summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/bus/cpc/mface2.cpp6
-rw-r--r--src/devices/bus/cpc/mface2.h2
-rw-r--r--src/devices/bus/iq151/minigraf.cpp2
-rw-r--r--src/devices/bus/iq151/minigraf.h2
-rw-r--r--src/devices/bus/iq151/ms151a.cpp2
-rw-r--r--src/devices/bus/iq151/ms151a.h2
-rw-r--r--src/devices/bus/isa/aga.cpp24
-rw-r--r--src/devices/bus/isa/aga.h2
-rw-r--r--src/devices/bus/isa/mda.cpp6
-rw-r--r--src/devices/bus/isa/mda.h2
-rw-r--r--src/devices/bus/isa/pgc.cpp10
-rw-r--r--src/devices/bus/isa/pgc.h6
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.cpp8
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.h2
-rw-r--r--src/devices/bus/nes/disksys.cpp4
-rw-r--r--src/devices/bus/nes/disksys.h2
-rw-r--r--src/devices/bus/snes/sdd1.cpp6
-rw-r--r--src/devices/bus/snes/sdd1.h2
-rw-r--r--src/devices/bus/snes/spc7110.cpp4
-rw-r--r--src/devices/bus/snes/spc7110.h2
-rw-r--r--src/devices/cpu/alto2/a2disp.cpp8
-rw-r--r--src/devices/cpu/alto2/a2disp.h4
-rw-r--r--src/devices/cpu/alto2/a2ether.cpp8
-rw-r--r--src/devices/cpu/alto2/a2ether.h4
-rw-r--r--src/devices/cpu/alto2/a2ram.cpp4
-rw-r--r--src/devices/cpu/alto2/alto2cpu.cpp10
-rw-r--r--src/devices/cpu/alto2/alto2cpu.h2
-rw-r--r--src/devices/cpu/i386/cycles.h1
-rw-r--r--src/devices/cpu/i386/i386.cpp43
-rw-r--r--src/devices/cpu/i386/i386.h5
-rw-r--r--src/devices/cpu/z180/z180.cpp8
-rw-r--r--src/devices/machine/akiko.cpp6
-rw-r--r--src/devices/machine/akiko.h2
-rw-r--r--src/devices/machine/diablo_hd.cpp17
-rw-r--r--src/devices/machine/diablo_hd.h2
-rw-r--r--src/devices/machine/s3c2400.h2
-rw-r--r--src/devices/machine/s3c2410.h2
-rw-r--r--src/devices/machine/s3c2440.h2
-rw-r--r--src/devices/machine/s3c24xx.inc4
-rw-r--r--src/devices/machine/s3c44b0.cpp14
-rw-r--r--src/devices/machine/s3c44b0.h2
-rw-r--r--src/devices/machine/smpc.cpp4
-rw-r--r--src/devices/machine/strata.cpp16
-rw-r--r--src/devices/machine/strata.h2
-rw-r--r--src/devices/sound/c140.cpp16
-rw-r--r--src/devices/sound/c140.h4
-rw-r--r--src/devices/sound/cdda.cpp6
-rw-r--r--src/devices/sound/cdda.h2
-rw-r--r--src/devices/sound/cem3394.cpp22
-rw-r--r--src/devices/sound/cem3394.h4
-rw-r--r--src/devices/sound/k005289.cpp14
-rw-r--r--src/devices/sound/k005289.h4
-rw-r--r--src/devices/sound/k051649.cpp12
-rw-r--r--src/devices/sound/k051649.h4
-rw-r--r--src/devices/sound/k054539.cpp12
-rw-r--r--src/devices/sound/k054539.h2
-rw-r--r--src/devices/sound/mos6560.cpp4
-rw-r--r--src/devices/sound/mos6560.h4
-rw-r--r--src/devices/sound/mos7360.cpp2
-rw-r--r--src/devices/sound/mos7360.h2
-rw-r--r--src/devices/sound/segapcm.cpp8
-rw-r--r--src/devices/sound/segapcm.h2
-rw-r--r--src/devices/sound/sid.cpp8
-rw-r--r--src/devices/sound/sidvoice.cpp4
-rw-r--r--src/devices/sound/sp0256.cpp6
-rw-r--r--src/devices/sound/sp0256.h2
-rw-r--r--src/devices/sound/ymf271.cpp20
-rw-r--r--src/devices/sound/ymf271.h6
-rw-r--r--src/devices/sound/ymf278b.cpp8
-rw-r--r--src/devices/sound/ymf278b.h2
-rw-r--r--src/devices/sound/ymz280b.cpp12
-rw-r--r--src/devices/sound/ymz280b.h2
-rw-r--r--src/devices/video/315_5313.cpp82
-rw-r--r--src/devices/video/315_5313.h32
-rw-r--r--src/devices/video/epic12.cpp8
-rw-r--r--src/devices/video/epic12.h4
-rw-r--r--src/devices/video/fixfreq.cpp10
-rw-r--r--src/devices/video/fixfreq.h2
-rw-r--r--src/devices/video/huc6260.cpp2
-rw-r--r--src/devices/video/huc6260.h2
-rw-r--r--src/devices/video/huc6261.cpp2
-rw-r--r--src/devices/video/huc6261.h2
-rw-r--r--src/devices/video/psx.cpp2
-rw-r--r--src/devices/video/psx.h2
-rw-r--r--src/devices/video/snes_ppu.cpp24
-rw-r--r--src/devices/video/snes_ppu.h6
-rw-r--r--src/devices/video/stvvdp1.cpp10
-rw-r--r--src/devices/video/stvvdp2.cpp34
-rw-r--r--src/devices/video/vic4567.cpp2
-rw-r--r--src/devices/video/vic4567.h2
-rw-r--r--src/emu/machine.h7
-rw-r--r--src/emu/ui/menu.cpp4
-rw-r--r--src/emu/ui/menu.h2
-rw-r--r--src/emu/ui/ui.cpp2
-rw-r--r--src/emu/ui/ui.h2
-rw-r--r--src/lib/util/coretmpl.h19
-rw-r--r--src/mame/audio/cclimber.cpp6
-rw-r--r--src/mame/audio/cclimber.h2
-rw-r--r--src/mame/audio/flower.cpp12
-rw-r--r--src/mame/audio/geebee.cpp2
-rw-r--r--src/mame/audio/gomoku.cpp14
-rw-r--r--src/mame/audio/hng64.cpp6
-rw-r--r--src/mame/audio/phoenix.cpp4
-rw-r--r--src/mame/audio/redbaron.cpp2
-rw-r--r--src/mame/audio/redbaron.h2
-rw-r--r--src/mame/audio/suna8.cpp2
-rw-r--r--src/mame/audio/warpwarp.cpp2
-rw-r--r--src/mame/audio/warpwarp.h4
-rw-r--r--src/mame/drivers/acommand.cpp4
-rw-r--r--src/mame/drivers/alg.cpp6
-rw-r--r--src/mame/drivers/alphasma.cpp4
-rw-r--r--src/mame/drivers/apexc.cpp4
-rw-r--r--src/mame/drivers/aristmk4.cpp6
-rw-r--r--src/mame/drivers/armedf.cpp2
-rw-r--r--src/mame/drivers/astinvad.cpp6
-rw-r--r--src/mame/drivers/astrof.cpp4
-rw-r--r--src/mame/drivers/atarig1.cpp6
-rw-r--r--src/mame/drivers/backfire.cpp28
-rw-r--r--src/mame/drivers/blitz68k.cpp6
-rw-r--r--src/mame/drivers/bmcpokr.cpp4
-rw-r--r--src/mame/drivers/bml3.cpp4
-rw-r--r--src/mame/drivers/calchase.cpp20
-rw-r--r--src/mame/drivers/cc40.cpp8
-rw-r--r--src/mame/drivers/cham24.cpp40
-rw-r--r--src/mame/drivers/chinsan.cpp10
-rw-r--r--src/mame/drivers/cobra.cpp60
-rw-r--r--src/mame/drivers/cocoloco.cpp6
-rw-r--r--src/mame/drivers/coolridr.cpp14
-rw-r--r--src/mame/drivers/cps2.cpp4
-rw-r--r--src/mame/drivers/cps3.cpp28
-rw-r--r--src/mame/drivers/cubeqst.cpp6
-rw-r--r--src/mame/drivers/dblcrown.cpp10
-rw-r--r--src/mame/drivers/ddenlovr.cpp52
-rw-r--r--src/mame/drivers/deco156.cpp8
-rw-r--r--src/mame/drivers/dgpix.cpp6
-rw-r--r--src/mame/drivers/dreamwld.cpp16
-rw-r--r--src/mame/drivers/dvk_kcgd.cpp4
-rw-r--r--src/mame/drivers/einstein.cpp4
-rw-r--r--src/mame/drivers/eolith16.cpp6
-rw-r--r--src/mame/drivers/esripsys.cpp14
-rw-r--r--src/mame/drivers/famibox.cpp12
-rw-r--r--src/mame/drivers/fm7.cpp6
-rw-r--r--src/mame/drivers/fmtowns.cpp16
-rw-r--r--src/mame/drivers/fromanc2.cpp6
-rw-r--r--src/mame/drivers/funkball.cpp6
-rw-r--r--src/mame/drivers/funworld.cpp6
-rw-r--r--src/mame/drivers/gamecstl.cpp8
-rw-r--r--src/mame/drivers/gottlieb.cpp4
-rw-r--r--src/mame/drivers/gp32.cpp4
-rw-r--r--src/mame/drivers/gridlee.cpp5
-rw-r--r--src/mame/drivers/gticlub.cpp10
-rw-r--r--src/mame/drivers/gunpey.cpp4
-rw-r--r--src/mame/drivers/halleys.cpp28
-rw-r--r--src/mame/drivers/hitpoker.cpp12
-rw-r--r--src/mame/drivers/hng64.cpp10
-rw-r--r--src/mame/drivers/igs011.cpp16
-rw-r--r--src/mame/drivers/jalmah.cpp24
-rw-r--r--src/mame/drivers/jchan.cpp36
-rw-r--r--src/mame/drivers/jtc.cpp18
-rw-r--r--src/mame/drivers/laser3k.cpp8
-rw-r--r--src/mame/drivers/m58.cpp4
-rw-r--r--src/mame/drivers/m63.cpp8
-rw-r--r--src/mame/drivers/m72.cpp18
-rw-r--r--src/mame/drivers/macs.cpp12
-rw-r--r--src/mame/drivers/marinedt.cpp12
-rw-r--r--src/mame/drivers/maygayv1.cpp14
-rw-r--r--src/mame/drivers/mediagx.cpp12
-rw-r--r--src/mame/drivers/megaplay.cpp8
-rw-r--r--src/mame/drivers/megatech.cpp8
-rw-r--r--src/mame/drivers/merit.cpp6
-rw-r--r--src/mame/drivers/meritm.cpp12
-rw-r--r--src/mame/drivers/midqslvr.cpp56
-rw-r--r--src/mame/drivers/mjsister.cpp8
-rw-r--r--src/mame/drivers/mlanding.cpp8
-rw-r--r--src/mame/drivers/model3.cpp4
-rw-r--r--src/mame/drivers/monzagp.cpp14
-rw-r--r--src/mame/drivers/mrgame.cpp4
-rw-r--r--src/mame/drivers/ms32.cpp2
-rw-r--r--src/mame/drivers/multigam.cpp78
-rw-r--r--src/mame/drivers/namcofl.cpp12
-rw-r--r--src/mame/drivers/namcoic.cpp4
-rw-r--r--src/mame/drivers/namcos21.cpp10
-rw-r--r--src/mame/drivers/nes.cpp6
-rw-r--r--src/mame/drivers/nwk-tr.cpp8
-rw-r--r--src/mame/drivers/panicr.cpp8
-rw-r--r--src/mame/drivers/pasopia7.cpp4
-rw-r--r--src/mame/drivers/pc9801.cpp6
-rw-r--r--src/mame/drivers/peplus.cpp12
-rw-r--r--src/mame/drivers/pgm.cpp2
-rw-r--r--src/mame/drivers/pipeline.cpp6
-rw-r--r--src/mame/drivers/progolf.cpp6
-rw-r--r--src/mame/drivers/psion.cpp10
-rw-r--r--src/mame/drivers/px4.cpp6
-rw-r--r--src/mame/drivers/queen.cpp16
-rw-r--r--src/mame/drivers/quizo.cpp6
-rw-r--r--src/mame/drivers/rabbit.cpp4
-rw-r--r--src/mame/drivers/rastersp.cpp10
-rw-r--r--src/mame/drivers/rollext.cpp4
-rw-r--r--src/mame/drivers/rungun.cpp3
-rw-r--r--src/mame/drivers/safarir.cpp12
-rw-r--r--src/mame/drivers/sangho.cpp20
-rw-r--r--src/mame/drivers/saturn.cpp15
-rw-r--r--src/mame/drivers/savquest.cpp44
-rw-r--r--src/mame/drivers/sbowling.cpp6
-rw-r--r--src/mame/drivers/segac2.cpp2
-rw-r--r--src/mame/drivers/segas32.cpp10
-rw-r--r--src/mame/drivers/sfbonus.cpp52
-rw-r--r--src/mame/drivers/sfkick.cpp8
-rw-r--r--src/mame/drivers/sigmab98.cpp4
-rw-r--r--src/mame/drivers/skimaxx.cpp12
-rw-r--r--src/mame/drivers/slotcarn.cpp6
-rw-r--r--src/mame/drivers/snesb.cpp10
-rw-r--r--src/mame/drivers/speglsht.cpp4
-rw-r--r--src/mame/drivers/spool99.cpp2
-rw-r--r--src/mame/drivers/srmp5.cpp16
-rw-r--r--src/mame/drivers/stratos.cpp8
-rw-r--r--src/mame/drivers/stv.cpp11
-rw-r--r--src/mame/drivers/subsino.cpp48
-rw-r--r--src/mame/drivers/subsino2.cpp30
-rw-r--r--src/mame/drivers/superqix.cpp4
-rw-r--r--src/mame/drivers/supertnk.cpp8
-rw-r--r--src/mame/drivers/suprgolf.cpp24
-rw-r--r--src/mame/drivers/system1.cpp16
-rw-r--r--src/mame/drivers/taitojc.cpp4
-rw-r--r--src/mame/drivers/taitotz.cpp18
-rw-r--r--src/mame/drivers/taitowlf.cpp8
-rw-r--r--src/mame/drivers/tnzs.cpp6
-rw-r--r--src/mame/drivers/ttchamp.cpp6
-rw-r--r--src/mame/drivers/turrett.cpp8
-rw-r--r--src/mame/drivers/ultrsprt.cpp10
-rw-r--r--src/mame/drivers/vamphalf.cpp12
-rw-r--r--src/mame/drivers/vboy.cpp6
-rw-r--r--src/mame/drivers/vcombat.cpp32
-rw-r--r--src/mame/drivers/vegaeo.cpp6
-rw-r--r--src/mame/drivers/voyager.cpp8
-rw-r--r--src/mame/drivers/vpoker.cpp8
-rw-r--r--src/mame/drivers/wheelfir.cpp18
-rw-r--r--src/mame/drivers/wyvernf0.cpp8
-rw-r--r--src/mame/drivers/xtom3d.cpp56
-rw-r--r--src/mame/drivers/zn.cpp6
-rw-r--r--src/mame/drivers/zr107.cpp4
-rw-r--r--src/mame/includes/3do.h6
-rw-r--r--src/mame/includes/40love.h4
-rw-r--r--src/mame/includes/amstrad.h2
-rw-r--r--src/mame/includes/apollo.h2
-rw-r--r--src/mame/includes/apple2.h6
-rw-r--r--src/mame/includes/apple2gs.h2
-rw-r--r--src/mame/includes/apple3.h2
-rw-r--r--src/mame/includes/arabian.h4
-rw-r--r--src/mame/includes/arcadia.h2
-rw-r--r--src/mame/includes/argus.h4
-rw-r--r--src/mame/includes/armedf.h2
-rw-r--r--src/mame/includes/astrocde.h4
-rw-r--r--src/mame/includes/astrof.h2
-rw-r--r--src/mame/includes/atarig1.h2
-rw-r--r--src/mame/includes/bigevglf.h2
-rw-r--r--src/mame/includes/blktiger.h2
-rw-r--r--src/mame/includes/btime.h2
-rw-r--r--src/mame/includes/carpolo.h10
-rw-r--r--src/mame/includes/cave.h2
-rw-r--r--src/mame/includes/cbasebal.h4
-rw-r--r--src/mame/includes/changela.h4
-rw-r--r--src/mame/includes/cheekyms.h2
-rw-r--r--src/mame/includes/cloak.h6
-rw-r--r--src/mame/includes/cloud9.h2
-rw-r--r--src/mame/includes/contra.h4
-rw-r--r--src/mame/includes/cps1.h2
-rw-r--r--src/mame/includes/cps3.h8
-rw-r--r--src/mame/includes/crgolf.h4
-rw-r--r--src/mame/includes/dcheese.h2
-rw-r--r--src/mame/includes/deco32.h4
-rw-r--r--src/mame/includes/deco_mlc.h6
-rw-r--r--src/mame/includes/dogfgt.h2
-rw-r--r--src/mame/includes/drmicro.h2
-rw-r--r--src/mame/includes/dynax.h2
-rw-r--r--src/mame/includes/einstein.h2
-rw-r--r--src/mame/includes/eolith.h2
-rw-r--r--src/mame/includes/equites.h2
-rw-r--r--src/mame/includes/esripsys.h16
-rw-r--r--src/mame/includes/exerion.h2
-rw-r--r--src/mame/includes/exidy440.h4
-rw-r--r--src/mame/includes/flower.h4
-rw-r--r--src/mame/includes/fm7.h2
-rw-r--r--src/mame/includes/fmtowns.h8
-rw-r--r--src/mame/includes/fromanc2.h4
-rw-r--r--src/mame/includes/fromance.h4
-rw-r--r--src/mame/includes/gaelco3d.h6
-rw-r--r--src/mame/includes/galaxian.h2
-rw-r--r--src/mame/includes/galaxold.h4
-rw-r--r--src/mame/includes/gameplan.h2
-rw-r--r--src/mame/includes/glass.h2
-rw-r--r--src/mame/includes/goal92.h2
-rw-r--r--src/mame/includes/gomoku.h4
-rw-r--r--src/mame/includes/gottlieb.h2
-rw-r--r--src/mame/includes/gp32.h2
-rw-r--r--src/mame/includes/gridlee.h2
-rw-r--r--src/mame/includes/hng64.h16
-rw-r--r--src/mame/includes/hyprduel.h8
-rw-r--r--src/mame/includes/irobot.h4
-rw-r--r--src/mame/includes/itech32.h2
-rw-r--r--src/mame/includes/kangaroo.h2
-rw-r--r--src/mame/includes/karnov.h2
-rw-r--r--src/mame/includes/konamigx.h13
-rw-r--r--src/mame/includes/ladyfrog.h2
-rw-r--r--src/mame/includes/legionna.h2
-rw-r--r--src/mame/includes/leland.h2
-rw-r--r--src/mame/includes/lethalj.h2
-rw-r--r--src/mame/includes/liberate.h2
-rw-r--r--src/mame/includes/lisa.h2
-rw-r--r--src/mame/includes/lockon.h6
-rw-r--r--src/mame/includes/lordgun.h2
-rw-r--r--src/mame/includes/m72.h4
-rw-r--r--src/mame/includes/madalien.h2
-rw-r--r--src/mame/includes/magmax.h2
-rw-r--r--src/mame/includes/matmania.h4
-rw-r--r--src/mame/includes/mcatadv.h2
-rw-r--r--src/mame/includes/megadriv.h2
-rw-r--r--src/mame/includes/megasys1.h8
-rw-r--r--src/mame/includes/megazone.h2
-rw-r--r--src/mame/includes/metlclsh.h2
-rw-r--r--src/mame/includes/metro.h2
-rw-r--r--src/mame/includes/micro3d.h4
-rw-r--r--src/mame/includes/microtan.h2
-rw-r--r--src/mame/includes/midyunit.h2
-rw-r--r--src/mame/includes/model1.h2
-rw-r--r--src/mame/includes/model3.h4
-rw-r--r--src/mame/includes/ms32.h2
-rw-r--r--src/mame/includes/munchmo.h2
-rw-r--r--src/mame/includes/mz700.h4
-rw-r--r--src/mame/includes/namcofl.h2
-rw-r--r--src/mame/includes/namcos2.h2
-rw-r--r--src/mame/includes/namcos21.h14
-rw-r--r--src/mame/includes/namcos22.h8
-rw-r--r--src/mame/includes/nbmj8688.h4
-rw-r--r--src/mame/includes/nbmj8891.h8
-rw-r--r--src/mame/includes/nbmj8900.h8
-rw-r--r--src/mame/includes/nbmj8991.h4
-rw-r--r--src/mame/includes/nbmj9195.h2
-rw-r--r--src/mame/includes/nes.h2
-rw-r--r--src/mame/includes/niyanpai.h4
-rw-r--r--src/mame/includes/nmk16.h2
-rw-r--r--src/mame/includes/pacland.h2
-rw-r--r--src/mame/includes/pcw.h2
-rw-r--r--src/mame/includes/pecom.h2
-rw-r--r--src/mame/includes/pgm.h4
-rw-r--r--src/mame/includes/phoenix.h4
-rw-r--r--src/mame/includes/pitnrun.h2
-rw-r--r--src/mame/includes/playch10.h4
-rw-r--r--src/mame/includes/poisk1.h2
-rw-r--r--src/mame/includes/policetr.h2
-rw-r--r--src/mame/includes/popeye.h4
-rw-r--r--src/mame/includes/psikyo.h4
-rw-r--r--src/mame/includes/psikyosh.h2
-rw-r--r--src/mame/includes/psion.h2
-rw-r--r--src/mame/includes/quasar.h2
-rw-r--r--src/mame/includes/quizdna.h4
-rw-r--r--src/mame/includes/radio86.h2
-rw-r--r--src/mame/includes/rbisland.h2
-rw-r--r--src/mame/includes/realbrk.h4
-rw-r--r--src/mame/includes/redalert.h2
-rw-r--r--src/mame/includes/rltennis.h2
-rw-r--r--src/mame/includes/rungun.h6
-rw-r--r--src/mame/includes/scramble.h4
-rw-r--r--src/mame/includes/segas32.h8
-rw-r--r--src/mame/includes/seta2.h2
-rw-r--r--src/mame/includes/shadfrce.h2
-rw-r--r--src/mame/includes/slapshot.h4
-rw-r--r--src/mame/includes/sms.h2
-rw-r--r--src/mame/includes/spacefb.h2
-rw-r--r--src/mame/includes/special.h2
-rw-r--r--src/mame/includes/ssrj.h2
-rw-r--r--src/mame/includes/ssv.h2
-rw-r--r--src/mame/includes/ssystem3.h2
-rw-r--r--src/mame/includes/starcrus.h8
-rw-r--r--src/mame/includes/starshp1.h2
-rw-r--r--src/mame/includes/starwars.h6
-rw-r--r--src/mame/includes/stv.h12
-rw-r--r--src/mame/includes/suna16.h2
-rw-r--r--src/mame/includes/suna8.h2
-rw-r--r--src/mame/includes/superqix.h4
-rw-r--r--src/mame/includes/svi318.h2
-rw-r--r--src/mame/includes/system1.h2
-rw-r--r--src/mame/includes/taito_b.h6
-rw-r--r--src/mame/includes/taito_f3.h6
-rw-r--r--src/mame/includes/taitoair.h2
-rw-r--r--src/mame/includes/taitojc.h4
-rw-r--r--src/mame/includes/taotaido.h8
-rw-r--r--src/mame/includes/tatsumi.h4
-rw-r--r--src/mame/includes/tetrisp2.h2
-rw-r--r--src/mame/includes/thief.h4
-rw-r--r--src/mame/includes/thoop2.h2
-rw-r--r--src/mame/includes/ti85.h2
-rw-r--r--src/mame/includes/tnzs.h2
-rw-r--r--src/mame/includes/tryout.h4
-rw-r--r--src/mame/includes/tubep.h2
-rw-r--r--src/mame/includes/turbo.h2
-rw-r--r--src/mame/includes/turrett.h2
-rw-r--r--src/mame/includes/tx1.h8
-rw-r--r--src/mame/includes/vc4000.h2
-rw-r--r--src/mame/includes/victory.h10
-rw-r--r--src/mame/includes/vigilant.h2
-rw-r--r--src/mame/includes/volfied.h2
-rw-r--r--src/mame/includes/vsnes.h4
-rw-r--r--src/mame/includes/williams.h2
-rw-r--r--src/mame/includes/wolfpack.h2
-rw-r--r--src/mame/includes/wswan.h2
-rw-r--r--src/mame/includes/x68k.h4
-rw-r--r--src/mame/includes/xmen.h4
-rw-r--r--src/mame/includes/zx.h3
-rw-r--r--src/mame/machine/315-5881_crypt.cpp31
-rw-r--r--src/mame/machine/315-5881_crypt.h4
-rw-r--r--src/mame/machine/3do.cpp18
-rw-r--r--src/mame/machine/aim65.cpp2
-rw-r--r--src/mame/machine/amstrad.cpp2
-rw-r--r--src/mame/machine/apple2.cpp4
-rw-r--r--src/mame/machine/atarifdc.cpp6
-rw-r--r--src/mame/machine/atarifdc.h2
-rw-r--r--src/mame/machine/cdicdic.cpp10
-rw-r--r--src/mame/machine/cdicdic.h2
-rw-r--r--src/mame/machine/docg3.cpp42
-rw-r--r--src/mame/machine/docg3.h2
-rw-r--r--src/mame/machine/fddebug.cpp4
-rw-r--r--src/mame/machine/k573dio.cpp4
-rw-r--r--src/mame/machine/k573dio.h2
-rw-r--r--src/mame/machine/konppc.cpp14
-rw-r--r--src/mame/machine/konppc.h6
-rw-r--r--src/mame/machine/leland.cpp4
-rw-r--r--src/mame/machine/lisa.cpp8
-rw-r--r--src/mame/machine/mega32x.cpp28
-rw-r--r--src/mame/machine/mega32x.h8
-rw-r--r--src/mame/machine/megadriv.cpp8
-rw-r--r--src/mame/machine/microdrv.cpp12
-rw-r--r--src/mame/machine/microdrv.h4
-rw-r--r--src/mame/machine/model1.cpp14
-rw-r--r--src/mame/machine/mz700.cpp26
-rw-r--r--src/mame/machine/namcos2.cpp4
-rw-r--r--src/mame/machine/naomim1.cpp8
-rw-r--r--src/mame/machine/naomim1.h2
-rw-r--r--src/mame/machine/naomim2.cpp6
-rw-r--r--src/mame/machine/naomim2.h2
-rw-r--r--src/mame/machine/naomim4.cpp10
-rw-r--r--src/mame/machine/naomim4.h4
-rw-r--r--src/mame/machine/nes.cpp6
-rw-r--r--src/mame/machine/pce_cd.cpp14
-rw-r--r--src/mame/machine/pce_cd.h4
-rw-r--r--src/mame/machine/pgmprot_igs027a_type3.cpp16
-rw-r--r--src/mame/machine/playch10.cpp46
-rw-r--r--src/mame/machine/radio86.cpp4
-rw-r--r--src/mame/machine/rbisland.cpp18
-rw-r--r--src/mame/machine/scramble.cpp17
-rw-r--r--src/mame/machine/sms.cpp16
-rw-r--r--src/mame/machine/starwars.cpp6
-rw-r--r--src/mame/machine/svi318.cpp20
-rw-r--r--src/mame/machine/ti85.cpp14
-rw-r--r--src/mame/machine/vsnes.cpp62
-rw-r--r--src/mame/machine/wswan.cpp4
-rw-r--r--src/mame/video/40love.cpp4
-rw-r--r--src/mame/video/733_asr.cpp2
-rw-r--r--src/mame/video/733_asr.h2
-rw-r--r--src/mame/video/antic.cpp8
-rw-r--r--src/mame/video/antic.h4
-rw-r--r--src/mame/video/apollo.cpp10
-rw-r--r--src/mame/video/apple2.cpp10
-rw-r--r--src/mame/video/apple2.h4
-rw-r--r--src/mame/video/apple2gs.cpp2
-rw-r--r--src/mame/video/apple3.cpp2
-rw-r--r--src/mame/video/arabian.cpp8
-rw-r--r--src/mame/video/arcadia.cpp2
-rw-r--r--src/mame/video/argus.cpp18
-rw-r--r--src/mame/video/armedf.cpp12
-rw-r--r--src/mame/video/astrocde.cpp6
-rw-r--r--src/mame/video/bigevglf.cpp4
-rw-r--r--src/mame/video/blktiger.cpp4
-rw-r--r--src/mame/video/btime.cpp2
-rw-r--r--src/mame/video/carpolo.cpp10
-rw-r--r--src/mame/video/cave.cpp2
-rw-r--r--src/mame/video/cbasebal.cpp8
-rw-r--r--src/mame/video/changela.cpp18
-rw-r--r--src/mame/video/cheekyms.cpp2
-rw-r--r--src/mame/video/cloak.cpp18
-rw-r--r--src/mame/video/cloud9.cpp6
-rw-r--r--src/mame/video/contra.cpp20
-rw-r--r--src/mame/video/crgolf.cpp8
-rw-r--r--src/mame/video/crt.cpp2
-rw-r--r--src/mame/video/crt.h2
-rw-r--r--src/mame/video/dcheese.cpp2
-rw-r--r--src/mame/video/deco32.cpp24
-rw-r--r--src/mame/video/deco_mlc.cpp18
-rw-r--r--src/mame/video/dogfgt.cpp4
-rw-r--r--src/mame/video/drmicro.cpp4
-rw-r--r--src/mame/video/dynax.cpp174
-rw-r--r--src/mame/video/eolith.cpp4
-rw-r--r--src/mame/video/equites.cpp8
-rw-r--r--src/mame/video/esripsys.cpp40
-rw-r--r--src/mame/video/exerion.cpp15
-rw-r--r--src/mame/video/exidy440.cpp8
-rw-r--r--src/mame/video/fmtowns.cpp4
-rw-r--r--src/mame/video/fromanc2.cpp46
-rw-r--r--src/mame/video/fromance.cpp12
-rw-r--r--src/mame/video/fuukifg3.cpp4
-rw-r--r--src/mame/video/gaelco3d.cpp12
-rw-r--r--src/mame/video/galaxian.cpp2
-rw-r--r--src/mame/video/galaxold.cpp6
-rw-r--r--src/mame/video/gameplan.cpp6
-rw-r--r--src/mame/video/glass.cpp2
-rw-r--r--src/mame/video/goal92.cpp8
-rw-r--r--src/mame/video/hng64.cpp2
-rw-r--r--src/mame/video/hng64_3d.cpp2
-rw-r--r--src/mame/video/hyprduel.cpp26
-rw-r--r--src/mame/video/igs017_igs031.cpp4
-rw-r--r--src/mame/video/igs017_igs031.h2
-rw-r--r--src/mame/video/irobot.cpp16
-rw-r--r--src/mame/video/itech32.cpp4
-rw-r--r--src/mame/video/k001005.cpp36
-rw-r--r--src/mame/video/k001005.h12
-rw-r--r--src/mame/video/k001006.cpp6
-rw-r--r--src/mame/video/k001006.h2
-rw-r--r--src/mame/video/k053246_k053247_k055673.cpp17
-rw-r--r--src/mame/video/k053246_k053247_k055673.h2
-rw-r--r--src/mame/video/k057714.cpp12
-rw-r--r--src/mame/video/k057714.h2
-rw-r--r--src/mame/video/k1ge.cpp2
-rw-r--r--src/mame/video/k1ge.h2
-rw-r--r--src/mame/video/kan_pand.cpp8
-rw-r--r--src/mame/video/kan_pand.h4
-rw-r--r--src/mame/video/kangaroo.cpp4
-rw-r--r--src/mame/video/karnov.cpp4
-rw-r--r--src/mame/video/konamigx.cpp34
-rw-r--r--src/mame/video/ladyfrog.cpp4
-rw-r--r--src/mame/video/legionna.cpp6
-rw-r--r--src/mame/video/lethalj.cpp4
-rw-r--r--src/mame/video/liberate.cpp4
-rw-r--r--src/mame/video/lockon.cpp12
-rw-r--r--src/mame/video/lordgun.cpp2
-rw-r--r--src/mame/video/m58.cpp2
-rw-r--r--src/mame/video/m72.cpp18
-rw-r--r--src/mame/video/madalien.cpp2
-rw-r--r--src/mame/video/magmax.cpp2
-rw-r--r--src/mame/video/matmania.cpp4
-rw-r--r--src/mame/video/mcatadv.cpp6
-rw-r--r--src/mame/video/mcr68.cpp18
-rw-r--r--src/mame/video/megasys1.cpp20
-rw-r--r--src/mame/video/megazone.cpp2
-rw-r--r--src/mame/video/metlclsh.cpp6
-rw-r--r--src/mame/video/metro.cpp4
-rw-r--r--src/mame/video/micro3d.cpp10
-rw-r--r--src/mame/video/microtan.cpp4
-rw-r--r--src/mame/video/midtunit.cpp6
-rw-r--r--src/mame/video/midyunit.cpp6
-rw-r--r--src/mame/video/model3.cpp12
-rw-r--r--src/mame/video/munchmo.cpp2
-rw-r--r--src/mame/video/n64.cpp2
-rw-r--r--src/mame/video/n64.h10
-rw-r--r--src/mame/video/namcos21.cpp34
-rw-r--r--src/mame/video/namcos22.cpp16
-rw-r--r--src/mame/video/nbmj8688.cpp6
-rw-r--r--src/mame/video/nbmj8891.cpp30
-rw-r--r--src/mame/video/nbmj8900.cpp22
-rw-r--r--src/mame/video/nbmj8991.cpp10
-rw-r--r--src/mame/video/nbmj9195.cpp12
-rw-r--r--src/mame/video/niyanpai.cpp16
-rw-r--r--src/mame/video/nmk16.cpp2
-rw-r--r--src/mame/video/ojankohs.cpp10
-rw-r--r--src/mame/video/pacland.cpp6
-rw-r--r--src/mame/video/pcw.cpp2
-rw-r--r--src/mame/video/pecom.cpp4
-rw-r--r--src/mame/video/pgm.cpp4
-rw-r--r--src/mame/video/phoenix.cpp16
-rw-r--r--src/mame/video/pitnrun.cpp8
-rw-r--r--src/mame/video/poisk1.cpp7
-rw-r--r--src/mame/video/policetr.cpp2
-rw-r--r--src/mame/video/popeye.cpp12
-rw-r--r--src/mame/video/powervr2.cpp2
-rw-r--r--src/mame/video/powervr2.h2
-rw-r--r--src/mame/video/ppu2c0x.cpp2
-rw-r--r--src/mame/video/ppu2c0x.h2
-rw-r--r--src/mame/video/psikyo.cpp16
-rw-r--r--src/mame/video/psikyosh.cpp4
-rw-r--r--src/mame/video/quasar.cpp4
-rw-r--r--src/mame/video/quizdna.cpp8
-rw-r--r--src/mame/video/realbrk.cpp4
-rw-r--r--src/mame/video/redalert.cpp4
-rw-r--r--src/mame/video/rltennis.cpp8
-rw-r--r--src/mame/video/rungun.cpp6
-rw-r--r--src/mame/video/sega16sp.cpp2
-rw-r--r--src/mame/video/segaic16.cpp6
-rw-r--r--src/mame/video/segaic16.h2
-rw-r--r--src/mame/video/segaic16_road.cpp22
-rw-r--r--src/mame/video/segaic16_road.h4
-rw-r--r--src/mame/video/segaic24.cpp32
-rw-r--r--src/mame/video/segaic24.h5
-rw-r--r--src/mame/video/segas32.cpp16
-rw-r--r--src/mame/video/seta2.cpp6
-rw-r--r--src/mame/video/shadfrce.cpp6
-rw-r--r--src/mame/video/slapshot.cpp10
-rw-r--r--src/mame/video/spacefb.cpp6
-rw-r--r--src/mame/video/special.cpp2
-rw-r--r--src/mame/video/ssrj.cpp4
-rw-r--r--src/mame/video/ssv.cpp8
-rw-r--r--src/mame/video/ssystem3.cpp2
-rw-r--r--src/mame/video/starcrus.cpp8
-rw-r--r--src/mame/video/starshp1.cpp6
-rw-r--r--src/mame/video/suna16.cpp2
-rw-r--r--src/mame/video/superqix.cpp4
-rw-r--r--src/mame/video/taito_b.cpp8
-rw-r--r--src/mame/video/taito_f3.cpp12
-rw-r--r--src/mame/video/taitoair.cpp6
-rw-r--r--src/mame/video/taitojc.cpp4
-rw-r--r--src/mame/video/taotaido.cpp18
-rw-r--r--src/mame/video/tatsumi.cpp6
-rw-r--r--src/mame/video/tetrisp2.cpp24
-rw-r--r--src/mame/video/thief.cpp4
-rw-r--r--src/mame/video/thoop2.cpp2
-rw-r--r--src/mame/video/tia.cpp6
-rw-r--r--src/mame/video/tia.h2
-rw-r--r--src/mame/video/tryout.cpp10
-rw-r--r--src/mame/video/tubep.cpp6
-rw-r--r--src/mame/video/turbo.cpp4
-rw-r--r--src/mame/video/turrett.cpp2
-rw-r--r--src/mame/video/tx1.cpp58
-rw-r--r--src/mame/video/vc4000.cpp2
-rw-r--r--src/mame/video/victory.cpp16
-rw-r--r--src/mame/video/vigilant.cpp2
-rw-r--r--src/mame/video/volfied.cpp6
-rw-r--r--src/mame/video/williams.cpp6
-rw-r--r--src/mame/video/wolfpack.cpp2
-rw-r--r--src/mame/video/x68k.cpp4
-rw-r--r--src/mame/video/xmen.cpp8
-rw-r--r--src/mame/video/zx.cpp4
629 files changed, 2626 insertions, 2606 deletions
diff --git a/src/devices/bus/cpc/mface2.cpp b/src/devices/bus/cpc/mface2.cpp
index 3bb01352876..bb4354041bc 100644
--- a/src/devices/bus/cpc/mface2.cpp
+++ b/src/devices/bus/cpc/mface2.cpp
@@ -107,9 +107,9 @@ void cpc_multiface2_device::multiface_rethink_memory()
{
/* set bank addressess */
machine().root_device().membank("bank1")->set_base(multiface_rom);
- machine().root_device().membank("bank2")->set_base(m_multiface_ram);
+ machine().root_device().membank("bank2")->set_base(m_multiface_ram.get());
machine().root_device().membank("bank9")->set_base(multiface_rom);
- machine().root_device().membank("bank10")->set_base(m_multiface_ram);
+ machine().root_device().membank("bank10")->set_base(m_multiface_ram.get());
}
}
@@ -326,7 +326,7 @@ void cpc_multiface2_device::device_start()
m_multiface_flags = MULTIFACE_VISIBLE;
/* allocate ram */
- m_multiface_ram = auto_alloc_array(machine(), UINT8, 8192);
+ m_multiface_ram = std::make_unique<UINT8[]>(8192);
}
//-------------------------------------------------
diff --git a/src/devices/bus/cpc/mface2.h b/src/devices/bus/cpc/mface2.h
index c54e38ec889..c64872af18b 100644
--- a/src/devices/bus/cpc/mface2.h
+++ b/src/devices/bus/cpc/mface2.h
@@ -59,7 +59,7 @@ private:
DIRECT_UPDATE_MEMBER( amstrad_default );
DIRECT_UPDATE_MEMBER( amstrad_multiface_directoverride );
- unsigned char *m_multiface_ram;
+ std::unique_ptr<UINT8[]> m_multiface_ram;
unsigned long m_multiface_flags;
UINT8 m_romdis;
diff --git a/src/devices/bus/iq151/minigraf.cpp b/src/devices/bus/iq151/minigraf.cpp
index ca4ffdcc463..1a8e9d182a0 100644
--- a/src/devices/bus/iq151/minigraf.cpp
+++ b/src/devices/bus/iq151/minigraf.cpp
@@ -62,7 +62,7 @@ void iq151_minigraf_device::device_start()
m_rom = (UINT8*)memregion("minigraf")->base();
// allocate a bitmap for represent the paper
- m_paper = auto_bitmap_ind16_alloc(machine(), PAPER_WIDTH, PAPER_HEIGHT);
+ m_paper = std::make_unique<bitmap_ind16>(PAPER_WIDTH, PAPER_HEIGHT);
m_paper->fill(0);
m_pen = 0;
diff --git a/src/devices/bus/iq151/minigraf.h b/src/devices/bus/iq151/minigraf.h
index 311d79e97f1..6632fa31aa4 100644
--- a/src/devices/bus/iq151/minigraf.h
+++ b/src/devices/bus/iq151/minigraf.h
@@ -46,7 +46,7 @@ private:
UINT8 m_pen;
UINT8 m_control;
- bitmap_ind16 * m_paper;
+ std::unique_ptr<bitmap_ind16> m_paper;
};
diff --git a/src/devices/bus/iq151/ms151a.cpp b/src/devices/bus/iq151/ms151a.cpp
index 1a4ee73d586..99da92c6d61 100644
--- a/src/devices/bus/iq151/ms151a.cpp
+++ b/src/devices/bus/iq151/ms151a.cpp
@@ -61,7 +61,7 @@ void iq151_ms151a_device::device_start()
m_rom = (UINT8*)memregion("ms151a")->base();
// allocate a bitmap for represent the paper
- m_paper = auto_bitmap_ind16_alloc(machine(), PAPER_WIDTH, PAPER_HEIGHT);
+ m_paper = std::make_unique<bitmap_ind16>(PAPER_WIDTH, PAPER_HEIGHT);
m_paper->fill(0);
m_pen = 0;
diff --git a/src/devices/bus/iq151/ms151a.h b/src/devices/bus/iq151/ms151a.h
index 528ce9a9554..1d794e1081d 100644
--- a/src/devices/bus/iq151/ms151a.h
+++ b/src/devices/bus/iq151/ms151a.h
@@ -46,7 +46,7 @@ private:
INT32 m_posy;
UINT8 m_pen;
- bitmap_ind16 * m_paper;
+ std::unique_ptr<bitmap_ind16> m_paper;
};
diff --git a/src/devices/bus/isa/aga.cpp b/src/devices/bus/isa/aga.cpp
index 8149486ae7e..1e798680b58 100644
--- a/src/devices/bus/isa/aga.cpp
+++ b/src/devices/bus/isa/aga.cpp
@@ -107,7 +107,7 @@ void isa8_aga_device::device_start()
m_mode = AGA_COLOR;
m_mda_chr_gen = memregion("gfx1")->base() + 0x1000;
m_cga_chr_gen = memregion("gfx1")->base();
- m_videoram = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_videoram = std::make_unique<UINT8[]>(0x10000);
set_isa_device();
m_isa->install_memory(0xb0000, 0xbffff, 0, 0, read8_delegate(FUNC(isa8_aga_device::pc_aga_videoram_r),this), write8_delegate(FUNC(isa8_aga_device::pc_aga_videoram_w),this));
@@ -194,7 +194,7 @@ void isa8_aga_pc200_device::device_start()
m_mode = AGA_COLOR;
m_mda_chr_gen = memregion("gfx1")->base();
m_cga_chr_gen = memregion("gfx1")->base() + 0x1000;
- m_videoram = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_videoram = std::make_unique<UINT8[]>(0x10000);
set_isa_device();
m_isa->install_memory(0xb0000, 0xbffff, 0, 0, read8_delegate(FUNC(isa8_aga_pc200_device::pc200_videoram_r),this), write8_delegate(FUNC(isa8_aga_pc200_device::pc200_videoram_w),this));
@@ -315,7 +315,7 @@ machine_config_constructor isa8_aga_device::device_mconfig_additions() const
MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
int i;
@@ -375,7 +375,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row )
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
@@ -437,7 +437,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row )
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -469,7 +469,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -499,7 +499,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -533,7 +533,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -569,7 +569,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -594,7 +594,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row )
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -628,7 +628,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row )
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
int i;
@@ -654,7 +654,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row )
MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row )
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
const rgb_t *palette = m_palette->palette()->entry_list_raw();
UINT32 *p = &bitmap.pix32(y);
UINT8 fg = m_cga_color_select & 0x0F;
diff --git a/src/devices/bus/isa/aga.h b/src/devices/bus/isa/aga.h
index 5ed2e560287..c0c80ac29bb 100644
--- a/src/devices/bus/isa/aga.h
+++ b/src/devices/bus/isa/aga.h
@@ -93,7 +93,7 @@ public:
UINT8 m_cga_palette_lut_2bpp[4];
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
};
// device type definition
diff --git a/src/devices/bus/isa/mda.cpp b/src/devices/bus/isa/mda.cpp
index 713891a5186..c8456886f02 100644
--- a/src/devices/bus/isa/mda.cpp
+++ b/src/devices/bus/isa/mda.cpp
@@ -799,15 +799,15 @@ void isa8_ec1840_0002_device::device_start()
{
isa8_mda_device::device_start();
- m_soft_chr_gen = auto_alloc_array(machine(), UINT8, 0x2000);
- m_isa->install_bank(0xdc000, 0xddfff, 0, 0x2000, "bank_chargen", m_soft_chr_gen);
+ m_soft_chr_gen = std::make_unique<UINT8[]>(0x2000);
+ m_isa->install_bank(0xdc000, 0xddfff, 0, 0x2000, "bank_chargen", m_soft_chr_gen.get());
}
void isa8_ec1840_0002_device::device_reset()
{
isa8_mda_device::device_reset();
- m_chr_gen = m_soft_chr_gen;
+ m_chr_gen = m_soft_chr_gen.get();
}
diff --git a/src/devices/bus/isa/mda.h b/src/devices/bus/isa/mda.h
index cba94767b40..c6cf72b29ad 100644
--- a/src/devices/bus/isa/mda.h
+++ b/src/devices/bus/isa/mda.h
@@ -120,7 +120,7 @@ protected:
virtual void device_reset() override;
public:
- UINT8 *m_soft_chr_gen;
+ std::unique_ptr<UINT8[]> m_soft_chr_gen;
};
diff --git a/src/devices/bus/isa/pgc.cpp b/src/devices/bus/isa/pgc.cpp
index f551a0fc2ec..c22631d405b 100644
--- a/src/devices/bus/isa/pgc.cpp
+++ b/src/devices/bus/isa/pgc.cpp
@@ -237,14 +237,14 @@ void isa8_pgc_device::device_start()
m_palette->set_pen_color( i, 0, 0, 0 );
}
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_bitmap = std::make_unique<bitmap_ind16>(width, height);
m_bitmap->fill(0);
- m_vram = auto_alloc_array(machine(), UINT8, 0x78000);
+ m_vram = std::make_unique<UINT8[]>(0x78000);
space.install_readwrite_bank(0x80000, 0xf7fff, "vram");
- membank("vram")->set_base(m_vram);
+ membank("vram")->set_base(m_vram.get());
- m_eram = auto_alloc_array(machine(), UINT8, 0x8000);
+ m_eram = std::make_unique<UINT8[]>(0x8000);
machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(isa8_pgc_device::reset_common), this));
}
@@ -325,7 +325,7 @@ READ8_MEMBER( isa8_pgc_device::init_r ) {
DBG_LOG(1,"INIT",("mapping emulator RAM\n"));
space.install_readwrite_bank(0xf8000, 0xfffff, "eram");
- membank("eram")->set_base(m_eram);
+ membank("eram")->set_base(m_eram.get());
DBG_LOG(1,"INIT",("mapping LUT\n"));
space.install_write_handler(0xf8400, 0xf85ff,
diff --git a/src/devices/bus/isa/pgc.h b/src/devices/bus/isa/pgc.h
index 45eb4bfb25a..cf83eb8ae1d 100644
--- a/src/devices/bus/isa/pgc.h
+++ b/src/devices/bus/isa/pgc.h
@@ -55,11 +55,11 @@ private:
required_device<palette_device> m_palette;
UINT8 *m_commarea;
- UINT8 *m_vram;
- UINT8 *m_eram;
+ std::unique_ptr<UINT8[]> m_vram;
+ std::unique_ptr<UINT8[]> m_eram;
UINT8 m_stateparam[16];
UINT8 m_lut[256*3];
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
};
diff --git a/src/devices/bus/macpds/pds_tpdfpd.cpp b/src/devices/bus/macpds/pds_tpdfpd.cpp
index 968eed3564f..f89a210888f 100644
--- a/src/devices/bus/macpds/pds_tpdfpd.cpp
+++ b/src/devices/bus/macpds/pds_tpdfpd.cpp
@@ -115,10 +115,10 @@ void macpds_sedisplay_device::device_start()
install_rom(this, SEDISPLAY_ROM_REGION, 0xc00000);
install_rom(this, SEDISPLAY_ROM_REGION, 0xf80000);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
+ m_vram = std::make_unique<UINT8[]>(VRAM_SIZE);
static const char bankname[] = { "radpds_ram" };
- m_macpds->install_bank(0xc40000, 0xc40000+VRAM_SIZE-1, 0, 0, bankname, m_vram);
+ m_macpds->install_bank(0xc40000, 0xc40000+VRAM_SIZE-1, 0, 0, bankname, m_vram.get());
m_macpds->install_device(0x770000, 0x77000f, read16_delegate(FUNC(macpds_sedisplay_device::ramdac_r), this), write16_delegate(FUNC(macpds_sedisplay_device::ramdac_w), this));
m_macpds->install_device(0xc10000, 0xc2ffff, read16_delegate(FUNC(macpds_sedisplay_device::sedisplay_r), this), write16_delegate(FUNC(macpds_sedisplay_device::sedisplay_w), this));
@@ -136,7 +136,7 @@ void macpds_sedisplay_device::device_reset()
m_count = 0;
m_clutoffs = 0;
m_vbl_disable = 1;
- memset(m_vram, 0, VRAM_SIZE);
+ memset(m_vram.get(), 0, VRAM_SIZE);
memset(m_palette, 0, sizeof(m_palette));
m_palette[0] = rgb_t(0, 0, 0);
@@ -166,7 +166,7 @@ UINT32 macpds_sedisplay_device::screen_update(screen_device &screen, bitmap_rgb3
int x, y;
UINT8 pixels, *vram;
- vram = m_vram;
+ vram = m_vram.get();
for (y = 0; y < 870; y++)
{
diff --git a/src/devices/bus/macpds/pds_tpdfpd.h b/src/devices/bus/macpds/pds_tpdfpd.h
index 0adf48c2765..218c30f959b 100644
--- a/src/devices/bus/macpds/pds_tpdfpd.h
+++ b/src/devices/bus/macpds/pds_tpdfpd.h
@@ -41,7 +41,7 @@ protected:
DECLARE_WRITE16_MEMBER(ramdac_w);
public:
- UINT8 *m_vram;
+ std::unique_ptr<UINT8[]> m_vram;
UINT32 m_vbl_disable;
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
emu_timer *m_timer;
diff --git a/src/devices/bus/nes/disksys.cpp b/src/devices/bus/nes/disksys.cpp
index e89429dc0c4..d517b7d4a67 100644
--- a/src/devices/bus/nes/disksys.cpp
+++ b/src/devices/bus/nes/disksys.cpp
@@ -416,11 +416,11 @@ void nes_disksys_device::load_disk(device_image_interface &image)
m_fds_sides = (image.length() - header) / 65500;
if (!m_fds_data)
- m_fds_data = auto_alloc_array(machine(), UINT8, m_fds_sides * 65500);
+ m_fds_data = std::make_unique<UINT8[]>(m_fds_sides * 65500);
// if there is an header, skip it
image.fseek(header, SEEK_SET);
- image.fread(m_fds_data, 65500 * m_fds_sides);
+ image.fread(m_fds_data.get(), 65500 * m_fds_sides);
return;
}
diff --git a/src/devices/bus/nes/disksys.h b/src/devices/bus/nes/disksys.h
index 821cfb5614b..7dbefa37ee4 100644
--- a/src/devices/bus/nes/disksys.h
+++ b/src/devices/bus/nes/disksys.h
@@ -38,7 +38,7 @@ public:
private:
UINT8 *m_2c33_rom;
- UINT8 *m_fds_data; // here, we store a copy of the disk
+ std::unique_ptr<UINT8[]> m_fds_data; // here, we store a copy of the disk
required_device<legacy_floppy_image_device> m_disk;
static const device_timer_id TIMER_IRQ = 0;
diff --git a/src/devices/bus/snes/sdd1.cpp b/src/devices/bus/snes/sdd1.cpp
index 56376641705..f3282b27b84 100644
--- a/src/devices/bus/snes/sdd1.cpp
+++ b/src/devices/bus/snes/sdd1.cpp
@@ -428,7 +428,7 @@ void sns_rom_sdd1_device::device_start()
{
m_sdd1emu = auto_alloc(machine(), SDD1_emu(machine()));
- m_buffer.data = (UINT8*)auto_alloc_array(machine(), UINT8, 0x10000);
+ m_buffer.data = std::make_unique<UINT8[]>(0x10000);
m_buffer.ready = 0;
save_item(NAME(m_sdd1_enable));
@@ -441,7 +441,7 @@ void sns_rom_sdd1_device::device_start()
save_item(NAME(m_dma[i].size), i);
}
- save_pointer(NAME(m_buffer.data), 0x10000);
+ save_pointer(NAME(m_buffer.data.get()), 0x10000);
save_item(NAME(m_buffer.offset));
save_item(NAME(m_buffer.size));
save_item(NAME(m_buffer.ready));
@@ -567,7 +567,7 @@ UINT8 sns_rom_sdd1_device::read_helper(UINT32 addr)
// SDD1_emu calls this function; it needs to access uncompressed data;
// so temporarily disable decompression mode for decompress() call.
- m_sdd1emu->SDD1emu_decompress(m_rom, m_mmc, addr, m_buffer.size, m_buffer.data);
+ m_sdd1emu->SDD1emu_decompress(m_rom, m_mmc, addr, m_buffer.size, m_buffer.data.get());
m_buffer.ready = 1;
}
diff --git a/src/devices/bus/snes/sdd1.h b/src/devices/bus/snes/sdd1.h
index 24e8ecaf47a..6524a043b68 100644
--- a/src/devices/bus/snes/sdd1.h
+++ b/src/devices/bus/snes/sdd1.h
@@ -180,7 +180,7 @@ public:
struct
{
- UINT8 *data; // pointer to decompressed S-DD1 data (65536 bytes)
+ std::unique_ptr<UINT8[]> data; // pointer to decompressed S-DD1 data (65536 bytes)
UINT16 offset; // read index into S-DD1 decompression buffer
UINT32 size; // length of data buffer; reads decrement counter, set ready to false at 0
UINT8 ready; // 1 when data[] is valid; 0 to invoke sdd1emu.decompress()
diff --git a/src/devices/bus/snes/spc7110.cpp b/src/devices/bus/snes/spc7110.cpp
index a6ebbdab2df..0c7cc797316 100644
--- a/src/devices/bus/snes/spc7110.cpp
+++ b/src/devices/bus/snes/spc7110.cpp
@@ -300,7 +300,7 @@ static const UINT8 spc7110_mode2_context_table[32][2] =
SPC7110_Decomp::SPC7110_Decomp(running_machine &machine)
: m_machine(machine)
{
- m_decomp_buffer = (UINT8*)auto_alloc_array(machine, UINT8, SPC7110_DECOMP_BUFFER_SIZE);
+ m_decomp_buffer = std::make_unique<UINT8[]>(SPC7110_DECOMP_BUFFER_SIZE);
reset();
for (int i = 0; i < 256; i++)
@@ -325,7 +325,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine)
m_machine.save().save_item(m_decomp_mode, "SNES_SPC7110/m_decomp_mode");
m_machine.save().save_item(m_decomp_offset, "SNES_SPC7110/m_decomp_offset");
- m_machine.save().save_pointer(m_decomp_buffer, "SNES_SPC7110/m_decomp_buffer", SPC7110_DECOMP_BUFFER_SIZE);
+ m_machine.save().save_pointer(m_decomp_buffer.get(), "SNES_SPC7110/m_decomp_buffer", SPC7110_DECOMP_BUFFER_SIZE);
m_machine.save().save_item(m_decomp_buffer_rdoffset, "SNES_SPC7110/m_decomp_buffer_rdoffset");
m_machine.save().save_item(m_decomp_buffer_wroffset, "SNES_SPC7110/m_decomp_buffer_wroffset");
m_machine.save().save_item(m_decomp_buffer_length, "SNES_SPC7110/m_decomp_buffer_length");
diff --git a/src/devices/bus/snes/spc7110.h b/src/devices/bus/snes/spc7110.h
index ba356790d2f..7dd3710cc5d 100644
--- a/src/devices/bus/snes/spc7110.h
+++ b/src/devices/bus/snes/spc7110.h
@@ -50,7 +50,7 @@ private:
UINT32 m_decomp_mode;
UINT32 m_decomp_offset;
- UINT8 *m_decomp_buffer;
+ std::unique_ptr<UINT8[]> m_decomp_buffer;
UINT32 m_decomp_buffer_rdoffset;
UINT32 m_decomp_buffer_wroffset;
UINT32 m_decomp_buffer_length;
diff --git a/src/devices/cpu/alto2/a2disp.cpp b/src/devices/cpu/alto2/a2disp.cpp
index 82b0e083cf8..aedc0096f3a 100644
--- a/src/devices/cpu/alto2/a2disp.cpp
+++ b/src/devices/cpu/alto2/a2disp.cpp
@@ -286,7 +286,7 @@ void alto2_cpu_device::unload_word()
m_unload_time = -1;
return;
}
- UINT16* bitmap = m_dsp.raw_bitmap + y * ALTO2_DISPLAY_SCANLINE_WORDS;
+ UINT16* bitmap = m_dsp.raw_bitmap.get() + y * ALTO2_DISPLAY_SCANLINE_WORDS;
UINT16 word = m_dsp.inverse;
UINT8 a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa];
if (FIFO_MBEMPTY(a38))
@@ -532,12 +532,12 @@ void alto2_cpu_device::init_disp()
m_dsp.hlc = ALTO2_DISPLAY_HLC_START;
- m_dsp.raw_bitmap = auto_alloc_array(machine(), UINT16, ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
+ m_dsp.raw_bitmap = std::make_unique<UINT16[]>(ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
m_dsp.scanline = auto_alloc_array(machine(), UINT8*, ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H);
for (int y = 0; y < ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H; y++)
m_dsp.scanline[y] = auto_alloc_array(machine(), UINT8, ALTO2_DISPLAY_TOTAL_WIDTH);
- m_dsp.bitmap = auto_bitmap_ind16_alloc(machine(), ALTO2_DISPLAY_WIDTH, ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H);
+ m_dsp.bitmap = std::make_unique<bitmap_ind16>(ALTO2_DISPLAY_WIDTH, ALTO2_DISPLAY_HEIGHT + ALTO2_FAKE_STATUS_H);
m_dsp.state = 0;
}
@@ -567,7 +567,7 @@ void alto2_cpu_device::reset_disp()
m_dsp.curxpos = 0;
m_dsp.cursor0 = 0;
m_dsp.cursor1 = 0;
- memset(m_dsp.raw_bitmap, 0, sizeof(UINT16) * ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
+ memset(m_dsp.raw_bitmap.get(), 0, sizeof(UINT16) * ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
for (int y = 0; y < ALTO2_DISPLAY_HEIGHT; y++)
memset(m_dsp.scanline[y], 0, sizeof(UINT8) * ALTO2_DISPLAY_TOTAL_WIDTH);
m_dsp.odd_frame = false;
diff --git a/src/devices/cpu/alto2/a2disp.h b/src/devices/cpu/alto2/a2disp.h
index 80454eb4896..a8f4568f29d 100644
--- a/src/devices/cpu/alto2/a2disp.h
+++ b/src/devices/cpu/alto2/a2disp.h
@@ -192,9 +192,9 @@ struct {
UINT32 curxpos; //!< helper: first cursor word in scanline
UINT16 cursor0; //!< helper: shifted cursor data for left word
UINT16 cursor1; //!< helper: shifted cursor data for right word
- UINT16 *raw_bitmap; //!< array of words of the raw bitmap that is displayed
+ std::unique_ptr<UINT16[]> raw_bitmap; //!< array of words of the raw bitmap that is displayed
UINT8 **scanline; //!< array of scanlines with 1 byte per pixel
- bitmap_ind16 *bitmap; //!< MAME bitmap with 16 bit indices
+ std::unique_ptr<bitmap_ind16> bitmap; //!< MAME bitmap with 16 bit indices
bool odd_frame; //!< true, if odd frame is drawn
} m_dsp;
diff --git a/src/devices/cpu/alto2/a2ether.cpp b/src/devices/cpu/alto2/a2ether.cpp
index 2cd38bb48c6..c3fd5a5c87a 100644
--- a/src/devices/cpu/alto2/a2ether.cpp
+++ b/src/devices/cpu/alto2/a2ether.cpp
@@ -600,7 +600,7 @@ void alto2_cpu_device::bs_early_eidfct()
m_eth.rx_packet[m_eth.rx_count] = r;
m_eth.rx_count++;
if (ALTO2_ETHER_PACKET_SIZE == m_eth.rx_count) {
- dump_packet(this,"RX", m_eth.rx_packet, 0, m_eth.rx_count);
+ dump_packet(this,"RX", m_eth.rx_packet.get(), 0, m_eth.rx_count);
m_eth.rx_count = 0;
}
#endif
@@ -709,7 +709,7 @@ void alto2_cpu_device::f2_late_eodfct()
m_eth.tx_packet[m_eth.tx_count] = m_bus;
m_eth.tx_count++;
if (ALTO2_ETHER_PACKET_SIZE == m_eth.tx_count) {
- dump_packet(this,"TX", m_eth.tx_packet, 0, m_eth.tx_count);
+ dump_packet(this,"TX", m_eth.tx_packet.get(), 0, m_eth.tx_count);
m_eth.tx_count = 0;
}
#endif
@@ -1338,8 +1338,8 @@ void alto2_cpu_device::init_ether(int task)
m_active_callback[task] = &alto2_cpu_device::activate_eth;
- m_eth.rx_packet = auto_alloc_array(machine(), UINT16, sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE);
- m_eth.tx_packet = auto_alloc_array(machine(), UINT16, sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE);
+ m_eth.rx_packet = std::make_unique<UINT16[]>(sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE);
+ m_eth.tx_packet = std::make_unique<UINT16[]>(sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE);
m_eth.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::tx_packet),this));
m_eth.tx_timer->reset();
diff --git a/src/devices/cpu/alto2/a2ether.h b/src/devices/cpu/alto2/a2ether.h
index 6bdbd24ce3e..484bd187f8c 100644
--- a/src/devices/cpu/alto2/a2ether.h
+++ b/src/devices/cpu/alto2/a2ether.h
@@ -57,8 +57,8 @@ struct {
UINT16 tx_crc; //!< transmitter CRC
UINT32 rx_count; //!< received words count
UINT32 tx_count; //!< transmitted words count
- UINT16* rx_packet; //!< buffer to collect received words
- UINT16* tx_packet; //!< buffer to collect transmitted words
+ std::unique_ptr<UINT16[]> rx_packet; //!< buffer to collect received words
+ std::unique_ptr<UINT16[]> tx_packet; //!< buffer to collect transmitted words
emu_timer* rx_timer; //!< receiver timer
emu_timer* tx_timer; //!< transmitter timer
jkff_t ff_10a; //!< JK flip-flop 10a IBUSY (Sheet 13)
diff --git a/src/devices/cpu/alto2/a2ram.cpp b/src/devices/cpu/alto2/a2ram.cpp
index 425f3f60634..159415d0605 100644
--- a/src/devices/cpu/alto2/a2ram.cpp
+++ b/src/devices/cpu/alto2/a2ram.cpp
@@ -10,11 +10,11 @@
#define DEBUG_WRTRAM 0 //!< define to 1 to printf disassembled CRAM writes
//! direct read access to the microcode CRAM
-#define RD_CRAM(addr) (*reinterpret_cast<UINT32 *>(m_ucode_cram + addr * 4))
+#define RD_CRAM(addr) (*reinterpret_cast<UINT32 *>(m_ucode_cram.get() + addr * 4))
//! direct write access to the microcode CRAM
#define WR_CRAM(addr,data) do { \
- *reinterpret_cast<UINT32 *>(m_ucode_cram + addr * 4) = data; \
+ *reinterpret_cast<UINT32 *>(m_ucode_cram.get() + addr * 4) = data; \
} while (0)
/**
diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp
index 382732044ca..6b35a076ec3 100644
--- a/src/devices/cpu/alto2/alto2cpu.cpp
+++ b/src/devices/cpu/alto2/alto2cpu.cpp
@@ -819,10 +819,10 @@ void alto2_cpu_device::device_start()
m_ucode_crom = prom_load(machine(), pl_ucode, memregion("ucode_proms")->base(), ALTO2_UCODE_ROM_PAGES, 8);
// allocate micro code CRAM
- m_ucode_cram = auto_alloc_array(machine(), UINT8, sizeof(UINT32) * ALTO2_UCODE_RAM_PAGES * ALTO2_UCODE_PAGE_SIZE);
+ m_ucode_cram = std::make_unique<UINT8[]>(sizeof(UINT32) * ALTO2_UCODE_RAM_PAGES * ALTO2_UCODE_PAGE_SIZE);
// fill with the micro code inverted bits value
for (offs_t offset = 0; offset < ALTO2_UCODE_RAM_PAGES * ALTO2_UCODE_PAGE_SIZE; offset++)
- *reinterpret_cast<UINT32 *>(m_ucode_cram + offset * 4) = ALTO2_UCODE_INVERTED;
+ *reinterpret_cast<UINT32 *>(m_ucode_cram.get() + offset * 4) = ALTO2_UCODE_INVERTED;
// decode constant PROMs to m_const_data
m_const_data = prom_load(machine(), pl_const, memregion("const_proms")->base(), 1, 4);
@@ -1028,13 +1028,13 @@ READ32_MEMBER ( alto2_cpu_device::crom_r )
//! read microcode CRAM
READ32_MEMBER ( alto2_cpu_device::cram_r )
{
- return *reinterpret_cast<UINT32 *>(m_ucode_cram + offset * 4);
+ return *reinterpret_cast<UINT32 *>(m_ucode_cram.get() + offset * 4);
}
//! write microcode CRAM
WRITE32_MEMBER( alto2_cpu_device::cram_w )
{
- *reinterpret_cast<UINT32 *>(m_ucode_cram + offset * 4) = data;
+ *reinterpret_cast<UINT32 *>(m_ucode_cram.get() + offset * 4) = data;
}
//! read constants PROM
@@ -1046,7 +1046,7 @@ READ16_MEMBER ( alto2_cpu_device::const_r )
//! direct read access to the microcode CROM or CRAM
#define RD_UCODE(addr) (addr < ALTO2_UCODE_RAM_BASE ? \
*reinterpret_cast<UINT32 *>(m_ucode_crom + addr * 4) : \
- *reinterpret_cast<UINT32 *>(m_ucode_cram + (addr - ALTO2_UCODE_RAM_BASE) * 4))
+ *reinterpret_cast<UINT32 *>(m_ucode_cram.get() + (addr - ALTO2_UCODE_RAM_BASE) * 4))
//-------------------------------------------------
// device_reset - device-specific reset
diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h
index daa66d81658..11208dbae83 100644
--- a/src/devices/cpu/alto2/alto2cpu.h
+++ b/src/devices/cpu/alto2/alto2cpu.h
@@ -231,7 +231,7 @@ private:
address_space* m_iomem;
UINT8* m_ucode_crom;
- UINT8* m_ucode_cram;
+ std::unique_ptr<UINT8[]> m_ucode_cram;
UINT8* m_const_data;
//! read microcode CROM
diff --git a/src/devices/cpu/i386/cycles.h b/src/devices/cpu/i386/cycles.h
index a04e54da8e0..62b6da2a80a 100644
--- a/src/devices/cpu/i386/cycles.h
+++ b/src/devices/cpu/i386/cycles.h
@@ -333,7 +333,6 @@ enum X86_CYCLES
};
-#define X86_NUM_CPUS 4
#define CPU_CYCLES_I386 0
#define CPU_CYCLES_I486 1
#define CPU_CYCLES_PENTIUM 2
diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp
index 9017ffbaea7..77623b8f7d4 100644
--- a/src/devices/cpu/i386/i386.cpp
+++ b/src/devices/cpu/i386/i386.cpp
@@ -2769,9 +2769,6 @@ void i386_device::i386_protected_mode_iret(int operand32)
#include "cycles.h"
-static UINT8 *cycle_table_rm[X86_NUM_CPUS];
-static UINT8 *cycle_table_pm[X86_NUM_CPUS];
-
#define CYCLES_NUM(x) (m_cycles -= (x))
void i386_device::CYCLES(int x)
@@ -2817,8 +2814,8 @@ void i386_device::build_cycle_table()
int i, j;
for (j=0; j < X86_NUM_CPUS; j++)
{
- cycle_table_rm[j] = auto_alloc_array(machine(), UINT8, CYCLES_NUM_OPCODES);
- cycle_table_pm[j] = auto_alloc_array(machine(), UINT8, CYCLES_NUM_OPCODES);
+ cycle_table_rm[j] = std::make_unique<UINT8[]>(CYCLES_NUM_OPCODES);
+ cycle_table_pm[j] = std::make_unique<UINT8[]>(CYCLES_NUM_OPCODES);
for (i=0; i < sizeof(x86_cycle_table)/sizeof(X86_CYCLE_TABLE); i++)
{
@@ -3300,8 +3297,8 @@ void i386_device::device_start()
i386_common_init(32);
build_opcode_table(OP_I386);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I386];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I386];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I386].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I386].get();
register_state_i386();
}
@@ -3983,8 +3980,8 @@ void i486_device::device_start()
build_opcode_table(OP_I386 | OP_FPU | OP_I486);
build_x87_opcode_table();
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I486];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I486];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I486].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I486].get();
register_state_i386_x87();
}
@@ -4042,8 +4039,8 @@ void pentium_device::device_start()
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM);
build_x87_opcode_table();
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get();
}
void pentium_device::device_reset()
@@ -4116,8 +4113,8 @@ void mediagx_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_CYRIX);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_MEDIAGX];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_MEDIAGX];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_MEDIAGX].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_MEDIAGX].get();
}
void mediagx_device::device_reset()
@@ -4181,8 +4178,8 @@ void pentium_pro_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium_pro_device::device_reset()
@@ -4256,8 +4253,8 @@ void pentium_mmx_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_MMX);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium_mmx_device::device_reset()
@@ -4329,8 +4326,8 @@ void pentium2_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium2_device::device_reset()
@@ -4396,8 +4393,8 @@ void pentium3_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX | OP_SSE);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium3_device::device_reset()
@@ -4465,8 +4462,8 @@ void pentium4_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX | OP_SSE | OP_SSE2);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium4_device::device_reset()
diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h
index 60eea10264d..ed2cf432ee3 100644
--- a/src/devices/cpu/i386/i386.h
+++ b/src/devices/cpu/i386/i386.h
@@ -22,6 +22,7 @@
#define MCFG_I386_SMIACT(_devcb) \
i386_device::set_smiact(*device, DEVCB_##_devcb);
+#define X86_NUM_CPUS 4
class i386_device : public cpu_device
{
@@ -68,6 +69,10 @@ protected:
address_space_config m_program_config;
address_space_config m_io_config;
+ std::unique_ptr<UINT8[]> cycle_table_rm[X86_NUM_CPUS];
+ std::unique_ptr<UINT8[]> cycle_table_pm[X86_NUM_CPUS];
+
+
union I386_GPR {
UINT32 d[8];
UINT16 w[16];
diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp
index 5a76f81ae76..214062cfe79 100644
--- a/src/devices/cpu/z180/z180.cpp
+++ b/src/devices/cpu/z180/z180.cpp
@@ -755,8 +755,8 @@ static UINT8 SZP[256]; /* zero, sign and parity flags */
static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */
static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */
-static UINT8 *SZHVC_add;
-static UINT8 *SZHVC_sub;
+static std::unique_ptr<UINT8[]> SZHVC_add;
+static std::unique_ptr<UINT8[]> SZHVC_sub;
#include "z180ops.h"
#include "z180tbl.h"
@@ -1894,8 +1894,8 @@ void z180_device::device_start()
}
/* allocate big flag arrays once */
- SZHVC_add = auto_alloc_array(machine(), UINT8, 2*256*256);
- SZHVC_sub = auto_alloc_array(machine(), UINT8, 2*256*256);
+ SZHVC_add = std::make_unique<UINT8[]>(2*256*256);
+ SZHVC_sub = std::make_unique<UINT8[]>(2*256*256);
padd = &SZHVC_add[ 0*256];
padc = &SZHVC_add[256*256];
diff --git a/src/devices/machine/akiko.cpp b/src/devices/machine/akiko.cpp
index 0c7ef441ad2..85df5f0d66d 100644
--- a/src/devices/machine/akiko.cpp
+++ b/src/devices/machine/akiko.cpp
@@ -187,10 +187,10 @@ void akiko_device::device_reset()
m_cdrom_numtracks = cdrom_get_last_track(m_cdrom)+3;
- m_cdrom_toc = auto_alloc_array(machine(), UINT8, 13*m_cdrom_numtracks);
- memset( m_cdrom_toc, 0, 13*m_cdrom_numtracks);
+ m_cdrom_toc = std::make_unique<UINT8[]>(13*m_cdrom_numtracks);
+ memset( m_cdrom_toc.get(), 0, 13*m_cdrom_numtracks);
- p = m_cdrom_toc;
+ p = m_cdrom_toc.get();
p[1] = ((addrctrl & 0x0f) << 4) | ((addrctrl & 0xf0) >> 4);
p[3] = 0xa0; /* first track */
p[8] = 1;
diff --git a/src/devices/machine/akiko.h b/src/devices/machine/akiko.h
index 6886a4073a4..3fd1b586fb6 100644
--- a/src/devices/machine/akiko.h
+++ b/src/devices/machine/akiko.h
@@ -113,7 +113,7 @@ private:
cdda_device *m_cdda;
cdrom_file *m_cdrom;
- UINT8 *m_cdrom_toc;
+ std::unique_ptr<UINT8[]> m_cdrom_toc;
emu_timer *m_dma_timer;
emu_timer *m_frame_timer;
diff --git a/src/devices/machine/diablo_hd.cpp b/src/devices/machine/diablo_hd.cpp
index f067acd4742..f833cf54504 100644
--- a/src/devices/machine/diablo_hd.cpp
+++ b/src/devices/machine/diablo_hd.cpp
@@ -87,7 +87,6 @@ diablo_hd_device::diablo_hd_device(const machine_config &mconfig, const char *ta
m_head(-1),
m_sector(-1),
m_page(-1),
- m_cache(nullptr),
m_bits(nullptr),
m_rdfirst(-1),
m_rdlast(-1),
@@ -310,13 +309,12 @@ void diablo_hd_device::read_sector()
if (m_disk) {
// allocate a buffer for this page
- m_cache[m_page] = auto_alloc_array(machine(), UINT8, sizeof(diablo_sector_t));
+ m_cache[m_page] = std::make_unique<UINT8[]>(sizeof(diablo_sector_t));
// and read the page from the hard_disk image
- if (hard_disk_read(m_disk, m_page, m_cache[m_page])) {
+ if (hard_disk_read(m_disk, m_page, m_cache[m_page].get())) {
LOG_DRIVE((2,"[DHD%u] CHS:%03d/%d/%02d => page:%d loaded\n", m_unit, m_cylinder, m_head, m_sector, m_page));
} else {
LOG_DRIVE((0,"[DHD%u] CHS:%03d/%d/%02d => page:%d read failed\n", m_unit, m_cylinder, m_head, m_sector, m_page));
- auto_free(machine(), m_cache[m_page]);
m_cache[m_page] = nullptr;
}
} else {
@@ -442,7 +440,7 @@ UINT32* diablo_hd_device::expand_sector()
LOG_DRIVE((0,"[DHD%u] no image for page #%d\n", m_unit, m_page));
return nullptr;
}
- diablo_sector_t *s = reinterpret_cast<diablo_sector_t *>(m_cache[m_page]);
+ diablo_sector_t *s = reinterpret_cast<diablo_sector_t *>(m_cache[m_page].get());
/* allocate a bits image */
UINT32 *bits = auto_alloc_array_clear(machine(), UINT32, 400);
@@ -727,7 +725,7 @@ void diablo_hd_device::squeeze_sector()
UINT32 *bits = m_bits[m_page];
// pointer to sector buffer
- s = reinterpret_cast<diablo_sector_t *>(m_cache[m_page]);
+ s = reinterpret_cast<diablo_sector_t *>(m_cache[m_page].get());
// zap the sector first
memset(s, 0, sizeof(*s));
@@ -778,7 +776,7 @@ void diablo_hd_device::squeeze_sector()
m_bits[m_page] = nullptr;
if (m_disk) {
- if (!hard_disk_write(m_disk, m_page, m_cache[m_page])) {
+ if (!hard_disk_write(m_disk, m_page, m_cache[m_page].get())) {
LOG_DRIVE((0,"[DHD%u] write failed for page #%d\n", m_unit, m_page));
}
} else {
@@ -1334,9 +1332,7 @@ void diablo_hd_device::device_reset()
if (m_cache) {
for (int page = 0; page < m_pages; page++)
if (m_cache[page])
- auto_free(machine(), m_cache[page]);
- auto_free(machine(), m_cache);
- m_cache = nullptr;
+ m_cache[page] = nullptr;
}
// free previous bits cache
if (m_bits) {
@@ -1406,7 +1402,6 @@ void diablo_hd_device::device_reset()
if (!m_handle)
return;
// for units with a CHD assigned to them start the timer
- m_cache = auto_alloc_array_clear(machine(), UINT8*, m_pages);
m_bits = auto_alloc_array_clear(machine(), UINT32*, m_pages);
timer_set(m_sector_time - m_sector_mark_0_time, 1, 0);
read_sector();
diff --git a/src/devices/machine/diablo_hd.h b/src/devices/machine/diablo_hd.h
index 19b1b5c776b..c3fadd2a073 100644
--- a/src/devices/machine/diablo_hd.h
+++ b/src/devices/machine/diablo_hd.h
@@ -108,7 +108,7 @@ private:
int m_head; //!< current head (track) number on cylinder
int m_sector; //!< current sector number in track
int m_page; //!< current page (derived from cylinder, head and sector)
- UINT8** m_cache; //!< pages raw bytes
+ std::unique_ptr<UINT8[]> m_cache[2 * DIABLO_PAGES]; //!< pages raw bytes
UINT32** m_bits; //!< pages expanded to bits
int m_rdfirst; //!< set to first bit of a sector that is read from
int m_rdlast; //!< set to last bit of a sector that was read from
diff --git a/src/devices/machine/s3c2400.h b/src/devices/machine/s3c2400.h
index 5c8b6d3dcb9..fbd2e5e70d4 100644
--- a/src/devices/machine/s3c2400.h
+++ b/src/devices/machine/s3c2400.h
@@ -769,7 +769,7 @@ public:
{
s3c24xx_lcd_regs_t regs;
emu_timer *timer;
- bitmap_rgb32 *bitmap[2];
+ std::unique_ptr<bitmap_rgb32> bitmap[2];
UINT32 vramaddr_cur;
UINT32 vramaddr_max;
UINT32 offsize;
diff --git a/src/devices/machine/s3c2410.h b/src/devices/machine/s3c2410.h
index 33665eabbcb..6e9b28a9146 100644
--- a/src/devices/machine/s3c2410.h
+++ b/src/devices/machine/s3c2410.h
@@ -935,7 +935,7 @@ public:
{
s3c24xx_lcd_regs_t regs;
emu_timer *timer;
- bitmap_rgb32 *bitmap[2];
+ std::unique_ptr<bitmap_rgb32> bitmap[2];
UINT32 vramaddr_cur;
UINT32 vramaddr_max;
UINT32 offsize;
diff --git a/src/devices/machine/s3c2440.h b/src/devices/machine/s3c2440.h
index 9adfce38569..58976ddcf1a 100644
--- a/src/devices/machine/s3c2440.h
+++ b/src/devices/machine/s3c2440.h
@@ -1006,7 +1006,7 @@ public:
{
s3c24xx_lcd_regs_t regs;
emu_timer *timer;
- bitmap_rgb32 *bitmap[2];
+ std::unique_ptr<bitmap_rgb32> bitmap[2];
UINT32 vramaddr_cur;
UINT32 vramaddr_max;
UINT32 offsize;
diff --git a/src/devices/machine/s3c24xx.inc b/src/devices/machine/s3c24xx.inc
index 07193f890a4..e2c4800f077 100644
--- a/src/devices/machine/s3c24xx.inc
+++ b/src/devices/machine/s3c24xx.inc
@@ -716,8 +716,8 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp )
void S3C24_CLASS_NAME::s3c24xx_video_start()
{
screen_device *screen = machine().first_screen();
- m_lcd.bitmap[0] = auto_bitmap_rgb32_alloc(machine(), screen->width(), screen->height());
- m_lcd.bitmap[1] = auto_bitmap_rgb32_alloc(machine(), screen->width(), screen->height());
+ m_lcd.bitmap[0] = std::make_unique<bitmap_rgb32>( screen->width(), screen->height());
+ m_lcd.bitmap[1] = std::make_unique<bitmap_rgb32>( screen->width(), screen->height());
}
void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bitmap_src_1, bitmap_rgb32 &bitmap_src_2)
diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp
index 37402f900b0..19579a1aa03 100644
--- a/src/devices/machine/s3c44b0.cpp
+++ b/src/devices/machine/s3c44b0.cpp
@@ -387,7 +387,7 @@ void s3c44b0_device::lcd_dma_read(int count, UINT8 *data)
void s3c44b0_device::lcd_render_stn_04()
{
- UINT8 *bitmap = m_lcd.bitmap + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min);
+ UINT8 *bitmap = m_lcd.bitmap.get() + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min);
UINT8 data[16];
lcd_dma_read(16, data);
for (auto & elem : data)
@@ -403,7 +403,7 @@ void s3c44b0_device::lcd_render_stn_04()
if (m_lcd.vpos > m_lcd.vpos_max)
{
m_lcd.vpos = m_lcd.vpos_min;
- bitmap = m_lcd.bitmap;
+ bitmap = m_lcd.bitmap.get();
}
m_lcd.hpos = m_lcd.hpos_min;
}
@@ -413,7 +413,7 @@ void s3c44b0_device::lcd_render_stn_04()
void s3c44b0_device::lcd_render_stn_08()
{
- UINT8 *bitmap = m_lcd.bitmap + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min);
+ UINT8 *bitmap = m_lcd.bitmap.get() + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min);
UINT8 data[16];
lcd_dma_read(16, data);
for (auto & elem : data)
@@ -432,7 +432,7 @@ void s3c44b0_device::lcd_render_stn_08()
if (m_lcd.vpos > m_lcd.vpos_max)
{
m_lcd.vpos = m_lcd.vpos_min;
- bitmap = m_lcd.bitmap;
+ bitmap = m_lcd.bitmap.get();
}
m_lcd.hpos = m_lcd.hpos_min;
}
@@ -510,7 +510,7 @@ UINT32 s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitmap,
for (int y = 0; y < screen.height(); y++)
{
UINT32 *scanline = &bitmap.pix32(y);
- UINT8 *vram = m_lcd.bitmap + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1);
+ UINT8 *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1);
for (int x = 0; x < screen.width(); x++)
{
*scanline++ = rgb_t(vram[0], vram[1], vram[2]);
@@ -596,9 +596,9 @@ void s3c44b0_device::lcd_configure()
verboselog( *this, 3, "LCD - min_x %d min_y %d max_x %d max_y %d\n", m_lcd.hpos_min, m_lcd.vpos_min, m_lcd.hpos_max, m_lcd.vpos_max);
if (m_lcd.bitmap)
{
- auto_free(machine(), m_lcd.bitmap);
+ m_lcd.bitmap = nullptr;
}
- m_lcd.bitmap = auto_alloc_array(machine(), UINT8, (m_lcd.hpos_max - m_lcd.hpos_min + 1) * (m_lcd.vpos_max - m_lcd.vpos_min + 1) * 3);
+ m_lcd.bitmap = std::make_unique<UINT8[]>((m_lcd.hpos_max - m_lcd.hpos_min + 1) * (m_lcd.vpos_max - m_lcd.vpos_min + 1) * 3);
m_lcd.frame_period = HZ_TO_ATTOSECONDS(m_lcd.framerate);
m_lcd.scantime = m_lcd.frame_period / m_lcd.vpos_end;
m_lcd.pixeltime = m_lcd.frame_period / (m_lcd.vpos_end * m_lcd.hpos_end);
diff --git a/src/devices/machine/s3c44b0.h b/src/devices/machine/s3c44b0.h
index cdf1fe6d72e..05b0c134532 100644
--- a/src/devices/machine/s3c44b0.h
+++ b/src/devices/machine/s3c44b0.h
@@ -505,7 +505,7 @@ struct s3c44b0_lcd_t
{
s3c44b0_lcd_regs_t regs;
emu_timer *timer;
- UINT8 *bitmap;
+ std::unique_ptr<UINT8[]> bitmap;
UINT32 vramaddr_cur;
UINT32 vramaddr_max;
UINT32 offsize;
diff --git a/src/devices/machine/smpc.cpp b/src/devices/machine/smpc.cpp
index caf0834da5a..fcbda532e27 100644
--- a/src/devices/machine/smpc.cpp
+++ b/src/devices/machine/smpc.cpp
@@ -214,8 +214,8 @@ TIMER_CALLBACK_MEMBER( saturn_state::smpc_cd_enable )
void saturn_state::smpc_system_reset()
{
/*Only backup ram and SMPC ram are retained after that this command is issued.*/
- memset(m_scu_regs ,0x00,0x000100);
- memset(m_scsp_regs,0x00,0x001000);
+ memset(m_scu_regs.get() ,0x00,0x000100);
+ memset(m_scsp_regs.get(),0x00,0x001000);
memset(m_sound_ram,0x00,0x080000);
memset(m_workram_h,0x00,0x100000);
memset(m_workram_l,0x00,0x100000);
diff --git a/src/devices/machine/strata.cpp b/src/devices/machine/strata.cpp
index 01651eb90bd..4f7006f4d99 100644
--- a/src/devices/machine/strata.cpp
+++ b/src/devices/machine/strata.cpp
@@ -59,7 +59,7 @@ strataflash_device::strataflash_device(const machine_config &mconfig, const char
void strataflash_device::nvram_default()
{
- memset(m_flashmemory, 0, COMPLETE_SIZE);
+ memset(m_flashmemory.get(), 0, COMPLETE_SIZE);
}
//-------------------------------------------------
@@ -69,7 +69,7 @@ void strataflash_device::nvram_default()
void strataflash_device::nvram_read(emu_file &file)
{
- file.read(m_flashmemory, COMPLETE_SIZE);
+ file.read(m_flashmemory.get(), COMPLETE_SIZE);
// TODO
@@ -173,7 +173,7 @@ void strataflash_device::nvram_write(emu_file &file)
return 0;
*/
- file.write(m_flashmemory, COMPLETE_SIZE);
+ file.write(m_flashmemory.get(), COMPLETE_SIZE);
}
//-------------------------------------------------
@@ -184,15 +184,15 @@ void strataflash_device::device_start(void)
m_mode = FM_NORMAL;
m_status = 0x80;
m_master_lock = 0;
- m_flashmemory = auto_alloc_array(machine(), UINT8, COMPLETE_SIZE);
+ m_flashmemory = std::make_unique<UINT8[]>(COMPLETE_SIZE);
- m_wrbuf = m_flashmemory + FEEPROM_SIZE;
+ m_wrbuf = m_flashmemory.get() + FEEPROM_SIZE;
m_prot_regs = m_wrbuf + WRBUF_SIZE;
m_blocklock = m_prot_regs + PROT_REGS_SIZE;
// clear various FEEPROM areas
memset(m_prot_regs, 0xff, 18);
- memset(m_flashmemory, 0xff, FEEPROM_SIZE);
+ memset(m_flashmemory.get(), 0xff, FEEPROM_SIZE);
memset(m_blocklock, 0x00, BLOCKLOCK_SIZE);
// set-up factory-programmed protection register segment
@@ -234,7 +234,7 @@ UINT16 strataflash_device::read8_16(address_space& space, offs_t offset, bus_wid
case bw_8:
return m_flashmemory[BYTE_XOR_LE(offset)];
case bw_16:
- return *(UINT16*)(m_flashmemory+offset);
+ return *(UINT16*)(m_flashmemory.get()+offset);
}
break;
case FM_READSTATUS:
@@ -562,7 +562,7 @@ void strataflash_device::write8_16(address_space& space, offs_t offset, UINT16 d
m_flashmemory[BYTE_XOR_LE(offset)] &= data;
break;
case bw_16:
- *(UINT16*)(m_flashmemory+offset) &= data;
+ *(UINT16*)(m_flashmemory.get()+offset) &= data;
break;
}
}
diff --git a/src/devices/machine/strata.h b/src/devices/machine/strata.h
index 1d1835f0812..5092d1e891e 100644
--- a/src/devices/machine/strata.h
+++ b/src/devices/machine/strata.h
@@ -64,7 +64,7 @@ private:
int m_wrbuf_len; // count converted into byte length in write buffer command
int m_wrbuf_count; // current count in write buffer command
UINT8* m_wrbuf; // write buffer used by write buffer command
- UINT8* m_flashmemory; // main FEEPROM area
+ std::unique_ptr<UINT8[]> m_flashmemory; // main FEEPROM area
UINT8* m_blocklock; // block lock flags
UINT8* m_prot_regs; // protection registers
};
diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp
index 6e5ff8321bf..daaa33cd47e 100644
--- a/src/devices/sound/c140.cpp
+++ b/src/devices/sound/c140.cpp
@@ -132,8 +132,8 @@ void c140_device::device_start()
}
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- m_mixer_buffer_left = auto_alloc_array(machine(), INT16, 2 * m_sample_rate);
- m_mixer_buffer_right = m_mixer_buffer_left + m_sample_rate;
+ m_mixer_buffer_left = std::make_unique<INT16[]>(m_sample_rate);
+ m_mixer_buffer_right = std::make_unique<INT16[]>(m_sample_rate);;
save_item(NAME(m_REG));
@@ -181,8 +181,8 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
if(samples>m_sample_rate) samples=m_sample_rate;
/* zap the contents of the mixer buffer */
- memset(m_mixer_buffer_left, 0, samples * sizeof(INT16));
- memset(m_mixer_buffer_right, 0, samples * sizeof(INT16));
+ memset(m_mixer_buffer_left.get(), 0, samples * sizeof(INT16));
+ memset(m_mixer_buffer_right.get(), 0, samples * sizeof(INT16));
/* get the number of voices to update */
voicecnt = (m_banking_type == C140_TYPE_ASIC219) ? 16 : 24;
@@ -208,8 +208,8 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
rvol=(vreg->volume_right*32)/C140_MAX_VOICE;
/* Set mixer outputs base pointers */
- lmix = m_mixer_buffer_left;
- rmix = m_mixer_buffer_right;
+ lmix = m_mixer_buffer_left.get();
+ rmix = m_mixer_buffer_right.get();
/* Retrieve sample start/end and calculate size */
st=v->sample_start;
@@ -342,8 +342,8 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
}
/* render to MAME's stream buffer */
- lmix = m_mixer_buffer_left;
- rmix = m_mixer_buffer_right;
+ lmix = m_mixer_buffer_left.get();
+ rmix = m_mixer_buffer_right.get();
{
stream_sample_t *dest1 = outputs[0];
stream_sample_t *dest2 = outputs[1];
diff --git a/src/devices/sound/c140.h b/src/devices/sound/c140.h
index 899045d03af..d94818e9df7 100644
--- a/src/devices/sound/c140.h
+++ b/src/devices/sound/c140.h
@@ -106,8 +106,8 @@ private:
sound_stream *m_stream;
int m_banking_type;
/* internal buffers */
- INT16 *m_mixer_buffer_left;
- INT16 *m_mixer_buffer_right;
+ std::unique_ptr<INT16[]> m_mixer_buffer_left;
+ std::unique_ptr<INT16[]> m_mixer_buffer_right;
int m_baserate;
INT8 *m_pRom;
diff --git a/src/devices/sound/cdda.cpp b/src/devices/sound/cdda.cpp
index 5bd6746e9d7..3223142a062 100644
--- a/src/devices/sound/cdda.cpp
+++ b/src/devices/sound/cdda.cpp
@@ -29,7 +29,7 @@ void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
void cdda_device::device_start()
{
/* allocate an audio cache */
- m_audio_cache = auto_alloc_array( machine(), UINT8, CD_MAX_SECTOR_DATA * MAX_SECTORS );
+ m_audio_cache = std::make_unique<UINT8[]>(CD_MAX_SECTOR_DATA * MAX_SECTORS );
m_stream = machine().sound().stream_alloc(*this, 0, 2, 44100);
@@ -47,7 +47,7 @@ void cdda_device::device_start()
save_item( NAME(m_audio_ended_normally) );
save_item( NAME(m_audio_lba) );
save_item( NAME(m_audio_length) );
- save_pointer( NAME(m_audio_cache), CD_MAX_SECTOR_DATA * MAX_SECTORS );
+ save_pointer( NAME(m_audio_cache.get()), CD_MAX_SECTOR_DATA * MAX_SECTORS );
save_item( NAME(m_audio_samples) );
save_item( NAME(m_audio_bptr) );
}
@@ -161,7 +161,7 @@ int cdda_device::audio_ended()
void cdda_device::get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, UINT32 samples_wanted)
{
int i;
- INT16 *audio_cache = (INT16 *) m_audio_cache;
+ INT16 *audio_cache = (INT16 *) m_audio_cache.get();
while (samples_wanted > 0)
{
diff --git a/src/devices/sound/cdda.h b/src/devices/sound/cdda.h
index 4e6da29919e..2d9b6d86584 100644
--- a/src/devices/sound/cdda.h
+++ b/src/devices/sound/cdda.h
@@ -46,7 +46,7 @@ private:
INT8 m_audio_playing, m_audio_pause, m_audio_ended_normally;
UINT32 m_audio_lba, m_audio_length;
- UINT8 * m_audio_cache;
+ std::unique_ptr<UINT8[]> m_audio_cache;
UINT32 m_audio_samples;
UINT32 m_audio_bptr;
INT16 m_audio_volume[2];
diff --git a/src/devices/sound/cem3394.cpp b/src/devices/sound/cem3394.cpp
index c64b2539482..5d345fa6507 100644
--- a/src/devices/sound/cem3394.cpp
+++ b/src/devices/sound/cem3394.cpp
@@ -176,7 +176,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
INT16 last_ext = m_last_ext;
/* fetch the external data */
- m_ext_cb(samples, m_external_buffer);
+ m_ext_cb(samples, m_external_buffer.get());
/* compute the modulation depth, and adjust fstep to the maximum frequency */
/* we lop off 13 bits of depth so that we can multiply by stepadjust, below, */
@@ -187,7 +187,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* "apply" the filter: note this is pretty cheesy; it basically just downsamples the
external sample to filter_freq by allowing only 2 transitions for every cycle */
- for (i = 0, ext = m_external_buffer, position = m_position; i < samples; i++, ext++)
+ for (i = 0, ext = m_external_buffer.get(), position = m_position; i < samples; i++, ext++)
{
UINT32 newposition;
INT32 stepadjust;
@@ -229,7 +229,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* if the width is wider than the step, we're guaranteed to hit it once per cycle */
if (pulse_width >= step)
{
- for (i = 0, mix = m_mixer_buffer, position = m_position; i < samples; i++, mix++)
+ for (i = 0, mix = m_mixer_buffer.get(), position = m_position; i < samples; i++, mix++)
{
if (position < pulse_width)
*mix = 0x1932;
@@ -243,7 +243,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
else
{
INT16 volume = 0x1932 * pulse_width / step;
- for (i = 0, mix = m_mixer_buffer, position = m_position; i < samples; i++, mix++)
+ for (i = 0, mix = m_mixer_buffer.get(), position = m_position; i < samples; i++, mix++)
{
UINT32 newposition = position + step;
if ((newposition ^ position) & ~FRACTION_MASK)
@@ -258,13 +258,13 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* otherwise, clear the mixing buffer */
else
- memset(m_mixer_buffer, 0, sizeof(INT16) * samples);
+ memset(m_mixer_buffer.get(), 0, sizeof(INT16) * samples);
/* handle the sawtooth component; it maxes out at 0x2000, which is 27% larger */
/* than the pulse */
if (ENABLE_SAWTOOTH && (m_wave_select & WAVE_SAWTOOTH))
{
- for (i = 0, mix = m_mixer_buffer, position = m_position; i < samples; i++, mix++)
+ for (i = 0, mix = m_mixer_buffer.get(), position = m_position; i < samples; i++, mix++)
{
*mix += ((position >> (FRACTION_BITS - 14)) & 0x3fff) - 0x2000;
position += step;
@@ -277,7 +277,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* a multiplication) */
if (ENABLE_TRIANGLE && (m_wave_select & WAVE_TRIANGLE))
{
- for (i = 0, mix = m_mixer_buffer, position = m_position; i < samples; i++, mix++)
+ for (i = 0, mix = m_mixer_buffer.get(), position = m_position; i < samples; i++, mix++)
{
INT16 value;
if (position & (1 << (FRACTION_BITS - 1)))
@@ -295,8 +295,8 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t *
}
/* mix it down */
- mix = m_mixer_buffer;
- ext = m_external_buffer;
+ mix = m_mixer_buffer.get();
+ ext = m_external_buffer.get();
{
/* internal + external */
if (ext_volume != 0 && int_volume != 0)
@@ -336,8 +336,8 @@ void cem3394_device::device_start()
m_ext_cb.bind_relative_to(*owner());
/* allocate memory for a mixer buffer and external buffer (1 second should do it!) */
- m_mixer_buffer = auto_alloc_array(machine(), INT16, m_sample_rate);
- m_external_buffer = auto_alloc_array(machine(), INT16, m_sample_rate);
+ m_mixer_buffer = std::make_unique<INT16[]>(m_sample_rate);
+ m_external_buffer = std::make_unique<INT16[]>(m_sample_rate);
save_item(NAME(m_values));
save_item(NAME(m_wave_select));
diff --git a/src/devices/sound/cem3394.h b/src/devices/sound/cem3394.h
index 188ad9b069f..88d2608bec1 100644
--- a/src/devices/sound/cem3394.h
+++ b/src/devices/sound/cem3394.h
@@ -107,8 +107,8 @@ private:
double m_inv_sample_rate;
int m_sample_rate;
- INT16 *m_mixer_buffer;
- INT16 *m_external_buffer;
+ std::unique_ptr<INT16[]> m_mixer_buffer;
+ std::unique_ptr<INT16[]> m_external_buffer;
};
extern const device_type CEM3394;
diff --git a/src/devices/sound/k005289.cpp b/src/devices/sound/k005289.cpp
index dc349b7e211..b49d97b1555 100644
--- a/src/devices/sound/k005289.cpp
+++ b/src/devices/sound/k005289.cpp
@@ -77,7 +77,7 @@ void k005289_device::device_start()
m_stream = stream_alloc(0, 1, m_rate);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- m_mixer_buffer = auto_alloc_array(machine(), short, 2 * m_rate);
+ m_mixer_buffer = std::make_unique<short[]>(2 * m_rate);
/* build the mixer table */
make_mixer_table(2);
@@ -113,7 +113,7 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
int i,v,f;
/* zap the contents of the mixer buffer */
- memset(m_mixer_buffer, 0, samples * sizeof(INT16));
+ memset(m_mixer_buffer.get(), 0, samples * sizeof(INT16));
v=m_volume[0];
f=m_frequency[0];
@@ -122,7 +122,7 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
const unsigned char *w = m_sound_prom + m_waveform[0];
int c = m_counter[0];
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
/* add our contribution */
for (i = 0; i < samples; i++)
@@ -145,7 +145,7 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
const unsigned char *w = m_sound_prom + m_waveform[1];
int c = m_counter[1];
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
/* add our contribution */
for (i = 0; i < samples; i++)
@@ -162,7 +162,7 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t *
}
/* mix it down */
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
for (i = 0; i < samples; i++)
*buffer++ = m_mixer_lookup[*mix++];
}
@@ -180,10 +180,10 @@ void k005289_device::make_mixer_table(int voices)
int gain = 16;
/* allocate memory */
- m_mixer_table = auto_alloc_array(machine(), INT16, 256 * voices);
+ m_mixer_table = std::make_unique<INT16[]>(256 * voices);
/* find the middle of the table */
- m_mixer_lookup = m_mixer_table + (128 * voices);
+ m_mixer_lookup = m_mixer_table.get() + (128 * voices);
/* fill in the table - 16 bit case */
for (i = 0; i < count; i++)
diff --git a/src/devices/sound/k005289.h b/src/devices/sound/k005289.h
index 9112ca5458f..24f84638263 100644
--- a/src/devices/sound/k005289.h
+++ b/src/devices/sound/k005289.h
@@ -48,9 +48,9 @@ private:
int m_rate;
/* mixer tables and internal buffers */
- INT16 *m_mixer_table;
+ std::unique_ptr<INT16[]> m_mixer_table;
INT16 *m_mixer_lookup;
- short *m_mixer_buffer;
+ std::unique_ptr<short[]> m_mixer_buffer;
UINT32 m_counter[2];
UINT16 m_frequency[2];
diff --git a/src/devices/sound/k051649.cpp b/src/devices/sound/k051649.cpp
index 05c8fffae3f..dde61572d44 100644
--- a/src/devices/sound/k051649.cpp
+++ b/src/devices/sound/k051649.cpp
@@ -69,7 +69,7 @@ void k051649_device::device_start()
m_mclock = clock();
// allocate a buffer to mix into - 1 second's worth should be more than enough
- m_mixer_buffer = auto_alloc_array(machine(), short, 2 * m_rate);
+ m_mixer_buffer = std::make_unique<short[]>(2 * m_rate);
// build the mixer table
make_mixer_table(5);
@@ -111,7 +111,7 @@ void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t *
int i,j;
// zap the contents of the mixer buffer
- memset(m_mixer_buffer, 0, samples * sizeof(short));
+ memset(m_mixer_buffer.get(), 0, samples * sizeof(short));
for (j = 0; j < 5; j++)
{
@@ -123,7 +123,7 @@ void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t *
int c=voice[j].counter;
int step = ((INT64)m_mclock * (1 << FREQ_BITS)) / (float)((voice[j].frequency + 1) * 16 * (m_rate / 32)) + 0.5f;
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
// add our contribution
for (i = 0; i < samples; i++)
@@ -141,7 +141,7 @@ void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t *
}
// mix it down
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
for (i = 0; i < samples; i++)
*buffer++ = m_mixer_lookup[*mix++];
}
@@ -272,10 +272,10 @@ void k051649_device::make_mixer_table(int voices)
int i;
// allocate memory
- m_mixer_table = auto_alloc_array(machine(), INT16, 512 * voices);
+ m_mixer_table = std::make_unique<INT16[]>(512 * voices);
// find the middle of the table
- m_mixer_lookup = m_mixer_table + (256 * voices);
+ m_mixer_lookup = m_mixer_table.get() + (256 * voices);
// fill in the table - 16 bit case
for (i = 0; i < (voices * 256); i++)
diff --git a/src/devices/sound/k051649.h b/src/devices/sound/k051649.h
index 4fec1b7659f..f5e4997f02c 100644
--- a/src/devices/sound/k051649.h
+++ b/src/devices/sound/k051649.h
@@ -81,9 +81,9 @@ private:
int m_rate;
/* mixer tables and internal buffers */
- INT16 *m_mixer_table;
+ std::unique_ptr<INT16[]> m_mixer_table;
INT16 *m_mixer_lookup;
- short *m_mixer_buffer;
+ std::unique_ptr<short[]> m_mixer_buffer;
/* chip registers */
UINT8 m_test;
diff --git a/src/devices/sound/k054539.cpp b/src/devices/sound/k054539.cpp
index e619e53a0bd..5270f5b80d6 100644
--- a/src/devices/sound/k054539.cpp
+++ b/src/devices/sound/k054539.cpp
@@ -105,7 +105,7 @@ void k054539_device::sound_stream_update(sound_stream &stream, stream_sample_t *
};
- INT16 *rbase = (INT16 *)ram;
+ INT16 *rbase = (INT16 *)ram.get();
if(!(regs[0x22f] & 1))
return;
@@ -306,10 +306,10 @@ void k054539_device::init_chip()
memset(posreg_latch, 0, sizeof(posreg_latch)); //*
flags |= UPDATE_AT_KEYON; //* make it default until proven otherwise
- ram = auto_alloc_array(machine(), unsigned char, 0x4000);
+ ram = std::make_unique<UINT8[]>(0x4000);
reverb_pos = 0;
cur_ptr = 0;
- memset(ram, 0, 0x4000);
+ memset(ram.get(), 0, 0x4000);
memory_region *reg = (m_rgnoverride != nullptr) ? owner()->memregion(m_rgnoverride) : region();
rom = reg->base();
@@ -324,7 +324,7 @@ void k054539_device::init_chip()
stream = stream_alloc(0, 2, clock() / 384);
save_item(NAME(regs));
- save_pointer(NAME(ram), 0x4000);
+ save_pointer(NAME(ram.get()), 0x4000);
save_item(NAME(cur_ptr));
}
@@ -428,7 +428,7 @@ WRITE8_MEMBER(k054539_device::write)
case 0x22e:
cur_zone =
- data == 0x80 ? ram :
+ data == 0x80 ? ram.get() :
rom + 0x20000*data;
cur_limit = data == 0x80 ? 0x4000 : 0x20000;
cur_ptr = 0;
@@ -466,7 +466,7 @@ WRITE8_MEMBER(k054539_device::write)
void k054539_device::device_post_load()
{
int data = regs[0x22e];
- cur_zone = data == 0x80 ? ram : rom + 0x20000*data;
+ cur_zone = data == 0x80 ? ram.get() : rom + 0x20000*data;
cur_limit = data == 0x80 ? 0x4000 : 0x20000;
}
diff --git a/src/devices/sound/k054539.h b/src/devices/sound/k054539.h
index dea41388837..fd196d306b8 100644
--- a/src/devices/sound/k054539.h
+++ b/src/devices/sound/k054539.h
@@ -94,7 +94,7 @@ private:
int flags;
unsigned char regs[0x230];
- unsigned char *ram;
+ std::unique_ptr<UINT8[]> ram;
int reverb_pos;
INT32 cur_ptr;
diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp
index 61ca40f5829..f7c31e96ea9 100644
--- a/src/devices/sound/mos6560.cpp
+++ b/src/devices/sound/mos6560.cpp
@@ -626,7 +626,7 @@ void mos6560_device::sound_start()
/* buffer for fastest played sample for 5 second so we have enough data for min 5 second */
m_noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
- m_noise = auto_alloc_array(machine(), INT8, m_noisesize);
+ m_noise = std::make_unique<INT8[]>(m_noisesize);
{
int noiseshift = 0x7ffff8;
char data;
@@ -661,7 +661,7 @@ void mos6560_device::sound_start()
if (m_tonesize > 0)
{
- m_tone = auto_alloc_array(machine(), INT16, m_tonesize);
+ m_tone = std::make_unique<INT16[]>(m_tonesize);
for (i = 0; i < m_tonesize; i++)
{
diff --git a/src/devices/sound/mos6560.h b/src/devices/sound/mos6560.h
index c5259f72659..d84897027d5 100644
--- a/src/devices/sound/mos6560.h
+++ b/src/devices/sound/mos6560.h
@@ -223,8 +223,8 @@ protected:
m_noisesamples; /* count of samples to give out per tone */
sound_stream *m_channel;
- INT16 *m_tone;
- INT8 *m_noise;
+ std::unique_ptr<INT16[]> m_tone;
+ std::unique_ptr<INT8[]> m_noise;
emu_timer *m_line_timer;
};
diff --git a/src/devices/sound/mos7360.cpp b/src/devices/sound/mos7360.cpp
index 1be8535b417..6478d931111 100644
--- a/src/devices/sound/mos7360.cpp
+++ b/src/devices/sound/mos7360.cpp
@@ -297,7 +297,7 @@ void mos7360_device::device_start()
// buffer for fastest played sample for 5 second so we have enough data for min 5 second
m_noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
- m_noise = auto_alloc_array(machine(), UINT8, m_noisesize);
+ m_noise = std::make_unique<UINT8[]>(m_noisesize);
{
int noiseshift = 0x7ffff8;
diff --git a/src/devices/sound/mos7360.h b/src/devices/sound/mos7360.h
index f1d755981b2..cba7b398762 100644
--- a/src/devices/sound/mos7360.h
+++ b/src/devices/sound/mos7360.h
@@ -185,7 +185,7 @@ protected:
double m_rastertime;
/* sound part */
- UINT8 *m_noise;
+ std::unique_ptr<UINT8[]> m_noise;
int m_tone1pos, m_tone2pos,
m_tone1samples, m_tone2samples,
m_noisesize, /* number of samples */
diff --git a/src/devices/sound/segapcm.cpp b/src/devices/sound/segapcm.cpp
index 8e92167c708..5ad1c6d7ebb 100644
--- a/src/devices/sound/segapcm.cpp
+++ b/src/devices/sound/segapcm.cpp
@@ -37,9 +37,9 @@ void segapcm_device::device_start()
{
int mask, rom_mask;
- m_ram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_ram = std::make_unique<UINT8[]>(0x800);
- memset(m_ram, 0xff, 0x800);
+ memset(m_ram.get(), 0xff, 0x800);
m_bankshift = (UINT8) m_bank;
mask = m_bank >> 16;
@@ -54,7 +54,7 @@ void segapcm_device::device_start()
m_stream = stream_alloc(0, 2, clock() / 128);
save_item(NAME(m_low));
- save_pointer(NAME(m_ram), 0x800);
+ save_pointer(NAME(m_ram.get()), 0x800);
}
@@ -92,7 +92,7 @@ void segapcm_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* loop over channels */
for (int ch = 0; ch < 16; ch++)
{
- UINT8 *regs = m_ram+8*ch;
+ UINT8 *regs = m_ram.get()+8*ch;
/* only process active channels */
if (!(regs[0x86]&1))
diff --git a/src/devices/sound/segapcm.h b/src/devices/sound/segapcm.h
index a56a9062688..48474134b46 100644
--- a/src/devices/sound/segapcm.h
+++ b/src/devices/sound/segapcm.h
@@ -56,7 +56,7 @@ protected:
private:
required_region_ptr<UINT8> m_rom;
- UINT8* m_ram;
+ std::unique_ptr<UINT8[]> m_ram;
UINT8 m_low[16];
int m_bank;
int m_bankshift;
diff --git a/src/devices/sound/sid.cpp b/src/devices/sound/sid.cpp
index d040702eeae..a2a406c13d6 100644
--- a/src/devices/sound/sid.cpp
+++ b/src/devices/sound/sid.cpp
@@ -19,8 +19,8 @@
#include "sidenvel.h"
#include "sid.h"
-static float *filterTable;
-static float *bandPassParam;
+static std::unique_ptr<float[]> filterTable;
+static std::unique_ptr<float[]> bandPassParam;
#define lowPassParam filterTable
static float filterResTable[16];
@@ -168,8 +168,8 @@ static void filterTableInit(running_machine &machine)
float resDyMin;
float resDy;
- filterTable = auto_alloc_array(machine, float, 0x800);
- bandPassParam = auto_alloc_array(machine, float, 0x800);
+ filterTable = std::make_unique<float[]>(0x800);
+ bandPassParam = std::make_unique<float[]>(0x800);
uk = 0;
for ( rk = 0; rk < 0x800; rk++ )
diff --git a/src/devices/sound/sidvoice.cpp b/src/devices/sound/sidvoice.cpp
index 3104f69d680..33f4039891a 100644
--- a/src/devices/sound/sidvoice.cpp
+++ b/src/devices/sound/sidvoice.cpp
@@ -23,7 +23,7 @@ static const UINT8* waveform70;
static UINT8 noiseTableLSB[1<<8];
#endif
-static INT8* ampMod1x8;
+static std::unique_ptr<INT8[]> ampMod1x8;
static const UINT32 noiseSeed = 0x7ffff8;
@@ -35,7 +35,7 @@ void sidInitMixerEngine(running_machine &machine)
/* 8-bit volume modulation tables. */
float filterAmpl = 0.7f;
- ampMod1x8=auto_alloc_array(machine, INT8, 256*256);
+ ampMod1x8=std::make_unique<INT8[]>(256*256);
uk = 0;
for ( si = 0; si < 256; si++ )
diff --git a/src/devices/sound/sp0256.cpp b/src/devices/sound/sp0256.cpp
index 1ba54669ab2..9e5a95441e3 100644
--- a/src/devices/sound/sp0256.cpp
+++ b/src/devices/sound/sp0256.cpp
@@ -125,8 +125,8 @@ void sp0256_device::device_start()
/* -------------------------------------------------------------------- */
/* Allocate a scratch buffer for generating ~10kHz samples. */
/* -------------------------------------------------------------------- */
- m_scratch = auto_alloc_array(machine(), INT16, SCBUF_SIZE);
- save_pointer(NAME(m_scratch), SCBUF_SIZE);
+ m_scratch = std::make_unique<INT16[]>(SCBUF_SIZE);
+ save_pointer(NAME(m_scratch.get()), SCBUF_SIZE);
m_sc_head = m_sc_tail = 0;
@@ -1357,7 +1357,7 @@ void sp0256_device::sound_stream_update(sound_stream &stream, stream_sample_t **
else
{
did_samp += lpc12_update(&m_filt, do_samp,
- m_scratch, &m_sc_head);
+ m_scratch.get(), &m_sc_head);
}
m_sc_head &= SCBUF_MASK;
diff --git a/src/devices/sound/sp0256.h b/src/devices/sound/sp0256.h
index c1e486883d6..c7215cb4e6c 100644
--- a/src/devices/sound/sp0256.h
+++ b/src/devices/sound/sp0256.h
@@ -108,7 +108,7 @@ private:
int m_silent; /* Flag: SP0256 is silent. */
- INT16 *m_scratch; /* Scratch buffer for audio. */
+ std::unique_ptr<INT16[]> m_scratch; /* Scratch buffer for audio. */
UINT32 m_sc_head; /* Head pointer into scratch circular buf */
UINT32 m_sc_tail; /* Tail pointer into scratch circular buf */
diff --git a/src/devices/sound/ymf271.cpp b/src/devices/sound/ymf271.cpp
index 1d0eec4fa5d..81b657af7d4 100644
--- a/src/devices/sound/ymf271.cpp
+++ b/src/devices/sound/ymf271.cpp
@@ -544,12 +544,12 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **
int op;
INT32 *mixp;
- memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2);
+ memset(m_mix_buffer.get(), 0, sizeof(m_mix_buffer[0])*samples*2);
for (j = 0; j < 12; j++)
{
YMF271Group *slot_group = &m_groups[j];
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
if (slot_group->pfm && slot_group->sync != 3)
{
@@ -567,7 +567,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **
int slot2 = j + (1*12);
int slot3 = j + (2*12);
int slot4 = j + (3*12);
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
if (m_slots[slot1].active)
{
@@ -794,7 +794,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **
int slot1 = j + ((op + 0) * 12);
int slot3 = j + ((op + 2) * 12);
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
if (m_slots[slot1].active)
{
for (i = 0; i < samples; i++)
@@ -856,7 +856,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **
int slot1 = j + (0*12);
int slot2 = j + (1*12);
int slot3 = j + (2*12);
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
if (m_slots[slot1].active)
{
@@ -959,7 +959,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **
}
}
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
update_pcm(j + (3*12), mixp, samples);
break;
}
@@ -976,7 +976,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **
}
}
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
for (i = 0; i < samples; i++)
{
outputs[0][i] = (*mixp++)>>2;
@@ -1505,13 +1505,13 @@ void ymf271_device::init_tables()
int i, j;
for (i = 0; i < 8; i++)
- m_lut_waves[i] = auto_alloc_array(machine(), INT16, SIN_LEN);
+ m_lut_waves[i] = std::make_unique<INT16[]>(SIN_LEN);
for (i = 0; i < 4*8; i++)
m_lut_plfo[i>>3][i&7] = auto_alloc_array(machine(), double, LFO_LENGTH);
for (i = 0; i < 4; i++)
- m_lut_alfo[i] = auto_alloc_array(machine(), int, LFO_LENGTH);
+ m_lut_alfo[i] = std::make_unique<int[]>(LFO_LENGTH);
for (i = 0; i < SIN_LEN; i++)
{
@@ -1717,7 +1717,7 @@ void ymf271_device::device_start()
init_state();
m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/384);
- m_mix_buffer = auto_alloc_array(machine(), INT32, 44100*2);
+ m_mix_buffer = std::make_unique<INT32[]>(44100*2);
}
//-------------------------------------------------
diff --git a/src/devices/sound/ymf271.h b/src/devices/sound/ymf271.h
index 81c59164512..d37c4895c5c 100644
--- a/src/devices/sound/ymf271.h
+++ b/src/devices/sound/ymf271.h
@@ -121,9 +121,9 @@ private:
inline bool check_envelope_end(YMF271Slot *slot);
// lookup tables
- INT16 *m_lut_waves[8];
+ std::unique_ptr<INT16[]> m_lut_waves[8];
double *m_lut_plfo[4][8];
- int *m_lut_alfo[4];
+ std::unique_ptr<int[]> m_lut_alfo[4];
double m_lut_ar[64];
double m_lut_dc[64];
double m_lut_lfo[256];
@@ -153,7 +153,7 @@ private:
emu_timer *m_timA, *m_timB;
sound_stream *m_stream;
- INT32 *m_mix_buffer;
+ std::unique_ptr<INT32[]> m_mix_buffer;
devcb_write_line m_irq_handler;
devcb_read8 m_ext_read_handler;
diff --git a/src/devices/sound/ymf278b.cpp b/src/devices/sound/ymf278b.cpp
index 160d609126d..5c696252728 100644
--- a/src/devices/sound/ymf278b.cpp
+++ b/src/devices/sound/ymf278b.cpp
@@ -231,7 +231,7 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
return;
}
- memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2);
+ memset(m_mix_buffer.get(), 0, sizeof(m_mix_buffer[0])*samples*2);
for (i = 0; i < 24; i++)
{
@@ -239,7 +239,7 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
if (slot->active)
{
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
for (j = 0; j < samples; j++)
{
@@ -299,7 +299,7 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
}
}
- mixp = m_mix_buffer;
+ mixp = m_mix_buffer.get();
vl = m_mix_level[m_pcm_l];
vr = m_mix_level[m_pcm_r];
for (i = 0; i < samples; i++)
@@ -985,7 +985,7 @@ void ymf278b_device::device_start()
}
m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/768);
- m_mix_buffer = auto_alloc_array(machine(), INT32, 44100*2);
+ m_mix_buffer = std::make_unique<INT32[]>(44100*2);
// rate tables
precompute_rate_tables();
diff --git a/src/devices/sound/ymf278b.h b/src/devices/sound/ymf278b.h
index 8037af45d82..6c750fcfd91 100644
--- a/src/devices/sound/ymf278b.h
+++ b/src/devices/sound/ymf278b.h
@@ -130,7 +130,7 @@ private:
int m_clock;
sound_stream * m_stream;
- INT32 *m_mix_buffer;
+ std::unique_ptr<INT32[]> m_mix_buffer;
direct_read_data * m_direct;
const address_space_config m_space_config;
devcb_write_line m_irq_handler;
diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp
index c9c19277780..02c0283b4ae 100644
--- a/src/devices/sound/ymz280b.cpp
+++ b/src/devices/sound/ymz280b.cpp
@@ -451,7 +451,7 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
struct YMZ280BVoice *voice = &m_voice[v];
INT16 prev = voice->last_sample;
INT16 curr = voice->curr_sample;
- INT16 *curr_data = m_scratch;
+ INT16 *curr_data = m_scratch.get();
INT32 *ldest = lacc;
INT32 *rdest = racc;
UINT32 new_samples, samples_left;
@@ -496,10 +496,10 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/* generate them into our buffer */
switch (voice->playing << 7 | voice->mode)
{
- case 0x81: samples_left = generate_adpcm(voice, m_scratch, new_samples); break;
- case 0x82: samples_left = generate_pcm8(voice, m_scratch, new_samples); break;
- case 0x83: samples_left = generate_pcm16(voice, m_scratch, new_samples); break;
- default: samples_left = 0; memset(m_scratch, 0, new_samples * sizeof(m_scratch[0])); break;
+ case 0x81: samples_left = generate_adpcm(voice, m_scratch.get(), new_samples); break;
+ case 0x82: samples_left = generate_pcm8(voice, m_scratch.get(), new_samples); break;
+ case 0x83: samples_left = generate_pcm16(voice, m_scratch.get(), new_samples); break;
+ default: samples_left = 0; memset(m_scratch.get(), 0, new_samples * sizeof(m_scratch[0])); break;
}
if (samples_left || voice->ended)
@@ -595,7 +595,7 @@ void ymz280b_device::device_start()
/* allocate memory */
assert(MAX_SAMPLE_CHUNK < 0x10000);
- m_scratch = auto_alloc_array(machine(), INT16, MAX_SAMPLE_CHUNK);
+ m_scratch = std::make_unique<INT16[]>(MAX_SAMPLE_CHUNK);
/* state save */
save_item(NAME(m_current_register));
diff --git a/src/devices/sound/ymz280b.h b/src/devices/sound/ymz280b.h
index 4f53d955499..44cd6e16665 100644
--- a/src/devices/sound/ymz280b.h
+++ b/src/devices/sound/ymz280b.h
@@ -121,7 +121,7 @@ private:
UINT8 *m_mem_base; /* pointer to the base of external memory */
UINT32 m_mem_size;
sound_stream *m_stream; /* which stream are we using */
- INT16 *m_scratch;
+ std::unique_ptr<INT16[]> m_scratch;
#if MAKE_WAVS
void *m_wavresample; /* resampled waveform */
#endif
diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp
index 6a655874da4..d16874cdb59 100644
--- a/src/devices/video/315_5313.cpp
+++ b/src/devices/video/315_5313.cpp
@@ -113,24 +113,24 @@ void sega315_5313_device::device_start()
m_32x_interrupt_func.bind_relative_to(*owner());
m_32x_scanline_helper_func.bind_relative_to(*owner());
- m_vram = auto_alloc_array(machine(), UINT16, 0x10000/2);
- m_cram = auto_alloc_array(machine(), UINT16, 0x80/2);
- m_vsram = auto_alloc_array(machine(), UINT16, 0x80/2);
- m_regs = auto_alloc_array(machine(), UINT16, 0x40/2);
- m_internal_sprite_attribute_table = auto_alloc_array(machine(), UINT16, 0x400/2);
+ m_vram = std::make_unique<UINT16[]>(0x10000/2);
+ m_cram = std::make_unique<UINT16[]>(0x80/2);
+ m_vsram = std::make_unique<UINT16[]>(0x80/2);
+ m_regs = std::make_unique<UINT16[]>(0x40/2);
+ m_internal_sprite_attribute_table = std::make_unique<UINT16[]>(0x400/2);
- memset(m_vram, 0x00, 0x10000);
- memset(m_cram, 0x00, 0x80);
- memset(m_vsram, 0x00, 0x80);
- memset(m_regs, 0x00, 0x40);
- memset(m_internal_sprite_attribute_table, 0x00, 0x400);
+ memset(m_vram.get(), 0x00, 0x10000);
+ memset(m_cram.get(), 0x00, 0x80);
+ memset(m_vsram.get(), 0x00, 0x80);
+ memset(m_regs.get(), 0x00, 0x40);
+ memset(m_internal_sprite_attribute_table.get(), 0x00, 0x400);
- save_pointer(NAME(m_vram), 0x10000/2);
- save_pointer(NAME(m_cram), 0x80/2);
- save_pointer(NAME(m_vsram), 0x80/2);
- save_pointer(NAME(m_regs), 0x40/2);
- save_pointer(NAME(m_internal_sprite_attribute_table), 0x400/2);
+ save_pointer(NAME(m_vram.get()), 0x10000/2);
+ save_pointer(NAME(m_cram.get()), 0x80/2);
+ save_pointer(NAME(m_vsram.get()), 0x80/2);
+ save_pointer(NAME(m_regs.get()), 0x40/2);
+ save_pointer(NAME(m_internal_sprite_attribute_table.get()), 0x400/2);
save_item(NAME(m_command_pending));
save_item(NAME(m_command_part1));
@@ -152,42 +152,42 @@ void sega315_5313_device::device_start()
save_item(NAME(m_vblank_flag));
save_item(NAME(m_total_scanlines));
- m_sprite_renderline = auto_alloc_array(machine(), UINT8, 1024);
- m_highpri_renderline = auto_alloc_array(machine(), UINT8, 320);
- m_video_renderline = auto_alloc_array(machine(), UINT32, 320);
+ m_sprite_renderline = std::make_unique<UINT8[]>(1024);
+ m_highpri_renderline = std::make_unique<UINT8[]>(320);
+ m_video_renderline = std::make_unique<UINT32[]>(320);
- m_palette_lookup = auto_alloc_array(machine(), UINT16, 0x40);
- m_palette_lookup_sprite = auto_alloc_array(machine(), UINT16, 0x40);
+ m_palette_lookup = std::make_unique<UINT16[]>(0x40);
+ m_palette_lookup_sprite = std::make_unique<UINT16[]>(0x40);
- m_palette_lookup_shadow = auto_alloc_array(machine(), UINT16, 0x40);
- m_palette_lookup_highlight = auto_alloc_array(machine(), UINT16, 0x40);
+ m_palette_lookup_shadow = std::make_unique<UINT16[]>(0x40);
+ m_palette_lookup_highlight = std::make_unique<UINT16[]>(0x40);
- memset(m_palette_lookup,0x00,0x40*2);
- memset(m_palette_lookup_sprite,0x00,0x40*2);
+ memset(m_palette_lookup.get(),0x00,0x40*2);
+ memset(m_palette_lookup_sprite.get(),0x00,0x40*2);
- memset(m_palette_lookup_shadow,0x00,0x40*2);
- memset(m_palette_lookup_highlight,0x00,0x40*2);
+ memset(m_palette_lookup_shadow.get(),0x00,0x40*2);
+ memset(m_palette_lookup_highlight.get(),0x00,0x40*2);
if (!m_use_alt_timing)
- m_render_bitmap = auto_bitmap_ind16_alloc(machine(), 320, 512); // allocate maximum sizes we're going to use, it's safer.
+ m_render_bitmap = std::make_unique<bitmap_ind16>(320, 512); // allocate maximum sizes we're going to use, it's safer.
else
- m_render_line = auto_alloc_array(machine(), UINT16, 320);
+ m_render_line = std::make_unique<UINT16[]>(320);
- m_render_line_raw = auto_alloc_array(machine(), UINT16, 320);
+ m_render_line_raw = std::make_unique<UINT16[]>(320);
// FIXME: are these all needed? I'm pretty sure some of these (most?) are just helpers which don't need to be saved,
// but better safe than sorry...
- save_pointer(NAME(m_sprite_renderline), 1024);
- save_pointer(NAME(m_highpri_renderline), 320);
- save_pointer(NAME(m_video_renderline), 320/4);
- save_pointer(NAME(m_palette_lookup), 0x40);
- save_pointer(NAME(m_palette_lookup_sprite), 0x40);
- save_pointer(NAME(m_palette_lookup_shadow), 0x40);
- save_pointer(NAME(m_palette_lookup_highlight), 0x40);
- save_pointer(NAME(m_render_line_raw), 320/2);
+ save_pointer(NAME(m_sprite_renderline.get()), 1024);
+ save_pointer(NAME(m_highpri_renderline.get()), 320);
+ save_pointer(NAME(m_video_renderline.get()), 320/4);
+ save_pointer(NAME(m_palette_lookup.get()), 0x40);
+ save_pointer(NAME(m_palette_lookup_sprite.get()), 0x40);
+ save_pointer(NAME(m_palette_lookup_shadow.get()), 0x40);
+ save_pointer(NAME(m_palette_lookup_highlight.get()), 0x40);
+ save_pointer(NAME(m_render_line_raw.get()), 320/2);
if (m_use_alt_timing)
- save_pointer(NAME(m_render_line), 320/2);
+ save_pointer(NAME(m_render_line.get()), 320/2);
m_irq6_on_timer = machine().scheduler().timer_alloc(FUNC(irq6_on_timer_callback), (void*)this);
m_irq4_on_timer = machine().scheduler().timer_alloc(FUNC(irq4_on_timer_callback), (void*)this);
@@ -1310,7 +1310,7 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline)
/* Clear our Render Buffer */
- memset(m_sprite_renderline, 0, 1024);
+ memset(m_sprite_renderline.get(), 0, 1024);
{
@@ -1517,7 +1517,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline)
m_video_renderline[x]=MEGADRIVE_REG07_BGCOLOUR | 0x20000; // mark as BG
}
- memset(m_highpri_renderline, 0, 320);
+ memset(m_highpri_renderline.get(), 0, 320);
/* is this line enabled? */
if (!MEGADRIVE_REG01_DISP_ENABLE)
@@ -2518,7 +2518,7 @@ void sega315_5313_device::render_videobuffer_to_screenbuffer(int scanline)
}
else
- lineptr = m_render_line;
+ lineptr = m_render_line.get();
for (int x = 0; x < 320; x++)
{
diff --git a/src/devices/video/315_5313.h b/src/devices/video/315_5313.h
index 90f5f0a1cd2..5994d47bb47 100644
--- a/src/devices/video/315_5313.h
+++ b/src/devices/video/315_5313.h
@@ -240,9 +240,9 @@ public:
m_render_bitmap->fill(0);
}
- bitmap_ind16* m_render_bitmap;
- UINT16* m_render_line;
- UINT16* m_render_line_raw;
+ std::unique_ptr<bitmap_ind16> m_render_bitmap;
+ std::unique_ptr<UINT16[]> m_render_line;
+ std::unique_ptr<UINT16[]> m_render_line_raw;
TIMER_DEVICE_CALLBACK_MEMBER( megadriv_scanline_timer_callback_alt_timing );
TIMER_DEVICE_CALLBACK_MEMBER( megadriv_scanline_timer_callback );
@@ -294,14 +294,14 @@ private:
int m_vdp_pal;
int m_use_cram; // c2 uses it's own palette ram, so it sets this to 0
int m_dma_delay; // SVP and SegaCD have some 'lag' in DMA transfers
-
- UINT16* m_regs;
- UINT16* m_vram;
- UINT16* m_cram;
- UINT16* m_vsram;
+
+ std::unique_ptr<UINT16[]> m_regs;
+ std::unique_ptr<UINT16[]> m_vram;
+ std::unique_ptr<UINT16[]> m_cram;
+ std::unique_ptr<UINT16[]> m_vsram;
/* The VDP keeps a 0x400 byte on-chip cache of the Sprite Attribute Table
to speed up processing, Castlevania Bloodlines abuses this on the upside down level */
- UINT16* m_internal_sprite_attribute_table;
+ std::unique_ptr<UINT16[]> m_internal_sprite_attribute_table;
// these are used internally by the VDP to schedule when after the start of a scanline
// to trigger the various interrupts / rendering to our bitmap, bit of a hack really
@@ -342,13 +342,13 @@ private:
void render_videobuffer_to_screenbuffer(int scanline);
/* variables used during emulation - not saved */
- UINT8* m_sprite_renderline;
- UINT8* m_highpri_renderline;
- UINT32* m_video_renderline;
- UINT16* m_palette_lookup;
- UINT16* m_palette_lookup_sprite; // for C2
- UINT16* m_palette_lookup_shadow;
- UINT16* m_palette_lookup_highlight;
+ std::unique_ptr<UINT8[]> m_sprite_renderline;
+ std::unique_ptr<UINT8[]> m_highpri_renderline;
+ std::unique_ptr<UINT32[]> m_video_renderline;
+ std::unique_ptr<UINT16[]> m_palette_lookup;
+ std::unique_ptr<UINT16[]> m_palette_lookup_sprite; // for C2
+ std::unique_ptr<UINT16[]> m_palette_lookup_shadow;
+ std::unique_ptr<UINT16[]> m_palette_lookup_highlight;
address_space *m_space68k;
m68000_base_device* m_cpu68k;
diff --git a/src/devices/video/epic12.cpp b/src/devices/video/epic12.cpp
index fa9c8522198..fa168e5ac36 100644
--- a/src/devices/video/epic12.cpp
+++ b/src/devices/video/epic12.cpp
@@ -41,11 +41,11 @@ TIMER_CALLBACK_MEMBER( epic12_device::blitter_delay_callback )
void epic12_device::device_start()
{
m_gfx_size = 0x2000 * 0x1000;
- m_bitmaps = auto_bitmap_rgb32_alloc(machine(), 0x2000, 0x1000);
+ m_bitmaps = std::make_unique<bitmap_rgb32>( 0x2000, 0x1000);
m_clip = m_bitmaps->cliprect();
m_clip.set(0, 0x2000-1, 0, 0x1000-1);
- m_ram16_copy = auto_alloc_array(machine(), UINT16, m_main_ramsize/2);
+ m_ram16_copy = std::make_unique<UINT16[]>(m_main_ramsize/2);
m_blitter_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epic12_device::blitter_delay_callback),this));
m_blitter_delay_timer->adjust(attotime::never);
@@ -60,7 +60,7 @@ void epic12_device::device_reset()
}
else
{
- m_use_ram = m_ram16_copy; // slow mode
+ m_use_ram = m_ram16_copy.get(); // slow mode
m_work_queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_HIGH_FREQ);
}
@@ -186,7 +186,7 @@ inline void epic12_device::gfx_upload(offs_t *addr)
}
}
-#define draw_params m_bitmaps, &m_clip, &m_bitmaps->pix(0,0),src_x,src_y, x,y, dimx,dimy, flipy, s_alpha, d_alpha, &tint_clr
+#define draw_params m_bitmaps.get(), &m_clip, &m_bitmaps->pix(0,0),src_x,src_y, x,y, dimx,dimy, flipy, s_alpha, d_alpha, &tint_clr
diff --git a/src/devices/video/epic12.h b/src/devices/video/epic12.h
index fac967b1a3d..5e6301b44f8 100644
--- a/src/devices/video/epic12.h
+++ b/src/devices/video/epic12.h
@@ -76,7 +76,7 @@ public:
UINT32 m_gfx_scroll_1_x, m_gfx_scroll_1_y;
int m_gfx_size;
- bitmap_rgb32 *m_bitmaps;
+ std::unique_ptr<bitmap_rgb32> m_bitmaps;
rectangle m_clip;
UINT16* m_use_ram;
@@ -95,7 +95,7 @@ public:
UINT32 m_gfx_addr_shadowcopy;
UINT32 m_gfx_scroll_0_x_shadowcopy, m_gfx_scroll_0_y_shadowcopy;
UINT32 m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_y_shadowcopy;
- UINT16* m_ram16_copy;
+ std::unique_ptr<UINT16[]> m_ram16_copy;
inline void gfx_upload_shadow_copy(address_space &space, offs_t *addr);
inline void gfx_create_shadow_copy(address_space &space);
inline UINT16 COPY_NEXT_WORD(address_space &space, offs_t *addr);
diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp
index 355150ccfb6..d75232808e9 100644
--- a/src/devices/video/fixfreq.cpp
+++ b/src/devices/video/fixfreq.cpp
@@ -149,9 +149,9 @@ void fixedfreq_device::recompute_parameters(bool postload)
bool needs_realloc = (m_htotal != m_hbackporch) && (m_vtotal != m_vbackporch);
if (m_bitmap[0] != nullptr || needs_realloc)
- auto_free(machine(), m_bitmap[0]);
+ m_bitmap[0] = nullptr;
if (m_bitmap[1] != nullptr || needs_realloc)
- auto_free(machine(), m_bitmap[0]);
+ m_bitmap[1] = nullptr;
m_htotal = m_hbackporch;
m_vtotal = m_vbackporch;
@@ -162,8 +162,8 @@ void fixedfreq_device::recompute_parameters(bool postload)
m_mult = (double) (m_monitor_clock) / (double) m_htotal * 1.0; // / (3.0 + 3.0);
VERBOSE_OUT(("trigger %f with len %f\n", m_int_trig, 1e6 / m_mult));
- m_bitmap[0] = auto_bitmap_rgb32_alloc(machine(),m_htotal, m_vtotal);
- m_bitmap[1] = auto_bitmap_rgb32_alloc(machine(),m_htotal, m_vtotal);
+ m_bitmap[0] = std::make_unique<bitmap_rgb32>(m_htotal, m_vtotal);
+ m_bitmap[1] = std::make_unique<bitmap_rgb32>(m_htotal, m_vtotal);
rectangle visarea(
m_hbackporch - m_hfrontporch,
@@ -235,7 +235,7 @@ UINT32 fixedfreq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitm
NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_vid)
{
- bitmap_rgb32 *bm = m_bitmap[m_cur_bm];
+ bitmap_rgb32 *bm = m_bitmap[m_cur_bm].get();
const int has_fields = (m_fieldcount > 1) ? 1: 0;
int pixels = round((time - m_line_time).as_double() / m_clock_period.as_double());
diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h
index b8cdc9c711e..38fde1c5f3b 100644
--- a/src/devices/video/fixfreq.h
+++ b/src/devices/video/fixfreq.h
@@ -126,7 +126,7 @@ private:
attotime m_last_vsync_time;
attotime m_refresh;
attotime m_clock_period;
- bitmap_rgb32 *m_bitmap[2];
+ std::unique_ptr<bitmap_rgb32> m_bitmap[2];
int m_cur_bm;
/* adjustable by drivers */
diff --git a/src/devices/video/huc6260.cpp b/src/devices/video/huc6260.cpp
index 7d3ccc75f78..ca9a9b0510d 100644
--- a/src/devices/video/huc6260.cpp
+++ b/src/devices/video/huc6260.cpp
@@ -253,7 +253,7 @@ WRITE8_MEMBER( huc6260_device::write )
void huc6260_device::device_start()
{
m_timer = timer_alloc();
- m_bmp = auto_bitmap_ind16_alloc( machine(), HUC6260_WPF, HUC6260_LPF );
+ m_bmp = std::make_unique<bitmap_ind16>(HUC6260_WPF, HUC6260_LPF );
/* Resolve callbacks */
m_hsync_changed_cb.resolve();
diff --git a/src/devices/video/huc6260.h b/src/devices/video/huc6260.h
index 36131787fbe..85552fbd265 100644
--- a/src/devices/video/huc6260.h
+++ b/src/devices/video/huc6260.h
@@ -88,7 +88,7 @@ private:
UINT8 m_pixel_clock;
emu_timer *m_timer;
- bitmap_ind16 *m_bmp;
+ std::unique_ptr<bitmap_ind16> m_bmp;
};
diff --git a/src/devices/video/huc6261.cpp b/src/devices/video/huc6261.cpp
index 295f8d8abf9..69caa26008e 100644
--- a/src/devices/video/huc6261.cpp
+++ b/src/devices/video/huc6261.cpp
@@ -398,7 +398,7 @@ void huc6261_device::device_start()
m_huc6270_a = machine().device<huc6270_device>(m_huc6270_a_tag);
m_huc6270_b = machine().device<huc6270_device>(m_huc6270_b_tag);
- m_bmp = auto_bitmap_rgb32_alloc( machine(), HUC6261_WPF, HUC6261_LPF );
+ m_bmp = std::make_unique<bitmap_rgb32>(HUC6261_WPF, HUC6261_LPF );
/* We want to have valid devices */
assert( m_huc6270_a != nullptr );
diff --git a/src/devices/video/huc6261.h b/src/devices/video/huc6261.h
index b8a86f0e69e..ab04cd01c22 100644
--- a/src/devices/video/huc6261.h
+++ b/src/devices/video/huc6261.h
@@ -70,7 +70,7 @@ private:
UINT8 m_pixel_clock;
emu_timer *m_timer;
- bitmap_rgb32 *m_bmp;
+ std::unique_ptr<bitmap_rgb32> m_bmp;
INT32 m_uv_lookup[65536][3];
};
diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp
index 9268c6dc575..f4d72e7a785 100644
--- a/src/devices/video/psx.cpp
+++ b/src/devices/video/psx.cpp
@@ -127,7 +127,7 @@ void psxgpu_device::DebugMeshInit( void )
m_debug.b_clear = 1;
m_debug.n_coord = 0;
m_debug.n_skip = 0;
- m_debug.mesh = auto_bitmap_ind16_alloc( machine(), width, height );
+ m_debug.mesh = std::make_unique<bitmap_ind16>(width, height );
}
void psxgpu_device::DebugMesh( int n_coordx, int n_coordy )
diff --git a/src/devices/video/psx.h b/src/devices/video/psx.h
index f1767df722d..d35c0789183 100644
--- a/src/devices/video/psx.h
+++ b/src/devices/video/psx.h
@@ -58,7 +58,7 @@ extern const device_type CXD8654Q;
struct psx_gpu_debug
{
- bitmap_ind16 *mesh;
+ std::unique_ptr<bitmap_ind16> mesh;
int b_clear;
int b_mesh;
int n_skip;
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index 134f3e84a97..ed8fafeefbc 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -216,9 +216,9 @@ void snes_ppu_device::device_start()
{
m_openbus_cb.resolve_safe(0);
- m_vram = auto_alloc_array(machine(), UINT8, SNES_VRAM_SIZE);
- m_cgram = auto_alloc_array(machine(), UINT16, SNES_CGRAM_SIZE/2);
- m_oam_ram = auto_alloc_array(machine(), UINT16, SNES_OAM_SIZE/2);
+ m_vram = std::make_unique<UINT8[]>(SNES_VRAM_SIZE);
+ m_cgram = std::make_unique<UINT16[]>(SNES_CGRAM_SIZE/2);
+ m_oam_ram = std::make_unique<UINT16[]>(SNES_OAM_SIZE/2);
for (int i = 0; i < 2; i++)
{
@@ -355,9 +355,9 @@ void snes_ppu_device::device_start()
save_item(NAME(m_regs));
- save_pointer(NAME(m_vram), SNES_VRAM_SIZE);
- save_pointer(NAME(m_cgram), SNES_CGRAM_SIZE/2);
- save_pointer(NAME(m_oam_ram), SNES_OAM_SIZE/2);
+ save_pointer(NAME(m_vram.get()), SNES_VRAM_SIZE);
+ save_pointer(NAME(m_cgram.get()), SNES_CGRAM_SIZE/2);
+ save_pointer(NAME(m_oam_ram.get()), SNES_OAM_SIZE/2);
}
void snes_ppu_device::device_reset()
@@ -393,13 +393,13 @@ void snes_ppu_device::device_reset()
}
/* Init VRAM */
- memset(m_vram, 0, SNES_VRAM_SIZE);
+ memset(m_vram.get(), 0, SNES_VRAM_SIZE);
/* Init Palette RAM */
- memset((UINT8 *)m_cgram, 0, SNES_CGRAM_SIZE);
+ memset((UINT8 *)m_cgram.get(), 0, SNES_CGRAM_SIZE);
/* Init oam RAM */
- memset((UINT8 *)m_oam_ram, 0xff, SNES_OAM_SIZE);
+ memset((UINT8 *)m_oam_ram.get(), 0xff, SNES_OAM_SIZE);
m_stat78 = 0;
@@ -1156,7 +1156,7 @@ void snes_ppu_device::update_obsel( void )
void snes_ppu_device::oam_list_build( void )
{
- UINT8 *oamram = (UINT8 *)m_oam_ram;
+ UINT8 *oamram = (UINT8 *)m_oam_ram.get();
INT16 oam = 0x1ff;
UINT16 oam_extra = oam + 0x20;
UINT16 extra = 0;
@@ -2222,7 +2222,7 @@ READ8_MEMBER( snes_ppu_device::cgram_read )
}
#endif
- res = ((UINT8 *)m_cgram)[offset];
+ res = ((UINT8 *)m_cgram.get())[offset];
// CGRAM palette data format is 15-bits (0,bbbbb,ggggg,rrrrr).
// Highest bit is simply ignored.
@@ -2255,7 +2255,7 @@ WRITE8_MEMBER( snes_ppu_device::cgram_write )
if (offset & 0x01)
data &= 0x7f;
- ((UINT8 *)m_cgram)[offset] = data;
+ ((UINT8 *)m_cgram.get())[offset] = data;
}
UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7)
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index f9fa754b549..0fa3f830aef 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -267,9 +267,9 @@ public:
DECLARE_WRITE8_MEMBER( cgram_write );
DECLARE_READ8_MEMBER( vram_read );
DECLARE_WRITE8_MEMBER( vram_write );
- UINT16 *m_oam_ram; /* Object Attribute Memory */
- UINT16 *m_cgram; /* Palette RAM */
- UINT8 *m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
+ std::unique_ptr<UINT16[]> m_oam_ram; /* Object Attribute Memory */
+ std::unique_ptr<UINT16[]> m_cgram; /* Palette RAM */
+ std::unique_ptr<UINT8[]> m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
protected:
// device-level overrides
diff --git a/src/devices/video/stvvdp1.cpp b/src/devices/video/stvvdp1.cpp
index e467bb4a68c..e30275fbc53 100644
--- a/src/devices/video/stvvdp1.cpp
+++ b/src/devices/video/stvvdp1.cpp
@@ -337,7 +337,7 @@ READ32_MEMBER ( saturn_state::saturn_vdp1_vram_r )
WRITE32_MEMBER ( saturn_state::saturn_vdp1_vram_w )
{
- UINT8 *vdp1 = m_vdp1.gfx_decode;
+ UINT8 *vdp1 = m_vdp1.gfx_decode.get();
COMBINE_DATA (&m_vdp1_vram[offset]);
@@ -2099,7 +2099,7 @@ void saturn_state::video_update_vdp1( void )
void saturn_state::stv_vdp1_state_save_postload( void )
{
- UINT8 *vdp1 = m_vdp1.gfx_decode;
+ UINT8 *vdp1 = m_vdp1.gfx_decode.get();
int offset;
UINT32 data;
@@ -2123,12 +2123,12 @@ int saturn_state::stv_vdp1_start ( void )
{
m_vdp1_regs = auto_alloc_array_clear(machine(), UINT16, 0x020/2 );
m_vdp1_vram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4 );
- m_vdp1.gfx_decode = auto_alloc_array(machine(), UINT8, 0x100000 );
+ m_vdp1.gfx_decode = std::make_unique<UINT8[]>(0x100000 );
stv_vdp1_shading_data = auto_alloc(machine(), struct stv_vdp1_poly_scanline_data);
- m_vdp1.framebuffer[0] = auto_alloc_array(machine(), UINT16, 1024 * 256 * 2 ); /* *2 is for double interlace */
- m_vdp1.framebuffer[1] = auto_alloc_array(machine(), UINT16, 1024 * 256 * 2 );
+ m_vdp1.framebuffer[0] = std::make_unique<UINT16[]>(1024 * 256 * 2 ); /* *2 is for double interlace */
+ m_vdp1.framebuffer[1] = std::make_unique<UINT16[]>(1024 * 256 * 2 );
m_vdp1.framebuffer_display_lines = auto_alloc_array(machine(), UINT16 *, 512);
m_vdp1.framebuffer_draw_lines = auto_alloc_array(machine(), UINT16 *, 512);
diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp
index 07b718741c2..c456d28dc5b 100644
--- a/src/devices/video/stvvdp2.cpp
+++ b/src/devices/video/stvvdp2.cpp
@@ -2580,7 +2580,7 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555(
rectangle myclip;
UINT8* gfxdata;
- gfxdata = m_vdp2.gfx_decode + code * 0x20;
+ gfxdata = m_vdp2.gfx_decode.get() + code * 0x20;
if(stv2_current_tilemap.window_control.enabled[0] ||
stv2_current_tilemap.window_control.enabled[1])
@@ -2806,7 +2806,7 @@ void saturn_state::stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectan
UINT8* gfxdata;
int sprite_screen_width, sprite_screen_height;
- gfxdata = m_vdp2.gfx_decode + code * 0x20;
+ gfxdata = m_vdp2.gfx_decode.get() + code * 0x20;
sprite_screen_width = sprite_screen_height = 8;
if(stv2_current_tilemap.window_control.enabled[0] ||
@@ -2920,7 +2920,7 @@ void saturn_state::stv_vdp2_drawgfx_rgb888( bitmap_rgb32 &dest_bmp, const rectan
UINT8* gfxdata;
int sprite_screen_width, sprite_screen_height;
- gfxdata = m_vdp2.gfx_decode + code * 0x20;
+ gfxdata = m_vdp2.gfx_decode.get() + code * 0x20;
sprite_screen_width = sprite_screen_height = 8;
if(stv2_current_tilemap.window_control.enabled[0] ||
@@ -3185,7 +3185,7 @@ void saturn_state::draw_4bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipr
int xsize, ysize, xsize_mask, ysize_mask;
int xsrc,ysrc,xdst,ydst;
int src_offs;
- UINT8* vram = m_vdp2.gfx_decode;
+ UINT8* vram = m_vdp2.gfx_decode.get();
UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000;
int scrollx = stv2_current_tilemap.scrollx;
int scrolly = stv2_current_tilemap.scrolly;
@@ -3241,7 +3241,7 @@ void saturn_state::draw_8bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipr
int xsize, ysize, xsize_mask, ysize_mask;
int xsrc,ysrc,xdst,ydst;
int src_offs;
- UINT8* vram = m_vdp2.gfx_decode;
+ UINT8* vram = m_vdp2.gfx_decode.get();
UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000;
int scrollx = stv2_current_tilemap.scrollx;
int scrolly = stv2_current_tilemap.scrolly;
@@ -3300,7 +3300,7 @@ void saturn_state::draw_11bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip
int xsize, ysize, xsize_mask, ysize_mask;
int xsrc,ysrc,xdst,ydst;
int src_offs;
- UINT8* vram = m_vdp2.gfx_decode;
+ UINT8* vram = m_vdp2.gfx_decode.get();
UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000;
int scrollx = stv2_current_tilemap.scrollx;
int scrolly = stv2_current_tilemap.scrolly;
@@ -3358,7 +3358,7 @@ void saturn_state::draw_rgb15_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip
int xsize, ysize, xsize_mask, ysize_mask;
int xsrc,ysrc,xdst,ydst;
int src_offs;
- UINT8* vram = m_vdp2.gfx_decode;
+ UINT8* vram = m_vdp2.gfx_decode.get();
UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000;
int scrollx = stv2_current_tilemap.scrollx;
int scrolly = stv2_current_tilemap.scrolly;
@@ -3416,7 +3416,7 @@ void saturn_state::draw_rgb32_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip
int xsize, ysize, xsize_mask, ysize_mask;
int xsrc,ysrc,xdst,ydst;
int src_offs;
- UINT8* vram = m_vdp2.gfx_decode;
+ UINT8* vram = m_vdp2.gfx_decode.get();
UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000;
int scrollx = stv2_current_tilemap.scrollx;
int scrolly = stv2_current_tilemap.scrolly;
@@ -4327,7 +4327,7 @@ void saturn_state::stv_vdp2_check_tilemap_with_linescroll(bitmap_rgb32 &bitmap,
void saturn_state::stv_vdp2_draw_line(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int x,y;
- UINT8* gfxdata = m_vdp2.gfx_decode;
+ UINT8* gfxdata = m_vdp2.gfx_decode.get();
UINT32 base_offs,base_mask;
UINT32 pix;
UINT8 interlace;
@@ -5581,7 +5581,7 @@ void saturn_state::stv_vdp2_draw_RBG0(bitmap_rgb32 &bitmap, const rectangle &cli
void saturn_state::stv_vdp2_draw_back(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int x,y;
- UINT8* gfxdata = m_vdp2.gfx_decode;
+ UINT8* gfxdata = m_vdp2.gfx_decode.get();
UINT32 base_offs,base_mask;
UINT8 interlace;
@@ -5627,7 +5627,7 @@ READ32_MEMBER ( saturn_state::saturn_vdp2_vram_r )
WRITE32_MEMBER ( saturn_state::saturn_vdp2_vram_w )
{
- UINT8* gfxdata = m_vdp2.gfx_decode;
+ UINT8* gfxdata = m_vdp2.gfx_decode.get();
COMBINE_DATA(&m_vdp2_vram[offset]);
@@ -6057,7 +6057,7 @@ int saturn_state::get_vcounter( void )
void saturn_state::stv_vdp2_state_save_postload( void )
{
- UINT8 *gfxdata = m_vdp2.gfx_decode;
+ UINT8 *gfxdata = m_vdp2.gfx_decode.get();
int offset;
UINT32 data;
@@ -6104,7 +6104,7 @@ int saturn_state::stv_vdp2_start ( void )
m_vdp2_regs = auto_alloc_array_clear(machine(), UINT16, 0x040000/2 );
m_vdp2_vram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4 );
m_vdp2_cram = auto_alloc_array_clear(machine(), UINT32, 0x080000/4 );
- m_vdp2.gfx_decode = auto_alloc_array(machine(), UINT8, 0x100000 );
+ m_vdp2.gfx_decode = std::make_unique<UINT8[]>(0x100000 );
// m_gfxdecode->gfx(0)->granularity()=4;
// m_gfxdecode->gfx(1)->granularity()=4;
@@ -6129,10 +6129,10 @@ VIDEO_START_MEMBER(saturn_state,stv_vdp2)
stv_vdp2_start();
stv_vdp1_start();
m_vdpdebug_roz = 0;
- m_gfxdecode->gfx(0)->set_source(m_vdp2.gfx_decode);
- m_gfxdecode->gfx(1)->set_source(m_vdp2.gfx_decode);
- m_gfxdecode->gfx(2)->set_source(m_vdp2.gfx_decode);
- m_gfxdecode->gfx(3)->set_source(m_vdp2.gfx_decode);
+ m_gfxdecode->gfx(0)->set_source(m_vdp2.gfx_decode.get());
+ m_gfxdecode->gfx(1)->set_source(m_vdp2.gfx_decode.get());
+ m_gfxdecode->gfx(2)->set_source(m_vdp2.gfx_decode.get());
+ m_gfxdecode->gfx(3)->set_source(m_vdp2.gfx_decode.get());
/* calc V counter offsets */
/* 224 mode */
diff --git a/src/devices/video/vic4567.cpp b/src/devices/video/vic4567.cpp
index e04a4851dcc..8df490408f8 100644
--- a/src/devices/video/vic4567.cpp
+++ b/src/devices/video/vic4567.cpp
@@ -172,7 +172,7 @@ void vic3_device::device_start()
width = m_screen->width();
height = m_screen->height();
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_bitmap = std::make_unique<bitmap_ind16>(width, height);
m_dma_read_cb.resolve_safe(0);
m_dma_read_color_cb.resolve_safe(0);
diff --git a/src/devices/video/vic4567.h b/src/devices/video/vic4567.h
index ddf17a6a6b3..b4b179d43d5 100644
--- a/src/devices/video/vic4567.h
+++ b/src/devices/video/vic4567.h
@@ -185,7 +185,7 @@ private:
UINT16 m_chargenaddr, m_videoaddr, m_bitmapaddr;
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
int m_x_begin, m_x_end;
int m_y_begin, m_y_end;
diff --git a/src/emu/machine.h b/src/emu/machine.h
index 755e8466384..271eaa92e13 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -73,13 +73,6 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is e
#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine &>(m).respool(), t, c)
#define auto_free(m, v) pool_free(static_cast<running_machine &>(m).respool(), v)
-#define auto_bitmap_ind8_alloc(m, w, h) auto_alloc(m, bitmap_ind8(w, h))
-#define auto_bitmap_ind16_alloc(m, w, h) auto_alloc(m, bitmap_ind16(w, h))
-#define auto_bitmap_ind32_alloc(m, w, h) auto_alloc(m, bitmap_ind32(w, h))
-#define auto_bitmap_rgb32_alloc(m, w, h) auto_alloc(m, bitmap_rgb32(w, h))
-
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp
index 6456d425ddd..cf3da0d8b90 100644
--- a/src/emu/ui/menu.cpp
+++ b/src/emu/ui/menu.cpp
@@ -31,7 +31,7 @@
ui_menu *ui_menu::menu_stack;
ui_menu *ui_menu::menu_free;
-bitmap_rgb32 *ui_menu::hilight_bitmap;
+std::unique_ptr<bitmap_rgb32> ui_menu::hilight_bitmap;
render_texture *ui_menu::hilight_texture;
render_texture *ui_menu::arrow_texture;
@@ -84,7 +84,7 @@ void ui_menu::init(running_machine &machine)
ui_menu::stack_reset(machine);
// create a texture for hilighting items
- hilight_bitmap = auto_bitmap_rgb32_alloc(machine, 256, 1);
+ hilight_bitmap = std::make_unique<bitmap_rgb32>(256, 1);
for (x = 0; x < 256; x++)
{
int alpha = 0xff;
diff --git a/src/emu/ui/menu.h b/src/emu/ui/menu.h
index c16add8d5c8..b52b0f90ff4 100644
--- a/src/emu/ui/menu.h
+++ b/src/emu/ui/menu.h
@@ -170,7 +170,7 @@ public:
private:
static ui_menu *menu_free;
- static bitmap_rgb32 *hilight_bitmap;
+ static std::unique_ptr<bitmap_rgb32> hilight_bitmap;
static render_texture *hilight_texture, *arrow_texture;
bool m_special_main_menu;
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp
index 3a016b25b10..39eeb6e5edb 100644
--- a/src/emu/ui/ui.cpp
+++ b/src/emu/ui/ui.cpp
@@ -244,7 +244,7 @@ ui_manager::ui_manager(running_machine &machine)
// more initialization
set_handler(handler_messagebox, 0);
- m_non_char_keys_down = auto_alloc_array(machine, UINT8, (ARRAY_LENGTH(non_char_keys) + 7) / 8);
+ m_non_char_keys_down = std::make_unique<UINT8[]>((ARRAY_LENGTH(non_char_keys) + 7) / 8);
m_mouse_show = machine.system().flags & MACHINE_CLICKABLE_ARTWORK ? true : false;
// request a callback upon exiting
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h
index 987cf2b8976..ac68a2fb773 100644
--- a/src/emu/ui/ui.h
+++ b/src/emu/ui/ui.h
@@ -179,7 +179,7 @@ private:
bool m_show_profiler;
osd_ticks_t m_popup_text_end;
bool m_use_natural_keyboard;
- UINT8 * m_non_char_keys_down;
+ std::unique_ptr<UINT8[]> m_non_char_keys_down;
render_texture * m_mouse_arrow_texture;
bool m_mouse_show;
diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h
index afbd3dcf9a1..6b92b528614 100644
--- a/src/lib/util/coretmpl.h
+++ b/src/lib/util/coretmpl.h
@@ -17,6 +17,7 @@
#include "corealloc.h"
#include <vector>
+#include <memory>
// TEMPORARY helper to catch is_pod assertions in the debugger
#if 0
@@ -27,6 +28,24 @@
typedef std::vector<UINT8> dynamic_buffer;
+template<typename T>
+inline std::unique_ptr<T> make_unique_clear(std::size_t size)
+{
+ auto ptr = std::make_unique<T>(size);
+ static_assert(std::is_array<T>::value, "Type must be array");
+ memset(ptr.get(), 0, sizeof(std::remove_extent<T>) * size);
+ return ptr;
+}
+
+template<typename T>
+inline std::unique_ptr<T> make_unique_clear()
+{
+ auto ptr = std::make_unique<T>();
+ static_assert(std::is_pod<T>::value, "Type must be plain old data type");
+ memset(ptr.get(), 0, sizeof(T));
+ return ptr;
+}
+
// ======================> simple_list
diff --git a/src/mame/audio/cclimber.cpp b/src/mame/audio/cclimber.cpp
index cce1cc98d36..23ed02302b7 100644
--- a/src/mame/audio/cclimber.cpp
+++ b/src/mame/audio/cclimber.cpp
@@ -13,8 +13,8 @@
SAMPLES_START_CB_MEMBER( cclimber_audio_device::sh_start )
{
if (machine().root_device().memregion("samples")->base())
- m_sample_buf = auto_alloc_array(machine(), INT16, 2 * machine().root_device().memregion("samples")->bytes());
- save_pointer(NAME(m_sample_buf), 2 * machine().root_device().memregion("samples")->bytes());
+ m_sample_buf = std::make_unique<INT16[]>(2 * machine().root_device().memregion("samples")->bytes());
+ save_pointer(NAME(m_sample_buf.get()), 2 * machine().root_device().memregion("samples")->bytes());
}
MACHINE_CONFIG_FRAGMENT( cclimber_audio )
@@ -122,5 +122,5 @@ void cclimber_audio_device::play_sample(int start,int freq,int volume)
len++;
}
- m_samples->start_raw(0,m_sample_buf,2 * len,freq);
+ m_samples->start_raw(0,m_sample_buf.get(),2 * len,freq);
}
diff --git a/src/mame/audio/cclimber.h b/src/mame/audio/cclimber.h
index ef72fac26e4..6007aa0a831 100644
--- a/src/mame/audio/cclimber.h
+++ b/src/mame/audio/cclimber.h
@@ -52,7 +52,7 @@ protected:
void play_sample(int start,int freq,int volume);
private:
- INT16 *m_sample_buf; /* buffer to decode samples at run time */
+ std::unique_ptr<INT16[]> m_sample_buf; /* buffer to decode samples at run time */
int m_sample_num;
int m_sample_freq;
int m_sample_volume;
diff --git a/src/mame/audio/flower.cpp b/src/mame/audio/flower.cpp
index fcde400310d..fc8ef87b559 100644
--- a/src/mame/audio/flower.cpp
+++ b/src/mame/audio/flower.cpp
@@ -49,7 +49,7 @@ void flower_sound_device::device_start()
m_effect_timer = timer_alloc(TIMER_CLOCK_EFFECT);
m_stream = machine().sound().stream_alloc(*this, 0, 1, MIXER_SAMPLERATE);
- m_mixer_buffer = auto_alloc_array(machine(), short, MIXER_SAMPLERATE);
+ m_mixer_buffer = std::make_unique<short[]>(MIXER_SAMPLERATE);
make_mixer_table(8, MIXER_DEFGAIN);
/* extract globals from the interface */
@@ -114,10 +114,10 @@ void flower_sound_device::make_mixer_table(int voices, int gain)
int count = voices * 128;
/* allocate memory */
- m_mixer_table = auto_alloc_array(machine(), INT16, 256 * voices);
+ m_mixer_table = std::make_unique<INT16[]>(256 * voices);
/* find the middle of the table */
- m_mixer_lookup = m_mixer_table + (128 * voices);
+ m_mixer_lookup = m_mixer_table.get() + (128 * voices);
/* fill in the table - 16 bit case */
for (int i = 0; i < count; i++)
@@ -274,7 +274,7 @@ void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
int i;
/* zap the contents of the mixer buffer */
- memset(m_mixer_buffer, 0, samples * sizeof(short));
+ memset(m_mixer_buffer.get(), 0, samples * sizeof(short));
/* loop over each voice and add its contribution */
for (voice = m_channel_list; voice < m_last_channel; voice++)
@@ -303,7 +303,7 @@ void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
// bit 3: not used much, maybe pitch slide the other way?
v |= voice->voltab;
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
for (i = 0; i < samples; i++)
{
@@ -331,7 +331,7 @@ void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
}
/* mix it down */
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
for (i = 0; i < samples; i++)
*buffer++ = m_mixer_lookup[*mix++];
}
diff --git a/src/mame/audio/geebee.cpp b/src/mame/audio/geebee.cpp
index 58103b0b7f2..d16f3c68cb5 100644
--- a/src/mame/audio/geebee.cpp
+++ b/src/mame/audio/geebee.cpp
@@ -36,7 +36,7 @@ geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const ch
void geebee_sound_device::device_start()
{
- m_decay = auto_alloc_array(machine(), UINT16, 32768);
+ m_decay = std::make_unique<UINT16[]>(32768);
for (int i = 0; i < 0x8000; i++)
m_decay[0x7fff - i] = (INT16) (0x7fff/exp(1.0*i/4096));
diff --git a/src/mame/audio/gomoku.cpp b/src/mame/audio/gomoku.cpp
index 9362bc25fe1..9743ea2884e 100644
--- a/src/mame/audio/gomoku.cpp
+++ b/src/mame/audio/gomoku.cpp
@@ -59,8 +59,8 @@ void gomoku_sound_device::device_start()
m_stream = stream_alloc(0, 1, samplerate);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- m_mixer_buffer = auto_alloc_array(machine(), short, 2 * samplerate);
- m_mixer_buffer_2 = m_mixer_buffer + samplerate;
+ m_mixer_buffer = std::make_unique<short[]>(2 * samplerate);
+ m_mixer_buffer_2 = m_mixer_buffer.get() + samplerate;
/* build the mixer table */
make_mixer_table(8, defgain);
@@ -105,7 +105,7 @@ void gomoku_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
}
/* zap the contents of the mixer buffer */
- memset(m_mixer_buffer, 0, samples * sizeof(short));
+ memset(m_mixer_buffer.get(), 0, samples * sizeof(short));
/* loop over each voice and add its contribution */
for (ch = 0, voice = m_channel_list; voice < m_last_channel; ch++, voice++)
@@ -124,7 +124,7 @@ void gomoku_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
else
w_base = 0x100 * (m_soundregs2[0x1d] & 0x0f);
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
/* add our contribution */
for (i = 0; i < samples; i++)
@@ -167,7 +167,7 @@ void gomoku_sound_device::sound_stream_update(sound_stream &stream, stream_sampl
}
/* mix it down */
- mix = m_mixer_buffer;
+ mix = m_mixer_buffer.get();
for (i = 0; i < samples; i++)
*buffer++ = m_mixer_lookup[*mix++];
}
@@ -180,10 +180,10 @@ void gomoku_sound_device::make_mixer_table(int voices, int gain)
int i;
/* allocate memory */
- m_mixer_table = auto_alloc_array(machine(), INT16, 256 * voices);
+ m_mixer_table = std::make_unique<INT16[]>(256 * voices);
/* find the middle of the table */
- m_mixer_lookup = m_mixer_table + (128 * voices);
+ m_mixer_lookup = m_mixer_table.get() + (128 * voices);
/* fill in the table - 16 bit case */
for (i = 0; i < count; i++)
diff --git a/src/mame/audio/hng64.cpp b/src/mame/audio/hng64.cpp
index 220afc56240..982aa46ca70 100644
--- a/src/mame/audio/hng64.cpp
+++ b/src/mame/audio/hng64.cpp
@@ -92,7 +92,7 @@ WRITE32_MEMBER(hng64_state::hng64_soundram_w)
fp=fopen(filename, "w+b");
if (fp)
{
- fwrite((UINT8*)m_soundram, 0x80000*4, 1, fp);
+ fwrite((UINT8*)m_soundram.get(), 0x80000*4, 1, fp);
fclose(fp);
}
}
@@ -145,7 +145,7 @@ WRITE32_MEMBER( hng64_state::hng64_soundcpu_enable_w )
void hng64_state::reset_sound()
{
- UINT8 *RAM = (UINT8*)m_soundram;
+ UINT8 *RAM = (UINT8*)m_soundram.get();
membank("bank0")->set_base(&RAM[0x1f0000]);
membank("bank1")->set_base(&RAM[0x1f0000]);
membank("bank2")->set_base(&RAM[0x1f0000]);
@@ -222,7 +222,7 @@ WRITE16_MEMBER(hng64_state::hng64_sound_bank_w)
// the 2 early games don't do this.. maybe all banks actuallly default to that region tho?
// the sound code on those games seems buggier anyway.
- UINT8 *RAM = (UINT8*)m_soundram;
+ UINT8 *RAM = (UINT8*)m_soundram.get();
int bank = data & 0x1f;
diff --git a/src/mame/audio/phoenix.cpp b/src/mame/audio/phoenix.cpp
index 02c9cca051a..4fb3d244a76 100644
--- a/src/mame/audio/phoenix.cpp
+++ b/src/mame/audio/phoenix.cpp
@@ -83,7 +83,7 @@ void phoenix_sound_device::device_start()
m_discrete = machine().device<discrete_device>("discrete");
m_tms = machine().device<tms36xx_device>("tms");
- m_poly18 = auto_alloc_array(machine(), UINT32, 1ul << (18-5));
+ m_poly18 = std::make_unique<UINT32[]>(1ul << (18-5));
shiftreg = 0;
for( i = 0; i < (1ul << (18-5)); i++ )
@@ -112,7 +112,7 @@ void phoenix_sound_device::device_start()
save_item(NAME(m_noise_state.polyoffs));
save_item(NAME(m_noise_state.lowpass_counter));
save_item(NAME(m_noise_state.lowpass_polybit));
- save_pointer(NAME(m_poly18), (1ul << (18-5)));
+ save_pointer(NAME(m_poly18.get()), (1ul << (18-5)));
}
int phoenix_sound_device::update_c24(int samplerate)
diff --git a/src/mame/audio/redbaron.cpp b/src/mame/audio/redbaron.cpp
index ff50862cf7a..b8f71f1d5f2 100644
--- a/src/mame/audio/redbaron.cpp
+++ b/src/mame/audio/redbaron.cpp
@@ -65,7 +65,7 @@ void redbaron_sound_device::device_start()
{
int i;
- m_vol_lookup = auto_alloc_array(machine(), INT16, 32768);
+ m_vol_lookup = std::make_unique<INT16[]>(32768);
for( i = 0; i < 0x8000; i++ )
m_vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
diff --git a/src/mame/audio/redbaron.h b/src/mame/audio/redbaron.h
index dc65f9502fa..b7d11ae2ab7 100644
--- a/src/mame/audio/redbaron.h
+++ b/src/mame/audio/redbaron.h
@@ -22,7 +22,7 @@ protected:
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
private:
- INT16 *m_vol_lookup;
+ std::unique_ptr<INT16[]> m_vol_lookup;
INT16 m_vol_crash[16];
diff --git a/src/mame/audio/suna8.cpp b/src/mame/audio/suna8.cpp
index 5fe1ad7cbfe..43f70119b9a 100644
--- a/src/mame/audio/suna8.cpp
+++ b/src/mame/audio/suna8.cpp
@@ -18,7 +18,7 @@ SAMPLES_START_CB_MEMBER(suna8_state::sh_start)
int i, len = memregion("samples")->bytes() * 2; // 2 samples per byte
UINT8 *ROM = memregion("samples")->base();
- m_samplebuf = auto_alloc_array(machine(), INT16, len);
+ m_samplebuf = std::make_unique<INT16[]>(len);
// Convert 4 bit to 16 bit samples
for(i = 0; i < len; i++)
diff --git a/src/mame/audio/warpwarp.cpp b/src/mame/audio/warpwarp.cpp
index 728ac384e33..d0c17d54d77 100644
--- a/src/mame/audio/warpwarp.cpp
+++ b/src/mame/audio/warpwarp.cpp
@@ -48,7 +48,7 @@ warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, cons
void warpwarp_sound_device::device_start()
{
- m_decay = auto_alloc_array(machine(), INT16, 32768);
+ m_decay = std::make_unique<INT16[]>(32768);
for (int i = 0; i < 0x8000; i++)
m_decay[0x7fff - i] = (INT16) (0x7fff/exp(1.0*i/4096));
diff --git a/src/mame/audio/warpwarp.h b/src/mame/audio/warpwarp.h
index 4f419e8a90e..c14c61f63b5 100644
--- a/src/mame/audio/warpwarp.h
+++ b/src/mame/audio/warpwarp.h
@@ -24,7 +24,7 @@ protected:
private:
// internal state
- UINT16 *m_decay;
+ std::unique_ptr<UINT16[]> m_decay;
sound_stream *m_channel;
int m_sound_latch;
int m_sound_signal;
@@ -67,7 +67,7 @@ protected:
private:
// internal state
- INT16 *m_decay;
+ std::unique_ptr<INT16[]> m_decay;
sound_stream *m_channel;
int m_sound_latch;
int m_music1_latch;
diff --git a/src/mame/drivers/acommand.cpp b/src/mame/drivers/acommand.cpp
index d08c0877b02..5da92a119ce 100644
--- a/src/mame/drivers/acommand.cpp
+++ b/src/mame/drivers/acommand.cpp
@@ -83,7 +83,7 @@ public:
required_shared_ptr<UINT16> m_ac_devram;
tilemap_t *m_tx_tilemap;
tilemap_t *m_bg_tilemap;
- UINT16 *m_ac_vregs;
+ std::unique_ptr<UINT16[]> m_ac_vregs;
UINT16 m_led0;
UINT16 m_led1;
UINT16 m_ufo_sw1;
@@ -199,7 +199,7 @@ void acommand_state::video_start()
m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(acommand_state::ac_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,512,32);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(acommand_state::ac_get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(acommand_state::bg_scan),this),16,16,256,16);
- m_ac_vregs = auto_alloc_array(machine(), UINT16, 0x80/2);
+ m_ac_vregs = std::make_unique<UINT16[]>(0x80/2);
m_tx_tilemap->set_transparent_pen(15);
}
diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp
index e3003b2c940..f01d9004c91 100644
--- a/src/mame/drivers/alg.cpp
+++ b/src/mame/drivers/alg.cpp
@@ -756,7 +756,7 @@ DRIVER_INIT_MEMBER(alg_state,aplatoon)
/* NOT DONE TODO FIGURE OUT THE RIGHT ORDER!!!! */
UINT8 *rom = memregion("user2")->base();
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x40000);
+ std::unique_ptr<UINT8[]> decrypted = std::make_unique<UINT8[]>(0x40000);
int i;
static const int shuffle[] =
@@ -766,8 +766,8 @@ DRIVER_INIT_MEMBER(alg_state,aplatoon)
};
for (i = 0; i < 64; i++)
- memcpy(decrypted + i * 0x1000, rom + shuffle[i] * 0x1000, 0x1000);
- memcpy(rom, decrypted, 0x40000);
+ memcpy(decrypted.get() + i * 0x1000, rom + shuffle[i] * 0x1000, 0x1000);
+ memcpy(rom, decrypted.get(), 0x40000);
logerror("decrypt done\n ");
}
diff --git a/src/mame/drivers/alphasma.cpp b/src/mame/drivers/alphasma.cpp
index 2ef3f77f253..f7f0d58d3a5 100644
--- a/src/mame/drivers/alphasma.cpp
+++ b/src/mame/drivers/alphasma.cpp
@@ -62,7 +62,7 @@ protected:
UINT8 m_matrix[2];
UINT8 m_port_a;
UINT8 m_port_d;
- bitmap_ind16 * m_tmp_bitmap;
+ std::unique_ptr<bitmap_ind16> m_tmp_bitmap;
};
class asma2k_state : public alphasmart_state
@@ -404,7 +404,7 @@ void alphasmart_state::machine_start()
m_rambank->configure_entries(0, 4, ram, 0x8000);
m_nvram->set_base(ram, 0x8000*4);
- m_tmp_bitmap = auto_bitmap_ind16_alloc(machine(), 6*40, 9*4);
+ m_tmp_bitmap = std::make_unique<bitmap_ind16>(6 * 40, 9 * 4);
}
void alphasmart_state::machine_reset()
diff --git a/src/mame/drivers/apexc.cpp b/src/mame/drivers/apexc.cpp
index f20a6d29685..dd992f1a209 100644
--- a/src/mame/drivers/apexc.cpp
+++ b/src/mame/drivers/apexc.cpp
@@ -26,7 +26,7 @@ public:
be edited - the existence of this register is a personnal
guess */
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
UINT32 m_old_edit_keys;
int m_old_control_keys;
@@ -568,7 +568,7 @@ void apexc_state::video_start()
int width = m_screen->width();
int height = m_screen->height();
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_bitmap = std::make_unique<bitmap_ind16>(width, height);
m_bitmap->fill(0, /*machine().visible_area*/teletyper_window);
}
diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp
index 8bfe1535524..502fa6b24a3 100644
--- a/src/mame/drivers/aristmk4.cpp
+++ b/src/mame/drivers/aristmk4.cpp
@@ -369,7 +369,7 @@ public:
int m_rtc_data_strobe;
UINT8 *m_shapeRomPtr;
UINT8 m_shapeRom[0xc000];
- UINT8 *m_nvram;
+ std::unique_ptr<UINT8[]> m_nvram;
UINT8 m_psg_data;
int m_ay8910_1;
int m_ay8910_2;
@@ -1661,12 +1661,12 @@ DRIVER_INIT_MEMBER(aristmk4_state,aristmk4)
{
m_shapeRomPtr = (UINT8 *)memregion("tile_gfx")->base();
memcpy(m_shapeRom,m_shapeRomPtr,sizeof(m_shapeRom)); // back up
- m_nvram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_nvram = std::make_unique<UINT8[]>(0x1000);
}
void aristmk4_state::machine_start()
{
- save_pointer(NAME(m_nvram), 0x1000); // m_nvram
+ save_pointer(NAME(m_nvram.get()), 0x1000); // m_nvram
}
void aristmk4_state::machine_reset()
diff --git a/src/mame/drivers/armedf.cpp b/src/mame/drivers/armedf.cpp
index 352de671596..2fe9162ffb5 100644
--- a/src/mame/drivers/armedf.cpp
+++ b/src/mame/drivers/armedf.cpp
@@ -319,7 +319,7 @@ Notes:
WRITE16_MEMBER(armedf_state::terraf_io_w)
{
if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition
- m_nb1414m4->exec((m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram,m_fg_scrollx,m_fg_scrolly,m_tx_tilemap);
+ m_nb1414m4->exec((m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram.get(),m_fg_scrollx,m_fg_scrolly,m_tx_tilemap);
COMBINE_DATA(&m_vreg);
diff --git a/src/mame/drivers/astinvad.cpp b/src/mame/drivers/astinvad.cpp
index ba265fb9fec..f98cccb3500 100644
--- a/src/mame/drivers/astinvad.cpp
+++ b/src/mame/drivers/astinvad.cpp
@@ -68,7 +68,7 @@ public:
required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_videoram;
- UINT8 * m_colorram;
+ std::unique_ptr<UINT8[]> m_colorram;
emu_timer *m_int_timer;
UINT8 m_sound_state[2];
UINT8 m_screen_flip;
@@ -117,10 +117,10 @@ protected:
VIDEO_START_MEMBER(astinvad_state,spaceint)
{
- m_colorram = auto_alloc_array(machine(), UINT8, m_videoram.bytes());
+ m_colorram = std::make_unique<UINT8[]>(m_videoram.bytes());
save_item(NAME(m_color_latch));
- save_pointer(NAME(m_colorram), m_videoram.bytes());
+ save_pointer(NAME(m_colorram.get()), m_videoram.bytes());
}
diff --git a/src/mame/drivers/astrof.cpp b/src/mame/drivers/astrof.cpp
index 76e0dbed3f4..73cf8950681 100644
--- a/src/mame/drivers/astrof.cpp
+++ b/src/mame/drivers/astrof.cpp
@@ -170,8 +170,8 @@ CUSTOM_INPUT_MEMBER(astrof_state::tomahawk_controls_r)
void astrof_state::video_start()
{
/* allocate the color RAM -- half the size of the video RAM as A0 is not connected */
- m_colorram = auto_alloc_array(machine(), UINT8, m_videoram.bytes() / 2);
- save_pointer(NAME(m_colorram), m_videoram.bytes() / 2);
+ m_colorram = std::make_unique<UINT8[]>(m_videoram.bytes() / 2);
+ save_pointer(NAME(m_colorram.get()), m_videoram.bytes() / 2);
}
diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp
index ddb2f038808..a3ad029f96b 100644
--- a/src/mame/drivers/atarig1.cpp
+++ b/src/mame/drivers/atarig1.cpp
@@ -118,7 +118,7 @@ void atarig1_state::update_bank(int bank)
{
/* bank 0 comes from the copy we made earlier */
if (bank == 0)
- memcpy(m_bslapstic_base, m_bslapstic_bank0, 0x2000);
+ memcpy(m_bslapstic_base, m_bslapstic_bank0.get(), 0x2000);
else
memcpy(m_bslapstic_base, &m_bslapstic_base[bank * 0x1000], 0x2000);
@@ -172,8 +172,8 @@ void atarig1_state::pitfightb_cheap_slapstic_init()
m_bslapstic_base = m_maincpu->space(AS_PROGRAM).install_read_handler(0x038000, 0x03ffff, read16_delegate(FUNC(atarig1_state::pitfightb_cheap_slapstic_r),this));
/* allocate memory for a copy of bank 0 */
- m_bslapstic_bank0 = auto_alloc_array(machine(), UINT8, 0x2000);
- memcpy(m_bslapstic_bank0, m_bslapstic_base, 0x2000);
+ m_bslapstic_bank0 = std::make_unique<UINT8[]>(0x2000);
+ memcpy(m_bslapstic_bank0.get(), m_bslapstic_base, 0x2000);
/* not primed by default */
m_bslapstic_primed = false;
diff --git a/src/mame/drivers/backfire.cpp b/src/mame/drivers/backfire.cpp
index 98341a9867c..06a2214b9e7 100644
--- a/src/mame/drivers/backfire.cpp
+++ b/src/mame/drivers/backfire.cpp
@@ -47,8 +47,8 @@ public:
{ }
/* memory pointers */
- UINT16 * m_spriteram_1;
- UINT16 * m_spriteram_2;
+ std::unique_ptr<UINT16[]> m_spriteram_1;
+ std::unique_ptr<UINT16[]> m_spriteram_2;
required_shared_ptr<UINT32> m_mainram;
required_shared_ptr<UINT32> m_left_priority;
required_shared_ptr<UINT32> m_right_priority;
@@ -56,8 +56,8 @@ public:
optional_device<decospr_device> m_sprgen2;
/* video related */
- bitmap_ind16 *m_left;
- bitmap_ind16 *m_right;
+ std::unique_ptr<bitmap_ind16> m_left;
+ std::unique_ptr<bitmap_ind16> m_right;
/* devices */
required_device<cpu_device> m_maincpu;
@@ -115,8 +115,8 @@ public:
/* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */
void backfire_state::video_start()
{
- m_spriteram_1 = auto_alloc_array(machine(), UINT16, 0x2000/2);
- m_spriteram_2 = auto_alloc_array(machine(), UINT16, 0x2000/2);
+ m_spriteram_1 = std::make_unique<UINT16[]>(0x2000/2);
+ m_spriteram_2 = std::make_unique<UINT16[]>(0x2000/2);
/* and register the allocated ram so that save states still work */
save_item(NAME(m_pf1_rowscroll));
@@ -124,11 +124,11 @@ void backfire_state::video_start()
save_item(NAME(m_pf3_rowscroll));
save_item(NAME(m_pf4_rowscroll));
- m_left = auto_bitmap_ind16_alloc(machine(), 80*8, 32*8);
- m_right = auto_bitmap_ind16_alloc(machine(), 80*8, 32*8);
+ m_left = std::make_unique<bitmap_ind16>(80*8, 32*8);
+ m_right = std::make_unique<bitmap_ind16>(80*8, 32*8);
- save_pointer(NAME(m_spriteram_1), 0x2000/2);
- save_pointer(NAME(m_spriteram_2), 0x2000/2);
+ save_pointer(NAME(m_spriteram_1.get()), 0x2000/2);
+ save_pointer(NAME(m_spriteram_2.get()), 0x2000/2);
save_item(NAME(*m_left));
save_item(NAME(*m_right));
@@ -153,13 +153,13 @@ UINT32 backfire_state::screen_update_backfire_left(screen_device &screen, bitmap
{
m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 1);
m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 2);
- m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
+ m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram_1.get(), 0x800);
}
else if (m_left_priority[0] == 2)
{
m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 2);
m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 4);
- m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
+ m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram_1.get(), 0x800);
}
else
popmessage( "unknown left priority %08x", m_left_priority[0]);
@@ -184,13 +184,13 @@ UINT32 backfire_state::screen_update_backfire_right(screen_device &screen, bitma
{
m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 1);
m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2);
- m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
+ m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2.get(), 0x800);
}
else if (m_right_priority[0] == 2)
{
m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2);
m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 4);
- m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
+ m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2.get(), 0x800);
}
else
popmessage( "unknown right priority %08x", m_right_priority[0]);
diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp
index e236de0c4ad..e51a4203581 100644
--- a/src/mame/drivers/blitz68k.cpp
+++ b/src/mame/drivers/blitz68k.cpp
@@ -73,7 +73,7 @@ public:
m_palette(*this, "palette") { }
optional_shared_ptr<UINT16> m_nvram;
- UINT8 *m_blit_buffer;
+ std::unique_ptr<UINT8[]> m_blit_buffer;
optional_shared_ptr<UINT16> m_frame_buffer;
optional_shared_ptr<UINT16> m_blit_romaddr;
optional_shared_ptr<UINT16> m_blit_attr1_ram;
@@ -206,7 +206,7 @@ struct blit_t
VIDEO_START_MEMBER(blitz68k_state,blitz68k)
{
- m_blit_buffer = auto_alloc_array(machine(), UINT8, 512*256);
+ m_blit_buffer = std::make_unique<UINT8[]>(512*256);
blit.addr_factor = 2;
}
@@ -220,7 +220,7 @@ UINT32 blitz68k_state::screen_update_blitz68k(screen_device &screen, bitmap_rgb3
{
int x,y;
- UINT8 *src = m_blit_buffer;
+ UINT8 *src = m_blit_buffer.get();
for(y = 0; y < 256; y++)
{
diff --git a/src/mame/drivers/bmcpokr.cpp b/src/mame/drivers/bmcpokr.cpp
index 6a645bc9fcf..46b3d297f13 100644
--- a/src/mame/drivers/bmcpokr.cpp
+++ b/src/mame/drivers/bmcpokr.cpp
@@ -85,7 +85,7 @@ public:
DECLARE_WRITE16_MEMBER(videoram_1_w);
DECLARE_WRITE16_MEMBER(videoram_2_w);
- bitmap_ind16 *m_pixbitmap;
+ std::unique_ptr<bitmap_ind16> m_pixbitmap;
void pixbitmap_redraw();
UINT16 m_pixpal;
DECLARE_WRITE16_MEMBER(pixram_w);
@@ -149,7 +149,7 @@ void bmcpokr_state::video_start()
m_tilemap_1->set_scroll_cols(1);
m_tilemap_2->set_scroll_cols(1);
- m_pixbitmap = auto_bitmap_ind16_alloc(machine(), 0x400, 0x200);
+ m_pixbitmap = std::make_unique<bitmap_ind16>(0x400, 0x200);
save_state();
}
diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp
index b0421009ec1..a2e405950c6 100644
--- a/src/mame/drivers/bml3.cpp
+++ b/src/mame/drivers/bml3.cpp
@@ -145,7 +145,7 @@ private:
virtual void machine_start() override;
void m6845_change_clock(UINT8 setting);
UINT8 m_crtc_index;
- UINT8 *m_extram;
+ std::unique_ptr<UINT8[]> m_extram;
UINT8 m_firq_mask;
UINT8 m_firq_status;
required_device<cpu_device> m_maincpu;
@@ -762,7 +762,7 @@ INTERRUPT_GEN_MEMBER(bml3_state::bml3_timer_firq)
void bml3_state::machine_start()
{
- m_extram = auto_alloc_array(machine(),UINT8,0x10000);
+ m_extram = std::make_unique<UINT8[]>(0x10000);
m_p_chargen = memregion("chargen")->base();
m_p_videoram = memregion("vram")->base();
m_psg_latch = 0;
diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp
index 6b446ae47d2..18354d8e5dc 100644
--- a/src/mame/drivers/calchase.cpp
+++ b/src/mame/drivers/calchase.cpp
@@ -149,8 +149,8 @@ public:
{
}
- UINT32 *m_bios_ram;
- UINT32 *m_bios_ext_ram;
+ std::unique_ptr<UINT32[]> m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext_ram;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -204,11 +204,11 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
if (reg == 0x63)
{
if (data & 0x20) // enable RAM access to region 0xf0000 - 0xfffff
- state->membank("bios_bank")->set_base(state->m_bios_ram);
+ state->membank("bios_bank")->set_base(state->m_bios_ram.get());
else // disable RAM access (reads go to BIOS ROM)
state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x10000);
if (data & 0x80) // enable RAM access to region 0xe0000 - 0xeffff
- state->membank("bios_ext")->set_base(state->m_bios_ext_ram);
+ state->membank("bios_ext")->set_base(state->m_bios_ext_ram.get());
else
state->membank("bios_ext")->set_base(state->memregion("bios")->base() + 0);
}
@@ -339,7 +339,7 @@ WRITE32_MEMBER(calchase_state::bios_ram_w)
{
if (m_mtxc_config_reg[0x63] & 0x10) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -347,7 +347,7 @@ WRITE32_MEMBER(calchase_state::bios_ext_ram_w)
{
if (m_mtxc_config_reg[0x63] & 0x40) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext_ram + offset);
+ COMBINE_DATA(m_bios_ext_ram.get() + offset);
}
}
@@ -641,8 +641,8 @@ INPUT_PORTS_END
void calchase_state::machine_start()
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
- m_bios_ext_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x10000/4);
+ m_bios_ext_ram = std::make_unique<UINT32[]>(0x10000/4);
}
void calchase_state::machine_reset()
@@ -725,7 +725,7 @@ WRITE32_MEMBER(calchase_state::calchase_idle_skip_w)
DRIVER_INIT_MEMBER(calchase_state,calchase)
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x20000/4);
intel82439tx_init();
@@ -734,7 +734,7 @@ DRIVER_INIT_MEMBER(calchase_state,calchase)
DRIVER_INIT_MEMBER(calchase_state, hostinv)
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x20000/4);
intel82439tx_init();
}
diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp
index 16dcead7cde..254a9bdbd2a 100644
--- a/src/mame/drivers/cc40.cpp
+++ b/src/mame/drivers/cc40.cpp
@@ -116,7 +116,7 @@ public:
UINT8 m_clock_divider;
UINT8 m_key_select;
- UINT8 *m_sysram[2];
+ std::unique_ptr<UINT8[]> m_sysram[2];
UINT16 m_sysram_size[2];
UINT16 m_sysram_end[2];
UINT16 m_sysram_mask[2];
@@ -523,15 +523,15 @@ void cc40_state::init_sysram(int chip, UINT16 size)
if (m_sysram[chip] == nullptr)
{
// init to largest possible
- m_sysram[chip] = auto_alloc_array(machine(), UINT8, 0x2000);
- save_pointer(NAME(m_sysram[chip]), 0x2000, chip);
+ m_sysram[chip] = std::make_unique<UINT8[]>(0x2000);
+ save_pointer(NAME(m_sysram[chip].get()), 0x2000, chip);
save_item(NAME(m_sysram_size[chip]), chip);
save_item(NAME(m_sysram_end[chip]), chip);
save_item(NAME(m_sysram_mask[chip]), chip);
}
- m_nvram[chip]->set_base(m_sysram[chip], size);
+ m_nvram[chip]->set_base(m_sysram[chip].get(), size);
m_sysram_size[chip] = size;
}
diff --git a/src/mame/drivers/cham24.cpp b/src/mame/drivers/cham24.cpp
index 15a0758538e..0fc42e73776 100644
--- a/src/mame/drivers/cham24.cpp
+++ b/src/mame/drivers/cham24.cpp
@@ -72,7 +72,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<ppu2c0x_device> m_ppu;
- UINT8* m_nt_ram;
+ std::unique_ptr<UINT8[]> m_nt_ram;
UINT8* m_nt_page[4];
UINT32 m_in_0;
UINT32 m_in_1;
@@ -102,29 +102,29 @@ void cham24_state::cham24_set_mirroring( int mirroring )
switch(mirroring)
{
case PPU_MIRROR_LOW:
- m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram;
+ m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram.get();
break;
case PPU_MIRROR_HIGH:
- m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram + 0x400;
+ m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_HORZ:
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram;
- m_nt_page[2] = m_nt_ram + 0x400;
- m_nt_page[3] = m_nt_ram + 0x400;
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get();
+ m_nt_page[2] = m_nt_ram.get() + 0x400;
+ m_nt_page[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_VERT:
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram;
- m_nt_page[3] = m_nt_ram + 0x400;
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get();
+ m_nt_page[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_NONE:
default:
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
break;
}
}
@@ -289,11 +289,11 @@ void cham24_state::machine_start()
membank("bank1")->set_base(memregion("gfx1")->base());
/* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
/* and read/write handlers */
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff,read8_delegate(FUNC(cham24_state::nt_r), this), write8_delegate(FUNC(cham24_state::nt_w), this));
diff --git a/src/mame/drivers/chinsan.cpp b/src/mame/drivers/chinsan.cpp
index c0f51e3cea8..49d8e3e4adf 100644
--- a/src/mame/drivers/chinsan.cpp
+++ b/src/mame/drivers/chinsan.cpp
@@ -87,7 +87,7 @@ public:
required_device<msm5205_device> m_adpcm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- UINT8 *m_decrypted_opcodes;
+ std::unique_ptr<UINT8[]> m_decrypted_opcodes;
};
@@ -572,8 +572,8 @@ WRITE_LINE_MEMBER(chinsan_state::chin_adpcm_int)
void chinsan_state::machine_start()
{
membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x4000);
- membank("bank0d")->set_base(m_decrypted_opcodes);
- membank("bank1d")->configure_entries(0, 4, m_decrypted_opcodes + 0x8000, 0x4000);
+ membank("bank0d")->set_base(m_decrypted_opcodes.get());
+ membank("bank1d")->configure_entries(0, 4, m_decrypted_opcodes.get() + 0x8000, 0x4000);
save_item(NAME(m_adpcm_idle));
save_item(NAME(m_port_select));
@@ -677,8 +677,8 @@ ROM_END
DRIVER_INIT_MEMBER(chinsan_state,chinsan)
{
- m_decrypted_opcodes = auto_alloc_array(machine(), UINT8, 0x18000);
- mc8123_decode(memregion("maincpu")->base(), m_decrypted_opcodes, memregion("user1")->base(), 0x18000);
+ m_decrypted_opcodes = std::make_unique<UINT8[]>(0x18000);
+ mc8123_decode(memregion("maincpu")->base(), m_decrypted_opcodes.get(), memregion("user1")->base(), 0x18000);
}
diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp
index a1e90713cb9..c5842421c16 100644
--- a/src/mame/drivers/cobra.cpp
+++ b/src/mame/drivers/cobra.cpp
@@ -358,15 +358,15 @@ public:
cobra_renderer(screen_device &screen)
: poly_manager<float, cobra_polydata, 8, 10000>(screen)
{
- m_texture_ram = auto_alloc_array(machine(), UINT32, 0x100000);
+ m_texture_ram = std::make_unique<UINT32[]>(0x100000);
- m_framebuffer = auto_bitmap_rgb32_alloc(machine(), 1024, 1024);
- m_backbuffer = auto_bitmap_rgb32_alloc(machine(), 1024, 1024);
- m_overlay = auto_bitmap_rgb32_alloc(machine(), 1024, 1024);
- m_zbuffer = auto_bitmap_ind32_alloc(machine(), 1024, 1024);
- m_stencil = auto_bitmap_ind32_alloc(machine(), 1024, 1024);
+ m_framebuffer = std::make_unique<bitmap_rgb32>( 1024, 1024);
+ m_backbuffer = std::make_unique<bitmap_rgb32>( 1024, 1024);
+ m_overlay = std::make_unique<bitmap_rgb32>( 1024, 1024);
+ m_zbuffer = std::make_unique<bitmap_ind32>(1024, 1024);
+ m_stencil = std::make_unique<bitmap_ind32>(1024, 1024);
- m_gfx_regmask = auto_alloc_array(machine(), UINT32, 0x100);
+ m_gfx_regmask = std::make_unique<UINT32[]>(0x100);
for (int i=0; i < 0x100; i++)
{
UINT32 mask = 0;
@@ -400,19 +400,19 @@ public:
void display(bitmap_rgb32 *bitmap, const rectangle &cliprect);
inline rgb_t texture_fetch(UINT32 *texture, int u, int v, int width, int format);
private:
- bitmap_rgb32 *m_framebuffer;
- bitmap_rgb32 *m_backbuffer;
- bitmap_rgb32 *m_overlay;
- bitmap_ind32 *m_zbuffer;
- bitmap_ind32 *m_stencil;
+ std::unique_ptr<bitmap_rgb32> m_framebuffer;
+ std::unique_ptr<bitmap_rgb32> m_backbuffer;
+ std::unique_ptr<bitmap_rgb32> m_overlay;
+ std::unique_ptr<bitmap_ind32> m_zbuffer;
+ std::unique_ptr<bitmap_ind32> m_stencil;
- UINT32 *m_texture_ram;
+ std::unique_ptr<UINT32[]> m_texture_ram;
- UINT32 *m_gfx_gram;
- UINT32 *m_gfx_regmask;
+ std::unique_ptr<UINT32[]> m_gfx_gram;
+ std::unique_ptr<UINT32[]> m_gfx_regmask;
UINT32 m_gfx_register_select;
- UINT64 *m_gfx_register;
+ std::unique_ptr<UINT64[]> m_gfx_register;
UINT32 m_texram_ptr;
@@ -451,7 +451,7 @@ public:
cobra_fifo(running_machine &machine, int capacity, const char *name, bool verbose, event_delegate event_callback)
{
- m_data = auto_alloc_array(machine, UINT64, capacity);
+ m_data = std::make_unique<UINT64[]>(capacity);
m_name = name;
m_size = capacity;
@@ -481,7 +481,7 @@ private:
int m_num;
bool m_verbose;
const char *m_name;
- UINT64 *m_data;
+ std::unique_ptr<UINT64[]> m_data;
event_delegate m_event_callback;
};
@@ -708,7 +708,7 @@ public:
UINT8 m_main_int_active;
- UINT32 *m_comram[2];
+ std::unique_ptr<UINT32[]> m_comram[2];
int m_comram_page;
int m_main_debug_state;
@@ -737,8 +737,8 @@ public:
bool m_has_psac;
- INT16 *m_sound_dma_buffer_l;
- INT16 *m_sound_dma_buffer_r;
+ std::unique_ptr<INT16[]> m_sound_dma_buffer_l;
+ std::unique_ptr<INT16[]> m_sound_dma_buffer_r;
UINT32 m_sound_dma_ptr;
dmadac_sound_device *m_dmadac[2];
@@ -1895,7 +1895,7 @@ WRITE32_MEMBER(cobra_state::sub_comram_w)
{
int page = m_comram_page ^ 1;
- COMBINE_DATA(m_comram[page] + offset);
+ COMBINE_DATA(m_comram[page].get() + offset);
}
WRITE32_MEMBER(cobra_state::sub_psac_palette_w)
@@ -1946,8 +1946,8 @@ WRITE32_MEMBER(cobra_state::sub_sound_dma_w)
{
m_sound_dma_ptr = 0;
- dmadac_transfer(&m_dmadac[0], 1, 0, 1, DMA_SOUND_BUFFER_SIZE, m_sound_dma_buffer_l);
- dmadac_transfer(&m_dmadac[1], 1, 0, 1, DMA_SOUND_BUFFER_SIZE, m_sound_dma_buffer_r);
+ dmadac_transfer(&m_dmadac[0], 1, 0, 1, DMA_SOUND_BUFFER_SIZE, m_sound_dma_buffer_l.get());
+ dmadac_transfer(&m_dmadac[1], 1, 0, 1, DMA_SOUND_BUFFER_SIZE, m_sound_dma_buffer_r.get());
}
}
@@ -2052,9 +2052,9 @@ void cobra_renderer::gfx_init()
{
const rectangle& visarea = screen().visible_area();
- m_gfx_gram = auto_alloc_array(machine(), UINT32, 0x40000);
+ m_gfx_gram = std::make_unique<UINT32[]>(0x40000);
- m_gfx_register = auto_alloc_array(machine(), UINT64, 0x3000);
+ m_gfx_register = std::make_unique<UINT64[]>(0x3000);
m_gfx_register_select = 0;
float zvalue = 10000000.0f;
@@ -3298,13 +3298,13 @@ DRIVER_INIT_MEMBER(cobra_state, cobra)
m_subcpu->ppc4xx_spu_set_tx_handler(write8_delegate(FUNC(cobra_state::sub_jvs_w), this));
- m_comram[0] = auto_alloc_array(machine(), UINT32, 0x40000/4);
- m_comram[1] = auto_alloc_array(machine(), UINT32, 0x40000/4);
+ m_comram[0] = std::make_unique<UINT32[]>(0x40000/4);
+ m_comram[1] = std::make_unique<UINT32[]>(0x40000/4);
m_comram_page = 0;
- m_sound_dma_buffer_l = auto_alloc_array(machine(), INT16, DMA_SOUND_BUFFER_SIZE);
- m_sound_dma_buffer_r = auto_alloc_array(machine(), INT16, DMA_SOUND_BUFFER_SIZE);
+ m_sound_dma_buffer_l = std::make_unique<INT16[]>(DMA_SOUND_BUFFER_SIZE);
+ m_sound_dma_buffer_r = std::make_unique<INT16[]>(DMA_SOUND_BUFFER_SIZE);
// setup fake pagetable until we figure out what really maps there...
//m_gfx_pagetable[0x80 / 8] = U64(0x800001001e0001a8);
diff --git a/src/mame/drivers/cocoloco.cpp b/src/mame/drivers/cocoloco.cpp
index 7cb6dec9d94..e3c34d62014 100644
--- a/src/mame/drivers/cocoloco.cpp
+++ b/src/mame/drivers/cocoloco.cpp
@@ -195,7 +195,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
UINT8 m_videobank;
DECLARE_READ8_MEMBER(vram_r);
@@ -290,9 +290,9 @@ PALETTE_INIT_MEMBER(cocoloco_state, cocoloco)
void cocoloco_state::video_start()
{
- m_videoram = auto_alloc_array(machine(), UINT8, 0x2000 * 8);
+ m_videoram = std::make_unique<UINT8[]>(0x2000 * 8);
- save_pointer(NAME(m_videoram), 0x2000 * 8);
+ save_pointer(NAME(m_videoram.get()), 0x2000 * 8);
save_item(NAME(m_videobank));
}
diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp
index 2e5b1263a32..912c55d3afa 100644
--- a/src/mame/drivers/coolridr.cpp
+++ b/src/mame/drivers/coolridr.cpp
@@ -390,8 +390,8 @@ public:
UINT8 sound_data, sound_fifo;
UINT8* m_compressedgfx;
- UINT16* m_expanded_10bit_gfx;
- UINT16* m_rearranged_16bit_gfx;
+ std::unique_ptr<UINT16[]> m_expanded_10bit_gfx;
+ std::unique_ptr<UINT16[]> m_rearranged_16bit_gfx;
UINT32 get_20bit_data(UINT32 romoffset, int _20bitwordnum);
UINT16 get_10bit_data(UINT32 romoffset, int _10bitwordnum);
@@ -1319,8 +1319,8 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid)
- UINT16* rearranged_16bit_gfx = object->state->m_rearranged_16bit_gfx;
- UINT16* expanded_10bit_gfx = object->state->m_expanded_10bit_gfx;
+ UINT16* rearranged_16bit_gfx = object->state->m_rearranged_16bit_gfx.get();
+ UINT16* expanded_10bit_gfx = object->state->m_expanded_10bit_gfx.get();
INT16 clipminX = CLIPMINX_FULL;
INT16 clipmaxX = CLIPMAXX_FULL;
@@ -3621,7 +3621,7 @@ void coolridr_state::machine_start()
size_t size = memregion( "compressedgfx" )->bytes();
// we're expanding 10bit packed data to 16bits(10 used)
- m_expanded_10bit_gfx = auto_alloc_array(machine(), UINT16, ((size/10)*16)/2);
+ m_expanded_10bit_gfx = std::make_unique<UINT16[]>(((size/10)*16)/2);
for (int i=0;i<(0x800000*8)/2;i++)
{
@@ -3630,7 +3630,7 @@ void coolridr_state::machine_start()
// do a rearranged version too with just the 16-bit words in a different order, palettes seem to
// be referenced this way?!
- m_rearranged_16bit_gfx = auto_alloc_array(machine(), UINT16, size/2);
+ m_rearranged_16bit_gfx = std::make_unique<UINT16[]>(size/2);
UINT16* compressed = (UINT16*)memregion( "compressedgfx" )->base();
int count = 0;
@@ -3660,7 +3660,7 @@ void coolridr_state::machine_start()
{
for (int i=0;i<(0x800000*8);i++)
{
- fwrite((UINT8*)m_expanded_10bit_gfx+(i^1), 1, 1, fp);
+ fwrite((UINT8*)m_expanded_10bit_gfx.get()+(i^1), 1, 1, fp);
}
fclose(fp);
diff --git a/src/mame/drivers/cps2.cpp b/src/mame/drivers/cps2.cpp
index 248160d3134..345beb1eee2 100644
--- a/src/mame/drivers/cps2.cpp
+++ b/src/mame/drivers/cps2.cpp
@@ -9368,8 +9368,8 @@ DRIVER_INIT_MEMBER(cps_state,gigaman2)
DRIVER_INIT_CALL(cps2nc);
- m_gigaman2_dummyqsound_ram = auto_alloc_array(machine(), UINT16, 0x20000 / 2);
- save_pointer(NAME(m_gigaman2_dummyqsound_ram), 0x20000 / 2);
+ m_gigaman2_dummyqsound_ram = std::make_unique<UINT16[]>(0x20000 / 2);
+ save_pointer(NAME(m_gigaman2_dummyqsound_ram.get()), 0x20000 / 2);
space.install_readwrite_handler(0x618000, 0x619fff, read16_delegate(FUNC(cps_state::gigaman2_dummyqsound_r),this), write16_delegate(FUNC(cps_state::gigaman2_dummyqsound_w), this)); // no qsound..
diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp
index aeb038e8199..8868118f89e 100644
--- a/src/mame/drivers/cps3.cpp
+++ b/src/mame/drivers/cps3.cpp
@@ -782,8 +782,8 @@ void cps3_state::init_common(void)
for (int chipnum = 0; chipnum < 8; chipnum++)
m_simm[simmnum][chipnum] = machine().device<fujitsu_29f016a_device>(strformat(tempstr,"simm%d.%d", simmnum + 1, chipnum).c_str());
- m_eeprom = auto_alloc_array(machine(), UINT32, 0x400/4);
- machine().device<nvram_device>("eeprom")->set_base(m_eeprom, 0x400);
+ m_eeprom = std::make_unique<UINT32[]>(0x400/4);
+ machine().device<nvram_device>("eeprom")->set_base(m_eeprom.get(), 0x400);
}
@@ -894,27 +894,27 @@ void cps3_state::cps3_set_mame_colours(int colournum, UINT16 data, UINT32 fadeva
void cps3_state::video_start()
{
- m_ss_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
- memset(m_ss_ram, 0x00, 0x10000);
- save_pointer(NAME(m_ss_ram), 0x10000/4);
+ m_ss_ram = std::make_unique<UINT32[]>(0x10000/4);
+ memset(m_ss_ram.get(), 0x00, 0x10000);
+ save_pointer(NAME(m_ss_ram.get()), 0x10000/4);
- m_char_ram = auto_alloc_array(machine(), UINT32, 0x800000/4);
- memset(m_char_ram, 0x00, 0x800000);
- save_pointer(NAME(m_char_ram), 0x800000 /4);
+ m_char_ram = std::make_unique<UINT32[]>(0x800000/4);
+ memset(m_char_ram.get(), 0x00, 0x800000);
+ save_pointer(NAME(m_char_ram.get()), 0x800000 /4);
/* create the char set (gfx will then be updated dynamically from RAM) */
- m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, cps3_tiles8x8_layout, (UINT8 *)m_ss_ram, 0, m_palette->entries() / 16, 0)));
+ m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, cps3_tiles8x8_layout, (UINT8 *)m_ss_ram.get(), 0, m_palette->entries() / 16, 0)));
//decode_ssram();
/* create the char set (gfx will then be updated dynamically from RAM) */
- m_gfxdecode->set_gfx(1, global_alloc(gfx_element(m_palette, cps3_tiles16x16_layout, (UINT8 *)m_char_ram, 0, m_palette->entries() / 64, 0)));
+ m_gfxdecode->set_gfx(1, global_alloc(gfx_element(m_palette, cps3_tiles16x16_layout, (UINT8 *)m_char_ram.get(), 0, m_palette->entries() / 64, 0)));
m_gfxdecode->gfx(1)->set_granularity(64);
//decode_charram();
- m_mame_colours = auto_alloc_array(machine(), UINT32, 0x80000/4);
- memset(m_mame_colours, 0x00, 0x80000);
+ m_mame_colours = std::make_unique<UINT32[]>(0x80000/4);
+ memset(m_mame_colours.get(), 0x00, 0x80000);
m_screenwidth = 384;
@@ -1835,7 +1835,7 @@ WRITE32_MEMBER(cps3_state::cps3_palettedma_w)
UINT32 cps3_state::process_byte( UINT8 real_byte, UINT32 destination, int max_length )
{
- UINT8* dest = (UINT8*)m_char_ram;
+ UINT8* dest = (UINT8*)m_char_ram.get();
//printf("process byte for destination %08x\n", destination);
@@ -1930,7 +1930,7 @@ void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination,
UINT32 cps3_state::ProcessByte8(UINT8 b,UINT32 dst_offset)
{
- UINT8* destRAM = (UINT8*)m_char_ram;
+ UINT8* destRAM = (UINT8*)m_char_ram.get();
int l=0;
if(m_lastb==m_lastb2) //rle
diff --git a/src/mame/drivers/cubeqst.cpp b/src/mame/drivers/cubeqst.cpp
index 7cb464c2e45..6ed299afaef 100644
--- a/src/mame/drivers/cubeqst.cpp
+++ b/src/mame/drivers/cubeqst.cpp
@@ -39,7 +39,7 @@ public:
m_screen(*this, "screen"),
m_generic_paletteram_16(*this, "paletteram") { }
- UINT8 *m_depth_buffer;
+ std::unique_ptr<UINT8[]> m_depth_buffer;
int m_video_field;
UINT8 m_io_latch;
UINT8 m_reset_latch;
@@ -96,7 +96,7 @@ public:
void cubeqst_state::video_start()
{
m_video_field = 0;
- m_depth_buffer = auto_alloc_array(machine(), UINT8, 512);
+ m_depth_buffer = std::make_unique<UINT8[]>(512);
}
WRITE16_MEMBER(cubeqst_state::palette_w)
@@ -130,7 +130,7 @@ UINT32 cubeqst_state::screen_update_cubeqst(screen_device &screen, bitmap_rgb32
UINT32 pen;
/* Zap the depth buffer */
- memset(m_depth_buffer, 0xff, 512);
+ memset(m_depth_buffer.get(), 0xff, 512);
/* Process all the spans on this scanline */
if (y < 256)
diff --git a/src/mame/drivers/dblcrown.cpp b/src/mame/drivers/dblcrown.cpp
index f3d1119ae95..3778813c4cc 100644
--- a/src/mame/drivers/dblcrown.cpp
+++ b/src/mame/drivers/dblcrown.cpp
@@ -72,8 +72,8 @@ public:
UINT8 m_bank;
UINT8 m_irq_src;
- UINT8 *m_pal_ram;
- UINT8 *m_vram;
+ std::unique_ptr<UINT8[]> m_pal_ram;
+ std::unique_ptr<UINT8[]> m_vram;
UINT8 m_vram_bank[2];
UINT8 m_mux_data;
UINT8 m_lamps_data;
@@ -110,10 +110,10 @@ protected:
void dblcrown_state::video_start()
{
- m_pal_ram = auto_alloc_array(machine(), UINT8, 0x200 * 2);
- m_vram = auto_alloc_array(machine(), UINT8, 0x1000 * 0x10);
+ m_pal_ram = std::make_unique<UINT8[]>(0x200 * 2);
+ m_vram = std::make_unique<UINT8[]>(0x1000 * 0x10);
- save_pointer(NAME(m_vram), 0x1000 * 0x10);
+ save_pointer(NAME(m_vram.get()), 0x1000 * 0x10);
}
UINT32 dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp
index 519ed10af03..e29451a027f 100644
--- a/src/mame/drivers/ddenlovr.cpp
+++ b/src/mame/drivers/ddenlovr.cpp
@@ -168,7 +168,7 @@ public:
optional_shared_ptr<UINT16> m_protection2;
- UINT8 * m_ddenlovr_pixmap[8];
+ std::unique_ptr<UINT8[]> m_ddenlovr_pixmap[8];
/* blitter (TODO: merge with the dynax.h, where possible) */
int m_extra_layers;
@@ -461,7 +461,7 @@ VIDEO_START_MEMBER(ddenlovr_state,ddenlovr)
for (i = 0; i < 8; i++)
{
- m_ddenlovr_pixmap[i] = auto_alloc_array(machine(), UINT8, 512 * 512);
+ m_ddenlovr_pixmap[i] = std::make_unique<UINT8[]>(512 * 512);
m_ddenlovr_scroll[i * 2 + 0] = m_ddenlovr_scroll[i * 2 + 1] = 0;
}
@@ -542,14 +542,14 @@ VIDEO_START_MEMBER(ddenlovr_state,ddenlovr)
save_item(NAME(m_ddenlovr_blit_pen_mask));
save_item(NAME(m_ddenlovr_blit_regs));
- save_pointer(NAME(m_ddenlovr_pixmap[0]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[1]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[2]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[3]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[4]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[5]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[6]), 512 * 512);
- save_pointer(NAME(m_ddenlovr_pixmap[7]), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[0].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[1].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[2].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[3].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[4].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[5].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[6].get()), 512 * 512);
+ save_pointer(NAME(m_ddenlovr_pixmap[7].get()), 512 * 512);
}
VIDEO_START_MEMBER(ddenlovr_state,mmpanic)
@@ -872,17 +872,17 @@ void ddenlovr_state::blit_rect_yh()
if (start + length > 512 * 512)
length = 512 * 512 - start;
- if (m_ddenlovr_dest_layer & 0x0001) memset(m_ddenlovr_pixmap[0] + start, m_ddenlovr_blit_pen, length);
- if (m_ddenlovr_dest_layer & 0x0002) memset(m_ddenlovr_pixmap[1] + start, m_ddenlovr_blit_pen, length);
- if (m_ddenlovr_dest_layer & 0x0004) memset(m_ddenlovr_pixmap[2] + start, m_ddenlovr_blit_pen, length);
- if (m_ddenlovr_dest_layer & 0x0008) memset(m_ddenlovr_pixmap[3] + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0001) memset(m_ddenlovr_pixmap[0].get() + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0002) memset(m_ddenlovr_pixmap[1].get() + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0004) memset(m_ddenlovr_pixmap[2].get() + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0008) memset(m_ddenlovr_pixmap[3].get() + start, m_ddenlovr_blit_pen, length);
if (!m_extra_layers) return;
- if (m_ddenlovr_dest_layer & 0x0100) memset(m_ddenlovr_pixmap[4] + start, m_ddenlovr_blit_pen, length);
- if (m_ddenlovr_dest_layer & 0x0200) memset(m_ddenlovr_pixmap[5] + start, m_ddenlovr_blit_pen, length);
- if (m_ddenlovr_dest_layer & 0x0400) memset(m_ddenlovr_pixmap[6] + start, m_ddenlovr_blit_pen, length);
- if (m_ddenlovr_dest_layer & 0x0800) memset(m_ddenlovr_pixmap[7] + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0100) memset(m_ddenlovr_pixmap[4].get() + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0200) memset(m_ddenlovr_pixmap[5].get() + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0400) memset(m_ddenlovr_pixmap[6].get() + start, m_ddenlovr_blit_pen, length);
+ if (m_ddenlovr_dest_layer & 0x0800) memset(m_ddenlovr_pixmap[7].get() + start, m_ddenlovr_blit_pen, length);
}
}
@@ -905,17 +905,17 @@ void ddenlovr_state::blit_fill_xy( int x, int y )
// popmessage("FILL command X %03x Y %03x", x, y);
#endif
- if (m_ddenlovr_dest_layer & 0x0001) memset(m_ddenlovr_pixmap[0] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
- if (m_ddenlovr_dest_layer & 0x0002) memset(m_ddenlovr_pixmap[1] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
- if (m_ddenlovr_dest_layer & 0x0004) memset(m_ddenlovr_pixmap[2] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
- if (m_ddenlovr_dest_layer & 0x0008) memset(m_ddenlovr_pixmap[3] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0001) memset(m_ddenlovr_pixmap[0].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0002) memset(m_ddenlovr_pixmap[1].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0004) memset(m_ddenlovr_pixmap[2].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0008) memset(m_ddenlovr_pixmap[3].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
if (!m_extra_layers) return;
- if (m_ddenlovr_dest_layer & 0x0100) memset(m_ddenlovr_pixmap[4] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
- if (m_ddenlovr_dest_layer & 0x0200) memset(m_ddenlovr_pixmap[5] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
- if (m_ddenlovr_dest_layer & 0x0400) memset(m_ddenlovr_pixmap[6] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
- if (m_ddenlovr_dest_layer & 0x0800) memset(m_ddenlovr_pixmap[7] + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0100) memset(m_ddenlovr_pixmap[4].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0200) memset(m_ddenlovr_pixmap[5].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0400) memset(m_ddenlovr_pixmap[6].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
+ if (m_ddenlovr_dest_layer & 0x0800) memset(m_ddenlovr_pixmap[7].get() + start, m_ddenlovr_blit_pen, 512 * 512 - start);
}
diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp
index 9200ac4d862..faa0f3bb6a5 100644
--- a/src/mame/drivers/deco156.cpp
+++ b/src/mame/drivers/deco156.cpp
@@ -51,7 +51,7 @@ public:
/* memory */
UINT16 m_pf1_rowscroll[0x800/2];
UINT16 m_pf2_rowscroll[0x800/2];
- UINT16* m_spriteram;
+ std::unique_ptr<UINT16[]> m_spriteram;
DECLARE_WRITE32_MEMBER(hvysmsh_eeprom_w);
DECLARE_WRITE32_MEMBER(wcvol95_nonbuffered_palette_w);
DECLARE_WRITE32_MEMBER(deco156_nonbuffered_palette_w);
@@ -75,12 +75,12 @@ public:
void deco156_state::video_start()
{
- m_spriteram = auto_alloc_array(machine(), UINT16, 0x2000/2);
+ m_spriteram = std::make_unique<UINT16[]>(0x2000/2);
/* and register the allocated ram so that save states still work */
save_item(NAME(m_pf1_rowscroll));
save_item(NAME(m_pf2_rowscroll));
- save_pointer(NAME(m_spriteram), 0x2000/2);
+ save_pointer(NAME(m_spriteram.get()), 0x2000/2);
}
@@ -95,7 +95,7 @@ UINT32 deco156_state::screen_update_wcvol95(screen_device &screen, bitmap_rgb32
m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x800);
+ m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram.get(), 0x800);
m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/drivers/dgpix.cpp b/src/mame/drivers/dgpix.cpp
index c9bd8abe3e2..eef53a0fbb7 100644
--- a/src/mame/drivers/dgpix.cpp
+++ b/src/mame/drivers/dgpix.cpp
@@ -167,7 +167,7 @@ public:
required_device<cpu_device> m_maincpu;
required_ioport m_vblank;
- UINT32 *m_vram;
+ std::unique_ptr<UINT32[]> m_vram;
int m_vbuffer;
int m_flash_roms;
int m_old_vbuf;
@@ -376,9 +376,9 @@ INPUT_PORTS_END
void dgpix_state::video_start()
{
- m_vram = auto_alloc_array(machine(), UINT32, 0x40000*2/4);
+ m_vram = std::make_unique<UINT32[]>(0x40000*2/4);
- save_pointer(NAME(m_vram), 0x40000*2/4);
+ save_pointer(NAME(m_vram.get()), 0x40000*2/4);
}
UINT32 dgpix_state::screen_update_dgpix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/drivers/dreamwld.cpp b/src/mame/drivers/dreamwld.cpp
index 7f4d26beb9b..6da2dc43890 100644
--- a/src/mame/drivers/dreamwld.cpp
+++ b/src/mame/drivers/dreamwld.cpp
@@ -133,8 +133,8 @@ public:
int m_tilebank[2];
int m_tilebankold[2];
- UINT32* m_spritebuf1;
- UINT32* m_spritebuf2;
+ std::unique_ptr<UINT32[]> m_spritebuf1;
+ std::unique_ptr<UINT32[]> m_spritebuf2;
/* misc */
int m_protindex;
@@ -161,8 +161,8 @@ public:
void dreamwld_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
gfx_element *gfx = m_gfxdecode->gfx(0);
- UINT32 *source = m_spritebuf1;
- UINT32 *finish = m_spritebuf1 + 0x1000 / 4;
+ UINT32 *source = m_spritebuf1.get();
+ UINT32 *finish = m_spritebuf1.get() + 0x1000 / 4;
UINT16 *redirect = (UINT16 *)memregion("spritelut")->base();
int xoffset = 4;
@@ -271,8 +271,8 @@ void dreamwld_state::video_start()
m_bg2_tilemap->set_scroll_rows(64*16); // line scrolling
m_bg2_tilemap->set_scroll_cols(1);
- m_spritebuf1 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
- m_spritebuf2 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
+ m_spritebuf1 = std::make_unique<UINT32[]>(0x2000 / 4);
+ m_spritebuf2 = std::make_unique<UINT32[]>(0x2000 / 4);
m_lineram16 = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x400 / 2);
save_pointer(NAME(m_lineram16), 0x400/2);
@@ -284,8 +284,8 @@ void dreamwld_state::screen_eof_dreamwld(screen_device &screen, bool state)
// rising edge
if (state)
{
- memcpy(m_spritebuf2, m_spritebuf1, 0x2000);
- memcpy(m_spritebuf1, m_spriteram, 0x2000);
+ memcpy(m_spritebuf2.get(), m_spritebuf1.get(), 0x2000);
+ memcpy(m_spritebuf1.get(), m_spriteram, 0x2000);
}
}
diff --git a/src/mame/drivers/dvk_kcgd.cpp b/src/mame/drivers/dvk_kcgd.cpp
index a95755fac8a..0beb193fde2 100644
--- a/src/mame/drivers/dvk_kcgd.cpp
+++ b/src/mame/drivers/dvk_kcgd.cpp
@@ -107,7 +107,7 @@ private:
int palette_index, vram_addr;
UINT8 palette[16];
} m_video;
- UINT32 *m_videoram;
+ std::unique_ptr<UINT32[]> m_videoram;
protected:
required_device<cpu_device> m_maincpu;
@@ -158,7 +158,7 @@ void kcgd_state::video_start()
// screen_device *screen = machine().device<screen_device>("screen");
// 64 kwords, word size is 17 bits
- m_videoram = auto_alloc_array(machine(), UINT32, 65536);
+ m_videoram = std::make_unique<UINT32[]>(65536);
m_tmpclip = rectangle(0, KCGD_DISP_HORZ-1, 0, KCGD_DISP_VERT-1);
m_tmpbmp.allocate(KCGD_DISP_HORZ, KCGD_DISP_VERT);
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp
index 41cd632f51f..c2fd45e06b8 100644
--- a/src/mame/drivers/einstein.cpp
+++ b/src/mame/drivers/einstein.cpp
@@ -437,8 +437,8 @@ MACHINE_RESET_MEMBER(einstein_state,einstein2)
MACHINE_START_MEMBER(einstein_state,einstein2)
{
- m_crtc_ram = auto_alloc_array(machine(), UINT8, 2048);
- memset(m_crtc_ram, 0, sizeof(UINT8) * 2048);
+ m_crtc_ram = std::make_unique<UINT8[]>(2048);
+ memset(m_crtc_ram.get(), 0, sizeof(UINT8) * 2048);
einstein_state::machine_start();
}
diff --git a/src/mame/drivers/eolith16.cpp b/src/mame/drivers/eolith16.cpp
index 4cb68dd4875..fc9da7b255b 100644
--- a/src/mame/drivers/eolith16.cpp
+++ b/src/mame/drivers/eolith16.cpp
@@ -25,7 +25,7 @@ public:
eolith16_state(const machine_config &mconfig, device_type type, const char *tag)
: eolith_state(mconfig, type, tag) { }
- UINT16 *m_vram;
+ std::unique_ptr<UINT16[]> m_vram;
int m_vbuffer;
DECLARE_WRITE16_MEMBER(eeprom_w);
@@ -116,8 +116,8 @@ INPUT_PORTS_END
VIDEO_START_MEMBER(eolith16_state,eolith16)
{
- m_vram = auto_alloc_array(machine(), UINT16, 0x10000);
- save_pointer(NAME(m_vram), 0x10000);
+ m_vram = std::make_unique<UINT16[]>(0x10000);
+ save_pointer(NAME(m_vram.get()), 0x10000);
save_item(NAME(m_vbuffer));
}
diff --git a/src/mame/drivers/esripsys.cpp b/src/mame/drivers/esripsys.cpp
index 8119d2f60df..81683144df5 100644
--- a/src/mame/drivers/esripsys.cpp
+++ b/src/mame/drivers/esripsys.cpp
@@ -630,20 +630,20 @@ DRIVER_INIT_MEMBER(esripsys_state,esripsys)
{
UINT8 *rom = memregion("sound_data")->base();
- m_fdt_a = auto_alloc_array(machine(), UINT8, FDT_RAM_SIZE);
- m_fdt_b = auto_alloc_array(machine(), UINT8, FDT_RAM_SIZE);
- m_cmos_ram = auto_alloc_array(machine(), UINT8, CMOS_RAM_SIZE);
+ m_fdt_a = std::make_unique<UINT8[]>(FDT_RAM_SIZE);
+ m_fdt_b = std::make_unique<UINT8[]>(FDT_RAM_SIZE);
+ m_cmos_ram = std::make_unique<UINT8[]>(CMOS_RAM_SIZE);
- machine().device<nvram_device>("nvram")->set_base(m_cmos_ram, CMOS_RAM_SIZE);
+ machine().device<nvram_device>("nvram")->set_base(m_cmos_ram.get(), CMOS_RAM_SIZE);
membank("bank2")->set_base(&rom[0x0000]);
membank("bank3")->set_base(&rom[0x4000]);
membank("bank4")->set_base(&rom[0x8000]);
/* Register stuff for state saving */
- save_pointer(NAME(m_fdt_a), FDT_RAM_SIZE);
- save_pointer(NAME(m_fdt_b), FDT_RAM_SIZE);
- save_pointer(NAME(m_cmos_ram), CMOS_RAM_SIZE);
+ save_pointer(NAME(m_fdt_a.get()), FDT_RAM_SIZE);
+ save_pointer(NAME(m_fdt_b.get()), FDT_RAM_SIZE);
+ save_pointer(NAME(m_cmos_ram.get()), CMOS_RAM_SIZE);
save_item(NAME(m_g_iodata));
save_item(NAME(m_g_ioaddr));
diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp
index 25e05e9ccdb..8fe3e6434f6 100644
--- a/src/mame/drivers/famibox.cpp
+++ b/src/mame/drivers/famibox.cpp
@@ -78,7 +78,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<ppu2c0x_device> m_ppu;
- UINT8* m_nt_ram;
+ std::unique_ptr<UINT8[]> m_nt_ram;
UINT8* m_nt_page[4];
UINT32 m_in_0;
@@ -523,11 +523,11 @@ void famibox_state::machine_reset()
void famibox_state::machine_start()
{
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(famibox_state::famibox_nt_r), this), write8_delegate(FUNC(famibox_state::famibox_nt_w), this));
m_ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "ppubank1");
diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp
index 4442882d215..00de2cdb6b5 100644
--- a/src/mame/drivers/fm7.cpp
+++ b/src/mame/drivers/fm7.cpp
@@ -1892,8 +1892,8 @@ INPUT_PORTS_END
DRIVER_INIT_MEMBER(fm7_state,fm7)
{
-// m_shared_ram = auto_alloc_array(machine(),UINT8,0x80);
- m_video_ram = auto_alloc_array(machine(),UINT8,0x18000); // 2 pages on some systems
+// m_shared_ram = std::make_unique<UINT8[]>(0x80);
+ m_video_ram = std::make_unique<UINT8[]>(0x18000); // 2 pages on some systems
m_timer = timer_alloc(TIMER_FM7_IRQ);
m_subtimer = timer_alloc(TIMER_FM7_SUBTIMER_IRQ);
m_keyboard_timer = timer_alloc(TIMER_FM7_KEYBOARD_POLL);
@@ -2038,7 +2038,7 @@ void fm7_state::machine_reset()
m_x86->set_input_line(INPUT_LINE_HALT,ASSERT_LINE);
}
- memset(m_video_ram, 0, sizeof(UINT8) * 0x18000);
+ memset(m_video_ram.get(), 0, sizeof(UINT8) * 0x18000);
}
diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp
index d4ca82081ce..8667759d012 100644
--- a/src/mame/drivers/fmtowns.cpp
+++ b/src/mame/drivers/fmtowns.cpp
@@ -226,11 +226,11 @@ void towns_state::init_serial_rom()
if(m_serial)
srom = m_serial->base();
- memset(m_towns_serial_rom,0,256/8);
+ memset(m_towns_serial_rom.get(),0,256/8);
if(srom)
{
- memcpy(m_towns_serial_rom,srom,32);
+ memcpy(m_towns_serial_rom.get(),srom,32);
m_towns_machine_id = (m_towns_serial_rom[0x18] << 8) | m_towns_serial_rom[0x17];
logerror("Machine ID in serial ROM: %04x\n",m_towns_machine_id);
return;
@@ -2564,12 +2564,12 @@ INPUT_PORTS_END
void towns_state::driver_start()
{
- m_towns_vram = auto_alloc_array(machine(),UINT32,0x20000);
- m_towns_gfxvram = auto_alloc_array(machine(),UINT8,0x80000);
- m_towns_txtvram = auto_alloc_array(machine(),UINT8,0x20000);
- memset(m_towns_txtvram, 0, sizeof(UINT8)*0x20000);
- //towns_sprram = auto_alloc_array(machine(),UINT8,0x20000);
- m_towns_serial_rom = auto_alloc_array(machine(),UINT8,256/8);
+ m_towns_vram = std::make_unique<UINT32[]>(0x20000);
+ m_towns_gfxvram = std::make_unique<UINT8[]>(0x80000);
+ m_towns_txtvram = std::make_unique<UINT8[]>(0x20000);
+ memset(m_towns_txtvram.get(), 0, sizeof(UINT8)*0x20000);
+ //towns_sprram = std::make_unique<UINT8[]>(0x20000);
+ m_towns_serial_rom = std::make_unique<UINT8[]>(256/8);
init_serial_rom();
init_rtc();
m_towns_rtc_timer = timer_alloc(TIMER_RTC);
diff --git a/src/mame/drivers/fromanc2.cpp b/src/mame/drivers/fromanc2.cpp
index b0a7482afbb..5843d684dc8 100644
--- a/src/mame/drivers/fromanc2.cpp
+++ b/src/mame/drivers/fromanc2.cpp
@@ -490,17 +490,17 @@ MACHINE_START_MEMBER(fromanc2_state,fromanc4)
MACHINE_START_MEMBER(fromanc2_state,fromanc2)
{
- m_bankedram = auto_alloc_array(machine(), UINT8, 0x4000 * 3);
+ m_bankedram = std::make_unique<UINT8[]>(0x4000 * 3);
membank("bank1")->configure_entries(0, 4, memregion("sub")->base(), 0x4000);
membank("bank2")->configure_entry(0, memregion("sub")->base() + 0x08000);
- membank("bank2")->configure_entries(1, 3, m_bankedram, 0x4000);
+ membank("bank2")->configure_entries(1, 3, m_bankedram.get(), 0x4000);
MACHINE_START_CALL_MEMBER(fromanc4);
save_item(NAME(m_subcpu_int_flag));
save_item(NAME(m_subcpu_nmi_flag));
- save_pointer(NAME(m_bankedram), 0x4000 * 3);
+ save_pointer(NAME(m_bankedram.get()), 0x4000 * 3);
}
void fromanc2_state::machine_reset()
diff --git a/src/mame/drivers/funkball.cpp b/src/mame/drivers/funkball.cpp
index 758dab737f5..9031a46b1a1 100644
--- a/src/mame/drivers/funkball.cpp
+++ b/src/mame/drivers/funkball.cpp
@@ -94,7 +94,7 @@ public:
UINT8 m_funkball_config_reg_sel;
UINT8 m_funkball_config_regs[256];
UINT32 m_cx5510_regs[256/4];
- UINT8 *m_bios_ram;
+ std::unique_ptr<UINT8[]> m_bios_ram;
UINT32 m_biu_ctrl_reg[256/4];
@@ -308,7 +308,7 @@ WRITE32_MEMBER(funkball_state::biu_ctrl_w)
for(i=0;i<8;i++)
{
if (data & 0x1 << i*4) // enable RAM access to region 0xe0000 - 0xfffff
- membank(banknames[i])->set_base(m_bios_ram + (0x4000 * i));
+ membank(banknames[i])->set_base(m_bios_ram.get() + (0x4000 * i));
else // disable RAM access (reads go to BIOS ROM)
membank(banknames[i])->set_base(memregion("bios")->base() + (0x4000 * i));
}
@@ -781,7 +781,7 @@ INPUT_PORTS_END
void funkball_state::machine_start()
{
- m_bios_ram = auto_alloc_array(machine(), UINT8, 0x20000);
+ m_bios_ram = std::make_unique<UINT8[]>(0x20000);
/* defaults, otherwise it won't boot */
m_unk_ram[0x010/4] = 0x2f8d85ff;
diff --git a/src/mame/drivers/funworld.cpp b/src/mame/drivers/funworld.cpp
index a890826f4d1..f02bf070a50 100644
--- a/src/mame/drivers/funworld.cpp
+++ b/src/mame/drivers/funworld.cpp
@@ -6108,7 +6108,7 @@ DRIVER_INIT_MEMBER(funworld_state, ctunk)
int size = memregion("maincpu")->bytes();
int start = 0x8000;
- UINT8 *buffer;
+ //UINT8 *buffer;
int i;// a;
/*****************************
@@ -6122,8 +6122,8 @@ DRIVER_INIT_MEMBER(funworld_state, ctunk)
rom[i] = BITSWAP8(rom[i], 5, 6, 7, 3, 4, 0, 1, 2);
}
- buffer = auto_alloc_array(machine(), UINT8, size);
- memcpy(buffer, rom, size);
+ //buffer = std::make_unique<UINT8[]>(size);
+ //memcpy(buffer, rom, size);
/*****************************
diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp
index bc17ba94522..97e2e248323 100644
--- a/src/mame/drivers/gamecstl.cpp
+++ b/src/mame/drivers/gamecstl.cpp
@@ -84,7 +84,7 @@ public:
required_shared_ptr<UINT32> m_cga_ram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- UINT32 *m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ram;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -184,7 +184,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- state->membank("bank1")->set_base(state->m_bios_ram);
+ state->membank("bank1")->set_base(state->m_bios_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -330,7 +330,7 @@ WRITE32_MEMBER(gamecstl_state::bios_ram_w)
{
if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -460,7 +460,7 @@ MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(gamecstl_state,gamecstl)
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x10000/4);
intel82439tx_init();
}
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index d9913f744d8..45defc43421 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -236,7 +236,7 @@ void gottlieb_state::machine_start()
m_laserdisc_philips_timer = timer_alloc(TIMER_LASERDISC_PHILIPS);
/* create some audio RAM */
- m_laserdisc_audio_buffer = auto_alloc_array(machine(), UINT8, AUDIORAM_SIZE);
+ m_laserdisc_audio_buffer = std::make_unique<UINT8[]>(AUDIORAM_SIZE);
m_laserdisc_status = 0x38;
/* more save state registration */
@@ -244,7 +244,7 @@ void gottlieb_state::machine_start()
save_item(NAME(m_laserdisc_status));
save_item(NAME(m_laserdisc_philips_code));
- save_pointer(NAME(m_laserdisc_audio_buffer), AUDIORAM_SIZE);
+ save_pointer(NAME(m_laserdisc_audio_buffer.get()), AUDIORAM_SIZE);
save_item(NAME(m_laserdisc_audio_address));
save_item(NAME(m_laserdisc_last_samples));
save_item(NAME(m_laserdisc_last_time));
diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp
index 4512c3db20f..f7c4c1c2f4c 100644
--- a/src/mame/drivers/gp32.cpp
+++ b/src/mame/drivers/gp32.cpp
@@ -1614,8 +1614,8 @@ void gp32_state::s3c240x_machine_start()
m_s3c240x_iic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iic_timer_exp),this), (void *)(FPTR)0);
m_s3c240x_iis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iis_timer_exp),this), (void *)(FPTR)0);
m_s3c240x_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_lcd_timer_exp),this), (void *)(FPTR)0);
- m_eeprom_data = auto_alloc_array( machine(), UINT8, 0x2000);
- m_nvram->set_base(m_eeprom_data, 0x2000);
+ m_eeprom_data = std::make_unique<UINT8[]>(0x2000);
+ m_nvram->set_base(m_eeprom_data.get(), 0x2000);
smc_init();
i2s_init();
}
diff --git a/src/mame/drivers/gridlee.cpp b/src/mame/drivers/gridlee.cpp
index 54f67139cbe..072fa04dd56 100644
--- a/src/mame/drivers/gridlee.cpp
+++ b/src/mame/drivers/gridlee.cpp
@@ -223,8 +223,9 @@ void gridlee_state::poly17_init()
UINT8 *p, *r;
/* allocate memory */
- p = m_poly17 = auto_alloc_array(machine(), UINT8, 2 * (POLY17_SIZE + 1));
- r = m_rand17 = m_poly17 + POLY17_SIZE + 1;
+ m_poly17 = std::make_unique<UINT8[]>(2 * (POLY17_SIZE + 1));
+ p = m_poly17.get();
+ r = m_rand17 = m_poly17.get() + POLY17_SIZE + 1;
/* generate the polynomial */
for (i = 0; i < POLY17_SIZE; i++)
diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp
index e8c88a6981f..b751e7fc029 100644
--- a/src/mame/drivers/gticlub.cpp
+++ b/src/mame/drivers/gticlub.cpp
@@ -332,8 +332,8 @@ private:
UINT8 m_gticlub_led_reg[2];
emu_timer *m_sound_irq_timer;
- UINT32 *m_sharc_dataram_0;
- UINT32 *m_sharc_dataram_1;
+ std::unique_ptr<UINT32[]> m_sharc_dataram_0;
+ std::unique_ptr<UINT32[]> m_sharc_dataram_1;
};
@@ -1416,15 +1416,15 @@ ROM_END
DRIVER_INIT_MEMBER(gticlub_state,gticlub)
{
- m_sharc_dataram_0 = auto_alloc_array(machine(), UINT32, 0x100000/4);
+ m_sharc_dataram_0 = std::make_unique<UINT32[]>(0x100000/4);
}
void gticlub_state::init_hangplt_common()
{
m_konppc->set_cgboard_texture_bank(0, "bank5", memregion("user5")->base());
m_konppc->set_cgboard_texture_bank(1, "bank6", memregion("user5")->base());
- m_sharc_dataram_0 = auto_alloc_array(machine(), UINT32, 0x100000/4);
- m_sharc_dataram_1 = auto_alloc_array(machine(), UINT32, 0x100000/4);
+ m_sharc_dataram_0 = std::make_unique<UINT32[]>(0x100000/4);
+ m_sharc_dataram_1 = std::make_unique<UINT32[]>(0x100000/4);
}
DRIVER_INIT_MEMBER(gticlub_state,hangplt)
diff --git a/src/mame/drivers/gunpey.cpp b/src/mame/drivers/gunpey.cpp
index 3f418dc133f..80285fe5c1f 100644
--- a/src/mame/drivers/gunpey.cpp
+++ b/src/mame/drivers/gunpey.cpp
@@ -210,7 +210,7 @@ public:
required_shared_ptr<UINT16> m_wram;
required_device<palette_device> m_palette;
- UINT16 *m_blit_buffer;
+ std::unique_ptr<UINT16[]> m_blit_buffer;
UINT16 m_blit_ram[0x10];
UINT8 m_irq_cause, m_irq_mask;
DECLARE_WRITE8_MEMBER(gunpey_status_w);
@@ -268,7 +268,7 @@ public:
void gunpey_state::video_start()
{
- m_blit_buffer = auto_alloc_array(machine(), UINT16, 512*512);
+ m_blit_buffer = std::make_unique<UINT16[]>(512*512);
}
UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,UINT8 scene_gradient)
diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp
index a1f7ab0723b..69dc250ec1d 100644
--- a/src/mame/drivers/halleys.cpp
+++ b/src/mame/drivers/halleys.cpp
@@ -223,15 +223,15 @@ public:
UINT8 m_sound_fifo[MAX_SOUNDS];
UINT8 *m_gfx_plane02;
UINT8 *m_gfx_plane13;
- UINT8 *m_collision_list;
+ std::unique_ptr<UINT8[]> m_collision_list;
UINT8 *m_scrolly0;
UINT8 *m_scrollx0;
UINT8 *m_scrolly1;
UINT8 *m_scrollx1;
- UINT32 *m_internal_palette;
- UINT32 *m_alpha_table;
+ std::unique_ptr<UINT32[]> m_internal_palette;
+ std::unique_ptr<UINT32[]> m_alpha_table;
UINT8 *m_cpu1_base;
- UINT8 *m_gfx1_base;
+ std::unique_ptr<UINT8[]> m_gfx1_base;
required_shared_ptr<UINT8> m_blitter_ram;
required_shared_ptr<UINT8> m_io_ram;
int m_game_id;
@@ -432,7 +432,7 @@ if (0) {
src1 &= 0x3fff;
src2 &= 0x3fff;
bank = ((code & BANKBIT0) | (color & BANKBIT1)) << 8;
- pal_ptr = m_internal_palette;
+ pal_ptr = m_internal_palette.get();
// the crossroad of fate
@@ -749,7 +749,7 @@ COMMAND_MODE:
if (flags & S1_IDLE) src_dx = 0; else src_dx = 1;
if (flags & S1_REV ) src_dx = -src_dx;
- src_base = m_gfx1_base + bank;
+ src_base = m_gfx1_base.get() + bank;
if (command == STARPASS1 || command == STARPASS2) layer = (layer & 1) + 4;
dst_base = m_render_layer[layer];
@@ -1133,8 +1133,8 @@ PALETTE_INIT_MEMBER(halleys_state, halleys)
{
UINT32 d, r, g, b, i, j, count;
// allocate memory for internal palette
- m_internal_palette = auto_alloc_array(machine(), UINT32, PALETTE_SIZE);
- UINT32 *pal_ptr = m_internal_palette;
+ m_internal_palette = std::make_unique<UINT32[]>(PALETTE_SIZE);
+ UINT32 *pal_ptr = m_internal_palette.get();
for (count=0; count<1024; count++)
{
@@ -1232,7 +1232,7 @@ READ8_MEMBER(halleys_state::paletteram_r)
WRITE8_MEMBER(halleys_state::paletteram_w)
{
UINT32 d, r, g, b, i, j;
- UINT32 *pal_ptr = m_internal_palette;
+ UINT32 *pal_ptr = m_internal_palette.get();
m_paletteram[offset] = data;
d = (UINT32)data;
@@ -1476,7 +1476,7 @@ void halleys_state::filter_bitmap(bitmap_ind16 &bitmap, int mask)
UINT32 *pal_ptr, *edi;
int esi, eax, ebx, ecx, edx;
- pal_ptr = m_internal_palette;
+ pal_ptr = m_internal_palette.get();
esi = mask | 0xffffff00;
edi = (UINT32*)&bitmap.pix16(VIS_MINY, VIS_MINX + CLIP_W);
dst_pitch = bitmap.rowpixels() >> 1;
@@ -2184,20 +2184,20 @@ void halleys_state::init_common()
// allocate memory for pre-processed ROMs
- m_gfx1_base = auto_alloc_array(machine(), UINT8, 0x20000);
+ m_gfx1_base = std::make_unique<UINT8[]>(0x20000);
// allocate memory for alpha table
- m_alpha_table = auto_alloc_array(machine(), UINT32, 0x10000);
+ m_alpha_table = std::make_unique<UINT32[]>(0x10000);
// allocate memory for hardware collision list
- m_collision_list = auto_alloc_array(machine(), UINT8, MAX_SPRITES);
+ m_collision_list = std::make_unique<UINT8[]>(MAX_SPRITES);
// decrypt main program ROM
rom = m_cpu1_base = memregion("maincpu")->base();
- buf = m_gfx1_base;
+ buf = m_gfx1_base.get();
for (i=0; i<0x10000; i++)
{
diff --git a/src/mame/drivers/hitpoker.cpp b/src/mame/drivers/hitpoker.cpp
index ce73815b86d..e37bdc6ddbd 100644
--- a/src/mame/drivers/hitpoker.cpp
+++ b/src/mame/drivers/hitpoker.cpp
@@ -64,9 +64,9 @@ public:
required_shared_ptr<UINT8> m_sys_regs;
UINT8 m_pic_data;
- UINT8 *m_videoram;
- UINT8 *m_paletteram;
- UINT8 *m_colorram;
+ std::unique_ptr<UINT8[]> m_videoram;
+ std::unique_ptr<UINT8[]> m_paletteram;
+ std::unique_ptr<UINT8[]> m_colorram;
UINT8 m_eeprom_data[0x1000];
UINT16 m_eeprom_index;
@@ -97,9 +97,9 @@ public:
void hitpoker_state::video_start()
{
- m_videoram = auto_alloc_array(machine(), UINT8, 0x35ff);
- m_paletteram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_colorram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_videoram = std::make_unique<UINT8[]>(0x35ff);
+ m_paletteram = std::make_unique<UINT8[]>(0x1000);
+ m_colorram = std::make_unique<UINT8[]>(0x2000);
}
UINT32 hitpoker_state::screen_update_hitpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp
index 7a5d73d7b93..6bb798cb805 100644
--- a/src/mame/drivers/hng64.cpp
+++ b/src/mame/drivers/hng64.cpp
@@ -1392,11 +1392,11 @@ DRIVER_INIT_MEMBER(hng64_state,hng64_reorder_gfx)
DRIVER_INIT_MEMBER(hng64_state,hng64)
{
/* 1 meg of virtual address space for the com cpu */
- m_com_virtual_mem = auto_alloc_array(machine(), UINT8, 0x100000);
- m_com_op_base = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_com_virtual_mem = std::make_unique<UINT8[]>(0x100000);
+ m_com_op_base = std::make_unique<UINT8[]>(0x10000);
- m_soundram = auto_alloc_array(machine(), UINT16, 0x200000/2);
- m_soundram2 = auto_alloc_array(machine(), UINT16, 0x200000/2);
+ m_soundram = std::make_unique<UINT16[]>(0x200000/2);
+ m_soundram2 = std::make_unique<UINT16[]>(0x200000/2);
DRIVER_INIT_CALL(hng64_reorder_gfx);
}
@@ -1508,7 +1508,7 @@ void hng64_state::machine_start()
m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase);
m_comm_rom = memregion("user2")->base();
- m_comm_ram = auto_alloc_array(machine(),UINT8,0x10000);
+ m_comm_ram = std::make_unique<UINT8[]>(0x10000);
for (int i = 0; i < 0x38 / 4; i++)
{
diff --git a/src/mame/drivers/igs011.cpp b/src/mame/drivers/igs011.cpp
index edc3fd3f6d1..3c4e6c62fcf 100644
--- a/src/mame/drivers/igs011.cpp
+++ b/src/mame/drivers/igs011.cpp
@@ -104,7 +104,7 @@ public:
optional_shared_ptr<UINT16> m_vbowl_trackball;
required_shared_ptr<UINT16> m_generic_paletteram_16;
- UINT8 *m_layer[8];
+ std::unique_ptr<UINT8[]> m_layer[8];
UINT16 m_priority;
UINT8 m_lhb2_pen_hi;
UINT16 m_igs_dips_sel;
@@ -275,8 +275,8 @@ void igs011_state::video_start()
{
for (int i = 0; i < 8; i++)
{
- m_layer[i] = auto_alloc_array(machine(), UINT8, 512 * 256);
- save_pointer(NAME(m_layer[i]), 512 * 256, i);
+ m_layer[i] = std::make_unique<UINT8[]>(512 * 256);
+ save_pointer(NAME(m_layer[i].get()), 512 * 256, i);
}
m_lhb2_pen_hi = 0;
@@ -374,8 +374,8 @@ READ16_MEMBER(igs011_state::igs011_layers_r)
{
int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2);
- UINT8 *l0 = m_layer[layer0];
- UINT8 *l1 = m_layer[layer0+1];
+ UINT8 *l0 = m_layer[layer0].get();
+ UINT8 *l1 = m_layer[layer0+1].get();
offset >>= 1;
offset &= 0x1ffff;
@@ -389,8 +389,8 @@ WRITE16_MEMBER(igs011_state::igs011_layers_w)
int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2);
- UINT8 *l0 = m_layer[layer0];
- UINT8 *l1 = m_layer[layer0+1];
+ UINT8 *l0 = m_layer[layer0].get();
+ UINT8 *l1 = m_layer[layer0+1].get();
offset >>= 1;
offset &= 0x1ffff;
@@ -499,7 +499,7 @@ WRITE16_MEMBER(igs011_state::igs011_blit_flags_w)
blitter.x,blitter.y,blitter.w,blitter.h,blitter.gfx_hi,blitter.gfx_lo,blitter.depth,blitter.pen,blitter.flags);
#endif
- dest = m_layer[ blitter.flags & 0x0007 ];
+ dest = m_layer[ blitter.flags & 0x0007 ].get();
opaque = !(blitter.flags & 0x0008);
clear = blitter.flags & 0x0010;
flipx = blitter.flags & 0x0020;
diff --git a/src/mame/drivers/jalmah.cpp b/src/mame/drivers/jalmah.cpp
index f088374501c..1182c464f4c 100644
--- a/src/mame/drivers/jalmah.cpp
+++ b/src/mame/drivers/jalmah.cpp
@@ -152,8 +152,8 @@ public:
optional_shared_ptr<UINT16> m_sc1_vram;
optional_shared_ptr<UINT16> m_sc2_vram;
required_shared_ptr<UINT16> m_sc3_vram;
- UINT16 *m_jm_scrollram;
- UINT16 *m_jm_vregs;
+ std::unique_ptr<UINT16[]>m_jm_scrollram;
+ std::unique_ptr<UINT16[]> m_jm_vregs;
UINT16 m_sc0bank;
UINT16 m_pri;
UINT8 m_sc0_prin;
@@ -336,8 +336,8 @@ void jalmah_state::video_start()
m_sc3_tilemap_2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc3_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range2_8x8),this),8,8,128,64);
m_sc3_tilemap_3 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc3_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range3_8x8),this),8,8,64,128);
- m_jm_scrollram = auto_alloc_array(machine(), UINT16, 0x80/2);
- m_jm_vregs = auto_alloc_array(machine(), UINT16, 0x40/2);
+ m_jm_scrollram = std::make_unique<UINT16[]>(0x80/2);
+ m_jm_vregs = std::make_unique<UINT16[]>(0x40/2);
m_sc0_tilemap_0->set_transparent_pen(15);
m_sc0_tilemap_1->set_transparent_pen(15);
@@ -365,8 +365,8 @@ VIDEO_START_MEMBER(jalmah_state,urashima)
m_sc0_tilemap_0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc0_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range0_16x16),this),16,16,256,32);
m_sc3_tilemap_0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc3_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range2_8x8),this),8,8,128,64);
- m_jm_scrollram = auto_alloc_array(machine(), UINT16, 0x80/2);
- m_jm_vregs = auto_alloc_array(machine(), UINT16, 0x40/2);
+ m_jm_scrollram = std::make_unique<UINT16[]>(0x80/2);
+ m_jm_vregs = std::make_unique<UINT16[]>(0x40/2);
m_sc0_tilemap_0->set_transparent_pen(15);
m_sc3_tilemap_0->set_transparent_pen(15);
@@ -452,7 +452,7 @@ void jalmah_state::draw_sc3_layer(screen_device &screen, bitmap_ind16 &bitmap, c
UINT32 jalmah_state::screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT16 *jm_scrollram = m_jm_scrollram;
+ UINT16 *jm_scrollram = m_jm_scrollram.get();
UINT8 cur_prin;
jalmah_priority_system();
@@ -512,7 +512,7 @@ UINT32 jalmah_state::screen_update_jalmah(screen_device &screen, bitmap_ind16 &b
UINT32 jalmah_state::screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT16 *jm_scrollram = m_jm_scrollram;
+ UINT16 *jm_scrollram = m_jm_scrollram.get();
/*this game doesn't use the RANGE register at all.*/
m_sc0_tilemap_0->set_scrollx(0, jm_scrollram[0]);
m_sc3_tilemap_0->set_scrollx(0, jm_scrollram[3]);
@@ -599,8 +599,8 @@ WRITE16_MEMBER(jalmah_state::jalmah_tilebank_w)
WRITE16_MEMBER(jalmah_state::jalmah_scroll_w)
{
- UINT16 *jm_scrollram = m_jm_scrollram;
- UINT16 *jm_vregs = m_jm_vregs;
+ UINT16 *jm_scrollram = m_jm_scrollram.get();
+ UINT16 *jm_vregs = m_jm_vregs.get();
//logerror("[%04x]<-%04x\n",(offset+0x10)*2,data);
switch(offset+(0x10))
{
@@ -655,8 +655,8 @@ WRITE16_MEMBER(jalmah_state::urashima_sc3_vram_w)
/*Urashima Mahjong uses a bigger (and mostly unused/wasted) video register ram.*/
WRITE16_MEMBER(jalmah_state::urashima_vregs_w)
{
- UINT16 *jm_scrollram = m_jm_scrollram;
- UINT16 *jm_vregs = m_jm_vregs;
+ UINT16 *jm_scrollram = m_jm_scrollram.get();
+ UINT16 *jm_vregs = m_jm_vregs.get();
//logerror("[%04x]<-%04x\n",(offset)*2,data);
switch(offset)
{
diff --git a/src/mame/drivers/jchan.cpp b/src/mame/drivers/jchan.cpp
index 01576892c93..a5eb0ba0699 100644
--- a/src/mame/drivers/jchan.cpp
+++ b/src/mame/drivers/jchan.cpp
@@ -195,12 +195,12 @@ public:
required_shared_ptr<UINT16> m_mainsub_shared_ram;
required_shared_ptr<UINT16> m_ctrl;
- bitmap_ind16 *m_sprite_bitmap_1;
- bitmap_ind16 *m_sprite_bitmap_2;
- UINT32* m_sprite_ram32_1;
- UINT32* m_sprite_ram32_2;
- UINT32* m_sprite_regs32_1;
- UINT32* m_sprite_regs32_2;
+ std::unique_ptr<bitmap_ind16> m_sprite_bitmap_1;
+ std::unique_ptr<bitmap_ind16> m_sprite_bitmap_2;
+ std::unique_ptr<UINT32[]> m_sprite_ram32_1;
+ std::unique_ptr<UINT32[]> m_sprite_ram32_2;
+ std::unique_ptr<UINT32[]> m_sprite_regs32_1;
+ std::unique_ptr<UINT32[]> m_sprite_regs32_2;
int m_irq_sub_enable;
DECLARE_WRITE16_MEMBER(ctrl_w);
@@ -265,23 +265,23 @@ TIMER_DEVICE_CALLBACK_MEMBER(jchan_state::vblank)
void jchan_state::video_start()
{
/* so we can use sknsspr.c */
- m_sprite_ram32_1 = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_sprite_ram32_2 = auto_alloc_array(machine(), UINT32, 0x4000/4);
+ m_sprite_ram32_1 = std::make_unique<UINT32[]>(0x4000/4);
+ m_sprite_ram32_2 = std::make_unique<UINT32[]>(0x4000/4);
- m_sprite_regs32_1 = auto_alloc_array(machine(), UINT32, 0x40/4);
- m_sprite_regs32_2 = auto_alloc_array(machine(), UINT32, 0x40/4);
+ m_sprite_regs32_1 = std::make_unique<UINT32[]>(0x40/4);
+ m_sprite_regs32_2 = std::make_unique<UINT32[]>(0x40/4);
- m_sprite_bitmap_1 = auto_bitmap_ind16_alloc(machine(),1024,1024);
- m_sprite_bitmap_2 = auto_bitmap_ind16_alloc(machine(),1024,1024);
+ m_sprite_bitmap_1 = std::make_unique<bitmap_ind16>(1024,1024);
+ m_sprite_bitmap_2 = std::make_unique<bitmap_ind16>(1024,1024);
m_spritegen1->skns_sprite_kludge(0,0);
m_spritegen2->skns_sprite_kludge(0,0);
save_item(NAME(m_irq_sub_enable));
- save_pointer(NAME(m_sprite_ram32_1), 0x4000/4);
- save_pointer(NAME(m_sprite_ram32_2), 0x4000/4);
- save_pointer(NAME(m_sprite_regs32_1), 0x40/4);
- save_pointer(NAME(m_sprite_regs32_2), 0x40/4);
+ save_pointer(NAME(m_sprite_ram32_1.get()), 0x4000/4);
+ save_pointer(NAME(m_sprite_ram32_2.get()), 0x4000/4);
+ save_pointer(NAME(m_sprite_regs32_1.get()), 0x40/4);
+ save_pointer(NAME(m_sprite_regs32_2.get()), 0x40/4);
}
@@ -313,8 +313,8 @@ UINT32 jchan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
m_sprite_bitmap_1->fill(0x0000, cliprect);
m_sprite_bitmap_2->fill(0x0000, cliprect);
- m_spritegen1->skns_draw_sprites(*m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_sprite_regs32_1 );
- m_spritegen2->skns_draw_sprites(*m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 );
+ m_spritegen1->skns_draw_sprites(*m_sprite_bitmap_1, cliprect, m_sprite_ram32_1.get(), 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_sprite_regs32_1.get() );
+ m_spritegen2->skns_draw_sprites(*m_sprite_bitmap_2, cliprect, m_sprite_ram32_2.get(), 0x4000, memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2.get() );
// 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/jtc.cpp b/src/mame/drivers/jtc.cpp
index c626909c7e1..07114be0ac1 100644
--- a/src/mame/drivers/jtc.cpp
+++ b/src/mame/drivers/jtc.cpp
@@ -90,9 +90,9 @@ public:
DECLARE_WRITE8_MEMBER( banksel_w );
UINT8 m_video_bank;
- UINT8 *m_color_ram_r;
- UINT8 *m_color_ram_g;
- UINT8 *m_color_ram_b;
+ std::unique_ptr<UINT8[]> m_color_ram_r;
+ std::unique_ptr<UINT8[]> m_color_ram_g;
+ std::unique_ptr<UINT8[]> m_color_ram_b;
};
@@ -636,16 +636,16 @@ void jtces40_state::video_start()
{
/* allocate memory */
m_video_ram.allocate(JTC_ES40_VIDEORAM_SIZE);
- m_color_ram_r = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
- m_color_ram_g = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
- m_color_ram_b = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
+ m_color_ram_r = std::make_unique<UINT8[]>(JTC_ES40_VIDEORAM_SIZE);
+ m_color_ram_g = std::make_unique<UINT8[]>(JTC_ES40_VIDEORAM_SIZE);
+ m_color_ram_b = std::make_unique<UINT8[]>(JTC_ES40_VIDEORAM_SIZE);
/* register for state saving */
save_item(NAME(m_video_bank));
save_pointer(NAME(m_video_ram.target()), JTC_ES40_VIDEORAM_SIZE);
- save_pointer(NAME(m_color_ram_r), JTC_ES40_VIDEORAM_SIZE);
- save_pointer(NAME(m_color_ram_g), JTC_ES40_VIDEORAM_SIZE);
- save_pointer(NAME(m_color_ram_b), JTC_ES40_VIDEORAM_SIZE);
+ save_pointer(NAME(m_color_ram_r.get()), JTC_ES40_VIDEORAM_SIZE);
+ save_pointer(NAME(m_color_ram_g.get()), JTC_ES40_VIDEORAM_SIZE);
+ save_pointer(NAME(m_color_ram_b.get()), JTC_ES40_VIDEORAM_SIZE);
save_item(NAME(m_centronics_busy));
}
diff --git a/src/mame/drivers/laser3k.cpp b/src/mame/drivers/laser3k.cpp
index dea0ee965d5..c8732ac239d 100644
--- a/src/mame/drivers/laser3k.cpp
+++ b/src/mame/drivers/laser3k.cpp
@@ -120,8 +120,8 @@ private:
bool m_80col;
bool m_mix;
int m_gfxmode;
- UINT16 *m_hires_artifact_map;
- UINT16 *m_dhires_artifact_map;
+ std::unique_ptr<UINT16[]> m_hires_artifact_map;
+ std::unique_ptr<UINT16[]> m_dhires_artifact_map;
void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen);
void do_io(int offset);
@@ -165,10 +165,10 @@ void laser3k_state::machine_start()
UINT16 c;
/* 2^3 dependent pixels * 2 color sets * 2 offsets */
- m_hires_artifact_map = auto_alloc_array(machine(), UINT16, 8 * 2 * 2);
+ m_hires_artifact_map = std::make_unique<UINT16[]>(8 * 2 * 2);
/* 2^4 dependent pixels */
- m_dhires_artifact_map = auto_alloc_array(machine(), UINT16, 16);
+ m_dhires_artifact_map = std::make_unique<UINT16[]>(16);
/* build hires artifact map */
for (i = 0; i < 8; i++)
diff --git a/src/mame/drivers/m58.cpp b/src/mame/drivers/m58.cpp
index ded857f1146..38ca3b7b72b 100644
--- a/src/mame/drivers/m58.cpp
+++ b/src/mame/drivers/m58.cpp
@@ -437,7 +437,7 @@ DRIVER_INIT_MEMBER(m58_state,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);
+ std::unique_ptr<UINT8[]> buffer = std::make_unique<UINT8[]>(0x10);
UINT8* region = memregion("proms")->base();
int i;
@@ -445,7 +445,7 @@ DRIVER_INIT_MEMBER(m58_state,yard85)
{
buffer[i] = region[0x20f-i];
}
- memcpy(region+0x200, buffer, 0x10);
+ memcpy(region+0x200, buffer.get(), 0x10);
m_palette->update();
}
diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp
index 9e90e6d85e9..b58fb3a397c 100644
--- a/src/mame/drivers/m63.cpp
+++ b/src/mame/drivers/m63.cpp
@@ -163,7 +163,7 @@ public:
int m_sound_status;
int m_p1;
int m_p2;
- INT16 *m_samplebuf;
+ std::unique_ptr<INT16[]> m_samplebuf;
/* sound devices */
required_device<cpu_device> m_soundcpu;
@@ -449,7 +449,7 @@ READ8_MEMBER(m63_state::snddata_r)
WRITE8_MEMBER(m63_state::fghtbskt_samples_w)
{
if (data & 1)
- m_samples->start_raw(0, m_samplebuf + ((data & 0xf0) << 8), 0x2000, 8000);
+ m_samples->start_raw(0, m_samplebuf.get() + ((data & 0xf0) << 8), 0x2000, 8000);
}
WRITE8_MEMBER(m63_state::nmi_mask_w)
@@ -704,8 +704,8 @@ SAMPLES_START_CB_MEMBER(m63_state::fghtbskt_sh_start)
int i, len = memregion("samples")->bytes();
UINT8 *ROM = memregion("samples")->base();
- m_samplebuf = auto_alloc_array(machine(), INT16, len);
- save_pointer(NAME(m_samplebuf), len);
+ m_samplebuf = std::make_unique<INT16[]>(len);
+ save_pointer(NAME(m_samplebuf.get()), len);
for(i = 0; i < len; i++)
m_samplebuf[i] = ((INT8)(ROM[i] ^ 0x80)) * 256;
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index 2fad012c24c..b6cc9b7e4bb 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -373,7 +373,7 @@ WRITE16_MEMBER(m72_state::main_mcu_w)
//machine().scheduler().timer_set(m_mcu->cycles_to_attotime(0), FUNC(mcu_irq0_raise));
}
else
- machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), (offset<<16) | val, m_protection_ram);
+ machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), (offset<<16) | val, m_protection_ram.get());
}
WRITE8_MEMBER(m72_state::mcu_data_w)
@@ -382,7 +382,7 @@ WRITE8_MEMBER(m72_state::mcu_data_w)
if (offset&1) val = (m_protection_ram[offset/2] & 0x00ff) | (data << 8);
else val = (m_protection_ram[offset/2] & 0xff00) | (data&0xff);
- machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), ((offset >>1 ) << 16) | val, m_protection_ram);
+ machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), ((offset >>1 ) << 16) | val, m_protection_ram.get());
}
READ8_MEMBER(m72_state::mcu_data_r)
@@ -466,12 +466,12 @@ DRIVER_INIT_MEMBER(m72_state,m72_8751)
address_space &io = m_maincpu->space(AS_IO);
address_space &sndio = m_soundcpu->space(AS_IO);
- m_protection_ram = auto_alloc_array(machine(), UINT16, 0x10000/2);
+ m_protection_ram = std::make_unique<UINT16[]>(0x10000/2);
program.install_read_bank(0xb0000, 0xbffff, "bank1");
program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::main_mcu_w),this));
- membank("bank1")->configure_entry(0, m_protection_ram);
+ membank("bank1")->configure_entry(0, m_protection_ram.get());
- save_pointer(NAME(m_protection_ram), 0x10000/2);
+ save_pointer(NAME(m_protection_ram.get()), 0x10000/2);
save_item(NAME(m_mcu_sample_latch));
save_item(NAME(m_mcu_sample_addr));
save_item(NAME(m_mcu_snd_cmd_latch));
@@ -795,7 +795,7 @@ void m72_state::copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes)
READ16_MEMBER(m72_state::protection_r)
{
if (ACCESSING_BITS_8_15)
- copy_le(m_protection_ram,m_protection_code,CODE_LEN);
+ copy_le(m_protection_ram.get(),m_protection_code,CODE_LEN);
return m_protection_ram[0xffa/2+offset];
}
@@ -811,15 +811,15 @@ WRITE16_MEMBER(m72_state::protection_w)
void m72_state::install_protection_handler(const UINT8 *code,const UINT8 *crc)
{
- m_protection_ram = auto_alloc_array(machine(), UINT16, 0x1000/2);
+ m_protection_ram = std::make_unique<UINT16[]>(0x1000/2);
m_protection_code = code;
m_protection_crc = crc;
m_maincpu->space(AS_PROGRAM).install_read_bank(0xb0000, 0xb0fff, "bank1");
m_maincpu->space(AS_PROGRAM).install_read_handler(0xb0ffa, 0xb0ffb, read16_delegate(FUNC(m72_state::protection_r),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::protection_w),this));
- membank("bank1")->configure_entry(0, m_protection_ram);
+ membank("bank1")->configure_entry(0, m_protection_ram.get());
- save_pointer(NAME(m_protection_ram), 0x1000/2);
+ save_pointer(NAME(m_protection_ram.get()), 0x1000/2);
}
DRIVER_INIT_MEMBER(m72_state,bchopper)
diff --git a/src/mame/drivers/macs.cpp b/src/mame/drivers/macs.cpp
index 34f1bbda216..0bcdb63d3ce 100644
--- a/src/mame/drivers/macs.cpp
+++ b/src/mame/drivers/macs.cpp
@@ -73,7 +73,7 @@ public:
UINT8 m_mux_data;
UINT8 m_rev;
- UINT8 *m_ram1;
+ std::unique_ptr<UINT8[]> m_ram1;
required_shared_ptr<UINT8> m_ram2;
DECLARE_WRITE8_MEMBER(rambank_w);
DECLARE_READ8_MEMBER(macs_input_r);
@@ -639,7 +639,7 @@ static const UINT8 ramdata[160]=
MACHINE_RESET_MEMBER(macs_state,macs)
{
- UINT8 *macs_ram1 = m_ram1;
+ UINT8 *macs_ram1 = m_ram1.get();
#if 0
UINT8 *macs_ram2 = m_ram2;
/*
@@ -718,28 +718,28 @@ MACHINE_RESET_MEMBER(macs_state,macs)
DRIVER_INIT_MEMBER(macs_state,macs)
{
- m_ram1=auto_alloc_array(machine(), UINT8, 0x20000);
+ m_ram1=std::make_unique<UINT8[]>(0x20000);
m_maincpu->st0016_game=10|0x80;
m_rev = 1;
}
DRIVER_INIT_MEMBER(macs_state,macs2)
{
- m_ram1=auto_alloc_array(machine(), UINT8, 0x20000);
+ m_ram1=std::make_unique<UINT8[]>(0x20000);
m_maincpu->st0016_game=10|0x80;
m_rev = 2;
}
DRIVER_INIT_MEMBER(macs_state,kisekaeh)
{
- m_ram1=auto_alloc_array(machine(), UINT8, 0x20000);
+ m_ram1=std::make_unique<UINT8[]>(0x20000);
m_maincpu->st0016_game=11|0x180;
m_rev = 1;
}
DRIVER_INIT_MEMBER(macs_state,kisekaem)
{
- m_ram1=auto_alloc_array(machine(), UINT8, 0x20000);
+ m_ram1=std::make_unique<UINT8[]>(0x20000);
m_maincpu->st0016_game=10|0x180;
m_rev = 1;
}
diff --git a/src/mame/drivers/marinedt.cpp b/src/mame/drivers/marinedt.cpp
index 0572dd30412..0f8e24b6199 100644
--- a/src/mame/drivers/marinedt.cpp
+++ b/src/mame/drivers/marinedt.cpp
@@ -168,9 +168,9 @@ public:
required_shared_ptr<UINT8> m_tx_tileram;
/* video-related */
- bitmap_ind16 *m_tile;
- bitmap_ind16 *m_obj1;
- bitmap_ind16 *m_obj2;
+ std::unique_ptr<bitmap_ind16> m_tile;
+ std::unique_ptr<bitmap_ind16> m_obj1;
+ std::unique_ptr<bitmap_ind16> m_obj2;
tilemap_t *m_tx_tilemap;
UINT8 m_obj1_a;
@@ -561,9 +561,9 @@ void marinedt_state::video_start()
m_tx_tilemap->set_scrolldx(0, 4*8);
m_tx_tilemap->set_scrolldy(0, -4*8);
- m_tile = auto_bitmap_ind16_alloc(machine(), 32 * 8, 32 * 8);
- m_obj1 = auto_bitmap_ind16_alloc(machine(), 32, 32);
- m_obj2 = auto_bitmap_ind16_alloc(machine(), 32, 32);
+ m_tile = std::make_unique<bitmap_ind16>(32 * 8, 32 * 8);
+ m_obj1 = std::make_unique<bitmap_ind16>(32, 32);
+ m_obj2 = std::make_unique<bitmap_ind16>(32, 32);
}
diff --git a/src/mame/drivers/maygayv1.cpp b/src/mame/drivers/maygayv1.cpp
index d3e911d772a..36f074865aa 100644
--- a/src/mame/drivers/maygayv1.cpp
+++ b/src/mame/drivers/maygayv1.cpp
@@ -199,9 +199,9 @@ static const UINT32 banks[4] = { 0, 0x40000/2, 0x20000/2, 0x60000/2 };
struct i82716_t
{
UINT16 r[16];
- UINT16 *dram;
+ std::unique_ptr<UINT16[]> dram;
- UINT8 *line_buf; // there's actually two
+ std::unique_ptr<UINT8[]> line_buf; // there's actually two
};
@@ -336,7 +336,7 @@ UINT32 maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind1
/* Clear the frame buffer on each line to BG colour (palette entry 2) */
/* 4bpp only ! */
- memset(i82716.line_buf, 0x22, 512);
+ memset(i82716.line_buf.get(), 0x22, 512);
/* Parse the list of 16 objects */
for (obj = 0; obj < 16; ++obj)
@@ -838,10 +838,10 @@ WRITE8_MEMBER(maygayv1_state::b_writ)
void maygayv1_state::machine_start()
{
i82716_t &i82716 = m_i82716;
- i82716.dram = auto_alloc_array(machine(), UINT16, 0x80000/2); // ???
- i82716.line_buf = auto_alloc_array(machine(), UINT8, 512);
+ i82716.dram = std::make_unique<UINT16[]>(0x80000/2); // ???
+ i82716.line_buf = std::make_unique<UINT8[]>(512);
- save_pointer(NAME(i82716.dram), 0x40000);
+ save_pointer(NAME(i82716.dram.get()), 0x40000);
m_soundcpu->i8051_set_serial_tx_callback(write8_delegate(FUNC(maygayv1_state::data_from_i8031),this));
m_soundcpu->i8051_set_serial_rx_callback(read8_delegate(FUNC(maygayv1_state::data_to_i8031),this));
@@ -851,7 +851,7 @@ void maygayv1_state::machine_reset()
{
i82716_t &i82716 = m_i82716;
// ?
- memset(i82716.dram, 0, 0x40000);
+ memset(i82716.dram.get(), 0, 0x40000);
i82716.r[RWBA] = 0x0200;
}
diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp
index d7212977ae4..74598aa32e6 100644
--- a/src/mame/drivers/mediagx.cpp
+++ b/src/mame/drivers/mediagx.cpp
@@ -130,8 +130,8 @@ public:
UINT32 m_cx5510_regs[256/4];
- INT16 *m_dacl;
- INT16 *m_dacr;
+ std::unique_ptr<INT16[]> m_dacl;
+ std::unique_ptr<INT16[]> m_dacr;
int m_dacl_ptr;
int m_dacr_ptr;
@@ -659,8 +659,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(mediagx_state::sound_timer_callback)
m_ad1847_sample_counter = 0;
timer.adjust(attotime::from_msec(10));
- dmadac_transfer(&m_dmadac[0], 1, 0, 1, m_dacl_ptr, m_dacl);
- dmadac_transfer(&m_dmadac[1], 1, 0, 1, m_dacr_ptr, m_dacr);
+ dmadac_transfer(&m_dmadac[0], 1, 0, 1, m_dacl_ptr, m_dacl.get());
+ dmadac_transfer(&m_dmadac[1], 1, 0, 1, m_dacr_ptr, m_dacr.get());
m_dacl_ptr = 0;
m_dacr_ptr = 0;
@@ -847,8 +847,8 @@ INPUT_PORTS_END
void mediagx_state::machine_start()
{
- m_dacl = auto_alloc_array(machine(), INT16, 65536);
- m_dacr = auto_alloc_array(machine(), INT16, 65536);
+ m_dacl = std::make_unique<INT16[]>(65536);
+ m_dacr = std::make_unique<INT16[]>(65536);
}
void mediagx_state::machine_reset()
diff --git a/src/mame/drivers/megaplay.cpp b/src/mame/drivers/megaplay.cpp
index 1e70aa87996..f7533ce8fd1 100644
--- a/src/mame/drivers/megaplay.cpp
+++ b/src/mame/drivers/megaplay.cpp
@@ -115,8 +115,8 @@ private:
UINT8 m_bios_6403;
UINT8 m_bios_6404;
- UINT16 *m_ic36_ram;
- UINT8* m_ic37_ram;
+ std::unique_ptr<UINT16[]> m_ic36_ram;
+ std::unique_ptr<UINT8[]> m_ic37_ram;
required_shared_ptr<UINT8> m_ic3_ram;
optional_device<sega315_5124_device> m_vdp1;
@@ -896,8 +896,8 @@ DRIVER_INIT_MEMBER(mplay_state,megaplay)
}
// to support the old code
- m_ic36_ram = auto_alloc_array(machine(), UINT16, 0x10000 / 2);
- m_ic37_ram = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_ic36_ram = std::make_unique<UINT16[]>(0x10000 / 2);
+ m_ic37_ram = std::make_unique<UINT8[]>(0x10000);
DRIVER_INIT_CALL(megadrij);
m_megadrive_io_read_data_port_ptr = read8_delegate(FUNC(md_base_state::megadrive_io_read_data_port_3button),this);
diff --git a/src/mame/drivers/megatech.cpp b/src/mame/drivers/megatech.cpp
index 281578fd94f..a455dc369a6 100644
--- a/src/mame/drivers/megatech.cpp
+++ b/src/mame/drivers/megatech.cpp
@@ -156,7 +156,7 @@ private:
void switch_cart(int gameno);
- UINT8* m_banked_ram;
+ std::unique_ptr<UINT8[]> m_banked_ram;
UINT8* sms_mainram;
UINT8* sms_rom;
@@ -398,9 +398,9 @@ void mtech_state::set_genz80_as_md()
address_space &prg = m_z80snd->space(AS_PROGRAM);
prg.install_readwrite_bank(0x0000, 0x1fff, "bank1");
- machine().root_device().membank("bank1")->set_base(m_genz80.z80_prgram);
+ machine().root_device().membank("bank1")->set_base(m_genz80.z80_prgram.get());
- prg.install_ram(0x0000, 0x1fff, m_genz80.z80_prgram);
+ prg.install_ram(0x0000, 0x1fff, m_genz80.z80_prgram.get());
prg.install_readwrite_handler(0x4000, 0x4003, read8_delegate(FUNC(ym2612_device::read), (ym2612_device *)m_ymsnd), write8_delegate(FUNC(ym2612_device::write), (ym2612_device *)m_ymsnd));
prg.install_write_handler (0x6000, 0x6000, write8_delegate(FUNC(mtech_state::megadriv_z80_z80_bank_w),this));
@@ -595,7 +595,7 @@ ADDRESS_MAP_END
DRIVER_INIT_MEMBER(mtech_state,mt_slot)
{
- m_banked_ram = auto_alloc_array(machine(), UINT8, 0x1000*8);
+ m_banked_ram = std::make_unique<UINT8[]>(0x1000*8);
DRIVER_INIT_CALL(megadriv);
diff --git a/src/mame/drivers/merit.cpp b/src/mame/drivers/merit.cpp
index 9eea39980c1..01c902011ce 100644
--- a/src/mame/drivers/merit.cpp
+++ b/src/mame/drivers/merit.cpp
@@ -99,7 +99,7 @@ public:
pen_t m_pens[NUM_PENS];
required_shared_ptr<UINT8> m_ram_attr;
required_shared_ptr<UINT8> m_ram_video;
- UINT8 *m_ram_palette;
+ std::unique_ptr<UINT8[]> m_ram_palette;
UINT8 m_lscnblk;
int m_extra_video_bank_bit;
int m_question_address;
@@ -138,9 +138,9 @@ public:
void merit_state::machine_start()
{
m_question_address = 0;
- m_ram_palette = auto_alloc_array(machine(), UINT8, RAM_PALETTE_SIZE);
+ m_ram_palette = std::make_unique<UINT8[]>(RAM_PALETTE_SIZE);
- save_pointer(NAME(m_ram_palette), RAM_PALETTE_SIZE);
+ save_pointer(NAME(m_ram_palette.get()), RAM_PALETTE_SIZE);
save_item(NAME(m_lscnblk));
save_item(NAME(m_extra_video_bank_bit));
save_item(NAME(m_question_address));
diff --git a/src/mame/drivers/meritm.cpp b/src/mame/drivers/meritm.cpp
index b0e73d23d76..794ab9a46de 100644
--- a/src/mame/drivers/meritm.cpp
+++ b/src/mame/drivers/meritm.cpp
@@ -205,7 +205,7 @@ public:
m_region_extra(*this, "extra")
{ }
- UINT8* m_ram;
+ std::unique_ptr<UINT8[]> m_ram;
required_device<z80pio_device> m_z80pio_0;
required_device<z80pio_device> m_z80pio_1;
int m_vint;
@@ -1052,19 +1052,19 @@ MACHINE_START_MEMBER(meritm_state,meritm_crt250_crt252_crt258)
MACHINE_START_MEMBER(meritm_state,meritm_crt260)
{
- m_ram = auto_alloc_array(machine(), UINT8, 0x8000 );
- machine().device<nvram_device>("nvram")->set_base(m_ram, 0x8000);
- memset(m_ram, 0x00, 0x8000);
+ m_ram = std::make_unique<UINT8[]>( 0x8000 );
+ machine().device<nvram_device>("nvram")->set_base(m_ram.get(), 0x8000);
+ memset(m_ram.get(), 0x00, 0x8000);
m_bank1->configure_entries(0, 128, m_region_maincpu->base(), 0x8000);
m_bank2->configure_entries(0, 128, m_region_maincpu->base(), 0x8000);
- m_bank3->configure_entries(0, 4, m_ram, 0x2000);
+ m_bank3->configure_entries(0, 4, m_ram.get(), 0x2000);
m_bank = 0xff;
m_psd_a15 = 0;
meritm_switch_banks();
MACHINE_START_CALL_MEMBER(merit_common);
save_item(NAME(m_bank));
save_item(NAME(m_psd_a15));
- save_pointer(NAME(m_ram), 0x8000);
+ save_pointer(NAME(m_ram.get()), 0x8000);
}
TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::vblank_start_tick)
diff --git a/src/mame/drivers/midqslvr.cpp b/src/mame/drivers/midqslvr.cpp
index 08f997aa736..35dc9607862 100644
--- a/src/mame/drivers/midqslvr.cpp
+++ b/src/mame/drivers/midqslvr.cpp
@@ -40,13 +40,13 @@ public:
{
}
- UINT32 *m_bios_ram;
- UINT32 *m_bios_ext1_ram;
- UINT32 *m_bios_ext2_ram;
- UINT32 *m_bios_ext3_ram;
- UINT32 *m_bios_ext4_ram;
- UINT32 *m_isa_ram1;
- UINT32 *m_isa_ram2;
+ std::unique_ptr<UINT32[]> m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext1_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext2_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext3_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext4_ram;
+ std::unique_ptr<UINT32[]> m_isa_ram1;
+ std::unique_ptr<UINT32[]> m_isa_ram2;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -108,7 +108,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x59: // PAM0
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
- state->membank("bios_bank")->set_base(state->m_bios_ram);
+ state->membank("bios_bank")->set_base(state->m_bios_ram.get());
else // disable RAM access (reads go to BIOS ROM)
state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x70000);
break;
@@ -116,12 +116,12 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x5a: // PAM1
{
if (data & 0x1)
- state->membank("video_bank1")->set_base(state->m_isa_ram1);
+ state->membank("video_bank1")->set_base(state->m_isa_ram1.get());
else
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);
+ state->membank("video_bank2")->set_base(state->m_isa_ram2.get());
else
state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
@@ -130,12 +130,12 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x5e: // PAM5
{
if (data & 0x1)
- state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
+ state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram.get());
else
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);
+ state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram.get());
else
state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x64000);
@@ -144,12 +144,12 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x5f: // PAM6
{
if (data & 0x1)
- state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
+ state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram.get());
else
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);
+ state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram.get());
else
state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0x6c000);
@@ -300,7 +300,7 @@ WRITE32_MEMBER(midqslvr_state::isa_ram1_w)
{
if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_isa_ram1 + offset);
+ COMBINE_DATA(m_isa_ram1.get() + offset);
}
}
@@ -308,7 +308,7 @@ WRITE32_MEMBER(midqslvr_state::isa_ram2_w)
{
if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_isa_ram2 + offset);
+ COMBINE_DATA(m_isa_ram2.get() + offset);
}
}
@@ -316,7 +316,7 @@ WRITE32_MEMBER(midqslvr_state::bios_ext1_ram_w)
{
if (m_mtxc_config_reg[0x5e] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext1_ram + offset);
+ COMBINE_DATA(m_bios_ext1_ram.get() + offset);
}
}
@@ -325,7 +325,7 @@ WRITE32_MEMBER(midqslvr_state::bios_ext2_ram_w)
{
if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext2_ram + offset);
+ COMBINE_DATA(m_bios_ext2_ram.get() + offset);
}
}
@@ -334,7 +334,7 @@ WRITE32_MEMBER(midqslvr_state::bios_ext3_ram_w)
{
if (m_mtxc_config_reg[0x5f] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext3_ram + offset);
+ COMBINE_DATA(m_bios_ext3_ram.get() + offset);
}
}
@@ -343,7 +343,7 @@ WRITE32_MEMBER(midqslvr_state::bios_ext4_ram_w)
{
if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext4_ram + offset);
+ COMBINE_DATA(m_bios_ext4_ram.get() + offset);
}
}
@@ -352,7 +352,7 @@ WRITE32_MEMBER(midqslvr_state::bios_ram_w)
{
if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -385,13 +385,13 @@ ADDRESS_MAP_END
void midqslvr_state::machine_start()
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
- m_bios_ext1_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ext2_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ext3_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ext4_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_isa_ram1 = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_isa_ram2 = auto_alloc_array(machine(), UINT32, 0x4000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x10000/4);
+ m_bios_ext1_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ext2_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ext3_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ext4_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_isa_ram1 = std::make_unique<UINT32[]>(0x4000/4);
+ m_isa_ram2 = std::make_unique<UINT32[]>(0x4000/4);
intel82439tx_init();
}
diff --git a/src/mame/drivers/mjsister.cpp b/src/mame/drivers/mjsister.cpp
index 07bc532a2c7..eb171d95a35 100644
--- a/src/mame/drivers/mjsister.cpp
+++ b/src/mame/drivers/mjsister.cpp
@@ -31,8 +31,8 @@ public:
m_dac(*this, "dac") { }
/* video-related */
- bitmap_ind16 *m_tmpbitmap0;
- bitmap_ind16 *m_tmpbitmap1;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap0;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap1;
int m_flip_screen;
int m_video_enable;
int m_screen_redraw;
@@ -90,8 +90,8 @@ protected:
void mjsister_state::video_start()
{
- m_tmpbitmap0 = auto_bitmap_ind16_alloc(machine(), 256, 256);
- m_tmpbitmap1 = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_tmpbitmap0 = std::make_unique<bitmap_ind16>(256, 256);
+ m_tmpbitmap1 = std::make_unique<bitmap_ind16>(256, 256);
save_item(NAME(m_videoram0));
save_item(NAME(m_videoram1));
diff --git a/src/mame/drivers/mlanding.cpp b/src/mame/drivers/mlanding.cpp
index c50ca0ccd78..a4cb4078ec7 100644
--- a/src/mame/drivers/mlanding.cpp
+++ b/src/mame/drivers/mlanding.cpp
@@ -111,7 +111,7 @@ public:
required_device<palette_device> m_palette;
- UINT16 *m_dma_ram;
+ std::unique_ptr<UINT16[]> m_dma_ram;
UINT8 m_dma_cpu_bank;
UINT8 m_dma_busy;
UINT16 m_dsp_hold_signal;
@@ -172,11 +172,11 @@ protected:
void mlanding_state::machine_start()
{
// Allocate two DMA RAM banks
- m_dma_ram = auto_alloc_array(machine(), UINT16, c_dma_bank_words * 2);
- m_dma_bank->configure_entries(0, 2, m_dma_ram, c_dma_bank_words * 2);
+ m_dma_ram = std::make_unique<UINT16[]>(c_dma_bank_words * 2);
+ m_dma_bank->configure_entries(0, 2, m_dma_ram.get(), c_dma_bank_words * 2);
// Register state for saving
- save_pointer(NAME(m_dma_ram), c_dma_bank_words * 2);
+ save_pointer(NAME(m_dma_ram.get()), c_dma_bank_words * 2);
save_item(NAME(m_dma_cpu_bank));
save_item(NAME(m_dma_busy));
save_item(NAME(m_dsp_hold_signal));
diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp
index 69058990c3d..37d4d7339ad 100644
--- a/src/mame/drivers/model3.cpp
+++ b/src/mame/drivers/model3.cpp
@@ -5607,8 +5607,8 @@ static void interleave_vroms(running_machine &machine)
int vrom_length = state->memregion("user3")->bytes();
UINT16 *vrom;
- state->m_vrom = auto_alloc_array(machine, UINT32, 0x4000000/4);
- vrom = (UINT16 *)state->m_vrom;
+ state->m_vrom = std::make_unique<UINT32[]>(0x4000000/4);
+ vrom = (UINT16 *)state->m_vrom.get();
if( vrom_length <= 0x1000000 ) {
start = 0x1000000;
diff --git a/src/mame/drivers/monzagp.cpp b/src/mame/drivers/monzagp.cpp
index 1c421b5bf22..8e7ec24f0ce 100644
--- a/src/mame/drivers/monzagp.cpp
+++ b/src/mame/drivers/monzagp.cpp
@@ -80,8 +80,8 @@ private:
bool m_time_tick;
bool m_cp_ruote;
UINT8 m_mycar_pos;
- UINT8 *m_vram;
- UINT8 *m_score_ram;
+ std::unique_ptr<UINT8[]> m_vram;
+ std::unique_ptr<UINT8[]> m_score_ram;
};
@@ -97,15 +97,15 @@ PALETTE_INIT_MEMBER(monzagp_state, monzagp)
void monzagp_state::video_start()
{
- m_vram = auto_alloc_array(machine(), UINT8, 0x800);
- m_score_ram = auto_alloc_array(machine(), UINT8, 0x100);
+ m_vram = std::make_unique<UINT8[]>(0x800);
+ m_score_ram = std::make_unique<UINT8[]>(0x100);
m_time_tick = 0;
m_cp_ruote = 0;
m_mycar_pos = 7*16;
- save_pointer(NAME(m_vram), 0x800);
- save_pointer(NAME(m_score_ram), 0x100);
+ save_pointer(NAME(m_vram.get()), 0x800);
+ save_pointer(NAME(m_score_ram.get()), 0x100);
- m_nvram->set_base(m_score_ram, 0x100);
+ m_nvram->set_base(m_score_ram.get(), 0x100);
}
UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp
index 2d2ec7abc0a..beb0a9e0bca 100644
--- a/src/mame/drivers/mrgame.cpp
+++ b/src/mame/drivers/mrgame.cpp
@@ -76,7 +76,7 @@ public:
DECLARE_READ8_MEMBER(rsw_r);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer);
UINT32 screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- bitmap_ind16 *m_tile_bitmap;
+ std::unique_ptr<bitmap_ind16> m_tile_bitmap;
required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_p_videoram;
required_shared_ptr<UINT8> m_p_objectram;
@@ -299,7 +299,7 @@ READ8_MEMBER( mrgame_state::portc_r )
void mrgame_state::machine_start()
{
- m_tile_bitmap=auto_bitmap_ind16_alloc(machine(),256,256);
+ m_tile_bitmap=std::make_unique<bitmap_ind16>(256,256);
}
void mrgame_state::machine_reset()
diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp
index 33294d7c2af..a42790ee244 100644
--- a/src/mame/drivers/ms32.cpp
+++ b/src/mame/drivers/ms32.cpp
@@ -2185,7 +2185,7 @@ void ms32_state::configure_banks()
DRIVER_INIT_MEMBER(ms32_state,ms32_common)
{
- m_nvram_8 = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_nvram_8 = std::make_unique<UINT8[]>(0x2000);
configure_banks();
}
diff --git a/src/mame/drivers/multigam.cpp b/src/mame/drivers/multigam.cpp
index 92cb75e24b1..2a1c7772b6c 100644
--- a/src/mame/drivers/multigam.cpp
+++ b/src/mame/drivers/multigam.cpp
@@ -123,8 +123,8 @@ public:
required_device<cpu_device> m_maincpu;
required_device<ppu2c0x_device> m_ppu;
- UINT8* m_nt_ram;
- UINT8* m_vram;
+ std::unique_ptr<UINT8[]> m_nt_ram;
+ std::unique_ptr<UINT8[]> m_vram;
UINT8* m_nt_page[4];
UINT32 m_in_0;
UINT32 m_in_1;
@@ -138,7 +138,7 @@ public:
int m_multigam3_mmc3_banks[2];
int m_multigam3_mmc3_4screen;
int m_multigam3_mmc3_last_bank;
- UINT8* m_multigmc_mmc3_6000_ram;
+ std::unique_ptr<UINT8[]> m_multigmc_mmc3_6000_ram;
UINT8* m_multigam3_mmc3_prg_base;
int m_multigam3_mmc3_prg_size;
int m_multigam3_mmc3_chr_bank_base;
@@ -212,29 +212,29 @@ void multigam_state::set_mirroring(int mirroring)
switch(mirroring)
{
case PPU_MIRROR_LOW:
- m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram;
+ m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram.get();
break;
case PPU_MIRROR_HIGH:
- m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram + 0x400;
+ m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_HORZ:
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram;
- m_nt_page[2] = m_nt_ram + 0x400;
- m_nt_page[3] = m_nt_ram + 0x400;
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get();
+ m_nt_page[2] = m_nt_ram.get() + 0x400;
+ m_nt_page[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_VERT:
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram;
- m_nt_page[3] = m_nt_ram + 0x400;
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get();
+ m_nt_page[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_NONE:
default:
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
break;
}
}
@@ -274,7 +274,7 @@ void multigam_state::set_videoram_bank( int start, int count, int bank, int bank
/* count determines the size of the area mapped in KB */
for (i = 0; i < count; i++, offset += 0x400)
{
- membank(banknames[i + start])->set_base(m_vram + offset);
+ membank(banknames[i + start])->set_base(m_vram.get() + offset);
}
}
@@ -554,7 +554,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w)
case 0x2001: /* enable ram at $6000 */
if (data & 0x80)
{
- membank("bank10")->set_base(m_multigmc_mmc3_6000_ram);
+ membank("bank10")->set_base(m_multigmc_mmc3_6000_ram.get());
}
else
{
@@ -591,7 +591,7 @@ void multigam_state::multigam_init_mmc3(UINT8 *prg_base, int prg_size, int chr_b
// 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)
- memcpy(m_multigmc_mmc3_6000_ram, dst + 0x6000, 0x2000);
+ memcpy(m_multigmc_mmc3_6000_ram.get(), dst + 0x6000, 0x2000);
memcpy(&dst[0x8000], prg_base + (prg_size - 0x4000), 0x4000);
memcpy(&dst[0xc000], prg_base + (prg_size - 0x4000), 0x4000);
@@ -899,7 +899,7 @@ void multigam_state::supergm3_set_bank()
// VRAM
m_ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1");
m_ppu->space(AS_PROGRAM).install_write_bank(0x0000, 0x1fff, "bank1");
- membank("bank1")->set_base(m_vram);
+ membank("bank1")->set_base(m_vram.get());
if (m_supergm3_chr_bank == 0x40)
set_mirroring(PPU_MIRROR_VERT);
@@ -1158,11 +1158,11 @@ MACHINE_RESET_MEMBER(multigam_state,multigm3)
void multigam_state::machine_start()
{
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this));
m_ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1");
@@ -1171,11 +1171,11 @@ void multigam_state::machine_start()
MACHINE_START_MEMBER(multigam_state,multigm3)
{
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this));
@@ -1193,16 +1193,16 @@ MACHINE_START_MEMBER(multigam_state,multigm3)
MACHINE_START_MEMBER(multigam_state,supergm3)
{
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_nt_page[0] = m_nt_ram;
- m_nt_page[1] = m_nt_ram + 0x400;
- m_nt_page[2] = m_nt_ram + 0x800;
- m_nt_page[3] = m_nt_ram + 0xc00;
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
+ m_nt_page[0] = m_nt_ram.get();
+ m_nt_page[1] = m_nt_ram.get() + 0x400;
+ m_nt_page[2] = m_nt_ram.get() + 0x800;
+ m_nt_page[3] = m_nt_ram.get() + 0xc00;
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this));
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
- m_multigmc_mmc3_6000_ram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
+ m_multigmc_mmc3_6000_ram = std::make_unique<UINT8[]>(0x2000);
}
static MACHINE_CONFIG_START( multigam, multigam_state )
@@ -1406,7 +1406,7 @@ DRIVER_INIT_MEMBER(multigam_state,multigm3)
multigm3_decrypt(memregion("maincpu")->base(), memregion("maincpu")->bytes(), decode );
multigm3_decrypt(memregion("user1")->base(), memregion("user1")->bytes(), decode );
- m_multigmc_mmc3_6000_ram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_multigmc_mmc3_6000_ram = std::make_unique<UINT8[]>(0x2000);
multigam_switch_prg_rom(space, 0x0, 0x01);
}
diff --git a/src/mame/drivers/namcofl.cpp b/src/mame/drivers/namcofl.cpp
index fac0b6a60dc..7291f72ff69 100644
--- a/src/mame/drivers/namcofl.cpp
+++ b/src/mame/drivers/namcofl.cpp
@@ -188,13 +188,13 @@ WRITE32_MEMBER(namcofl_state::namcofl_sysreg_w)
{
if (data == 0) // RAM at 00000000, ROM at 10000000
{
- membank("bank1")->set_base(m_workram );
+ membank("bank1")->set_base(m_workram.get());
membank("bank2")->set_base(memregion("maincpu")->base() );
}
else // ROM at 00000000, RAM at 10000000
{
membank("bank1")->set_base(memregion("maincpu")->base() );
- membank("bank2")->set_base(m_workram );
+ membank("bank2")->set_base(m_workram.get());
}
}
}
@@ -571,9 +571,9 @@ MACHINE_RESET_MEMBER(namcofl_state,namcofl)
machine().scheduler().timer_set(m_screen->time_until_pos(m_screen->visible_area().max_y + 1), timer_expired_delegate(FUNC(namcofl_state::vblank_interrupt_callback),this));
membank("bank1")->set_base(memregion("maincpu")->base() );
- membank("bank2")->set_base(m_workram );
+ membank("bank2")->set_base(m_workram.get() );
- memset(m_workram, 0x00, 0x100000);
+ memset(m_workram.get(), 0x00, 0x100000);
}
@@ -790,10 +790,10 @@ ROM_END
void namcofl_state::common_init()
{
- m_workram = auto_alloc_array(machine(), UINT32, 0x100000/4);
+ m_workram = std::make_unique<UINT32[]>(0x100000/4);
membank("bank1")->set_base(memregion("maincpu")->base() );
- membank("bank2")->set_base(m_workram );
+ membank("bank2")->set_base(m_workram.get());
}
DRIVER_INIT_MEMBER(namcofl_state,speedrcr)
diff --git a/src/mame/drivers/namcoic.cpp b/src/mame/drivers/namcoic.cpp
index 8790639cfe7..2044ca756a9 100644
--- a/src/mame/drivers/namcoic.cpp
+++ b/src/mame/drivers/namcoic.cpp
@@ -22,7 +22,7 @@ static struct
* 0x30/2 color
*/
tilemap_t *tmap[6];
- UINT16 *videoram;
+ std::unique_ptr<UINT16[]> videoram;
int gfxbank;
UINT8 *maskBaseAddr;
void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask);
@@ -59,7 +59,7 @@ void namcos2_shared_state::namco_tilemap_init( int gfxbank, void *maskBaseAddr,
mTilemapInfo.gfxbank = gfxbank;
mTilemapInfo.maskBaseAddr = (UINT8 *)maskBaseAddr;
mTilemapInfo.cb = cb;
- mTilemapInfo.videoram = auto_alloc_array(machine(), UINT16, 0x10000 );
+ mTilemapInfo.videoram = std::make_unique<UINT16[]>( 0x10000 );
/* four scrolling tilemaps */
mTilemapInfo.tmap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcos2_shared_state::get_tile_info0),this),TILEMAP_SCAN_ROWS,8,8,64,64);
diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp
index 819d139dfbc..10e02334f17 100644
--- a/src/mame/drivers/namcos21.cpp
+++ b/src/mame/drivers/namcos21.cpp
@@ -2448,7 +2448,7 @@ ROM_END
void namcos21_state::init(int game_type)
{
m_gametype = game_type;
- m_pointram = auto_alloc_array(machine(), UINT8, PTRAM_SIZE);
+ m_pointram = std::make_unique<UINT8[]>(PTRAM_SIZE);
init_dsp();
m_mbNeedsKickstart = 20;
if( game_type==NAMCOS21_CYBERSLED )
@@ -2464,10 +2464,10 @@ DRIVER_INIT_MEMBER(namcos21_state,winrun)
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
- m_winrun_dspcomram = auto_alloc_array(machine(), UINT16, 0x1000*2);
+ m_winrun_dspcomram = std::make_unique<UINT16[]>(0x1000*2);
m_gametype = NAMCOS21_WINRUN91;
- m_pointram = auto_alloc_array(machine(), UINT8, PTRAM_SIZE);
+ m_pointram = std::make_unique<UINT8[]>(PTRAM_SIZE);
m_pointram_idx = 0;
m_mbNeedsKickstart = 0;
}
@@ -2505,9 +2505,9 @@ DRIVER_INIT_MEMBER(namcos21_state,driveyes)
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
- m_winrun_dspcomram = auto_alloc_array(machine(), UINT16, 0x1000*2);
+ m_winrun_dspcomram = std::make_unique<UINT16[]>(0x1000*2);
m_gametype = NAMCOS21_DRIVERS_EYES;
- m_pointram = auto_alloc_array(machine(), UINT8, PTRAM_SIZE);
+ m_pointram = std::make_unique<UINT8[]>(PTRAM_SIZE);
m_pointram_idx = 0;
m_mbNeedsKickstart = 0;
}
diff --git a/src/mame/drivers/nes.cpp b/src/mame/drivers/nes.cpp
index 96292db4b15..bfce851aae6 100644
--- a/src/mame/drivers/nes.cpp
+++ b/src/mame/drivers/nes.cpp
@@ -184,7 +184,7 @@ void nes_state::setup_disk(nes_disksys_device *slot)
slot->vram_alloc(0x2000);
slot->prgram_alloc(0x8000);
- slot->pcb_start(machine(), m_ciram, FALSE);
+ slot->pcb_start(machine(), m_ciram.get(), FALSE);
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(device_nes_cart_interface::chr_r),(device_nes_cart_interface *)slot), write8_delegate(FUNC(device_nes_cart_interface::chr_w),(device_nes_cart_interface *)slot));
m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(device_nes_cart_interface::nt_r),(device_nes_cart_interface *)slot), write8_delegate(FUNC(device_nes_cart_interface::nt_w),(device_nes_cart_interface *)slot));
m_ppu->set_scanline_callback(ppu2c0x_scanline_delegate(FUNC(device_nes_cart_interface::scanline_irq),(device_nes_cart_interface *)slot));
@@ -196,13 +196,13 @@ void nes_state::setup_disk(nes_disksys_device *slot)
MACHINE_START_MEMBER( nes_state, fds )
{
- m_ciram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_ciram = std::make_unique<UINT8[]>(0x800);
m_io_disksel = ioport("FLIPDISK");
setup_disk(m_disk);
// register saves
save_item(NAME(m_last_frame_flip));
- save_pointer(NAME(m_ciram), 0x800);
+ save_pointer(NAME(m_ciram.get()), 0x800);
}
MACHINE_RESET_MEMBER( nes_state, fds )
diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp
index dd836131e8f..3d4719b95f1 100644
--- a/src/mame/drivers/nwk-tr.cpp
+++ b/src/mame/drivers/nwk-tr.cpp
@@ -304,8 +304,8 @@ public:
int m_fpga_uploaded;
int m_lanc2_ram_r;
int m_lanc2_ram_w;
- UINT8 *m_lanc2_ram;
- UINT32 *m_sharc_dataram;
+ std::unique_ptr<UINT8[]> m_lanc2_ram;
+ std::unique_ptr<UINT32[]> m_sharc_dataram;
DECLARE_WRITE32_MEMBER(paletteram32_w);
DECLARE_READ32_MEMBER(sysreg_r);
DECLARE_WRITE32_MEMBER(sysreg_w);
@@ -443,7 +443,7 @@ void nwktr_state::lanc2_init()
m_fpga_uploaded = 0;
m_lanc2_ram_r = 0;
m_lanc2_ram_w = 0;
- m_lanc2_ram = auto_alloc_array(machine(), UINT8, 0x8000);
+ m_lanc2_ram = std::make_unique<UINT8[]>(0x8000);
}
READ32_MEMBER(nwktr_state::lanc1_r)
@@ -841,7 +841,7 @@ DRIVER_INIT_MEMBER(nwktr_state, nwktr)
{
machine().device<konppc_device>("konppc")->set_cgboard_texture_bank(0, "bank5", memregion("user5")->base());
- m_sharc_dataram = auto_alloc_array(machine(), UINT32, 0x100000/4);
+ m_sharc_dataram = std::make_unique<UINT32[]>(0x100000/4);
m_led_reg0 = m_led_reg1 = 0x7f;
lanc2_init();
diff --git a/src/mame/drivers/panicr.cpp b/src/mame/drivers/panicr.cpp
index c5fd69f4342..ada8a26f185 100644
--- a/src/mame/drivers/panicr.cpp
+++ b/src/mame/drivers/panicr.cpp
@@ -97,8 +97,8 @@ public:
tilemap_t *m_txttilemap;
int m_scrollx;
- bitmap_ind16 *m_temprender;
- bitmap_ind16 *m_tempbitmap_1;
+ std::unique_ptr<bitmap_ind16> m_temprender;
+ std::unique_ptr<bitmap_ind16> m_tempbitmap_1;
rectangle m_tempbitmap_clip;
DECLARE_READ8_MEMBER(collision_r);
@@ -821,8 +821,8 @@ DRIVER_INIT_MEMBER(panicr_state,panicr)
}
}
- m_tempbitmap_1 = auto_bitmap_ind16_alloc(machine(),256,256);
- m_temprender = auto_bitmap_ind16_alloc(machine(),256,256);
+ m_tempbitmap_1 = std::make_unique<bitmap_ind16>(256,256);
+ m_temprender = std::make_unique<bitmap_ind16>(256,256);
m_tempbitmap_clip.set(0, 256-1, 0, 256-1);
m_tempbitmap_1->fill(0, m_tempbitmap_clip);
diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp
index 7ae3c96a8f2..2a9ec18114d 100644
--- a/src/mame/drivers/pasopia7.cpp
+++ b/src/mame/drivers/pasopia7.cpp
@@ -88,7 +88,7 @@ public:
DECLARE_READ8_MEMBER(nmi_portb_r);
UINT8 m_vram_sel;
UINT8 m_mio_sel;
- UINT8 *m_p7_pal;
+ std::unique_ptr<UINT8[]> m_p7_pal;
UINT8 m_bank_reg;
UINT16 m_cursor_addr;
UINT8 m_cursor_blink;
@@ -136,7 +136,7 @@ TIMER_CALLBACK_MEMBER(pasopia7_state::pio_timer)
VIDEO_START_MEMBER(pasopia7_state,pasopia7)
{
- m_p7_pal = auto_alloc_array(machine(), UINT8, 0x10);
+ m_p7_pal = std::make_unique<UINT8[]>(0x10);
}
void pasopia7_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width)
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index e24ba892e97..8c151817379 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -516,7 +516,7 @@ public:
UINT8 m_txt_scroll_reg[8];
UINT8 m_pal_clut[4];
- UINT16 *m_tvram;
+ std::unique_ptr<UINT16[]> m_tvram;
UINT16 m_font_addr;
UINT8 m_font_line;
@@ -749,7 +749,7 @@ void pc9801_state::device_timer(emu_timer &timer, device_timer_id id, int param,
void pc9801_state::video_start()
{
- m_tvram = auto_alloc_array(machine(), UINT16, 0x2000);
+ m_tvram = std::make_unique<UINT16[]>(0x2000);
// find memory regions
m_char_rom = memregion("chargen")->base();
@@ -3068,7 +3068,7 @@ MACHINE_START_MEMBER(pc9801_state,pc9821ap2)
MACHINE_RESET_MEMBER(pc9801_state,pc9801_common)
{
- memset(m_tvram, 0, sizeof(UINT16) * 0x2000);
+ memset(m_tvram.get(), 0, sizeof(UINT16) * 0x2000);
/* this looks like to be some kind of backup ram, system will boot with green colors otherwise */
{
int i;
diff --git a/src/mame/drivers/peplus.cpp b/src/mame/drivers/peplus.cpp
index 178a853a9f1..98245f6b26b 100644
--- a/src/mame/drivers/peplus.cpp
+++ b/src/mame/drivers/peplus.cpp
@@ -256,8 +256,8 @@ public:
UINT16 door_wait;
UINT8 m_jumper_e16_e17;
UINT16 m_vid_address;
- UINT8 *m_palette_ram;
- UINT8 *m_palette_ram2;
+ std::unique_ptr<UINT8[]> m_palette_ram;
+ std::unique_ptr<UINT8[]> m_palette_ram2;
UINT64 m_last_cycles;
UINT8 m_coin_state;
UINT64 m_last_door;
@@ -903,10 +903,10 @@ TILE_GET_INFO_MEMBER(peplus_state::get_bg_tile_info)
void peplus_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(peplus_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25);
- m_palette_ram = auto_alloc_array(machine(), UINT8, 0x3000);
- memset(m_palette_ram, 0, 0x3000);
- m_palette_ram2 = auto_alloc_array(machine(), UINT8, 0x3000);
- memset(m_palette_ram2, 0, 0x3000);
+ m_palette_ram = std::make_unique<UINT8[]>(0x3000);
+ memset(m_palette_ram.get(), 0, 0x3000);
+ m_palette_ram2 = std::make_unique<UINT8[]>(0x3000);
+ memset(m_palette_ram2.get(), 0, 0x3000);
}
UINT32 peplus_state::screen_update_peplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/drivers/pgm.cpp b/src/mame/drivers/pgm.cpp
index 86eea22389e..b8a5d87e214 100644
--- a/src/mame/drivers/pgm.cpp
+++ b/src/mame/drivers/pgm.cpp
@@ -4376,7 +4376,7 @@ void pgm_state::expand_colourdata()
while (m_sprite_a_region_size < needed)
m_sprite_a_region_size <<= 1;
- m_sprite_a_region = auto_alloc_array(machine(), UINT8, m_sprite_a_region_size);
+ m_sprite_a_region = std::make_unique<UINT8[]>(m_sprite_a_region_size);
for (cnt = 0 ; cnt < srcsize / 2 ; cnt++)
{
diff --git a/src/mame/drivers/pipeline.cpp b/src/mame/drivers/pipeline.cpp
index 00296c48b28..0757fd1ae32 100644
--- a/src/mame/drivers/pipeline.cpp
+++ b/src/mame/drivers/pipeline.cpp
@@ -96,7 +96,7 @@ public:
tilemap_t *m_tilemap2;
UINT8 m_vidctrl;
- UINT8 *m_palram;
+ std::unique_ptr<UINT8[]> m_palram;
UINT8 m_toMCU;
UINT8 m_fromMCU;
UINT8 m_ddrA;
@@ -151,13 +151,13 @@ TILE_GET_INFO_MEMBER(pipeline_state::get_tile_info2)
void pipeline_state::video_start()
{
- m_palram=auto_alloc_array(machine(), UINT8, 0x1000);
+ m_palram=std::make_unique<UINT8[]>(0x1000);
m_tilemap1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pipeline_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32 );
m_tilemap2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pipeline_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,64,32 );
m_tilemap2->set_transparent_pen(0);
save_item(NAME(m_vidctrl));
- save_pointer(NAME(m_palram), 0x1000);
+ save_pointer(NAME(m_palram.get()), 0x1000);
}
UINT32 pipeline_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/drivers/progolf.cpp b/src/mame/drivers/progolf.cpp
index bdaf0032601..213be37d7aa 100644
--- a/src/mame/drivers/progolf.cpp
+++ b/src/mame/drivers/progolf.cpp
@@ -81,7 +81,7 @@ public:
UINT8 m_char_pen;
UINT8 m_char_pen_vreg;
- UINT8 *m_fg_fb;
+ std::unique_ptr<UINT8[]> m_fg_fb;
UINT8 m_scrollx_hi;
UINT8 m_scrollx_lo;
UINT8 m_gfx_switch;
@@ -117,11 +117,11 @@ void progolf_state::video_start()
m_scrollx_hi = 0;
m_scrollx_lo = 0;
- m_fg_fb = auto_alloc_array(machine(), UINT8, 0x2000*8);
+ m_fg_fb = std::make_unique<UINT8[]>(0x2000*8);
save_item(NAME(m_char_pen));
save_item(NAME(m_char_pen_vreg));
- save_pointer(NAME(m_fg_fb), 0x2000*8);
+ save_pointer(NAME(m_fg_fb.get()), 0x2000*8);
save_item(NAME(m_scrollx_hi));
save_item(NAME(m_scrollx_lo));
save_item(NAME(m_gfx_switch));
diff --git a/src/mame/drivers/psion.cpp b/src/mame/drivers/psion.cpp
index e877ae3d52e..9041ccf92b6 100644
--- a/src/mame/drivers/psion.cpp
+++ b/src/mame/drivers/psion.cpp
@@ -472,16 +472,16 @@ void psion_state::machine_start()
if (m_ram_bank_count)
{
- m_paged_ram = auto_alloc_array(machine(), UINT8, m_ram_bank_count * 0x4000);
- memset(m_paged_ram, 0, sizeof(UINT8) * (m_ram_bank_count * 0x4000));
- membank("rambank")->configure_entries(0, m_ram_bank_count, m_paged_ram, 0x4000);
+ m_paged_ram = std::make_unique<UINT8[]>(m_ram_bank_count * 0x4000);
+ memset(m_paged_ram.get(), 0, sizeof(UINT8) * (m_ram_bank_count * 0x4000));
+ membank("rambank")->configure_entries(0, m_ram_bank_count, m_paged_ram.get(), 0x4000);
membank("rambank")->set_entry(0);
}
m_nvram1->set_base(m_sys_register, 0xc0);
m_nvram2->set_base(m_ram, m_ram.bytes());
if (m_nvram3)
- m_nvram3->set_base(m_paged_ram, m_ram_bank_count * 0x4000);
+ m_nvram3->set_base(m_paged_ram.get(), m_ram_bank_count * 0x4000);
save_item(NAME(m_kb_counter));
save_item(NAME(m_enable_nmi));
@@ -494,7 +494,7 @@ void psion_state::machine_start()
save_item(NAME(m_port2));
save_item(NAME(m_port6_ddr));
save_item(NAME(m_port6));
- save_pointer(NAME(m_paged_ram), m_ram_bank_count * 0x4000);
+ save_pointer(NAME(m_paged_ram.get()), m_ram_bank_count * 0x4000);
}
void psion_state::machine_reset()
diff --git a/src/mame/drivers/px4.cpp b/src/mame/drivers/px4.cpp
index 61513abaf0b..ed00f53f189 100644
--- a/src/mame/drivers/px4.cpp
+++ b/src/mame/drivers/px4.cpp
@@ -278,7 +278,7 @@ private:
required_device<generic_slot_device> m_rdsocket;
offs_t m_ramdisk_address;
- UINT8 *m_ramdisk;
+ std::unique_ptr<UINT8[]> m_ramdisk;
};
@@ -1223,7 +1223,7 @@ DRIVER_INIT_MEMBER( px4p_state, px4p )
DRIVER_INIT_CALL(px4);
// reserve memory for external ram-disk
- m_ramdisk = auto_alloc_array(machine(), UINT8, 0x20000);
+ m_ramdisk = std::make_unique<UINT8[]>(0x20000);
}
void px4_state::machine_start()
@@ -1248,7 +1248,7 @@ void px4_state::machine_reset()
void px4p_state::machine_start()
{
px4_state::machine_start();
- m_rdnvram->set_base(m_ramdisk, 0x20000);
+ m_rdnvram->set_base(m_ramdisk.get(), 0x20000);
}
diff --git a/src/mame/drivers/queen.cpp b/src/mame/drivers/queen.cpp
index cd95ccfef51..21b69043b7a 100644
--- a/src/mame/drivers/queen.cpp
+++ b/src/mame/drivers/queen.cpp
@@ -43,8 +43,8 @@ public:
{
}
- UINT32 *m_bios_ram;
- UINT32 *m_bios_ext_ram;
+ std::unique_ptr<UINT32[]> m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext_ram;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -85,11 +85,11 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
if (reg == 0x63)
{
if (data & 0x20) // enable RAM access to region 0xf0000 - 0xfffff
- state->membank("bios_bank")->set_base(state->m_bios_ram);
+ state->membank("bios_bank")->set_base(state->m_bios_ram.get());
else // disable RAM access (reads go to BIOS ROM)
state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x30000);
if (data & 0x80) // enable RAM access to region 0xe0000 - 0xeffff
- state->membank("bios_ext")->set_base(state->m_bios_ext_ram);
+ state->membank("bios_ext")->set_base(state->m_bios_ext_ram.get());
else
state->membank("bios_ext")->set_base(state->memregion("bios")->base() + 0x20000);
}
@@ -217,7 +217,7 @@ WRITE32_MEMBER(queen_state::bios_ext_ram_w)
{
if (m_mtxc_config_reg[0x63] & 0x40) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext_ram + offset);
+ COMBINE_DATA(m_bios_ext_ram.get() + offset);
}
}
@@ -226,7 +226,7 @@ WRITE32_MEMBER(queen_state::bios_ram_w)
{
if (m_mtxc_config_reg[0x63] & 0x10) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -256,8 +256,8 @@ ADDRESS_MAP_END
void queen_state::machine_start()
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
- m_bios_ext_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x10000/4);
+ m_bios_ext_ram = std::make_unique<UINT32[]>(0x10000/4);
intel82439tx_init();
}
diff --git a/src/mame/drivers/quizo.cpp b/src/mame/drivers/quizo.cpp
index cdd9aea3836..6279c372cc2 100644
--- a/src/mame/drivers/quizo.cpp
+++ b/src/mame/drivers/quizo.cpp
@@ -39,7 +39,7 @@ public:
required_device<cpu_device> m_maincpu;
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
UINT8 m_port60;
UINT8 m_port70;
@@ -268,10 +268,10 @@ ROM_END
DRIVER_INIT_MEMBER(quizo_state,quizo)
{
- m_videoram=auto_alloc_array(machine(), UINT8, 0x4000*2);
+ m_videoram=std::make_unique<UINT8[]>(0x4000*2);
membank("bank1")->configure_entries(0, 6, memregion("user1")->base(), 0x4000);
- save_pointer(NAME(m_videoram), 0x4000*2);
+ save_pointer(NAME(m_videoram.get()), 0x4000*2);
//save_item(NAME(m_port60));
save_item(NAME(m_port70));
}
diff --git a/src/mame/drivers/rabbit.cpp b/src/mame/drivers/rabbit.cpp
index df0d4925730..757737584a6 100644
--- a/src/mame/drivers/rabbit.cpp
+++ b/src/mame/drivers/rabbit.cpp
@@ -126,7 +126,7 @@ public:
required_shared_ptr<UINT32> m_blitterregs;
required_shared_ptr<UINT32> m_spriteram;
- bitmap_ind16 *m_sprite_bitmap;
+ std::unique_ptr<bitmap_ind16> m_sprite_bitmap;
rectangle m_sprite_clip;
int m_vblirqlevel;
int m_bltirqlevel;
@@ -434,7 +434,7 @@ void rabbit_state::video_start()
m_tilemap[3]->map_pen_to_layer(0, 15, TILEMAP_PIXEL_TRANSPARENT);
m_tilemap[3]->map_pen_to_layer(1, 255, TILEMAP_PIXEL_TRANSPARENT);
- m_sprite_bitmap = auto_bitmap_ind16_alloc(machine(),0x1000,0x1000);
+ m_sprite_bitmap = std::make_unique<bitmap_ind16>(0x1000,0x1000);
m_sprite_clip.set(0, 0x1000-1, 0, 0x1000-1);
save_pointer(NAME(m_tilemap_ram[0]), 0x20000/4);
diff --git a/src/mame/drivers/rastersp.cpp b/src/mame/drivers/rastersp.cpp
index cbccc251d6c..8176fb3f749 100644
--- a/src/mame/drivers/rastersp.cpp
+++ b/src/mame/drivers/rastersp.cpp
@@ -128,11 +128,11 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(tms_tx_timer);
INTERRUPT_GEN_MEMBER(vblank_irq);
- UINT8 *m_nvram8;
+ std::unique_ptr<UINT8[]> m_nvram8;
UINT8 m_io_reg;
UINT8 m_irq_status;
UINT32 m_dpyaddr;
- UINT16 *m_paletteram;
+ std::unique_ptr<UINT16[]> m_paletteram;
UINT32 m_speedup_count;
UINT32 m_tms_io_regs[0x80];
bitmap_ind16 m_update_bitmap;
@@ -158,9 +158,9 @@ protected:
void rastersp_state::machine_start()
{
- m_nvram8 = auto_alloc_array(machine(), UINT8, NVRAM_SIZE);
- m_nvram->set_base(m_nvram8,NVRAM_SIZE);
- m_paletteram = auto_alloc_array(machine(), UINT16, 0x8000);
+ m_nvram8 = std::make_unique<UINT8[]>(NVRAM_SIZE);
+ m_nvram->set_base(m_nvram8.get(),NVRAM_SIZE);
+ m_paletteram = std::make_unique<UINT16[]>(0x8000);
membank("bank1")->set_base(m_dram);
membank("bank2")->set_base(&m_dram[0x10000/4]);
diff --git a/src/mame/drivers/rollext.cpp b/src/mame/drivers/rollext.cpp
index 61698ec5c91..412d3a2f02a 100644
--- a/src/mame/drivers/rollext.cpp
+++ b/src/mame/drivers/rollext.cpp
@@ -93,7 +93,7 @@ public:
DECLARE_WRITE32_MEMBER(a0000000_w);
DECLARE_READ32_MEMBER(b0000000_r);
- UINT8 *m_texture;
+ std::unique_ptr<UINT8[]> m_texture;
void draw_line(bitmap_rgb32 &bitmap, const rectangle &visarea, int v1x, int v1y, int v2x, int v2y);
@@ -178,7 +178,7 @@ void rollext_state::draw_line(bitmap_rgb32 &bitmap, const rectangle &visarea, in
void rollext_state::video_start()
{
- m_texture = auto_alloc_array(machine(), UINT8, 0x2000000);
+ m_texture = std::make_unique<UINT8[]>(0x2000000);
preprocess_texture_data();
}
diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp
index 1f6ab6964e4..06604ae29ea 100644
--- a/src/mame/drivers/rungun.cpp
+++ b/src/mame/drivers/rungun.cpp
@@ -389,7 +389,8 @@ void rungun_state::machine_start()
membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
m_banked_ram = auto_alloc_array_clear(machine(), UINT16, 0x2000);
- m_pal_ram = auto_alloc_array_clear(machine(), UINT16, 0x800*2);
+ m_pal_ram = std::make_unique<UINT16[]>(0x800*2);
+ memset(m_pal_ram.get(), 0, sizeof(UINT16) * 0x800 * 2);
membank("spriteram_bank")->configure_entries(0,2,&m_banked_ram[0],0x2000);
diff --git a/src/mame/drivers/safarir.cpp b/src/mame/drivers/safarir.cpp
index bc711f88d9c..44e064e5188 100644
--- a/src/mame/drivers/safarir.cpp
+++ b/src/mame/drivers/safarir.cpp
@@ -71,8 +71,8 @@ public:
required_shared_ptr<UINT8> m_bg_scroll;
required_device<gfxdecode_device> m_gfxdecode;
- UINT8 *m_ram_1;
- UINT8 *m_ram_2;
+ std::unique_ptr<UINT8[]> m_ram_1;
+ std::unique_ptr<UINT8[]> m_ram_2;
UINT8 m_ram_bank;
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
@@ -316,14 +316,14 @@ MACHINE_CONFIG_END
void safarir_state::machine_start()
{
- m_ram_1 = auto_alloc_array(machine(), UINT8, m_ram.bytes());
- m_ram_2 = auto_alloc_array(machine(), UINT8, m_ram.bytes());
+ m_ram_1 = std::make_unique<UINT8[]>(m_ram.bytes());
+ m_ram_2 = std::make_unique<UINT8[]>(m_ram.bytes());
m_port_last = 0;
m_port_last2 = 0;
/* setup for save states */
- save_pointer(NAME(m_ram_1), m_ram.bytes());
- save_pointer(NAME(m_ram_2), m_ram.bytes());
+ save_pointer(NAME(m_ram_1.get()), m_ram.bytes());
+ save_pointer(NAME(m_ram_2.get()), m_ram.bytes());
save_item(NAME(m_ram_bank));
save_item(NAME(m_port_last));
save_item(NAME(m_port_last2));
diff --git a/src/mame/drivers/sangho.cpp b/src/mame/drivers/sangho.cpp
index dec145ceffb..4f401081ef3 100644
--- a/src/mame/drivers/sangho.cpp
+++ b/src/mame/drivers/sangho.cpp
@@ -69,7 +69,7 @@ public:
, m_bank8(*this, "bank8")
{ }
- UINT8* m_ram;
+ std::unique_ptr<UINT8[]> m_ram;
UINT8 m_sexyboom_bank[8];
UINT8 m_pzlestar_mem_bank;
UINT8 m_pzlestar_rom_bank;
@@ -118,8 +118,8 @@ void sangho_state::pzlestar_map_banks()
case 0:
m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, m_bank1);
m_maincpu->space(AS_PROGRAM).install_write_bank(0x0000, 0x3fff, m_bank5);
- m_bank1->set_base(m_ram);
- m_bank5->set_base(m_ram);
+ m_bank1->set_base(m_ram.get());
+ m_bank5->set_base(m_ram.get());
break;
case 2:
m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, m_bank1);
@@ -140,8 +140,8 @@ void sangho_state::pzlestar_map_banks()
case 0:
m_maincpu->space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, m_bank2);
m_maincpu->space(AS_PROGRAM).install_write_bank(0x4000, 0x7fff, m_bank6);
- m_bank2->set_base(m_ram + 0x4000);
- m_bank6->set_base(m_ram + 0x4000);
+ m_bank2->set_base(m_ram.get() + 0x4000);
+ m_bank6->set_base(m_ram.get() + 0x4000);
break;
case 2:
m_maincpu->space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, m_bank2);
@@ -166,8 +166,8 @@ void sangho_state::pzlestar_map_banks()
case 0:
m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, m_bank3);
m_maincpu->space(AS_PROGRAM).install_write_bank(0x8000, 0xbfff, m_bank7);
- m_bank3->set_base(m_ram + 0x8000);
- m_bank7->set_base(m_ram + 0x8000);
+ m_bank3->set_base(m_ram.get() + 0x8000);
+ m_bank7->set_base(m_ram.get() + 0x8000);
break;
case 3:
m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, m_bank3);
@@ -188,8 +188,8 @@ void sangho_state::pzlestar_map_banks()
case 0:
m_maincpu->space(AS_PROGRAM).install_read_bank(0xc000, 0xffff, m_bank4);
m_maincpu->space(AS_PROGRAM).install_write_bank(0xc000, 0xffff, m_bank8);
- m_bank4->set_base(m_ram + 0xc000);
- m_bank8->set_base(m_ram + 0xc000);
+ m_bank4->set_base(m_ram.get() + 0xc000);
+ m_bank8->set_base(m_ram.get() + 0xc000);
break;
case 1:
case 2:
@@ -425,7 +425,7 @@ INPUT_PORTS_END
void sangho_state::machine_start()
{
- m_ram = auto_alloc_array(machine(), UINT8, 0x20000); // TODO: define how much RAM these ones have (MSX2+ can potentially go up to 4MB)
+ m_ram = std::make_unique<UINT8[]>(0x20000); // TODO: define how much RAM these ones have (MSX2+ can potentially go up to 4MB)
}
MACHINE_RESET_MEMBER(sangho_state,pzlestar)
diff --git a/src/mame/drivers/saturn.cpp b/src/mame/drivers/saturn.cpp
index c1043304284..049dd17dcf4 100644
--- a/src/mame/drivers/saturn.cpp
+++ b/src/mame/drivers/saturn.cpp
@@ -959,7 +959,7 @@ MACHINE_START_MEMBER(sat_console_state, saturn)
m_maincpu->space(AS_PROGRAM).nop_readwrite(0x04000000, 0x047fffff);
m_slave->space(AS_PROGRAM).nop_readwrite(0x04000000, 0x047fffff);
- m_nvram->set_base(m_backupram, 0x8000);
+ m_nvram->set_base(m_backupram.get(), 0x8000);
m_smpc_nv->set_base(&m_smpc.SMEM, 4);
if (m_exp)
@@ -1008,8 +1008,8 @@ MACHINE_START_MEMBER(sat_console_state, saturn)
}
// save states
- save_pointer(NAME(m_scu_regs), 0x100/4);
- save_pointer(NAME(m_scsp_regs), 0x1000/2);
+ save_pointer(NAME(m_scu_regs.get()), 0x100/4);
+ save_pointer(NAME(m_scsp_regs.get()), 0x1000/2);
save_item(NAME(m_NMI_reset));
save_item(NAME(m_en_68k));
save_item(NAME(m_smpc.IOSEL1));
@@ -1209,9 +1209,12 @@ void sat_console_state::saturn_init_driver(int rgn)
m_minit_boost_timeslice = attotime::zero;
m_sinit_boost_timeslice = attotime::zero;
- m_scu_regs = auto_alloc_array_clear(machine(), UINT32, 0x100/4);
- m_scsp_regs = auto_alloc_array_clear(machine(), UINT16, 0x1000/2);
- m_backupram = auto_alloc_array_clear(machine(), UINT8, 0x8000);
+ m_scu_regs = std::make_unique<UINT32[]>(0x100/4);
+ memset(m_scu_regs.get(), 0, sizeof(UINT32) * 0x100 / 4);
+ m_scsp_regs = std::make_unique<UINT16[]>(0x1000/2);
+ memset(m_scu_regs.get(), 0, sizeof(UINT16) * 0x1000 / 2);
+ m_backupram = std::make_unique<UINT8[]>(0x8000);
+ memset(m_scu_regs.get(), 0, sizeof(UINT8) * 0x8000);
}
DRIVER_INIT_MEMBER(sat_console_state,saturnus)
diff --git a/src/mame/drivers/savquest.cpp b/src/mame/drivers/savquest.cpp
index e8f59beaa72..784278096fa 100644
--- a/src/mame/drivers/savquest.cpp
+++ b/src/mame/drivers/savquest.cpp
@@ -64,13 +64,13 @@ public:
{
}
- UINT32 *m_bios_f0000_ram;
- UINT32 *m_bios_e0000_ram;
- UINT32 *m_bios_e4000_ram;
- UINT32 *m_bios_e8000_ram;
- UINT32 *m_bios_ec000_ram;
+ std::unique_ptr<UINT32[]> m_bios_f0000_ram;
+ std::unique_ptr<UINT32[]> m_bios_e0000_ram;
+ std::unique_ptr<UINT32[]> m_bios_e4000_ram;
+ std::unique_ptr<UINT32[]> m_bios_e8000_ram;
+ std::unique_ptr<UINT32[]> m_bios_ec000_ram;
- UINT8 *m_smram;
+ std::unique_ptr<UINT8[]> m_smram;
required_device<s3_vga_device> m_vga;
required_device<voodoo_2_device> m_voodoo;
@@ -148,7 +148,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- state->membank("bios_f0000")->set_base(state->m_bios_f0000_ram);
+ state->membank("bios_f0000")->set_base(state->m_bios_f0000_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -161,7 +161,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xe4000 - 0xe7fff
{
- state->membank("bios_e4000")->set_base(state->m_bios_e4000_ram);
+ state->membank("bios_e4000")->set_base(state->m_bios_e4000_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -170,7 +170,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 1) // enable RAM access to region 0xe0000 - 0xe3fff
{
- state->membank("bios_e0000")->set_base(state->m_bios_e0000_ram);
+ state->membank("bios_e0000")->set_base(state->m_bios_e0000_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -183,7 +183,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xec000 - 0xeffff
{
- state->membank("bios_ec000")->set_base(state->m_bios_ec000_ram);
+ state->membank("bios_ec000")->set_base(state->m_bios_ec000_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -192,7 +192,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
if (data & 1) // enable RAM access to region 0xe8000 - 0xebfff
{
- state->membank("bios_e8000")->set_base(state->m_bios_e8000_ram);
+ state->membank("bios_e8000")->set_base(state->m_bios_e8000_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -214,7 +214,7 @@ void savquest_state::intel82439tx_init()
m_mtxc_config_reg[0x63] = 0x02;
m_mtxc_config_reg[0x64] = 0x02;
m_mtxc_config_reg[0x65] = 0x02;
- m_smram = auto_alloc_array(machine(), UINT8, 0x20000);
+ m_smram = std::make_unique<UINT8[]>(0x20000);
}
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
@@ -374,7 +374,7 @@ WRITE32_MEMBER(savquest_state::bios_f0000_ram_w)
#if 1
if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_f0000_ram + offset);
+ COMBINE_DATA(m_bios_f0000_ram.get() + offset);
}
#endif
}
@@ -385,7 +385,7 @@ WRITE32_MEMBER(savquest_state::bios_e0000_ram_w)
#if 1
if (m_mtxc_config_reg[0x5e] & 2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_e0000_ram + offset);
+ COMBINE_DATA(m_bios_e0000_ram.get() + offset);
}
#endif
}
@@ -396,7 +396,7 @@ WRITE32_MEMBER(savquest_state::bios_e4000_ram_w)
#if 1
if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_e4000_ram + offset);
+ COMBINE_DATA(m_bios_e4000_ram.get() + offset);
}
#endif
}
@@ -407,7 +407,7 @@ WRITE32_MEMBER(savquest_state::bios_e8000_ram_w)
#if 1
if (m_mtxc_config_reg[0x5f] & 2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_e8000_ram + offset);
+ COMBINE_DATA(m_bios_e8000_ram.get() + offset);
}
#endif
}
@@ -418,7 +418,7 @@ WRITE32_MEMBER(savquest_state::bios_ec000_ram_w)
#if 1
if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ec000_ram + offset);
+ COMBINE_DATA(m_bios_ec000_ram.get() + offset);
}
#endif
}
@@ -769,11 +769,11 @@ INPUT_PORTS_END
void savquest_state::machine_start()
{
- m_bios_f0000_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
- m_bios_e0000_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_e4000_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_e8000_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ec000_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
+ m_bios_f0000_ram = std::make_unique<UINT32[]>(0x10000/4);
+ m_bios_e0000_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_e4000_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_e8000_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ec000_ram = std::make_unique<UINT32[]>(0x4000/4);
intel82439tx_init();
vid_3dfx_init();
diff --git a/src/mame/drivers/sbowling.cpp b/src/mame/drivers/sbowling.cpp
index ccb4b11f8a2..b4869187e49 100644
--- a/src/mame/drivers/sbowling.cpp
+++ b/src/mame/drivers/sbowling.cpp
@@ -62,7 +62,7 @@ public:
int m_bgmap;
int m_system;
tilemap_t *m_tilemap;
- bitmap_ind16 *m_tmpbitmap;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap;
UINT32 m_color_prom_address;
UINT8 m_pix_sh;
UINT8 m_pix[2];
@@ -121,7 +121,7 @@ WRITE8_MEMBER(sbowling_state::videoram_w)
for (int i = 0; i < 8; i++)
{
- plot_pixel_sbw(m_tmpbitmap, x++, y, m_color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip);
+ plot_pixel_sbw(m_tmpbitmap.get(), x++, y, m_color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip);
v1 >>= 1;
v2 >>= 1;
}
@@ -137,7 +137,7 @@ UINT32 sbowling_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
void sbowling_state::video_start()
{
- m_tmpbitmap = auto_bitmap_ind16_alloc(machine(),32*8,32*8);
+ m_tmpbitmap = std::make_unique<bitmap_ind16>(32*8,32*8);
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
save_item(NAME(m_bgmap));
diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp
index a7070123d7e..01ec8968901 100644
--- a/src/mame/drivers/segac2.cpp
+++ b/src/mame/drivers/segac2.cpp
@@ -1385,7 +1385,7 @@ UINT32 segac2_state::screen_update_segac2_new(screen_device &screen, bitmap_rgb3
UINT32* desty = &bitmap.pix32(y, 0);
UINT16* srcy;
- srcy = m_vdp->m_render_line_raw;
+ srcy = m_vdp->m_render_line_raw.get();
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp
index 54dc575c541..d25a065ec1e 100644
--- a/src/mame/drivers/segas32.cpp
+++ b/src/mame/drivers/segas32.cpp
@@ -2655,7 +2655,7 @@ public:
DECLARE_DRIVER_INIT(f1lap);
DECLARE_DRIVER_INIT(orunners);
- UINT16* m_dual_pcb_comms;
+ std::unique_ptr<UINT16[]> m_dual_pcb_comms;
DECLARE_WRITE16_MEMBER(dual_pcb_comms_w);
DECLARE_READ16_MEMBER(dual_pcb_comms_r);
DECLARE_READ16_MEMBER(dual_pcb_masterslave);
@@ -5164,7 +5164,7 @@ DRIVER_INIT_MEMBER(segas32_new_state, arescue)
m_mainpcb->init_arescue(1);
m_slavepcb->init_arescue(0);
- m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
+ m_dual_pcb_comms = std::make_unique<UINT16[]>(0x1000/2);
m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this));
m_mainpcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_masterslave),this));
@@ -5176,8 +5176,8 @@ DRIVER_INIT_MEMBER(segas32_new_state,f1en) {
m_mainpcb->init_f1en();
m_slavepcb->init_f1en();
- m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
- memset(m_dual_pcb_comms, 0xff, 0x1000 / 2);
+ m_dual_pcb_comms = std::make_unique<UINT16[]>(0x1000/2);
+ memset(m_dual_pcb_comms.get(), 0xff, 0x1000 / 2);
m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this));
m_mainpcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_masterslave),this));
@@ -5225,7 +5225,7 @@ void segas32_state::init_brival(void)
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
/* install protection handlers */
- m_system32_protram = auto_alloc_array(machine(), UINT16, 0x1000/2);
+ m_system32_protram = std::make_unique<UINT16[]>(0x1000/2);
m_maincpu->space(AS_PROGRAM).install_read_handler(0x20ba00, 0x20ba07, read16_delegate(FUNC(segas32_state::brival_protection_r),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xa00000, 0xa00fff, write16_delegate(FUNC(segas32_state::brival_protection_w),this));
}
diff --git a/src/mame/drivers/sfbonus.cpp b/src/mame/drivers/sfbonus.cpp
index 7270532330d..55f0d355b4f 100644
--- a/src/mame/drivers/sfbonus.cpp
+++ b/src/mame/drivers/sfbonus.cpp
@@ -308,18 +308,18 @@ public:
required_shared_ptr<UINT8> m_3000_regs;
required_shared_ptr<UINT8> m_3800_regs;
- bitmap_ind16 *m_temp_reel_bitmap;
+ std::unique_ptr<bitmap_ind16> m_temp_reel_bitmap;
tilemap_t *m_tilemap;
tilemap_t *m_reel_tilemap;
tilemap_t *m_reel2_tilemap;
tilemap_t *m_reel3_tilemap;
tilemap_t *m_reel4_tilemap;
- UINT8 *m_tilemap_ram;
- UINT8 *m_reel_ram;
- UINT8 *m_reel2_ram;
- UINT8 *m_reel3_ram;
- UINT8 *m_reel4_ram;
- UINT8* m_videoram;
+ std::unique_ptr<UINT8[]> m_tilemap_ram;
+ std::unique_ptr<UINT8[]> m_reel_ram;
+ std::unique_ptr<UINT8[]> m_reel2_ram;
+ std::unique_ptr<UINT8[]> m_reel3_ram;
+ std::unique_ptr<UINT8[]> m_reel4_ram;
+ std::unique_ptr<UINT8[]> m_videoram;
DECLARE_WRITE8_MEMBER(sfbonus_videoram_w);
DECLARE_WRITE8_MEMBER(sfbonus_bank_w);
@@ -907,7 +907,7 @@ WRITE8_MEMBER(sfbonus_state::sfbonus_videoram_w)
void sfbonus_state::video_start()
{
- m_temp_reel_bitmap = auto_bitmap_ind16_alloc(machine(),1024,512);
+ m_temp_reel_bitmap = std::make_unique<bitmap_ind16>(1024,512);
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sfbonus_state::get_sfbonus_tile_info),this),TILEMAP_SCAN_ROWS,8,8, 128, 64);
m_reel_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sfbonus_state::get_sfbonus_reel_tile_info),this),TILEMAP_SCAN_ROWS,8,32, 64, 16);
@@ -5848,31 +5848,31 @@ ROM_END
DRIVER_INIT_MEMBER(sfbonus_state,sfbonus_common)
{
- m_tilemap_ram = auto_alloc_array(machine(), UINT8, 0x4000);
- memset(m_tilemap_ram, 0xff, 0x4000);
- save_pointer(NAME(m_tilemap_ram), 0x4000);
+ m_tilemap_ram = std::make_unique<UINT8[]>(0x4000);
+ memset(m_tilemap_ram.get(), 0xff, 0x4000);
+ save_pointer(NAME(m_tilemap_ram.get()), 0x4000);
- m_reel_ram = auto_alloc_array(machine(), UINT8, 0x0800);
- memset(m_reel_ram, 0xff ,0x0800);
- save_pointer(NAME(m_reel_ram), 0x0800);
+ m_reel_ram = std::make_unique<UINT8[]>(0x0800);
+ memset(m_reel_ram.get(), 0xff ,0x0800);
+ save_pointer(NAME(m_reel_ram.get()), 0x0800);
- m_reel2_ram = auto_alloc_array(machine(), UINT8, 0x0800);
- memset(m_reel2_ram, 0xff, 0x0800);
- save_pointer(NAME(m_reel2_ram), 0x0800);
+ m_reel2_ram = std::make_unique<UINT8[]>(0x0800);
+ memset(m_reel2_ram.get(), 0xff, 0x0800);
+ save_pointer(NAME(m_reel2_ram.get()), 0x0800);
- m_reel3_ram = auto_alloc_array(machine(), UINT8, 0x0800);
- memset(m_reel3_ram, 0xff, 0x0800);
- save_pointer(NAME(m_reel3_ram), 0x0800);
+ m_reel3_ram = std::make_unique<UINT8[]>(0x0800);
+ memset(m_reel3_ram.get(), 0xff, 0x0800);
+ save_pointer(NAME(m_reel3_ram.get()), 0x0800);
- m_reel4_ram = auto_alloc_array(machine(), UINT8, 0x0800);
- memset(m_reel4_ram, 0xff, 0x0800);
- save_pointer(NAME(m_reel4_ram), 0x0800);
+ m_reel4_ram = std::make_unique<UINT8[]>(0x0800);
+ memset(m_reel4_ram.get(), 0xff, 0x0800);
+ save_pointer(NAME(m_reel4_ram.get()), 0x0800);
- m_videoram = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_videoram = std::make_unique<UINT8[]>(0x10000);
- memset(m_videoram, 0xff, 0x10000);
+ memset(m_videoram.get(), 0xff, 0x10000);
- save_pointer(NAME(m_videoram), 0x10000);
+ save_pointer(NAME(m_videoram.get()), 0x10000);
// dummy.rom helper
{
diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp
index f1130e61463..f61a97cc71c 100644
--- a/src/mame/drivers/sfkick.cpp
+++ b/src/mame/drivers/sfkick.cpp
@@ -87,7 +87,7 @@ public:
m_dsw2(*this, "DSW2")
{ }
- UINT8 *m_main_mem;
+ std::unique_ptr<UINT8[]> m_main_mem;
int m_bank_cfg;
int m_bank[8];
int m_input_mux;
@@ -261,8 +261,8 @@ void sfkick_state::sfkick_remap_banks()
case 3: /* RAM */
{
- m_bank7->set_base(m_main_mem);
- m_bank8->set_base(m_main_mem+0x2000);
+ m_bank7->set_base(m_main_mem.get());
+ m_bank8->set_base(m_main_mem.get()+0x2000);
}
break;
}
@@ -513,7 +513,7 @@ MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(sfkick_state,sfkick)
{
- m_main_mem=auto_alloc_array(machine(), UINT8, 0x4000);
+ m_main_mem=std::make_unique<UINT8[]>(0x4000);
}
diff --git a/src/mame/drivers/sigmab98.cpp b/src/mame/drivers/sigmab98.cpp
index d8fc656f624..be1f7c816fc 100644
--- a/src/mame/drivers/sigmab98.cpp
+++ b/src/mame/drivers/sigmab98.cpp
@@ -147,7 +147,7 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- bitmap_ind16 *m_sprite_bitmap;
+ std::unique_ptr<bitmap_ind16> m_sprite_bitmap;
UINT8 m_reg;
UINT8 m_rombank;
@@ -263,7 +263,7 @@ public:
void sigmab98_state::video_start()
{
- m_sprite_bitmap = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_sprite_bitmap = std::make_unique<bitmap_ind16>(512, 512);
}
/***************************************************************************
diff --git a/src/mame/drivers/skimaxx.cpp b/src/mame/drivers/skimaxx.cpp
index a1f30bc7b3d..439f0cc874a 100644
--- a/src/mame/drivers/skimaxx.cpp
+++ b/src/mame/drivers/skimaxx.cpp
@@ -62,7 +62,7 @@ public:
required_shared_ptr<UINT32> m_fpga_ctrl;
required_shared_ptr<UINT16> m_fg_buffer;
- UINT32 *m_bg_buffer;
+ std::unique_ptr<UINT32[]> m_bg_buffer;
UINT32 *m_bg_buffer_front;
UINT32 *m_bg_buffer_back;
UINT16 *m_blitter_gfx;
@@ -157,9 +157,9 @@ void skimaxx_state::video_start()
m_blitter_gfx = (UINT16 *) memregion( "blitter" )->base();
m_blitter_gfx_len = memregion( "blitter" )->bytes() / 2;
- m_bg_buffer = auto_alloc_array(machine(), UINT32, 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers
- m_bg_buffer_back = m_bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 0;
- m_bg_buffer_front = m_bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 1;
+ m_bg_buffer = std::make_unique<UINT32[]>(0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers
+ m_bg_buffer_back = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 0;
+ m_bg_buffer_front = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 1;
membank("bank1")->configure_entry(0, m_bg_buffer_back);
membank("bank1")->configure_entry(1, m_bg_buffer_front);
}
@@ -250,8 +250,8 @@ WRITE32_MEMBER(skimaxx_state::skimaxx_fpga_ctrl_w)
// double buffering
UINT8 bank_bg_buffer = (newdata & 0x40) ? 1 : 0;
- m_bg_buffer_back = m_bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * bank_bg_buffer;
- m_bg_buffer_front = m_bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * (1 - bank_bg_buffer);
+ m_bg_buffer_back = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * bank_bg_buffer;
+ m_bg_buffer_front = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * (1 - bank_bg_buffer);
membank("bank1")->set_entry(bank_bg_buffer);
}
diff --git a/src/mame/drivers/slotcarn.cpp b/src/mame/drivers/slotcarn.cpp
index d7988c01aef..643f696b7fe 100644
--- a/src/mame/drivers/slotcarn.cpp
+++ b/src/mame/drivers/slotcarn.cpp
@@ -47,7 +47,7 @@ public:
required_shared_ptr<UINT8> m_backup_ram;
required_shared_ptr<UINT8> m_ram_attr;
required_shared_ptr<UINT8> m_ram_video;
- UINT8 *m_ram_palette;
+ std::unique_ptr<UINT8[]> m_ram_palette;
DECLARE_READ8_MEMBER(palette_r);
DECLARE_WRITE8_MEMBER(palette_w);
DECLARE_WRITE_LINE_MEMBER(hsync_changed);
@@ -529,8 +529,8 @@ GFXDECODE_END
void slotcarn_state::machine_start()
{
- m_ram_palette = auto_alloc_array(machine(), UINT8, RAM_PALETTE_SIZE);
- save_pointer(NAME(m_ram_palette), RAM_PALETTE_SIZE);
+ m_ram_palette = std::make_unique<UINT8[]>(RAM_PALETTE_SIZE);
+ save_pointer(NAME(m_ram_palette.get()), RAM_PALETTE_SIZE);
}
/***********************************
diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp
index b949bdde103..04dc492c099 100644
--- a/src/mame/drivers/snesb.cpp
+++ b/src/mame/drivers/snesb.cpp
@@ -155,9 +155,9 @@ public:
snesb_state(const machine_config &mconfig, device_type type, const char *tag)
: snes_state(mconfig, type, tag) { }
- INT8 *m_shared_ram;
+ std::unique_ptr<INT8[]> m_shared_ram;
UINT8 m_cnt;
- INT8 *m_shared_ram2;
+ std::unique_ptr<INT8[]> m_shared_ram2;
DECLARE_READ8_MEMBER(sharedram_r);
DECLARE_WRITE8_MEMBER(sharedram_w);
DECLARE_READ8_MEMBER(sb2b_75bd37_r);
@@ -744,7 +744,7 @@ DRIVER_INIT_MEMBER(snesb_state,kinstb)
rom[i] = BITSWAP8(rom[i], 5, 0, 6, 1, 7, 4, 3, 2);
}
- m_shared_ram = auto_alloc_array(machine(), INT8, 0x100);
+ m_shared_ram = std::make_unique<INT8[]>(0x100);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781000, 0x7810ff, read8_delegate(FUNC(snesb_state::sharedram_r),this), write8_delegate(FUNC(snesb_state::sharedram_w),this));
/* extra inputs */
@@ -987,8 +987,8 @@ DRIVER_INIT_MEMBER(snesb_state,endless)
/* work around missing content */
m_maincpu->space(AS_PROGRAM).install_read_handler(0x800b, 0x800c, read8_delegate(FUNC(snesb_state::endless_800b_r),this));
- m_shared_ram = auto_alloc_array(machine(), INT8, 0x22);
- m_shared_ram2 = auto_alloc_array(machine(), INT8, 0x22);
+ m_shared_ram = std::make_unique<INT8[]>(0x22);
+ m_shared_ram2 = std::make_unique<INT8[]>(0x22);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781000, 0x781021, read8_delegate(FUNC(snesb_state::sharedram_r),this), write8_delegate(FUNC(snesb_state::sharedram_w),this));
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781200, 0x781221, read8_delegate(FUNC(snesb_state::sharedram2_r),this), write8_delegate(FUNC(snesb_state::sharedram2_w),this));
diff --git a/src/mame/drivers/speglsht.cpp b/src/mame/drivers/speglsht.cpp
index c74718b0f24..74aee52aee1 100644
--- a/src/mame/drivers/speglsht.cpp
+++ b/src/mame/drivers/speglsht.cpp
@@ -126,7 +126,7 @@ public:
required_shared_ptr<UINT8> m_shared;
required_shared_ptr<UINT32> m_framebuffer;
UINT32 m_videoreg;
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
required_shared_ptr<UINT32> m_cop_ram;
DECLARE_READ32_MEMBER(shared_r);
DECLARE_WRITE32_MEMBER(shared_w);
@@ -351,7 +351,7 @@ MACHINE_RESET_MEMBER(speglsht_state,speglsht)
VIDEO_START_MEMBER(speglsht_state,speglsht)
{
- m_bitmap = auto_bitmap_ind16_alloc(machine(), 512, 5122 );
+ m_bitmap = std::make_unique<bitmap_ind16>(512, 5122 );
// VIDEO_START_CALL_MEMBER(st0016);
}
diff --git a/src/mame/drivers/spool99.cpp b/src/mame/drivers/spool99.cpp
index de393b3b619..7b331e14ccd 100644
--- a/src/mame/drivers/spool99.cpp
+++ b/src/mame/drivers/spool99.cpp
@@ -454,7 +454,7 @@ ROM_END
DRIVER_INIT_MEMBER(spool99_state,spool99)
{
UINT8 *ROM = memregion("maincpu")->base();
-// vram = auto_alloc_array(machine(), UINT8, 0x2000);
+// vram = std::make_unique<UINT8[]>(0x2000);
memcpy(m_main, ROM, 0x100);
}
diff --git a/src/mame/drivers/srmp5.cpp b/src/mame/drivers/srmp5.cpp
index 1937daf3d90..1ecfd8a1f0a 100644
--- a/src/mame/drivers/srmp5.cpp
+++ b/src/mame/drivers/srmp5.cpp
@@ -86,8 +86,8 @@ public:
required_ioport_array<4> m_keys;
UINT32 m_chrbank;
- UINT16 *m_tileram;
- UINT16 *m_sprram;
+ std::unique_ptr<UINT16[]> m_tileram;
+ std::unique_ptr<UINT16[]> m_sprram;
UINT8 m_input_select;
@@ -128,9 +128,9 @@ public:
UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int x,y,address,xs,xs2,ys,ys2,height,width,xw,yw,xb,yb,sizex,sizey;
- UINT16 *sprite_list=m_sprram;
+ UINT16 *sprite_list=m_sprram.get();
UINT16 *sprite_list_end=&m_sprram[0x4000]; //guess
- UINT8 *pixels=(UINT8 *)m_tileram;
+ UINT8 *pixels=(UINT8 *)m_tileram.get();
const pen_t * const pens = m_palette->pens();
//Table surface seems to be tiles, but display corrupts when switching the scene if always ON.
@@ -249,8 +249,8 @@ void srmp5_state::machine_start()
save_item(NAME(m_cmd2));
save_item(NAME(m_cmd_stat));
save_item(NAME(m_chrbank));
- save_pointer(NAME(m_tileram), 0x100000/2);
- save_pointer(NAME(m_sprram), 0x80000/2);
+ save_pointer(NAME(m_tileram.get()), 0x100000/2);
+ save_pointer(NAME(m_sprram.get()), 0x80000/2);
save_item(NAME(m_vidregs));
}
@@ -612,8 +612,8 @@ DRIVER_INIT_MEMBER(srmp5_state,srmp5)
{
m_maincpu->st0016_game = 9;
- m_tileram = auto_alloc_array(machine(), UINT16, 0x100000/2);
- m_sprram = auto_alloc_array(machine(), UINT16, 0x080000/2);
+ m_tileram = std::make_unique<UINT16[]>(0x100000/2);
+ m_sprram = std::make_unique<UINT16[]>(0x080000/2);
#ifdef DEBUG_CHAR
memset(m_tileduty, 1, 0x2000);
#endif
diff --git a/src/mame/drivers/stratos.cpp b/src/mame/drivers/stratos.cpp
index 8ace206949c..62de51b640c 100644
--- a/src/mame/drivers/stratos.cpp
+++ b/src/mame/drivers/stratos.cpp
@@ -28,7 +28,7 @@ public:
required_memory_bank bank_4000;
required_memory_bank nvram_bank;
- UINT8 *nvram_data;
+ std::unique_ptr<UINT8[]> nvram_data;
UINT8 control, led_latch_control;
UINT32 individual_leds;
UINT8 latch_AH_red, latch_AH_green, latch_18_red, latch_18_green;
@@ -52,12 +52,12 @@ public:
DRIVER_INIT_MEMBER( stratos_state, stratos )
{
- nvram_data = auto_alloc_array(machine(), UINT8, 0x2000);
- nvram->set_base(nvram_data, 0x2000);
+ nvram_data = std::make_unique<UINT8[]>(0x2000);
+ nvram->set_base(nvram_data.get(), 0x2000);
bank_8000 ->configure_entries(0, 4, memregion("roms_8000")->base(), 0x8000);
bank_4000 ->configure_entries(0, 4, memregion("roms_4000")->base(), 0x4000);
- nvram_bank->configure_entries(0, 2, nvram_data, 0x1000);
+ nvram_bank->configure_entries(0, 2, nvram_data.get(), 0x1000);
}
void stratos_state::machine_reset()
diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp
index be06065508e..d2037ecf941 100644
--- a/src/mame/drivers/stv.cpp
+++ b/src/mame/drivers/stv.cpp
@@ -377,9 +377,10 @@ DRIVER_INIT_MEMBER(stv_state,stv)
m_minit_boost_timeslice = attotime::zero;
m_sinit_boost_timeslice = attotime::zero;
- m_scu_regs = auto_alloc_array(machine(), UINT32, 0x100/4);
- m_scsp_regs = auto_alloc_array(machine(), UINT16, 0x1000/2);
- m_backupram = auto_alloc_array_clear(machine(), UINT8, 0x8000);
+ m_scu_regs = std::make_unique<UINT32[]>(0x100/4);
+ m_scsp_regs = std::make_unique<UINT16[]>(0x1000/2);
+ m_backupram = std::make_unique<UINT8[]>(0x8000);
+ memset(m_backupram.get(), 0, sizeof(UINT8) * 0x8000);
install_stvbios_speedups();
@@ -1309,8 +1310,8 @@ MACHINE_START_MEMBER(stv_state,stv)
machine().device<scsp_device>("scsp")->set_ram_base(m_sound_ram);
// save states
- save_pointer(NAME(m_scu_regs), 0x100/4);
- save_pointer(NAME(m_scsp_regs), 0x1000/2);
+ save_pointer(NAME(m_scu_regs.get()), 0x100/4);
+ save_pointer(NAME(m_scsp_regs.get()), 0x1000/2);
save_item(NAME(m_NMI_reset));
save_item(NAME(m_en_68k));
// save_item(NAME(scanline));
diff --git a/src/mame/drivers/subsino.cpp b/src/mame/drivers/subsino.cpp
index 678a7e7c1bc..2b1a82eb621 100644
--- a/src/mame/drivers/subsino.cpp
+++ b/src/mame/drivers/subsino.cpp
@@ -269,14 +269,14 @@ public:
tilemap_t *m_reel3_tilemap;
int m_tiles_offset;
UINT8 m_out_c;
- UINT8 *m_reel1_attr;
- UINT8 *m_reel2_attr;
- UINT8 *m_reel3_attr;
+ std::unique_ptr<UINT8[]> m_reel1_attr;
+ std::unique_ptr<UINT8[]> m_reel2_attr;
+ std::unique_ptr<UINT8[]> m_reel3_attr;
UINT8 m_flash_val;
UINT8 m_flash_packet;
UINT8 m_flash_packet_start;
int m_colordac_offs;
- UINT8 *m_stbsub_colorram;
+ std::unique_ptr<UINT8[]> m_stbsub_colorram;
ticket_dispenser_device *m_hopper;
@@ -3841,15 +3841,15 @@ DRIVER_INIT_MEMBER(subsino_state,stbsub)
rom[0x957] = 0x18; //patch "losing protection" check
#endif
- m_stbsub_colorram = auto_alloc_array(machine(), UINT8, 256*3);
+ m_stbsub_colorram = std::make_unique<UINT8[]>(256*3);
m_reel1_scroll.allocate(0x40);
m_reel2_scroll.allocate(0x40);
m_reel3_scroll.allocate(0x40);
- m_reel1_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel2_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel3_attr = auto_alloc_array(machine(), UINT8, 0x200);
+ m_reel1_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel2_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel3_attr = std::make_unique<UINT8[]>(0x200);
}
DRIVER_INIT_MEMBER(subsino_state, stisub)
@@ -3858,15 +3858,15 @@ DRIVER_INIT_MEMBER(subsino_state, stisub)
rom[0x0FA0] = 0x28;
rom[0x0FA1] = 0x1d; //patch protection check
- m_stbsub_colorram = auto_alloc_array(machine(), UINT8, 256*3);
+ m_stbsub_colorram = std::make_unique<UINT8[]>(256*3);
m_reel1_scroll.allocate(0x40);
m_reel2_scroll.allocate(0x40);
m_reel3_scroll.allocate(0x40);
- m_reel1_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel2_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel3_attr = auto_alloc_array(machine(), UINT8, 0x200);
+ m_reel1_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel2_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel3_attr = std::make_unique<UINT8[]>(0x200);
}
DRIVER_INIT_MEMBER(subsino_state,tesorone)
@@ -3879,15 +3879,15 @@ DRIVER_INIT_MEMBER(subsino_state,tesorone)
rom[0xa84] = 0x18; //patch "losing protection" check
#endif
- m_stbsub_colorram = auto_alloc_array(machine(), UINT8, 256*3);
+ m_stbsub_colorram = std::make_unique<UINT8[]>(256*3);
m_reel1_scroll.allocate(0x40);
m_reel2_scroll.allocate(0x40);
m_reel3_scroll.allocate(0x40);
- m_reel1_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel2_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel3_attr = auto_alloc_array(machine(), UINT8, 0x200);
+ m_reel1_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel2_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel3_attr = std::make_unique<UINT8[]>(0x200);
}
DRIVER_INIT_MEMBER(subsino_state,tesorone230)
@@ -3900,29 +3900,29 @@ DRIVER_INIT_MEMBER(subsino_state,tesorone230)
rom[0xa88] = 0x18; //patch "losing protection" check
#endif
- m_stbsub_colorram = auto_alloc_array(machine(), UINT8, 256*3);
+ m_stbsub_colorram = std::make_unique<UINT8[]>(256*3);
m_reel1_scroll.allocate(0x40);
m_reel2_scroll.allocate(0x40);
m_reel3_scroll.allocate(0x40);
- m_reel1_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel2_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel3_attr = auto_alloc_array(machine(), UINT8, 0x200);
+ m_reel1_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel2_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel3_attr = std::make_unique<UINT8[]>(0x200);
}
DRIVER_INIT_MEMBER(subsino_state,mtrainnv)
{
- m_stbsub_colorram = auto_alloc_array(machine(), UINT8, 256*3);
+ m_stbsub_colorram = std::make_unique<UINT8[]>(256*3);
m_reel1_scroll.allocate(0x40);
m_reel2_scroll.allocate(0x40);
m_reel3_scroll.allocate(0x40);
- m_reel1_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel2_attr = auto_alloc_array(machine(), UINT8, 0x200);
- m_reel3_attr = auto_alloc_array(machine(), UINT8, 0x200);
+ m_reel1_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel2_attr = std::make_unique<UINT8[]>(0x200);
+ m_reel3_attr = std::make_unique<UINT8[]>(0x200);
}
/***************************************************************************
diff --git a/src/mame/drivers/subsino2.cpp b/src/mame/drivers/subsino2.cpp
index 99c9cf97a09..e1b3ea5c584 100644
--- a/src/mame/drivers/subsino2.cpp
+++ b/src/mame/drivers/subsino2.cpp
@@ -64,9 +64,9 @@ enum vram_t
// Layers
struct layer_t
{
- UINT8 *videorams[2];
+ std::unique_ptr<UINT8[]> videorams[2];
- UINT8 *scrollrams[2];
+ std::unique_ptr<UINT8[]> scrollrams[2];
int scroll_x;
int scroll_y;
@@ -88,11 +88,11 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
- UINT8 *m_hm86171_colorram;
+ std::unique_ptr<UINT8[]> m_hm86171_colorram;
layer_t m_layers[2];
UINT8 m_ss9601_byte_lo;
UINT8 m_ss9601_byte_lo2;
- UINT8 *m_ss9601_reelrams[2];
+ std::unique_ptr<UINT8[]> m_ss9601_reelrams[2];
rectangle m_ss9601_reelrects[3];
UINT8 m_ss9601_scrollctrl;
UINT8 m_ss9601_tilesize;
@@ -598,7 +598,7 @@ WRITE8_MEMBER(subsino2_state::ss9601_disable_w)
VIDEO_START_MEMBER(subsino2_state,subsino2)
{
- m_hm86171_colorram = auto_alloc_array(machine(), UINT8, 256*3);
+ m_hm86171_colorram = std::make_unique<UINT8[]>(256*3);
// SS9601 Regs:
@@ -622,21 +622,21 @@ VIDEO_START_MEMBER(subsino2_state,subsino2)
// line scroll
l->tmap->set_scroll_rows(0x200);
- l->videorams[VRAM_HI] = auto_alloc_array(machine(), UINT8, 0x80 * 0x40);
- l->videorams[VRAM_LO] = auto_alloc_array(machine(), UINT8, 0x80 * 0x40);
+ l->videorams[VRAM_HI] = std::make_unique<UINT8[]>(0x80 * 0x40);
+ l->videorams[VRAM_LO] = std::make_unique<UINT8[]>(0x80 * 0x40);
- l->scrollrams[VRAM_HI] = auto_alloc_array(machine(), UINT8, 0x200);
- l->scrollrams[VRAM_LO] = auto_alloc_array(machine(), UINT8, 0x200);
- memset(l->scrollrams[VRAM_HI], 0, 0x200);
- memset(l->scrollrams[VRAM_LO], 0, 0x200);
+ l->scrollrams[VRAM_HI] = std::make_unique<UINT8[]>(0x200);
+ l->scrollrams[VRAM_LO] = std::make_unique<UINT8[]>(0x200);
+ memset(l->scrollrams[VRAM_HI].get(), 0, 0x200);
+ memset(l->scrollrams[VRAM_LO].get(), 0, 0x200);
}
// SS9601 Reels:
- m_ss9601_reelrams[VRAM_HI] = auto_alloc_array(machine(), UINT8, 0x2000);
- m_ss9601_reelrams[VRAM_LO] = auto_alloc_array(machine(), UINT8, 0x2000);
- memset(m_ss9601_reelrams[VRAM_HI], 0, 0x2000);
- memset(m_ss9601_reelrams[VRAM_LO], 0, 0x2000);
+ m_ss9601_reelrams[VRAM_HI] = std::make_unique<UINT8[]>(0x2000);
+ m_ss9601_reelrams[VRAM_LO] = std::make_unique<UINT8[]>(0x2000);
+ memset(m_ss9601_reelrams[VRAM_HI].get(), 0, 0x2000);
+ memset(m_ss9601_reelrams[VRAM_LO].get(), 0, 0x2000);
m_ss9601_reelrects[0].set(0, 0, 0x00*8, 0x09*8-1);
m_ss9601_reelrects[1].set(0, 0, 0x09*8, 0x10*8-1);
m_ss9601_reelrects[2].set(0, 0, 0x10*8, 256-16-1);
diff --git a/src/mame/drivers/superqix.cpp b/src/mame/drivers/superqix.cpp
index 8db24ee5ed0..3e25d7f450d 100644
--- a/src/mame/drivers/superqix.cpp
+++ b/src/mame/drivers/superqix.cpp
@@ -116,7 +116,7 @@ SAMPLES_START_CB_MEMBER(superqix_state::pbillian_sh_start)
int i, len = memregion("samples")->bytes();
/* convert 8-bit unsigned samples to 8-bit signed */
- m_samplebuf = auto_alloc_array(machine(), INT16, len);
+ m_samplebuf = std::make_unique<INT16[]>(len);
for (i = 0;i < len;i++)
m_samplebuf[i] = (INT8)(src[i] ^ 0x80) * 256;
}
@@ -133,7 +133,7 @@ WRITE8_MEMBER(superqix_state::pbillian_sample_trigger_w)
while (end < len && src[end] != 0xff)
end++;
- m_samples->start_raw(0, m_samplebuf + start, end - start, 5000); // 5khz ?
+ m_samples->start_raw(0, m_samplebuf.get() + start, end - start, 5000); // 5khz ?
}
diff --git a/src/mame/drivers/supertnk.cpp b/src/mame/drivers/supertnk.cpp
index bb7b3e06731..938ab46a2fc 100644
--- a/src/mame/drivers/supertnk.cpp
+++ b/src/mame/drivers/supertnk.cpp
@@ -114,7 +114,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu") { }
- UINT8 *m_videoram[3];
+ std::unique_ptr<UINT8[]> m_videoram[3];
UINT8 m_rom_bank;
UINT8 m_bitplane_select;
pen_t m_pens[NUM_PENS];
@@ -199,9 +199,9 @@ void supertnk_state::video_start()
m_pens[i] = rgb_t(pal1bit(data >> 2), pal1bit(data >> 5), pal1bit(data >> 6));
}
- m_videoram[0] = auto_alloc_array(machine(), UINT8, 0x2000);
- m_videoram[1] = auto_alloc_array(machine(), UINT8, 0x2000);
- m_videoram[2] = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_videoram[0] = std::make_unique<UINT8[]>(0x2000);
+ m_videoram[1] = std::make_unique<UINT8[]>(0x2000);
+ m_videoram[2] = std::make_unique<UINT8[]>(0x2000);
}
diff --git a/src/mame/drivers/suprgolf.cpp b/src/mame/drivers/suprgolf.cpp
index bed008de237..c83dbb32a0c 100644
--- a/src/mame/drivers/suprgolf.cpp
+++ b/src/mame/drivers/suprgolf.cpp
@@ -47,10 +47,10 @@ public:
required_shared_ptr<UINT8> m_videoram;
tilemap_t *m_tilemap;
- UINT8 *m_paletteram;
- UINT8 *m_bg_vram;
- UINT16 *m_bg_fb;
- UINT16 *m_fg_fb;
+ std::unique_ptr<UINT8[]> m_paletteram;
+ std::unique_ptr<UINT8[]> m_bg_vram;
+ std::unique_ptr<UINT16[]> m_bg_fb;
+ std::unique_ptr<UINT16[]> m_fg_fb;
UINT8 m_rom_bank;
UINT8 m_bg_bank;
UINT8 m_vreg_bank;
@@ -103,10 +103,10 @@ TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info)
void suprgolf_state::video_start()
{
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suprgolf_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
- m_paletteram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_bg_vram = auto_alloc_array(machine(), UINT8, 0x2000*0x20);
- m_bg_fb = auto_alloc_array(machine(), UINT16, 0x2000*0x20);
- m_fg_fb = auto_alloc_array(machine(), UINT16, 0x2000*0x20);
+ m_paletteram = std::make_unique<UINT8[]>(0x1000);
+ m_bg_vram = std::make_unique<UINT8[]>(0x2000*0x20);
+ m_bg_fb = std::make_unique<UINT16[]>(0x2000*0x20);
+ m_fg_fb = std::make_unique<UINT16[]>(0x2000*0x20);
m_tilemap->set_transparent_pen(15);
@@ -115,10 +115,10 @@ void suprgolf_state::video_start()
save_item(NAME(m_vreg_pen));
save_item(NAME(m_palette_switch));
save_item(NAME(m_bg_vreg_test));
- save_pointer(NAME(m_paletteram), 0x1000);
- save_pointer(NAME(m_bg_vram), 0x2000*0x20);
- save_pointer(NAME(m_bg_fb), 0x2000*0x20);
- save_pointer(NAME(m_fg_fb), 0x2000*0x20);
+ save_pointer(NAME(m_paletteram.get()), 0x1000);
+ save_pointer(NAME(m_bg_vram.get()), 0x2000*0x20);
+ save_pointer(NAME(m_bg_fb.get()), 0x2000*0x20);
+ save_pointer(NAME(m_fg_fb.get()), 0x2000*0x20);
}
UINT32 suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp
index 20a7f74594c..66d9c792700 100644
--- a/src/mame/drivers/system1.cpp
+++ b/src/mame/drivers/system1.cpp
@@ -381,8 +381,8 @@ void system1_state::machine_start()
if (m_banked_decrypted_opcodes)
{
- m_bank0d->set_base(m_banked_decrypted_opcodes);
- m_bank1d->configure_entries(0, numbanks, m_banked_decrypted_opcodes + 0x10000, 0x4000);
+ m_bank0d->set_base(m_banked_decrypted_opcodes.get());
+ m_bank1d->configure_entries(0, numbanks, m_banked_decrypted_opcodes.get() + 0x10000, 0x4000);
m_bank1d->set_entry(0);
}
@@ -5413,15 +5413,15 @@ DRIVER_INIT_MEMBER(system1_state,gardiab)
DRIVER_INIT_MEMBER(system1_state,wbml)
{
DRIVER_INIT_CALL(bank0c);
- m_banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
- mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
+ m_banked_decrypted_opcodes = std::make_unique<UINT8[]>(m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), memregion("key")->base(), m_maincpu_region->bytes());
}
DRIVER_INIT_MEMBER(system1_state,ufosensi)
{
DRIVER_INIT_CALL(bank0c);
- m_banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
- mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
+ m_banked_decrypted_opcodes = std::make_unique<UINT8[]>(m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), memregion("key")->base(), m_maincpu_region->bytes());
}
DRIVER_INIT_MEMBER(system1_state,wboysys2)
@@ -5486,8 +5486,8 @@ DRIVER_INIT_MEMBER(system1_state,wboysys2)
DRIVER_INIT_MEMBER(system1_state,dakkochn)
{
m_videomode_custom = &system1_state::dakkochn_custom_w;
- m_banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
- mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
+ m_banked_decrypted_opcodes = std::make_unique<UINT8[]>(m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), memregion("key")->base(), m_maincpu_region->bytes());
}
diff --git a/src/mame/drivers/taitojc.cpp b/src/mame/drivers/taitojc.cpp
index 45a5b9c5037..01ee6ab04ce 100644
--- a/src/mame/drivers/taitojc.cpp
+++ b/src/mame/drivers/taitojc.cpp
@@ -900,7 +900,7 @@ WRITE16_MEMBER(taitojc_state::dsp_unk2_w)
if (offset == 0)
{
taitojc_clear_frame();
- m_renderer->render_polygons(m_polygon_fifo, m_polygon_fifo_ptr);
+ m_renderer->render_polygons(m_polygon_fifo.get(), m_polygon_fifo_ptr);
m_polygon_fifo_ptr = 0;
}
@@ -1225,7 +1225,7 @@ READ16_MEMBER(taitojc_state::dendego2_dsp_idle_skip_r)
DRIVER_INIT_MEMBER(taitojc_state,taitojc)
{
- m_polygon_fifo = auto_alloc_array(machine(), UINT16, TAITOJC_POLYGON_FIFO_SIZE);
+ m_polygon_fifo = std::make_unique<UINT16[]>(TAITOJC_POLYGON_FIFO_SIZE);
m_has_dsp_hack = 1;
diff --git a/src/mame/drivers/taitotz.cpp b/src/mame/drivers/taitotz.cpp
index 5f83ed30285..c83e0494595 100644
--- a/src/mame/drivers/taitotz.cpp
+++ b/src/mame/drivers/taitotz.cpp
@@ -565,9 +565,9 @@ public:
DECLARE_READ64_MEMBER(video_fifo_r);
DECLARE_WRITE64_MEMBER(video_fifo_w);
- UINT32 *m_screen_ram;
- UINT32 *m_frame_ram;
- UINT32 *m_texture_ram;
+ std::unique_ptr<UINT32[]> m_screen_ram;
+ std::unique_ptr<UINT32[]> m_frame_ram;
+ std::unique_ptr<UINT32[]> m_texture_ram;
UINT32 m_video_unk_reg[0x10];
UINT32 m_video_fifo_ptr;
@@ -626,7 +626,7 @@ public:
: poly_manager<float, taitotz_polydata, 6, 50000>(state.machine()),
m_state(state)
{
- m_zbuffer = auto_bitmap_ind32_alloc(state.machine(), width, height);
+ m_zbuffer = std::make_unique<bitmap_ind32>(width, height);
m_texture = texram;
m_diffuse_intensity = 224;
@@ -659,7 +659,7 @@ private:
taitotz_state &m_state;
bitmap_rgb32 *m_fb;
- bitmap_ind32 *m_zbuffer;
+ std::unique_ptr<bitmap_ind32> m_zbuffer;
UINT32 *m_texture;
PLANE m_clip_plane[6];
@@ -742,12 +742,12 @@ void taitotz_state::video_start()
int width = m_screen->width();
int height = m_screen->height();
- m_screen_ram = auto_alloc_array(machine(), UINT32, 0x200000);
- m_frame_ram = auto_alloc_array(machine(), UINT32, 0x80000);
- m_texture_ram = auto_alloc_array(machine(), UINT32, 0x800000);
+ m_screen_ram = std::make_unique<UINT32[]>(0x200000);
+ m_frame_ram = std::make_unique<UINT32[]>(0x80000);
+ m_texture_ram = std::make_unique<UINT32[]>(0x800000);
/* create renderer */
- m_renderer = auto_alloc(machine(), taitotz_renderer(*this, width, height, m_texture_ram));
+ m_renderer = auto_alloc(machine(), taitotz_renderer(*this, width, height, m_texture_ram.get()));
//machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitotz_exit), &machine()));
}
diff --git a/src/mame/drivers/taitowlf.cpp b/src/mame/drivers/taitowlf.cpp
index 4751803b823..eba6d93fed2 100644
--- a/src/mame/drivers/taitowlf.cpp
+++ b/src/mame/drivers/taitowlf.cpp
@@ -45,7 +45,7 @@ public:
m_bank1(*this, "bank1"),
m_palette(*this, "palette") { }
- UINT32 *m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ram;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -261,7 +261,7 @@ WRITE32_MEMBER(taitowlf_state::bios_ram_w)
{
if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -396,9 +396,9 @@ MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(taitowlf_state,taitowlf)
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x10000/4);
- m_bank1->configure_entry(1, m_bios_ram);
+ m_bank1->configure_entry(1, m_bios_ram.get());
m_bank1->configure_entry(0, memregion("bios")->base() + 0x30000);
intel82439tx_init();
}
diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp
index 7448c36aff2..828ff045e2a 100644
--- a/src/mame/drivers/tnzs.cpp
+++ b/src/mame/drivers/tnzs.cpp
@@ -652,7 +652,7 @@ SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples)
}
/* 2009-11 FP: should these be saved? */
- m_sampledata[i] = auto_alloc_array(machine(), INT16, size);
+ m_sampledata[i] = std::make_unique<INT16[]>(size);
m_samplesize[i] = size;
@@ -660,7 +660,7 @@ SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples)
start = size = 0;
// signed 8-bit sample to unsigned 8-bit sample convert
- dest = m_sampledata[i];
+ dest = m_sampledata[i].get();
scan = &src[start];
for (n = 0; n < size; n++)
{
@@ -720,7 +720,7 @@ WRITE8_MEMBER(tnzs_state::kageki_csport_w)
else
{
// play samples
- m_samples->start_raw(0, m_sampledata[data], m_samplesize[data], 7000);
+ m_samples->start_raw(0, m_sampledata[data].get(), m_samplesize[data], 7000);
sprintf(mess, "VOICE:%02X PLAY", data);
}
// popmessage(mess);
diff --git a/src/mame/drivers/ttchamp.cpp b/src/mame/drivers/ttchamp.cpp
index 75d3ca110bd..fe8c6bf7870 100644
--- a/src/mame/drivers/ttchamp.cpp
+++ b/src/mame/drivers/ttchamp.cpp
@@ -106,7 +106,7 @@ public:
int m_pic_latched;
int m_pic_writelatched;
- UINT8* m_bakram;
+ std::unique_ptr<UINT8[]> m_bakram;
UINT16 m_mainram[0x10000 / 2];
@@ -153,8 +153,8 @@ void ttchamp_state::machine_start()
m_picmodex = PIC_IDLE;
- m_bakram = auto_alloc_array(machine(), UINT8, 0x100);
- machine().device<nvram_device>("backram")->set_base(m_bakram, 0x100);
+ m_bakram = std::make_unique<UINT8[]>(0x100);
+ machine().device<nvram_device>("backram")->set_base(m_bakram.get(), 0x100);
save_item(NAME(m_paloff));
save_item(NAME(m_port10));
diff --git a/src/mame/drivers/turrett.cpp b/src/mame/drivers/turrett.cpp
index f4d9bef80a9..a37bf36cfe2 100644
--- a/src/mame/drivers/turrett.cpp
+++ b/src/mame/drivers/turrett.cpp
@@ -34,12 +34,12 @@
void turrett_state::machine_start()
{
// Allocate memory for the two 256kx16 banks of video RAM
- m_video_ram[0] = (UINT16*)auto_alloc_array(machine(), UINT16, VRAM_BANK_WORDS);
- m_video_ram[1] = (UINT16*)auto_alloc_array(machine(), UINT16, VRAM_BANK_WORDS);
+ m_video_ram[0] = std::make_unique<UINT16[]>(VRAM_BANK_WORDS);
+ m_video_ram[1] = std::make_unique<UINT16[]>(VRAM_BANK_WORDS);
// Register our state for saving
- save_pointer(NAME(m_video_ram[0]), VRAM_BANK_WORDS);
- save_pointer(NAME(m_video_ram[1]), VRAM_BANK_WORDS);
+ save_pointer(NAME(m_video_ram[0].get()), VRAM_BANK_WORDS);
+ save_pointer(NAME(m_video_ram[1].get()), VRAM_BANK_WORDS);
save_item(NAME(m_inputs_active));
save_item(NAME(m_last_pixel));
save_item(NAME(m_video_ctrl));
diff --git a/src/mame/drivers/ultrsprt.cpp b/src/mame/drivers/ultrsprt.cpp
index fc39612134f..e76c03e8c2a 100644
--- a/src/mame/drivers/ultrsprt.cpp
+++ b/src/mame/drivers/ultrsprt.cpp
@@ -47,7 +47,7 @@ protected:
virtual void machine_reset() override;
private:
- UINT8 *m_vram;
+ std::unique_ptr<UINT8[]> m_vram;
UINT32 m_cpu_vram_page;
};
@@ -56,7 +56,7 @@ private:
UINT32 ultrsprt_state::screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 *vram = m_vram + (m_cpu_vram_page ^ 1) * VRAM_PAGE_BYTES;
+ UINT8 *vram = m_vram.get() + (m_cpu_vram_page ^ 1) * VRAM_PAGE_BYTES;
for (int y = cliprect.min_y; y <= cliprect.max_y; ++y)
{
@@ -191,11 +191,11 @@ void ultrsprt_state::machine_start()
/* configure fast RAM regions for DRC */
m_maincpu->ppcdrc_add_fastram(0xff000000, 0xff01ffff, FALSE, m_workram);
- m_vram = auto_alloc_array(machine(), UINT8, VRAM_PAGE_BYTES * VRAM_PAGES);
+ m_vram = std::make_unique<UINT8[]>(VRAM_PAGE_BYTES * VRAM_PAGES);
- membank("vram")->configure_entries(0, VRAM_PAGES, m_vram, VRAM_PAGE_BYTES);
+ membank("vram")->configure_entries(0, VRAM_PAGES, m_vram.get(), VRAM_PAGE_BYTES);
- save_pointer(NAME(m_vram), VRAM_PAGE_BYTES * VRAM_PAGES);
+ save_pointer(NAME(m_vram.get()), VRAM_PAGE_BYTES * VRAM_PAGES);
save_item(NAME(m_cpu_vram_page));
}
diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp
index 98b5a6072a3..97640e10076 100644
--- a/src/mame/drivers/vamphalf.cpp
+++ b/src/mame/drivers/vamphalf.cpp
@@ -110,7 +110,7 @@ public:
int m_semicom_prot_idx;
int m_semicom_prot_which;
UINT16 m_finalgdr_backupram_bank;
- UINT8 *m_finalgdr_backupram;
+ std::unique_ptr<UINT8[]> m_finalgdr_backupram;
UINT8 m_qs1000_data;
DECLARE_WRITE16_MEMBER(flipscreen_w);
@@ -2891,9 +2891,9 @@ DRIVER_INIT_MEMBER(vamphalf_state,yorijori)
DRIVER_INIT_MEMBER(vamphalf_state,finalgdr)
{
m_finalgdr_backupram_bank = 1;
- m_finalgdr_backupram = auto_alloc_array(machine(), UINT8, 0x80*0x100);
+ m_finalgdr_backupram = std::make_unique<UINT8[]>(0x80*0x100);
m_maincpu->space(AS_PROGRAM).install_read_handler(0x005e874, 0x005e877, read32_delegate(FUNC(vamphalf_state::finalgdr_speedup_r), this));
- machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram, 0x80*0x100);
+ machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram.get(), 0x80*0x100);
m_palshift = 0;
m_flip_bit = 1; //?
@@ -2903,7 +2903,7 @@ DRIVER_INIT_MEMBER(vamphalf_state,finalgdr)
m_semicom_prot_data[1] = 3;
save_item(NAME(m_finalgdr_backupram_bank));
- save_pointer(NAME(m_finalgdr_backupram), 0x80*0x100);
+ save_pointer(NAME(m_finalgdr_backupram.get()), 0x80*0x100);
save_item(NAME(m_semicom_prot_idx));
save_item(NAME(m_semicom_prot_which));
}
@@ -2912,9 +2912,9 @@ DRIVER_INIT_MEMBER(vamphalf_state,mrkickera)
{
// backup ram isn't used
m_finalgdr_backupram_bank = 1;
- m_finalgdr_backupram = auto_alloc_array(machine(), UINT8, 0x80*0x100);
+ m_finalgdr_backupram = std::make_unique<UINT8[]>(0x80*0x100);
m_maincpu->space(AS_PROGRAM).install_read_handler(0x00701a4, 0x00701a7, read32_delegate(FUNC(vamphalf_state::mrkickera_speedup_r), this));
- machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram, 0x80*0x100);
+ machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram.get(), 0x80*0x100);
m_palshift = 0;
m_flip_bit = 1; //?
diff --git a/src/mame/drivers/vboy.cpp b/src/mame/drivers/vboy.cpp
index ba2625ef020..2f0e15c7802 100644
--- a/src/mame/drivers/vboy.cpp
+++ b/src/mame/drivers/vboy.cpp
@@ -183,7 +183,7 @@ public:
DECLARE_WRITE8_MEMBER(rfb0_w);
DECLARE_WRITE8_MEMBER(rfb1_w);
UINT16 *m_font;
- UINT16 *m_bgmap;
+ std::unique_ptr<UINT16[]> m_bgmap;
UINT8 *m_l_frame_0;
UINT8 *m_l_frame_1;
UINT8 *m_r_frame_0;
@@ -235,8 +235,8 @@ void vboy_state::video_start()
m_r_frame_1 = auto_alloc_array_clear(machine(), UINT8, 0x6000);
m_font = auto_alloc_array_clear(machine(), UINT16, (0x8000 >> 1)*4 * 2);
- m_bgmap = auto_alloc_array(machine(), UINT16, 0x20000 >> 1);
- memset(m_bgmap, 0, sizeof(UINT16) * (0x20000 >> 1));
+ m_bgmap = std::make_unique<UINT16[]>(0x20000 >> 1);
+ memset(m_bgmap.get(), 0, sizeof(UINT16) * (0x20000 >> 1));
}
void vboy_state::put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, UINT16 code, UINT8 pal)
diff --git a/src/mame/drivers/vcombat.cpp b/src/mame/drivers/vcombat.cpp
index baf394599a9..ad72f7770b8 100644
--- a/src/mame/drivers/vcombat.cpp
+++ b/src/mame/drivers/vcombat.cpp
@@ -105,8 +105,8 @@ public:
m_vid_1(*this, "vid_1"),
m_dac(*this, "dac") { }
- UINT16* m_m68k_framebuffer[2];
- UINT16* m_i860_framebuffer[2][2];
+ std::unique_ptr<UINT16[]> m_m68k_framebuffer[2];
+ std::unique_ptr<UINT16[]> m_i860_framebuffer[2][2];
required_device<tlc34076_device> m_tlc34076;
required_shared_ptr<UINT16> m_framebuffer_ctrl;
int m_crtc_select;
@@ -142,8 +142,8 @@ static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const r
int y;
const rgb_t *const pens = state->m_tlc34076->get_pens();
- UINT16 *m68k_buf = state->m_m68k_framebuffer[(*state->m_framebuffer_ctrl & 0x20) ? 1 : 0];
- UINT16 *i860_buf = state->m_i860_framebuffer[index][0];
+ UINT16 *m68k_buf = state->m_m68k_framebuffer[(*state->m_framebuffer_ctrl & 0x20) ? 1 : 0].get();
+ UINT16 *i860_buf = state->m_i860_framebuffer[index][0].get();
/* TODO: It looks like the leftmost chunk of the ground should really be on the right side? */
/* But the i860 draws the background correctly, so it may be an original game issue. */
@@ -284,7 +284,7 @@ WRITE64_MEMBER(vcombat_state::v0_fb_w)
{
/* The frame buffer seems to sit on a 32-bit data bus, while the
i860 uses a 64-bit data bus. Adjust accordingly. */
- char *p = (char *)(m_i860_framebuffer[0][0]);
+ char *p = (char *)(m_i860_framebuffer[0][0].get());
int m = mem_mask;
int o = (offset << 2);
if (m & 0xff000000) {
@@ -307,7 +307,7 @@ WRITE64_MEMBER(vcombat_state::v1_fb_w)
{
/* The frame buffer seems to sit on a 32-bit data bus, while the
i860 uses a 64-bit data bus. Adjust accordingly. */
- char *p = (char *)(m_i860_framebuffer[1][0]);
+ char *p = (char *)(m_i860_framebuffer[1][0].get());
int m = mem_mask;
int o = (offset << 2);
if (m & 0xff000000) {
@@ -434,16 +434,16 @@ DRIVER_INIT_MEMBER(vcombat_state,vcombat)
UINT8 *ROM = memregion("maincpu")->base();
/* Allocate the 68000 framebuffers */
- m_m68k_framebuffer[0] = auto_alloc_array(machine(), UINT16, 0x8000);
- m_m68k_framebuffer[1] = auto_alloc_array(machine(), UINT16, 0x8000);
+ m_m68k_framebuffer[0] = std::make_unique<UINT16[]>(0x8000);
+ m_m68k_framebuffer[1] = std::make_unique<UINT16[]>(0x8000);
/* First i860 */
- m_i860_framebuffer[0][0] = auto_alloc_array(machine(), UINT16, 0x8000);
- m_i860_framebuffer[0][1] = auto_alloc_array(machine(), UINT16, 0x8000);
+ m_i860_framebuffer[0][0] = std::make_unique<UINT16[]>(0x8000);
+ m_i860_framebuffer[0][1] = std::make_unique<UINT16[]>(0x8000);
/* Second i860 */
- m_i860_framebuffer[1][0] = auto_alloc_array(machine(), UINT16, 0x8000);
- m_i860_framebuffer[1][1] = auto_alloc_array(machine(), UINT16, 0x8000);
+ m_i860_framebuffer[1][0] = std::make_unique<UINT16[]>(0x8000);
+ m_i860_framebuffer[1][1] = std::make_unique<UINT16[]>(0x8000);
/* pc==4016 : jump 4038 ... There's something strange about how it waits at 402e (interrupts all masked out)
I think what is happening here is that M0 snags the first time
@@ -464,12 +464,12 @@ DRIVER_INIT_MEMBER(vcombat_state,vcombat)
DRIVER_INIT_MEMBER(vcombat_state,shadfgtr)
{
/* Allocate th 68000 frame buffers */
- m_m68k_framebuffer[0] = auto_alloc_array(machine(), UINT16, 0x8000);
- m_m68k_framebuffer[1] = auto_alloc_array(machine(), UINT16, 0x8000);
+ m_m68k_framebuffer[0] = std::make_unique<UINT16[]>(0x8000);
+ m_m68k_framebuffer[1] = std::make_unique<UINT16[]>(0x8000);
/* Only one i860 */
- m_i860_framebuffer[0][0] = auto_alloc_array(machine(), UINT16, 0x8000);
- m_i860_framebuffer[0][1] = auto_alloc_array(machine(), UINT16, 0x8000);
+ m_i860_framebuffer[0][0] = std::make_unique<UINT16[]>(0x8000);
+ m_i860_framebuffer[0][1] = std::make_unique<UINT16[]>(0x8000);
m_i860_framebuffer[1][0] = nullptr;
m_i860_framebuffer[1][1] = nullptr;
}
diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp
index ff3c3ab668d..9d366595ed8 100644
--- a/src/mame/drivers/vegaeo.cpp
+++ b/src/mame/drivers/vegaeo.cpp
@@ -26,7 +26,7 @@ public:
vegaeo_state(const machine_config &mconfig, device_type type, const char *tag)
: eolith_state(mconfig, type, tag) { }
- UINT32 *m_vega_vram;
+ std::unique_ptr<UINT32[]> m_vega_vram;
UINT8 m_vega_vbuffer;
DECLARE_WRITE32_MEMBER(vega_vram_w);
@@ -177,8 +177,8 @@ INPUT_PORTS_END
VIDEO_START_MEMBER(vegaeo_state,vega)
{
- m_vega_vram = auto_alloc_array(machine(), UINT32, 0x14000*2/4);
- save_pointer(NAME(m_vega_vram), 0x14000*2/4);
+ m_vega_vram = std::make_unique<UINT32[]>(0x14000*2/4);
+ save_pointer(NAME(m_vega_vram.get()), 0x14000*2/4);
save_item(NAME(m_vega_vbuffer));
}
diff --git a/src/mame/drivers/voyager.cpp b/src/mame/drivers/voyager.cpp
index 328c32557d1..7afe5159636 100644
--- a/src/mame/drivers/voyager.cpp
+++ b/src/mame/drivers/voyager.cpp
@@ -31,7 +31,7 @@ public:
{
}
- UINT32 *m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ram;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -67,7 +67,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
//if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
if ((data & 0x50) | (data & 0xA0))
{
- state->membank("bank1")->set_base(state->m_bios_ram);
+ state->membank("bank1")->set_base(state->m_bios_ram.get());
}
else // disable RAM access (reads go to BIOS ROM)
{
@@ -213,7 +213,7 @@ WRITE32_MEMBER(voyager_state::bios_ram_w)
//if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
if (m_mtxc_config_reg[0x63] & 0x50)
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -499,7 +499,7 @@ MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(voyager_state,voyager)
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x20000/4);
intel82439tx_init();
}
diff --git a/src/mame/drivers/vpoker.cpp b/src/mame/drivers/vpoker.cpp
index d7dbe58fa84..1a23190c002 100644
--- a/src/mame/drivers/vpoker.cpp
+++ b/src/mame/drivers/vpoker.cpp
@@ -112,7 +112,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
UINT8 m_blit_ram[8];
DECLARE_READ8_MEMBER(blitter_r);
DECLARE_WRITE8_MEMBER(blitter_w);
@@ -127,12 +127,12 @@ public:
void vpoker_state::video_start()
{
- m_videoram = auto_alloc_array(machine(), UINT8, 0x200);
+ m_videoram = std::make_unique<UINT8[]>(0x200);
}
UINT32 vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
gfx_element *gfx = m_gfxdecode->gfx(0);
int count = 0x0000;
@@ -163,7 +163,7 @@ READ8_MEMBER(vpoker_state::blitter_r)
WRITE8_MEMBER(vpoker_state::blitter_w)
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
m_blit_ram[offset] = data;
diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp
index d461781acb4..1667b2d2161 100644
--- a/src/mame/drivers/wheelfir.cpp
+++ b/src/mame/drivers/wheelfir.cpp
@@ -242,10 +242,10 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- INT32 *m_zoom_table;
- UINT16 *m_blitter_data;
+ std::unique_ptr<INT32[]> m_zoom_table;
+ std::unique_ptr<UINT16[]> m_blitter_data;
- UINT8 *m_palette_ptr;
+ std::unique_ptr<UINT8[]> m_palette_ptr;
INT32 m_palpos;
INT32 m_current_scanline;
@@ -263,7 +263,7 @@ public:
INT16 m_scanline_cnt;
- bitmap_ind16 *m_tmp_bitmap[2];
+ std::unique_ptr<bitmap_ind16> m_tmp_bitmap[2];
INT32 get_scale(INT32 index)
{
@@ -572,8 +572,8 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_blit_w)
void wheelfir_state::video_start()
{
- m_tmp_bitmap[0] = auto_bitmap_ind16_alloc(machine(), 512, 512);
- m_tmp_bitmap[1] = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_tmp_bitmap[0] = std::make_unique<bitmap_ind16>(512, 512);
+ m_tmp_bitmap[1] = std::make_unique<bitmap_ind16>(512, 512);
}
UINT32 wheelfir_state::screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -769,11 +769,11 @@ void wheelfir_state::machine_reset()
void wheelfir_state::machine_start()
{
- m_zoom_table = auto_alloc_array(machine(), INT32, ZOOM_TABLE_SIZE);
- m_blitter_data = auto_alloc_array(machine(), UINT16, 16);
+ m_zoom_table = std::make_unique<INT32[]>(ZOOM_TABLE_SIZE);
+ m_blitter_data = std::make_unique<UINT16[]>(16);
m_scanlines = reinterpret_cast<scroll_info*>(auto_alloc_array(machine(), UINT8, sizeof(scroll_info)*(NUM_SCANLINES+NUM_VBLANK_LINES)));
- m_palette_ptr = auto_alloc_array(machine(), UINT8, NUM_COLORS*3);
+ m_palette_ptr = std::make_unique<UINT8[]>(NUM_COLORS*3);
for(int i=0;i<(ZOOM_TABLE_SIZE);++i)
diff --git a/src/mame/drivers/wyvernf0.cpp b/src/mame/drivers/wyvernf0.cpp
index 1a8aabe32da..1b32bd96aa0 100644
--- a/src/mame/drivers/wyvernf0.cpp
+++ b/src/mame/drivers/wyvernf0.cpp
@@ -58,7 +58,7 @@ public:
// video-related
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
- UINT8 *m_objram;
+ std::unique_ptr<UINT8[]> m_objram;
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
@@ -603,9 +603,9 @@ MACHINE_START_MEMBER(wyvernf0_state,wyvernf0)
membank("rombank")->configure_entries(0, 8, ROM, 0x2000);
// sprite codes lookup in banked RAM
- m_objram = auto_alloc_array(machine(), UINT8, 0x1000 * 2);
- save_pointer(NAME(m_objram), 0x1000 * 2);
- membank("rambank")->configure_entries(0, 2, m_objram, 0x1000);
+ m_objram = std::make_unique<UINT8[]>(0x1000 * 2);
+ save_pointer(NAME(m_objram.get()), 0x1000 * 2);
+ membank("rambank")->configure_entries(0, 2, m_objram.get(), 0x1000);
save_item(NAME(m_sound_nmi_enable));
save_item(NAME(m_pending_nmi));
diff --git a/src/mame/drivers/xtom3d.cpp b/src/mame/drivers/xtom3d.cpp
index 3e7a9c3548d..c017d160442 100644
--- a/src/mame/drivers/xtom3d.cpp
+++ b/src/mame/drivers/xtom3d.cpp
@@ -56,13 +56,13 @@ public:
: pcat_base_state(mconfig, type, tag)
{ }
- UINT32 *m_bios_ram;
- UINT32 *m_bios_ext1_ram;
- UINT32 *m_bios_ext2_ram;
- UINT32 *m_bios_ext3_ram;
- UINT32 *m_bios_ext4_ram;
- UINT32 *m_isa_ram1;
- UINT32 *m_isa_ram2;
+ std::unique_ptr<UINT32[]> m_bios_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext1_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext2_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext3_ram;
+ std::unique_ptr<UINT32[]> m_bios_ext4_ram;
+ std::unique_ptr<UINT32[]> m_isa_ram1;
+ std::unique_ptr<UINT32[]> m_isa_ram2;
UINT8 m_mtxc_config_reg[256];
UINT8 m_piix4_config_reg[4][256];
@@ -120,7 +120,7 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x59: // PAM0
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
- state->membank("bios_bank")->set_base(state->m_bios_ram);
+ state->membank("bios_bank")->set_base(state->m_bios_ram.get());
else // disable RAM access (reads go to BIOS ROM)
state->membank("bios_bank")->set_base(state->memregion("bios")->base() + 0x10000);
break;
@@ -128,12 +128,12 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x5a: // PAM1
{
if (data & 0x1)
- state->membank("video_bank1")->set_base(state->m_isa_ram1);
+ state->membank("video_bank1")->set_base(state->m_isa_ram1.get());
else
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);
+ state->membank("video_bank2")->set_base(state->m_isa_ram2.get());
else
state->membank("video_bank2")->set_base(state->memregion("video_bios")->base() + 0x4000);
@@ -142,12 +142,12 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x5e: // PAM5
{
if (data & 0x1)
- state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram);
+ state->membank("bios_ext1")->set_base(state->m_bios_ext1_ram.get());
else
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);
+ state->membank("bios_ext2")->set_base(state->m_bios_ext2_ram.get());
else
state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x4000);
@@ -156,12 +156,12 @@ static void mtxc_config_w(device_t *busdevice, device_t *device, int function, i
case 0x5f: // PAM6
{
if (data & 0x1)
- state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram);
+ state->membank("bios_ext3")->set_base(state->m_bios_ext3_ram.get());
else
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);
+ state->membank("bios_ext4")->set_base(state->m_bios_ext4_ram.get());
else
state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0xc000);
@@ -287,7 +287,7 @@ WRITE32_MEMBER(xtom3d_state::isa_ram1_w)
{
if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_isa_ram1 + offset);
+ COMBINE_DATA(m_isa_ram1.get() + offset);
}
}
@@ -295,7 +295,7 @@ WRITE32_MEMBER(xtom3d_state::isa_ram2_w)
{
if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_isa_ram2 + offset);
+ COMBINE_DATA(m_isa_ram2.get() + offset);
}
}
@@ -303,7 +303,7 @@ WRITE32_MEMBER(xtom3d_state::bios_ext1_ram_w)
{
if (m_mtxc_config_reg[0x5e] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext1_ram + offset);
+ COMBINE_DATA(m_bios_ext1_ram.get() + offset);
}
}
@@ -312,7 +312,7 @@ WRITE32_MEMBER(xtom3d_state::bios_ext2_ram_w)
{
if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext2_ram + offset);
+ COMBINE_DATA(m_bios_ext2_ram.get() + offset);
}
}
@@ -321,7 +321,7 @@ WRITE32_MEMBER(xtom3d_state::bios_ext3_ram_w)
{
if (m_mtxc_config_reg[0x5f] & 0x2) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext3_ram + offset);
+ COMBINE_DATA(m_bios_ext3_ram.get() + offset);
}
}
@@ -330,7 +330,7 @@ WRITE32_MEMBER(xtom3d_state::bios_ext4_ram_w)
{
if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ext4_ram + offset);
+ COMBINE_DATA(m_bios_ext4_ram.get() + offset);
}
}
@@ -339,7 +339,7 @@ WRITE32_MEMBER(xtom3d_state::bios_ram_w)
{
if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
- COMBINE_DATA(m_bios_ram + offset);
+ COMBINE_DATA(m_bios_ram.get() + offset);
}
}
@@ -372,13 +372,13 @@ ADDRESS_MAP_END
void xtom3d_state::machine_start()
{
- m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4);
- m_bios_ext1_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ext2_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ext3_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_bios_ext4_ram = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_isa_ram1 = auto_alloc_array(machine(), UINT32, 0x4000/4);
- m_isa_ram2 = auto_alloc_array(machine(), UINT32, 0x4000/4);
+ m_bios_ram = std::make_unique<UINT32[]>(0x10000/4);
+ m_bios_ext1_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ext2_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ext3_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_bios_ext4_ram = std::make_unique<UINT32[]>(0x4000/4);
+ m_isa_ram1 = std::make_unique<UINT32[]>(0x4000/4);
+ m_isa_ram2 = std::make_unique<UINT32[]>(0x4000/4);
intel82439tx_init();
}
diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp
index 871ebaba7a0..c053484ff5f 100644
--- a/src/mame/drivers/zn.cpp
+++ b/src/mame/drivers/zn.cpp
@@ -131,7 +131,7 @@ private:
UINT16 m_bam2_mcu_command;
int m_jdredd_gun_mux;
- UINT8* m_fx1b_fram;
+ std::unique_ptr<UINT8[]> m_fx1b_fram;
UINT16 m_vt83c461_latch;
@@ -1228,8 +1228,8 @@ ADDRESS_MAP_END
DRIVER_INIT_MEMBER(zn_state,coh1000tb)
{
- m_fx1b_fram = auto_alloc_array(machine(), UINT8, 0x200);
- machine().device<nvram_device>("fm1208s")->set_base(m_fx1b_fram, 0x200);
+ m_fx1b_fram = std::make_unique<UINT8[]>(0x200);
+ machine().device<nvram_device>("fm1208s")->set_base(m_fx1b_fram.get(), 0x200);
}
MACHINE_RESET_MEMBER(zn_state,coh1000tb)
diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp
index e5779c89ac6..f838f3e21e2 100644
--- a/src/mame/drivers/zr107.cpp
+++ b/src/mame/drivers/zr107.cpp
@@ -227,7 +227,7 @@ public:
required_shared_ptr<UINT32> m_generic_paletteram_32;
required_device<konppc_device> m_konppc;
- UINT32 *m_sharc_dataram;
+ std::unique_ptr<UINT32[]> m_sharc_dataram;
UINT8 m_led_reg0;
UINT8 m_led_reg1;
int m_ccu_vcth;
@@ -909,7 +909,7 @@ MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(zr107_state,common)
{
- m_sharc_dataram = auto_alloc_array(machine(), UINT32, 0x100000/4);
+ m_sharc_dataram = std::make_unique<UINT32[]>(0x100000/4);
m_led_reg0 = m_led_reg1 = 0x7f;
m_ccu_vcth = m_ccu_vctl = 0;
}
diff --git a/src/mame/includes/3do.h b/src/mame/includes/3do.h
index 0bd7b0b84ad..c826052faa4 100644
--- a/src/mame/includes/3do.h
+++ b/src/mame/includes/3do.h
@@ -131,9 +131,9 @@ struct SVF {
};
struct DSPP {
- UINT16 *N;
- UINT16 *EI;
- UINT16 *EO;
+ std::unique_ptr<UINT16[]> N;
+ std::unique_ptr<UINT16[]> EI;
+ std::unique_ptr<UINT16[]> EO;
};
class _3do_state : public driver_device
diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h
index 222a91a02ce..dcc3cc63962 100644
--- a/src/mame/includes/40love.h
+++ b/src/mame/includes/40love.h
@@ -31,8 +31,8 @@ public:
optional_shared_ptr<UINT8> m_mcu_ram;
/* video-related */
- bitmap_ind16 *m_tmp_bitmap1;
- bitmap_ind16 *m_tmp_bitmap2;
+ std::unique_ptr<bitmap_ind16> m_tmp_bitmap1;
+ std::unique_ptr<bitmap_ind16> m_tmp_bitmap2;
tilemap_t *m_bg_tilemap;
UINT8 m_flipscreen;
UINT8 m_pix_redraw;
diff --git a/src/mame/includes/amstrad.h b/src/mame/includes/amstrad.h
index e87597da5f6..682c0a6b226 100644
--- a/src/mame/includes/amstrad.h
+++ b/src/mame/includes/amstrad.h
@@ -50,7 +50,7 @@
****************************/
struct gate_array_t
{
- bitmap_ind16 *bitmap; /* The bitmap we work on */
+ std::unique_ptr<bitmap_ind16> bitmap; /* The bitmap we work on */
UINT8 pen_selected; /* Pen selection */
UINT8 mrer; /* Mode and ROM Enable Register */
UINT8 upper_bank;
diff --git a/src/mame/includes/apollo.h b/src/mame/includes/apollo.h
index 2666fc17aa5..ee4dbfb7c06 100644
--- a/src/mame/includes/apollo.h
+++ b/src/mame/includes/apollo.h
@@ -532,7 +532,7 @@ protected:
int m_p_clock;
int m_data_clock;
- UINT16 *m_image_memory;
+ std::unique_ptr<UINT16[]> m_image_memory;
int m_image_plane_size;
int m_image_memory_size;
diff --git a/src/mame/includes/apple2.h b/src/mame/includes/apple2.h
index f353598e614..9c2e9624708 100644
--- a/src/mame/includes/apple2.h
+++ b/src/mame/includes/apple2.h
@@ -186,8 +186,8 @@ public:
int m_bgcolor;
int m_flash;
int m_alt_charset_value;
- UINT16 *m_hires_artifact_map;
- UINT16 *m_dhires_artifact_map;
+ std::unique_ptr<UINT16[]> m_hires_artifact_map;
+ std::unique_ptr<UINT16[]> m_dhires_artifact_map;
bool m_monochrome_dhr;
int m_inh_slot;
int m_reset_flag;
@@ -371,7 +371,7 @@ private:
UINT8 m_exp_bankhior;
int m_exp_addrmask;
UINT8 m_exp_regs[0x10];
- UINT8 *m_exp_ram;
+ std::unique_ptr<UINT8[]> m_exp_ram;
int m_exp_wptr, m_exp_liveptr;
};
/*----------- defined in drivers/apple2.c -----------*/
diff --git a/src/mame/includes/apple2gs.h b/src/mame/includes/apple2gs.h
index eddd8445cd5..ed0ec08b870 100644
--- a/src/mame/includes/apple2gs.h
+++ b/src/mame/includes/apple2gs.h
@@ -159,7 +159,7 @@ public:
UINT8 m_sndglu_ctrl;
int m_sndglu_addr;
int m_sndglu_dummy_read;
- bitmap_ind16 *m_legacy_gfx;
+ std::unique_ptr<bitmap_ind16> m_legacy_gfx;
bool m_is_rom3;
UINT8 m_echo_bank;
UINT64 m_last_adb_time;
diff --git a/src/mame/includes/apple3.h b/src/mame/includes/apple3.h
index 1d389c0b435..62fccf41f8c 100644
--- a/src/mame/includes/apple3.h
+++ b/src/mame/includes/apple3.h
@@ -148,7 +148,7 @@ private:
offs_t m_zpa;
UINT8 m_last_n;
UINT8 m_char_mem[0x800];
- UINT32 *m_hgr_map;
+ std::unique_ptr<UINT32[]> m_hgr_map;
bool m_sync;
bool m_rom_has_been_disabled;
diff --git a/src/mame/includes/arabian.h b/src/mame/includes/arabian.h
index c2d92febffa..0dc5fc7fde2 100644
--- a/src/mame/includes/arabian.h
+++ b/src/mame/includes/arabian.h
@@ -23,8 +23,8 @@ public:
required_shared_ptr<UINT8> m_custom_cpu_ram;
required_shared_ptr<UINT8> m_blitter;
- UINT8 * m_main_bitmap;
- UINT8 * m_converted_gfx;
+ std::unique_ptr<UINT8[]> m_main_bitmap;
+ std::unique_ptr<UINT8[]> m_converted_gfx;
/* video-related */
UINT8 m_video_control;
diff --git a/src/mame/includes/arcadia.h b/src/mame/includes/arcadia.h
index 7e8cd46fc15..164c095852c 100644
--- a/src/mame/includes/arcadia.h
+++ b/src/mame/includes/arcadia.h
@@ -94,7 +94,7 @@ public:
UINT8 ram3[3][16];
} d;
} m_reg;
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
DECLARE_DRIVER_INIT(arcadia);
virtual void machine_start() override;
virtual void video_start() override;
diff --git a/src/mame/includes/argus.h b/src/mame/includes/argus.h
index 9aa56173f83..db322d7ed2b 100644
--- a/src/mame/includes/argus.h
+++ b/src/mame/includes/argus.h
@@ -46,7 +46,7 @@ public:
UINT16 m_palette_intensity;
// argus specific
- UINT8 *m_dummy_bg0ram;
+ std::unique_ptr<UINT8[]> m_dummy_bg0ram;
int m_lowbitscroll;
int m_prvscrollx;
@@ -55,7 +55,7 @@ public:
UINT8 *m_butasan_bg0ram;
UINT8 *m_butasan_bg0backram;
UINT8 *m_butasan_txbackram;
- UINT8 *m_butasan_pagedram[2];
+ std::unique_ptr<UINT8[]> m_butasan_pagedram[2];
UINT8 m_butasan_page_latch;
UINT8 m_butasan_bg1_status;
UINT8 m_butasan_unknown;
diff --git a/src/mame/includes/armedf.h b/src/mame/includes/armedf.h
index 4934f2d6d00..b09b256ee45 100644
--- a/src/mame/includes/armedf.h
+++ b/src/mame/includes/armedf.h
@@ -28,7 +28,7 @@ public:
required_device<buffered_spriteram16_device> m_spriteram;
/* memory pointers */
- UINT8 *m_text_videoram;
+ std::unique_ptr<UINT8[]> m_text_videoram;
required_shared_ptr<UINT16> m_spr_pal_clut;
required_shared_ptr<UINT16> m_fg_videoram;
required_shared_ptr<UINT16> m_bg_videoram;
diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h
index 5a3657eb0a6..99ec5cc7e39 100644
--- a/src/mame/includes/astrocde.h
+++ b/src/mame/includes/astrocde.h
@@ -94,7 +94,7 @@ public:
UINT8 m_port_2_last;
UINT8 m_ram_write_enable;
UINT8 m_input_select;
- UINT8 *m_sparklestar;
+ std::unique_ptr<UINT8[]> m_sparklestar;
UINT8 m_interrupt_enabl;
UINT8 m_interrupt_vector;
UINT8 m_interrupt_scanline;
@@ -120,7 +120,7 @@ public:
UINT8 m_pattern_skip;
UINT8 m_pattern_width;
UINT8 m_pattern_height;
- UINT16 *m_profpac_videoram;
+ std::unique_ptr<UINT16[]> m_profpac_videoram;
UINT16 m_profpac_palette[16];
UINT8 m_profpac_colormap[4];
UINT8 m_profpac_intercept;
diff --git a/src/mame/includes/astrof.h b/src/mame/includes/astrof.h
index 46631763fd0..f45a3681777 100644
--- a/src/mame/includes/astrof.h
+++ b/src/mame/includes/astrof.h
@@ -25,7 +25,7 @@ public:
/* video-related */
required_shared_ptr<UINT8> m_videoram;
- UINT8 * m_colorram;
+ std::unique_ptr<UINT8[]> m_colorram;
required_shared_ptr<UINT8> m_astrof_color;
optional_shared_ptr<UINT8> m_tomahawk_protection;
diff --git a/src/mame/includes/atarig1.h b/src/mame/includes/atarig1.h
index e38a467a336..1729282b341 100644
--- a/src/mame/includes/atarig1.h
+++ b/src/mame/includes/atarig1.h
@@ -34,7 +34,7 @@ public:
required_shared_ptr<UINT16> m_mo_command;
UINT16 * m_bslapstic_base;
- void * m_bslapstic_bank0;
+ std::unique_ptr<UINT8[]> m_bslapstic_bank0;
UINT8 m_bslapstic_bank;
bool m_bslapstic_primed;
diff --git a/src/mame/includes/bigevglf.h b/src/mame/includes/bigevglf.h
index d4dd3f8a451..d0bd4a3cea5 100644
--- a/src/mame/includes/bigevglf.h
+++ b/src/mame/includes/bigevglf.h
@@ -25,7 +25,7 @@ public:
/* video-related */
bitmap_ind16 m_tmp_bitmap[4];
- UINT8 *m_vidram;
+ std::unique_ptr<UINT8[]> m_vidram;
UINT32 m_vidram_bank;
UINT32 m_plane_selected;
UINT32 m_plane_visible;
diff --git a/src/mame/includes/blktiger.h b/src/mame/includes/blktiger.h
index 7a399ba839a..2fe842cde63 100644
--- a/src/mame/includes/blktiger.h
+++ b/src/mame/includes/blktiger.h
@@ -32,7 +32,7 @@ public:
UINT32 m_scroll_bank;
UINT8 m_scroll_x[2];
UINT8 m_scroll_y[2];
- UINT8 *m_scroll_ram;
+ std::unique_ptr<UINT8[]> m_scroll_ram;
UINT8 m_screen_layout;
UINT8 m_chon;
UINT8 m_objon;
diff --git a/src/mame/includes/btime.h b/src/mame/includes/btime.h
index fbda90ffd2d..3f2fa108886 100644
--- a/src/mame/includes/btime.h
+++ b/src/mame/includes/btime.h
@@ -39,7 +39,7 @@ public:
optional_shared_ptr<UINT8> m_audio_rambase;
/* video-related */
- bitmap_ind16 *m_background_bitmap;
+ std::unique_ptr<bitmap_ind16> m_background_bitmap;
UINT8 m_btime_palette;
UINT8 m_bnj_scroll1;
UINT8 m_bnj_scroll2;
diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h
index 469ad2c268a..62978cef335 100644
--- a/src/mame/includes/carpolo.h
+++ b/src/mame/includes/carpolo.h
@@ -68,11 +68,11 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- bitmap_ind16 *m_sprite_sprite_collision_bitmap1;
- bitmap_ind16 *m_sprite_sprite_collision_bitmap2;
- bitmap_ind16 *m_sprite_goal_collision_bitmap1;
- bitmap_ind16 *m_sprite_goal_collision_bitmap2;
- bitmap_ind16 *m_sprite_border_collision_bitmap;
+ std::unique_ptr<bitmap_ind16> m_sprite_sprite_collision_bitmap1;
+ std::unique_ptr<bitmap_ind16> m_sprite_sprite_collision_bitmap2;
+ std::unique_ptr<bitmap_ind16> m_sprite_goal_collision_bitmap1;
+ std::unique_ptr<bitmap_ind16> m_sprite_goal_collision_bitmap2;
+ std::unique_ptr<bitmap_ind16> m_sprite_border_collision_bitmap;
DECLARE_READ8_MEMBER(carpolo_ball_screen_collision_cause_r);
DECLARE_READ8_MEMBER(carpolo_car_ball_collision_x_r);
DECLARE_READ8_MEMBER(carpolo_car_ball_collision_y_r);
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index b8616cfcbc1..6f78bf422f5 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -85,7 +85,7 @@ public:
int m_spriteram_bank[4];
int m_spriteram_bank_delay[4];
- UINT16 *m_palette_map[4];
+ std::unique_ptr<UINT16[]> m_palette_map[4];
int m_layers_offs_x;
int m_layers_offs_y;
diff --git a/src/mame/includes/cbasebal.h b/src/mame/includes/cbasebal.h
index 6c2ede6d076..8a057beac20 100644
--- a/src/mame/includes/cbasebal.h
+++ b/src/mame/includes/cbasebal.h
@@ -22,8 +22,8 @@ public:
/* video-related */
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
- UINT8 *m_textram;
- UINT8 *m_scrollram;
+ std::unique_ptr<UINT8[]> m_textram;
+ std::unique_ptr<UINT8[]> m_scrollram;
UINT8 m_scroll_x[2];
UINT8 m_scroll_y[2];
int m_tilebank;
diff --git a/src/mame/includes/changela.h b/src/mame/includes/changela.h
index 220c5acf3a3..2b0d9b24db7 100644
--- a/src/mame/includes/changela.h
+++ b/src/mame/includes/changela.h
@@ -25,8 +25,8 @@ public:
bitmap_ind16 m_river_bitmap;
bitmap_ind16 m_tree0_bitmap;
bitmap_ind16 m_tree1_bitmap;
- UINT8* m_tree_ram;
- UINT8* m_memory_devices;
+ std::unique_ptr<UINT8[]> m_tree_ram;
+ std::unique_ptr<UINT8[]> m_memory_devices;
UINT32 m_mem_dev_selected; /* an offset within memory_devices area */
UINT32 m_slopeROM_bank;
UINT8 m_tree_en;
diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h
index ffda1850317..7957a0802f6 100644
--- a/src/mame/includes/cheekyms.h
+++ b/src/mame/includes/cheekyms.h
@@ -35,7 +35,7 @@ public:
/* video-related */
tilemap_t *m_cm_tilemap;
- bitmap_ind16 *m_bitmap_buffer;
+ std::unique_ptr<bitmap_ind16> m_bitmap_buffer;
UINT8 m_irq_mask;
diff --git a/src/mame/includes/cloak.h b/src/mame/includes/cloak.h
index 416df7bd7b6..c3f3c127b49 100644
--- a/src/mame/includes/cloak.h
+++ b/src/mame/includes/cloak.h
@@ -25,11 +25,11 @@ public:
UINT8 m_bitmap_videoram_selected;
UINT8 m_bitmap_videoram_address_x;
UINT8 m_bitmap_videoram_address_y;
- UINT8 *m_bitmap_videoram1;
- UINT8 *m_bitmap_videoram2;
+ std::unique_ptr<UINT8[]> m_bitmap_videoram1;
+ std::unique_ptr<UINT8[]> m_bitmap_videoram2;
UINT8 *m_current_bitmap_videoram_accessed;
UINT8 *m_current_bitmap_videoram_displayed;
- UINT16 *m_palette_ram;
+ std::unique_ptr<UINT16[]> m_palette_ram;
tilemap_t *m_bg_tilemap;
DECLARE_WRITE8_MEMBER(cloak_led_w);
DECLARE_WRITE8_MEMBER(cloak_coin_counter_w);
diff --git a/src/mame/includes/cloud9.h b/src/mame/includes/cloud9.h
index 3bc0e140ab6..b1f4e70f12f 100644
--- a/src/mame/includes/cloud9.h
+++ b/src/mame/includes/cloud9.h
@@ -26,7 +26,7 @@ public:
required_device<m6502_device> m_maincpu;
required_device<x2212_device> m_nvram;
/* memory pointers */
- UINT8 * m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_paletteram;
diff --git a/src/mame/includes/contra.h b/src/mame/includes/contra.h
index 1f37b794ab2..454a3ca21f9 100644
--- a/src/mame/includes/contra.h
+++ b/src/mame/includes/contra.h
@@ -29,8 +29,8 @@ public:
m_palette(*this, "palette") { }
/* memory pointers */
- UINT8 * m_buffered_spriteram;
- UINT8 * m_buffered_spriteram_2;
+ std::unique_ptr<UINT8[]> m_buffered_spriteram;
+ std::unique_ptr<UINT8[]> m_buffered_spriteram_2;
required_shared_ptr<UINT8> m_fg_cram;
required_shared_ptr<UINT8> m_fg_vram;
required_shared_ptr<UINT8> m_tx_cram;
diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h
index 3b2d893cf9a..b476d70d35e 100644
--- a/src/mame/includes/cps1.h
+++ b/src/mame/includes/cps1.h
@@ -150,7 +150,7 @@ public:
optional_ioport m_io_in1;
UINT16 * m_cps2_buffered_obj;
// game-specific
- UINT16 * m_gigaman2_dummyqsound_ram;
+ std::unique_ptr<UINT16[]> m_gigaman2_dummyqsound_ram;
UINT16 sf2ceblp_prot;
/* video-related */
diff --git a/src/mame/includes/cps3.h b/src/mame/includes/cps3.h
index fd909a355ff..8792500c685 100644
--- a/src/mame/includes/cps3.h
+++ b/src/mame/includes/cps3.h
@@ -53,20 +53,20 @@ public:
fujitsu_29f016a_device *m_simm[7][8];
UINT32 m_cram_gfxflash_bank;
UINT32* m_nops;
- UINT32* m_char_ram;
- UINT32* m_eeprom;
+ std::unique_ptr<UINT32[]> m_char_ram;
+ std::unique_ptr<UINT32[]> m_eeprom;
UINT32 m_ss_pal_base;
UINT32 m_unk_vidregs[0x20/4];
UINT32 m_ss_bank_base;
UINT32 m_screenwidth;
- UINT32* m_mame_colours;
+ std::unique_ptr<UINT32[]> m_mame_colours;
bitmap_rgb32 m_renderbuffer_bitmap;
rectangle m_renderbuffer_clip;
UINT8* m_user4region;
UINT32 m_key1;
UINT32 m_key2;
int m_altEncryption;
- UINT32* m_ss_ram;
+ std::unique_ptr<UINT32[]> m_ss_ram;
UINT32 m_cram_bank;
UINT16 m_current_eeprom_read;
UINT32 m_paldma_source;
diff --git a/src/mame/includes/crgolf.h b/src/mame/includes/crgolf.h
index 5d68877ac21..c337a5f8263 100644
--- a/src/mame/includes/crgolf.h
+++ b/src/mame/includes/crgolf.h
@@ -24,8 +24,8 @@ public:
m_msm(*this, "msm"){ }
/* memory pointers */
- UINT8 * m_videoram_a;
- UINT8 * m_videoram_b;
+ std::unique_ptr<UINT8[]> m_videoram_a;
+ std::unique_ptr<UINT8[]> m_videoram_b;
required_shared_ptr<UINT8> m_color_select;
required_shared_ptr<UINT8> m_screen_flip;
required_shared_ptr<UINT8> m_screen_select;
diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h
index eb2b5832cf9..d8c9455f899 100644
--- a/src/mame/includes/dcheese.h
+++ b/src/mame/includes/dcheese.h
@@ -28,7 +28,7 @@ public:
UINT16 m_blitter_yparam[16];
UINT16 m_blitter_vidparam[32];
- bitmap_ind16 *m_dstbitmap;
+ std::unique_ptr<bitmap_ind16> m_dstbitmap;
emu_timer *m_blitter_timer;
/* misc */
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index ba84805c2dd..c1ce644b7d1 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -83,9 +83,9 @@ public:
int m_byteAddr; // tattass
int m_ace_ram_dirty; // nslasher and tattass
int m_has_ace_ram; // all - config
- UINT8 *m_dirty_palette; // all but captaven
+ std::unique_ptr<UINT8[]> m_dirty_palette; // all but captaven
int m_pri; // captaven, fghthist, nslasher and tattass
- bitmap_ind16 *m_tilemap_alpha_bitmap; // nslasher
+ std::unique_ptr<bitmap_ind16> m_tilemap_alpha_bitmap; // nslasher
UINT16 m_spriteram16[0x1000]; // captaven, fghthist, nslasher and tattass
UINT16 m_spriteram16_buffered[0x1000]; // captaven, fghthist, nslasher and tattass
UINT16 m_spriteram16_2[0x1000]; //nslasher and tattass
diff --git a/src/mame/includes/deco_mlc.h b/src/mame/includes/deco_mlc.h
index 50a454eb814..85379c3810e 100644
--- a/src/mame/includes/deco_mlc.h
+++ b/src/mame/includes/deco_mlc.h
@@ -38,9 +38,9 @@ public:
int m_lastScanline[9];
UINT32 m_colour_mask;
- UINT16 *m_mlc_spriteram;
- UINT16 *m_mlc_spriteram_spare;
- UINT16 *m_mlc_buffered_spriteram;
+ std::unique_ptr<UINT16[]> m_mlc_spriteram;
+ std::unique_ptr<UINT16[]> m_mlc_spriteram_spare;
+ std::unique_ptr<UINT16[]> m_mlc_buffered_spriteram;
DECLARE_READ32_MEMBER(test2_r);
DECLARE_READ32_MEMBER(mlc_440008_r);
DECLARE_READ32_MEMBER(mlc_44001c_r);
diff --git a/src/mame/includes/dogfgt.h b/src/mame/includes/dogfgt.h
index 7eaf9658327..c63ff99abc2 100644
--- a/src/mame/includes/dogfgt.h
+++ b/src/mame/includes/dogfgt.h
@@ -27,7 +27,7 @@ public:
/* video-related */
bitmap_ind16 m_pixbitmap;
tilemap_t *m_bg_tilemap;
- UINT8 *m_bitmapram;
+ std::unique_ptr<UINT8[]> m_bitmapram;
int m_bm_plane;
int m_pixcolor;
int m_scroll[4];
diff --git a/src/mame/includes/drmicro.h b/src/mame/includes/drmicro.h
index 812a2eb9d54..2494ef9557a 100644
--- a/src/mame/includes/drmicro.h
+++ b/src/mame/includes/drmicro.h
@@ -18,7 +18,7 @@ public:
m_palette(*this, "palette") { }
/* memory pointers */
- UINT8 * m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
/* video-related */
tilemap_t *m_bg1;
diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h
index 694487d4120..7d84e0cc86e 100644
--- a/src/mame/includes/dynax.h
+++ b/src/mame/includes/dynax.h
@@ -36,7 +36,7 @@ public:
optional_device<msm6242_device> m_rtc;
// up to 8 layers, 2 images per layer (interleaved on screen)
- UINT8 * m_pixmap[8][2];
+ std::unique_ptr<UINT8[]> m_pixmap[8][2];
/* irq */
typedef void (dynax_state::*irq_func)(); // some games trigger IRQ at blitter end, some don't
diff --git a/src/mame/includes/einstein.h b/src/mame/includes/einstein.h
index 71fcc7d24cf..027b2370ba3 100644
--- a/src/mame/includes/einstein.h
+++ b/src/mame/includes/einstein.h
@@ -97,7 +97,7 @@ public:
/* 80 column device */
optional_device<mc6845_device> m_mc6845;
optional_device<screen_device> m_crtc_screen;
- UINT8 *m_crtc_ram;
+ std::unique_ptr<UINT8[]> m_crtc_ram;
UINT8 m_de;
int m_centronics_busy;
diff --git a/src/mame/includes/eolith.h b/src/mame/includes/eolith.h
index 975f107b527..3269f784949 100644
--- a/src/mame/includes/eolith.h
+++ b/src/mame/includes/eolith.h
@@ -41,7 +41,7 @@ public:
int m_coin_counter_bit;
int m_buffer;
- UINT32 *m_vram;
+ std::unique_ptr<UINT32[]> m_vram;
UINT8 m_sound_data;
diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h
index 07d254a72ab..a3808e6265a 100644
--- a/src/mame/includes/equites.h
+++ b/src/mame/includes/equites.h
@@ -36,7 +36,7 @@ public:
/* memory pointers */
required_shared_ptr<UINT16> m_bg_videoram;
- UINT8 *m_fg_videoram; // 8bits
+ std::unique_ptr<UINT8[]> m_fg_videoram; // 8bits
required_shared_ptr<UINT16> m_spriteram;
optional_shared_ptr<UINT16> m_spriteram_2;
optional_shared_ptr<UINT8> m_mcuram;
diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h
index cdb1dd673a3..43994ec4ada 100644
--- a/src/mame/includes/esripsys.h
+++ b/src/mame/includes/esripsys.h
@@ -29,9 +29,9 @@
struct line_buffer_t
{
- UINT8 *colour_buf;
- UINT8 *intensity_buf;
- UINT8 *priority_buf;
+ std::unique_ptr<UINT8[]> colour_buf;
+ std::unique_ptr<UINT8[]> intensity_buf;
+ std::unique_ptr<UINT8[]> priority_buf;
};
class esripsys_state : public driver_device
@@ -63,7 +63,7 @@ public:
int m_io_firq_status;
UINT8 m_cmos_ram_a2_0;
UINT8 m_cmos_ram_a10_3;
- UINT8 *m_cmos_ram;
+ std::unique_ptr<UINT8[]> m_cmos_ram;
UINT8 m_u56a;
UINT8 m_u56b;
UINT8 m_g_to_s_latch1;
@@ -73,8 +73,8 @@ public:
UINT8 m_dac_msb;
UINT8 m_dac_vol;
UINT8 m_tms_data;
- UINT8 *m_fdt_a;
- UINT8 *m_fdt_b;
+ std::unique_ptr<UINT8[]> m_fdt_a;
+ std::unique_ptr<UINT8[]> m_fdt_b;
struct line_buffer_t m_line_buffer[2];
int m_fasel;
int m_fbsel;
@@ -85,8 +85,8 @@ public:
int m_video_firq_en;
emu_timer *m_hblank_end_timer;
emu_timer *m_hblank_start_timer;
- UINT8 *m_fig_scale_table;
- UINT8 *m_scale_table;
+ std::unique_ptr<UINT8[]> m_fig_scale_table;
+ std::unique_ptr<UINT8[]> m_scale_table;
int m_video_firq;
UINT8 m_bg_intensity;
DECLARE_WRITE8_MEMBER(uart_w);
diff --git a/src/mame/includes/exerion.h b/src/mame/includes/exerion.h
index f787ed9709d..7bf606e2180 100644
--- a/src/mame/includes/exerion.h
+++ b/src/mame/includes/exerion.h
@@ -43,7 +43,7 @@ public:
UINT8 m_char_palette;
UINT8 m_sprite_palette;
UINT8 m_char_bank;
- UINT16 *m_background_gfx[4];
+ std::unique_ptr<UINT16[]> m_background_gfx[4];
UINT8 *m_background_mixer;
UINT8 m_background_latches[13];
diff --git a/src/mame/includes/exidy440.h b/src/mame/includes/exidy440.h
index 87835b7fbc1..e6f7048ac8a 100644
--- a/src/mame/includes/exidy440.h
+++ b/src/mame/includes/exidy440.h
@@ -41,8 +41,8 @@ public:
UINT8 m_firq_beam;
UINT8 *m_topsecex_yscroll;
UINT8 m_latched_x;
- UINT8 *m_local_videoram;
- UINT8 *m_local_paletteram;
+ std::unique_ptr<UINT8[]> m_local_videoram;
+ std::unique_ptr<UINT8[]> m_local_paletteram;
UINT8 m_firq_enable;
UINT8 m_firq_select;
UINT8 m_palettebank_io;
diff --git a/src/mame/includes/flower.h b/src/mame/includes/flower.h
index 24979ea9ca3..12abefb7b89 100644
--- a/src/mame/includes/flower.h
+++ b/src/mame/includes/flower.h
@@ -115,9 +115,9 @@ private:
sound_stream * m_stream;
/* mixer tables and internal buffers */
- INT16 *m_mixer_table;
+ std::unique_ptr<INT16[]> m_mixer_table;
INT16 *m_mixer_lookup;
- short *m_mixer_buffer;
+ std::unique_ptr<short[]> m_mixer_buffer;
UINT8 m_soundregs1[0x40];
UINT8 m_soundregs2[0x40];
diff --git a/src/mame/includes/fm7.h b/src/mame/includes/fm7.h
index 97f1de1eb9d..cdc22c6e092 100644
--- a/src/mame/includes/fm7.h
+++ b/src/mame/includes/fm7.h
@@ -194,7 +194,7 @@ public:
fm7_encoder_t m_encoder;
fm7_mmr_t m_mmr;
UINT8 m_cp_prev;
- UINT8* m_video_ram;
+ std::unique_ptr<UINT8[]> m_video_ram;
emu_timer* m_fm77av_vsync_timer;
UINT8 m_type;
fm7_video_t m_video;
diff --git a/src/mame/includes/fmtowns.h b/src/mame/includes/fmtowns.h
index 8fea8129e8a..c0916921cbe 100644
--- a/src/mame/includes/fmtowns.h
+++ b/src/mame/includes/fmtowns.h
@@ -146,12 +146,12 @@ class towns_state : public driver_device
UINT32 m_towns_ankcg_enable;
UINT32 m_towns_mainmem_enable;
UINT32 m_towns_ram_enable;
- UINT32* m_towns_vram;
- UINT8* m_towns_gfxvram;
- UINT8* m_towns_txtvram;
+ std::unique_ptr<UINT32[]> m_towns_vram;
+ std::unique_ptr<UINT8[]> m_towns_gfxvram;
+ std::unique_ptr<UINT8[]> m_towns_txtvram;
int m_towns_selected_drive;
UINT8 m_towns_fdc_irq6mask;
- UINT8* m_towns_serial_rom;
+ std::unique_ptr<UINT8[]> m_towns_serial_rom;
int m_towns_srom_position;
UINT8 m_towns_srom_clk;
UINT8 m_towns_srom_reset;
diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h
index 562daa42187..8041c7974f3 100644
--- a/src/mame/includes/fromanc2.h
+++ b/src/mame/includes/fromanc2.h
@@ -16,8 +16,8 @@ public:
m_rpalette(*this, "rpalette") { }
/* memory pointers */
- UINT16 *m_videoram[2][4];
- UINT8 *m_bankedram;
+ std::unique_ptr<UINT16[]> m_videoram[2][4];
+ std::unique_ptr<UINT8[]> m_bankedram;
/* video-related */
tilemap_t *m_tilemap[2][4];
diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h
index 30e7b0ec204..d8562d4deb9 100644
--- a/src/mame/includes/fromance.h
+++ b/src/mame/includes/fromance.h
@@ -35,8 +35,8 @@ public:
/* video-related */
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
- UINT8 *m_local_videoram[2];
- UINT8 *m_local_paletteram;
+ std::unique_ptr<UINT8[]> m_local_videoram[2];
+ std::unique_ptr<UINT8[]> m_local_paletteram;
UINT8 m_selected_videoram;
UINT8 m_selected_paletteram;
UINT32 m_scrollx[2];
diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h
index 0ed2a2e7afd..cf1bbf93e65 100644
--- a/src/mame/includes/gaelco3d.h
+++ b/src/mame/includes/gaelco3d.h
@@ -44,8 +44,8 @@ private:
UINT32 m_polygons;
offs_t m_texture_size;
offs_t m_texmask_size;
- UINT8 *m_texture;
- UINT8 *m_texmask;
+ std::unique_ptr<UINT8[]> m_texture;
+ std::unique_ptr<UINT8[]> m_texmask;
void render_noz_noperspective(INT32 scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid);
void render_normal(INT32 scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid);
@@ -97,7 +97,7 @@ public:
offs_t m_adsp_size;
dmadac_sound_device *m_dmadac[SOUND_CHANNELS];
rgb_t *m_palette;
- UINT32 *m_polydata_buffer;
+ std::unique_ptr<UINT32[]> m_polydata_buffer;
UINT32 m_polydata_count;
int m_lastscan;
int m_video_changed;
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index b704281dd41..0702832b67c 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -118,7 +118,7 @@ public:
UINT32 m_star_rng_origin;
UINT32 m_star_rng_origin_frame;
rgb_t m_star_color[64];
- UINT8 *m_stars;
+ std::unique_ptr<UINT8[]> m_stars;
UINT8 m_stars_enabled;
UINT8 m_stars_blink_state;
rgb_t m_bullet_color[8];
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index b7c8d1482d3..dbd741e1d4d 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -75,7 +75,7 @@ public:
UINT8 m_flipscreen_y;
UINT8 m_color_mask;
tilemap_t *m_dambustr_tilemap2;
- UINT8 *m_dambustr_videoram2;
+ std::unique_ptr<UINT8[]> m_dambustr_videoram2;
int m_leftclip;
void (galaxold_state::*m_modify_charcode)(UINT16 *code, UINT8 x); /* function to call to do character banking */
@@ -99,7 +99,7 @@ public:
int m_dambustr_bg_color_2;
int m_dambustr_bg_priority;
int m_dambustr_char_bank;
- bitmap_ind16 *m_dambustr_tmpbitmap;
+ std::unique_ptr<bitmap_ind16> m_dambustr_tmpbitmap;
void (galaxold_state::*m_draw_stars)(bitmap_ind16 &, const rectangle &); /* function to call to draw the star layer */
int m_stars_colors_start;
diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h
index 5861cc7907d..d01d6d969a9 100644
--- a/src/mame/includes/gameplan.h
+++ b/src/mame/includes/gameplan.h
@@ -50,7 +50,7 @@ public:
optional_shared_ptr<UINT8> m_trvquest_question;
/* video state */
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
size_t m_videoram_size;
UINT8 m_video_x;
UINT8 m_video_y;
diff --git a/src/mame/includes/glass.h b/src/mame/includes/glass.h
index e4f4fcbc9d8..4fc0cbe59ee 100644
--- a/src/mame/includes/glass.h
+++ b/src/mame/includes/glass.h
@@ -27,7 +27,7 @@ public:
/* video-related */
tilemap_t *m_pant[2];
- bitmap_ind16 *m_screen_bitmap;
+ std::unique_ptr<bitmap_ind16> m_screen_bitmap;
/* misc */
int m_current_bit;
diff --git a/src/mame/includes/goal92.h b/src/mame/includes/goal92.h
index 9ed63e29827..a1b6a996e0f 100644
--- a/src/mame/includes/goal92.h
+++ b/src/mame/includes/goal92.h
@@ -28,7 +28,7 @@ public:
required_shared_ptr<UINT16> m_tx_data;
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_scrollram;
- UINT16 * m_buffered_spriteram;
+ std::unique_ptr<UINT16[]> m_buffered_spriteram;
/* video-related */
tilemap_t *m_bg_layer;
diff --git a/src/mame/includes/gomoku.h b/src/mame/includes/gomoku.h
index da6f91a9d33..375a08f7f5c 100644
--- a/src/mame/includes/gomoku.h
+++ b/src/mame/includes/gomoku.h
@@ -97,9 +97,9 @@ private:
sound_stream *m_stream;
/* mixer tables and internal buffers */
- INT16 *m_mixer_table;
+ std::unique_ptr<INT16[]> m_mixer_table;
INT16 *m_mixer_lookup;
- short *m_mixer_buffer;
+ std::unique_ptr<short[]> m_mixer_buffer;
short *m_mixer_buffer_2;
UINT8 m_soundregs1[0x20];
diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h
index 630f93646fa..8f539ff234f 100644
--- a/src/mame/includes/gottlieb.h
+++ b/src/mame/includes/gottlieb.h
@@ -76,7 +76,7 @@ public:
UINT8 m_laserdisc_select;
UINT8 m_laserdisc_status;
UINT16 m_laserdisc_philips_code;
- UINT8 *m_laserdisc_audio_buffer;
+ std::unique_ptr<UINT8[]> m_laserdisc_audio_buffer;
UINT16 m_laserdisc_audio_address;
INT16 m_laserdisc_last_samples[2];
attotime m_laserdisc_last_time;
diff --git a/src/mame/includes/gp32.h b/src/mame/includes/gp32.h
index 270d6c5f01d..c2d13dc66c5 100644
--- a/src/mame/includes/gp32.h
+++ b/src/mame/includes/gp32.h
@@ -107,7 +107,7 @@ public:
virtual void video_start() override;
required_shared_ptr<UINT32> m_s3c240x_ram;
- UINT8 *m_eeprom_data;
+ std::unique_ptr<UINT8[]> m_eeprom_data;
UINT32 m_s3c240x_lcd_regs[0x400/4];
emu_timer *m_s3c240x_lcd_timer;
s3c240x_lcd_t m_s3c240x_lcd;
diff --git a/src/mame/includes/gridlee.h b/src/mame/includes/gridlee.h
index 72c7a8f49ac..d776b69b7b6 100644
--- a/src/mame/includes/gridlee.h
+++ b/src/mame/includes/gridlee.h
@@ -41,7 +41,7 @@ public:
UINT8 m_last_analog_input[2];
UINT8 m_last_analog_output[2];
- UINT8 *m_poly17;
+ std::unique_ptr<UINT8[]> m_poly17;
UINT8 *m_rand17;
emu_timer *m_irq_off;
emu_timer *m_irq_timer;
diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h
index 26e96851a80..d35571f41dc 100644
--- a/src/mame/includes/hng64.h
+++ b/src/mame/includes/hng64.h
@@ -118,14 +118,14 @@ public:
hng64_state& state() { return m_state; }
bitmap_rgb32& colorBuffer3d() { return m_colorBuffer3d; }
- float* depthBuffer3d() { return m_depthBuffer3d; }
+ float* depthBuffer3d() { return m_depthBuffer3d.get(); }
private:
hng64_state& m_state;
// (Temporarily class members - someday they will live in the memory map)
bitmap_rgb32 m_colorBuffer3d;
- float* m_depthBuffer3d;
+ std::unique_ptr<float[]> m_depthBuffer3d;
};
@@ -174,7 +174,7 @@ public:
required_shared_ptr<UINT32> m_videoregs;
required_shared_ptr<UINT32> m_tcram;
- UINT16* m_dl;
+ std::unique_ptr<UINT16[]> m_dl;
required_shared_ptr<UINT32> m_3dregs;
required_shared_ptr<UINT32> m_3d_1;
required_shared_ptr<UINT32> m_3d_2;
@@ -188,12 +188,12 @@ public:
int m_mcu_type;
- UINT16 *m_soundram;
- UINT16 *m_soundram2;
+ std::unique_ptr<UINT16[]> m_soundram;
+ std::unique_ptr<UINT16[]> m_soundram2;
/* Communications stuff */
- UINT8 *m_com_op_base;
- UINT8 *m_com_virtual_mem;
+ std::unique_ptr<UINT8[]> m_com_op_base;
+ std::unique_ptr<UINT8[]> m_com_virtual_mem;
UINT8 m_com_shared[8];
INT32 m_dma_start;
@@ -295,7 +295,7 @@ public:
void set_irq(UINT32 irq_vector);
UINT32 m_irq_pending;
UINT8 *m_comm_rom;
- UINT8 *m_comm_ram;
+ std::unique_ptr<UINT8[]> m_comm_ram;
UINT8 m_mmu_regs[8];
UINT32 m_mmua[6];
UINT16 m_mmub[6];
diff --git a/src/mame/includes/hyprduel.h b/src/mame/includes/hyprduel.h
index 718a81b4694..f037f61c555 100644
--- a/src/mame/includes/hyprduel.h
+++ b/src/mame/includes/hyprduel.h
@@ -46,16 +46,16 @@ public:
required_shared_ptr<UINT16> m_videoregs;
required_shared_ptr<UINT16> m_sharedram1;
required_shared_ptr<UINT16> m_sharedram3;
- UINT16 * m_tiletable_old;
+ std::unique_ptr<UINT16[]> m_tiletable_old;
/* video-related */
tilemap_t *m_bg_tilemap[3];
- UINT8 *m_empty_tiles;
- UINT8 *m_dirtyindex;
+ std::unique_ptr<UINT8[]> m_empty_tiles;
+ std::unique_ptr<UINT8[]> m_dirtyindex;
int m_sprite_xoffs;
int m_sprite_yoffs;
int m_sprite_yoffs_sub;
- UINT8 * m_expanded_gfx1;
+ std::unique_ptr<UINT8[]> m_expanded_gfx1;
/* misc */
emu_timer *m_magerror_irq_timer;
diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h
index 3c2d3b05e1e..a2fc05d6fea 100644
--- a/src/mame/includes/irobot.h
+++ b/src/mame/includes/irobot.h
@@ -61,8 +61,8 @@ public:
const irmb_ops *m_irmb_stack[16];
UINT32 m_irmb_regs[16];
UINT32 m_irmb_latch;
- UINT8 *m_polybitmap1;
- UINT8 *m_polybitmap2;
+ std::unique_ptr<UINT8[]> m_polybitmap1;
+ std::unique_ptr<UINT8[]> m_polybitmap2;
int m_ir_xmin;
int m_ir_ymin;
int m_ir_xmax;
diff --git a/src/mame/includes/itech32.h b/src/mame/includes/itech32.h
index 257def50b98..303887fcdd9 100644
--- a/src/mame/includes/itech32.h
+++ b/src/mame/includes/itech32.h
@@ -47,7 +47,7 @@ public:
void nvram_init(nvram_device &nvram, void *base, size_t length);
- UINT16 *m_videoram;
+ std::unique_ptr<UINT16[]> m_videoram;
UINT8 m_vint_state;
UINT8 m_xint_state;
UINT8 m_qint_state;
diff --git a/src/mame/includes/kangaroo.h b/src/mame/includes/kangaroo.h
index 3627dc4f47a..2b73a14c28e 100644
--- a/src/mame/includes/kangaroo.h
+++ b/src/mame/includes/kangaroo.h
@@ -21,7 +21,7 @@ public:
required_shared_ptr<UINT8> m_video_control;
/* video-related */
- UINT32 *m_videoram;
+ std::unique_ptr<UINT32[]> m_videoram;
/* misc */
UINT8 m_mcu_clock;
diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h
index 2af9e810f91..12d44893b99 100644
--- a/src/mame/includes/karnov.h
+++ b/src/mame/includes/karnov.h
@@ -39,7 +39,7 @@ public:
required_device<palette_device> m_palette;
/* video-related */
- bitmap_ind16 *m_bitmap_f;
+ std::unique_ptr<bitmap_ind16> m_bitmap_f;
tilemap_t *m_fix_tilemap;
int m_flipscreen;
UINT16 m_scroll[2];
diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h
index 8e951214bbf..63cdd7af37d 100644
--- a/src/mame/includes/konamigx.h
+++ b/src/mame/includes/konamigx.h
@@ -222,7 +222,8 @@ public:
UINT16 m_gx_wrport2;
// 2nd-Tier GX/MW Graphics Variables
- UINT8 *m_gx_objzbuf, *m_gx_shdzbuf;
+ UINT8 *m_gx_objzbuf;
+ std::unique_ptr<UINT8[]> m_gx_shdzbuf;
int m_layer_colorbase[4];
INT32 m_gx_tilebanks[8], m_gx_oldbanks[8];
int m_gx_tilemode, m_gx_rozenable, m_psac_colorbase, m_last_psac_colorbase;
@@ -230,12 +231,12 @@ public:
int m_gx_rushingheroes_hack;
tilemap_t *m_gx_psac_tilemap, *m_gx_psac_tilemap2;
- bitmap_ind16 *m_type3_roz_temp_bitmap;
+ std::unique_ptr<bitmap_ind16> m_type3_roz_temp_bitmap;
tilemap_t *m_gx_psac_tilemap_alt;
int m_konamigx_has_dual_screen;
int m_konamigx_palformat;
- bitmap_rgb32 *m_dualscreen_left_tempbitmap;
- bitmap_rgb32 *m_dualscreen_right_tempbitmap;
+ std::unique_ptr<bitmap_rgb32> m_dualscreen_left_tempbitmap;
+ std::unique_ptr<bitmap_rgb32> m_dualscreen_right_tempbitmap;
/* On Type-1 the K053936 output is rendered to these temporary bitmaps as raw data
the 'voxel' effect to give the pixels height is a post-process operation on the
@@ -253,8 +254,8 @@ public:
*/
- bitmap_ind16 *m_gxtype1_roz_dstbitmap;
- bitmap_ind16 *m_gxtype1_roz_dstbitmap2;
+ std::unique_ptr<bitmap_ind16> m_gxtype1_roz_dstbitmap;
+ std::unique_ptr<bitmap_ind16> m_gxtype1_roz_dstbitmap2;
rectangle m_gxtype1_roz_dstbitmapclip;
int m_konamigx_type3_psac2_actual_bank;
diff --git a/src/mame/includes/ladyfrog.h b/src/mame/includes/ladyfrog.h
index 293b964d39c..24a085410d8 100644
--- a/src/mame/includes/ladyfrog.h
+++ b/src/mame/includes/ladyfrog.h
@@ -23,7 +23,7 @@ public:
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
- UINT8 * m_spriteram;
+ std::unique_ptr<UINT8[]> m_spriteram;
required_shared_ptr<UINT8> m_scrlram;
std::vector<UINT8> m_paletteram;
std::vector<UINT8> m_paletteram_ext;
diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h
index ed64c30b16c..5bf076fdf5d 100644
--- a/src/mame/includes/legionna.h
+++ b/src/mame/includes/legionna.h
@@ -32,7 +32,7 @@ public:
UINT16* m_fore_data;
UINT16* m_mid_data;
UINT16* m_textram;
- UINT16 *m_scrollram16;
+ std::unique_ptr<UINT16[]> m_scrollram16;
UINT16 m_layer_disable;
int m_sprite_xoffs;
int m_sprite_yoffs;
diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h
index cd0a8684463..464344e2f1c 100644
--- a/src/mame/includes/leland.h
+++ b/src/mame/includes/leland.h
@@ -78,7 +78,7 @@ public:
UINT32 m_xrom2_addr;
UINT8 m_battery_ram_enable;
UINT8 *m_battery_ram;
- UINT8 *m_extra_tram;
+ std::unique_ptr<UINT8[]> m_extra_tram;
UINT8 *m_video_ram;
struct vram_state_data m_vram_state[2];
UINT16 m_xscroll;
diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h
index e9e519d8d56..eb501e82122 100644
--- a/src/mame/includes/lethalj.h
+++ b/src/mame/includes/lethalj.h
@@ -39,7 +39,7 @@ public:
optional_ioport m_light1_y;
UINT16 m_blitter_data[8];
- UINT16 *m_screenram;
+ std::unique_ptr<UINT16[]> m_screenram;
UINT8 m_vispage;
UINT16 *m_blitter_base;
int m_blitter_rows;
diff --git a/src/mame/includes/liberate.h b/src/mame/includes/liberate.h
index c86a926b090..e2820cdd23d 100644
--- a/src/mame/includes/liberate.h
+++ b/src/mame/includes/liberate.h
@@ -23,7 +23,7 @@ public:
optional_shared_ptr<UINT8> m_scratchram;
UINT8 *m_fg_gfx; /* prosoccr */
- UINT8 *m_charram; /* prosoccr */
+ std::unique_ptr<UINT8[]> m_charram; /* prosoccr */
UINT8 m_io_ram[16];
int m_bank;
diff --git a/src/mame/includes/lisa.h b/src/mame/includes/lisa.h
index 7a54062802c..ae17f172ba7 100644
--- a/src/mame/includes/lisa.h
+++ b/src/mame/includes/lisa.h
@@ -161,7 +161,7 @@ public:
UINT16 m_mem_err_addr_latch;
int m_parity_error_pending;
int m_bad_parity_count;
- UINT8 *m_bad_parity_table;
+ std::unique_ptr<UINT8[]> m_bad_parity_table;
int m_VTMSK;
int m_VTIR;
UINT16 m_video_address_latch;
diff --git a/src/mame/includes/lockon.h b/src/mame/includes/lockon.h
index 89fd0d1258e..86407bd3671 100644
--- a/src/mame/includes/lockon.h
+++ b/src/mame/includes/lockon.h
@@ -55,8 +55,8 @@ public:
UINT8 m_ground_ctrl;
UINT16 m_scroll_h;
UINT16 m_scroll_v;
- bitmap_ind16 *m_front_buffer;
- bitmap_ind16 *m_back_buffer;
+ std::unique_ptr<bitmap_ind16> m_front_buffer;
+ std::unique_ptr<bitmap_ind16> m_back_buffer;
emu_timer *m_bufend_timer;
emu_timer *m_cursor_timer;
@@ -72,7 +72,7 @@ public:
/* Object palette RAM control */
UINT32 m_iden;
- UINT8 *m_obj_pal_ram;
+ std::unique_ptr<UINT8[]> m_obj_pal_ram;
UINT32 m_obj_pal_latch;
UINT32 m_obj_pal_addr;
diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h
index c381e474a8e..fbc1b57227e 100644
--- a/src/mame/includes/lordgun.h
+++ b/src/mame/includes/lordgun.h
@@ -56,7 +56,7 @@ public:
int m_whitescreen;
lordgun_gun_data m_gun[2];
tilemap_t *m_tilemap[4];
- bitmap_ind16 *m_bitmaps[5];
+ std::unique_ptr<bitmap_ind16> m_bitmaps[5];
UINT16 m_protection_data;
DECLARE_WRITE16_MEMBER(lordgun_protection_w);
diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h
index 4c74265c2a7..0d23479e856 100644
--- a/src/mame/includes/m72.h
+++ b/src/mame/includes/m72.h
@@ -69,12 +69,12 @@ public:
required_shared_ptr<UINT16> m_generic_paletteram2_16;
optional_device<pic8259_device> m_upd71059c;
- UINT16 *m_protection_ram;
+ std::unique_ptr<UINT16[]> m_protection_ram;
emu_timer *m_scanline_timer;
const UINT8 *m_protection_code;
const UINT8 *m_protection_crc;
UINT32 m_raster_irq_position;
- UINT16 *m_buffered_spriteram;
+ std::unique_ptr<UINT16[]> m_buffered_spriteram;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
tilemap_t *m_bg_tilemap_large;
diff --git a/src/mame/includes/madalien.h b/src/mame/includes/madalien.h
index b0fbb2a6a15..475823d53a9 100644
--- a/src/mame/includes/madalien.h
+++ b/src/mame/includes/madalien.h
@@ -49,7 +49,7 @@ public:
tilemap_t *m_tilemap_fg;
tilemap_t *m_tilemap_edge1[4];
tilemap_t *m_tilemap_edge2[4];
- bitmap_ind16 *m_headlight_bitmap;
+ std::unique_ptr<bitmap_ind16> m_headlight_bitmap;
DECLARE_READ8_MEMBER(shift_r);
DECLARE_READ8_MEMBER(shift_rev_r);
DECLARE_WRITE8_MEMBER(madalien_output_w);
diff --git a/src/mame/includes/magmax.h b/src/mame/includes/magmax.h
index a74305b1483..36199b3c49c 100644
--- a/src/mame/includes/magmax.h
+++ b/src/mame/includes/magmax.h
@@ -28,7 +28,7 @@ public:
UINT8 m_gain_control;
emu_timer *m_interrupt_timer;
int m_flipscreen;
- UINT32 *m_prom_tab;
+ std::unique_ptr<UINT32[]> m_prom_tab;
bitmap_ind16 m_bitmap;
DECLARE_WRITE16_MEMBER(magmax_sound_w);
DECLARE_READ8_MEMBER(magmax_sound_irq_ack);
diff --git a/src/mame/includes/matmania.h b/src/mame/includes/matmania.h
index 405210b1c55..af41168bed5 100644
--- a/src/mame/includes/matmania.h
+++ b/src/mame/includes/matmania.h
@@ -45,8 +45,8 @@ public:
required_device<palette_device> m_palette;
/* video-related */
- bitmap_ind16 *m_tmpbitmap;
- bitmap_ind16 *m_tmpbitmap2;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap2;
/* maniach 68705 protection */
UINT8 m_port_a_in;
diff --git a/src/mame/includes/mcatadv.h b/src/mame/includes/mcatadv.h
index 77f9b7a74e4..eec74b2df5d 100644
--- a/src/mame/includes/mcatadv.h
+++ b/src/mame/includes/mcatadv.h
@@ -25,7 +25,7 @@ public:
required_shared_ptr<UINT16> m_spriteram;
UINT16 * m_spriteram_old;
required_shared_ptr<UINT16> m_vidregs;
- UINT16 * m_vidregs_old;
+ std::unique_ptr<UINT16[]> m_vidregs_old;
/* video-related */
tilemap_t *m_tilemap1;
diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h
index b30205cb890..6a70543beab 100644
--- a/src/mame/includes/megadriv.h
+++ b/src/mame/includes/megadriv.h
@@ -33,7 +33,7 @@ struct genesis_z80_vars
int z80_is_reset;
int z80_has_bus;
UINT32 z80_bank_addr;
- UINT8* z80_prgram;
+ std::unique_ptr<UINT8[]> z80_prgram;
};
diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h
index 8e153797238..816bcbe0407 100644
--- a/src/mame/includes/megasys1.h
+++ b/src/mame/includes/megasys1.h
@@ -82,10 +82,10 @@ public:
tilemap_t *m_tmap[3];
tilemap_t *m_tilemap[3][2][4];
int m_hardware_type_z;
- UINT16 *m_buffer_objectram;
- UINT16 *m_buffer2_objectram;
- UINT16 *m_buffer_spriteram16;
- UINT16 *m_buffer2_spriteram16;
+ std::unique_ptr<UINT16[]> m_buffer_objectram;
+ std::unique_ptr<UINT16[]> m_buffer2_objectram;
+ std::unique_ptr<UINT16[]> m_buffer_spriteram16;
+ std::unique_ptr<UINT16[]> m_buffer2_spriteram16;
int m_layers_order[16];
int m_mcu_hs;
diff --git a/src/mame/includes/megazone.h b/src/mame/includes/megazone.h
index e133c62cf58..8621b5c90af 100644
--- a/src/mame/includes/megazone.h
+++ b/src/mame/includes/megazone.h
@@ -34,7 +34,7 @@ public:
required_shared_ptr<UINT8> m_spriteram;
/* video-related */
- bitmap_ind16 *m_tmpbitmap;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap;
int m_flipscreen;
/* misc */
diff --git a/src/mame/includes/metlclsh.h b/src/mame/includes/metlclsh.h
index 15e331d3b33..b8783156faa 100644
--- a/src/mame/includes/metlclsh.h
+++ b/src/mame/includes/metlclsh.h
@@ -25,7 +25,7 @@ public:
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_bgram;
required_shared_ptr<UINT8> m_scrollx;
- UINT8 * m_otherram;
+ std::unique_ptr<UINT8[]> m_otherram;
/* video-related */
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index 06301500280..b8e62f0e7d7 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -95,7 +95,7 @@ public:
int m_sprite_yoffs;
int m_sprite_xoffs_dx;
- UINT8 *m_expanded_gfx1;
+ std::unique_ptr<UINT8[]> m_expanded_gfx1;
/* irq_related */
int m_vblank_bit;
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index 369e4020771..cde05482501 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -137,8 +137,8 @@ public:
INT32 m_y_mid;
int m_dpram_bank;
UINT32 m_draw_dpram[1024];
- UINT16 *m_frame_buffers[2];
- UINT16 *m_tmp_buffer;
+ std::unique_ptr<UINT16[]> m_frame_buffers[2];
+ std::unique_ptr<UINT16[]> m_tmp_buffer;
int m_drawing_buffer;
int m_display_buffer;
diff --git a/src/mame/includes/microtan.h b/src/mame/includes/microtan.h
index 0f3f63090f2..c9e990ea472 100644
--- a/src/mame/includes/microtan.h
+++ b/src/mame/includes/microtan.h
@@ -42,7 +42,7 @@ public:
required_shared_ptr<UINT8> m_videoram;
UINT8 m_chunky_graphics;
- UINT8 *m_chunky_buffer;
+ std::unique_ptr<UINT8[]> m_chunky_buffer;
UINT8 m_keypad_column;
UINT8 m_keyboard_ascii;
emu_timer *m_timer;
diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h
index ea17134496b..f3feb79cead 100644
--- a/src/mame/includes/midyunit.h
+++ b/src/mame/includes/midyunit.h
@@ -69,7 +69,7 @@ public:
DECLARE_IOPORT_ARRAY(ports);
- UINT16 *m_cmos_ram;
+ std::unique_ptr<UINT16[]> m_cmos_ram;
UINT32 m_cmos_page;
UINT16 m_prot_result;
UINT16 m_prot_sequence[3];
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index dce16b83fe1..ea8c5c55125 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -92,7 +92,7 @@ public:
UINT16 m_ram_adr;
UINT16 m_ram_latch[2];
UINT16 m_ram_scanadr;
- UINT32 *m_ram_data;
+ std::unique_ptr<UINT32[]> m_ram_data;
float m_tgp_vr_base[4];
int m_puuu;
int m_ccount;
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index 2ec1966e650..4812025c31a 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -125,7 +125,7 @@ public:
UINT64 m_real3d_status;
UINT64 *m_network_ram;
int m_prot_data_ptr;
- UINT32 *m_vrom;
+ std::unique_ptr<UINT32[]> m_vrom;
int m_step;
int m_m3_step;
INT32 m_tap_state;
@@ -144,7 +144,7 @@ public:
UINT64 *m_m3_tile_ram;
UINT32 *m_texture_fifo;
int m_texture_fifo_pos;
- UINT16 *m_texture_ram[2];
+ std::unique_ptr<UINT16[]> m_texture_ram[2];
UINT32 *m_display_list_ram;
UINT32 *m_culling_ram;
UINT32 *m_polygon_ram;
diff --git a/src/mame/includes/ms32.h b/src/mame/includes/ms32.h
index c5d4c9b991a..87fe602a7de 100644
--- a/src/mame/includes/ms32.h
+++ b/src/mame/includes/ms32.h
@@ -37,7 +37,7 @@ public:
optional_shared_ptr<UINT16> m_txram;
optional_shared_ptr<UINT16> m_bgram;
optional_shared_ptr<UINT16> m_f1superb_extraram;
- UINT8 *m_nvram_8;
+ std::unique_ptr<UINT8[]> m_nvram_8;
UINT32 m_to_main;
UINT16 m_irqreq;
tilemap_t *m_tx_tilemap;
diff --git a/src/mame/includes/munchmo.h b/src/mame/includes/munchmo.h
index c3681a03e8b..6606f5591ab 100644
--- a/src/mame/includes/munchmo.h
+++ b/src/mame/includes/munchmo.h
@@ -31,7 +31,7 @@ public:
required_shared_ptr<UINT8> m_vreg;
/* video-related */
- bitmap_ind16 *m_tmpbitmap;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap;
int m_palette_bank;
int m_flipscreen;
diff --git a/src/mame/includes/mz700.h b/src/mame/includes/mz700.h
index a2644f1c0a9..552dd9a20c0 100644
--- a/src/mame/includes/mz700.h
+++ b/src/mame/includes/mz700.h
@@ -91,7 +91,7 @@ private:
int m_mz700_ram_vram; /* 1 if vram is banked in */
/* mz800 specific */
- UINT8 *m_cgram;
+ std::unique_ptr<UINT8[]> m_cgram;
UINT8 *m_p_chargen;
int m_mz700_mode; /* 1 if in mz700 mode */
@@ -105,7 +105,7 @@ private:
int m_centronics_perror;
UINT8 *m_colorram;
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
UINT8 m_speaker_level;
UINT8 m_prev_state;
UINT16 m_mz800_ramaddr;
diff --git a/src/mame/includes/namcofl.h b/src/mame/includes/namcofl.h
index 212fe4169c5..eeb702ae58e 100644
--- a/src/mame/includes/namcofl.h
+++ b/src/mame/includes/namcofl.h
@@ -32,7 +32,7 @@ public:
required_device<cpu_device> m_mcu;
required_device<namco_c116_device> m_c116;
emu_timer *m_raster_interrupt_timer;
- UINT32 *m_workram;
+ std::unique_ptr<UINT32[]> m_workram;
required_shared_ptr<UINT16> m_shareram;
UINT8 m_mcu_port6;
UINT32 m_sprbank;
diff --git a/src/mame/includes/namcos2.h b/src/mame/includes/namcos2.h
index d19968a225c..799e8dabbfd 100644
--- a/src/mame/includes/namcos2.h
+++ b/src/mame/includes/namcos2.h
@@ -129,7 +129,7 @@ public:
int m_mcu_analog_ctrl;
int m_mcu_analog_data;
int m_mcu_analog_complete;
- UINT8 *m_eeprom;
+ std::unique_ptr<UINT8[]> m_eeprom;
UINT16 m_68k_master_C148[0x20];
UINT16 m_68k_slave_C148[0x20];
UINT16 m_68k_gpu_C148[0x20];
diff --git a/src/mame/includes/namcos21.h b/src/mame/includes/namcos21.h
index f34916def5b..2a80cf7e32f 100644
--- a/src/mame/includes/namcos21.h
+++ b/src/mame/includes/namcos21.h
@@ -67,15 +67,15 @@ public:
optional_device<cpu_device> m_dsp;
- UINT8 *m_videoram;
- UINT16 *m_winrun_dspcomram;
+ std::unique_ptr<UINT8[]> m_videoram;
+ std::unique_ptr<UINT16[]> m_winrun_dspcomram;
UINT16 m_winrun_poly_buf[WINRUN_MAX_POLY_PARAM];
int m_winrun_poly_index;
UINT32 m_winrun_pointrom_addr;
int m_winrun_dsp_alive;
UINT16 m_winrun_dspcomram_control[8];
UINT16 m_video_enable;
- UINT8 *m_pointram;
+ std::unique_ptr<UINT8[]> m_pointram;
int m_pointram_idx;
UINT16 m_pointram_control;
dsp_state *m_mpDspState;
@@ -85,10 +85,10 @@ public:
int m_mbPointRomDataAvailable;
int m_irq_enable;
UINT8 m_depthcue[2][0x400];
- UINT16 *m_mpPolyFrameBufferPens;
- UINT16 *m_mpPolyFrameBufferZ;
- UINT16 *m_mpPolyFrameBufferPens2;
- UINT16 *m_mpPolyFrameBufferZ2;
+ std::unique_ptr<UINT16[]> m_mpPolyFrameBufferPens;
+ std::unique_ptr<UINT16[]> m_mpPolyFrameBufferZ;
+ std::unique_ptr<UINT16[]> m_mpPolyFrameBufferPens2;
+ std::unique_ptr<UINT16[]> m_mpPolyFrameBufferZ2;
UINT16 m_winrun_color;
UINT16 m_winrun_gpu_register[0x10/2];
DECLARE_READ16_MEMBER(namcos21_video_enable_r);
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index 9d1ea7b7f7b..d37cd80e234 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -271,9 +271,9 @@ public:
int m_cz_adjust;
namcos22_renderer *m_poly;
UINT16 *m_texture_tilemap;
- UINT8 *m_texture_tileattr;
+ std::unique_ptr<UINT8[]> m_texture_tileattr;
UINT8 *m_texture_tiledata;
- UINT8 *m_texture_ayx_to_pixel;
+ std::unique_ptr<UINT8[]> m_texture_ayx_to_pixel;
UINT16 m_dspram_bank;
UINT16 m_dspram16_latch;
bool m_slave_simulation_active;
@@ -287,8 +287,8 @@ public:
unsigned m_LitSurfaceIndex;
int m_pointrom_size;
INT32 *m_pointrom;
- UINT8 *m_dirtypal;
- bitmap_ind16 *m_mix_bitmap;
+ std::unique_ptr<UINT8[]> m_dirtypal;
+ std::unique_ptr<bitmap_ind16> m_mix_bitmap;
tilemap_t *m_bgtilemap;
int m_mixer_flags;
diff --git a/src/mame/includes/nbmj8688.h b/src/mame/includes/nbmj8688.h
index 911d6c7e86f..8df14b9c0b8 100644
--- a/src/mame/includes/nbmj8688.h
+++ b/src/mame/includes/nbmj8688.h
@@ -41,9 +41,9 @@ public:
int m_gfxflag3;
int m_flipscreen;
int m_screen_refresh;
- bitmap_ind16 *m_tmpbitmap;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap;
UINT16 *m_videoram;
- UINT8 *m_clut;
+ std::unique_ptr<UINT8[]> m_clut;
int m_flipscreen_old;
emu_timer *m_blitter_timer;
diff --git a/src/mame/includes/nbmj8891.h b/src/mame/includes/nbmj8891.h
index cbcbafd3364..6c636e289cb 100644
--- a/src/mame/includes/nbmj8891.h
+++ b/src/mame/includes/nbmj8891.h
@@ -39,10 +39,10 @@ public:
int m_gfxdraw_mode;
bitmap_ind16 m_tmpbitmap0;
bitmap_ind16 m_tmpbitmap1;
- UINT8 *m_videoram0;
- UINT8 *m_videoram1;
- UINT8 *m_palette_ptr;
- UINT8 *m_clut;
+ std::unique_ptr<UINT8[]> m_videoram0;
+ std::unique_ptr<UINT8[]> m_videoram1;
+ std::unique_ptr<UINT8[]> m_palette_ptr;
+ std::unique_ptr<UINT8[]> m_clut;
int m_param_old[0x10];
int m_param_cnt;
int m_flipscreen_old;
diff --git a/src/mame/includes/nbmj8900.h b/src/mame/includes/nbmj8900.h
index 6cf9e74a530..4cef61e01c7 100644
--- a/src/mame/includes/nbmj8900.h
+++ b/src/mame/includes/nbmj8900.h
@@ -41,10 +41,10 @@ public:
int m_screen_width;
bitmap_ind16 m_tmpbitmap0;
bitmap_ind16 m_tmpbitmap1;
- UINT8 *m_videoram0;
- UINT8 *m_videoram1;
- UINT8 *m_palette_ptr;
- UINT8 *m_clut;
+ std::unique_ptr<UINT8[]> m_videoram0;
+ std::unique_ptr<UINT8[]> m_videoram1;
+ std::unique_ptr<UINT8[]> m_palette_ptr;
+ std::unique_ptr<UINT8[]> m_clut;
int m_flipscreen_old;
emu_timer *m_blitter_timer;
diff --git a/src/mame/includes/nbmj8991.h b/src/mame/includes/nbmj8991.h
index 0581dedc41f..74920f3555f 100644
--- a/src/mame/includes/nbmj8991.h
+++ b/src/mame/includes/nbmj8991.h
@@ -42,8 +42,8 @@ public:
int m_clutsel;
int m_screen_refresh;
bitmap_ind16 m_tmpbitmap;
- UINT8 *m_videoram;
- UINT8 *m_clut;
+ std::unique_ptr<UINT8[]> m_videoram;
+ std::unique_ptr<UINT8[]> m_clut;
int m_flipscreen_old;
emu_timer *m_blitter_timer;
diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h
index 6566790f353..0906bc54397 100644
--- a/src/mame/includes/nbmj9195.h
+++ b/src/mame/includes/nbmj9195.h
@@ -69,7 +69,7 @@ public:
bitmap_ind16 m_tmpbitmap[VRAM_MAX];
UINT16 *m_videoram[VRAM_MAX];
UINT16 *m_videoworkram[VRAM_MAX];
- UINT8 *m_clut[VRAM_MAX];
+ std::unique_ptr<UINT8[]> m_clut[VRAM_MAX];
int m_flipscreen_old[VRAM_MAX];
emu_timer *m_blitter_timer;
diff --git a/src/mame/includes/nes.h b/src/mame/includes/nes.h
index 90c3db04aba..b3ba8450829 100644
--- a/src/mame/includes/nes.h
+++ b/src/mame/includes/nes.h
@@ -70,7 +70,7 @@ public:
ioport_port *m_io_disksel;
UINT8 *m_vram;
- UINT8 *m_ciram; //PPU nametable RAM - external to PPU!
+ std::unique_ptr<UINT8[]> m_ciram; //PPU nametable RAM - external to PPU!
required_device<cpu_device> m_maincpu;
required_device<ppu2c0x_device> m_ppu;
diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h
index 6a3dce28bd3..98e65f868c8 100644
--- a/src/mame/includes/niyanpai.h
+++ b/src/mame/includes/niyanpai.h
@@ -49,8 +49,8 @@ public:
bitmap_ind16 m_tmpbitmap[VRAM_MAX];
UINT16 *m_videoram[VRAM_MAX];
UINT16 *m_videoworkram[VRAM_MAX];
- UINT16 *m_palette_ptr;
- UINT8 *m_clut[VRAM_MAX];
+ std::unique_ptr<UINT16[]> m_palette_ptr;
+ std::unique_ptr<UINT8[]> m_clut[VRAM_MAX];
int m_flipscreen_old[VRAM_MAX];
emu_timer *m_blitter_timer;
diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h
index ab9671f6265..fb1683e84d7 100644
--- a/src/mame/includes/nmk16.h
+++ b/src/mame/includes/nmk16.h
@@ -67,7 +67,7 @@ public:
tilemap_t *m_bg_tilemap3;
tilemap_t *m_tx_tilemap;
tilemap_t *m_fg_tilemap;
- bitmap_ind16 *m_background_bitmap;
+ std::unique_ptr<bitmap_ind16> m_background_bitmap;
int m_mustang_bg_xscroll;
UINT8 m_scroll[4];
UINT8 m_scroll_2[4];
diff --git a/src/mame/includes/pacland.h b/src/mame/includes/pacland.h
index 308c26c6b34..9c4eee41deb 100644
--- a/src/mame/includes/pacland.h
+++ b/src/mame/includes/pacland.h
@@ -33,7 +33,7 @@ public:
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
bitmap_ind16 m_fg_bitmap;
- UINT32 *m_transmask[3];
+ std::unique_ptr<UINT32[]> m_transmask[3];
UINT16 m_scroll0;
UINT16 m_scroll1;
UINT8 m_main_irq_mask;
diff --git a/src/mame/includes/pcw.h b/src/mame/includes/pcw.h
index b36b4e1d39e..fb9b35b96e9 100644
--- a/src/mame/includes/pcw.h
+++ b/src/mame/includes/pcw.h
@@ -68,7 +68,7 @@ public:
UINT16 m_printer_pins;
UINT8 m_printer_p2; // MCU port P2 state
UINT32 m_paper_feed; // amount of paper fed through printer, by n/360 inches. One line feed is 61/360in (from the linefeed command in CP/M;s ptr menu)
- bitmap_ind16* m_prn_output;
+ std::unique_ptr<bitmap_ind16> m_prn_output;
UINT8 m_printer_p2_prev;
emu_timer* m_prn_stepper;
emu_timer* m_prn_pins;
diff --git a/src/mame/includes/pecom.h b/src/mame/includes/pecom.h
index d3725031985..c8b9768bb31 100644
--- a/src/mame/includes/pecom.h
+++ b/src/mame/includes/pecom.h
@@ -31,7 +31,7 @@ public:
required_device<cosmac_device> m_cdp1802;
required_device<cdp1869_device> m_cdp1869;
- UINT8 *m_charram; /* character generator ROM */
+ std::unique_ptr<UINT8[]> m_charram; /* character generator ROM */
int m_reset; /* CPU mode */
int m_dma; /* memory refresh DMA */
diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h
index f858005b86c..1c754170b53 100644
--- a/src/mame/includes/pgm.h
+++ b/src/mame/includes/pgm.h
@@ -41,7 +41,7 @@ public:
UINT16 * m_bg_videoram;
UINT16 * m_tx_videoram;
UINT16 * m_rowscrollram;
- UINT8 * m_sprite_a_region;
+ std::unique_ptr<UINT8[]> m_sprite_a_region;
size_t m_sprite_a_region_size;
UINT16 * m_spritebufferram; // buffered spriteram
@@ -316,7 +316,7 @@ public:
}
// svg
int m_svg_ram_sel;
- UINT32 * m_svg_shareram[2]; //for 5585G MACHINE
+ std::unique_ptr<UINT32[]> m_svg_shareram[2]; //for 5585G MACHINE
UINT32 m_svg_latchdata_68k_w;
UINT32 m_svg_latchdata_arm_w;
diff --git a/src/mame/includes/phoenix.h b/src/mame/includes/phoenix.h
index 5acabc38fbb..0f423efea69 100644
--- a/src/mame/includes/phoenix.h
+++ b/src/mame/includes/phoenix.h
@@ -16,7 +16,7 @@ public:
required_device<cpu_device> m_maincpu;
optional_device<pleiads_sound_device> m_pleiads_custom;
required_device<gfxdecode_device> m_gfxdecode;
- UINT8 *m_videoram_pg[2];
+ std::unique_ptr<UINT8[]> m_videoram_pg[2];
UINT8 m_videoram_pg_index;
UINT8 m_palette_bank;
UINT8 m_cocktail_mode;
@@ -103,7 +103,7 @@ private:
struct n_state m_noise_state;
UINT8 m_sound_latch_a;
sound_stream * m_channel;
- UINT32 * m_poly18;
+ std::unique_ptr<UINT32[]> m_poly18;
discrete_device *m_discrete;
tms36xx_device *m_tms;
diff --git a/src/mame/includes/pitnrun.h b/src/mame/includes/pitnrun.h
index 33c9b68288f..91dadd7172e 100644
--- a/src/mame/includes/pitnrun.h
+++ b/src/mame/includes/pitnrun.h
@@ -36,7 +36,7 @@ public:
int m_scroll;
int m_char_bank;
int m_color_select;
- bitmap_ind16 *m_tmp_bitmap[4];
+ std::unique_ptr<bitmap_ind16> m_tmp_bitmap[4];
tilemap_t *m_bg;
tilemap_t *m_fg;
diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h
index c098dd197d1..c69f07cd514 100644
--- a/src/mame/includes/playch10.h
+++ b/src/mame/includes/playch10.h
@@ -50,9 +50,9 @@ public:
int m_MMC2_bank[4];
int m_MMC2_bank_latch[2];
UINT8* m_vrom;
- UINT8* m_vram;
+ std::unique_ptr<UINT8[]> m_vram;
UINT8* m_nametable[4];
- UINT8* m_nt_ram;
+ std::unique_ptr<UINT8[]> m_nt_ram;
chr_bank m_chr_page[8];
int m_mmc1_shiftreg;
int m_mmc1_shiftcount;
diff --git a/src/mame/includes/poisk1.h b/src/mame/includes/poisk1.h
index 3a4a87ced44..57a24f0c052 100644
--- a/src/mame/includes/poisk1.h
+++ b/src/mame/includes/poisk1.h
@@ -69,7 +69,7 @@ public:
struct
{
UINT8 trap[4];
- UINT8 *videoram_base;
+ std::unique_ptr<UINT8[]> videoram_base;
UINT8 *videoram;
UINT8 mode_control_6a;
UINT8 color_select_68;
diff --git a/src/mame/includes/policetr.h b/src/mame/includes/policetr.h
index ab1086c0a4f..9525c9a21a7 100644
--- a/src/mame/includes/policetr.h
+++ b/src/mame/includes/policetr.h
@@ -35,7 +35,7 @@ public:
UINT8 m_palette_data[3];
rectangle m_render_clip;
UINT8 *m_srcbitmap;
- UINT8 *m_dstbitmap;
+ std::unique_ptr<UINT8[]> m_dstbitmap;
UINT16 m_src_xoffs;
UINT16 m_src_yoffs;
UINT16 m_dst_xoffs;
diff --git a/src/mame/includes/popeye.h b/src/mame/includes/popeye.h
index db1bc86809b..c7eee33bf4d 100644
--- a/src/mame/includes/popeye.h
+++ b/src/mame/includes/popeye.h
@@ -23,8 +23,8 @@ public:
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
- UINT8 *m_bitmapram;
- bitmap_ind16 *m_tmpbitmap2;
+ std::unique_ptr<UINT8[]> m_bitmapram;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap2;
UINT8 m_invertmask;
UINT8 m_bitmap_type;
tilemap_t *m_fg_tilemap;
diff --git a/src/mame/includes/psikyo.h b/src/mame/includes/psikyo.h
index 566195eaa09..9d0f2f6b69e 100644
--- a/src/mame/includes/psikyo.h
+++ b/src/mame/includes/psikyo.h
@@ -30,8 +30,8 @@ public:
required_shared_ptr<UINT32> m_vram_1;
required_shared_ptr<UINT32> m_vregs;
optional_shared_ptr<UINT32> m_bootleg_spritebuffer;
- UINT32 * m_spritebuf1;
- UINT32 * m_spritebuf2;
+ std::unique_ptr<UINT32[]> m_spritebuf1;
+ std::unique_ptr<UINT32[]> m_spritebuf2;
/* video-related */
tilemap_t *m_tilemap_0_size0;
diff --git a/src/mame/includes/psikyosh.h b/src/mame/includes/psikyosh.h
index a21f4edda1c..8879191fd29 100644
--- a/src/mame/includes/psikyosh.h
+++ b/src/mame/includes/psikyosh.h
@@ -49,7 +49,7 @@ public:
bitmap_ind8 m_zoom_bitmap;
bitmap_ind16 m_z_bitmap;
bitmap_rgb32 m_bg_bitmap;
- UINT16 *m_bg_zoom;
+ std::unique_ptr<UINT16[]> m_bg_zoom;
UINT8 m_alphatable[256];
/* devices */
diff --git a/src/mame/includes/psion.h b/src/mame/includes/psion.h
index da355b0b386..bf09325add0 100644
--- a/src/mame/includes/psion.h
+++ b/src/mame/includes/psion.h
@@ -60,7 +60,7 @@ public:
// RAM/ROM banks
required_shared_ptr<UINT8> m_ram;
- UINT8 *m_paged_ram;
+ std::unique_ptr<UINT8[]> m_paged_ram;
UINT8 m_rom_bank;
UINT8 m_ram_bank;
UINT8 m_ram_bank_count;
diff --git a/src/mame/includes/quasar.h b/src/mame/includes/quasar.h
index 424312da082..3c8569c4626 100644
--- a/src/mame/includes/quasar.h
+++ b/src/mame/includes/quasar.h
@@ -14,7 +14,7 @@ public:
quasar_state(const machine_config &mconfig, device_type type, const char *tag)
: cvs_state(mconfig, type, tag) { }
- UINT8 * m_effectram;
+ std::unique_ptr<UINT8[]> m_effectram;
UINT8 m_effectcontrol;
UINT8 m_page;
UINT8 m_io_page;
diff --git a/src/mame/includes/quizdna.h b/src/mame/includes/quizdna.h
index e5dbcb74bc3..7d4bf69ac9c 100644
--- a/src/mame/includes/quizdna.h
+++ b/src/mame/includes/quizdna.h
@@ -18,8 +18,8 @@ public:
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_generic_paletteram_8;
- UINT8 *m_bg_ram;
- UINT8 *m_fg_ram;
+ std::unique_ptr<UINT8[]> m_bg_ram;
+ std::unique_ptr<UINT8[]> m_fg_ram;
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
UINT8 m_bg_xscroll[2];
diff --git a/src/mame/includes/radio86.h b/src/mame/includes/radio86.h
index aa39cb1fb07..8985e1692f6 100644
--- a/src/mame/includes/radio86.h
+++ b/src/mame/includes/radio86.h
@@ -59,7 +59,7 @@ public:
UINT8 m_tape_value;
UINT8 m_mikrosha_font_page;
int m_keyboard_mask;
- UINT8* m_radio_ram_disk;
+ std::unique_ptr<UINT8[]> m_radio_ram_disk;
UINT8 m_romdisk_lsb;
UINT8 m_romdisk_msb;
UINT8 m_disk_sel;
diff --git a/src/mame/includes/rbisland.h b/src/mame/includes/rbisland.h
index 02e936f592f..0fa8a251740 100644
--- a/src/mame/includes/rbisland.h
+++ b/src/mame/includes/rbisland.h
@@ -33,7 +33,7 @@ public:
UINT8 m_jumping_latch;
/* c-chip */
- UINT8 *m_CRAM[8];
+ std::unique_ptr<UINT8[]> m_CRAM[8];
int m_extra_version;
UINT8 m_current_bank;
diff --git a/src/mame/includes/realbrk.h b/src/mame/includes/realbrk.h
index 4ed74c5bdd8..4b3c3d9689a 100644
--- a/src/mame/includes/realbrk.h
+++ b/src/mame/includes/realbrk.h
@@ -38,8 +38,8 @@ public:
optional_shared_ptr<UINT16> m_vram_0ras;
optional_shared_ptr<UINT16> m_vram_1ras;
- bitmap_ind16 *m_tmpbitmap0;
- bitmap_ind16 *m_tmpbitmap1;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap0;
+ std::unique_ptr<bitmap_ind16> m_tmpbitmap1;
int m_disable_video;
tilemap_t *m_tilemap_0;
tilemap_t *m_tilemap_1;
diff --git a/src/mame/includes/redalert.h b/src/mame/includes/redalert.h
index 97e6e12d324..c3aeb7be441 100644
--- a/src/mame/includes/redalert.h
+++ b/src/mame/includes/redalert.h
@@ -38,7 +38,7 @@ public:
optional_device<hc55516_device> m_cvsd;
required_device<screen_device> m_screen;
- UINT8 *m_bitmap_colorram;
+ std::unique_ptr<UINT8[]> m_bitmap_colorram;
UINT8 m_control_xor;
DECLARE_READ8_MEMBER(redalert_interrupt_clear_r);
DECLARE_WRITE8_MEMBER(redalert_interrupt_clear_w);
diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h
index b41ad49152b..321a778d689 100644
--- a/src/mame/includes/rltennis.h
+++ b/src/mame/includes/rltennis.h
@@ -29,7 +29,7 @@ public:
INT32 m_sample_rom_offset_2;
INT32 m_offset_shift;
INT32 m_unk_counter;
- bitmap_ind16 *m_tmp_bitmap[RLT_NUM_BITMAPS];
+ std::unique_ptr<bitmap_ind16> m_tmp_bitmap[RLT_NUM_BITMAPS];
UINT8 *m_samples_1;
UINT8 *m_samples_2;
UINT8 *m_gfx;
diff --git a/src/mame/includes/rungun.h b/src/mame/includes/rungun.h
index bc6e45babfd..388e16bb952 100644
--- a/src/mame/includes/rungun.h
+++ b/src/mame/includes/rungun.h
@@ -50,9 +50,9 @@ public:
/* video-related */
tilemap_t *m_ttl_tilemap[2];
tilemap_t *m_936_tilemap[2];
- UINT16 *m_psac2_vram;
- UINT16 *m_ttl_vram;
- UINT16 *m_pal_ram;
+ std::unique_ptr<UINT16[]> m_psac2_vram;
+ std::unique_ptr<UINT16[]> m_ttl_vram;
+ std::unique_ptr<UINT16[]> m_pal_ram;
UINT8 m_current_display_bank;
int m_ttl_gfx_index;
int m_sprite_colorbase;
diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h
index b5d65e4b258..2648ce25237 100644
--- a/src/mame/includes/scramble.h
+++ b/src/mame/includes/scramble.h
@@ -33,8 +33,8 @@ public:
UINT8 m_harem_decrypt_bit;
UINT8 m_harem_decrypt_clk;
UINT8 m_harem_decrypt_count;
- UINT8 *m_harem_decrypted_data;
- UINT8 *m_harem_decrypted_opcodes;
+ std::unique_ptr<UINT8[]> m_harem_decrypted_data;
+ std::unique_ptr<UINT8[]> m_harem_decrypted_opcodes;
DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_custom_r);
DECLARE_CUSTOM_INPUT_MEMBER(ckongs_coinage_r);
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index ab580bde8d3..76a5f8fd161 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -75,7 +75,7 @@ public:
sys32_output_callback m_sw1_output;
sys32_output_callback m_sw2_output;
sys32_output_callback m_sw3_output;
- UINT16 *m_system32_protram;
+ std::unique_ptr<UINT16[]> m_system32_protram;
UINT16 m_system32_displayenable[2];
UINT16 m_system32_tilebank_external;
UINT16 m_arescue_dsp_io[6];
@@ -83,12 +83,12 @@ public:
struct cache_entry *m_cache_head;
struct layer_info m_layer_data[11];
UINT16 m_mixer_control[2][0x40];
- UINT16 *m_solid_0000;
- UINT16 *m_solid_ffff;
+ std::unique_ptr<UINT16[]> m_solid_0000;
+ std::unique_ptr<UINT16[]> m_solid_ffff;
UINT8 m_sprite_render_count;
UINT8 m_sprite_control_latched[8];
UINT8 m_sprite_control[8];
- UINT32 *m_spriteram_32bit;
+ std::unique_ptr<UINT32[]> m_spriteram_32bit;
typedef void (segas32_state::*prot_vblank_func)();
prot_vblank_func m_system32_prot_vblank;
int m_print_count;
diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h
index 00a33d0c505..1c48610d9e9 100644
--- a/src/mame/includes/seta2.h
+++ b/src/mame/includes/seta2.h
@@ -40,7 +40,7 @@ public:
int m_xoffset;
int m_yoffset;
int m_keyboard_row;
- UINT16 *m_buffered_spriteram;
+ std::unique_ptr<UINT16[]> m_buffered_spriteram;
UINT64 m_funcube_coin_start_cycles;
UINT8 m_funcube_hopper_motor;
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h
index 10f2b6120bc..82ce0cba31b 100644
--- a/src/mame/includes/shadfrce.h
+++ b/src/mame/includes/shadfrce.h
@@ -47,7 +47,7 @@ public:
required_shared_ptr<UINT16> m_bg1videoram;
required_shared_ptr<UINT16> m_spvideoram;
- UINT16 *m_spvideoram_old;
+ std::unique_ptr<UINT16[]> m_spvideoram_old;
tilemap_t *m_fgtilemap;
tilemap_t *m_bg0tilemap;
tilemap_t *m_bg1tilemap;
diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h
index 35eff83f330..6a200b524ab 100644
--- a/src/mame/includes/slapshot.h
+++ b/src/mame/includes/slapshot.h
@@ -53,8 +53,8 @@ public:
/* memory pointers */
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_spriteext;
- UINT16 * m_spriteram_buffered;
- UINT16 * m_spriteram_delayed;
+ std::unique_ptr<UINT16[]> m_spriteram_buffered;
+ std::unique_ptr<UINT16[]> m_spriteram_delayed;
/* video-related */
struct slapshot_tempsprite *m_spritelist;
diff --git a/src/mame/includes/sms.h b/src/mame/includes/sms.h
index 541e298b4d0..6fc09d3f1d9 100644
--- a/src/mame/includes/sms.h
+++ b/src/mame/includes/sms.h
@@ -100,7 +100,7 @@ public:
bitmap_rgb32 m_gg_sms_mode_bitmap;
// line_buffer will be used to hold 4 lines of line data as a kind of cache for
// vertical scaling in the gamegear sms compatibility mode.
- int *m_line_buffer;
+ std::unique_ptr<int[]> m_line_buffer;
// model identifiers
UINT8 m_is_gamegear;
diff --git a/src/mame/includes/spacefb.h b/src/mame/includes/spacefb.h
index f78e84dfa32..4bd39f33338 100644
--- a/src/mame/includes/spacefb.h
+++ b/src/mame/includes/spacefb.h
@@ -46,7 +46,7 @@ public:
UINT8 m_sound_latch;
emu_timer *m_interrupt_timer;
- UINT8 *m_object_present_map;
+ std::unique_ptr<UINT8[]> m_object_present_map;
UINT8 m_port_0;
UINT8 m_port_2;
UINT32 m_star_shift_reg;
diff --git a/src/mame/includes/special.h b/src/mame/includes/special.h
index bd0ec55385a..6c9a369b922 100644
--- a/src/mame/includes/special.h
+++ b/src/mame/includes/special.h
@@ -86,7 +86,7 @@ public:
DECLARE_WRITE8_MEMBER(specialist_8255_portc_w);
void specimx_set_bank(offs_t i, UINT8 data);
void erik_set_bank();
- UINT8 *m_specimx_colorram;
+ std::unique_ptr<UINT8[]> m_specimx_colorram;
UINT8 m_erik_color_1;
UINT8 m_erik_color_2;
UINT8 m_erik_background;
diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h
index 7f126a606a7..f17223aca95 100644
--- a/src/mame/includes/ssrj.h
+++ b/src/mame/includes/ssrj.h
@@ -28,7 +28,7 @@ public:
tilemap_t *m_tilemap1;
tilemap_t *m_tilemap2;
tilemap_t *m_tilemap4;
- UINT8 *m_buffer_spriteram;
+ std::unique_ptr<UINT8[]> m_buffer_spriteram;
DECLARE_READ8_MEMBER(wheel_r);
DECLARE_WRITE8_MEMBER(vram1_w);
diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h
index 21393b2ee70..e3d4dff7688 100644
--- a/src/mame/includes/ssv.h
+++ b/src/mame/includes/ssv.h
@@ -59,7 +59,7 @@ public:
int m_shadow_pen_shift;
UINT8 m_requested_int;
UINT16 m_irq_enable;
- UINT16 *m_eaglshot_gfxram;
+ std::unique_ptr<UINT16[]> m_eaglshot_gfxram;
tilemap_t *m_gdfs_tmap;
int m_interrupt_ultrax;
int m_gdfs_lightgun_select;
diff --git a/src/mame/includes/ssystem3.h b/src/mame/includes/ssystem3.h
index 4a98f1175cc..79a5e7d4591 100644
--- a/src/mame/includes/ssystem3.h
+++ b/src/mame/includes/ssystem3.h
@@ -69,7 +69,7 @@ public:
private:
UINT8 m_porta;
- UINT8 *m_videoram;
+ std::unique_ptr<UINT8[]> m_videoram;
playfield_t m_playfield;
lcd_t m_lcd;
diff --git a/src/mame/includes/starcrus.h b/src/mame/includes/starcrus.h
index 73665c6da10..3de1b75301f 100644
--- a/src/mame/includes/starcrus.h
+++ b/src/mame/includes/starcrus.h
@@ -16,10 +16,10 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- bitmap_ind16 *m_ship1_vid;
- bitmap_ind16 *m_ship2_vid;
- bitmap_ind16 *m_proj1_vid;
- bitmap_ind16 *m_proj2_vid;
+ std::unique_ptr<bitmap_ind16> m_ship1_vid;
+ std::unique_ptr<bitmap_ind16> m_ship2_vid;
+ std::unique_ptr<bitmap_ind16> m_proj1_vid;
+ std::unique_ptr<bitmap_ind16> m_proj2_vid;
int m_s1_x;
int m_s1_y;
diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h
index 3de371cebd3..324c790db41 100644
--- a/src/mame/includes/starshp1.h
+++ b/src/mame/includes/starshp1.h
@@ -68,7 +68,7 @@ public:
int m_starfield_kill;
int m_mux;
int m_inverse;
- UINT16 *m_LSFR;
+ std::unique_ptr<UINT16[]> m_LSFR;
bitmap_ind16 m_helper;
tilemap_t *m_bg_tilemap;
DECLARE_WRITE8_MEMBER(starshp1_collision_reset_w);
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index 24a295da6de..6baec75153a 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -39,9 +39,9 @@ public:
UINT16 m_quotient_shift;
UINT16 m_divisor;
UINT16 m_dividend;
- UINT8 *m_PROM_STR;
- UINT8 *m_PROM_MAS;
- UINT8 *m_PROM_AM;
+ std::unique_ptr<UINT8[]> m_PROM_STR;
+ std::unique_ptr<UINT8[]> m_PROM_MAS;
+ std::unique_ptr<UINT8[]> m_PROM_AM;
int m_math_run;
emu_timer *m_math_timer;
INT16 m_A;
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index 4655c3648b0..1c317f7b805 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -49,9 +49,9 @@ public:
optional_ioport m_fake_comms;
memory_region *m_cart_reg[4];
- UINT8 *m_backupram;
- UINT32 *m_scu_regs;
- UINT16 *m_scsp_regs;
+ std::unique_ptr<UINT8[]> m_backupram;
+ std::unique_ptr<UINT32[]> m_scu_regs;
+ std::unique_ptr<UINT16[]> m_scsp_regs;
UINT16 *m_vdp2_regs;
UINT32 *m_vdp2_vram;
UINT32 *m_vdp2_cram;
@@ -96,9 +96,9 @@ public:
int framebuffer_clear_on_next_frame;
rectangle system_cliprect;
rectangle user_cliprect;
- UINT16 *framebuffer[2];
+ std::unique_ptr<UINT16[]> framebuffer[2];
UINT16 **framebuffer_draw_lines;
- UINT8 *gfx_decode;
+ std::unique_ptr<UINT8[]> gfx_decode;
UINT16 lopr;
UINT16 copr;
UINT16 ewdr;
@@ -108,7 +108,7 @@ public:
}m_vdp1;
struct {
- UINT8 *gfx_decode;
+ std::unique_ptr<UINT8[]> gfx_decode;
bitmap_rgb32 roz_bitmap[2];
UINT8 dotsel;
UINT8 pal;
diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h
index 76d88acbc83..d7f7ed7d029 100644
--- a/src/mame/includes/suna16.h
+++ b/src/mame/includes/suna16.h
@@ -39,7 +39,7 @@ public:
optional_memory_bank m_bank2;
- UINT16 *m_paletteram;
+ std::unique_ptr<UINT16[]> m_paletteram;
int m_color_bank;
UINT8 m_prot;
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index 97067103bc3..0f3055c0b21 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -67,7 +67,7 @@ public:
bool m_has_text; // has text sprites (older games)
// samples
- INT16 *m_samplebuf;
+ std::unique_ptr<INT16[]> m_samplebuf;
int m_sample, m_play;
int m_numsamples;
diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h
index ede28fa498e..82729e52e86 100644
--- a/src/mame/includes/superqix.h
+++ b/src/mame/includes/superqix.h
@@ -27,7 +27,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- INT16 *m_samplebuf;
+ std::unique_ptr<INT16[]> m_samplebuf;
UINT8 m_port1;
UINT8 m_port2;
UINT8 m_port3;
@@ -45,7 +45,7 @@ public:
UINT8 m_portC;
int m_curr_player;
int m_gfxbank;
- bitmap_ind16 *m_fg_bitmap[2];
+ std::unique_ptr<bitmap_ind16> m_fg_bitmap[2];
int m_show_bitmap;
tilemap_t *m_bg_tilemap;
UINT8 m_nmi_mask;
diff --git a/src/mame/includes/svi318.h b/src/mame/includes/svi318.h
index ce486816850..1e0fc0d0d30 100644
--- a/src/mame/includes/svi318.h
+++ b/src/mame/includes/svi318.h
@@ -131,7 +131,7 @@ private:
UINT8 m_bank_high1_read_only;
UINT8 m_bank_high2_read_only;
- UINT8 *m_empty_bank;
+ std::unique_ptr<UINT8[]> m_empty_bank;
UINT8 *m_bank_low_ptr;
UINT8 *m_bank_high1_ptr;
UINT8 *m_bank_high2_ptr;
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index d62450c965e..24661f07012 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -151,5 +151,5 @@ public:
optional_memory_bank m_bank0d;
optional_memory_bank m_bank1d;
- UINT8 *m_banked_decrypted_opcodes;
+ std::unique_ptr<UINT8[]> m_banked_decrypted_opcodes;
};
diff --git a/src/mame/includes/taito_b.h b/src/mame/includes/taito_b.h
index 5f38bce46ae..c9e325e625d 100644
--- a/src/mame/includes/taito_b.h
+++ b/src/mame/includes/taito_b.h
@@ -45,9 +45,9 @@ public:
/* video-related */
/* framebuffer is a raw bitmap, remapped as a last step */
- bitmap_ind16 *m_framebuffer[2];
- bitmap_ind16 *m_pixel_bitmap;
- bitmap_ind16 *m_realpunc_bitmap;
+ std::unique_ptr<bitmap_ind16> m_framebuffer[2];
+ std::unique_ptr<bitmap_ind16> m_pixel_bitmap;
+ std::unique_ptr<bitmap_ind16> m_realpunc_bitmap;
UINT16 m_pixel_scroll[2];
diff --git a/src/mame/includes/taito_f3.h b/src/mame/includes/taito_f3.h
index e33c1dce538..30d3fd67589 100644
--- a/src/mame/includes/taito_f3.h
+++ b/src/mame/includes/taito_f3.h
@@ -101,7 +101,7 @@ public:
tilemap_t *m_pf8_tilemap;
tilemap_t *m_pixel_layer;
tilemap_t *m_vram_layer;
- UINT16 *m_spriteram16_buffered;
+ std::unique_ptr<UINT16[]> m_spriteram16_buffered;
UINT16 m_f3_control_0[8];
UINT16 m_f3_control_1[8];
int m_flipscreen;
@@ -131,8 +131,8 @@ public:
int m_width_mask;
int m_twidth_mask;
int m_twidth_mask_bit;
- UINT8 *m_tile_opaque_sp;
- UINT8 *m_tile_opaque_pf[8];
+ std::unique_ptr<UINT8[]> m_tile_opaque_sp;
+ std::unique_ptr<UINT8[]> m_tile_opaque_pf[8];
UINT8 m_add_sat[256][256];
int m_alpha_s_1_1;
int m_alpha_s_1_2;
diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h
index 17400d7fa3c..c5eac6777d4 100644
--- a/src/mame/includes/taitoair.h
+++ b/src/mame/includes/taitoair.h
@@ -67,7 +67,7 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- bitmap_ind16 *m_framebuffer[2];
+ std::unique_ptr<bitmap_ind16> m_framebuffer[2];
/* 3d info */
INT16 m_frustumLeft;
diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h
index e4ee95a64d6..813324a7cac 100644
--- a/src/mame/includes/taitojc.h
+++ b/src/mame/includes/taitojc.h
@@ -99,7 +99,7 @@ public:
INT16 m_projection_data[3];
INT16 m_intersection_data[3];
- UINT8 *m_texture;
+ std::unique_ptr<UINT8[]> m_texture;
bitmap_ind16 m_framebuffer;
bitmap_ind16 m_zbuffer;
@@ -109,7 +109,7 @@ public:
UINT32 *m_tile_ram;
tilemap_t *m_tilemap;
- UINT16 *m_polygon_fifo;
+ std::unique_ptr<UINT16[]> m_polygon_fifo;
int m_polygon_fifo_ptr;
UINT8 m_mcu_comm_main;
diff --git a/src/mame/includes/taotaido.h b/src/mame/includes/taotaido.h
index 3db0c50bac7..3c7e566469c 100644
--- a/src/mame/includes/taotaido.h
+++ b/src/mame/includes/taotaido.h
@@ -28,10 +28,10 @@ public:
UINT16 m_sprite_character_bank_select[8];
UINT16 m_video_bank_select[8];
tilemap_t *m_bg_tilemap;
- UINT16 *m_spriteram_old;
- UINT16 *m_spriteram_older;
- UINT16 *m_spriteram2_old;
- UINT16 *m_spriteram2_older;
+ std::unique_ptr<UINT16[]> m_spriteram_old;
+ std::unique_ptr<UINT16[]> m_spriteram_older;
+ std::unique_ptr<UINT16[]> m_spriteram2_old;
+ std::unique_ptr<UINT16[]> m_spriteram2_older;
DECLARE_READ16_MEMBER(pending_command_r);
DECLARE_WRITE16_MEMBER(sound_command_w);
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index a8eb74d90fd..2fe7083a416 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -79,9 +79,9 @@ public:
tilemap_t *m_layer2;
tilemap_t *m_layer3;
bitmap_rgb32 m_temp_bitmap;
- UINT8 *m_apache3_road_x_ram;
+ std::unique_ptr<UINT8[]> m_apache3_road_x_ram;
UINT8 m_apache3_road_z;
- UINT16* m_roundup5_vram;
+ std::unique_ptr<UINT16[]> m_roundup5_vram;
UINT16 m_bigfight_bank;
UINT16 m_bigfight_last_bank;
UINT8 m_roundupt_crt_selected_reg;
diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h
index ee2aaeff6bc..9f65ee2fa19 100644
--- a/src/mame/includes/tetrisp2.h
+++ b/src/mame/includes/tetrisp2.h
@@ -45,7 +45,7 @@ public:
required_shared_ptr<UINT16> m_scroll_fg;
required_shared_ptr<UINT16> m_scroll_bg;
required_shared_ptr<UINT16> m_rotregs;
- UINT8 *m_priority;
+ std::unique_ptr<UINT8[]> m_priority;
optional_shared_ptr<UINT16> m_rocknms_sub_priority;
optional_shared_ptr<UINT16> m_rocknms_sub_vram_rot;
optional_shared_ptr<UINT16> m_rocknms_sub_vram_fg;
diff --git a/src/mame/includes/thief.h b/src/mame/includes/thief.h
index 96fa495667c..03e8d2b6ae3 100644
--- a/src/mame/includes/thief.h
+++ b/src/mame/includes/thief.h
@@ -4,9 +4,9 @@
#include "video/tms9927.h"
struct coprocessor_t {
- UINT8 *context_ram;
+ std::unique_ptr<UINT8[]> context_ram;
UINT8 bank;
- UINT8 *image_ram;
+ std::unique_ptr<UINT8[]> image_ram;
UINT8 param[0x9];
};
diff --git a/src/mame/includes/thoop2.h b/src/mame/includes/thoop2.h
index 643b8fef85a..066f4ffbde2 100644
--- a/src/mame/includes/thoop2.h
+++ b/src/mame/includes/thoop2.h
@@ -16,7 +16,7 @@ public:
required_shared_ptr<UINT16> m_vregs;
required_shared_ptr<UINT16> m_spriteram;
int m_sprite_count[5];
- int *m_sprite_table[5];
+ std::unique_ptr<int[]> m_sprite_table[5];
tilemap_t *m_pant[2];
DECLARE_WRITE16_MEMBER(OKIM6295_bankswitch_w);
DECLARE_WRITE16_MEMBER(thoop2_coin_w);
diff --git a/src/mame/includes/ti85.h b/src/mame/includes/ti85.h
index 00a7e1145c8..b4a738d3e11 100644
--- a/src/mame/includes/ti85.h
+++ b/src/mame/includes/ti85.h
@@ -100,7 +100,7 @@ public:
UINT8 m_interrupt_speed;
UINT8 m_port4_bit0;
UINT8 m_ti81_port_7_data;
- UINT8 *m_ti8x_ram;
+ std::unique_ptr<UINT8[]> m_ti8x_ram;
UINT8 m_PCR;
UINT8 m_red_out;
UINT8 m_white_out;
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index 8cfde271a57..2c8e5654ae9 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -72,7 +72,7 @@ public:
optional_ioport m_an2;
/* sound-related */
- INT16 *m_sampledata[MAX_SAMPLES];
+ std::unique_ptr<INT16[]> m_sampledata[MAX_SAMPLES];
int m_samplesize[MAX_SAMPLES];
/* misc / mcu */
diff --git a/src/mame/includes/tryout.h b/src/mame/includes/tryout.h
index 90731fa74b6..e2ef35ded3e 100644
--- a/src/mame/includes/tryout.h
+++ b/src/mame/includes/tryout.h
@@ -27,8 +27,8 @@ public:
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
UINT8 m_vram_bank;
- UINT8 *m_vram;
- UINT8 *m_vram_gfx;
+ std::unique_ptr<UINT8[]> m_vram;
+ std::unique_ptr<UINT8[]> m_vram_gfx;
DECLARE_WRITE8_MEMBER(nmi_ack_w);
DECLARE_WRITE8_MEMBER(sound_w);
diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h
index e94873e988b..a967f970ea7 100644
--- a/src/mame/includes/tubep.h
+++ b/src/mame/includes/tubep.h
@@ -34,7 +34,7 @@ public:
optional_shared_ptr<UINT8> m_backgroundram;
required_shared_ptr<UINT8> m_sprite_colorsharedram;
optional_shared_ptr<UINT8> m_rjammer_backgroundram;
- UINT8 *m_spritemap;
+ std::unique_ptr<UINT8[]> m_spritemap;
UINT8 m_prom2[32];
UINT32 m_romD_addr;
UINT32 m_romEF_addr;
diff --git a/src/mame/includes/turbo.h b/src/mame/includes/turbo.h
index c982ca3b7e4..a4efd6c97e4 100644
--- a/src/mame/includes/turbo.h
+++ b/src/mame/includes/turbo.h
@@ -63,7 +63,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
- UINT8 * m_buckrog_bitmap_ram;
+ std::unique_ptr<UINT8[]> m_buckrog_bitmap_ram;
/* machine states */
UINT8 m_i8279_scanlines;
diff --git a/src/mame/includes/turrett.h b/src/mame/includes/turrett.h
index bfa376f7d91..675f6407238 100644
--- a/src/mame/includes/turrett.h
+++ b/src/mame/includes/turrett.h
@@ -59,7 +59,7 @@ public:
// members
emu_timer *m_dma_timer;
UINT32 m_inputs_active;
- UINT16 *m_video_ram[2];
+ std::unique_ptr<UINT16[]> m_video_ram[2];
UINT16 m_last_pixel;
INT32 m_video_ctrl;
UINT16 m_video_fade;
diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h
index d15f49b807a..68f9a37739d 100644
--- a/src/mame/includes/tx1.h
+++ b/src/mame/includes/tx1.h
@@ -146,10 +146,10 @@ public:
sn74s516_t m_sn74s516;
vregs_t m_vregs;
- UINT8 *m_chr_bmp;
- UINT8 *m_obj_bmp;
- UINT8 *m_rod_bmp;
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<UINT8[]> m_chr_bmp;
+ std::unique_ptr<UINT8[]> m_obj_bmp;
+ std::unique_ptr<UINT8[]> m_rod_bmp;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
bool m_needs_update;
diff --git a/src/mame/includes/vc4000.h b/src/mame/includes/vc4000.h
index f9f6720aecf..ca19737872f 100644
--- a/src/mame/includes/vc4000.h
+++ b/src/mame/includes/vc4000.h
@@ -118,7 +118,7 @@ public:
UINT8 m_joy2_y;
UINT8 m_objects[512];
UINT8 m_irq_pause;
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
virtual void machine_start() override;
virtual void video_start() override;
DECLARE_PALETTE_INIT(vc4000);
diff --git a/src/mame/includes/victory.h b/src/mame/includes/victory.h
index 5df68773e47..499432ec87f 100644
--- a/src/mame/includes/victory.h
+++ b/src/mame/includes/victory.h
@@ -50,11 +50,11 @@ public:
required_shared_ptr<UINT8> m_charram;
UINT16 m_paletteram[0x40];
- UINT8 *m_bgbitmap;
- UINT8 *m_fgbitmap;
- UINT8 *m_rram;
- UINT8 *m_gram;
- UINT8 *m_bram;
+ std::unique_ptr<UINT8[]> m_bgbitmap;
+ std::unique_ptr<UINT8[]> m_fgbitmap;
+ std::unique_ptr<UINT8[]> m_rram;
+ std::unique_ptr<UINT8[]> m_gram;
+ std::unique_ptr<UINT8[]> m_bram;
UINT8 m_vblank_irq;
UINT8 m_fgcoll;
UINT8 m_fgcollx;
diff --git a/src/mame/includes/vigilant.h b/src/mame/includes/vigilant.h
index 6bc33c9149d..a83bea427eb 100644
--- a/src/mame/includes/vigilant.h
+++ b/src/mame/includes/vigilant.h
@@ -31,7 +31,7 @@ public:
int m_rear_color;
int m_rear_disable;
int m_rear_refresh;
- bitmap_ind16 *m_bg_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bg_bitmap;
// common
DECLARE_WRITE8_MEMBER(bank_select_w);
diff --git a/src/mame/includes/volfied.h b/src/mame/includes/volfied.h
index 17e58b8f90b..e49fab85419 100644
--- a/src/mame/includes/volfied.h
+++ b/src/mame/includes/volfied.h
@@ -24,7 +24,7 @@ public:
m_screen(*this, "screen") { }
/* memory pointers */
- UINT16 * m_video_ram;
+ std::unique_ptr<UINT16[]> m_video_ram;
UINT8 * m_cchip_ram;
/* video-related */
diff --git a/src/mame/includes/vsnes.h b/src/mame/includes/vsnes.h
index 557d6be9635..064919f66ff 100644
--- a/src/mame/includes/vsnes.h
+++ b/src/mame/includes/vsnes.h
@@ -29,9 +29,9 @@ public:
int m_input_latch[4];
int m_sound_fix;
UINT8 m_last_bank;
- UINT8* m_vram;
+ std::unique_ptr<UINT8[]> m_vram;
UINT8* m_vrom[2];
- UINT8* m_nt_ram[2];
+ std::unique_ptr<UINT8[]> m_nt_ram[2];
UINT8* m_nt_page[2][4];
UINT32 m_vrom_size[2];
int m_vrom_banks;
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index adcca117690..1a586791475 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -51,7 +51,7 @@ public:
UINT8 m_blitter_xor;
UINT8 m_blitter_remap_index;
const UINT8 *m_blitter_remap;
- UINT8 *m_blitter_remap_lookup;
+ std::unique_ptr<UINT8[]> m_blitter_remap_lookup;
DECLARE_WRITE8_MEMBER(williams_vram_select_w);
DECLARE_WRITE8_MEMBER(williams_cmos_w);
DECLARE_WRITE8_MEMBER(bubbles_cmos_w);
diff --git a/src/mame/includes/wolfpack.h b/src/mame/includes/wolfpack.h
index f4abe029c9b..457f867f542 100644
--- a/src/mame/includes/wolfpack.h
+++ b/src/mame/includes/wolfpack.h
@@ -41,7 +41,7 @@ public:
UINT8 m_ship_pic;
UINT8 m_torpedo_h;
UINT8 m_torpedo_v;
- UINT8* m_LFSR;
+ std::unique_ptr<UINT8[]> m_LFSR;
bitmap_ind16 m_helper;
DECLARE_READ8_MEMBER(wolfpack_misc_r);
DECLARE_WRITE8_MEMBER(wolfpack_high_explo_w);
diff --git a/src/mame/includes/wswan.h b/src/mame/includes/wswan.h
index db0c4f0973b..5cdc8336f04 100644
--- a/src/mame/includes/wswan.h
+++ b/src/mame/includes/wswan.h
@@ -57,7 +57,7 @@ public:
UINT8 m_internal_eeprom[INTERNAL_EEPROM_SIZE];
UINT8 m_system_type;
SoundDMA m_sound_dma;
- UINT8 *m_ws_bios_bank;
+ std::unique_ptr<UINT8[]> m_ws_bios_bank;
UINT8 m_bios_disabled;
UINT8 m_rotate;
diff --git a/src/mame/includes/x68k.h b/src/mame/includes/x68k.h
index ea3fca06d38..a77d024d5ef 100644
--- a/src/mame/includes/x68k.h
+++ b/src/mame/includes/x68k.h
@@ -113,8 +113,8 @@ public:
std::vector<UINT16> m_gvram;
std::vector<UINT16> m_spritereg;
- bitmap_ind16 *m_pcgbitmap;
- bitmap_ind16 *m_gfxbitmap;
+ std::unique_ptr<bitmap_ind16> m_pcgbitmap;
+ std::unique_ptr<bitmap_ind16> m_gfxbitmap;
void floppy_load_unload(bool load, floppy_image_device *dev);
int floppy_load(floppy_image_device *dev);
diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h
index 9cf61b78295..d7bdceb6a65 100644
--- a/src/mame/includes/xmen.h
+++ b/src/mame/includes/xmen.h
@@ -30,8 +30,8 @@ public:
int m_layerpri[3];
/* for xmen6p */
- bitmap_ind16 *m_screen_right;
- bitmap_ind16 *m_screen_left;
+ std::unique_ptr<bitmap_ind16> m_screen_right;
+ std::unique_ptr<bitmap_ind16> m_screen_left;
optional_shared_ptr<UINT16> m_xmen6p_spriteramleft;
optional_shared_ptr<UINT16> m_xmen6p_spriteramright;
optional_shared_ptr<UINT16> m_xmen6p_tilemapleft;
diff --git a/src/mame/includes/zx.h b/src/mame/includes/zx.h
index a8ebbf17e51..dce127f3986 100644
--- a/src/mame/includes/zx.h
+++ b/src/mame/includes/zx.h
@@ -95,7 +95,8 @@ protected:
UINT8 m_prev_refresh;
UINT8 m_speaker_state;
- bitmap_ind16 *m_bitmap_render, *m_bitmap_buffer;
+ std::unique_ptr<bitmap_ind16> m_bitmap_render;
+ std::unique_ptr<bitmap_ind16> m_bitmap_buffer;
UINT16 m_ula_char_buffer;
double m_cassette_cur_level;
diff --git a/src/mame/machine/315-5881_crypt.cpp b/src/mame/machine/315-5881_crypt.cpp
index 96f654a44e1..b73f6a85931 100644
--- a/src/mame/machine/315-5881_crypt.cpp
+++ b/src/mame/machine/315-5881_crypt.cpp
@@ -29,15 +29,15 @@ sega_315_5881_crypt_device::sega_315_5881_crypt_device(const machine_config &mco
void sega_315_5881_crypt_device::device_start()
{
- buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
- line_buffer = auto_alloc_array(machine(), UINT8, LINE_SIZE);
- line_buffer_prev = auto_alloc_array(machine(), UINT8, LINE_SIZE);
+ buffer = std::make_unique<UINT8[]>(BUFFER_SIZE);
+ line_buffer = std::make_unique<UINT8[]>(LINE_SIZE);
+ line_buffer_prev = std::make_unique<UINT8[]>(LINE_SIZE);
m_read.bind_relative_to(*owner());
- save_pointer(NAME(buffer), BUFFER_SIZE);
- save_pointer(NAME(line_buffer), LINE_SIZE);
- save_pointer(NAME(line_buffer_prev), LINE_SIZE);
+ save_pointer(NAME(buffer.get()), BUFFER_SIZE);
+ save_pointer(NAME(line_buffer.get()), LINE_SIZE);
+ save_pointer(NAME(line_buffer_prev.get()), LINE_SIZE);
save_item(NAME(prot_cur_address));
save_item(NAME(subkey));
save_item(NAME(enc_ready));
@@ -59,9 +59,9 @@ void sega_315_5881_crypt_device::device_start()
void sega_315_5881_crypt_device::device_reset()
{
- memset(buffer, 0, BUFFER_SIZE);
- memset(line_buffer, 0, LINE_SIZE);
- memset(line_buffer_prev, 0, LINE_SIZE);
+ memset(buffer.get(), 0, BUFFER_SIZE);
+ memset(line_buffer.get(), 0, LINE_SIZE);
+ memset(line_buffer_prev.get(), 0, LINE_SIZE);
prot_cur_address = 0;
subkey = 0;
@@ -89,12 +89,12 @@ UINT16 sega_315_5881_crypt_device::do_decrypt(UINT8 *&base)
line_fill();
}
- base = line_buffer + line_buffer_pos;
+ base = line_buffer.get() + line_buffer_pos;
line_buffer_pos += 2;
} else {
if(buffer_pos == BUFFER_SIZE)
enc_fill();
- base = buffer + buffer_pos;
+ base = buffer.get() + buffer_pos;
buffer_pos += 2;
}
@@ -857,10 +857,11 @@ int sega_315_5881_crypt_device::get_compressed_bit()
void sega_315_5881_crypt_device::line_fill()
{
assert(line_buffer_pos == line_buffer_size);
- UINT8 *lp = line_buffer;
- UINT8 *lc = line_buffer_prev;
- line_buffer = lc;
- line_buffer_prev = lp;
+ UINT8 *lp = line_buffer.get();
+ UINT8 *lc = line_buffer_prev.get();
+
+ line_buffer.swap(line_buffer_prev);
+
line_buffer_pos = 0;
for(int i=0; i != line_buffer_size;) {
diff --git a/src/mame/machine/315-5881_crypt.h b/src/mame/machine/315-5881_crypt.h
index 257d42ff9bb..8c8c4739af1 100644
--- a/src/mame/machine/315-5881_crypt.h
+++ b/src/mame/machine/315-5881_crypt.h
@@ -48,7 +48,9 @@ private:
UINT32 key;
- UINT8 *buffer, *line_buffer, *line_buffer_prev;
+ std::unique_ptr<UINT8[]> buffer;
+ std::unique_ptr<UINT8[]> line_buffer;
+ std::unique_ptr<UINT8[]> line_buffer_prev;
UINT32 prot_cur_address;
UINT16 subkey, dec_hist;
UINT32 dec_header;
diff --git a/src/mame/machine/3do.cpp b/src/mame/machine/3do.cpp
index 9bab395964f..347ca3822b4 100644
--- a/src/mame/machine/3do.cpp
+++ b/src/mame/machine/3do.cpp
@@ -1112,15 +1112,15 @@ void _3do_state::m_3do_clio_init( screen_device *screen )
m_clio.revision = 0x02022000 /* 0x04000000 */;
m_clio.unclerev = 0x03800000;
m_clio.expctl = 0x80; /* ARM has the expansion bus */
- m_dspp.N = auto_alloc_array(machine(), UINT16, 0x800 );
- m_dspp.EI = auto_alloc_array(machine(), UINT16, 0x400 );
- m_dspp.EO = auto_alloc_array(machine(), UINT16, 0x400 );
+ m_dspp.N = std::make_unique<UINT16[]>(0x800 );
+ m_dspp.EI = std::make_unique<UINT16[]>(0x400 );
+ m_dspp.EO = std::make_unique<UINT16[]>(0x400 );
- memset(m_dspp.N, 0, sizeof(UINT16) * 0x400);
- memset(m_dspp.EI, 0, sizeof(UINT16) * 0x400);
- memset(m_dspp.EO, 0, sizeof(UINT16) * 0x400);
+ memset(m_dspp.N.get(), 0, sizeof(UINT16) * 0x400);
+ memset(m_dspp.EI.get(), 0, sizeof(UINT16) * 0x400);
+ memset(m_dspp.EO.get(), 0, sizeof(UINT16) * 0x400);
- save_pointer(NAME(m_dspp.N), 0x800);
- save_pointer(NAME(m_dspp.EI), 0x400);
- save_pointer(NAME(m_dspp.EO), 0x400);
+ save_pointer(NAME(m_dspp.N.get()), 0x800);
+ save_pointer(NAME(m_dspp.EI.get()), 0x400);
+ save_pointer(NAME(m_dspp.EO.get()), 0x400);
}
diff --git a/src/mame/machine/aim65.cpp b/src/mame/machine/aim65.cpp
index 3e7d4f2a309..4dc9d246c62 100644
--- a/src/mame/machine/aim65.cpp
+++ b/src/mame/machine/aim65.cpp
@@ -378,7 +378,7 @@ WRITE8_MEMBER( aim65_state::aim65_pa_w )
VIDEO_START_MEMBER(aim65_state,aim65)
{
m_print_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aim65_state::aim65_printer_timer),this));
- m_printerRAM = auto_alloc_array(machine(), UINT16, (600 * 10 * 2) / 2);
+ m_printerRAM = std::make_unique<UINT16[]>((600 * 10 * 2) / 2);
memset(m_printerRAM, 0, videoram_size);
VIDEO_START_CALL_MEMBER(generic);
m_printer_x = 0;
diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp
index eed5c0f291e..9b7d5394e9d 100644
--- a/src/mame/machine/amstrad.cpp
+++ b/src/mame/machine/amstrad.cpp
@@ -1088,7 +1088,7 @@ VIDEO_START_MEMBER(amstrad_state,amstrad)
{
amstrad_init_lookups();
- m_gate_array.bitmap = auto_bitmap_ind16_alloc( machine(), m_screen->width(), m_screen->height() );
+ m_gate_array.bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height() );
m_gate_array.hsync_after_vsync_counter = 3;
}
diff --git a/src/mame/machine/apple2.cpp b/src/mame/machine/apple2.cpp
index 88a2158ab8b..27378e5d97f 100644
--- a/src/mame/machine/apple2.cpp
+++ b/src/mame/machine/apple2.cpp
@@ -2336,8 +2336,8 @@ MACHINE_START_MEMBER(apple2_state,laser128)
apple2_init_common();
// 1 MB of expansion RAM in slot 5
- m_exp_ram = auto_alloc_array(machine(), UINT8, 1024*1024);
- memset(m_exp_ram, 0xff, 1024*1024);
+ m_exp_ram = std::make_unique<UINT8[]>(1024*1024);
+ memset(m_exp_ram.get(), 0xff, 1024*1024);
m_exp_bankhior = 0xf0;
m_exp_addrmask = 0xfffff;
diff --git a/src/mame/machine/atarifdc.cpp b/src/mame/machine/atarifdc.cpp
index 0249ba31e7e..13505910f30 100644
--- a/src/mame/machine/atarifdc.cpp
+++ b/src/mame/machine/atarifdc.cpp
@@ -114,7 +114,7 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image)
int size, i;
const char *ext;
- m_drv[id].image = auto_alloc_array(image.device().machine(),UINT8,MAXSIZE);
+ m_drv[id].image = std::make_unique<UINT8[]>(MAXSIZE);
if (!m_drv[id].image)
return;
@@ -132,7 +132,7 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image)
image.fseek(0, SEEK_SET);
}
- size = image.fread(m_drv[id].image, MAXSIZE);
+ size = image.fread(m_drv[id].image.get(), MAXSIZE);
if( size <= 0 )
{
@@ -276,7 +276,7 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image)
/* DSK format: it's all in the header */
case FORMAT_DSK:
{
- atari_dsk_format *dsk = (atari_dsk_format *) m_drv[id].image;
+ atari_dsk_format *dsk = (atari_dsk_format *) m_drv[id].image.get();
m_drv[id].tracks = dsk->tracks;
m_drv[id].spt = dsk->spt;
diff --git a/src/mame/machine/atarifdc.h b/src/mame/machine/atarifdc.h
index f7f02d10b10..4c41c7b745a 100644
--- a/src/mame/machine/atarifdc.h
+++ b/src/mame/machine/atarifdc.h
@@ -36,7 +36,7 @@ private:
struct atari_drive
{
- UINT8 *image; /* alloc'd image */
+ std::unique_ptr<UINT8[]> image; /* alloc'd image */
int type; /* type of image (XFD, ATR, DSK) */
int mode; /* 0 read only, != 0 read/write */
int density; /* 0 SD, 1 MD, 2 DD */
diff --git a/src/mame/machine/cdicdic.cpp b/src/mame/machine/cdicdic.cpp
index a6fbd02da27..11a2b21eacc 100644
--- a/src/mame/machine/cdicdic.cpp
+++ b/src/mame/machine/cdicdic.cpp
@@ -563,12 +563,12 @@ void cdicdic_device::sample_trigger()
m_decode_delay = 0;
}
- if(CDIC_IS_VALID_SAMPLE_BUF(m_ram, m_decode_addr & 0x3ffe))
+ if(CDIC_IS_VALID_SAMPLE_BUF(m_ram.get(), m_decode_addr & 0x3ffe))
{
verboselog(machine(), 0, "Hit audio_sample_trigger, with m_decode_addr == %04x, calling decode_audio_sector\n", m_decode_addr );
// Decode the data at Z+4, the same offset as a normal CD sector.
- decode_audio_sector(((UINT8*)m_ram) + (m_decode_addr & 0x3ffe) + 4, 1);
+ decode_audio_sector(((UINT8*)m_ram.get()) + (m_decode_addr & 0x3ffe) + 4, 1);
// Swap buffer positions to indicate our new buffer position at the next read
m_decode_addr ^= 0x1a00;
@@ -577,7 +577,7 @@ void cdicdic_device::sample_trigger()
//// Delay for Frequency * (18*28*2*size in bytes) before requesting more data
verboselog(machine(), 0, "%s", "Data is valid, setting up a new callback\n" );
- m_decode_period = attotime::from_hz(CDIC_SAMPLE_BUF_FREQ(m_ram, m_decode_addr & 0x3ffe)) * (18*28*2*CDIC_SAMPLE_BUF_SIZE(m_ram, m_decode_addr & 0x3ffe));
+ m_decode_period = attotime::from_hz(CDIC_SAMPLE_BUF_FREQ(m_ram.get(), m_decode_addr & 0x3ffe)) * (18*28*2*CDIC_SAMPLE_BUF_SIZE(m_ram.get(), m_decode_addr & 0x3ffe));
m_audio_sample_timer->adjust(m_decode_period);
//dmadac_enable(&dmadac[0], 2, 0);
}
@@ -706,7 +706,7 @@ void cdicdic_device::process_delayed_command()
m_ram[(m_data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
}
- decode_audio_sector(((UINT8*)m_ram) + ((m_data_buffer & 5) * 0xa00 + 4), 0);
+ decode_audio_sector(((UINT8*)m_ram.get()) + ((m_data_buffer & 5) * 0xa00 + 4), 0);
//printf( "Setting CDIC interrupt line\n" );
verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for audio sector\n" );
@@ -1193,7 +1193,7 @@ void cdicdic_device::device_start()
m_audio_sample_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::audio_sample_trigger), this));
m_audio_sample_timer->adjust(attotime::never);
- m_ram = auto_alloc_array(machine(), UINT16, 0x3c00/2);
+ m_ram = std::make_unique<UINT16[]>(0x3c00/2);
}
//-------------------------------------------------
diff --git a/src/mame/machine/cdicdic.h b/src/mame/machine/cdicdic.h
index 6b131f3f7cc..a42450c5f4e 100644
--- a/src/mame/machine/cdicdic.h
+++ b/src/mame/machine/cdicdic.h
@@ -103,7 +103,7 @@ private:
attotime m_decode_period;
int m_xa_last[4];
- UINT16 *m_ram;
+ std::unique_ptr<UINT16[]> m_ram;
// static internal members
static void decode_xa_mono(INT32 *cdic_xa_last, const UINT8 *xa, INT16 *dp);
diff --git a/src/mame/machine/docg3.cpp b/src/mame/machine/docg3.cpp
index 9ec4ef16b35..1d6fee6c0c6 100644
--- a/src/mame/machine/docg3.cpp
+++ b/src/mame/machine/docg3.cpp
@@ -134,7 +134,7 @@ void diskonchip_g3_device::g3_write_data(UINT8 data)
{
const UINT8 xxx[] = { 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
offset = g3_offset_data_2();
- memcpy( m_data[1] + offset, xxx, 16);
+ memcpy( m_data[1].get() + offset, xxx, 16);
}
offset = g3_offset_data_1() + m_transfer_offset;
m_data[0][offset] = data;
@@ -470,9 +470,9 @@ void diskonchip_g3_device::g3_erase_block()
{
m_plane = j;
offset = g3_offset_data_1();
- memset( m_data[0] + offset, 0xFF, (m_user_data_size + m_extra_area_size));
+ memset( m_data[0].get() + offset, 0xFF, (m_user_data_size + m_extra_area_size));
offset = g3_offset_data_2();
- memcpy( m_data[1] + offset, xxx, 16);
+ memcpy( m_data[1].get() + offset, xxx, 16);
}
}
}
@@ -777,12 +777,12 @@ void diskonchip_g3_device::device_start()
memset(m_sec_2, 0, sizeof(m_sec_2));
- m_data[0] = auto_alloc_array( machine(), UINT8, m_data_size[0]);
- memset(m_data[0], 0, sizeof(UINT8) * m_data_size[0]);
- m_data[1] = auto_alloc_array( machine(), UINT8, m_data_size[1]);
- memset(m_data[1], 0, sizeof(UINT8) * m_data_size[1]);
- m_data[2] = auto_alloc_array( machine(), UINT8, m_data_size[2]);
- memset(m_data[2], 0, sizeof(UINT8) * m_data_size[2]);
+ m_data[0] = std::make_unique<UINT8[]>(m_data_size[0]);
+ memset(m_data[0].get(), 0, sizeof(UINT8) * m_data_size[0]);
+ m_data[1] = std::make_unique<UINT8[]>(m_data_size[1]);
+ memset(m_data[1].get(), 0, sizeof(UINT8) * m_data_size[1]);
+ m_data[2] = std::make_unique<UINT8[]>(m_data_size[2]);
+ memset(m_data[2].get(), 0, sizeof(UINT8) * m_data_size[2]);
// diskonchip_load( device, "diskonchip");
@@ -791,9 +791,9 @@ void diskonchip_g3_device::device_start()
save_item( NAME(m_pages));
save_item( NAME(m_user_data_size));
save_item( NAME(m_extra_area_size));
- save_pointer( NAME(m_data[0]), m_data_size[0]);
- save_pointer( NAME(m_data[1]), m_data_size[1]);
- save_pointer( NAME(m_data[2]), m_data_size[2]);
+ save_pointer( NAME(m_data[0].get()), m_data_size[0]);
+ save_pointer( NAME(m_data[1].get()), m_data_size[1]);
+ save_pointer( NAME(m_data[2].get()), m_data_size[2]);
}
//-------------------------------------------------
@@ -812,9 +812,9 @@ void diskonchip_g3_device::device_reset()
void diskonchip_g3_device::nvram_default()
{
- memset(m_data[0], 0xFF, m_data_size[0]);
- memset(m_data[1], 0x00, m_data_size[1]);
- memset(m_data[2], 0xFF, m_data_size[2]);
+ memset(m_data[0].get(), 0xFF, m_data_size[0]);
+ memset(m_data[1].get(), 0x00, m_data_size[1]);
+ memset(m_data[2].get(), 0xFF, m_data_size[2]);
}
//-------------------------------------------------
@@ -824,9 +824,9 @@ void diskonchip_g3_device::nvram_default()
void diskonchip_g3_device::nvram_read(emu_file &file)
{
- file.read(m_data[0], m_data_size[0]);
- file.read(m_data[1], m_data_size[1]);
- file.read(m_data[2], m_data_size[2]);
+ file.read(m_data[0].get(), m_data_size[0]);
+ file.read(m_data[1].get(), m_data_size[1]);
+ file.read(m_data[2].get(), m_data_size[2]);
}
//-------------------------------------------------
@@ -836,7 +836,7 @@ void diskonchip_g3_device::nvram_read(emu_file &file)
void diskonchip_g3_device::nvram_write(emu_file &file)
{
- file.write(m_data[0], m_data_size[0]);
- file.write(m_data[1], m_data_size[1]);
- file.write(m_data[2], m_data_size[2]);
+ file.write(m_data[0].get(), m_data_size[0]);
+ file.write(m_data[1].get(), m_data_size[1]);
+ file.write(m_data[2].get(), m_data_size[2]);
}
diff --git a/src/mame/machine/docg3.h b/src/mame/machine/docg3.h
index a32a77da1f4..36423f12641 100644
--- a/src/mame/machine/docg3.h
+++ b/src/mame/machine/docg3.h
@@ -82,7 +82,7 @@ private:
UINT32 m_pages;
UINT32 m_user_data_size;
UINT32 m_extra_area_size;
- UINT8 *m_data[3];
+ std::unique_ptr<UINT8[]> m_data[3];
UINT32 m_data_size[3];
UINT8 m_sec_2[0x800];
UINT32 m_data_1036;
diff --git a/src/mame/machine/fddebug.cpp b/src/mame/machine/fddebug.cpp
index 61e019280db..ce78ae294ea 100644
--- a/src/mame/machine/fddebug.cpp
+++ b/src/mame/machine/fddebug.cpp
@@ -499,11 +499,11 @@ void fd1094_init_debugging(running_machine &machine, const char *cpureg, const c
ignorepc = auto_alloc_array_clear(machine, UINT8, 1 << 23);
/* allocate memory for the undo buffer */
- undobuff = auto_alloc_array(machine, UINT8, keystatus_words * 2);
+ undobuff = std::make_unique<UINT8[]>(keystatus_words * 2);
memcpy(undobuff, keystatus, keystatus_words * 2);
/* allocate memory for the possible seeds array */
- possible_seed = auto_alloc_array(machine, UINT32, 65536);
+ possible_seed = std::make_unique<UINT32[]>(65536);
/* build the opcode table */
build_optable(machine);
diff --git a/src/mame/machine/k573dio.cpp b/src/mame/machine/k573dio.cpp
index 69632cf51bd..672aa2fa209 100644
--- a/src/mame/machine/k573dio.cpp
+++ b/src/mame/machine/k573dio.cpp
@@ -116,8 +116,8 @@ k573dio_device::k573dio_device(const machine_config &mconfig, const char *tag, d
void k573dio_device::device_start()
{
output_cb.resolve_safe();
- ram = auto_alloc_array( machine(), UINT16, 12 * 1024 * 1024 );
- save_pointer( NAME(ram), 12 * 1024 * 1024 );
+ ram = std::make_unique<UINT16[]>(12 * 1024 * 1024 );
+ save_pointer( NAME(ram.get()), 12 * 1024 * 1024 );
}
void k573dio_device::device_reset()
diff --git a/src/mame/machine/k573dio.h b/src/mame/machine/k573dio.h
index 6fb44f4089f..9762536b072 100644
--- a/src/mame/machine/k573dio.h
+++ b/src/mame/machine/k573dio.h
@@ -73,7 +73,7 @@ protected:
private:
devcb_write8 output_cb;
- UINT16 *ram;
+ std::unique_ptr<UINT16[]> ram;
UINT32 ram_adr;
UINT8 output_data[8];
diff --git a/src/mame/machine/konppc.cpp b/src/mame/machine/konppc.cpp
index 93dbc89041b..d70d3364142 100644
--- a/src/mame/machine/konppc.cpp
+++ b/src/mame/machine/konppc.cpp
@@ -33,7 +33,7 @@ void konppc_device::device_start()
for (i=0; i < num_cgboards; i++)
{
dsp_comm_ppc[i][0] = 0x00;
- dsp_shared_ram[i] = auto_alloc_array(machine(), UINT32, DSP_BANK_SIZE * 2/4);
+ dsp_shared_ram[i] = std::make_unique<UINT32[]>(DSP_BANK_SIZE * 2/4);
dsp_shared_ram_bank[i] = 0;
dsp_state[i] = 0x80;
@@ -43,19 +43,19 @@ void konppc_device::device_start()
nwk_fifo_read_ptr[i] = 0;
nwk_fifo_write_ptr[i] = 0;
- nwk_fifo[i] = auto_alloc_array(machine(), UINT32, 0x800);
- nwk_ram[i] = auto_alloc_array(machine(), UINT32, 0x2000);
+ nwk_fifo[i] = std::make_unique<UINT32[]>(0x800);
+ nwk_ram[i] = std::make_unique<UINT32[]>(0x2000);
save_item(NAME(dsp_comm_ppc[i]), i);
save_item(NAME(dsp_comm_sharc[i]), i);
save_item(NAME(dsp_shared_ram_bank[i]), i);
- save_pointer(NAME(dsp_shared_ram[i]), DSP_BANK_SIZE * 2 / sizeof(dsp_shared_ram[i][0]), i);
+ save_pointer(NAME(dsp_shared_ram[i].get()), DSP_BANK_SIZE * 2 / sizeof(dsp_shared_ram[i][0]), i);
save_item(NAME(dsp_state[i]), i);
save_item(NAME(nwk_device_sel[i]), i);
save_item(NAME(nwk_fifo_read_ptr[i]), i);
save_item(NAME(nwk_fifo_write_ptr[i]), i);
- save_pointer(NAME(nwk_fifo[i]), 0x800, i);
- save_pointer(NAME(nwk_ram[i]), 0x2000, i);
+ save_pointer(NAME(nwk_fifo[i].get()), 0x800, i);
+ save_pointer(NAME(nwk_ram[i].get()), 0x2000, i);
}
save_item(NAME(cgboard_id));
@@ -185,7 +185,7 @@ WRITE32_MEMBER( konppc_device::cgboard_dsp_shared_w_ppc )
if (cgboard_id < MAX_CG_BOARDS)
{
space.machine().scheduler().trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround)
- COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD)));
+ COMBINE_DATA(dsp_shared_ram[cgboard_id].get() + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD)));
}
}
diff --git a/src/mame/machine/konppc.h b/src/mame/machine/konppc.h
index c17cdfa922c..cc3a3c386b9 100644
--- a/src/mame/machine/konppc.h
+++ b/src/mame/machine/konppc.h
@@ -78,7 +78,7 @@ private:
INT32 cgboard_type;
INT32 num_cgboards;
- UINT32 *dsp_shared_ram[MAX_CG_BOARDS];
+ std::unique_ptr<UINT32[]> dsp_shared_ram[MAX_CG_BOARDS];
UINT32 dsp_state[MAX_CG_BOARDS];
UINT32 nwk_device_sel[MAX_CG_BOARDS];
@@ -89,11 +89,11 @@ private:
int nwk_fifo_full;
int nwk_fifo_mask;
- UINT32 *nwk_fifo[MAX_CG_BOARDS];
+ std::unique_ptr<UINT32[]> nwk_fifo[MAX_CG_BOARDS];
INT32 nwk_fifo_read_ptr[MAX_CG_BOARDS];
INT32 nwk_fifo_write_ptr[MAX_CG_BOARDS];
- UINT32 *nwk_ram[MAX_CG_BOARDS];
+ std::unique_ptr<UINT32[]> nwk_ram[MAX_CG_BOARDS];
};
diff --git a/src/mame/machine/leland.cpp b/src/mame/machine/leland.cpp
index f140b00603e..0b6ad8b19f0 100644
--- a/src/mame/machine/leland.cpp
+++ b/src/mame/machine/leland.cpp
@@ -369,7 +369,7 @@ MACHINE_START_MEMBER(leland_state,ataxx)
{
/* set the odd data banks */
m_battery_ram = reinterpret_cast<UINT8 *>(memshare("battery")->ptr());
- m_extra_tram = auto_alloc_array(machine(), UINT8, ATAXX_EXTRA_TRAM_SIZE);
+ m_extra_tram = std::make_unique<UINT8[]>(ATAXX_EXTRA_TRAM_SIZE);
/* start scanline interrupts going */
m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::ataxx_interrupt_callback),this));
@@ -378,7 +378,7 @@ MACHINE_START_MEMBER(leland_state,ataxx)
MACHINE_RESET_MEMBER(leland_state,ataxx)
{
- memset(m_extra_tram, 0, ATAXX_EXTRA_TRAM_SIZE);
+ memset(m_extra_tram.get(), 0, ATAXX_EXTRA_TRAM_SIZE);
m_master_int_timer->adjust(m_screen->time_until_pos(8), 8);
/* initialize the XROM */
diff --git a/src/mame/machine/lisa.cpp b/src/mame/machine/lisa.cpp
index 48ba7a2e9fd..c0364ccbdb9 100644
--- a/src/mame/machine/lisa.cpp
+++ b/src/mame/machine/lisa.cpp
@@ -909,7 +909,7 @@ DRIVER_INIT_MEMBER(lisa_state,lisa2)
m_features.has_double_sided_floppy = 0;
m_features.has_mac_xl_video = 0;
- m_bad_parity_table = auto_alloc_array(machine(), UINT8, 0x40000); /* 1 bit per byte of CPU RAM */
+ m_bad_parity_table = std::make_unique<UINT8[]>(0x40000); /* 1 bit per byte of CPU RAM */
}
DRIVER_INIT_MEMBER(lisa_state,lisa210)
@@ -922,7 +922,7 @@ DRIVER_INIT_MEMBER(lisa_state,lisa210)
m_features.has_double_sided_floppy = 0;
m_features.has_mac_xl_video = 0;
- m_bad_parity_table = auto_alloc_array(machine(), UINT8, 0x40000); /* 1 bit per byte of CPU RAM */
+ m_bad_parity_table = std::make_unique<UINT8[]>(0x40000); /* 1 bit per byte of CPU RAM */
}
DRIVER_INIT_MEMBER(lisa_state,mac_xl)
@@ -935,7 +935,7 @@ DRIVER_INIT_MEMBER(lisa_state,mac_xl)
m_features.has_double_sided_floppy = 0;
m_features.has_mac_xl_video = 1;
- m_bad_parity_table = auto_alloc_array(machine(), UINT8, 0x40000); /* 1 bit per byte of CPU RAM */
+ m_bad_parity_table = std::make_unique<UINT8[]>(0x40000); /* 1 bit per byte of CPU RAM */
}
void lisa_state::machine_start()
@@ -967,7 +967,7 @@ void lisa_state::machine_reset()
m_parity_error_pending = 0;
m_bad_parity_count = 0;
- memset(m_bad_parity_table, 0, 0x40000); /* Clear */
+ memset(m_bad_parity_table.get(), 0, 0x40000); /* Clear */
/* init video */
diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp
index 8c60160097d..864e3d00b0b 100644
--- a/src/mame/machine/mega32x.cpp
+++ b/src/mame/machine/mega32x.cpp
@@ -1038,13 +1038,13 @@ void sega_32x_device::_32x_check_framebuffer_swap(bool enabled)
if (m_32x_fb_swap & 1)
{
- m_32x_access_dram = m_32x_dram0;
- m_32x_display_dram = m_32x_dram1;
+ m_32x_access_dram = m_32x_dram0.get();
+ m_32x_display_dram = m_32x_dram1.get();
}
else
{
- m_32x_display_dram = m_32x_dram0;
- m_32x_access_dram = m_32x_dram1;
+ m_32x_display_dram = m_32x_dram0.get();
+ m_32x_access_dram = m_32x_dram1.get();
}
}
}
@@ -1835,20 +1835,20 @@ void sega_32x_device::device_start()
m_32x_pwm_timer = machine().scheduler().timer_alloc(FUNC(_32x_pwm_callback), (void*)this);
m_32x_pwm_timer->adjust(attotime::never);
- m_32x_dram0 = auto_alloc_array(machine(), UINT16, 0x40000/2);
- m_32x_dram1 = auto_alloc_array(machine(), UINT16, 0x40000/2);
+ m_32x_dram0 = std::make_unique<UINT16[]>(0x40000/2);
+ m_32x_dram1 = std::make_unique<UINT16[]>(0x40000/2);
- memset(m_32x_dram0, 0x00, 0x40000);
- memset(m_32x_dram1, 0x00, 0x40000);
+ memset(m_32x_dram0.get(), 0x00, 0x40000);
+ memset(m_32x_dram1.get(), 0x00, 0x40000);
- m_32x_palette_lookup = auto_alloc_array(machine(), UINT16, 0x200/2);
- m_32x_palette = auto_alloc_array(machine(), UINT16, 0x200/2);
+ m_32x_palette_lookup = std::make_unique<UINT16[]>(0x200/2);
+ m_32x_palette = std::make_unique<UINT16[]>(0x200/2);
- memset(m_32x_palette_lookup, 0x00, 0x200);
- memset(m_32x_palette, 0x00, 0x200);
+ memset(m_32x_palette_lookup.get(), 0x00, 0x200);
+ memset(m_32x_palette.get(), 0x00, 0x200);
- m_32x_display_dram = m_32x_dram0;
- m_32x_access_dram = m_32x_dram1;
+ m_32x_display_dram = m_32x_dram0.get();
+ m_32x_access_dram = m_32x_dram1.get();
}
void sega_32x_device::device_reset()
diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h
index e79b4a32043..f076b0f7a71 100644
--- a/src/mame/machine/mega32x.h
+++ b/src/mame/machine/mega32x.h
@@ -193,11 +193,11 @@ private:
UINT16 m_commsram[8];
- UINT16* m_32x_dram0;
- UINT16* m_32x_dram1;
+ std::unique_ptr<UINT16[]> m_32x_dram0;
+ std::unique_ptr<UINT16[]> m_32x_dram1;
UINT16 *m_32x_display_dram, *m_32x_access_dram;
- UINT16* m_32x_palette;
- UINT16* m_32x_palette_lookup;
+ std::unique_ptr<UINT16[]> m_32x_palette;
+ std::unique_ptr<UINT16[]> m_32x_palette_lookup;
UINT16 m_fifo_block_a[4];
UINT16 m_fifo_block_b[4];
diff --git a/src/mame/machine/megadriv.cpp b/src/mame/machine/megadriv.cpp
index 9cc3ebbbacb..ad16299070f 100644
--- a/src/mame/machine/megadriv.cpp
+++ b/src/mame/machine/megadriv.cpp
@@ -798,7 +798,7 @@ UINT32 md_base_state::screen_update_megadriv(screen_device &screen, bitmap_rgb32
if (!m_vdp->m_use_alt_timing)
srcy = &m_vdp->m_render_bitmap->pix(y, 0);
else
- srcy = m_vdp->m_render_line;
+ srcy = m_vdp->m_render_line.get();
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
@@ -1030,12 +1030,12 @@ void md_base_state::megadriv_init_common()
if (m_z80snd)
{
//printf("GENESIS Sound Z80 cpu found '%s'\n", machine().device("genesis_snd_z80")->tag());
- m_genz80.z80_prgram = auto_alloc_array(machine(), UINT8, 0x2000);
- membank("bank1")->set_base(m_genz80.z80_prgram);
+ m_genz80.z80_prgram = std::make_unique<UINT8[]>(0x2000);
+ membank("bank1")->set_base(m_genz80.z80_prgram.get());
save_item(NAME(m_genz80.z80_is_reset));
save_item(NAME(m_genz80.z80_has_bus));
save_item(NAME(m_genz80.z80_bank_addr));
- save_pointer(NAME(m_genz80.z80_prgram), 0x2000);
+ save_pointer(NAME(m_genz80.z80_prgram.get()), 0x2000);
}
m_maincpu->set_tas_write_callback(write8_delegate(FUNC(md_base_state::megadriv_tas_callback),this));
diff --git a/src/mame/machine/microdrv.cpp b/src/mame/machine/microdrv.cpp
index 803f1d921d8..36406bd1bdf 100644
--- a/src/mame/machine/microdrv.cpp
+++ b/src/mame/machine/microdrv.cpp
@@ -77,8 +77,8 @@ void microdrive_image_device::device_start()
m_write_comms_out.resolve_safe();
// allocate track buffers
- m_left = auto_alloc_array(machine(), UINT8, MDV_IMAGE_LENGTH / 2);
- m_right = auto_alloc_array(machine(), UINT8, MDV_IMAGE_LENGTH / 2);
+ m_left = std::make_unique<UINT8[]>(MDV_IMAGE_LENGTH / 2);
+ m_right = std::make_unique<UINT8[]>(MDV_IMAGE_LENGTH / 2);
// allocate timers
m_bit_timer = timer_alloc();
@@ -97,8 +97,8 @@ bool microdrive_image_device::call_load()
for (int i = 0; i < MDV_IMAGE_LENGTH / 2; i++)
{
- fread(m_left, 1);
- fread(m_right, 1);
+ fread(m_left.get(), 1);
+ fread(m_right.get(), 1);
}
m_bit_offset = 0;
@@ -109,8 +109,8 @@ bool microdrive_image_device::call_load()
void microdrive_image_device::call_unload()
{
- memset(m_left, 0, MDV_IMAGE_LENGTH / 2);
- memset(m_right, 0, MDV_IMAGE_LENGTH / 2);
+ memset(m_left.get(), 0, MDV_IMAGE_LENGTH / 2);
+ memset(m_right.get(), 0, MDV_IMAGE_LENGTH / 2);
}
void microdrive_image_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
diff --git a/src/mame/machine/microdrv.h b/src/mame/machine/microdrv.h
index 9d83cd66956..30853bd84d7 100644
--- a/src/mame/machine/microdrv.h
+++ b/src/mame/machine/microdrv.h
@@ -86,8 +86,8 @@ private:
int m_erase;
int m_read_write;
- UINT8 *m_left;
- UINT8 *m_right;
+ std::unique_ptr<UINT8[]> m_left;
+ std::unique_ptr<UINT8[]> m_right;
int m_bit_offset;
int m_byte_offset;
diff --git a/src/mame/machine/model1.cpp b/src/mame/machine/model1.cpp
index df1e8006bbf..2f974d00a97 100644
--- a/src/mame/machine/model1.cpp
+++ b/src/mame/machine/model1.cpp
@@ -1331,7 +1331,7 @@ TGP_FUNCTION( model1_state::vmat_save )
int i;
logerror("TGP vmat_save 0x%x (%x)\n", a, m_pushpc);
for(i=0; i<16; i++)
- memcpy(m_ram_data+a+0x10*i, m_mat_vector[i], sizeof(m_cmat));
+ memcpy(m_ram_data.get()+a+0x10*i, m_mat_vector[i], sizeof(m_cmat));
next_fn();
}
@@ -1341,7 +1341,7 @@ TGP_FUNCTION( model1_state::vmat_load )
int i;
logerror("TGP vmat_load 0x%x (%x)\n", a, m_pushpc);
for(i=0; i<16; i++)
- memcpy(m_mat_vector[i], m_ram_data+a+0x10*i, sizeof(m_cmat));
+ memcpy(m_mat_vector[i], m_ram_data.get()+a+0x10*i, sizeof(m_cmat));
next_fn();
}
@@ -1449,7 +1449,7 @@ TGP_FUNCTION( model1_state::vmat_load1 )
{
UINT32 a = fifoin_pop();
logerror("TGP vmat_load1 0x%x (%x)\n", a, m_pushpc);
- memcpy(m_cmat, m_ram_data+a, sizeof(m_cmat));
+ memcpy(m_cmat, m_ram_data.get()+a, sizeof(m_cmat));
next_fn();
}
@@ -1879,9 +1879,9 @@ WRITE16_MEMBER(model1_state::model1_tgp_copro_ram_w)
MACHINE_START_MEMBER(model1_state,model1)
{
- m_ram_data = auto_alloc_array(machine(), UINT32, 0x10000);
+ m_ram_data = std::make_unique<UINT32[]>(0x10000);
- save_pointer(NAME(m_ram_data), 0x10000);
+ save_pointer(NAME(m_ram_data.get()), 0x10000);
save_item(NAME(m_ram_adr));
save_item(NAME(m_ram_scanadr));
save_item(NAME(m_ram_latch));
@@ -1902,7 +1902,7 @@ MACHINE_START_MEMBER(model1_state,model1)
void model1_state::tgp_reset(int swa)
{
m_ram_adr = 0;
- memset(m_ram_data, 0, 0x10000*4);
+ memset(m_ram_data.get(), 0, 0x10000*4);
m_fifoout_rpos = 0;
m_fifoout_wpos = 0;
@@ -1927,7 +1927,7 @@ void model1_state::tgp_reset(int swa)
void model1_state::vr_tgp_reset()
{
m_ram_adr = 0;
- memset(m_ram_data, 0, 0x8000*4);
+ memset(m_ram_data.get(), 0, 0x8000*4);
m_copro_fifoout_rpos = 0;
m_copro_fifoout_wpos = 0;
diff --git a/src/mame/machine/mz700.cpp b/src/mame/machine/mz700.cpp
index 55fa4fc67d3..877bb528858 100644
--- a/src/mame/machine/mz700.cpp
+++ b/src/mame/machine/mz700.cpp
@@ -42,9 +42,9 @@ DRIVER_INIT_MEMBER(mz_state,mz700)
m_mz700 = TRUE;
m_mz700_mode = TRUE;
- m_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_videoram, 0, sizeof(UINT8) * 0x1000);
- m_colorram = m_videoram + 0x800;
+ m_videoram = std::make_unique<UINT8[]>(0x1000);
+ memset(m_videoram.get(), 0, sizeof(UINT8) * 0x1000);
+ m_colorram = m_videoram.get() + 0x800;
m_p_chargen = memregion("cgrom")->base();
UINT8 *rom = memregion("monitor")->base();
@@ -53,7 +53,7 @@ DRIVER_INIT_MEMBER(mz_state,mz700)
membank("bankr0")->configure_entry(1, &rom[0]); // rom
membank("bankw0")->configure_entry(0, &ram[0]); // ram
membank("bankd")->configure_entry(0, &ram[0xd000]); // ram
- membank("bankd")->configure_entry(1, m_videoram); // vram
+ membank("bankd")->configure_entry(1, m_videoram.get()); // vram
}
DRIVER_INIT_MEMBER(mz_state,mz800)
@@ -62,17 +62,17 @@ DRIVER_INIT_MEMBER(mz_state,mz800)
m_mz700_mode = true;//FALSE;
/* video ram */
- m_videoram = auto_alloc_array(machine(), UINT8, 0x4000);
- memset(m_videoram, 0, sizeof(UINT8) * 0x4000);
- m_colorram = m_videoram + 0x800;
+ m_videoram = std::make_unique<UINT8[]>(0x4000);
+ memset(m_videoram.get(), 0, sizeof(UINT8) * 0x4000);
+ m_colorram = m_videoram.get() + 0x800;
/* character generator ram */
- m_cgram = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_cgram, 0, sizeof(UINT8) * 0x1000);
+ m_cgram = std::make_unique<UINT8[]>(0x1000);
+ memset(m_cgram.get(), 0, sizeof(UINT8) * 0x1000);
m_p_chargen = memregion("cgrom")->base();
if (!m_p_chargen)
- m_p_chargen = m_cgram;
+ m_p_chargen = m_cgram.get();
UINT8 *rom = memregion("monitor")->base();
UINT8 *ram = m_ram->pointer();
// configure banks (0 = RAM in all cases)
@@ -82,11 +82,11 @@ DRIVER_INIT_MEMBER(mz_state,mz800)
membank("bank1")->configure_entry(0, &ram[0x1000]); // ram
membank("bank1")->configure_entry(1, &rom[0x1000]); // chargen
membank("banka")->configure_entry(0, &ram[0x8000]); // ram
- membank("banka")->configure_entry(1, m_videoram); // vram in mz800 mode
+ membank("banka")->configure_entry(1, m_videoram.get()); // vram in mz800 mode
membank("bankc")->configure_entry(0, &ram[0xc000]); // ram
- membank("bankc")->configure_entry(1, m_cgram); // cgram in mz800 mode
+ membank("bankc")->configure_entry(1, m_cgram.get()); // cgram in mz800 mode
membank("bankd")->configure_entry(0, &ram[0xd000]); // ram
- membank("bankd")->configure_entry(1, m_videoram); // vram in mz700 mode
+ membank("bankd")->configure_entry(1, m_videoram.get()); // vram in mz700 mode
}
void mz_state::machine_start()
diff --git a/src/mame/machine/namcos2.cpp b/src/mame/machine/namcos2.cpp
index 7265a607d81..0758a25241d 100644
--- a/src/mame/machine/namcos2.cpp
+++ b/src/mame/machine/namcos2.cpp
@@ -102,8 +102,8 @@ void namcos2_shared_state::reset_all_subcpus(int state)
MACHINE_START_MEMBER(namcos2_shared_state,namcos2)
{
namcos2_kickstart = nullptr;
- m_eeprom = auto_alloc_array(machine(), UINT8, m_eeprom_size);
- machine().device<nvram_device>("nvram")->set_base(m_eeprom, m_eeprom_size);
+ m_eeprom = std::make_unique<UINT8[]>(m_eeprom_size);
+ machine().device<nvram_device>("nvram")->set_base(m_eeprom.get(), m_eeprom_size);
m_posirq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos2_shared_state::namcos2_posirq_tick),this));
}
diff --git a/src/mame/machine/naomim1.cpp b/src/mame/machine/naomim1.cpp
index c9e5bc1c359..7e205ce1ee7 100644
--- a/src/mame/machine/naomim1.cpp
+++ b/src/mame/machine/naomim1.cpp
@@ -41,9 +41,9 @@ void naomi_m1_board::device_start()
key = 0;
}
- buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
+ buffer = std::make_unique<UINT8[]>(BUFFER_SIZE);
- save_pointer(NAME(buffer), BUFFER_SIZE);
+ save_pointer(NAME(buffer.get()), BUFFER_SIZE);
save_item(NAME(dict));
save_item(NAME(hist));
save_item(NAME(rom_cur_address));
@@ -84,7 +84,7 @@ void naomi_m1_board::board_setup_address(UINT32 address, bool is_dma)
void naomi_m1_board::board_get_buffer(UINT8 *&base, UINT32 &limit)
{
if(encryption) {
- base = buffer;
+ base = buffer.get();
limit = BUFFER_SIZE;
} else {
@@ -97,7 +97,7 @@ void naomi_m1_board::board_advance(UINT32 size)
{
if(encryption) {
if(size < buffer_actual_size) {
- memmove(buffer, buffer + size, buffer_actual_size - size);
+ memmove(buffer.get(), buffer.get() + size, buffer_actual_size - size);
buffer_actual_size -= size;
} else {
hist[0] = buffer[buffer_actual_size-2];
diff --git a/src/mame/machine/naomim1.h b/src/mame/machine/naomim1.h
index 8de82b75b01..37c5a58739b 100644
--- a/src/mame/machine/naomim1.h
+++ b/src/mame/machine/naomim1.h
@@ -29,7 +29,7 @@ private:
enum { BUFFER_SIZE = 32768 };
UINT32 key;
- UINT8 *buffer;
+ std::unique_ptr<UINT8[]> buffer;
UINT8 dict[111], hist[2];
UINT64 avail_val;
UINT32 rom_cur_address, buffer_actual_size, avail_bits;
diff --git a/src/mame/machine/naomim2.cpp b/src/mame/machine/naomim2.cpp
index 9c82089ab01..516da16435e 100644
--- a/src/mame/machine/naomim2.cpp
+++ b/src/mame/machine/naomim2.cpp
@@ -121,17 +121,17 @@ void naomi_m2_board::device_start()
{
naomi_board::device_start();
- ram = auto_alloc_array(machine(), UINT8, RAM_SIZE);
+ ram = std::make_unique<UINT8[]>(RAM_SIZE);
save_item(NAME(rom_cur_address));
- save_pointer(NAME(ram), RAM_SIZE);
+ save_pointer(NAME(ram.get()), RAM_SIZE);
}
void naomi_m2_board::device_reset()
{
naomi_board::device_reset();
- memset(ram, 0, RAM_SIZE);
+ memset(ram.get(), 0, RAM_SIZE);
rom_cur_address = 0;
}
diff --git a/src/mame/machine/naomim2.h b/src/mame/machine/naomim2.h
index f8d22b84668..ae1bdf3fed8 100644
--- a/src/mame/machine/naomim2.h
+++ b/src/mame/machine/naomim2.h
@@ -16,7 +16,7 @@ public:
naomi_m2_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT32 rom_cur_address;
static const int RAM_SIZE = 65536;
- UINT8* ram;
+ std::unique_ptr<UINT8[]> ram;
UINT16 read_callback(UINT32 addr);
diff --git a/src/mame/machine/naomim4.cpp b/src/mame/machine/naomim4.cpp
index d22f7540ebc..40ced99ea5a 100644
--- a/src/mame/machine/naomim4.cpp
+++ b/src/mame/machine/naomim4.cpp
@@ -66,10 +66,10 @@ void naomi_m4_board::device_start()
subkey1 = (key_data[0x5e2] << 8) | key_data[0x5e0];
subkey2 = (key_data[0x5e6] << 8) | key_data[0x5e4];
- buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
+ buffer = std::make_unique<UINT8[]>(BUFFER_SIZE);
enc_init();
- save_pointer(NAME(buffer), BUFFER_SIZE);
+ save_pointer(NAME(buffer.get()), BUFFER_SIZE);
save_item(NAME(rom_cur_address));
save_item(NAME(buffer_actual_size));
save_item(NAME(encryption));
@@ -79,7 +79,7 @@ void naomi_m4_board::device_start()
void naomi_m4_board::enc_init()
{
- one_round = auto_alloc_array(machine(), UINT16, 0x10000);
+ one_round = std::make_unique<UINT16[]>(0x10000);
for(int round_input = 0; round_input < 0x10000; round_input++) {
UINT8 input_nibble[4];
@@ -148,7 +148,7 @@ void naomi_m4_board::board_get_buffer(UINT8 *&base, UINT32 &limit)
}
if(encryption) {
- base = buffer;
+ base = buffer.get();
limit = BUFFER_SIZE;
} else {
@@ -168,7 +168,7 @@ void naomi_m4_board::board_advance(UINT32 size)
{
if(encryption) {
if(size < buffer_actual_size) {
- memmove(buffer, buffer + size, buffer_actual_size - size);
+ memmove(buffer.get(), buffer.get() + size, buffer_actual_size - size);
buffer_actual_size -= size;
} else
buffer_actual_size = 0;
diff --git a/src/mame/machine/naomim4.h b/src/mame/machine/naomim4.h
index 10d9c9f9b73..650ed901c24 100644
--- a/src/mame/machine/naomim4.h
+++ b/src/mame/machine/naomim4.h
@@ -35,9 +35,9 @@ private:
const char *key_tag;
UINT16 subkey1, subkey2;
- UINT16 *one_round;
+ std::unique_ptr<UINT16[]> one_round;
- UINT8 *buffer;
+ std::unique_ptr<UINT8[]> buffer;
UINT32 rom_cur_address, buffer_actual_size;
UINT16 iv;
UINT8 counter;
diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp
index c5cd79575ee..e2975f35f68 100644
--- a/src/mame/machine/nes.cpp
+++ b/src/mame/machine/nes.cpp
@@ -47,7 +47,7 @@ void nes_state::machine_start()
// NES has 2KB of internal RAM which can be used to fill the 4x1KB banks of PPU RAM at $2000-$2fff
// Line A10 is exposed to the carts, so that games can change CIRAM mapping in PPU (we emulate this with the set_nt_mirroring
// function). CIRAM can also be disabled by the game (if e.g. VROM or cart RAM has to be used in PPU...
- m_ciram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_ciram = std::make_unique<UINT8[]>(0x800);
// other pointers got set in the loading routine, because they 'belong' to the cart itself
m_io_disksel = ioport("FLIPDISK");
@@ -98,13 +98,13 @@ void nes_state::machine_start()
space.install_write_handler(0x4020, 0x40ff, write8_delegate(FUNC(nes_cart_slot_device::write_ex), (nes_cart_slot_device *)m_cartslot));
}
- m_cartslot->pcb_start(m_ciram);
+ m_cartslot->pcb_start(m_ciram.get());
m_cartslot->m_cart->pcb_reg_postload(machine());
}
// register saves
save_item(NAME(m_last_frame_flip));
- save_pointer(NAME(m_ciram), 0x800);
+ save_pointer(NAME(m_ciram.get()), 0x800);
}
diff --git a/src/mame/machine/pce_cd.cpp b/src/mame/machine/pce_cd.cpp
index d9b9e5441ea..272a86c5ea9 100644
--- a/src/mame/machine/pce_cd.cpp
+++ b/src/mame/machine/pce_cd.cpp
@@ -91,12 +91,12 @@ pce_cd_device::pce_cd_device(const machine_config &mconfig, const char *tag, dev
void pce_cd_device::device_start()
{
/* Initialize BRAM */
- m_bram = auto_alloc_array(machine(), UINT8, PCE_BRAM_SIZE * 2);
- memset(m_bram, 0, PCE_BRAM_SIZE);
- memset(m_bram + PCE_BRAM_SIZE, 0xff, PCE_BRAM_SIZE);
+ m_bram = std::make_unique<UINT8[]>(PCE_BRAM_SIZE * 2);
+ memset(m_bram.get(), 0, PCE_BRAM_SIZE);
+ memset(m_bram.get() + PCE_BRAM_SIZE, 0xff, PCE_BRAM_SIZE);
m_bram_locked = 1;
- m_nvram->set_base(m_bram, PCE_BRAM_SIZE);
+ m_nvram->set_base(m_bram.get(), PCE_BRAM_SIZE);
/* set up adpcm related things */
m_adpcm_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ADPCM_RAM_SIZE);
@@ -113,7 +113,7 @@ void pce_cd_device::device_start()
m_data_buffer_size = 0;
m_data_buffer_index = 0;
- m_subcode_buffer = auto_alloc_array(machine(), UINT8, 96);
+ m_subcode_buffer = std::make_unique<UINT8[]>(96);
m_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::data_timer_callback),this));
m_data_timer->adjust(attotime::never);
@@ -134,7 +134,7 @@ void pce_cd_device::device_start()
// TODO: add proper restore for the cd data...
save_item(NAME(m_regs));
- save_pointer(NAME(m_bram), PCE_BRAM_SIZE * 2);
+ save_pointer(NAME(m_bram.get()), PCE_BRAM_SIZE * 2);
save_pointer(NAME(m_adpcm_ram), PCE_ADPCM_RAM_SIZE);
save_item(NAME(m_bram_locked));
save_item(NAME(m_adpcm_read_ptr));
@@ -183,7 +183,7 @@ void pce_cd_device::device_start()
save_item(NAME(m_last_frame));
save_item(NAME(m_cdda_status));
save_item(NAME(m_cdda_play_mode));
- save_pointer(NAME(m_subcode_buffer), 96);
+ save_pointer(NAME(m_subcode_buffer.get()), 96);
save_item(NAME(m_end_mark));
save_item(NAME(m_cdda_volume));
save_item(NAME(m_adpcm_volume));
diff --git a/src/mame/machine/pce_cd.h b/src/mame/machine/pce_cd.h
index e51d46908ce..9e9e4a484d0 100644
--- a/src/mame/machine/pce_cd.h
+++ b/src/mame/machine/pce_cd.h
@@ -96,7 +96,7 @@ private:
required_device<cpu_device> m_maincpu;
UINT8 m_regs[16];
- UINT8 *m_bram;
+ std::unique_ptr<UINT8[]> m_bram;
UINT8 *m_adpcm_ram;
int m_bram_locked;
int m_adpcm_read_ptr;
@@ -150,7 +150,7 @@ private:
UINT32 m_last_frame;
UINT8 m_cdda_status;
UINT8 m_cdda_play_mode;
- UINT8 *m_subcode_buffer;
+ std::unique_ptr<UINT8[]> m_subcode_buffer;
UINT8 m_end_mark;
required_device<msm5205_device> m_msm;
diff --git a/src/mame/machine/pgmprot_igs027a_type3.cpp b/src/mame/machine/pgmprot_igs027a_type3.cpp
index 24fc0c19ccd..429e7b2d170 100644
--- a/src/mame/machine/pgmprot_igs027a_type3.cpp
+++ b/src/mame/machine/pgmprot_igs027a_type3.cpp
@@ -69,7 +69,7 @@ WRITE32_MEMBER(pgm_arm_type3_state::svg_arm7_shareram_w )
READ16_MEMBER(pgm_arm_type3_state::svg_m68k_ram_r )
{
int ram_sel = (m_svg_ram_sel & 1) ^ 1;
- UINT16 *share16 = (UINT16 *)(m_svg_shareram[ram_sel & 1]);
+ UINT16 *share16 = (UINT16 *)(m_svg_shareram[ram_sel & 1].get());
return share16[BYTE_XOR_LE(offset)];
}
@@ -77,7 +77,7 @@ READ16_MEMBER(pgm_arm_type3_state::svg_m68k_ram_r )
WRITE16_MEMBER(pgm_arm_type3_state::svg_m68k_ram_w )
{
int ram_sel = (m_svg_ram_sel & 1) ^ 1;
- UINT16 *share16 = (UINT16 *)(m_svg_shareram[ram_sel & 1]);
+ UINT16 *share16 = (UINT16 *)(m_svg_shareram[ram_sel & 1].get());
COMBINE_DATA(&share16[BYTE_XOR_LE(offset)]);
}
@@ -207,12 +207,12 @@ MACHINE_CONFIG_END
void pgm_arm_type3_state::svg_basic_init()
{
pgm_basic_init();
- m_svg_shareram[0] = auto_alloc_array(machine(), UINT32, 0x20000 / 4);
- m_svg_shareram[1] = auto_alloc_array(machine(), UINT32, 0x20000 / 4);
+ m_svg_shareram[0] = std::make_unique<UINT32[]>(0x20000 / 4);
+ m_svg_shareram[1] = std::make_unique<UINT32[]>(0x20000 / 4);
m_svg_ram_sel = 0;
- save_pointer(NAME(m_svg_shareram[0]), 0x20000 / 4);
- save_pointer(NAME(m_svg_shareram[1]), 0x20000 / 4);
+ save_pointer(NAME(m_svg_shareram[0].get()), 0x20000 / 4);
+ save_pointer(NAME(m_svg_shareram[1].get()), 0x20000 / 4);
save_item(NAME(m_svg_ram_sel));
}
@@ -719,9 +719,9 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,dmnfrnt)
// we have to copy it to both shared ram regions because it reads from a different one before the attract story?
// could be a timing error? or shared ram behavior isn't how we think it is?
UINT16 *share16;
- share16 = (UINT16 *)(m_svg_shareram[1]);
+ share16 = (UINT16 *)(m_svg_shareram[1].get());
share16[0x158/2] = 0x0005;
- share16 = (UINT16 *)(m_svg_shareram[0]);
+ share16 = (UINT16 *)(m_svg_shareram[0].get());
share16[0x158/2] = 0x0005;
}
diff --git a/src/mame/machine/playch10.cpp b/src/mame/machine/playch10.cpp
index b9c6cf5d56a..ccda25a5384 100644
--- a/src/mame/machine/playch10.cpp
+++ b/src/mame/machine/playch10.cpp
@@ -42,7 +42,7 @@ void playch10_state::machine_start()
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this));
machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this),write8_delegate(FUNC(playch10_state::pc10_nt_w),this));
@@ -62,10 +62,10 @@ MACHINE_START_MEMBER(playch10_state,playch10_hboard)
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
- m_nt_ram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_nt_ram = std::make_unique<UINT8[]>(0x1000);
/* allocate vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0, 0x1fff, read8_delegate(FUNC(playch10_state::pc10_chr_r),this), write8_delegate(FUNC(playch10_state::pc10_chr_w),this));
machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(playch10_state::pc10_nt_r),this), write8_delegate(FUNC(playch10_state::pc10_nt_w),this));
@@ -299,29 +299,29 @@ void playch10_state::pc10_set_mirroring(int mirroring )
switch (mirroring)
{
case PPU_MIRROR_LOW:
- m_nametable[0] = m_nametable[1] = m_nametable[2] = m_nametable[3] = m_nt_ram;
+ m_nametable[0] = m_nametable[1] = m_nametable[2] = m_nametable[3] = m_nt_ram.get();
break;
case PPU_MIRROR_HIGH:
- m_nametable[0] = m_nametable[1] = m_nametable[2] = m_nametable[3] = m_nt_ram + 0x400;
+ m_nametable[0] = m_nametable[1] = m_nametable[2] = m_nametable[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_HORZ:
- m_nametable[0] = m_nt_ram;
- m_nametable[1] = m_nt_ram;
- m_nametable[2] = m_nt_ram + 0x400;
- m_nametable[3] = m_nt_ram + 0x400;
+ m_nametable[0] = m_nt_ram.get();
+ m_nametable[1] = m_nt_ram.get();
+ m_nametable[2] = m_nt_ram.get() + 0x400;
+ m_nametable[3] = m_nt_ram.get() + 0x400;
break;
case PPU_MIRROR_VERT:
- m_nametable[0] = m_nt_ram;
- m_nametable[1] = m_nt_ram + 0x400;
- m_nametable[2] = m_nt_ram;
- m_nametable[3] = m_nt_ram + 0x400;
+ m_nametable[0] = m_nt_ram.get();
+ m_nametable[1] = m_nt_ram.get() + 0x400;
+ m_nametable[2] = m_nt_ram.get();
+ m_nametable[3] = m_nt_ram.get()+ 0x400;
break;
case PPU_MIRROR_NONE:
default:
- m_nametable[0] = m_nt_ram;
- m_nametable[1] = m_nt_ram + 0x400;
- m_nametable[2] = m_nt_ram + 0x800;
- m_nametable[3] = m_nt_ram + 0xc00;
+ m_nametable[0] = m_nt_ram.get();
+ m_nametable[1] = m_nt_ram.get() + 0x400;
+ m_nametable[2] = m_nt_ram.get() + 0x800;
+ m_nametable[3] = m_nt_ram.get() + 0xc00;
break;
}
}
@@ -375,7 +375,7 @@ void playch10_state::set_videoram_bank( int first, int count, int bank, int size
for (i = 0; i < count; i++)
{
m_chr_page[i + first].writable = 1;
- m_chr_page[i + first].chr = m_vram + (((i * 0x400) + (bank * size * 0x400)) & 0x1fff);
+ m_chr_page[i + first].chr = m_vram.get() + (((i * 0x400) + (bank * size * 0x400)) & 0x1fff);
}
}
@@ -596,7 +596,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcbboard)
DRIVER_INIT_CALL(playch10);
/* allocate vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
/* set the mirroring here */
m_mirroring = PPU_MIRROR_VERT;
@@ -644,7 +644,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcdboard)
/* common init */
DRIVER_INIT_CALL(playch10);
/* allocate vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
/* special init */
set_videoram_bank(0, 8, 0, 8);
}
@@ -660,7 +660,7 @@ DRIVER_INIT_MEMBER(playch10_state,pcdboard_2)
DRIVER_INIT_CALL(pcdboard);
/* allocate vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
/* special init */
set_videoram_bank(0, 8, 0, 8);
}
@@ -1025,7 +1025,7 @@ DRIVER_INIT_MEMBER(playch10_state,pciboard)
DRIVER_INIT_CALL(playch10);
/* allocate vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
/* special init */
set_videoram_bank(0, 8, 0, 8);
}
@@ -1125,7 +1125,7 @@ DRIVER_INIT_MEMBER(playch10_state,pckboard)
DRIVER_INIT_CALL(playch10);
/* allocate vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
/* special init */
set_videoram_bank(0, 8, 0, 8);
}
diff --git a/src/mame/machine/radio86.cpp b/src/mame/machine/radio86.cpp
index 0f1f9360aa0..ef097a1dc48 100644
--- a/src/mame/machine/radio86.cpp
+++ b/src/mame/machine/radio86.cpp
@@ -36,8 +36,8 @@ DRIVER_INIT_MEMBER(radio86_state,radio86)
DRIVER_INIT_MEMBER(radio86_state,radioram)
{
DRIVER_INIT_CALL(radio86);
- m_radio_ram_disk = auto_alloc_array(machine(), UINT8, 0x20000);
- memset(m_radio_ram_disk,0,0x20000);
+ m_radio_ram_disk = std::make_unique<UINT8[]>(0x20000);
+ memset(m_radio_ram_disk.get(),0,0x20000);
}
READ8_MEMBER(radio86_state::radio86_8255_portb_r2)
{
diff --git a/src/mame/machine/rbisland.cpp b/src/mame/machine/rbisland.cpp
index fa86c0ff800..41e95d329c2 100644
--- a/src/mame/machine/rbisland.cpp
+++ b/src/mame/machine/rbisland.cpp
@@ -648,8 +648,8 @@ void rbisland_state::request_round_data( )
{
int round = m_CRAM[1][0x141]; /* 0...49 */
- memcpy(m_CRAM[1], CROM_BANK1, sizeof CROM_BANK1);
- memcpy(m_CRAM[2], CROM_BANK2, sizeof CROM_BANK2);
+ memcpy(m_CRAM[1].get(), CROM_BANK1, sizeof CROM_BANK1);
+ memcpy(m_CRAM[2].get(), CROM_BANK2, sizeof CROM_BANK2);
m_CRAM[1][1] = cchip_round_height[round] >> 0;
m_CRAM[1][2] = cchip_round_height[round] >> 8;
@@ -682,9 +682,9 @@ void rbisland_state::request_world_data( )
/* first two bytes in each bank are left unchanged */
- memcpy(m_CRAM[4] + 2, CROM_BANK4[world].data, CROM_BANK4[world].size);
- memcpy(m_CRAM[5] + 2, CROM_BANK5[world].data, CROM_BANK5[world].size);
- memcpy(m_CRAM[7] + 2, CROM_BANK7[world].data, CROM_BANK7[world].size);
+ memcpy(m_CRAM[4].get() + 2, CROM_BANK4[world].data, CROM_BANK4[world].size);
+ memcpy(m_CRAM[5].get() + 2, CROM_BANK5[world].data, CROM_BANK5[world].size);
+ memcpy(m_CRAM[7].get() + 2, CROM_BANK7[world].data, CROM_BANK7[world].size);
/* banks 5 and 6 are different in the extra version */
@@ -703,11 +703,11 @@ void rbisland_state::request_world_data( )
}
}
- memcpy(m_CRAM[6] + 2, CROM_BANK6_EXTRA, sizeof CROM_BANK6_EXTRA);
+ memcpy(m_CRAM[6].get() + 2, CROM_BANK6_EXTRA, sizeof CROM_BANK6_EXTRA);
}
else
{
- memcpy(m_CRAM[6] + 2, CROM_BANK6, sizeof CROM_BANK6);
+ memcpy(m_CRAM[6].get() + 2, CROM_BANK6, sizeof CROM_BANK6);
}
}
@@ -821,9 +821,9 @@ void rbisland_state::rbisland_cchip_init( int version )
for (i = 0; i < 8; i++)
{
- m_CRAM[i] = auto_alloc_array(machine(), UINT8, 0x400);
+ m_CRAM[i] = std::make_unique<UINT8[]>(0x400);
- save_pointer(m_CRAM[i], "cchip/m_CRAM[i]", 0x400, i);
+ save_pointer(m_CRAM[i].get(), "cchip/m_CRAM[i]", 0x400, i);
}
save_item(m_current_bank, "cchip/m_current_bank");
diff --git a/src/mame/machine/scramble.cpp b/src/mame/machine/scramble.cpp
index af667349e1c..80cca7a8016 100644
--- a/src/mame/machine/scramble.cpp
+++ b/src/mame/machine/scramble.cpp
@@ -623,8 +623,8 @@ WRITE8_MEMBER(scramble_state::harem_decrypt_clk_w)
bank = 0;
}
- membank("rombank")->set_base (m_harem_decrypted_data + 0x2000 * bank);
- membank("rombank_decrypted")->set_base (m_harem_decrypted_opcodes + 0x2000 * bank);
+ membank("rombank")->set_base (m_harem_decrypted_data.get() + 0x2000 * bank);
+ membank("rombank_decrypted")->set_base (m_harem_decrypted_opcodes.get() + 0x2000 * bank);
// logerror("%s: decrypt mode = %02x (bank %x) active\n", machine().describe_context(), m_harem_decrypt_mode, bank);
@@ -645,10 +645,11 @@ DRIVER_INIT_MEMBER(scramble_state,harem)
{
UINT8 *ROM = memregion("maincpu")->base() + 0x8000;
size_t size = 0x2000;
-
- UINT8 *data = m_harem_decrypted_data = auto_alloc_array(machine(), UINT8, size * 3);
- UINT8 *opcodes = m_harem_decrypted_opcodes = auto_alloc_array(machine(), UINT8, size * 3);
-
+
+ m_harem_decrypted_data = std::make_unique<UINT8[]>(size * 3);
+ UINT8 *data = m_harem_decrypted_data.get();
+ m_harem_decrypted_opcodes = std::make_unique<UINT8[]>(size * 3);
+ UINT8 *opcodes = m_harem_decrypted_opcodes.get();
// decryption 03
for (int i = 0; i < size; i++)
{
@@ -673,8 +674,8 @@ DRIVER_INIT_MEMBER(scramble_state,harem)
data [size * 2 + i] = BITSWAP8(x, 7,2,5,4,3,0,1,6);
}
- membank("rombank")->set_base (m_harem_decrypted_data);
- membank("rombank_decrypted")->set_base (m_harem_decrypted_opcodes);
+ membank("rombank")->set_base (m_harem_decrypted_data.get());
+ membank("rombank_decrypted")->set_base (m_harem_decrypted_opcodes.get());
save_item(NAME(m_harem_decrypt_mode));
save_item(NAME(m_harem_decrypt_bit));
diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp
index 86fb9114bc0..ac860bfb974 100644
--- a/src/mame/machine/sms.cpp
+++ b/src/mame/machine/sms.cpp
@@ -1301,12 +1301,12 @@ VIDEO_START_MEMBER(sms_state,gamegear)
m_prev_bitmap_copied = false;
m_main_scr->register_screen_bitmap(m_prev_bitmap);
m_main_scr->register_screen_bitmap(m_gg_sms_mode_bitmap);
- m_line_buffer = auto_alloc_array(machine(), int, 160 * 4);
+ m_line_buffer = std::make_unique<int[]>(160 * 4);
save_item(NAME(m_prev_bitmap_copied));
save_item(NAME(m_prev_bitmap));
save_item(NAME(m_gg_sms_mode_bitmap));
- save_pointer(NAME(m_line_buffer), 160 * 4);
+ save_pointer(NAME(m_line_buffer.get()), 160 * 4);
}
VIDEO_RESET_MEMBER(sms_state,gamegear)
@@ -1319,7 +1319,7 @@ VIDEO_RESET_MEMBER(sms_state,gamegear)
if (m_cartslot->exists() && m_cartslot->m_cart->get_sms_mode())
{
m_gg_sms_mode_bitmap.fill(rgb_t::black);
- memset(m_line_buffer, 0, 160 * 4 * sizeof(int));
+ memset(m_line_buffer.get(), 0, 160 * 4 * sizeof(int));
}
}
@@ -1370,7 +1370,7 @@ void sms_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 &
/* Process lines, but skip those already processed before */
for (sms_y2 = MAX(sms_min_y2, sms_y2); sms_y2 <= sms_max_y2; sms_y2++)
{
- int *combineline_buffer = m_line_buffer + (sms_y2 & 0x03) * 160;
+ int *combineline_buffer = m_line_buffer.get() + (sms_y2 & 0x03) * 160;
if (sms_y2 >= vdp_bitmap.cliprect().min_y && sms_y2 <= vdp_bitmap.cliprect().max_y)
{
@@ -1432,10 +1432,10 @@ void sms_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 &
int *line1, *line2, *line3, *line4;
/* Setup our source lines */
- line1 = m_line_buffer + ((sms_y + y_i - 1) & 0x03) * 160;
- line2 = m_line_buffer + ((sms_y + y_i - 0) & 0x03) * 160;
- line3 = m_line_buffer + ((sms_y + y_i + 1) & 0x03) * 160;
- line4 = m_line_buffer + ((sms_y + y_i + 2) & 0x03) * 160;
+ line1 = m_line_buffer.get() + ((sms_y + y_i - 1) & 0x03) * 160;
+ line2 = m_line_buffer.get() + ((sms_y + y_i - 0) & 0x03) * 160;
+ line3 = m_line_buffer.get() + ((sms_y + y_i + 1) & 0x03) * 160;
+ line4 = m_line_buffer.get() + ((sms_y + y_i + 2) & 0x03) * 160;
UINT32 *p_bitmap = &bitmap.pix32(visarea.min_y + plot_y_group + y_i, visarea.min_x);
diff --git a/src/mame/machine/starwars.cpp b/src/mame/machine/starwars.cpp
index 4caa47d9df1..75699bc50a0 100644
--- a/src/mame/machine/starwars.cpp
+++ b/src/mame/machine/starwars.cpp
@@ -156,9 +156,9 @@ void starwars_state::starwars_mproc_init()
UINT8 *src = memregion("user2")->base();
int cnt, val;
- m_PROM_STR = auto_alloc_array(machine(), UINT8, 1024);
- m_PROM_MAS = auto_alloc_array(machine(), UINT8, 1024);
- m_PROM_AM = auto_alloc_array(machine(), UINT8, 1024);
+ m_PROM_STR = std::make_unique<UINT8[]>(1024);
+ m_PROM_MAS = std::make_unique<UINT8[]>(1024);
+ m_PROM_AM = std::make_unique<UINT8[]>(1024);
for (cnt = 0; cnt < 1024; cnt++)
{
diff --git a/src/mame/machine/svi318.cpp b/src/mame/machine/svi318.cpp
index b34b6f381fc..445931485b4 100644
--- a/src/mame/machine/svi318.cpp
+++ b/src/mame/machine/svi318.cpp
@@ -409,12 +409,12 @@ DRIVER_INIT_MEMBER(svi318_state, svi318)
m_maincpu->set_input_line_vector(0, 0xff);
/* memory */
- m_empty_bank = auto_alloc_array(machine(), UINT8, 0x8000);
- memset(m_empty_bank, 0xff, 0x8000);
+ m_empty_bank = std::make_unique<UINT8[]>(0x8000);
+ memset(m_empty_bank.get(), 0xff, 0x8000);
- m_bank_low_ptr = m_empty_bank;
- m_bank_high1_ptr = m_empty_bank;
- m_bank_high2_ptr = m_empty_bank;
+ m_bank_low_ptr = m_empty_bank.get();
+ m_bank_high1_ptr = m_empty_bank.get();
+ m_bank_high2_ptr = m_empty_bank.get();
}
DRIVER_INIT_MEMBER(svi318_state, svi328_806)
@@ -535,7 +535,7 @@ void svi318_state::set_banks()
m_bank_low = (v & 1) ? ((v & 2) ? ((v & 8) ? SVI_INTERNAL : SVI_EXPRAM3) : SVI_EXPRAM2) : SVI_CART;
m_bank_high = (v & 4) ? ((v & 16) ? SVI_INTERNAL : SVI_EXPRAM3) : SVI_EXPRAM2;
- m_bank_low_ptr = m_empty_bank;
+ m_bank_low_ptr = m_empty_bank.get();
m_bank_low_read_only = 1;
switch (m_bank_low)
@@ -563,9 +563,9 @@ void svi318_state::set_banks()
break;
}
- m_bank_high1_ptr = m_empty_bank;
+ m_bank_high1_ptr = m_empty_bank.get();
m_bank_high1_read_only = 1;
- m_bank_high2_ptr = m_empty_bank;
+ m_bank_high2_ptr = m_empty_bank.get();
m_bank_high2_read_only = 1;
switch (m_bank_high)
@@ -607,9 +607,9 @@ void svi318_state::set_banks()
/* Check for special CART based banking */
if (m_bank_low == SVI_CART && (v & 0xc0 ) != 0xc0)
{
- m_bank_high1_ptr = m_empty_bank;
+ m_bank_high1_ptr = m_empty_bank.get();
m_bank_high1_read_only = 1;
- m_bank_high2_ptr = m_empty_bank;
+ m_bank_high2_ptr = m_empty_bank.get();
m_bank_high2_read_only = 1;
if (m_cart_rom && !(v & 0x80))
diff --git a/src/mame/machine/ti85.cpp b/src/mame/machine/ti85.cpp
index 069e8f7f6fa..c63bdc26776 100644
--- a/src/mame/machine/ti85.cpp
+++ b/src/mame/machine/ti85.cpp
@@ -211,7 +211,7 @@ void ti85_state::update_ti86_memory ()
if (m_ti8x_memory_page_1 & 0x40)
{
- ti8x_update_bank(space, 1, m_ti8x_ram, m_ti8x_memory_page_1 & 0x07, true);
+ ti8x_update_bank(space, 1, m_ti8x_ram.get(), m_ti8x_memory_page_1 & 0x07, true);
}
else
{
@@ -220,7 +220,7 @@ void ti85_state::update_ti86_memory ()
if (m_ti8x_memory_page_2 & 0x40)
{
- ti8x_update_bank(space, 2, m_ti8x_ram, m_ti8x_memory_page_2 & 0x07, true);
+ ti8x_update_bank(space, 2, m_ti8x_ram.get(), m_ti8x_memory_page_2 & 0x07, true);
}
else
{
@@ -438,16 +438,16 @@ MACHINE_START_MEMBER(ti85_state,ti86)
m_interrupt_speed = 0;
m_port4_bit0 = 0;
- m_ti8x_ram = auto_alloc_array(machine(), UINT8, 128*1024);
- memset(m_ti8x_ram, 0, sizeof(UINT8)*128*1024);
+ m_ti8x_ram = std::make_unique<UINT8[]>(128*1024);
+ memset(m_ti8x_ram.get(), 0, sizeof(UINT8)*128*1024);
space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios + 0x04000);
- membank("bank4")->set_base(m_ti8x_ram);
- machine().device<nvram_device>("nvram")->set_base(m_ti8x_ram, sizeof(UINT8)*128*1024);
+ membank("bank4")->set_base(m_ti8x_ram.get());
+ machine().device<nvram_device>("nvram")->set_base(m_ti8x_ram.get(), sizeof(UINT8)*128*1024);
machine().scheduler().timer_pulse(attotime::from_hz(256), timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback),this));
}
@@ -1129,7 +1129,7 @@ void ti85_state::ti86_setup_snapshot (UINT8 * data)
ti8x_snapshot_setup_registers ( data);
/* Memory dump */
- memcpy(m_ti8x_ram, data+0x94, 0x20000);
+ memcpy(m_ti8x_ram.get(), data+0x94, 0x20000);
m_keypad_mask = hdw[0x00]&0x7f;
diff --git a/src/mame/machine/vsnes.cpp b/src/mame/machine/vsnes.cpp
index 6970c948a46..0acb85626c5 100644
--- a/src/mame/machine/vsnes.cpp
+++ b/src/mame/machine/vsnes.cpp
@@ -188,12 +188,12 @@ MACHINE_START_MEMBER(vsnes_state,vsnes)
int i;
/* establish nametable ram */
- m_nt_ram[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_nt_ram[0] = std::make_unique<UINT8[]>(0x1000);
/* set mirroring */
- m_nt_page[0][0] = m_nt_ram[0];
- m_nt_page[0][1] = m_nt_ram[0] + 0x400;
- m_nt_page[0][2] = m_nt_ram[0] + 0x800;
- m_nt_page[0][3] = m_nt_ram[0] + 0xc00;
+ m_nt_page[0][0] = m_nt_ram[0].get();
+ m_nt_page[0][1] = m_nt_ram[0].get() + 0x400;
+ m_nt_page[0][2] = m_nt_ram[0].get() + 0x800;
+ m_nt_page[0][3] = m_nt_ram[0].get() + 0xc00;
ppu1_space.install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this));
@@ -215,7 +215,7 @@ MACHINE_START_MEMBER(vsnes_state,vsnes)
}
else
{
- ppu1_space.install_ram(0x0000, 0x1fff, m_vram);
+ ppu1_space.install_ram(0x0000, 0x1fff, m_vram.get());
}
}
@@ -227,17 +227,17 @@ MACHINE_START_MEMBER(vsnes_state,vsdual)
m_vrom_size[1] = memregion("gfx2")->bytes();
/* establish nametable ram */
- m_nt_ram[0] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_nt_ram[1] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_nt_ram[0] = std::make_unique<UINT8[]>(0x1000);
+ m_nt_ram[1] = std::make_unique<UINT8[]>(0x1000);
/* set mirroring */
- m_nt_page[0][0] = m_nt_ram[0];
- m_nt_page[0][1] = m_nt_ram[0] + 0x400;
- m_nt_page[0][2] = m_nt_ram[0] + 0x800;
- m_nt_page[0][3] = m_nt_ram[0] + 0xc00;
- m_nt_page[1][0] = m_nt_ram[1];
- m_nt_page[1][1] = m_nt_ram[1] + 0x400;
- m_nt_page[1][2] = m_nt_ram[1] + 0x800;
- m_nt_page[1][3] = m_nt_ram[1] + 0xc00;
+ m_nt_page[0][0] = m_nt_ram[0].get();
+ m_nt_page[0][1] = m_nt_ram[0].get() + 0x400;
+ m_nt_page[0][2] = m_nt_ram[0].get() + 0x800;
+ m_nt_page[0][3] = m_nt_ram[0].get() + 0xc00;
+ m_nt_page[1][0] = m_nt_ram[1].get();
+ m_nt_page[1][1] = m_nt_ram[1].get() + 0x400;
+ m_nt_page[1][2] = m_nt_ram[1].get() + 0x800;
+ m_nt_page[1][3] = m_nt_ram[1].get() + 0xc00;
machine().device("ppu1")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),this));
machine().device("ppu2")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt1_r),this), write8_delegate(FUNC(vsnes_state::vsnes_nt1_w),this));
@@ -286,29 +286,29 @@ void vsnes_state::v_set_mirroring(int ppu, int mirroring)
switch (mirroring)
{
case PPU_MIRROR_LOW:
- m_nt_page[ppu][0] = m_nt_page[ppu][1] = m_nt_page[ppu][2] = m_nt_page[ppu][3] = m_nt_ram[ppu];
+ m_nt_page[ppu][0] = m_nt_page[ppu][1] = m_nt_page[ppu][2] = m_nt_page[ppu][3] = m_nt_ram[ppu].get();
break;
case PPU_MIRROR_HIGH:
- m_nt_page[ppu][0] = m_nt_page[ppu][1] = m_nt_page[ppu][2] = m_nt_page[ppu][3] = m_nt_ram[ppu] + 0x400;
+ m_nt_page[ppu][0] = m_nt_page[ppu][1] = m_nt_page[ppu][2] = m_nt_page[ppu][3] = m_nt_ram[ppu].get() + 0x400;
break;
case PPU_MIRROR_HORZ:
- m_nt_page[ppu][0] = m_nt_ram[ppu];
- m_nt_page[ppu][1] = m_nt_ram[ppu];
- m_nt_page[ppu][2] = m_nt_ram[ppu] + 0x400;
- m_nt_page[ppu][3] = m_nt_ram[ppu] + 0x400;
+ m_nt_page[ppu][0] = m_nt_ram[ppu].get();
+ m_nt_page[ppu][1] = m_nt_ram[ppu].get();
+ m_nt_page[ppu][2] = m_nt_ram[ppu].get() + 0x400;
+ m_nt_page[ppu][3] = m_nt_ram[ppu].get() + 0x400;
break;
case PPU_MIRROR_VERT:
- m_nt_page[ppu][0] = m_nt_ram[ppu];
- m_nt_page[ppu][1] = m_nt_ram[ppu] + 0x400;
- m_nt_page[ppu][2] = m_nt_ram[ppu];
- m_nt_page[ppu][3] = m_nt_ram[ppu] + 0x400;
+ m_nt_page[ppu][0] = m_nt_ram[ppu].get();
+ m_nt_page[ppu][1] = m_nt_ram[ppu].get() + 0x400;
+ m_nt_page[ppu][2] = m_nt_ram[ppu].get();
+ m_nt_page[ppu][3] = m_nt_ram[ppu].get() + 0x400;
break;
case PPU_MIRROR_NONE:
default:
- m_nt_page[ppu][0] = m_nt_ram[ppu];
- m_nt_page[ppu][1] = m_nt_ram[ppu] + 0x400;
- m_nt_page[ppu][2] = m_nt_ram[ppu] + 0x800;
- m_nt_page[ppu][3] = m_nt_ram[ppu] + 0xc00;
+ m_nt_page[ppu][0] = m_nt_ram[ppu].get();
+ m_nt_page[ppu][1] = m_nt_ram[ppu].get() + 0x400;
+ m_nt_page[ppu][2] = m_nt_ram[ppu].get() + 0x800;
+ m_nt_page[ppu][3] = m_nt_ram[ppu].get() + 0xc00;
break;
}
@@ -638,7 +638,7 @@ DRIVER_INIT_MEMBER(vsnes_state,vsvram)
m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(vsnes_state::vsvram_rom_banking),this));
/* allocate m_vram */
- m_vram = auto_alloc_array(machine(), UINT8, 0x2000);
+ m_vram = std::make_unique<UINT8[]>(0x2000);
}
/**********************************************************************************/
diff --git a/src/mame/machine/wswan.cpp b/src/mame/machine/wswan.cpp
index fefa9df670c..d6596c77676 100644
--- a/src/mame/machine/wswan.cpp
+++ b/src/mame/machine/wswan.cpp
@@ -169,8 +169,8 @@ void wswan_state::register_save()
void wswan_state::common_start()
{
- m_ws_bios_bank = auto_alloc_array(machine(), UINT8, 0x10000);
- memcpy(m_ws_bios_bank + 0xffc0, ws_fake_bios_code, 0x40);
+ m_ws_bios_bank = std::make_unique<UINT8[]>(0x10000);
+ memcpy(m_ws_bios_bank.get() + 0xffc0, ws_fake_bios_code, 0x40);
register_save();
diff --git a/src/mame/video/40love.cpp b/src/mame/video/40love.cpp
index 0a284915b3a..5cbd46c0d36 100644
--- a/src/mame/video/40love.cpp
+++ b/src/mame/video/40love.cpp
@@ -106,8 +106,8 @@ void fortyl_state::video_start()
m_pixram1 = auto_alloc_array_clear(machine(), UINT8, 0x4000);
m_pixram2 = auto_alloc_array_clear(machine(), UINT8, 0x4000);
- m_tmp_bitmap1 = auto_bitmap_ind16_alloc(machine(), 256, 256);
- m_tmp_bitmap2 = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_tmp_bitmap1 = std::make_unique<bitmap_ind16>(256, 256);
+ m_tmp_bitmap2 = std::make_unique<bitmap_ind16>(256, 256);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(fortyl_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
diff --git a/src/mame/video/733_asr.cpp b/src/mame/video/733_asr.cpp
index da1286d69f5..e9c446301a2 100644
--- a/src/mame/video/733_asr.cpp
+++ b/src/mame/video/733_asr.cpp
@@ -111,7 +111,7 @@ void asr733_device::device_start()
const rectangle &visarea = screen->visible_area();
m_last_key_pressed = 0x80;
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_bitmap = std::make_unique<bitmap_ind16>(width, height);
m_bitmap->fill(0, visarea);
diff --git a/src/mame/video/733_asr.h b/src/mame/video/733_asr.h
index 5329cd0094f..9c45c69c6ed 100644
--- a/src/mame/video/733_asr.h
+++ b/src/mame/video/733_asr.h
@@ -71,7 +71,7 @@ private:
int m_x;
- bitmap_ind16* m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
required_device<palette_device> m_palette;
required_device<gfxdecode_device> m_gfxdecode;
diff --git a/src/mame/video/antic.cpp b/src/mame/video/antic.cpp
index b01b7ba259e..fab29e17e69 100644
--- a/src/mame/video/antic.cpp
+++ b/src/mame/video/antic.cpp
@@ -65,7 +65,7 @@ void antic_device::device_start()
m_gtia = machine().device<gtia_device>(m_gtia_tag);
assert(m_gtia);
- m_bitmap = auto_bitmap_ind16_alloc(machine(), m_screen->width(), m_screen->height());
+ m_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height());
m_cclk_expand = auto_alloc_array_clear(machine(), UINT32, 21 * 256);
@@ -79,9 +79,9 @@ void antic_device::device_start()
m_pf_gtia2 = &m_cclk_expand[19 * 256];
m_pf_gtia3 = &m_cclk_expand[20 * 256];
- m_used_colors = auto_alloc_array(machine(), UINT8, 21 * 256);
+ m_used_colors = std::make_unique<UINT8[]>(21 * 256);
- memset(m_used_colors, 0, 21 * 256 * sizeof(UINT8));
+ memset(m_used_colors.get(), 0, 21 * 256 * sizeof(UINT8));
m_uc_21 = &m_used_colors[ 0 * 256];
m_uc_x10b = &m_used_colors[ 1 * 256];
@@ -134,7 +134,7 @@ void antic_device::device_start()
save_item(NAME(m_pmbits));
save_pointer(NAME(m_cclk_expand), 21 * 256);
- save_pointer(NAME(m_used_colors), 21 * 256);
+ save_pointer(NAME(m_used_colors.get()), 21 * 256);
}
diff --git a/src/mame/video/antic.h b/src/mame/video/antic.h
index b83afe9d8f2..5ddfbe81b22 100644
--- a/src/mame/video/antic.h
+++ b/src/mame/video/antic.h
@@ -447,7 +447,7 @@ private:
UINT32 *m_pf_gtia1; /* 1cclk gtia mode 1 */
UINT32 *m_pf_gtia2; /* 1cclk gtia mode 2 */
UINT32 *m_pf_gtia3; /* 1cclk gtia mode 3 */
- UINT8 *m_used_colors; /* shared buffer for the following: */
+ std::unique_ptr<UINT8[]> m_used_colors; /* shared buffer for the following: */
UINT8 *m_uc_21; /* used colors for txt (2,3) */
UINT8 *m_uc_x10b; /* used colors for txt 4,5, gfx D,E */
UINT8 *m_uc_3210b2; /* used colors for txt 6,7, gfx 9,B,C */
@@ -457,7 +457,7 @@ private:
UINT8 *m_uc_g1; /* used colors for gfx GTIA 1 */
UINT8 *m_uc_g2; /* used colors for gfx GTIA 2 */
UINT8 *m_uc_g3; /* used colors for gfx GTIA 3 */
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
void prio_init();
void cclk_init();
diff --git a/src/mame/video/apollo.cpp b/src/mame/video/apollo.cpp
index 2cebbc8b4bd..7d6cc7099ef 100644
--- a/src/mame/video/apollo.cpp
+++ b/src/mame/video/apollo.cpp
@@ -1246,7 +1246,7 @@ READ8_MEMBER( apollo_graphics_15i::apollo_ccr_r )
UINT8 apollo_graphics_15i::get_pixel(UINT32 offset, UINT16 mask)
{
UINT8 data = 0;
- UINT16 *source_ptr = m_image_memory + offset;
+ UINT16 *source_ptr = m_image_memory.get() + offset;
if (m_n_planes == 4)
{
@@ -1555,7 +1555,7 @@ UINT32 apollo_graphics_15i::screen_update(screen_device &screen, bitmap_rgb32 &b
void apollo_graphics_15i::screen_update1(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- UINT16 *source_ptr = m_image_memory;
+ UINT16 *source_ptr = m_image_memory.get();
int x, y;
UINT16 data, mask;
UINT16 inverse = (m_cr1 & CR1_INV) ? 0xffff : 0;
@@ -1872,14 +1872,14 @@ void apollo_graphics_15i::device_reset()
m_image_plane_size = m_buffer_height * m_buffer_width / 16;
m_image_memory_size = m_image_plane_size * m_n_planes;
m_image_memory
- = auto_alloc_array(machine(), UINT16, m_image_memory_size);
+ = std::make_unique<UINT16[]>(m_image_memory_size);
assert(m_image_memory != nullptr);
- MLOG1(("device reset apollo graphics: buffer=%p size=%0x", (void *) m_image_memory, m_image_memory_size));
+ MLOG1(("device reset apollo graphics: buffer=%p size=%0x", (void *) m_image_memory.get(), m_image_memory_size));
}
memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
- memset(m_image_memory, 0, m_image_memory_size * 2);
+ memset(m_image_memory.get(), 0, m_image_memory_size * 2);
// register_vblank_callback(this);
diff --git a/src/mame/video/apple2.cpp b/src/mame/video/apple2.cpp
index c62c9d02456..a496d3e3e15 100644
--- a/src/mame/video/apple2.cpp
+++ b/src/mame/video/apple2.cpp
@@ -500,10 +500,10 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram,
m_textgfx_datalen = memregion("gfx1")->bytes();
/* 2^3 dependent pixels * 2 color sets * 2 offsets */
- m_hires_artifact_map = auto_alloc_array(machine(), UINT16, 8 * 2 * 2);
+ m_hires_artifact_map = std::make_unique<UINT16[]>(8 * 2 * 2);
/* 2^4 dependent pixels */
- m_dhires_artifact_map = auto_alloc_array(machine(), UINT16, 16);
+ m_dhires_artifact_map = std::make_unique<UINT16[]>(16);
/* build hires artifact map */
for (i = 0; i < 8; i++)
@@ -704,7 +704,7 @@ void a2_video_device::device_start()
UINT16 c;
/* 2^3 dependent pixels * 2 color sets * 2 offsets */
- m_hires_artifact_map = auto_alloc_array(machine(), UINT16, 8 * 2 * 2);
+ m_hires_artifact_map = std::make_unique<UINT16[]>(8 * 2 * 2);
/* build hires artifact map */
for (i = 0; i < 8; i++)
@@ -731,7 +731,7 @@ void a2_video_device::device_start()
}
/* 2^4 dependent pixels */
- m_dhires_artifact_map = auto_alloc_array(machine(), UINT16, 16);
+ m_dhires_artifact_map = std::make_unique<UINT16[]>(16);
/* build double hires artifact map */
for (i = 0; i < 16; i++)
@@ -1283,7 +1283,7 @@ void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, co
// verified on h/w: setting dhires w/o 80col emulates a rev. 0 Apple ][ with no orange/blue
if (m_dhires)
{
- artifact_map_ptr = m_hires_artifact_map;
+ artifact_map_ptr = m_hires_artifact_map.get();
}
else
{
diff --git a/src/mame/video/apple2.h b/src/mame/video/apple2.h
index f28ed518c11..420a293a703 100644
--- a/src/mame/video/apple2.h
+++ b/src/mame/video/apple2.h
@@ -28,8 +28,8 @@ public:
bool m_dhires;
bool m_80col;
bool m_altcharset;
- UINT16 *m_hires_artifact_map;
- UINT16 *m_dhires_artifact_map;
+ std::unique_ptr<UINT16[]> m_hires_artifact_map;
+ std::unique_ptr<UINT16[]> m_dhires_artifact_map;
UINT8 *m_ram_ptr, *m_aux_ptr, *m_char_ptr;
int m_char_size;
diff --git a/src/mame/video/apple2gs.cpp b/src/mame/video/apple2gs.cpp
index fb00047c30a..1cefde0e248 100644
--- a/src/mame/video/apple2gs.cpp
+++ b/src/mame/video/apple2gs.cpp
@@ -19,7 +19,7 @@ VIDEO_START_MEMBER(apple2gs_state,apple2gs)
{
m_bordercolor = 0;
apple2_video_start(m_slowmem, m_slowmem+0x10000, 0, 8);
- m_legacy_gfx = auto_bitmap_ind16_alloc(machine(), 560, 192);
+ m_legacy_gfx = std::make_unique<bitmap_ind16>(560, 192);
save_item(m_bordercolor, "BORDERCLR");
save_item(NAME(m_fgcolor));
diff --git a/src/mame/video/apple3.cpp b/src/mame/video/apple3.cpp
index e733199bd87..06245b5ef80 100644
--- a/src/mame/video/apple3.cpp
+++ b/src/mame/video/apple3.cpp
@@ -125,7 +125,7 @@ VIDEO_START_MEMBER(apple3_state,apple3)
memset(m_char_mem, 0, 0x800);
- m_hgr_map = auto_alloc_array(machine(), UINT32, 192);
+ m_hgr_map = std::make_unique<UINT32[]>(192);
for (i = 0; i < 24; i++)
{
v = text_map[i] - 0x0400;
diff --git a/src/mame/video/arabian.cpp b/src/mame/video/arabian.cpp
index 0e0010cb708..e99bc95750c 100644
--- a/src/mame/video/arabian.cpp
+++ b/src/mame/video/arabian.cpp
@@ -161,10 +161,10 @@ void arabian_state::video_start()
/* allocate a common bitmap to use for both planes */
/* plane A (top plane with motion objects) is in the upper 4 bits */
/* plane B (bottom plane with playfield) is in the lower 4 bits */
- m_main_bitmap = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * BITMAP_HEIGHT);
+ m_main_bitmap = std::make_unique<UINT8[]>(BITMAP_WIDTH * BITMAP_HEIGHT);
/* allocate memory for the converted graphics data */
- m_converted_gfx = auto_alloc_array(machine(), UINT8, 0x8000 * 2);
+ m_converted_gfx = std::make_unique<UINT8[]>(0x8000 * 2);
/*--------------------------------------------------
transform graphics data into more usable format
@@ -207,8 +207,8 @@ void arabian_state::video_start()
m_converted_gfx[offs * 4 + 0] = p4;
}
- save_pointer(NAME(m_main_bitmap), BITMAP_WIDTH * BITMAP_HEIGHT);
- save_pointer(NAME(m_converted_gfx), 0x8000 * 2);
+ save_pointer(NAME(m_main_bitmap.get()), BITMAP_WIDTH * BITMAP_HEIGHT);
+ save_pointer(NAME(m_converted_gfx.get()), 0x8000 * 2);
save_item(NAME(m_video_control));
save_item(NAME(m_flip_screen));
}
diff --git a/src/mame/video/arcadia.cpp b/src/mame/video/arcadia.cpp
index 869439aef10..21d1c0066c8 100644
--- a/src/mame/video/arcadia.cpp
+++ b/src/mame/video/arcadia.cpp
@@ -306,7 +306,7 @@ void arcadia_state::video_start()
{
int width = m_screen->width();
int height = m_screen->height();
- m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_bitmap = std::make_unique<bitmap_ind16>(width, height);
}
}
diff --git a/src/mame/video/argus.cpp b/src/mame/video/argus.cpp
index 49577665bc4..4baa2323356 100644
--- a/src/mame/video/argus.cpp
+++ b/src/mame/video/argus.cpp
@@ -270,12 +270,12 @@ VIDEO_START_MEMBER(argus_state,argus)
m_tx_tilemap->set_transparent_pen(15);
/* dummy RAM for back ground */
- m_dummy_bg0ram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_dummy_bg0ram = std::make_unique<UINT8[]>(0x800);
save_item(NAME(m_bg_status));
save_item(NAME(m_flipscreen));
save_item(NAME(m_palette_intensity));
- save_pointer(NAME(m_dummy_bg0ram), 0x800);
+ save_pointer(NAME(m_dummy_bg0ram.get()), 0x800);
save_item(NAME(m_lowbitscroll));
save_item(NAME(m_prvscrollx));
}
@@ -286,7 +286,7 @@ VIDEO_RESET_MEMBER(argus_state,argus)
m_prvscrollx = 0;
m_bg0_scrollx[0] = 0;
m_bg0_scrollx[1] = 0;
- memset(m_dummy_bg0ram, 0, 0x800);
+ memset(m_dummy_bg0ram.get(), 0, 0x800);
reset_common();
}
@@ -324,8 +324,8 @@ VIDEO_START_MEMBER(argus_state,butasan)
m_bg1_tilemap->set_transparent_pen(15);
m_tx_tilemap->set_transparent_pen(15);
- m_butasan_pagedram[0] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_butasan_pagedram[1] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_butasan_pagedram[0] = std::make_unique<UINT8[]>(0x1000);
+ m_butasan_pagedram[1] = std::make_unique<UINT8[]>(0x1000);
m_butasan_bg0ram = &m_butasan_pagedram[0][0x000];
m_butasan_bg0backram = &m_butasan_pagedram[0][0x800];
@@ -335,8 +335,8 @@ VIDEO_START_MEMBER(argus_state,butasan)
save_item(NAME(m_bg_status));
save_item(NAME(m_flipscreen));
save_item(NAME(m_palette_intensity));
- save_pointer(NAME(m_butasan_pagedram[0]), 0x1000);
- save_pointer(NAME(m_butasan_pagedram[1]), 0x1000);
+ save_pointer(NAME(m_butasan_pagedram[0].get()), 0x1000);
+ save_pointer(NAME(m_butasan_pagedram[1].get()), 0x1000);
save_item(NAME(m_butasan_page_latch));
save_item(NAME(m_butasan_bg1_status));
save_item(NAME(m_butasan_unknown));
@@ -346,8 +346,8 @@ VIDEO_RESET_MEMBER(argus_state,butasan)
{
m_butasan_page_latch = 0;
m_butasan_bg1_status = 0x01;
- memset(m_butasan_pagedram[0], 0, 0x1000);
- memset(m_butasan_pagedram[1], 0, 0x1000);
+ memset(m_butasan_pagedram[0].get(), 0, 0x1000);
+ memset(m_butasan_pagedram[1].get(), 0, 0x1000);
reset_common();
}
diff --git a/src/mame/video/armedf.cpp b/src/mame/video/armedf.cpp
index 0b82b573edd..84c08f9c022 100644
--- a/src/mame/video/armedf.cpp
+++ b/src/mame/video/armedf.cpp
@@ -128,10 +128,10 @@ VIDEO_START_MEMBER(armedf_state,terraf)
if (m_scroll_type != 1)
m_tx_tilemap->set_scrollx(0, -128);
- m_text_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_text_videoram, 0x00, 0x1000);
+ m_text_videoram = std::make_unique<UINT8[]>(0x1000);
+ memset(m_text_videoram.get(), 0x00, 0x1000);
- save_pointer(NAME(m_text_videoram), 0x1000);
+ save_pointer(NAME(m_text_videoram.get()), 0x1000);
}
VIDEO_START_MEMBER(armedf_state,armedf)
@@ -150,10 +150,10 @@ VIDEO_START_MEMBER(armedf_state,armedf)
if (m_scroll_type != 1)
m_tx_tilemap->set_scrollx(0, -128);
- m_text_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_text_videoram, 0x00, 0x1000);
+ m_text_videoram = std::make_unique<UINT8[]>(0x1000);
+ memset(m_text_videoram.get(), 0x00, 0x1000);
- save_pointer(NAME(m_text_videoram), 0x1000);
+ save_pointer(NAME(m_text_videoram.get()), 0x1000);
}
/***************************************************************************
diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp
index 2df2fb11706..a26e2aff2e3 100644
--- a/src/mame/video/astrocde.cpp
+++ b/src/mame/video/astrocde.cpp
@@ -187,13 +187,13 @@ VIDEO_START_MEMBER(astrocde_state,profpac)
m_intoff_timer = timer_alloc(TIMER_INTERRUPT_OFF);
/* allocate videoram */
- m_profpac_videoram = auto_alloc_array(machine(), UINT16, 0x4000 * 4);
+ m_profpac_videoram = std::make_unique<UINT16[]>(0x4000 * 4);
/* register for save states */
init_savestate();
/* register our specific save state data */
- save_pointer(NAME(m_profpac_videoram), 0x4000 * 4);
+ save_pointer(NAME(m_profpac_videoram.get()), 0x4000 * 4);
save_item(NAME(m_profpac_palette));
save_item(NAME(m_profpac_colormap));
save_item(NAME(m_profpac_intercept));
@@ -924,7 +924,7 @@ void astrocde_state::init_sparklestar()
m_sparkle[0] = m_sparkle[1] = m_sparkle[2] = m_sparkle[3] = 0;
/* allocate memory for the sparkle/star array */
- m_sparklestar = auto_alloc_array(machine(), UINT8, RNG_PERIOD);
+ m_sparklestar = std::make_unique<UINT8[]>(RNG_PERIOD);
/* generate the data for the sparkle/star array */
for (shiftreg = i = 0; i < RNG_PERIOD; i++)
diff --git a/src/mame/video/bigevglf.cpp b/src/mame/video/bigevglf.cpp
index 0684433e3ca..b2e32d00a63 100644
--- a/src/mame/video/bigevglf.cpp
+++ b/src/mame/video/bigevglf.cpp
@@ -61,9 +61,9 @@ void bigevglf_state::video_start()
save_item(NAME(m_tmp_bitmap[2]));
save_item(NAME(m_tmp_bitmap[3]));
- m_vidram = auto_alloc_array(machine(), UINT8, 0x100 * 0x100 * 4);
+ m_vidram = std::make_unique<UINT8[]>(0x100 * 0x100 * 4);
- save_pointer(NAME(m_vidram), 0x100 * 0x100 * 4);
+ save_pointer(NAME(m_vidram.get()), 0x100 * 0x100 * 4);
}
void bigevglf_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/blktiger.cpp b/src/mame/video/blktiger.cpp
index c9e62949ed7..fe7363dbc2d 100644
--- a/src/mame/video/blktiger.cpp
+++ b/src/mame/video/blktiger.cpp
@@ -69,7 +69,7 @@ void blktiger_state::video_start()
m_objon = 1;
m_screen_layout = 0;
- m_scroll_ram = auto_alloc_array(machine(), UINT8, BGRAM_BANK_SIZE * BGRAM_BANKS);
+ m_scroll_ram = std::make_unique<UINT8[]>(BGRAM_BANK_SIZE * BGRAM_BANKS);
m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(blktiger_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg_tilemap8x4 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(blktiger_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(blktiger_state::bg8x4_scan),this), 16, 16, 128, 64);
@@ -86,7 +86,7 @@ void blktiger_state::video_start()
m_bg_tilemap4x8->set_transmask(2, 0xff00, 0x80ff);
m_bg_tilemap4x8->set_transmask(3, 0xf000, 0x8fff);
- save_pointer(NAME(m_scroll_ram), BGRAM_BANK_SIZE * BGRAM_BANKS);
+ save_pointer(NAME(m_scroll_ram.get()), BGRAM_BANK_SIZE * BGRAM_BANKS);
}
diff --git a/src/mame/video/btime.cpp b/src/mame/video/btime.cpp
index 8ce07c28918..bda913ffd58 100644
--- a/src/mame/video/btime.cpp
+++ b/src/mame/video/btime.cpp
@@ -128,7 +128,7 @@ VIDEO_START_MEMBER(btime_state,bnj)
/* the background area is twice as wide as the screen */
int width = 256;
int height = 256;
- m_background_bitmap = auto_bitmap_ind16_alloc(machine(), 2 * width, height);
+ m_background_bitmap = std::make_unique<bitmap_ind16>(2 * width, height);
save_item(NAME(*m_background_bitmap));
}
diff --git a/src/mame/video/carpolo.cpp b/src/mame/video/carpolo.cpp
index dbeb2e479e5..1cf3c51c57a 100644
--- a/src/mame/video/carpolo.cpp
+++ b/src/mame/video/carpolo.cpp
@@ -145,13 +145,13 @@ PALETTE_INIT_MEMBER(carpolo_state, carpolo)
void carpolo_state::video_start()
{
- m_sprite_sprite_collision_bitmap1 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
- m_sprite_sprite_collision_bitmap2 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
+ m_sprite_sprite_collision_bitmap1 = std::make_unique<bitmap_ind16>(SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
+ m_sprite_sprite_collision_bitmap2 = std::make_unique<bitmap_ind16>(SPRITE_WIDTH*2, SPRITE_HEIGHT*2);
- m_sprite_goal_collision_bitmap1 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
- m_sprite_goal_collision_bitmap2 = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
+ m_sprite_goal_collision_bitmap1 = std::make_unique<bitmap_ind16>(SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
+ m_sprite_goal_collision_bitmap2 = std::make_unique<bitmap_ind16>(SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT);
- m_sprite_border_collision_bitmap = auto_bitmap_ind16_alloc(machine(), SPRITE_WIDTH, SPRITE_HEIGHT);
+ m_sprite_border_collision_bitmap = std::make_unique<bitmap_ind16>(SPRITE_WIDTH, SPRITE_HEIGHT);
save_item(NAME(*m_sprite_sprite_collision_bitmap1));
save_item(NAME(*m_sprite_sprite_collision_bitmap2));
diff --git a/src/mame/video/cave.cpp b/src/mame/video/cave.cpp
index 19f051c0744..b89dc4b0bfa 100644
--- a/src/mame/video/cave.cpp
+++ b/src/mame/video/cave.cpp
@@ -75,7 +75,7 @@ PALETTE_INIT_MEMBER(cave_state,cave)
for (int chip = 0; chip < 4; chip++)
{
/* create a 1:1 palette map covering everything */
- m_palette_map[chip] = auto_alloc_array(machine(), UINT16, palette.entries());
+ m_palette_map[chip] = std::make_unique<UINT16[]>(palette.entries());
int maxpens = m_paletteram[chip].bytes() / 2;
if (!maxpens)
diff --git a/src/mame/video/cbasebal.cpp b/src/mame/video/cbasebal.cpp
index cd7a368de4f..c24370d5a2c 100644
--- a/src/mame/video/cbasebal.cpp
+++ b/src/mame/video/cbasebal.cpp
@@ -38,16 +38,16 @@ TILE_GET_INFO_MEMBER(cbasebal_state::get_fg_tile_info)
void cbasebal_state::video_start()
{
- m_textram = auto_alloc_array(machine(), UINT8, 0x1000);
- m_scrollram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_textram = std::make_unique<UINT8[]>(0x1000);
+ m_scrollram = std::make_unique<UINT8[]>(0x1000);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cbasebal_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cbasebal_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_fg_tilemap->set_transparent_pen(3);
- save_pointer(NAME(m_textram), 0x1000);
- save_pointer(NAME(m_scrollram), 0x1000);
+ save_pointer(NAME(m_textram.get()), 0x1000);
+ save_pointer(NAME(m_scrollram.get()), 0x1000);
}
diff --git a/src/mame/video/changela.cpp b/src/mame/video/changela.cpp
index 11de0e5269a..e9bdae5c878 100644
--- a/src/mame/video/changela.cpp
+++ b/src/mame/video/changela.cpp
@@ -21,8 +21,8 @@ Todo: Priority between tree0 and tree1.
void changela_state::video_start()
{
- m_memory_devices = auto_alloc_array(machine(), UINT8, 4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
- m_tree_ram = auto_alloc_array(machine(), UINT8, 2 * 0x20);
+ m_memory_devices = std::make_unique<UINT8[]>(4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
+ m_tree_ram = std::make_unique<UINT8[]>(2 * 0x20);
m_screen->register_screen_bitmap(m_obj0_bitmap);
m_screen->register_screen_bitmap(m_river_bitmap);
@@ -32,8 +32,8 @@ void changela_state::video_start()
m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(changela_state::changela_scanline_callback),this));
m_scanline_timer->adjust(m_screen->time_until_pos(30), 30);
- save_pointer(NAME(m_memory_devices), 4 * 0x800);
- save_pointer(NAME(m_tree_ram), 2 * 0x20);
+ save_pointer(NAME(m_memory_devices.get()), 4 * 0x800);
+ save_pointer(NAME(m_tree_ram.get()), 2 * 0x20);
}
/**************************************************************************
@@ -173,9 +173,9 @@ void changela_state::draw_river( bitmap_ind16 &bitmap, int sy )
int sx, i, j;
UINT8* ROM = memregion("user2")->base();
- UINT8* RAM = m_memory_devices + 0x800;
+ UINT8* RAM = m_memory_devices.get() + 0x800;
UINT8* TILE_ROM = memregion("gfx1")->base();
- UINT8* TILE_RAM = m_memory_devices + 0x1000;
+ UINT8* TILE_RAM = m_memory_devices.get() + 0x1000;
UINT8* PROM = memregion("proms")->base();
int preload = ((sy < 32) ? 1 : 0);
@@ -352,13 +352,13 @@ void changela_state::draw_tree( bitmap_ind16 &bitmap, int sy, int tree_num )
/* State machine */
UINT8* ROM = memregion("user2")->base();
- UINT8* RAM = m_memory_devices + 0x840 + 0x40 * tree_num;
+ UINT8* RAM = m_memory_devices.get() + 0x840 + 0x40 * tree_num;
UINT8* PROM = memregion("proms")->base();
/* Tree Data */
- UINT8* RAM2 = m_tree_ram + 0x20 * tree_num;
+ UINT8* RAM2 = m_tree_ram.get() + 0x20 * tree_num;
UINT8* TILE_ROM = (tree_num ? (memregion("user3")->base() + 0x1000) : (memregion("gfx1")->base() + 0x2000));
- UINT8* TILE_RAM = (tree_num ? (memregion("user3")->base()) : (m_memory_devices + 0x1800));
+ UINT8* TILE_RAM = (tree_num ? (memregion("user3")->base()) : (m_memory_devices.get() + 0x1800));
int preload = ((sy < 32) ? 1 : 0);
diff --git a/src/mame/video/cheekyms.cpp b/src/mame/video/cheekyms.cpp
index 99a98580f82..572c2476575 100644
--- a/src/mame/video/cheekyms.cpp
+++ b/src/mame/video/cheekyms.cpp
@@ -96,7 +96,7 @@ void cheekyms_state::video_start()
width = m_screen->width();
height = m_screen->height();
- m_bitmap_buffer = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_bitmap_buffer = std::make_unique<bitmap_ind16>(width, height);
m_cm_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cheekyms_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_cm_tilemap->set_transparent_pen(0);
diff --git a/src/mame/video/cloak.cpp b/src/mame/video/cloak.cpp
index d0951091be2..b9916328679 100644
--- a/src/mame/video/cloak.cpp
+++ b/src/mame/video/cloak.cpp
@@ -49,7 +49,7 @@ WRITE8_MEMBER(cloak_state::cloak_paletteram_w)
void cloak_state::set_pen(int i)
{
- UINT16 *palette_ram = m_palette_ram;
+ UINT16 *palette_ram = m_palette_ram.get();
static const int resistances[3] = { 10000, 4700, 2200 };
double weights[3];
@@ -86,8 +86,8 @@ void cloak_state::set_pen(int i)
void cloak_state::set_current_bitmap_videoram_pointer()
{
- m_current_bitmap_videoram_accessed = m_bitmap_videoram_selected ? m_bitmap_videoram1 : m_bitmap_videoram2;
- m_current_bitmap_videoram_displayed = m_bitmap_videoram_selected ? m_bitmap_videoram2 : m_bitmap_videoram1;
+ m_current_bitmap_videoram_accessed = m_bitmap_videoram_selected ? m_bitmap_videoram1.get() : m_bitmap_videoram2.get();
+ m_current_bitmap_videoram_displayed = m_bitmap_videoram_selected ? m_bitmap_videoram2.get() : m_bitmap_videoram1.get();
}
WRITE8_MEMBER(cloak_state::cloak_clearbmp_w)
@@ -163,18 +163,18 @@ void cloak_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cloak_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- m_bitmap_videoram1 = auto_alloc_array(machine(), UINT8, 256*256);
- m_bitmap_videoram2 = auto_alloc_array(machine(), UINT8, 256*256);
- m_palette_ram = auto_alloc_array(machine(), UINT16, NUM_PENS);
+ m_bitmap_videoram1 = std::make_unique<UINT8[]>(256*256);
+ m_bitmap_videoram2 = std::make_unique<UINT8[]>(256*256);
+ m_palette_ram = std::make_unique<UINT16[]>(NUM_PENS);
set_current_bitmap_videoram_pointer();
save_item(NAME(m_bitmap_videoram_address_x));
save_item(NAME(m_bitmap_videoram_address_y));
save_item(NAME(m_bitmap_videoram_selected));
- save_pointer(NAME(m_bitmap_videoram1), 256*256);
- save_pointer(NAME(m_bitmap_videoram2), 256*256);
- save_pointer(NAME(m_palette_ram), NUM_PENS);
+ save_pointer(NAME(m_bitmap_videoram1.get()), 256*256);
+ save_pointer(NAME(m_bitmap_videoram2.get()), 256*256);
+ save_pointer(NAME(m_palette_ram.get()), NUM_PENS);
machine().save().register_postload(save_prepost_delegate(FUNC(cloak_state::set_current_bitmap_videoram_pointer), this));
}
diff --git a/src/mame/video/cloud9.cpp b/src/mame/video/cloud9.cpp
index 0db0912de0a..23f382a9751 100644
--- a/src/mame/video/cloud9.cpp
+++ b/src/mame/video/cloud9.cpp
@@ -22,8 +22,8 @@ void cloud9_state::video_start()
static const int resistances[3] = { 22000, 10000, 4700 };
/* allocate second bank of videoram */
- m_videoram = auto_alloc_array(machine(), UINT8, 0x8000);
- membank("bank1")->set_base(m_videoram);
+ m_videoram = std::make_unique<UINT8[]>(0x8000);
+ membank("bank1")->set_base(m_videoram.get());
/* get pointers to our PROMs */
m_syncprom = memregion("proms")->base() + 0x000;
@@ -40,7 +40,7 @@ void cloud9_state::video_start()
m_screen->register_screen_bitmap(m_spritebitmap);
/* register for savestates */
- save_pointer(NAME(m_videoram), 0x8000);
+ save_pointer(NAME(m_videoram.get()), 0x8000);
save_item(NAME(m_video_control));
save_item(NAME(m_bitmode_addr));
}
diff --git a/src/mame/video/contra.cpp b/src/mame/video/contra.cpp
index 4e639e9e7ba..2728f0378ac 100644
--- a/src/mame/video/contra.cpp
+++ b/src/mame/video/contra.cpp
@@ -147,8 +147,8 @@ void contra_state::video_start()
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(contra_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(contra_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- m_buffered_spriteram = auto_alloc_array(machine(), UINT8, 0x800);
- m_buffered_spriteram_2 = auto_alloc_array(machine(), UINT8, 0x800);
+ m_buffered_spriteram = std::make_unique<UINT8[]>(0x800);
+ m_buffered_spriteram_2 = std::make_unique<UINT8[]>(0x800);
m_bg_clip = m_screen->visible_area();
m_bg_clip.min_x += 40;
@@ -161,8 +161,8 @@ void contra_state::video_start()
m_fg_tilemap->set_transparent_pen(0);
- save_pointer(NAME(m_buffered_spriteram), 0x800);
- save_pointer(NAME(m_buffered_spriteram_2), 0x800);
+ save_pointer(NAME(m_buffered_spriteram.get()), 0x800);
+ save_pointer(NAME(m_buffered_spriteram_2.get()), 0x800);
}
@@ -215,9 +215,9 @@ WRITE8_MEMBER(contra_state::contra_K007121_ctrl_0_w)
if (offset == 3)
{
if ((data & 0x8) == 0)
- memcpy(m_buffered_spriteram, m_spriteram + 0x800, 0x800);
+ memcpy(m_buffered_spriteram.get(), m_spriteram + 0x800, 0x800);
else
- memcpy(m_buffered_spriteram, m_spriteram, 0x800);
+ memcpy(m_buffered_spriteram.get(), m_spriteram, 0x800);
}
if (offset == 6)
@@ -239,9 +239,9 @@ WRITE8_MEMBER(contra_state::contra_K007121_ctrl_1_w)
if (offset == 3)
{
if ((data & 0x8) == 0)
- memcpy(m_buffered_spriteram_2, m_spriteram + 0x2800, 0x800);
+ memcpy(m_buffered_spriteram_2.get(), m_spriteram + 0x2800, 0x800);
else
- memcpy(m_buffered_spriteram_2, m_spriteram + 0x2000, 0x800);
+ memcpy(m_buffered_spriteram_2.get(), m_spriteram + 0x2000, 0x800);
}
if (offset == 6)
{
@@ -270,9 +270,9 @@ void contra_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
const UINT8 *source;
if (bank == 0)
- source = m_buffered_spriteram;
+ source = m_buffered_spriteram.get();
else
- source = m_buffered_spriteram_2;
+ source = m_buffered_spriteram_2.get();
k007121->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(bank), m_palette, source, base_color, 40, 0, priority_bitmap, (UINT32)-1);
}
diff --git a/src/mame/video/crgolf.cpp b/src/mame/video/crgolf.cpp
index 96d9664de6c..9934a78a5b9 100644
--- a/src/mame/video/crgolf.cpp
+++ b/src/mame/video/crgolf.cpp
@@ -92,12 +92,12 @@ void crgolf_state::get_pens( pen_t *pens )
VIDEO_START_MEMBER(crgolf_state,crgolf)
{
/* allocate memory for the two bitmaps */
- m_videoram_a = auto_alloc_array(machine(), UINT8, VIDEORAM_SIZE);
- m_videoram_b = auto_alloc_array(machine(), UINT8, VIDEORAM_SIZE);
+ m_videoram_a = std::make_unique<UINT8[]>(VIDEORAM_SIZE);
+ m_videoram_b = std::make_unique<UINT8[]>(VIDEORAM_SIZE);
/* register for save states */
- save_pointer(NAME(m_videoram_a), VIDEORAM_SIZE);
- save_pointer(NAME(m_videoram_b), VIDEORAM_SIZE);
+ save_pointer(NAME(m_videoram_a.get()), VIDEORAM_SIZE);
+ save_pointer(NAME(m_videoram_b.get()), VIDEORAM_SIZE);
}
diff --git a/src/mame/video/crt.cpp b/src/mame/video/crt.cpp
index e69fcfa9b70..524696f7e17 100644
--- a/src/mame/video/crt.cpp
+++ b/src/mame/video/crt.cpp
@@ -71,7 +71,7 @@ void crt_device::device_start()
{
/* alloc the arrays */
m_list = auto_alloc_array(machine(), crt_point, m_window_width * m_window_height);
- m_list_head = auto_alloc_array(machine(), int, m_window_height);
+ m_list_head = std::make_unique<int[]>(m_window_height);
/* fill with black and set up list as empty */
for (int i = 0; i < (m_window_width * m_window_height); i++)
diff --git a/src/mame/video/crt.h b/src/mame/video/crt.h
index 10d4b6e8539..41eb10da2a1 100644
--- a/src/mame/video/crt.h
+++ b/src/mame/video/crt.h
@@ -73,7 +73,7 @@ protected:
private:
crt_point *m_list; /* array of (crt_window_width*crt_window_height) point */
- int *m_list_head; /* head of the list of lit pixels (index in the array) */
+ std::unique_ptr<int[]> m_list_head; /* head of the list of lit pixels (index in the array) */
/* keep a separate list for each display line (makes the video code slightly faster) */
int m_decay_counter; /* incremented each frame (tells for how many frames the CRT has decayed between two screen refresh) */
diff --git a/src/mame/video/dcheese.cpp b/src/mame/video/dcheese.cpp
index 0bef838655b..98cfaa3611e 100644
--- a/src/mame/video/dcheese.cpp
+++ b/src/mame/video/dcheese.cpp
@@ -97,7 +97,7 @@ void dcheese_state::device_timer(emu_timer &timer, device_timer_id id, int param
void dcheese_state::video_start()
{
/* the destination bitmap is not directly accessible to the CPU */
- m_dstbitmap = auto_bitmap_ind16_alloc(machine(), DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT);
+ m_dstbitmap = std::make_unique<bitmap_ind16>(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT);
/* create a timer */
m_blitter_timer = timer_alloc(TIMER_BLITTER_SCANLINE);
diff --git a/src/mame/video/deco32.cpp b/src/mame/video/deco32.cpp
index eed824f4067..ef1874db2c9 100644
--- a/src/mame/video/deco32.cpp
+++ b/src/mame/video/deco32.cpp
@@ -165,27 +165,27 @@ VIDEO_START_MEMBER(deco32_state,captaven)
VIDEO_START_MEMBER(deco32_state,fghthist)
{
- m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ m_dirty_palette = std::make_unique<UINT8[]>(4096);
m_sprgen->alloc_sprite_bitmap();
m_has_ace_ram=0;
- save_pointer(NAME(m_dirty_palette), 4096);
+ save_pointer(NAME(m_dirty_palette.get()), 4096);
deco32_state::video_start();
}
VIDEO_START_MEMBER(deco32_state,nslasher)
{
int width, height;
- m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ m_dirty_palette = std::make_unique<UINT8[]>(4096);
width = m_screen->width();
height = m_screen->height();
- m_tilemap_alpha_bitmap=auto_bitmap_ind16_alloc(machine(), width, height );
+ m_tilemap_alpha_bitmap=std::make_unique<bitmap_ind16>(width, height );
m_sprgen1->alloc_sprite_bitmap();
m_sprgen2->alloc_sprite_bitmap();
- memset(m_dirty_palette,0,4096);
+ memset(m_dirty_palette.get(),0,4096);
m_has_ace_ram=1;
- save_pointer(NAME(m_dirty_palette), 4096);
+ save_pointer(NAME(m_dirty_palette.get()), 4096);
save_item(NAME(m_ace_ram_dirty));
save_item(NAME(m_spriteram16_2));
save_item(NAME(m_spriteram16_2_buffered));
@@ -203,28 +203,28 @@ void dragngun_state::video_start()
VIDEO_START_MEMBER(dragngun_state,dragngun)
{
- m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ m_dirty_palette = std::make_unique<UINT8[]>(4096);
m_screen->register_screen_bitmap(m_temp_render_bitmap);
- memset(m_dirty_palette,0,4096);
+ memset(m_dirty_palette.get(),0,4096);
m_has_ace_ram=0;
save_item(NAME(m_sprite_ctrl));
- save_pointer(NAME(m_dirty_palette), 4096);
+ save_pointer(NAME(m_dirty_palette.get()), 4096);
}
VIDEO_START_MEMBER(dragngun_state,lockload)
{
- m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ m_dirty_palette = std::make_unique<UINT8[]>(4096);
m_screen->register_screen_bitmap(m_temp_render_bitmap);
- memset(m_dirty_palette,0,4096);
+ memset(m_dirty_palette.get(),0,4096);
m_has_ace_ram=0;
save_item(NAME(m_sprite_ctrl));
- save_pointer(NAME(m_dirty_palette), 4096);
+ save_pointer(NAME(m_dirty_palette.get()), 4096);
}
/******************************************************************************/
diff --git a/src/mame/video/deco_mlc.cpp b/src/mame/video/deco_mlc.cpp
index 808b177bf91..a419d2c9846 100644
--- a/src/mame/video/deco_mlc.cpp
+++ b/src/mame/video/deco_mlc.cpp
@@ -24,15 +24,15 @@ VIDEO_START_MEMBER(deco_mlc_state,mlc)
else
m_colour_mask=0x1f;
-// temp_bitmap = auto_bitmap_rgb32_alloc( machine(), 512, 512 );
- m_mlc_buffered_spriteram = auto_alloc_array(machine(), UINT16, 0x3000/2);
- m_mlc_spriteram_spare = auto_alloc_array(machine(), UINT16, 0x3000/2);
- m_mlc_spriteram = auto_alloc_array(machine(), UINT16, 0x3000/2);
+// temp_bitmap = std::make_unique<bitmap_rgb32>(512, 512 );
+ m_mlc_buffered_spriteram = std::make_unique<UINT16[]>(0x3000/2);
+ m_mlc_spriteram_spare = std::make_unique<UINT16[]>(0x3000/2);
+ m_mlc_spriteram = std::make_unique<UINT16[]>(0x3000/2);
- save_pointer(NAME(m_mlc_spriteram), 0x3000/2);
- save_pointer(NAME(m_mlc_spriteram_spare), 0x3000/2);
- save_pointer(NAME(m_mlc_buffered_spriteram), 0x3000/2);
+ save_pointer(NAME(m_mlc_spriteram.get()), 0x3000/2);
+ save_pointer(NAME(m_mlc_spriteram_spare.get()), 0x3000/2);
+ save_pointer(NAME(m_mlc_buffered_spriteram.get()), 0x3000/2);
}
@@ -153,7 +153,7 @@ void deco_mlc_state::draw_sprites( const rectangle &cliprect, int scanline, UINT
int clipper=0;
rectangle user_clip;
- UINT16* mlc_spriteram=m_mlc_buffered_spriteram; // spriteram32
+ UINT16* mlc_spriteram=m_mlc_buffered_spriteram.get(); // spriteram32
//printf("%d - (%08x %08x %08x) (%08x %08x %08x) (%08x %08x %08x)\n", scanline, m_irq_ram[6], m_irq_ram[7], m_irq_ram[8], m_irq_ram[9], m_irq_ram[10], m_irq_ram[11] , m_irq_ram[12] , m_irq_ram[13] , m_irq_ram[14]);
@@ -547,7 +547,7 @@ void deco_mlc_state::screen_eof_mlc(screen_device &screen, bool state)
lookup table. Without buffering incorrect one frame glitches are seen
in several places, especially in Hoops.
*/
- memcpy(m_mlc_buffered_spriteram, m_mlc_spriteram, 0x3000/2);
+ memcpy(m_mlc_buffered_spriteram.get(), m_mlc_spriteram.get(), 0x3000/2);
}
}
diff --git a/src/mame/video/dogfgt.cpp b/src/mame/video/dogfgt.cpp
index 82c400233a8..b925444b866 100644
--- a/src/mame/video/dogfgt.cpp
+++ b/src/mame/video/dogfgt.cpp
@@ -70,8 +70,8 @@ void dogfgt_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dogfgt_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- m_bitmapram = auto_alloc_array(machine(), UINT8, BITMAPRAM_SIZE);
- save_pointer(NAME(m_bitmapram), BITMAPRAM_SIZE);
+ m_bitmapram = std::make_unique<UINT8[]>(BITMAPRAM_SIZE);
+ save_pointer(NAME(m_bitmapram.get()), BITMAPRAM_SIZE);
m_screen->register_screen_bitmap(m_pixbitmap);
save_item(NAME(m_pixbitmap));
diff --git a/src/mame/video/drmicro.cpp b/src/mame/video/drmicro.cpp
index 446dbc49b32..06fefd17cbb 100644
--- a/src/mame/video/drmicro.cpp
+++ b/src/mame/video/drmicro.cpp
@@ -102,8 +102,8 @@ PALETTE_INIT_MEMBER(drmicro_state, drmicro)
void drmicro_state::video_start()
{
- m_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
- save_pointer(NAME(m_videoram), 0x1000);
+ m_videoram = std::make_unique<UINT8[]>(0x1000);
+ save_pointer(NAME(m_videoram.get()), 0x1000);
m_bg1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(drmicro_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(drmicro_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
diff --git a/src/mame/video/dynax.cpp b/src/mame/video/dynax.cpp
index 6c179631645..70a00ce5e80 100644
--- a/src/mame/video/dynax.cpp
+++ b/src/mame/video/dynax.cpp
@@ -868,52 +868,52 @@ void dynax_state::dynax_common_reset()
VIDEO_START_MEMBER(dynax_state,hanamai)
{
- m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[3][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[3][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[0][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[3][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[3][1] = std::make_unique<UINT8[]>(256 * 256);
dynax_common_reset();
m_layer_layout = LAYOUT_HANAMAI;
- save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[3][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[3][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][1].get()), 256 * 256);
}
VIDEO_START_MEMBER(dynax_state,hnoridur)
{
- m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[3][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[3][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[0][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[3][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[3][1] = std::make_unique<UINT8[]>(256 * 256);
dynax_common_reset();
m_layer_layout = LAYOUT_HNORIDUR;
m_priority_table = priority_hnoridur;
- save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[3][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[3][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][1].get()), 256 * 256);
}
VIDEO_START_MEMBER(dynax_state,mcnpshnt)
@@ -924,76 +924,76 @@ VIDEO_START_MEMBER(dynax_state,mcnpshnt)
VIDEO_START_MEMBER(dynax_state,sprtmtch)
{
- m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[0][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][1] = std::make_unique<UINT8[]>(256 * 256);
dynax_common_reset();
m_layer_layout = LAYOUT_DRGPUNCH;
- save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1].get()), 256 * 256);
}
VIDEO_START_MEMBER(dynax_state,jantouki)
{
- m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[0][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[2][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[3][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[3][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[4][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[4][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[5][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[5][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[6][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[6][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[7][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[7][1] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[0][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[2][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[3][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[3][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[4][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[4][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[5][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[5][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[6][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[6][1] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[7][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[7][1] = std::make_unique<UINT8[]>(256 * 256);
dynax_common_reset();
m_layer_layout = LAYOUT_JANTOUKI;
m_update_irq_func = &dynax_state::jantouki_update_irq;
- save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[0][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[2][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[3][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[3][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[4][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[4][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[5][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[5][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[6][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[6][1]), 256 * 256);
- save_pointer(NAME(m_pixmap[7][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[7][1]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[2][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[3][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[4][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[4][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[5][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[5][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[6][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[6][1].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[7][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[7][1].get()), 256 * 256);
}
VIDEO_START_MEMBER(dynax_state,mjdialq2)
{
- m_pixmap[0][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_pixmap[1][0] = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_pixmap[0][0] = std::make_unique<UINT8[]>(256 * 256);
+ m_pixmap[1][0] = std::make_unique<UINT8[]>(256 * 256);
dynax_common_reset();
m_layer_layout = LAYOUT_MJDIALQ2;
m_update_irq_func = nullptr;
- save_pointer(NAME(m_pixmap[0][0]), 256 * 256);
- save_pointer(NAME(m_pixmap[1][0]), 256 * 256);
+ save_pointer(NAME(m_pixmap[0][0].get()), 256 * 256);
+ save_pointer(NAME(m_pixmap[1][0].get()), 256 * 256);
}
VIDEO_START_MEMBER(dynax_state,mjelctrn)
@@ -1055,8 +1055,8 @@ void dynax_state::hanamai_copylayer(bitmap_ind16 &bitmap, const rectangle &clipr
{
int dy, length, pen;
- UINT8 *src1 = m_pixmap[i][1];
- UINT8 *src2 = m_pixmap[i][0];
+ UINT8 *src1 = m_pixmap[i][1].get();
+ UINT8 *src2 = m_pixmap[i][0].get();
int palbase = 16 * color;
@@ -1121,8 +1121,8 @@ void dynax_state::jantouki_copylayer( bitmap_ind16 &bitmap, const rectangle &cli
{
int dy, length, pen;
- UINT8 *src1 = m_pixmap[i][1];
- UINT8 *src2 = m_pixmap[i][0];
+ UINT8 *src1 = m_pixmap[i][1].get();
+ UINT8 *src2 = m_pixmap[i][0].get();
int palbase = 16 * color;
@@ -1184,7 +1184,7 @@ void dynax_state::mjdialq2_copylayer( bitmap_ind16 &bitmap, const rectangle &cli
{
int dy, length, pen;
- UINT8 *src = m_pixmap[i][0];
+ UINT8 *src = m_pixmap[i][0].get();
int palbase = 16 * color;
@@ -1288,10 +1288,10 @@ int dynax_state::debug_viewer(bitmap_ind16 &bitmap, const rectangle &cliprect )
m_blit_palbank = (c >> 4) & 1;
bitmap.fill(0, cliprect);
- memset(m_pixmap[0][0], 0, sizeof(UINT8) * 0x100 * 0x100);
+ memset(m_pixmap[0][0].get(), 0, sizeof(UINT8) * 0x100 * 0x100);
if (m_layer_layout != LAYOUT_MJDIALQ2)
- memset(m_pixmap[0][1], 0, sizeof(UINT8) * 0x100 * 0x100);
+ memset(m_pixmap[0][1].get(), 0, sizeof(UINT8) * 0x100 * 0x100);
for (m_hanamai_layer_half = 0; m_hanamai_layer_half < 2; m_hanamai_layer_half++)
blitter_drawgfx(0, 1, "gfx1", i, 0, cliprect.min_x, cliprect.min_y, 3, 0);
diff --git a/src/mame/video/eolith.cpp b/src/mame/video/eolith.cpp
index 25497162379..215af20ced4 100644
--- a/src/mame/video/eolith.cpp
+++ b/src/mame/video/eolith.cpp
@@ -34,8 +34,8 @@ READ32_MEMBER(eolith_state::eolith_vram_r)
VIDEO_START_MEMBER(eolith_state,eolith)
{
- m_vram = auto_alloc_array(machine(), UINT32, 0x40000*2/4);
- save_pointer(NAME(m_vram), 0x40000*2/4);
+ m_vram = std::make_unique<UINT32[]>(0x40000*2/4);
+ save_pointer(NAME(m_vram.get()), 0x40000*2/4);
save_item(NAME(m_buffer));
}
diff --git a/src/mame/video/equites.cpp b/src/mame/video/equites.cpp
index a5913bc879a..ce6f607fc5c 100644
--- a/src/mame/video/equites.cpp
+++ b/src/mame/video/equites.cpp
@@ -119,8 +119,8 @@ TILE_GET_INFO_MEMBER(equites_state::splndrbt_bg_info)
VIDEO_START_MEMBER(equites_state,equites)
{
- m_fg_videoram = auto_alloc_array(machine(), UINT8, 0x800);
- save_pointer(NAME(m_fg_videoram), 0x800);
+ m_fg_videoram = std::make_unique<UINT8[]>(0x800);
+ save_pointer(NAME(m_fg_videoram.get()), 0x800);
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(equites_state::equites_fg_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
@@ -134,8 +134,8 @@ VIDEO_START_MEMBER(equites_state,splndrbt)
{
assert(m_screen->format() == BITMAP_FORMAT_IND16);
- m_fg_videoram = auto_alloc_array(machine(), UINT8, 0x800);
- save_pointer(NAME(m_fg_videoram), 0x800);
+ m_fg_videoram = std::make_unique<UINT8[]>(0x800);
+ save_pointer(NAME(m_fg_videoram.get()), 0x800);
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(equites_state::splndrbt_fg_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
diff --git a/src/mame/video/esripsys.cpp b/src/mame/video/esripsys.cpp
index 0a75d0fc0b9..7cbbf21b8d9 100644
--- a/src/mame/video/esripsys.cpp
+++ b/src/mame/video/esripsys.cpp
@@ -62,13 +62,13 @@ void esripsys_state::video_start()
int i;
/* Allocate memory for the two 512-pixel line buffers */
- line_buffer[0].colour_buf = auto_alloc_array(machine(), UINT8, 512);
- line_buffer[0].intensity_buf = auto_alloc_array(machine(), UINT8, 512);
- line_buffer[0].priority_buf = auto_alloc_array(machine(), UINT8, 512);
+ line_buffer[0].colour_buf = std::make_unique<UINT8[]>(512);
+ line_buffer[0].intensity_buf = std::make_unique<UINT8[]>(512);
+ line_buffer[0].priority_buf = std::make_unique<UINT8[]>(512);
- line_buffer[1].colour_buf = auto_alloc_array(machine(), UINT8, 512);
- line_buffer[1].intensity_buf = auto_alloc_array(machine(), UINT8, 512);
- line_buffer[1].priority_buf = auto_alloc_array(machine(), UINT8, 512);
+ line_buffer[1].colour_buf = std::make_unique<UINT8[]>(512);
+ line_buffer[1].intensity_buf = std::make_unique<UINT8[]>(512);
+ line_buffer[1].priority_buf = std::make_unique<UINT8[]>(512);
/* Create and initialise the HBLANK timers */
m_hblank_start_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_start_callback),this));
@@ -76,7 +76,7 @@ void esripsys_state::video_start()
m_hblank_start_timer->adjust(m_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));
/* Create the sprite scaling table */
- m_scale_table = auto_alloc_array(machine(), UINT8, 64 * 64);
+ m_scale_table = std::make_unique<UINT8[]>(64 * 64);
for (i = 0; i < 64; ++i)
{
@@ -109,7 +109,7 @@ void esripsys_state::video_start()
}
/* Now create a lookup table for scaling the sprite 'fig' value */
- m_fig_scale_table = auto_alloc_array(machine(), UINT8, 1024 * 64);
+ m_fig_scale_table = std::make_unique<UINT8[]>(1024 * 64);
for (i = 0; i < 1024; ++i)
{
@@ -133,13 +133,13 @@ void esripsys_state::video_start()
}
/* Register stuff for state saving */
- save_pointer(NAME(line_buffer[0].colour_buf), 512);
- save_pointer(NAME(line_buffer[0].intensity_buf), 512);
- save_pointer(NAME(line_buffer[0].priority_buf), 512);
+ save_pointer(NAME(line_buffer[0].colour_buf.get()), 512);
+ save_pointer(NAME(line_buffer[0].intensity_buf.get()), 512);
+ save_pointer(NAME(line_buffer[0].priority_buf.get()), 512);
- save_pointer(NAME(line_buffer[1].colour_buf), 512);
- save_pointer(NAME(line_buffer[1].intensity_buf), 512);
- save_pointer(NAME(line_buffer[1].priority_buf), 512);
+ save_pointer(NAME(line_buffer[1].colour_buf.get()), 512);
+ save_pointer(NAME(line_buffer[1].intensity_buf.get()), 512);
+ save_pointer(NAME(line_buffer[1].priority_buf.get()), 512);
save_item(NAME(m_video_firq));
save_item(NAME(m_bg_intensity));
@@ -154,9 +154,9 @@ UINT32 esripsys_state::screen_update_esripsys(screen_device &screen, bitmap_rgb3
struct line_buffer_t *line_buffer = m_line_buffer;
int x, y;
- UINT8 *colour_buf = line_buffer[m_12sel ? 0 : 1].colour_buf;
- UINT8 *intensity_buf = line_buffer[m_12sel ? 0 : 1].intensity_buf;
- UINT8 *priority_buf = line_buffer[m_12sel ? 0 : 1].priority_buf;
+ UINT8 *colour_buf = line_buffer[m_12sel ? 0 : 1].colour_buf.get();
+ UINT8 *intensity_buf = line_buffer[m_12sel ? 0 : 1].intensity_buf.get();
+ UINT8 *priority_buf = line_buffer[m_12sel ? 0 : 1].priority_buf.get();
for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
{
@@ -191,9 +191,9 @@ WRITE8_MEMBER(esripsys_state::esripsys_bg_intensity_w)
ESRIP_DRAW(esripsys_state::esripsys_draw )
{
struct line_buffer_t *line_buffer = m_line_buffer;
- UINT8 *colour_buf = line_buffer[m_12sel ? 1 : 0].colour_buf;
- UINT8 *intensity_buf = line_buffer[m_12sel ? 1 : 0].intensity_buf;
- UINT8 *priority_buf = line_buffer[m_12sel ? 1 : 0].priority_buf;
+ UINT8 *colour_buf = line_buffer[m_12sel ? 1 : 0].colour_buf.get();
+ UINT8 *intensity_buf = line_buffer[m_12sel ? 1 : 0].intensity_buf.get();
+ UINT8 *priority_buf = line_buffer[m_12sel ? 1 : 0].priority_buf.get();
UINT8 pri = attr & 0xff;
UINT8 iny = (attr >> 8) & 0xf;
diff --git a/src/mame/video/exerion.cpp b/src/mame/video/exerion.cpp
index 8f1743f0ba0..dee291a0419 100644
--- a/src/mame/video/exerion.cpp
+++ b/src/mame/video/exerion.cpp
@@ -112,12 +112,15 @@ void exerion_state::video_start()
m_background_mixer = memregion("proms")->base() + 0x320;
/* allocate memory for the decoded background graphics */
- m_background_gfx[0] = auto_alloc_array(machine(), UINT16, 256 * 256 * 4);
- m_background_gfx[1] = m_background_gfx[0] + 256 * 256;
- m_background_gfx[2] = m_background_gfx[1] + 256 * 256;
- m_background_gfx[3] = m_background_gfx[2] + 256 * 256;
+ m_background_gfx[0] = std::make_unique<UINT16[]>(256 * 256);
+ m_background_gfx[1] = std::make_unique<UINT16[]>(256 * 256);
+ m_background_gfx[2] = std::make_unique<UINT16[]>(256 * 256);
+ m_background_gfx[3] = std::make_unique<UINT16[]>(256 * 256);
- save_pointer(NAME(m_background_gfx[0]), 256 * 256 * 4);
+ save_pointer(NAME(m_background_gfx[0].get()), 256 * 256);
+ save_pointer(NAME(m_background_gfx[1].get()), 256 * 256);
+ save_pointer(NAME(m_background_gfx[2].get()), 256 * 256);
+ save_pointer(NAME(m_background_gfx[3].get()), 256 * 256);
/*---------------------------------
* Decode the background graphics
@@ -140,7 +143,7 @@ void exerion_state::video_start()
int y;
UINT8 *src = gfx + i * 0x2000;
- UINT16 *dst = m_background_gfx[i];
+ UINT16 *dst = m_background_gfx[i].get();
for (y = 0; y < 0x100; y++)
{
diff --git a/src/mame/video/exidy440.cpp b/src/mame/video/exidy440.cpp
index 5528165795a..94472bde421 100644
--- a/src/mame/video/exidy440.cpp
+++ b/src/mame/video/exidy440.cpp
@@ -44,12 +44,12 @@ VIDEO_START_MEMBER(exidy440_state,exidy440)
m_firq_beam = 0;
/* allocate a buffer for VRAM */
- m_local_videoram = auto_alloc_array(machine(), UINT8, 256 * 256 * 2);
- memset(m_local_videoram, 0, 256 * 256 * 2);
+ m_local_videoram = std::make_unique<UINT8[]>(256 * 256 * 2);
+ memset(m_local_videoram.get(), 0, 256 * 256 * 2);
/* allocate a buffer for palette RAM */
- m_local_paletteram = auto_alloc_array(machine(), UINT8, 512 * 2);
- memset(m_local_paletteram, 0, 512 * 2);
+ m_local_paletteram = std::make_unique<UINT8[]>(512 * 2);
+ memset(m_local_paletteram.get(), 0, 512 * 2);
}
diff --git a/src/mame/video/fmtowns.cpp b/src/mame/video/fmtowns.cpp
index 1790f856bc4..b61f5103402 100644
--- a/src/mame/video/fmtowns.cpp
+++ b/src/mame/video/fmtowns.cpp
@@ -854,9 +854,9 @@ void towns_state::draw_sprites(const rectangle* rect)
// clears VRAM for each frame?
if(m_video.towns_sprite_page == 0)
- memset(m_towns_gfxvram+0x40000,0x80,0x20000);
+ memset(m_towns_gfxvram.get()+0x40000,0x80,0x20000);
else
- memset(m_towns_gfxvram+0x60000,0x80,0x20000);
+ memset(m_towns_gfxvram.get()+0x60000,0x80,0x20000);
for(n=sprite_limit;n<1024;n++)
{
diff --git a/src/mame/video/fromanc2.cpp b/src/mame/video/fromanc2.cpp
index 0a8204d744e..acd33f42a8f 100644
--- a/src/mame/video/fromanc2.cpp
+++ b/src/mame/video/fromanc2.cpp
@@ -286,20 +286,20 @@ VIDEO_START_MEMBER(fromanc2_state,fromanc2)
palette_device *palette = (screen == 0 ? m_lpalette : m_rpalette);
for (int tmap = 0; tmap < 4; tmap++)
{
- m_videoram[screen][tmap] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[screen][tmap] = std::make_unique<UINT16[]>((64 * 64));
m_tilemap[screen][tmap]->set_palette(palette);
if (tmap != 0) m_tilemap[screen][tmap]->set_transparent_pen(0x000);
}
}
- save_pointer(NAME(m_videoram[0][0]), (64 * 64));
- save_pointer(NAME(m_videoram[0][1]), (64 * 64));
- save_pointer(NAME(m_videoram[0][2]), (64 * 64));
- save_pointer(NAME(m_videoram[0][3]), (64 * 64));
- save_pointer(NAME(m_videoram[1][0]), (64 * 64));
- save_pointer(NAME(m_videoram[1][1]), (64 * 64));
- save_pointer(NAME(m_videoram[1][2]), (64 * 64));
- save_pointer(NAME(m_videoram[1][3]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][0].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[0][1].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[0][2].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[0][3].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][0].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][1].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][2].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][3].get()), (64 * 64));
save_item(NAME(m_scrollx[0]));
save_item(NAME(m_scrollx[1]));
save_item(NAME(m_scrolly[0]));
@@ -324,18 +324,18 @@ VIDEO_START_MEMBER(fromanc2_state,fromancr)
palette_device *palette = (screen == 0 ? m_lpalette : m_rpalette);
for (int tmap = 0; tmap < 3; tmap++)
{
- m_videoram[screen][tmap] = auto_alloc_array(machine(), UINT16, (64 * 64));
+ m_videoram[screen][tmap] = std::make_unique<UINT16[]>((64 * 64));
m_tilemap[screen][tmap]->set_palette(palette);
if (tmap != 0) m_tilemap[screen][tmap]->set_transparent_pen(0x0ff);
}
}
- save_pointer(NAME(m_videoram[0][0]), (64 * 64));
- save_pointer(NAME(m_videoram[0][1]), (64 * 64));
- save_pointer(NAME(m_videoram[0][2]), (64 * 64));
- save_pointer(NAME(m_videoram[1][0]), (64 * 64));
- save_pointer(NAME(m_videoram[1][1]), (64 * 64));
- save_pointer(NAME(m_videoram[1][2]), (64 * 64));
+ save_pointer(NAME(m_videoram[0][0].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[0][1].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[0][2].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][0].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][1].get()), (64 * 64));
+ save_pointer(NAME(m_videoram[1][2].get()), (64 * 64));
save_item(NAME(m_scrollx[0]));
save_item(NAME(m_scrollx[1]));
save_item(NAME(m_scrolly[0]));
@@ -360,18 +360,18 @@ VIDEO_START_MEMBER(fromanc2_state,fromanc4)
palette_device *palette = (screen == 0 ? m_lpalette : m_rpalette);
for (int tmap = 0; tmap < 3; tmap++)
{
- m_videoram[screen][tmap] = auto_alloc_array(machine(), UINT16, (256 * 64));
+ m_videoram[screen][tmap] = std::make_unique<UINT16[]>((256 * 64));
m_tilemap[screen][tmap]->set_palette(palette);
if (tmap != 0) m_tilemap[screen][tmap]->set_transparent_pen(0x000);
}
}
- save_pointer(NAME(m_videoram[0][0]), (256 * 64));
- save_pointer(NAME(m_videoram[0][1]), (256 * 64));
- save_pointer(NAME(m_videoram[0][2]), (256 * 64));
- save_pointer(NAME(m_videoram[1][0]), (256 * 64));
- save_pointer(NAME(m_videoram[1][1]), (256 * 64));
- save_pointer(NAME(m_videoram[1][2]), (256 * 64));
+ save_pointer(NAME(m_videoram[0][0].get()), (256 * 64));
+ save_pointer(NAME(m_videoram[0][1].get()), (256 * 64));
+ save_pointer(NAME(m_videoram[0][2].get()), (256 * 64));
+ save_pointer(NAME(m_videoram[1][0].get()), (256 * 64));
+ save_pointer(NAME(m_videoram[1][1].get()), (256 * 64));
+ save_pointer(NAME(m_videoram[1][2].get()), (256 * 64));
save_item(NAME(m_scrollx[0]));
save_item(NAME(m_scrollx[1]));
save_item(NAME(m_scrolly[0]));
diff --git a/src/mame/video/fromance.cpp b/src/mame/video/fromance.cpp
index b5f5d6ca659..f8eff58d92c 100644
--- a/src/mame/video/fromance.cpp
+++ b/src/mame/video/fromance.cpp
@@ -58,11 +58,11 @@ TILE_GET_INFO_MEMBER(fromance_state::get_nekkyoku_fg_tile_info){ get_nekkyoku_ti
void fromance_state::init_common( )
{
/* allocate local videoram */
- m_local_videoram[0] = auto_alloc_array(machine(), UINT8, 0x1000 * 3);
- m_local_videoram[1] = auto_alloc_array(machine(), UINT8, 0x1000 * 3);
+ m_local_videoram[0] = std::make_unique<UINT8[]>(0x1000 * 3);
+ m_local_videoram[1] = std::make_unique<UINT8[]>(0x1000 * 3);
/* allocate local palette RAM */
- m_local_paletteram = auto_alloc_array(machine(), UINT8, 0x800 * 2);
+ m_local_paletteram = std::make_unique<UINT8[]>(0x800 * 2);
/* configure tilemaps */
m_fg_tilemap->set_transparent_pen(15);
@@ -72,8 +72,8 @@ void fromance_state::init_common( )
/* state save */
save_item(NAME(m_selected_videoram));
- save_pointer(NAME(m_local_videoram[0]), 0x1000 * 3);
- save_pointer(NAME(m_local_videoram[1]), 0x1000 * 3);
+ save_pointer(NAME(m_local_videoram[0].get()), 0x1000 * 3);
+ save_pointer(NAME(m_local_videoram[1].get()), 0x1000 * 3);
save_item(NAME(m_selected_paletteram));
save_item(NAME(m_scrollx));
save_item(NAME(m_scrolly));
@@ -84,7 +84,7 @@ void fromance_state::init_common( )
save_item(NAME(m_scrolly_ofs));
save_item(NAME(m_crtc_register));
save_item(NAME(m_crtc_data));
- save_pointer(NAME(m_local_paletteram), 0x800 * 2);
+ save_pointer(NAME(m_local_paletteram.get()), 0x800 * 2);
}
VIDEO_START_MEMBER(fromance_state,fromance)
diff --git a/src/mame/video/fuukifg3.cpp b/src/mame/video/fuukifg3.cpp
index db045401a06..80f96111f46 100644
--- a/src/mame/video/fuukifg3.cpp
+++ b/src/mame/video/fuukifg3.cpp
@@ -92,8 +92,8 @@ WRITE32_MEMBER(fuuki32_state::vram_3_w){ vram_w(offset, data, mem_mask, 3); }
void fuuki32_state::video_start()
{
-// m_buf_spriteram = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
-// m_buf_spriteram2 = auto_alloc_array(machine(), UINT32, m_spriteram.bytes() / 4);
+// m_buf_spriteram = std::make_unique<UINT32[]>(m_spriteram.bytes() / 4);
+// m_buf_spriteram2 = std::make_unique<UINT32[]>(m_spriteram.bytes() / 4);
diff --git a/src/mame/video/gaelco3d.cpp b/src/mame/video/gaelco3d.cpp
index 43041d2fa0e..62b21c1b8e3 100644
--- a/src/mame/video/gaelco3d.cpp
+++ b/src/mame/video/gaelco3d.cpp
@@ -33,15 +33,15 @@ gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
m_polygons(0),
m_texture_size(state.memregion("gfx1")->bytes()),
m_texmask_size(state.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))
+ m_texture(std::make_unique<UINT8[]>(m_texture_size)),
+ m_texmask(std::make_unique<UINT8[]>(m_texmask_size))
{
state.machine().save().save_item(NAME(m_screenbits));
state.machine().save().save_item(NAME(m_zbuffer));
/* first expand the pixel data */
UINT8 *src = state.memregion("gfx1")->base();
- UINT8 *dst = m_texture;
+ UINT8 *dst = m_texture.get();
for (int y = 0; y < m_texture_size/4096; y += 2)
for (int x = 0; x < 4096; x += 2)
{
@@ -53,7 +53,7 @@ gaelco3d_renderer::gaelco3d_renderer(gaelco3d_state &state)
/* then expand the mask data */
src = state.memregion("gfx2")->base();
- dst = m_texmask;
+ dst = m_texmask.get();
for (int y = 0; y < m_texmask_size/4096; y++)
for (int x = 0; x < 4096; x++)
dst[y * 4096 + x] = (src[(x / 1024) * (m_texmask_size/8/4) + (y * 1024 + x % 1024) / 8] >> (x % 8)) & 1;
@@ -71,12 +71,12 @@ void gaelco3d_state::video_start()
m_poly = auto_alloc(machine(), gaelco3d_renderer(*this));
m_palette = auto_alloc_array(machine(), rgb_t, 32768);
- m_polydata_buffer = auto_alloc_array(machine(), UINT32, MAX_POLYDATA);
+ m_polydata_buffer = std::make_unique<UINT32[]>(MAX_POLYDATA);
/* save states */
save_pointer(NAME(m_palette), 32768);
- save_pointer(NAME(m_polydata_buffer), MAX_POLYDATA);
+ save_pointer(NAME(m_polydata_buffer.get()), MAX_POLYDATA);
save_item(NAME(m_polydata_count));
save_item(NAME(m_lastscan));
}
diff --git a/src/mame/video/galaxian.cpp b/src/mame/video/galaxian.cpp
index ba022af66b5..9af1055eea0 100644
--- a/src/mame/video/galaxian.cpp
+++ b/src/mame/video/galaxian.cpp
@@ -786,7 +786,7 @@ void galaxian_state::stars_init()
m_stars_blink_state = 0;
/* precalculate the RNG */
- m_stars = auto_alloc_array(machine(), UINT8, STAR_RNG_PERIOD);
+ m_stars = std::make_unique<UINT8[]>(STAR_RNG_PERIOD);
shiftreg = 0;
for (i = 0; i < STAR_RNG_PERIOD; i++)
{
diff --git a/src/mame/video/galaxold.cpp b/src/mame/video/galaxold.cpp
index cebfe20e687..1a4c42ac7c4 100644
--- a/src/mame/video/galaxold.cpp
+++ b/src/mame/video/galaxold.cpp
@@ -803,10 +803,10 @@ VIDEO_START_MEMBER(galaxold_state,dambustr)
m_draw_bullets = &galaxold_state::dambustr_draw_bullets;
/* allocate the temporary bitmap for the background priority */
- m_dambustr_tmpbitmap = auto_bitmap_ind16_alloc(machine(), m_screen->width(), m_screen->height());
+ m_dambustr_tmpbitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height());
/* make a copy of the tilemap to emulate background priority */
- m_dambustr_videoram2 = auto_alloc_array(machine(), UINT8, 0x0400);
+ m_dambustr_videoram2 = std::make_unique<UINT8[]>(0x0400);
m_dambustr_tilemap2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(galaxold_state::dambustr_get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,32,32);
m_dambustr_tilemap2->set_transparent_pen(0);
@@ -1776,7 +1776,7 @@ UINT32 galaxold_state::screen_update_dambustr(screen_device &screen, bitmap_ind1
dambustr_draw_upper_background(bitmap, cliprect);
/* only rows with color code > 3 are stronger than the background */
- memset(m_dambustr_videoram2, 0x20, 0x0400);
+ memset(m_dambustr_videoram2.get(), 0x20, 0x0400);
for (i=0; i<32; i++) {
color = m_attributesram[(i << 1) | 1] & m_color_mask;
if (color > 3) {
diff --git a/src/mame/video/gameplan.cpp b/src/mame/video/gameplan.cpp
index e20324372e0..9456e6910f1 100644
--- a/src/mame/video/gameplan.cpp
+++ b/src/mame/video/gameplan.cpp
@@ -219,7 +219,7 @@ WRITE_LINE_MEMBER(gameplan_state::video_command_trigger_w)
m_via_0->write_ca1(1);
}
- memset(m_videoram, m_video_data & 0x0f, m_videoram_size);
+ memset(m_videoram.get(), m_video_data & 0x0f, m_videoram_size);
/* set a timer for an arbitrarily short period.
The real time it takes to clear to screen is not
@@ -268,12 +268,12 @@ TIMER_CALLBACK_MEMBER(gameplan_state::via_0_ca1_timer_callback)
VIDEO_START_MEMBER(gameplan_state,common)
{
m_videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND);
- m_videoram = auto_alloc_array(machine(), UINT8, m_videoram_size);
+ m_videoram = std::make_unique<UINT8[]>(m_videoram_size);
m_via_0_ca1_timer = timer_alloc(TIMER_VIA_0_CAL);
/* register for save states */
- save_pointer(NAME(m_videoram), m_videoram_size);
+ save_pointer(NAME(m_videoram.get()), m_videoram_size);
}
diff --git a/src/mame/video/glass.cpp b/src/mame/video/glass.cpp
index 416dbb37f7d..a661ce578a2 100644
--- a/src/mame/video/glass.cpp
+++ b/src/mame/video/glass.cpp
@@ -129,7 +129,7 @@ void glass_state::video_start()
{
m_pant[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_pant[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- m_screen_bitmap = auto_bitmap_ind16_alloc (machine(), 320, 200);
+ m_screen_bitmap = std::make_unique<bitmap_ind16>(320, 200);
save_item(NAME(*m_screen_bitmap));
diff --git a/src/mame/video/goal92.cpp b/src/mame/video/goal92.cpp
index 43d8941a0c7..c4f0e99529a 100644
--- a/src/mame/video/goal92.cpp
+++ b/src/mame/video/goal92.cpp
@@ -88,7 +88,7 @@ TILE_GET_INFO_MEMBER(goal92_state::get_fore_tile_info)
void goal92_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
{
- UINT16 *buffered_spriteram16 = m_buffered_spriteram;
+ UINT16 *buffered_spriteram16 = m_buffered_spriteram.get();
int offs, fx, fy, x, y, color, sprite;
for (offs = 3; offs <= 0x400 - 5; offs += 4)
@@ -136,8 +136,8 @@ void goal92_state::video_start()
m_fg_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(goal92_state::get_fore_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_tx_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(goal92_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- m_buffered_spriteram = auto_alloc_array(machine(), UINT16, 0x400 * 2);
- save_pointer(NAME(m_buffered_spriteram), 0x400 * 2);
+ m_buffered_spriteram = std::make_unique<UINT16[]>(0x400 * 2);
+ save_pointer(NAME(m_buffered_spriteram.get()), 0x400 * 2);
m_bg_layer->set_transparent_pen(15);
m_fg_layer->set_transparent_pen(15);
@@ -184,6 +184,6 @@ void goal92_state::screen_eof_goal92(screen_device &screen, bool state)
// rising edge
if (state)
{
- memcpy(m_buffered_spriteram, m_spriteram, 0x400 * 2);
+ memcpy(m_buffered_spriteram.get(), m_spriteram, 0x400 * 2);
}
}
diff --git a/src/mame/video/hng64.cpp b/src/mame/video/hng64.cpp
index 015c8ae0fac..a85a820b308 100644
--- a/src/mame/video/hng64.cpp
+++ b/src/mame/video/hng64.cpp
@@ -1288,7 +1288,7 @@ void hng64_state::video_start()
m_poly_renderer = auto_alloc(machine(), hng64_poly_renderer(*this));
// 3d information
- m_dl = auto_alloc_array(machine(), UINT16, 0x100);
+ m_dl = std::make_unique<UINT16[]>(0x100);
m_polys.resize(HNG64_MAX_POLYGONS);
m_texturerom = memregion("textures")->base();
diff --git a/src/mame/video/hng64_3d.cpp b/src/mame/video/hng64_3d.cpp
index 868f871fcf8..b28aa4109d6 100644
--- a/src/mame/video/hng64_3d.cpp
+++ b/src/mame/video/hng64_3d.cpp
@@ -15,7 +15,7 @@ hng64_poly_renderer::hng64_poly_renderer(hng64_state& state)
, m_colorBuffer3d(state.m_screen->visible_area().width(), state.m_screen->visible_area().height())
{
const INT32 bufferSize = state.m_screen->visible_area().width() * state.m_screen->visible_area().height();
- m_depthBuffer3d = auto_alloc_array(state.machine(), float, bufferSize);
+ m_depthBuffer3d = std::make_unique<float[]>(bufferSize);
}
diff --git a/src/mame/video/hyprduel.cpp b/src/mame/video/hyprduel.cpp
index 70b6864d2f4..266c0ad0724 100644
--- a/src/mame/video/hyprduel.cpp
+++ b/src/mame/video/hyprduel.cpp
@@ -125,7 +125,7 @@ inline void hyprduel_state::get_tile_info( tile_data &tileinfo, int tile_index,
if (code & 0x8000) /* Special: draw a tile of a single color (i.e. not from the gfx ROMs) */
{
int _code = code & 0x000f;
- tileinfo.pen_data = m_empty_tiles + _code * 16 * 16;
+ tileinfo.pen_data = m_empty_tiles.get() + _code * 16 * 16;
tileinfo.palette_base = ((code & 0x0ff0)) + 0x1000;
tileinfo.flags = 0;
tileinfo.group = 0;
@@ -162,7 +162,7 @@ inline void hyprduel_state::get_tile_info_8bit( tile_data &tileinfo, int tile_in
if (code & 0x8000) /* Special: draw a tile of a single color (i.e. not from the gfx ROMs) */
{
int _code = code & 0x000f;
- tileinfo.pen_data = m_empty_tiles + _code * 16 * 16;
+ tileinfo.pen_data = m_empty_tiles.get() + _code * 16 * 16;
tileinfo.palette_base = ((code & 0x0ff0)) + 0x1000;
tileinfo.flags = 0;
tileinfo.group = 0;
@@ -207,7 +207,7 @@ inline void hyprduel_state::get_tile_info_16x16_8bit( tile_data &tileinfo, int t
if (code & 0x8000) /* Special: draw a tile of a single color (i.e. not from the gfx ROMs) */
{
int _code = code & 0x000f;
- tileinfo.pen_data = m_empty_tiles + _code * 16 * 16;
+ tileinfo.pen_data = m_empty_tiles.get() + _code * 16 * 16;
tileinfo.palette_base = ((code & 0x0ff0)) + 0x1000;
tileinfo.flags = 0;
tileinfo.group = 0;
@@ -304,8 +304,8 @@ void hyprduel_state::alloc_empty_tiles( )
{
int code,i;
- m_empty_tiles = auto_alloc_array(machine(), UINT8, 16*16*16);
- save_pointer(NAME(m_empty_tiles), 16*16*16);
+ m_empty_tiles = std::make_unique<UINT8[]>(16*16*16);
+ save_pointer(NAME(m_empty_tiles.get()), 16*16*16);
for (code = 0; code < 0x10; code++)
for (i = 0; i < 16 * 16; i++)
@@ -334,7 +334,7 @@ void hyprduel_state::expand_gfx1(hyprduel_state &state)
{
UINT8 *base_gfx = state.memregion("gfx1")->base();
UINT32 length = 2 * state.memregion("gfx1")->bytes();
- state.m_expanded_gfx1 = auto_alloc_array(state.machine(), UINT8, length);
+ state.m_expanded_gfx1 = std::make_unique<UINT8[]>(length);
for (int i = 0; i < length; i += 2)
{
UINT8 src = base_gfx[i / 2];
@@ -347,11 +347,11 @@ VIDEO_START_MEMBER(hyprduel_state,common_14220)
{
expand_gfx1(*this);
alloc_empty_tiles();
- m_tiletable_old = auto_alloc_array(machine(), UINT16, m_tiletable.bytes() / 2);
- m_dirtyindex = auto_alloc_array(machine(), UINT8, m_tiletable.bytes() / 4);
+ m_tiletable_old = std::make_unique<UINT16[]>(m_tiletable.bytes() / 2);
+ m_dirtyindex = std::make_unique<UINT8[]>(m_tiletable.bytes() / 4);
- save_pointer(NAME(m_tiletable_old), m_tiletable.bytes() / 2);
- save_pointer(NAME(m_dirtyindex), m_tiletable.bytes() / 4);
+ save_pointer(NAME(m_tiletable_old.get()), m_tiletable.bytes() / 2);
+ save_pointer(NAME(m_dirtyindex.get()), m_tiletable.bytes() / 4);
m_bg_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_0_8bit),this), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
m_bg_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(hyprduel_state::get_tile_info_1_8bit),this), TILEMAP_SCAN_ROWS, 8, 8, WIN_NX, WIN_NY);
@@ -449,7 +449,7 @@ VIDEO_START_MEMBER(hyprduel_state,magerror_14220)
void hyprduel_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- UINT8 *base_gfx4 = m_expanded_gfx1;
+ UINT8 *base_gfx4 = m_expanded_gfx1.get();
UINT8 *base_gfx8 = memregion("gfx1")->base();
UINT32 gfx_size = memregion("gfx1")->bytes();
@@ -660,7 +660,7 @@ UINT32 hyprduel_state::screen_update_hyprduel(screen_device &screen, bitmap_ind1
{
int dirty = 0;
- memset(m_dirtyindex, 0, m_tiletable.bytes() / 4);
+ memset(m_dirtyindex.get(), 0, m_tiletable.bytes() / 4);
for (i = 0; i < m_tiletable.bytes() / 4; i++)
{
UINT32 tile_new = (m_tiletable[2 * i + 0] << 16 ) + m_tiletable[2 * i + 1];
@@ -672,7 +672,7 @@ UINT32 hyprduel_state::screen_update_hyprduel(screen_device &screen, bitmap_ind1
dirty = 1;
}
}
- memcpy(m_tiletable_old, m_tiletable, m_tiletable.bytes());
+ memcpy(m_tiletable_old.get(), m_tiletable, m_tiletable.bytes());
if (dirty)
{
diff --git a/src/mame/video/igs017_igs031.cpp b/src/mame/video/igs017_igs031.cpp
index 8aa254db422..8e8993e0fa7 100644
--- a/src/mame/video/igs017_igs031.cpp
+++ b/src/mame/video/igs017_igs031.cpp
@@ -242,7 +242,7 @@ void igs017_igs031_device::expand_sprites()
int i;
m_sprites_gfx_size = size / 2 * 3;
- m_sprites_gfx = auto_alloc_array(machine(), UINT8, m_sprites_gfx_size);
+ m_sprites_gfx = std::make_unique<UINT8[]>(m_sprites_gfx_size);
for (i = 0; i < size / 2 ; i++)
{
@@ -296,7 +296,7 @@ void igs017_igs031_device::draw_sprite(bitmap_ind16 &bitmap,const rectangle &cli
if ( addr + dimx * dimy >= m_sprites_gfx_size )
return;
- gfx_element gfx(m_palette, m_sprites_gfx + addr, dimx, dimy, dimx, m_palette->entries(), 0x100, 32);
+ gfx_element gfx(m_palette, m_sprites_gfx.get() + addr, dimx, dimy, dimx, m_palette->entries(), 0x100, 32);
gfx.transpen(bitmap,cliprect,
0, color,
diff --git a/src/mame/video/igs017_igs031.h b/src/mame/video/igs017_igs031.h
index b8d2e18f2ec..4c3b2c66ed3 100644
--- a/src/mame/video/igs017_igs031.h
+++ b/src/mame/video/igs017_igs031.h
@@ -49,7 +49,7 @@ public:
UINT8 m_video_disable;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
- UINT8 *m_sprites_gfx;
+ std::unique_ptr<UINT8[]> m_sprites_gfx;
int m_sprites_gfx_size;
int get_nmi_enable() { return m_nmi_enable; }
diff --git a/src/mame/video/irobot.cpp b/src/mame/video/irobot.cpp
index 418384d4f99..6ee40245158 100644
--- a/src/mame/video/irobot.cpp
+++ b/src/mame/video/irobot.cpp
@@ -85,7 +85,7 @@ void irobot_state::_irobot_poly_clear(UINT8 *bitmap_base)
void irobot_state::irobot_poly_clear()
{
- UINT8 *bitmap_base = m_bufsel ? m_polybitmap2 : m_polybitmap1;
+ UINT8 *bitmap_base = m_bufsel ? m_polybitmap2.get() : m_polybitmap1.get();
_irobot_poly_clear(bitmap_base);
}
@@ -99,12 +99,12 @@ void irobot_state::video_start()
{
/* Setup 2 bitmaps for the polygon generator */
int height = m_screen->height();
- m_polybitmap1 = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * height);
- m_polybitmap2 = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * height);
+ m_polybitmap1 = std::make_unique<UINT8[]>(BITMAP_WIDTH * height);
+ m_polybitmap2 = std::make_unique<UINT8[]>(BITMAP_WIDTH * height);
/* clear the bitmaps so we start with valid palette look-up values for drawing */
- _irobot_poly_clear(m_polybitmap1);
- _irobot_poly_clear(m_polybitmap2);
+ _irobot_poly_clear(m_polybitmap1.get());
+ _irobot_poly_clear(m_polybitmap2.get());
/* Set clipping */
m_ir_xmin = m_ir_ymin = 0;
@@ -225,9 +225,9 @@ void irobot_state::irobot_run_video()
logerror("Starting Polygon Generator, Clear=%d\n",m_vg_clear);
if (m_bufsel)
- polybitmap = m_polybitmap2;
+ polybitmap = m_polybitmap2.get();
else
- polybitmap = m_polybitmap1;
+ polybitmap = m_polybitmap1.get();
lpnt=0;
while (lpnt < 0x7ff)
@@ -348,7 +348,7 @@ void irobot_state::irobot_run_video()
UINT32 irobot_state::screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
UINT8 *videoram = m_videoram;
- UINT8 *bitmap_base = m_bufsel ? m_polybitmap1 : m_polybitmap2;
+ UINT8 *bitmap_base = m_bufsel ? m_polybitmap1.get() : m_polybitmap2.get();
int x, y, offs;
/* copy the polygon bitmap */
diff --git a/src/mame/video/itech32.cpp b/src/mame/video/itech32.cpp
index f0b9b84b8e0..3c882ac757b 100644
--- a/src/mame/video/itech32.cpp
+++ b/src/mame/video/itech32.cpp
@@ -168,8 +168,8 @@ void itech32_state::video_start()
int i;
/* allocate memory */
- m_videoram = auto_alloc_array(machine(), UINT16, VRAM_WIDTH * (m_vram_height + 16) * 2);
- memset(m_videoram, 0xff, VRAM_WIDTH * (m_vram_height + 16) * 2 * 2);
+ m_videoram = std::make_unique<UINT16[]>(VRAM_WIDTH * (m_vram_height + 16) * 2);
+ memset(m_videoram.get(), 0xff, VRAM_WIDTH * (m_vram_height + 16) * 2 * 2);
/* videoplane[0] is the foreground; videoplane[1] is the background */
m_videoplane[0] = &m_videoram[0 * VRAM_WIDTH * (m_vram_height + 16) + 8 * VRAM_WIDTH];
diff --git a/src/mame/video/k001005.cpp b/src/mame/video/k001005.cpp
index 0a6b3e535b7..fad84787317 100644
--- a/src/mame/video/k001005.cpp
+++ b/src/mame/video/k001005.cpp
@@ -32,12 +32,12 @@ k001005_renderer::k001005_renderer(device_t &parent, screen_device &screen, devi
int width = screen.width();
int height = screen.height();
- m_fb[0] = auto_bitmap_rgb32_alloc(machine(), width, height);
- m_fb[1] = auto_bitmap_rgb32_alloc(machine(), width, height);
+ m_fb[0] = std::make_unique<bitmap_rgb32>( width, height);
+ m_fb[1] = std::make_unique<bitmap_rgb32>( width, height);
- m_zb = auto_bitmap_ind32_alloc(machine(), width, height);
+ m_zb = std::make_unique<bitmap_ind32>(width, height);
- m_3dfifo = auto_alloc_array(machine(), UINT32, 0x10000);
+ m_3dfifo = std::make_unique<UINT32[]>(0x10000);
m_3dfifo_ptr = 0;
m_fb_page = 0;
@@ -45,8 +45,8 @@ k001005_renderer::k001005_renderer(device_t &parent, screen_device &screen, devi
for (int k=0; k < 8; k++)
{
- m_tex_mirror_table[0][k] = auto_alloc_array(machine(), int, 128);
- m_tex_mirror_table[1][k] = auto_alloc_array(machine(), int, 128);
+ m_tex_mirror_table[0][k] = std::make_unique<int[]>(128);
+ m_tex_mirror_table[1][k] = std::make_unique<int[]>(128);
int size = (k+1)*8;
@@ -58,7 +58,7 @@ k001005_renderer::k001005_renderer(device_t &parent, screen_device &screen, devi
}
// save state
- parent.save_pointer(NAME(m_3dfifo), 0x10000);
+ parent.save_pointer(NAME(m_3dfifo.get()), 0x10000);
parent.save_item(NAME(m_3dfifo_ptr));
parent.save_item(NAME(*m_fb[0]));
parent.save_item(NAME(*m_fb[1]));
@@ -143,7 +143,7 @@ void k001005_renderer::render_polygons()
vertex_t *vertex3;
vertex_t *vertex4;
- UINT32 *fifo = m_3dfifo;
+ UINT32 *fifo = m_3dfifo.get();
const rectangle& visarea = screen().visible_area();
@@ -917,8 +917,8 @@ void k001005_renderer::draw_scanline_2d_tex(INT32 scanline, const extent_t &exte
int texture_width = extradata.texture_width;
int texture_height = extradata.texture_height;
- int *x_mirror_table = m_tex_mirror_table[texture_mirror_x][texture_width];
- int *y_mirror_table = m_tex_mirror_table[texture_mirror_y][texture_height];
+ int *x_mirror_table = m_tex_mirror_table[texture_mirror_x][texture_width].get();
+ int *y_mirror_table = m_tex_mirror_table[texture_mirror_y][texture_height].get();
for (int x = extent.startx; x < extent.stopx; x++)
{
@@ -1038,8 +1038,8 @@ void k001005_renderer::draw_scanline_tex(INT32 scanline, const extent_t &extent,
UINT32 *fb = &m_fb[m_fb_page]->pix32(scanline);
float *zb = (float*)&m_zb->pix32(scanline);
- int *x_mirror_table = m_tex_mirror_table[texture_mirror_x][texture_width];
- int *y_mirror_table = m_tex_mirror_table[texture_mirror_y][texture_height];
+ int *x_mirror_table = m_tex_mirror_table[texture_mirror_x][texture_width].get();
+ int *y_mirror_table = m_tex_mirror_table[texture_mirror_y][texture_height].get();
for (int x = extent.startx; x < extent.stopx; x++)
{
@@ -1203,16 +1203,16 @@ void k001005_device::device_start()
{
m_k001006 = machine().device(m_k001006_tag);
- m_ram[0] = auto_alloc_array(machine(), UINT16, 0x140000);
- m_ram[1] = auto_alloc_array(machine(), UINT16, 0x140000);
+ m_ram[0] = std::make_unique<UINT16[]>(0x140000);
+ m_ram[1] = std::make_unique<UINT16[]>(0x140000);
- m_fifo = auto_alloc_array(machine(), UINT32, 0x800);
+ m_fifo = std::make_unique<UINT32[]>(0x800);
m_renderer = auto_alloc(machine(), k001005_renderer(*this, *m_screen, m_k001006));
- save_pointer(NAME(m_ram[0]), 0x140000);
- save_pointer(NAME(m_ram[1]), 0x140000);
- save_pointer(NAME(m_fifo), 0x800);
+ save_pointer(NAME(m_ram[0].get()), 0x140000);
+ save_pointer(NAME(m_ram[1].get()), 0x140000);
+ save_pointer(NAME(m_fifo.get()), 0x800);
save_item(NAME(m_status));
save_item(NAME(m_ram_ptr));
save_item(NAME(m_fifo_read_ptr));
diff --git a/src/mame/video/k001005.h b/src/mame/video/k001005.h
index ae4838f4b65..3c0bd5058fa 100644
--- a/src/mame/video/k001005.h
+++ b/src/mame/video/k001005.h
@@ -72,12 +72,12 @@ public:
static const int POLY_B = 5;
private:
- bitmap_rgb32 *m_fb[2];
- bitmap_ind32 *m_zb;
+ std::unique_ptr<bitmap_rgb32> m_fb[2];
+ std::unique_ptr<bitmap_ind32> m_zb;
rectangle m_cliprect;
int m_fb_page;
- UINT32 *m_3dfifo;
+ std::unique_ptr<UINT32[]> m_3dfifo;
int m_3dfifo_ptr;
vertex_t m_prev_v[4];
@@ -95,7 +95,7 @@ private:
device_t *m_k001006;
- int *m_tex_mirror_table[2][8];
+ std::unique_ptr<int[]> m_tex_mirror_table[2][8];
};
@@ -128,8 +128,8 @@ private:
device_t *m_k001006;
const char *m_k001006_tag;
- UINT16 * m_ram[2];
- UINT32 * m_fifo;
+ std::unique_ptr<UINT16[]> m_ram[2];
+ std::unique_ptr<UINT32[]> m_fifo;
UINT32 m_status;
int m_ram_ptr;
diff --git a/src/mame/video/k001006.cpp b/src/mame/video/k001006.cpp
index 67a55f137fc..a0524973494 100644
--- a/src/mame/video/k001006.cpp
+++ b/src/mame/video/k001006.cpp
@@ -46,9 +46,9 @@ void k001006_device::device_start()
m_palette = auto_alloc_array_clear(machine(), UINT32, 0x800);
m_gfxrom = machine().root_device().memregion(m_gfx_region)->base();
- m_texrom = auto_alloc_array(machine(), UINT8, 0x800000);
+ m_texrom = std::make_unique<UINT8[]>(0x800000);
- preprocess_texture_data(m_texrom, m_gfxrom, 0x800000, m_tex_layout);
+ preprocess_texture_data(m_texrom.get(), m_gfxrom, 0x800000, m_tex_layout);
save_pointer(NAME(m_pal_ram), 0x800*sizeof(UINT16));
save_pointer(NAME(m_unknown_ram), 0x1000*sizeof(UINT16));
@@ -155,7 +155,7 @@ WRITE32_MEMBER( k001006_device::write )
UINT32 k001006_device::fetch_texel(int page, int pal_index, int u, int v)
{
- UINT8 *tex = m_texrom + page;
+ UINT8 *tex = m_texrom.get() + page;
int texel = tex[((v & 0x1ff) * 512) + (u & 0x1ff)];
return m_palette[pal_index + texel];
}
diff --git a/src/mame/video/k001006.h b/src/mame/video/k001006.h
index eb9fba02c80..2a2beb48895 100644
--- a/src/mame/video/k001006.h
+++ b/src/mame/video/k001006.h
@@ -35,7 +35,7 @@ private:
UINT32 m_addr;
int m_device_sel;
- UINT8 * m_texrom;
+ std::unique_ptr<UINT8[]> m_texrom;
UINT32 * m_palette;
diff --git a/src/mame/video/k053246_k053247_k055673.cpp b/src/mame/video/k053246_k053247_k055673.cpp
index 0e706813000..fe18006cad7 100644
--- a/src/mame/video/k053246_k053247_k055673.cpp
+++ b/src/mame/video/k053246_k053247_k055673.cpp
@@ -66,7 +66,7 @@ void k053247_device::clear_all()
void k053247_device::k053247_get_ram( UINT16 **ram )
{
- *ram = m_ram;
+ *ram = m_ram.get();
}
int k053247_device::k053247_get_dx( void )
@@ -102,7 +102,7 @@ READ16_MEMBER( k053247_device::k053247_word_r )
WRITE16_MEMBER( k053247_device::k053247_word_w )
{
- COMBINE_DATA(m_ram + offset);
+ COMBINE_DATA(m_ram.get() + offset);
}
READ8_MEMBER( k053247_device::k053247_r )
@@ -401,7 +401,7 @@ void k053247_device::k053247_sprites_draw_common( _BitmapClass &bitmap, const re
k053247_draw_single_sprite_gxcore( bitmap, cliprect,
nullptr, nullptr,
- code, m_ram, offs,
+ code, m_ram.get(), offs,
color,
/* gx only */
0, 0, 0, 0,
@@ -1023,13 +1023,13 @@ void k055673_device::device_start()
m_z_rejection = -1;
m_gfx = m_gfxdecode->gfx(gfx_index);
m_objcha_line = CLEAR_LINE;
- m_ram = auto_alloc_array(machine(), UINT16, 0x1000/2);
+ m_ram = std::make_unique<UINT16[]>(0x1000/2);
- memset(m_ram, 0, 0x1000);
+ memset(m_ram.get(), 0, 0x1000);
memset(m_kx46_regs, 0, 8);
memset(m_kx47_regs, 0, 32);
- machine().save().save_pointer(NAME(m_ram), 0x800);
+ machine().save().save_pointer(NAME(m_ram.get()), 0x800);
machine().save().save_item(NAME(m_kx46_regs));
machine().save().save_item(NAME(m_kx47_regs));
machine().save().save_item(NAME(m_objcha_line));
@@ -1129,9 +1129,10 @@ void k053247_device::device_start()
m_gfx = m_gfxdecode->gfx(m_gfx_num);
- m_ram = auto_alloc_array_clear(machine(), UINT16, 0x1000 / 2);
+ m_ram = std::make_unique<UINT16[]>(0x1000 / 2);
+ memset(m_ram.get(), 0, sizeof(UINT16) * 0x1000 / 2);
- save_pointer(NAME(m_ram), 0x1000 / 2);
+ save_pointer(NAME(m_ram.get()), 0x1000 / 2);
save_item(NAME(m_kx46_regs));
save_item(NAME(m_kx47_regs));
save_item(NAME(m_objcha_line));
diff --git a/src/mame/video/k053246_k053247_k055673.h b/src/mame/video/k053246_k053247_k055673.h
index 98e132c8db3..96e41f00893 100644
--- a/src/mame/video/k053246_k053247_k055673.h
+++ b/src/mame/video/k053246_k053247_k055673.h
@@ -110,7 +110,7 @@ public:
DECLARE_READ16_MEMBER( k053246_reg_word_r ); // OBJSET1
- UINT16 *m_ram;
+ std::unique_ptr<UINT16[]> m_ram;
gfx_element *m_gfx;
diff --git a/src/mame/video/k057714.cpp b/src/mame/video/k057714.cpp
index 405f0e722c2..8676e3a5a37 100644
--- a/src/mame/video/k057714.cpp
+++ b/src/mame/video/k057714.cpp
@@ -23,8 +23,8 @@ void k057714_device::device_start()
{
m_irq.resolve_safe();
- m_vram = auto_alloc_array(machine(), UINT32, 0x2000000/4);
- memset(m_vram, 0, 0x2000000);
+ m_vram = std::make_unique<UINT32[]>(0x2000000/4);
+ memset(m_vram.get(), 0, 0x2000000);
}
void k057714_device::device_reset()
@@ -306,7 +306,7 @@ WRITE32_MEMBER(k057714_device::fifo_w)
int k057714_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT16 *vram16 = (UINT16*)m_vram;
+ UINT16 *vram16 = (UINT16*)m_vram.get();
int x = 0;
int y = 0;
@@ -408,7 +408,7 @@ void k057714_device::draw_object(UINT32 *cmd)
y += m_fb_origin_y;
}
- UINT16 *vram16 = (UINT16*)m_vram;
+ UINT16 *vram16 = (UINT16*)m_vram.get();
if (xscale == 0 || yscale == 0)
{
@@ -543,7 +543,7 @@ void k057714_device::fill_rect(UINT32 *cmd)
int y1 = y;
int y2 = y + height;
- UINT16 *vram16 = (UINT16*)m_vram;
+ UINT16 *vram16 = (UINT16*)m_vram.get();
int fb_pitch = 1024;
@@ -598,7 +598,7 @@ void k057714_device::draw_character(UINT32 *cmd)
printf("%s Draw Char %08X, x %d, y %d\n", basetag(), address, x, y);
#endif
- UINT16 *vram16 = (UINT16*)m_vram;
+ UINT16 *vram16 = (UINT16*)m_vram.get();
int fb_pitch = 1024;
int height = double_height ? 16 : 8;
diff --git a/src/mame/video/k057714.h b/src/mame/video/k057714.h
index 8447454a18a..a0ca6007385 100644
--- a/src/mame/video/k057714.h
+++ b/src/mame/video/k057714.h
@@ -37,7 +37,7 @@ private:
void draw_character(UINT32 *cmd);
void fb_config(UINT32 *cmd);
- UINT32 *m_vram;
+ std::unique_ptr<UINT32[]> m_vram;
UINT32 m_vram_read_addr;
UINT32 m_vram_fifo0_addr;
UINT32 m_vram_fifo1_addr;
diff --git a/src/mame/video/k1ge.cpp b/src/mame/video/k1ge.cpp
index 94e0398fd1a..4906fff945c 100644
--- a/src/mame/video/k1ge.cpp
+++ b/src/mame/video/k1ge.cpp
@@ -803,7 +803,7 @@ void k1ge_device::device_start()
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::timer_callback), this));
m_hblank_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::hblank_on_timer_callback), this));
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x4000);
- m_bitmap = auto_bitmap_ind16_alloc( machine(), m_screen->width(), m_screen->height() );
+ m_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height() );
save_pointer(NAME(m_vram), 0x4000);
save_item(NAME(m_wba_h));
diff --git a/src/mame/video/k1ge.h b/src/mame/video/k1ge.h
index 73fd8ed39fe..93f4a0aa630 100644
--- a/src/mame/video/k1ge.h
+++ b/src/mame/video/k1ge.h
@@ -55,7 +55,7 @@ protected:
emu_timer *m_timer;
emu_timer *m_hblank_on_timer;
- bitmap_ind16 *m_bitmap;
+ std::unique_ptr<bitmap_ind16> m_bitmap;
virtual void draw(int line);
diff --git a/src/mame/video/kan_pand.cpp b/src/mame/video/kan_pand.cpp
index ad8777a2ff7..181de04020d 100644
--- a/src/mame/video/kan_pand.cpp
+++ b/src/mame/video/kan_pand.cpp
@@ -93,13 +93,13 @@ void kaneko_pandora_device::device_start()
{
m_bg_pen = 0;
- m_spriteram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_spriteram = std::make_unique<UINT8[]>(0x1000);
- m_sprites_bitmap = auto_bitmap_ind16_alloc(machine(), m_screen->width(), m_screen->height());
+ m_sprites_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height());
save_item(NAME(m_clear_bitmap));
save_item(NAME(m_bg_pen));
- save_pointer(NAME(m_spriteram), 0x1000);
+ save_pointer(NAME(m_spriteram.get()), 0x1000);
save_item(NAME(*m_sprites_bitmap));
}
@@ -109,7 +109,7 @@ void kaneko_pandora_device::device_start()
void kaneko_pandora_device::device_reset()
{
- memset(m_spriteram, 0x00, 0x1000);
+ memset(m_spriteram.get(), 0x00, 0x1000);
m_clear_bitmap = 1;
}
diff --git a/src/mame/video/kan_pand.h b/src/mame/video/kan_pand.h
index 29c8383194d..f29c5ef3605 100644
--- a/src/mame/video/kan_pand.h
+++ b/src/mame/video/kan_pand.h
@@ -51,8 +51,8 @@ protected:
private:
// internal state
- UINT8 * m_spriteram;
- bitmap_ind16 *m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */
+ std::unique_ptr<UINT8[]> m_spriteram;
+ std::unique_ptr<bitmap_ind16> m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */
int m_clear_bitmap;
int m_bg_pen; // might work some other way..
UINT8 m_gfx_region;
diff --git a/src/mame/video/kangaroo.cpp b/src/mame/video/kangaroo.cpp
index 4949a13ebe4..78bedef66f8 100644
--- a/src/mame/video/kangaroo.cpp
+++ b/src/mame/video/kangaroo.cpp
@@ -18,8 +18,8 @@
void kangaroo_state::video_start()
{
/* video RAM is accessed 32 bits at a time (two planes, 4bpp each, 4 pixels) */
- m_videoram = auto_alloc_array(machine(), UINT32, 256 * 64);
- save_pointer(NAME(m_videoram), 256 * 64);
+ m_videoram = std::make_unique<UINT32[]>(256 * 64);
+ save_pointer(NAME(m_videoram.get()), 256 * 64);
}
diff --git a/src/mame/video/karnov.cpp b/src/mame/video/karnov.cpp
index 50adb033a8f..69d48a46a77 100644
--- a/src/mame/video/karnov.cpp
+++ b/src/mame/video/karnov.cpp
@@ -160,7 +160,7 @@ WRITE16_MEMBER(karnov_state::karnov_playfield_swap_w)
VIDEO_START_MEMBER(karnov_state,karnov)
{
/* Allocate bitmap & tilemap */
- m_bitmap_f = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_bitmap_f = std::make_unique<bitmap_ind16>(512, 512);
m_fix_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(karnov_state::get_fix_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
save_item(NAME(*m_bitmap_f));
@@ -171,7 +171,7 @@ VIDEO_START_MEMBER(karnov_state,karnov)
VIDEO_START_MEMBER(karnov_state,wndrplnt)
{
/* Allocate bitmap & tilemap */
- m_bitmap_f = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_bitmap_f = std::make_unique<bitmap_ind16>(512, 512);
m_fix_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(karnov_state::get_fix_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
save_item(NAME(*m_bitmap_f));
diff --git a/src/mame/video/konamigx.cpp b/src/mame/video/konamigx.cpp
index 216525f2662..356947da9db 100644
--- a/src/mame/video/konamigx.cpp
+++ b/src/mame/video/konamigx.cpp
@@ -238,7 +238,7 @@ void konamigx_state::wipezbuf(int noshadow)
if (!noshadow)
{
- zptr = m_gx_shdzbuf;
+ zptr = m_gx_shdzbuf.get();
w <<= 1;
ecx = h;
do { memset(zptr, -1, w); zptr += (GX_ZBUFW<<1); } while (--ecx);
@@ -285,7 +285,7 @@ void konamigx_state::konamigx_mixer_init(screen_device &screen, int objdma)
m_gx_primode = 0;
m_gx_objzbuf = &screen.priority().pix8(0);
- m_gx_shdzbuf = auto_alloc_array(machine(), UINT8, GX_ZBUFSIZE);
+ m_gx_shdzbuf = std::make_unique<UINT8[]>(GX_ZBUFSIZE);
gx_objpool = auto_alloc_array(machine(), struct GX_OBJ, GX_MAX_OBJECTS);
m_k054338->export_config(&m_K054338_shdRGB);
@@ -861,7 +861,7 @@ void konamigx_state::konamigx_mixer_draw(screen_device &screen, bitmap_rgb32 &bi
m_k055673->k053247_draw_single_sprite_gxcore(bitmap, cliprect,
- m_gx_objzbuf, m_gx_shdzbuf, code, m_gx_spriteram, offs,
+ m_gx_objzbuf, m_gx_shdzbuf.get(), code, m_gx_spriteram, offs,
color, alpha, drawmode, zcode, pri,
/* non-gx only */
0,0,nullptr,nullptr,0
@@ -1160,8 +1160,8 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type3)
int width = m_screen->width();
int height = m_screen->height();
- m_dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- m_dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
+ m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
common_init();
@@ -1173,7 +1173,7 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type3)
/* set up tile layers */
- m_type3_roz_temp_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_type3_roz_temp_bitmap = std::make_unique<bitmap_ind16>(width, height);
//m_gx_psac_tilemap->set_flip(TILEMAP_FLIPX| TILEMAP_FLIPY);
@@ -1196,8 +1196,8 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type4)
int width = m_screen->width();
int height = m_screen->height();
- m_dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- m_dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
+ m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
common_init();
@@ -1224,8 +1224,8 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type4_vsn)
int width = m_screen->width();
int height = m_screen->height();
- m_dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- m_dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
+ m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
common_init();
@@ -1251,8 +1251,8 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type4_sd2)
int width = m_screen->width();
int height = m_screen->height();
- m_dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
- m_dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height);
+ m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
+ m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
common_init();
@@ -1295,8 +1295,8 @@ VIDEO_START_MEMBER(konamigx_state, opengolf)
m_gx_rozenable = 0;
m_gx_specialrozenable = 1;
- m_gxtype1_roz_dstbitmap = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
- m_gxtype1_roz_dstbitmap2 = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ m_gxtype1_roz_dstbitmap = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ m_gxtype1_roz_dstbitmap2 = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmapclip.set(0, 512-1, 0, 512-1);
@@ -1330,8 +1330,8 @@ VIDEO_START_MEMBER(konamigx_state, racinfrc)
m_gx_rozenable = 0;
m_gx_specialrozenable = 1;
- m_gxtype1_roz_dstbitmap = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
- m_gxtype1_roz_dstbitmap2 = auto_bitmap_ind16_alloc(machine(),512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ m_gxtype1_roz_dstbitmap = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
+ m_gxtype1_roz_dstbitmap2 = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmapclip.set(0, 512-1, 0, 512-1);
@@ -1424,7 +1424,7 @@ UINT32 konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rgb3
else K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap, 0,0,0); // soccerss playfield
- konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, 0, m_type3_roz_temp_bitmap, m_gx_rushingheroes_hack);
+ konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, 0, m_type3_roz_temp_bitmap.get(), m_gx_rushingheroes_hack);
}
else
{
diff --git a/src/mame/video/ladyfrog.cpp b/src/mame/video/ladyfrog.cpp
index 8079d0a9fc0..44cd01d9f7f 100644
--- a/src/mame/video/ladyfrog.cpp
+++ b/src/mame/video/ladyfrog.cpp
@@ -126,7 +126,7 @@ void ladyfrog_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
VIDEO_START_MEMBER(ladyfrog_state,ladyfrog_common)
{
- m_spriteram = auto_alloc_array(machine(), UINT8, 160);
+ m_spriteram = std::make_unique<UINT8[]>(160);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ladyfrog_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_paletteram.resize(0x200);
@@ -137,7 +137,7 @@ VIDEO_START_MEMBER(ladyfrog_state,ladyfrog_common)
m_bg_tilemap->set_scroll_cols(32);
m_bg_tilemap->set_scrolldy(15, 15);
- save_pointer(NAME(m_spriteram), 160);
+ save_pointer(NAME(m_spriteram.get()), 160);
save_item(NAME(m_paletteram));
save_item(NAME(m_paletteram_ext));
}
diff --git a/src/mame/video/legionna.cpp b/src/mame/video/legionna.cpp
index 69b591ce001..f9840cc3a98 100644
--- a/src/mame/video/legionna.cpp
+++ b/src/mame/video/legionna.cpp
@@ -206,7 +206,7 @@ VIDEO_START_MEMBER(legionna_state,legionna)
m_midground_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info),this), TILEMAP_SCAN_ROWS,16,16,32,32);
m_text_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
- m_scrollram16 = auto_alloc_array(machine(), UINT16, 0x60/2);
+ m_scrollram16 = std::make_unique<UINT16[]>(0x60/2);
m_sprite_xoffs = 0;
m_sprite_yoffs = 0;
@@ -231,7 +231,7 @@ VIDEO_START_MEMBER(legionna_state,denjinmk)
m_midground_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info_denji),this), TILEMAP_SCAN_ROWS,16,16,32,32);
m_text_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
- m_scrollram16 = auto_alloc_array(machine(), UINT16, 0x60/2);
+ m_scrollram16 = std::make_unique<UINT16[]>(0x60/2);
m_sprite_xoffs = 0;
m_sprite_yoffs = 0;
@@ -256,7 +256,7 @@ VIDEO_START_MEMBER(legionna_state,cupsoc)
m_midground_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(legionna_state::get_mid_tile_info_cupsoc),this), TILEMAP_SCAN_ROWS,16,16,32,32);
m_text_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(legionna_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS, 8,8,64,32);
- m_scrollram16 = auto_alloc_array(machine(), UINT16, 0x60/2);
+ m_scrollram16 = std::make_unique<UINT16[]>(0x60/2);
m_sprite_xoffs = 0;
m_sprite_yoffs = 0;
diff --git a/src/mame/video/lethalj.cpp b/src/mame/video/lethalj.cpp
index 3fdc4027ede..ae40525e276 100644
--- a/src/mame/video/lethalj.cpp
+++ b/src/mame/video/lethalj.cpp
@@ -87,7 +87,7 @@ READ16_MEMBER(lethalj_state::lethalj_gun_r)
void lethalj_state::video_start()
{
/* allocate video RAM for screen */
- m_screenram = auto_alloc_array(machine(), UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
+ m_screenram = std::make_unique<UINT16[]>(BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
/* predetermine blitter info */
m_blitter_base = (UINT16 *)memregion("gfx1")->base();
@@ -136,7 +136,7 @@ void lethalj_state::do_blit()
if (dsty >= 0 && dsty < BLITTER_DEST_HEIGHT/2)
{
UINT16 *source = m_blitter_base + (srcy % m_blitter_rows) * BLITTER_SOURCE_WIDTH;
- UINT16 *dest = m_screenram + (dsty + (m_vispage ^ 1) * 256) * BLITTER_DEST_WIDTH;
+ UINT16 *dest = m_screenram.get() + (dsty + (m_vispage ^ 1) * 256) * BLITTER_DEST_WIDTH;
int sx = srcx;
int dx = dstx;
int x;
diff --git a/src/mame/video/liberate.cpp b/src/mame/video/liberate.cpp
index 55011e47c58..b53c767f042 100644
--- a/src/mame/video/liberate.cpp
+++ b/src/mame/video/liberate.cpp
@@ -210,9 +210,9 @@ VIDEO_START_MEMBER(liberate_state,prosoccr)
m_fix_tilemap->set_transparent_pen(0);
m_fg_gfx = memregion("fg_gfx")->base();
- m_charram = auto_alloc_array(machine(), UINT8, 0x1800 * 2);
+ m_charram = std::make_unique<UINT8[]>(0x1800 * 2);
- save_pointer(NAME(m_charram), 0x1800 * 2);
+ save_pointer(NAME(m_charram.get()), 0x1800 * 2);
save_pointer(NAME(m_fg_gfx), 0x6000);
}
diff --git a/src/mame/video/lockon.cpp b/src/mame/video/lockon.cpp
index 4bb6e2e59a0..6e2bcb9cc7f 100644
--- a/src/mame/video/lockon.cpp
+++ b/src/mame/video/lockon.cpp
@@ -891,11 +891,11 @@ void lockon_state::video_start()
m_tilemap->set_transparent_pen(0);
/* Allocate the two frame buffers for rotation */
- m_back_buffer = auto_bitmap_ind16_alloc(machine(), 512, 512);
- m_front_buffer = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_back_buffer = std::make_unique<bitmap_ind16>(512, 512);
+ m_front_buffer = std::make_unique<bitmap_ind16>(512, 512);
/* 2kB of object ASIC palette RAM */
- m_obj_pal_ram = auto_alloc_array(machine(), UINT8, 2048);
+ m_obj_pal_ram = std::make_unique<UINT8[]>(2048);
/* Timer for ground display list callback */
m_bufend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lockon_state::bufend_callback),this));
@@ -906,7 +906,7 @@ void lockon_state::video_start()
save_item(NAME(*m_back_buffer));
save_item(NAME(*m_front_buffer));
- save_pointer(NAME(m_obj_pal_ram), 2048);
+ save_pointer(NAME(m_obj_pal_ram.get()), 2048);
}
UINT32 lockon_state::screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -936,9 +936,7 @@ void lockon_state::screen_eof_lockon(screen_device &screen, bool state)
if (!state)
{
/* Swap the frame buffers */
- bitmap_ind16 *tmp = m_front_buffer;
- m_front_buffer = m_back_buffer;
- m_back_buffer = tmp;
+ m_front_buffer.swap(m_back_buffer);
/* Draw the frame buffer layers */
scene_draw();
diff --git a/src/mame/video/lordgun.cpp b/src/mame/video/lordgun.cpp
index fb314c7c8be..f9d5790b6f0 100644
--- a/src/mame/video/lordgun.cpp
+++ b/src/mame/video/lordgun.cpp
@@ -131,7 +131,7 @@ void lordgun_state::video_start()
// Buffer bitmaps for 4 tilemaps (0-3) + sprites (4)
for (i = 0; i < 5; i++)
- m_bitmaps[i] = auto_bitmap_ind16_alloc(machine(), w, h);
+ m_bitmaps[i] = std::make_unique<bitmap_ind16>(w, h);
}
/***************************************************************************
diff --git a/src/mame/video/m58.cpp b/src/mame/video/m58.cpp
index 5a2fc6f4232..1d61628884b 100644
--- a/src/mame/video/m58.cpp
+++ b/src/mame/video/m58.cpp
@@ -182,7 +182,7 @@ void m58_state::video_start()
m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1));
m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1));
- //m_scroll_panel_bitmap = auto_bitmap_ind16_alloc(machine(), SCROLL_PANEL_WIDTH, height);
+ //m_scroll_panel_bitmap = std::make_unique<bitmap_ind16>(SCROLL_PANEL_WIDTH, height);
m_screen->register_screen_bitmap(m_scroll_panel_bitmap);
save_item(NAME(m_scroll_panel_bitmap));
}
diff --git a/src/mame/video/m72.cpp b/src/mame/video/m72.cpp
index 61d03d3857c..b4840baacd2 100644
--- a/src/mame/video/m72.cpp
+++ b/src/mame/video/m72.cpp
@@ -105,7 +105,7 @@ void m72_state::register_savestate()
save_item(NAME(m_scrolly1));
save_item(NAME(m_scrollx2));
save_item(NAME(m_scrolly2));
- save_pointer(NAME(m_buffered_spriteram), m_spriteram.bytes()/2);
+ save_pointer(NAME(m_buffered_spriteram.get()), m_spriteram.bytes()/2);
}
@@ -114,7 +114,7 @@ VIDEO_START_MEMBER(m72_state,m72)
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
+ m_buffered_spriteram = std::make_unique<UINT16[]>(m_spriteram.bytes()/2);
m_fg_tilemap->set_transmask(0,0xffff,0x0001);
m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
@@ -128,7 +128,7 @@ VIDEO_START_MEMBER(m72_state,m72)
//m_bg_tilemap->set_transmask(2,0x001f,0xffe0); // needed for nspiritj japan warning to look correct
// not sure what is needed to be able to see the imgfghto warning message
- memset(m_buffered_spriteram,0,m_spriteram.bytes());
+ memset(m_buffered_spriteram.get(),0,m_spriteram.bytes());
m_fg_tilemap->set_scrolldx(0,0);
m_fg_tilemap->set_scrolldy(-128,-128);
@@ -209,8 +209,8 @@ VIDEO_START_MEMBER(m72_state,m82)
m_bg_tilemap_large->set_scrolldx(4,0);
m_bg_tilemap_large->set_scrolldy(-128,-128);
- m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
- memset(m_buffered_spriteram,0,m_spriteram.bytes());
+ m_buffered_spriteram = std::make_unique<UINT16[]>(m_spriteram.bytes()/2);
+ memset(m_buffered_spriteram.get(),0,m_spriteram.bytes());
register_savestate();
save_item(NAME(m_m82_rowscroll));
@@ -224,7 +224,7 @@ VIDEO_START_MEMBER(m72_state,rtype2)
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::rtype2_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
- m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
+ m_buffered_spriteram = std::make_unique<UINT16[]>(m_spriteram.bytes()/2);
m_fg_tilemap->set_transmask(0,0xffff,0x0001);
m_fg_tilemap->set_transmask(1,0x00ff,0xff01);
@@ -234,7 +234,7 @@ VIDEO_START_MEMBER(m72_state,rtype2)
m_bg_tilemap->set_transmask(1,0x00ff,0xff00);
m_bg_tilemap->set_transmask(2,0x0001,0xfffe);
- memset(m_buffered_spriteram,0,m_spriteram.bytes());
+ memset(m_buffered_spriteram.get(),0,m_spriteram.bytes());
m_fg_tilemap->set_scrolldx(4,0);
m_fg_tilemap->set_scrolldy(-128,16);
@@ -375,7 +375,7 @@ WRITE16_MEMBER(m72_state::scrolly2_w)
WRITE16_MEMBER(m72_state::dmaon_w)
{
if (ACCESSING_BITS_0_7)
- memcpy(m_buffered_spriteram, m_spriteram, m_spriteram.bytes());
+ memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
}
@@ -454,7 +454,7 @@ WRITE16_MEMBER(m72_state::m82_tm_ctrl_w)
void m72_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- UINT16 *spriteram = m_buffered_spriteram;
+ UINT16 *spriteram = m_buffered_spriteram.get();
int offs;
offs = 0;
diff --git a/src/mame/video/madalien.cpp b/src/mame/video/madalien.cpp
index cd9447a6478..73af39bb0e7 100644
--- a/src/mame/video/madalien.cpp
+++ b/src/mame/video/madalien.cpp
@@ -143,7 +143,7 @@ VIDEO_START_MEMBER(madalien_state,madalien)
m_tilemap_edge2[i] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(madalien_state::get_tile_info_BG_2),this), scan_functions[i], 16, 16, tilemap_cols[i], 8);
}
- m_headlight_bitmap = auto_bitmap_ind16_alloc(machine(), 128, 128);
+ m_headlight_bitmap = std::make_unique<bitmap_ind16>(128, 128);
m_gfxdecode->gfx(0)->set_source(m_charram);
diff --git a/src/mame/video/magmax.cpp b/src/mame/video/magmax.cpp
index f6279a137f6..4e5212303eb 100644
--- a/src/mame/video/magmax.cpp
+++ b/src/mame/video/magmax.cpp
@@ -69,7 +69,7 @@ void magmax_state::video_start()
/* Set up save state */
save_item(NAME(m_flipscreen));
- m_prom_tab = auto_alloc_array(machine(), UINT32, 256);
+ m_prom_tab = std::make_unique<UINT32[]>(256);
m_screen->register_screen_bitmap(m_bitmap);
diff --git a/src/mame/video/matmania.cpp b/src/mame/video/matmania.cpp
index 3a994d02079..d91a2c32f19 100644
--- a/src/mame/video/matmania.cpp
+++ b/src/mame/video/matmania.cpp
@@ -120,8 +120,8 @@ void matmania_state::video_start()
int height = m_screen->height();
/* Mat Mania has a virtual screen twice as large as the visible screen */
- m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), width, 2 * height);
- m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine(), width, 2 * height);
+ m_tmpbitmap = std::make_unique<bitmap_ind16>(width, 2 * height);
+ m_tmpbitmap2 = std::make_unique<bitmap_ind16>(width, 2 * height);
}
diff --git a/src/mame/video/mcatadv.cpp b/src/mame/video/mcatadv.cpp
index 9e03ef904ac..a14b5ba9f41 100644
--- a/src/mame/video/mcatadv.cpp
+++ b/src/mame/video/mcatadv.cpp
@@ -272,13 +272,13 @@ void mcatadv_state::video_start()
m_tilemap2->set_transparent_pen(0);
m_spriteram_old = auto_alloc_array_clear(machine(), UINT16, m_spriteram.bytes() / 2);
- m_vidregs_old = auto_alloc_array(machine(), UINT16, (0x0f + 1) / 2);
+ m_vidregs_old = std::make_unique<UINT16[]>((0x0f + 1) / 2);
m_palette_bank1 = 0;
m_palette_bank2 = 0;
save_pointer(NAME(m_spriteram_old), m_spriteram.bytes() / 2);
- save_pointer(NAME(m_vidregs_old), (0x0f + 1) / 2);
+ save_pointer(NAME(m_vidregs_old.get()), (0x0f + 1) / 2);
}
void mcatadv_state::screen_eof_mcatadv(screen_device &screen, bool state)
@@ -287,6 +287,6 @@ void mcatadv_state::screen_eof_mcatadv(screen_device &screen, bool state)
if (state)
{
memcpy(m_spriteram_old, m_spriteram, m_spriteram.bytes());
- memcpy(m_vidregs_old, m_vidregs, 0xf);
+ memcpy(m_vidregs_old.get(), m_vidregs, 0xf);
}
}
diff --git a/src/mame/video/mcr68.cpp b/src/mame/video/mcr68.cpp
index 7d9da3db68e..a02ff35f87f 100644
--- a/src/mame/video/mcr68.cpp
+++ b/src/mame/video/mcr68.cpp
@@ -71,8 +71,10 @@ VIDEO_START_MEMBER(mcr68_state,zwackery)
const UINT8 *colordatabase = (const UINT8 *)memregion("gfx3")->base();
gfx_element *gfx0 = m_gfxdecode->gfx(0);
gfx_element *gfx2 = m_gfxdecode->gfx(2);
- UINT8 *srcdata0, *dest0;
- UINT8 *srcdata2, *dest2;
+ std::unique_ptr<UINT8[]> srcdata0;
+ UINT8 *dest0;
+ std::unique_ptr<UINT8[]> srcdata2;
+ UINT8 *dest2;
int code, y, x;
/* initialize the background tilemap */
@@ -83,12 +85,12 @@ VIDEO_START_MEMBER(mcr68_state,zwackery)
m_fg_tilemap->set_transparent_pen(0);
/* allocate memory for the assembled gfx data */
- srcdata0 = auto_alloc_array(machine(), UINT8, gfx0->elements() * gfx0->width() * gfx0->height());
- srcdata2 = auto_alloc_array(machine(), UINT8, gfx2->elements() * gfx2->width() * gfx2->height());
+ srcdata0 = std::make_unique<UINT8[]>(gfx0->elements() * gfx0->width() * gfx0->height());
+ srcdata2 = std::make_unique<UINT8[]>(gfx2->elements() * gfx2->width() * gfx2->height());
/* "colorize" each code */
- dest0 = srcdata0;
- dest2 = srcdata2;
+ dest0 = srcdata0.get();
+ dest2 = srcdata2.get();
for (code = 0; code < gfx0->elements(); code++)
{
const UINT8 *coldata = colordatabase + code * 32;
@@ -125,8 +127,8 @@ VIDEO_START_MEMBER(mcr68_state,zwackery)
}
/* make the assembled data our new source data */
- gfx0->set_raw_layout(srcdata0, gfx0->width(), gfx0->height(), gfx0->elements(), 8 * gfx0->width(), 8 * gfx0->width() * gfx0->height());
- gfx2->set_raw_layout(srcdata2, gfx2->width(), gfx2->height(), gfx2->elements(), 8 * gfx2->width(), 8 * gfx2->width() * gfx2->height());
+ gfx0->set_raw_layout(srcdata0.get(), gfx0->width(), gfx0->height(), gfx0->elements(), 8 * gfx0->width(), 8 * gfx0->width() * gfx0->height());
+ gfx2->set_raw_layout(srcdata2.get(), gfx2->width(), gfx2->height(), gfx2->elements(), 8 * gfx2->width(), 8 * gfx2->width() * gfx2->height());
}
diff --git a/src/mame/video/megasys1.cpp b/src/mame/video/megasys1.cpp
index 18930a131fc..4565966c80d 100644
--- a/src/mame/video/megasys1.cpp
+++ b/src/mame/video/megasys1.cpp
@@ -225,10 +225,10 @@ VIDEO_START_MEMBER(megasys1_state,megasys1)
m_spriteram = &m_ram[0x8000/2];
- m_buffer_objectram = auto_alloc_array(machine(), UINT16, 0x2000);
- m_buffer_spriteram16 = auto_alloc_array(machine(), UINT16, 0x2000);
- m_buffer2_objectram = auto_alloc_array(machine(), UINT16, 0x2000);
- m_buffer2_spriteram16 = auto_alloc_array(machine(), UINT16, 0x2000);
+ m_buffer_objectram = std::make_unique<UINT16[]>(0x2000);
+ m_buffer_spriteram16 = std::make_unique<UINT16[]>(0x2000);
+ m_buffer2_objectram = std::make_unique<UINT16[]>(0x2000);
+ m_buffer2_spriteram16 = std::make_unique<UINT16[]>(0x2000);
create_tilemaps();
m_tmap[0] = m_tilemap[0][0][0];
@@ -725,8 +725,8 @@ void megasys1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
INT32 color_mask = (m_sprite_flag & 0x100) ? 0x07 : 0x0f;
- UINT16 *objectram = (UINT16*)m_buffer2_objectram;
- UINT16 *spriteram = (UINT16*)m_buffer2_spriteram16;
+ UINT16 *objectram = (UINT16*)m_buffer2_objectram.get();
+ UINT16 *spriteram = (UINT16*)m_buffer2_spriteram16.get();
for (INT32 offs = (0x800-8)/2; offs >= 0; offs -= 4)
{
@@ -1179,11 +1179,11 @@ void megasys1_state::screen_eof_megasys1(screen_device &screen, bool state)
{
/* Sprite are TWO frames ahead, like NMK16 HW. */
//m_objectram
- memcpy(m_buffer2_objectram,m_buffer_objectram, 0x2000);
- memcpy(m_buffer_objectram, m_objectram, 0x2000);
+ memcpy(m_buffer2_objectram.get(),m_buffer_objectram.get(), 0x2000);
+ memcpy(m_buffer_objectram.get(), m_objectram, 0x2000);
//spriteram16
- memcpy(m_buffer2_spriteram16, m_buffer_spriteram16, 0x2000);
- memcpy(m_buffer_spriteram16, m_spriteram, 0x2000);
+ memcpy(m_buffer2_spriteram16.get(), m_buffer_spriteram16.get(), 0x2000);
+ memcpy(m_buffer_spriteram16.get(), m_spriteram, 0x2000);
}
}
diff --git a/src/mame/video/megazone.cpp b/src/mame/video/megazone.cpp
index 8eb713a6fe5..69e8b84f303 100644
--- a/src/mame/video/megazone.cpp
+++ b/src/mame/video/megazone.cpp
@@ -103,7 +103,7 @@ WRITE8_MEMBER(megazone_state::megazone_flipscreen_w)
void megazone_state::video_start()
{
- m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_tmpbitmap = std::make_unique<bitmap_ind16>(256, 256);
save_item(NAME(*m_tmpbitmap));
}
diff --git a/src/mame/video/metlclsh.cpp b/src/mame/video/metlclsh.cpp
index d7fe6f10427..2b4cd3adeb1 100644
--- a/src/mame/video/metlclsh.cpp
+++ b/src/mame/video/metlclsh.cpp
@@ -34,7 +34,7 @@ WRITE8_MEMBER(metlclsh_state::metlclsh_rambank_w)
else
{
m_write_mask = 1 << (data >> 1);
- membank("bank1")->set_base(m_otherram);
+ membank("bank1")->set_base(m_otherram.get());
}
}
@@ -133,7 +133,7 @@ WRITE8_MEMBER(metlclsh_state::metlclsh_fgram_w)
void metlclsh_state::video_start()
{
- m_otherram = auto_alloc_array(machine(), UINT8, 0x800); // banked ram
+ m_otherram = std::make_unique<UINT8[]>(0x800); // banked ram
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(metlclsh_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(metlclsh_state::metlclsh_bgtilemap_scan),this), 16, 16, 32, 16);
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(metlclsh_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
@@ -141,7 +141,7 @@ void metlclsh_state::video_start()
m_bg_tilemap->set_transparent_pen(0);
m_fg_tilemap->set_transparent_pen(0);
- save_pointer(NAME(m_otherram), 0x800);
+ save_pointer(NAME(m_otherram.get()), 0x800);
}
diff --git a/src/mame/video/metro.cpp b/src/mame/video/metro.cpp
index 12127cce1a3..004452cefe5 100644
--- a/src/mame/video/metro.cpp
+++ b/src/mame/video/metro.cpp
@@ -258,7 +258,7 @@ void metro_state::expand_gfx1()
UINT8 *base_gfx = memregion("gfx1")->base();
UINT32 length = memregion("gfx1")->bytes() * 2;
- m_expanded_gfx1 = auto_alloc_array(machine(), UINT8, length);
+ m_expanded_gfx1 = std::make_unique<UINT8[]>(length);
for (int i = 0; i < length; i += 2)
{
@@ -401,7 +401,7 @@ VIDEO_START_MEMBER(metro_state,gstrik2)
void metro_state::metro_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- UINT8 *base_gfx4 = m_expanded_gfx1;
+ UINT8 *base_gfx4 = m_expanded_gfx1.get();
UINT8 *base_gfx8 = memregion("gfx1")->base();
UINT32 gfx_size = memregion("gfx1")->bytes();
diff --git a/src/mame/video/micro3d.cpp b/src/mame/video/micro3d.cpp
index e34a29897a7..2c51c32f928 100644
--- a/src/mame/video/micro3d.cpp
+++ b/src/mame/video/micro3d.cpp
@@ -40,9 +40,9 @@ enum
void micro3d_state::video_start()
{
/* Allocate 512x12 x 2 3D frame buffers */
- m_frame_buffers[0] = auto_alloc_array(machine(), UINT16, 1024 * 512);
- m_frame_buffers[1] = auto_alloc_array(machine(), UINT16, 1024 * 512);
- m_tmp_buffer = auto_alloc_array(machine(), UINT16, 1024 * 512);
+ m_frame_buffers[0] = std::make_unique<UINT16[]>(1024 * 512);
+ m_frame_buffers[1] = std::make_unique<UINT16[]>(1024 * 512);
+ m_tmp_buffer = std::make_unique<UINT16[]>(1024 * 512);
}
@@ -73,7 +73,7 @@ TMS340X0_SCANLINE_IND16_CB_MEMBER(micro3d_state::scanline_update)
UINT16 *frame_src;
scanline = MAX((scanline - params->veblnk), 0);
- frame_src = m_frame_buffers[m_display_buffer] + (scanline << 10);
+ frame_src = m_frame_buffers[m_display_buffer].get() + (scanline << 10);
/* TODO: XFER3DK - X/Y offsets for 3D */
@@ -672,7 +672,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_fifo_w)
case 0xd8:
{
/* TODO: We shouldn't need this extra buffer - is there some sort of sync missing? */
- memcpy(m_frame_buffers[m_drawing_buffer], m_tmp_buffer, 512*1024*2);
+ memcpy(m_frame_buffers[m_drawing_buffer].get(), m_tmp_buffer.get(), 512*1024*2);
m_drawing_buffer ^= 1;
m_vgb->set_input_line(0, ASSERT_LINE);
break;
diff --git a/src/mame/video/microtan.cpp b/src/mame/video/microtan.cpp
index b6973e40fac..5bf71726278 100644
--- a/src/mame/video/microtan.cpp
+++ b/src/mame/video/microtan.cpp
@@ -45,8 +45,8 @@ void microtan_state::video_start()
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(microtan_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 16, 32, 16);
- m_chunky_buffer = auto_alloc_array(machine(), UINT8, 0x200);
- memset(m_chunky_buffer, 0, 0x200);
+ m_chunky_buffer = std::make_unique<UINT8[]>(0x200);
+ memset(m_chunky_buffer.get(), 0, 0x200);
m_chunky_graphics = 0;
}
diff --git a/src/mame/video/midtunit.cpp b/src/mame/video/midtunit.cpp
index 4b091991125..e4c48c8c1b2 100644
--- a/src/mame/video/midtunit.cpp
+++ b/src/mame/video/midtunit.cpp
@@ -48,7 +48,7 @@ static UINT16 midtunit_control;
/* videoram-related variables */
static UINT32 gfxbank_offset[2];
-static UINT16 * local_videoram;
+static std::unique_ptr<UINT16[]> local_videoram;
static UINT8 videobank_select;
/* DMA-related variables */
@@ -91,7 +91,7 @@ static struct
VIDEO_START_MEMBER(midtunit_state,midtunit)
{
/* allocate memory */
- local_videoram = auto_alloc_array(machine(), UINT16, 0x100000/2);
+ local_videoram = std::make_unique<UINT16[]>(0x100000/2);
/* reset all the globals */
gfxbank_offset[0] = 0x000000;
@@ -104,7 +104,7 @@ VIDEO_START_MEMBER(midtunit_state,midtunit)
/* register for state saving */
save_item(NAME(midtunit_control));
save_item(NAME(gfxbank_offset));
- save_pointer(NAME(local_videoram), 0x100000/sizeof(local_videoram[0]));
+ save_pointer(NAME(local_videoram.get()), 0x100000/sizeof(local_videoram[0]));
save_item(NAME(videobank_select));
save_item(NAME(dma_register));
}
diff --git a/src/mame/video/midyunit.cpp b/src/mame/video/midyunit.cpp
index eab824b3418..6bbfc2a5358 100644
--- a/src/mame/video/midyunit.cpp
+++ b/src/mame/video/midyunit.cpp
@@ -42,11 +42,11 @@ enum
VIDEO_START_MEMBER(midyunit_state,common)
{
/* allocate memory */
- m_cmos_ram = auto_alloc_array(machine(), UINT16, (0x2000 * 4)/2);
+ m_cmos_ram = std::make_unique<UINT16[]>((0x2000 * 4)/2);
m_local_videoram = auto_alloc_array_clear(machine(), UINT16, 0x80000/2);
m_pen_map = auto_alloc_array(machine(), pen_t, 65536);
- machine().device<nvram_device>("nvram")->set_base(m_cmos_ram, 0x2000 * 4);
+ machine().device<nvram_device>("nvram")->set_base(m_cmos_ram.get(), 0x2000 * 4);
/* reset all the globals */
m_cmos_page = 0;
@@ -60,7 +60,7 @@ VIDEO_START_MEMBER(midyunit_state,common)
/* register for state saving */
save_item(NAME(m_autoerase_enable));
save_pointer(NAME(m_local_videoram), 0x80000/2);
- save_pointer(NAME(m_cmos_ram), (0x2000 * 4)/2);
+ save_pointer(NAME(m_cmos_ram.get()), (0x2000 * 4)/2);
save_item(NAME(m_videobank_select));
save_item(NAME(m_dma_register));
}
diff --git a/src/mame/video/model3.cpp b/src/mame/video/model3.cpp
index 9e1e60be5d8..c73b05c0a72 100644
--- a/src/mame/video/model3.cpp
+++ b/src/mame/video/model3.cpp
@@ -43,8 +43,8 @@ public:
model3_renderer(model3_state &state, int width, int height)
: poly_manager<float, model3_polydata, 6, 50000>(state.machine())
{
- m_fb = auto_bitmap_rgb32_alloc(state.machine(), width, height);
- m_zb = auto_bitmap_ind32_alloc(state.machine(), width, height);
+ m_fb = std::make_unique<bitmap_rgb32>(width, height);
+ m_zb = std::make_unique<bitmap_ind32>(width, height);
}
void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -62,8 +62,8 @@ public:
void wait_for_polys();
private:
- bitmap_rgb32 *m_fb;
- bitmap_ind32 *m_zb;
+ std::unique_ptr<bitmap_rgb32> m_fb;
+ std::unique_ptr<bitmap_ind32> m_zb;
};
@@ -185,8 +185,8 @@ void model3_state::video_start()
m_texture_fifo = auto_alloc_array_clear(machine(), UINT32, 0x100000/4);
/* 2x 4MB texture sheets */
- m_texture_ram[0] = auto_alloc_array(machine(), UINT16, 0x400000/2);
- m_texture_ram[1] = auto_alloc_array(machine(), UINT16, 0x400000/2);
+ m_texture_ram[0] = std::make_unique<UINT16[]>(0x400000/2);
+ m_texture_ram[1] = std::make_unique<UINT16[]>(0x400000/2);
/* 1MB Display List RAM */
m_display_list_ram = auto_alloc_array_clear(machine(), UINT32, 0x100000/4);
diff --git a/src/mame/video/munchmo.cpp b/src/mame/video/munchmo.cpp
index 86febc95642..c95dc5a232b 100644
--- a/src/mame/video/munchmo.cpp
+++ b/src/mame/video/munchmo.cpp
@@ -45,7 +45,7 @@ WRITE8_MEMBER(munchmo_state::mnchmobl_flipscreen_w)
void munchmo_state::video_start()
{
- m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), 512, 512);
+ m_tmpbitmap = std::make_unique<bitmap_ind16>(512, 512);
}
void munchmo_state::draw_status( bitmap_ind16 &bitmap, const rectangle &cliprect )
diff --git a/src/mame/video/n64.cpp b/src/mame/video/n64.cpp
index bba19f6aa56..c9ba7a71f03 100644
--- a/src/mame/video/n64.cpp
+++ b/src/mame/video/n64.cpp
@@ -2106,7 +2106,7 @@ void n64_rdp::draw_triangle(bool shade, bool texture, bool zbuffer, bool rect)
if(new_object)
{
object = &object_data_alloc();
- memcpy(object->m_tmem, m_tmem, 0x1000);
+ memcpy(object->m_tmem, m_tmem.get(), 0x1000);
new_object = false;
}
diff --git a/src/mame/video/n64.h b/src/mame/video/n64.h
index 8f9bb174633..bcaa05d7ad4 100644
--- a/src/mame/video/n64.h
+++ b/src/mame/video/n64.h
@@ -139,8 +139,8 @@ public:
void init_internal_state()
{
- m_tmem = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_tmem, 0, 0x1000);
+ m_tmem = std::make_unique<UINT8[]>(0x1000);
+ memset(m_tmem.get(), 0, 0x1000);
UINT8* normpoint = machine().root_device().memregion("normpoint")->base();
UINT8* normslope = machine().root_device().memregion("normslope")->base();
@@ -192,8 +192,8 @@ public:
void set_mul_input_alpha(color_t** input, INT32 code, rdp_span_aux* userdata);
// Texture memory
- UINT8* get_tmem8() { return m_tmem; }
- UINT16* get_tmem16() { return (UINT16*)m_tmem; }
+ UINT8* get_tmem8() { return m_tmem.get(); }
+ UINT16* get_tmem16() { return (UINT16*)m_tmem.get(); }
// YUV Factors
void set_yuv_factors(color_t k023, color_t k1, color_t k4, color_t k5) { m_k023 = k023; m_k1 = k1; m_k4 = k4; m_k5 = k5; }
@@ -356,7 +356,7 @@ private:
UINT32 m_current;
UINT32 m_status;
- UINT8* m_tmem;
+ std::unique_ptr<UINT8[]> m_tmem;
// YUV factors
color_t m_k023;
diff --git a/src/mame/video/namcos21.cpp b/src/mame/video/namcos21.cpp
index 2baae7d69c3..0c91a8b0fe7 100644
--- a/src/mame/video/namcos21.cpp
+++ b/src/mame/video/namcos21.cpp
@@ -36,7 +36,7 @@ WRITE16_MEMBER(namcos21_state::winrun_gpu_register_w)
WRITE16_MEMBER(namcos21_state::winrun_gpu_videoram_w)
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
int color = data>>8;
int mask = data&0xff;
int i;
@@ -51,17 +51,17 @@ WRITE16_MEMBER(namcos21_state::winrun_gpu_videoram_w)
READ16_MEMBER(namcos21_state::winrun_gpu_videoram_r)
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
return videoram[offset]<<8;
}
void namcos21_state::allocate_poly_framebuffer()
{
- m_mpPolyFrameBufferZ = auto_alloc_array(machine(), UINT16, FRAMEBUFFER_SIZE_IN_BYTES/2 );
- m_mpPolyFrameBufferPens = auto_alloc_array(machine(), UINT16, FRAMEBUFFER_SIZE_IN_BYTES/2 );
+ m_mpPolyFrameBufferZ = std::make_unique<UINT16[]>(FRAMEBUFFER_SIZE_IN_BYTES/2 );
+ m_mpPolyFrameBufferPens = std::make_unique<UINT16[]>(FRAMEBUFFER_SIZE_IN_BYTES/2 );
- m_mpPolyFrameBufferZ2 = auto_alloc_array(machine(), UINT16, FRAMEBUFFER_SIZE_IN_BYTES/2 );
- m_mpPolyFrameBufferPens2 = auto_alloc_array(machine(), UINT16, FRAMEBUFFER_SIZE_IN_BYTES/2 );
+ m_mpPolyFrameBufferZ2 = std::make_unique<UINT16[]>(FRAMEBUFFER_SIZE_IN_BYTES/2 );
+ m_mpPolyFrameBufferPens2 = std::make_unique<UINT16[]>(FRAMEBUFFER_SIZE_IN_BYTES/2 );
clear_poly_framebuffer();
clear_poly_framebuffer();
@@ -69,16 +69,10 @@ void namcos21_state::allocate_poly_framebuffer()
void namcos21_state::clear_poly_framebuffer()
{
- UINT16 *temp2;
-
/* swap work and visible framebuffers */
- temp2 = m_mpPolyFrameBufferZ;
- m_mpPolyFrameBufferZ = m_mpPolyFrameBufferZ2;
- m_mpPolyFrameBufferZ2 = temp2;
+ m_mpPolyFrameBufferZ.swap(m_mpPolyFrameBufferZ2);
- temp2 = m_mpPolyFrameBufferPens;
- m_mpPolyFrameBufferPens = m_mpPolyFrameBufferPens2;
- m_mpPolyFrameBufferPens2 = temp2;
+ m_mpPolyFrameBufferPens.swap(m_mpPolyFrameBufferPens2);
/* wipe work zbuffer */
for( int i = 0; i < NAMCOS21_POLY_FRAME_WIDTH*NAMCOS21_POLY_FRAME_HEIGHT; i++ )
@@ -94,8 +88,8 @@ void namcos21_state::copy_visible_poly_framebuffer(bitmap_ind16 &bitmap, const r
for( sy=clip.min_y; sy<=clip.max_y; sy++ )
{
UINT16 *dest = &bitmap.pix16(sy);
- const UINT16 *pPen = m_mpPolyFrameBufferPens2+NAMCOS21_POLY_FRAME_WIDTH*sy;
- const UINT16 *pZ = m_mpPolyFrameBufferZ2+NAMCOS21_POLY_FRAME_WIDTH*sy;
+ const UINT16 *pPen = m_mpPolyFrameBufferPens2.get()+NAMCOS21_POLY_FRAME_WIDTH*sy;
+ const UINT16 *pZ = m_mpPolyFrameBufferZ2.get()+NAMCOS21_POLY_FRAME_WIDTH*sy;
int sx;
for( sx=clip.min_x; sx<=clip.max_x; sx++ )
{
@@ -113,7 +107,7 @@ VIDEO_START_MEMBER(namcos21_state,namcos21)
{
if( m_gametype == NAMCOS21_WINRUN91 )
{
- m_videoram = auto_alloc_array(machine(), UINT8, 0x80000);
+ m_videoram = std::make_unique<UINT8[]>(0x80000);
}
allocate_poly_framebuffer();
c355_obj_init(
@@ -143,7 +137,7 @@ VIDEO_START_MEMBER(namcos21_state,namcos21)
UINT32 namcos21_state::screen_update_namcos21(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 *videoram = m_videoram;
+ UINT8 *videoram = m_videoram.get();
int pivot = 3;
int pri;
bitmap.fill(0xff, cliprect );
@@ -217,8 +211,8 @@ void namcos21_state::renderscanline_flat(const edge *e1, const edge *e2, int sy,
}
{
- UINT16 *pDest = m_mpPolyFrameBufferPens + sy*NAMCOS21_POLY_FRAME_WIDTH;
- UINT16 *pZBuf = m_mpPolyFrameBufferZ + sy*NAMCOS21_POLY_FRAME_WIDTH;
+ UINT16 *pDest = m_mpPolyFrameBufferPens.get() + sy*NAMCOS21_POLY_FRAME_WIDTH;
+ UINT16 *pZBuf = m_mpPolyFrameBufferZ.get() + sy*NAMCOS21_POLY_FRAME_WIDTH;
int x0 = (int)e1->x;
int x1 = (int)e2->x;
int w = x1-x0;
diff --git a/src/mame/video/namcos22.cpp b/src/mame/video/namcos22.cpp
index aa59865c2aa..7a56a0b98a4 100644
--- a/src/mame/video/namcos22.cpp
+++ b/src/mame/video/namcos22.cpp
@@ -93,9 +93,9 @@ void namcos22_renderer::renderscanline_uvi_full(INT32 scanline, const extent_t &
UINT32 *dest = &extra.destbase->pix32(scanline);
UINT8 *primap = &extra.primap->pix8(scanline);
UINT16 *ttmap = m_state.m_texture_tilemap;
- UINT8 *ttattr = m_state.m_texture_tileattr;
+ UINT8 *ttattr = m_state.m_texture_tileattr.get();
UINT8 *ttdata = m_state.m_texture_tiledata;
- UINT8 *tt_ayx_to_pixel = m_state.m_texture_ayx_to_pixel;
+ UINT8 *tt_ayx_to_pixel = m_state.m_texture_ayx_to_pixel.get();
if (extra.cmode & 4)
{
@@ -2361,8 +2361,8 @@ UINT32 namcos22_state::screen_update_namcos22(screen_device &screen, bitmap_rgb3
void namcos22_state::init_tables()
{
- m_dirtypal = auto_alloc_array(machine(), UINT8, 0x8000/4);
- memset(m_dirtypal, 1, 0x8000/4);
+ m_dirtypal = std::make_unique<UINT8[]>(0x8000/4);
+ memset(m_dirtypal.get(), 1, 0x8000/4);
memset(m_paletteram, 0, 0x8000);
memset(m_polygonram, 0xcc, m_polygonram.bytes());
@@ -2401,11 +2401,11 @@ void namcos22_state::init_tables()
m_texture_tilemap = (UINT16 *)memregion("textilemap")->base();
m_texture_tiledata = (UINT8 *)m_gfxdecode->gfx(1)->get_data(0);
- m_texture_tileattr = auto_alloc_array(machine(), UINT8, 0x080000*2);
+ m_texture_tileattr = std::make_unique<UINT8[]>(0x080000*2);
// unpack textures
UINT8 *packed_tileattr = 0x200000 + (UINT8 *)memregion("textilemap")->base();
- UINT8 *unpacked_tileattr = m_texture_tileattr;
+ UINT8 *unpacked_tileattr = m_texture_tileattr.get();
for (int i = 0; i < 0x80000; i++)
{
*unpacked_tileattr++ = (*packed_tileattr) >> 4;
@@ -2414,7 +2414,7 @@ void namcos22_state::init_tables()
}
// make attr/y/x lookup table
- m_texture_ayx_to_pixel = auto_alloc_array(machine(), UINT8, 16*16*16);
+ m_texture_ayx_to_pixel = std::make_unique<UINT8[]>(16*16*16);
for (int attr = 0; attr < 16; attr++)
{
for (int y = 0; y < 16; y++)
@@ -2473,7 +2473,7 @@ void namcos22_state::video_start()
m_is_ss22 = (m_iomcu == nullptr);
init_tables();
- m_mix_bitmap = auto_bitmap_ind16_alloc(machine(), 640, 480);
+ m_mix_bitmap = std::make_unique<bitmap_ind16>(640, 480);
m_bgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcos22_state::get_text_tile_info), this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
m_bgtilemap->set_transparent_pen(0xf);
diff --git a/src/mame/video/nbmj8688.cpp b/src/mame/video/nbmj8688.cpp
index 911315c907a..4a2be6cb067 100644
--- a/src/mame/video/nbmj8688.cpp
+++ b/src/mame/video/nbmj8688.cpp
@@ -550,15 +550,15 @@ void nbmj8688_state::common_video_start()
{
m_blitter_timer = timer_alloc(TIMER_BLITTER);
- m_tmpbitmap = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_tmpbitmap = std::make_unique<bitmap_ind16>(512, 256);
m_videoram = auto_alloc_array_clear(machine(), UINT16, 512 * 256);
- m_clut = auto_alloc_array(machine(), UINT8, 0x20);
+ m_clut = std::make_unique<UINT8[]>(0x20);
m_scrolly = 0; // reset because crystalg/crystal2 don't write to this register
m_screen_refresh = 1;
save_pointer(NAME(m_videoram), 512 * 256);
- save_pointer(NAME(m_clut), 0x20);
+ save_pointer(NAME(m_clut.get()), 0x20);
save_item(NAME(m_scrolly));
save_item(NAME(m_blitter_destx));
save_item(NAME(m_blitter_desty));
diff --git a/src/mame/video/nbmj8891.cpp b/src/mame/video/nbmj8891.cpp
index 56d40311475..78d92a4c3fe 100644
--- a/src/mame/video/nbmj8891.cpp
+++ b/src/mame/video/nbmj8891.cpp
@@ -275,7 +275,7 @@ void nbmj8891_state::vramflip(int vram)
if (m_flipscreen == m_flipscreen_old) return;
- vidram = vram ? m_videoram1 : m_videoram0;
+ vidram = vram ? m_videoram1.get() : m_videoram0.get();
for (y = 0; y < (height / 2); y++)
{
@@ -488,10 +488,10 @@ VIDEO_START_MEMBER(nbmj8891_state,_1layer)
m_blitter_timer = timer_alloc(TIMER_BLITTER);
m_screen->register_screen_bitmap(m_tmpbitmap0);
- m_videoram0 = auto_alloc_array(machine(), UINT8, width * height);
- m_palette_ptr = auto_alloc_array(machine(), UINT8, 0x200);
- m_clut = auto_alloc_array(machine(), UINT8, 0x800);
- memset(m_videoram0, 0xff, (width * height * sizeof(char)));
+ m_videoram0 = std::make_unique<UINT8[]>(width * height);
+ m_palette_ptr = std::make_unique<UINT8[]>(0x200);
+ m_clut = std::make_unique<UINT8[]>(0x800);
+ memset(m_videoram0.get(), 0xff, (width * height * sizeof(char)));
m_gfxdraw_mode = 0;
m_screen_refresh = 1;
@@ -513,17 +513,17 @@ void nbmj8891_state::video_start()
m_blitter_timer = timer_alloc(TIMER_BLITTER);
m_screen->register_screen_bitmap(m_tmpbitmap0);
m_screen->register_screen_bitmap(m_tmpbitmap1);
- m_videoram0 = auto_alloc_array(machine(), UINT8, width * height);
- m_videoram1 = auto_alloc_array(machine(), UINT8, width * height);
- m_palette_ptr = auto_alloc_array(machine(), UINT8, 0x200);
- m_clut = auto_alloc_array(machine(), UINT8, 0x800);
- memset(m_videoram0, 0xff, (width * height * sizeof(UINT8)));
- memset(m_videoram1, 0xff, (width * height * sizeof(UINT8)));
+ m_videoram0 = std::make_unique<UINT8[]>(width * height);
+ m_videoram1 = std::make_unique<UINT8[]>(width * height);
+ m_palette_ptr = std::make_unique<UINT8[]>(0x200);
+ m_clut = std::make_unique<UINT8[]>(0x800);
+ memset(m_videoram0.get(), 0xff, (width * height * sizeof(UINT8)));
+ memset(m_videoram1.get(), 0xff, (width * height * sizeof(UINT8)));
m_gfxdraw_mode = 1;
m_screen_refresh = 1;
common_save_state();
- save_pointer(NAME(m_videoram1), width * height);
+ save_pointer(NAME(m_videoram1.get()), width * height);
}
void nbmj8891_state::common_save_state()
@@ -542,9 +542,9 @@ void nbmj8891_state::common_save_state()
save_item(NAME(m_flipscreen));
save_item(NAME(m_clutsel));
save_item(NAME(m_gfxdraw_mode));
- save_pointer(NAME(m_videoram0), m_screen->width() * m_screen->height());
- save_pointer(NAME(m_palette_ptr), 0x200);
- save_pointer(NAME(m_clut), 0x800);
+ save_pointer(NAME(m_videoram0.get()), m_screen->width() * m_screen->height());
+ save_pointer(NAME(m_palette_ptr.get()), 0x200);
+ save_pointer(NAME(m_clut.get()), 0x800);
save_item(NAME(m_flipscreen_old));
machine().save().register_postload(save_prepost_delegate(FUNC(nbmj8891_state::postload), this));
diff --git a/src/mame/video/nbmj8900.cpp b/src/mame/video/nbmj8900.cpp
index 503b209249c..ad910679752 100644
--- a/src/mame/video/nbmj8900.cpp
+++ b/src/mame/video/nbmj8900.cpp
@@ -167,7 +167,7 @@ void nbmj8900_state::vramflip(int vram)
if (m_flipscreen == m_flipscreen_old) return;
- vidram = vram ? m_videoram1 : m_videoram0;
+ vidram = vram ? m_videoram1.get() : m_videoram0.get();
for (y = 0; y < (height / 2); y++)
{
@@ -373,12 +373,12 @@ void nbmj8900_state::video_start()
m_screen->register_screen_bitmap(m_tmpbitmap0);
m_screen->register_screen_bitmap(m_tmpbitmap1);
- m_videoram0 = auto_alloc_array(machine(), UINT8, m_screen_width * m_screen_height);
- m_videoram1 = auto_alloc_array(machine(), UINT8, m_screen_width * m_screen_height);
- m_palette_ptr = auto_alloc_array(machine(), UINT8, 0x200);
- m_clut = auto_alloc_array(machine(), UINT8, 0x800);
- memset(m_videoram0, 0xff, (m_screen_width * m_screen_height * sizeof(UINT8)));
- memset(m_videoram1, 0xff, (m_screen_width * m_screen_height * sizeof(UINT8)));
+ m_videoram0 = std::make_unique<UINT8[]>(m_screen_width * m_screen_height);
+ m_videoram1 = std::make_unique<UINT8[]>(m_screen_width * m_screen_height);
+ m_palette_ptr = std::make_unique<UINT8[]>(0x200);
+ m_clut = std::make_unique<UINT8[]>(0x800);
+ memset(m_videoram0.get(), 0xff, (m_screen_width * m_screen_height * sizeof(UINT8)));
+ memset(m_videoram1.get(), 0xff, (m_screen_width * m_screen_height * sizeof(UINT8)));
// m_palette->pen(0x07f) = 0xff; /* palette_transparent_pen */
m_gfxdraw_mode = 1;
m_screen_refresh = 1;
@@ -397,10 +397,10 @@ void nbmj8900_state::video_start()
save_item(NAME(m_flipscreen));
save_item(NAME(m_clutsel));
//save_item(NAME(m_gfxdraw_mode)); //always 1?
- save_pointer(NAME(m_videoram0), m_screen_width * m_screen_height);
- save_pointer(NAME(m_videoram1), m_screen_width * m_screen_height);
- save_pointer(NAME(m_palette_ptr), 0x200);
- save_pointer(NAME(m_clut), 0x800);
+ save_pointer(NAME(m_videoram0.get()), m_screen_width * m_screen_height);
+ save_pointer(NAME(m_videoram1.get()), m_screen_width * m_screen_height);
+ save_pointer(NAME(m_palette_ptr.get()), 0x200);
+ save_pointer(NAME(m_clut.get()), 0x800);
save_item(NAME(m_flipscreen_old));
}
diff --git a/src/mame/video/nbmj8991.cpp b/src/mame/video/nbmj8991.cpp
index cc688e9d1ab..95a449e03fa 100644
--- a/src/mame/video/nbmj8991.cpp
+++ b/src/mame/video/nbmj8991.cpp
@@ -294,9 +294,9 @@ void nbmj8991_state::video_start()
int height = m_screen->height();
m_screen->register_screen_bitmap(m_tmpbitmap);
- m_videoram = auto_alloc_array(machine(), UINT8, width * height);
- m_clut = auto_alloc_array(machine(), UINT8, 0x800);
- memset(m_videoram, 0x00, (width * height * sizeof(UINT8)));
+ m_videoram = std::make_unique<UINT8[]>(width * height);
+ m_clut = std::make_unique<UINT8[]>(0x800);
+ memset(m_videoram.get(), 0x00, (width * height * sizeof(UINT8)));
m_screen_refresh = 1;
@@ -313,8 +313,8 @@ void nbmj8991_state::video_start()
save_item(NAME(m_dispflag));
save_item(NAME(m_flipscreen));
save_item(NAME(m_clutsel));
- save_pointer(NAME(m_videoram), width * height);
- save_pointer(NAME(m_clut), 0x800);
+ save_pointer(NAME(m_videoram.get()), width * height);
+ save_pointer(NAME(m_clut.get()), 0x800);
save_item(NAME(m_flipscreen_old));
machine().save().register_postload(save_prepost_delegate(FUNC(nbmj8991_state::postload), this));
diff --git a/src/mame/video/nbmj9195.cpp b/src/mame/video/nbmj9195.cpp
index 0632e64ddd4..d22c52744c9 100644
--- a/src/mame/video/nbmj9195.cpp
+++ b/src/mame/video/nbmj9195.cpp
@@ -377,7 +377,7 @@ VIDEO_START_MEMBER(nbmj9195_state,_1layer)
m_screen->register_screen_bitmap(m_tmpbitmap[0]);
m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_clut[0] = std::make_unique<UINT8[]>(0x1000);
m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
m_nb19010_busyflag = 1;
m_gfxdraw_mode = 0;
@@ -402,7 +402,7 @@ VIDEO_START_MEMBER(nbmj9195_state,_1layer)
save_item(NAME(m_nb19010_busyctr));
save_item(NAME(m_nb19010_busyflag));
save_pointer(NAME(m_videoram[0]), width * height);
- save_pointer(NAME(m_clut[0]), 0x1000);
+ save_pointer(NAME(m_clut[0].get()), 0x1000);
save_item(NAME(m_flipscreen_old));
machine().save().register_postload(save_prepost_delegate(FUNC(nbmj9195_state::postload), this));
}
@@ -418,8 +418,8 @@ void nbmj9195_state::video_start()
m_screen->register_screen_bitmap(m_tmpbitmap[1]);
m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
m_videoram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_clut[0] = std::make_unique<UINT8[]>(0x1000);
+ m_clut[1] = std::make_unique<UINT8[]>(0x1000);
m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
m_nb19010_busyflag = 1;
m_gfxdraw_mode = 1;
@@ -446,8 +446,8 @@ void nbmj9195_state::video_start()
save_item(NAME(m_nb19010_busyflag));
save_pointer(NAME(m_videoram[0]), width * height);
save_pointer(NAME(m_videoram[1]), width * height);
- save_pointer(NAME(m_clut[0]), 0x1000);
- save_pointer(NAME(m_clut[1]), 0x1000);
+ save_pointer(NAME(m_clut[0].get()), 0x1000);
+ save_pointer(NAME(m_clut[1].get()), 0x1000);
save_item(NAME(m_flipscreen_old));
machine().save().register_postload(save_prepost_delegate(FUNC(nbmj9195_state::postload), this));
}
diff --git a/src/mame/video/niyanpai.cpp b/src/mame/video/niyanpai.cpp
index a84f1c40f80..e6cdeffe70f 100644
--- a/src/mame/video/niyanpai.cpp
+++ b/src/mame/video/niyanpai.cpp
@@ -367,10 +367,10 @@ void niyanpai_state::video_start()
m_videoworkram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
m_videoworkram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
m_videoworkram[2] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_palette_ptr = auto_alloc_array(machine(), UINT16, 0x480);
- m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_clut[2] = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_palette_ptr = std::make_unique<UINT16[]>(0x480);
+ m_clut[0] = std::make_unique<UINT8[]>(0x1000);
+ m_clut[1] = std::make_unique<UINT8[]>(0x1000);
+ m_clut[2] = std::make_unique<UINT8[]>(0x1000);
m_nb19010_busyflag = 1;
m_blitter_timer = timer_alloc(TIMER_BLITTER);
@@ -392,16 +392,16 @@ void niyanpai_state::video_start()
save_item(NAME(m_nb19010_busyctr));
save_item(NAME(m_nb19010_busyflag));
save_item(NAME(m_flipscreen_old));
- save_pointer(NAME(m_palette_ptr), 0x480);
+ save_pointer(NAME(m_palette_ptr.get()), 0x480);
save_pointer(NAME(m_videoram[0]), width * height);
save_pointer(NAME(m_videoram[1]), width * height);
save_pointer(NAME(m_videoram[2]), width * height);
save_pointer(NAME(m_videoworkram[0]), width * height);
save_pointer(NAME(m_videoworkram[1]), width * height);
save_pointer(NAME(m_videoworkram[2]), width * height);
- save_pointer(NAME(m_clut[0]), 0x1000);
- save_pointer(NAME(m_clut[1]), 0x1000);
- save_pointer(NAME(m_clut[2]), 0x1000);
+ save_pointer(NAME(m_clut[0].get()), 0x1000);
+ save_pointer(NAME(m_clut[1].get()), 0x1000);
+ save_pointer(NAME(m_clut[2].get()), 0x1000);
save_item(NAME(m_tmpbitmap[0]));
save_item(NAME(m_tmpbitmap[1]));
save_item(NAME(m_tmpbitmap[2]));
diff --git a/src/mame/video/nmk16.cpp b/src/mame/video/nmk16.cpp
index 41fd7cf1e09..8f3d65fe7a5 100644
--- a/src/mame/video/nmk16.cpp
+++ b/src/mame/video/nmk16.cpp
@@ -127,7 +127,7 @@ VIDEO_START_MEMBER(nmk16_state,bioship)
m_tx_tilemap->set_transparent_pen(15);
nmk16_video_init();
- m_background_bitmap = auto_bitmap_ind16_alloc(machine(),8192,512);
+ m_background_bitmap = std::make_unique<bitmap_ind16>(8192,512);
m_bioship_background_bank=0;
m_redraw_bitmap = 1;
diff --git a/src/mame/video/ojankohs.cpp b/src/mame/video/ojankohs.cpp
index af39290097e..f4fd3af9fe6 100644
--- a/src/mame/video/ojankohs.cpp
+++ b/src/mame/video/ojankohs.cpp
@@ -258,16 +258,16 @@ WRITE8_MEMBER(ojankohs_state::ojankoc_videoram_w)
VIDEO_START_MEMBER(ojankohs_state,ojankohs)
{
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ojankohs_state::ojankohs_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
-// m_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
-// m_colorram = auto_alloc_array(machine(), UINT8, 0x1000);
-// m_paletteram = auto_alloc_array(machine(), UINT8, 0x800);
+// m_videoram = std::make_unique<UINT8[]>(0x1000);
+// m_colorram = std::make_unique<UINT8[]>(0x1000);
+// m_paletteram = std::make_unique<UINT8[]>(0x800);
}
VIDEO_START_MEMBER(ojankohs_state,ojankoy)
{
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ojankohs_state::ojankoy_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64);
-// m_videoram = auto_alloc_array(machine(), UINT8, 0x2000);
-// m_colorram = auto_alloc_array(machine(), UINT8, 0x1000);
+// m_videoram = std::make_unique<UINT8[]>(0x2000);
+// m_colorram = std::make_unique<UINT8[]>(0x1000);
}
VIDEO_START_MEMBER(ojankohs_state,ojankoc)
diff --git a/src/mame/video/pacland.cpp b/src/mame/video/pacland.cpp
index 1dfdaa798fe..9199462f4ff 100644
--- a/src/mame/video/pacland.cpp
+++ b/src/mame/video/pacland.cpp
@@ -114,9 +114,9 @@ PALETTE_INIT_MEMBER(pacland_state, pacland)
switch_palette();
/* precalculate transparency masks for sprites */
- m_transmask[0] = auto_alloc_array(machine(), UINT32, 64);
- m_transmask[1] = auto_alloc_array(machine(), UINT32, 64);
- m_transmask[2] = auto_alloc_array(machine(), UINT32, 64);
+ m_transmask[0] = std::make_unique<UINT32[]>(64);
+ m_transmask[1] = std::make_unique<UINT32[]>(64);
+ m_transmask[2] = std::make_unique<UINT32[]>(64);
for (i = 0; i < 64; i++)
{
int palentry;
diff --git a/src/mame/video/pcw.cpp b/src/mame/video/pcw.cpp
index d24c870081e..6a700784d4e 100644
--- a/src/mame/video/pcw.cpp
+++ b/src/mame/video/pcw.cpp
@@ -25,7 +25,7 @@ void pcw_state::video_start()
{
rectangle rect(0, PCW_PRINTER_WIDTH - 1, 0, PCW_PRINTER_HEIGHT - 1);
- m_prn_output = auto_bitmap_ind16_alloc(machine(),PCW_PRINTER_WIDTH,PCW_PRINTER_HEIGHT);
+ m_prn_output = std::make_unique<bitmap_ind16>(PCW_PRINTER_WIDTH,PCW_PRINTER_HEIGHT);
m_prn_output->fill(1, rect);
}
diff --git a/src/mame/video/pecom.cpp b/src/mame/video/pecom.cpp
index 795e97f8ef4..ff55a1726ef 100644
--- a/src/mame/video/pecom.cpp
+++ b/src/mame/video/pecom.cpp
@@ -81,12 +81,12 @@ WRITE_LINE_MEMBER(pecom_state::pecom_prd_w)
VIDEO_START_MEMBER(pecom_state,pecom)
{
/* allocate memory */
- m_charram = auto_alloc_array(machine(), UINT8, PECOM_CHAR_RAM_SIZE);
+ m_charram = std::make_unique<UINT8[]>(PECOM_CHAR_RAM_SIZE);
/* register for state saving */
save_item(NAME(m_reset));
save_item(NAME(m_dma));
- save_pointer(NAME(m_charram), PECOM_CHAR_RAM_SIZE);
+ save_pointer(NAME(m_charram.get()), PECOM_CHAR_RAM_SIZE);
}
MACHINE_CONFIG_FRAGMENT( pecom_video )
diff --git a/src/mame/video/pgm.cpp b/src/mame/video/pgm.cpp
index f4d923075ae..d8d27d359e1 100644
--- a/src/mame/video/pgm.cpp
+++ b/src/mame/video/pgm.cpp
@@ -80,7 +80,7 @@ void pgm_state::draw_sprite_line( int wide, UINT16* dest, UINT8* destpri, int xz
int xoffset = 0;
int xdrawpos = 0;
- UINT8 *adata = m_sprite_a_region;
+ UINT8 *adata = m_sprite_a_region.get();
size_t adatasize = m_sprite_a_region_size - 1;
UINT16 msk;
@@ -328,7 +328,7 @@ void pgm_state::draw_sprite_line_basic( int wide, UINT16* dest, UINT8* destpri,
int xcnt,xcntdraw;
int xoffset = 0;
int xdrawpos = 0;
- UINT8 *adata = m_sprite_a_region;
+ UINT8 *adata = m_sprite_a_region.get();
size_t adatasize = m_sprite_a_region_size - 1;
UINT16 msk;
diff --git a/src/mame/video/phoenix.cpp b/src/mame/video/phoenix.cpp
index 60dfdedfab2..23a2389a9b8 100644
--- a/src/mame/video/phoenix.cpp
+++ b/src/mame/video/phoenix.cpp
@@ -168,13 +168,13 @@ TILE_GET_INFO_MEMBER(phoenix_state::get_bg_tile_info)
VIDEO_START_MEMBER(phoenix_state,phoenix)
{
- m_videoram_pg[0] = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_videoram_pg[0], 0x00, 0x1000 * sizeof(UINT8));
- m_videoram_pg[1] = auto_alloc_array(machine(), UINT8, 0x1000);
- memset(m_videoram_pg[1], 0x00, 0x1000 * sizeof(UINT8));
+ m_videoram_pg[0] = std::make_unique<UINT8[]>(0x1000);
+ memset(m_videoram_pg[0].get(), 0x00, 0x1000 * sizeof(UINT8));
+ m_videoram_pg[1] = std::make_unique<UINT8[]>(0x1000);
+ memset(m_videoram_pg[1].get(), 0x00, 0x1000 * sizeof(UINT8));
- membank("bank1")->configure_entry(0, m_videoram_pg[0]);
- membank("bank1")->configure_entry(1, m_videoram_pg[1]);
+ membank("bank1")->configure_entry(0, m_videoram_pg[0].get());
+ membank("bank1")->configure_entry(1, m_videoram_pg[1].get());
membank("bank1")->set_entry(0);
m_videoram_pg_index = 0;
@@ -191,8 +191,8 @@ VIDEO_START_MEMBER(phoenix_state,phoenix)
m_fg_tilemap->set_scrolldy(0, (VTOTAL - VBSTART));
m_bg_tilemap->set_scrolldy(0, (VTOTAL - VBSTART));
- save_pointer(NAME(m_videoram_pg[0]), 0x1000);
- save_pointer(NAME(m_videoram_pg[1]), 0x1000);
+ save_pointer(NAME(m_videoram_pg[0].get()), 0x1000);
+ save_pointer(NAME(m_videoram_pg[1].get()), 0x1000);
save_item(NAME(m_videoram_pg_index));
save_item(NAME(m_palette_bank));
save_item(NAME(m_cocktail_mode));
diff --git a/src/mame/video/pitnrun.cpp b/src/mame/video/pitnrun.cpp
index 3a0b8732c6a..d1a969f64a4 100644
--- a/src/mame/video/pitnrun.cpp
+++ b/src/mame/video/pitnrun.cpp
@@ -160,10 +160,10 @@ void pitnrun_state::video_start()
m_fg = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pitnrun_state::get_tile_info1),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
m_bg = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pitnrun_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,32*4,32 );
m_fg->set_transparent_pen(0 );
- m_tmp_bitmap[0] = auto_bitmap_ind16_alloc(machine(),128,128);
- m_tmp_bitmap[1] = auto_bitmap_ind16_alloc(machine(),128,128);
- m_tmp_bitmap[2] = auto_bitmap_ind16_alloc(machine(),128,128);
- m_tmp_bitmap[3] = auto_bitmap_ind16_alloc(machine(),128,128);
+ m_tmp_bitmap[0] = std::make_unique<bitmap_ind16>(128,128);
+ m_tmp_bitmap[1] = std::make_unique<bitmap_ind16>(128,128);
+ m_tmp_bitmap[2] = std::make_unique<bitmap_ind16>(128,128);
+ m_tmp_bitmap[3] = std::make_unique<bitmap_ind16>(128,128);
spotlights();
save_item(NAME(m_h_heed));
diff --git a/src/mame/video/poisk1.cpp b/src/mame/video/poisk1.cpp
index 99532e31fed..f8b133bf58f 100644
--- a/src/mame/video/poisk1.cpp
+++ b/src/mame/video/poisk1.cpp
@@ -111,9 +111,9 @@ WRITE8_MEMBER(p1_state::p1_ppi2_porta_w)
// DISPLAY BANK
if (BIT(data, 6) != BIT(m_video.color_select_68, 6)) {
if (BIT(data, 6))
- m_video.videoram = m_video.videoram_base + 0x4000;
+ m_video.videoram = m_video.videoram_base.get() + 0x4000;
else
- m_video.videoram = m_video.videoram_base;
+ m_video.videoram = m_video.videoram_base.get();
}
// HIRES -- XXX
if (BIT(data, 7) != BIT(m_video.color_select_68, 7)) {
@@ -290,7 +290,8 @@ void p1_state::video_start()
DBG_LOG(0,"init",("video_start()\n"));
memset(&m_video, 0, sizeof(m_video));
- m_video.videoram = m_video.videoram_base = auto_alloc_array(machine(), UINT8, 0x8000);
+ m_video.videoram_base = std::make_unique<UINT8[]>(0x8000);
+ m_video.videoram = m_video.videoram_base.get();
m_video.stride = 80;
space.install_readwrite_bank(0xb8000, 0xbffff, "bank11" );
diff --git a/src/mame/video/policetr.cpp b/src/mame/video/policetr.cpp
index ddcccad3933..c2345439837 100644
--- a/src/mame/video/policetr.cpp
+++ b/src/mame/video/policetr.cpp
@@ -33,7 +33,7 @@ void policetr_state::video_start()
m_srcbitmap_height_mask = (memregion("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
/* the destination bitmap is not directly accessible to the CPU */
- m_dstbitmap = auto_alloc_array(machine(), UINT8, DSTBITMAP_WIDTH * DSTBITMAP_HEIGHT);
+ m_dstbitmap = std::make_unique<UINT8[]>(DSTBITMAP_WIDTH * DSTBITMAP_HEIGHT);
}
diff --git a/src/mame/video/popeye.cpp b/src/mame/video/popeye.cpp
index 920a1f1b20b..d057139fbcb 100644
--- a/src/mame/video/popeye.cpp
+++ b/src/mame/video/popeye.cpp
@@ -337,8 +337,8 @@ TILE_GET_INFO_MEMBER(popeye_state::get_fg_tile_info)
void popeye_state::video_start()
{
- m_bitmapram = auto_alloc_array(machine(), UINT8, popeye_bitmapram_size);
- m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine(),1024,1024); /* actually 1024x512 but not rolling over vertically? */
+ m_bitmapram = std::make_unique<UINT8[]>(popeye_bitmapram_size);
+ m_tmpbitmap2 = std::make_unique<bitmap_ind16>(1024,1024); /* actually 1024x512 but not rolling over vertically? */
m_bitmap_type = TYPE_SKYSKIPR;
@@ -351,13 +351,13 @@ void popeye_state::video_start()
save_item(NAME(m_field));
save_item(NAME(m_lastflip));
save_item(NAME(*m_tmpbitmap2));
- save_pointer(NAME(m_bitmapram), popeye_bitmapram_size);
+ save_pointer(NAME(m_bitmapram.get()), popeye_bitmapram_size);
}
VIDEO_START_MEMBER(popeye_state,popeye)
{
- m_bitmapram = auto_alloc_array(machine(), UINT8, popeye_bitmapram_size);
- m_tmpbitmap2 = auto_bitmap_ind16_alloc(machine(),512,512);
+ m_bitmapram = std::make_unique<UINT8[]>(popeye_bitmapram_size);
+ m_tmpbitmap2 = std::make_unique<bitmap_ind16>(512,512);
m_bitmap_type = TYPE_POPEYE;
@@ -370,7 +370,7 @@ VIDEO_START_MEMBER(popeye_state,popeye)
save_item(NAME(m_field));
save_item(NAME(m_lastflip));
save_item(NAME(*m_tmpbitmap2));
- save_pointer(NAME(m_bitmapram), popeye_bitmapram_size);
+ save_pointer(NAME(m_bitmapram.get()), popeye_bitmapram_size);
}
void popeye_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp
index a0db91d6b62..4907b985f86 100644
--- a/src/mame/video/powervr2.cpp
+++ b/src/mame/video/powervr2.cpp
@@ -3625,7 +3625,7 @@ void powervr2_device::device_start()
endofrender_timer_tsp = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::endofrender_tsp),this));
endofrender_timer_video = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::endofrender_video),this));
- fake_accumulationbuffer_bitmap = auto_bitmap_rgb32_alloc(machine(),2048,2048);
+ fake_accumulationbuffer_bitmap = std::make_unique<bitmap_rgb32>(2048,2048);
softreset = 0;
param_base = 0;
diff --git a/src/mame/video/powervr2.h b/src/mame/video/powervr2.h
index 8983f88336f..3dfae1f90c7 100644
--- a/src/mame/video/powervr2.h
+++ b/src/mame/video/powervr2.h
@@ -55,7 +55,7 @@ public:
// the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer
// our implementation is not currently tile based, and thus the accumulation buffer is screen sized
- bitmap_rgb32 *fake_accumulationbuffer_bitmap;
+ std::unique_ptr<bitmap_rgb32> fake_accumulationbuffer_bitmap;
struct texinfo {
UINT32 address, vqbase;
diff --git a/src/mame/video/ppu2c0x.cpp b/src/mame/video/ppu2c0x.cpp
index d6511dbb245..5e140d7558f 100644
--- a/src/mame/video/ppu2c0x.cpp
+++ b/src/mame/video/ppu2c0x.cpp
@@ -222,7 +222,7 @@ void ppu2c0x_device::device_start()
m_nmi_timer->adjust(attotime::never);
/* allocate a screen bitmap, videomem and spriteram, a dirtychar array and the monochromatic colortable */
- m_bitmap = auto_bitmap_ind16_alloc(machine(), VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT);
+ m_bitmap = std::make_unique<bitmap_ind16>(VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT);
m_spriteram = auto_alloc_array_clear(machine(), UINT8, SPRITERAM_SIZE);
m_colortable = auto_alloc_array(machine(), pen_t, ARRAY_LENGTH(default_colortable));
m_colortable_mono = auto_alloc_array(machine(), pen_t, ARRAY_LENGTH(default_colortable_mono));
diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h
index ad9daadebf7..ec91bd4166b 100644
--- a/src/mame/video/ppu2c0x.h
+++ b/src/mame/video/ppu2c0x.h
@@ -188,7 +188,7 @@ public:
required_device<cpu_device> m_cpu;
- bitmap_ind16 *m_bitmap; /* target bitmap */
+ std::unique_ptr<bitmap_ind16> m_bitmap; /* target bitmap */
UINT8 *m_spriteram; /* sprite ram */
pen_t *m_colortable; /* color table modified at run time */
pen_t *m_colortable_mono; /* monochromatic color table modified at run time */
diff --git a/src/mame/video/psikyo.cpp b/src/mame/video/psikyo.cpp
index bbbfef1faa1..766d5c279f5 100644
--- a/src/mame/video/psikyo.cpp
+++ b/src/mame/video/psikyo.cpp
@@ -168,8 +168,8 @@ VIDEO_START_MEMBER(psikyo_state,psikyo)
m_tilemap_1_size2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x80, 0x20);
m_tilemap_1_size3 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psikyo_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x100, 0x10);
- m_spritebuf1 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
- m_spritebuf2 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
+ m_spritebuf1 = std::make_unique<UINT32[]>(0x2000 / 4);
+ m_spritebuf2 = std::make_unique<UINT32[]>(0x2000 / 4);
m_tilemap_0_size0->set_scroll_rows(0x80 * 16); // line scrolling
m_tilemap_0_size0->set_scroll_cols(1);
@@ -195,8 +195,8 @@ VIDEO_START_MEMBER(psikyo_state,psikyo)
m_tilemap_1_size3->set_scroll_rows(0x10 * 16); // line scrolling
m_tilemap_1_size3->set_scroll_cols(1);
- save_pointer(NAME(m_spritebuf1), 0x2000 / 4);
- save_pointer(NAME(m_spritebuf2), 0x2000 / 4);
+ save_pointer(NAME(m_spritebuf1.get()), 0x2000 / 4);
+ save_pointer(NAME(m_spritebuf2.get()), 0x2000 / 4);
}
VIDEO_START_MEMBER(psikyo_state,sngkace)
@@ -258,7 +258,7 @@ void psikyo_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, co
/* tile layers 0 & 1 have priorities 1 & 2 */
static const int pri[] = { 0, 0xfc, 0xff, 0xff };
int offs;
- UINT16 *spritelist = (UINT16 *)(m_spritebuf2 + 0x1800 / 4);
+ UINT16 *spritelist = (UINT16 *)(m_spritebuf2.get() + 0x1800 / 4);
UINT8 *TILES = memregion("spritelut")->base(); // Sprites LUT
int TILES_LEN = memregion("spritelut")->bytes();
@@ -375,7 +375,7 @@ void psikyo_state::draw_sprites_bootleg( screen_device &screen, bitmap_ind16 &bi
/* tile layers 0 & 1 have priorities 1 & 2 */
static const int pri[] = { 0, 0xfc, 0xff, 0xff };
int offs;
- UINT16 *spritelist = (UINT16 *)(m_spritebuf2 + 0x1800 / 4);
+ UINT16 *spritelist = (UINT16 *)(m_spritebuf2.get()+ 0x1800 / 4);
UINT8 *TILES = memregion("spritelut")->base(); // Sprites LUT
int TILES_LEN = memregion("spritelut")->bytes();
@@ -850,7 +850,7 @@ void psikyo_state::screen_eof_psikyo(screen_device &screen, bool state)
// rising edge
if (state)
{
- memcpy(m_spritebuf2, m_spritebuf1, 0x2000);
- memcpy(m_spritebuf1, m_spriteram, 0x2000);
+ memcpy(m_spritebuf2.get(), m_spritebuf1.get(), 0x2000);
+ memcpy(m_spritebuf1.get(), m_spriteram, 0x2000);
}
}
diff --git a/src/mame/video/psikyosh.cpp b/src/mame/video/psikyosh.cpp
index 24b51d9e375..2c40e75aa44 100644
--- a/src/mame/video/psikyosh.cpp
+++ b/src/mame/video/psikyosh.cpp
@@ -1093,7 +1093,7 @@ void psikyosh_state::video_start()
m_screen->register_screen_bitmap(m_z_bitmap); /* z-buffer */
m_zoom_bitmap.allocate(16*16, 16*16); /* temp buffer for assembling sprites */
m_bg_bitmap.allocate(32*16, 32*16); /* temp buffer for assembling tilemaps */
- m_bg_zoom = auto_alloc_array(machine(), UINT16, 256);
+ m_bg_zoom = std::make_unique<UINT16[]>(256);
m_gfxdecode->gfx(1)->set_granularity(16); /* 256 colour sprites with palette selectable on 16 colour boundaries */
@@ -1117,7 +1117,7 @@ void psikyosh_state::video_start()
save_item(NAME(m_z_bitmap));
save_item(NAME(m_zoom_bitmap));
save_item(NAME(m_bg_bitmap));
- save_pointer(NAME(m_bg_zoom), 256);
+ save_pointer(NAME(m_bg_zoom.get()), 256);
}
diff --git a/src/mame/video/quasar.cpp b/src/mame/video/quasar.cpp
index cc89578a4b3..75bdd0f0593 100644
--- a/src/mame/video/quasar.cpp
+++ b/src/mame/video/quasar.cpp
@@ -91,14 +91,14 @@ PALETTE_INIT_MEMBER(quasar_state,quasar)
VIDEO_START_MEMBER(quasar_state,quasar)
{
- m_effectram = auto_alloc_array(machine(), UINT8, 0x400);
+ m_effectram = std::make_unique<UINT8[]>(0x400);
/* create helper bitmap */
m_screen->register_screen_bitmap(m_collision_background);
/* register save */
save_item(NAME(m_collision_background));
- save_pointer(NAME(m_effectram), 0x400);
+ save_pointer(NAME(m_effectram.get()), 0x400);
}
UINT32 quasar_state::screen_update_quasar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/quizdna.cpp b/src/mame/video/quizdna.cpp
index 0a9378abc32..1c39b6b0156 100644
--- a/src/mame/video/quizdna.cpp
+++ b/src/mame/video/quizdna.cpp
@@ -53,16 +53,16 @@ void quizdna_state::video_start()
m_bg_xscroll[0] = 0;
m_bg_xscroll[1] = 0;
- m_bg_ram = auto_alloc_array(machine(), UINT8, 0x2000);
- m_fg_ram = auto_alloc_array(machine(), UINT8, 0x1000);
+ m_bg_ram = std::make_unique<UINT8[]>(0x2000);
+ m_fg_ram = std::make_unique<UINT8[]>(0x1000);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(quizdna_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32 );
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(quizdna_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,16,8,32,32 );
m_fg_tilemap->set_transparent_pen(0 );
- save_pointer(NAME(m_bg_ram), 0x2000);
- save_pointer(NAME(m_fg_ram), 0x1000);
+ save_pointer(NAME(m_bg_ram.get()), 0x2000);
+ save_pointer(NAME(m_fg_ram.get()), 0x1000);
save_item(NAME(m_bg_xscroll));
save_item(NAME(m_flipscreen));
save_item(NAME(m_video_enable));
diff --git a/src/mame/video/realbrk.cpp b/src/mame/video/realbrk.cpp
index c6326d68daa..c84ec9b5365 100644
--- a/src/mame/video/realbrk.cpp
+++ b/src/mame/video/realbrk.cpp
@@ -154,8 +154,8 @@ void realbrk_state::video_start()
m_tilemap_1->set_transparent_pen(0);
m_tilemap_2->set_transparent_pen(0);
- m_tmpbitmap0 = auto_bitmap_ind16_alloc(machine(),32,32);
- m_tmpbitmap1 = auto_bitmap_ind16_alloc(machine(),32,32);
+ m_tmpbitmap0 = std::make_unique<bitmap_ind16>(32,32);
+ m_tmpbitmap1 = std::make_unique<bitmap_ind16>(32,32);
save_item(NAME(m_disable_video));
}
diff --git a/src/mame/video/redalert.cpp b/src/mame/video/redalert.cpp
index 288e92198bd..f1a4d14d6f8 100644
--- a/src/mame/video/redalert.cpp
+++ b/src/mame/video/redalert.cpp
@@ -164,9 +164,9 @@ void redalert_state::get_panther_pens(pen_t *pens)
VIDEO_START_MEMBER(redalert_state,redalert)
{
- m_bitmap_colorram = auto_alloc_array(machine(), UINT8, 0x0400);
+ m_bitmap_colorram = std::make_unique<UINT8[]>(0x0400);
- save_pointer(NAME(m_bitmap_colorram), 0x0400);
+ save_pointer(NAME(m_bitmap_colorram.get()), 0x0400);
m_control_xor = 0x00;
}
diff --git a/src/mame/video/rltennis.cpp b/src/mame/video/rltennis.cpp
index 0600a31899f..1388940d24e 100644
--- a/src/mame/video/rltennis.cpp
+++ b/src/mame/video/rltennis.cpp
@@ -222,10 +222,10 @@ WRITE16_MEMBER(rltennis_state::blitter_w)
void rltennis_state::video_start()
{
- m_tmp_bitmap[BITMAP_BG] = auto_bitmap_ind16_alloc(machine(), 512, 256);
- m_tmp_bitmap[BITMAP_FG_1] = auto_bitmap_ind16_alloc(machine(), 512, 256);
- m_tmp_bitmap[BITMAP_FG_2] = auto_bitmap_ind16_alloc(machine(), 512, 256);
- m_tmp_bitmap[BITMAP_FG_DISPLAY] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_tmp_bitmap[BITMAP_BG] = std::make_unique<bitmap_ind16>(512, 256);
+ m_tmp_bitmap[BITMAP_FG_1] = std::make_unique<bitmap_ind16>(512, 256);
+ m_tmp_bitmap[BITMAP_FG_2] = std::make_unique<bitmap_ind16>(512, 256);
+ m_tmp_bitmap[BITMAP_FG_DISPLAY] = std::make_unique<bitmap_ind16>(512, 256);
save_item(NAME(m_blitter));
}
diff --git a/src/mame/video/rungun.cpp b/src/mame/video/rungun.cpp
index c3a8869fa09..e2e9b78fe2e 100644
--- a/src/mame/video/rungun.cpp
+++ b/src/mame/video/rungun.cpp
@@ -19,7 +19,7 @@
TILE_GET_INFO_MEMBER(rungun_state::ttl_get_tile_info)
{
UINT32 base_addr = (FPTR)tilemap.user_data();
- UINT8 *lvram = (UINT8 *)m_ttl_vram + base_addr;
+ UINT8 *lvram = (UINT8 *)m_ttl_vram.get() + base_addr;
int attr, code;
attr = (lvram[BYTE_XOR_LE(tile_index<<2)] & 0xf0) >> 4;
@@ -84,8 +84,8 @@ void rungun_state::video_start()
int gfx_index;
- m_ttl_vram = auto_alloc_array(machine(), UINT16, 0x1000*2);
- m_psac2_vram = auto_alloc_array(machine(), UINT16, 0x80000*2);
+ m_ttl_vram = std::make_unique<UINT16[]>(0x1000*2);
+ m_psac2_vram = std::make_unique<UINT16[]>(0x80000*2);
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
diff --git a/src/mame/video/sega16sp.cpp b/src/mame/video/sega16sp.cpp
index cb92a10a212..4b7e19a1c81 100644
--- a/src/mame/video/sega16sp.cpp
+++ b/src/mame/video/sega16sp.cpp
@@ -1281,7 +1281,7 @@ void sega_yboard_sprite_device::draw(bitmap_ind16 &bitmap, const rectangle &clip
set_origin(m_xoffs, m_yoffs);
// clear out any scanlines we might be using
- const UINT16 *rotatebase = m_segaic16_rotate[0].buffer ? m_segaic16_rotate[0].buffer : m_segaic16_rotate[0].rotateram;
+ const UINT16 *rotatebase = m_segaic16_rotate[0].buffer ? m_segaic16_rotate[0].buffer.get() : m_segaic16_rotate[0].rotateram;
rotatebase -= yorigin();
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
if (!(rotatebase[y & ~1] & 0xc000))
diff --git a/src/mame/video/segaic16.cpp b/src/mame/video/segaic16.cpp
index f76ec9bebfc..b551707645e 100644
--- a/src/mame/video/segaic16.cpp
+++ b/src/mame/video/segaic16.cpp
@@ -1359,10 +1359,10 @@ void segaic16_video_device::rotate_init(int which, int type, int colorbase)
}
/* allocate a buffer for swapping */
- info->buffer = auto_alloc_array(machine(), UINT16, info->ramsize/2);
+ info->buffer = std::make_unique<UINT16[]>(info->ramsize/2);
save_item(NAME(info->colorbase), which);
- save_pointer(NAME((UINT8 *) info->buffer), info->ramsize, which);
+ save_pointer(NAME((UINT8 *) info->buffer.get()), info->ramsize, which);
}
@@ -1443,7 +1443,7 @@ READ16_MEMBER( segaic16_video_device::rotate_control_r )
if (info->buffer)
{
UINT32 *src = (UINT32 *)info->rotateram;
- UINT32 *dst = (UINT32 *)info->buffer;
+ UINT32 *dst = (UINT32 *)info->buffer.get();
int i;
/* swap the halves of the rotation RAM */
diff --git a/src/mame/video/segaic16.h b/src/mame/video/segaic16.h
index 4564f547d43..ff0c4f754e1 100644
--- a/src/mame/video/segaic16.h
+++ b/src/mame/video/segaic16.h
@@ -81,7 +81,7 @@ struct rotate_info
UINT16 colorbase; /* base color index */
INT32 ramsize; /* size of rotate RAM */
UINT16 * rotateram; /* pointer to rotateram pointer */
- UINT16 * buffer; /* buffered data */
+ std::unique_ptr<UINT16[]> buffer; /* buffered data */
};
diff --git a/src/mame/video/segaic16_road.cpp b/src/mame/video/segaic16_road.cpp
index 85bce272f65..699370ac0c6 100644
--- a/src/mame/video/segaic16_road.cpp
+++ b/src/mame/video/segaic16_road.cpp
@@ -80,13 +80,13 @@ void segaic16_road_device::segaic16_road_hangon_decode(running_machine &machine,
int len = memregion("^gfx3")->bytes();
/* allocate memory for the unpacked road data */
- info->gfx = auto_alloc_array(machine, UINT8, 256 * 512);
+ info->gfx = std::make_unique<UINT8[]>(256 * 512);
/* loop over rows */
for (y = 0; y < 256; y++)
{
const UINT8 *src = gfx + ((y & 0xff) * 0x40) % len;
- UINT8 *dst = info->gfx + y * 512;
+ UINT8 *dst = info->gfx.get() + y * 512;
/* loop over columns */
for (x = 0; x < 512; x++)
@@ -120,7 +120,7 @@ static void segaic16_road_hangon_draw(struct road_info *info, bitmap_ind16 &bitm
continue;
/* compute the offset of the road graphics for this line */
- src = info->gfx + (0x000 + (control & 0xff)) * 512;
+ src = info->gfx.get() + (0x000 + (control & 0xff)) * 512;
/* initialize the 4-bit counter at 9M, which counts bits within each road byte */
ctr9m = hpos & 7;
@@ -341,13 +341,13 @@ void segaic16_road_device::segaic16_road_outrun_decode(running_machine &machine,
int len = memregion("^gfx3")->bytes();
/* allocate memory for the unpacked road data */
- info->gfx = auto_alloc_array(machine, UINT8, (256 * 2 + 1) * 512);
+ info->gfx = std::make_unique<UINT8[]>((256 * 2 + 1) * 512);
/* loop over rows */
for (y = 0; y < 256 * 2; y++)
{
const UINT8 *src = gfx + ((y & 0xff) * 0x40 + (y >> 8) * 0x8000) % len;
- UINT8 *dst = info->gfx + y * 512;
+ UINT8 *dst = info->gfx.get() + y * 512;
/* loop over columns */
for (x = 0; x < 512; x++)
@@ -361,13 +361,13 @@ void segaic16_road_device::segaic16_road_outrun_decode(running_machine &machine,
}
/* set up a dummy road in the last entry */
- memset(info->gfx + 256 * 2 * 512, 3, 512);
+ memset(info->gfx.get() + 256 * 2 * 512, 3, 512);
}
static void segaic16_road_outrun_draw(struct road_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
{
- UINT16 *roadram = info->buffer;
+ UINT16 *roadram = info->buffer.get();
int x, y;
/* loop over scanlines */
@@ -442,12 +442,12 @@ static void segaic16_road_outrun_draw(struct road_info *info, bitmap_ind16 &bitm
continue;
/* get road 0 data */
- src0 = (data0 & 0x800) ? info->gfx + 256 * 2 * 512 : (info->gfx + (0x000 + ((data0 >> 1) & 0xff)) * 512);
+ src0 = (data0 & 0x800) ? info->gfx.get() + 256 * 2 * 512 : (info->gfx.get() + (0x000 + ((data0 >> 1) & 0xff)) * 512);
hpos0 = (roadram[0x200 + ((info->control & 4) ? y : (data0 & 0x1ff))]) & 0xfff;
color0 = roadram[0x600 + ((info->control & 4) ? y : (data0 & 0x1ff))];
/* get road 1 data */
- src1 = (data1 & 0x800) ? info->gfx + 256 * 2 * 512 : (info->gfx + (0x100 + ((data1 >> 1) & 0xff)) * 512);
+ src1 = (data1 & 0x800) ? info->gfx.get() + 256 * 2 * 512 : (info->gfx.get() + (0x100 + ((data1 >> 1) & 0xff)) * 512);
hpos1 = (roadram[0x400 + ((info->control & 4) ? (0x100 + y) : (data1 & 0x1ff))]) & 0xfff;
color1 = roadram[0x600 + ((info->control & 4) ? (0x100 + y) : (data1 & 0x1ff))];
@@ -573,7 +573,7 @@ void segaic16_road_device::segaic16_road_init(running_machine &machine, int whic
case SEGAIC16_ROAD_OUTRUN:
case SEGAIC16_ROAD_XBOARD:
- info->buffer = auto_alloc_array(machine, UINT16, 0x1000/2);
+ info->buffer = std::make_unique<UINT16[]>(0x1000/2);
info->draw = segaic16_road_outrun_draw;
segaic16_road_outrun_decode(machine, info);
break;
@@ -612,7 +612,7 @@ READ16_MEMBER( segaic16_road_device::segaic16_road_control_0_r )
if (info->buffer)
{
UINT32 *src = (UINT32 *)info->roadram;
- UINT32 *dst = (UINT32 *)info->buffer;
+ UINT32 *dst = (UINT32 *)info->buffer.get();
int i;
/* swap the halves of the road RAM */
diff --git a/src/mame/video/segaic16_road.h b/src/mame/video/segaic16_road.h
index a124c210928..c37bb5ef279 100644
--- a/src/mame/video/segaic16_road.h
+++ b/src/mame/video/segaic16_road.h
@@ -32,8 +32,8 @@ struct road_info
INT32 xoffs; /* X scroll offset */
void (*draw)(struct road_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority);
UINT16 * roadram; /* pointer to roadram pointer */
- UINT16 * buffer; /* buffered roadram pointer */
- UINT8 * gfx; /* expanded road graphics */
+ std::unique_ptr<UINT16[]> buffer; /* buffered roadram pointer */
+ std::unique_ptr<UINT8[]> gfx; /* expanded road graphics */
};
diff --git a/src/mame/video/segaic24.cpp b/src/mame/video/segaic24.cpp
index 27be4638793..56687869f44 100644
--- a/src/mame/video/segaic24.cpp
+++ b/src/mame/video/segaic24.cpp
@@ -104,8 +104,8 @@ void segas24_tile::device_start()
break;
assert(char_gfx_index != MAX_GFX_ELEMENTS);
- char_ram = auto_alloc_array(machine(), UINT16, 0x80000/2);
- tile_ram = auto_alloc_array(machine(), UINT16, 0x10000/2);
+ char_ram = std::make_unique<UINT16[]>(0x80000/2);
+ tile_ram = std::make_unique<UINT16[]>(0x10000/2);
tile_layer[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
tile_layer[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
@@ -117,13 +117,13 @@ void segas24_tile::device_start()
tile_layer[2]->set_transparent_pen(0);
tile_layer[3]->set_transparent_pen(0);
- memset(char_ram, 0, 0x80000);
- memset(tile_ram, 0, 0x10000);
+ memset(char_ram.get(), 0, 0x80000);
+ memset(tile_ram.get(), 0, 0x10000);
- m_gfxdecode->set_gfx(char_gfx_index, global_alloc(gfx_element(m_palette, char_layout, (UINT8 *)char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries() / 16, 0)));
+ m_gfxdecode->set_gfx(char_gfx_index, global_alloc(gfx_element(m_palette, char_layout, (UINT8 *)char_ram.get(), NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries() / 16, 0)));
- save_pointer(NAME(tile_ram), 0x10000/2);
- save_pointer(NAME(char_ram), 0x80000/2);
+ save_pointer(NAME(tile_ram.get()), 0x10000/2);
+ save_pointer(NAME(char_ram.get()), 0x80000/2);
}
void segas24_tile::draw_rect(screen_device &screen, bitmap_ind16 &bm, bitmap_ind8 &tm, bitmap_ind16 &dm, const UINT16 *mask,
@@ -378,7 +378,7 @@ void segas24_tile::draw_common(screen_device &screen, _BitmapClass &bitmap, cons
UINT16 hscr = tile_ram[0x5000+(layer >> 1)];
UINT16 vscr = tile_ram[0x5004+(layer >> 1)];
UINT16 ctrl = tile_ram[0x5004+((layer >> 1) & 2)];
- UINT16 *mask = tile_ram + (layer & 4 ? 0x6800 : 0x6000);
+ UINT16 *mask = tile_ram.get() + (layer & 4 ? 0x6800 : 0x6000);
UINT16 tpri = layer & 1;
lpri = 1 << lpri;
@@ -397,7 +397,7 @@ void segas24_tile::draw_common(screen_device &screen, _BitmapClass &bitmap, cons
tile_layer[layer|1]->set_scrolly(0, vscr & 0x1ff);
if(hscr & 0x8000) {
- UINT16 *hscrtb = tile_ram + 0x4000 + 0x200*layer;
+ UINT16 *hscrtb = tile_ram.get() + 0x4000 + 0x200*layer;
switch((ctrl & 0x6000) >> 13) {
case 1: {
@@ -500,7 +500,7 @@ void segas24_tile::draw_common(screen_device &screen, _BitmapClass &bitmap, cons
if(hscr & 0x8000) {
int y;
- UINT16 *hscrtb = tile_ram + 0x4000 + 0x200*layer;
+ UINT16 *hscrtb = tile_ram.get() + 0x4000 + 0x200*layer;
vscr &= 0x1ff;
for(y=0; y<384; y++) {
@@ -566,7 +566,7 @@ READ16_MEMBER(segas24_tile::char_r)
WRITE16_MEMBER(segas24_tile::tile_w)
{
- COMBINE_DATA(tile_ram + offset);
+ COMBINE_DATA(tile_ram.get() + offset);
if(offset < 0x4000)
tile_layer[offset >> 12]->mark_tile_dirty(offset & 0xfff);
}
@@ -574,7 +574,7 @@ WRITE16_MEMBER(segas24_tile::tile_w)
WRITE16_MEMBER(segas24_tile::char_w)
{
UINT16 old = char_ram[offset];
- COMBINE_DATA(char_ram + offset);
+ COMBINE_DATA(char_ram.get() + offset);
if(old != char_ram[offset])
m_gfxdecode->gfx(char_gfx_index)->mark_dirty(offset / 16);
}
@@ -609,9 +609,9 @@ segas24_sprite::segas24_sprite(const machine_config &mconfig, const char *tag, d
void segas24_sprite::device_start()
{
- sprite_ram = auto_alloc_array(machine(), UINT16, 0x40000/2);
+ sprite_ram = std::make_unique<UINT16[]>(0x40000/2);
- save_pointer(NAME(sprite_ram), 0x40000/2);
+ save_pointer(NAME(sprite_ram.get()), 0x40000/2);
}
/* System24 sprites
@@ -655,7 +655,7 @@ void segas24_sprite::draw(bitmap_ind16 &bitmap, const rectangle &cliprect, bitma
UINT16 *source;
UINT16 type;
- source = sprite_ram + (curspr << 3);
+ source = sprite_ram.get() + (curspr << 3);
if(curspr == 0 && source[0] == 0)
break;
@@ -838,7 +838,7 @@ void segas24_sprite::draw(bitmap_ind16 &bitmap, const rectangle &cliprect, bitma
WRITE16_MEMBER(segas24_sprite::write)
{
- COMBINE_DATA(sprite_ram + offset);
+ COMBINE_DATA(sprite_ram.get() + offset);
}
READ16_MEMBER(segas24_sprite::read)
diff --git a/src/mame/video/segaic24.h b/src/mame/video/segaic24.h
index b311ec55506..51165e32ac1 100644
--- a/src/mame/video/segaic24.h
+++ b/src/mame/video/segaic24.h
@@ -58,7 +58,8 @@ private:
SYS24_TILES = 0x4000
};
- UINT16 *char_ram, *tile_ram;
+ std::unique_ptr<UINT16[]> char_ram;
+ std::unique_ptr<UINT16[]> tile_ram;
int char_gfx_index;
tilemap_t *tile_layer[4];
UINT16 tile_mask;
@@ -98,7 +99,7 @@ protected:
virtual void device_start() override;
private:
- UINT16 *sprite_ram;
+ std::unique_ptr<UINT16[]> sprite_ram;
};
diff --git a/src/mame/video/segas32.cpp b/src/mame/video/segas32.cpp
index ed05f3df3c6..b899b8ee3ee 100644
--- a/src/mame/video/segas32.cpp
+++ b/src/mame/video/segas32.cpp
@@ -219,7 +219,7 @@ void segas32_state::common_start(int multi32)
m_is_multi32 = multi32;
/* allocate a copy of spriteram in 32-bit format */
- m_spriteram_32bit = auto_alloc_array(machine(), UINT32, 0x20000/4);
+ m_spriteram_32bit = std::make_unique<UINT32[]>(0x20000/4);
/* allocate the tilemap cache */
m_cache_head = nullptr;
@@ -239,15 +239,15 @@ void segas32_state::common_start(int multi32)
/* allocate the bitmaps (a few extra for multi32) */
for (tmap = 0; tmap < 9 + 2 * multi32; tmap++)
{
- m_layer_data[tmap].bitmap = auto_bitmap_ind16_alloc(machine(), 416, 224);
+ m_layer_data[tmap].bitmap = auto_alloc(machine(), bitmap_ind16(416, 224));
m_layer_data[tmap].transparent = auto_alloc_array_clear(machine(), UINT8, 256);
}
/* allocate pre-rendered solid lines of 0's and ffff's */
- m_solid_0000 = auto_alloc_array(machine(), UINT16, 512);
- memset(m_solid_0000, 0x00, sizeof(m_solid_0000[0]) * 512);
- m_solid_ffff = auto_alloc_array(machine(), UINT16, 512);
- memset(m_solid_ffff, 0xff, sizeof(m_solid_ffff[0]) * 512);
+ m_solid_0000 = std::make_unique<UINT16[]>(512);
+ memset(m_solid_0000.get(), 0x00, sizeof(m_solid_0000[0]) * 512);
+ m_solid_ffff = std::make_unique<UINT16[]>(512);
+ memset(m_solid_ffff.get(), 0xff, sizeof(m_solid_ffff[0]) * 512);
memset(m_system32_videoram, 0x00, 0x20000);
@@ -1703,7 +1703,7 @@ int segas32_state::draw_one_sprite(UINT16 *data, int xoffs, int yoffs, const rec
/* clamp to within the memory region size */
if (fromram)
{
- spritedata = m_spriteram_32bit;
+ spritedata = m_spriteram_32bit.get();
addrmask = (0x20000 / 4) - 1;
}
else
@@ -1974,7 +1974,7 @@ inline UINT16 segas32_state::compute_sprite_blend(UINT8 encoding)
inline UINT16 *segas32_state::get_layer_scanline(int layer, int scanline)
{
if (m_layer_data[layer].transparent[scanline])
- return (layer == MIXER_LAYER_SPRITES) ? m_solid_ffff : m_solid_0000;
+ return (layer == MIXER_LAYER_SPRITES) ? m_solid_ffff.get() : m_solid_0000.get();
return &m_layer_data[layer].bitmap->pix16(scanline);
}
diff --git a/src/mame/video/seta2.cpp b/src/mame/video/seta2.cpp
index d67bb9c12fe..ab279aa5958 100644
--- a/src/mame/video/seta2.cpp
+++ b/src/mame/video/seta2.cpp
@@ -218,7 +218,7 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
// Sprites list
// When debugging, use m_spriteram here, and run mame -update_in_pause
- UINT16 *buffered_spriteram16 = m_buffered_spriteram;
+ UINT16 *buffered_spriteram16 = m_buffered_spriteram.get();
UINT16 *s1 = buffered_spriteram16 + 0x3000/2;
UINT16 *end = &buffered_spriteram16[m_spriteram.bytes()/2];
@@ -450,7 +450,7 @@ void seta2_state::video_start()
m_gfxdecode->gfx(4)->set_granularity(16);
m_gfxdecode->gfx(5)->set_granularity(16);
- m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
+ m_buffered_spriteram = std::make_unique<UINT16[]>(m_spriteram.bytes()/2);
m_xoffset = 0;
m_yoffset = 0;
@@ -487,6 +487,6 @@ void seta2_state::screen_eof(screen_device &screen, bool state)
if (state)
{
// Buffer sprites by 1 frame
- memcpy(m_buffered_spriteram, m_spriteram, m_spriteram.bytes());
+ memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
}
}
diff --git a/src/mame/video/shadfrce.cpp b/src/mame/video/shadfrce.cpp
index 8b68a623b61..e2359506202 100644
--- a/src/mame/video/shadfrce.cpp
+++ b/src/mame/video/shadfrce.cpp
@@ -68,7 +68,7 @@ void shadfrce_state::video_start()
m_bg1tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shadfrce_state::get_bg1tile_info),this),TILEMAP_SCAN_ROWS, 16, 16,32,32);
- m_spvideoram_old = auto_alloc_array(machine(), UINT16, m_spvideoram.bytes()/2);
+ m_spvideoram_old = std::make_unique<UINT16[]>(m_spvideoram.bytes()/2);
save_item(NAME(m_video_enable));
save_item(NAME(m_irqs_enable));
@@ -118,7 +118,7 @@ void shadfrce_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c
*/
gfx_element *gfx = m_gfxdecode->gfx(1);
- UINT16 *finish = m_spvideoram_old;
+ UINT16 *finish = m_spvideoram_old.get();
UINT16 *source = finish + 0x2000/2 - 8;
int hcount;
while( source>=finish )
@@ -173,6 +173,6 @@ void shadfrce_state::screen_eof(screen_device &screen, bool state)
if (state)
{
/* looks like sprites are *two* frames ahead */
- memcpy(m_spvideoram_old, m_spvideoram, m_spvideoram.bytes());
+ memcpy(m_spvideoram_old.get(), m_spvideoram, m_spvideoram.bytes());
}
}
diff --git a/src/mame/video/slapshot.cpp b/src/mame/video/slapshot.cpp
index f470e3d606b..f6c0220986c 100644
--- a/src/mame/video/slapshot.cpp
+++ b/src/mame/video/slapshot.cpp
@@ -7,8 +7,8 @@
void slapshot_state::video_start()
{
- m_spriteram_delayed = auto_alloc_array(machine(), UINT16, m_spriteram.bytes() / 2);
- m_spriteram_buffered = auto_alloc_array(machine(), UINT16, m_spriteram.bytes() / 2);
+ m_spriteram_delayed = std::make_unique<UINT16[]>(m_spriteram.bytes() / 2);
+ m_spriteram_buffered = std::make_unique<UINT16[]>(m_spriteram.bytes() / 2);
m_spritelist = auto_alloc_array(machine(), struct slapshot_tempsprite, 0x400);
m_sprites_disabled = 1;
@@ -20,8 +20,8 @@ void slapshot_state::video_start()
save_item(NAME(m_sprites_master_scrolly));
save_item(NAME(m_sprites_flipscreen));
save_item(NAME(m_prepare_sprites));
- save_pointer(NAME(m_spriteram_delayed), m_spriteram.bytes() / 2);
- save_pointer(NAME(m_spriteram_buffered), m_spriteram.bytes() / 2);
+ save_pointer(NAME(m_spriteram_delayed.get()), m_spriteram.bytes() / 2);
+ save_pointer(NAME(m_spriteram_buffered.get()), m_spriteram.bytes() / 2);
}
/************************************************************
@@ -374,7 +374,7 @@ void slapshot_state::taito_handle_sprite_buffering( )
{
if (m_prepare_sprites) /* no buffering */
{
- memcpy(m_spriteram_buffered, m_spriteram, m_spriteram.bytes());
+ memcpy(m_spriteram_buffered.get(), m_spriteram, m_spriteram.bytes());
m_prepare_sprites = 0;
}
}
diff --git a/src/mame/video/spacefb.cpp b/src/mame/video/spacefb.cpp
index 154ba917172..bd777efb31d 100644
--- a/src/mame/video/spacefb.cpp
+++ b/src/mame/video/spacefb.cpp
@@ -84,14 +84,14 @@ void spacefb_state::video_start()
width = m_screen->width();
height = m_screen->height();
- m_object_present_map = auto_alloc_array(machine(), UINT8, width * height);
+ m_object_present_map = std::make_unique<UINT8[]>(width * height);
/* this start value positions the stars to match the flyer screen shot,
but most likely, the actual star position is random as the hardware
uses whatever value is on the shift register on power-up */
m_star_shift_reg = 0x18f89;
- save_pointer(NAME(m_object_present_map), width * height);
+ save_pointer(NAME(m_object_present_map.get()), width * height);
save_item(NAME(m_port_0));
save_item(NAME(m_port_2));
save_item(NAME(m_star_shift_reg));
@@ -373,7 +373,7 @@ void spacefb_state::draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect
get_sprite_pens(sprite_pens);
- memset(m_object_present_map, 0, bitmap.width() * bitmap.height());
+ memset(m_object_present_map.get(), 0, bitmap.width() * bitmap.height());
while (1)
{
diff --git a/src/mame/video/special.cpp b/src/mame/video/special.cpp
index d868c9efded..f527fbdd2a4 100644
--- a/src/mame/video/special.cpp
+++ b/src/mame/video/special.cpp
@@ -83,7 +83,7 @@ PALETTE_INIT_MEMBER(special_state,specimx)
VIDEO_START_MEMBER(special_state,specimx)
{
- m_specimx_colorram = auto_alloc_array(machine(), UINT8, 0x3000);
+ m_specimx_colorram = std::make_unique<UINT8[]>(0x3000);
}
UINT32 special_state::screen_update_specimx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/ssrj.cpp b/src/mame/video/ssrj.cpp
index e33d7098cbb..3d7e71729a3 100644
--- a/src/mame/video/ssrj.cpp
+++ b/src/mame/video/ssrj.cpp
@@ -226,7 +226,7 @@ void ssrj_state::video_start()
m_tilemap2->set_transparent_pen(0);
m_tilemap4->set_transparent_pen(0);
- m_buffer_spriteram = auto_alloc_array(machine(), UINT8, 0x0800);
+ m_buffer_spriteram = std::make_unique<UINT8[]>(0x0800);
}
@@ -289,6 +289,6 @@ void ssrj_state::screen_eof(screen_device &screen, bool state)
// rising edge
if (state)
{
- memcpy(m_buffer_spriteram, m_scrollram, 0x800);
+ memcpy(m_buffer_spriteram.get(), m_scrollram, 0x800);
}
}
diff --git a/src/mame/video/ssv.cpp b/src/mame/video/ssv.cpp
index 775697804d1..d9ceb4a71c9 100644
--- a/src/mame/video/ssv.cpp
+++ b/src/mame/video/ssv.cpp
@@ -207,12 +207,12 @@ VIDEO_START_MEMBER(ssv_state,eaglshot)
{
ssv_state::video_start();
- m_eaglshot_gfxram = auto_alloc_array(machine(), UINT16, 16 * 0x40000 / 2);
+ m_eaglshot_gfxram = std::make_unique<UINT16[]>(16 * 0x40000 / 2);
- m_gfxdecode->gfx(0)->set_source((UINT8 *)m_eaglshot_gfxram);
- m_gfxdecode->gfx(1)->set_source((UINT8 *)m_eaglshot_gfxram);
+ m_gfxdecode->gfx(0)->set_source((UINT8 *)m_eaglshot_gfxram.get());
+ m_gfxdecode->gfx(1)->set_source((UINT8 *)m_eaglshot_gfxram.get());
- save_pointer(NAME(m_eaglshot_gfxram), 16 * 0x40000 / 2);
+ save_pointer(NAME(m_eaglshot_gfxram.get()), 16 * 0x40000 / 2);
}
TILE_GET_INFO_MEMBER(ssv_state::get_tile_info_0)
diff --git a/src/mame/video/ssystem3.cpp b/src/mame/video/ssystem3.cpp
index a755dff5a4b..34af1e027ae 100644
--- a/src/mame/video/ssystem3.cpp
+++ b/src/mame/video/ssystem3.cpp
@@ -49,7 +49,7 @@ PALETTE_INIT_MEMBER(ssystem3_state, ssystem3)
void ssystem3_state::video_start()
{
// artwork seams to need this
- m_videoram = auto_alloc_array(machine(), UINT8, 6 * 2 + 24);
+ m_videoram = std::make_unique<UINT8[]>(6 * 2 + 24);
}
diff --git a/src/mame/video/starcrus.cpp b/src/mame/video/starcrus.cpp
index 776632ac165..d40cca50a16 100644
--- a/src/mame/video/starcrus.cpp
+++ b/src/mame/video/starcrus.cpp
@@ -21,11 +21,11 @@ WRITE8_MEMBER(starcrus_state::p2_y_w){ m_p2_y = data^0xff; }
void starcrus_state::video_start()
{
- m_ship1_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
- m_ship2_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
+ m_ship1_vid = std::make_unique<bitmap_ind16>(16, 16);
+ m_ship2_vid = std::make_unique<bitmap_ind16>(16, 16);
- m_proj1_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
- m_proj2_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
+ m_proj1_vid = std::make_unique<bitmap_ind16>(16, 16);
+ m_proj2_vid = std::make_unique<bitmap_ind16>(16, 16);
save_item(NAME(m_s1_x));
save_item(NAME(m_s1_y));
diff --git a/src/mame/video/starshp1.cpp b/src/mame/video/starshp1.cpp
index 62065fcb200..b2cd7639167 100644
--- a/src/mame/video/starshp1.cpp
+++ b/src/mame/video/starshp1.cpp
@@ -64,7 +64,7 @@ void starshp1_state::video_start()
m_bg_tilemap->set_scrollx(0, -8);
- m_LSFR = auto_alloc_array(machine(), UINT16, 0x10000);
+ m_LSFR = std::make_unique<UINT16[]>(0x10000);
for (i = 0; i < 0x10000; i++)
{
@@ -153,7 +153,7 @@ void starshp1_state::draw_starfield(bitmap_ind16 &bitmap)
for (y = 0; y < bitmap.height(); y++)
{
- const UINT16* p = m_LSFR + (UINT16) (512 * y);
+ const UINT16* p = m_LSFR.get() + (UINT16) (512 * y);
UINT16* pLine = &bitmap.pix16(y);
@@ -250,7 +250,7 @@ void starshp1_state::draw_circle_line(bitmap_ind16 &bitmap, int x, int y, int l)
{
if (y >= 0 && y <= bitmap.height() - 1)
{
- const UINT16* p = m_LSFR + (UINT16) (512 * y);
+ const UINT16* p = m_LSFR.get() + (UINT16) (512 * y);
UINT16* pLine = &bitmap.pix16(y);
diff --git a/src/mame/video/suna16.cpp b/src/mame/video/suna16.cpp
index 9698134ad97..6707da55344 100644
--- a/src/mame/video/suna16.cpp
+++ b/src/mame/video/suna16.cpp
@@ -93,7 +93,7 @@ WRITE16_MEMBER(suna16_state::bestbest_flipscreen_w)
void suna16_state::video_start()
{
- m_paletteram = auto_alloc_array(machine(), UINT16, m_palette->entries());
+ m_paletteram = std::make_unique<UINT16[]>(m_palette->entries());
save_item(NAME(m_color_bank));
}
diff --git a/src/mame/video/superqix.cpp b/src/mame/video/superqix.cpp
index d2c08c13d96..5ed5fa79ce8 100644
--- a/src/mame/video/superqix.cpp
+++ b/src/mame/video/superqix.cpp
@@ -56,8 +56,8 @@ VIDEO_START_MEMBER(superqix_state,pbillian)
VIDEO_START_MEMBER(superqix_state,superqix)
{
- m_fg_bitmap[0] = auto_bitmap_ind16_alloc(machine(), 256, 256);
- m_fg_bitmap[1] = auto_bitmap_ind16_alloc(machine(), 256, 256);
+ m_fg_bitmap[0] = std::make_unique<bitmap_ind16>(256, 256);
+ m_fg_bitmap[1] = std::make_unique<bitmap_ind16>(256, 256);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(superqix_state::sqix_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
diff --git a/src/mame/video/taito_b.cpp b/src/mame/video/taito_b.cpp
index 0583938da2f..141331eccf2 100644
--- a/src/mame/video/taito_b.cpp
+++ b/src/mame/video/taito_b.cpp
@@ -39,8 +39,8 @@ WRITE16_MEMBER(taitob_state::realpunc_video_ctrl_w)
VIDEO_START_MEMBER(taitob_state,taitob_core)
{
- m_framebuffer[0] = auto_bitmap_ind16_alloc(machine(), 512, 256);
- m_framebuffer[1] = auto_bitmap_ind16_alloc(machine(), 512, 256);
+ m_framebuffer[0] = std::make_unique<bitmap_ind16>(512, 256);
+ m_framebuffer[1] = std::make_unique<bitmap_ind16>(512, 256);
m_pixel_bitmap = nullptr; /* only hitice needs this */
save_item(NAME(m_pixel_scroll));
@@ -86,7 +86,7 @@ VIDEO_START_MEMBER(taitob_state,hitice)
m_b_fg_color_base = 0x80; /* hitice also uses this for the pixel_bitmap */
- m_pixel_bitmap = auto_bitmap_ind16_alloc(machine(), 1024, 512);
+ m_pixel_bitmap = std::make_unique<bitmap_ind16>(1024, 512);
save_item(NAME(*m_pixel_bitmap));
}
@@ -100,7 +100,7 @@ VIDEO_RESET_MEMBER(taitob_state,hitice)
VIDEO_START_MEMBER(taitob_state,realpunc)
{
- m_realpunc_bitmap = auto_bitmap_ind16_alloc(machine(), m_screen->width(), m_screen->height());
+ m_realpunc_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height());
VIDEO_START_CALL_MEMBER(taitob_color_order0);
}
diff --git a/src/mame/video/taito_f3.cpp b/src/mame/video/taito_f3.cpp
index 973e6b364cc..e5598e41c68 100644
--- a/src/mame/video/taito_f3.cpp
+++ b/src/mame/video/taito_f3.cpp
@@ -509,9 +509,9 @@ void taito_f3_state::screen_eof_f3(screen_device &screen, bool state)
{
if (machine().video().skip_this_frame() == 0)
{
- get_sprite_info(m_spriteram16_buffered);
+ get_sprite_info(m_spriteram16_buffered.get());
}
- memcpy(m_spriteram16_buffered,m_spriteram,0x10000);
+ memcpy(m_spriteram16_buffered.get(),m_spriteram,0x10000);
}
else if (m_sprite_lag==1)
{
@@ -624,7 +624,7 @@ VIDEO_START_MEMBER(taito_f3_state,f3)
m_pf8_tilemap->set_transparent_pen(0);
}
- m_spriteram16_buffered = auto_alloc_array(machine(), UINT16, 0x10000/2);
+ m_spriteram16_buffered = std::make_unique<UINT16[]>(0x10000/2);
m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x400);
m_sprite_end = m_spritelist;
m_vram_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(taito_f3_state::get_tile_info_vram),this),TILEMAP_SCAN_ROWS,8,8,64,64);
@@ -632,9 +632,9 @@ VIDEO_START_MEMBER(taito_f3_state,f3)
m_pf_line_inf = auto_alloc_array(machine(), struct f3_playfield_line_inf, 5);
m_sa_line_inf = auto_alloc_array(machine(), struct f3_spritealpha_line_inf, 1);
m_screen->register_screen_bitmap(m_pri_alp_bitmap);
- m_tile_opaque_sp = auto_alloc_array(machine(), UINT8, m_gfxdecode->gfx(2)->elements());
+ m_tile_opaque_sp = std::make_unique<UINT8[]>(m_gfxdecode->gfx(2)->elements());
for (i=0; i<8; i++)
- m_tile_opaque_pf[i] = auto_alloc_array(machine(), UINT8, m_gfxdecode->gfx(1)->elements());
+ m_tile_opaque_pf[i] = std::make_unique<UINT8[]>(m_gfxdecode->gfx(1)->elements());
m_vram_layer->set_transparent_pen(0);
@@ -646,7 +646,7 @@ VIDEO_START_MEMBER(taito_f3_state,f3)
m_gfxdecode->gfx(2)->set_granularity(16);
m_flipscreen = 0;
- memset(m_spriteram16_buffered,0,0x10000);
+ memset(m_spriteram16_buffered.get(),0,0x10000);
memset(m_spriteram,0,0x10000);
save_item(NAME(m_f3_control_0));
diff --git a/src/mame/video/taitoair.cpp b/src/mame/video/taitoair.cpp
index 65b70726f44..9f9aed421a8 100644
--- a/src/mame/video/taitoair.cpp
+++ b/src/mame/video/taitoair.cpp
@@ -502,9 +502,9 @@ void taitoair_state::video_start()
width = m_screen->width();
height = m_screen->height();
- m_framebuffer[0] = auto_bitmap_ind16_alloc(machine(), width, height);
- m_framebuffer[1] = auto_bitmap_ind16_alloc(machine(), width, height);
- //m_buffer3d = auto_bitmap_ind16_alloc(machine(), width, height);
+ m_framebuffer[0] = std::make_unique<bitmap_ind16>(width, height);
+ m_framebuffer[1] = std::make_unique<bitmap_ind16>(width, height);
+ //m_buffer3d = std::make_unique<bitmap_ind16>(width, height);
}
UINT32 taitoair_state::screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/taitojc.cpp b/src/mame/video/taitojc.cpp
index ecca7b3ff0e..c0034c28c85 100644
--- a/src/mame/video/taitojc.cpp
+++ b/src/mame/video/taitojc.cpp
@@ -319,13 +319,13 @@ void taitojc_state::video_start()
/* create the char set (gfx will then be updated dynamically from RAM) */
m_gfxdecode->set_gfx(m_gfx_index, global_alloc(gfx_element(m_palette, taitojc_char_layout, (UINT8 *)m_char_ram, 0, m_palette->entries() / 16, 0)));
- m_texture = auto_alloc_array(machine(), UINT8, 0x400000);
+ m_texture = std::make_unique<UINT8[]>(0x400000);
m_screen->register_screen_bitmap(m_framebuffer);
m_screen->register_screen_bitmap(m_zbuffer);
/* create renderer */
- m_renderer = auto_alloc(machine(), taitojc_renderer(machine(), &m_framebuffer, &m_zbuffer, m_texture));
+ m_renderer = auto_alloc(machine(), taitojc_renderer(machine(), &m_framebuffer, &m_zbuffer, m_texture.get()));
}
UINT32 taitojc_state::screen_update_taitojc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/taotaido.cpp b/src/mame/video/taotaido.cpp
index 994174bdbb2..21eaa685afc 100644
--- a/src/mame/video/taotaido.cpp
+++ b/src/mame/video/taotaido.cpp
@@ -100,11 +100,11 @@ void taotaido_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(taotaido_state::bg_tile_info),this),tilemap_mapper_delegate(FUNC(taotaido_state::tilemap_scan_rows),this),16,16,128,64);
- m_spriteram_old = auto_alloc_array(machine(), UINT16, 0x2000/2);
- m_spriteram_older = auto_alloc_array(machine(), UINT16, 0x2000/2);
+ m_spriteram_old = std::make_unique<UINT16[]>(0x2000/2);
+ m_spriteram_older = std::make_unique<UINT16[]>(0x2000/2);
- m_spriteram2_old = auto_alloc_array(machine(), UINT16, 0x10000/2);
- m_spriteram2_older = auto_alloc_array(machine(), UINT16, 0x10000/2);
+ m_spriteram2_old = std::make_unique<UINT16[]>(0x10000/2);
+ m_spriteram2_older = std::make_unique<UINT16[]>(0x10000/2);
save_item(NAME(m_sprite_character_bank_select));
save_item(NAME(m_video_bank_select));
@@ -133,7 +133,7 @@ UINT32 taotaido_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
m_bg_tilemap->draw(screen, bitmap, clip, 0,0);
}
- m_spr->draw_sprites(m_spriteram_older, m_spriteram.bytes(), screen, bitmap,cliprect);
+ m_spr->draw_sprites(m_spriteram_older.get(), m_spriteram.bytes(), screen, bitmap,cliprect);
return 0;
}
@@ -144,10 +144,10 @@ void taotaido_state::screen_eof(screen_device &screen, bool state)
{
/* sprites need to be delayed by 2 frames? */
- memcpy(m_spriteram2_older,m_spriteram2_old,0x10000);
- memcpy(m_spriteram2_old,m_spriteram2,0x10000);
+ memcpy(m_spriteram2_older.get(),m_spriteram2_old.get(),0x10000);
+ memcpy(m_spriteram2_old.get(),m_spriteram2,0x10000);
- memcpy(m_spriteram_older,m_spriteram_old,0x2000);
- memcpy(m_spriteram_old,m_spriteram,0x2000);
+ memcpy(m_spriteram_older.get(),m_spriteram_old.get(),0x2000);
+ memcpy(m_spriteram_old.get(),m_spriteram,0x2000);
}
}
diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp
index 3e150303609..aafb99ff5bc 100644
--- a/src/mame/video/tatsumi.cpp
+++ b/src/mame/video/tatsumi.cpp
@@ -129,7 +129,7 @@ VIDEO_START_MEMBER(tatsumi_state,apache3)
m_tx_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_shadow_pen_array = auto_alloc_array_clear(machine(), UINT8, 8192);
m_temp_bitmap.allocate(512, 512);
- m_apache3_road_x_ram = auto_alloc_array(machine(), UINT8, 512);
+ m_apache3_road_x_ram = std::make_unique<UINT8[]>(512);
m_tx_layer->set_transparent_pen(0);
}
@@ -138,11 +138,11 @@ VIDEO_START_MEMBER(tatsumi_state,roundup5)
{
m_tx_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
m_shadow_pen_array = auto_alloc_array_clear(machine(), UINT8, 8192);
- m_roundup5_vram = auto_alloc_array(machine(), UINT16, (0x48000 * 4)/2);
+ m_roundup5_vram = std::make_unique<UINT16[]>((0x48000 * 4)/2);
m_tx_layer->set_transparent_pen(0);
- m_gfxdecode->gfx(1)->set_source((UINT8 *)m_roundup5_vram);
+ m_gfxdecode->gfx(1)->set_source((UINT8 *)m_roundup5_vram.get());
}
VIDEO_START_MEMBER(tatsumi_state,cyclwarr)
diff --git a/src/mame/video/tetrisp2.cpp b/src/mame/video/tetrisp2.cpp
index 7511f401e8d..5307b11b062 100644
--- a/src/mame/video/tetrisp2.cpp
+++ b/src/mame/video/tetrisp2.cpp
@@ -228,11 +228,11 @@ VIDEO_START_MEMBER(tetrisp2_state,tetrisp2)
m_tilemap_rot->set_transparent_pen(0);
// should be smaller and mirrored like m32 I guess
- m_priority = auto_alloc_array(machine(), UINT8, 0x40000);
+ m_priority = std::make_unique<UINT8[]>(0x40000);
ms32_rearrange_sprites(machine(), "gfx1");
save_item(NAME(m_flipscreen_old));
- save_pointer(NAME(m_priority), 0x40000);
+ save_pointer(NAME(m_priority.get()), 0x40000);
}
VIDEO_START_MEMBER(tetrisp2_state,nndmseal)
@@ -254,11 +254,11 @@ VIDEO_START_MEMBER(tetrisp2_state,rockntread)
m_tilemap_rot->set_transparent_pen(0);
// should be smaller and mirrored like m32 I guess
- m_priority = auto_alloc_array(machine(), UINT8, 0x40000);
+ m_priority = std::make_unique<UINT8[]>(0x40000);
ms32_rearrange_sprites(machine(), "gfx1");
save_item(NAME(m_flipscreen_old));
- save_pointer(NAME(m_priority), 0x40000);
+ save_pointer(NAME(m_priority.get()), 0x40000);
}
@@ -486,7 +486,7 @@ UINT32 tetrisp2_state::screen_update_tetrisp2(screen_device &screen, bitmap_ind1
else if (asc_pri == 2)
m_tilemap_fg->draw(screen, bitmap, cliprect, 0, 1 << 2);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram, m_spriteram.bytes(), m_gfxdecode->gfx(0), (m_systemregs[0x00] & 0x02) );
return 0;
}
@@ -571,7 +571,7 @@ UINT32 tetrisp2_state::screen_update_rockntread(screen_device &screen, bitmap_in
else if (asc_pri == 2)
m_tilemap_fg->draw(screen, bitmap, cliprect, 0, 1 << 2);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram, m_spriteram.bytes(), m_gfxdecode->gfx(0), (m_systemregs[0x00] & 0x02) );
return 0;
}
@@ -633,7 +633,7 @@ UINT32 tetrisp2_state::screen_update_rocknms_left(screen_device &screen, bitmap_
else if (asc_pri == 2)
m_tilemap_sub_fg->draw(screen, bitmap, cliprect, 0, 1 << 2);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram2, m_spriteram2.bytes(), m_sub_gfxdecode->gfx(0), (m_systemregs[0x00] & 0x02) );
return 0;
@@ -694,7 +694,7 @@ UINT32 tetrisp2_state::screen_update_rocknms_right(screen_device &screen, bitmap
else if (asc_pri == 2)
m_tilemap_fg->draw(screen, bitmap, cliprect, 0, 1 << 2);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram, m_spriteram.bytes(), m_gfxdecode->gfx(0), (m_systemregs[0x00] & 0x02) );
return 0;
@@ -737,7 +737,7 @@ VIDEO_START_MEMBER(stepstag_state,stepstag)
m_tilemap_rot->set_transparent_pen(0);
// should be smaller and mirrored like m32 I guess
- m_priority = auto_alloc_array(machine(), UINT8, 0x40000);
+ m_priority = std::make_unique<UINT8[]>(0x40000);
ms32_rearrange_sprites(machine(), "sprites_horiz");
ms32_rearrange_sprites(machine(), "sprites_vert");
@@ -748,7 +748,7 @@ UINT32 stepstag_state::screen_update_stepstag_left(screen_device &screen, bitmap
bitmap.fill(0, cliprect);
screen.priority().fill(0);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram, m_spriteram.bytes(), m_gfxdecode->gfx(1), (m_systemregs[0x00] & 0x02) );
return 0;
}
@@ -757,7 +757,7 @@ UINT32 stepstag_state::screen_update_stepstag_right(screen_device &screen, bitma
bitmap.fill(0, cliprect);
screen.priority().fill(0);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram3, m_spriteram3.bytes(), m_gfxdecode->gfx(1), (m_systemregs[0x00] & 0x02) );
return 0;
}
@@ -767,7 +767,7 @@ UINT32 stepstag_state::screen_update_stepstag_mid(screen_device &screen, bitmap_
bitmap.fill(0, cliprect);
screen.priority().fill(0);
- tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority,
+ tetrisp2_draw_sprites(bitmap, screen.priority(), cliprect, m_priority.get(),
m_spriteram2, m_spriteram2.bytes(), m_gfxdecode->gfx(0), (m_systemregs[0x00] & 0x02) );
m_tilemap_fg->draw(screen, bitmap, cliprect, 0, 1 << 2);
diff --git a/src/mame/video/thief.cpp b/src/mame/video/thief.cpp
index 00862465ae9..1fc54b9d9d3 100644
--- a/src/mame/video/thief.cpp
+++ b/src/mame/video/thief.cpp
@@ -96,8 +96,8 @@ void thief_state::video_start(){
m_videoram = auto_alloc_array_clear(machine(), UINT8, 0x2000*4*2 );
- m_coprocessor.image_ram = auto_alloc_array(machine(), UINT8, 0x2000 );
- m_coprocessor.context_ram = auto_alloc_array(machine(), UINT8, 0x400 );
+ m_coprocessor.image_ram = std::make_unique<UINT8[]>(0x2000 );
+ m_coprocessor.context_ram = std::make_unique<UINT8[]>(0x400 );
}
UINT32 thief_state::screen_update_thief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){
diff --git a/src/mame/video/thoop2.cpp b/src/mame/video/thoop2.cpp
index cee5e1f77c0..e2b826941c5 100644
--- a/src/mame/video/thoop2.cpp
+++ b/src/mame/video/thoop2.cpp
@@ -90,7 +90,7 @@ void thoop2_state::video_start()
m_pant[1]->set_transmask(0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
for (i = 0; i < 5; i++){
- m_sprite_table[i] = auto_alloc_array(machine(), int, 512);
+ m_sprite_table[i] = std::make_unique<int[]>(512);
}
}
diff --git a/src/mame/video/tia.cpp b/src/mame/video/tia.cpp
index d6d08ecfb6d..05291544f58 100644
--- a/src/mame/video/tia.cpp
+++ b/src/mame/video/tia.cpp
@@ -429,9 +429,9 @@ void tia_video_device::device_start()
int cx = m_screen->width();
screen_height = m_screen->height();
- helper[0] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
- helper[1] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
- helper[2] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
+ helper[0] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT);
+ helper[1] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT);
+ helper[2] = std::make_unique<bitmap_ind16>(cx, TIA_MAX_SCREEN_HEIGHT);
register_save_state();
}
diff --git a/src/mame/video/tia.h b/src/mame/video/tia.h
index 8626ef3c806..de5cfc5da05 100644
--- a/src/mame/video/tia.h
+++ b/src/mame/video/tia.h
@@ -198,7 +198,7 @@ private:
UINT8 REFLECT; /* Should playfield be reflected or not */
UINT8 NUSIZx_changed;
- bitmap_ind16 *helper[3];
+ std::unique_ptr<bitmap_ind16> helper[3];
UINT16 screen_height;
diff --git a/src/mame/video/tryout.cpp b/src/mame/video/tryout.cpp
index 43262b8f1e3..45c8d553151 100644
--- a/src/mame/video/tryout.cpp
+++ b/src/mame/video/tryout.cpp
@@ -165,16 +165,16 @@ void tryout_state::video_start()
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tryout_state::get_fg_tile_info),this),tilemap_mapper_delegate(FUNC(tryout_state::get_fg_memory_offset),this),8,8,32,32);
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tryout_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(tryout_state::get_bg_memory_offset),this),16,16,64,16);
- m_vram=auto_alloc_array(machine(), UINT8, 8 * 0x800);
- m_vram_gfx=auto_alloc_array(machine(), UINT8, 0x6000);
+ m_vram=std::make_unique<UINT8[]>(8 * 0x800);
+ m_vram_gfx=std::make_unique<UINT8[]>(0x6000);
- m_gfxdecode->gfx(2)->set_source(m_vram_gfx);
+ m_gfxdecode->gfx(2)->set_source(m_vram_gfx.get());
m_fg_tilemap->set_transparent_pen(0);
save_item(NAME(m_vram_bank));
- save_pointer(NAME(m_vram), 8 * 0x800);
- save_pointer(NAME(m_vram_gfx), 0x6000);
+ save_pointer(NAME(m_vram.get()), 8 * 0x800);
+ save_pointer(NAME(m_vram_gfx.get()), 0x6000);
}
void tryout_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
diff --git a/src/mame/video/tubep.cpp b/src/mame/video/tubep.cpp
index adac17e1a65..95091136ee2 100644
--- a/src/mame/video/tubep.cpp
+++ b/src/mame/video/tubep.cpp
@@ -340,7 +340,7 @@ PALETTE_INIT_MEMBER(tubep_state,tubep)
VIDEO_START_MEMBER(tubep_state,tubep)
{
- m_spritemap = auto_alloc_array(machine(), UINT8, 256*256*2);
+ m_spritemap = std::make_unique<UINT8[]>(256*256*2);
/* Set up save state */
save_item(NAME(m_romD_addr));
@@ -369,7 +369,7 @@ VIDEO_START_MEMBER(tubep_state,tubep)
VIDEO_RESET_MEMBER(tubep_state,tubep)
{
- memset(m_spritemap,0,256*256*2);
+ memset(m_spritemap.get(),0,256*256*2);
m_romD_addr = 0;
m_romEF_addr = 0;
@@ -567,7 +567,7 @@ void tubep_state::tubep_vblank_end()
m_DISP = m_DISP ^ 1;
/* logerror("EOF: DISP after this is=%i, and clearing it now.\n", m_DISP); */
/* clear the new frame (the one that was (just) displayed)*/
- memset(m_spritemap+m_DISP*256*256, 0x0f, 256*256);
+ memset(m_spritemap.get()+m_DISP*256*256, 0x0f, 256*256);
}
diff --git a/src/mame/video/turbo.cpp b/src/mame/video/turbo.cpp
index 618521951e9..c5e6d68a937 100644
--- a/src/mame/video/turbo.cpp
+++ b/src/mame/video/turbo.cpp
@@ -173,8 +173,8 @@ VIDEO_START_MEMBER(turbo_state,buckrog)
m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(turbo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
/* allocate the bitmap RAM */
- m_buckrog_bitmap_ram = auto_alloc_array(machine(), UINT8, 0xe000);
- save_pointer(NAME(m_buckrog_bitmap_ram), 0xe000);
+ m_buckrog_bitmap_ram = std::make_unique<UINT8[]>(0xe000);
+ save_pointer(NAME(m_buckrog_bitmap_ram.get()), 0xe000);
}
diff --git a/src/mame/video/turrett.cpp b/src/mame/video/turrett.cpp
index 4751d7a137a..421a9ce19b8 100644
--- a/src/mame/video/turrett.cpp
+++ b/src/mame/video/turrett.cpp
@@ -28,7 +28,7 @@ UINT32 turrett_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
int page = (m_video_ctrl & 1) ^ 1;
- const UINT16 *vram = m_video_ram[page];
+ const UINT16 *vram = m_video_ram[page].get();
INT8 fade_b = m_video_fade & 0x1f;
INT8 fade_g = (m_video_fade >> 5) & 0x1f;
diff --git a/src/mame/video/tx1.cpp b/src/mame/video/tx1.cpp
index 56a8556f2d9..9125963cf78 100644
--- a/src/mame/video/tx1.cpp
+++ b/src/mame/video/tx1.cpp
@@ -1099,12 +1099,12 @@ void tx1_state::tx1_draw_objects(UINT8 *bitmap)
VIDEO_START_MEMBER(tx1_state,tx1)
{
/* Allocate a large bitmap that covers the three screens */
- m_bitmap = auto_bitmap_ind16_alloc(machine(), 768, 256);
+ m_bitmap = std::make_unique<bitmap_ind16>(768, 256);
/* Allocate some bitmaps */
- m_chr_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
- m_obj_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
- m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
+ m_chr_bmp = std::make_unique<UINT8[]>(256 * 3 * 240);
+ m_obj_bmp = std::make_unique<UINT8[]>(256 * 3 * 240);
+ m_rod_bmp = std::make_unique<UINT8[]>(256 * 3 * 240);
/* Set a timer to run the interrupts */
m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this));
@@ -1138,9 +1138,9 @@ void tx1_state::tx1_combine_layers(bitmap_ind16 &bitmap, int screen)
UINT32 bmp_offset = y * 768 + x_offset;
- UINT8 *chr_addr = m_chr_bmp + bmp_offset;
- UINT8 *rod_addr = m_rod_bmp + bmp_offset;
- UINT8 *obj_addr = m_obj_bmp + bmp_offset;
+ UINT8 *chr_addr = m_chr_bmp.get() + bmp_offset;
+ UINT8 *rod_addr = m_rod_bmp.get() + bmp_offset;
+ UINT8 *obj_addr = m_obj_bmp.get() + bmp_offset;
for (x = 0; x < 256; ++x)
{
@@ -1178,11 +1178,11 @@ void tx1_state::tx1_combine_layers(bitmap_ind16 &bitmap, int screen)
void tx1_state::tx1_update_layers()
{
- memset(m_obj_bmp, 0, 768*240);
+ memset(m_obj_bmp.get(), 0, 768*240);
- tx1_draw_char(m_chr_bmp);
- tx1_draw_road(m_rod_bmp);
- tx1_draw_objects(m_obj_bmp);
+ tx1_draw_char(m_chr_bmp.get());
+ tx1_draw_road(m_rod_bmp.get());
+ tx1_draw_objects(m_obj_bmp.get());
m_needs_update = false;
}
@@ -2946,9 +2946,9 @@ void tx1_state::bb_combine_layers(bitmap_ind16 &bitmap, int screen)
UINT32 bmp_offset = y * bmp_stride + x_offset;
- UINT8 *chr_addr = m_chr_bmp + bmp_offset;
- UINT8 *rod_addr = m_rod_bmp + bmp_offset;
- UINT8 *obj_addr = m_obj_bmp + bmp_offset;
+ UINT8 *chr_addr = m_chr_bmp.get() + bmp_offset;
+ UINT8 *rod_addr = m_rod_bmp.get() + bmp_offset;
+ UINT8 *obj_addr = m_obj_bmp.get() + bmp_offset;
UINT32 sky_en = BIT(m_vregs.sky, 7);
UINT32 sky_val = (((m_vregs.sky & 0x7f) + y) >> 2) & 0x3f;
@@ -2992,9 +2992,9 @@ void tx1_state::bb_combine_layers(bitmap_ind16 &bitmap, int screen)
VIDEO_START_MEMBER(tx1_state,buggyboy)
{
/* Allocate some bitmaps */
- m_chr_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
- m_obj_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
- m_rod_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
+ m_chr_bmp = std::make_unique<UINT8[]>(3 * 256 * 240);
+ m_obj_bmp = std::make_unique<UINT8[]>(3 * 256 * 240);
+ m_rod_bmp = std::make_unique<UINT8[]>(3 * 256 * 240);
/* Set a timer to run the interrupts */
m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this));
@@ -3006,9 +3006,9 @@ VIDEO_START_MEMBER(tx1_state,buggyboy)
VIDEO_START_MEMBER(tx1_state,buggybjr)
{
/* Allocate some bitmaps */
- m_chr_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
- m_obj_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
- m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
+ m_chr_bmp = std::make_unique<UINT8[]>(256 * 240);
+ m_obj_bmp = std::make_unique<UINT8[]>(256 * 240);
+ m_rod_bmp = std::make_unique<UINT8[]>(256 * 240);
/* Set a timer to run the interrupts */
m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this));
@@ -3035,12 +3035,12 @@ void tx1_state::screen_eof_buggyboy(screen_device &screen, bool state)
void tx1_state::bb_update_layers()
{
- memset(m_obj_bmp, 0, 768*240);
- memset(m_rod_bmp, 0, 768*240);
+ memset(m_obj_bmp.get(), 0, 768*240);
+ memset(m_rod_bmp.get(), 0, 768*240);
- buggyboy_draw_char(m_chr_bmp, 1);
- buggyboy_draw_road(m_rod_bmp);
- buggyboy_draw_objs(m_obj_bmp, 1);
+ buggyboy_draw_char(m_chr_bmp.get(), 1);
+ buggyboy_draw_road(m_rod_bmp.get());
+ buggyboy_draw_objs(m_obj_bmp.get(), 1);
m_needs_update = false;
}
@@ -3074,11 +3074,11 @@ UINT32 tx1_state::screen_update_buggyboy_right(screen_device &screen, bitmap_ind
UINT32 tx1_state::screen_update_buggybjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- memset(m_obj_bmp, 0, 256*240);
+ memset(m_obj_bmp.get(), 0, 256*240);
- buggyboy_draw_char(m_chr_bmp, 0);
- buggybjr_draw_road(m_rod_bmp);
- buggyboy_draw_objs(m_obj_bmp, 0);
+ buggyboy_draw_char(m_chr_bmp.get(), 0);
+ buggybjr_draw_road(m_rod_bmp.get());
+ buggyboy_draw_objs(m_obj_bmp.get(), 0);
bb_combine_layers(bitmap, -1);
return 0;
diff --git a/src/mame/video/vc4000.cpp b/src/mame/video/vc4000.cpp
index 15252cba98c..45fa1079131 100644
--- a/src/mame/video/vc4000.cpp
+++ b/src/mame/video/vc4000.cpp
@@ -58,7 +58,7 @@ void vc4000_state::video_start()
m_video.sprites[3].data = &m_video.reg.d.sprite4;
m_video.sprites[3].mask = 1 << 3;
- m_bitmap = auto_bitmap_ind16_alloc(machine(), m_screen->width(), m_screen->height());
+ m_bitmap = std::make_unique<bitmap_ind16>(m_screen->width(), m_screen->height());
}
inline UINT8 vc4000_state::vc4000_joystick_return_to_centre(UINT8 joy)
diff --git a/src/mame/video/victory.cpp b/src/mame/video/victory.cpp
index 99ce602429b..b7f6ce15ff0 100644
--- a/src/mame/video/victory.cpp
+++ b/src/mame/video/victory.cpp
@@ -32,13 +32,13 @@
void victory_state::video_start()
{
/* allocate bitmapram */
- m_rram = auto_alloc_array(machine(), UINT8, 0x4000);
- m_gram = auto_alloc_array(machine(), UINT8, 0x4000);
- m_bram = auto_alloc_array(machine(), UINT8, 0x4000);
+ m_rram = std::make_unique<UINT8[]>(0x4000);
+ m_gram = std::make_unique<UINT8[]>(0x4000);
+ m_bram = std::make_unique<UINT8[]>(0x4000);
/* allocate bitmaps */
- m_bgbitmap = auto_alloc_array(machine(), UINT8, 256 * 256);
- m_fgbitmap = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_bgbitmap = std::make_unique<UINT8[]>(256 * 256);
+ m_fgbitmap = std::make_unique<UINT8[]>(256 * 256);
/* reset globals */
m_vblank_irq = 0;
@@ -51,9 +51,9 @@ void victory_state::video_start()
/* register for state saving */
save_item(NAME(m_paletteram));
- save_pointer(NAME(m_rram), 0x4000);
- save_pointer(NAME(m_gram), 0x4000);
- save_pointer(NAME(m_bram), 0x4000);
+ save_pointer(NAME(m_rram.get()), 0x4000);
+ save_pointer(NAME(m_gram.get()), 0x4000);
+ save_pointer(NAME(m_bram.get()), 0x4000);
save_item(NAME(m_vblank_irq));
save_item(NAME(m_fgcoll));
save_item(NAME(m_fgcollx));
diff --git a/src/mame/video/vigilant.cpp b/src/mame/video/vigilant.cpp
index 0f95bdcde96..23449692bd4 100644
--- a/src/mame/video/vigilant.cpp
+++ b/src/mame/video/vigilant.cpp
@@ -21,7 +21,7 @@ static const rectangle bottomvisiblearea(16*8, 48*8-1, 6*8, 32*8-1);
void vigilant_state::video_start()
{
- m_bg_bitmap = auto_bitmap_ind16_alloc(machine(),512*4,256);
+ m_bg_bitmap = std::make_unique<bitmap_ind16>(512*4,256);
save_item(NAME(m_horiz_scroll_low));
save_item(NAME(m_horiz_scroll_high));
diff --git a/src/mame/video/volfied.cpp b/src/mame/video/volfied.cpp
index 3bf38ccd55f..5b1d808340e 100644
--- a/src/mame/video/volfied.cpp
+++ b/src/mame/video/volfied.cpp
@@ -9,12 +9,12 @@
void volfied_state::video_start()
{
- m_video_ram = auto_alloc_array(machine(), UINT16, 0x40000);
+ m_video_ram = std::make_unique<UINT16[]>(0x40000);
m_video_ctrl = 0;
m_video_mask = 0;
- save_pointer(NAME(m_video_ram), 0x40000);
+ save_pointer(NAME(m_video_ram.get()), 0x40000);
save_item(NAME(m_video_ctrl));
save_item(NAME(m_video_mask));
}
@@ -91,7 +91,7 @@ void volfied_state::refresh_pixel_layer( bitmap_ind16 &bitmap )
*********************************************************/
- UINT16* p = m_video_ram;
+ UINT16* p = m_video_ram.get();
int width = m_screen->width();
int height = m_screen->height();
diff --git a/src/mame/video/williams.cpp b/src/mame/video/williams.cpp
index 84f5d7a5578..0f4a01d3688 100644
--- a/src/mame/video/williams.cpp
+++ b/src/mame/video/williams.cpp
@@ -432,7 +432,7 @@ WRITE8_MEMBER(williams2_state::williams2_xscroll_high_w)
WRITE8_MEMBER(blaster_state::blaster_remap_select_w)
{
m_blitter_remap_index = data;
- m_blitter_remap = m_blitter_remap_lookup + data * 256;
+ m_blitter_remap = m_blitter_remap_lookup.get() + data * 256;
}
@@ -461,9 +461,9 @@ void williams_state::blitter_init(int blitter_config, const UINT8 *remap_prom)
m_blitter_xor = (blitter_config == WILLIAMS_BLITTER_SC01) ? 4 : 0;
/* create the remap table; if no PROM, make an identity remap table */
- m_blitter_remap_lookup = auto_alloc_array(machine(), UINT8, 256 * 256);
+ m_blitter_remap_lookup = std::make_unique<UINT8[]>(256 * 256);
m_blitter_remap_index = 0;
- m_blitter_remap = m_blitter_remap_lookup;
+ m_blitter_remap = m_blitter_remap_lookup.get();
for (i = 0; i < 256; i++)
{
const UINT8 *table = remap_prom ? (remap_prom + (i & 0x7f) * 16) : dummy_table;
diff --git a/src/mame/video/wolfpack.cpp b/src/mame/video/wolfpack.cpp
index 33e26e690e4..77b6f3ea1d1 100644
--- a/src/mame/video/wolfpack.cpp
+++ b/src/mame/video/wolfpack.cpp
@@ -100,7 +100,7 @@ void wolfpack_state::video_start()
int i;
- m_LFSR = auto_alloc_array(machine(), UINT8, 0x8000);
+ m_LFSR = std::make_unique<UINT8[]>(0x8000);
m_screen->register_screen_bitmap(m_helper);
diff --git a/src/mame/video/x68k.cpp b/src/mame/video/x68k.cpp
index 770ab644f8d..6a1019ad339 100644
--- a/src/mame/video/x68k.cpp
+++ b/src/mame/video/x68k.cpp
@@ -1101,10 +1101,10 @@ VIDEO_START_MEMBER(x68k_state,x68000)
m_bg0_16->set_transparent_pen(0);
m_bg1_16->set_transparent_pen(0);
- m_pcgbitmap = auto_bitmap_ind16_alloc(machine(), 1024, 1024);
+ m_pcgbitmap = std::make_unique<bitmap_ind16>(1024, 1024);
m_pcgbitmap->fill(0);
- m_gfxbitmap = auto_bitmap_ind16_alloc(machine(), 1024, 1024);
+ m_gfxbitmap = std::make_unique<bitmap_ind16>(1024, 1024);
m_gfxbitmap->fill(0);
// m_scanline_timer->adjust(attotime::zero, 0, attotime::from_hz(55.45)/568);
diff --git a/src/mame/video/xmen.cpp b/src/mame/video/xmen.cpp
index ceefb936ba6..f25a51d5fcd 100644
--- a/src/mame/video/xmen.cpp
+++ b/src/mame/video/xmen.cpp
@@ -53,8 +53,8 @@ VIDEO_START_MEMBER(xmen_state,xmen6p)
{
m_k053246->k053247_get_ram( &m_k053247_ram);
- m_screen_left = auto_bitmap_ind16_alloc(machine(), 64 * 8, 32 * 8);
- m_screen_right = auto_bitmap_ind16_alloc(machine(), 64 * 8, 32 * 8);
+ m_screen_left = std::make_unique<bitmap_ind16>(64 * 8, 32 * 8);
+ m_screen_right = std::make_unique<bitmap_ind16>(64 * 8, 32 * 8);
save_item(NAME(*m_screen_left));
save_item(NAME(*m_screen_right));
@@ -168,7 +168,7 @@ void xmen_state::screen_eof_xmen6p(screen_device &screen, bool state)
}
- renderbitmap = m_screen_right;
+ renderbitmap = m_screen_right.get();
}
else
{
@@ -187,7 +187,7 @@ void xmen_state::screen_eof_xmen6p(screen_device &screen, bool state)
}
- renderbitmap = m_screen_left;
+ renderbitmap = m_screen_left.get();
}
diff --git a/src/mame/video/zx.cpp b/src/mame/video/zx.cpp
index 43ec24aa467..7f9089653a7 100644
--- a/src/mame/video/zx.cpp
+++ b/src/mame/video/zx.cpp
@@ -138,8 +138,8 @@ void zx_state::video_start()
m_ula_hsync = timer_alloc(TIMER_ULA_HSYNC);
m_ula_char_buffer = 0xffff;
- m_bitmap_render = auto_bitmap_ind16_alloc(machine(), 384, 311);
- m_bitmap_buffer = auto_bitmap_ind16_alloc(machine(), 384, 311);
+ m_bitmap_render = std::make_unique<bitmap_ind16>(384, 311);
+ m_bitmap_buffer = std::make_unique<bitmap_ind16>(384, 311);
}
UINT32 zx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)