summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Olivier Galibert <galibert@pobox.com>2020-05-09 20:20:41 +0200
committerGravatarGravatar Olivier Galibert <galibert@pobox.com>2020-05-09 20:20:49 +0200
commitc1a6acae3202d903638847f010766efa96cb742b (patch)
treea990badf10d6223a21dfea85f215751fdf6187f7
parent157a37994c2a2f88a6460d2350f6a67d2171e4ad (diff)
emumem: Simplify memory management. [O. Galibert]memory-test
API impact: - install_ram/rom/writeonly now requires a non-null pointer. If you want automatically managed ram, add it to a memory map, not in machine_start - install_*_bank now requires a memory_bank *, not a string - one can create memory banks outside of memory maps with memory_bank_creator Memory maps impact: - ram ranges with overlapping addresses are not shared anymore. Use .share() - ram ranges touching each other are not merged anymore. Stay in your range Extra note: - there is no need to create a bank just to dynamically map some memory/rom. Just use install_rom/ram/writeonly
-rw-r--r--docs/source/techspecs/index.rst1
-rw-r--r--docs/source/techspecs/memory.rst167
-rw-r--r--src/devices/bus/a1bus/a1bus.cpp9
-rw-r--r--src/devices/bus/a1bus/a1bus.h4
-rw-r--r--src/devices/bus/a1bus/a1cassette.cpp2
-rw-r--r--src/devices/bus/a1bus/a1cffa.cpp2
-rw-r--r--src/devices/bus/abcbus/ram.cpp3
-rw-r--r--src/devices/bus/abcbus/ram.h2
-rw-r--r--src/devices/bus/abcbus/ssa.cpp5
-rw-r--r--src/devices/bus/abcbus/ssa.h6
-rw-r--r--src/devices/bus/acorn/atom/discpack.cpp7
-rw-r--r--src/devices/bus/acorn/atom/discpack.h2
-rw-r--r--src/devices/bus/acorn/system/32k.cpp7
-rw-r--r--src/devices/bus/acorn/system/32k.h1
-rw-r--r--src/devices/bus/acorn/system/8k.cpp5
-rw-r--r--src/devices/bus/acorn/system/8k.h1
-rw-r--r--src/devices/bus/adam/exp.cpp3
-rw-r--r--src/devices/bus/adam/exp.h2
-rw-r--r--src/devices/bus/adam/ram.cpp3
-rw-r--r--src/devices/bus/adam/ram.h2
-rw-r--r--src/devices/bus/bw2/ramcard.cpp5
-rw-r--r--src/devices/bus/bw2/ramcard.h2
-rw-r--r--src/devices/bus/c64/c128_partner.cpp6
-rw-r--r--src/devices/bus/c64/c128_partner.h2
-rw-r--r--src/devices/bus/c64/dqbb.cpp3
-rw-r--r--src/devices/bus/c64/dqbb.h4
-rw-r--r--src/devices/bus/c64/easyflash.cpp5
-rw-r--r--src/devices/bus/c64/easyflash.h2
-rw-r--r--src/devices/bus/c64/exp.cpp12
-rw-r--r--src/devices/bus/c64/exp.h8
-rw-r--r--src/devices/bus/c64/fcc.cpp1
-rw-r--r--src/devices/bus/c64/fcc.h8
-rw-r--r--src/devices/bus/c64/georam.cpp5
-rw-r--r--src/devices/bus/c64/georam.h2
-rw-r--r--src/devices/bus/c64/ide64.cpp6
-rw-r--r--src/devices/bus/c64/ide64.h2
-rw-r--r--src/devices/bus/c64/magic_formel.cpp5
-rw-r--r--src/devices/bus/c64/magic_formel.h2
-rw-r--r--src/devices/bus/c64/neoram.cpp2
-rw-r--r--src/devices/bus/c64/neoram.h4
-rw-r--r--src/devices/bus/c64/ocean.cpp8
-rw-r--r--src/devices/bus/c64/pagefox.cpp6
-rw-r--r--src/devices/bus/c64/pagefox.h2
-rw-r--r--src/devices/bus/c64/partner.cpp4
-rw-r--r--src/devices/bus/c64/partner.h2
-rw-r--r--src/devices/bus/c64/reu.cpp5
-rw-r--r--src/devices/bus/c64/reu.h2
-rw-r--r--src/devices/bus/c64/ross.cpp2
-rw-r--r--src/devices/bus/c64/std.cpp12
-rw-r--r--src/devices/bus/c64/westermann.cpp8
-rw-r--r--src/devices/bus/c64/xl80.cpp4
-rw-r--r--src/devices/bus/c64/xl80.h2
-rw-r--r--src/devices/bus/cbm2/24k.cpp3
-rw-r--r--src/devices/bus/cbm2/24k.h2
-rw-r--r--src/devices/bus/cbm2/exp.cpp11
-rw-r--r--src/devices/bus/cbm2/exp.h6
-rw-r--r--src/devices/bus/cbm2/std.cpp12
-rw-r--r--src/devices/bus/comx35/clm.cpp5
-rw-r--r--src/devices/bus/comx35/clm.h2
-rw-r--r--src/devices/bus/comx35/ram.cpp3
-rw-r--r--src/devices/bus/comx35/ram.h2
-rw-r--r--src/devices/bus/cpc/cpc_rom.cpp4
-rw-r--r--src/devices/bus/ecbbus/grip.cpp5
-rw-r--r--src/devices/bus/ecbbus/grip.h2
-rw-r--r--src/devices/bus/hp_dio/hp_dio.cpp10
-rw-r--r--src/devices/bus/hp_dio/hp_dio.h4
-rw-r--r--src/devices/bus/interpro/sr/sr.h4
-rw-r--r--src/devices/bus/isa/3c503.cpp8
-rw-r--r--src/devices/bus/isa/3c505.cpp2
-rw-r--r--src/devices/bus/isa/aha1542c.cpp2
-rw-r--r--src/devices/bus/isa/asc88.cpp4
-rw-r--r--src/devices/bus/isa/cga.cpp16
-rw-r--r--src/devices/bus/isa/chessmsr.cpp8
-rw-r--r--src/devices/bus/isa/chessmsr.h2
-rw-r--r--src/devices/bus/isa/ega.cpp2
-rw-r--r--src/devices/bus/isa/eis_hgb107x.cpp4
-rw-r--r--src/devices/bus/isa/hdc.cpp2
-rw-r--r--src/devices/bus/isa/isa.cpp10
-rw-r--r--src/devices/bus/isa/isa.h4
-rw-r--r--src/devices/bus/isa/lbaenhancer.cpp2
-rw-r--r--src/devices/bus/isa/mc1502_rom.cpp2
-rw-r--r--src/devices/bus/isa/mda.cpp22
-rw-r--r--src/devices/bus/isa/mufdc.cpp2
-rw-r--r--src/devices/bus/isa/p1_fdc.cpp2
-rw-r--r--src/devices/bus/isa/p1_hdc.cpp2
-rw-r--r--src/devices/bus/isa/p1_rom.cpp2
-rw-r--r--src/devices/bus/isa/pc1640_iga.cpp2
-rw-r--r--src/devices/bus/isa/pgc.cpp15
-rw-r--r--src/devices/bus/isa/pgc.h2
-rw-r--r--src/devices/bus/isa/side116.cpp8
-rw-r--r--src/devices/bus/isa/svga_cirrus.cpp4
-rw-r--r--src/devices/bus/isa/svga_s3.cpp8
-rw-r--r--src/devices/bus/isa/svga_trident.cpp2
-rw-r--r--src/devices/bus/isa/svga_tseng.cpp2
-rw-r--r--src/devices/bus/isa/vga.cpp2
-rw-r--r--src/devices/bus/isa/vga_ati.cpp6
-rw-r--r--src/devices/bus/isa/wdxt_gen.cpp2
-rw-r--r--src/devices/bus/lpci/northbridge.cpp4
-rw-r--r--src/devices/bus/macpds/macpds.cpp18
-rw-r--r--src/devices/bus/macpds/macpds.h4
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.cpp3
-rw-r--r--src/devices/bus/msx_slot/bunsetsu.cpp2
-rw-r--r--src/devices/bus/nubus/laserview.cpp4
-rw-r--r--src/devices/bus/nubus/nubus.cpp20
-rw-r--r--src/devices/bus/nubus/nubus.h4
-rw-r--r--src/devices/bus/nubus/nubus_48gc.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_cb264.cpp2
-rw-r--r--src/devices/bus/nubus/nubus_image.cpp3
-rw-r--r--src/devices/bus/nubus/nubus_vikbw.cpp4
-rw-r--r--src/devices/bus/pet/64k.cpp5
-rw-r--r--src/devices/bus/pet/64k.h2
-rw-r--r--src/devices/bus/pet/superpet.cpp5
-rw-r--r--src/devices/bus/pet/superpet.h2
-rw-r--r--src/devices/bus/plus4/exp.cpp4
-rw-r--r--src/devices/bus/plus4/exp.h8
-rw-r--r--src/devices/bus/plus4/std.cpp16
-rw-r--r--src/devices/bus/pofo/ccm.cpp6
-rw-r--r--src/devices/bus/pofo/ccm.h3
-rw-r--r--src/devices/bus/pofo/hpc104.cpp4
-rw-r--r--src/devices/bus/pofo/hpc104.h6
-rw-r--r--src/devices/bus/pofo/ram.cpp4
-rw-r--r--src/devices/bus/pofo/ram.h6
-rw-r--r--src/devices/bus/ql/rom.cpp8
-rw-r--r--src/devices/bus/ql/rom.h2
-rw-r--r--src/devices/bus/ql/sandy_superqboard.cpp5
-rw-r--r--src/devices/bus/ql/sandy_superqboard.h2
-rw-r--r--src/devices/bus/ql/std.cpp4
-rw-r--r--src/devices/bus/ql/trumpcard.cpp5
-rw-r--r--src/devices/bus/ql/trumpcard.h2
-rw-r--r--src/devices/bus/s100/dj2db.cpp5
-rw-r--r--src/devices/bus/s100/dj2db.h2
-rw-r--r--src/devices/bus/s100/mm65k16s.cpp3
-rw-r--r--src/devices/bus/s100/mm65k16s.h2
-rw-r--r--src/devices/bus/snes/event.cpp6
-rw-r--r--src/devices/bus/snes/upd.cpp18
-rw-r--r--src/devices/bus/vic10/exp.cpp13
-rw-r--r--src/devices/bus/vic10/exp.h6
-rw-r--r--src/devices/bus/vic10/std.cpp16
-rw-r--r--src/devices/bus/vic20/exp.cpp7
-rw-r--r--src/devices/bus/vic20/exp.h9
-rw-r--r--src/devices/bus/vic20/fe3.cpp4
-rw-r--r--src/devices/bus/vic20/fe3.h2
-rw-r--r--src/devices/bus/vic20/megacart.cpp3
-rw-r--r--src/devices/bus/vic20/megacart.h5
-rw-r--r--src/devices/bus/vic20/vic1110.cpp4
-rw-r--r--src/devices/bus/vic20/vic1110.h2
-rw-r--r--src/devices/bus/vic20/vic1111.cpp4
-rw-r--r--src/devices/bus/vic20/vic1111.h2
-rw-r--r--src/devices/bus/vic20/vic1210.cpp4
-rw-r--r--src/devices/bus/vic20/vic1210.h2
-rw-r--r--src/devices/bus/vic20/videopak.cpp7
-rw-r--r--src/devices/bus/vic20/videopak.h4
-rw-r--r--src/devices/bus/vip/vp570.cpp3
-rw-r--r--src/devices/bus/vip/vp570.h2
-rw-r--r--src/devices/bus/vip/vp590.cpp5
-rw-r--r--src/devices/bus/vip/vp590.h2
-rw-r--r--src/devices/bus/vtech/memexp/memory.cpp11
-rw-r--r--src/devices/bus/vtech/memexp/memory.h1
-rw-r--r--src/devices/bus/wangpc/emb.cpp5
-rw-r--r--src/devices/bus/wangpc/emb.h2
-rw-r--r--src/devices/bus/wangpc/lvc.cpp5
-rw-r--r--src/devices/bus/wangpc/lvc.h2
-rw-r--r--src/devices/bus/wangpc/mvc.cpp11
-rw-r--r--src/devices/bus/wangpc/mvc.h6
-rw-r--r--src/devices/bus/wangpc/rtc.cpp3
-rw-r--r--src/devices/bus/wangpc/rtc.h2
-rw-r--r--src/devices/bus/x68k/x68k_scsiext.cpp7
-rw-r--r--src/devices/cpu/dsp16/dsp16.cpp4
-rw-r--r--src/devices/cpu/m6805/m68705.cpp2
-rw-r--r--src/devices/cpu/m6805/m68hc05.cpp2
-rw-r--r--src/devices/machine/at28c16.cpp2
-rw-r--r--src/devices/machine/cs4031.cpp50
-rw-r--r--src/devices/machine/cs4031.h4
-rw-r--r--src/devices/machine/ds1386.cpp2
-rw-r--r--src/devices/machine/er1400.cpp2
-rw-r--r--src/devices/machine/er2055.cpp2
-rw-r--r--src/devices/machine/i82875p.cpp2
-rw-r--r--src/devices/machine/i8355.cpp2
-rw-r--r--src/devices/machine/mos6530n.cpp24
-rw-r--r--src/devices/machine/mos6530n.h10
-rw-r--r--src/devices/machine/rp5h01.cpp2
-rw-r--r--src/devices/machine/timekpr.cpp2
-rw-r--r--src/devices/machine/vt82c496.cpp143
-rw-r--r--src/devices/machine/vt82c496.h20
-rw-r--r--src/devices/machine/x2201.cpp4
-rw-r--r--src/devices/machine/x2212.cpp2
-rw-r--r--src/devices/sound/tms5110.cpp2
-rw-r--r--src/devices/video/ppu2c0x.cpp2
-rw-r--r--src/devices/video/t6963c.cpp2
-rw-r--r--src/emu/addrmap.cpp23
-rw-r--r--src/emu/devfind.cpp86
-rw-r--r--src/emu/devfind.h126
-rw-r--r--src/emu/diimage.cpp7
-rw-r--r--src/emu/diimage.h6
-rw-r--r--src/emu/dimemory.h2
-rw-r--r--src/emu/dirom.cpp6
-rw-r--r--src/emu/dirom.h2
-rw-r--r--src/emu/emufwd.h1
-rw-r--r--src/emu/emumem.cpp787
-rw-r--r--src/emu/emumem.h172
-rw-r--r--src/emu/emumem_hem.h8
-rw-r--r--src/emu/romload.cpp4
-rw-r--r--src/mame/audio/bally.cpp1
-rw-r--r--src/mame/audio/dcs.cpp10
-rw-r--r--src/mame/audio/dcs.h4
-rw-r--r--src/mame/audio/mario.cpp4
-rw-r--r--src/mame/drivers/3do.cpp2
-rw-r--r--src/mame/drivers/4enlinea.cpp2
-rw-r--r--src/mame/drivers/8080bw.cpp2
-rw-r--r--src/mame/drivers/a5105.cpp16
-rw-r--r--src/mame/drivers/a7150.cpp16
-rw-r--r--src/mame/drivers/aeroboto.cpp2
-rw-r--r--src/mame/drivers/alphasma.cpp2
-rw-r--r--src/mame/drivers/amiga.cpp2
-rw-r--r--src/mame/drivers/apc.cpp9
-rw-r--r--src/mame/drivers/apple2gs.cpp3
-rw-r--r--src/mame/drivers/apricotp.cpp11
-rw-r--r--src/mame/drivers/aquarius.cpp7
-rw-r--r--src/mame/drivers/aristmk4.cpp4
-rw-r--r--src/mame/drivers/arsystems.cpp20
-rw-r--r--src/mame/drivers/asteroid.cpp14
-rw-r--r--src/mame/drivers/at.cpp7
-rw-r--r--src/mame/drivers/atari400.cpp27
-rw-r--r--src/mame/drivers/aussiebyte.cpp64
-rw-r--r--src/mame/drivers/b2m.cpp16
-rw-r--r--src/mame/drivers/basic52.cpp6
-rw-r--r--src/mame/drivers/beathead.cpp2
-rw-r--r--src/mame/drivers/blitz68k.cpp6
-rw-r--r--src/mame/drivers/blmbycar.cpp6
-rw-r--r--src/mame/drivers/bmcbowl.cpp2
-rw-r--r--src/mame/drivers/bnstars.cpp14
-rw-r--r--src/mame/drivers/btime.cpp6
-rw-r--r--src/mame/drivers/buggychl.cpp2
-rw-r--r--src/mame/drivers/bw12.cpp24
-rw-r--r--src/mame/drivers/bwidow.cpp6
-rw-r--r--src/mame/drivers/bzone.cpp34
-rw-r--r--src/mame/drivers/c128.cpp7
-rw-r--r--src/mame/drivers/c64.cpp7
-rw-r--r--src/mame/drivers/cabaret.cpp2
-rw-r--r--src/mame/drivers/calchase.cpp2
-rw-r--r--src/mame/drivers/calorie.cpp3
-rw-r--r--src/mame/drivers/cbm2.cpp29
-rw-r--r--src/mame/drivers/cham24.cpp12
-rw-r--r--src/mame/drivers/chinagat.cpp2
-rw-r--r--src/mame/drivers/chsuper.cpp2
-rw-r--r--src/mame/drivers/cninja.cpp12
-rw-r--r--src/mame/drivers/combatsc.cpp2
-rw-r--r--src/mame/drivers/compis.cpp6
-rw-r--r--src/mame/drivers/coolridr.cpp8
-rw-r--r--src/mame/drivers/crshrace.cpp2
-rw-r--r--src/mame/drivers/cv1k.cpp8
-rw-r--r--src/mame/drivers/dccons.cpp2
-rw-r--r--src/mame/drivers/ddenlovr.cpp10
-rw-r--r--src/mame/drivers/deadang.cpp18
-rw-r--r--src/mame/drivers/dec0.cpp22
-rw-r--r--src/mame/drivers/dec8.cpp2
-rw-r--r--src/mame/drivers/decocass.cpp12
-rw-r--r--src/mame/drivers/dgn_beta.cpp1
-rw-r--r--src/mame/drivers/dgpix.cpp2
-rw-r--r--src/mame/drivers/diverboy.cpp4
-rw-r--r--src/mame/drivers/dkong.cpp38
-rw-r--r--src/mame/drivers/dreamwld.cpp4
-rw-r--r--src/mame/drivers/ec184x.cpp20
-rw-r--r--src/mame/drivers/elf.cpp6
-rw-r--r--src/mame/drivers/eolith16.cpp2
-rw-r--r--src/mame/drivers/excali64.cpp28
-rw-r--r--src/mame/drivers/exidy.cpp3
-rw-r--r--src/mame/drivers/exidy440.cpp2
-rw-r--r--src/mame/drivers/exp85.cpp4
-rw-r--r--src/mame/drivers/famibox.cpp12
-rw-r--r--src/mame/drivers/fastfred.cpp2
-rw-r--r--src/mame/drivers/fk1.cpp2
-rw-r--r--src/mame/drivers/fm7.cpp158
-rw-r--r--src/mame/drivers/fmtowns.cpp2
-rw-r--r--src/mame/drivers/fruitpc.cpp2
-rw-r--r--src/mame/drivers/galaxian.cpp22
-rw-r--r--src/mame/drivers/galaxold.cpp4
-rw-r--r--src/mame/drivers/galivan.cpp13
-rw-r--r--src/mame/drivers/gamate.cpp6
-rw-r--r--src/mame/drivers/gamecom.cpp12
-rw-r--r--src/mame/drivers/gba.cpp13
-rw-r--r--src/mame/drivers/ghosteo.cpp8
-rw-r--r--src/mame/drivers/gimix.cpp2
-rw-r--r--src/mame/drivers/gottlieb.cpp20
-rw-r--r--src/mame/drivers/gridcomp.cpp3
-rw-r--r--src/mame/drivers/gticlub.cpp118
-rw-r--r--src/mame/drivers/harddriv.cpp2
-rw-r--r--src/mame/drivers/hec2hrp.cpp87
-rw-r--r--src/mame/drivers/hng64.cpp82
-rw-r--r--src/mame/drivers/homelab.cpp35
-rw-r--r--src/mame/drivers/hornet.cpp4
-rw-r--r--src/mame/drivers/hp3478a.cpp5
-rw-r--r--src/mame/drivers/ibm6580.cpp5
-rw-r--r--src/mame/drivers/igspoker.cpp2
-rw-r--r--src/mame/drivers/indigo.cpp4
-rw-r--r--src/mame/drivers/irobot.cpp2
-rw-r--r--src/mame/drivers/itech32.cpp28
-rw-r--r--src/mame/drivers/itech8.cpp9
-rw-r--r--src/mame/drivers/jackie.cpp2
-rw-r--r--src/mame/drivers/jaguar.cpp2
-rw-r--r--src/mame/drivers/jalmah.cpp14
-rw-r--r--src/mame/drivers/jr100.cpp44
-rw-r--r--src/mame/drivers/jtc.cpp20
-rw-r--r--src/mame/drivers/jupace.cpp6
-rw-r--r--src/mame/drivers/kangaroo.cpp2
-rw-r--r--src/mame/drivers/kaypro.cpp43
-rw-r--r--src/mame/drivers/kinst.cpp6
-rw-r--r--src/mame/drivers/konamigs.cpp6
-rw-r--r--src/mame/drivers/kyocera.cpp88
-rw-r--r--src/mame/drivers/kyugo.cpp44
-rw-r--r--src/mame/drivers/lc80.cpp14
-rw-r--r--src/mame/drivers/leapster.cpp5
-rw-r--r--src/mame/drivers/leland.cpp19
-rw-r--r--src/mame/drivers/liberate.cpp2
-rw-r--r--src/mame/drivers/limenko.cpp9
-rw-r--r--src/mame/drivers/lisa.cpp4
-rw-r--r--src/mame/drivers/m20.cpp291
-rw-r--r--src/mame/drivers/m5.cpp60
-rw-r--r--src/mame/drivers/m72.cpp9
-rw-r--r--src/mame/drivers/magtouch.cpp2
-rw-r--r--src/mame/drivers/mbc200.cpp22
-rw-r--r--src/mame/drivers/mbc55x.cpp6
-rw-r--r--src/mame/drivers/mc1000.cpp46
-rw-r--r--src/mame/drivers/mc1502.cpp3
-rw-r--r--src/mame/drivers/mcr.cpp23
-rw-r--r--src/mame/drivers/megadriv_acbl.cpp4
-rw-r--r--src/mame/drivers/megatech.cpp3
-rw-r--r--src/mame/drivers/mhavoc.cpp4
-rw-r--r--src/mame/drivers/micronic.cpp2
-rw-r--r--src/mame/drivers/midzeus.cpp2
-rw-r--r--src/mame/drivers/model3.cpp20
-rw-r--r--src/mame/drivers/moo.cpp2
-rw-r--r--src/mame/drivers/mpu4vid.cpp8
-rw-r--r--src/mame/drivers/mpz80.cpp1
-rw-r--r--src/mame/drivers/mtouchxl.cpp4
-rw-r--r--src/mame/drivers/multigam.cpp60
-rw-r--r--src/mame/drivers/nanos.cpp4
-rw-r--r--src/mame/drivers/naomi.cpp8
-rw-r--r--src/mame/drivers/nc.cpp13
-rw-r--r--src/mame/drivers/neogeo.cpp5
-rw-r--r--src/mame/drivers/neogeocd.cpp8
-rw-r--r--src/mame/drivers/neopcb.cpp20
-rw-r--r--src/mame/drivers/nes.cpp3
-rw-r--r--src/mame/drivers/ngen.cpp5
-rw-r--r--src/mame/drivers/ngp.cpp6
-rw-r--r--src/mame/drivers/nmk16.cpp4
-rw-r--r--src/mame/drivers/nwk-tr.cpp4
-rw-r--r--src/mame/drivers/octopus.cpp8
-rw-r--r--src/mame/drivers/offtwall.cpp4
-rw-r--r--src/mame/drivers/ojankohs.cpp10
-rw-r--r--src/mame/drivers/omegrace.cpp2
-rw-r--r--src/mame/drivers/opwolf.cpp6
-rw-r--r--src/mame/drivers/osi.cpp8
-rw-r--r--src/mame/drivers/pacman.cpp31
-rw-r--r--src/mame/drivers/palm.cpp4
-rw-r--r--src/mame/drivers/pc1500.cpp14
-rw-r--r--src/mame/drivers/pc8001.cpp12
-rw-r--r--src/mame/drivers/pc8401a.cpp23
-rw-r--r--src/mame/drivers/pcat_nit.cpp29
-rw-r--r--src/mame/drivers/pce220.cpp4
-rw-r--r--src/mame/drivers/pda600.cpp14
-rw-r--r--src/mame/drivers/pet.cpp7
-rw-r--r--src/mame/drivers/pingpong.cpp53
-rw-r--r--src/mame/drivers/pipedrm.cpp3
-rw-r--r--src/mame/drivers/playch10.cpp286
-rw-r--r--src/mame/drivers/poisk1.cpp13
-rw-r--r--src/mame/drivers/prestige.cpp6
-rw-r--r--src/mame/drivers/ps2.cpp4
-rw-r--r--src/mame/drivers/psychic5.cpp2
-rw-r--r--src/mame/drivers/rohga.cpp2
-rw-r--r--src/mame/drivers/rollext.cpp2
-rw-r--r--src/mame/drivers/rt1715.cpp2
-rw-r--r--src/mame/drivers/scorpion.cpp2
-rw-r--r--src/mame/drivers/segas16b.cpp2
-rw-r--r--src/mame/drivers/segas32.cpp6
-rw-r--r--src/mame/drivers/seibuspi.cpp8
-rw-r--r--src/mame/drivers/sigmab98.cpp46
-rw-r--r--src/mame/drivers/socrates.cpp34
-rw-r--r--src/mame/drivers/sorcerer.cpp135
-rw-r--r--src/mame/drivers/srmp5.cpp4
-rw-r--r--src/mame/drivers/srmp6.cpp5
-rw-r--r--src/mame/drivers/ssv.cpp6
-rw-r--r--src/mame/drivers/starwars.cpp2
-rw-r--r--src/mame/drivers/subsino.cpp16
-rw-r--r--src/mame/drivers/sym1.cpp11
-rw-r--r--src/mame/drivers/symbolics.cpp3
-rw-r--r--src/mame/drivers/systec.cpp9
-rw-r--r--src/mame/drivers/tandy2k.cpp1
-rw-r--r--src/mame/drivers/tceptor.cpp6
-rw-r--r--src/mame/drivers/tempest.cpp2
-rw-r--r--src/mame/drivers/tigeroad.cpp2
-rw-r--r--src/mame/drivers/tiki100.cpp3
-rw-r--r--src/mame/drivers/timex.cpp76
-rw-r--r--src/mame/drivers/tmc1800.cpp2
-rw-r--r--src/mame/drivers/trackfld.cpp12
-rw-r--r--src/mame/drivers/triforce.cpp2
-rw-r--r--src/mame/drivers/trs80.cpp4
-rw-r--r--src/mame/drivers/trs80m2.cpp2
-rw-r--r--src/mame/drivers/tsamurai.cpp4
-rw-r--r--src/mame/drivers/tumbleb.cpp8
-rw-r--r--src/mame/drivers/tunhunt.cpp12
-rw-r--r--src/mame/drivers/tvc.cpp4
-rw-r--r--src/mame/drivers/twin16.cpp13
-rw-r--r--src/mame/drivers/unico.cpp2
-rw-r--r--src/mame/drivers/v1050.cpp18
-rw-r--r--src/mame/drivers/vamphalf.cpp25
-rw-r--r--src/mame/drivers/vegaeo.cpp8
-rw-r--r--src/mame/drivers/vic10.cpp7
-rw-r--r--src/mame/drivers/videopkr.cpp4
-rw-r--r--src/mame/drivers/voyager.cpp4
-rw-r--r--src/mame/drivers/vtech1.cpp84
-rw-r--r--src/mame/drivers/williams.cpp2
-rw-r--r--src/mame/drivers/x68k.cpp3
-rw-r--r--src/mame/drivers/xor100.cpp36
-rw-r--r--src/mame/drivers/zaurus.cpp2
-rw-r--r--src/mame/drivers/zr107.cpp108
-rw-r--r--src/mame/includes/3do.h4
-rw-r--r--src/mame/includes/abc80.h4
-rw-r--r--src/mame/includes/abc80x.h12
-rw-r--r--src/mame/includes/armedf.h2
-rw-r--r--src/mame/includes/asteroid.h6
-rw-r--r--src/mame/includes/atarigt.h2
-rw-r--r--src/mame/includes/aussiebyte.h15
-rw-r--r--src/mame/includes/beathead.h4
-rw-r--r--src/mame/includes/blockout.h2
-rw-r--r--src/mame/includes/btoads.h4
-rw-r--r--src/mame/includes/bw12.h4
-rw-r--r--src/mame/includes/bzone.h3
-rw-r--r--src/mame/includes/cninja.h1
-rw-r--r--src/mame/includes/comx35.h4
-rw-r--r--src/mame/includes/cps3.h2
-rw-r--r--src/mame/includes/dec0.h1
-rw-r--r--src/mame/includes/decocass.h3
-rw-r--r--src/mame/includes/dgn_beta.h2
-rw-r--r--src/mame/includes/dkong.h4
-rw-r--r--src/mame/includes/dragon.h8
-rw-r--r--src/mame/includes/efdt.h2
-rw-r--r--src/mame/includes/fantland.h4
-rw-r--r--src/mame/includes/fm7.h4
-rw-r--r--src/mame/includes/fromance.h6
-rw-r--r--src/mame/includes/fuukifg3.h4
-rw-r--r--src/mame/includes/gaelco3d.h2
-rw-r--r--src/mame/includes/galaxian.h3
-rw-r--r--src/mame/includes/galivan.h2
-rw-r--r--src/mame/includes/gamecom.h4
-rw-r--r--src/mame/includes/hec2hrp.h11
-rw-r--r--src/mame/includes/hng64.h8
-rw-r--r--src/mame/includes/itech32.h10
-rw-r--r--src/mame/includes/itech8.h3
-rw-r--r--src/mame/includes/jaguar.h2
-rw-r--r--src/mame/includes/kaypro.h8
-rw-r--r--src/mame/includes/konamigx.h8
-rw-r--r--src/mame/includes/kyocera.h12
-rw-r--r--src/mame/includes/kyugo.h3
-rw-r--r--src/mame/includes/leland.h6
-rw-r--r--src/mame/includes/lisa.h2
-rw-r--r--src/mame/includes/llc.h4
-rw-r--r--src/mame/includes/m92.h2
-rw-r--r--src/mame/includes/mac.h2
-rw-r--r--src/mame/includes/mbee.h3
-rw-r--r--src/mame/includes/mcr.h6
-rw-r--r--src/mame/includes/midtunit.h1
-rw-r--r--src/mame/includes/midvunit.h2
-rw-r--r--src/mame/includes/midyunit.h3
-rw-r--r--src/mame/includes/model3.h4
-rw-r--r--src/mame/includes/mpz80.h4
-rw-r--r--src/mame/includes/ms32.h16
-rw-r--r--src/mame/includes/mtx.h12
-rw-r--r--src/mame/includes/namcofl.h2
-rw-r--r--src/mame/includes/naomi.h4
-rw-r--r--src/mame/includes/nc.h3
-rw-r--r--src/mame/includes/neogeo.h5
-rw-r--r--src/mame/includes/nes.h4
-rw-r--r--src/mame/includes/offtwall.h4
-rw-r--r--src/mame/includes/ojankohs.h42
-rw-r--r--src/mame/includes/pacman.h3
-rw-r--r--src/mame/includes/pc1512.h4
-rw-r--r--src/mame/includes/pc8401a.h4
-rw-r--r--src/mame/includes/pingpong.h6
-rw-r--r--src/mame/includes/playch10.h26
-rw-r--r--src/mame/includes/psikyo.h2
-rw-r--r--src/mame/includes/qix.h4
-rw-r--r--src/mame/includes/saturn.h2
-rw-r--r--src/mame/includes/scramble.h5
-rw-r--r--src/mame/includes/seta2.h8
-rw-r--r--src/mame/includes/sorcerer.h6
-rw-r--r--src/mame/includes/suna8.h8
-rw-r--r--src/mame/includes/taito_f3.h12
-rw-r--r--src/mame/includes/tandy2k.h4
-rw-r--r--src/mame/includes/taotaido.h2
-rw-r--r--src/mame/includes/tiki100.h4
-rw-r--r--src/mame/includes/tmc1800.h4
-rw-r--r--src/mame/includes/tmc600.h4
-rw-r--r--src/mame/includes/toaplan1.h4
-rw-r--r--src/mame/includes/trs80m2.h4
-rw-r--r--src/mame/includes/twin16.h1
-rw-r--r--src/mame/includes/unico.h6
-rw-r--r--src/mame/includes/v1050.h4
-rw-r--r--src/mame/includes/vsnes.h3
-rw-r--r--src/mame/includes/xor100.h6
-rw-r--r--src/mame/includes/zaxxon.h4
-rw-r--r--src/mame/machine/315_5195.cpp55
-rw-r--r--src/mame/machine/315_5195.h8
-rw-r--r--src/mame/machine/abc1600mac.cpp8
-rw-r--r--src/mame/machine/abc1600mac.h4
-rw-r--r--src/mame/machine/advision.cpp2
-rw-r--r--src/mame/machine/asteroid.cpp11
-rw-r--r--src/mame/machine/b2m.cpp136
-rw-r--r--src/mame/machine/bebox.cpp8
-rw-r--r--src/mame/machine/dgn_beta.cpp3
-rw-r--r--src/mame/machine/dragon.cpp8
-rw-r--r--src/mame/machine/galaxy.cpp11
-rw-r--r--src/mame/machine/gamecom.cpp2
-rw-r--r--src/mame/machine/hp48.cpp32
-rw-r--r--src/mame/machine/kc.cpp43
-rw-r--r--src/mame/machine/llc.cpp33
-rw-r--r--src/mame/machine/lviv.cpp6
-rw-r--r--src/mame/machine/m20_8086.cpp3
-rw-r--r--src/mame/machine/mac.cpp52
-rw-r--r--src/mame/machine/mbee.cpp37
-rw-r--r--src/mame/machine/mc8123.cpp2
-rw-r--r--src/mame/machine/mega32x.cpp7
-rw-r--r--src/mame/machine/mega32x.h1
-rw-r--r--src/mame/machine/midtunit.cpp19
-rw-r--r--src/mame/machine/midyunit.cpp12
-rw-r--r--src/mame/machine/mtx.cpp72
-rw-r--r--src/mame/machine/nes.cpp6
-rw-r--r--src/mame/machine/ondra.cpp4
-rw-r--r--src/mame/machine/orion.cpp22
-rw-r--r--src/mame/machine/partner.cpp22
-rw-r--r--src/mame/machine/pc1350.cpp9
-rw-r--r--src/mame/machine/pecom.cpp12
-rw-r--r--src/mame/machine/playch10.cpp49
-rw-r--r--src/mame/machine/pmd85.cpp28
-rw-r--r--src/mame/machine/pp01.cpp11
-rw-r--r--src/mame/machine/primo.cpp2
-rw-r--r--src/mame/machine/rmnimbus.cpp2
-rw-r--r--src/mame/machine/scramble.cpp9
-rw-r--r--src/mame/machine/special.cpp22
-rw-r--r--src/mame/machine/ti85.cpp2
-rw-r--r--src/mame/machine/vsnes.cpp26
-rw-r--r--src/mame/video/abc80.cpp3
-rw-r--r--src/mame/video/abc800.cpp4
-rw-r--r--src/mame/video/abc802.cpp3
-rw-r--r--src/mame/video/abc806.cpp7
-rw-r--r--src/mame/video/atarimo.cpp7
-rw-r--r--src/mame/video/atarimo.h19
-rw-r--r--src/mame/video/avgdvg.cpp4
-rw-r--r--src/mame/video/comx35.cpp2
-rw-r--r--src/mame/video/dgn_beta.cpp2
-rw-r--r--src/mame/video/fm7.cpp151
-rw-r--r--src/mame/video/fromance.cpp4
-rw-r--r--src/mame/video/igs017_igs031.cpp8
-rw-r--r--src/mame/video/kaypro.cpp23
-rw-r--r--src/mame/video/ojankohs.cpp8
-rw-r--r--src/mame/video/pc1512.cpp2
-rw-r--r--src/mame/video/qix.cpp3
-rw-r--r--src/mame/video/suna8.cpp3
-rw-r--r--src/mame/video/tc0150rod.cpp2
-rw-r--r--src/mame/video/tmc600.cpp3
-rw-r--r--src/mame/video/toaplan1.cpp15
-rw-r--r--src/mame/video/v1050.cpp3
-rw-r--r--src/mame/video/zaxxon.cpp3
563 files changed, 3468 insertions, 4129 deletions
diff --git a/docs/source/techspecs/index.rst b/docs/source/techspecs/index.rst
index 67775ae3a74..b23b74834cc 100644
--- a/docs/source/techspecs/index.rst
+++ b/docs/source/techspecs/index.rst
@@ -10,6 +10,7 @@ This section covers technical specifications useful to programmers working on MA
device_memory_interface
device_rom_interface
device_disasm_interface
+ memory
floppy
nscsi
luaengine
diff --git a/docs/source/techspecs/memory.rst b/docs/source/techspecs/memory.rst
new file mode 100644
index 00000000000..c078aa016c7
--- /dev/null
+++ b/docs/source/techspecs/memory.rst
@@ -0,0 +1,167 @@
+Emulated system memory and address spaces management
+====================================================
+
+1. Overview
+-----------
+
+The memory subsystem (emumem and addrmap) combines multiple functions
+useful for system emulation:
+* address bus decoding and dispatching with caching
+* static descriptions of an address map
+* ram allocation and registration for state saving
+* interaction with memory regions to access rom
+
+Devices create address spaces, e.g. decodable buses, through the
+device_memory_interface. The machine configuration sets up address
+maps to put in the address spaces, then the device can do read and
+writes through the bus.
+
+2. Basic concepts
+-----------------
+
+2.1 Address spaces
+~~~~~~~~~~~~~~~~~~
+
+An address space, implemented in the class **address_space**,
+represents an addressable bus with potentially multiple sub-devices
+connected requiring a decode. It has a number of data lines (8, 16,
+32 or 64) called data width, a number of address lines (1 to 32)
+called address width and an endianness. In addition an address shift
+allows for buses that have an atomic granularity different than a
+byte.
+
+Address space objects provide a series of methods for read and write
+access, and a second series of methods for dynamically changing the
+decode.
+
+
+2.2 Address maps
+~~~~~~~~~~~~~~~~
+
+An address map is a static description of the decode expected when
+using a bus. It connects to memory, other devices and methods, and is
+installed, usually at startup, in an address space. That description
+is stored in an **address_map** structure which is filled
+programatically.
+
+
+2.3 Shares, banks and regions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Memory shares are allocated memory zones that can be put in multiple
+places in the same or different address spaces, and can also be
+directly accessed from devices.
+
+Memory banks are zones that indirect memory access, giving the
+possibility to dynamically and efficiently change where a zone
+actually points to.
+
+Memory regions are read-only memory zones in which roms are loaded.
+
+
+3. Address maps API
+-------------------
+
+3.1 General API structure
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A memory is a method of a device which fills an **address_map**
+structure, usually called **map**, passed by reference. The method
+then can set some global configuration through specific methods and
+then provide address range-oriented entries which indicate what should
+happen when a specific range is accessed.
+
+The general syntax for entries uses method chaining:
+
+| map(start, end).handler(...).handler_qualifier(...).range_qualifier();
+
+The values start and end define the range, the handler() block defines
+how the access is handled, the handler_qualifier() block specifies
+some aspects of the handler (memory sharing for instance) and the
+range_qualifier() block refines the range (mirroring, masking, byte
+selection...).
+
+3.2 Global configurations
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+3.2.1 Global masking
+''''''''''''''''''''
+
+| map.global_mask(offs_t mask);
+
+Allows to indicates a mask to be applied to all addresses when
+accessing the space that map is installed in.
+
+
+3.2.2 Returned value on unmapped/nop-ed read
+''''''''''''''''''''''''''''''''''''''''''''
+
+| map.unmap_value_low();
+| map.unmap_value_high();
+| map.unmap_value(u8 value);
+
+Sets the value to return on reads to an unmapped or nopped-out
+address. Low means 0, high ~0.
+
+3.3 Handler setting
+~~~~~~~~~~~~~~~~~~~
+
+3.3.1 Method on the current device
+''''''''''''''''''''''''''''''''''
+
+| (...).r(FUNC(my_device::read_method))
+| (...).w(FUNC(my_device::write_method))
+| (...).rw(FUNC(my_device::read_method), FUNC(my_device::write_method))
+|
+| uNN my_device::read_method(address_space &space, offs_t offset, uNN mem_mask)
+| uNN my_device::read_method(address_space &space, offs_t offset)
+| uNN my_device::read_method(address_space &space)
+| uNN my_device::read_method(offs_t offset, uNN mem_mask)
+| uNN my_device::read_method(offs_t offset)
+| uNN my_device::read_method()
+|
+| void my_device::write_method(address_space &space, offs_t offset, uNN data, uNN mem_mask)
+| void my_device::write_method(address_space &space, offs_t offset, uNN data)
+| void my_device::write_method(address_space &space, uNN data)
+| void my_device::write_method(offs_t offset, uNN data, uNN mem_mask)
+| void my_device::write_method(offs_t offset, uNN data)
+| void my_device::write_method(uNN data)
+
+Sets a method of the current device to read, write or both for the
+current entry. The prototype of the method can take multiple forms
+making some elements optional. uNN represents u8, u16, u32 or u64
+depending on the data width of the handler. The handler can be less
+wide than the bus itself (for instance a 8-bits device on a 32-bits
+bus).
+
+3.3.2 Method on a different device
+''''''''''''''''''''''''''''''''''
+
+| (...).r(m_other_device, FUNC(other_device::read_method))
+| (...).r("other-device-tag", FUNC(other_device::read_method))
+| (...).w(m_other_device, FUNC(other_device::write_method))
+| (...).w("other-device-tag", FUNC(other_device::write_method))
+| (...).rw(m_other_device, FUNC(other_device::read_method), FUNC(other_device::write_method))
+| (...).rw("other-device-tag", FUNC(other_device::read_method), FUNC(other_device::write_method))
+
+Sets a method of another device, designated by a finder
+(required_device or optional_device) or its tag, to read, write or
+both for the current entry.
+
+3.3.3 Lambda function
+'''''''''''''''''''''
+
+| (...).lr{8,16,32,64}(FUNC([...](address_space &space, offs_t offset, uNN mem_mask) -> uNN { ... }))
+| (...).lr{8,16,32,64}([...](address_space &space, offs_t offset, uNN mem_mask) -> uNN { ... }, "name")
+| (...).lw{8,16,32,64}(FUNC([...](address_space &space, offs_t offset, uNN data, uNN mem_mask) -> void { ... }))
+| (...).lw{8,16,32,64}([...](address_space &space, offs_t offset, uNN data, uNN mem_mask) -> void { ... }, "name")
+| (...).lrw{8,16,32,64}(FUNC(read), FUNC(write))
+| (...).lrw{8,16,32,64}(read, "name_r", write, "name_w")
+
+Sets a lambda called on read, write or both. The lambda prototype can
+be any of the 6 available for methods. One can either use FUNC() over
+the whole lambda or provide a name after the lambda definition.
+
+3.3.4 Direct memory access
+''''''''''''''''''''''''''
+
diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp
index bdb34f81846..ff7075e0e86 100644
--- a/src/devices/bus/a1bus/a1bus.cpp
+++ b/src/devices/bus/a1bus/a1bus.cpp
@@ -129,11 +129,10 @@ void a1bus_device::install_device(offs_t start, offs_t end, read8_delegate rhand
m_space->install_readwrite_handler(start, end, rhandler, whandler);
}
-void a1bus_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void a1bus_device::install_bank(offs_t start, offs_t end, uint8_t *data)
{
// printf("install_bank: %s @ %x->%x\n", tag, start, end);
- m_space->install_readwrite_bank(start, end, tag);
- machine().root_device().membank(siblingtag(tag).c_str())->set_base(data);
+ m_space->install_ram(start, end, data);
}
// interrupt request from a1bus card
@@ -195,7 +194,7 @@ void device_a1bus_card_interface::install_device(offs_t start, offs_t end, read8
m_a1bus->install_device(start, end, rhandler, whandler);
}
-void device_a1bus_card_interface::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void device_a1bus_card_interface::install_bank(offs_t start, offs_t end, uint8_t *data)
{
- m_a1bus->install_bank(start, end, tag, data);
+ m_a1bus->install_bank(start, end, data);
}
diff --git a/src/devices/bus/a1bus/a1bus.h b/src/devices/bus/a1bus/a1bus.h
index 32345620b86..28a95070ad6 100644
--- a/src/devices/bus/a1bus/a1bus.h
+++ b/src/devices/bus/a1bus/a1bus.h
@@ -69,7 +69,7 @@ public:
void set_nmi_line(int state);
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
DECLARE_WRITE_LINE_MEMBER( irq_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
@@ -118,7 +118,7 @@ protected:
void lower_slot_nmi() { m_a1bus->set_nmi_line(CLEAR_LINE); }
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
device_a1bus_card_interface(const machine_config &mconfig, device_t &device);
diff --git a/src/devices/bus/a1bus/a1cassette.cpp b/src/devices/bus/a1bus/a1cassette.cpp
index fc470ef7f94..ed4dbad0389 100644
--- a/src/devices/bus/a1bus/a1cassette.cpp
+++ b/src/devices/bus/a1bus/a1cassette.cpp
@@ -73,7 +73,7 @@ a1bus_cassette_device::a1bus_cassette_device(const machine_config &mconfig, devi
void a1bus_cassette_device::device_start()
{
install_device(0xc000, 0xc0ff, read8_delegate(*this, FUNC(a1bus_cassette_device::cassette_r)), write8_delegate(*this, FUNC(a1bus_cassette_device::cassette_w)));
- install_bank(0xc100, 0xc1ff, "bank_a1cas", &m_rom[0]);
+ install_bank(0xc100, 0xc1ff, &m_rom[0]);
save_item(NAME(m_cassette_output_flipflop));
}
diff --git a/src/devices/bus/a1bus/a1cffa.cpp b/src/devices/bus/a1bus/a1cffa.cpp
index 8c68e818531..52bc9fa0081 100644
--- a/src/devices/bus/a1bus/a1cffa.cpp
+++ b/src/devices/bus/a1bus/a1cffa.cpp
@@ -69,7 +69,7 @@ a1bus_cffa_device::a1bus_cffa_device(const machine_config &mconfig, device_type
void a1bus_cffa_device::device_start()
{
install_device(0xafe0, 0xafff, read8_delegate(*this, FUNC(a1bus_cffa_device::cffa_r)), write8_delegate(*this, FUNC(a1bus_cffa_device::cffa_w)));
- install_bank(0x9000, 0xafdf, "bank_cffa1", &m_rom[0]);
+ install_bank(0x9000, 0xafdf, &m_rom[0]);
save_item(NAME(m_lastdata));
save_item(NAME(m_writeprotect));
diff --git a/src/devices/bus/abcbus/ram.cpp b/src/devices/bus/abcbus/ram.cpp
index 4886f46defa..563964041c5 100644
--- a/src/devices/bus/abcbus/ram.cpp
+++ b/src/devices/bus/abcbus/ram.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(ABC80_16KB_RAM_CARD, abc80_16kb_ram_card_device, "abc80_16kb"
abc80_16kb_ram_card_device::abc80_16kb_ram_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ABC80_16KB_RAM_CARD, tag, owner, clock),
device_abcbus_card_interface(mconfig, *this),
- m_ram(*this, "ram")
+ m_ram(*this, "ram", 0x4000, ENDIANNESS_LITTLE)
{
}
@@ -41,7 +41,6 @@ abc80_16kb_ram_card_device::abc80_16kb_ram_card_device(const machine_config &mco
void abc80_16kb_ram_card_device::device_start()
{
- m_ram.allocate(0x4000);
}
diff --git a/src/devices/bus/abcbus/ram.h b/src/devices/bus/abcbus/ram.h
index cddb07182c7..ddb191cd5cf 100644
--- a/src/devices/bus/abcbus/ram.h
+++ b/src/devices/bus/abcbus/ram.h
@@ -37,7 +37,7 @@ protected:
virtual void abcbus_xmemw(offs_t offset, uint8_t data) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/abcbus/ssa.cpp b/src/devices/bus/abcbus/ssa.cpp
index 3de6119a3d9..bc15c0852cb 100644
--- a/src/devices/bus/abcbus/ssa.cpp
+++ b/src/devices/bus/abcbus/ssa.cpp
@@ -121,7 +121,7 @@ abc_super_smartaid_device::abc_super_smartaid_device(const machine_config &mconf
m_rom_1(*this, "ssa1"),
m_rom_2(*this, "ssa2"),
m_prom(*this, "ssa3"),
- m_nvram(*this, "nvram"),
+ m_nvram(*this, "nvram", 0x800, ENDIANNESS_LITTLE),
m_rom_bank(0),
m_prom_bank(0)
{
@@ -144,9 +144,6 @@ void abc_super_smartaid_device::device_start()
m_rom_2->base()[i] = bitswap<8>(m_rom_2->base()[i], 2, 6, 1, 4, 3, 5, 7, 0);
}
- // allocate memory
- m_nvram.allocate(0x800);
-
// state saving
save_item(NAME(m_rom_bank));
save_item(NAME(m_prom_bank));
diff --git a/src/devices/bus/abcbus/ssa.h b/src/devices/bus/abcbus/ssa.h
index 7de5ade5950..2eceb3ad0dd 100644
--- a/src/devices/bus/abcbus/ssa.h
+++ b/src/devices/bus/abcbus/ssa.h
@@ -41,8 +41,8 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
- virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.share()->bytes()); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.share()->bytes()); } }
// device_abcbus_interface overrides
virtual void abcbus_cs(uint8_t data) override { m_bus->write_cs(data); }
@@ -61,7 +61,7 @@ private:
required_memory_region m_rom_1;
required_memory_region m_rom_2;
required_memory_region m_prom;
- optional_shared_ptr<uint8_t> m_nvram;
+ memory_share_creator<uint8_t> m_nvram;
uint8_t m_rom_bank;
uint8_t m_prom_bank;
};
diff --git a/src/devices/bus/acorn/atom/discpack.cpp b/src/devices/bus/acorn/atom/discpack.cpp
index dd8d3021301..c7010454e78 100644
--- a/src/devices/bus/acorn/atom/discpack.cpp
+++ b/src/devices/bus/acorn/atom/discpack.cpp
@@ -85,10 +85,11 @@ void atom_discpack_device::device_start()
space.install_device(0x0a00, 0x0a03, *m_fdc, &i8271_device::map);
space.install_readwrite_handler(0x0a04, 0x0a04, 0, 0x1f8, 0, read8smo_delegate(*m_fdc, FUNC(i8271_device::data_r)), write8smo_delegate(*m_fdc, FUNC(i8271_device::data_w)));
- space.install_ram(0x2000, 0x23ff);
- space.install_ram(0x2400, 0x27ff);
- space.install_ram(0x3c00, 0x3fff);
+ space.install_ram(0x2000, 0x27ff, m_ram);
+ space.install_ram(0x3c00, 0x3fff, m_ram+0x800);
space.install_rom(0xe000, 0xefff, m_dos_rom->base());
+
+ save_item(NAME(m_ram));
}
diff --git a/src/devices/bus/acorn/atom/discpack.h b/src/devices/bus/acorn/atom/discpack.h
index 3f06870f87c..a55abce3278 100644
--- a/src/devices/bus/acorn/atom/discpack.h
+++ b/src/devices/bus/acorn/atom/discpack.h
@@ -47,6 +47,8 @@ private:
required_memory_region m_dos_rom;
required_device<i8271_device> m_fdc;
required_device_array<floppy_connector, 2> m_floppy;
+
+ u8 m_ram[0x800 + 0x400];
};
diff --git a/src/devices/bus/acorn/system/32k.cpp b/src/devices/bus/acorn/system/32k.cpp
index c74d60cc863..00eb80050e9 100644
--- a/src/devices/bus/acorn/system/32k.cpp
+++ b/src/devices/bus/acorn/system/32k.cpp
@@ -73,6 +73,7 @@ acorn_32k_device::acorn_32k_device(const machine_config &mconfig, const char *ta
void acorn_32k_device::device_start()
{
+ save_item(NAME(m_ram));
}
//-------------------------------------------------
@@ -85,11 +86,11 @@ void acorn_32k_device::device_reset()
if (m_links->read())
{
- space.install_ram(0x8000, 0xbfff);
+ space.install_ram(0x8000, 0xbfff, m_ram);
}
else
{
- space.install_ram(0x2000, 0x7fff);
- space.install_ram(0xc000, 0xdfff);
+ space.install_ram(0x2000, 0x7fff, m_ram);
+ space.install_ram(0xc000, 0xdfff, m_ram + 0x6000);
}
}
diff --git a/src/devices/bus/acorn/system/32k.h b/src/devices/bus/acorn/system/32k.h
index 0ef4c10f3c3..f3d3b76be5c 100644
--- a/src/devices/bus/acorn/system/32k.h
+++ b/src/devices/bus/acorn/system/32k.h
@@ -38,6 +38,7 @@ protected:
private:
required_ioport m_links;
+ u8 m_ram[32768];
};
diff --git a/src/devices/bus/acorn/system/8k.cpp b/src/devices/bus/acorn/system/8k.cpp
index 97939b7362f..ecbd69c930f 100644
--- a/src/devices/bus/acorn/system/8k.cpp
+++ b/src/devices/bus/acorn/system/8k.cpp
@@ -98,6 +98,7 @@ acorn_8k_device::acorn_8k_device(const machine_config &mconfig, const char *tag,
void acorn_8k_device::device_start()
{
+ save_item(NAME(m_ram));
}
//-------------------------------------------------
@@ -112,11 +113,11 @@ void acorn_8k_device::device_reset()
if (ram_addr == 0x0000) // BLK0
{
- space.install_ram(0x1000, 0x1fff);
+ space.install_ram(0x1000, 0x1fff, m_ram);
}
else
{
- space.install_ram(ram_addr, ram_addr + 0x1fff);
+ space.install_ram(ram_addr, ram_addr + 0x1fff, m_ram);
}
uint16_t rom_addr = (m_links->read() & 0xf0) << 9;
diff --git a/src/devices/bus/acorn/system/8k.h b/src/devices/bus/acorn/system/8k.h
index 125b636cd5b..09f089c1563 100644
--- a/src/devices/bus/acorn/system/8k.h
+++ b/src/devices/bus/acorn/system/8k.h
@@ -47,6 +47,7 @@ private:
required_device_array<generic_slot_device, 2> m_rom;
required_ioport m_links;
+ u8 m_ram[8192];
};
diff --git a/src/devices/bus/adam/exp.cpp b/src/devices/bus/adam/exp.cpp
index a6c8b777402..59c677144f3 100644
--- a/src/devices/bus/adam/exp.cpp
+++ b/src/devices/bus/adam/exp.cpp
@@ -36,8 +36,7 @@ DEFINE_DEVICE_TYPE(ADAM_EXPANSION_SLOT, adam_expansion_slot_device, "adam_expans
//-------------------------------------------------
device_adam_expansion_slot_card_interface::device_adam_expansion_slot_card_interface(const machine_config &mconfig, device_t &device) :
- device_interface(device, "adamexp"),
- m_rom(*this, "rom")
+ device_interface(device, "adamexp")
{
m_slot = dynamic_cast<adam_expansion_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h
index 69ed921d5d5..ee74bf0396a 100644
--- a/src/devices/bus/adam/exp.h
+++ b/src/devices/bus/adam/exp.h
@@ -100,7 +100,7 @@ protected:
adam_expansion_slot_device *m_slot;
- optional_shared_ptr<uint8_t> m_rom;
+ std::unique_ptr<uint8_t[]> m_rom;
};
diff --git a/src/devices/bus/adam/ram.cpp b/src/devices/bus/adam/ram.cpp
index a7e79719867..65dc13f2246 100644
--- a/src/devices/bus/adam/ram.cpp
+++ b/src/devices/bus/adam/ram.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(ADAM_RAM, adam_ram_expansion_device, "adam_ram", "Adam 64KB R
adam_ram_expansion_device::adam_ram_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ADAM_RAM, tag, owner, clock),
device_adam_expansion_slot_card_interface(mconfig, *this),
- m_ram(*this, "ram")
+ m_ram(*this, "ram", 0x10000, ENDIANNESS_LITTLE)
{
}
@@ -41,7 +41,6 @@ adam_ram_expansion_device::adam_ram_expansion_device(const machine_config &mconf
void adam_ram_expansion_device::device_start()
{
- m_ram.allocate(0x10000);
}
diff --git a/src/devices/bus/adam/ram.h b/src/devices/bus/adam/ram.h
index 780d51be726..c1997bf77c4 100644
--- a/src/devices/bus/adam/ram.h
+++ b/src/devices/bus/adam/ram.h
@@ -37,7 +37,7 @@ protected:
virtual void adam_bd_w(offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/bw2/ramcard.cpp b/src/devices/bus/bw2/ramcard.cpp
index 48de6cffdec..939d477384e 100644
--- a/src/devices/bus/bw2/ramcard.cpp
+++ b/src/devices/bus/bw2/ramcard.cpp
@@ -51,7 +51,7 @@ bw2_ramcard_device::bw2_ramcard_device(const machine_config &mconfig, const char
: device_t(mconfig, BW2_RAMCARD, tag, owner, clock),
device_bw2_expansion_slot_interface(mconfig, *this),
m_rom(*this, "ramcard"),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 512*1024, ENDIANNESS_LITTLE),
m_en(0),
m_bank(0)
{
@@ -64,9 +64,6 @@ bw2_ramcard_device::bw2_ramcard_device(const machine_config &mconfig, const char
void bw2_ramcard_device::device_start()
{
- // allocate memory
- m_ram.allocate(512 * 1024);
-
// state saving
save_item(NAME(m_en));
save_item(NAME(m_bank));
diff --git a/src/devices/bus/bw2/ramcard.h b/src/devices/bus/bw2/ramcard.h
index 029d9b91feb..f3cd95f38d4 100644
--- a/src/devices/bus/bw2/ramcard.h
+++ b/src/devices/bus/bw2/ramcard.h
@@ -43,7 +43,7 @@ protected:
private:
required_memory_region m_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
int m_en;
uint8_t m_bank;
diff --git a/src/devices/bus/c64/c128_partner.cpp b/src/devices/bus/c64/c128_partner.cpp
index 91b7cf751ab..808926d8583 100644
--- a/src/devices/bus/c64/c128_partner.cpp
+++ b/src/devices/bus/c64/c128_partner.cpp
@@ -80,7 +80,8 @@ ioport_constructor c128_partner_cartridge_device::device_input_ports() const
c128_partner_cartridge_device::c128_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, C128_PARTNER, tag, owner, clock),
device_c64_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"), t_joyb2(nullptr),
+ m_ram(*this, "ram", 0x2000, ENDIANNESS_LITTLE),
+ t_joyb2(nullptr),
m_ram_a12_a7(0),
m_ls74_cd(0),
m_ls74_q1(0),
@@ -96,9 +97,6 @@ c128_partner_cartridge_device::c128_partner_cartridge_device(const machine_confi
void c128_partner_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x2000);
-
// simulate the 16.7ms pulse from CIA1 PB2 that would arrive thru the joystick port dongle
t_joyb2 = timer_alloc();
t_joyb2->adjust(attotime::from_msec(16), 0, attotime::from_msec(16));
diff --git a/src/devices/bus/c64/c128_partner.h b/src/devices/bus/c64/c128_partner.h
index 1f4402d5b22..da906531122 100644
--- a/src/devices/bus/c64/c128_partner.h
+++ b/src/devices/bus/c64/c128_partner.h
@@ -49,7 +49,7 @@ protected:
virtual void vcs_joy_w(uint8_t data);
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
emu_timer *t_joyb2;
int m_ram_a12_a7;
diff --git a/src/devices/bus/c64/dqbb.cpp b/src/devices/bus/c64/dqbb.cpp
index 20adedd9057..6f7e2bf7dab 100644
--- a/src/devices/bus/c64/dqbb.cpp
+++ b/src/devices/bus/c64/dqbb.cpp
@@ -53,7 +53,8 @@ c64_dqbb_cartridge_device::c64_dqbb_cartridge_device(const machine_config &mconf
void c64_dqbb_cartridge_device::device_start()
{
// allocate memory
- m_nvram.allocate(0x4000);
+ m_nvram = std::make_unique<uint8_t[]>(0x4000);
+ save_pointer(NAME(m_nvram.get()), 0x4000);
// state saving
save_item(NAME(m_cs));
diff --git a/src/devices/bus/c64/dqbb.h b/src/devices/bus/c64/dqbb.h
index aaa8c0e1bf4..af9460a5bbe 100644
--- a/src/devices/bus/c64/dqbb.h
+++ b/src/devices/bus/c64/dqbb.h
@@ -38,8 +38,8 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
- virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram.get(), 0x4000); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram.get(), 0x4000); } }
// device_c64_expansion_card_interface overrides
virtual uint8_t c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override;
diff --git a/src/devices/bus/c64/easyflash.cpp b/src/devices/bus/c64/easyflash.cpp
index 38cdf9739c6..eab9ff7930a 100644
--- a/src/devices/bus/c64/easyflash.cpp
+++ b/src/devices/bus/c64/easyflash.cpp
@@ -77,7 +77,7 @@ c64_easyflash_cartridge_device::c64_easyflash_cartridge_device(const machine_con
m_flash_roml(*this, AM29F040_0_TAG),
m_flash_romh(*this, AM29F040_1_TAG),
m_jp1(*this, "JP1"),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x100, ENDIANNESS_LITTLE),
m_bank(0),
m_mode(0)
{
@@ -90,9 +90,6 @@ c64_easyflash_cartridge_device::c64_easyflash_cartridge_device(const machine_con
void c64_easyflash_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x100);
-
// state saving
save_item(NAME(m_bank));
save_item(NAME(m_mode));
diff --git a/src/devices/bus/c64/easyflash.h b/src/devices/bus/c64/easyflash.h
index 377de25d50d..6c73a14838a 100644
--- a/src/devices/bus/c64/easyflash.h
+++ b/src/devices/bus/c64/easyflash.h
@@ -49,7 +49,7 @@ private:
required_device<amd_29f040_device> m_flash_roml;
required_device<amd_29f040_device> m_flash_romh;
required_ioport m_jp1;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_bank;
uint8_t m_mode;
diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp
index 3c5663db036..8304a7be6b7 100644
--- a/src/devices/bus/c64/exp.cpp
+++ b/src/devices/bus/c64/exp.cpp
@@ -29,10 +29,6 @@ DEFINE_DEVICE_TYPE(C64_EXPANSION_SLOT, c64_expansion_slot_device, "c64_expansion
device_c64_expansion_card_interface::device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "c64exp"),
- m_roml(*this, "roml"),
- m_romh(*this, "romh"),
- m_romx(*this, "romx"),
- m_nvram(*this, "nvram"),
m_game(1),
m_exrom(1)
{
@@ -148,11 +144,11 @@ image_init_result c64_expansion_slot_device::call_load()
uint8_t *roml = nullptr;
uint8_t *romh = nullptr;
- m_card->m_roml.allocate(roml_size);
- m_card->m_romh.allocate(romh_size);
+ m_card->m_roml = std::make_unique<uint8_t[]>(roml_size);
+ m_card->m_romh = std::make_unique<uint8_t[]>(romh_size);
- if (roml_size) roml = m_card->m_roml;
- if (romh_size) romh = m_card->m_roml;
+ if (roml_size) roml = m_card->m_roml.get();
+ if (romh_size) romh = m_card->m_romh.get();
cbm_crt_read_data(image_core_file(), roml, romh);
}
diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h
index 2507227d724..29e79fb1ff8 100644
--- a/src/devices/bus/c64/exp.h
+++ b/src/devices/bus/c64/exp.h
@@ -148,10 +148,10 @@ public:
protected:
device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_roml;
- optional_shared_ptr<uint8_t> m_romh;
- optional_shared_ptr<uint8_t> m_romx;
- optional_shared_ptr<uint8_t> m_nvram;
+ std::unique_ptr<uint8_t[]> m_roml;
+ std::unique_ptr<uint8_t[]> m_romh;
+ std::unique_ptr<uint8_t[]> m_romx;
+ std::unique_ptr<uint8_t[]> m_nvram;
int m_game;
int m_exrom;
diff --git a/src/devices/bus/c64/fcc.cpp b/src/devices/bus/c64/fcc.cpp
index 405c1761a2e..13b42122a03 100644
--- a/src/devices/bus/c64/fcc.cpp
+++ b/src/devices/bus/c64/fcc.cpp
@@ -97,6 +97,7 @@ c64_final_chesscard_device::c64_final_chesscard_device(const machine_config &mco
void c64_final_chesscard_device::device_start()
{
+ m_nvram = std::make_unique<uint8_t[]>(0x2000);
// state saving
save_item(NAME(m_bank));
save_item(NAME(m_hidden));
diff --git a/src/devices/bus/c64/fcc.h b/src/devices/bus/c64/fcc.h
index 3c3aa02881d..67922eafeca 100644
--- a/src/devices/bus/c64/fcc.h
+++ b/src/devices/bus/c64/fcc.h
@@ -42,8 +42,8 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
- virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram.get(), 0x2000); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram.get(), 0x2000); } }
// device_c64_expansion_card_interface overrides
virtual uint8_t c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override;
@@ -59,8 +59,8 @@ private:
DECLARE_WRITE_LINE_MEMBER(mainlatch_int) { m_slot->nmi_w(state); }
DECLARE_READ8_MEMBER(rom_r) { return m_romx[offset]; } // cartridge cpu rom
- DECLARE_READ8_MEMBER(nvram_r) { return m_nvram[offset & m_nvram.mask()]; }
- DECLARE_WRITE8_MEMBER(nvram_w) { m_nvram[offset & m_nvram.mask()] = data; }
+ DECLARE_READ8_MEMBER(nvram_r) { return m_nvram[offset]; }
+ DECLARE_WRITE8_MEMBER(nvram_w) { m_nvram[offset] = data; }
void c64_fcc_map(address_map &map);
};
diff --git a/src/devices/bus/c64/georam.cpp b/src/devices/bus/c64/georam.cpp
index 6bf8a16a1d8..377bc10a391 100644
--- a/src/devices/bus/c64/georam.cpp
+++ b/src/devices/bus/c64/georam.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(C64_GEORAM, c64_georam_cartridge_device, "c64_georam", "C64 G
c64_georam_cartridge_device::c64_georam_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, C64_GEORAM, tag, owner, clock),
device_c64_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x80000, ENDIANNESS_LITTLE),
m_bank(0)
{
}
@@ -42,9 +42,6 @@ c64_georam_cartridge_device::c64_georam_cartridge_device(const machine_config &m
void c64_georam_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x80000);
-
// state saving
save_item(NAME(m_bank));
}
diff --git a/src/devices/bus/c64/georam.h b/src/devices/bus/c64/georam.h
index 03967625c23..41b7fd82379 100644
--- a/src/devices/bus/c64/georam.h
+++ b/src/devices/bus/c64/georam.h
@@ -39,7 +39,7 @@ protected:
virtual void c64_cd_w(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint16_t m_bank;
};
diff --git a/src/devices/bus/c64/ide64.cpp b/src/devices/bus/c64/ide64.cpp
index 1942ce466b5..88a1357058c 100644
--- a/src/devices/bus/c64/ide64.cpp
+++ b/src/devices/bus/c64/ide64.cpp
@@ -93,7 +93,8 @@ c64_ide64_cartridge_device::c64_ide64_cartridge_device(const machine_config &mco
m_rtc(*this, DS1302_TAG),
m_ata(*this, ATA_TAG),
m_jp1(*this, "JP1"),
- m_ram(*this, "ram"), m_bank(0), m_ata_data(0), m_wp(0), m_enable(0)
+ m_ram(*this, "ram", 0x8000, ENDIANNESS_LITTLE),
+ m_bank(0), m_ata_data(0), m_wp(0), m_enable(0)
{
}
@@ -104,9 +105,6 @@ c64_ide64_cartridge_device::c64_ide64_cartridge_device(const machine_config &mco
void c64_ide64_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x8000);
-
// state saving
save_item(NAME(m_bank));
save_item(NAME(m_ata_data));
diff --git a/src/devices/bus/c64/ide64.h b/src/devices/bus/c64/ide64.h
index 366357868b9..9438e3a1ed0 100644
--- a/src/devices/bus/c64/ide64.h
+++ b/src/devices/bus/c64/ide64.h
@@ -53,7 +53,7 @@ private:
required_device<ds1302_device> m_rtc;
required_device<ata_interface_device> m_ata;
required_ioport m_jp1;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_bank;
uint16_t m_ata_data;
diff --git a/src/devices/bus/c64/magic_formel.cpp b/src/devices/bus/c64/magic_formel.cpp
index e47795a9eb0..7a5d7e238ca 100644
--- a/src/devices/bus/c64/magic_formel.cpp
+++ b/src/devices/bus/c64/magic_formel.cpp
@@ -157,7 +157,7 @@ c64_magic_formel_cartridge_device::c64_magic_formel_cartridge_device(const machi
device_t(mconfig, C64_MAGIC_FORMEL, tag, owner, clock),
device_c64_expansion_card_interface(mconfig, *this),
m_pia(*this, MC6821_TAG),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x2000, ENDIANNESS_LITTLE),
m_rom_bank(0),
m_ram_bank(0),
m_ram_oe(0),
@@ -174,9 +174,6 @@ c64_magic_formel_cartridge_device::c64_magic_formel_cartridge_device(const machi
void c64_magic_formel_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x2000);
-
// state saving
save_item(NAME(m_rom_bank));
save_item(NAME(m_ram_bank));
diff --git a/src/devices/bus/c64/magic_formel.h b/src/devices/bus/c64/magic_formel.h
index 818342d3c3f..dece2679584 100644
--- a/src/devices/bus/c64/magic_formel.h
+++ b/src/devices/bus/c64/magic_formel.h
@@ -51,7 +51,7 @@ private:
DECLARE_WRITE_LINE_MEMBER( pia_cb2_w );
required_device<pia6821_device> m_pia;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_rom_bank;
uint8_t m_ram_bank;
diff --git a/src/devices/bus/c64/neoram.cpp b/src/devices/bus/c64/neoram.cpp
index 4cb34cbbb57..c0f292da161 100644
--- a/src/devices/bus/c64/neoram.cpp
+++ b/src/devices/bus/c64/neoram.cpp
@@ -43,7 +43,7 @@ c64_neoram_cartridge_device::c64_neoram_cartridge_device(const machine_config &m
void c64_neoram_cartridge_device::device_start()
{
// allocate memory
- m_nvram.allocate(0x200000);
+ m_nvram = std::make_unique<uint8_t[]>(0x200000);
// state saving
save_item(NAME(m_bank));
diff --git a/src/devices/bus/c64/neoram.h b/src/devices/bus/c64/neoram.h
index d5058b878b7..b6729ec08d4 100644
--- a/src/devices/bus/c64/neoram.h
+++ b/src/devices/bus/c64/neoram.h
@@ -37,8 +37,8 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
- virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram.get(), 0x200000); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram.get(), 0x200000); } }
// device_c64_expansion_card_interface overrides
virtual uint8_t c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override;
diff --git a/src/devices/bus/c64/ocean.cpp b/src/devices/bus/c64/ocean.cpp
index 92b18de6a51..d267a9912fa 100644
--- a/src/devices/bus/c64/ocean.cpp
+++ b/src/devices/bus/c64/ocean.cpp
@@ -84,15 +84,15 @@ void c64_ocean_cartridge_device::device_reset()
uint8_t c64_ocean_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2)
{
- if (!roml && m_roml.bytes())
+ if (!roml && m_roml)
{
offs_t addr = (m_bank << 13) | (offset & 0x1fff);
- data = m_roml[addr & m_roml.mask()];
+ data = m_roml[addr];
}
- else if (!romh && m_romh.bytes())
+ else if (!romh && m_romh)
{
offs_t addr = (m_bank << 13) | (offset & 0x1fff);
- data = m_romh[addr & m_romh.mask()];
+ data = m_romh[addr];
}
else if (!io1)
{
diff --git a/src/devices/bus/c64/pagefox.cpp b/src/devices/bus/c64/pagefox.cpp
index 80264aab13b..e33bb4d3d7b 100644
--- a/src/devices/bus/c64/pagefox.cpp
+++ b/src/devices/bus/c64/pagefox.cpp
@@ -52,7 +52,8 @@ DEFINE_DEVICE_TYPE(C64_PAGEFOX, c64_pagefox_cartridge_device, "c64_pagefox", "C6
c64_pagefox_cartridge_device::c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, C64_PAGEFOX, tag, owner, clock),
device_c64_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"), m_bank(0)
+ m_ram(*this, "ram", 0x8000, ENDIANNESS_LITTLE),
+ m_bank(0)
{
}
@@ -63,9 +64,6 @@ c64_pagefox_cartridge_device::c64_pagefox_cartridge_device(const machine_config
void c64_pagefox_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x8000);
-
// state saving
save_item(NAME(m_bank));
}
diff --git a/src/devices/bus/c64/pagefox.h b/src/devices/bus/c64/pagefox.h
index 74ed5a4edf0..b0295eb9d0d 100644
--- a/src/devices/bus/c64/pagefox.h
+++ b/src/devices/bus/c64/pagefox.h
@@ -39,7 +39,7 @@ protected:
virtual void c64_cd_w(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_bank;
};
diff --git a/src/devices/bus/c64/partner.cpp b/src/devices/bus/c64/partner.cpp
index 55e4d07f3e1..b77cf610d17 100644
--- a/src/devices/bus/c64/partner.cpp
+++ b/src/devices/bus/c64/partner.cpp
@@ -80,7 +80,7 @@ ioport_constructor c64_partner_cartridge_device::device_input_ports() const
c64_partner_cartridge_device::c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, C64_PARTNER, tag, owner, clock),
device_c64_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x2000, ENDIANNESS_LITTLE),
m_a0(1),
m_a6(1),
m_nmi(0)
@@ -94,8 +94,6 @@ c64_partner_cartridge_device::c64_partner_cartridge_device(const machine_config
void c64_partner_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x2000);
}
diff --git a/src/devices/bus/c64/partner.h b/src/devices/bus/c64/partner.h
index 6ecf4503a91..4dd71542571 100644
--- a/src/devices/bus/c64/partner.h
+++ b/src/devices/bus/c64/partner.h
@@ -44,7 +44,7 @@ protected:
virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
int m_a0;
int m_a6;
diff --git a/src/devices/bus/c64/reu.cpp b/src/devices/bus/c64/reu.cpp
index cc51b99e096..0d24a1967fa 100644
--- a/src/devices/bus/c64/reu.cpp
+++ b/src/devices/bus/c64/reu.cpp
@@ -53,7 +53,7 @@ c64_reu_cartridge_device::c64_reu_cartridge_device(const machine_config &mconfig
device_c64_expansion_card_interface(mconfig, *this),
m_dmac(*this, MOS8726R1_TAG),
m_eprom(*this, "rom"),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", ram_size, ENDIANNESS_LITTLE),
m_variant(variant),
m_jp1(jp1),
m_ram_size(ram_size)
@@ -76,9 +76,6 @@ c64_reu1764_cartridge_device::c64_reu1764_cartridge_device(const machine_config
void c64_reu_cartridge_device::device_start()
{
- // allocate memory
- m_ram.allocate(m_ram_size);
-
// setup DMA controller
m_dmac->set_unscaled_clock(m_slot->phi2());
m_dmac->bs_w(m_jp1);
diff --git a/src/devices/bus/c64/reu.h b/src/devices/bus/c64/reu.h
index 0cbb67d9576..eaa662f38a1 100644
--- a/src/devices/bus/c64/reu.h
+++ b/src/devices/bus/c64/reu.h
@@ -52,7 +52,7 @@ protected:
required_device<mos8726_device> m_dmac;
required_device<generic_slot_device> m_eprom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
int m_variant;
int m_jp1;
diff --git a/src/devices/bus/c64/ross.cpp b/src/devices/bus/c64/ross.cpp
index 25c1a996df8..e8703a33bcc 100644
--- a/src/devices/bus/c64/ross.cpp
+++ b/src/devices/bus/c64/ross.cpp
@@ -68,7 +68,7 @@ uint8_t c64_ross_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, int sph
{
offs_t addr = (m_bank << 14) | (offset & 0x3fff);
- data = m_roml[addr & m_roml.mask()];
+ data = m_roml[addr];
}
return data;
diff --git a/src/devices/bus/c64/std.cpp b/src/devices/bus/c64/std.cpp
index 08f4c1d65e0..95d472bfbfd 100644
--- a/src/devices/bus/c64/std.cpp
+++ b/src/devices/bus/c64/std.cpp
@@ -49,19 +49,19 @@ void c64_standard_cartridge_device::device_start()
uint8_t c64_standard_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2)
{
- if (!roml && m_roml.bytes())
+ if (!roml && m_roml)
{
- data = m_roml[offset & m_roml.mask()];
+ data = m_roml[offset];
}
else if (!romh)
{
- if (m_romh.bytes())
+ if (m_romh)
{
- data = m_romh[offset & m_romh.mask()];
+ data = m_romh[offset];
}
- else if (m_roml.mask() == 0x3fff)
+ else if (m_roml)
{
- data = m_roml[offset & m_roml.mask()];
+ data = m_roml[offset];
}
}
diff --git a/src/devices/bus/c64/westermann.cpp b/src/devices/bus/c64/westermann.cpp
index ac254733f01..33b22c06942 100644
--- a/src/devices/bus/c64/westermann.cpp
+++ b/src/devices/bus/c64/westermann.cpp
@@ -61,17 +61,17 @@ uint8_t c64_westermann_cartridge_device::c64_cd_r(offs_t offset, uint8_t data, i
{
if (!roml)
{
- data = m_roml[offset & m_roml.mask()];
+ data = m_roml[offset];
}
else if (!romh)
{
- if (m_romh.bytes())
+ if (m_romh)
{
- data = m_romh[offset & m_romh.mask()];
+ data = m_romh[offset];
}
else
{
- data = m_roml[offset & m_roml.mask()];
+ data = m_roml[offset];
}
}
else if (!io2)
diff --git a/src/devices/bus/c64/xl80.cpp b/src/devices/bus/c64/xl80.cpp
index 8f0f35b523f..cd87a53e09d 100644
--- a/src/devices/bus/c64/xl80.cpp
+++ b/src/devices/bus/c64/xl80.cpp
@@ -157,7 +157,7 @@ c64_xl80_device::c64_xl80_device(const machine_config &mconfig, const char *tag,
m_crtc(*this, HD46505SP_TAG),
m_palette(*this, "palette"),
m_char_rom(*this, HD46505SP_TAG),
- m_ram(*this, "ram")
+ m_ram(*this, "ram", RAM_SIZE, ENDIANNESS_LITTLE)
{
}
@@ -168,8 +168,6 @@ c64_xl80_device::c64_xl80_device(const machine_config &mconfig, const char *tag,
void c64_xl80_device::device_start()
{
- // allocate memory
- m_ram.allocate(RAM_SIZE);
}
diff --git a/src/devices/bus/c64/xl80.h b/src/devices/bus/c64/xl80.h
index 70a9b1cba9d..762b8ed39eb 100644
--- a/src/devices/bus/c64/xl80.h
+++ b/src/devices/bus/c64/xl80.h
@@ -52,7 +52,7 @@ private:
required_device<hd6845s_device> m_crtc;
required_device<palette_device> m_palette;
required_memory_region m_char_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/cbm2/24k.cpp b/src/devices/bus/cbm2/24k.cpp
index c212b2fef83..c56474c7be9 100644
--- a/src/devices/bus/cbm2/24k.cpp
+++ b/src/devices/bus/cbm2/24k.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(CBM2_24K, cbm2_24k_cartridge_device, "cbm2_24k", "CBM-II 24K
cbm2_24k_cartridge_device::cbm2_24k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CBM2_24K, tag, owner, clock),
device_cbm2_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram")
+ m_ram(*this, "ram", 0x6000, ENDIANNESS_LITTLE)
{
}
@@ -41,7 +41,6 @@ cbm2_24k_cartridge_device::cbm2_24k_cartridge_device(const machine_config &mconf
void cbm2_24k_cartridge_device::device_start()
{
- m_ram.allocate(0x6000);
}
diff --git a/src/devices/bus/cbm2/24k.h b/src/devices/bus/cbm2/24k.h
index b1c029c5254..554ba721444 100644
--- a/src/devices/bus/cbm2/24k.h
+++ b/src/devices/bus/cbm2/24k.h
@@ -36,7 +36,7 @@ protected:
virtual uint8_t cbm2_bd_r(offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override;
virtual void cbm2_bd_w(offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/cbm2/exp.cpp b/src/devices/bus/cbm2/exp.cpp
index 92c865006f7..7bc35f33120 100644
--- a/src/devices/bus/cbm2/exp.cpp
+++ b/src/devices/bus/cbm2/exp.cpp
@@ -36,10 +36,7 @@ DEFINE_DEVICE_TYPE(CBM2_EXPANSION_SLOT, cbm2_expansion_slot_device, "cbm2_expans
//-------------------------------------------------
device_cbm2_expansion_card_interface::device_cbm2_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_interface(device, "cbm2exp"),
- m_bank1(*this, "bank1"),
- m_bank2(*this, "bank2"),
- m_bank3(*this, "bank3")
+ device_interface(device, "cbm2exp")
{
m_slot = dynamic_cast<cbm2_expansion_slot_device *>(device.owner());
}
@@ -107,17 +104,17 @@ image_init_result cbm2_expansion_slot_device::call_load()
if (is_filetype("20"))
{
- m_card->m_bank1.allocate(size);
+ m_card->m_bank1 = std::make_unique<uint8_t[]>(size);
fread(m_card->m_bank1, size);
}
else if (is_filetype("40"))
{
- m_card->m_bank2.allocate(size);
+ m_card->m_bank2 = std::make_unique<uint8_t[]>(size);
fread(m_card->m_bank2, size);
}
else if (is_filetype("60"))
{
- m_card->m_bank3.allocate(size);
+ m_card->m_bank3 = std::make_unique<uint8_t[]>(size);
fread(m_card->m_bank3, size);
}
}
diff --git a/src/devices/bus/cbm2/exp.h b/src/devices/bus/cbm2/exp.h
index d07035614a8..9781e4ac05a 100644
--- a/src/devices/bus/cbm2/exp.h
+++ b/src/devices/bus/cbm2/exp.h
@@ -113,9 +113,9 @@ public:
protected:
device_cbm2_expansion_card_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_bank1;
- optional_shared_ptr<uint8_t> m_bank2;
- optional_shared_ptr<uint8_t> m_bank3;
+ std::unique_ptr<uint8_t[]> m_bank1;
+ std::unique_ptr<uint8_t[]> m_bank2;
+ std::unique_ptr<uint8_t[]> m_bank3;
cbm2_expansion_slot_device *m_slot;
};
diff --git a/src/devices/bus/cbm2/std.cpp b/src/devices/bus/cbm2/std.cpp
index f56226028ee..51653c72755 100644
--- a/src/devices/bus/cbm2/std.cpp
+++ b/src/devices/bus/cbm2/std.cpp
@@ -49,17 +49,17 @@ void cbm2_standard_cartridge_device::device_start()
uint8_t cbm2_standard_cartridge_device::cbm2_bd_r(offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3)
{
- if (!csbank1 && m_bank1.bytes())
+ if (!csbank1 && m_bank1)
{
- data = m_bank1[offset & m_bank1.mask()];
+ data = m_bank1[offset];
}
- else if (!csbank2 && m_bank2.bytes())
+ else if (!csbank2 && m_bank2)
{
- data = m_bank2[offset & m_bank2.mask()];
+ data = m_bank2[offset];
}
- else if (!csbank3 && m_bank3.bytes())
+ else if (!csbank3 && m_bank3)
{
- data = m_bank3[offset & m_bank3.mask()];
+ data = m_bank3[offset];
}
return data;
diff --git a/src/devices/bus/comx35/clm.cpp b/src/devices/bus/comx35/clm.cpp
index ebf7e1f271e..11a0c460bcb 100644
--- a/src/devices/bus/comx35/clm.cpp
+++ b/src/devices/bus/comx35/clm.cpp
@@ -173,7 +173,7 @@ comx_clm_device::comx_clm_device(const machine_config &mconfig, const char *tag,
m_palette(*this, "palette"),
m_rom(*this, "c000"),
m_char_rom(*this, MC6845_TAG),
- m_video_ram(*this, "video_ram")
+ m_video_ram(*this, "video_ram", VIDEORAM_SIZE, ENDIANNESS_LITTLE)
{
}
@@ -184,9 +184,6 @@ comx_clm_device::comx_clm_device(const machine_config &mconfig, const char *tag,
void comx_clm_device::device_start()
{
- // allocate memory
- m_video_ram.allocate(VIDEORAM_SIZE);
-
// state saving
save_item(NAME(m_ds));
}
diff --git a/src/devices/bus/comx35/clm.h b/src/devices/bus/comx35/clm.h
index 9c4845cbbe0..de86ff28b7f 100644
--- a/src/devices/bus/comx35/clm.h
+++ b/src/devices/bus/comx35/clm.h
@@ -52,7 +52,7 @@ private:
required_device<palette_device> m_palette;
required_memory_region m_rom;
required_memory_region m_char_rom;
- optional_shared_ptr<uint8_t> m_video_ram;
+ memory_share_creator<uint8_t> m_video_ram;
};
diff --git a/src/devices/bus/comx35/ram.cpp b/src/devices/bus/comx35/ram.cpp
index b468b6366ff..0f11dfdb194 100644
--- a/src/devices/bus/comx35/ram.cpp
+++ b/src/devices/bus/comx35/ram.cpp
@@ -37,7 +37,7 @@ DEFINE_DEVICE_TYPE(COMX_RAM, comx_ram_device, "comx_ram", "COMX-35 RAM Card")
comx_ram_device::comx_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, COMX_RAM, tag, owner, clock),
device_comx_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", RAM_SIZE, ENDIANNESS_LITTLE),
m_bank(0)
{
}
@@ -49,7 +49,6 @@ comx_ram_device::comx_ram_device(const machine_config &mconfig, const char *tag,
void comx_ram_device::device_start()
{
- m_ram.allocate(RAM_SIZE);
}
diff --git a/src/devices/bus/comx35/ram.h b/src/devices/bus/comx35/ram.h
index 3a75e208eb6..8ab8703d195 100644
--- a/src/devices/bus/comx35/ram.h
+++ b/src/devices/bus/comx35/ram.h
@@ -39,7 +39,7 @@ protected:
virtual void comx_io_w(offs_t offset, uint8_t data) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
int m_bank;
};
diff --git a/src/devices/bus/cpc/cpc_rom.cpp b/src/devices/bus/cpc/cpc_rom.cpp
index 69bd7f80035..ff60f024f39 100644
--- a/src/devices/bus/cpc/cpc_rom.cpp
+++ b/src/devices/bus/cpc/cpc_rom.cpp
@@ -109,12 +109,12 @@ image_init_result cpc_rom_image_device::call_load()
m_base = std::make_unique<uint8_t[]>(16384);
if(size <= 16384)
{
- image->fread(m_base.get(),size);
+ image->fread(m_base,size);
}
else
{
image->fseek(size-16384,SEEK_SET);
- image->fread(m_base.get(),16384);
+ image->fread(m_base,16384);
}
return image_init_result::PASS;
diff --git a/src/devices/bus/ecbbus/grip.cpp b/src/devices/bus/ecbbus/grip.cpp
index 83adcc78952..ea51bcf2e13 100644
--- a/src/devices/bus/ecbbus/grip.cpp
+++ b/src/devices/bus/ecbbus/grip.cpp
@@ -569,7 +569,7 @@ ecb_grip21_device::ecb_grip21_device(const machine_config &mconfig, const char *
m_centronics(*this, CENTRONICS_TAG),
m_palette(*this, "palette"),
m_speaker(*this, "speaker"),
- m_video_ram(*this, "video_ram"),
+ m_video_ram(*this, "video_ram", VIDEORAM_SIZE, ENDIANNESS_LITTLE),
m_j3a(*this, "J3A"),
m_j3b(*this, "J3B"),
m_j7(*this, "J7"),
@@ -583,9 +583,6 @@ ecb_grip21_device::ecb_grip21_device(const machine_config &mconfig, const char *
void ecb_grip21_device::device_start()
{
- // allocate video RAM
- m_video_ram.allocate(VIDEORAM_SIZE);
-
// setup GRIP memory banking
membank("videoram")->configure_entries(0, 2, m_video_ram, 0x8000);
membank("videoram")->set_entry(0);
diff --git a/src/devices/bus/ecbbus/grip.h b/src/devices/bus/ecbbus/grip.h
index d1e1456eb57..d89fc8ae8fe 100644
--- a/src/devices/bus/ecbbus/grip.h
+++ b/src/devices/bus/ecbbus/grip.h
@@ -72,7 +72,7 @@ private:
required_device<centronics_device> m_centronics;
required_device<palette_device> m_palette;
required_device<speaker_sound_device> m_speaker;
- optional_shared_ptr<uint8_t> m_video_ram;
+ memory_share_creator<uint8_t> m_video_ram;
required_ioport m_j3a;
required_ioport m_j3b;
required_ioport m_j7;
diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp
index d37ebb3a34c..65e71a42209 100644
--- a/src/devices/bus/hp_dio/hp_dio.cpp
+++ b/src/devices/bus/hp_dio/hp_dio.cpp
@@ -268,10 +268,9 @@ void dio16_device::install_memory(offs_t start, offs_t end,
}
}
-void dio16_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void dio16_device::install_bank(offs_t start, offs_t end, uint8_t *data)
{
- m_prgspace->install_readwrite_bank(start, end, 0, tag);
- machine().root_device().membank(m_prgspace->device().siblingtag(tag).c_str())->set_base(data);
+ m_prgspace->install_ram(start, end, data);
}
void dio16_device::unmap_bank(offs_t start, offs_t end)
@@ -279,10 +278,9 @@ void dio16_device::unmap_bank(offs_t start, offs_t end)
m_prgspace->unmap_readwrite(start, end);
}
-void dio16_device::install_rom(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void dio16_device::install_rom(offs_t start, offs_t end, uint8_t *data)
{
- m_prgspace->install_read_bank(start, end, 0, tag);
- machine().root_device().membank(m_prgspace->device().siblingtag(tag).c_str())->set_base(data);
+ m_prgspace->install_rom(start, end, data);
}
void dio16_device::unmap_rom(offs_t start, offs_t end)
diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h
index 6344f95b3a8..872cd388298 100644
--- a/src/devices/bus/hp_dio/hp_dio.h
+++ b/src/devices/bus/hp_dio/hp_dio.h
@@ -83,8 +83,8 @@ public:
// due to the varying bus widths. Using all install_memory() shields you from this problem.
// Either know what you're doing (m_prgwidth is available to cards for this purpose) or
// only use these for 32-bit DIO-II cards.
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
- void install_rom(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
+ void install_rom(offs_t start, offs_t end, uint8_t *data);
void unmap_bank(offs_t start, offs_t end);
void unmap_rom(offs_t start, offs_t end);
diff --git a/src/devices/bus/interpro/sr/sr.h b/src/devices/bus/interpro/sr/sr.h
index ef9d01d2f29..0d30905943b 100644
--- a/src/devices/bus/interpro/sr/sr.h
+++ b/src/devices/bus/interpro/sr/sr.h
@@ -75,7 +75,7 @@ public:
offs_t end = start + (CBUS_SIZE - 1);
// install the idprom region
- read32_delegate idprom_r(*this, [idprom] (address_space &space, offs_t offset, u32 mem_mask) { return idprom->as_u32(offset); }, idprom->name());
+ read32sm_delegate idprom_r(*this, [idprom] (offs_t offset) { return idprom->as_u32(offset); }, idprom->name().c_str());
m_main_space->install_read_handler(start, start | 0x7f, idprom_r);
m_io_space->install_read_handler(start, start | 0x7f, idprom_r);
@@ -171,7 +171,7 @@ public:
offs_t end = start + (SRX_SIZE - 1);
// install the idprom region
- read32_delegate idprom_r(*this, [idprom] (address_space &space, offs_t offset, u32 mem_mask) { return idprom->as_u32(offset); }, idprom->name());
+ read32sm_delegate idprom_r(*this, [idprom] (offs_t offset) { return idprom->as_u32(offset); }, idprom->name().c_str());
m_main_space->install_read_handler(start | 0x7f80, start | 0x7fff, idprom_r);
m_io_space->install_read_handler(start | 0x7f80, start | 0x7fff, idprom_r);
diff --git a/src/devices/bus/isa/3c503.cpp b/src/devices/bus/isa/3c503.cpp
index 44955657475..de831617f3d 100644
--- a/src/devices/bus/isa/3c503.cpp
+++ b/src/devices/bus/isa/3c503.cpp
@@ -55,7 +55,7 @@ void el2_3c503_device::device_reset() {
m_regs.ctrl = 0x0a;
m_irq_state = CLEAR_LINE;
m_isa->unmap_bank(SADDR, SADDR + 0x1fff);
- m_isa->install_bank(SADDR, SADDR + 0x1fff, "3c503 rom", m_rom);
+ m_isa->install_bank(SADDR, SADDR + 0x1fff, m_rom);
}
void el2_3c503_device::set_irq(int state) {
@@ -193,13 +193,13 @@ WRITE8_MEMBER(el2_3c503_device::el2_3c503_hiport_w) {
m_isa->unmap_bank(SADDR, SADDR + 0x1fff);
switch(data & 0xf) {
case 0:
- m_isa->install_bank(SADDR, SADDR + 0x1fff, "3c503 rom", m_rom);
+ m_isa->install_bank(SADDR, SADDR + 0x1fff, m_rom);
break;
case 9:
- m_isa->install_bank(SADDR, SADDR + 0x1fff, "3c503 ram", m_board_ram);
+ m_isa->install_bank(SADDR, SADDR + 0x1fff, m_board_ram);
break;
default:
- m_isa->install_bank(SADDR, SADDR + 0x1fff, "3c503 no map", m_rom);
+ m_isa->install_bank(SADDR, SADDR + 0x1fff, m_rom);
break;
}
}
diff --git a/src/devices/bus/isa/3c505.cpp b/src/devices/bus/isa/3c505.cpp
index 8efc0471ff4..a4f353b81aa 100644
--- a/src/devices/bus/isa/3c505.cpp
+++ b/src/devices/bus/isa/3c505.cpp
@@ -280,7 +280,7 @@ void isa16_3c505_device::device_reset()
offs_t const rom_base = (m_romopts->read() & 0xfe) << 12;
if (m_isa->is_option_rom_space_available(rom_base, 0x2000))
- m_isa->install_rom(this, rom_base, rom_base | 0x01fff, "host", "host");
+ m_isa->install_rom(this, rom_base, rom_base | 0x01fff, "host");
}
m_isa->set_dma_channel(m_isa_drq, this, true);
diff --git a/src/devices/bus/isa/aha1542c.cpp b/src/devices/bus/isa/aha1542c.cpp
index d0bb112728c..3e9a53da30c 100644
--- a/src/devices/bus/isa/aha1542c.cpp
+++ b/src/devices/bus/isa/aha1542c.cpp
@@ -376,7 +376,7 @@ aha1542cp_device::aha1542cp_device(const machine_config &mconfig, const char *ta
void aha1542c_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xdc000, 0xdffff, "aha1542", "aha1542");
+ m_isa->install_rom(this, 0xdc000, 0xdffff, "aha1542");
m_isa->install_device(0x330, 0x333,
read8_delegate(*this, FUNC(aha1542cf_device::aha1542_r)),
write8_delegate(*this, FUNC(aha1542cf_device::aha1542_w)));
diff --git a/src/devices/bus/isa/asc88.cpp b/src/devices/bus/isa/asc88.cpp
index 8843aad29a1..be80911d399 100644
--- a/src/devices/bus/isa/asc88.cpp
+++ b/src/devices/bus/isa/asc88.cpp
@@ -50,8 +50,8 @@ void asc88_device::device_start()
void asc88_device::device_reset()
{
const offs_t baseaddr = 0xc0000 | (u32(m_baseaddr->read()) << 14);
- m_isa->install_rom(this, baseaddr, baseaddr | 0x37ff, "asc88", "bios");
- m_isa->install_bank(baseaddr | 0x3800, baseaddr | 0x3fef, "ascram", m_ram.get());
+ m_isa->install_rom(this, baseaddr, baseaddr | 0x37ff, "bios");
+ m_isa->install_bank(baseaddr | 0x3800, baseaddr | 0x3fef, m_ram.get());
m_isa->install_memory(baseaddr | 0x3ff0, baseaddr | 0x3ff7,
read8sm_delegate(*m_scsic, FUNC(ncr5380n_device::read)),
write8sm_delegate(*m_scsic, FUNC(ncr5380n_device::write)));
diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp
index 1be367cc992..5e23904ff8f 100644
--- a/src/devices/bus/isa/cga.cpp
+++ b/src/devices/bus/isa/cga.cpp
@@ -332,9 +332,9 @@ void isa8_cga_device::device_start()
set_isa_device();
m_vram.resize(m_vram_size);
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_cga_device::io_read)), write8_delegate(*this, FUNC(isa8_cga_device::io_write)));
- m_isa->install_bank(0xb8000, 0xb8000 + (std::min<size_t>)(0x8000, m_vram_size) - 1, "bank_cga", &m_vram[0]);
+ m_isa->install_bank(0xb8000, 0xb8000 + (std::min<size_t>)(0x8000, m_vram_size) - 1, &m_vram[0]);
if(m_vram_size == 0x4000)
- m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
+ m_isa->install_bank(0xbc000, 0xbffff, &m_vram[0]);
/* Initialise the cga palette */
int i;
@@ -1347,7 +1347,7 @@ void isa8_cga_pc1512_device::device_start()
isa8_cga_device::device_start();
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_cga_pc1512_device::io_read)), write8_delegate(*this, FUNC(isa8_cga_pc1512_device::io_write)));
- m_isa->install_bank(0xb8000, 0xbbfff, "bank1", &m_vram[0]);
+ m_isa->install_bank(0xb8000, 0xbbfff, &m_vram[0]);
address_space &space = m_isa->memspace();
@@ -1486,8 +1486,8 @@ void isa8_wyse700_device::device_start()
isa8_cga_device::device_start();
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_wyse700_device::io_read)), write8_delegate(*this, FUNC(isa8_wyse700_device::io_write)));
- m_isa->install_bank(0xa0000, 0xaffff, "bank_wy1", &m_vram[0x00000]);
- m_isa->install_bank(0xb0000, 0xbffff, "bank_cga", &m_vram[0x10000]);
+ m_isa->install_bank(0xa0000, 0xaffff, &m_vram[0x00000]);
+ m_isa->install_bank(0xb0000, 0xbffff, &m_vram[0x10000]);
}
void isa8_wyse700_device::device_reset()
@@ -1587,9 +1587,9 @@ WRITE8_MEMBER( isa8_ec1841_0002_device::io_write )
read8_delegate( *this, FUNC(isa8_ec1841_0002_device::char_ram_read)),
write8_delegate(*this, FUNC(isa8_ec1841_0002_device::char_ram_write)));
} else {
- m_isa->install_bank(0xb8000, 0xb8000 + (std::min<size_t>)(0x8000, m_vram_size) - 1, "bank_cga", &m_vram[0]);
+ m_isa->install_bank(0xb8000, 0xb8000 + (std::min<size_t>)(0x8000, m_vram_size) - 1, &m_vram[0]);
if(m_vram_size == 0x4000)
- m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
+ m_isa->install_bank(0xbc000, 0xbffff, &m_vram[0]);
}
break;
default:
@@ -1983,6 +1983,6 @@ WRITE8_MEMBER(isa8_cga_cportiii_device::port_23c6_w)
if(BIT(data, 3))
m_isa->install_memory(0xb8000, 0xb9fff, read8_delegate(*this, FUNC(isa8_cga_cportiii_device::char_ram_read)), write8_delegate(*this, FUNC(isa8_cga_cportiii_device::char_ram_write)));
else
- m_isa->install_bank(0xb8000, 0xb8000 + 0x8000 - 1, "bank_cga", &m_vram[0]);
+ m_isa->install_bank(0xb8000, 0xb8000 + 0x8000 - 1, &m_vram[0]);
}
diff --git a/src/devices/bus/isa/chessmsr.cpp b/src/devices/bus/isa/chessmsr.cpp
index 206dd8e15e4..54872e728a3 100644
--- a/src/devices/bus/isa/chessmsr.cpp
+++ b/src/devices/bus/isa/chessmsr.cpp
@@ -32,8 +32,7 @@ isa8_chessmsr_device::isa8_chessmsr_device(const machine_config &mconfig, const
device_isa8_card_interface(mconfig, *this),
m_maincpu(*this, "maincpu"),
m_mainlatch(*this, "mainlatch"),
- m_sublatch(*this, "sublatch"),
- m_ram(*this, "ram")
+ m_sublatch(*this, "sublatch")
{ }
@@ -70,8 +69,9 @@ void isa8_chessmsr_device::device_reset()
// install RAM
u32 ramsize = 1 << ioport("RAM")->read();
- m_ram.allocate(ramsize / 4);
- m_maincpu->space(AS_PROGRAM).install_ram(0, ramsize - 1, m_ram);
+ m_ram = std::make_unique<u32[]>(ramsize / 4);
+ save_pointer(NAME(m_ram.get()), ramsize/4);
+ m_maincpu->space(AS_PROGRAM).install_ram(0, ramsize - 1, m_ram.get());
m_installed = true;
}
diff --git a/src/devices/bus/isa/chessmsr.h b/src/devices/bus/isa/chessmsr.h
index 2d79226d4ce..e9f7cf209da 100644
--- a/src/devices/bus/isa/chessmsr.h
+++ b/src/devices/bus/isa/chessmsr.h
@@ -37,7 +37,7 @@ private:
required_device<arm_cpu_device> m_maincpu;
required_device<generic_latch_8_device> m_mainlatch;
required_device<generic_latch_8_device> m_sublatch;
- optional_shared_ptr<u32> m_ram;
+ std::unique_ptr<u32[]> m_ram;
u8 m_ram_offset;
bool m_suspended;
diff --git a/src/devices/bus/isa/ega.cpp b/src/devices/bus/isa/ega.cpp
index abca884e810..4d6d678415d 100644
--- a/src/devices/bus/isa/ega.cpp
+++ b/src/devices/bus/isa/ega.cpp
@@ -636,7 +636,7 @@ void isa8_ega_device::device_start()
m_plane[2] = m_videoram + 0x20000;
m_plane[3] = m_videoram + 0x30000;
- m_isa->install_rom(this, 0xc0000, 0xc3fff, "ega", "user2");
+ m_isa->install_rom(this, 0xc0000, 0xc3fff, "user2");
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3b0_r)), write8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3b0_w)));
m_isa->install_device(0x3c0, 0x3cf, read8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3c0_r)), write8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3c0_w)));
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3d0_r)), write8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3d0_w)));
diff --git a/src/devices/bus/isa/eis_hgb107x.cpp b/src/devices/bus/isa/eis_hgb107x.cpp
index 3503802811a..b0cd62b8cd8 100644
--- a/src/devices/bus/isa/eis_hgb107x.cpp
+++ b/src/devices/bus/isa/eis_hgb107x.cpp
@@ -243,13 +243,13 @@ void isa8_epc_mda_device::device_reset()
if (m_installed == false)
{
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*this, FUNC(isa8_epc_mda_device::io_read)), write8_delegate(*this, FUNC(isa8_epc_mda_device::io_write)));
- m_isa->install_bank(0xb0000, 0xb7fff, "bank_epc", &m_videoram[0]); // Monochrome emulation mode VRAM address
+ m_isa->install_bank(0xb0000, 0xb7fff, &m_videoram[0]); // Monochrome emulation mode VRAM address
// This check allows a color monitor adapter to be installed at this address range if color emulation is disabled
if (m_color_mode & 1)
{
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_epc_mda_device::io_read)), write8_delegate(*this, FUNC(isa8_epc_mda_device::io_write)));
- m_isa->install_bank(0xb8000, 0xbffff, "bank_epc", &m_videoram[0]); // Color emulation mode VRAM address, but same 32KB areas as there are only this amount on the board
+ m_isa->install_bank(0xb8000, 0xbffff, &m_videoram[0]); // Color emulation mode VRAM address, but same 32KB areas as there are only this amount on the board
}
m_installed = true;
}
diff --git a/src/devices/bus/isa/hdc.cpp b/src/devices/bus/isa/hdc.cpp
index 8d5d84bfe1e..3900978ea54 100644
--- a/src/devices/bus/isa/hdc.cpp
+++ b/src/devices/bus/isa/hdc.cpp
@@ -1000,7 +1000,7 @@ void isa8_hdc_device::device_reset()
dip = ioport("HDD")->read();
if (ioport("ROM")->read() == 1 && m_hdc->install_rom())
- m_isa->install_rom(this, 0xc8000, 0xc9fff, "hdc", "hdc");
+ m_isa->install_rom(this, 0xc8000, 0xc9fff, "hdc");
}
/*************************************************************************
diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp
index 9537febc93c..6f9d94356d0 100644
--- a/src/devices/bus/isa/isa.cpp
+++ b/src/devices/bus/isa/isa.cpp
@@ -335,10 +335,9 @@ template void isa8_device::install_device<read8mo_delegate, write8mo_delegate >
template void isa8_device::install_device<read8smo_delegate, write8smo_delegate>(offs_t start, offs_t end, read8smo_delegate rhandler, write8smo_delegate whandler);
-void isa8_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void isa8_device::install_bank(offs_t start, offs_t end, uint8_t *data)
{
- m_memspace->install_readwrite_bank(start, end, 0, tag );
- machine().root_device().membank(m_memspace->device().siblingtag(tag).c_str())->set_base(data);
+ m_memspace->install_ram(start, end, data);
}
void isa8_device::unmap_bank(offs_t start, offs_t end)
@@ -346,16 +345,15 @@ void isa8_device::unmap_bank(offs_t start, offs_t end)
m_memspace->unmap_readwrite(start, end);
}
-void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, const char *tag, const char *region)
+void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, const char *region)
{
if (machine().root_device().memregion("isa")) {
uint8_t *src = dev->memregion(region)->base();
uint8_t *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000;
memcpy(dest,src, end - start + 1);
} else {
- m_memspace->install_read_bank(start, end, 0, tag);
+ m_memspace->install_rom(start, end, machine().root_device().memregion(dev->subtag(region).c_str())->base());
m_memspace->unmap_write(start, end);
- machine().root_device().membank(m_memspace->device().siblingtag(tag).c_str())->set_base(machine().root_device().memregion(dev->subtag(region).c_str())->base());
}
}
diff --git a/src/devices/bus/isa/isa.h b/src/devices/bus/isa/isa.h
index 4cd032a1a9e..6d79b8b6234 100644
--- a/src/devices/bus/isa/isa.h
+++ b/src/devices/bus/isa/isa.h
@@ -148,8 +148,8 @@ public:
{
m_iospace->install_device(addrstart, addrend, device, map, unitmask);
}
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
- void install_rom(device_t *dev, offs_t start, offs_t end, const char *tag, const char *region);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
+ void install_rom(device_t *dev, offs_t start, offs_t end, const char *region);
template<typename R, typename W> void install_memory(offs_t start, offs_t end, R rhandler, W whandler);
void unmap_device(offs_t start, offs_t end) const { m_iospace->unmap_readwrite(start, end); }
diff --git a/src/devices/bus/isa/lbaenhancer.cpp b/src/devices/bus/isa/lbaenhancer.cpp
index f8ebedb130c..242f1f47afe 100644
--- a/src/devices/bus/isa/lbaenhancer.cpp
+++ b/src/devices/bus/isa/lbaenhancer.cpp
@@ -133,7 +133,7 @@ void lba_enhancer_device::device_reset()
m_current_rom_start = 0xc8000 + (ioport("ROM_ADDRESS")->read()* 0x4000);
uint32_t current_rom_end = m_current_rom_start + 0x04000 - 1;
- m_isa->install_rom(this, m_current_rom_start, current_rom_end, "lbabios", "lbabios");
+ m_isa->install_rom(this, m_current_rom_start, current_rom_end, "lbabios");
logerror("LBA enhancer (for 28 bit LBA) located at BIOS address %x - %x\n", m_current_rom_start, current_rom_end);
}
diff --git a/src/devices/bus/isa/mc1502_rom.cpp b/src/devices/bus/isa/mc1502_rom.cpp
index 7e612c10832..f3a78cb93a6 100644
--- a/src/devices/bus/isa/mc1502_rom.cpp
+++ b/src/devices/bus/isa/mc1502_rom.cpp
@@ -59,7 +59,7 @@ mc1502_rom_device::mc1502_rom_device(const machine_config &mconfig, const char *
void mc1502_rom_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xe8000, 0xeffff, "XXX", "mc1502_rom");
+ m_isa->install_rom(this, 0xe8000, 0xeffff, "mc1502_rom");
}
diff --git a/src/devices/bus/isa/mda.cpp b/src/devices/bus/isa/mda.cpp
index 0408d52becf..c2e9f3c6105 100644
--- a/src/devices/bus/isa/mda.cpp
+++ b/src/devices/bus/isa/mda.cpp
@@ -183,14 +183,14 @@ void isa8_mda_device::device_start()
set_isa_device();
m_videoram.resize(0x1000);
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*this, FUNC(isa8_mda_device::io_read)), write8_delegate(*this, FUNC(isa8_mda_device::io_write)));
- m_isa->install_bank(0xb0000, 0xb0fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb1000, 0xb1fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb2000, 0xb2fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb3000, 0xb3fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb4000, 0xb4fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb5000, 0xb5fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb6000, 0xb6fff, "bank_mda", &m_videoram[0]);
- m_isa->install_bank(0xb7000, 0xb7fff, "bank_mda", &m_videoram[0]);
+ m_isa->install_bank(0xb0000, 0xb0fff, &m_videoram[0]);
+ m_isa->install_bank(0xb1000, 0xb1fff, &m_videoram[0]);
+ m_isa->install_bank(0xb2000, 0xb2fff, &m_videoram[0]);
+ m_isa->install_bank(0xb3000, 0xb3fff, &m_videoram[0]);
+ m_isa->install_bank(0xb4000, 0xb4fff, &m_videoram[0]);
+ m_isa->install_bank(0xb5000, 0xb5fff, &m_videoram[0]);
+ m_isa->install_bank(0xb6000, 0xb6fff, &m_videoram[0]);
+ m_isa->install_bank(0xb7000, 0xb7fff, &m_videoram[0]);
/* Initialise the mda palette */
for (int i = 0; i < 4; i++)
@@ -602,7 +602,7 @@ void isa8_hercules_device::device_start()
m_videoram.resize(0x10000);
set_isa_device();
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*this, FUNC(isa8_hercules_device::io_read)), write8_delegate(*this, FUNC(isa8_hercules_device::io_write)));
- m_isa->install_bank(0xb0000, 0xbffff, "bank_hercules", &m_videoram[0]);
+ m_isa->install_bank(0xb0000, 0xbffff, &m_videoram[0]);
/* Initialise the mda palette */
for(int i = 0; i < (sizeof(mda_palette) / 3); i++)
@@ -795,8 +795,8 @@ void isa8_ec1840_0002_device::device_start()
isa8_mda_device::device_start();
m_soft_chr_gen = std::make_unique<uint8_t[]>(0x2000);
- m_isa->install_bank(0xdc000, 0xddfff, "bank_chargen", m_soft_chr_gen.get());
- m_isa->install_bank(0xde000, 0xdffff, "bank_chargen", m_soft_chr_gen.get());
+ m_isa->install_bank(0xdc000, 0xddfff, m_soft_chr_gen.get());
+ m_isa->install_bank(0xde000, 0xdffff, m_soft_chr_gen.get());
}
void isa8_ec1840_0002_device::device_reset()
diff --git a/src/devices/bus/isa/mufdc.cpp b/src/devices/bus/isa/mufdc.cpp
index 61cbeecc95a..1ca76c041ac 100644
--- a/src/devices/bus/isa/mufdc.cpp
+++ b/src/devices/bus/isa/mufdc.cpp
@@ -160,7 +160,7 @@ void mufdc_device::device_start()
void mufdc_device::device_reset()
{
- m_isa->install_rom(this, 0xc8000, 0xc9fff, shortname(), "option");
+ m_isa->install_rom(this, 0xc8000, 0xc9fff, "option");
m_isa->install_device(0x3f0, 0x3f7, *m_fdc, &mcs3201_device::map);
m_isa->set_dma_channel(2, this, true);
}
diff --git a/src/devices/bus/isa/p1_fdc.cpp b/src/devices/bus/isa/p1_fdc.cpp
index 822a14f1e27..c81ed697c9d 100644
--- a/src/devices/bus/isa/p1_fdc.cpp
+++ b/src/devices/bus/isa/p1_fdc.cpp
@@ -172,7 +172,7 @@ p1_fdc_device::p1_fdc_device(const machine_config &mconfig, const char *tag, dev
void p1_fdc_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xe0000, 0xe07ff, "XXX", "p1_fdc");
+ m_isa->install_rom(this, 0xe0000, 0xe07ff, "p1_fdc");
m_isa->install_device(0x00c0, 0x00c3, read8sm_delegate(*m_fdc, FUNC(fd1793_device::read)), write8sm_delegate(*m_fdc, FUNC(fd1793_device::write)));
m_isa->install_device(0x00c4, 0x00c7, read8_delegate(*this, FUNC(p1_fdc_device::p1_fdc_r)), write8_delegate(*this, FUNC(p1_fdc_device::p1_fdc_w)));
}
diff --git a/src/devices/bus/isa/p1_hdc.cpp b/src/devices/bus/isa/p1_hdc.cpp
index 36f93811694..07ef7b639f8 100644
--- a/src/devices/bus/isa/p1_hdc.cpp
+++ b/src/devices/bus/isa/p1_hdc.cpp
@@ -126,7 +126,7 @@ p1_hdc_device::p1_hdc_device(const machine_config &mconfig, const char *tag, dev
void p1_hdc_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xe2000, 0xe27ff, "XXX", "p1_hdc");
+ m_isa->install_rom(this, 0xe2000, 0xe27ff, "p1_hdc");
m_isa->install_memory(0xd0000, 0xd0fff, read8_delegate(*this, FUNC(p1_hdc_device::p1_HDC_r)), write8_delegate(*this, FUNC(p1_hdc_device::p1_HDC_w)));
}
diff --git a/src/devices/bus/isa/p1_rom.cpp b/src/devices/bus/isa/p1_rom.cpp
index 22faf40df01..76013aca719 100644
--- a/src/devices/bus/isa/p1_rom.cpp
+++ b/src/devices/bus/isa/p1_rom.cpp
@@ -64,7 +64,7 @@ p1_rom_device::p1_rom_device(const machine_config &mconfig, const char *tag, dev
void p1_rom_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc1fff, "XXX", "p1_rom");
+ m_isa->install_rom(this, 0xc0000, 0xc1fff, "p1_rom");
}
diff --git a/src/devices/bus/isa/pc1640_iga.cpp b/src/devices/bus/isa/pc1640_iga.cpp
index 7b7b5a89354..ab732e3f00c 100644
--- a/src/devices/bus/isa/pc1640_iga.cpp
+++ b/src/devices/bus/isa/pc1640_iga.cpp
@@ -101,7 +101,7 @@ void isa8_pc1640_iga_device::device_start()
m_plane[2] = m_videoram + 0x20000;
m_plane[3] = m_videoram + 0x30000;
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "ega", "iga");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "iga");
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3b0_r)), write8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3b0_w)));
m_isa->install_device(0x3c0, 0x3cf, read8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3c0_r)), write8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3c0_w)));
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3d0_r)), write8_delegate(*this, FUNC(isa8_ega_device::pc_ega8_3d0_w)));
diff --git a/src/devices/bus/isa/pgc.cpp b/src/devices/bus/isa/pgc.cpp
index 4d7de335616..7a28228b793 100644
--- a/src/devices/bus/isa/pgc.cpp
+++ b/src/devices/bus/isa/pgc.cpp
@@ -71,8 +71,6 @@ ROM_START( pgc )
ROMX_LOAD("pgc_u44.bin", 0x00000, 0x8000, CRC(71280241) SHA1(7042ccd4ebd03f576a256a433b8aa38d1b4fefa8), ROM_BIOS(1))
ROMX_LOAD("pgc_u43.bin", 0x08000, 0x8000, CRC(923f5ea3) SHA1(2b2a55d64b20d3a613b00c51443105aa03eca5d6), ROM_BIOS(1))
- ROM_REGION(0x800, "commarea", ROMREGION_ERASE00)
-
ROM_REGION(0x1000, "chargen", 0)
ROM_LOAD("pgc_u27.bin", 0x0000, 0x1000, CRC(6be256cc) SHA1(deb1195886268dcddce10459911e020f7a9f74f7))
ROM_END
@@ -113,7 +111,7 @@ void isa8_pgc_device::pgc_map(address_map &map)
map(0x08000, 0x0ffff).rom().region("maincpu", 0x8000);
map(0x10000, 0x1001f).rw(FUNC(isa8_pgc_device::stateparam_r), FUNC(isa8_pgc_device::stateparam_w));
// map(0x18000, 0x18fff).ram(); // ??
- map(0x28000, 0x287ff).ram().region("commarea", 0).mirror(0x800);
+ map(0x28000, 0x287ff).ram().share("commarea").mirror(0x800);
map(0x32001, 0x32001).nopw();
map(0x32020, 0x3203f).w(FUNC(isa8_pgc_device::accel_w));
map(0x3c000, 0x3c001).r(FUNC(isa8_pgc_device::init_r));
@@ -210,7 +208,8 @@ isa8_pgc_device::isa8_pgc_device(const machine_config &mconfig, device_type type
m_cpu(*this, "maincpu"),
m_screen(*this, PGC_SCREEN_NAME),
m_palette(*this, "palette"),
- m_commarea(nullptr), m_vram(nullptr), m_eram(nullptr)
+ m_commarea(*this, "commarea"),
+ m_vram(nullptr), m_eram(nullptr)
{
}
@@ -246,11 +245,10 @@ void isa8_pgc_device::device_reset()
memset(m_lut, 0, sizeof(m_lut));
m_accel = 0;
- m_commarea = memregion("commarea")->base();
if (BIT(ioport("DSW")->read(), 1))
- m_isa->install_bank(0xc6400, 0xc67ff, "commarea", m_commarea);
+ m_isa->install_bank(0xc6400, 0xc67ff, m_commarea);
else
- m_isa->install_bank(0xc6000, 0xc63ff, "commarea", m_commarea);
+ m_isa->install_bank(0xc6000, 0xc63ff, m_commarea);
}
//
@@ -385,8 +383,7 @@ READ8_MEMBER(isa8_pgc_device::init_r)
space.unmap_read(0xf8000, 0xfffff);
LOG("INIT: mapping emulator RAM\n");
- space.install_readwrite_bank(0xf8000, 0xfffff, "eram");
- membank("eram")->set_base(m_eram.get());
+ space.install_ram(0xf8000, 0xfffff, m_eram.get());
LOG("INIT: mapping LUT\n");
space.install_write_handler(0xf8400, 0xf85ff, write8_delegate(*this, FUNC(isa8_pgc_device::lut_w)));
diff --git a/src/devices/bus/isa/pgc.h b/src/devices/bus/isa/pgc.h
index a022812cd52..99495e7bd44 100644
--- a/src/devices/bus/isa/pgc.h
+++ b/src/devices/bus/isa/pgc.h
@@ -60,8 +60,8 @@ private:
required_device<i8088_cpu_device> m_cpu;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_shared_ptr<uint8_t> m_commarea;
- uint8_t *m_commarea;
std::unique_ptr<uint8_t[]> m_vram;
std::unique_ptr<uint8_t[]> m_eram;
uint8_t m_stateparam[16];
diff --git a/src/devices/bus/isa/side116.cpp b/src/devices/bus/isa/side116.cpp
index e11b8588d60..0eb3ab496d0 100644
--- a/src/devices/bus/isa/side116.cpp
+++ b/src/devices/bus/isa/side116.cpp
@@ -112,10 +112,10 @@ void side116_device::device_reset()
{
switch ((m_config->read() >> 1) & 0x03)
{
- case 0: m_isa->install_rom(this, 0xc8000, 0xc9fff, "side116", "option"); break;
- case 1: m_isa->install_rom(this, 0xd8000, 0xd9fff, "side116", "option"); break;
- case 2: m_isa->install_rom(this, 0xcc000, 0xcdfff, "side116", "option"); break;
- case 3: m_isa->install_rom(this, 0xdc000, 0xddfff, "side116", "option"); break;
+ case 0: m_isa->install_rom(this, 0xc8000, 0xc9fff, "option"); break;
+ case 1: m_isa->install_rom(this, 0xd8000, 0xd9fff, "option"); break;
+ case 2: m_isa->install_rom(this, 0xcc000, 0xcdfff, "option"); break;
+ case 3: m_isa->install_rom(this, 0xdc000, 0xddfff, "option"); break;
}
}
diff --git a/src/devices/bus/isa/svga_cirrus.cpp b/src/devices/bus/isa/svga_cirrus.cpp
index 74b3c581a39..7f8f11ded1a 100644
--- a/src/devices/bus/isa/svga_cirrus.cpp
+++ b/src/devices/bus/isa/svga_cirrus.cpp
@@ -72,7 +72,7 @@ void isa16_svga_cirrus_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "dm_clgd5430");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "dm_clgd5430");
m_isa->install_device(0x03b0, 0x03bf, read8_delegate(*m_vga, FUNC(cirrus_gd5430_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(cirrus_gd5430_device::port_03b0_w)));
m_isa->install_device(0x03c0, 0x03cf, read8_delegate(*m_vga, FUNC(cirrus_gd5430_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(cirrus_gd5430_device::port_03c0_w)));
@@ -150,7 +150,7 @@ void isa16_svga_cirrus_gd542x_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "clgd542x");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "clgd542x");
m_isa->install_device(0x03b0, 0x03bf, read8_delegate(*m_vga, FUNC(cirrus_gd5428_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(cirrus_gd5428_device::port_03b0_w)));
m_isa->install_device(0x03c0, 0x03cf, read8_delegate(*m_vga, FUNC(cirrus_gd5428_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(cirrus_gd5428_device::port_03c0_w)));
diff --git a/src/devices/bus/isa/svga_s3.cpp b/src/devices/bus/isa/svga_s3.cpp
index 26225d06215..553155c747e 100644
--- a/src/devices/bus/isa/svga_s3.cpp
+++ b/src/devices/bus/isa/svga_s3.cpp
@@ -82,7 +82,7 @@ void isa16_svga_s3_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "s3_764");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "s3_764");
m_isa->install_device(0x03b0, 0x03bf, read8_delegate(*m_vga, FUNC(s3_vga_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(s3_vga_device::port_03b0_w)));
m_isa->install_device(0x03c0, 0x03cf, read8_delegate(*m_vga, FUNC(s3_vga_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(s3_vga_device::port_03c0_w)));
@@ -196,7 +196,7 @@ void isa16_s3virge_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "s3virge");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "s3virge");
m_isa->install_device(0x03b0, 0x03bf, read8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03b0_w)));
m_isa->install_device(0x03c0, 0x03cf, read8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03c0_w)));
@@ -302,7 +302,7 @@ void isa16_s3virgedx_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "s3virgedx");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "s3virgedx");
m_isa->install_device(0x03b0, 0x03bf, read8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03b0_w)));
m_isa->install_device(0x03c0, 0x03cf, read8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03c0_w)));
@@ -400,7 +400,7 @@ void isa16_stealth3d2kpro_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "svga", "stealth3d");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "stealth3d");
m_isa->install_device(0x03b0, 0x03bf, read8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03b0_w)));
m_isa->install_device(0x03c0, 0x03cf, read8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(s3virge_vga_device::port_03c0_w)));
diff --git a/src/devices/bus/isa/svga_trident.cpp b/src/devices/bus/isa/svga_trident.cpp
index bc07c57a425..4a64426d16e 100644
--- a/src/devices/bus/isa/svga_trident.cpp
+++ b/src/devices/bus/isa/svga_trident.cpp
@@ -72,7 +72,7 @@ void isa16_svga_tgui9680_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "tgui9680", "tgui9680");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "tgui9680");
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*m_vga, FUNC(trident_vga_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(trident_vga_device::port_03b0_w)));
m_isa->install_device(0x3c0, 0x3cf, read8_delegate(*m_vga, FUNC(trident_vga_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(trident_vga_device::port_03c0_w)));
diff --git a/src/devices/bus/isa/svga_tseng.cpp b/src/devices/bus/isa/svga_tseng.cpp
index 53dc3d72a5d..2f6b97961d0 100644
--- a/src/devices/bus/isa/svga_tseng.cpp
+++ b/src/devices/bus/isa/svga_tseng.cpp
@@ -114,5 +114,5 @@ void isa8_svga_et4k_device::map_ram()
void isa8_svga_et4k_device::map_rom()
{
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "et4000", "et4000");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "et4000");
}
diff --git a/src/devices/bus/isa/vga.cpp b/src/devices/bus/isa/vga.cpp
index 3fafec340b0..cebd1cf082a 100644
--- a/src/devices/bus/isa/vga.cpp
+++ b/src/devices/bus/isa/vga.cpp
@@ -69,7 +69,7 @@ void isa8_vga_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "ibm_vga", "ibm_vga");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "ibm_vga");
m_isa->install_device(0x3b0, 0x3bf, read8_delegate(*m_vga, FUNC(vga_device::port_03b0_r)), write8_delegate(*m_vga, FUNC(vga_device::port_03b0_w)));
m_isa->install_device(0x3c0, 0x3cf, read8_delegate(*m_vga, FUNC(vga_device::port_03c0_r)), write8_delegate(*m_vga, FUNC(vga_device::port_03c0_w)));
diff --git a/src/devices/bus/isa/vga_ati.cpp b/src/devices/bus/isa/vga_ati.cpp
index 37617ae62d4..c3c0f9499da 100644
--- a/src/devices/bus/isa/vga_ati.cpp
+++ b/src/devices/bus/isa/vga_ati.cpp
@@ -163,7 +163,7 @@ void isa16_vga_gfxultra_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga", "gfxultra");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "gfxultra");
m_isa->install_device(0x1ce, 0x1cf, read8_delegate(*m_vga, FUNC(ati_vga_device::ati_port_ext_r)), write8_delegate(*m_vga, FUNC(ati_vga_device::ati_port_ext_w)));
m_isa->install_device(0x2e8, 0x2ef, read8_delegate(*m_8514, FUNC(mach8_device::ibm8514_status_r)), write8_delegate(*m_8514, FUNC(mach8_device::ibm8514_htotal_w)));
@@ -224,7 +224,7 @@ void isa16_vga_gfxultrapro_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga", "gfxultrapro");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "gfxultrapro");
m_isa->install_device(0x1ce, 0x1cf, read8_delegate(*m_vga, FUNC(mach32_device::ati_port_ext_r)), write8_delegate(*m_vga, FUNC(mach32_device::ati_port_ext_w)));
m_isa->install_device(0x2e8, 0x2ef, read8_delegate(*m_vga, FUNC(mach32_device::mach32_status_r)), write8_delegate(*m_vga, FUNC(mach32_device::ibm8514_htotal_w)));
@@ -293,7 +293,7 @@ void isa16_vga_mach64_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga", "mach64");
+ m_isa->install_rom(this, 0xc0000, 0xc7fff, "mach64");
m_isa->install_device(0x1ce, 0x1cf, read8_delegate(*m_vga, FUNC(mach64_device::ati_port_ext_r)), write8_delegate(*m_vga, FUNC(mach64_device::ati_port_ext_w)));
m_isa->install_device(0x2e8, 0x2ef, read8_delegate(*m_vga, FUNC(mach64_device::mach32_status_r)), write8_delegate(*m_vga, FUNC(mach64_device::ibm8514_htotal_w)));
diff --git a/src/devices/bus/isa/wdxt_gen.cpp b/src/devices/bus/isa/wdxt_gen.cpp
index 3448589b9a5..0d89d00bee4 100644
--- a/src/devices/bus/isa/wdxt_gen.cpp
+++ b/src/devices/bus/isa/wdxt_gen.cpp
@@ -199,7 +199,7 @@ wdxt_gen_device::wdxt_gen_device(const machine_config &mconfig, const char *tag,
void wdxt_gen_device::device_start()
{
set_isa_device();
- m_isa->install_rom(this, 0xc8000, 0xc9fff, "hdc", "hdc");
+ m_isa->install_rom(this, 0xc8000, 0xc9fff, "hdc");
m_isa->install_device(0x0320, 0x0323, read8sm_delegate(*m_host, FUNC(wd11c00_17_device::io_r)), write8sm_delegate(*m_host, FUNC(wd11c00_17_device::io_w)));
m_isa->set_dma_channel(3, this, false);
}
diff --git a/src/devices/bus/lpci/northbridge.cpp b/src/devices/bus/lpci/northbridge.cpp
index 57c802a9e20..0384a9637e4 100644
--- a/src/devices/bus/lpci/northbridge.cpp
+++ b/src/devices/bus/lpci/northbridge.cpp
@@ -33,9 +33,7 @@ void northbridge_device::device_start()
if (m_ram->size() > 0x100000)
{
offs_t ram_limit = 0x100000 + m_ram->size() - 0x100000;
- space.install_read_bank (0x100000, ram_limit - 1, "bank1");
- space.install_write_bank(0x100000, ram_limit - 1, "bank1");
- machine().root_device().membank("bank1")->set_base(m_ram->pointer() + 0x100000);
+ space.install_ram(0x100000, ram_limit - 1, m_ram->pointer() + 0x100000);
}
}
diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp
index fb264fac214..9864f8f79aa 100644
--- a/src/devices/bus/macpds/macpds.cpp
+++ b/src/devices/bus/macpds/macpds.cpp
@@ -108,13 +108,12 @@ void macpds_device::install_device(offs_t start, offs_t end, read16_delegate rha
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask);
}
-void macpds_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void macpds_device::install_bank(offs_t start, offs_t end, uint8_t *data)
{
// printf("install_bank: %s @ %x->%x\n", tag, start, end);
m_maincpu = machine().device<cpu_device>(m_cputag);
address_space &space = m_maincpu->space(AS_PROGRAM);
- space.install_readwrite_bank(start, end, 0, tag );
- machine().root_device().membank(siblingtag(tag).c_str())->set_base(data);
+ space.install_ram(start, end, data);
}
void macpds_device::set_irq_line(int line, int state)
@@ -157,22 +156,15 @@ void device_macpds_card_interface::set_macpds_device()
m_macpds->add_macpds_card(this);
}
-void device_macpds_card_interface::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void device_macpds_card_interface::install_bank(offs_t start, offs_t end, uint8_t *data)
{
- char bank[256];
-
- // append an underscore and the slot name to the bank so it's guaranteed unique
- snprintf(bank, sizeof(bank), "%s_%s", tag, m_macpds_slottag);
-
- m_macpds->install_bank(start, end, bank, data);
+ m_macpds->install_bank(start, end, data);
}
void device_macpds_card_interface::install_rom(device_t *dev, const char *romregion, uint32_t addr)
{
uint8_t *rom = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->base();
uint32_t romlen = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->bytes();
- char bankname[128];
- sprintf(bankname, "rom_%x", addr);
- m_macpds->install_bank(addr, addr+romlen-1, bankname, rom);
+ m_macpds->install_bank(addr, addr+romlen-1, rom);
}
diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h
index 9cd5a550a5e..65f07172da1 100644
--- a/src/devices/bus/macpds/macpds.h
+++ b/src/devices/bus/macpds/macpds.h
@@ -75,7 +75,7 @@ public:
void add_macpds_card(device_macpds_card_interface *card);
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask=0xffffffff);
void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask=0xffffffff);
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
void set_irq_line(int line, int state);
protected:
@@ -112,7 +112,7 @@ public:
void set_macpds_device();
// helper functions for card devices
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
void install_rom(device_t *dev, const char *romregion, uint32_t addr);
// inline configuration
diff --git a/src/devices/bus/macpds/pds_tpdfpd.cpp b/src/devices/bus/macpds/pds_tpdfpd.cpp
index a6d6a0216f0..d3d946262a9 100644
--- a/src/devices/bus/macpds/pds_tpdfpd.cpp
+++ b/src/devices/bus/macpds/pds_tpdfpd.cpp
@@ -109,8 +109,7 @@ void macpds_sedisplay_device::device_start()
m_vram = std::make_unique<uint8_t[]>(VRAM_SIZE);
- static const char bankname[] = { "radpds_ram" };
- m_macpds->install_bank(0xc40000, 0xc40000+VRAM_SIZE-1, bankname, m_vram.get());
+ m_macpds->install_bank(0xc40000, 0xc40000+VRAM_SIZE-1, m_vram.get());
m_macpds->install_device(0x770000, 0x77000f, read16_delegate(*this, FUNC(macpds_sedisplay_device::ramdac_r)), write16_delegate(*this, FUNC(macpds_sedisplay_device::ramdac_w)));
m_macpds->install_device(0xc10000, 0xc2ffff, read16_delegate(*this, FUNC(macpds_sedisplay_device::sedisplay_r)), write16_delegate(*this, FUNC(macpds_sedisplay_device::sedisplay_w)));
diff --git a/src/devices/bus/msx_slot/bunsetsu.cpp b/src/devices/bus/msx_slot/bunsetsu.cpp
index 79a07b2e53a..9c73a37dbd8 100644
--- a/src/devices/bus/msx_slot/bunsetsu.cpp
+++ b/src/devices/bus/msx_slot/bunsetsu.cpp
@@ -13,7 +13,7 @@ DEFINE_DEVICE_TYPE(MSX_SLOT_BUNSETSU, msx_slot_bunsetsu_device, "msx_slot_bunset
msx_slot_bunsetsu_device::msx_slot_bunsetsu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: msx_slot_rom_device(mconfig, MSX_SLOT_BUNSETSU, tag, owner, clock)
- , m_bunsetsu_region(*this, finder_base::DUMMY_TAG, 0x20000)
+ , m_bunsetsu_region(*this, finder_base::DUMMY_TAG)
, m_bunsetsu_address(0)
{
}
diff --git a/src/devices/bus/nubus/laserview.cpp b/src/devices/bus/nubus/laserview.cpp
index e080f4a1276..1368f293ef5 100644
--- a/src/devices/bus/nubus/laserview.cpp
+++ b/src/devices/bus/nubus/laserview.cpp
@@ -88,8 +88,8 @@ void nubus_laserview_device::device_start()
// printf("[laserview %p] slotspace = %x\n", this, slotspace);
m_vram.resize(VRAM_SIZE);
- install_bank(slotspace, slotspace+VRAM_SIZE-1, "bank_laserview", &m_vram[0]);
- install_bank(slotspace+0x900000, slotspace+0x900000+VRAM_SIZE-1, "bank_laserview2", &m_vram[0]);
+ install_bank(slotspace, slotspace+VRAM_SIZE-1, &m_vram[0]);
+ install_bank(slotspace+0x900000, slotspace+0x900000+VRAM_SIZE-1, &m_vram[0]);
nubus().install_device(slotspace+0xB0000, slotspace+0xBFFFF, read32_delegate(*this, FUNC(nubus_laserview_device::regs_r)), write32_delegate(*this, FUNC(nubus_laserview_device::regs_w)));
}
diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp
index 118d7f50f1a..02e75173b5e 100644
--- a/src/devices/bus/nubus/nubus.cpp
+++ b/src/devices/bus/nubus/nubus.cpp
@@ -190,11 +190,10 @@ void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_de
}
}
-void nubus_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void nubus_device::install_bank(offs_t start, offs_t end, uint8_t *data)
{
// printf("install_bank: %s @ %x->%x\n", tag, start, end);
- m_space->install_readwrite_bank(start, end, 0, tag);
- machine().root_device().membank(siblingtag(tag).c_str())->set_base(data);
+ m_space->install_rom(start, end, data);
}
void nubus_device::set_irq_line(int slot, int state)
@@ -295,14 +294,9 @@ void device_nubus_card_interface::interface_pre_start()
}
}
-void device_nubus_card_interface::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
+void device_nubus_card_interface::install_bank(offs_t start, offs_t end, uint8_t *data)
{
- char bank[256];
-
- // append an underscore and the slot name to the bank so it's guaranteed unique
- snprintf(bank, sizeof(bank), "%s_%s", tag, m_nubus_slottag);
-
- nubus().install_bank(start, end, bank, data);
+ nubus().install_bank(start, end, data);
}
void device_nubus_card_interface::install_declaration_rom(device_t *dev, const char *romregion, bool mirror_all_mb, bool reverse_rom)
@@ -441,20 +435,18 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c
// now install the ROM
uint32_t addr = get_slotspace() + 0x01000000;
- char bankname[128];
- snprintf(bankname, sizeof(bankname), "rom_%s", m_nubus_slottag);
addr -= romlen;
// printf("Installing ROM at %x, length %x\n", addr, romlen);
if (mirror_all_mb) // mirror the declaration ROM across all 16 megs of the slot space
{
uint32_t off = 0;
while(off < 0x1000000) {
- nubus().install_bank(addr + off, addr+off+romlen-1, bankname, &m_declaration_rom[0]);
+ nubus().install_bank(addr + off, addr+off+romlen-1, &m_declaration_rom[0]);
off += romlen;
}
}
else
{
- nubus().install_bank(addr, addr+romlen-1, bankname, &m_declaration_rom[0]);
+ nubus().install_bank(addr, addr+romlen-1, &m_declaration_rom[0]);
}
}
diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h
index 874a37bcf82..915b3e35b51 100644
--- a/src/devices/bus/nubus/nubus.h
+++ b/src/devices/bus/nubus/nubus.h
@@ -76,7 +76,7 @@ public:
void install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask=0xffffffff);
void install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, uint32_t mask=0xffffffff);
void install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, uint32_t mask=0xffffffff);
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
void set_irq_line(int slot, int state);
DECLARE_WRITE_LINE_MEMBER( irq9_w );
@@ -127,7 +127,7 @@ public:
// helper functions for card devices
void install_declaration_rom(device_t *dev, const char *romregion, bool mirror_all_mb = false, bool reverse_rom = false);
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
uint32_t get_slotspace() { return 0xf0000000 | (m_slot<<24); }
uint32_t get_super_slotspace() { return m_slot<<28; }
diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp
index f54c98ff3f1..0f181343ed2 100644
--- a/src/devices/bus/nubus/nubus_48gc.cpp
+++ b/src/devices/bus/nubus/nubus_48gc.cpp
@@ -107,7 +107,7 @@ void jmfb_device::device_start()
// printf("[JMFB %p] slotspace = %x\n", this, slotspace);
m_vram.resize(VRAM_SIZE);
- install_bank(slotspace, slotspace+VRAM_SIZE-1, "bank_48gc", &m_vram[0]);
+ install_bank(slotspace, slotspace+VRAM_SIZE-1, &m_vram[0]);
nubus().install_device(slotspace+0x200000, slotspace+0x2003ff, read32_delegate(*this, FUNC(jmfb_device::mac_48gc_r)), write32_delegate(*this, FUNC(jmfb_device::mac_48gc_w)));
diff --git a/src/devices/bus/nubus/nubus_cb264.cpp b/src/devices/bus/nubus/nubus_cb264.cpp
index 99d67081ecd..eb1afd7ef41 100644
--- a/src/devices/bus/nubus/nubus_cb264.cpp
+++ b/src/devices/bus/nubus/nubus_cb264.cpp
@@ -93,7 +93,7 @@ void nubus_cb264_device::device_start()
// printf("[cb264 %p] slotspace = %x\n", this, slotspace);
m_vram.resize(VRAM_SIZE);
- install_bank(slotspace, slotspace+VRAM_SIZE-1, "bank_cb264", &m_vram[0]);
+ install_bank(slotspace, slotspace+VRAM_SIZE-1, &m_vram[0]);
nubus().install_device(slotspace+0xff6000, slotspace+0xff60ff, read32_delegate(*this, FUNC(nubus_cb264_device::cb264_r)), write32_delegate(*this, FUNC(nubus_cb264_device::cb264_w)));
nubus().install_device(slotspace+0xff7000, slotspace+0xff70ff, read32_delegate(*this, FUNC(nubus_cb264_device::cb264_ramdac_r)), write32_delegate(*this, FUNC(nubus_cb264_device::cb264_ramdac_w)));
diff --git a/src/devices/bus/nubus/nubus_image.cpp b/src/devices/bus/nubus/nubus_image.cpp
index 80324a287bc..e755a0c95cf 100644
--- a/src/devices/bus/nubus/nubus_image.cpp
+++ b/src/devices/bus/nubus/nubus_image.cpp
@@ -89,9 +89,8 @@ image_init_result nubus_image_device::messimg_disk_image_device::call_load()
return image_init_result::FAIL;
}
- m_data = make_unique_clear<uint8_t[]>(m_size);
fseek(0, SEEK_SET);
- fread(m_data.get(), m_size);
+ fread(m_data, m_size);
m_ejected = false;
return image_init_result::PASS;
diff --git a/src/devices/bus/nubus/nubus_vikbw.cpp b/src/devices/bus/nubus/nubus_vikbw.cpp
index 875ddf676f4..ea5d48e1377 100644
--- a/src/devices/bus/nubus/nubus_vikbw.cpp
+++ b/src/devices/bus/nubus/nubus_vikbw.cpp
@@ -89,8 +89,8 @@ void nubus_vikbw_device::device_start()
// printf("[vikbw %p] slotspace = %x\n", this, slotspace);
m_vram.resize(VRAM_SIZE);
- install_bank(slotspace+0x40000, slotspace+0x40000+VRAM_SIZE-1, "bank_vikbw", &m_vram[0]);
- install_bank(slotspace+0x940000, slotspace+0x940000+VRAM_SIZE-1, "bank_vikbw2", &m_vram[0]);
+ install_bank(slotspace+0x40000, slotspace+0x40000+VRAM_SIZE-1, &m_vram[0]);
+ install_bank(slotspace+0x940000, slotspace+0x940000+VRAM_SIZE-1, &m_vram[0]);
nubus().install_device(slotspace, slotspace+3, read32_delegate(*this, FUNC(nubus_vikbw_device::viking_enable_r)), write32_delegate(*this, FUNC(nubus_vikbw_device::viking_disable_w)));
nubus().install_device(slotspace+0x80000, slotspace+0x80000+3, read32_delegate(*this, FUNC(nubus_vikbw_device::viking_ack_r)), write32_delegate(*this, FUNC(nubus_vikbw_device::viking_ack_w)));
diff --git a/src/devices/bus/pet/64k.cpp b/src/devices/bus/pet/64k.cpp
index 85f91114386..7e335ba97ff 100644
--- a/src/devices/bus/pet/64k.cpp
+++ b/src/devices/bus/pet/64k.cpp
@@ -79,7 +79,7 @@ inline void pet_64k_expansion_device::write_ram(offs_t offset, uint8_t data)
pet_64k_expansion_device::pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PET_64K, tag, owner, clock),
device_pet_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x10000, ENDIANNESS_LITTLE),
m_ctrl(0)
{
}
@@ -91,9 +91,6 @@ pet_64k_expansion_device::pet_64k_expansion_device(const machine_config &mconfig
void pet_64k_expansion_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x10000);
-
// state saving
save_item(NAME(m_ctrl));
}
diff --git a/src/devices/bus/pet/64k.h b/src/devices/bus/pet/64k.h
index 7cf03cd621b..6b55cc3098e 100644
--- a/src/devices/bus/pet/64k.h
+++ b/src/devices/bus/pet/64k.h
@@ -41,7 +41,7 @@ private:
inline uint8_t read_ram(offs_t offset);
inline void write_ram(offs_t offset, uint8_t data);
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_ctrl;
};
diff --git a/src/devices/bus/pet/superpet.cpp b/src/devices/bus/pet/superpet.cpp
index 6f7dcb9ea5e..5a02383cbcb 100644
--- a/src/devices/bus/pet/superpet.cpp
+++ b/src/devices/bus/pet/superpet.cpp
@@ -173,7 +173,7 @@ superpet_device::superpet_device(const machine_config &mconfig, const char *tag,
m_acia(*this, MOS6551_TAG),
m_dongle(*this, MOS6702_TAG),
m_rom(*this, M6809_TAG),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x10000, ENDIANNESS_LITTLE),
m_io_sw1(*this, "SW1"),
m_io_sw2(*this, "SW2"),
m_system(0),
@@ -191,9 +191,6 @@ superpet_device::superpet_device(const machine_config &mconfig, const char *tag,
void superpet_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x10000);
-
// state saving
save_item(NAME(m_system));
save_item(NAME(m_bank));
diff --git a/src/devices/bus/pet/superpet.h b/src/devices/bus/pet/superpet.h
index 6a6dfde0889..d94c251803b 100644
--- a/src/devices/bus/pet/superpet.h
+++ b/src/devices/bus/pet/superpet.h
@@ -59,7 +59,7 @@ private:
required_device<mos6551_device> m_acia;
required_device<mos6702_device> m_dongle;
required_memory_region m_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
required_ioport m_io_sw1;
required_ioport m_io_sw2;
diff --git a/src/devices/bus/plus4/exp.cpp b/src/devices/bus/plus4/exp.cpp
index 5ca28efd81d..c1184f16922 100644
--- a/src/devices/bus/plus4/exp.cpp
+++ b/src/devices/bus/plus4/exp.cpp
@@ -37,10 +37,6 @@ DEFINE_DEVICE_TYPE(PLUS4_EXPANSION_SLOT, plus4_expansion_slot_device, "plus4_exp
device_plus4_expansion_card_interface::device_plus4_expansion_card_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "plus4exp"),
- m_c1l(*this, "c1l"),
- m_c1h(*this, "c1h"),
- m_c2l(*this, "c2l"),
- m_c2h(*this, "c2h"),
m_c1l_mask(0),
m_c1h_mask(0),
m_c2l_mask(0),
diff --git a/src/devices/bus/plus4/exp.h b/src/devices/bus/plus4/exp.h
index 369480281b3..37691a319d5 100644
--- a/src/devices/bus/plus4/exp.h
+++ b/src/devices/bus/plus4/exp.h
@@ -137,10 +137,10 @@ public:
protected:
device_plus4_expansion_card_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_c1l;
- optional_shared_ptr<uint8_t> m_c1h;
- optional_shared_ptr<uint8_t> m_c2l;
- optional_shared_ptr<uint8_t> m_c2h;
+ std::unique_ptr<uint8_t[]> m_c1l;
+ std::unique_ptr<uint8_t[]> m_c1h;
+ std::unique_ptr<uint8_t[]> m_c2l;
+ std::unique_ptr<uint8_t[]> m_c2h;
size_t m_c1l_mask;
size_t m_c1h_mask;
diff --git a/src/devices/bus/plus4/std.cpp b/src/devices/bus/plus4/std.cpp
index c8efe4b679f..2a050999680 100644
--- a/src/devices/bus/plus4/std.cpp
+++ b/src/devices/bus/plus4/std.cpp
@@ -49,21 +49,21 @@ void plus4_standard_cartridge_device::device_start()
uint8_t plus4_standard_cartridge_device::plus4_cd_r(offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h)
{
- if (!c1l && m_c1l.bytes())
+ if (!c1l && m_c1l)
{
- data = m_c1l[offset & m_c1l.mask()];
+ data = m_c1l[offset];
}
- else if (!c1h && m_c1h.bytes())
+ else if (!c1h && m_c1h)
{
- data = m_c1h[offset & m_c1h.mask()];
+ data = m_c1h[offset];
}
- else if (!c2l && m_c2l.bytes())
+ else if (!c2l && m_c2l)
{
- data = m_c2l[offset & m_c2l.mask()];
+ data = m_c2l[offset];
}
- else if (!c2h && m_c2h.bytes())
+ else if (!c2h && m_c2h)
{
- data = m_c2h[offset & m_c2h.mask()];
+ data = m_c2h[offset];
}
return data;
diff --git a/src/devices/bus/pofo/ccm.cpp b/src/devices/bus/pofo/ccm.cpp
index 11e90cc852c..b5790a14a3b 100644
--- a/src/devices/bus/pofo/ccm.cpp
+++ b/src/devices/bus/pofo/ccm.cpp
@@ -28,9 +28,7 @@ DEFINE_DEVICE_TYPE(PORTFOLIO_MEMORY_CARD_SLOT, portfolio_memory_card_slot_device
//-------------------------------------------------
device_portfolio_memory_card_slot_interface::device_portfolio_memory_card_slot_interface(const machine_config &mconfig, device_t &device) :
- device_interface(device, "pofoccm"),
- m_rom(*this, "rom"),
- m_nvram(*this, "nvram")
+ device_interface(device, "pofoccm")
{
m_slot = dynamic_cast<portfolio_memory_card_slot_device *>(device.owner());
}
@@ -73,7 +71,9 @@ image_init_result portfolio_memory_card_slot_device::call_load()
if (m_card)
{
if (!loaded_through_softlist())
+ {
fread(m_card->m_rom, length());
+ }
else
load_software_region("rom", m_card->m_rom);
}
diff --git a/src/devices/bus/pofo/ccm.h b/src/devices/bus/pofo/ccm.h
index 74175a7dc56..7dc0698453f 100644
--- a/src/devices/bus/pofo/ccm.h
+++ b/src/devices/bus/pofo/ccm.h
@@ -82,8 +82,7 @@ protected:
// construction/destruction
device_portfolio_memory_card_slot_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_rom;
- optional_shared_ptr<uint8_t> m_nvram;
+ std::unique_ptr<uint8_t[]> m_rom;
portfolio_memory_card_slot_device *m_slot;
};
diff --git a/src/devices/bus/pofo/hpc104.cpp b/src/devices/bus/pofo/hpc104.cpp
index a6e66f13da8..11744206c7e 100644
--- a/src/devices/bus/pofo/hpc104.cpp
+++ b/src/devices/bus/pofo/hpc104.cpp
@@ -101,7 +101,7 @@ pofo_hpc104_device::pofo_hpc104_device(const machine_config &mconfig, device_typ
device_nvram_interface(mconfig, *this),
m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_B_TAG),
m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
- m_nvram(*this, "nvram"),
+ m_nvram(*this, "nvram", 0x40000, ENDIANNESS_LITTLE),
m_io_sw1(*this, "SW1")
{
}
@@ -128,8 +128,6 @@ pofo_hpc104_2_device::pofo_hpc104_2_device(const machine_config &mconfig, const
void pofo_hpc104_device::device_start()
{
- // allocate memory
- m_nvram.allocate(0x40000);
}
diff --git a/src/devices/bus/pofo/hpc104.h b/src/devices/bus/pofo/hpc104.h
index 042bece210e..6afae6dd5ec 100644
--- a/src/devices/bus/pofo/hpc104.h
+++ b/src/devices/bus/pofo/hpc104.h
@@ -44,8 +44,8 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
- virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, 0x40000); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, 0x40000); } }
// device_portfolio_expansion_slot_interface overrides
virtual bool nmd1() override { return m_ccm->cdet_r(); }
@@ -58,7 +58,7 @@ protected:
private:
required_device<portfolio_memory_card_slot_device> m_ccm;
required_device<portfolio_expansion_slot_device> m_exp;
- optional_shared_ptr<uint8_t> m_nvram;
+ memory_share_creator<uint8_t> m_nvram;
required_ioport m_io_sw1;
bool m_sw1;
diff --git a/src/devices/bus/pofo/ram.cpp b/src/devices/bus/pofo/ram.cpp
index 5498a9b8c32..7f1298b8b95 100644
--- a/src/devices/bus/pofo/ram.cpp
+++ b/src/devices/bus/pofo/ram.cpp
@@ -29,7 +29,8 @@ DEFINE_DEVICE_TYPE(PORTFOLIO_RAM_CARD, portfolio_ram_card_device, "portfolio_ram
portfolio_ram_card_device::portfolio_ram_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PORTFOLIO_RAM_CARD, tag, owner, clock),
device_portfolio_memory_card_slot_interface(mconfig, *this),
- device_nvram_interface(mconfig, *this)
+ device_nvram_interface(mconfig, *this),
+ m_nvram(*this, "nvram", 0x20000, ENDIANNESS_LITTLE)
{
}
@@ -40,7 +41,6 @@ portfolio_ram_card_device::portfolio_ram_card_device(const machine_config &mconf
void portfolio_ram_card_device::device_start()
{
- m_nvram.allocate(0x20000);
}
diff --git a/src/devices/bus/pofo/ram.h b/src/devices/bus/pofo/ram.h
index 2c19f807816..c3eee30910d 100644
--- a/src/devices/bus/pofo/ram.h
+++ b/src/devices/bus/pofo/ram.h
@@ -36,14 +36,16 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
- virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.share()->bytes()); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.share()->bytes()); } }
// device_portfolio_memory_card_slot_interface overrides
virtual bool cdet() override { return 0; }
virtual uint8_t nrdi_r(offs_t offset) override;
virtual void nwri_w(offs_t offset, uint8_t data) override;
+
+ memory_share_creator<uint8_t> m_nvram;
};
diff --git a/src/devices/bus/ql/rom.cpp b/src/devices/bus/ql/rom.cpp
index 0c84eadd6b6..f6b54fdc907 100644
--- a/src/devices/bus/ql/rom.cpp
+++ b/src/devices/bus/ql/rom.cpp
@@ -29,7 +29,6 @@ DEFINE_DEVICE_TYPE(QL_ROM_CARTRIDGE_SLOT, ql_rom_cartridge_slot_device, "ql_rom_
device_ql_rom_cartridge_card_interface::device_ql_rom_cartridge_card_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "qlrom"),
- m_rom(*this, "rom"),
m_slot(dynamic_cast<ql_rom_cartridge_slot_device *>(device.owner())),
m_romoeh(0)
{
@@ -89,14 +88,9 @@ image_init_result ql_rom_cartridge_slot_device::call_load()
{
if (m_card)
{
- size_t size;
-
if (!loaded_through_softlist())
{
- size = length();
-
- m_card->m_rom.allocate(size);
- fread(m_card->m_rom, size);
+ fread(m_card->m_rom, length());
}
else
{
diff --git a/src/devices/bus/ql/rom.h b/src/devices/bus/ql/rom.h
index 4b79406aca9..bfd06793d8c 100644
--- a/src/devices/bus/ql/rom.h
+++ b/src/devices/bus/ql/rom.h
@@ -58,7 +58,7 @@ protected:
virtual void interface_post_start() override;
- optional_shared_ptr<uint8_t> m_rom;
+ std::unique_ptr<uint8_t[]> m_rom;
ql_rom_cartridge_slot_device *const m_slot;
diff --git a/src/devices/bus/ql/sandy_superqboard.cpp b/src/devices/bus/ql/sandy_superqboard.cpp
index 9fbd2f49c77..4d4a712b010 100644
--- a/src/devices/bus/ql/sandy_superqboard.cpp
+++ b/src/devices/bus/ql/sandy_superqboard.cpp
@@ -219,7 +219,7 @@ sandy_superqboard_device::sandy_superqboard_device(const machine_config &mconfig
m_centronics(*this, CENTRONICS_TAG),
m_latch(*this, TTL74273_TAG),
m_rom(*this, "rom"),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", ram_size, ENDIANNESS_BIG),
m_buttons(*this, "mouse_buttons"),
m_ram_size(ram_size),
m_fd6(0),
@@ -250,9 +250,6 @@ sandy_superqmouse_512k_device::sandy_superqmouse_512k_device(const machine_confi
void sandy_superqboard_device::device_start()
{
- // allocate memory
- m_ram.allocate(m_ram_size);
-
// state saving
save_item(NAME(m_fd6));
save_item(NAME(m_fd7));
diff --git a/src/devices/bus/ql/sandy_superqboard.h b/src/devices/bus/ql/sandy_superqboard.h
index 94bfe0c7dad..347703673de 100644
--- a/src/devices/bus/ql/sandy_superqboard.h
+++ b/src/devices/bus/ql/sandy_superqboard.h
@@ -74,7 +74,7 @@ private:
required_device<centronics_device> m_centronics;
required_device<output_latch_device> m_latch;
required_memory_region m_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
optional_ioport m_buttons;
int m_ram_size;
diff --git a/src/devices/bus/ql/std.cpp b/src/devices/bus/ql/std.cpp
index b1171c46336..7524cc1693d 100644
--- a/src/devices/bus/ql/std.cpp
+++ b/src/devices/bus/ql/std.cpp
@@ -49,9 +49,9 @@ void ql_standard_rom_cartridge_device::device_start()
uint8_t ql_standard_rom_cartridge_device::read(offs_t offset, uint8_t data)
{
- if (m_romoeh && m_rom.bytes())
+ if (m_romoeh && m_rom)
{
- data = m_rom[offset & m_rom.mask()];
+ data = m_rom[offset];
}
return data;
diff --git a/src/devices/bus/ql/trumpcard.cpp b/src/devices/bus/ql/trumpcard.cpp
index 473fc9bb78e..da5fece8726 100644
--- a/src/devices/bus/ql/trumpcard.cpp
+++ b/src/devices/bus/ql/trumpcard.cpp
@@ -114,7 +114,7 @@ ql_trump_card_device::ql_trump_card_device(const machine_config &mconfig, device
m_floppy0(*this, WD1772_TAG":0"),
m_floppy1(*this, WD1772_TAG":1"),
m_rom(*this, "rom"),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", ram_size, ENDIANNESS_BIG),
m_ram_size(ram_size),
m_rom_en(false)
{
@@ -142,9 +142,6 @@ ql_trump_card_768k_device::ql_trump_card_768k_device(const machine_config &mconf
void ql_trump_card_device::device_start()
{
- // allocate memory
- m_ram.allocate(m_ram_size);
-
// state saving
save_item(NAME(m_rom_en));
}
diff --git a/src/devices/bus/ql/trumpcard.h b/src/devices/bus/ql/trumpcard.h
index d9926160928..ee27efc4792 100644
--- a/src/devices/bus/ql/trumpcard.h
+++ b/src/devices/bus/ql/trumpcard.h
@@ -53,7 +53,7 @@ private:
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_memory_region m_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
int m_ram_size;
bool m_rom_en;
diff --git a/src/devices/bus/s100/dj2db.cpp b/src/devices/bus/s100/dj2db.cpp
index 3bc8607077d..03acd63437c 100644
--- a/src/devices/bus/s100/dj2db.cpp
+++ b/src/devices/bus/s100/dj2db.cpp
@@ -254,7 +254,7 @@ s100_dj2db_device::s100_dj2db_device(const machine_config &mconfig, const char *
m_floppy3(*this, MB8866_TAG":3"),
m_floppy(nullptr),
m_rom(*this, "dj2db"),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x400, ENDIANNESS_LITTLE),
m_j1a(*this, "J1A"),
m_j3a(*this, "J3A"),
m_j4(*this, "J4"),
@@ -275,9 +275,6 @@ s100_dj2db_device::s100_dj2db_device(const machine_config &mconfig, const char *
void s100_dj2db_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x400);
-
// state saving
save_item(NAME(m_drive));
save_item(NAME(m_head));
diff --git a/src/devices/bus/s100/dj2db.h b/src/devices/bus/s100/dj2db.h
index dccb5bfbadb..e285ab43f42 100644
--- a/src/devices/bus/s100/dj2db.h
+++ b/src/devices/bus/s100/dj2db.h
@@ -63,7 +63,7 @@ private:
required_device<floppy_connector> m_floppy3;
floppy_image_device *m_floppy;
required_memory_region m_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
required_ioport m_j1a;
required_ioport m_j3a;
required_ioport m_j4;
diff --git a/src/devices/bus/s100/mm65k16s.cpp b/src/devices/bus/s100/mm65k16s.cpp
index ae098a2e29c..5f64ce67aa4 100644
--- a/src/devices/bus/s100/mm65k16s.cpp
+++ b/src/devices/bus/s100/mm65k16s.cpp
@@ -205,7 +205,7 @@ ioport_constructor s100_mm65k16s_device::device_input_ports() const
s100_mm65k16s_device::s100_mm65k16s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, S100_MM65K16S, tag, owner, clock),
device_s100_card_interface(mconfig, *this),
- m_ram(*this, "ram")
+ m_ram(*this, "ram", 0x10000, ENDIANNESS_LITTLE)
{
}
@@ -216,7 +216,6 @@ s100_mm65k16s_device::s100_mm65k16s_device(const machine_config &mconfig, const
void s100_mm65k16s_device::device_start()
{
- m_ram.allocate(0x10000);
}
diff --git a/src/devices/bus/s100/mm65k16s.h b/src/devices/bus/s100/mm65k16s.h
index 10fa1daff7a..706d7e697b6 100644
--- a/src/devices/bus/s100/mm65k16s.h
+++ b/src/devices/bus/s100/mm65k16s.h
@@ -43,7 +43,7 @@ protected:
virtual void s100_phantom_w(int state) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/snes/event.cpp b/src/devices/bus/snes/event.cpp
index 3591a2a679a..d6e8000eab3 100644
--- a/src/devices/bus/snes/event.cpp
+++ b/src/devices/bus/snes/event.cpp
@@ -173,10 +173,8 @@ inline uint16_t get_data(uint8_t *CPU, uint32_t addr)
void sns_pfest94_device::speedup_addon_bios_access()
{
- m_upd7725->space(AS_PROGRAM).install_read_bank(0x0000, 0x07ff, "dsp_prg");
- m_upd7725->space(AS_DATA).install_read_bank(0x0000, 0x03ff, "dsp_data");
- membank("dsp_prg")->set_base(&m_dsp_prg[0]);
- membank("dsp_data")->set_base(&m_dsp_data[0]);
+ m_upd7725->space(AS_PROGRAM).install_rom(0x0000, 0x07ff, &m_dsp_prg[0]);
+ m_upd7725->space(AS_DATA).install_rom(0x0000, 0x03ff, &m_dsp_data[0]);
// copy data in the correct format
for (int x = 0; x < 0x800; x++)
m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
diff --git a/src/devices/bus/snes/upd.cpp b/src/devices/bus/snes/upd.cpp
index 70396938e89..476a1b42544 100644
--- a/src/devices/bus/snes/upd.cpp
+++ b/src/devices/bus/snes/upd.cpp
@@ -322,10 +322,8 @@ void sns_rom_seta11dsp_device::device_add_mconfig(machine_config &config)
void sns_rom20_necdsp_device::speedup_addon_bios_access()
{
- m_upd7725->space(AS_PROGRAM).install_read_bank(0x0000, 0x07ff, "dsp_prg");
- m_upd7725->space(AS_DATA).install_read_bank(0x0000, 0x03ff, "dsp_data");
- membank("dsp_prg")->set_base(&m_dsp_prg[0]);
- membank("dsp_data")->set_base(&m_dsp_data[0]);
+ m_upd7725->space(AS_PROGRAM).install_rom(0x0000, 0x07ff, &m_dsp_prg[0]);
+ m_upd7725->space(AS_DATA).install_rom(0x0000, 0x03ff, &m_dsp_data[0]);
// copy data in the correct format
for (int x = 0; x < 0x800; x++)
m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
@@ -335,10 +333,8 @@ void sns_rom20_necdsp_device::speedup_addon_bios_access()
void sns_rom21_necdsp_device::speedup_addon_bios_access()
{
- m_upd7725->space(AS_PROGRAM).install_read_bank(0x0000, 0x07ff, "dsp_prg");
- m_upd7725->space(AS_DATA).install_read_bank(0x0000, 0x03ff, "dsp_data");
- membank("dsp_prg")->set_base(&m_dsp_prg[0]);
- membank("dsp_data")->set_base(&m_dsp_data[0]);
+ m_upd7725->space(AS_PROGRAM).install_rom(0x0000, 0x07ff, &m_dsp_prg[0]);
+ m_upd7725->space(AS_DATA).install_rom(0x0000, 0x03ff, &m_dsp_data[0]);
// copy data in the correct format
for (int x = 0; x < 0x800; x++)
m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
@@ -348,10 +344,8 @@ void sns_rom21_necdsp_device::speedup_addon_bios_access()
void sns_rom_setadsp_device::speedup_addon_bios_access()
{
- m_upd96050->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "dsp_prg");
- m_upd96050->space(AS_DATA).install_read_bank(0x0000, 0x07ff, "dsp_data");
- membank("dsp_prg")->set_base(&m_dsp_prg[0]);
- membank("dsp_data")->set_base(&m_dsp_data[0]);
+ m_upd96050->space(AS_PROGRAM).install_rom(0x0000, 0x3fff, &m_dsp_prg[0]);
+ m_upd96050->space(AS_DATA).install_rom(0x0000, 0x07ff, &m_dsp_data[0]);
// copy data in the correct format
for (int x = 0; x < 0x4000; x++)
m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp
index a4f677c4ff1..69c33da6a1d 100644
--- a/src/devices/bus/vic10/exp.cpp
+++ b/src/devices/bus/vic10/exp.cpp
@@ -29,10 +29,7 @@ DEFINE_DEVICE_TYPE(VIC10_EXPANSION_SLOT, vic10_expansion_slot_device, "vic10_exp
//-------------------------------------------------
device_vic10_expansion_card_interface::device_vic10_expansion_card_interface(const machine_config &mconfig, device_t &device) :
- device_interface(device, "vic10exp"),
- m_lorom(*this, "lorom"),
- m_exram(*this, "exram"),
- m_uprom(*this, "uprom")
+ device_interface(device, "vic10exp")
{
m_slot = dynamic_cast<vic10_expansion_slot_device *>(device.owner());
}
@@ -133,11 +130,11 @@ image_init_result vic10_expansion_slot_device::call_load()
uint8_t *roml = nullptr;
uint8_t *romh = nullptr;
- m_card->m_lorom.allocate(roml_size);
- m_card->m_uprom.allocate(romh_size);
+ m_card->m_lorom = std::make_unique<uint8_t[]>(roml_size);
+ m_card->m_uprom = std::make_unique<uint8_t[]>(romh_size);
- if (roml_size) roml = m_card->m_lorom;
- if (romh_size) romh = m_card->m_lorom;
+ if (roml_size) roml = m_card->m_lorom.get();
+ if (romh_size) romh = m_card->m_lorom.get();
cbm_crt_read_data(image_core_file(), roml, romh);
}
diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h
index 8dd977550ac..20d21f99e1c 100644
--- a/src/devices/bus/vic10/exp.h
+++ b/src/devices/bus/vic10/exp.h
@@ -141,9 +141,9 @@ public:
protected:
device_vic10_expansion_card_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_lorom;
- optional_shared_ptr<uint8_t> m_exram;
- optional_shared_ptr<uint8_t> m_uprom;
+ std::unique_ptr<uint8_t[]> m_lorom;
+ std::unique_ptr<uint8_t[]> m_exram;
+ std::unique_ptr<uint8_t[]> m_uprom;
vic10_expansion_slot_device *m_slot;
};
diff --git a/src/devices/bus/vic10/std.cpp b/src/devices/bus/vic10/std.cpp
index de4ba6ff8b6..3ffda30fcd9 100644
--- a/src/devices/bus/vic10/std.cpp
+++ b/src/devices/bus/vic10/std.cpp
@@ -48,17 +48,17 @@ void vic10_standard_cartridge_device::device_start()
uint8_t vic10_standard_cartridge_device::vic10_cd_r(offs_t offset, uint8_t data, int lorom, int uprom, int exram)
{
- if (!lorom && m_lorom.bytes())
+ if (!lorom && m_lorom)
{
- data = m_lorom[offset & m_lorom.mask()];
+ data = m_lorom[offset];
}
- else if (!exram && m_exram.bytes())
+ else if (!exram && m_exram)
{
- data = m_exram[offset & m_exram.mask()];
+ data = m_exram[offset];
}
- else if (!uprom && m_uprom.bytes())
+ else if (!uprom && m_uprom)
{
- data = m_uprom[offset & m_uprom.mask()];
+ data = m_uprom[offset];
}
return data;
@@ -71,8 +71,8 @@ uint8_t vic10_standard_cartridge_device::vic10_cd_r(offs_t offset, uint8_t data,
void vic10_standard_cartridge_device::vic10_cd_w(offs_t offset, uint8_t data, int lorom, int uprom, int exram)
{
- if (!exram && m_exram.bytes())
+ if (!exram && m_exram)
{
- m_exram[offset & m_exram.mask()] = data;
+ m_exram[offset] = data;
}
}
diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp
index 7751ff4bc81..c7f0120b25f 100644
--- a/src/devices/bus/vic20/exp.cpp
+++ b/src/devices/bus/vic20/exp.cpp
@@ -28,12 +28,7 @@ DEFINE_DEVICE_TYPE(VIC20_EXPANSION_SLOT, vic20_expansion_slot_device, "vic20_exp
//-------------------------------------------------
device_vic20_expansion_card_interface::device_vic20_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_interface(device, "vic20exp"),
- m_blk1(*this, "blk1"),
- m_blk2(*this, "blk2"),
- m_blk3(*this, "blk3"),
- m_blk5(*this, "blk5"),
- m_nvram(*this, "nvram")
+ : device_interface(device, "vic20exp")
{
m_slot = dynamic_cast<vic20_expansion_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h
index b643c9089b2..96583a29577 100644
--- a/src/devices/bus/vic20/exp.h
+++ b/src/devices/bus/vic20/exp.h
@@ -134,11 +134,10 @@ public:
protected:
device_vic20_expansion_card_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_blk1;
- optional_shared_ptr<uint8_t> m_blk2;
- optional_shared_ptr<uint8_t> m_blk3;
- optional_shared_ptr<uint8_t> m_blk5;
- optional_shared_ptr<uint8_t> m_nvram;
+ std::unique_ptr<uint8_t[]> m_blk1;
+ std::unique_ptr<uint8_t[]> m_blk2;
+ std::unique_ptr<uint8_t[]> m_blk3;
+ std::unique_ptr<uint8_t[]> m_blk5;
vic20_expansion_slot_device *m_slot;
};
diff --git a/src/devices/bus/vic20/fe3.cpp b/src/devices/bus/vic20/fe3.cpp
index f008bec3cb8..230dc076bb4 100644
--- a/src/devices/bus/vic20/fe3.cpp
+++ b/src/devices/bus/vic20/fe3.cpp
@@ -105,7 +105,7 @@ vic20_final_expansion_3_device::vic20_final_expansion_3_device(const machine_con
device_t(mconfig, VIC20_FE3, tag, owner, clock),
device_vic20_expansion_card_interface(mconfig, *this),
m_flash_rom(*this, AM29F040_TAG),
- m_ram(*this, "sram"), m_reg1(0), m_reg2(0), m_lockbit(0)
+ m_ram(*this, "sram", 0x80000, ENDIANNESS_LITTLE), m_reg1(0), m_reg2(0), m_lockbit(0)
{
}
@@ -116,8 +116,6 @@ vic20_final_expansion_3_device::vic20_final_expansion_3_device(const machine_con
void vic20_final_expansion_3_device::device_start()
{
- m_ram.allocate(0x80000);
-
// state saving
save_item(NAME(m_reg1));
save_item(NAME(m_reg2));
diff --git a/src/devices/bus/vic20/fe3.h b/src/devices/bus/vic20/fe3.h
index 018ef2617b6..c82fff2f7ee 100644
--- a/src/devices/bus/vic20/fe3.h
+++ b/src/devices/bus/vic20/fe3.h
@@ -77,7 +77,7 @@ private:
void write_register(offs_t offset, uint8_t data);
required_device<amd_29f040_device> m_flash_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_reg1;
uint8_t m_reg2;
diff --git a/src/devices/bus/vic20/megacart.cpp b/src/devices/bus/vic20/megacart.cpp
index 8094adfba2b..21171bf4343 100644
--- a/src/devices/bus/vic20/megacart.cpp
+++ b/src/devices/bus/vic20/megacart.cpp
@@ -39,6 +39,7 @@ vic20_megacart_device::vic20_megacart_device(const machine_config &mconfig, cons
: device_t(mconfig, VIC20_MEGACART, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
, device_nvram_interface(mconfig, *this)
+ , m_nvram(*this, "nvram", 0x2000, ENDIANNESS_LITTLE)
, m_nvram_en(0)
{
}
@@ -50,8 +51,6 @@ vic20_megacart_device::vic20_megacart_device(const machine_config &mconfig, cons
void vic20_megacart_device::device_start()
{
- m_nvram.allocate(0x2000);
-
// state saving
save_item(NAME(m_nvram_en));
}
diff --git a/src/devices/bus/vic20/megacart.h b/src/devices/bus/vic20/megacart.h
index 52f5182fc3c..08e3ef0a59b 100644
--- a/src/devices/bus/vic20/megacart.h
+++ b/src/devices/bus/vic20/megacart.h
@@ -39,14 +39,15 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { file.read(m_nvram, m_nvram.bytes()); }
- virtual void nvram_write(emu_file &file) override { file.write(m_nvram, m_nvram.bytes()); }
+ virtual void nvram_read(emu_file &file) override { file.read(m_nvram, 0x2000); }
+ virtual void nvram_write(emu_file &file) override { file.write(m_nvram, 0x2000); }
// device_vic20_expansion_card_interface overrides
virtual uint8_t vic20_cd_r(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
+ memory_share_creator<uint8_t> m_nvram;
int m_nvram_en;
};
diff --git a/src/devices/bus/vic20/vic1110.cpp b/src/devices/bus/vic20/vic1110.cpp
index 9b2d0c192d9..f9ee69fd8b1 100644
--- a/src/devices/bus/vic20/vic1110.cpp
+++ b/src/devices/bus/vic20/vic1110.cpp
@@ -69,7 +69,7 @@ ioport_constructor vic1110_device::device_input_ports() const
vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, VIC1110, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
- , m_ram(*this, "ram")
+ , m_ram(*this, "ram", 0x2000, ENDIANNESS_LITTLE)
, m_sw(*this, "SW")
{
}
@@ -81,8 +81,6 @@ vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, d
void vic1110_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x2000);
}
diff --git a/src/devices/bus/vic20/vic1110.h b/src/devices/bus/vic20/vic1110.h
index 9ec1ea2791a..831bc478bf4 100644
--- a/src/devices/bus/vic20/vic1110.h
+++ b/src/devices/bus/vic20/vic1110.h
@@ -40,7 +40,7 @@ protected:
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
required_ioport m_sw;
};
diff --git a/src/devices/bus/vic20/vic1111.cpp b/src/devices/bus/vic20/vic1111.cpp
index 1f8fa215078..4bb3a492ef2 100644
--- a/src/devices/bus/vic20/vic1111.cpp
+++ b/src/devices/bus/vic20/vic1111.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(VIC1111, vic1111_device, "vic1111", "VIC-1111 16K RAM Expansi
vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, VIC1111, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
- , m_ram(*this, "ram")
+ , m_ram(*this, "ram", 0x4000, ENDIANNESS_LITTLE)
{
}
@@ -41,8 +41,6 @@ vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, d
void vic1111_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x4000);
}
diff --git a/src/devices/bus/vic20/vic1111.h b/src/devices/bus/vic20/vic1111.h
index eb42db2f149..7d391875732 100644
--- a/src/devices/bus/vic20/vic1111.h
+++ b/src/devices/bus/vic20/vic1111.h
@@ -37,7 +37,7 @@ protected:
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/vic20/vic1210.cpp b/src/devices/bus/vic20/vic1210.cpp
index 6fa2a917254..88c94e8fbbd 100644
--- a/src/devices/bus/vic20/vic1210.cpp
+++ b/src/devices/bus/vic20/vic1210.cpp
@@ -31,7 +31,7 @@ DEFINE_DEVICE_TYPE(VIC1210, vic1210_device, "vic1210", "VIC-1210 3K RAM Expansio
vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, VIC1210, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
- , m_ram(*this, "ram")
+ , m_ram(*this, "ram", 0xc00, ENDIANNESS_LITTLE)
{
}
@@ -42,8 +42,6 @@ vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, d
void vic1210_device::device_start()
{
- // allocate memory
- m_ram.allocate(0xc00);
}
diff --git a/src/devices/bus/vic20/vic1210.h b/src/devices/bus/vic20/vic1210.h
index f890d5ad61e..9f20f9164ad 100644
--- a/src/devices/bus/vic20/vic1210.h
+++ b/src/devices/bus/vic20/vic1210.h
@@ -38,7 +38,7 @@ protected:
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/vic20/videopak.cpp b/src/devices/bus/vic20/videopak.cpp
index 187224721be..8b119d1d438 100644
--- a/src/devices/bus/vic20/videopak.cpp
+++ b/src/devices/bus/vic20/videopak.cpp
@@ -131,8 +131,8 @@ vic20_video_pak_device::vic20_video_pak_device(const machine_config &mconfig, co
m_crtc(*this, MC6845_TAG),
m_palette(*this, "palette"),
m_char_rom(*this, MC6845_TAG),
- m_videoram(*this, "videoram"),
- m_ram(*this, "ram")
+ m_videoram(*this, "videoram", VIDEORAM_SIZE, ENDIANNESS_LITTLE),
+ m_ram(*this, "ram", RAM_SIZE, ENDIANNESS_LITTLE)
{
}
@@ -143,9 +143,6 @@ vic20_video_pak_device::vic20_video_pak_device(const machine_config &mconfig, co
void vic20_video_pak_device::device_start()
{
- // allocate memory
- m_videoram.allocate(VIDEORAM_SIZE);
- m_ram.allocate(RAM_SIZE);
}
diff --git a/src/devices/bus/vic20/videopak.h b/src/devices/bus/vic20/videopak.h
index 9e3176e5365..d87b04d35c1 100644
--- a/src/devices/bus/vic20/videopak.h
+++ b/src/devices/bus/vic20/videopak.h
@@ -51,8 +51,8 @@ private:
required_device<mc6845_device> m_crtc;
required_device<palette_device> m_palette;
required_memory_region m_char_rom;
- optional_shared_ptr<uint8_t> m_videoram;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_videoram;
+ memory_share_creator<uint8_t> m_ram;
bool m_case;
bool m_bank_size;
diff --git a/src/devices/bus/vip/vp570.cpp b/src/devices/bus/vip/vp570.cpp
index f9473bd2f87..f2e32dffd35 100644
--- a/src/devices/bus/vip/vp570.cpp
+++ b/src/devices/bus/vip/vp570.cpp
@@ -63,7 +63,7 @@ ioport_constructor vp570_device::device_input_ports() const
vp570_device::vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VP570, tag, owner, clock),
device_vip_expansion_card_interface(mconfig, *this),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", 0x1000, ENDIANNESS_LITTLE),
m_base(*this, "BASE"),
m_sw1(*this, "SW1")
{
@@ -76,7 +76,6 @@ vp570_device::vp570_device(const machine_config &mconfig, const char *tag, devic
void vp570_device::device_start()
{
- m_ram.allocate(0x1000);
}
diff --git a/src/devices/bus/vip/vp570.h b/src/devices/bus/vip/vp570.h
index 04ad752d804..2f026bd1eac 100644
--- a/src/devices/bus/vip/vp570.h
+++ b/src/devices/bus/vip/vp570.h
@@ -40,7 +40,7 @@ protected:
virtual void vip_program_w(offs_t offset, uint8_t data, int cdef, int *minh) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
required_ioport m_base;
required_ioport m_sw1;
};
diff --git a/src/devices/bus/vip/vp590.cpp b/src/devices/bus/vip/vp590.cpp
index 3fd9185c5d1..296ce70fb8b 100644
--- a/src/devices/bus/vip/vp590.cpp
+++ b/src/devices/bus/vip/vp590.cpp
@@ -131,7 +131,7 @@ vp590_device::vp590_device(const machine_config &mconfig, const char *tag, devic
device_t(mconfig, VP590, tag, owner, clock),
device_vip_expansion_card_interface(mconfig, *this),
m_cgc(*this, CDP1862_TAG),
- m_color_ram(*this, "color_ram"),
+ m_color_ram(*this, "color_ram", COLOR_RAM_SIZE, ENDIANNESS_LITTLE),
m_j1(*this, "J1"),
m_j2(*this, "J2"),
m_a12(0), m_color(0), m_keylatch(0)
@@ -145,9 +145,6 @@ vp590_device::vp590_device(const machine_config &mconfig, const char *tag, devic
void vp590_device::device_start()
{
- // allocate memory
- m_color_ram.allocate(COLOR_RAM_SIZE);
-
// state saving
save_item(NAME(m_a12));
save_item(NAME(m_color));
diff --git a/src/devices/bus/vip/vp590.h b/src/devices/bus/vip/vp590.h
index 230b7d8d02d..9c69762f7be 100644
--- a/src/devices/bus/vip/vp590.h
+++ b/src/devices/bus/vip/vp590.h
@@ -50,7 +50,7 @@ private:
DECLARE_READ_LINE_MEMBER( gd_r );
required_device<cdp1862_device> m_cgc;
- optional_shared_ptr<uint8_t> m_color_ram;
+ memory_share_creator<uint8_t> m_color_ram;
required_ioport m_j1;
required_ioport m_j2;
diff --git a/src/devices/bus/vtech/memexp/memory.cpp b/src/devices/bus/vtech/memexp/memory.cpp
index 19330332bed..4fcb13a2623 100644
--- a/src/devices/bus/vtech/memexp/memory.cpp
+++ b/src/devices/bus/vtech/memexp/memory.cpp
@@ -129,7 +129,8 @@ void vtech_laser310_16k_device::device_reset()
vtech_laser_64k_device::vtech_laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, VTECH_LASER_64K, tag, owner, clock),
- device_vtech_memexp_interface(mconfig, *this)
+ device_vtech_memexp_interface(mconfig, *this),
+ m_bank(*this, "bank")
{
}
@@ -152,10 +153,10 @@ void vtech_laser_64k_device::device_reset()
program_space().install_ram(0x8000, 0xbfff, &m_ram[0]);
// other banks
- program_space().install_readwrite_bank(0xc000, 0xffff, tag());
+ program_space().install_readwrite_bank(0xc000, 0xffff, m_bank);
- membank(tag())->configure_entries(0, 4, &m_ram[0], 0x4000);
- membank(tag())->set_entry(1);
+ m_bank->configure_entries(0, 4, &m_ram[0], 0x4000);
+ m_bank->set_entry(1);
// bank switch
io_space().install_write_handler(0x70, 0x7f, write8_delegate(*this, FUNC(vtech_laser_64k_device::bankswitch_w)));
@@ -163,5 +164,5 @@ void vtech_laser_64k_device::device_reset()
WRITE8_MEMBER( vtech_laser_64k_device::bankswitch_w )
{
- membank(tag())->set_entry(data & 0x03);
+ m_bank->set_entry(data & 0x03);
}
diff --git a/src/devices/bus/vtech/memexp/memory.h b/src/devices/bus/vtech/memexp/memory.h
index f8a0fe78e7d..7296bedc01e 100644
--- a/src/devices/bus/vtech/memexp/memory.h
+++ b/src/devices/bus/vtech/memexp/memory.h
@@ -81,6 +81,7 @@ protected:
virtual void device_reset() override;
private:
+ memory_bank_creator m_bank;
std::vector<uint8_t> m_ram;
};
diff --git a/src/devices/bus/wangpc/emb.cpp b/src/devices/bus/wangpc/emb.cpp
index 8a1817d1666..6a69c1a0fee 100644
--- a/src/devices/bus/wangpc/emb.cpp
+++ b/src/devices/bus/wangpc/emb.cpp
@@ -47,7 +47,7 @@ DEFINE_DEVICE_TYPE(WANGPC_EMB, wangpc_emb_device, "wangpc_emb", "Wang PC-PM031-B
wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, WANGPC_EMB, tag, owner, clock),
device_wangpcbus_card_interface(mconfig, *this),
- m_ram(*this, "ram"),
+ m_ram(*this, "ram", RAM_SIZE, ENDIANNESS_LITTLE),
m_option(0), m_parity_error(0), m_parity_odd(0)
{
}
@@ -59,9 +59,6 @@ wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *
void wangpc_emb_device::device_start()
{
- // allocate memory
- m_ram.allocate(RAM_SIZE);
-
// state saving
save_item(NAME(m_option));
save_item(NAME(m_parity_error));
diff --git a/src/devices/bus/wangpc/emb.h b/src/devices/bus/wangpc/emb.h
index 1e175ae6867..1f23fed9f09 100644
--- a/src/devices/bus/wangpc/emb.h
+++ b/src/devices/bus/wangpc/emb.h
@@ -40,7 +40,7 @@ protected:
virtual void wangpcbus_aiowc_w(offs_t offset, uint16_t mem_mask, uint16_t data) override;
private:
- optional_shared_ptr<uint16_t> m_ram;
+ memory_share_creator<uint16_t> m_ram;
uint16_t m_option;
int m_parity_error;
int m_parity_odd;
diff --git a/src/devices/bus/wangpc/lvc.cpp b/src/devices/bus/wangpc/lvc.cpp
index 4d31a7b9367..d87c49394c5 100644
--- a/src/devices/bus/wangpc/lvc.cpp
+++ b/src/devices/bus/wangpc/lvc.cpp
@@ -164,7 +164,7 @@ wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *
device_t(mconfig, WANGPC_LVC, tag, owner, clock),
device_wangpcbus_card_interface(mconfig, *this),
m_crtc(*this, MC6845_TAG),
- m_video_ram(*this, "video_ram"),
+ m_video_ram(*this, "video_ram", RAM_SIZE, ENDIANNESS_LITTLE),
m_option(0), m_scroll(0),
m_irq(CLEAR_LINE)
{
@@ -177,9 +177,6 @@ wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *
void wangpc_lvc_device::device_start()
{
- // allocate memory
- m_video_ram.allocate(RAM_SIZE);
-
// state saving
save_item(NAME(m_option));
save_item(NAME(m_scroll));
diff --git a/src/devices/bus/wangpc/lvc.h b/src/devices/bus/wangpc/lvc.h
index 3fa858adf1c..7f0cb5ac816 100644
--- a/src/devices/bus/wangpc/lvc.h
+++ b/src/devices/bus/wangpc/lvc.h
@@ -48,7 +48,7 @@ private:
inline void set_irq(int state);
required_device<mc6845_device> m_crtc;
- optional_shared_ptr<uint16_t> m_video_ram;
+ memory_share_creator<uint16_t> m_video_ram;
rgb_t m_palette[16];
uint8_t m_option;
diff --git a/src/devices/bus/wangpc/mvc.cpp b/src/devices/bus/wangpc/mvc.cpp
index 562e277f982..2a337e85341 100644
--- a/src/devices/bus/wangpc/mvc.cpp
+++ b/src/devices/bus/wangpc/mvc.cpp
@@ -184,9 +184,9 @@ wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char *
device_t(mconfig, WANGPC_MVC, tag, owner, clock),
device_wangpcbus_card_interface(mconfig, *this),
m_crtc(*this, MC6845_TAG),
- m_video_ram(*this, "video_ram"),
- m_char_ram(*this, "char_ram"),
- m_bitmap_ram(*this, "bitmap_ram"),
+ m_video_ram(*this, "video_ram", VIDEO_RAM_SIZE, ENDIANNESS_LITTLE),
+ m_char_ram(*this, "char_ram", CHAR_RAM_SIZE, ENDIANNESS_LITTLE),
+ m_bitmap_ram(*this, "bitmap_ram", BITMAP_RAM_SIZE, ENDIANNESS_LITTLE),
m_option(0),
m_irq(CLEAR_LINE)
{
@@ -199,11 +199,6 @@ wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char *
void wangpc_mvc_device::device_start()
{
- // allocate memory
- m_video_ram.allocate(VIDEO_RAM_SIZE);
- m_char_ram.allocate(CHAR_RAM_SIZE);
- m_bitmap_ram.allocate(BITMAP_RAM_SIZE);
-
// state saving
save_item(NAME(m_option));
save_item(NAME(m_irq));
diff --git a/src/devices/bus/wangpc/mvc.h b/src/devices/bus/wangpc/mvc.h
index aee0cdf51b2..9911952f6ac 100644
--- a/src/devices/bus/wangpc/mvc.h
+++ b/src/devices/bus/wangpc/mvc.h
@@ -48,9 +48,9 @@ private:
inline void set_irq(int state);
required_device<mc6845_device> m_crtc;
- optional_shared_ptr<uint16_t> m_video_ram;
- optional_shared_ptr<uint16_t> m_char_ram;
- optional_shared_ptr<uint16_t> m_bitmap_ram;
+ memory_share_creator<uint16_t> m_video_ram;
+ memory_share_creator<uint16_t> m_char_ram;
+ memory_share_creator<uint16_t> m_bitmap_ram;
uint8_t m_option;
int m_irq;
diff --git a/src/devices/bus/wangpc/rtc.cpp b/src/devices/bus/wangpc/rtc.cpp
index bb299017730..8cd5e055ac6 100644
--- a/src/devices/bus/wangpc/rtc.cpp
+++ b/src/devices/bus/wangpc/rtc.cpp
@@ -186,7 +186,7 @@ wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *
m_ctc0(*this, Z80CTC_0_TAG),
m_ctc1(*this, Z80CTC_1_TAG),
m_sio(*this, Z80SIO_TAG),
- m_char_ram(*this, "char_ram")
+ m_char_ram(*this, "char_ram", 0x100, ENDIANNESS_LITTLE)
{
}
@@ -197,7 +197,6 @@ wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *
void wangpc_rtc_device::device_start()
{
- m_char_ram.allocate(0x100);
}
diff --git a/src/devices/bus/wangpc/rtc.h b/src/devices/bus/wangpc/rtc.h
index eb848b599ec..4366536ccdf 100644
--- a/src/devices/bus/wangpc/rtc.h
+++ b/src/devices/bus/wangpc/rtc.h
@@ -52,7 +52,7 @@ private:
required_device<z80ctc_device> m_ctc0;
required_device<z80ctc_device> m_ctc1;
required_device<z80sio_device> m_sio;
- optional_shared_ptr<uint8_t> m_char_ram;
+ memory_share_creator<uint8_t> m_char_ram;
void wangpc_rtc_io(address_map &map);
void wangpc_rtc_mem(address_map &map);
diff --git a/src/devices/bus/x68k/x68k_scsiext.cpp b/src/devices/bus/x68k/x68k_scsiext.cpp
index 22a35a17297..f46924ae895 100644
--- a/src/devices/bus/x68k/x68k_scsiext.cpp
+++ b/src/devices/bus/x68k/x68k_scsiext.cpp
@@ -65,13 +65,12 @@ x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const ch
void x68k_scsiext_device::device_start()
{
+ uint8_t *ROM = machine().root_device().memregion(subtag("scsiexrom").c_str())->base();
+
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
- m_slot->space().install_read_bank(0xea0020,0xea1fff,"scsi_ext");
+ m_slot->space().install_rom(0xea0020,0xea1fff,ROM);
m_slot->space().unmap_write(0xea0020,0xea1fff);
- uint8_t *ROM = machine().root_device().memregion(subtag("scsiexrom").c_str())->base();
- machine().root_device().membank("scsi_ext")->set_base(ROM);
-
m_slot->space().install_readwrite_handler(0xea0000,0xea001f, read8_delegate(*this, FUNC(x68k_scsiext_device::register_r)), write8_delegate(*this, FUNC(x68k_scsiext_device::register_w)), 0x00ff00ff);
}
diff --git a/src/devices/cpu/dsp16/dsp16.cpp b/src/devices/cpu/dsp16/dsp16.cpp
index f0c28c5ca32..2f1eecf65e4 100644
--- a/src/devices/cpu/dsp16/dsp16.cpp
+++ b/src/devices/cpu/dsp16/dsp16.cpp
@@ -2082,7 +2082,7 @@ dsp16_device::dsp16_device(machine_config const &mconfig, char const *tag, devic
mconfig, DSP16, tag, owner, clock,
9,
address_map_constructor(FUNC(dsp16_device::data_map), this))
- , m_rom(*this, DEVICE_SELF, 0x0800)
+ , m_rom(*this, DEVICE_SELF)
{
}
@@ -2114,7 +2114,7 @@ dsp16a_device::dsp16a_device(machine_config const &mconfig, char const *tag, dev
mconfig, DSP16A, tag, owner, clock,
16,
address_map_constructor(FUNC(dsp16a_device::data_map), this))
- , m_rom(*this, DEVICE_SELF, 0x1000)
+ , m_rom(*this, DEVICE_SELF)
{
}
diff --git a/src/devices/cpu/m6805/m68705.cpp b/src/devices/cpu/m6805/m68705.cpp
index 814a0ca57d6..67ffc0885ec 100644
--- a/src/devices/cpu/m6805/m68705.cpp
+++ b/src/devices/cpu/m6805/m68705.cpp
@@ -231,7 +231,7 @@ m6805_hmos_device::m6805_hmos_device(machine_config const &mconfig, char const *
m68705_device::m68705_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock, device_type type, u32 addr_width, unsigned ram_size)
: m6805_hmos_device(mconfig, tag, owner, clock, type, addr_width, ram_size)
, device_nvram_interface(mconfig, *this)
- , m_user_rom(*this, DEVICE_SELF, u32(1) << addr_width)
+ , m_user_rom(*this, DEVICE_SELF)
, m_vihtp(CLEAR_LINE)
, m_pcr(0xff)
, m_pl_data(0xff)
diff --git a/src/devices/cpu/m6805/m68hc05.cpp b/src/devices/cpu/m6805/m68hc05.cpp
index 14c40020c47..0a7128b29a7 100644
--- a/src/devices/cpu/m6805/m68hc05.cpp
+++ b/src/devices/cpu/m6805/m68hc05.cpp
@@ -930,7 +930,7 @@ m68hc705c8a_device::m68hc705c8a_device(machine_config const &mconfig, char const
M68HC705C8A,
13,
address_map_constructor(FUNC(m68hc705c8a_device::c8a_map), this))
- , m_rom(*this, DEVICE_SELF, 0x2000)
+ , m_rom(*this, DEVICE_SELF)
{
set_port_bits(std::array<u8, PORT_COUNT>{{ 0xff, 0xff, 0xff, 0xbf }});
}
diff --git a/src/devices/machine/at28c16.cpp b/src/devices/machine/at28c16.cpp
index 622dfb3fc19..acbee4613eb 100644
--- a/src/devices/machine/at28c16.cpp
+++ b/src/devices/machine/at28c16.cpp
@@ -48,7 +48,7 @@ at28c16_device::at28c16_device(const machine_config &mconfig, const char *tag, d
m_a9_12v(0),
m_oe_12v(0),
m_last_write(-1),
- m_default_data(*this, DEVICE_SELF, AT28C16_DATA_BYTES)
+ m_default_data(*this, DEVICE_SELF)
{
}
diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp
index 4af64f320a1..b8919cca609 100644
--- a/src/devices/machine/cs4031.cpp
+++ b/src/devices/machine/cs4031.cpp
@@ -565,28 +565,25 @@ void cs4031_device::config_data_w(uint8_t data)
// MEMORY MAPPER
//**************************************************************************
-void cs4031_device::update_read_region(int index, const char *region, offs_t start, offs_t end)
+void cs4031_device::update_read_region(int index, offs_t start, offs_t end)
{
if (!BIT(m_registers[SHADOW_READ], index) && BIT(m_registers[ROMCS], index))
{
LOGMEMORY("ROM read from %x to %x\n", start, end);
- m_space->install_read_bank(start, end, region);
- machine().root_device().membank(region)->set_base(m_bios + start);
+ m_space->install_rom(start, end, m_bios + start);
}
else if (!BIT(m_registers[SHADOW_READ], index) && !BIT(m_registers[ROMCS], index))
{
LOGMEMORY("ISA read from %x to %x\n", start, end);
- m_space->install_read_bank(start, end, region);
- machine().root_device().membank(region)->set_base(m_isa + start - 0xc0000);
+ m_space->install_rom(start, end, m_isa + start - 0xc0000);
}
else if (BIT(m_registers[SHADOW_READ], index))
{
LOGMEMORY("RAM read from %x to %x\n", start, end);
- m_space->install_read_bank(start, end, region);
- machine().root_device().membank(region)->set_base(m_ram + start);
+ m_space->install_rom(start, end, m_ram + start);
}
else
{
@@ -596,28 +593,25 @@ void cs4031_device::update_read_region(int index, const char *region, offs_t sta
}
}
-void cs4031_device::update_write_region(int index, const char *region, offs_t start, offs_t end)
+void cs4031_device::update_write_region(int index, offs_t start, offs_t end)
{
if (!BIT(m_registers[SHADOW_WRITE], index) && BIT(m_registers[ROMCS], index) && BIT(m_registers[ROMCS], 7))
{
LOGMEMORY("ROM write from %x to %x\n", start, end);
- m_space->install_write_bank(start, end, region);
- machine().root_device().membank(region)->set_base(m_bios + start);
+ m_space->install_writeonly(start, end, m_bios + start);
}
else if (!BIT(m_registers[SHADOW_WRITE], index) && !BIT(m_registers[ROMCS], index))
{
LOGMEMORY("ISA write from %x to %x\n", start, end);
- m_space->install_write_bank(start, end, region);
- machine().root_device().membank(region)->set_base(m_isa + start - 0xc0000);
+ m_space->install_writeonly(start, end, m_isa + start - 0xc0000);
}
else if (BIT(m_registers[SHADOW_WRITE], index))
{
LOGMEMORY("RAM write from %x to %x\n", start, end);
- m_space->install_write_bank(start, end, region);
- machine().root_device().membank(region)->set_base(m_ram + start);
+ m_space->install_writeonly(start, end, m_ram + start);
}
else
{
@@ -629,24 +623,24 @@ void cs4031_device::update_write_region(int index, const char *region, offs_t st
void cs4031_device::update_read_regions()
{
- update_read_region(0, "read_c0000", 0xc0000, 0xc3fff);
- update_read_region(1, "read_c4000", 0xc4000, 0xc7fff);
- update_read_region(2, "read_c8000", 0xc8000, 0xcbfff);
- update_read_region(3, "read_cc000", 0xcc000, 0xcffff);
- update_read_region(4, "read_d0000", 0xd0000, 0xdffff);
- update_read_region(5, "read_e0000", 0xe0000, 0xeffff);
- update_read_region(6, "read_f0000", 0xf0000, 0xfffff);
+ update_read_region(0, 0xc0000, 0xc3fff);
+ update_read_region(1, 0xc4000, 0xc7fff);
+ update_read_region(2, 0xc8000, 0xcbfff);
+ update_read_region(3, 0xcc000, 0xcffff);
+ update_read_region(4, 0xd0000, 0xdffff);
+ update_read_region(5, 0xe0000, 0xeffff);
+ update_read_region(6, 0xf0000, 0xfffff);
}
void cs4031_device::update_write_regions()
{
- update_write_region(0, "write_c0000", 0xc0000, 0xc3fff);
- update_write_region(1, "write_c4000", 0xc4000, 0xc7fff);
- update_write_region(2, "write_c8000", 0xc8000, 0xcbfff);
- update_write_region(3, "write_cc000", 0xcc000, 0xcffff);
- update_write_region(4, "write_d0000", 0xd0000, 0xdffff);
- update_write_region(5, "write_e0000", 0xe0000, 0xeffff);
- update_write_region(6, "write_f0000", 0xf0000, 0xfffff);
+ update_write_region(0, 0xc0000, 0xc3fff);
+ update_write_region(1, 0xc4000, 0xc7fff);
+ update_write_region(2, 0xc8000, 0xcbfff);
+ update_write_region(3, 0xcc000, 0xcffff);
+ update_write_region(4, 0xd0000, 0xdffff);
+ update_write_region(5, 0xe0000, 0xeffff);
+ update_write_region(6, 0xf0000, 0xfffff);
}
diff --git a/src/devices/machine/cs4031.h b/src/devices/machine/cs4031.h
index 21cb09f2eb0..b8540380679 100644
--- a/src/devices/machine/cs4031.h
+++ b/src/devices/machine/cs4031.h
@@ -142,8 +142,8 @@ private:
void fast_gatea20(int state);
void keyboard_gatea20(int state);
- void update_read_region(int index, const char *region, offs_t start, offs_t end);
- void update_write_region(int index, const char *region, offs_t start, offs_t end);
+ void update_read_region(int index, offs_t start, offs_t end);
+ void update_write_region(int index, offs_t start, offs_t end);
void update_read_regions();
void update_write_regions();
diff --git a/src/devices/machine/ds1386.cpp b/src/devices/machine/ds1386.cpp
index c5a9048f2fc..4333a6bcc5c 100644
--- a/src/devices/machine/ds1386.cpp
+++ b/src/devices/machine/ds1386.cpp
@@ -46,7 +46,7 @@ ds1386_device::ds1386_device(const machine_config &mconfig, device_type type, co
, m_watchdog_timer(nullptr)
, m_inta_timer(nullptr)
, m_intb_timer(nullptr)
- , m_default_data(*this, DEVICE_SELF, size)
+ , m_default_data(*this, DEVICE_SELF)
, m_hundredths(0)
, m_seconds(0)
, m_minutes(0)
diff --git a/src/devices/machine/er1400.cpp b/src/devices/machine/er1400.cpp
index a4eed0dacae..f42a9f58f9c 100644
--- a/src/devices/machine/er1400.cpp
+++ b/src/devices/machine/er1400.cpp
@@ -42,7 +42,7 @@ DEFINE_DEVICE_TYPE(ER1400, er1400_device, "er1400", "ER1400 Serial EAROM (100x14
er1400_device::er1400_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, ER1400, tag, owner, clock)
, device_nvram_interface(mconfig, *this)
- , m_default_data(*this, DEVICE_SELF, 100)
+ , m_default_data(*this, DEVICE_SELF)
, m_clock_input(0)
, m_code_input(0)
, m_data_input(0)
diff --git a/src/devices/machine/er2055.cpp b/src/devices/machine/er2055.cpp
index ad61551bd8f..20fd3805e7d 100644
--- a/src/devices/machine/er2055.cpp
+++ b/src/devices/machine/er2055.cpp
@@ -37,7 +37,7 @@ DEFINE_DEVICE_TYPE(ER2055, er2055_device, "er2055", "ER2055 EAROM (64x8)")
er2055_device::er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ER2055, tag, owner, clock),
device_nvram_interface(mconfig, *this),
- m_default_data(*this, DEVICE_SELF, SIZE_DATA),
+ m_default_data(*this, DEVICE_SELF),
m_control_state(0),
m_address(0),
m_data(0)
diff --git a/src/devices/machine/i82875p.cpp b/src/devices/machine/i82875p.cpp
index 850ca50821a..31151af9984 100644
--- a/src/devices/machine/i82875p.cpp
+++ b/src/devices/machine/i82875p.cpp
@@ -443,7 +443,7 @@ void i82875p_overflow_device::overflow_map(address_map &map)
{
map(0x000, 0x007).rw(FUNC(i82875p_overflow_device::dram_row_boundary_r), FUNC(i82875p_overflow_device::dram_row_boundary_w));
map(0x010, 0x013).rw(FUNC(i82875p_overflow_device::dram_row_attribute_r), FUNC(i82875p_overflow_device::dram_row_attribute_w));
- map(0x060, 0x064).rw(FUNC(i82875p_overflow_device::dram_timing_r), FUNC(i82875p_overflow_device::dram_timing_w));
+ map(0x060, 0x063).rw(FUNC(i82875p_overflow_device::dram_timing_r), FUNC(i82875p_overflow_device::dram_timing_w));
map(0x068, 0x06b).rw(FUNC(i82875p_overflow_device::dram_controller_mode_r), FUNC(i82875p_overflow_device::dram_controller_mode_w));
}
diff --git a/src/devices/machine/i8355.cpp b/src/devices/machine/i8355.cpp
index f6a28f07297..caa31eb7e1a 100644
--- a/src/devices/machine/i8355.cpp
+++ b/src/devices/machine/i8355.cpp
@@ -93,7 +93,7 @@ i8355_device::i8355_device(const machine_config &mconfig, const char *tag, devic
m_out_pa_cb(*this),
m_in_pb_cb(*this),
m_out_pb_cb(*this),
- m_rom(*this, DEVICE_SELF, 0x800)
+ m_rom(*this, DEVICE_SELF)
{
}
diff --git a/src/devices/machine/mos6530n.cpp b/src/devices/machine/mos6530n.cpp
index 0c19a5aaed6..e6ad3c9dc86 100644
--- a/src/devices/machine/mos6530n.cpp
+++ b/src/devices/machine/mos6530n.cpp
@@ -118,9 +118,9 @@ void mos6532_new_device::io_w(offs_t offset, uint8_t data)
// mos6530_device_base - constructor
//-------------------------------------------------
-mos6530_device_base::mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+mos6530_device_base::mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, u32 rsize) :
device_t(mconfig, type, tag, owner, clock),
- m_ram(*this, finder_base::DUMMY_TAG),
+ m_ram(*this, finder_base::DUMMY_TAG, rsize, ENDIANNESS_LITTLE),
m_rom(*this, DEVICE_SELF),
m_irq_cb(*this),
m_in8_pa_cb(*this),
@@ -155,7 +155,7 @@ mos6530_device_base::mos6530_device_base(const machine_config &mconfig, device_t
//-------------------------------------------------
mos6530_new_device::mos6530_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mos6530_device_base(mconfig, MOS6530_NEW, tag, owner, clock) { }
+ : mos6530_device_base(mconfig, MOS6530_NEW, tag, owner, clock, 0x40) { }
//-------------------------------------------------
@@ -163,7 +163,7 @@ mos6530_new_device::mos6530_new_device(const machine_config &mconfig, const char
//-------------------------------------------------
mos6532_new_device::mos6532_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mos6530_device_base(mconfig, MOS6532_NEW, tag, owner, clock) { }
+ : mos6530_device_base(mconfig, MOS6532_NEW, tag, owner, clock, 0x80) { }
//-------------------------------------------------
@@ -203,22 +203,6 @@ void mos6530_device_base::device_start()
save_item(NAME(m_timer));
}
-void mos6530_new_device::device_start()
-{
- mos6530_device_base::device_start();
-
- // allocate RAM
- m_ram.allocate(0x40);
-}
-
-void mos6532_new_device::device_start()
-{
- mos6530_device_base::device_start();
-
- // allocate RAM
- m_ram.allocate(0x80);
-}
-
//-------------------------------------------------
// device_reset - device-specific reset
diff --git a/src/devices/machine/mos6530n.h b/src/devices/machine/mos6530n.h
index 3a6a2289944..2822d18d6bf 100644
--- a/src/devices/machine/mos6530n.h
+++ b/src/devices/machine/mos6530n.h
@@ -96,7 +96,7 @@ public:
protected:
// construction/destruction
- mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, u32 rsize);
// device-level overrides
virtual void device_start() override;
@@ -137,7 +137,7 @@ protected:
void timer_on_w(offs_t offset, uint8_t data);
void edge_w(uint8_t data);
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
optional_region_ptr<uint8_t> m_rom;
devcb_write_line m_irq_cb;
@@ -207,8 +207,6 @@ public:
protected:
// device-level overrides
- virtual void device_start() override;
-
void update_pb() override;
void update_irq() override;
uint8_t get_irq_flags() override;
@@ -227,10 +225,6 @@ public:
// is there a better way to access the memory map when not using m()?
uint8_t io_r(offs_t offset);
void io_w(offs_t offset, uint8_t data);
-
-protected:
- // device-level overrides
- virtual void device_start() override;
};
diff --git a/src/devices/machine/rp5h01.cpp b/src/devices/machine/rp5h01.cpp
index 21367354256..655ffd5f841 100644
--- a/src/devices/machine/rp5h01.cpp
+++ b/src/devices/machine/rp5h01.cpp
@@ -35,7 +35,7 @@ DEFINE_DEVICE_TYPE(RP5H01, rp5h01_device, "rp5h01", "RP5H01 6/7-bit Counter")
rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, RP5H01, tag, owner, clock)
, m_data(nullptr)
- , m_rom(*this, DEVICE_SELF, 0x10)
+ , m_rom(*this, DEVICE_SELF)
{
}
diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp
index ce9d6d3f327..5128ef1ac62 100644
--- a/src/devices/machine/timekpr.cpp
+++ b/src/devices/machine/timekpr.cpp
@@ -93,7 +93,7 @@ timekeeper_device::timekeeper_device(const machine_config &mconfig, device_type
, device_nvram_interface(mconfig, *this)
, m_reset_cb(*this)
, m_irq_cb(*this)
- , m_default_data(*this, DEVICE_SELF, size)
+ , m_default_data(*this, DEVICE_SELF)
, m_size(size)
{
}
diff --git a/src/devices/machine/vt82c496.cpp b/src/devices/machine/vt82c496.cpp
index 16d309adb91..ad58ac95b69 100644
--- a/src/devices/machine/vt82c496.cpp
+++ b/src/devices/machine/vt82c496.cpp
@@ -17,7 +17,28 @@ DEFINE_DEVICE_TYPE(VT82C496, vt82c496_device, "vt82c496", "VIA VT82C496 system c
vt82c496_device::vt82c496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, VT82C496, tag, owner, clock), m_cpu(*this, finder_base::DUMMY_TAG), m_space(nullptr), m_ram(*this, finder_base::DUMMY_TAG), m_rom(*this, finder_base::DUMMY_TAG), m_reg_select(0)
+ : device_t(mconfig, VT82C496, tag, owner, clock), m_cpu(*this, finder_base::DUMMY_TAG), m_space(nullptr), m_ram(*this, finder_base::DUMMY_TAG), m_rom(*this, finder_base::DUMMY_TAG),
+ m_bios_c0_r(*this, "bios_c0_r"),
+ m_bios_c4_r(*this, "bios_c4_r"),
+ m_bios_c8_r(*this, "bios_c8_r"),
+ m_bios_cc_r(*this, "bios_cc_r"),
+ m_bios_d0_r(*this, "bios_d0_r"),
+ m_bios_d4_r(*this, "bios_d4_r"),
+ m_bios_d8_r(*this, "bios_d8_r"),
+ m_bios_dc_r(*this, "bios_dc_r"),
+ m_bios_e0_r(*this, "bios_e0_r"),
+ m_bios_f0_r(*this, "bios_f0_r"),
+ m_bios_c0_w(*this, "bios_c0_w"),
+ m_bios_c4_w(*this, "bios_c4_w"),
+ m_bios_c8_w(*this, "bios_c8_w"),
+ m_bios_cc_w(*this, "bios_cc_w"),
+ m_bios_d0_w(*this, "bios_d0_w"),
+ m_bios_d4_w(*this, "bios_d4_w"),
+ m_bios_d8_w(*this, "bios_d8_w"),
+ m_bios_dc_w(*this, "bios_dc_w"),
+ m_bios_e0_w(*this, "bios_e0_w"),
+ m_bios_f0_w(*this, "bios_f0_w"),
+ m_reg_select(0)
{
}
@@ -34,27 +55,27 @@ void vt82c496_device::device_reset()
memset(m_reg,0,0x100);
// set up default ROM banking
- m_space->install_read_bank(0xc0000,0xc3fff,0,"bios_c0_r");
- m_space->install_read_bank(0xc4000,0xc7fff,0,"bios_c4_r");
- m_space->install_read_bank(0xc8000,0xcbfff,0,"bios_c8_r");
- m_space->install_read_bank(0xcc000,0xcffff,0,"bios_cc_r");
- m_space->install_read_bank(0xd0000,0xd3fff,0,"bios_d0_r");
- m_space->install_read_bank(0xd4000,0xd7fff,0,"bios_d4_r");
- m_space->install_read_bank(0xd8000,0xdbfff,0,"bios_d8_r");
- m_space->install_read_bank(0xdc000,0xdffff,0,"bios_dc_r");
- m_space->install_read_bank(0xe0000,0xeffff,0,"bios_e0_r");
- m_space->install_read_bank(0xf0000,0xfffff,0,"bios_f0_r");
+ m_space->install_read_bank(0xc0000,0xc3fff,0,m_bios_c0_r);
+ m_space->install_read_bank(0xc4000,0xc7fff,0,m_bios_c4_r);
+ m_space->install_read_bank(0xc8000,0xcbfff,0,m_bios_c8_r);
+ m_space->install_read_bank(0xcc000,0xcffff,0,m_bios_cc_r);
+ m_space->install_read_bank(0xd0000,0xd3fff,0,m_bios_d0_r);
+ m_space->install_read_bank(0xd4000,0xd7fff,0,m_bios_d4_r);
+ m_space->install_read_bank(0xd8000,0xdbfff,0,m_bios_d8_r);
+ m_space->install_read_bank(0xdc000,0xdffff,0,m_bios_dc_r);
+ m_space->install_read_bank(0xe0000,0xeffff,0,m_bios_e0_r);
+ m_space->install_read_bank(0xf0000,0xfffff,0,m_bios_f0_r);
m_space->nop_write(0xc0000,0xfffff);
- machine().root_device().membank("bios_c0_r")->set_base(&m_rom[0]);
- machine().root_device().membank("bios_c4_r")->set_base(&m_rom[0x4000/4]);
- machine().root_device().membank("bios_c8_r")->set_base(&m_rom[0x8000/4]);
- machine().root_device().membank("bios_cc_r")->set_base(&m_rom[0xc000/4]);
- machine().root_device().membank("bios_d0_r")->set_base(&m_rom[0x10000/4]);
- machine().root_device().membank("bios_d4_r")->set_base(&m_rom[0x14000/4]);
- machine().root_device().membank("bios_d8_r")->set_base(&m_rom[0x18000/4]);
- machine().root_device().membank("bios_dc_r")->set_base(&m_rom[0x1c000/4]);
- machine().root_device().membank("bios_e0_r")->set_base(&m_rom[0x20000/4]);
- machine().root_device().membank("bios_f0_r")->set_base(&m_rom[0x30000/4]);
+ m_bios_c0_r->set_base(m_rom);
+ m_bios_c4_r->set_base(m_rom+0x4000);
+ m_bios_c8_r->set_base(m_rom+0x8000);
+ m_bios_cc_r->set_base(m_rom+0xc000);
+ m_bios_d0_r->set_base(m_rom+0x10000);
+ m_bios_d4_r->set_base(m_rom+0x14000);
+ m_bios_d8_r->set_base(m_rom+0x18000);
+ m_bios_dc_r->set_base(m_rom+0x1c000);
+ m_bios_e0_r->set_base(m_rom+0x20000);
+ m_bios_f0_r->set_base(m_rom+0x30000);
}
uint8_t vt82c496_device::read(offs_t offset)
@@ -89,49 +110,49 @@ void vt82c496_device::write(offs_t offset, uint8_t data)
void vt82c496_device::update_mem_c0(uint8_t data)
{
if(data & 0x80)
- machine().root_device().membank("bios_cc_r")->set_base(m_ram->pointer()+0xcc000);
+ m_bios_cc_r->set_base(m_ram->pointer()+0xcc000);
else
- machine().root_device().membank("bios_cc_r")->set_base(&m_rom[0xc000/4]);
+ m_bios_cc_r->set_base(m_rom+0xc000/4);
if(data & 0x40)
{
- m_space->install_write_bank(0xcc000,0xcffff,0,"bios_cc_w");
- machine().root_device().membank("bios_cc_w")->set_base(m_ram->pointer()+0xcc000);
+ m_space->install_write_bank(0xcc000,0xcffff,0,m_bios_cc_w);
+ m_bios_cc_w->set_base(m_ram->pointer()+0xcc000);
}
else
m_space->nop_write(0xcc000,0xcffff);
if(data & 0x20)
- machine().root_device().membank("bios_c8_r")->set_base(m_ram->pointer()+0xc8000);
+ m_bios_c8_r->set_base(m_ram->pointer()+0xc8000);
else
- machine().root_device().membank("bios_c8_r")->set_base(&m_rom[0x8000/4]);
+ m_bios_c8_r->set_base(m_rom+0x8000/4);
if(data & 0x10)
{
- m_space->install_write_bank(0xc8000,0xcbfff,0,"bios_c8_w");
- machine().root_device().membank("bios_c8_w")->set_base(m_ram->pointer()+0xc8000);
+ m_space->install_write_bank(0xc8000,0xcbfff,0,m_bios_c8_w);
+ m_bios_c8_w->set_base(m_ram->pointer()+0xc8000);
}
else
m_space->nop_write(0xc8000,0xcbfff);
if(data & 0x08)
- machine().root_device().membank("bios_c4_r")->set_base(m_ram->pointer()+0xc4000);
+ m_bios_c4_r->set_base(m_ram->pointer()+0xc4000);
else
- machine().root_device().membank("bios_c4_r")->set_base(&m_rom[0x4000/4]);
+ m_bios_c4_r->set_base(m_rom+0x4000/4);
if(data & 0x04)
{
- m_space->install_write_bank(0xc4000,0xc7fff,0,"bios_c4_w");
- machine().root_device().membank("bios_c4_w")->set_base(m_ram->pointer()+0xc4000);
+ m_space->install_write_bank(0xc4000,0xc7fff,0,m_bios_c4_w);
+ m_bios_c4_w->set_base(m_ram->pointer()+0xc4000);
}
else
m_space->nop_write(0xc4000,0xc7fff);
if(data & 0x02)
- machine().root_device().membank("bios_c0_r")->set_base(m_ram->pointer()+0xc0000);
+ m_bios_c0_r->set_base(m_ram->pointer()+0xc0000);
else
- machine().root_device().membank("bios_c0_r")->set_base(&m_rom[0]);
+ m_bios_c0_r->set_base(m_rom+0);
if(data & 0x01)
{
- m_space->install_write_bank(0xc0000,0xc3fff,0,"bios_c0_w");
- machine().root_device().membank("bios_c0_w")->set_base(m_ram->pointer()+0xc0000);
+ m_space->install_write_bank(0xc0000,0xc3fff,0,m_bios_c0_w);
+ m_bios_c0_w->set_base(m_ram->pointer()+0xc0000);
}
else
m_space->nop_write(0xc0000,0xc3fff);
@@ -140,49 +161,49 @@ void vt82c496_device::update_mem_c0(uint8_t data)
void vt82c496_device::update_mem_d0(uint8_t data)
{
if(data & 0x80)
- machine().root_device().membank("bios_dc_r")->set_base(m_ram->pointer()+0xdc000);
+ m_bios_dc_r->set_base(m_ram->pointer()+0xdc000);
else
- machine().root_device().membank("bios_dc_r")->set_base(&m_rom[0x1c000/4]);
+ m_bios_dc_r->set_base(m_rom+0x1c000/4);
if(data & 0x40)
{
- m_space->install_write_bank(0xdc000,0xdffff,0,"bios_dc_w");
- machine().root_device().membank("bios_dc_w")->set_base(m_ram->pointer()+0xdc000);
+ m_space->install_write_bank(0xdc000,0xdffff,0,m_bios_dc_w);
+ m_bios_dc_w->set_base(m_ram->pointer()+0xdc000);
}
else
m_space->nop_write(0xdc000,0xdffff);
if(data & 0x20)
- machine().root_device().membank("bios_d8_r")->set_base(m_ram->pointer()+0xd8000);
+ m_bios_d8_r->set_base(m_ram->pointer()+0xd8000);
else
- machine().root_device().membank("bios_d8_r")->set_base(&m_rom[0x18000/4]);
+ m_bios_d8_r->set_base(m_rom+0x18000/4);
if(data & 0x10)
{
- m_space->install_write_bank(0xd8000,0xdbfff,0,"bios_d8_w");
- machine().root_device().membank("bios_d8_w")->set_base(m_ram->pointer()+0xd8000);
+ m_space->install_write_bank(0xd8000,0xdbfff,0,m_bios_d8_w);
+ m_bios_d8_w->set_base(m_ram->pointer()+0xd8000);
}
else
m_space->nop_write(0xd8000,0xdbfff);
if(data & 0x08)
- machine().root_device().membank("bios_d4_r")->set_base(m_ram->pointer()+0xd4000);
+ m_bios_d4_r->set_base(m_ram->pointer()+0xd4000);
else
- machine().root_device().membank("bios_d4_r")->set_base(&m_rom[0x14000/4]);
+ m_bios_d4_r->set_base(m_rom+0x14000/4);
if(data & 0x04)
{
- m_space->install_write_bank(0xd4000,0xd7fff,0,"bios_d4_w");
- machine().root_device().membank("bios_d4_w")->set_base(m_ram->pointer()+0xd4000);
+ m_space->install_write_bank(0xd4000,0xd7fff,0,m_bios_d4_w);
+ m_bios_d4_w->set_base(m_ram->pointer()+0xd4000);
}
else
m_space->nop_write(0xd4000,0xd7fff);
if(data & 0x02)
- machine().root_device().membank("bios_d0_r")->set_base(m_ram->pointer()+0xd0000);
+ m_bios_d0_r->set_base(m_ram->pointer()+0xd0000);
else
- machine().root_device().membank("bios_d0_r")->set_base(&m_rom[0x10000/4]);
+ m_bios_d0_r->set_base(m_rom+0x10000/4);
if(data & 0x01)
{
- m_space->install_write_bank(0xd0000,0xd3fff,0,"bios_d0_w");
- machine().root_device().membank("bios_d0_w")->set_base(m_ram->pointer()+0xd0000);
+ m_space->install_write_bank(0xd0000,0xd3fff,0,m_bios_d0_w);
+ m_bios_d0_w->set_base(m_ram->pointer()+0xd0000);
}
else
m_space->nop_write(0xd0000,0xd3fff);
@@ -191,27 +212,27 @@ void vt82c496_device::update_mem_d0(uint8_t data)
void vt82c496_device::update_mem_e0(uint8_t data)
{
if(data & 0x80)
- machine().root_device().membank("bios_e0_r")->set_base(m_ram->pointer()+0xe0000);
+ m_bios_e0_r->set_base(m_ram->pointer()+0xe0000);
else
- machine().root_device().membank("bios_e0_r")->set_base(&m_rom[0x20000/4]);
+ m_bios_e0_r->set_base(m_rom+0x20000/4);
if(data & 0x40)
{
- m_space->install_write_bank(0xe0000,0xeffff,0,"bios_e0_w");
- machine().root_device().membank("bios_e0_w")->set_base(m_ram->pointer()+0xe0000);
+ m_space->install_write_bank(0xe0000,0xeffff,0,m_bios_e0_w);
+ m_bios_e0_w->set_base(m_ram->pointer()+0xe0000);
}
else
m_space->nop_write(0xe0000,0xeffff);
if(data & 0x20)
- machine().root_device().membank("bios_f0_r")->set_base(m_ram->pointer()+0xf0000);
+ m_bios_f0_r->set_base(m_ram->pointer()+0xf0000);
else
- machine().root_device().membank("bios_f0_r")->set_base(&m_rom[0x30000/4]);
+ m_bios_f0_r->set_base(m_rom+0x30000/4);
if(data & 0x10)
{
- m_space->install_write_bank(0xf0000,0xfffff,0,"bios_f0_w");
- machine().root_device().membank("bios_f0_w")->set_base(m_ram->pointer()+0xf0000);
+ m_space->install_write_bank(0xf0000,0xfffff,0,m_bios_f0_w);
+ m_bios_f0_w->set_base(m_ram->pointer()+0xf0000);
}
else
m_space->nop_write(0xf0000,0xfffff);
diff --git a/src/devices/machine/vt82c496.h b/src/devices/machine/vt82c496.h
index 48028579ed2..c73a0ace79a 100644
--- a/src/devices/machine/vt82c496.h
+++ b/src/devices/machine/vt82c496.h
@@ -37,6 +37,26 @@ private:
address_space* m_space;
required_device<ram_device> m_ram;
required_region_ptr<uint32_t> m_rom;
+ memory_bank_creator m_bios_c0_r;
+ memory_bank_creator m_bios_c4_r;
+ memory_bank_creator m_bios_c8_r;
+ memory_bank_creator m_bios_cc_r;
+ memory_bank_creator m_bios_d0_r;
+ memory_bank_creator m_bios_d4_r;
+ memory_bank_creator m_bios_d8_r;
+ memory_bank_creator m_bios_dc_r;
+ memory_bank_creator m_bios_e0_r;
+ memory_bank_creator m_bios_f0_r;
+ memory_bank_creator m_bios_c0_w;
+ memory_bank_creator m_bios_c4_w;
+ memory_bank_creator m_bios_c8_w;
+ memory_bank_creator m_bios_cc_w;
+ memory_bank_creator m_bios_d0_w;
+ memory_bank_creator m_bios_d4_w;
+ memory_bank_creator m_bios_d8_w;
+ memory_bank_creator m_bios_dc_w;
+ memory_bank_creator m_bios_e0_w;
+ memory_bank_creator m_bios_f0_w;
uint8_t m_reg[0x100];
uint8_t m_reg_select;
diff --git a/src/devices/machine/x2201.cpp b/src/devices/machine/x2201.cpp
index 90d731b7e3e..d93fca101ff 100644
--- a/src/devices/machine/x2201.cpp
+++ b/src/devices/machine/x2201.cpp
@@ -45,7 +45,7 @@ DEFINE_DEVICE_TYPE(X2201, x2201_device, "x2201", "Xicor X2201 1024x1 NOVRAM")
x2201_device::x2201_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, X2201, tag, owner, clock)
, device_nvram_interface(mconfig, *this)
- , m_default_data(*this, DEVICE_SELF, 1024 / 8)
+ , m_default_data(*this, DEVICE_SELF)
, m_cs(false)
, m_store(false)
, m_array_recall(false)
@@ -61,7 +61,7 @@ void x2201_device::device_start()
{
// create arrays
m_ram = make_unique_clear<u8[]>(1024 / 8);
- m_eeprom = std::make_unique<u8[]>(1028 / 8);
+ m_eeprom = std::make_unique<u8[]>(1024 / 8);
// register state for saving
save_pointer(NAME(m_ram), 1024 / 8);
diff --git a/src/devices/machine/x2212.cpp b/src/devices/machine/x2212.cpp
index 84a4e0b565b..cc5028e0cc7 100644
--- a/src/devices/machine/x2212.cpp
+++ b/src/devices/machine/x2212.cpp
@@ -37,7 +37,7 @@ x2212_device::x2212_device(const machine_config &mconfig, device_type type, cons
, m_store(false)
, m_array_recall(false)
, m_size_data(size_data)
- , m_default_data(*this, DEVICE_SELF, size_data)
+ , m_default_data(*this, DEVICE_SELF)
{
}
diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp
index d9d8427688a..14da319ba19 100644
--- a/src/devices/sound/tms5110.cpp
+++ b/src/devices/sound/tms5110.cpp
@@ -1511,7 +1511,7 @@ DEFINE_DEVICE_TYPE(TMSPROM, tmsprom_device, "tmsprom", "TMSPROM")
tmsprom_device::tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TMSPROM, tag, owner, clock),
m_rom(*this, DEVICE_SELF),
- m_prom(*this, finder_base::DUMMY_TAG, 0x20),
+ m_prom(*this, finder_base::DUMMY_TAG),
m_rom_size(0),
m_pdc_bit(0),
m_ctl1_bit(0),
diff --git a/src/devices/video/ppu2c0x.cpp b/src/devices/video/ppu2c0x.cpp
index bad650cf0a6..e02e8302c34 100644
--- a/src/devices/video/ppu2c0x.cpp
+++ b/src/devices/video/ppu2c0x.cpp
@@ -166,7 +166,7 @@ ppu2c0x_device::ppu2c0x_device(const machine_config& mconfig, device_type type,
ppu2c0x_rgb_device::ppu2c0x_rgb_device(const machine_config& mconfig, device_type type, const char* tag, device_t* owner, uint32_t clock) :
ppu2c0x_device(mconfig, type, tag, owner, clock),
- m_palette_data(*this, "palette", 0xc0)
+ m_palette_data(*this, "palette")
{
}
diff --git a/src/devices/video/t6963c.cpp b/src/devices/video/t6963c.cpp
index 0e63572dddb..b6989b38a6c 100644
--- a/src/devices/video/t6963c.cpp
+++ b/src/devices/video/t6963c.cpp
@@ -36,7 +36,7 @@ t6963c_device::t6963c_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, T6963C, tag, owner, clock)
, device_memory_interface(mconfig, *this)
, m_display_config("display", ENDIANNESS_LITTLE, 8, 16, 0)
- , m_cgrom(*this, "cgrom", 0x400)
+ , m_cgrom(*this, "cgrom")
, m_display_ram(nullptr)
, m_data(0)
, m_adp(0)
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp
index 97f46511237..7253bbb7cbd 100644
--- a/src/emu/addrmap.cpp
+++ b/src/emu/addrmap.cpp
@@ -1148,18 +1148,33 @@ void address_map::map_validity_check(validity_checker &valid, int spacenum) cons
osd_printf_error("In %s memory range %x-%x, mirror %x touches a select bit (%x)\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend, entry.m_addrmirror, entry.m_addrmirror & entry.m_addrselect);
// if this is a program space, auto-assign implicit ROM entries
- if (entry.m_read.m_type == AMH_ROM && entry.m_region == nullptr)
+ if (entry.m_read.m_type == AMH_ROM && entry.m_region == nullptr && spacenum == AS_PROGRAM && entry.m_share == nullptr)
{
entry.m_region = m_device->tag();
entry.m_rgnoffs = entry.m_addrstart;
}
+ // detect conflicts between region and share
+ if (entry.m_region && entry.m_share)
+ osd_printf_error("%s space memory map entry %X-%X has both .region() and .share()\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend);
+
+
+ // Detect inaccesible memory. Region automapping is handled before
+ if (entry.m_read.m_type == AMH_ROM && entry.m_write.m_type != AMH_RAM &&
+ !entry.m_share && !entry.m_region)
+ osd_printf_error("%s space memory map entry %X-%X has .rom() but no .region() or .share()\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend);
+ if (entry.m_read.m_type != AMH_RAM && entry.m_write.m_type == AMH_RAM &&
+ !entry.m_share && !entry.m_region)
+ osd_printf_error("%s space memory map entry %X-%X has .writeonly() but no .region() or .share()\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend);
+
// if this entry references a memory region, validate it
- if (entry.m_region != nullptr && entry.m_share == nullptr)
+ if (entry.m_region != nullptr)
{
// address map entries that reference regions but are NOPs are pointless
- if (entry.m_read.m_type == AMH_NONE && entry.m_write.m_type == AMH_NONE)
- osd_printf_error("%s space references memory region %s, but is noprw()\n", spaceconfig.m_name, entry.m_region);
+ if (entry.m_read.m_type != AMH_ROM && entry.m_read.m_type != AMH_RAM)
+ osd_printf_error("%s space memory map entry %X-%X references memory region %s, but can't read it\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend, entry.m_region);
+ if (entry.m_write.m_type == AMH_RAM)
+ osd_printf_error("%s space memory map entry %X-%X references memory region %s, but wants to write to it\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend, entry.m_region);
// make sure we can resolve the full path to the region
bool found = false;
diff --git a/src/emu/devfind.cpp b/src/emu/devfind.cpp
index 3cfcd17c223..6ec76fe3fae 100644
--- a/src/emu/devfind.cpp
+++ b/src/emu/devfind.cpp
@@ -157,18 +157,8 @@ void *finder_base::find_memregion(u8 width, size_t &length, bool required) const
return nullptr;
}
- // check the length and warn if other than specified
- size_t const length_found = region->bytes() / width;
- if (length != 0 && length != length_found)
- {
- if (required)
- osd_printf_warning("Region '%s' found but has %d bytes, not %ld as requested\n", m_tag, region->bytes(), long(length*width));
- length = 0;
- return nullptr;
- }
-
// return results
- length = length_found;
+ length = region->bytes()/width;
return region->base();
}
@@ -177,7 +167,7 @@ void *finder_base::find_memregion(u8 width, size_t &length, bool required) const
// validate_memregion - find memory region
//-------------------------------------------------
-bool finder_base::validate_memregion(size_t bytes, bool required) const
+bool finder_base::validate_memregion(bool required) const
{
// make sure we can resolve the full path to the region
size_t bytes_found = 0;
@@ -198,13 +188,6 @@ bool finder_base::validate_memregion(size_t bytes, bool required) const
break;
}
- // check the length and warn if other than specified
- if ((bytes_found != 0) && (bytes != 0) && (bytes != bytes_found))
- {
- osd_printf_warning("Region '%s' found but has %ld bytes, not %ld as requested\n", m_tag, long(bytes_found), long(bytes));
- bytes_found = 0;
- }
-
return report_missing(bytes_found != 0, "memory region", required);
}
@@ -348,3 +331,68 @@ void finder_base::printf_warning(const char *format, ...)
osd_printf_warning("%s", buffer);
va_end(argptr);
}
+
+
+bool memory_bank_creator::findit(bool validation)
+{
+ if (validation)
+ return true;
+
+ device_t &dev = m_base.get();
+ memory_manager &manager = dev.machine().memory();
+ std::string tag = dev.subtag(m_tag);
+ memory_bank *bank = manager.bank_find(tag);
+ if (bank)
+ m_target = bank;
+ else
+ m_target = manager.bank_alloc(dev, tag);
+ return true;
+}
+
+void memory_bank_creator::end_configuration()
+{
+ m_target = nullptr;
+}
+
+
+template<typename uX> memory_share_creator<uX>::memory_share_creator(device_t &base, char const *tag, size_t bytes, endianness_t endianness)
+ : finder_base(base, tag)
+ , m_width(sizeof(uX)*8)
+ , m_bytes(bytes)
+ , m_endianness(endianness)
+{
+}
+
+template<typename uX> bool memory_share_creator<uX>::findit(bool validation)
+{
+ if (validation)
+ return true;
+
+ device_t &dev = m_base.get();
+ memory_manager &manager = dev.machine().memory();
+ std::string tag = dev.subtag(m_tag);
+ memory_share *share = manager.share_find(tag);
+ if (share)
+ {
+ m_target = share;
+ std::string result = share->compare(m_width, m_bytes, m_endianness);
+ if (!result.empty())
+ {
+ osd_printf_error("%s\n", result);
+ return false;
+ }
+ }
+ else
+ m_target = manager.share_alloc(dev, tag, m_width, m_bytes, m_endianness);
+ return true;
+}
+
+template<typename uX> void memory_share_creator<uX>::end_configuration()
+{
+ m_target = nullptr;
+}
+
+template class memory_share_creator<u8>;
+template class memory_share_creator<u16>;
+template class memory_share_creator<u32>;
+template class memory_share_creator<u64>;
diff --git a/src/emu/devfind.h b/src/emu/devfind.h
index 3922624e272..b56b9e11b80 100644
--- a/src/emu/devfind.h
+++ b/src/emu/devfind.h
@@ -353,7 +353,7 @@ protected:
/// it is optional.
/// \return True if the region is optional, or if the region is
/// required and a matching region is found, or false otherwise.
- bool validate_memregion(size_t bytes, bool required) const;
+ bool validate_memregion(bool required) const;
/// \brief Find a memory share
///
@@ -676,7 +676,7 @@ private:
virtual bool findit(bool isvalidation) override
{
if (isvalidation)
- return this->validate_memregion(0, Required);
+ return this->validate_memregion(Required);
assert(!this->m_resolved);
this->m_resolved = true;
@@ -773,6 +773,94 @@ template <unsigned Count, bool Required> using memory_bank_array_finder = object
template <unsigned Count> using optional_memory_bank_array = memory_bank_array_finder<Count, false>;
template <unsigned Count> using required_memory_bank_array = memory_bank_array_finder<Count, true>;
+/// \brief Memory bank creator
+///
+/// Creates a memory bank or picks up an existing one.
+class memory_bank_creator : finder_base
+{
+public:
+ memory_bank_creator(device_t &base, char const *tag) : finder_base(base, tag) { }
+ virtual ~memory_bank_creator() = default;
+
+ /// \brief Get pointer to target bank object
+ /// \return Pointer to target bank object if found, or nullptr otherwise.
+ memory_bank *target() const { return m_target; }
+
+ /// \brief Cast-to-pointer operator
+ ///
+ /// Allows implicit casting to a pointer to the target bank object.
+ /// \return Pointer to target bank object
+ operator memory_bank *() const { return m_target; }
+
+ /// \brief Pointer member access operator
+ ///
+ /// Allows pointer-member-style access to members of the target
+ /// bank object.
+ /// \return Pointer to target bank object
+ memory_bank *operator->() const { return m_target; }
+
+protected:
+ virtual bool findit(bool isvalidation) override;
+ virtual void end_configuration() override;
+
+ /// \brief Pointer to target object
+ ///
+ /// Pointer to target object, or nullptr if the creation has not been
+ /// attempted yet.
+ memory_bank *m_target = nullptr;
+};
+
+template <unsigned Count> using memory_bank_array_creator = object_array_finder<memory_bank_creator, Count>;
+
+/// \brief Memory share creator
+///
+/// Creates a memory share or picks up an existing one.
+template<typename uX> class memory_share_creator : finder_base
+{
+public:
+ memory_share_creator(device_t &base, char const *tag, size_t bytes, endianness_t endianness);
+ virtual ~memory_share_creator() = default;
+
+ /// \brief Get pointer to the share object
+ /// \return Pointer to share object.
+ memory_share *share() const { return m_target; }
+
+ /// \brief Get pointer to the share object backing ram
+ /// \return Pointer to the ram.
+ uX *ptr() const { return reinterpret_cast<uX *>(m_target->ptr()); }
+
+ /// \brief Cast-to-pointer operator
+ ///
+ /// Allows implicit casting to a pointer to the target bank object.
+ /// \return Pointer to target bank object
+ operator uX *() const { return reinterpret_cast<uX *>(m_target->ptr()); }
+
+ /// \brief Pointer member access operator
+ ///
+ /// Allows pointer-member-style access to members of the target
+ /// bank object.
+ /// \return Pointer to target bank object
+ memory_share *operator->() const { return m_target; }
+
+ size_t bytes() const { return m_target->bytes(); }
+ endianness_t endianness() const { return m_target->endianness(); }
+ u8 bitwidth() const { return m_target->bitwidth(); }
+ u8 bytewidth() const { return m_target->bytewidth(); }
+
+protected:
+ virtual bool findit(bool isvalidation) override;
+ virtual void end_configuration() override;
+
+ /// \brief Pointer to target object
+ ///
+ /// Pointer to target object, or nullptr if the creation has not been
+ /// attempted yet.
+ memory_share *m_target = nullptr;
+
+ const u8 m_width; // width of the shared region in bits
+ const size_t m_bytes; // size of the shared region in bytes
+ const endianness_t m_endianness; // endianness of the memory
+};
/// \brief I/O port finder template
///
@@ -975,9 +1063,8 @@ public:
/// pointer remains valid until resolution time.
/// \param [in] length Desired memory region length in units of the
/// size of the element type, or zero to match any region length.
- region_ptr_finder(device_t &base, char const *tag, size_t length = 0)
+ region_ptr_finder(device_t &base, char const *tag)
: object_finder_base<PointerType, Required>(base, tag)
- , m_desired_length(length)
, m_length(0)
{
}
@@ -1025,21 +1112,15 @@ private:
virtual bool findit(bool isvalidation) override
{
if (isvalidation)
- return this->validate_memregion(sizeof(PointerType) * m_desired_length, Required);
+ return this->validate_memregion(Required);
assert(!this->m_resolved);
this->m_resolved = true;
- m_length = m_desired_length;
this->m_target = reinterpret_cast<PointerType *>(this->find_memregion(sizeof(PointerType), m_length, Required));
return this->report_missing("memory region");
}
- /// \brief Desired region length
- ///
- /// Desired region length in units of elements.
- size_t const m_desired_length;
-
- /// \brief Matched region length
+ /// \brief Region length
///
/// Actual length of the region that was found in units of
/// elements, or zero if no matching region has been found.
@@ -1078,11 +1159,9 @@ class shared_ptr_finder : public object_finder_base<PointerType, Required>
{
public:
// construction/destruction
- shared_ptr_finder(device_t &base, char const *tag, u8 width = sizeof(PointerType) * 8)
+ shared_ptr_finder(device_t &base, char const *tag)
: object_finder_base<PointerType, Required>(base, tag)
- , m_width(width)
, m_bytes(0)
- , m_allocated(0)
{
}
@@ -1093,19 +1172,6 @@ public:
u32 bytes() const { return m_bytes; }
u32 mask() const { return m_bytes - 1; } // FIXME: wrong when sizeof(PointerType) != 1
- // setter for setting the object
- void set_target(PointerType *target, size_t bytes) { this->m_target = target; m_bytes = bytes; }
-
- // dynamic allocation of a shared pointer
- void allocate(u32 entries)
- {
- assert(m_allocated.empty());
- m_allocated.resize(entries);
- this->m_target = &m_allocated[0];
- m_bytes = entries * sizeof(PointerType);
- this->m_base.get().save_item(m_allocated, this->m_tag);
- }
-
private:
// finder
virtual bool findit(bool isvalidation) override
@@ -1115,14 +1181,12 @@ private:
assert(!this->m_resolved);
this->m_resolved = true;
- this->m_target = reinterpret_cast<PointerType *>(this->find_memshare(m_width, m_bytes, Required));
+ this->m_target = reinterpret_cast<PointerType *>(this->find_memshare(sizeof(PointerType)*8, m_bytes, Required));
return this->report_missing("shared pointer");
}
// internal state
- u8 const m_width;
size_t m_bytes;
- std::vector<PointerType> m_allocated;
};
template <typename PointerType> using optional_shared_ptr = shared_ptr_finder<PointerType, false>;
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp
index d8235569d1d..6398afc60e4 100644
--- a/src/emu/diimage.cpp
+++ b/src/emu/diimage.cpp
@@ -479,15 +479,14 @@ const char *device_image_interface::get_feature(const char *feature_name) const
// load_software_region -
//-------------------------------------------------
-bool device_image_interface::load_software_region(const char *tag, optional_shared_ptr<u8> &ptr)
+bool device_image_interface::load_software_region(const char *tag, std::unique_ptr<u8[]> &ptr)
{
size_t size = get_software_region_length(tag);
if (size)
{
- ptr.allocate(size);
-
- memcpy(ptr, get_software_region(tag), size);
+ ptr = std::make_unique<u8[]>(size);
+ memcpy(ptr.get(), get_software_region(tag), size);
}
return size > 0;
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index 2f9421bcf4d..9f67530383f 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -164,8 +164,8 @@ public:
u64 length() { check_for_file(); return m_file->size(); }
bool is_readonly() const noexcept { return m_readonly; }
u32 fread(void *buffer, u32 length) { check_for_file(); return m_file->read(buffer, length); }
- u32 fread(optional_shared_ptr<u8> &ptr, u32 length) { ptr.allocate(length); return fread(ptr.target(), length); }
- u32 fread(optional_shared_ptr<u8> &ptr, u32 length, offs_t offset) { ptr.allocate(length); return fread(ptr + offset, length - offset); }
+ u32 fread(std::unique_ptr<u8[]> &ptr, u32 length) { ptr = std::make_unique<u8[]>(length); return fread(ptr.get(), length); }
+ u32 fread(std::unique_ptr<u8[]> &ptr, u32 length, offs_t offset) { ptr = std::make_unique<u8[]>(length); return fread(ptr.get() + offset, length - offset); }
u32 fwrite(const void *buffer, u32 length) { check_for_file(); return m_file->write(buffer, length); }
int fseek(s64 offset, int whence) { check_for_file(); return m_file->seek(offset, whence); }
u64 ftell() { check_for_file(); return m_file->tell(); }
@@ -191,7 +191,7 @@ public:
u8 *get_software_region(const char *tag);
u32 get_software_region_length(const char *tag);
const char *get_feature(const char *feature_name) const;
- bool load_software_region(const char *tag, optional_shared_ptr<u8> &ptr);
+ bool load_software_region(const char *tag, std::unique_ptr<u8[]> &ptr);
u32 crc();
util::hash_collection& hash() { return m_hash; }
diff --git a/src/emu/dimemory.h b/src/emu/dimemory.h
index 3d43c6a6a4d..ed177882d37 100644
--- a/src/emu/dimemory.h
+++ b/src/emu/dimemory.h
@@ -103,8 +103,6 @@ public:
}
void prepare_maps() { for (auto const &space : m_addrspace) { if (space) { space->prepare_map(); } } }
void populate_from_maps() { for (auto const &space : m_addrspace) { if (space) { space->populate_from_map(); } } }
- void allocate_memory() { for (auto const &space : m_addrspace) { if (space) { space->allocate_memory(); } } }
- void locate_memory() { for (auto const &space : m_addrspace) { if (space) { space->locate_memory(); } } }
void set_log_unmap(bool log) { for (auto const &space : m_addrspace) { if (space) { space->set_log_unmap(log); } } }
protected:
diff --git a/src/emu/dirom.cpp b/src/emu/dirom.cpp
index 6440fa2cfc6..da3919a6810 100644
--- a/src/emu/dirom.cpp
+++ b/src/emu/dirom.cpp
@@ -8,7 +8,7 @@ device_rom_interface::device_rom_interface(const machine_config &mconfig, device
device_memory_interface(mconfig, device),
m_rom_tag(device.basetag()),
m_rom_config("rom", endian, datawidth, addrwidth),
- m_bank(nullptr),
+ m_bank(device, "bank"),
m_cur_bank(-1)
{
}
@@ -60,9 +60,9 @@ void device_rom_interface::set_rom(const void *base, u32 size)
m_bank_count = 1;
if(rend >= mend) {
- space().install_read_bank(0, mend, device().tag());
- m_bank = device().machine().memory().banks().find(device().tag())->second.get();
+ space().install_read_bank(0, mend, m_bank);
m_bank->configure_entries(0, m_bank_count, const_cast<void *>(base), mend+1);
+ m_bank->set_entry(0);
m_cur_bank = 0;
} else {
diff --git a/src/emu/dirom.h b/src/emu/dirom.h
index 761e1d357ec..9d24fab5234 100644
--- a/src/emu/dirom.h
+++ b/src/emu/dirom.h
@@ -49,7 +49,7 @@ private:
std::function<u32 (offs_t)> m_r32;
std::function<u64 (offs_t)> m_r64;
- memory_bank *m_bank;
+ memory_bank_creator m_bank;
int m_cur_bank, m_bank_count;
virtual void interface_pre_start() override;
diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h
index 97955067865..fb589ea616a 100644
--- a/src/emu/emufwd.h
+++ b/src/emu/emufwd.h
@@ -142,7 +142,6 @@ class driver_device;
class address_space;
template<int Width, int AddrShift, int Endian> class memory_access_cache;
class memory_bank;
-class memory_block;
class memory_manager;
class memory_region;
class memory_share;
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp
index f800d09c91f..56e88eb2a4d 100644
--- a/src/emu/emumem.cpp
+++ b/src/emu/emumem.cpp
@@ -30,9 +30,16 @@
// DEBUGGING
//**************************************************************************
-#define VERBOSE (0)
+#define VERBOSE 0
-#define VPRINTF(x) do { if (VERBOSE) printf x; } while (0)
+#if VERBOSE
+template <typename Format, typename... Params> static void VPRINTF(Format &&fmt, Params &&...args)
+{
+ util::stream_format(std::cerr, std::forward<Format>(fmt), std::forward<Params>(args)...);
+}
+#else
+template <typename Format, typename... Params> static void VPRINTF(Format &&, Params &&...) {}
+#endif
#define VALIDATE_REFCOUNTS 0
@@ -259,10 +266,6 @@ template <> struct handler_width<write64s_delegate> { static constexpr int value
template <> struct handler_width<write64sm_delegate> { static constexpr int value = 3; };
template <> struct handler_width<write64mo_delegate> { static constexpr int value = 3; };
template <> struct handler_width<write64smo_delegate> { static constexpr int value = 3; };
-
-// other address map constants
-const int MEMORY_BLOCK_CHUNK = 65536; // minimum chunk size of allocated memory blocks
-
} // anonymous namespace
@@ -294,7 +297,6 @@ public:
void unmap_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite, bool quiet) override;
void install_ram_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite, void *baseptr) override;
- void install_bank_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string rtag, std::string wtag) override;
void install_bank_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, memory_bank *rbank, memory_bank *wbank) override;
void install_readwrite_port(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string rtag, std::string wtag) override;
void install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_constructor &map, u64 unitmask = 0, int cswidth = 0) override;
@@ -705,11 +707,11 @@ private:
template<int AccessWidth, typename READ> std::enable_if_t<(Width == AccessWidth)>
install_read_handler_helper(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, int cswidth, const READ &handler_r)
{
- VPRINTF(("address_space::install_read_handler(%s-%s mask=%s mirror=%s, space width=%d, handler width=%d, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
- 8 << Width, 8 << AccessWidth,
- handler_r.name(), core_i64_hex_format(unitmask, data_width() / 4)));
+ VPRINTF("address_space::install_read_handler(%*x-%*x mask=%*x mirror=%*x, space width=%d, handler width=%d, %s, %*x)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmask, m_addrchars, addrmirror,
+ 8 << Width, 8 << AccessWidth,
+ handler_r.name(), data_width() / 4, unitmask);
offs_t nstart, nend, nmask, nmirror;
u64 nunitmask;
@@ -726,11 +728,11 @@ private:
install_read_handler_helper(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, int cswidth,
const READ &handler_r)
{
- VPRINTF(("address_space::install_read_handler(%s-%s mask=%s mirror=%s, space width=%d, handler width=%d, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
- 8 << Width, 8 << AccessWidth,
- handler_r.name(), core_i64_hex_format(unitmask, data_width() / 4)));
+ VPRINTF("address_space::install_read_handler(%*x-%*x mask=%*x mirror=%*x, space width=%d, handler width=%d, %s, %*x)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmask, m_addrchars, addrmirror,
+ 8 << Width, 8 << AccessWidth,
+ handler_r.name(), data_width() / 4, unitmask);
offs_t nstart, nend, nmask, nmirror;
u64 nunitmask;
@@ -757,11 +759,11 @@ private:
install_write_handler_helper(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, int cswidth,
const WRITE &handler_w)
{
- VPRINTF(("address_space::install_write_handler(%s-%s mask=%s mirror=%s, space width=%d, handler width=%d, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
- 8 << Width, 8 << AccessWidth,
- handler_w.name(), core_i64_hex_format(unitmask, data_width() / 4)));
+ VPRINTF("address_space::install_write_handler(%*x-%*x mask=%*x mirror=%*x, space width=%d, handler width=%d, %s, %*x)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmask, m_addrchars, addrmirror,
+ 8 << Width, 8 << AccessWidth,
+ handler_w.name(), data_width() / 4, unitmask);
offs_t nstart, nend, nmask, nmirror;
u64 nunitmask;
@@ -778,11 +780,11 @@ private:
install_write_handler_helper(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, int cswidth,
const WRITE &handler_w)
{
- VPRINTF(("address_space::install_write_handler(%s-%s mask=%s mirror=%s, space width=%d, handler width=%d, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
- 8 << Width, 8 << AccessWidth,
- handler_w.name(), core_i64_hex_format(unitmask, data_width() / 4)));
+ VPRINTF("address_space::install_write_handler(%*x-%*x mask=%*x mirror=%*x, space width=%d, handler width=%d, %s, %*x)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmask, m_addrchars, addrmirror,
+ 8 << Width, 8 << AccessWidth,
+ handler_w.name(), data_width() / 4, unitmask);
offs_t nstart, nend, nmask, nmirror;
u64 nunitmask;
@@ -812,11 +814,11 @@ private:
const READ &handler_r,
const WRITE &handler_w)
{
- VPRINTF(("address_space::install_readwrite_handler(%s-%s mask=%s mirror=%s, space width=%d, handler width=%d, %s, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
- 8 << Width, 8 << AccessWidth,
- handler_r.name(), handler_w.name(), core_i64_hex_format(unitmask, data_width() / 4)));
+ VPRINTF("address_space::install_readwrite_handler(%*x-%*x mask=%*x mirror=%*x, space width=%d, handler width=%d, %s, %s, %*x)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmask, m_addrchars, addrmirror,
+ 8 << Width, 8 << AccessWidth,
+ handler_r.name(), handler_w.name(), data_width() / 4, unitmask);
offs_t nstart, nend, nmask, nmirror;
u64 nunitmask;
@@ -839,11 +841,11 @@ private:
const READ &handler_r,
const WRITE &handler_w)
{
- VPRINTF(("address_space::install_readwrite_handler(%s-%s mask=%s mirror=%s, space width=%d, handler width=%d, %s, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmask, m_addrchars), core_i64_hex_format(addrmirror, m_addrchars),
- 8 << Width, 8 << AccessWidth,
- handler_r.name(), handler_w.name(), core_i64_hex_format(unitmask, data_width() / 4)));
+ VPRINTF("address_space::install_readwrite_handler(%*x-%*x mask=%*x mirror=%*x, space width=%d, handler width=%d, %s, %s, %*x)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmask, m_addrchars, addrmirror,
+ 8 << Width, 8 << AccessWidth,
+ handler_r.name(), handler_w.name(), data_width() / 4, unitmask);
offs_t nstart, nend, nmask, nmirror;
u64 nunitmask;
@@ -886,9 +888,18 @@ private:
//-------------------------------------------------
memory_manager::memory_manager(running_machine &machine)
- : m_machine(machine),
- m_initialized(false)
+ : m_machine(machine)
+{
+}
+
+//-------------------------------------------------
+// ~memory_manager - free the allocated memory banks
+//-------------------------------------------------
+
+memory_manager::~memory_manager()
{
+ for(void *ptr : m_datablocks)
+ free(ptr);
}
//-------------------------------------------------
@@ -1022,38 +1033,51 @@ void memory_manager::initialize()
for (auto const memory : memories)
memory->populate_from_maps();
- // allocate memory needed to back each address space
- for (auto const memory : memories)
- memory->allocate_memory();
-
- // find all the allocated pointers
- for (auto const memory : memories)
- memory->locate_memory();
-
// disable logging of unmapped access when no one receives it
if (!machine().options().log() && !machine().options().oslog() && !(machine().debug_flags & DEBUG_FLAG_ENABLED))
for (auto const memory : memories)
memory->set_log_unmap(false);
+}
- // we are now initialized
- m_initialized = true;
+
+//-------------------------------------------------
+// allocate_memory - allocate some ram and register it for saving
+//-------------------------------------------------
+
+void *memory_manager::allocate_memory(device_t &dev, int spacenum, std::string name, u8 width, size_t bytes)
+{
+ void *ptr = malloc(bytes);
+ memset(ptr, 0, bytes);
+ m_datablocks.push_back(ptr);
+ machine().save().save_memory(&dev, "memory", dev.tag(), spacenum, name.c_str(), ptr, width/8, (u32)bytes / (width/8));
+ return ptr;
}
+
//-------------------------------------------------
// region_alloc - allocates memory for a region
//-------------------------------------------------
-memory_region *memory_manager::region_alloc(const char *name, u32 length, u8 width, endianness_t endian)
+memory_region *memory_manager::region_alloc(std::string name, u32 length, u8 width, endianness_t endian)
{
- osd_printf_verbose("Region '%s' created\n", name);
// make sure we don't have a region of the same name; also find the end of the list
if (m_regionlist.find(name) != m_regionlist.end())
fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
// allocate the region
- m_regionlist.emplace(name, std::make_unique<memory_region>(machine(), name, length, width, endian));
- return m_regionlist.find(name)->second.get();
+ return m_regionlist.emplace(name, std::make_unique<memory_region>(machine(), name, length, width, endian)).first->second.get();
+}
+
+
+//-------------------------------------------------
+// region_find - find a region by name
+//-------------------------------------------------
+
+memory_region *memory_manager::region_find(std::string name)
+{
+ auto i = m_regionlist.find(name);
+ return i != m_regionlist.end() ? i->second.get() : nullptr;
}
@@ -1061,61 +1085,82 @@ memory_region *memory_manager::region_alloc(const char *name, u32 length, u8 wid
// region_free - releases memory for a region
//-------------------------------------------------
-void memory_manager::region_free(const char *name)
+void memory_manager::region_free(std::string name)
{
m_regionlist.erase(name);
}
//-------------------------------------------------
-// region_containing - helper to determine if
-// a block of memory is part of a region
+// anonymous_alloc - allocates a anonymousd memory zone
//-------------------------------------------------
-memory_region *memory_manager::region_containing(const void *memory, offs_t bytes) const
+void *memory_manager::anonymous_alloc(address_space &space, size_t bytes, u8 width, offs_t start, offs_t end)
{
- const u8 *data = reinterpret_cast<const u8 *>(memory);
+ std::string name = util::string_format("%x-%x", start, end);
+ return allocate_memory(space.device(), space.spacenum(), name, width, bytes);
+}
- // look through the region list and return the first match
- for (auto &region : m_regionlist)
- if (data >= region.second->base() && (data + bytes) <= region.second->end())
- return region.second.get();
- // didn't find one
- return nullptr;
+//-------------------------------------------------
+// share_alloc - allocates a shared memory zone
+//-------------------------------------------------
+
+memory_share *memory_manager::share_alloc(device_t &dev, std::string name, u8 width, size_t bytes, endianness_t endianness)
+{
+ // make sure we don't have a share of the same name; also find the end of the list
+ if (m_sharelist.find(name) != m_sharelist.end())
+ fatalerror("share_alloc called with duplicate share name \"%s\"\n", name);
+
+ // allocate and register the memory
+ void *ptr = allocate_memory(dev, 0, name, width, bytes);
+
+ // allocate the region
+ return m_sharelist.emplace(name, std::make_unique<memory_share>(name, width, bytes, endianness, ptr)).first->second.get();
}
-memory_bank *memory_manager::find(const char *tag) const
+
+//-------------------------------------------------
+// share_find - find a share by name
+//-------------------------------------------------
+
+memory_share *memory_manager::share_find(std::string name)
{
- auto bank = m_banklist.find(tag);
- if (bank != m_banklist.end())
- return bank->second.get();
- return nullptr;
+ auto i = m_sharelist.find(name);
+ return i != m_sharelist.end() ? i->second.get() : nullptr;
}
-memory_bank *memory_manager::find(address_space &space, offs_t addrstart, offs_t addrend) const
+
+
+//-------------------------------------------------
+// share_alloc - allocates a banking zone
+//-------------------------------------------------
+
+memory_bank *memory_manager::bank_alloc(device_t &device, std::string name)
{
- // try to find an exact match
- for (auto &bank : m_banklist)
- if (bank.second->anonymous() && bank.second->references_space(space, read_or_write::READWRITE) && bank.second->matches_exactly(addrstart, addrend))
- return bank.second.get();
+ // allocate the bank
+ auto const ins = m_banklist.emplace(name, std::make_unique<memory_bank>(device, name));
- // not found
- return nullptr;
+ // make sure we don't have a bank of the same name
+ if (!ins.second)
+ fatalerror("bank_alloc called with duplicate bank name \"%s\"\n", name);
+
+ return ins.first->second.get();
}
-memory_bank *memory_manager::allocate(address_space &space, offs_t addrstart, offs_t addrend, const char *tag)
+
+//-------------------------------------------------
+// bank_find - find a bank by name
+//-------------------------------------------------
+
+memory_bank *memory_manager::bank_find(std::string name)
{
- auto bank = std::make_unique<memory_bank>(space, m_banklist.size(), addrstart, addrend, tag);
- std::string temptag;
- if (tag == nullptr) {
- temptag = string_format("anon_%p", bank.get());
- tag = temptag.c_str();
- }
- m_banklist.emplace(tag, std::move(bank));
- return m_banklist.find(tag)->second.get();
+ auto i = m_banklist.find(name);
+ return i != m_banklist.end() ? i->second.get() : nullptr;
}
+
+
//**************************************************************************
// ADDRESS SPACE CONFIG
//**************************************************************************
@@ -1422,15 +1467,23 @@ void address_space::prepare_map()
{
// if we can't find it, add it to our map
std::string fulltag = entry.m_devbase.subtag(entry.m_share);
- if (m_manager.m_sharelist.find(fulltag) == m_manager.m_sharelist.end())
+ memory_share *share = m_manager.share_find(fulltag);
+ if (!share)
{
- VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.c_str(), entry.m_addrend + 1 - entry.m_addrstart));
- m_manager.m_sharelist.emplace(fulltag.c_str(), std::make_unique<memory_share>(m_config.data_width(), address_to_byte(entry.m_addrend + 1 - entry.m_addrstart), endianness()));
+ VPRINTF("Creating share '%s' of length 0x%X\n", fulltag.c_str(), entry.m_addrend + 1 - entry.m_addrstart);
+ share = m_manager.share_alloc(m_device, fulltag, m_config.data_width(), address_to_byte(entry.m_addrend + 1 - entry.m_addrstart), endianness());
}
+ else
+ {
+ std::string result = share->compare(m_config.data_width(), address_to_byte(entry.m_addrend + 1 - entry.m_addrstart), endianness());
+ if (!result.empty())
+ fatalerror("%s\n", result);
+ }
+ entry.m_memory = share->ptr();
}
- // if this is a ROM handler without a specified region, attach it to the implicit region
- if (m_spacenum == 0 && entry.m_read.m_type == AMH_ROM && entry.m_region == nullptr)
+ // if this is a ROM handler without a specified region and not shared, attach it to the implicit region
+ if (m_spacenum == AS_PROGRAM && entry.m_read.m_type == AMH_ROM && entry.m_region == nullptr && entry.m_share == nullptr)
{
// make sure it fits within the memory region before doing so, however
if (entry.m_addrend < devregionsize)
@@ -1441,7 +1494,7 @@ void address_space::prepare_map()
}
// validate adjusted addresses against implicit regions
- if (entry.m_region != nullptr && entry.m_share == nullptr)
+ if (entry.m_region != nullptr)
{
// determine full tag
std::string fulltag = entry.m_devbase.subtag(entry.m_region);
@@ -1454,6 +1507,9 @@ void address_space::prepare_map()
// validate the region
if (entry.m_rgnoffs + m_config.addr2byte(entry.m_addrend - entry.m_addrstart + 1) > region->bytes())
fatalerror("device '%s' %s space memory map entry %X-%X extends beyond region \"%s\" size (%X)\n", m_device.tag(), m_name, entry.m_addrstart, entry.m_addrend, entry.m_region, region->bytes());
+
+ if (entry.m_share != nullptr)
+ fatalerror("device '%s' %s space memory map entry %X-%X has both .region() and .share()\n", m_device.tag(), m_name, entry.m_addrstart, entry.m_addrend);
}
// convert any region-relative entries to their memory pointers
@@ -1465,6 +1521,10 @@ void address_space::prepare_map()
// set the memory address
entry.m_memory = m_manager.machine().root_device().memregion(fulltag)->base() + entry.m_rgnoffs;
}
+
+ // allocate anonymous ram when needed
+ if (!entry.m_memory && (entry.m_read.m_type == AMH_RAM || entry.m_write.m_type == AMH_RAM))
+ entry.m_memory = m_manager.anonymous_alloc(*this, address_to_byte(entry.m_addrend + 1 - entry.m_addrstart), m_config.data_width(), entry.m_addrstart, entry.m_addrend);
}
}
@@ -1519,7 +1579,7 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
// fall through to the RAM case otherwise
case AMH_RAM:
- install_ram_generic(entry.m_addrstart, entry.m_addrend, entry.m_addrmirror, readorwrite, nullptr);
+ install_ram_generic(entry.m_addrstart, entry.m_addrend, entry.m_addrmirror, readorwrite, entry.m_memory);
break;
case AMH_NOP:
@@ -1651,167 +1711,22 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
break;
case AMH_BANK:
- install_bank_generic(entry.m_addrstart, entry.m_addrend, entry.m_addrmirror,
- (readorwrite == read_or_write::READ) ? entry.m_devbase.subtag(data.m_tag) : "",
- (readorwrite == read_or_write::WRITE) ? entry.m_devbase.subtag(data.m_tag) : "");
+ {
+ std::string tag = entry.m_devbase.subtag(data.m_tag);
+ memory_bank *bank = m_manager.bank_find(tag);
+ if (!bank)
+ bank = m_manager.bank_alloc(entry.m_devbase, tag);
+ install_bank_generic(entry.m_addrstart, entry.m_addrend, entry.m_addrmirror,
+ (readorwrite == read_or_write::READ) ? bank : nullptr,
+ (readorwrite == read_or_write::WRITE) ? bank : nullptr);
break;
+ }
case AMH_DEVICE_SUBMAP:
throw emu_fatalerror("Internal mapping error: leftover mapping of '%s'.\n", data.m_tag);
}
}
-//-------------------------------------------------
-// allocate_memory - determine all neighboring
-// address ranges and allocate memory to back
-// them
-//-------------------------------------------------
-
-void address_space::allocate_memory()
-{
- auto &blocklist = m_manager.m_blocklist;
-
- // make a first pass over the memory map and track blocks with hardcoded pointers
- // we do this to make sure they are found by space_find_backing_memory first
- // do it back-to-front so that overrides work correctly
- int tail = blocklist.size();
- for (address_map_entry &entry : m_map->m_entrylist)
- if (entry.m_memory != nullptr)
- blocklist.insert(blocklist.begin() + tail, std::make_unique<memory_block>(*this, entry.m_addrstart, entry.m_addrend, entry.m_memory));
-
- // loop over all blocks just allocated and assign pointers from them
- address_map_entry *unassigned = nullptr;
-
- for (auto memblock = blocklist.begin() + tail; memblock != blocklist.end(); ++memblock)
- unassigned = block_assign_intersecting(memblock->get()->addrstart(), memblock->get()->addrend(), memblock->get()->data());
-
- // if we don't have an unassigned pointer yet, try to find one
- if (unassigned == nullptr)
- unassigned = block_assign_intersecting(~0, 0, nullptr);
-
- // loop until we've assigned all memory in this space
- while (unassigned != nullptr)
- {
- // work in MEMORY_BLOCK_CHUNK-sized chunks
- offs_t curblockstart = unassigned->m_addrstart / MEMORY_BLOCK_CHUNK;
- offs_t curblockend = unassigned->m_addrend / MEMORY_BLOCK_CHUNK;
-
- // loop while we keep finding unassigned blocks in neighboring MEMORY_BLOCK_CHUNK chunks
- bool changed;
- do
- {
- changed = false;
-
- // scan for unmapped blocks in the adjusted map
- for (address_map_entry &entry : m_map->m_entrylist)
- if (entry.m_memory == nullptr && &entry != unassigned && needs_backing_store(entry))
- {
- // get block start/end blocks for this block
- offs_t blockstart = entry.m_addrstart / MEMORY_BLOCK_CHUNK;
- offs_t blockend = entry.m_addrend / MEMORY_BLOCK_CHUNK;
-
- // if we intersect or are adjacent, adjust the start/end
- if (blockstart <= curblockend + 1 && blockend >= curblockstart - 1)
- {
- if (blockstart < curblockstart)
- curblockstart = blockstart, changed = true;
- if (blockend > curblockend)
- curblockend = blockend, changed = true;
- }
- }
- } while (changed);
-
- // we now have a block to allocate; do it
- offs_t curaddrstart = curblockstart * MEMORY_BLOCK_CHUNK;
- offs_t curaddrend = curblockend * MEMORY_BLOCK_CHUNK + (MEMORY_BLOCK_CHUNK - 1);
- auto block = std::make_unique<memory_block>(*this, curaddrstart, curaddrend);
-
- // assign memory that intersected the new block
- unassigned = block_assign_intersecting(curaddrstart, curaddrend, block.get()->data());
- blocklist.push_back(std::move(block));
- }
-}
-
-
-//-------------------------------------------------
-// locate_memory - find all the requested
-// pointers into the final allocated memory
-//-------------------------------------------------
-
-void address_space::locate_memory()
-{
- // once this is done, find the starting bases for the banks
- for (auto &bank : m_manager.banks())
- if (bank.second->base() == nullptr && bank.second->references_space(*this, read_or_write::READWRITE))
- {
- // set the initial bank pointer
- for (address_map_entry &entry : m_map->m_entrylist)
- if (entry.m_addrstart == bank.second->addrstart() && entry.m_memory != nullptr)
- {
- bank.second->set_base(entry.m_memory);
- VPRINTF(("assigned bank '%s' pointer to memory from range %08X-%08X [%p]\n", bank.second->tag(), entry.m_addrstart, entry.m_addrend, entry.m_memory));
- break;
- }
- }
-}
-
-
-
-
-//-------------------------------------------------
-// block_assign_intersecting - find all
-// intersecting blocks and assign their pointers
-//-------------------------------------------------
-
-address_map_entry *address_space::block_assign_intersecting(offs_t addrstart, offs_t addrend, u8 *base)
-{
- address_map_entry *unassigned = nullptr;
-
- // loop over the adjusted map and assign memory to any blocks we can
- for (address_map_entry &entry : m_map->m_entrylist)
- {
- // if we haven't assigned this block yet, see if we have a mapped shared pointer for it
- if (entry.m_memory == nullptr && entry.m_share != nullptr)
- {
- std::string fulltag = entry.m_devbase.subtag(entry.m_share);
- auto share = m_manager.shares().find(fulltag);
- if (share != m_manager.shares().end() && share->second->ptr() != nullptr)
- {
- entry.m_memory = share->second->ptr();
- VPRINTF(("memory range %08X-%08X -> shared_ptr '%s' [%p]\n", entry.m_addrstart, entry.m_addrend, entry.m_share, entry.m_memory));
- }
- else
- {
- VPRINTF(("memory range %08X-%08X -> shared_ptr '%s' but not found\n", entry.m_addrstart, entry.m_addrend, entry.m_share));
- }
- }
-
- // otherwise, look for a match in this block
- if (entry.m_memory == nullptr && entry.m_addrstart >= addrstart && entry.m_addrend <= addrend)
- {
- entry.m_memory = base + m_config.addr2byte(entry.m_addrstart - addrstart);
- VPRINTF(("memory range %08X-%08X -> found in block from %08X-%08X [%p]\n", entry.m_addrstart, entry.m_addrend, addrstart, addrend, entry.m_memory));
- }
-
- // if we're the first match on a shared pointer, assign it now
- if (entry.m_memory != nullptr && entry.m_share != nullptr)
- {
- std::string fulltag = entry.m_devbase.subtag(entry.m_share);
- auto share = m_manager.shares().find(fulltag);
- if (share != m_manager.shares().end() && share->second->ptr() == nullptr)
- {
- share->second->set_ptr(entry.m_memory);
- VPRINTF(("setting shared_ptr '%s' = %p\n", entry.m_share, entry.m_memory));
- }
- }
-
- // keep track of the first unassigned entry
- if (entry.m_memory == nullptr && unassigned == nullptr && needs_backing_store(entry))
- unassigned = &entry;
- }
-
- return unassigned;
-}
memory_passthrough_handler *address_space::install_read_tap(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string name, std::function<void (offs_t offset, u8 &data, u8 mem_mask)> tap, memory_passthrough_handler *mph)
@@ -1915,11 +1830,11 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
template<int Width, int AddrShift, endianness_t Endian> void address_space_specific<Width, AddrShift, Endian>::unmap_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite, bool quiet)
{
- VPRINTF(("address_space::unmap(%s-%s mirror=%s, %s, %s)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmirror, m_addrchars),
- (readorwrite == read_or_write::READ) ? "read" : (readorwrite == read_or_write::WRITE) ? "write" : (readorwrite == read_or_write::READWRITE) ? "read/write" : "??",
- quiet ? "quiet" : "normal"));
+ VPRINTF("address_space::unmap(%*x-%*x mirror=%*x, %s, %s)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmirror,
+ (readorwrite == read_or_write::READ) ? "read" : (readorwrite == read_or_write::WRITE) ? "write" : (readorwrite == read_or_write::READWRITE) ? "read/write" : "??",
+ quiet ? "quiet" : "normal");
offs_t nstart, nend, nmask, nmirror;
check_optimize_mirror("unmap_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror);
@@ -2036,10 +1951,10 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
template<int Width, int AddrShift, endianness_t Endian> void address_space_specific<Width, AddrShift, Endian>::install_readwrite_port(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string rtag, std::string wtag)
{
- VPRINTF(("address_space::install_readwrite_port(%s-%s mirror=%s, read=\"%s\" / write=\"%s\")\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmirror, m_addrchars),
- rtag.empty() ? "(none)" : rtag.c_str(), wtag.empty() ? "(none)" : wtag.c_str()));
+ VPRINTF("address_space::install_readwrite_port(%*x-%*x mirror=%*x, read=\"%s\" / write=\"%s\")\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmirror,
+ rtag.empty() ? "(none)" : rtag.c_str(), wtag.empty() ? "(none)" : wtag.c_str());
offs_t nstart, nend, nmask, nmirror;
check_optimize_mirror("install_readwrite_port", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror);
@@ -2078,48 +1993,12 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
// mapping to a particular bank
//-------------------------------------------------
-template<int Width, int AddrShift, endianness_t Endian> void address_space_specific<Width, AddrShift, Endian>::install_bank_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string rtag, std::string wtag)
-{
- VPRINTF(("address_space::install_readwrite_bank(%s-%s mirror=%s, read=\"%s\" / write=\"%s\")\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmirror, m_addrchars),
- rtag.empty() ? "(none)" : rtag.c_str(), wtag.empty() ? "(none)" : wtag.c_str()));
-
- offs_t nstart, nend, nmask, nmirror;
- check_optimize_mirror("install_bank_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror);
-
- // map the read bank
- if (rtag != "")
- {
- std::string fulltag = device().siblingtag(rtag);
- memory_bank &bank = bank_find_or_allocate(fulltag.c_str(), addrstart, addrend, addrmirror, read_or_write::READ);
-
- auto hand_r = new handler_entry_read_memory_bank<Width, AddrShift, Endian>(this, bank);
- hand_r->set_address_info(nstart, nmask);
- m_root_read->populate(nstart, nend, nmirror, hand_r);
- }
-
- // map the write bank
- if (wtag != "")
- {
- std::string fulltag = device().siblingtag(wtag);
- memory_bank &bank = bank_find_or_allocate(fulltag.c_str(), addrstart, addrend, addrmirror, read_or_write::WRITE);
-
- auto hand_w = new handler_entry_write_memory_bank<Width, AddrShift, Endian>(this, bank);
- hand_w->set_address_info(nstart, nmask);
- m_root_write->populate(nstart, nend, nmirror, hand_w);
- }
-
- invalidate_caches(rtag != "" ? wtag != "" ? read_or_write::READWRITE : read_or_write::READ : read_or_write::WRITE);
-}
-
-
template<int Width, int AddrShift, endianness_t Endian> void address_space_specific<Width, AddrShift, Endian>::install_bank_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, memory_bank *rbank, memory_bank *wbank)
{
- VPRINTF(("address_space::install_readwrite_bank(%s-%s mirror=%s, read=\"%s\" / write=\"%s\")\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmirror, m_addrchars),
- (rbank != nullptr) ? rbank->tag() : "(none)", (wbank != nullptr) ? wbank->tag() : "(none)"));
+ VPRINTF("address_space::install_readwrite_bank(%*x-%*x mirror=%*x, read=\"%s\" / write=\"%s\")\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmirror,
+ (rbank != nullptr) ? rbank->tag() : "(none)", (wbank != nullptr) ? wbank->tag() : "(none)");
offs_t nstart, nend, nmask, nmirror;
check_optimize_mirror("install_bank_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror);
@@ -2151,11 +2030,11 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
template<int Width, int AddrShift, endianness_t Endian> void address_space_specific<Width, AddrShift, Endian>::install_ram_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite, void *baseptr)
{
- VPRINTF(("address_space::install_ram_generic(%s-%s mirror=%s, %s, %p)\n",
- core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
- core_i64_hex_format(addrmirror, m_addrchars),
- (readorwrite == read_or_write::READ) ? "read" : (readorwrite == read_or_write::WRITE) ? "write" : (readorwrite == read_or_write::READWRITE) ? "read/write" : "??",
- baseptr));
+ VPRINTF("address_space::install_ram_generic(%s-%s mirror=%s, %s, %p)\n",
+ m_addrchars, addrstart, m_addrchars, addrend,
+ m_addrchars, addrmirror,
+ (readorwrite == read_or_write::READ) ? "read" : (readorwrite == read_or_write::WRITE) ? "write" : (readorwrite == read_or_write::READWRITE) ? "read/write" : "??",
+ baseptr);
offs_t nstart, nend, nmask, nmirror;
check_optimize_mirror("install_ram_generic", addrstart, addrend, addrmirror, nstart, nend, nmask, nmirror);
@@ -2163,39 +2042,7 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
// map for read
if (readorwrite == read_or_write::READ || readorwrite == read_or_write::READWRITE)
{
- // find a bank and map it
- memory_bank &bank = bank_find_or_allocate(nullptr, addrstart, addrend, addrmirror, read_or_write::READ);
-
- // if we are provided a pointer, set it
- if (baseptr != nullptr)
- bank.set_base(baseptr);
-
- // if we don't have a bank pointer yet, try to find one
- if (bank.base() == nullptr)
- {
- void *backing = find_backing_memory(addrstart, addrend);
- if (backing != nullptr)
- bank.set_base(backing);
- }
-
- // if we still don't have a pointer, and we're past the initialization phase, allocate a new block
- if (bank.base() == nullptr && m_manager.m_initialized)
- {
- if (m_manager.machine().phase() >= machine_phase::RESET)
- fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!\n");
- auto block = std::make_unique<memory_block>(*this, addrstart, addrend);
- bank.set_base(block.get()->data());
- m_manager.m_blocklist.push_back(std::move(block));
- }
-
- auto hand_r = new handler_entry_read_memory<Width, AddrShift, Endian>(this);
- if (bank.base())
- hand_r->set_base(static_cast<uX *>(bank.base()));
- else {
- delayed_ref(hand_r);
- bank.add_notifier([this, hand_r](void *base) { hand_r->set_base(static_cast<uX *>(base)); delayed_unref(hand_r); });
- }
-
+ auto hand_r = new handler_entry_read_memory<Width, AddrShift, Endian>(this, baseptr);
hand_r->set_address_info(nstart, nmask);
m_root_read->populate(nstart, nend, nmirror, hand_r);
}
@@ -2203,39 +2050,7 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
// map for write
if (readorwrite == read_or_write::WRITE || readorwrite == read_or_write::READWRITE)
{
- // find a bank and map it
- memory_bank &bank = bank_find_or_allocate(nullptr, addrstart, addrend, addrmirror, read_or_write::WRITE);
-
- // if we are provided a pointer, set it
- if (baseptr != nullptr)
- bank.set_base(baseptr);
-
- // if we don't have a bank pointer yet, try to find one
- if (bank.base() == nullptr)
- {
- void *backing = find_backing_memory(addrstart, addrend);
- if (backing != nullptr)
- bank.set_base(backing);
- }
-
- // if we still don't have a pointer, and we're past the initialization phase, allocate a new block
- if (bank.base() == nullptr && m_manager.m_initialized)
- {
- if (m_manager.machine().phase() >= machine_phase::RESET)
- fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!\n");
- auto block = std::make_unique<memory_block>(*this, address_to_byte(addrstart), address_to_byte_end(addrend));
- bank.set_base(block.get()->data());
- m_manager.m_blocklist.push_back(std::move(block));
- }
-
- auto hand_w = new handler_entry_write_memory<Width, AddrShift, Endian>(this);
- if (bank.base())
- hand_w->set_base(static_cast<uX *>(bank.base()));
- else {
- delayed_ref(hand_w);
- bank.add_notifier([this, hand_w](void *base) { hand_w->set_base(static_cast<uX *>(base)); delayed_unref(hand_w); });
- }
-
+ auto hand_w = new handler_entry_write_memory<Width, AddrShift, Endian>(this, baseptr);
hand_w->set_address_info(nstart, nmask);
m_root_write->populate(nstart, nend, nmirror, hand_w);
}
@@ -2248,76 +2063,6 @@ template<int Width, int AddrShift, endianness_t Endian> void address_space_speci
// MEMORY MAPPING HELPERS
//**************************************************************************
-//-------------------------------------------------
-// find_backing_memory - return a pointer to
-// the base of RAM associated with the given
-// device and offset
-//-------------------------------------------------
-
-void *address_space::find_backing_memory(offs_t addrstart, offs_t addrend)
-{
- VPRINTF(("address_space::find_backing_memory('%s',%s,%08X-%08X) -> ", m_device.tag(), m_name, addrstart, addrend));
-
- if (m_map == nullptr)
- return nullptr;
-
- // look in the address map first, last winning for overrides
- void *result = nullptr;
- for (address_map_entry &entry : m_map->m_entrylist)
- {
- if (entry.m_memory != nullptr && addrstart >= entry.m_addrstart && addrend <= entry.m_addrend)
- {
- VPRINTF(("found in entry %08X-%08X [%p]\n", entry.m_addrstart, entry.m_addrend, (u8 *)entry.m_memory + address_to_byte(addrstart - entry.m_addrstart)));
- result = (u8 *)entry.m_memory + address_to_byte(addrstart - entry.m_addrstart);
- }
- }
- if (result)
- return result;
-
- // if not found there, look in the allocated blocks
- for (auto &block : m_manager.m_blocklist)
- if (block->contains(*this, addrstart, addrend))
- {
- VPRINTF(("found in allocated memory block %08X-%08X [%p]\n", block->addrstart(), block->addrend(), block->data() + address_to_byte(addrstart - block->addrstart())));
- return block->data() + address_to_byte(addrstart - block->addrstart());
- }
-
- VPRINTF(("did not find\n"));
- return nullptr;
-}
-
-
-//-------------------------------------------------
-// space_needs_backing_store - return whether a
-// given memory map entry implies the need of
-// allocating and registering memory
-//-------------------------------------------------
-
-bool address_space::needs_backing_store(const address_map_entry &entry)
-{
- // if we are sharing, and we don't have a pointer yet, create one
- if (entry.m_share != nullptr)
- {
- std::string fulltag = entry.m_devbase.subtag(entry.m_share);
- auto share = m_manager.shares().find(fulltag);
- if (share != m_manager.shares().end() && share->second->ptr() == nullptr)
- return true;
- }
-
- // if we're writing to any sort of bank or RAM, then yes, we do need backing
- if (entry.m_write.m_type == AMH_BANK || entry.m_write.m_type == AMH_RAM)
- return true;
-
- // if we're reading from RAM or from ROM outside of address space 0 or its region, then yes, we do need backing
- memory_region *region = m_manager.machine().root_device().memregion(m_device.tag());
- if (entry.m_read.m_type == AMH_RAM ||
- (entry.m_read.m_type == AMH_ROM && (m_spacenum != 0 || region == nullptr || entry.m_addrstart >= region->bytes())))
- return true;
-
- // all other cases don't need backing
- return false;
-}
-
int address_space::add_change_notifier(std::function<void (read_or_write)> n)
{
int id = m_notifier_id++;
@@ -2337,35 +2082,6 @@ void address_space::remove_change_notifier(int id)
//**************************************************************************
-// BANKING HELPERS
-//**************************************************************************
-
-//-------------------------------------------------
-// bank_find_or_allocate - allocate a new
-// bank, or find an existing one, and return the
-// read/write handler
-//-------------------------------------------------
-
-memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite)
-{
- // adjust the addresses, handling mirrors and such
- offs_t addrmask = ~addrmirror;
- adjust_addresses(addrstart, addrend, addrmask, addrmirror);
-
- // look up the bank by name, or else by byte range
- memory_bank *membank = tag ? m_manager.find(tag) : m_manager.find(*this, addrstart, addrend);
-
- // if we don't have a bank yet, create a new one
- if (!membank)
- membank = m_manager.allocate(*this, addrstart, addrend, tag);
-
- // add a reference for this space
- membank->add_reference(*this, readorwrite);
- return *membank;
-}
-
-
-//**************************************************************************
// CACHE MEMORY RANGES
//**************************************************************************
@@ -2440,63 +2156,6 @@ template class memory_access_cache<3, -3, ENDIANNESS_BIG>;
//**************************************************************************
-// MEMORY BLOCK
-//**************************************************************************
-
-//-------------------------------------------------
-// memory_block - constructor
-//-------------------------------------------------
-
-memory_block::memory_block(address_space &space, offs_t addrstart, offs_t addrend, void *memory)
- : m_machine(space.m_manager.machine()),
- m_space(space),
- m_addrstart(addrstart),
- m_addrend(addrend),
- m_data(reinterpret_cast<u8 *>(memory))
-{
- offs_t const length = space.address_to_byte(addrend + 1 - addrstart);
- VPRINTF(("block_allocate('%s',%s,%08X,%08X,%p)\n", space.device().tag(), space.name(), addrstart, addrend, memory));
-
- // allocate a block if needed
- if (m_data == nullptr)
- {
- if (length < 4096)
- {
- m_allocated.resize(length);
- memset(&m_allocated[0], 0, length);
- m_data = &m_allocated[0];
- }
- else
- {
- m_allocated.resize(length + 0xfff);
- memset(&m_allocated[0], 0, length + 0xfff);
- m_data = reinterpret_cast<u8 *>((reinterpret_cast<uintptr_t>(&m_allocated[0]) + 0xfff) & ~0xfff);
- }
- }
-
- // register for saving, but only if we're not part of a memory region
- if (space.m_manager.region_containing(m_data, length) != nullptr)
- VPRINTF(("skipping save of this memory block as it is covered by a memory region\n"));
- else
- {
- int bytes_per_element = space.data_width() / 8;
- std::string name = string_format("%08x-%08x", addrstart, addrend);
- machine().save().save_memory(&space.device(), "memory", space.device().tag(), space.spacenum(), name.c_str(), m_data, bytes_per_element, (u32)length / bytes_per_element);
- }
-}
-
-
-//-------------------------------------------------
-// memory_block - destructor
-//-------------------------------------------------
-
-memory_block::~memory_block()
-{
-}
-
-
-
-//**************************************************************************
// MEMORY BANK
//**************************************************************************
@@ -2504,27 +2163,13 @@ memory_block::~memory_block()
// memory_bank - constructor
//-------------------------------------------------
-memory_bank::memory_bank(address_space &space, int index, offs_t addrstart, offs_t addrend, const char *tag)
- : m_machine(space.m_manager.machine()),
- m_anonymous(tag == nullptr),
- m_addrstart(addrstart),
- m_addrend(addrend),
+memory_bank::memory_bank(device_t &device, std::string tag)
+ : m_machine(device.machine()),
m_curentry(0)
{
- // generate an internal tag if we don't have one
- if (tag == nullptr)
- {
- m_tag = string_format("~%d~", index);
- m_name = string_format("Internal bank #%d", index);
- }
- else
- {
- m_tag = tag;
- m_name = string_format("Bank '%s'", tag);
- }
-
- if (!m_anonymous && machine().save().registration_allowed())
- machine().save().save_item(&space.device(), "memory", m_tag.c_str(), 0, NAME(m_curentry));
+ m_tag = std::move(tag);
+ m_name = string_format("Bank '%s'", m_tag);
+ machine().save().save_item(&device, "memory", m_tag.c_str(), 0, NAME(m_curentry));
}
@@ -2538,35 +2183,6 @@ memory_bank::~memory_bank()
//-------------------------------------------------
-// references_space - walk the list of references
-// to find a match against the provided space
-// and read/write
-//-------------------------------------------------
-
-bool memory_bank::references_space(const address_space &space, read_or_write readorwrite) const
-{
- for (auto &ref : m_reflist)
- if (ref->matches(space, readorwrite))
- return true;
- return false;
-}
-
-
-//-------------------------------------------------
-// add_reference - add a new reference to the
-// given space
-//-------------------------------------------------
-
-void memory_bank::add_reference(address_space &space, read_or_write readorwrite)
-{
- // if we already have a reference, skip it
- if (references_space(space, readorwrite))
- return;
- m_reflist.push_back(std::make_unique<bank_reference>(space, readorwrite));
-}
-
-
-//-------------------------------------------------
// set_base - set the bank base explicitly
//-------------------------------------------------
@@ -2582,21 +2198,10 @@ void memory_bank::set_base(void *base)
m_curentry = 0;
}
m_entries[m_curentry] = reinterpret_cast<u8 *>(base);
- for(const auto &cb : m_alloc_notifier)
- cb(base);
- m_alloc_notifier.clear();
}
//-------------------------------------------------
-// add_notifier - add a function used to notify when the allocation is done
-//-------------------------------------------------
-void memory_bank::add_notifier(std::function<void (void *)> cb)
-{
- m_alloc_notifier.emplace_back(std::move(cb));
-}
-
-//-------------------------------------------------
// set_entry - set the base to a pre-configured
// entry
//-------------------------------------------------
@@ -2604,8 +2209,6 @@ void memory_bank::add_notifier(std::function<void (void *)> cb)
void memory_bank::set_entry(int entrynum)
{
// validate
- if (m_anonymous)
- throw emu_fatalerror("memory_bank::set_entry called for anonymous bank");
if (entrynum < 0 || entrynum >= int(m_entries.size()))
throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
if (m_entries[entrynum] == nullptr)
@@ -2657,9 +2260,9 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base,
// memory_region - constructor
//-------------------------------------------------
-memory_region::memory_region(running_machine &machine, const char *name, u32 length, u8 width, endianness_t endian)
+memory_region::memory_region(running_machine &machine, std::string name, u32 length, u8 width, endianness_t endian)
: m_machine(machine),
- m_name(name),
+ m_name(std::move(name)),
m_buffer(length),
m_endianness(endian),
m_bitwidth(width * 8),
@@ -2667,3 +2270,17 @@ memory_region::memory_region(running_machine &machine, const char *name, u32 len
{
assert(width == 1 || width == 2 || width == 4 || width == 8);
}
+
+std::string memory_share::compare(u8 width, size_t bytes, endianness_t endianness) const
+{
+ if (width != m_bitwidth)
+ return util::string_format("share %s found with unexpected width (expected %d, found %d)", m_name, width, m_bitwidth);
+ if (bytes != m_bytes)
+ return util::string_format("share %s found with unexpected size (expected %x, found %x)", m_name, bytes, m_bytes);
+ if (endianness != m_endianness)
+ return util::string_format("share %s found with unexpected endianness (expected %s, found %s)", m_name,
+ endianness == ENDIANNESS_LITTLE ? "little" : "big",
+ m_endianness == ENDIANNESS_LITTLE ? "little" : "big");
+ return "";
+}
+
diff --git a/src/emu/emumem.h b/src/emu/emumem.h
index f4b685b64d6..87f8bd6848b 100644
--- a/src/emu/emumem.h
+++ b/src/emu/emumem.h
@@ -1101,7 +1101,6 @@ public:
class address_space
{
friend class memory_bank;
- friend class memory_block;
template<int Width, int AddrShift, int Endian> friend class handler_entry_read_unmapped;
template<int Width, int AddrShift, int Endian> friend class handler_entry_write_unmapped;
template<int Width, int AddrShift, int Endian> friend class memory_access_cache;
@@ -1226,29 +1225,23 @@ public:
void install_read_port(offs_t addrstart, offs_t addrend, const char *rtag) { install_read_port(addrstart, addrend, 0, rtag); }
void install_write_port(offs_t addrstart, offs_t addrend, const char *wtag) { install_write_port(addrstart, addrend, 0, wtag); }
void install_readwrite_port(offs_t addrstart, offs_t addrend, const char *rtag, const char *wtag) { install_readwrite_port(addrstart, addrend, 0, rtag, wtag); }
- void install_read_bank(offs_t addrstart, offs_t addrend, const char *tag) { install_read_bank(addrstart, addrend, 0, tag); }
- void install_write_bank(offs_t addrstart, offs_t addrend, const char *tag) { install_write_bank(addrstart, addrend, 0, tag); }
- void install_readwrite_bank(offs_t addrstart, offs_t addrend, const char *tag) { install_readwrite_bank(addrstart, addrend, 0, tag); }
void install_read_bank(offs_t addrstart, offs_t addrend, memory_bank *bank) { install_read_bank(addrstart, addrend, 0, bank); }
void install_write_bank(offs_t addrstart, offs_t addrend, memory_bank *bank) { install_write_bank(addrstart, addrend, 0, bank); }
void install_readwrite_bank(offs_t addrstart, offs_t addrend, memory_bank *bank) { install_readwrite_bank(addrstart, addrend, 0, bank); }
- void install_rom(offs_t addrstart, offs_t addrend, void *baseptr = nullptr) { install_rom(addrstart, addrend, 0, baseptr); }
- void install_writeonly(offs_t addrstart, offs_t addrend, void *baseptr = nullptr) { install_writeonly(addrstart, addrend, 0, baseptr); }
- void install_ram(offs_t addrstart, offs_t addrend, void *baseptr = nullptr) { install_ram(addrstart, addrend, 0, baseptr); }
+ void install_rom(offs_t addrstart, offs_t addrend, void *baseptr) { install_rom(addrstart, addrend, 0, baseptr); }
+ void install_writeonly(offs_t addrstart, offs_t addrend, void *baseptr) { install_writeonly(addrstart, addrend, 0, baseptr); }
+ void install_ram(offs_t addrstart, offs_t addrend, void *baseptr) { install_ram(addrstart, addrend, 0, baseptr); }
// install ports, banks, RAM (with mirror/mask)
void install_read_port(offs_t addrstart, offs_t addrend, offs_t addrmirror, const char *rtag) { install_readwrite_port(addrstart, addrend, addrmirror, rtag, ""); }
void install_write_port(offs_t addrstart, offs_t addrend, offs_t addrmirror, const char *wtag) { install_readwrite_port(addrstart, addrend, addrmirror, "", wtag); }
virtual void install_readwrite_port(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string rtag, std::string wtag) = 0;
- void install_read_bank(offs_t addrstart, offs_t addrend, offs_t addrmirror, const char *tag) { install_bank_generic(addrstart, addrend, addrmirror, tag, ""); }
- void install_write_bank(offs_t addrstart, offs_t addrend, offs_t addrmirror, const char *tag) { install_bank_generic(addrstart, addrend, addrmirror, "", tag); }
- void install_readwrite_bank(offs_t addrstart, offs_t addrend, offs_t addrmirror, const char *tag) { install_bank_generic(addrstart, addrend, addrmirror, tag, tag); }
void install_read_bank(offs_t addrstart, offs_t addrend, offs_t addrmirror, memory_bank *bank) { install_bank_generic(addrstart, addrend, addrmirror, bank, nullptr); }
void install_write_bank(offs_t addrstart, offs_t addrend, offs_t addrmirror, memory_bank *bank) { install_bank_generic(addrstart, addrend, addrmirror, nullptr, bank); }
void install_readwrite_bank(offs_t addrstart, offs_t addrend, offs_t addrmirror, memory_bank *bank) { install_bank_generic(addrstart, addrend, addrmirror, bank, bank); }
- void install_rom(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr = nullptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::READ, baseptr); }
- void install_writeonly(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr = nullptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::WRITE, baseptr); }
- void install_ram(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr = nullptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::READWRITE, baseptr); }
+ void install_rom(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::READ, baseptr); }
+ void install_writeonly(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::WRITE, baseptr); }
+ void install_ram(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr) { install_ram_generic(addrstart, addrend, addrmirror, read_or_write::READWRITE, baseptr); }
// install device memory maps
template <typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(address_map &map), u64 unitmask = 0, int cswidth = 0) {
@@ -1448,8 +1441,6 @@ public:
// setup
void prepare_map();
void populate_from_map(address_map *map = nullptr);
- void allocate_memory();
- void locate_memory();
template<int Width, int AddrShift, int Endian> handler_entry_read_unmapped <Width, AddrShift, Endian> *get_unmap_r() const { return static_cast<handler_entry_read_unmapped <Width, AddrShift, Endian> *>(m_unmap_r); }
template<int Width, int AddrShift, int Endian> handler_entry_write_unmapped<Width, AddrShift, Endian> *get_unmap_w() const { return static_cast<handler_entry_write_unmapped<Width, AddrShift, Endian> *>(m_unmap_w); }
@@ -1461,13 +1452,8 @@ protected:
void populate_map_entry(const address_map_entry &entry, read_or_write readorwrite);
virtual void unmap_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite, bool quiet) = 0;
virtual void install_ram_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite, void *baseptr) = 0;
- virtual void install_bank_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, std::string rtag, std::string wtag) = 0;
virtual void install_bank_generic(offs_t addrstart, offs_t addrend, offs_t addrmirror, memory_bank *rbank, memory_bank *wbank) = 0;
void adjust_addresses(offs_t &start, offs_t &end, offs_t &mask, offs_t &mirror);
- void *find_backing_memory(offs_t addrstart, offs_t addrend);
- bool needs_backing_store(const address_map_entry &entry);
- memory_bank &bank_find_or_allocate(const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite);
- address_map_entry *block_assign_intersecting(offs_t bytestart, offs_t byteend, u8 *base);
void check_optimize_all(const char *function, int width, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, int cswidth, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror, u64 &nunitmask, int &ncswidth);
void check_optimize_mirror(const char *function, offs_t addrstart, offs_t addrend, offs_t addrmirror, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror);
void check_address(const char *function, offs_t addrstart, offs_t addrend);
@@ -1500,93 +1486,22 @@ protected:
};
-// ======================> memory_block
-
-// a memory block is a chunk of RAM associated with a range of memory in a device's address space
-class memory_block
-{
- DISABLE_COPYING(memory_block);
-
-public:
- // construction/destruction
- memory_block(address_space &space, offs_t start, offs_t end, void *memory = nullptr);
- ~memory_block();
-
- // getters
- running_machine &machine() const { return m_machine; }
- offs_t addrstart() const { return m_addrstart; }
- offs_t addrend() const { return m_addrend; }
- u8 *data() const { return m_data; }
-
- // is the given range contained by this memory block?
- bool contains(address_space &space, offs_t addrstart, offs_t addrend) const
- {
- return (&space == &m_space && m_addrstart <= addrstart && m_addrend >= addrend);
- }
-
-private:
- // internal state
- running_machine & m_machine; // need the machine to free our memory
- address_space & m_space; // which address space are we associated with?
- offs_t m_addrstart, m_addrend; // start/end for verifying a match
- u8 * m_data; // pointer to the data for this block
- std::vector<u8> m_allocated; // pointer to the actually allocated block
-};
-
-
// ======================> memory_bank
// a memory bank is a global pointer to memory that can be shared across devices and changed dynamically
class memory_bank
{
- // a bank reference is an entry in a list of address spaces that reference a given bank
- class bank_reference
- {
- public:
- // construction/destruction
- bank_reference(address_space &space, read_or_write readorwrite)
- : m_space(space),
- m_readorwrite(readorwrite) { }
-
- // getters
- address_space &space() const { return m_space; }
-
- // does this reference match the space+read/write combination?
- bool matches(const address_space &space, read_or_write readorwrite) const
- {
- return (&space == &m_space && (readorwrite == read_or_write::READWRITE || readorwrite == m_readorwrite));
- }
-
- private:
- // internal state
- address_space & m_space; // address space that references us
- read_or_write m_readorwrite; // used for read or write?
-
- };
-
public:
// construction/destruction
- memory_bank(address_space &space, int index, offs_t start, offs_t end, const char *tag = nullptr);
+ memory_bank(device_t &device, std::string tag);
~memory_bank();
// getters
running_machine &machine() const { return m_machine; }
int entry() const { return m_curentry; }
- bool anonymous() const { return m_anonymous; }
- offs_t addrstart() const { return m_addrstart; }
void *base() const { return m_entries.empty() ? nullptr : m_entries[m_curentry]; }
- const char *tag() const { return m_tag.c_str(); }
- const char *name() const { return m_name.c_str(); }
-
- // compare a range against our range
- bool matches_exactly(offs_t addrstart, offs_t addrend) const { return (m_addrstart == addrstart && m_addrend == addrend); }
- bool fully_covers(offs_t addrstart, offs_t addrend) const { return (m_addrstart <= addrstart && m_addrend >= addrend); }
- bool is_covered_by(offs_t addrstart, offs_t addrend) const { return (m_addrstart >= addrstart && m_addrend <= addrend); }
- bool straddles(offs_t addrstart, offs_t addrend) const { return (m_addrstart < addrend && m_addrend > addrstart); }
-
- // track and verify address space references to this bank
- bool references_space(const address_space &space, read_or_write readorwrite) const;
- void add_reference(address_space &space, read_or_write readorwrite);
+ const std::string &tag() const { return m_tag; }
+ const std::string &name() const { return m_name; }
// set the base explicitly
void set_base(void *base);
@@ -1595,20 +1510,14 @@ public:
void configure_entry(int entrynum, void *base);
void configure_entries(int startentry, int numentries, void *base, offs_t stride);
void set_entry(int entrynum);
- void add_notifier(std::function<void (void *)> cb);
private:
// internal state
running_machine & m_machine; // need the machine to free our memory
std::vector<u8 *> m_entries; // the entries
- bool m_anonymous; // are we anonymous or explicit?
- offs_t m_addrstart; // start offset
- offs_t m_addrend; // end offset
int m_curentry; // current entry
std::string m_name; // friendly name for this bank
std::string m_tag; // tag for this bank
- std::vector<std::unique_ptr<bank_reference>> m_reflist; // list of address spaces referencing this bank
- std::vector<std::function<void (void *)>> m_alloc_notifier; // list of notifier targets when allocating
};
@@ -1619,26 +1528,27 @@ class memory_share
{
public:
// construction/destruction
- memory_share(u8 width, size_t bytes, endianness_t endianness, void *ptr = nullptr)
+ memory_share(std::string name, u8 width, size_t bytes, endianness_t endianness, void *ptr)
: m_ptr(ptr),
- m_bytes(bytes),
- m_endianness(endianness),
- m_bitwidth(width),
- m_bytewidth(width <= 8 ? 1 : width <= 16 ? 2 : width <= 32 ? 4 : 8)
+ m_bytes(bytes),
+ m_endianness(endianness),
+ m_bitwidth(width),
+ m_bytewidth(width <= 8 ? 1 : width <= 16 ? 2 : width <= 32 ? 4 : 8)
{ }
// getters
+ const std::string &name() const { return m_name; }
void *ptr() const { return m_ptr; }
size_t bytes() const { return m_bytes; }
endianness_t endianness() const { return m_endianness; }
u8 bitwidth() const { return m_bitwidth; }
u8 bytewidth() const { return m_bytewidth; }
- // setters
- void set_ptr(void *ptr) { m_ptr = ptr; }
+ std::string compare(u8 width, size_t bytes, endianness_t endianness) const;
private:
// internal state
+ std::string m_name; // share name
void * m_ptr; // pointer to the memory backing the region
size_t m_bytes; // size of the shared region in bytes
endianness_t m_endianness; // endianness of the memory
@@ -1654,18 +1564,16 @@ private:
class memory_region
{
DISABLE_COPYING(memory_region);
-
- friend class memory_manager;
public:
// construction/destruction
- memory_region(running_machine &machine, const char *name, u32 length, u8 width, endianness_t endian);
+ memory_region(running_machine &machine, std::string name, u32 length, u8 width, endianness_t endian);
// getters
running_machine &machine() const { return m_machine; }
u8 *base() { return (m_buffer.size() > 0) ? &m_buffer[0] : nullptr; }
u8 *end() { return base() + m_buffer.size(); }
u32 bytes() const { return m_buffer.size(); }
- const char *name() const { return m_name.c_str(); }
+ const std::string &name() const { return m_name; }
// flag expansion
endianness_t endianness() const { return m_endianness; }
@@ -1695,41 +1603,53 @@ private:
// holds internal state for the memory system
class memory_manager
{
- friend class address_space;
- template<int Width, int AddrShift, endianness_t Endian> friend class address_space_specific;
- friend memory_region::memory_region(running_machine &machine, const char *name, u32 length, u8 width, endianness_t endian);
public:
// construction/destruction
memory_manager(running_machine &machine);
+ ~memory_manager();
+
+ // initialize the memory spaces from the memory maps of the devices
void initialize();
// getters
running_machine &machine() const { return m_machine; }
+
+ // used for the debugger interface memory views
const std::unordered_map<std::string, std::unique_ptr<memory_bank>> &banks() const { return m_banklist; }
const std::unordered_map<std::string, std::unique_ptr<memory_region>> &regions() const { return m_regionlist; }
const std::unordered_map<std::string, std::unique_ptr<memory_share>> &shares() const { return m_sharelist; }
- // regions
- memory_region *region_alloc(const char *name, u32 length, u8 width, endianness_t endian);
- void region_free(const char *name);
- memory_region *region_containing(const void *memory, offs_t bytes) const;
+ // anonymous memory zones
+ void *anonymous_alloc(address_space &space, size_t bytes, u8 width, offs_t start, offs_t end);
- memory_bank *find(const char *tag) const;
- memory_bank *find(address_space &space, offs_t addrstart, offs_t addrend) const;
- memory_bank *allocate(address_space &space, offs_t addrstart, offs_t addrend, const char *tag = nullptr);
+ // shares
+ memory_share *share_alloc(device_t &dev, std::string name, u8 width, size_t bytes, endianness_t endianness);
+ memory_share *share_find(std::string name);
-private:
- void allocate(device_memory_interface &memory);
+ // banks
+ memory_bank *bank_alloc(device_t &device, std::string tag);
+ memory_bank *bank_find(std::string tag);
+ // regions
+ memory_region *region_alloc(std::string name, u32 length, u8 width, endianness_t endian);
+ memory_region *region_find(std::string name);
+ void region_free(std::string name);
+
+private:
// internal state
running_machine & m_machine; // reference to the machine
- bool m_initialized; // have we completed initialization?
-
- std::vector<std::unique_ptr<memory_block>> m_blocklist; // head of the list of memory blocks
+ std::vector<void *> m_datablocks; // list of memory blocks to free on exit
std::unordered_map<std::string, std::unique_ptr<memory_bank>> m_banklist; // data gathered for each bank
std::unordered_map<std::string, std::unique_ptr<memory_share>> m_sharelist; // map for share lookups
std::unordered_map<std::string, std::unique_ptr<memory_region>> m_regionlist; // list of memory regions
+
+
+ // Allocate the address spaces
+ void allocate(device_memory_interface &memory);
+
+ // Allocate some ram and register it for saving
+ void *allocate_memory(device_t &dev, int spacenum, std::string name, u8 width, size_t bytes);
};
diff --git a/src/emu/emumem_hem.h b/src/emu/emumem_hem.h
index 184c752625c..25813829182 100644
--- a/src/emu/emumem_hem.h
+++ b/src/emu/emumem_hem.h
@@ -11,14 +11,12 @@ public:
using uX = typename emu::detail::handler_entry_size<Width>::uX;
using inh = handler_entry_read_address<Width, AddrShift, Endian>;
- handler_entry_read_memory(address_space *space) : handler_entry_read_address<Width, AddrShift, Endian>(space, 0) {}
+ handler_entry_read_memory(address_space *space, void *base) : handler_entry_read_address<Width, AddrShift, Endian>(space, 0), m_base(reinterpret_cast<uX *>(base)) {}
~handler_entry_read_memory() = default;
uX read(offs_t offset, uX mem_mask) override;
void *get_ptr(offs_t offset) const override;
- inline void set_base(uX *base) { m_base = base; }
-
std::string name() const override;
private:
@@ -31,14 +29,12 @@ public:
using uX = typename emu::detail::handler_entry_size<Width>::uX;
using inh = handler_entry_write_address<Width, AddrShift, Endian>;
- handler_entry_write_memory(address_space *space) : handler_entry_write_address<Width, AddrShift, Endian>(space, 0) {}
+ handler_entry_write_memory(address_space *space, void *base) : handler_entry_write_address<Width, AddrShift, Endian>(space, 0), m_base(reinterpret_cast<uX *>(base)) {}
~handler_entry_write_memory() = default;
void write(offs_t offset, uX data, uX mem_mask) override;
void *get_ptr(offs_t offset) const override;
- inline void set_base(uX *base) { m_base = base; }
-
std::string name() const override;
private:
diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp
index 63c518a13fb..d08b0c611b4 100644
--- a/src/emu/romload.cpp
+++ b/src/emu/romload.cpp
@@ -1273,8 +1273,8 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list
machine().memory().region_free(memregion->name());
}
- // remember the base and length
- m_region = machine().memory().region_alloc(regiontag.c_str(), regionlength, width, endianness);
+ /* remember the base and length */
+ m_region = machine().memory().region_alloc(regiontag, regionlength, width, endianness);
LOG("Allocated %X bytes @ %p\n", m_region->bytes(), m_region->base());
if (ROMREGION_ISERASE(region)) // clear the region if it's requested
diff --git a/src/mame/audio/bally.cpp b/src/mame/audio/bally.cpp
index 23506f47b53..4edd6c85f0f 100644
--- a/src/mame/audio/bally.cpp
+++ b/src/mame/audio/bally.cpp
@@ -492,7 +492,6 @@ TIMER_CALLBACK_MEMBER(bally_cheap_squeak_device::sound_int_sync)
void bally_cheap_squeak_device::cheap_squeak_map(address_map &map)
{
map.unmap_value_high();
- map(0x0080, 0x00ff).ram();
map(0x8000, 0x9fff).mirror(0x2000).rom();
map(0xc000, 0xdfff).mirror(0x2000).rom();
}
diff --git a/src/mame/audio/dcs.cpp b/src/mame/audio/dcs.cpp
index 8f5415dcfee..25903a945c5 100644
--- a/src/mame/audio/dcs.cpp
+++ b/src/mame/audio/dcs.cpp
@@ -706,8 +706,8 @@ dcs_audio_device::dcs_audio_device(const machine_config &mconfig, device_type ty
m_sounddata_bank(0),
m_ram_map(*this, "data_map_bank"),
m_data_bank(*this, "databank"),
- m_rom_page(nullptr),
- m_dram_page(nullptr),
+ m_rom_page(*this, "rompage"),
+ m_dram_page(*this, "drampage"),
m_auto_ack(0),
m_latch_control(0),
m_input_data(0),
@@ -1048,16 +1048,14 @@ void dcs_audio_device::sdrc_remap_memory()
{
int baseaddr = (SDRC_ROM_ST == 0) ? 0x0000 : (SDRC_ROM_ST == 1) ? 0x3000 : 0x3400;
int pagesize = (SDRC_ROM_SZ == 0 && SDRC_ROM_ST != 0) ? 4096 : 1024;
- m_data->install_read_bank(baseaddr, baseaddr + pagesize - 1, "rompage");
- m_rom_page = membank("rompage");
+ m_data->install_read_bank(baseaddr, baseaddr + pagesize - 1, m_rom_page);
}
/* map the DRAM page as bank 26 */
if (SDRC_DM_ST != 0)
{
int baseaddr = (SDRC_DM_ST == 1) ? 0x0000 : (SDRC_DM_ST == 2) ? 0x3000 : 0x3400;
- m_data->install_readwrite_bank(baseaddr, baseaddr + 0x3ff, "drampage");
- m_dram_page = membank("drampage");
+ m_data->install_readwrite_bank(baseaddr, baseaddr + 0x3ff, m_dram_page);
}
/* update the bank pointers */
diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h
index 24646eb7829..8c364937e0c 100644
--- a/src/mame/audio/dcs.h
+++ b/src/mame/audio/dcs.h
@@ -199,8 +199,8 @@ protected:
optional_device<address_map_bank_device> m_ram_map;
optional_memory_bank m_data_bank;
- memory_bank * m_rom_page;
- memory_bank * m_dram_page;
+ memory_bank_creator m_rom_page;
+ memory_bank_creator m_dram_page;
/* I/O with the host */
uint8_t m_auto_ack;
diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp
index eb0e48bc679..97c9ff4be75 100644
--- a/src/mame/audio/mario.cpp
+++ b/src/mame/audio/mario.cpp
@@ -428,7 +428,7 @@ void mario_state::sound_start()
{
m_eabank = "bank1";
- m_audiocpu->space(AS_PROGRAM).install_read_bank(0x000, 0x7ff, "bank1");
+ m_audiocpu->space(AS_PROGRAM).install_read_bank(0x000, 0x7ff, membank("bank1"));
membank("bank1")->configure_entry(0, &SND[0]);
membank("bank1")->configure_entry(1, &SND[0x1000]);
@@ -609,7 +609,7 @@ WRITE8_MEMBER(mario_state::mario_sh3_w)
void mario_state::mario_sound_map(address_map &map)
{
- map(0x0000, 0x07ff).bankr("bank1").region("audiocpu", 0);
+ map(0x0000, 0x07ff).bankr("bank1");
map(0x0800, 0x0fff).rom();
}
diff --git a/src/mame/drivers/3do.cpp b/src/mame/drivers/3do.cpp
index 21c83a4d497..e621c2a9bde 100644
--- a/src/mame/drivers/3do.cpp
+++ b/src/mame/drivers/3do.cpp
@@ -108,7 +108,7 @@ Part list of Goldstar 3DO Interactive Multiplayer
void _3do_state::main_mem(address_map &map)
{
- map(0x00000000, 0x001FFFFF).bankrw(m_bank1).share(m_dram); /* DRAM */
+ map(0x00000000, 0x001FFFFF).bankrw(m_bank1); /* DRAM */
map(0x00200000, 0x003FFFFF).ram().share(m_vram); /* VRAM */
map(0x03000000, 0x030FFFFF).rom().region("bios", 0); /* BIOS */
map(0x03100000, 0x0313FFFF).ram(); /* Brooktree? */
diff --git a/src/mame/drivers/4enlinea.cpp b/src/mame/drivers/4enlinea.cpp
index cc49fd44f50..a599ea13815 100644
--- a/src/mame/drivers/4enlinea.cpp
+++ b/src/mame/drivers/4enlinea.cpp
@@ -331,7 +331,7 @@ void isa8_cga_4enlinea_device::device_start()
//m_isa->install_device(0x3bf, 0x3bf, 0, 0, nullptr, write8_delegate(*this, FUNC(isa8_cga_4enlinea_device::_4enlinea_mode_control_w)));
m_isa->install_device(0x3d0, 0x3df, read8_delegate(*this, FUNC(isa8_cga_4enlinea_device::_4enlinea_io_read)), write8_delegate(*this, FUNC(isa8_cga_device::io_write)));
- m_isa->install_bank(0x8000, 0xbfff, "bank1", &m_vram[0]);
+ m_isa->install_bank(0x8000, 0xbfff, &m_vram[0]);
/* Initialise the cga palette */
int i;
diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp
index 7105ee48010..cf0fd94e8d3 100644
--- a/src/mame/drivers/8080bw.cpp
+++ b/src/mame/drivers/8080bw.cpp
@@ -2226,7 +2226,7 @@ void _8080bw_state::yosakdon_map(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x2000, 0x3fff).ram().share("main_ram");
- map(0x4000, 0x43ff).writeonly(); /* what's this? */
+ map(0x4000, 0x43ff).nopw(); /* what's this? */
}
void _8080bw_state::yosakdon_io_map(address_map &map)
diff --git a/src/mame/drivers/a5105.cpp b/src/mame/drivers/a5105.cpp
index d8ffbbcc55c..bec581f6678 100644
--- a/src/mame/drivers/a5105.cpp
+++ b/src/mame/drivers/a5105.cpp
@@ -287,12 +287,12 @@ void a5105_state::a5105_memsel_w(uint8_t data)
{
case 0:
membank("bank1")->set_base(m_rom_base);
- prog.install_read_bank(0x0000, 0x3fff, "bank1");
+ prog.install_read_bank(0x0000, 0x3fff, membank("bank1"));
prog.unmap_write(0x0000, 0x3fff);
break;
case 2:
membank("bank1")->set_base(m_ram_base);
- prog.install_readwrite_bank(0x0000, 0x3fff, "bank1");
+ prog.install_readwrite_bank(0x0000, 0x3fff, membank("bank1"));
break;
default:
prog.unmap_readwrite(0x0000, 0x3fff);
@@ -308,17 +308,17 @@ void a5105_state::a5105_memsel_w(uint8_t data)
{
case 0:
membank("bank2")->set_base(m_rom_base + 0x4000);
- prog.install_read_bank(0x4000, 0x7fff, "bank2");
+ prog.install_read_bank(0x4000, 0x7fff, membank("bank2"));
prog.unmap_write(0x4000, 0x4000);
break;
case 1:
membank("bank2")->set_base(memregion("k5651")->base());
- prog.install_read_bank(0x4000, 0x7fff, "bank2");
+ prog.install_read_bank(0x4000, 0x7fff, membank("bank2"));
prog.unmap_write(0x4000, 0x4000);
break;
case 2:
membank("bank2")->set_base(m_ram_base + 0x4000);
- prog.install_readwrite_bank(0x4000, 0x7fff, "bank2");
+ prog.install_readwrite_bank(0x4000, 0x7fff, membank("bank2"));
break;
default:
prog.unmap_readwrite(0x4000, 0x7fff);
@@ -334,12 +334,12 @@ void a5105_state::a5105_memsel_w(uint8_t data)
{
case 0:
membank("bank3")->set_base(m_rom_base + 0x8000);
- prog.install_read_bank(0x8000, 0xbfff, "bank3");
+ prog.install_read_bank(0x8000, 0xbfff, membank("bank3"));
prog.unmap_write(0x8000, 0xbfff);
break;
case 2:
membank("bank3")->set_base(m_ram_base + 0x8000);
- prog.install_readwrite_bank(0x8000, 0xbfff, "bank3");
+ prog.install_readwrite_bank(0x8000, 0xbfff, membank("bank3"));
break;
default:
prog.unmap_readwrite(0x8000, 0xbfff);
@@ -355,7 +355,7 @@ void a5105_state::a5105_memsel_w(uint8_t data)
{
case 2:
membank("bank4")->set_base(m_ram_base + 0xc000);
- prog.install_readwrite_bank(0xc000, 0xffff, "bank4");
+ prog.install_readwrite_bank(0xc000, 0xffff, membank("bank4"));
break;
default:
prog.unmap_readwrite(0xc000, 0xffff);
diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp
index 69a0bac9735..2c55ae8c1fe 100644
--- a/src/mame/drivers/a7150.cpp
+++ b/src/mame/drivers/a7150.cpp
@@ -338,18 +338,18 @@ void a7150_state::k7070_cpu_banked(address_map &map)
map.unmap_value_high();
// default map: IML=0, MSEL=0. ROM + local RAM.
map(0x00000, 0x01fff).rom().region("user2", 0);
- map(0x02000, 0x07fff).bankrw("kgs_ram1");
- map(0x08000, 0x0ffff).bankrw("kgs_ram2");
+ map(0x02000, 0x07fff).ram().share("kgs_ram1");
+ map(0x08000, 0x0ffff).ram().share("kgs_ram2");
// IML=1, MSEL=0. local RAM only.
- map(0x10000, 0x11fff).bankrw("kgs_ram0");
- map(0x12000, 0x17fff).bankrw("kgs_ram1");
- map(0x18000, 0x1ffff).bankrw("kgs_ram2");
+ map(0x10000, 0x11fff).ram().share("kgs_ram0");
+ map(0x12000, 0x17fff).ram().share("kgs_ram1");
+ map(0x18000, 0x1ffff).ram().share("kgs_ram2");
// IML=0, MSEL=1. ROM + local RAM.
map(0x20000, 0x21fff).rom().region("user2", 0);
- map(0x22000, 0x27fff).bankrw("kgs_ram1");
+ map(0x22000, 0x27fff).ram().share("kgs_ram1");
// IML=1, MSEL=1. local RAM only.
- map(0x30000, 0x31fff).bankrw("kgs_ram0");
- map(0x32000, 0x37fff).bankrw("kgs_ram1");
+ map(0x30000, 0x31fff).ram().share("kgs_ram0");
+ map(0x32000, 0x37fff).ram().share("kgs_ram1");
map(0x38000, 0x3ffff).ram().share("video_ram");
}
diff --git a/src/mame/drivers/aeroboto.cpp b/src/mame/drivers/aeroboto.cpp
index 9ec149faaa6..cbfb0cd53b9 100644
--- a/src/mame/drivers/aeroboto.cpp
+++ b/src/mame/drivers/aeroboto.cpp
@@ -84,7 +84,7 @@ void aeroboto_state::main_map(address_map &map)
map(0x0000, 0x07ff).ram().share("mainram"); // main RAM
map(0x01a2, 0x01a2).w(FUNC(aeroboto_state::aeroboto_1a2_w)); // affects IRQ line (more protection?)
map(0x0800, 0x08ff).ram(); // tile color buffer; copied to 0x2000
- map(0x0900, 0x09ff).writeonly(); // a backup of default tile colors
+ map(0x0900, 0x09ff).writeonly().share("colors2"); // a backup of default tile colors
map(0x1000, 0x17ff).ram().w(FUNC(aeroboto_state::aeroboto_videoram_w)).share("videoram"); // tile RAM
map(0x1800, 0x183f).ram().share("hscroll"); // horizontal scroll regs
map(0x1840, 0x27ff).nopw(); // cleared during custom LSI test
diff --git a/src/mame/drivers/alphasma.cpp b/src/mame/drivers/alphasma.cpp
index 66bcc4f40c4..665a6d6177a 100644
--- a/src/mame/drivers/alphasma.cpp
+++ b/src/mame/drivers/alphasma.cpp
@@ -209,7 +209,7 @@ WRITE8_MEMBER(asma2k_state::port_a_w)
address_space &space = m_maincpu->space(AS_PROGRAM);
if (data & 0x40)
- space.install_readwrite_bank(0x0000, 0x7fff, "rambank");
+ space.install_readwrite_bank(0x0000, 0x7fff, m_rambank);
else
space.install_readwrite_handler(0x0000, 0x7fff, read8_delegate(*this, FUNC(asma2k_state::io_r)), write8_delegate(*this, FUNC(asma2k_state::io_w)));
}
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index f63b98a889c..1c2e02b4f54 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -805,7 +805,7 @@ void a1000_state::machine_reset()
// bootrom visible, wom writable
m_bootrom->set_bank(0);
- m_maincpu->space(AS_PROGRAM).install_write_bank(0xfc0000, 0xffffff, "wom");
+ m_maincpu->space(AS_PROGRAM).install_write_bank(0xfc0000, 0xffffff, m_wom);
}
// any write to this area will write protect the wom and disable the bootrom
diff --git a/src/mame/drivers/apc.cpp b/src/mame/drivers/apc.cpp
index 490a1e2b432..af00340bac9 100644
--- a/src/mame/drivers/apc.cpp
+++ b/src/mame/drivers/apc.cpp
@@ -87,6 +87,7 @@ public:
m_fdc_connector(*this, "upd765:%u", 0U),
m_dmac(*this, "i8237"),
m_pit(*this, "pit8253"),
+ m_aux_pcg(*this, "aux_pcg"),
m_speaker(*this, "mono"),
m_sound(*this, "upd1771c"),
m_video_ram_1(*this, "video_ram_1"),
@@ -115,8 +116,8 @@ private:
required_device_array<floppy_connector, 2> m_fdc_connector;
required_device<am9517a_device> m_dmac;
required_device<pit8253_device> m_pit;
+ required_shared_ptr<uint8_t> m_aux_pcg;
uint8_t *m_char_rom;
- uint8_t *m_aux_pcg;
required_device<speaker_device> m_speaker;
required_device<upd1771c_device> m_sound;
@@ -187,7 +188,6 @@ private:
void apc_state::video_start()
{
m_char_rom = memregion("gfx")->base();
- m_aux_pcg = memregion("aux_pcg")->base();
}
uint32_t apc_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
@@ -491,7 +491,7 @@ void apc_state::apc_map(address_map &map)
map(0xa0000, 0xa0fff).ram().share("cmos");
// map(0xa1000, 0xbffff) mirror CMOS
// map(0xc0000, 0xcffff) standard character ROM
- map(0xd8000, 0xd9fff).ram().region("aux_pcg", 0); // AUX character RAM
+ map(0xd8000, 0xd9fff).ram().share("aux_pcg"); // AUX character RAM
// map(0xe0000, 0xeffff) Special Character RAM
map(0xfe000, 0xfffff).rom().region("ipl", 0);
}
@@ -804,7 +804,6 @@ static GFXDECODE_START( gfx_apc )
GFXDECODE_ENTRY( "gfx", 0x0800, charset_8x16, 0, 128 )
GFXDECODE_ENTRY( "gfx", 0x1000, charset_8x16, 0, 128 )
GFXDECODE_ENTRY( "gfx", 0x1800, charset_8x16, 0, 128 )
-// GFXDECODE_ENTRY( "aux_pcg", 0x0000, charset_pcg, 0, 128 )
GFXDECODE_END
@@ -1023,8 +1022,6 @@ ROM_START( apc )
ROM_REGION( 0x2000, "gfx", ROMREGION_ERASE00 )
ROM_LOAD("pfcu1r.bin", 0x000000, 0x002000, CRC(683efa94) SHA1(43157984a1746b2e448f3236f571011af9a3aa73) )
-
- ROM_REGION16_LE( 0x2000, "aux_pcg", ROMREGION_ERASE00 )
ROM_END
void apc_state::init_apc()
diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp
index 96f3550b3ef..ac850bfbde7 100644
--- a/src/mame/drivers/apple2gs.cpp
+++ b/src/mame/drivers/apple2gs.cpp
@@ -1260,8 +1260,7 @@ void apple2gs_state::machine_start()
int ramsize = m_ram_size - 0x20000; // subtract 128K for banks 0 and 1, which are handled specially
// RAM sizes for both classes of machine no longer include the Mega II RAM
- space.install_readwrite_bank(0x020000, ramsize - 1 + 0x20000, "bank1");
- membank("bank1")->set_base(m_ram_ptr + 0x020000);
+ space.install_ram(0x020000, ramsize - 1 + 0x20000, m_ram_ptr + 0x020000);
// setup save states
save_item(NAME(m_speaker_state));
diff --git a/src/mame/drivers/apricotp.cpp b/src/mame/drivers/apricotp.cpp
index 03053753697..a548b8b2ea2 100644
--- a/src/mame/drivers/apricotp.cpp
+++ b/src/mame/drivers/apricotp.cpp
@@ -97,8 +97,7 @@ public:
, m_floppy1(*this, WD2797_TAG":1")
, m_floppy(nullptr)
, m_centronics(*this, CENTRONICS_TAG)
- , m_work_ram(*this, "work_ram")
- , m_video_ram(*this, "video_ram")
+ , m_video_ram(*this, "video_ram", 0x20000, ENDIANNESS_LITTLE)
{ }
void fp(machine_config &config);
@@ -139,10 +138,10 @@ private:
void lat_ls259_w(offs_t offset, int state);
- optional_shared_ptr<uint16_t> m_work_ram;
+ uint16_t *m_work_ram;
// video state
- optional_shared_ptr<uint16_t> m_video_ram;
+ memory_share_creator<uint16_t> m_video_ram;
uint8_t m_video;
int m_centronics_busy;
@@ -168,8 +167,6 @@ private:
void fp_state::video_start()
{
- // allocate memory
- m_video_ram.allocate(0x20000);
}
MC6845_UPDATE_ROW( fp_state::update_row )
@@ -535,7 +532,7 @@ WRITE_LINE_MEMBER( fp_state::write_centronics_perror )
void fp_state::machine_start()
{
// allocate memory
- m_work_ram.allocate(m_ram->size() / 2);
+ m_work_ram = reinterpret_cast<uint16_t *>(m_ram->pointer());
}
diff --git a/src/mame/drivers/aquarius.cpp b/src/mame/drivers/aquarius.cpp
index 8ee2e9f7b3c..38bc1a66b85 100644
--- a/src/mame/drivers/aquarius.cpp
+++ b/src/mame/drivers/aquarius.cpp
@@ -204,12 +204,7 @@ void aquarius_state::init_aquarius()
{
/* install expansion memory if available */
if (m_ram->size() > 0x1000)
- {
- address_space &space = m_maincpu->space(AS_PROGRAM);
-
- space.install_readwrite_bank(0x4000, 0x4000 + m_ram->size() - 0x1000 - 1, "bank1");
- membank("bank1")->set_base(m_ram->pointer());
- }
+ m_maincpu->space(AS_PROGRAM).install_ram(0x4000, 0x4000 + m_ram->size() - 0x1000 - 1, m_ram->pointer());
}
diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp
index f9faaf5c073..399093673ef 100644
--- a/src/mame/drivers/aristmk4.cpp
+++ b/src/mame/drivers/aristmk4.cpp
@@ -1034,7 +1034,7 @@ void aristmk4_state::slots_mem(address_map &map)
map(0x1c00, 0x1cff).w(FUNC(aristmk4_state::mk4_printer_w));
map(0x1900, 0x19ff).r(FUNC(aristmk4_state::mk4_printer_r));
map(0x2000, 0x3fff).rom(); // graphics rom map
- map(0x4000, 0x4fff).bankrw("bank1").share("nvram");
+ map(0x4000, 0x4fff).ram().share("nvram");
map(0x5000, 0x5000).w(FUNC(aristmk4_state::u3_p0));
map(0x5002, 0x5002).r(FUNC(aristmk4_state::u3_p2));
@@ -1078,7 +1078,7 @@ void aristmk4_state::poker_mem(address_map &map)
map(0x1801, 0x1801).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w));
map(0x1c00, 0x1cff).w(FUNC(aristmk4_state::mk4_printer_w));
map(0x1900, 0x19ff).r(FUNC(aristmk4_state::mk4_printer_r));
- map(0x4000, 0x4fff).bankrw("bank1").share("nvram");
+ map(0x4000, 0x4fff).ram().share("nvram");
map(0x5000, 0x5000).w(FUNC(aristmk4_state::u3_p0));
map(0x5002, 0x5002).r(FUNC(aristmk4_state::u3_p2));
diff --git a/src/mame/drivers/arsystems.cpp b/src/mame/drivers/arsystems.cpp
index 41608be4f40..6dd1761f55d 100644
--- a/src/mame/drivers/arsystems.cpp
+++ b/src/mame/drivers/arsystems.cpp
@@ -66,6 +66,8 @@ public:
arcadia_amiga_state(const machine_config &mconfig, device_type type, const char *tag)
: amiga_state(mconfig, type, tag)
, m_bios_region(*this, "user2")
+ , m_rom_board(*this, "user3")
+
{
}
@@ -103,7 +105,7 @@ private:
virtual void machine_reset() override;
- optional_memory_region m_bios_region;
+ optional_memory_region m_bios_region, m_rom_board;
uint8_t m_coin_counter[2];
};
@@ -119,7 +121,7 @@ private:
WRITE16_MEMBER(arcadia_amiga_state::arcadia_multibios_change_game)
{
if (data == 0)
- space.install_read_bank(0x800000, 0x97ffff, "bank2");
+ space.install_rom(0x800000, 0x97ffff, m_rom_board->base());
else
space.nop_read(0x800000, 0x97ffff);
}
@@ -221,7 +223,7 @@ void arcadia_amiga_state::a500_mem(address_map &map)
void arcadia_amiga_state::arcadia_map(address_map &map)
{
a500_mem(map);
- map(0x800000, 0x97ffff).bankr("bank2").region("user3", 0);
+ map(0x800000, 0x97ffff).rom().region("user3", 0);
map(0x980000, 0x9fbfff).rom().region("user2", 0);
map(0x9fc000, 0x9ffffd).ram().share("nvram");
map(0x9ffffe, 0x9fffff).w(FUNC(arcadia_amiga_state::arcadia_multibios_change_game));
@@ -231,7 +233,7 @@ void arcadia_amiga_state::arcadia_map(address_map &map)
void arcadia_amiga_state::argh_map(address_map &map)
{
a500_mem(map);
- map(0x800000, 0x97ffff).bankr("bank2").region("user3", 0);
+ map(0x800000, 0x97ffff).rom().region("user3", 0);
// map(0x980000, 0x9fefff).rom().region("user3", 0);
map(0x9ff000, 0x9fffff).ram().share("nvram");
map(0xf00000, 0xf7ffff).rom().region("user3", 0);
@@ -468,7 +470,7 @@ ROM_END
ROM_START( ar_dart2 )
ARCADIA_BIOS
- ROM_REGION16_BE(0x200000, "user3", 0)
+ ROM_REGION16_BE(0x180000, "user3", 0)
ROM_LOAD16_BYTE( "arcadia3.u10", 0x00000, 0x10000, CRC(7166c736) SHA1(9892725b4d0aac6486950f8153083ba3f6982ad8) )
ROM_LOAD16_BYTE( "arcadia3.u6", 0x00001, 0x10000, CRC(f226137e) SHA1(61540885ff83420f5adc1087547e0ece33383ffd) )
ROM_LOAD16_BYTE( "arcadia3.u11", 0x20000, 0x10000, CRC(5d9a7804) SHA1(acd8eb7fd28594e8008eb953f843a72f12782ea2) )
@@ -645,7 +647,7 @@ ROM_END
ROM_START( ar_ninj )
ARCADIA_BIOS
- ROM_REGION16_BE(0x200000, "user3", 0)
+ ROM_REGION16_BE(0x180000, "user3", 0)
ROM_LOAD16_BYTE( "ninj_1h.bin", 0x00000, 0x10000, CRC(53b07b4d) SHA1(4852005adf60fe63f2da880dd32740d18fd31169) )
ROM_LOAD16_BYTE( "ninj_1l.bin", 0x00001, 0x10000, CRC(3337a6c1) SHA1(be9719f0cd5872b51f4c6d32fcac2638c0dedaf4) )
ROM_LOAD16_BYTE( "ninj_2h.bin", 0x20000, 0x10000, CRC(e28a5fa8) SHA1(150e26aea24706b72d2e6612280d5dddc527061b) )
@@ -663,7 +665,7 @@ ROM_END
ROM_START( ar_ninj2 )
ARCADIA_BIOS
- ROM_REGION16_BE(0x200000, "user3", 0)
+ ROM_REGION16_BE(0x180000, "user3", 0)
ROM_LOAD16_BYTE( "arcadia5.u10", 0x00000, 0x10000, CRC(217cb8eb) SHA1(7cb1da4d5d5b5af5f42c10848c7535bdeebbcd94) )
ROM_LOAD16_BYTE( "arcadia5.u6", 0x00001, 0x10000, CRC(009bee8f) SHA1(ff61a0770643400ecddc70e603ca6589424b6831) )
ROM_LOAD16_BYTE( "arcadia5.u11", 0x20000, 0x10000, CRC(f5c84e48) SHA1(8149a225a406ffb7c9faaa48af4947c2f66f750d) )
@@ -687,7 +689,7 @@ ROM_END
ROM_START( ar_rdwr )
ARCADIA_BIOS
- ROM_REGION16_BE(0x200000, "user3", 0)
+ ROM_REGION16_BE(0x180000, "user3", 0)
ROM_LOAD16_BYTE( "rdwr_1h.bin", 0x00000, 0x10000, CRC(f52cb704) SHA1(cce8c7484ae8c3a3d14b2e79a981780a277c9b1c) )
ROM_LOAD16_BYTE( "rdwr_1l.bin", 0x00001, 0x10000, CRC(fde0de6d) SHA1(7f62ce854a040775548c5ba3b05e6a4dcb0d7cfb) )
ROM_LOAD16_BYTE( "rdwr_2h.bin", 0x20000, 0x10000, CRC(8f3c1a2c) SHA1(e473e55457c04ebd597375e9936aeb0473507ed7) )
@@ -721,7 +723,7 @@ ROM_END
ROM_START( ar_sdwr2 )
ARCADIA_BIOS
- ROM_REGION16_BE(0x200000, "user3", 0)
+ ROM_REGION16_BE(0x180000, "user3", 0)
ROM_LOAD16_BYTE( "arcadia1.u10", 0x00000, 0x10000, CRC(30949f1f) SHA1(270cd449f994eda76afd5532018bad636ac4cf68) )
ROM_LOAD16_BYTE( "arcadia1.u6", 0x00001, 0x10000, CRC(c760d1c4) SHA1(7d311e8b192e493da9501755e096599e1e8e8d3e) )
ROM_LOAD16_BYTE( "arcadia1.u11", 0x20000, 0x10000, CRC(d67ba564) SHA1(2afba72a77806e3925c9ca1e13c16c442a6cfc3a) )
diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp
index d3480749f66..cd838f7b3a4 100644
--- a/src/mame/drivers/asteroid.cpp
+++ b/src/mame/drivers/asteroid.cpp
@@ -321,8 +321,8 @@ void asteroid_state::asteroid_map(address_map &map)
{
map.global_mask(0x7fff);
map(0x0000, 0x01ff).ram();
- map(0x0200, 0x02ff).bankrw("ram1").share("ram1");
- map(0x0300, 0x03ff).bankrw("ram2").share("ram2");
+ map(0x0200, 0x02ff).bankrw("ram1");
+ map(0x0300, 0x03ff).bankrw("ram2");
map(0x2000, 0x2007).r(FUNC(asteroid_state::asteroid_IN0_r)).nopw(); /* IN0 */
map(0x2400, 0x2407).r(FUNC(asteroid_state::asteroid_IN1_r)); /* IN1 */
map(0x2800, 0x2803).r(FUNC(asteroid_state::asteroid_DSW1_r)).nopw(); /* DSW1 */
@@ -333,7 +333,7 @@ void asteroid_state::asteroid_map(address_map &map)
map(0x3a00, 0x3a00).w(FUNC(asteroid_state::asteroid_thump_w));
map(0x3c00, 0x3c07).w("audiolatch", FUNC(ls259_device::write_d7));
map(0x3e00, 0x3e00).w(FUNC(asteroid_state::asteroid_noise_reset_w));
- map(0x4000, 0x47ff).ram().share("dvg:vectorram").region("maincpu", 0x4000);
+ map(0x4000, 0x47ff).ram().share("dvg:vectorram");
map(0x5000, 0x57ff).rom(); /* vector rom */
map(0x6800, 0x7fff).rom();
}
@@ -343,8 +343,8 @@ void asteroid_state::astdelux_map(address_map &map)
{
map.global_mask(0x7fff);
map(0x0000, 0x01ff).ram();
- map(0x0200, 0x02ff).bankrw("ram1").share("ram1");
- map(0x0300, 0x03ff).bankrw("ram2").share("ram2");
+ map(0x0200, 0x02ff).bankrw("ram1");
+ map(0x0300, 0x03ff).bankrw("ram2");
map(0x2000, 0x2007).r(FUNC(asteroid_state::asteroid_IN0_r)).nopw(); /* IN0 */
map(0x2400, 0x2407).r(FUNC(asteroid_state::asteroid_IN1_r)).nopw(); /* IN1 */
map(0x2800, 0x2803).r(FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
@@ -357,7 +357,7 @@ void asteroid_state::astdelux_map(address_map &map)
map(0x3a00, 0x3a00).w(FUNC(asteroid_state::earom_control_w));
map(0x3c00, 0x3c07).w("audiolatch", FUNC(ls259_device::write_d7));
map(0x3e00, 0x3e00).w(FUNC(asteroid_state::asteroid_noise_reset_w));
- map(0x4000, 0x47ff).ram().share("dvg:vectorram").region("maincpu", 0x4000);
+ map(0x4000, 0x47ff).ram().share("dvg:vectorram");
map(0x4800, 0x57ff).rom(); /* vector rom */
map(0x6000, 0x7fff).rom();
}
@@ -376,7 +376,7 @@ void asteroid_state::llander_map(address_map &map)
map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3c00, 0x3c00).w(FUNC(asteroid_state::llander_sounds_w));
map(0x3e00, 0x3e00).w(FUNC(asteroid_state::llander_snd_reset_w));
- map(0x4000, 0x47ff).ram().share("dvg:vectorram").region("maincpu", 0x4000);
+ map(0x4000, 0x47ff).ram().share("dvg:vectorram");
map(0x4800, 0x5fff).rom(); /* vector rom */
map(0x5800, 0x5800).nopw(); // INC access?
map(0x6000, 0x7fff).rom();
diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp
index facffe41658..546ee873d07 100644
--- a/src/mame/drivers/at.cpp
+++ b/src/mame/drivers/at.cpp
@@ -442,9 +442,7 @@ void at_state::init_at_common(int xmsbase)
if (m_ram->size() > xmsbase)
{
offs_t ram_limit = 0x100000 + m_ram->size() - xmsbase;
- space.install_read_bank(0x100000, ram_limit - 1, "bank1");
- space.install_write_bank(0x100000, ram_limit - 1, "bank1");
- membank("bank1")->set_base(m_ram->pointer() + xmsbase);
+ space.install_ram(0x100000, ram_limit - 1, m_ram->pointer() + xmsbase);
}
}
@@ -463,8 +461,7 @@ void at_vrom_fix_state::machine_start()
at_state::machine_start();
address_space& space = m_maincpu->space(AS_PROGRAM);
- space.install_read_bank(0xc0000, 0xcffff, "vrom_bank");
- membank("vrom_bank")->set_base(machine().root_device().memregion("bios")->base());
+ space.install_rom(0xc0000, 0xcffff, machine().root_device().memregion("bios")->base());
}
void at_state::cfg_single_1200K(device_t *device)
diff --git a/src/mame/drivers/atari400.cpp b/src/mame/drivers/atari400.cpp
index 8330ea22bfc..5ba7f89556e 100644
--- a/src/mame/drivers/atari400.cpp
+++ b/src/mame/drivers/atari400.cpp
@@ -329,9 +329,6 @@ private:
required_device<pia6821_device> m_pia;
optional_device<dac_bit_interface> m_dac;
required_memory_region m_region_maincpu;
- memory_bank *m_0000 = nullptr;
- memory_bank *m_8000 = nullptr;
- memory_bank *m_a000 = nullptr;
optional_device<a800_cart_slot_device> m_cart;
optional_device<a800_cart_slot_device> m_cart2;
@@ -1740,35 +1737,17 @@ void a400_state::setup_ram(int bank, uint32_t size)
{
case 0: // 0x0000-0x7fff
ram_top = std::min(size, uint32_t(0x8000)) - 1;
- m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000");
- m_0000 = membank("0000");
- m_0000->set_base(m_ram->pointer());
+ m_maincpu->space(AS_PROGRAM).install_ram(0x0000, ram_top, m_ram->pointer());
break;
case 1: // 0x8000-0x9fff
ram_top = std::min(size, uint32_t(0xa000)) - 1;
if (ram_top > 0x8000)
- {
- m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x8000, ram_top, "8000");
- m_8000 = membank("8000");
- m_8000->set_base(m_ram->pointer() + 0x8000);
- }
- else
- {
- m_8000 = nullptr;
- }
+ m_maincpu->space(AS_PROGRAM).install_ram(0x8000, ram_top, m_ram->pointer() + 0x8000);
break;
case 2: // 0xa000-0xbfff
ram_top = std::min(size, uint32_t(0xc000)) - 1;
if (ram_top > 0xa000)
- {
- m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0xa000, ram_top, "a000");
- m_a000 = membank("a000");
- m_a000->set_base(m_ram->pointer() + 0xa000);
- }
- else
- {
- m_a000 = nullptr;
- }
+ m_maincpu->space(AS_PROGRAM).install_ram(0xa000, ram_top, m_ram->pointer() + 0xa000);
break;
}
}
diff --git a/src/mame/drivers/aussiebyte.cpp b/src/mame/drivers/aussiebyte.cpp
index 8f7c2318e54..a874b3b9317 100644
--- a/src/mame/drivers/aussiebyte.cpp
+++ b/src/mame/drivers/aussiebyte.cpp
@@ -48,7 +48,7 @@ void aussiebyte_state::aussiebyte_map(address_map &map)
map(0x0000, 0x3fff).bankr("bankr0").bankw("bankw0");
map(0x4000, 0x7fff).bankrw("bank1");
map(0x8000, 0xbfff).bankrw("bank2");
- map(0xc000, 0xffff).ram().region("mram", 0x0000);
+ map(0xc000, 0xffff).ram();
}
void aussiebyte_state::aussiebyte_io(address_map &map)
@@ -99,7 +99,7 @@ INPUT_PORTS_END
************************************************************/
WRITE8_MEMBER( aussiebyte_state::port15_w )
{
- membank("bankr0")->set_entry(m_port15); // point at ram
+ m_bankr0->set_entry(m_port15); // point at ram
m_port15 = true;
}
@@ -175,34 +175,34 @@ WRITE8_MEMBER( aussiebyte_state::port1a_w )
case 4:
m_port1a = data*3+1;
if (m_port15)
- membank("bankr0")->set_entry(data*3+1);
- membank("bankw0")->set_entry(data*3+1);
- membank("bank1")->set_entry(data*3+2);
- membank("bank2")->set_entry(data*3+3);
+ m_bankr0->set_entry(data*3+1);
+ m_bankw0->set_entry(data*3+1);
+ m_bank1->set_entry(data*3+2);
+ m_bank2->set_entry(data*3+3);
break;
case 5:
m_port1a = 1;
if (m_port15)
- membank("bankr0")->set_entry(1);
- membank("bankw0")->set_entry(1);
- membank("bank1")->set_entry(2);
- membank("bank2")->set_entry(13);
+ m_bankr0->set_entry(1);
+ m_bankw0->set_entry(1);
+ m_bank1->set_entry(2);
+ m_bank2->set_entry(13);
break;
case 6:
m_port1a = 14;
if (m_port15)
- membank("bankr0")->set_entry(14);
- membank("bankw0")->set_entry(14);
- membank("bank1")->set_entry(15);
- //membank("bank2")->set_entry(0); // open bus
+ m_bankr0->set_entry(14);
+ m_bankw0->set_entry(14);
+ m_bank1->set_entry(15);
+ //m_bank2->set_entry(0); // open bus
break;
case 7:
m_port1a = 1;
if (m_port15)
- membank("bankr0")->set_entry(1);
- membank("bankw0")->set_entry(1);
- membank("bank1")->set_entry(4);
- membank("bank2")->set_entry(13);
+ m_bankr0->set_entry(1);
+ m_bankw0->set_entry(1);
+ m_bank1->set_entry(4);
+ m_bank2->set_entry(13);
break;
}
}
@@ -446,8 +446,8 @@ QUICKLOAD_LOAD_MEMBER(aussiebyte_state::quickload_cb)
/* RAM must be banked in */
m_port15 = true; // disable boot rom
m_port1a = 4;
- membank("bankr0")->set_entry(m_port1a); /* enable correct program bank */
- membank("bankw0")->set_entry(m_port1a);
+ m_bankr0->set_entry(m_port1a); /* enable correct program bank */
+ m_bankw0->set_entry(m_port1a);
/* Avoid loading a program if CP/M-80 is not in memory */
if ((prog_space.read_byte(0) != 0xc3) || (prog_space.read_byte(5) != 0xc3))
@@ -488,10 +488,10 @@ void aussiebyte_state::machine_reset()
m_port1a = 1;
m_alpha_address = 0;
m_graph_address = 0;
- membank("bankr0")->set_entry(16); // point at rom
- membank("bankw0")->set_entry(1); // always write to ram
- membank("bank1")->set_entry(2);
- membank("bank2")->set_entry(3);
+ m_bankr0->set_entry(16); // point at rom
+ m_bankw0->set_entry(1); // always write to ram
+ m_bank1->set_entry(2);
+ m_bank2->set_entry(3);
m_maincpu->reset();
}
@@ -601,14 +601,12 @@ void aussiebyte_state::machine_start()
{
// Main ram is divided into 16k blocks (0-15). The boot rom is block number 16.
// For convenience, bank 0 is permanently assigned to C000-FFFF
- uint8_t *main = memregion("roms")->base();
- uint8_t *ram = memregion("mram")->base();
- membank("bankr0")->configure_entries(0, 16, &ram[0x0000], 0x4000);
- membank("bankw0")->configure_entries(0, 16, &ram[0x0000], 0x4000);
- membank("bank1")->configure_entries(0, 16, &ram[0x0000], 0x4000);
- membank("bank2")->configure_entries(0, 16, &ram[0x0000], 0x4000);
- membank("bankr0")->configure_entry(16, &main[0x0000]);
+ m_bankr0->configure_entries(0, 16, m_p_mram, 0x4000);
+ m_bankw0->configure_entries(0, 16, m_p_mram, 0x4000);
+ m_bank1->configure_entries(0, 16, m_p_mram, 0x4000);
+ m_bank2->configure_entries(0, 16, m_p_mram, 0x4000);
+ m_bankr0->configure_entry(16, memregion("roms")->base());
}
@@ -625,10 +623,6 @@ ROM_START(aussieby)
ROM_REGION(0x800, "chargen", 0)
ROM_LOAD( "8002.bin", 0x0000, 0x0800, CRC(fdd6eb13) SHA1(a094d416e66bdab916e72238112a6265a75ca690) )
-
- ROM_REGION(0x40000, "mram", ROMREGION_ERASE00) // main ram, 256k dynamic
- ROM_REGION(0x10000, "vram", ROMREGION_ERASEFF) // video ram, 64k dynamic
- ROM_REGION(0x00800, "aram", ROMREGION_ERASEFF) // attribute ram, 2k static
ROM_END
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
diff --git a/src/mame/drivers/b2m.cpp b/src/mame/drivers/b2m.cpp
index 7aeb9cb3c8d..4e319875cda 100644
--- a/src/mame/drivers/b2m.cpp
+++ b/src/mame/drivers/b2m.cpp
@@ -25,11 +25,7 @@
/* Address maps */
void b2m_state::b2m_mem(address_map &map)
{
- map(0x0000, 0x27ff).bankrw("bank1");
- map(0x2800, 0x2fff).bankrw("bank2");
- map(0x3000, 0x6fff).bankrw("bank3");
- map(0x7000, 0xdfff).bankrw("bank4");
- map(0xe000, 0xffff).bankrw("bank5");
+ // Dynamic, set with b2m_set_bank
}
void b2m_state::b2m_io(address_map &map)
@@ -258,14 +254,14 @@ void b2m_state::b2mrom(machine_config &config)
/* ROM definition */
ROM_START( b2m )
- ROM_REGION( 0x12000, "maincpu", ROMREGION_ERASEFF )
- ROM_LOAD( "b2m.rom", 0x10000, 0x2000, CRC(3f3214d6) SHA1(dd93e7fbabf14d1aed6777fe1ccfe0a3ca8fcaf2) )
+ ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD( "b2m.rom", 0x0000, 0x2000, CRC(3f3214d6) SHA1(dd93e7fbabf14d1aed6777fe1ccfe0a3ca8fcaf2) )
ROM_END
ROM_START( b2mrom )
- ROM_REGION( 0x22000, "maincpu", ROMREGION_ERASEFF )
- ROM_LOAD( "bios2.rom", 0x10000, 0x2000, CRC(c22a98b7) SHA1(7de91e653bf4b191ded62cf21532578268e4a2c1) )
- ROM_LOAD( "ramdos.sys", 0x12000, 0x60c0, CRC(91ed6df0) SHA1(4fd040f2647a6b7930c330c75560a035027d0606) )
+ ROM_REGION( 0x80c0, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD( "bios2.rom", 0x0000, 0x2000, CRC(c22a98b7) SHA1(7de91e653bf4b191ded62cf21532578268e4a2c1) )
+ ROM_LOAD( "ramdos.sys", 0x2000, 0x60c0, CRC(91ed6df0) SHA1(4fd040f2647a6b7930c330c75560a035027d0606) )
ROM_END
diff --git a/src/mame/drivers/basic52.cpp b/src/mame/drivers/basic52.cpp
index 907cf613ab2..3d45aa6b8da 100644
--- a/src/mame/drivers/basic52.cpp
+++ b/src/mame/drivers/basic52.cpp
@@ -76,7 +76,7 @@ void basic52_state::basic52_io(address_map &map)
{
map.unmap_value_high();
map(0x0000, 0x7fff).ram();
- map(0x8000, 0x9fff).rom(); // EPROM
+ map(0x8000, 0x9fff).rom().region("maincpu", 0); // EPROM
map(0xa000, 0xa003).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write)); // PPI-8255
//map(0xc000, 0xdfff) // Expansion block
//map(0xe000, 0xffff) // Expansion block
@@ -136,7 +136,7 @@ void basic52_state::basic52(machine_config &config)
/* ROM definition */
ROM_START( basic52 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASEFF )
ROM_SYSTEM_BIOS(0, "v11", "v 1.1")
ROMX_LOAD( "mcs-51-11.bin", 0x0000, 0x2000, CRC(4157b22b) SHA1(bd9e6869b400cc1c9b163243be7bdcf16ce72789), ROM_BIOS(0))
ROM_SYSTEM_BIOS(1, "v11b", "v 1.1b")
@@ -146,7 +146,7 @@ ROM_START( basic52 )
ROM_END
ROM_START( basic31 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASEFF )
ROM_SYSTEM_BIOS(0, "v12", "v 1.2")
ROMX_LOAD( "mcs-51-12.bin", 0x0000, 0x2000, CRC(ee667c7c) SHA1(e69b32e69ecda2012c7113649634a3a64e984bed), ROM_BIOS(0))
ROM_SYSTEM_BIOS(1, "v12a", "v 1.2a")
diff --git a/src/mame/drivers/beathead.cpp b/src/mame/drivers/beathead.cpp
index bcb16369f56..7e126b100c1 100644
--- a/src/mame/drivers/beathead.cpp
+++ b/src/mame/drivers/beathead.cpp
@@ -249,7 +249,7 @@ WRITE32_MEMBER( beathead_state::coin_count_w )
void beathead_state::main_map(address_map &map)
{
map(0x00000000, 0x0001ffff).ram().share("ram_base");
- map(0x01800000, 0x01bfffff).rom().region("user1", 0).share("rom_base");
+ map(0x01800000, 0x01bfffff).rom().region("user1", 0);
map(0x40000000, 0x400007ff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)).umask32(0x000000ff);
map(0x41000000, 0x41000000).rw(m_jsa, FUNC(atari_jsa_iii_device::main_response_r), FUNC(atari_jsa_iii_device::main_command_w));
map(0x41000100, 0x41000103).r(FUNC(beathead_state::interrupt_control_r));
diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp
index 70d906675b7..211e627dc09 100644
--- a/src/mame/drivers/blitz68k.cpp
+++ b/src/mame/drivers/blitz68k.cpp
@@ -1010,7 +1010,7 @@ void blitz68k_state::cjffruit_map(address_map &map)
map(0x8fc000, 0x8fc001).w(FUNC(blitz68k_state::cjffruit_leds3_w)).share("leds2");
map(0x8fe000, 0x8fe003).w(FUNC(blitz68k_state::blit_flags_w)); // flipx,y,solid,trans
- map(0x8fe004, 0x8fe005).writeonly();
+ map(0x8fe004, 0x8fe005).nopw();
map(0x8fe006, 0x8fe007).w(FUNC(blitz68k_state::crtc_lpen_w)); // 0x8fe006: 0->1, 0x8fe007: 1->0
map(0xc40000, 0xc40001).rw(FUNC(blitz68k_state::crtc_r), FUNC(blitz68k_state::crtc_w));
@@ -1110,7 +1110,7 @@ void blitz68k_state::deucesw2_map(address_map &map)
map(0x89c000, 0x89c001).w(FUNC(blitz68k_state::deucesw2_leds3_w)).share("leds2");
map(0x89e000, 0x89e003).w(FUNC(blitz68k_state::blit_flags_w)); // flipx,y,solid,trans
- map(0x89e004, 0x89e005).writeonly();
+ map(0x89e004, 0x89e005).nopw();
map(0x89e006, 0x89e007).w(FUNC(blitz68k_state::crtc_lpen_w)); // 0x89e006: 0->1, 0x89e007: 1->0
map(0xc00000, 0xc00001).rw(FUNC(blitz68k_state::crtc_r), FUNC(blitz68k_state::crtc_w));
@@ -1286,7 +1286,7 @@ void blitz68k_state::hermit_map(address_map &map)
map(0x9e8000, 0x9e8001).w(FUNC(blitz68k_state::hermit_leds2_w)).share("leds1");
map(0x9f0000, 0x9f0003).w(FUNC(blitz68k_state::blit_flags_w)); // flipx,y,solid,trans
- map(0x9f0004, 0x9f0005).writeonly();
+ map(0x9f0004, 0x9f0005).nopw();
map(0x9f0006, 0x9f0007).w(FUNC(blitz68k_state::crtc_lpen_w)); // 0x9f0006: 0->1, 0x9f0007: 1->0
map(0xb00000, 0xb00001).rw(FUNC(blitz68k_state::crtc_r), FUNC(blitz68k_state::crtc_w)); // triggered by MCU?
diff --git a/src/mame/drivers/blmbycar.cpp b/src/mame/drivers/blmbycar.cpp
index 827c4be384f..292114012fe 100644
--- a/src/mame/drivers/blmbycar.cpp
+++ b/src/mame/drivers/blmbycar.cpp
@@ -114,10 +114,10 @@ WRITE16_MEMBER(blmbycar_state::vram_w)
void blmbycar_state::common_map(address_map &map)
{
map(0x000000, 0x0fffff).rom();
- map(0x100000, 0x103fff).writeonly(); // ???
+ map(0x100000, 0x103fff).writeonly().share("unk_100000"); // ???
map(0x104000, 0x105fff).ram().w(FUNC(blmbycar_state::vram_w<1>)).share("vram_1"); // Layer 1
map(0x106000, 0x107fff).ram().w(FUNC(blmbycar_state::vram_w<0>)).share("vram_0"); // Layer 0
- map(0x108000, 0x10bfff).writeonly(); // ???
+ map(0x108000, 0x10bfff).writeonly().share("unk_108000"); // ???
map(0x10c000, 0x10c003).writeonly().share("scroll_1"); // Scroll 1
map(0x10c004, 0x10c007).writeonly().share("scroll_0"); // Scroll 0
map(0x200000, 0x203fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette").mirror(0x4000); // Palette
@@ -156,7 +156,7 @@ void blmbycar_state::watrball_map(address_map &map)
map(0x700006, 0x700007).nopr(); // read
map(0x700008, 0x700009).r(FUNC(blmbycar_state::waterball_unk_r)); // 0x0008 must toggle
- map(0x70000a, 0x70000b).writeonly(); // ?? busy
+ map(0x70000a, 0x70000b).nopw(); // ?? busy
}
void blmbycar_state::blmbycar_oki_map(address_map &map)
diff --git a/src/mame/drivers/bmcbowl.cpp b/src/mame/drivers/bmcbowl.cpp
index 45125c983e8..c9c99c00423 100644
--- a/src/mame/drivers/bmcbowl.cpp
+++ b/src/mame/drivers/bmcbowl.cpp
@@ -122,7 +122,7 @@ public:
bmcbowl_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_stats_ram(*this, "nvram", 16),
+ m_stats_ram(*this, "nvram"),
m_vid1(*this, "vid1"),
m_vid2(*this, "vid2"),
m_palette(*this, "palette"),
diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp
index 0dd49ba62ba..be0677ce9b4 100644
--- a/src/mame/drivers/bnstars.cpp
+++ b/src/mame/drivers/bnstars.cpp
@@ -106,14 +106,14 @@ class bnstars_state : public ms32_state
public:
bnstars_state(const machine_config &mconfig, device_type type, const char *tag)
: ms32_state(mconfig, type, tag)
- , m_ms32_tx0_ram(*this, "tx0_ram", 32)
- , m_ms32_tx1_ram(*this, "tx1_ram", 32)
- , m_ms32_bg0_ram(*this, "bg0_ram", 32)
- , m_ms32_bg1_ram(*this, "bg1_ram", 32)
- , m_ms32_roz0_ram(*this, "roz0_ram", 32)
- , m_ms32_roz1_ram(*this, "roz1_ram", 32)
+ , m_ms32_tx0_ram(*this, "tx0_ram")
+ , m_ms32_tx1_ram(*this, "tx1_ram")
+ , m_ms32_bg0_ram(*this, "bg0_ram")
+ , m_ms32_bg1_ram(*this, "bg1_ram")
+ , m_ms32_roz0_ram(*this, "roz0_ram")
+ , m_ms32_roz1_ram(*this, "roz1_ram")
, m_ms32_roz_ctrl(*this, "roz_ctrl.%u", 0)
- , m_ms32_spram(*this, "spram", 32)
+ , m_ms32_spram(*this, "spram")
, m_ms32_tx0_scroll(*this, "tx0_scroll")
, m_ms32_bg0_scroll(*this, "bg0_scroll")
, m_ms32_tx1_scroll(*this, "tx1_scroll")
diff --git a/src/mame/drivers/btime.cpp b/src/mame/drivers/btime.cpp
index f4e059b90b5..752c3d623fe 100644
--- a/src/mame/drivers/btime.cpp
+++ b/src/mame/drivers/btime.cpp
@@ -2158,8 +2158,7 @@ void btime_state::init_disco()
void btime_state::init_cookrace()
{
- m_audiocpu->space(AS_PROGRAM).install_read_bank(0x0200, 0x0fff, "bank10");
- membank("bank10")->set_base(memregion("audiocpu")->base() + 0xe200);
+ m_audiocpu->space(AS_PROGRAM).install_rom(0x0200, 0x0fff, memregion("audiocpu")->base() + 0xe200);
m_audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
@@ -2173,8 +2172,7 @@ void btime_state::init_wtennis()
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc15f, 0xc15f, read8_delegate(*this, FUNC(btime_state::wtennis_reset_hack_r)));
- m_audiocpu->space(AS_PROGRAM).install_read_bank(0x0200, 0x0fff, "bank10");
- membank("bank10")->set_base(memregion("audiocpu")->base() + 0xe200);
+ m_audiocpu->space(AS_PROGRAM).install_rom(0x0200, 0x0fff, memregion("audiocpu")->base() + 0xe200);
m_audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
diff --git a/src/mame/drivers/buggychl.cpp b/src/mame/drivers/buggychl.cpp
index c5c3238e4f2..22b5c2daf14 100644
--- a/src/mame/drivers/buggychl.cpp
+++ b/src/mame/drivers/buggychl.cpp
@@ -233,7 +233,7 @@ void buggychl_state::buggychl_map(address_map &map)
map(0xd820, 0xd83f).ram(); // TODO
map(0xd840, 0xd85f).writeonly().share("scrollv");
map(0xdb00, 0xdbff).writeonly().share("scrollh");
- map(0xdc04, 0xdc04).writeonly(); /* should be fg scroll */
+ map(0xdc04, 0xdc04).nopw(); /* should be fg scroll */
map(0xdc06, 0xdc06).w(FUNC(buggychl_state::buggychl_bg_scrollx_w));
}
diff --git a/src/mame/drivers/bw12.cpp b/src/mame/drivers/bw12.cpp
index 7bcc6580078..4f15dc86f12 100644
--- a/src/mame/drivers/bw12.cpp
+++ b/src/mame/drivers/bw12.cpp
@@ -46,22 +46,22 @@ void bw12_state::bankswitch()
{
address_space &program = m_maincpu->space(AS_PROGRAM);
- switch (m_bank)
+ switch (m_curbank)
{
case 0: /* ROM */
- program.install_read_bank(0x0000, 0x7fff, "bank1");
+ program.install_read_bank(0x0000, 0x7fff, m_bank);
program.unmap_write(0x0000, 0x7fff);
break;
case 1: /* BK0 */
- program.install_readwrite_bank(0x0000, 0x7fff, "bank1");
+ program.install_readwrite_bank(0x0000, 0x7fff, m_bank);
break;
case 2: /* BK1 */
case 3: /* BK2 */
if (m_ram->size() > 64*1024)
{
- program.install_readwrite_bank(0x0000, 0x7fff, "bank1");
+ program.install_readwrite_bank(0x0000, 0x7fff, m_bank);
}
else
{
@@ -70,7 +70,7 @@ void bw12_state::bankswitch()
break;
}
- membank("bank1")->set_entry(m_bank);
+ m_bank->set_entry(m_curbank);
}
void bw12_state::floppy_motor_on_off()
@@ -98,13 +98,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(bw12_state::floppy_motor_off_tick)
WRITE_LINE_MEMBER(bw12_state::ls138_a0_w)
{
- m_bank = (m_bank & 0x02) | state;
+ m_curbank = (m_curbank & 0x02) | state;
bankswitch();
}
WRITE_LINE_MEMBER(bw12_state::ls138_a1_w)
{
- m_bank = (state << 1) | (m_bank & 0x01);
+ m_curbank = (state << 1) | (m_curbank & 0x01);
bankswitch();
}
@@ -136,7 +136,7 @@ READ8_MEMBER( bw12_state::ls259_r )
void bw12_state::bw12_mem(address_map &map)
{
- map(0x0000, 0x7fff).bankrw("bank1");
+ map(0x0000, 0x7fff).bankrw("bank");
map(0x8000, 0xf7ff).ram();
map(0xf800, 0xffff).ram().share("video_ram");
}
@@ -440,12 +440,12 @@ WRITE_LINE_MEMBER( bw12_state::ay3600_data_ready_w )
void bw12_state::machine_start()
{
/* setup memory banking */
- membank("bank1")->configure_entry(0, m_rom->base());
- membank("bank1")->configure_entry(1, m_ram->pointer());
- membank("bank1")->configure_entries(2, 2, m_ram->pointer() + 0x10000, 0x8000);
+ m_bank->configure_entry(0, m_rom->base());
+ m_bank->configure_entry(1, m_ram->pointer());
+ m_bank->configure_entries(2, 2, m_ram->pointer() + 0x10000, 0x8000);
/* register for state saving */
- save_item(NAME(m_bank));
+ save_item(NAME(m_curbank));
save_item(NAME(m_pit_out2));
save_item(NAME(m_key_data));
save_item(NAME(m_key_sin));
diff --git a/src/mame/drivers/bwidow.cpp b/src/mame/drivers/bwidow.cpp
index 77376396b47..fe14a926848 100644
--- a/src/mame/drivers/bwidow.cpp
+++ b/src/mame/drivers/bwidow.cpp
@@ -407,7 +407,7 @@ WRITE8_MEMBER(bwidow_state::irq_ack_w)
void bwidow_state::bwidow_map(address_map &map)
{
map(0x0000, 0x07ff).ram();
- map(0x2000, 0x27ff).ram().share("avg:vectorram").region("maincpu", 0x2000);
+ map(0x2000, 0x27ff).ram().share("avg:vectorram");
map(0x2800, 0x5fff).rom();
map(0x6000, 0x67ff).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x6800, 0x6fff).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
@@ -436,7 +436,7 @@ void bwidow_state::bwidowp_map(address_map &map)
map(0x2800, 0x2800).w("avg", FUNC(avg_device::reset_w));
map(0x3000, 0x3000).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3800, 0x3800).w(FUNC(bwidow_state::bwidow_misc_w)); /* coin counters, leds */
- map(0x4000, 0x47ff).ram().share("avg:vectorram").region("maincpu", 0x4000);
+ map(0x4000, 0x47ff).ram().share("avg:vectorram");
map(0x4800, 0x6fff).rom();
map(0x6000, 0x6000).w(FUNC(bwidow_state::irq_ack_w)); /* interrupt acknowledge */
map(0x8000, 0x803f).w(FUNC(bwidow_state::earom_write));
@@ -462,7 +462,7 @@ void bwidow_state::spacduel_map(address_map &map)
map(0x0f00, 0x0f3f).w(FUNC(bwidow_state::earom_write));
map(0x1000, 0x10ff).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x1400, 0x14ff).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write));
- map(0x2000, 0x27ff).ram().share("avg:vectorram").region("maincpu", 0x2000);
+ map(0x2000, 0x27ff).ram().share("avg:vectorram");
map(0x2800, 0x3fff).rom();
map(0x4000, 0xffff).rom();
}
diff --git a/src/mame/drivers/bzone.cpp b/src/mame/drivers/bzone.cpp
index ccfefcb64e4..9f278f4fa91 100644
--- a/src/mame/drivers/bzone.cpp
+++ b/src/mame/drivers/bzone.cpp
@@ -348,10 +348,20 @@ void bzone_state::bzone_map(address_map &map)
map(0x1820, 0x182f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x1840, 0x1840).w(FUNC(bzone_state::bzone_sounds_w));
map(0x1860, 0x187f).w(m_mathbox, FUNC(mathbox_device::go_w));
- map(0x2000, 0x2fff).ram().share("avg:vectorram").region("maincpu", 0x2000);
+ map(0x2000, 0x2fff).ram().share("avg:vectorram");
map(0x3000, 0x7fff).rom();
}
+void bzone_state::bradley_map(address_map &map)
+{
+ bzone_map(map);
+ map(0x0400, 0x07ff).ram();
+ map(0x1808, 0x1808).portr("1808");
+ map(0x1809, 0x1809).portr("1809");
+ map(0x180a, 0x180a).r(FUNC(bzone_state::analog_data_r));
+ map(0x1848, 0x1850).w(FUNC(bzone_state::analog_select_w));
+}
+
void redbaron_state::redbaron_map(address_map &map)
{
map.global_mask(0x7fff);
@@ -373,7 +383,7 @@ void redbaron_state::redbaron_map(address_map &map)
map(0x1810, 0x181f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x1820, 0x185f).rw(FUNC(redbaron_state::earom_read), FUNC(redbaron_state::earom_write));
map(0x1860, 0x187f).nopr().w("mathbox", FUNC(mathbox_device::go_w));
- map(0x2000, 0x2fff).ram().share("avg:vectorram").region("maincpu", 0x2000);
+ map(0x2000, 0x2fff).ram().share("avg:vectorram");
map(0x3000, 0x7fff).rom();
}
@@ -600,6 +610,12 @@ void bzone_state::bzone(machine_config &config)
bzone_audio(config);
}
+void bzone_state::bradley(machine_config &config)
+{
+ bzone(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &bzone_state::bradley_map);
+}
+
void redbaron_state::redbaron(machine_config &config)
{
bzone_base(config);
@@ -890,18 +906,6 @@ void bzone_state::analog_select_w(offs_t offset, uint8_t data)
}
-void bzone_state::init_bradley()
-{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.install_ram(0x400, 0x7ff);
- space.install_read_port(0x1808, 0x1808, "1808");
- space.install_read_port(0x1809, 0x1809, "1809");
- space.install_read_handler(0x180a, 0x180a, read8smo_delegate(*this, FUNC(bzone_state::analog_data_r)));
- space.install_write_handler(0x1848, 0x1850, write8sm_delegate(*this, FUNC(bzone_state::analog_select_w)));
-}
-
-
-
/*************************************
*
* Game drivers
@@ -911,6 +915,6 @@ void bzone_state::init_bradley()
GAMEL(1980, bzone, 0, bzone, bzone, bzone_state, empty_init, ROT0, "Atari", "Battle Zone (rev 2)", MACHINE_SUPPORTS_SAVE, layout_bzone )
GAMEL(1980, bzonea, bzone, bzone, bzone, bzone_state, empty_init, ROT0, "Atari", "Battle Zone (rev 1)", MACHINE_SUPPORTS_SAVE, layout_bzone )
GAMEL(1980, bzonec, bzone, bzone, bzone, bzone_state, empty_init, ROT0, "Atari", "Battle Zone (cocktail)", MACHINE_SUPPORTS_SAVE|MACHINE_NO_COCKTAIL, layout_bzone )
-GAME( 1980, bradley, 0, bzone, bradley, bzone_state, init_bradley, ROT0, "Atari", "Bradley Trainer", MACHINE_SUPPORTS_SAVE )
+GAME( 1980, bradley, 0, bradley, bradley, bzone_state, empty_init, ROT0, "Atari", "Bradley Trainer", MACHINE_SUPPORTS_SAVE )
GAMEL(1980, redbaron, 0, redbaron, redbaron, redbaron_state, empty_init, ROT0, "Atari", "Red Baron (Revised Hardware)", MACHINE_SUPPORTS_SAVE, layout_redbaron )
GAMEL(1980, redbarona, redbaron, redbaron, redbaron, redbaron_state, empty_init, ROT0, "Atari", "Red Baron", MACHINE_SUPPORTS_SAVE, layout_redbaron )
diff --git a/src/mame/drivers/c128.cpp b/src/mame/drivers/c128.cpp
index aa92864ba67..9a083804299 100644
--- a/src/mame/drivers/c128.cpp
+++ b/src/mame/drivers/c128.cpp
@@ -69,7 +69,7 @@ public:
m_from(*this, "from"),
m_rom(*this, M8502_TAG),
m_charom(*this, "charom"),
- m_color_ram(*this, "color_ram"),
+ m_color_ram(*this, "color_ram", 0x800, ENDIANNESS_LITTLE),
m_row(*this, "ROW%u", 0),
m_k(*this, "K%u", 0),
m_lock(*this, "LOCK"),
@@ -113,7 +113,7 @@ public:
required_device<generic_slot_device> m_from;
required_memory_region m_rom;
required_memory_region m_charom;
- optional_shared_ptr<uint8_t> m_color_ram;
+ memory_share_creator<uint8_t> m_color_ram;
required_ioport_array<8> m_row;
required_ioport_array<3> m_k;
required_ioport m_lock;
@@ -1565,9 +1565,6 @@ void c128d81_iec_devices(device_slot_interface &device)
void c128_state::machine_start()
{
- // allocate memory
- m_color_ram.allocate(0x800);
-
// initialize memory
uint8_t data = 0xff;
diff --git a/src/mame/drivers/c64.cpp b/src/mame/drivers/c64.cpp
index 7847994757c..37d8f863b0e 100644
--- a/src/mame/drivers/c64.cpp
+++ b/src/mame/drivers/c64.cpp
@@ -64,7 +64,7 @@ public:
m_user(*this, PET_USER_PORT_TAG),
m_ram(*this, RAM_TAG),
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
- m_color_ram(*this, "color_ram"),
+ m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_LITTLE),
m_row(*this, "ROW%u", 0),
m_lock(*this, "LOCK"),
m_loram(1),
@@ -93,7 +93,7 @@ public:
required_device<pet_user_port_device> m_user;
required_device<ram_device> m_ram;
optional_device<pet_datassette_port_device> m_cassette;
- optional_shared_ptr<uint8_t> m_color_ram;
+ memory_share_creator<uint8_t> m_color_ram;
optional_ioport_array<8> m_row;
optional_ioport m_lock;
@@ -1386,9 +1386,6 @@ void c64_state::machine_start()
}
m_charom = memregion("charom")->base();
- // allocate memory
- m_color_ram.allocate(0x400);
-
// initialize memory
uint8_t data = 0xff;
diff --git a/src/mame/drivers/cabaret.cpp b/src/mame/drivers/cabaret.cpp
index 4b3dbe20342..a2c62607c4e 100644
--- a/src/mame/drivers/cabaret.cpp
+++ b/src/mame/drivers/cabaret.cpp
@@ -201,7 +201,7 @@ WRITE8_MEMBER(cabaret_state::ppi2_c_w)
void cabaret_state::cabaret_map(address_map &map)
{
map(0x00000, 0x0efff).rom();
- map(0x0f000, 0x0ffff).ram().region("maincpu", 0xf000);
+ map(0x0f000, 0x0ffff).ram();
}
void cabaret_state::cabaret_portmap(address_map &map)
diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp
index 638a8417ab1..185e584320b 100644
--- a/src/mame/drivers/calchase.cpp
+++ b/src/mame/drivers/calchase.cpp
@@ -408,7 +408,7 @@ void calchase_state::calchase_map(address_map &map)
{
map(0x00000000, 0x0009ffff).ram();
map(0x000a0000, 0x000bffff).rw("vga", FUNC(trident_vga_device::mem_r), FUNC(trident_vga_device::mem_w)); // VGA VRAM
- map(0x000c0000, 0x000c7fff).ram().region("video_bios", 0);
+ map(0x000c0000, 0x000c7fff).rom().region("video_bios", 0);
map(0x000c8000, 0x000cffff).noprw();
//map(0x000d0000, 0x000d0003).ram(); // XYLINX - Sincronus serial communication
map(0x000d0004, 0x000d0005).r(FUNC(calchase_state::calchase_iocard1_r));
diff --git a/src/mame/drivers/calorie.cpp b/src/mame/drivers/calorie.cpp
index ece27322a36..538c80d5fe4 100644
--- a/src/mame/drivers/calorie.cpp
+++ b/src/mame/drivers/calorie.cpp
@@ -186,7 +186,6 @@ uint32_t calorie_state::screen_update_calorie(screen_device &screen, bitmap_ind1
m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
}
-
for (x = 0x400; x >= 0; x -= 4)
{
int xpos, ypos, tileno, color, flipx, flipy;
@@ -287,7 +286,7 @@ void calorie_state::calorie_map(address_map &map)
void calorie_state::decrypted_opcodes_map(address_map &map)
{
map(0x0000, 0x7fff).rom().share("decrypted_opcodes");
- map(0x8000, 0xbfff).rom();
+ map(0x8000, 0xbfff).rom().region("maincpu", 0x8000);
map(0xc000, 0xcfff).ram().share("ram");
}
diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp
index d9eb765e244..5fce05ac23e 100644
--- a/src/mame/drivers/cbm2.cpp
+++ b/src/mame/drivers/cbm2.cpp
@@ -91,9 +91,9 @@ public:
m_basic(*this, "basic"),
m_kernal(*this, "kernal"),
m_charom(*this, "charom"),
- m_buffer_ram(*this, "buffer_ram"),
- m_extbuf_ram(*this, "extbuf_ram"),
- m_video_ram(*this, "video_ram"),
+ m_buffer_ram(*this, "buffer_ram", 0x800, ENDIANNESS_LITTLE),
+ m_extbuf_ram(*this, "extbuf_ram", 0x800, ENDIANNESS_LITTLE),
+ m_video_ram(*this, "video_ram", 0x800, ENDIANNESS_LITTLE),
m_pa(*this, "PA%u", 0),
m_pb(*this, "PB%u", 0),
m_lock(*this, "LOCK"),
@@ -130,9 +130,9 @@ public:
required_memory_region m_basic;
required_memory_region m_kernal;
required_memory_region m_charom;
- optional_shared_ptr<uint8_t> m_buffer_ram;
- optional_shared_ptr<uint8_t> m_extbuf_ram;
- optional_shared_ptr<uint8_t> m_video_ram;
+ memory_share_creator<uint8_t> m_buffer_ram;
+ memory_share_creator<uint8_t> m_extbuf_ram;
+ memory_share_creator<uint8_t> m_video_ram;
required_ioport_array<8> m_pa;
required_ioport_array<8> m_pb;
required_ioport m_lock;
@@ -257,7 +257,7 @@ public:
: cbm2_state(mconfig, type, tag),
m_pla2(*this, PLA2_TAG),
m_vic(*this, MOS6569_TAG),
- m_color_ram(*this, "color_ram"),
+ m_color_ram(*this, "color_ram", 0x400, ENDIANNESS_LITTLE),
m_statvid(1),
m_vicdotsel(1),
m_vicbnksel(0x03)
@@ -265,7 +265,7 @@ public:
required_device<pla_device> m_pla2;
required_device<mos6566_device> m_vic;
- optional_shared_ptr<uint8_t> m_color_ram;
+ memory_share_creator<uint8_t> m_color_ram;
DECLARE_MACHINE_START( p500 );
DECLARE_MACHINE_START( p500_ntsc );
@@ -2060,10 +2060,6 @@ void cbm2_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
MACHINE_START_MEMBER( cbm2_state, cbm2 )
{
- // allocate memory
- m_video_ram.allocate(m_video_ram_size);
- m_buffer_ram.allocate(0x800);
-
// allocate timer
int todclk = (m_ntsc ? 60 : 50) * 2;
@@ -2113,9 +2109,6 @@ MACHINE_START_MEMBER( cbm2_state, cbm2_pal )
MACHINE_START_MEMBER( cbm2_state, cbm2x_ntsc )
{
- // allocate memory
- m_extbuf_ram.allocate(0x800);
-
MACHINE_START_CALL_MEMBER(cbm2_ntsc);
}
@@ -2126,9 +2119,6 @@ MACHINE_START_MEMBER( cbm2_state, cbm2x_ntsc )
MACHINE_START_MEMBER( cbm2_state, cbm2x_pal )
{
- // allocate memory
- m_extbuf_ram.allocate(0x800);
-
MACHINE_START_CALL_MEMBER(cbm2_pal);
}
@@ -2143,9 +2133,6 @@ MACHINE_START_MEMBER( p500_state, p500 )
MACHINE_START_CALL_MEMBER(cbm2);
- // allocate memory
- m_color_ram.allocate(0x400);
-
// state saving
save_item(NAME(m_statvid));
save_item(NAME(m_vicdotsel));
diff --git a/src/mame/drivers/cham24.cpp b/src/mame/drivers/cham24.cpp
index a314148a724..046529393dc 100644
--- a/src/mame/drivers/cham24.cpp
+++ b/src/mame/drivers/cham24.cpp
@@ -94,6 +94,7 @@ public:
void cham24_set_mirroring( int mirroring );
void cham24(machine_config &config);
void cham24_map(address_map &map);
+ void cham24_ppu_map(address_map &map);
};
@@ -229,6 +230,12 @@ void cham24_state::cham24_map(address_map &map)
map(0x8000, 0xffff).rom().w(FUNC(cham24_state::cham24_mapper_w));
}
+void cham24_state::cham24_ppu_map(address_map &map)
+{
+ map(0x0000, 0x1fff).bankr("bank1");
+ map(0x2000, 0x3eff).rw(FUNC(cham24_state::nt_r), FUNC(cham24_state::nt_w));
+}
+
static INPUT_PORTS_START( cham24 )
PORT_START("P1") /* IN0 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
@@ -272,16 +279,12 @@ void cham24_state::machine_reset()
memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
/* uses 8K swapping, all ROM!*/
- m_ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "bank1");
membank("bank1")->set_base(memregion("gfx1")->base());
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(*this, FUNC(cham24_state::nt_r)), write8_delegate(*this, FUNC(cham24_state::nt_w)));
}
void cham24_state::init_cham24()
@@ -302,6 +305,7 @@ void cham24_state::cham24(machine_config &config)
screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update));
PPU_2C02(config, m_ppu);
+ m_ppu->set_addrmap(0, &cham24_state::cham24_ppu_map);
m_ppu->set_cpu_tag(m_maincpu);
m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
diff --git a/src/mame/drivers/chinagat.cpp b/src/mame/drivers/chinagat.cpp
index b27f6ddf41a..8e992ea474a 100644
--- a/src/mame/drivers/chinagat.cpp
+++ b/src/mame/drivers/chinagat.cpp
@@ -525,7 +525,7 @@ void chinagat_state::main_map(address_map &map)
map(0x2800, 0x2fff).ram().w(FUNC(chinagat_state::ddragon_bgvideoram_w)).share("bgvideoram");
map(0x3000, 0x317f).w(m_palette, FUNC(palette_device::write8)).share("palette");
map(0x3400, 0x357f).w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext");
- map(0x3800, 0x397f).bankw("bank3").share("spriteram");
+ map(0x3800, 0x397f).ram().share("spriteram");
map(0x3e00, 0x3e04).w(FUNC(chinagat_state::interrupt_w));
map(0x3e06, 0x3e06).writeonly().share("scrolly_lo");
map(0x3e07, 0x3e07).writeonly().share("scrollx_lo");
diff --git a/src/mame/drivers/chsuper.cpp b/src/mame/drivers/chsuper.cpp
index f8873b3f705..4218429986f 100644
--- a/src/mame/drivers/chsuper.cpp
+++ b/src/mame/drivers/chsuper.cpp
@@ -216,7 +216,7 @@ void chsuper_state::chsuper_prg_map(address_map &map)
{
map(0x00000, 0x0efff).rom();
map(0x00000, 0x01fff).w(FUNC(chsuper_state::chsuper_vram_w));
- map(0x0f000, 0x0ffff).ram().region("maincpu", 0xf000);
+ map(0x0f000, 0x0ffff).ram();
map(0xfb000, 0xfbfff).ram().share("nvram");
}
diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp
index 6e3d6d5a4b6..dfd335740ec 100644
--- a/src/mame/drivers/cninja.cpp
+++ b/src/mame/drivers/cninja.cpp
@@ -145,6 +145,14 @@ void cninja_state::cninjabl_map(address_map &map)
map(0x1b4000, 0x1b4001).w(m_spriteram[0], FUNC(buffered_spriteram16_device::write)); /* DMA flag */
}
+void cninja_state::cninjabl2_map(address_map &map)
+{
+ cninja_map(map);
+
+ map(0x180000, 0x18ffff).ram();
+ map(0x1b4000, 0x1b4001).r(FUNC(cninja_state::cninjabl2_sprite_dma_r));
+}
+
READ16_MEMBER( cninja_state::edrandy_protection_region_8_146_r )
{
int real_address = 0x1a0000 + (offset *2);
@@ -909,6 +917,7 @@ void cninja_state::stoneage(machine_config &config)
void cninja_state::cninjabl2(machine_config &config)
{
stoneage(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &cninja_state::cninjabl2_map);
m_audiocpu->set_addrmap(AS_PROGRAM, &cninja_state::cninjabl2_s_map);
m_screen->set_screen_update(FUNC(cninja_state::screen_update_cninjabl2));
@@ -2169,9 +2178,6 @@ ROM_END
void cninja_state::init_cninjabl2()
{
- m_maincpu->space(AS_PROGRAM).install_ram(0x180000, 0x18ffff);
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x1b4000, 0x1b4001, read16_delegate(*this, FUNC(cninja_state::cninjabl2_sprite_dma_r)));
-
m_okibank->configure_entries(0, 8, memregion("oki2")->base(), 0x10000);
}
diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp
index 86ecbabcfd3..df331fde22b 100644
--- a/src/mame/drivers/combatsc.cpp
+++ b/src/mame/drivers/combatsc.cpp
@@ -240,7 +240,7 @@ WRITE8_MEMBER(combatsc_state::combatscb_bankselect_w)
}
else
{
- space.install_read_bank(0x4000, 0x7fff, "bank1"); /* banked ROM */
+ space.install_read_bank(0x4000, 0x7fff, membank("bank1")); /* banked ROM */
space.unmap_write(0x4000, 0x7fff); /* banked ROM */
}
}
diff --git a/src/mame/drivers/compis.cpp b/src/mame/drivers/compis.cpp
index 8f33dda2d1b..5e862512dde 100644
--- a/src/mame/drivers/compis.cpp
+++ b/src/mame/drivers/compis.cpp
@@ -694,15 +694,15 @@ void compis_state::machine_start()
switch (m_ram->size())
{
case 256*1024:
- m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0x3ffff, nullptr);
+ m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0x3ffff, m_ram->pointer());
break;
case 512*1024:
- m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0x7ffff, nullptr);
+ m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0x7ffff, m_ram->pointer());
break;
case 768*1024:
- m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0xbffff, nullptr);
+ m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0xbffff, m_ram->pointer());
break;
}
diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp
index 8bfb51c0407..9f6c88f5ac6 100644
--- a/src/mame/drivers/coolridr.cpp
+++ b/src/mame/drivers/coolridr.cpp
@@ -320,7 +320,7 @@ public:
m_workram_h(*this, "workrah"),
m_sound_dma(*this, "sound_dma"),
m_soundram(*this, "soundram%u", 1U),
- m_rom(*this, "share1"),
+ m_rom(*this, "maincpu"),
m_compressedgfx(*this, "compressedgfx"),
m_io_config(*this, "CONFIG"),
m_gfxdecode(*this, "gfxdecode"),
@@ -358,7 +358,7 @@ public:
required_shared_ptr<uint32_t> m_workram_h;
required_shared_ptr<uint32_t> m_sound_dma;
required_shared_ptr_array<uint16_t, 2> m_soundram;
- required_shared_ptr<uint32_t> m_rom;
+ required_region_ptr<uint32_t> m_rom;
required_region_ptr<uint8_t> m_compressedgfx;
required_ioport m_io_config;
required_device<gfxdecode_device> m_gfxdecode;
@@ -2782,7 +2782,7 @@ WRITE32_MEMBER(coolridr_state::dma_w)
void coolridr_state::system_h1_map(address_map &map)
{
- map(0x00000000, 0x001fffff).rom().share("share1").nopw();
+ map(0x00000000, 0x001fffff).rom().nopw();
map(0x01000000, 0x01ffffff).rom().region("gfx_data", 0x0000000);
map(0x03f40000, 0x03f4ffff).ram().share("txt_vram");//text tilemap + "lineram"
@@ -2793,7 +2793,7 @@ void coolridr_state::system_h1_map(address_map &map)
map(0x0400001c, 0x0400001f).w(FUNC(coolridr_state::fb_data_w));
map(0x06000000, 0x060fffff).ram().share("workrah");
- map(0x20000000, 0x201fffff).rom().share("share1");
+ map(0x20000000, 0x201fffff).rom().region("maincpu", 0);
map(0x60000000, 0x600003ff).nopw();
}
diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp
index 0f243576a88..54ddb436a39 100644
--- a/src/mame/drivers/crshrace.cpp
+++ b/src/mame/drivers/crshrace.cpp
@@ -166,7 +166,7 @@ void crshrace_state::crshrace_map(address_map &map)
map(0xfff00a, 0xfff00b).portr("DSW1");
map(0xfff00e, 0xfff00f).portr("P3");
map(0xfff020, 0xfff03f).w(m_k053936, FUNC(k053936_device::ctrl_w));
- map(0xfff044, 0xfff047).writeonly(); // ??? moves during race
+ map(0xfff044, 0xfff047).nopw(); // ??? moves during race
}
void crshrace_state::sound_map(address_map &map)
diff --git a/src/mame/drivers/cv1k.cpp b/src/mame/drivers/cv1k.cpp
index 404d08354bd..0d019815059 100644
--- a/src/mame/drivers/cv1k.cpp
+++ b/src/mame/drivers/cv1k.cpp
@@ -196,7 +196,7 @@ public:
m_serflash(*this, "game"),
m_eeprom(*this, "eeprom"),
m_ram(*this, "mainram"),
- m_rombase(*this, "rombase"),
+ m_rombase(*this, "maincpu"),
m_blitrate(*this, "BLITRATE"),
m_eepromout(*this, "EEPROMOUT"),
m_idleramoffs(0),
@@ -209,7 +209,7 @@ public:
required_device<rtc9701_device> m_eeprom;
required_shared_ptr<uint64_t> m_ram;
- required_shared_ptr<uint64_t> m_rombase;
+ required_region_ptr<uint64_t> m_rombase;
DECLARE_READ8_MEMBER(flash_io_r);
DECLARE_WRITE8_MEMBER(flash_io_w);
@@ -344,7 +344,7 @@ WRITE8_MEMBER( cv1k_state::serial_rtc_eeprom_w )
void cv1k_state::cv1k_map(address_map &map)
{
- map(0x00000000, 0x003fffff).rom().region("maincpu", 0).nopw().share("rombase"); // mmmbanc writes here on startup for some reason..
+ map(0x00000000, 0x003fffff).rom().region("maincpu", 0).nopw(); // mmmbanc writes here on startup for some reason..
map(0x0c000000, 0x0c7fffff).ram().share("mainram");// work RAM
map(0x10000000, 0x10000007).rw(FUNC(cv1k_state::flash_io_r), FUNC(cv1k_state::flash_io_w));
map(0x10400000, 0x10400007).w("ymz770", FUNC(ymz770_device::write));
@@ -355,7 +355,7 @@ void cv1k_state::cv1k_map(address_map &map)
void cv1k_state::cv1k_d_map(address_map &map)
{
- map(0x00000000, 0x003fffff).rom().region("maincpu", 0).nopw().share("rombase"); // mmmbanc writes here on startup for some reason..
+ map(0x00000000, 0x003fffff).rom().region("maincpu", 0).nopw(); // mmmbanc writes here on startup for some reason..
map(0x0c000000, 0x0cffffff).ram().share("mainram"); // work RAM
map(0x10000000, 0x10000007).rw(FUNC(cv1k_state::flash_io_r), FUNC(cv1k_state::flash_io_w));
map(0x10400000, 0x10400007).w("ymz770", FUNC(ymz770_device::write));
diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp
index cb56a3ad89a..5245455c32e 100644
--- a/src/mame/drivers/dccons.cpp
+++ b/src/mame/drivers/dccons.cpp
@@ -379,7 +379,7 @@ WRITE8_MEMBER(dc_cons_state::dc_flash_w)
void dc_cons_state::dc_map(address_map &map)
{
map(0x00000000, 0x001fffff).rom().nopw(); // BIOS
- map(0x00200000, 0x0021ffff).rw(FUNC(dc_cons_state::dc_flash_r), FUNC(dc_cons_state::dc_flash_w)).region("dcflash", 0x20000);
+ map(0x00200000, 0x0021ffff).rw(FUNC(dc_cons_state::dc_flash_r), FUNC(dc_cons_state::dc_flash_w));
map(0x005f6800, 0x005f69ff).rw(FUNC(dc_cons_state::dc_sysctrl_r), FUNC(dc_cons_state::dc_sysctrl_w));
map(0x005f6c00, 0x005f6cff).m(m_maple, FUNC(maple_dc_device::amap));
map(0x005f7000, 0x005f701f).rw(m_ata, FUNC(ata_interface_device::cs1_r), FUNC(ata_interface_device::cs1_w)).umask64(0x0000ffff0000ffff);
diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp
index b69e1b434b1..470cb40714f 100644
--- a/src/mame/drivers/ddenlovr.cpp
+++ b/src/mame/drivers/ddenlovr.cpp
@@ -1952,7 +1952,7 @@ void ddenlovr_state::quiz365_map(address_map &map)
map(0x200c02, 0x200c03).r(FUNC(ddenlovr_state::quiz365_protection_r)); // Protection
map(0x200e0a, 0x200e0d).w(FUNC(ddenlovr_state::quiz365_protection_w)); // Protection
-// map(0x201000, 0x2017ff).writeonly(); // ?
+// map(0x201000, 0x2017ff).nopw(); // ?
map(0x300201, 0x300201).w(FUNC(ddenlovr_state::ddenlovr_select2_w));
map(0x300203, 0x300203).w(FUNC(ddenlovr_state::quiz365_coincounter_w)); // Coin Counters + more stuff written on startup
@@ -2006,7 +2006,7 @@ void ddenlovr_state::ddenlovj_map(address_map &map)
map(0x000000, 0x07ffff).rom(); // ROM
map(0x200000, 0x2003ff).w(FUNC(ddenlovr_state::rongrong_palette_w)).umask16(0x00ff);
-// map(0x201000, 0x2017ff).writeonly(); // ? B0 on startup, then 00
+// map(0x201000, 0x2017ff).nopw(); // ? B0 on startup, then 00
map(0x300040, 0x300047).w(FUNC(ddenlovr_state::ddenlovr_palette_base_w)).umask16(0x00ff);
map(0x300048, 0x30004f).w(FUNC(ddenlovr_state::ddenlovr_palette_mask_w)).umask16(0x00ff);
@@ -2176,7 +2176,7 @@ void ddenlovr_state::nettoqc_map(address_map &map)
map(0x200000, 0x2003ff).w(FUNC(ddenlovr_state::rongrong_palette_w)).umask16(0x00ff);
map(0x200c02, 0x200c03).r(FUNC(ddenlovr_state::nettoqc_protection1_r)); // Protection 1
map(0x200e0a, 0x200e0d).writeonly().share("protection1"); // ""
- map(0x201000, 0x2017ff).writeonly(); // ?
+ map(0x201000, 0x2017ff).nopw(); // ?
map(0x300040, 0x300047).w(FUNC(ddenlovr_state::ddenlovr_palette_base_w)).umask16(0x00ff);
map(0x300048, 0x30004f).w(FUNC(ddenlovr_state::ddenlovr_palette_mask_w)).umask16(0x00ff);
@@ -2231,7 +2231,7 @@ void ddenlovr_state::ultrchmp_map(address_map &map)
map(0xd00c02, 0xd00c03).r(FUNC(ddenlovr_state::nettoqc_protection1_r)); // Protection 1
map(0xd00e0a, 0xd00e0d).writeonly().share("protection1"); // ""
- map(0xd01000, 0xd017ff).writeonly(); // ?
+ map(0xd01000, 0xd017ff).nopw(); // ?
map(0xe00040, 0xe00047).w(FUNC(ddenlovr_state::ddenlovr_palette_base_w)).umask16(0x00ff);
map(0xe00048, 0xe0004f).w(FUNC(ddenlovr_state::ddenlovr_palette_mask_w)).umask16(0x00ff);
@@ -2441,7 +2441,7 @@ void ddenlovr_state::mmpanic_map(address_map &map)
map(0x0000, 0x5fff).rom(); // ROM
map(0x0051, 0x0051).r(FUNC(ddenlovr_state::magic_r)); // ?
map(0x6000, 0x6fff).ram(); // RAM
- map(0x7000, 0x7fff).bankrw("bank2"); // RAM (Banked)
+ map(0x7000, 0x7fff).ram(); // RAM (Banked)
map(0x8000, 0xffff).bankr("bank1"); // ROM (Banked)
map(0x8000, 0x81ff).w(FUNC(ddenlovr_state::rongrong_palette_w));
}
diff --git a/src/mame/drivers/deadang.cpp b/src/mame/drivers/deadang.cpp
index 5698f9d0958..93e3b9e3458 100644
--- a/src/mame/drivers/deadang.cpp
+++ b/src/mame/drivers/deadang.cpp
@@ -72,17 +72,17 @@ void deadang_state::main_map(address_map &map)
map(0x00000, 0x037ff).ram();
map(0x03800, 0x03fff).ram().share("spriteram");
map(0x04000, 0x04fff).ram().share("share1");
- map(0x05000, 0x05fff).writeonly();
+ map(0x05000, 0x05fff).nopw();
map(0x06000, 0x0600f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
- map(0x06010, 0x07fff).writeonly();
+ map(0x06010, 0x07fff).nopw();
map(0x08000, 0x087ff).w(FUNC(deadang_state::text_w)).share("videoram");
- map(0x08800, 0x0bfff).writeonly();
+ map(0x08800, 0x0bfff).nopw();
map(0x0a000, 0x0a001).portr("P1_P2");
map(0x0a002, 0x0a003).portr("DSW");
map(0x0c000, 0x0cfff).w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x0d000, 0x0dfff).writeonly();
+ map(0x0d000, 0x0dfff).nopw();
map(0x0e000, 0x0e0ff).ram().share("scroll_ram");
- map(0x0e100, 0x0ffff).writeonly();
+ map(0x0e100, 0x0ffff).nopw();
map(0xc0000, 0xfffff).rom();
}
@@ -92,16 +92,16 @@ void popnrun_state::popnrun_main_map(address_map &map)
map(0x03c00, 0x03dff).ram().share("spriteram");
map(0x03e00, 0x03fff).ram();
map(0x04000, 0x04fff).ram().share("share1");
- map(0x05000, 0x05fff).writeonly();
+ map(0x05000, 0x05fff).nopw();
map(0x06000, 0x0600f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)).umask16(0x00ff);
- map(0x06010, 0x07fff).writeonly();
+ map(0x06010, 0x07fff).nopw();
map(0x08000, 0x08fff).ram().w(FUNC(popnrun_state::popnrun_text_w)).share("videoram");
map(0x0a000, 0x0a001).portr("P1_P2");
map(0x0a002, 0x0a003).portr("DSW");
map(0x0c000, 0x0cfff).w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x0d000, 0x0dfff).writeonly();
+ map(0x0d000, 0x0dfff).nopw();
map(0x0e000, 0x0e0ff).ram().share("scroll_ram");
- map(0x0e100, 0x0ffff).writeonly();
+ map(0x0e100, 0x0ffff).nopw();
map(0xc0000, 0xfffff).rom();
}
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index 33843810851..999a407bad8 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -456,6 +456,15 @@ void dec0_state::dec0_map(address_map &map)
map(0xffc000, 0xffc7ff).ram().share("spriteram");
}
+void dec0_state::ffantasybl_map(address_map &map)
+{
+ dec0_map(map);
+
+ map(0x0024c880, 0x0024cbff).ram(); // what is this? layer 3-related??
+ map(0x00242024, 0x00242025).r(FUNC(dec0_state::ffantasybl_242024_r));
+ map(0x00ff87ee, 0x00ff87ef).portr("VBLANK");
+}
+
void dec0_state::dec0_tb_map(address_map &map)
{
dec0_map(map);
@@ -2145,10 +2154,11 @@ void dec0_state::hippodrm(machine_config &config)
}
void dec0_state::ffantasybl(machine_config &config)
-
{
dec0(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &dec0_state::ffantasybl_map);
+
// H6280(config, m_subcpu, XTAL(21'477'272) / 16);
// m_subcpu->set_addrmap(AS_PROGRAM, &dec0_state::hippodrm_sub_map);
// m_subcpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
@@ -4081,14 +4091,6 @@ READ16_MEMBER(dec0_state::ffantasybl_242024_r)
return 0xffff;
}
-void dec0_state::init_ffantasybl()
-{
- m_maincpu->space(AS_PROGRAM).install_ram(0x24c880, 0x24cbff); // what is this? layer 3-related??
-
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x00242024, 0x00242025, read16_delegate(*this, FUNC(dec0_state::ffantasybl_242024_r)));
- m_maincpu->space(AS_PROGRAM).install_read_port(0x00ff87ee, 0x00ff87ef, "VBLANK");
-}
-
/******************************************************************************/
// YEAR, NAME, PARENT, MACHINE, INPUT, STATE/DEVICE, INIT, MONITOR,COMPANY, FULLNAME, FLAGS
@@ -4130,7 +4132,7 @@ GAME( 1988, drgninjab, baddudes, drgninjab, drgninja, dec0_state, init_drgni
// this is a common bootleg board
GAME( 1989, midresb, midres, midresb, midresb, dec0_state, init_midresb, ROT0, "bootleg", "Midnight Resistance (bootleg with 68705)", MACHINE_SUPPORTS_SAVE ) // need to hook up 68705? (probably unused)
GAME( 1989, midresbj, midres, midresbj, midresb, dec0_state, init_midresb, ROT0, "bootleg", "Midnight Resistance (Joystick bootleg)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, ffantasybl, hippodrm, ffantasybl, ffantasybl, dec0_state, init_ffantasybl, ROT0, "bootleg", "Fighting Fantasy (bootleg with 68705)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // 68705 not dumped, might be the same as midresb
+GAME( 1989, ffantasybl, hippodrm, ffantasybl, ffantasybl, dec0_state, empty_init, ROT0, "bootleg", "Fighting Fantasy (bootleg with 68705)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // 68705 not dumped, might be the same as midresb
GAME( 1988, drgninjab2, baddudes, drgninjab, drgninja, dec0_state, init_drgninja, ROT0, "bootleg", "Dragonninja (bootleg with 68705)", MACHINE_SUPPORTS_SAVE ) // is this the same board as above? (region warning hacked to World, but still shows Japanese text), 68705 dumped but not hooked up
// these are different to the above but quite similar to each other
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index e053f627c3c..53841cf02f5 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -648,7 +648,7 @@ void dec8_state::cobra_map(address_map &map)
map(0x2000, 0x27ff).ram().w(FUNC(dec8_state::dec8_videoram_w)).share("videoram");
map(0x2800, 0x2fff).ram().share("spriteram");
map(0x3000, 0x31ff).ram().w(m_palette, FUNC(deco_rmc3_device::write8)).share("palette");
- map(0x3200, 0x37ff).writeonly(); /* Unused */
+ map(0x3200, 0x37ff).nopw(); /* Unused */
map(0x3800, 0x3800).portr("IN0"); /* Player 1 */
map(0x3801, 0x3801).portr("IN1"); /* Player 2 */
map(0x3802, 0x3802).portr("DSW0"); /* Dip 1 */
diff --git a/src/mame/drivers/decocass.cpp b/src/mame/drivers/decocass.cpp
index a27db56a0e6..a49dda80aa8 100644
--- a/src/mame/drivers/decocass.cpp
+++ b/src/mame/drivers/decocass.cpp
@@ -122,6 +122,13 @@ void decocass_state::decocass_map(address_map &map)
map(0xf000, 0xffff).rom();
}
+void decocass_state::decocrom_map(address_map &map)
+{
+ decocass_map(map);
+ map(0x6000, 0xafff).bankr("bank1").w(FUNC(decocass_state::decocass_de0091_w));
+ map(0xe900, 0xe900).w(FUNC(decocass_state::decocass_e900_w));
+}
+
void decocass_state::decocass_sound_map(address_map &map)
{
map(0x0000, 0x0fff).ram();
@@ -2073,15 +2080,10 @@ void decocass_state::init_decocrom()
init_decocass();
/* convert charram to a banked ROM */
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x6000, 0xafff, "bank1");
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x6000, 0xafff, write8_delegate(*this, FUNC(decocass_state::decocass_de0091_w)));
membank("bank1")->configure_entry(0, m_charram);
membank("bank1")->configure_entry(1, memregion("user3")->base());
membank("bank1")->configure_entry(2, memregion("user3")->base()+0x5000);
membank("bank1")->set_entry(0);
-
- /* install the bank selector */
- m_maincpu->space(AS_PROGRAM).install_write_handler(0xe900, 0xe900, write8_delegate(*this, FUNC(decocass_state::decocass_e900_w)));
}
READ8_MEMBER(decocass_state::cdsteljn_input_r )
diff --git a/src/mame/drivers/dgn_beta.cpp b/src/mame/drivers/dgn_beta.cpp
index 4fb86031887..1bb44158d71 100644
--- a/src/mame/drivers/dgn_beta.cpp
+++ b/src/mame/drivers/dgn_beta.cpp
@@ -173,7 +173,6 @@ void dgn_beta_state::dgnbeta_map(address_map &map)
map(0xFE00, 0xFE0F).rw(FUNC(dgn_beta_state::dgn_beta_page_r), FUNC(dgn_beta_state::dgn_beta_page_w));
map(0xfe10, 0xfEff).noprw();
map(0xFF00, 0xFFFF).bankrw("bank17");
-
}
diff --git a/src/mame/drivers/dgpix.cpp b/src/mame/drivers/dgpix.cpp
index 29484abd2d0..bbd218a5f8f 100644
--- a/src/mame/drivers/dgpix.cpp
+++ b/src/mame/drivers/dgpix.cpp
@@ -359,7 +359,7 @@ void dgpix_state::mem_map(address_map &map)
map(0x40000000, 0x4003ffff).rw(FUNC(dgpix_state::vram_r), FUNC(dgpix_state::vram_w));
map(0xe0000000, 0xe1ffffff).rw(FUNC(dgpix_state::flash_r), FUNC(dgpix_state::flash_w));
map(0xe2000000, 0xe3ffffff).rw(FUNC(dgpix_state::flash_r), FUNC(dgpix_state::flash_w));
- map(0xffc00000, 0xffffffff).rom().region("flash", 0x1c00000).share("nvram");
+ map(0xffc00000, 0xffffffff).rom().region("flash", 0x1c00000);
}
void dgpix_state::io_map(address_map &map)
diff --git a/src/mame/drivers/diverboy.cpp b/src/mame/drivers/diverboy.cpp
index 3d0376188af..50a5ce596c4 100644
--- a/src/mame/drivers/diverboy.cpp
+++ b/src/mame/drivers/diverboy.cpp
@@ -177,8 +177,8 @@ void diverboy_state::diverboy_map(address_map &map)
map(0x180008, 0x180009).portr("COINS");
// map(0x18000a, 0x18000b).nopr();
// map(0x18000c, 0x18000d).nopw();
- map(0x320000, 0x3207ff).writeonly(); /* ?? */
- map(0x322000, 0x3227ff).writeonly(); /* ?? */
+ map(0x320000, 0x3207ff).nopw(); /* ?? */
+ map(0x322000, 0x3227ff).nopw(); /* ?? */
// map(0x340000, 0x340001).nopw();
// map(0x340002, 0x340003).nopw();
}
diff --git a/src/mame/drivers/dkong.cpp b/src/mame/drivers/dkong.cpp
index 24058318361..f345e67d7ef 100644
--- a/src/mame/drivers/dkong.cpp
+++ b/src/mame/drivers/dkong.cpp
@@ -530,7 +530,7 @@ MACHINE_RESET_MEMBER(dkong_state,dkong)
MACHINE_RESET_MEMBER(dkong_state,ddk)
{
- dk_braze_a15(!membank("bank1")->entry());
+ dk_braze_a15(!m_bank1->entry());
}
MACHINE_RESET_MEMBER(dkong_state,strtheat)
@@ -540,9 +540,9 @@ MACHINE_RESET_MEMBER(dkong_state,strtheat)
MACHINE_RESET_CALL_MEMBER(dkong);
/* The initial state of the counter is 0x08 */
- membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
+ m_bank1->configure_entries(0, 4, &ROM[0x10000], 0x4000);
m_decrypt_counter = 0x08;
- membank("bank1")->set_entry(0);
+ m_bank1->set_entry(0);
}
MACHINE_RESET_MEMBER(dkong_state,drakton)
@@ -552,9 +552,9 @@ MACHINE_RESET_MEMBER(dkong_state,drakton)
MACHINE_RESET_CALL_MEMBER(dkong);
/* The initial state of the counter is 0x09 */
- membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
+ m_bank1->configure_entries(0, 4, &ROM[0x10000], 0x4000);
m_decrypt_counter = 0x09;
- membank("bank1")->set_entry(1);
+ m_bank1->set_entry(1);
}
@@ -660,10 +660,10 @@ READ8_MEMBER(dkong_state::epos_decrypt_rom)
switch(m_decrypt_counter)
{
- case 0x08: membank("bank1")->set_entry(0); break;
- case 0x09: membank("bank1")->set_entry(1); break;
- case 0x0A: membank("bank1")->set_entry(2); break;
- case 0x0B: membank("bank1")->set_entry(3); break;
+ case 0x08: m_bank1->set_entry(0); break;
+ case 0x09: m_bank1->set_entry(1); break;
+ case 0x0A: m_bank1->set_entry(2); break;
+ case 0x0B: m_bank1->set_entry(3); break;
default:
logerror("Invalid counter = %02X\n",m_decrypt_counter);
break;
@@ -1633,8 +1633,8 @@ READ8_MEMBER(dkong_state::braze_eeprom_r)
WRITE_LINE_MEMBER(dkong_state::dk_braze_a15)
{
- membank("bank1")->set_entry(state & 0x01);
- membank("bank2")->set_entry(state & 0x01);
+ m_bank1->set_entry(state & 0x01);
+ m_bank2->set_entry(state & 0x01);
}
WRITE8_MEMBER(dkong_state::dk_braze_a15_w)
@@ -3590,7 +3590,7 @@ void dkong_state::init_drakton()
{7,1,4,0,3,6,2,5},
};
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1" );
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, m_bank1 );
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -3612,7 +3612,7 @@ void dkong_state::init_strtheat()
{6,3,4,1,0,7,2,5},
};
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1" );
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, m_bank1 );
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -3631,15 +3631,15 @@ void dkong_state::dk_braze_decrypt()
{
m_decrypted = std::make_unique<uint8_t[]>(0x10000);
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x5fff, "bank1");
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xffff, "bank2");
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x5fff, m_bank1);
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xffff, m_bank2);
braze_decrypt_rom(m_decrypted.get());
- membank("bank1")->configure_entries(0, 2, m_decrypted.get(), 0x8000);
- membank("bank1")->set_entry(0);
- membank("bank2")->configure_entries(0, 2, m_decrypted.get(), 0x8000);
- membank("bank2")->set_entry(0);
+ m_bank1->configure_entries(0, 2, m_decrypted.get(), 0x8000);
+ m_bank1->set_entry(0);
+ m_bank2->configure_entries(0, 2, m_decrypted.get(), 0x8000);
+ m_bank2->set_entry(0);
}
void dkong_state::init_dkonghs()
diff --git a/src/mame/drivers/dreamwld.cpp b/src/mame/drivers/dreamwld.cpp
index a844f46acbd..7b0d81ee9f8 100644
--- a/src/mame/drivers/dreamwld.cpp
+++ b/src/mame/drivers/dreamwld.cpp
@@ -120,10 +120,10 @@ public:
dreamwld_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_spriteram(*this, "spriteram")
- , m_vram(*this, "vram_%u", 0U, u8(32))
+ , m_vram(*this, "vram_%u", 0U)
, m_vregs(*this, "vregs")
, m_workram(*this, "workram")
- , m_lineram(*this, "lineram", 32)
+ , m_lineram(*this, "lineram")
, m_spritelut(*this, "spritelut")
, m_okibank(*this, "oki%ubank", 1)
, m_dsw(*this, "DSW")
diff --git a/src/mame/drivers/ec184x.cpp b/src/mame/drivers/ec184x.cpp
index 956838424d1..e5c65d18666 100644
--- a/src/mame/drivers/ec184x.cpp
+++ b/src/mame/drivers/ec184x.cpp
@@ -136,8 +136,7 @@ WRITE8_MEMBER(ec184x_state::memboard_w)
for (int i = 0; i < 4; i++)
m_memory.enable[i] &= 0xfb;
// enable read access
- membank("bank10")->set_base(m_ram->pointer() + offset * EC1841_MEMBOARD_SIZE);
- program.install_read_bank(0, EC1841_MEMBOARD_SIZE - 1, "bank10");
+ program.install_rom(0, EC1841_MEMBOARD_SIZE - 1, m_ram->pointer() + offset * EC1841_MEMBOARD_SIZE);
LOG("ec1841_memboard_w map_read(%d)\n", offset);
}
@@ -146,8 +145,7 @@ WRITE8_MEMBER(ec184x_state::memboard_w)
for (int i = 0; i < 4; i++)
m_memory.enable[i] &= 0xf7;
// enable write access
- membank("bank20")->set_base(m_ram->pointer() + offset * EC1841_MEMBOARD_SIZE);
- program.install_write_bank(0, EC1841_MEMBOARD_SIZE - 1, "bank20");
+ program.install_writeonly(0, EC1841_MEMBOARD_SIZE - 1, m_ram->pointer() + offset * EC1841_MEMBOARD_SIZE);
LOG("ec1841_memboard_w map_write(%d)\n", offset);
}
@@ -158,8 +156,7 @@ void ec184x_state::init_ec1840()
{
address_space &program = m_maincpu->space(AS_PROGRAM);
- program.install_readwrite_bank(0, m_ram->size()-1, "bank10");
- membank("bank10")->set_base(m_ram->pointer());
+ program.install_ram(0, m_ram->size()-1, m_ram->pointer());
}
void ec184x_state::init_ec1841()
@@ -169,20 +166,13 @@ void ec184x_state::init_ec1841()
m_memory.boards = m_ram->size() / EC1841_MEMBOARD_SIZE;
if (m_memory.boards > 4) m_memory.boards = 4;
- program.install_read_bank(0, EC1841_MEMBOARD_SIZE-1, "bank10");
- program.install_write_bank(0, EC1841_MEMBOARD_SIZE-1, "bank20");
-
- membank("bank10")->set_base(m_ram->pointer());
- membank("bank20")->set_base(m_ram->pointer());
+ program.install_ram(0, EC1841_MEMBOARD_SIZE-1, m_ram->pointer());
// 640K configuration is special -- 512K board mapped at 0 + 128K board mapped at 512K
// XXX verify this was actually the case
if (m_ram->size() == 640 * 1024)
{
- program.install_read_bank(EC1841_MEMBOARD_SIZE, m_ram->size() - 1, "bank11");
- program.install_write_bank(EC1841_MEMBOARD_SIZE, m_ram->size() - 1, "bank21");
- membank("bank11")->set_base(m_ram->pointer() + EC1841_MEMBOARD_SIZE);
- membank("bank21")->set_base(m_ram->pointer() + EC1841_MEMBOARD_SIZE);
+ program.install_ram(EC1841_MEMBOARD_SIZE, m_ram->size() - 1, m_ram->pointer() + EC1841_MEMBOARD_SIZE);
}
}
diff --git a/src/mame/drivers/elf.cpp b/src/mame/drivers/elf.cpp
index a693b642c82..ed3740347d1 100644
--- a/src/mame/drivers/elf.cpp
+++ b/src/mame/drivers/elf.cpp
@@ -80,7 +80,7 @@ void elf2_state::elf2_mem(address_map &map)
{
map.unmap_value_high();
map.global_mask(0xff);
- map(0x0000, 0x00ff).bankrw("bank1");
+ // Ram is added dynamically
}
void elf2_state::elf2_io(address_map &map)
@@ -212,10 +212,8 @@ void elf2_state::machine_start()
m_led_h->rbi_w(1);
/* setup memory banking */
- program.install_read_bank(0x0000, 0x00ff, "bank1");
+ program.install_rom(0x0000, 0x00ff, m_ram->pointer());
program.install_write_handler(0x0000, 0x00ff, write8_delegate(*this, FUNC(elf2_state::memory_w)));
- membank("bank1")->configure_entry(0, m_ram->pointer());
- membank("bank1")->set_entry(0);
/* register for state saving */
save_item(NAME(m_data));
diff --git a/src/mame/drivers/eolith16.cpp b/src/mame/drivers/eolith16.cpp
index baa2558ed80..bb47cdd904d 100644
--- a/src/mame/drivers/eolith16.cpp
+++ b/src/mame/drivers/eolith16.cpp
@@ -28,7 +28,7 @@ public:
eolith16_state(const machine_config &mconfig, device_type type, const char *tag)
: eolith_state(mconfig, type, tag)
, m_special_io(*this, "SPECIAL")
- , m_vram(*this, "vram", 16)
+ , m_vram(*this, "vram")
, m_vrambank(*this, "vrambank")
{
}
diff --git a/src/mame/drivers/excali64.cpp b/src/mame/drivers/excali64.cpp
index a393a0d87a9..eb41d3a8cbd 100644
--- a/src/mame/drivers/excali64.cpp
+++ b/src/mame/drivers/excali64.cpp
@@ -61,6 +61,8 @@ public:
, m_palette(*this, "palette")
, m_maincpu(*this, "maincpu")
, m_p_chargen(*this, "chargen")
+ , m_p_rambank(*this, "rambank", 0xc000, ENDIANNESS_LITTLE)
+ , m_p_videoram(*this, "videoram", 0xa000, ENDIANNESS_LITTLE)
, m_cass(*this, "cassette")
, m_crtc(*this, "crtc")
, m_io_keyboard(*this, "KEY.%u", 0)
@@ -103,7 +105,6 @@ private:
void io_map(address_map &map);
void mem_map(address_map &map);
- uint8_t *m_p_videoram;
uint8_t *m_p_hiresram;
uint8_t m_sys_status;
uint8_t m_kbdrow;
@@ -114,6 +115,8 @@ private:
required_device<palette_device> m_palette;
required_device<cpu_device> m_maincpu;
required_region_ptr<u8> m_p_chargen;
+ memory_share_creator<u8> m_p_rambank;
+ memory_share_creator<u8> m_p_videoram;
required_device<cassette_image_device> m_cass;
required_device<mc6845_device> m_crtc;
required_ioport_array<8> m_io_keyboard;
@@ -131,7 +134,7 @@ void excali64_state::mem_map(address_map &map)
map(0x2000, 0x2FFF).bankr("bankr2").bankw("bankw2");
map(0x3000, 0x3FFF).bankr("bankr3").bankw("bankw3");
map(0x4000, 0xBFFF).bankr("bankr4").bankw("bankw4");
- map(0xC000, 0xFFFF).ram().region("rambank", 0xC000);
+ map(0xC000, 0xFFFF).ram();
}
void excali64_state::io_map(address_map &map)
@@ -462,20 +465,18 @@ GFXDECODE_END
void excali64_state::excali64_palette(palette_device &palette)
{
// do this here because driver_init hasn't run yet
- m_p_videoram = memregion("videoram")->base();
m_p_hiresram = m_p_videoram + 0x2000;
uint8_t *main = memregion("roms")->base();
- uint8_t *ram = memregion("rambank")->base();
// main ram (cp/m mode)
- membank("bankr1")->configure_entry(0, &ram[0x0000]);
- membank("bankr2")->configure_entry(0, &ram[0x2000]);
- membank("bankr3")->configure_entry(0, &ram[0x3000]);
- membank("bankr4")->configure_entry(0, &ram[0x4000]);//boot
- membank("bankw1")->configure_entry(0, &ram[0x0000]);//boot
- membank("bankw2")->configure_entry(0, &ram[0x2000]);
- membank("bankw3")->configure_entry(0, &ram[0x3000]);
- membank("bankw4")->configure_entry(0, &ram[0x4000]);//boot
+ membank("bankr1")->configure_entry(0, &m_p_rambank[0x0000]);
+ membank("bankr2")->configure_entry(0, &m_p_rambank[0x2000]);
+ membank("bankr3")->configure_entry(0, &m_p_rambank[0x3000]);
+ membank("bankr4")->configure_entry(0, &m_p_rambank[0x4000]);//boot
+ membank("bankw1")->configure_entry(0, &m_p_rambank[0x0000]);//boot
+ membank("bankw2")->configure_entry(0, &m_p_rambank[0x2000]);
+ membank("bankw3")->configure_entry(0, &m_p_rambank[0x3000]);
+ membank("bankw4")->configure_entry(0, &m_p_rambank[0x4000]);//boot
// rom_1
membank("bankr1")->configure_entry(1, &main[0x0000]);//boot
membank("bankr1")->configure_entry(2, &main[0x2000]);
@@ -645,9 +646,6 @@ ROM_START( excali64 )
// patch out the protection
ROM_FILL(0x3ce7, 1, 0)
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASE00)
- ROM_REGION(0xA000, "videoram", ROMREGION_ERASE00)
-
ROM_REGION(0x1020, "chargen", 0)
ROM_LOAD( "genex_3.ic43", 0x0000, 0x1000, CRC(b91619a9) SHA1(2ced636cb7b94ba9d329868d7ecf79963cefe9d9) )
ROM_LOAD( "hm7603.ic55", 0x1000, 0x0020, CRC(c74f47dc) SHA1(331ff3c913846191ddd97cacb80bd19438c1ff71) )
diff --git a/src/mame/drivers/exidy.cpp b/src/mame/drivers/exidy.cpp
index c21b1a10c9b..88a0acabe22 100644
--- a/src/mame/drivers/exidy.cpp
+++ b/src/mame/drivers/exidy.cpp
@@ -1725,8 +1725,7 @@ void exidy_state::init_phantoma()
m_color_latch[0] = 0x09;
/* the ROM is actually mapped high */
- m_maincpu->space(AS_PROGRAM).install_read_bank(0xf800, 0xffff, "bank1");
- membank("bank1")->set_base(memregion("maincpu")->base() + 0xf800);
+ m_maincpu->space(AS_PROGRAM).install_rom(0xf800, 0xffff, memregion("maincpu")->base() + 0xf800);
}
diff --git a/src/mame/drivers/exidy440.cpp b/src/mame/drivers/exidy440.cpp
index 8f1d112b104..153b3dd5684 100644
--- a/src/mame/drivers/exidy440.cpp
+++ b/src/mame/drivers/exidy440.cpp
@@ -306,7 +306,7 @@ void exidy440_state::exidy440_bank_select(uint8_t bank)
if (bank == 0 && m_bank != 0)
m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(*this, FUNC(exidy440_state::showdown_bank0_r)));
else if (bank != 0 && m_bank == 0)
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, "bank1");
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x4000, 0x7fff, membank("bank1"));
}
/* select the bank and update the bank pointer */
diff --git a/src/mame/drivers/exp85.cpp b/src/mame/drivers/exp85.cpp
index 58b30641f3b..3a1cd9d9af4 100644
--- a/src/mame/drivers/exp85.cpp
+++ b/src/mame/drivers/exp85.cpp
@@ -167,11 +167,7 @@ DEVICE_INPUT_DEFAULTS_END
void exp85_state::machine_start()
{
- address_space &program = m_maincpu->space(AS_PROGRAM);
-
/* setup memory banking */
- program.install_read_bank(0x0000, 0x07ff, "bank1");
- program.unmap_write(0x0000, 0x07ff);
membank("bank1")->configure_entry(0, m_rom->base() + 0xf000);
membank("bank1")->configure_entry(1, m_rom->base());
membank("bank1")->set_entry(0);
diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp
index c772235dfe9..82a4b35eaaa 100644
--- a/src/mame/drivers/famibox.cpp
+++ b/src/mame/drivers/famibox.cpp
@@ -120,6 +120,7 @@ private:
void famicombox_bankswitch(uint8_t bank);
void famicombox_reset();
void famibox_map(address_map &map);
+ void famibox_ppu_map(address_map &map);
};
/******************************************************
@@ -388,6 +389,12 @@ void famibox_state::famibox_map(address_map &map)
map(0xc000, 0xffff).bankr("cpubank2");
}
+void famibox_state::famibox_ppu_map(address_map &map)
+{
+ map(0x0000, 0x1fff).bankr("ppubank1");
+ map(0x2000, 0x3eff).rw(FUNC(famibox_state::famibox_nt_r), FUNC(famibox_state::famibox_nt_w));
+}
+
/******************************************************
Inputs
@@ -510,12 +517,8 @@ void famibox_state::machine_start()
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(*this, FUNC(famibox_state::famibox_nt_r)), write8_delegate(*this, FUNC(famibox_state::famibox_nt_w)));
- m_ppu->space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "ppubank1");
-
famicombox_bankswitch(0);
-
m_attract_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(famibox_state::famicombox_attract_timer_callback),this));
m_gameplay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(famibox_state::famicombox_gameplay_timer_callback),this));
m_exception_cause = 0xff;
@@ -539,6 +542,7 @@ void famibox_state::famibox(machine_config &config)
screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update));
PPU_2C02(config, m_ppu);
+ m_ppu->set_addrmap(0, &famibox_state::famibox_ppu_map);
m_ppu->set_cpu_tag(m_maincpu);
m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
diff --git a/src/mame/drivers/fastfred.cpp b/src/mame/drivers/fastfred.cpp
index 1fb0df22581..a74853e19a5 100644
--- a/src/mame/drivers/fastfred.cpp
+++ b/src/mame/drivers/fastfred.cpp
@@ -251,7 +251,7 @@ void fastfred_state::sound_map(address_map &map)
map(0x0000, 0x1fff).rom();
map(0x2000, 0x23ff).ram();
map(0x3000, 0x3000).r("soundlatch", FUNC(generic_latch_8_device::read)).w(FUNC(fastfred_state::sound_nmi_mask_w));
- map(0x4000, 0x4000).writeonly(); // Reset PSG's
+ map(0x4000, 0x4000).nopw(); // Reset PSG's
map(0x5000, 0x5001).w("ay8910.1", FUNC(ay8910_device::address_data_w));
map(0x6000, 0x6001).w("ay8910.2", FUNC(ay8910_device::address_data_w));
map(0x7000, 0x7000).nopr(); // only for Imago, read but not used
diff --git a/src/mame/drivers/fk1.cpp b/src/mame/drivers/fk1.cpp
index a75e3ff7a6b..ca0ce8c39bc 100644
--- a/src/mame/drivers/fk1.cpp
+++ b/src/mame/drivers/fk1.cpp
@@ -260,7 +260,7 @@ READ8_MEMBER( fk1_state::fk1_bank_ram_r )
address_space &space_mem = m_maincpu->space(AS_PROGRAM);
uint8_t *ram = m_ram->pointer();
- space_mem.install_write_bank(0x0000, 0x3fff, "bank1");
+ space_mem.install_write_bank(0x0000, 0x3fff, membank("bank1"));
membank("bank1")->set_base(ram);
membank("bank2")->set_base(ram + 0x4000);
return 0;
diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp
index 30fe9cfb9d9..e6b037c7c89 100644
--- a/src/mame/drivers/fm7.cpp
+++ b/src/mame/drivers/fm7.cpp
@@ -1012,105 +1012,6 @@ READ8_MEMBER(fm7_state::fm7_mmr_r)
void fm7_state::fm7_update_bank(address_space & space, int bank, uint8_t physical)
{
m_avbank[bank]->set_bank(physical);
-/* uint8_t* RAM = memregion("maincpu")->base();
- uint16_t size = 0xfff;
- char bank_name[10];
-
- if(bank == 15)
- size = 0xbff;
-
- sprintf(bank_name,"bank%d",bank+1);
-
- if(physical >= 0x10 && physical <= 0x1b)
- {
- switch(physical)
- {
- case 0x10:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram0_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram0_w)));
- break;
- case 0x11:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram1_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram1_w)));
- break;
- case 0x12:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram2_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram2_w)));
- break;
- case 0x13:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram3_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram3_w)));
- break;
- case 0x14:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram4_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram4_w)));
- break;
- case 0x15:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram5_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram5_w)));
- break;
- case 0x16:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram6_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram6_w)));
- break;
- case 0x17:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram7_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram7_w)));
- break;
- case 0x18:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram8_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram8_w)));
- break;
- case 0x19:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vram9_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vram9_w)));
- break;
- case 0x1a:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vramA_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vramA_w)));
- break;
- case 0x1b:
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_vramB_r)),write8_delegate(*this, FUNC(fm7_state::fm7_vramB_w)));
- break;
- }
-// membank(bank+1)->set_base(RAM+(physical<<12)-0x10000);
- return;
- }
- if(physical == 0x1c)
- {
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_console_ram_banked_r)),write8_delegate(*this, FUNC(fm7_state::fm7_console_ram_banked_w)));
- return;
- }
- if(physical == 0x1d)
- {
- space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(*this, FUNC(fm7_state::fm7_sub_ram_ports_banked_r)),write8_delegate(*this, FUNC(fm7_state::fm7_sub_ram_ports_banked_w)));
- return;
- }
- if(physical == 0x35)
- {
- if(m_init_rom_en && (m_type == SYS_FM11 || m_type == SYS_FM16))
- {
- RAM = memregion("init")->base();
- space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space.nop_write(bank*0x1000,(bank*0x1000)+size);
- membank(bank_name)->set_base(RAM+(physical<<12)-0x35000);
- return;
- }
- }
- if(physical == 0x36 || physical == 0x37)
- {
- if(m_init_rom_en && (m_type != SYS_FM11 && m_type != SYS_FM16))
- {
- RAM = memregion("init")->base();
- space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space.nop_write(bank*0x1000,(bank*0x1000)+size);
- membank(bank_name)->set_base(RAM+(physical<<12)-0x36000);
- return;
- }
- }
- if(physical > 0x37 && physical <= 0x3f)
- {
- if(m_basic_rom_en && (m_type != SYS_FM11 && m_type != SYS_FM16))
- {
- RAM = memregion("fbasic")->base();
- space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space.nop_write(bank*0x1000,(bank*0x1000)+size);
- membank(bank_name)->set_base(RAM+(physical<<12)-0x38000);
- return;
- }
- }
- space.install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- membank(bank_name)->set_base(RAM+(physical<<12));
- */
}
void fm7_state::fm7_mmr_refresh(address_space& space)
@@ -1139,8 +1040,7 @@ void fm7_state::fm7_mmr_refresh(address_space& space)
window_addr = ((m_mmr.window_offset << 8) + 0x7c00) & 0xffff;
// if(window_addr < 0xfc00)
{
- space.install_readwrite_bank(0x7c00,0x7fff,"bank24");
- membank("bank24")->set_base(RAM+window_addr);
+ space.install_ram(0x7c00,0x7fff,RAM+window_addr);
}
}
else
@@ -1505,7 +1405,7 @@ void fm7_state::fm7_sub_mem(address_map &map)
map(0xd409, 0xd409).rw(FUNC(fm7_state::fm7_vram_access_r), FUNC(fm7_state::fm7_vram_access_w));
map(0xd40a, 0xd40a).rw(FUNC(fm7_state::fm7_sub_busyflag_r), FUNC(fm7_state::fm7_sub_busyflag_w));
map(0xd40e, 0xd40f).w(FUNC(fm7_state::fm7_vram_offset_w));
- map(0xd800, 0xffff).rom();
+ map(0xd800, 0xffff).rom().region("sub", 0);
}
void fm7_state::fm11_mem(address_map &map)
@@ -1663,8 +1563,8 @@ void fm7_state::fm77av_mem(address_map &map)
void fm7_state::fm77av_sub_mem(address_map &map)
{
map(0x0000, 0xbfff).rw(FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
- map(0xc000, 0xcfff).ram().region("maincpu", 0x1c000); // Console RAM
- map(0xd000, 0xd37f).ram().region("maincpu", 0x1d000); // Work RAM
+ map(0xc000, 0xcfff).ram().share("consoleram"); // Console RAM
+ map(0xd000, 0xd37f).ram().share("workram"); // Work RAM
map(0xd380, 0xd3ff).ram().share("shared_ram");
// I/O space (D400-D4FF)
map(0xd400, 0xd401).r(FUNC(fm7_state::fm7_sub_keyboard_r));
@@ -1686,12 +1586,12 @@ void fm7_state::fm77av_sub_mem(address_map &map)
void fm7_state::fm7_banked_mem(address_map &map)
{
// Extended RAM
- map(0x00000, 0x0ffff).ram().region("maincpu", 0x00000);
+ map(0x00000, 0x0ffff).ram().share("extendedram");
// Sub CPU space
map(0x10000, 0x1bfff).rw(FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
- map(0x1c000, 0x1cfff).ram().region("maincpu", 0x1c000); // Console RAM
- map(0x1d000, 0x1d37f).ram().region("maincpu", 0x1d000); // Work RAM
+ map(0x1c000, 0x1cfff).ram(); // Console RAM
+ map(0x1d000, 0x1d37f).ram(); // Work RAM
map(0x1d380, 0x1d3ff).ram().share("shared_ram");
// I/O space (D400-D4FF)
map(0x1d400, 0x1d401).r(FUNC(fm7_state::fm7_sub_keyboard_r));
@@ -1705,7 +1605,7 @@ void fm7_state::fm7_banked_mem(address_map &map)
map(0x1d410, 0x1d42b).rw(FUNC(fm7_state::fm77av_alu_r), FUNC(fm7_state::fm77av_alu_w));
map(0x1d430, 0x1d430).rw(FUNC(fm7_state::fm77av_video_flags_r), FUNC(fm7_state::fm77av_video_flags_w));
map(0x1d431, 0x1d432).rw(FUNC(fm7_state::fm77av_key_encoder_r), FUNC(fm7_state::fm77av_key_encoder_w));
- map(0x1d500, 0x1d7ff).ram().region("maincpu", 0x1d500); // Work RAM
+ map(0x1d500, 0x1d7ff).ram().share("workram2"); // Work RAM
map(0x1d800, 0x1dfff).bankr("bank20");
map(0x1e000, 0x1ffff).bankr("bank21");
@@ -1713,7 +1613,7 @@ void fm7_state::fm7_banked_mem(address_map &map)
map(0x20000, 0x2ffff).ram().region("maincpu", 0x20000);
// Main CPU space
- map(0x30000, 0x35fff).ram().region("maincpu", 0x30000);
+ map(0x30000, 0x35fff).ram();
map(0x36000, 0x37fff).bankr("init_bank_r").bankw("init_bank_w");
map(0x38000, 0x3fbff).bankr("fbasic_bank_r").bankw("fbasic_bank_w");
map(0x3fc00, 0x3ffff).ram().region("maincpu", 0x3fc00);
@@ -1879,8 +1779,8 @@ INPUT_PORTS_END
void fm7_state::init_fm7()
{
-// m_shared_ram = std::make_unique<uint8_t[]>(0x80);
m_video_ram = std::make_unique<uint8_t[]>(0x18000); // 2 pages on some systems
+ save_pointer(NAME(m_video_ram.get()), 0x18000);
m_timer = timer_alloc(TIMER_FM7_IRQ);
m_subtimer = timer_alloc(TIMER_FM7_SUBTIMER_IRQ);
m_keyboard_timer = timer_alloc(TIMER_FM7_KEYBOARD_POLL);
@@ -1913,10 +1813,8 @@ MACHINE_START_MEMBER(fm7_state,fm77av)
memcpy(RAM+0x3fff0,ROM+0x1ff0,16);
m_video.subrom = 0; // default sub CPU ROM is type C.
- RAM = memregion("subsyscg")->base();
- membank("bank20")->set_base(RAM);
- RAM = memregion("subsys_c")->base();
- membank("bank21")->set_base(RAM+0x800);
+ membank("bank20")->set_base(memregion("subsyscg")->base());
+ membank("bank21")->set_base(memregion("subsys_c")->base()+0x800);
m_type = SYS_FM77AV;
m_beeper->set_state(0);
@@ -2298,11 +2196,11 @@ void fm7_state::fm16beta(machine_config &config)
/* ROM definition */
ROM_START( fm8 )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "fbasic10.rom", 0x38000, 0x7c00, CRC(e80ed96c) SHA1(f3fa8a6adb07224ad2a1def77d5dae9662de0867) )
+ ROM_REGION( 0x7c00, "maincpu", 0 )
+ ROM_LOAD( "fbasic10.rom", 0, 0x7c00, CRC(e80ed96c) SHA1(f3fa8a6adb07224ad2a1def77d5dae9662de0867) )
- ROM_REGION( 0x20000, "sub", 0 )
- ROM_LOAD( "subsys_8.rom", 0xd800, 0x2800, CRC(979f9046) SHA1(9c52052087bf3a41b83d437a51d89b9fcfec2515) )
+ ROM_REGION( 0x2800, "sub", 0 )
+ ROM_LOAD( "subsys_8.rom", 0, 0x2800, CRC(979f9046) SHA1(9c52052087bf3a41b83d437a51d89b9fcfec2515) )
// either one of these boot ROMs are selectable via DIP switch
ROM_REGION( 0x200, "basic", 0 )
@@ -2319,11 +2217,11 @@ ROM_END
ROM_START( fmnew7 )
- ROM_REGION( 0x40000, "maincpu", 0 ) // at 0x7ba5 there is the ID string 0302840301, meaning it's v3.02 from 1984/03/01
- ROM_LOAD( "fbasic302.rom", 0x38000, 0x7c00, CRC(a96d19b6) SHA1(8d5f0cfe7e0d39bf2ab7e4c798a13004769c28b2) )
+ ROM_REGION( 0x7c00, "maincpu", 0 ) // at 0x7ba5 there is the ID string 0302840301, meaning it's v3.02 from 1984/03/01
+ ROM_LOAD( "fbasic302.rom", 0, 0x7c00, CRC(a96d19b6) SHA1(8d5f0cfe7e0d39bf2ab7e4c798a13004769c28b2) )
- ROM_REGION( 0x20000, "sub", 0 )
- ROM_LOAD( "subsys_c.rom", 0xd800, 0x2800, CRC(24cec93f) SHA1(50b7283db6fe1342c6063fc94046283f4feddc1c) )
+ ROM_REGION( 0x2800, "sub", 0 )
+ ROM_LOAD( "subsys_c.rom", 0, 0x2800, CRC(24cec93f) SHA1(50b7283db6fe1342c6063fc94046283f4feddc1c) )
// either one of these boot ROMs are selectable via DIP switch
ROM_REGION( 0x200, "basic", 0 )
@@ -2339,11 +2237,11 @@ ROM_START( fmnew7 )
ROM_END
ROM_START( fm7 )
- ROM_REGION( 0x40000, "maincpu", 0 ) // at 0x7ba5 there is the ID string 0300820920, meaning it's v3.00 from 1982/09/20
- ROM_LOAD( "fbasic300.rom", 0x38000, 0x7c00, CRC(87c98494) SHA1(d7e3603b0a2442c7632dad45f9704d9ad71968f5) )
+ ROM_REGION( 0x7c00, "maincpu", 0 ) // at 0x7ba5 there is the ID string 0300820920, meaning it's v3.00 from 1982/09/20
+ ROM_LOAD( "fbasic300.rom", 0, 0x7c00, CRC(87c98494) SHA1(d7e3603b0a2442c7632dad45f9704d9ad71968f5) )
- ROM_REGION( 0x20000, "sub", 0 )
- ROM_LOAD( "subsys_c.rom", 0xd800, 0x2800, CRC(24cec93f) SHA1(50b7283db6fe1342c6063fc94046283f4feddc1c) )
+ ROM_REGION( 0x2800, "sub", 0 )
+ ROM_LOAD( "subsys_c.rom", 0, 0x2800, CRC(24cec93f) SHA1(50b7283db6fe1342c6063fc94046283f4feddc1c) )
// either one of these boot ROMs are selectable via DIP switch
ROM_REGION( 0x200, "basic", 0 )
@@ -2359,8 +2257,8 @@ ROM_START( fm7 )
ROM_END
ROM_START( fm77av )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_FILL(0x0000,0x40000,0xff)
+ ROM_REGION( 0x7c00, "maincpu", 0 )
+ ROM_FILL(0x0000,0x7c00,0xff)
ROM_REGION( 0x2000, "init", 0 )
ROM_LOAD( "initiate.rom", 0x0000, 0x2000, CRC(785cb06c) SHA1(b65987e98a9564a82c85eadb86f0204eee5a5c93) )
@@ -2388,8 +2286,8 @@ ROM_START( fm77av )
ROM_END
ROM_START( fm7740sx )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_FILL(0x0000,0x40000,0xff)
+ ROM_REGION( 0x7c00, "maincpu", 0 )
+ ROM_FILL(0x0000,0x7c00,0xff)
ROM_REGION( 0x2000, "init", 0 )
ROM_LOAD( "initiate.rom", 0x0000, 0x2000, CRC(785cb06c) SHA1(b65987e98a9564a82c85eadb86f0204eee5a5c93) )
diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp
index bea9210ef2f..72f371ee866 100644
--- a/src/mame/drivers/fmtowns.cpp
+++ b/src/mame/drivers/fmtowns.cpp
@@ -2732,7 +2732,7 @@ void towns_state::driver_start()
save_pointer(m_video.towns_video_reg,"Video registers",2);
if (m_ram->size() > 0x100000)
- m_maincpu->space(AS_PROGRAM).install_ram(0x100000,m_ram->size()-1,nullptr);
+ m_maincpu->space(AS_PROGRAM).install_ram(0x100000,m_ram->size()-1,m_ram->pointer() + 0x100000);
}
void marty_state::driver_start()
diff --git a/src/mame/drivers/fruitpc.cpp b/src/mame/drivers/fruitpc.cpp
index af5436ecd82..3eb20ba7d9f 100644
--- a/src/mame/drivers/fruitpc.cpp
+++ b/src/mame/drivers/fruitpc.cpp
@@ -55,7 +55,7 @@ void fruitpc_state::fruitpc_map(address_map &map)
map(0x00000000, 0x0009ffff).ram();
map(0x000a0000, 0x000bffff).rw("vga", FUNC(vga_device::mem_r), FUNC(vga_device::mem_w)); // VGA VRAM
map(0x000c0000, 0x000dffff).rom().region("bios", 0);
- map(0x000e0000, 0x000fffff).ram().region("bios", 0);
+ map(0x000e0000, 0x000fffff).rom().region("bios", 0);
map(0x00100000, 0x008fffff).ram(); // 8MB RAM
map(0x02000000, 0x28ffffff).noprw();
map(0xfffe0000, 0xffffffff).rom().region("bios", 0); /* System BIOS */
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 69918a3943a..a8ae7a8afd9 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -1241,7 +1241,7 @@ INPUT_CHANGED_MEMBER(gmgalax_state::game_changed)
m_selected_game = newval;
/* select the bank and graphics bank based on it */
- membank("bank1")->set_entry(m_selected_game);
+ m_bank1->set_entry(m_selected_game);
galaxian_gfxbank_w(space, 0, m_selected_game);
/* reset the stars */
@@ -1269,7 +1269,7 @@ CUSTOM_INPUT_MEMBER(gmgalax_state::port_r)
WRITE8_MEMBER(galaxian_state::zigzag_bankswap_w)
{
/* Zig Zag can swap ROMs 2 and 3 as a form of copy protection */
- membank("bank1")->set_entry(data & 1);
+ m_bank1->set_entry(data & 1);
membank("bank2")->set_entry(~data & 1);
}
@@ -7123,8 +7123,8 @@ void gmgalax_state::init_gmgalax()
common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, &gmgalax_state::gmgalax_extend_tile_info, &gmgalax_state::gmgalax_extend_sprite_info);
/* ROM is banked */
- space.install_read_bank(0x0000, 0x3fff, "bank1");
- membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
+ space.install_read_bank(0x0000, 0x3fff, m_bank1);
+ m_bank1->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
game_changed(*machine().ioport().ports().begin()->second->fields().first(), 0, 0, 0);
@@ -7172,8 +7172,8 @@ void galaxian_state::init_victoryc()
void galaxian_state::init_fourplay()
{
- membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->set_entry(0);
/* video extensions */
common_init(NULL, NULL, &galaxian_state::pisces_extend_tile_info, &galaxian_state::pisces_extend_sprite_info);
@@ -7181,8 +7181,8 @@ void galaxian_state::init_fourplay()
void galaxian_state::init_videight()
{
- membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->set_entry(0);
/* video extensions */
common_init(NULL, NULL, &galaxian_state::videight_extend_tile_info, &galaxian_state::videight_extend_sprite_info);
@@ -7347,7 +7347,7 @@ void galaxian_state::init_zigzag()
m_numspritegens = 2;
/* make ROMs 2 & 3 swappable */
- membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
+ m_bank1->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
/* handler for doing the swaps */
@@ -7642,8 +7642,8 @@ void galaxian_state::init_sfx()
m_sfx_tilemap = true;
/* sound board has space for extra ROM */
- m_audiocpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1");
- membank("bank1")->set_base(memregion("audiocpu")->base());
+ m_audiocpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, m_bank1);
+ m_bank1->set_base(memregion("audiocpu")->base());
}
diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp
index 087b20094d9..e3ac97f4d1f 100644
--- a/src/mame/drivers/galaxold.cpp
+++ b/src/mame/drivers/galaxold.cpp
@@ -3788,9 +3788,7 @@ ROM_END
void galaxold_state::init_guttangt()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- space.install_read_bank( 0x2000, 0x27ff, "cpubank" );
- uint8_t *rom = memregion("maincpu")->base();
- membank("cpubank")->set_base(rom + 0x2000);
+ space.install_rom( 0x2000, 0x27ff, memregion("maincpu")->base() + 0x2000);
}
diff --git a/src/mame/drivers/galivan.cpp b/src/mame/drivers/galivan.cpp
index 4f815dd7742..5f07a216db5 100644
--- a/src/mame/drivers/galivan.cpp
+++ b/src/mame/drivers/galivan.cpp
@@ -1124,9 +1124,9 @@ ROM_END
WRITE8_MEMBER(galivan_state::youmab_extra_bank_w)
{
if (data == 0xff)
- membank("bank2")->set_entry(1);
+ m_rombank->set_entry(1);
else if (data == 0x00)
- membank("bank2")->set_entry(0);
+ m_rombank->set_entry(0);
else
printf("data %03x\n", data);
}
@@ -1172,12 +1172,11 @@ void galivan_state::init_youmab()
{
// TODO: move all of this to an address map instead
m_maincpu->space(AS_IO).install_write_handler(0x82, 0x82, write8_delegate(*this, FUNC(galivan_state::youmab_extra_bank_w))); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x7fff, "bank3");
- membank("bank3")->set_base(memregion("maincpu")->base());
+ m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x7fff, memregion("maincpu")->base());
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, "bank2");
- membank("bank2")->configure_entries(0, 2, memregion("user2")->base(), 0x4000);
- membank("bank2")->set_entry(0);
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xbfff, m_rombank);
+ m_rombank->configure_entries(0, 2, memregion("user2")->base(), 0x4000);
+ m_rombank->set_entry(0);
m_maincpu->space(AS_IO).install_write_handler(0x81, 0x81, write8_delegate(*this, FUNC(galivan_state::youmab_81_w))); // ?? often, alternating values
m_maincpu->space(AS_IO).install_write_handler(0x84, 0x84, write8_delegate(*this, FUNC(galivan_state::youmab_84_w))); // ?? often, sequence..
diff --git a/src/mame/drivers/gamate.cpp b/src/mame/drivers/gamate.cpp
index 3e2bc074f89..71eb83c9d99 100644
--- a/src/mame/drivers/gamate.cpp
+++ b/src/mame/drivers/gamate.cpp
@@ -29,7 +29,7 @@ public:
, m_ay(*this, "ay8910")
, m_cartslot(*this, "cartslot")
, m_io_joy(*this, "JOY")
- , m_bios(*this, "bios")
+ , m_bios(*this, "maincpu")
, m_ram(*this, "ram")
{ }
@@ -62,7 +62,7 @@ private:
required_device<ay8910_device> m_ay;
required_device<gamate_cart_slot_device> m_cartslot;
required_ioport m_io_joy;
- required_shared_ptr<uint8_t> m_bios;
+ required_region_ptr<uint8_t> m_bios;
required_shared_ptr<uint8_t> m_ram;
emu_timer *timer1;
emu_timer *timer2;
@@ -128,7 +128,7 @@ void gamate_state::gamate_mem(address_map &map)
map(0x5a00, 0x5a00).r(FUNC(gamate_state::card_available_check));
map(0x6000, 0xdfff).rw(FUNC(gamate_state::read_cart), FUNC(gamate_state::write_cart));
- map(0xe000, 0xefff).mirror(0x1000).rom().share("bios").region("maincpu", 0);
+ map(0xe000, 0xefff).mirror(0x1000).rom().region("maincpu", 0);
}
diff --git a/src/mame/drivers/gamecom.cpp b/src/mame/drivers/gamecom.cpp
index 3cef1677970..50417c683f1 100644
--- a/src/mame/drivers/gamecom.cpp
+++ b/src/mame/drivers/gamecom.cpp
@@ -42,13 +42,11 @@ Game Status:
void gamecom_state::gamecom_mem_map(address_map &map)
{
- map(0x0000, 0x0013).ram().region("maincpu", 0x00);
+ map(0x0000, 0x03ff).ram().share("maincpu");
map(0x0014, 0x0017).rw(FUNC(gamecom_state::gamecom_pio_r), FUNC(gamecom_state::gamecom_pio_w)); // buttons
- map(0x0018, 0x001F).ram().region("maincpu", 0x18);
map(0x0020, 0x007F).rw(FUNC(gamecom_state::gamecom_internal_r), FUNC(gamecom_state::gamecom_internal_w));/* CPU internal register file */
- map(0x0080, 0x03FF).ram().region("maincpu", 0x80); /* RAM */
- map(0x0400, 0x0FFF).noprw(); /* Nothing */
- map(0x1000, 0x1FFF).rom(); /* Internal ROM (initially), or External ROM/Flash. Controlled by MMU0 (never swapped out in game.com) */
+ map(0x0400, 0x0FFF).noprw(); /* Nothing */
+ map(0x1000, 0x1FFF).rom().region("maincpu", 0); /* Internal ROM (initially), or External ROM/Flash. Controlled by MMU0 (never swapped out in game.com) */
map(0x2000, 0x3FFF).bankr("bank1"); /* External ROM/Flash. Controlled by MMU1 */
map(0x4000, 0x5FFF).bankr("bank2"); /* External ROM/Flash. Controlled by MMU2 */
map(0x6000, 0x7FFF).bankr("bank3"); /* External ROM/Flash. Controlled by MMU3 */
@@ -298,8 +296,8 @@ void gamecom_state::gamecom(machine_config &config)
}
ROM_START( gamecom )
- ROM_REGION( 0x2000, "maincpu", 0 )
- ROM_LOAD( "internal.bin", 0x1000, 0x1000, CRC(a0cec361) SHA1(03368237e8fed4a8724f3b4a1596cf4b17c96d33) )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "internal.bin", 0x0000, 0x1000, CRC(a0cec361) SHA1(03368237e8fed4a8724f3b4a1596cf4b17c96d33) )
ROM_REGION( 0x40000, "kernel", 0 )
ROM_LOAD( "external.bin", 0x00000, 0x40000, CRC(e235a589) SHA1(97f782e72d738f4d7b861363266bf46b438d9b50) )
diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp
index 6f81073cd05..d51523442a5 100644
--- a/src/mame/drivers/gba.cpp
+++ b/src/mame/drivers/gba.cpp
@@ -1332,17 +1332,14 @@ void gba_state::machine_start()
// install the cart ROM & SRAM into the address map, if present
if (m_cart->exists())
{
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x08000000, 0x09ffffff, "rom1");
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0a000000, 0x0bffffff, "rom2");
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0c000000, 0x0cffffff, "rom3");
std::string region_tag;
memory_region *cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GBASLOT_ROM_REGION_TAG));
// install ROM accesses
- membank("rom1")->set_base(cart_rom->base());
- membank("rom2")->set_base(cart_rom->base());
- membank("rom3")->set_base(cart_rom->base());
+ m_maincpu->space(AS_PROGRAM).install_rom(0x08000000, 0x09ffffff, cart_rom->base());
+ m_maincpu->space(AS_PROGRAM).install_rom(0x0a000000, 0x0bffffff, cart_rom->base());
+ m_maincpu->space(AS_PROGRAM).install_rom(0x0c000000, 0x0cffffff, cart_rom->base());
m_maincpu->space(AS_PROGRAM).install_read_handler(0x80000c4, 0x80000cb, read32_delegate(*m_cart, FUNC(gba_cart_slot_device::read_gpio)));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x80000c4, 0x80000cb, write32_delegate(*m_cart, FUNC(gba_cart_slot_device::write_gpio)));
@@ -1387,8 +1384,8 @@ void gba_state::machine_start()
if (m_cart->get_type() == GBA_3DMATRIX)
{
m_maincpu->space(AS_PROGRAM).install_write_handler(0x08800000, 0x088001ff, write32_delegate(*m_cart, FUNC(gba_cart_slot_device::write_mapper)));
- memory_region *cart_romhlp = memregion(region_tag.assign(m_cart->tag()).append(GBAHELP_ROM_REGION_TAG));
- membank("rom1")->set_base(cart_romhlp->base());
+ memory_region *cart_romhlp = memregion(region_tag.assign(m_cart->tag()).append(GBAHELP_ROM_REGION_TAG).c_str());
+ m_maincpu->space(AS_PROGRAM).install_rom(0x08000000, 0x09ffffff, cart_romhlp->base());
}
}
diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp
index 61c4e0dbf31..ef9bc88a387 100644
--- a/src/mame/drivers/ghosteo.cpp
+++ b/src/mame/drivers/ghosteo.cpp
@@ -97,6 +97,7 @@ public:
, m_soundlatch(*this, "soundlatch")
, m_system_memory(*this, "systememory")
, m_flash(*this, "flash")
+ , m_qs1000_bank(*this, "qs1000_bank")
{
}
@@ -115,6 +116,7 @@ private:
required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<uint32_t> m_system_memory;
required_region_ptr<uint8_t> m_flash;
+ memory_bank_creator m_qs1000_bank;
int m_security_count;
uint32_t m_bballoon_port[20];
@@ -182,7 +184,7 @@ WRITE8_MEMBER( ghosteo_state::qs1000_p3_w )
// ...x .... - ?
// ..x. .... - /IRQ clear
- membank("qs1000:bank")->set_entry(data & 0x07);
+ m_qs1000_bank->set_entry(data & 0x07);
if (!BIT(data, 5))
m_soundlatch->acknowledge_w();
@@ -594,8 +596,8 @@ READ32_MEMBER(ghosteo_state::bballoon_speedup_r)
void ghosteo_state::machine_start()
{
// Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM
- m_qs1000->cpu().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank");
- membank("qs1000:bank")->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000);
+ m_qs1000->cpu().space(AS_IO).install_read_bank(0x0100, 0xffff, m_qs1000_bank);
+ m_qs1000_bank->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000);
}
void ghosteo_state::machine_reset()
diff --git a/src/mame/drivers/gimix.cpp b/src/mame/drivers/gimix.cpp
index 21feb96f521..dd492e1d837 100644
--- a/src/mame/drivers/gimix.cpp
+++ b/src/mame/drivers/gimix.cpp
@@ -520,7 +520,7 @@ void gimix_state::machine_start()
{
for (int bank = 0; bank < 16; bank++)
{
- m_bank[bank]->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
+ m_bank[bank]->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,membank("upper_ram"));
}
}
m_floppy0->get_device()->set_rpm(300);
diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp
index cd626844e2f..4bba3a701fe 100644
--- a/src/mame/drivers/gottlieb.cpp
+++ b/src/mame/drivers/gottlieb.cpp
@@ -776,9 +776,7 @@ void gottlieb_state::reactor_map(address_map &map)
void gottlieb_state::gottlieb_map(address_map &map)
{
map.global_mask(0xffff);
- map(0x0000, 0x0fff).ram().share("nvram");
- map(0x1000, 0x1fff).ram().region("maincpu", 0x1000); /* or ROM */
- map(0x2000, 0x2fff).ram().region("maincpu", 0x2000); /* or ROM */
+ map(0x0000, 0x2fff).ram().share("nvram");
map(0x3000, 0x30ff).mirror(0x0700).writeonly().share("spriteram"); /* FRSEL */
map(0x3800, 0x3bff).mirror(0x0400).ram().w(FUNC(gottlieb_state::videoram_w)).share("videoram"); /* BRSEL */
map(0x4000, 0x4fff).ram().w(FUNC(gottlieb_state::charram_w)).share("charram"); /* BOJRSEL1 */
@@ -2161,9 +2159,11 @@ ROM_END
ROM_START( krull )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x3000, "nvram", ROMREGION_ERASEFF)
ROM_LOAD( "gv-105_ram_2.c7", 0x1000, 0x1000, CRC(302feadf) SHA1(9d70de35e4f0490dc4e601070993ad146f250dea) )
ROM_LOAD( "gv-105_ram_4.c9-10", 0x2000, 0x1000, CRC(79355a60) SHA1(57ad5c904b9ac4bf7c7d828bf755bbcbba6a4fd7) )
+
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "gv-105_rom_4.c16", 0x6000, 0x2000, CRC(2b696394) SHA1(b18270f4ad97743f6ff8c4cbc93e523c77a8e794) )
ROM_LOAD( "gv-105_rom_3.c14-15", 0x8000, 0x2000, CRC(14b0ee42) SHA1(276c4008a013806b3989c529f41cbc358ec49fd6) )
ROM_LOAD( "gv-105_rom_2.c13-14", 0xa000, 0x2000, CRC(b5fad94a) SHA1(1bae895fbdd658cfb56c53cc2139282cc1e778de) )
@@ -2471,8 +2471,10 @@ ROM_END
ROM_START( 3stooges )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x3000, "nvram", ROMREGION_ERASEFF)
ROM_LOAD( "gv113ram.4", 0x2000, 0x1000, CRC(533bff2a) SHA1(58d0be8add4b02dc3e27cf6b17a05baf4304f3ce) )
+
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "gv113rom.4", 0x6000, 0x2000, CRC(8b6e52b8) SHA1(6e17e11afce92a7fa1735a724f0c0faf9375ac89) )
ROM_LOAD( "gv113rom.3", 0x8000, 0x2000, CRC(b816d8c4) SHA1(86e16888492390034ac04e3f6a9f56422575c778) )
ROM_LOAD( "gv113rom.2", 0xa000, 0x2000, CRC(b45b2a79) SHA1(7d0b19bec462ab67f518361afdf4b6982829ed07) )
@@ -2498,8 +2500,10 @@ ROM_END
ROM_START( 3stoogesa )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x3000, "nvram", ROMREGION_ERASEFF)
ROM_LOAD( "gv113ram4.bin", 0x2000, 0x1000, CRC(a00365be) SHA1(a151e1dfd8a251e6558968ea1df5a8516286d2c1) ) /* Came from PCB with low serial # */
+
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "gv113rom4.bin", 0x6000, 0x2000, CRC(a8f9d51d) SHA1(c9b18e31fea6fd01171528dd583b4d4f9b9078ed) )
ROM_LOAD( "gv113rom3.bin", 0x8000, 0x2000, CRC(60bda7b6) SHA1(7dd7633397d3ccdbd7885a5436f422f575ecd0cc) )
ROM_LOAD( "gv113rom2.bin", 0xa000, 0x2000, CRC(9bb95798) SHA1(91cf203cf59c5a96ed5de8f4c5743bd91350c16f) )
@@ -2525,8 +2529,10 @@ ROM_END
ROM_START( vidvince )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x3000, "nvram", ROMREGION_ERASEFF)
ROM_LOAD( "gv132_ram4_2732.c9c10", 0x2000, 0x1000, CRC(67a4927b) SHA1(41dfd13ea24bb3b0f8f917f4af5f6b33af1bc2e7) )
+
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "gv132_rom4_2764.c16", 0x6000, 0x2000, CRC(3c5f39f5) SHA1(3722c30bcd60fc0c1c4ca4dd800a3654fba67599) )
ROM_LOAD( "gv132_rom3_2764.c14c15", 0x8000, 0x2000, CRC(3983cb79) SHA1(3c527ed2428b8cb86a6896a74c873317a9f7b411) )
ROM_LOAD( "gv132_rom2_2764.c13c14", 0xa000, 0x2000, CRC(0f5ebab9) SHA1(680874b9857565857375096d05203997669a7215) )
diff --git a/src/mame/drivers/gridcomp.cpp b/src/mame/drivers/gridcomp.cpp
index 64b1cd28be8..a37772b9197 100644
--- a/src/mame/drivers/gridcomp.cpp
+++ b/src/mame/drivers/gridcomp.cpp
@@ -283,8 +283,7 @@ MACHINE_START_MEMBER(gridcomp_state, gridcomp)
{
address_space &program = m_maincpu->space(AS_PROGRAM);
- program.install_readwrite_bank(0, m_ram->size() - 1, "bank10");
- membank("bank10")->set_base(m_ram->pointer());
+ program.install_ram(0, m_ram->size() - 1, m_ram->pointer());
m_videoram = (uint16_t *)m_maincpu->space(AS_PROGRAM).get_write_ptr(0x400);
}
diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp
index 27b9a4c8184..20ecf44ac1b 100644
--- a/src/mame/drivers/gticlub.cpp
+++ b/src/mame/drivers/gticlub.cpp
@@ -547,8 +547,8 @@ void gticlub_state::gticlub_map(address_map &map)
map(0x7e00a000, 0x7e00bfff).rw(m_k056230, FUNC(k056230_device::lanc_ram_r), FUNC(k056230_device::lanc_ram_w));
map(0x7e00c000, 0x7e00c00f).rw(m_k056800, FUNC(k056800_device::host_r), FUNC(k056800_device::host_w));
map(0x7f000000, 0x7f3fffff).rom().region("user2", 0); /* Data ROM */
- map(0x7f800000, 0x7f9fffff).rom().share("share2");
- map(0x7fe00000, 0x7fffffff).rom().region("user1", 0).share("share2"); /* Program ROM */
+ map(0x7f800000, 0x7f9fffff).rom().region("user1", 0);
+ map(0x7fe00000, 0x7fffffff).rom().region("user1", 0); /* Program ROM */
}
void gticlub_state::hangplt_map(address_map &map)
@@ -565,8 +565,8 @@ void gticlub_state::hangplt_map(address_map &map)
map(0x7e00a000, 0x7e00bfff).rw(m_k056230, FUNC(k056230_device::lanc_ram_r), FUNC(k056230_device::lanc_ram_w));
map(0x7e00c000, 0x7e00c00f).rw(m_k056800, FUNC(k056800_device::host_r), FUNC(k056800_device::host_w));
map(0x7f000000, 0x7f3fffff).rom().region("user2", 0); /* Data ROM */
- map(0x7f800000, 0x7f9fffff).rom().share("share2");
- map(0x7fe00000, 0x7fffffff).rom().region("user1", 0).share("share2"); /* Program ROM */
+ map(0x7f800000, 0x7f9fffff).rom().region("user1", 0);
+ map(0x7fe00000, 0x7fffffff).rom().region("user1", 0); /* Program ROM */
}
/**********************************************************************/
@@ -1153,11 +1153,11 @@ void gticlub_state::hangplt(machine_config &config)
/*************************************************************************/
ROM_START( gticlub ) /* Euro version EAA - Reports: GTI CLUB(TM) System ver 1.00(EUR) */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE("688eaa01.21u", 0x000003, 0x80000, CRC(824944ad) SHA1(a7bb86a2495e0579f5d82808aeed4895be2dbe3b) )
- ROM_LOAD32_BYTE("688eaa02.19u", 0x000002, 0x80000, CRC(88e7bfb9) SHA1(fc0e945291204ee0c82bbd2c81ff241e1565c6ae) )
- ROM_LOAD32_BYTE("688eaa03.21r", 0x000001, 0x80000, CRC(ea1c696b) SHA1(fd778afaa1de3a35b38a67b8e4c9a08fe9cf1b9e) )
- ROM_LOAD32_BYTE("688eaa04.19r", 0x000000, 0x80000, CRC(94fa2334) SHA1(04edf840f841b9713fa93e7ebb6aad2000b738c0) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE("688eaa01.21u", 0x000000, 0x80000, CRC(824944ad) SHA1(a7bb86a2495e0579f5d82808aeed4895be2dbe3b) )
+ ROM_LOAD32_BYTE("688eaa02.19u", 0x000001, 0x80000, CRC(88e7bfb9) SHA1(fc0e945291204ee0c82bbd2c81ff241e1565c6ae) )
+ ROM_LOAD32_BYTE("688eaa03.21r", 0x000002, 0x80000, CRC(ea1c696b) SHA1(fd778afaa1de3a35b38a67b8e4c9a08fe9cf1b9e) )
+ ROM_LOAD32_BYTE("688eaa04.19r", 0x000003, 0x80000, CRC(94fa2334) SHA1(04edf840f841b9713fa93e7ebb6aad2000b738c0) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP("688a05.14u", 0x000000, 0x200000, CRC(7caa3f80) SHA1(28409dc17c4e010173396fdc069a409fbea0d58d) )
@@ -1183,11 +1183,11 @@ ROM_START( gticlub ) /* Euro version EAA - Reports: GTI CLUB(TM) System ver 1.00
ROM_END
ROM_START( gticlubu ) /* USA version UAA - Reports: GTI CLUB(TM) System ver 1.02(USA) */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE("688uaa01.21u", 0x000003, 0x80000, CRC(4e2ea7ad) SHA1(cc517df7c4df098896a2a88843fef97c9beb46f3) )
- ROM_LOAD32_BYTE("688uaa02.19u", 0x000002, 0x80000, CRC(c0212ce1) SHA1(7716acfa1b1391e9d7a321ed46785c144d27fdd8) )
- ROM_LOAD32_BYTE("688uaa03.21r", 0x000001, 0x80000, CRC(030246fe) SHA1(70d3591159b07aaeca60141db44f7c28d1b2dac9) )
- ROM_LOAD32_BYTE("688uaa04.19r", 0x000000, 0x80000, CRC(9394e0b2) SHA1(9ff4ff22a307352bf127fc2b5ef9c56ecacf0aab) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE("688uaa01.21u", 0x000000, 0x80000, CRC(4e2ea7ad) SHA1(cc517df7c4df098896a2a88843fef97c9beb46f3) )
+ ROM_LOAD32_BYTE("688uaa02.19u", 0x000001, 0x80000, CRC(c0212ce1) SHA1(7716acfa1b1391e9d7a321ed46785c144d27fdd8) )
+ ROM_LOAD32_BYTE("688uaa03.21r", 0x000002, 0x80000, CRC(030246fe) SHA1(70d3591159b07aaeca60141db44f7c28d1b2dac9) )
+ ROM_LOAD32_BYTE("688uaa04.19r", 0x000003, 0x80000, CRC(9394e0b2) SHA1(9ff4ff22a307352bf127fc2b5ef9c56ecacf0aab) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP("688a05.14u", 0x000000, 0x200000, CRC(7caa3f80) SHA1(28409dc17c4e010173396fdc069a409fbea0d58d) )
@@ -1213,11 +1213,11 @@ ROM_START( gticlubu ) /* USA version UAA - Reports: GTI CLUB(TM) System ver 1.02
ROM_END
ROM_START( gticluba ) /* Asia version AAA - Reports: GTI CLUB(TM) System ver 1.00(ASI) */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE("688aaa01.21u", 0x000003, 0x80000, CRC(06a56474) SHA1(3a457b885a35e3ee030fd51d847bcf75fce46208) )
- ROM_LOAD32_BYTE("688aaa02.19u", 0x000002, 0x80000, CRC(3c1e714a) SHA1(557f8542b855b2b35f242c8db7396017aca6dbd8) )
- ROM_LOAD32_BYTE("688aaa03.21r", 0x000001, 0x80000, CRC(e060580b) SHA1(50242f3f3b949cc03082e4e75d9dcc89e17f0a75) )
- ROM_LOAD32_BYTE("688aaa04.19r", 0x000000, 0x80000, CRC(928c23cd) SHA1(cce54398e1e5b98bfb717839cc422f1f60502788) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE("688aaa01.21u", 0x000000, 0x80000, CRC(06a56474) SHA1(3a457b885a35e3ee030fd51d847bcf75fce46208) )
+ ROM_LOAD32_BYTE("688aaa02.19u", 0x000001, 0x80000, CRC(3c1e714a) SHA1(557f8542b855b2b35f242c8db7396017aca6dbd8) )
+ ROM_LOAD32_BYTE("688aaa03.21r", 0x000002, 0x80000, CRC(e060580b) SHA1(50242f3f3b949cc03082e4e75d9dcc89e17f0a75) )
+ ROM_LOAD32_BYTE("688aaa04.19r", 0x000003, 0x80000, CRC(928c23cd) SHA1(cce54398e1e5b98bfb717839cc422f1f60502788) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP("688a05.14u", 0x000000, 0x200000, CRC(7caa3f80) SHA1(28409dc17c4e010173396fdc069a409fbea0d58d) )
@@ -1243,11 +1243,11 @@ ROM_START( gticluba ) /* Asia version AAA - Reports: GTI CLUB(TM) System ver 1.0
ROM_END
ROM_START( gticlubj ) /* Japan version JAA - Reports: GTI CLUB(TM) System ver 1.00(JPN) */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE("688jaa01.21u", 0x000003, 0x80000, CRC(1492059c) SHA1(176dbd87f23f4cd8e1397e67da501738e20e5a57) )
- ROM_LOAD32_BYTE("688jaa02.19u", 0x000002, 0x80000, CRC(7896dd69) SHA1(a3ab7b872132a5e66238e414f4b497cf7beb8b1c) )
- ROM_LOAD32_BYTE("688jaa03.21r", 0x000001, 0x80000, CRC(94e2be50) SHA1(f206ac201903f3aae29196ab6fccdef104859346) )
- ROM_LOAD32_BYTE("688jaa04.19r", 0x000000, 0x80000, CRC(ff539bb6) SHA1(1a225eca4377d82a2b6cb99c1d16580b9ccf2f08) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE("688jaa01.21u", 0x000000, 0x80000, CRC(1492059c) SHA1(176dbd87f23f4cd8e1397e67da501738e20e5a57) )
+ ROM_LOAD32_BYTE("688jaa02.19u", 0x000001, 0x80000, CRC(7896dd69) SHA1(a3ab7b872132a5e66238e414f4b497cf7beb8b1c) )
+ ROM_LOAD32_BYTE("688jaa03.21r", 0x000002, 0x80000, CRC(94e2be50) SHA1(f206ac201903f3aae29196ab6fccdef104859346) )
+ ROM_LOAD32_BYTE("688jaa04.19r", 0x000003, 0x80000, CRC(ff539bb6) SHA1(1a225eca4377d82a2b6cb99c1d16580b9ccf2f08) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP("688a05.14u", 0x000000, 0x200000, CRC(7caa3f80) SHA1(28409dc17c4e010173396fdc069a409fbea0d58d) )
@@ -1273,11 +1273,11 @@ ROM_START( gticlubj ) /* Japan version JAA - Reports: GTI CLUB(TM) System ver 1.
ROM_END
ROM_START( thunderh ) /* Euro version EAA */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "680eaa01.21u", 0x000003, 0x080000, CRC(796e2678) SHA1(8051a228aa6d1a3f1fef26de15f4fdb785c2c8ee) )
- ROM_LOAD32_BYTE( "680eaa02.19u", 0x000002, 0x080000, CRC(767e6db0) SHA1(0f29f56fe485f30100ce54e64bda5d5a124c1d09) )
- ROM_LOAD32_BYTE( "680eaa03.21r", 0x000001, 0x080000, CRC(5a5b59b5) SHA1(542c0722437f40829559b09120fde995246d52ae) )
- ROM_LOAD32_BYTE( "680eaa04.19r", 0x000000, 0x080000, CRC(4a973a5c) SHA1(1d84f6416c3b5a85d7ebfbc15fc08e0dd8dc2414) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "680eaa01.21u", 0x000000, 0x080000, CRC(796e2678) SHA1(8051a228aa6d1a3f1fef26de15f4fdb785c2c8ee) )
+ ROM_LOAD32_BYTE( "680eaa02.19u", 0x000001, 0x080000, CRC(767e6db0) SHA1(0f29f56fe485f30100ce54e64bda5d5a124c1d09) )
+ ROM_LOAD32_BYTE( "680eaa03.21r", 0x000002, 0x080000, CRC(5a5b59b5) SHA1(542c0722437f40829559b09120fde995246d52ae) )
+ ROM_LOAD32_BYTE( "680eaa04.19r", 0x000003, 0x080000, CRC(4a973a5c) SHA1(1d84f6416c3b5a85d7ebfbc15fc08e0dd8dc2414) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "680a05.14u", 0x000000, 0x200000, CRC(0c9f334d) SHA1(99ac622a04a7140244d81031df69a796b6fd2657) )
@@ -1303,11 +1303,11 @@ ROM_START( thunderh ) /* Euro version EAA */
ROM_END
ROM_START( thunderhu ) /* USA version UAA */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "680uaa01.21u", 0x000003, 0x080000, CRC(f2bb2ba1) SHA1(311e88d63179486014376c4af4ff0ef28673ee5a) )
- ROM_LOAD32_BYTE( "680uaa02.19u", 0x000002, 0x080000, CRC(52f617b5) SHA1(fda3133d3a7e04eb4432c69becdcf1872b3660d9) )
- ROM_LOAD32_BYTE( "680uaa03.21r", 0x000001, 0x080000, CRC(086a0574) SHA1(32fb93dbb93d2fe6af743ea4310b50a6cd03647d) )
- ROM_LOAD32_BYTE( "680uaa04.19r", 0x000000, 0x080000, CRC(85e1f8e3) SHA1(9172c54b6663f1bf390795068271198083a6860d) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "680uaa01.21u", 0x000000, 0x080000, CRC(f2bb2ba1) SHA1(311e88d63179486014376c4af4ff0ef28673ee5a) )
+ ROM_LOAD32_BYTE( "680uaa02.19u", 0x000001, 0x080000, CRC(52f617b5) SHA1(fda3133d3a7e04eb4432c69becdcf1872b3660d9) )
+ ROM_LOAD32_BYTE( "680uaa03.21r", 0x000002, 0x080000, CRC(086a0574) SHA1(32fb93dbb93d2fe6af743ea4310b50a6cd03647d) )
+ ROM_LOAD32_BYTE( "680uaa04.19r", 0x000003, 0x080000, CRC(85e1f8e3) SHA1(9172c54b6663f1bf390795068271198083a6860d) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "680a05.14u", 0x000000, 0x200000, CRC(0c9f334d) SHA1(99ac622a04a7140244d81031df69a796b6fd2657) )
@@ -1333,11 +1333,11 @@ ROM_START( thunderhu ) /* USA version UAA */
ROM_END
ROM_START( slrasslt ) /* USA version UAA */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "792uaa01.21u", 0x000003, 0x080000, CRC(c73bf7fb) SHA1(ffe0fea155473827929339a9261a158287ce30a8) ) // ROM check screen shows version as: SOLAR ASSAULT DR2 VER UA-A
- ROM_LOAD32_BYTE( "792uaa02.19u", 0x000002, 0x080000, CRC(a940bb9b) SHA1(65a60157697a21cc2485c02c689c9addb3ac91f1) ) // Based on "Revised" code but title screen only shows Solar Assault
- ROM_LOAD32_BYTE( "792uaa03.21r", 0x000001, 0x080000, CRC(363e8411) SHA1(b9c70033d8e3de4b339b61a66172bfecb7c2b3ab) )
- ROM_LOAD32_BYTE( "792uaa04.19r", 0x000000, 0x080000, CRC(7910d99c) SHA1(e2114d369060528998b58331d590c086d306f541) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "792uaa01.21u", 0x000000, 0x080000, CRC(c73bf7fb) SHA1(ffe0fea155473827929339a9261a158287ce30a8) ) // ROM check screen shows version as: SOLAR ASSAULT DR2 VER UA-A
+ ROM_LOAD32_BYTE( "792uaa02.19u", 0x000001, 0x080000, CRC(a940bb9b) SHA1(65a60157697a21cc2485c02c689c9addb3ac91f1) ) // Based on "Revised" code but title screen only shows Solar Assault
+ ROM_LOAD32_BYTE( "792uaa03.21r", 0x000002, 0x080000, CRC(363e8411) SHA1(b9c70033d8e3de4b339b61a66172bfecb7c2b3ab) )
+ ROM_LOAD32_BYTE( "792uaa04.19r", 0x000003, 0x080000, CRC(7910d99c) SHA1(e2114d369060528998b58331d590c086d306f541) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "792a05.14u", 0x000000, 0x200000, CRC(9a27edfc) SHA1(c028b6440eb1b0c814c4db45918e580662ac2d9a) )
@@ -1363,11 +1363,11 @@ ROM_START( slrasslt ) /* USA version UAA */
ROM_END
ROM_START( slrassltj ) /* Japan version JAA */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "792jaa01.21u", 0x000003, 0x080000, CRC(112717c6) SHA1(be5066e1aefef20b6eab2340abc1bdc3d7a5a6e3) ) // ROM check screen shows version as: SOLAR ASSAULT DR2 VER JA-A
- ROM_LOAD32_BYTE( "792jaa02.19u", 0x000002, 0x080000, CRC(c48582bd) SHA1(194dfd51704ed5eeecb2b56b6bbf651c7cf7701e) ) // Title screen shows Solar Assault Revised
- ROM_LOAD32_BYTE( "792jaa03.21r", 0x000001, 0x080000, CRC(e691009d) SHA1(c8ae58fd280a18151b0e33511269c3685e30fe63) )
- ROM_LOAD32_BYTE( "792jaa04.19r", 0x000000, 0x080000, CRC(1e73a145) SHA1(e519d17d22b5a61570a9bf72ea840f6398928952) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "792jaa01.21u", 0x000000, 0x080000, CRC(112717c6) SHA1(be5066e1aefef20b6eab2340abc1bdc3d7a5a6e3) ) // ROM check screen shows version as: SOLAR ASSAULT DR2 VER JA-A
+ ROM_LOAD32_BYTE( "792jaa02.19u", 0x000001, 0x080000, CRC(c48582bd) SHA1(194dfd51704ed5eeecb2b56b6bbf651c7cf7701e) ) // Title screen shows Solar Assault Revised
+ ROM_LOAD32_BYTE( "792jaa03.21r", 0x000002, 0x080000, CRC(e691009d) SHA1(c8ae58fd280a18151b0e33511269c3685e30fe63) )
+ ROM_LOAD32_BYTE( "792jaa04.19r", 0x000003, 0x080000, CRC(1e73a145) SHA1(e519d17d22b5a61570a9bf72ea840f6398928952) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "792a05.14u", 0x000000, 0x200000, CRC(9a27edfc) SHA1(c028b6440eb1b0c814c4db45918e580662ac2d9a) )
@@ -1393,11 +1393,11 @@ ROM_START( slrassltj ) /* Japan version JAA */
ROM_END
ROM_START( slrassltj1 ) /* Japan version JAA */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "672jaa_a01.21u", 0x000003, 0x080000, CRC(e2821f51) SHA1(20c6c2402ba2b564b8f77bcf452abe2d7e023417) ) // ROM check screen shows version as: SOLAR ASSAULT VER JA-A
- ROM_LOAD32_BYTE( "672jaa_a02.19u", 0x000002, 0x080000, CRC(e3ac7031) SHA1(268588ac6e80463e51a399f53b2396b23faaddba) ) // Title screen shows subtitle "GRADIUS"
- ROM_LOAD32_BYTE( "672jaa_a03.21r", 0x000001, 0x080000, CRC(52711d79) SHA1(8c89fbff9de21cc1e5f17c4ea08870faea648465) )
- ROM_LOAD32_BYTE( "672jaa_a04.19r", 0x000000, 0x080000, CRC(f7419454) SHA1(44cef7f1181cb9c11b013ab0b7e26aa1e95d3746) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "672jaa_a01.21u", 0x000000, 0x080000, CRC(e2821f51) SHA1(20c6c2402ba2b564b8f77bcf452abe2d7e023417) ) // ROM check screen shows version as: SOLAR ASSAULT VER JA-A
+ ROM_LOAD32_BYTE( "672jaa_a02.19u", 0x000001, 0x080000, CRC(e3ac7031) SHA1(268588ac6e80463e51a399f53b2396b23faaddba) ) // Title screen shows subtitle "GRADIUS"
+ ROM_LOAD32_BYTE( "672jaa_a03.21r", 0x000002, 0x080000, CRC(52711d79) SHA1(8c89fbff9de21cc1e5f17c4ea08870faea648465) )
+ ROM_LOAD32_BYTE( "672jaa_a04.19r", 0x000003, 0x080000, CRC(f7419454) SHA1(44cef7f1181cb9c11b013ab0b7e26aa1e95d3746) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "672a05.14u", 0x000000, 0x200000, CRC(f6f296e4) SHA1(2ba4ede36f3392aa53a730614272fa80df65281c) )
@@ -1423,11 +1423,11 @@ ROM_START( slrassltj1 ) /* Japan version JAA */
ROM_END
ROM_START( hangplt ) /* Japan version JAB */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "685jab01.21u", 0x000003, 0x080000, CRC(f98a3e82) SHA1(94ebaa172b0e98c5cd08efaea5f56e707e5032b4) )
- ROM_LOAD32_BYTE( "685jab02.19u", 0x000002, 0x080000, CRC(20730cdc) SHA1(71b2cf7077ab7db875f9030e21afd05905f57ce5) )
- ROM_LOAD32_BYTE( "685jab03.21r", 0x000001, 0x080000, CRC(77fa2248) SHA1(a662b84945b3d268fed15952cc793d821233735e) )
- ROM_LOAD32_BYTE( "685jab04.19r", 0x000000, 0x080000, CRC(ab6773df) SHA1(91d3f849a1cc5fa4b2fbd876d53402a548198c41) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "685jab01.21u", 0x000000, 0x080000, CRC(f98a3e82) SHA1(94ebaa172b0e98c5cd08efaea5f56e707e5032b4) )
+ ROM_LOAD32_BYTE( "685jab02.19u", 0x000001, 0x080000, CRC(20730cdc) SHA1(71b2cf7077ab7db875f9030e21afd05905f57ce5) )
+ ROM_LOAD32_BYTE( "685jab03.21r", 0x000002, 0x080000, CRC(77fa2248) SHA1(a662b84945b3d268fed15952cc793d821233735e) )
+ ROM_LOAD32_BYTE( "685jab04.19r", 0x000003, 0x080000, CRC(ab6773df) SHA1(91d3f849a1cc5fa4b2fbd876d53402a548198c41) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "685a05.14u", 0x000000, 0x200000, CRC(ba1c8f40) SHA1(ce4ed641c1d6d44447eaaada16f305f1d7fb9ee2) )
@@ -1449,11 +1449,11 @@ ROM_START( hangplt ) /* Japan version JAB */
ROM_END
ROM_START( hangpltu ) /* USA version UAA */
- ROM_REGION(0x200000, "user1", 0) /* PowerPC program roms */
- ROM_LOAD32_BYTE( "685uaa01.21u", 0x000003, 0x080000, CRC(83a5b866) SHA1(6859590f212c7debb19924f0174e4cd1bfc011bc) )
- ROM_LOAD32_BYTE( "685uaa02.19u", 0x000002, 0x080000, CRC(765906d6) SHA1(9085a2346756b3b628fef91b7afc131aba434654) )
- ROM_LOAD32_BYTE( "685uaa03.21r", 0x000001, 0x080000, CRC(cb0147a3) SHA1(7bcab760c01ea7e24f4ca5793e081aafa97f68a3) )
- ROM_LOAD32_BYTE( "685uaa04.19r", 0x000000, 0x080000, CRC(a5fda56b) SHA1(4d86f488f411ec16fa3be830206a44214941d1fe) )
+ ROM_REGION32_BE(0x200000, "user1", 0) /* PowerPC program roms */
+ ROM_LOAD32_BYTE( "685uaa01.21u", 0x000000, 0x080000, CRC(83a5b866) SHA1(6859590f212c7debb19924f0174e4cd1bfc011bc) )
+ ROM_LOAD32_BYTE( "685uaa02.19u", 0x000001, 0x080000, CRC(765906d6) SHA1(9085a2346756b3b628fef91b7afc131aba434654) )
+ ROM_LOAD32_BYTE( "685uaa03.21r", 0x000002, 0x080000, CRC(cb0147a3) SHA1(7bcab760c01ea7e24f4ca5793e081aafa97f68a3) )
+ ROM_LOAD32_BYTE( "685uaa04.19r", 0x000003, 0x080000, CRC(a5fda56b) SHA1(4d86f488f411ec16fa3be830206a44214941d1fe) )
ROM_REGION32_BE(0x400000, "user2", 0) /* data roms */
ROM_LOAD32_WORD_SWAP( "685a05.14u", 0x000000, 0x200000, CRC(ba1c8f40) SHA1(ce4ed641c1d6d44447eaaada16f305f1d7fb9ee2) )
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index 60f1ca54f73..1f6fd2fcac4 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -387,7 +387,7 @@ harddriv_state::harddriv_state(const machine_config &mconfig, device_type type,
m_ds3_speedup_pc(0),
m_ds3_transfer_pc(0),
m_gsp_multisync(0),
- m_gsp_vram(*this, "gsp_vram", 16),
+ m_gsp_vram(*this, "gsp_vram"),
m_gsp_control_lo(*this, "gsp_control_lo"),
m_gsp_control_hi(*this, "gsp_control_hi"),
m_gsp_paletteram_lo(*this, "gsp_palram_lo"),
diff --git a/src/mame/drivers/hec2hrp.cpp b/src/mame/drivers/hec2hrp.cpp
index 8de75c1a7d2..3984ea3a2fd 100644
--- a/src/mame/drivers/hec2hrp.cpp
+++ b/src/mame/drivers/hec2hrp.cpp
@@ -91,7 +91,7 @@ void hec2hrp_state::hecdisc2_mem(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0x3fff).bankrw("bank3"); /* ROM at start up, RAM later */
+ map(0x0000, 0x3fff).bankrw("d2rom"); /* ROM at start up, RAM later */
map(0x4000, 0xffff).ram();
}
@@ -132,14 +132,14 @@ void hec2hrp_state::hec2hrp_mem(address_map &map)
/* contiguous RAM */
map(0x4A00, 0xbfff).ram();
/* from 0xC000 to 0xFFFF => Bank Ram for video and data */
- map(0xc000, 0xffff).ram().share("hector_videoram");
+ map(0xc000, 0xffff).ram().bankrw("hvram");
}
void hec2hrp_state::hec2hrx_mem(address_map &map)
{
map.unmap_value_high();
/* Main ROM page*/
- map(0x0000, 0x3fff).bankr("bank2");
+ map(0x0000, 0x3fff).bankr("rombank");
/* Hardware address mapping*/
map(0x0800, 0x0808).w(FUNC(hec2hrp_state::switch_bank_w));/* Bank handling */
@@ -155,7 +155,7 @@ void hec2hrp_state::hec2hrx_mem(address_map &map)
/* contiguous RAM */
map(0x4A00, 0xbfff).ram();
/* from 0xC000 to 0xFFFF => Bank Ram for video and data */
- map(0xc000, 0xffff).bankrw("bank1").share("hector_videoram");
+ map(0xc000, 0xffff).bankrw("hvram");
}
void hec2hrp_state::hec2hrp_io(address_map &map)
@@ -310,25 +310,22 @@ MACHINE_START_MEMBER(hec2hrp_state,hec2hrx)
//RAMD2[0xff6b] = 0x0ff; // force verbose mode
// Memory install for bank switching
- membank("bank1")->configure_entry(HECTOR_BANK_PROG , &RAM[0xc000] );
- membank("bank1")->configure_entry(HECTOR_BANK_VIDEO, m_hector_videoram_hrx); // Video RAM
+ m_hvram->configure_entry(HECTOR_BANK_PROG , &RAM[0xc000] );
+ m_hvram->configure_entry(HECTOR_BANK_VIDEO, m_hector_videoram); // Video RAM
// Set bank HECTOR_BANK_PROG as basic bank
- membank("bank1")->set_entry(HECTOR_BANK_PROG);
+ m_hvram->set_entry(HECTOR_BANK_PROG);
// MX-specific
- membank("bank2")->configure_entry(HECTORMX_BANK_PAGE0 , &RAM[0x0000]);
- membank("bank2")->configure_entry(HECTORMX_BANK_PAGE1 , memregion("page1")->base() ); // ROM page 1
- membank("bank2")->configure_entry(HECTORMX_BANK_PAGE2 , memregion("page2")->base() ); // ROM page 2
- membank("bank2")->set_entry(HECTORMX_BANK_PAGE0);
+ m_rombank->configure_entry(HECTORMX_BANK_PAGE0 , &RAM[0x0000]);
+ m_rombank->configure_entry(HECTORMX_BANK_PAGE1 , memregion("page1")->base() ); // ROM page 1
+ m_rombank->configure_entry(HECTORMX_BANK_PAGE2 , memregion("page2")->base() ); // ROM page 2
+ m_rombank->set_entry(HECTORMX_BANK_PAGE0);
// Disk II-specific
- membank("bank3")->configure_entry(DISCII_BANK_ROM , memregion("rom_disc2")->base() ); // ROM
- membank("bank3")->configure_entry(DISCII_BANK_RAM , memregion("disc2mem" )->base() ); // RAM
- membank("bank3")->set_entry(DISCII_BANK_ROM);
-
- // As video HR ram is in bank, use external memory
- m_hector_videoram.set_target(m_hector_videoram_hrx,m_hector_videoram.bytes());
+ m_d2rom->configure_entry(DISCII_BANK_ROM , memregion("rom_disc2")->base() ); // ROM
+ m_d2rom->configure_entry(DISCII_BANK_RAM , memregion("disc2mem" )->base() ); // RAM
+ m_d2rom->set_entry(DISCII_BANK_ROM);
hector_init();
}
@@ -340,20 +337,17 @@ MACHINE_START_MEMBER(hec2hrp_state,hec2mdhrx)
uint8_t *RAM = memregion("maincpu")->base();
// Memory install for bank switching
- membank("bank1")->configure_entry(HECTOR_BANK_PROG, &RAM[0xc000]);
- membank("bank1")->configure_entry(HECTOR_BANK_VIDEO, m_hector_videoram_hrx); // Video RAM
+ m_hvram->configure_entry(HECTOR_BANK_PROG, &RAM[0xc000]);
+ m_hvram->configure_entry(HECTOR_BANK_VIDEO, m_hector_videoram); // Video RAM
// Set HECTOR_BANK_PROG as basic bank
- membank("bank1")->set_entry(HECTOR_BANK_PROG);
+ m_hvram->set_entry(HECTOR_BANK_PROG);
//Here, bank 5 is not used for the language switch but for the floppy ROM
// Mini disk-specific
- membank("bank2")->configure_entry(HECTOR_BANK_BASE, &RAM[0x0000]); // ROM base page
- membank("bank2")->configure_entry(HECTOR_BANK_DISC, memregion("page2")->base() ); // ROM mini disc page
- membank("bank2")->set_entry(HECTOR_BANK_BASE);
-
- // As video HR ram is in bank, use external memory
- m_hector_videoram.set_target(m_hector_videoram_hrx,m_hector_videoram.bytes());
+ m_rombank->configure_entry(HECTOR_BANK_BASE, &RAM[0x0000]); // ROM base page
+ m_rombank->configure_entry(HECTOR_BANK_DISC, memregion("page2")->base() ); // ROM mini disc page
+ m_rombank->set_entry(HECTOR_BANK_BASE);
hector_init();
}
@@ -361,11 +355,11 @@ MACHINE_START_MEMBER(hec2hrp_state,hec2mdhrx)
MACHINE_RESET_MEMBER(hec2hrp_state,hec2hrx)
{
// Hector Memory
- membank("bank1")->set_entry(HECTOR_BANK_PROG);
- membank("bank2")->set_entry(HECTORMX_BANK_PAGE0);
+ m_hvram->set_entry(HECTOR_BANK_PROG);
+ m_hvram->set_entry(HECTORMX_BANK_PAGE0);
// DISK II Memory
- membank("bank3")->set_entry(DISCII_BANK_ROM);
+ m_d2rom->set_entry(DISCII_BANK_ROM);
hector_reset(1, 1);
hector_disc2_reset();
@@ -618,70 +612,60 @@ void hec2hrp_state::hec2mx80(machine_config &config)
}
ROM_START( hec2hr )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "2hr.bin", 0x0000, 0x1000, CRC(84b9e672) SHA1(8c8b089166122eee565addaed10f84c5ce6d849b))
- ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
- ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
ROM_END
ROM_START( victor )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "victor.rom", 0x0000, 0x1000, CRC(d1e9508f) SHA1(d0f1bdcd39917fafc8859223ab38eee2a7dc85ff))
- ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
- ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
ROM_END
ROM_START( hec2hrp )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "hector2hrp.rom", 0x0000, 0x4000, CRC(983f52e4) SHA1(71695941d689827356042ee52ffe55ce7e6b8ecd))
- ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
- ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
- ROM_REGION( 0x10000, "disc2cpu", ROMREGION_ERASEFF )
- ROM_REGION( 0x04000, "rom_disc2", ROMREGION_ERASEFF )
ROM_END
ROM_START( hec2hrx )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "hector2hrx.rom", 0x0000, 0x4000, CRC(f047c521) SHA1(744336b2acc76acd7c245b562bdc96dca155b066))
- ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
- ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
- ROM_REGION( 0x10000, "disc2cpu", ROMREGION_ERASEFF )
- ROM_REGION( 0x04000, "rom_disc2", ROMREGION_ERASEFF )
+ ROM_REGION( 0x1000, "rom_disc2", ROMREGION_ERASEFF )
ROM_LOAD( "d800k.bin" , 0x0000,0x1000, CRC(831bd584) SHA1(9782ee58f570042608d9d568b2c3fc4c6d87d8b9))
- ROM_REGION( 0x10000, "disc2mem", ROMREGION_ERASE00 )
ROM_END
// minidisc
ROM_START( hec2mdhrx )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "mdic1.bin" , 0x0000,0x2000, CRC(ddda1065) SHA1(e7bba14a72605238d2f8299da029b8320a563254))
ROM_LOAD( "mdicmb.bin" , 0x2000,0x2000, CRC(d8090747) SHA1(f2925b68002307562e2ea5e36b740e5458f0f0eb))
- ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF ) // Page 1 = unused page
ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF ) // Page 2 = minidisc page
ROM_LOAD( "mdic3.bin" , 0x0000,0x2000, CRC(87801816) SHA1(ddf441f40df014b237cdf17430d1989f3a452d04))
ROM_LOAD( "mdicmb.bin" , 0x2000,0x2000, CRC(d8090747) SHA1(f2925b68002307562e2ea5e36b740e5458f0f0eb))
ROM_END
ROM_START( hec2mx80 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "mx80c_page0.rom" , 0x0000,0x4000, CRC(a75945cf) SHA1(542391e482271be0997b069cf13c8b5dae28feec))
+
ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
ROM_LOAD( "mx80c_page1.rom", 0x0000, 0x4000, CRC(4615f57c) SHA1(5de291bf3ae0320915133b99f1a088cb56c41658))
+
ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
ROM_LOAD( "mx80c_page2.rom" , 0x0000,0x4000, CRC(2d5d975e) SHA1(48307132e0f3fad0262859bb8142d108f694a436))
ROM_REGION( 0x04000, "rom_disc2", ROMREGION_ERASEFF )
ROM_LOAD( "d800k.bin" , 0x0000,0x1000, CRC(831bd584) SHA1(9782ee58f570042608d9d568b2c3fc4c6d87d8b9))
- ROM_REGION( 0x10000, "disc2mem", ROMREGION_ERASE00 )
ROM_END
ROM_START( hec2mx40 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "mx40c_page0.rom" , 0x0000,0x4000, CRC(9bb5566d) SHA1(0c8c2e396ec8eb995d2b621abe06b6968ca5d0aa))
+
ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
ROM_LOAD( "mx40c_page1.rom", 0x0000, 0x4000, CRC(192a76fa) SHA1(062aa6df0b554b85774d4b5edeea8496a4baca35))
+
ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
ROM_LOAD( "mx40c_page2.rom" , 0x0000,0x4000, CRC(ef1b2654) SHA1(66624ea040cb7ede4720ad2eca0738d0d3bad89a))
@@ -689,7 +673,6 @@ ROM_START( hec2mx40 )
// ROM_LOAD( "d360k.bin" , 0x0000,0x4000, CRC(2454eacb) SHA1(dc0d5a7d5891a7e422d9d142a2419527bb15dfd5))
ROM_LOAD( "d800k.bin" , 0x0000,0x1000, CRC(831bd584) SHA1(9782ee58f570042608d9d568b2c3fc4c6d87d8b9))
// ROM_LOAD( "d200k.bin" , 0x0000,0x4000, CRC(e2801377) SHA1(0926df5b417ecd8013e35c71b76780c5a25c1cbf))
- ROM_REGION( 0x10000, "disc2mem", ROMREGION_ERASE00 )
ROM_END
/* Driver */
diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp
index bb0bdd6406f..364c1bf5023 100644
--- a/src/mame/drivers/hng64.cpp
+++ b/src/mame/drivers/hng64.cpp
@@ -831,7 +831,7 @@ void hng64_state::hng_map(address_map &map)
{
// main RAM / ROM
map(0x00000000, 0x00ffffff).ram().share("mainram");
- map(0x04000000, 0x05ffffff).nopw().rom().region("gameprg", 0).share("cart");
+ map(0x04000000, 0x05ffffff).nopw().rom().region("gameprg", 0);
// Misc Peripherals
map(0x1f700000, 0x1f7010ff).rw(FUNC(hng64_state::hng64_sysregs_r), FUNC(hng64_state::hng64_sysregs_w)).share("sysregs"); // various things
@@ -849,7 +849,7 @@ void hng64_state::hng_map(address_map &map)
map(0x1f808000, 0x1f8087ff).rw(FUNC(hng64_state::hng64_dualport_r), FUNC(hng64_state::hng64_dualport_w)).umask32(0xffffffff);
// BIOS ROM
- map(0x1fc00000, 0x1fc7ffff).nopw().rom().region("user1", 0).share("rombase");
+ map(0x1fc00000, 0x1fc7ffff).nopw().rom().region("user1", 0);
// Sprites
map(0x20000000, 0x2000bfff).ram().share("spriteram");
@@ -2247,7 +2247,7 @@ ROM_START( hng64 )
HNG64_BIOS
/* To placate MAME */
- ROM_REGION32_LE( 0x2000000, "gameprg", ROMREGION_ERASEFF )
+ ROM_REGION32_BE( 0x2000000, "gameprg", ROMREGION_ERASEFF )
ROM_REGION( 0x4000, "scrtile", ROMREGION_ERASEFF )
ROM_REGION( 0x4000, "sprtile", ROMREGION_ERASEFF )
ROM_REGION( 0x1000000, "textures", ROMREGION_ERASEFF )
@@ -2259,9 +2259,9 @@ ROM_END
ROM_START( roadedge )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "001pr01b.81", 0x0000000, 0x400000, CRC(effbac30) SHA1(c1bddf3e511a8950f65ac7e452f81dbc4b7fd977) )
- ROM_LOAD32_WORD( "001pr02b.82", 0x0000002, 0x400000, CRC(b9aa4ad3) SHA1(9ab3c896dbdc45560b7127486e2db6ca3b15a057) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "001pr01b.81", 0x0000002, 0x400000, CRC(effbac30) SHA1(c1bddf3e511a8950f65ac7e452f81dbc4b7fd977) )
+ ROM_LOAD32_WORD_SWAP( "001pr02b.82", 0x0000000, 0x400000, CRC(b9aa4ad3) SHA1(9ab3c896dbdc45560b7127486e2db6ca3b15a057) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x1000000, "scrtile", 0 )
@@ -2312,11 +2312,11 @@ ROM_END
ROM_START( sams64 )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "002-pro1a.81", 0x0000000, 0x400000, CRC(e5b907c5) SHA1(83637ffaa9031d41a5bed3397a519d1dfa8052cb) )
- ROM_LOAD32_WORD( "002-pro2a.82", 0x0000002, 0x400000, CRC(803ed2eb) SHA1(666db47886a316e68b911311e5db3bc0f5b8a34d) )
- ROM_LOAD32_WORD( "002-pro3a.83", 0x0800000, 0x400000, CRC(582156a7) SHA1(a7bbbd472a53072cbfaed5d41d4265123c9e3f3d) )
- ROM_LOAD32_WORD( "002-pro4a.84", 0x0800002, 0x400000, CRC(5a8291e9) SHA1(ec1e5a5a0ba37393e8b93d78b4ac855109d45ec9) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "002-pro1a.81", 0x0000002, 0x400000, CRC(e5b907c5) SHA1(83637ffaa9031d41a5bed3397a519d1dfa8052cb) )
+ ROM_LOAD32_WORD_SWAP( "002-pro2a.82", 0x0000000, 0x400000, CRC(803ed2eb) SHA1(666db47886a316e68b911311e5db3bc0f5b8a34d) )
+ ROM_LOAD32_WORD_SWAP( "002-pro3a.83", 0x0800002, 0x400000, CRC(582156a7) SHA1(a7bbbd472a53072cbfaed5d41d4265123c9e3f3d) )
+ ROM_LOAD32_WORD_SWAP( "002-pro4a.84", 0x0800000, 0x400000, CRC(5a8291e9) SHA1(ec1e5a5a0ba37393e8b93d78b4ac855109d45ec9) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x2000000, "scrtile", 0 )
@@ -2367,9 +2367,9 @@ ROM_END
ROM_START( xrally )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "003-pr01a.81", 0x0000000, 0x400000, CRC(4e160388) SHA1(08fba66d0f0dab47f7db5bc7d411f4fc0e8219c8) )
- ROM_LOAD32_WORD( "003-pr02a.82", 0x0000002, 0x400000, CRC(c4dd4f18) SHA1(4db0e6d5cabd9e4f82d5905556174b9eff8ad4d9) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "003-pr01a.81", 0x0000002, 0x400000, CRC(4e160388) SHA1(08fba66d0f0dab47f7db5bc7d411f4fc0e8219c8) )
+ ROM_LOAD32_WORD_SWAP( "003-pr02a.82", 0x0000000, 0x400000, CRC(c4dd4f18) SHA1(4db0e6d5cabd9e4f82d5905556174b9eff8ad4d9) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x1000000, "scrtile", 0 )
@@ -2409,11 +2409,11 @@ ROM_END
ROM_START( bbust2 )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "004-pr01a.81", 0x0000000, 0x400000, CRC(7b836ece) SHA1(7a4a08251f1dd66c368ac203f5a006266e77f73d) )
- ROM_LOAD32_WORD( "004-pr02a.82", 0x0000002, 0x400000, CRC(8c55a988) SHA1(d9a61ac3d8550ce0ee6aab374c9f024912163180) )
- ROM_LOAD32_WORD( "004-pr03a.83", 0x0800000, 0x400000, CRC(f25a82dd) SHA1(74c0a03021ef424e0b9c3c818be297d2967b3012) )
- ROM_LOAD32_WORD( "004-pr04a.84", 0x0800002, 0x400000, CRC(9258312b) SHA1(fabac42c8a033e85d503be56f266f9386adff10b) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "004-pr01a.81", 0x0000002, 0x400000, CRC(7b836ece) SHA1(7a4a08251f1dd66c368ac203f5a006266e77f73d) )
+ ROM_LOAD32_WORD_SWAP( "004-pr02a.82", 0x0000000, 0x400000, CRC(8c55a988) SHA1(d9a61ac3d8550ce0ee6aab374c9f024912163180) )
+ ROM_LOAD32_WORD_SWAP( "004-pr03a.83", 0x0800002, 0x400000, CRC(f25a82dd) SHA1(74c0a03021ef424e0b9c3c818be297d2967b3012) )
+ ROM_LOAD32_WORD_SWAP( "004-pr04a.84", 0x0800000, 0x400000, CRC(9258312b) SHA1(fabac42c8a033e85d503be56f266f9386adff10b) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x1000000, "scrtile", 0 )
@@ -2457,15 +2457,15 @@ ROM_END
ROM_START( sams64_2 )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "005pr01a.81", 0x0000000, 0x400000, CRC(a69d7700) SHA1(a580783a109bc3e24248d70bcd67f62dd7d8a5dd) )
- ROM_LOAD32_WORD( "005pr02a.82", 0x0000002, 0x400000, CRC(38b9e6b3) SHA1(d1dad8247d920cc66854a0096e1c7845842d2e1c) )
- ROM_LOAD32_WORD( "005pr03a.83", 0x0800000, 0x400000, CRC(0bc738a8) SHA1(79893b0e1c4a31e02ab385c4382684245975ae8f) )
- ROM_LOAD32_WORD( "005pr04a.84", 0x0800002, 0x400000, CRC(6b504852) SHA1(fcdcab432162542d249818a6cd15b8f2e8230f97) )
- ROM_LOAD32_WORD( "005pr05a.85", 0x1000000, 0x400000, CRC(32a743d3) SHA1(4088b930a1a4d6224a0939ef3942af1bf605cdb5) )
- ROM_LOAD32_WORD( "005pr06a.86", 0x1000002, 0x400000, CRC(c09fa615) SHA1(697d6769c16b3c8f73a6df4a1e268ec40cb30d51) )
- ROM_LOAD32_WORD( "005pr07a.87", 0x1800000, 0x400000, CRC(44286ad3) SHA1(1f890c74c0da0d34940a880468e68f7fb1417813) )
- ROM_LOAD32_WORD( "005pr08a.88", 0x1800002, 0x400000, CRC(d094eb67) SHA1(3edc8d608c631a05223e1d05157cd3daf2d6597a) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "005pr01a.81", 0x0000002, 0x400000, CRC(a69d7700) SHA1(a580783a109bc3e24248d70bcd67f62dd7d8a5dd) )
+ ROM_LOAD32_WORD_SWAP( "005pr02a.82", 0x0000000, 0x400000, CRC(38b9e6b3) SHA1(d1dad8247d920cc66854a0096e1c7845842d2e1c) )
+ ROM_LOAD32_WORD_SWAP( "005pr03a.83", 0x0800002, 0x400000, CRC(0bc738a8) SHA1(79893b0e1c4a31e02ab385c4382684245975ae8f) )
+ ROM_LOAD32_WORD_SWAP( "005pr04a.84", 0x0800000, 0x400000, CRC(6b504852) SHA1(fcdcab432162542d249818a6cd15b8f2e8230f97) )
+ ROM_LOAD32_WORD_SWAP( "005pr05a.85", 0x1000002, 0x400000, CRC(32a743d3) SHA1(4088b930a1a4d6224a0939ef3942af1bf605cdb5) )
+ ROM_LOAD32_WORD_SWAP( "005pr06a.86", 0x1000000, 0x400000, CRC(c09fa615) SHA1(697d6769c16b3c8f73a6df4a1e268ec40cb30d51) )
+ ROM_LOAD32_WORD_SWAP( "005pr07a.87", 0x1800002, 0x400000, CRC(44286ad3) SHA1(1f890c74c0da0d34940a880468e68f7fb1417813) )
+ ROM_LOAD32_WORD_SWAP( "005pr08a.88", 0x1800000, 0x400000, CRC(d094eb67) SHA1(3edc8d608c631a05223e1d05157cd3daf2d6597a) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x4000000, "scrtile", 0 )
@@ -2529,11 +2529,11 @@ ROM_END
ROM_START( fatfurwa )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "006pr01a.81", 0x0000000, 0x400000, CRC(3830efa1) SHA1(9d8c941ccb6cbe8d138499cf9d335db4ac7a9ec0) )
- ROM_LOAD32_WORD( "006pr02a.82", 0x0000002, 0x400000, CRC(8d5de84e) SHA1(e3ae014263f370c2836f62ab323f1560cb3a9cf0) )
- ROM_LOAD32_WORD( "006pr03a.83", 0x0800000, 0x400000, CRC(c811b458) SHA1(7d94e0df501fb086b2e5cf08905d7a3adc2c6472) )
- ROM_LOAD32_WORD( "006pr04a.84", 0x0800002, 0x400000, CRC(de708d6c) SHA1(2c9848e7bbf61c574370f9ecab5f5a6ba63339fd) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "006pr01a.81", 0x0000002, 0x400000, CRC(3830efa1) SHA1(9d8c941ccb6cbe8d138499cf9d335db4ac7a9ec0) )
+ ROM_LOAD32_WORD_SWAP( "006pr02a.82", 0x0000000, 0x400000, CRC(8d5de84e) SHA1(e3ae014263f370c2836f62ab323f1560cb3a9cf0) )
+ ROM_LOAD32_WORD_SWAP( "006pr03a.83", 0x0800002, 0x400000, CRC(c811b458) SHA1(7d94e0df501fb086b2e5cf08905d7a3adc2c6472) )
+ ROM_LOAD32_WORD_SWAP( "006pr04a.84", 0x0800000, 0x400000, CRC(de708d6c) SHA1(2c9848e7bbf61c574370f9ecab5f5a6ba63339fd) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x4000000, "scrtile", 0 )
@@ -2594,13 +2594,13 @@ ROM_END
ROM_START( buriki )
HNG64_BIOS
- ROM_REGION32_LE( 0x2000000, "gameprg", 0 )
- ROM_LOAD32_WORD( "007pr01b.81", 0x0000000, 0x400000, CRC(a31202f5) SHA1(c657729b292d394ced021a0201a1c5608a7118ba) )
- ROM_LOAD32_WORD( "007pr02b.82", 0x0000002, 0x400000, CRC(a563fed6) SHA1(9af9a021beb814e35df968abe5a99225a124b5eb) )
- ROM_LOAD32_WORD( "007pr03a.83", 0x0800000, 0x400000, CRC(da5f6105) SHA1(5424cf5289cef66e301e968b4394e551918fe99b) )
- ROM_LOAD32_WORD( "007pr04a.84", 0x0800002, 0x400000, CRC(befc7bce) SHA1(83d9ecf944e03a40cf25ee288077c2265d6a588a) )
- ROM_LOAD32_WORD( "007pr05a.85", 0x1000000, 0x400000, CRC(013e28bc) SHA1(45e5ac45b42b26957c2877ac1042472c4b5ec914) )
- ROM_LOAD32_WORD( "007pr06a.86", 0x1000002, 0x400000, CRC(0620fccc) SHA1(e0bffc56b019c79276a4ef5ec7354edda15b0889) )
+ ROM_REGION32_BE( 0x2000000, "gameprg", 0 )
+ ROM_LOAD32_WORD_SWAP( "007pr01b.81", 0x0000002, 0x400000, CRC(a31202f5) SHA1(c657729b292d394ced021a0201a1c5608a7118ba) )
+ ROM_LOAD32_WORD_SWAP( "007pr02b.82", 0x0000000, 0x400000, CRC(a563fed6) SHA1(9af9a021beb814e35df968abe5a99225a124b5eb) )
+ ROM_LOAD32_WORD_SWAP( "007pr03a.83", 0x0800002, 0x400000, CRC(da5f6105) SHA1(5424cf5289cef66e301e968b4394e551918fe99b) )
+ ROM_LOAD32_WORD_SWAP( "007pr04a.84", 0x0800000, 0x400000, CRC(befc7bce) SHA1(83d9ecf944e03a40cf25ee288077c2265d6a588a) )
+ ROM_LOAD32_WORD_SWAP( "007pr05a.85", 0x1000002, 0x400000, CRC(013e28bc) SHA1(45e5ac45b42b26957c2877ac1042472c4b5ec914) )
+ ROM_LOAD32_WORD_SWAP( "007pr06a.86", 0x1000000, 0x400000, CRC(0620fccc) SHA1(e0bffc56b019c79276a4ef5ec7354edda15b0889) )
/* Scroll Characters 8x8x8 / 16x16x8 */
ROM_REGION( 0x4000000, "scrtile", 0 )
@@ -2663,7 +2663,7 @@ GAME( 1997, hng64, 0, hng64_default, hng64, hng64_state, init_hng64,
/* Games */
GAME( 1997, roadedge, hng64, hng64_drive, hng64_drive, hng64_state, init_roadedge, ROT0, "SNK", "Roads Edge / Round Trip (rev.B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 001 */
GAME( 1998, sams64, hng64, hng64_fight, hng64_fight, hng64_state, init_ss64, ROT0, "SNK", "Samurai Shodown 64 / Samurai Spirits 64", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 002 */
-GAME( 1998, xrally, hng64, hng64_drive, hng64_drive, hng64_state, init_hng64_drive, ROT0, "SNK", "Xtreme Rally / Off Beat Racer!", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 003 */
+GAME( 1998, xrally, hng64, hng64_drive, hng64_drive, hng64_state, init_hng64_drive, ROT0, "SNK", "Xtreme Rally / Off Beat Racer!", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 003 */
GAME( 1998, bbust2, hng64, hng64_shoot, hng64_shoot, hng64_state, init_hng64_shoot, ROT0, "SNK", "Beast Busters 2nd Nightmare", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 004 */
GAME( 1998, sams64_2, hng64, hng64_fight, hng64_fight, hng64_state, init_ss64, ROT0, "SNK", "Samurai Shodown: Warrior's Rage / Samurai Spirits 2: Asura Zanmaden", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 005 */
GAME( 1998, fatfurwa, hng64, hng64_fight, hng64_fight, hng64_state, init_hng64_fght, ROT0, "SNK", "Fatal Fury: Wild Ambition (rev.A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 006 */
diff --git a/src/mame/drivers/homelab.cpp b/src/mame/drivers/homelab.cpp
index e442c4d94fc..aad1701de76 100644
--- a/src/mame/drivers/homelab.cpp
+++ b/src/mame/drivers/homelab.cpp
@@ -52,6 +52,8 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_p_chargen(*this, "chargen")
+ , m_videoram(*this, "videoram")
+ , m_extraram(*this, "extraram", 0x1000, ENDIANNESS_LITTLE)
, m_dac(*this, "dac")
, m_cass(*this, "cassette")
{ }
@@ -93,6 +95,8 @@ private:
bool m_nmi;
required_device<cpu_device> m_maincpu;
required_region_ptr<u8> m_p_chargen;
+ optional_shared_ptr<u8> m_videoram;
+ memory_share_creator<u8> m_extraram; // b4 only in reality
required_device<dac_bit_interface> m_dac;
required_device<cassette_image_device> m_cass;
};
@@ -217,11 +221,11 @@ void homelab_state::homelab2_mem(address_map &map)
map(0x1000, 0x17ff).rom(); // ROM 3
map(0x1800, 0x1fff).rom(); // ROM 4
map(0x2000, 0x27ff).rom(); // ROM 5
- map(0x2800, 0x2fff).rom(); // ROM 6
- map(0x3000, 0x37ff).rom(); // Empty
+ map(0x2800, 0x2fff).nopr(); // ROM 6
+ map(0x3000, 0x37ff).nopr(); // Empty
map(0x3800, 0x3fff).rw(FUNC(homelab_state::key_r), FUNC(homelab_state::cass_w));
map(0x4000, 0x7fff).ram();
- map(0xc000, 0xc3ff).ram().region("maincpu", 0xc000);
+ map(0xc000, 0xc3ff).ram().share("videoram");
map(0xe000, 0xe0ff).r(FUNC(homelab_state::cass2_r));
}
@@ -230,7 +234,7 @@ void homelab_state::homelab3_mem(address_map &map)
map(0x0000, 0x3fff).rom();
map(0x4000, 0x7fff).ram();
map(0xe800, 0xefff).r(FUNC(homelab_state::exxx_r));
- map(0xf800, 0xffff).ram().region("maincpu", 0xf800);
+ map(0xf800, 0xffff).ram().share("videoram");
}
void homelab_state::homelab3_io(address_map &map)
@@ -245,7 +249,7 @@ void homelab_state::brailab4_mem(address_map &map)
{
map(0x0000, 0x3fff).rom();
map(0x4000, 0xcfff).ram();
- map(0xd000, 0xdfff).rom();
+ map(0xd000, 0xdfff).rom().region("maincpu", 0x4000);
map(0xe800, 0xefff).r(FUNC(homelab_state::exxx_r));
map(0xf800, 0xffff).bankrw("bank1");
}
@@ -567,17 +571,17 @@ INPUT_PORTS_END
VIDEO_START_MEMBER(homelab_state,homelab2)
{
- m_p_videoram = memregion("maincpu")->base()+0xc000;
+ m_p_videoram = m_videoram;
}
VIDEO_START_MEMBER(homelab_state,homelab3)
{
- m_p_videoram = memregion("maincpu")->base()+0xf800;
+ m_p_videoram = m_videoram;
}
VIDEO_START_MEMBER(homelab_state,brailab4)
{
- m_p_videoram = memregion("maincpu")->base()+0x17800;
+ m_p_videoram = m_extraram + 0x800;
}
uint32_t homelab_state::screen_update_homelab2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -852,14 +856,13 @@ void homelab_state::brailab4(machine_config &config)
void homelab_state::init_brailab4()
{
- uint8_t *RAM = memregion("maincpu")->base();
- membank("bank1")->configure_entries(0, 2, &RAM[0xf800], 0x8000);
+ membank("bank1")->configure_entries(0, 2, m_extraram, 0x800);
}
/* ROM definition */
ROM_START( homelab2 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x2800, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "hl2_1.rom", 0x0000, 0x0800, BAD_DUMP CRC(205365f7) SHA1(da93b65befd83513dc762663b234227ba804124d))
ROM_LOAD( "hl2_2.rom", 0x0800, 0x0800, CRC(696af3c1) SHA1(b53bc6ae2b75975618fc90e7181fa5d21409fce1))
ROM_LOAD( "hl2_3.rom", 0x1000, 0x0800, CRC(69e57e8c) SHA1(e98510abb715dbf513e1b29fb6b09ab54e9483b7))
@@ -875,7 +878,7 @@ ROM_START( homelab2 )
ROM_END
ROM_START( homelab3 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "hl3_1.rom", 0x0000, 0x1000, CRC(6b90a8ea) SHA1(8ac40ca889b8c26cdf74ca309fbafd70dcfdfbec))
ROM_LOAD( "hl3_2.rom", 0x1000, 0x1000, CRC(bcac3c24) SHA1(aff371d17f61cb60c464998e092f04d5d85c4d52))
ROM_LOAD( "hl3_3.rom", 0x2000, 0x1000, CRC(ab1b4ab0) SHA1(ad74c7793f5dc22061a88ef31d3407267ad08719))
@@ -886,7 +889,7 @@ ROM_START( homelab3 )
ROM_END
ROM_START( homelab4 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "hl4_1.rom", 0x0000, 0x1000, CRC(a549b2d4) SHA1(90fc5595da8431616aee56eb5143b9f04281e798))
ROM_LOAD( "hl4_2.rom", 0x1000, 0x1000, CRC(151d33e8) SHA1(d32004bc1553f802b9d3266709552f7d5315fe44))
ROM_LOAD( "hl4_3.rom", 0x2000, 0x1000, CRC(39571ab1) SHA1(8470cff2e3442101e6a0bc655358b3a6fc1ef944))
@@ -897,12 +900,12 @@ ROM_START( homelab4 )
ROM_END
ROM_START( brailab4 )
- ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x5000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "brl1.rom", 0x0000, 0x1000, CRC(02323403) SHA1(3a2e853e0a39e05a04a8db58e1a76de1eda579c9))
ROM_LOAD( "brl2.rom", 0x1000, 0x1000, CRC(36173fbc) SHA1(1c01398e16a1cbe4103e1be769347ceae873e090))
ROM_LOAD( "brl3.rom", 0x2000, 0x1000, CRC(d3cdd108) SHA1(1a24e6c5f9c370ff6cb25045cb9d95e664467eb5))
ROM_LOAD( "brl4.rom", 0x3000, 0x1000, CRC(d4047885) SHA1(00fe40c4c2c64a49bb429fb2b27cc7e0d0025a85))
- ROM_LOAD( "brl5.rom", 0xd000, 0x1000, CRC(8a76be04) SHA1(4b683b9be23b47117901fe874072eb7aa481e4ff))
+ ROM_LOAD( "brl5.rom", 0x4000, 0x1000, CRC(8a76be04) SHA1(4b683b9be23b47117901fe874072eb7aa481e4ff))
ROM_REGION(0x0800, "chargen",0)
ROM_LOAD( "hl4.chr", 0x0000, 0x0800, CRC(f58ee39b) SHA1(49399c42d60a11b218a225856da86a9f3975a78a))
@@ -918,7 +921,7 @@ ROM_START( brailab4 )
ROM_END
ROM_START( braiplus )
- ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x5000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "brailabplus.bin", 0x0000, 0x4000, CRC(521d6952) SHA1(f7405520d86fc7abd2dec51d1d016658472f6fe8) )
ROM_REGION(0x0800, "chargen",0) // no idea what chargen it uses
diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp
index 9a927618eda..8a92ceeb775 100644
--- a/src/mame/drivers/hornet.cpp
+++ b/src/mame/drivers/hornet.cpp
@@ -788,8 +788,8 @@ void hornet_state::hornet_map(address_map &map)
map(0x7d020000, 0x7d021fff).rw("m48t58", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write)); /* M48T58Y RTC/NVRAM */
map(0x7d030000, 0x7d03000f).rw(m_k056800, FUNC(k056800_device::host_r), FUNC(k056800_device::host_w));
map(0x7e000000, 0x7e7fffff).rom().region("user2", 0); /* Data ROM */
- map(0x7f000000, 0x7f3fffff).rom().share("share2");
- map(0x7fc00000, 0x7fffffff).rom().region("user1", 0).share("share2"); /* Program ROM */
+ map(0x7f000000, 0x7f3fffff).rom().region("user1", 0);
+ map(0x7fc00000, 0x7fffffff).rom().region("user1", 0); /* Program ROM */
}
void hornet_state::terabrst_map(address_map &map)
diff --git a/src/mame/drivers/hp3478a.cpp b/src/mame/drivers/hp3478a.cpp
index d77af3c8327..224fb67270f 100644
--- a/src/mame/drivers/hp3478a.cpp
+++ b/src/mame/drivers/hp3478a.cpp
@@ -594,7 +594,7 @@ void hp3478a_state::i8039_io(address_map &map)
void hp3478a_state::io_bank(address_map &map)
{
map.unmap_value_high();
- map(0x000, 0x0ff).ram().region("nvram", 0).share("nvram").w(FUNC(hp3478a_state::nvwrite));
+ map(0x000, 0x0ff).ram().share("nvram").w(FUNC(hp3478a_state::nvwrite));
map(0x100, 0x107).ram().share("gpibregs"); //XXX TODO : connect to i8291.cpp
map(0x200, 0x2ff).portr("DIP");
}
@@ -714,9 +714,6 @@ void hp3478a_state::hp3478a(machine_config &config)
ROM_START( hp3478a )
ROM_REGION( 0x2000, "maincpu", 0 )
ROM_LOAD("rom_dc118.bin", 0, 0x2000, CRC(10097ced) SHA1(bd665cf7e07e63f825b2353c8322ed8a4376b3bd)) //main CPU ROM, can match other datecodes too
-
- ROM_REGION( 0x100, "nvram", 0 ) /* Calibration RAM, battery-backed */
- ROM_LOAD( "calram.bin", 0, 0x100, NO_DUMP)
ROM_END
/******************************************************************************
diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp
index 55b5f520970..d9d799ce234 100644
--- a/src/mame/drivers/ibm6580.cpp
+++ b/src/mame/drivers/ibm6580.cpp
@@ -823,10 +823,7 @@ uint32_t ibm6580_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
void ibm6580_state::machine_start()
{
- address_space &program = m_maincpu->space(AS_PROGRAM);
-
- program.install_readwrite_bank(0, m_ram->size() - 1, "bank10");
- membank("bank10")->set_base(m_ram->pointer());
+ m_maincpu->space(AS_PROGRAM).install_ram(0, m_ram->size() - 1, m_ram->pointer());
m_fdc->set_rate(500000); // XXX workaround
}
diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp
index 495f6d22a15..44d2b1e5796 100644
--- a/src/mame/drivers/igspoker.cpp
+++ b/src/mame/drivers/igspoker.cpp
@@ -409,7 +409,7 @@ READ8_MEMBER(igspoker_state::exp_rom_r)
void igspoker_state::igspoker_prg_map(address_map &map)
{
map(0x0000, 0xefff).rom();
- map(0xf000, 0xffff).ram().region("maincpu", 0xf000);
+ map(0xf000, 0xffff).ram();
}
void igspoker_state::igspoker_io_map(address_map &map)
diff --git a/src/mame/drivers/indigo.cpp b/src/mame/drivers/indigo.cpp
index 8a71934e403..b9565e1b176 100644
--- a/src/mame/drivers/indigo.cpp
+++ b/src/mame/drivers/indigo.cpp
@@ -158,7 +158,7 @@ void indigo_state::indigo_map(address_map &map)
void indigo3k_state::mem_map(address_map &map)
{
indigo_map(map);
- map(0x1fc00000, 0x1fc3ffff).rom().share("share10").region("user1", 0);
+ map(0x1fc00000, 0x1fc3ffff).rom().region("user1", 0);
}
WRITE64_MEMBER(indigo4k_state::write_ram)
@@ -185,7 +185,7 @@ void indigo4k_state::mem_map(address_map &map)
map(0x00000000, 0x0007ffff).bankrw("bank1");
map(0x08000000, 0x17ffffff).ram().share("share1").w(FUNC(indigo4k_state::write_ram)); /* 128 MB of main RAM */
map(0x1fa00000, 0x1fa1ffff).rw(m_mem_ctrl, FUNC(sgi_mc_device::read), FUNC(sgi_mc_device::write));
- map(0x1fc00000, 0x1fc7ffff).rom().share("share5").region("user1", 0);
+ map(0x1fc00000, 0x1fc7ffff).rom().region("user1", 0);
map(0x20000000, 0x27ffffff).ram().share("share1").w(FUNC(indigo4k_state::write_ram)); /* 128 MB of main RAM */
}
diff --git a/src/mame/drivers/irobot.cpp b/src/mame/drivers/irobot.cpp
index b52033b0518..f0a95a0181a 100644
--- a/src/mame/drivers/irobot.cpp
+++ b/src/mame/drivers/irobot.cpp
@@ -148,7 +148,7 @@ void irobot_state::irobot_map(address_map &map)
map(0x1300, 0x1300).mirror(0xff).r("adc", FUNC(adc0809_device::data_r));
map(0x1400, 0x143f).rw(FUNC(irobot_state::quad_pokeyn_r), FUNC(irobot_state::quad_pokeyn_w));
map(0x1800, 0x18ff).w(FUNC(irobot_state::irobot_paletteram_w));
- map(0x1900, 0x19ff).writeonly(); /* Watchdog reset */
+ map(0x1900, 0x19ff).nopw(); /* Watchdog reset */
map(0x1a00, 0x1a00).w(FUNC(irobot_state::irobot_clearfirq_w));
map(0x1b00, 0x1b03).mirror(0xfc).w("adc", FUNC(adc0809_device::address_offset_start_w));
map(0x1c00, 0x1fff).ram().share("videoram");
diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp
index eca98352c21..e04d39bf17d 100644
--- a/src/mame/drivers/itech32.cpp
+++ b/src/mame/drivers/itech32.cpp
@@ -624,13 +624,13 @@ u16 drivedge_state::gas_r()
u16 itech32_state::wcbowl_prot_result_r()
{
- return m_main_ram[0x111d/2];
+ return m_nvram[0x111d/2];
}
u8 itech32_state::itech020_prot_result_r()
{
- u32 result = ((u32 *)m_main_ram.target())[m_itech020_prot_address >> 2];
+ u32 result = ((u32 *)m_nvram.target())[m_itech020_prot_address >> 2];
result >>= (~m_itech020_prot_address & 3) * 8;
return result & 0xff;
}
@@ -843,7 +843,7 @@ READ32_MEMBER(drivedge_state::tms2_speedup_r)
void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length)
{
// if nvram is the main RAM, don't overwrite exception vectors
- int start = (base == m_main_ram) ? 0x80 : 0x00;
+ int start = (base == m_nvram) ? 0x80 : 0x00;
for (int i = start; i < length; i++)
((u8 *)base)[i] = machine().rand();
}
@@ -853,7 +853,7 @@ void drivedge_state::nvram_init(nvram_device &nvram, void *base, size_t length)
itech32_state::nvram_init(nvram, base, length);
// due to accessing uninitialized RAM, we need this hack
- ((u32 *)m_main_ram.target())[0x2ce4/4] = 0x0000001e;
+ ((u32 *)m_nvram.target())[0x2ce4/4] = 0x0000001e;
}
/*************************************
@@ -878,7 +878,7 @@ void itech32_state::timekill_map(address_map &map)
map(0x080000, 0x08007f).rw(FUNC(itech32_state::video_r), FUNC(itech32_state::video_w)).share("video");
map(0x0a0000, 0x0a0001).w(FUNC(itech32_state::int1_ack_w));
map(0x0c0000, 0x0c7fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0x100000, 0x17ffff).rom().region("user1", 0).share("main_rom");
+ map(0x100000, 0x17ffff).rom().region("user1", 0);
}
@@ -899,7 +899,7 @@ void itech32_state::bloodstm_map(address_map &map)
map(0x580000, 0x59ffff).ram().w(FUNC(itech32_state::bloodstm_paletteram_w)).share("palette");
map(0x700001, 0x700001).w(FUNC(itech32_state::bloodstm_plane_w));
map(0x780000, 0x780001).portr("EXTRA");
- map(0x800000, 0x87ffff).mirror(0x780000).rom().region("user1", 0).share("main_rom");
+ map(0x800000, 0x87ffff).mirror(0x780000).rom().region("user1", 0);
}
@@ -913,7 +913,7 @@ READ32_MEMBER(itech32_state::test1_r)
if (ACCESSING_BITS_16_23 && !m_written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", m_maincpu->pc(), 0x100 + offset*4+1);
if (ACCESSING_BITS_8_15 && !m_written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", m_maincpu->pc(), 0x100 + offset*4+2);
if (ACCESSING_BITS_0_7 && !m_written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", m_maincpu->pc(), 0x100 + offset*4+3);
- return ((u32 *)m_main_ram)[0x100/4 + offset];
+ return ((u32 *)m_nvram)[0x100/4 + offset];
}
WRITE32_MEMBER(itech32_state::test1_w)
@@ -922,7 +922,7 @@ WRITE32_MEMBER(itech32_state::test1_w)
if (ACCESSING_BITS_16_23) m_written[0x100 + offset*4+1] = 1;
if (ACCESSING_BITS_8_15) m_written[0x100 + offset*4+2] = 1;
if (ACCESSING_BITS_0_7) m_written[0x100 + offset*4+3] = 1;
- COMBINE_DATA(&((u32 *)m_main_ram)[0x100/4 + offset]);
+ COMBINE_DATA(&((u32 *)m_nvram)[0x100/4 + offset]);
}
READ32_MEMBER(itech32_state::test2_r)
@@ -931,7 +931,7 @@ READ32_MEMBER(itech32_state::test2_r)
if (ACCESSING_BITS_16_23 && !m_written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", m_maincpu->pc(), 0xc00 + offset*4+1);
if (ACCESSING_BITS_8_15 && !m_written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", m_maincpu->pc(), 0xc00 + offset*4+2);
if (ACCESSING_BITS_0_7 && !m_written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", m_maincpu->pc(), 0xc00 + offset*4+3);
- return ((u32 *)m_main_ram)[0xc00/4 + offset];
+ return ((u32 *)m_nvram)[0xc00/4 + offset];
}
WRITE32_MEMBER(itech32_state::test2_w)
@@ -940,7 +940,7 @@ WRITE32_MEMBER(itech32_state::test2_w)
if (ACCESSING_BITS_16_23) m_written[0xc00 + offset*4+1] = 1;
if (ACCESSING_BITS_8_15) m_written[0xc00 + offset*4+2] = 1;
if (ACCESSING_BITS_0_7) m_written[0xc00 + offset*4+3] = 1;
- COMBINE_DATA(&((u32 *)m_main_ram)[0xc00/4 + offset]);
+ COMBINE_DATA(&((u32 *)m_nvram)[0xc00/4 + offset]);
}
#endif
@@ -971,7 +971,7 @@ map(0x000c00, 0x007fff).mirror(0x40000).rw(FUNC(itech32_state::test2_r), FUNC(it
map(0x280000, 0x280fff).ram().w(FUNC(drivedge_state::tms1_68k_ram_w)).share("tms1_ram");
map(0x300000, 0x300fff).ram().w(FUNC(drivedge_state::tms2_68k_ram_w)).share("tms2_ram");
map(0x380000, 0x380003).nopw(); // .w("watchdog", FUNC(watchdog_timer_device::reset16_w));
- map(0x600000, 0x607fff).rom().region("user1", 0).share("main_rom");
+ map(0x600000, 0x607fff).rom().region("user1", 0);
}
void drivedge_state::tms1_map(address_map &map)
@@ -1010,7 +1010,7 @@ void itech32_state::itech020_map(address_map &map)
map(0x680000, 0x680003).nopw();
/* ! */ map(0x680800, 0x68083f).readonly().nopw(); /* Serial DUART Channel A/B & Top LED sign - To Do! */
map(0x700002, 0x700002).w(FUNC(itech32_state::itech020_plane_w));
- map(0x800000, 0xbfffff).rom().region("user1", 0).share("main_rom");
+ map(0x800000, 0xbfffff).rom().region("user1", 0);
}
@@ -4532,9 +4532,7 @@ ROM_END
void itech32_state::init_program_rom()
{
- if (m_main_ram == nullptr)
- m_main_ram.set_target(m_nvram, m_nvram.bytes());
- memcpy(m_main_ram, m_main_rom, 0x80);
+ memcpy(m_nvram, m_main_rom, 0x80);
}
diff --git a/src/mame/drivers/itech8.cpp b/src/mame/drivers/itech8.cpp
index 7227cedb2e4..2ed66a3a4f1 100644
--- a/src/mame/drivers/itech8.cpp
+++ b/src/mame/drivers/itech8.cpp
@@ -505,7 +505,6 @@
#include "cpu/z80/z80.h"
#include "machine/6522via.h"
#include "machine/6821pia.h"
-#include "machine/nvram.h"
#include "sound/2203intf.h"
#include "sound/2608intf.h"
#include "sound/3812intf.h"
@@ -955,8 +954,8 @@ void itech8_state::gtg2_map(address_map &map)
/*------ Ninja Clowns layout ------*/
void itech8_state::ninclown_map(address_map &map)
{
- map(0x000000, 0x00007f).ram().region("maincpu", 0);
- map(0x000080, 0x003fff).ram().share("nvram");
+ map(0x000000, 0x003fff).ram().share("nvram");
+ map(0x000000, 0x000007).rom();
map(0x004000, 0x03ffff).rom();
map(0x040000, 0x07ffff).r(FUNC(itech8_state::rom_constant_r));
map(0x100080, 0x100080).w(m_soundlatch, FUNC(generic_latch_8_device::write));
@@ -1723,7 +1722,7 @@ WRITE_LINE_MEMBER(itech8_state::generate_tms34061_interrupt)
void itech8_state::itech8_core_devices(machine_config &config)
{
- NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM);
+ NVRAM(config, m_nvram, nvram_device::DEFAULT_RANDOM);
TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW);
@@ -1954,6 +1953,8 @@ void itech8_state::ninclown(machine_config &config)
itech8_core_devices(config);
itech8_sound_ym3812_external(config);
+ // m_nvram->set_custom_handler([this](nvram_device &, void *p, size_t s) { memcpy(p, memregion("maincpu")->base(), s); }, "vectors");
+
M68000(config, m_maincpu, CLOCK_12MHz);
m_maincpu->set_addrmap(AS_PROGRAM, &itech8_state::ninclown_map);
diff --git a/src/mame/drivers/jackie.cpp b/src/mame/drivers/jackie.cpp
index a3bef6e870f..6d7313cb9e7 100644
--- a/src/mame/drivers/jackie.cpp
+++ b/src/mame/drivers/jackie.cpp
@@ -342,7 +342,7 @@ READ8_MEMBER(jackie_state::expram_r)
void jackie_state::prg_map(address_map &map)
{
map(0x0000, 0xefff).rom();
- map(0xf000, 0xffff).ram().region("maincpu", 0xf000);
+ map(0xf000, 0xffff).ram();
}
void jackie_state::io_map(address_map &map)
diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp
index cd8108a394b..d1e67c26a56 100644
--- a/src/mame/drivers/jaguar.cpp
+++ b/src/mame/drivers/jaguar.cpp
@@ -1967,7 +1967,7 @@ image_init_result jaguar_state::quickload_cb(device_image_interface &image, cons
{
memset(m_shared_ram, 0, 0x200000);
image.fseek(0, SEEK_SET);
- image.fread( &memregion("maincpu")->base()[start-skip], quickload_size);
+ image.fread( &m_shared_ram[(start-skip)/4], quickload_size);
quickload_begin = start;
fix_endian(&memregion("maincpu")->base()[(start-skip)&0xfffffc], quickload_size);
}
diff --git a/src/mame/drivers/jalmah.cpp b/src/mame/drivers/jalmah.cpp
index 52efc7aed82..eb7efbab423 100644
--- a/src/mame/drivers/jalmah.cpp
+++ b/src/mame/drivers/jalmah.cpp
@@ -127,6 +127,8 @@ public:
m_maincpu(*this, "maincpu"),
m_palette(*this, "palette"),
m_tmap(*this, "scroll%u", 0),
+ m_jmcu_rom_region(*this, "jmcu_rom"),
+ m_jmcu_rom_share(*this, "jmcu_rom"),
m_sharedram(*this, "sharedram"),
m_prirom(*this, "prirom"),
m_p1_key_io(*this, "P1_KEY%u", 0U),
@@ -174,6 +176,8 @@ protected:
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;
optional_device_array<megasys1_tilemap_device, 4> m_tmap;
+ optional_region_ptr<uint16_t> m_jmcu_rom_region;
+ optional_shared_ptr<uint16_t> m_jmcu_rom_share;
uint16_t m_tile_bank;
uint16_t m_pri;
@@ -691,7 +695,7 @@ void jalmah_state::jalmah_map(address_map &map)
void jalmah_state::jalmahv1_map(address_map &map)
{
jalmah_map(map);
- map(0x100000, 0x10ffff).ram().region("jmcu_rom", 0); // extended ROM functions (not on real HW)
+ map(0x100000, 0x10ffff).ram().share("jmcu_rom"); // extended ROM functions (not on real HW)
}
void urashima_state::urashima_map(address_map &map)
@@ -721,7 +725,7 @@ void urashima_state::urashima_map(address_map &map)
map(0x0a0000, 0x0a1fff).noprw();
map(0x0f0000, 0x0f0fff).ram().share("sharedram");/*shared with MCU*/
map(0x0f1000, 0x0fffff).ram(); /*Work Ram*/
- map(0x100000, 0x10ffff).ram().region("jmcu_rom", 0);/*extra RAM for MCU code prg (NOT ON REAL HW!!!)*/
+ map(0x100000, 0x10ffff).ram().share("jmcu_rom");/*extra RAM for MCU code prg (NOT ON REAL HW!!!)*/
}
void jalmah_state::oki_map(address_map &map)
@@ -1067,6 +1071,9 @@ void jalmah_state::machine_start()
void jalmah_state::machine_reset()
{
+ if(m_jmcu_rom_share)
+ memcpy(m_jmcu_rom_share, m_jmcu_rom_region, 0x10000);
+
m_pri = 0;
refresh_priority_system();
@@ -1075,6 +1082,9 @@ void jalmah_state::machine_reset()
void urashima_state::machine_reset()
{
+ if(m_jmcu_rom_share)
+ memcpy(m_jmcu_rom_share, m_jmcu_rom_region, 0x10000);
+
// m_pri = 0;
// initialize tilemap vram to sane defaults (test mode cares)
diff --git a/src/mame/drivers/jr100.cpp b/src/mame/drivers/jr100.cpp
index 24854edc556..1a24b97d2c8 100644
--- a/src/mame/drivers/jr100.cpp
+++ b/src/mame/drivers/jr100.cpp
@@ -73,7 +73,7 @@ public:
, m_ram(*this, "ram")
, m_pcg(*this, "pcg")
, m_vram(*this, "vram")
- , m_rom(*this, "rom")
+ , m_rom(*this, "maincpu")
, m_via(*this, "via")
, m_cassette(*this, "cassette")
, m_speaker(*this, "speaker")
@@ -104,7 +104,7 @@ private:
required_shared_ptr<uint8_t> m_ram;
required_shared_ptr<uint8_t> m_pcg;
required_shared_ptr<uint8_t> m_vram;
- required_shared_ptr<uint8_t> m_rom;
+ required_region_ptr<uint8_t> m_rom;
required_device<via6522_device> m_via;
required_device<cassette_image_device> m_cassette;
required_device<speaker_sound_device> m_speaker;
@@ -122,13 +122,13 @@ void jr100_state::mem_map(address_map &map)
map(0x0000, 0x3fff).ram().share("ram");
//map(0x4000, 0x7fff).ram(); expansion ram
//map(0x8000, 0xbfff).rom(); expansion rom
- map(0xc000, 0xc0ff).ram().share("pcg").region("maincpu", 0xc000);
+ map(0xc000, 0xc0ff).ram().share("pcg");
map(0xc100, 0xc3ff).ram().share("vram");
map(0xc800, 0xc80f).m(m_via, FUNC(via6522_device::map));
//map(0xcc00, 0xcfff).; expansion i/o
//map(0xd000, 0xd7ff).rom(); expansion rom for printer control
//map(0xd800, 0xdfff).rom(); expansion rom
- map(0xe000, 0xffff).rom().share("rom");
+ map(0xe000, 0xffff).rom().region("maincpu", 0);
}
// Input ports - names in [ ] are screen actions; otherwise the text is literally printed onscreen
@@ -248,33 +248,6 @@ uint32_t jr100_state::screen_update_jr100(screen_device &screen, bitmap_ind16 &b
return 0;
}
-static const gfx_layout tilesrom_layout =
-{
- 8,8,
- 128,
- 1,
- { 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
- 8*8
-};
-
-static const gfx_layout tilesram_layout =
-{
- 8,8,
- 32,
- 1,
- { 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
- { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
- 8*8
-};
-
-static GFXDECODE_START( gfx_jr100 )
- GFXDECODE_ENTRY( "maincpu", 0xe000, tilesrom_layout, 0, 1 ) // inside rom
- GFXDECODE_ENTRY( "maincpu", 0xc000, tilesram_layout, 0, 1 ) // user defined
-GFXDECODE_END
-
READ8_MEMBER(jr100_state::pb_r)
{
uint8_t data = 0x1f;
@@ -386,7 +359,6 @@ void jr100_state::jr100(machine_config &config)
screen.set_screen_update(FUNC(jr100_state::screen_update_jr100));
screen.set_palette("palette");
- GFXDECODE(config, "gfxdecode", "palette", gfx_jr100);
PALETTE(config, "palette", palette_device::MONOCHROME);
VIA6522(config, m_via, XTAL(14'318'181) / 16); // see note in TODO
@@ -410,13 +382,13 @@ void jr100_state::jr100(machine_config &config)
/* ROM definition */
ROM_START( jr100 )
- ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "jr100.ic5", 0xe000, 0x2000, CRC(951d08a1) SHA1(edae3daaa94924e444bbe485ac2bcd5cb5b22ca2))
+ ROM_REGION( 0x2000, "maincpu", 0 )
+ ROM_LOAD( "jr100.ic5", 0x0000, 0x2000, CRC(951d08a1) SHA1(edae3daaa94924e444bbe485ac2bcd5cb5b22ca2))
ROM_END
ROM_START( jr100u )
- ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "jr100u.ic5", 0xe000, 0x2000, CRC(f589dd8d) SHA1(78a51f2ae055bf4dc1b0887a6277f5dbbd8ba512))
+ ROM_REGION( 0x2000, "maincpu", 0 )
+ ROM_LOAD( "jr100u.ic5", 0x0000, 0x2000, CRC(f589dd8d) SHA1(78a51f2ae055bf4dc1b0887a6277f5dbbd8ba512))
ROM_END
/* Driver */
diff --git a/src/mame/drivers/jtc.cpp b/src/mame/drivers/jtc.cpp
index 47e3b5627c6..472f76db70e 100644
--- a/src/mame/drivers/jtc.cpp
+++ b/src/mame/drivers/jtc.cpp
@@ -44,7 +44,10 @@ public:
, m_cassette(*this, "cassette")
, m_speaker(*this, "speaker")
, m_centronics(*this, CENTRONICS_TAG)
- , m_video_ram(*this, "videoram")
+ , m_video_ram(*this, "videoram", JTC_ES40_VIDEORAM_SIZE, ENDIANNESS_BIG)
+ , m_color_ram_r(*this, "color_ram_r", JTC_ES40_VIDEORAM_SIZE, ENDIANNESS_BIG)
+ , m_color_ram_g(*this, "color_ram_g", JTC_ES40_VIDEORAM_SIZE, ENDIANNESS_BIG)
+ , m_color_ram_b(*this, "color_ram_b", JTC_ES40_VIDEORAM_SIZE, ENDIANNESS_BIG)
{ }
virtual void machine_start() override;
@@ -68,7 +71,10 @@ public:
required_device<cassette_image_device> m_cassette;
required_device<speaker_sound_device> m_speaker;
required_device<centronics_device> m_centronics;
- optional_shared_ptr<uint8_t> m_video_ram;
+ memory_share_creator<uint8_t> m_video_ram;
+ memory_share_creator<uint8_t> m_color_ram_r;
+ memory_share_creator<uint8_t> m_color_ram_g;
+ memory_share_creator<uint8_t> m_color_ram_b;
};
@@ -723,18 +729,8 @@ void jtc_state::es40_palette(palette_device &palette) const
void jtces40_state::video_start()
{
- /* allocate memory */
- m_video_ram.allocate(JTC_ES40_VIDEORAM_SIZE);
- m_color_ram_r = std::make_unique<uint8_t[]>(JTC_ES40_VIDEORAM_SIZE);
- m_color_ram_g = std::make_unique<uint8_t[]>(JTC_ES40_VIDEORAM_SIZE);
- m_color_ram_b = std::make_unique<uint8_t[]>(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_item(NAME(m_centronics_busy));
}
diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp
index b6d6f08826b..52feff83852 100644
--- a/src/mame/drivers/jupace.cpp
+++ b/src/mame/drivers/jupace.cpp
@@ -419,7 +419,7 @@ void ace_state::ace_mem(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x2000, 0x23ff).mirror(0x0400).ram().share("video_ram");
- map(0x2800, 0x2bff).mirror(0x0400).ram().share("char_ram").region(Z80_TAG, 0xfc00);
+ map(0x2800, 0x2bff).mirror(0x0400).ram().share("char_ram");
map(0x3000, 0x33ff).mirror(0x0c00).ram();
map(0x4000, 0xffff).ram();
}
@@ -829,14 +829,14 @@ void ace_state::ace(machine_config &config)
//-------------------------------------------------
ROM_START( jupace )
- ROM_REGION( 0x10000, Z80_TAG, 0 )
+ ROM_REGION( 0x2000, Z80_TAG, 0 )
ROM_LOAD( "rom-a.z1", 0x0000, 0x1000, CRC(dc8438a5) SHA1(8fa97eb71e5dd17c7d190c6587ee3840f839347c) )
ROM_LOAD( "rom-b.z2", 0x1000, 0x1000, CRC(4009f636) SHA1(98c5d4bcd74bcf014268cf4c00b2007ea5cc21f3) )
ROM_REGION( 0x1000, "fdc", 0 ) // Deep Thought disc interface
ROM_LOAD( "dos 4.bin", 0x0000, 0x1000, CRC(04c70448) SHA1(53ddcced6ae2feafd687a3b55864726656b71412) )
- ROM_REGION( 0x10000, SP0256AL2_TAG, 0 )
+ ROM_REGION( 0x800, SP0256AL2_TAG, 0 )
ROM_LOAD( "sp0256-al2.ic1", 0x000, 0x800, CRC(b504ac15) SHA1(e60fcb5fa16ff3f3b69d36c7a6e955744d3feafc) )
ROM_END
diff --git a/src/mame/drivers/kangaroo.cpp b/src/mame/drivers/kangaroo.cpp
index a3c549c8764..7578e5bf391 100644
--- a/src/mame/drivers/kangaroo.cpp
+++ b/src/mame/drivers/kangaroo.cpp
@@ -274,7 +274,7 @@ void kangaroo_state::main_map(address_map &map)
void kangaroo_state::sound_map(address_map &map)
{
- map(0x0000, 0x0fff).rom();
+ map(0x0000, 0x0fff).rom().region("audiocpu", 0);
map(0x4000, 0x43ff).mirror(0x0c00).ram();
map(0x6000, 0x6000).mirror(0x0fff).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x7000, 0x7000).mirror(0x0fff).w("aysnd", FUNC(ay8910_device::data_w));
diff --git a/src/mame/drivers/kaypro.cpp b/src/mame/drivers/kaypro.cpp
index d7f81ebe806..cd16f1c54c6 100644
--- a/src/mame/drivers/kaypro.cpp
+++ b/src/mame/drivers/kaypro.cpp
@@ -68,7 +68,7 @@ void kaypro_state::kaypro_map(address_map &map)
{
map(0x0000, 0x2fff).bankr("bankr0").bankw("bankw0");
map(0x3000, 0x3fff).bankrw("bank3");
- map(0x4000, 0xffff).ram().region("rambank", 0x4000);
+ map(0x4000, 0xffff).ram();
}
void kaypro_state::kayproii_io(address_map &map)
@@ -398,14 +398,13 @@ void kaypro_state::omni2(machine_config &config)
void kaypro_state::init_kaypro()
{
- uint8_t *main = memregion("roms")->base();
- uint8_t *ram = memregion("rambank")->base();
-
- membank("bankr0")->configure_entry(1, &main[0x0000]);
- membank("bankr0")->configure_entry(0, &ram[0x0000]);
- membank("bank3")->configure_entry(1, &main[0x3000]);
- membank("bank3")->configure_entry(0, &ram[0x3000]);
- membank("bankw0")->configure_entry(0, &ram[0x0000]);
+ uint8_t *rom = memregion("roms")->base();
+
+ membank("bankr0")->configure_entry(0, m_ram);
+ membank("bankw0")->configure_entry(0, m_ram);
+ membank("bankr0")->configure_entry(1, rom);
+ membank("bank3")->configure_entry(0, m_ram + 0x3000);
+ membank("bank3")->configure_entry(1, m_videoram);
}
@@ -437,7 +436,6 @@ ROM_START(kayproii)
ROMX_LOAD("kplus83.rom", 0x0000, 0x2000, CRC(5e9b817d) SHA1(26ea875ee3659a964cbded4ed0c82a3af42db64b), ROM_BIOS(6) )
ROM_SYSTEM_BIOS( 7, "pro8v3", "MicroCornucopia_Pro8_V3.3")
ROMX_LOAD("pro8-3.rom", 0x0000, 0x1000, CRC(f2d4c598) SHA1(269b2fddeb98db3e5eba2056ff250dff72b0561e), ROM_BIOS(7) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
ROM_REGION(0x0800, "chargen", ROMREGION_INVERT)
ROM_LOAD("81-146.u43", 0x0000, 0x0800, CRC(4cc7d206) SHA1(5cb880083b94bd8220aac1f87d537db7cfeb9013) )
@@ -456,7 +454,6 @@ ROM_START(kayproiv)
ROMX_LOAD("kplus83.rom", 0x0000, 0x2000, CRC(5e9b817d) SHA1(26ea875ee3659a964cbded4ed0c82a3af42db64b), ROM_BIOS(3) )
ROM_SYSTEM_BIOS( 4, "pro8v3", "MicroCornucopia_Pro8_V3.3")
ROMX_LOAD("pro8-3.rom", 0x0000, 0x1000, CRC(f2d4c598) SHA1(269b2fddeb98db3e5eba2056ff250dff72b0561e), ROM_BIOS(4) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
ROM_REGION(0x0800, "chargen", ROMREGION_INVERT)
ROM_LOAD("81-146.u43", 0x0000, 0x0800, CRC(4cc7d206) SHA1(5cb880083b94bd8220aac1f87d537db7cfeb9013) )
@@ -473,7 +470,6 @@ ROM_START(kaypro10)
ROMX_LOAD("trom34.rom", 0x0000, 0x2000, CRC(0ec6d39a) SHA1(8c2a92b8642e144452c28300bf50a00a11a060cd), ROM_BIOS(2) )
ROM_SYSTEM_BIOS( 3, "kplus83", "MICROCode Consulting KayPLUS 83")
ROMX_LOAD("kplus83.rom", 0x0000, 0x2000, CRC(5e9b817d) SHA1(26ea875ee3659a964cbded4ed0c82a3af42db64b), ROM_BIOS(3) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-187.u31", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
@@ -495,8 +491,6 @@ ROM_START(kaypro1084)
ROM_SYSTEM_BIOS( 5, "kplus", "MICROCode Consulting KayPLUS 84")
ROMX_LOAD("kplus84.rom", 0x0000, 0x2000, CRC(4551905a) SHA1(48f0964edfad05b214810ae5595638245c30e5c0), ROM_BIOS(5) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-187.u31", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -514,8 +508,6 @@ ROM_START(kaypro484) // later renamed in 2X (or 2X MTC to signify the inclusion
ROM_SYSTEM_BIOS( 4, "pro8v5", "MicroCornucopia Pro8 V5")
ROMX_LOAD("pro884v5.rom", 0x0000, 0x2000, CRC(fe0051b1) SHA1(cac429154d40e21174ae05ceb0017b62473cdebd), ROM_BIOS(4) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -534,8 +526,6 @@ ROM_START(kaypro284)
ROM_SYSTEM_BIOS( 4, "pro8v5", "MicroCornucopia Pro8 V5")
ROMX_LOAD("pro884v5.rom", 0x0000, 0x2000, CRC(fe0051b1) SHA1(cac429154d40e21174ae05ceb0017b62473cdebd), ROM_BIOS(4) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -560,8 +550,6 @@ ROM_START(kaypro2x)
ROM_SYSTEM_BIOS( 7, "handyman", "Hitech Research Handyman") // http://content.thetechnickel.com/misc/kaypro-handyman/kaypro-4-plus-88-06.jpg
ROMX_LOAD( "handyman.bin", 0x0000, 0x8000, CRC(f020d82c) SHA1(576a6608270d4ec7cf814c9de46ecf4e2869d30a), ROM_BIOS(7) ) // fits any classic Kaypro, needs its own 16K RAM
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -573,7 +561,6 @@ ROM_START(kayproiip88)
ROMX_LOAD("81-232.u47", 0x0000, 0x1000, CRC(4918fb91) SHA1(cd9f45cc3546bcaad7254b92c5d501c40e2ef0b2), ROM_BIOS(0) )
ROM_SYSTEM_BIOS( 1, "kplus83", "MICROCode Consulting KayPLUS 83")
ROMX_LOAD("kplus83.rom", 0x0000, 0x2000, CRC(5e9b817d) SHA1(26ea875ee3659a964cbded4ed0c82a3af42db64b), ROM_BIOS(1) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
ROM_REGION(0x0800, "chargen", ROMREGION_INVERT)
ROM_LOAD("81-146.u43", 0x0000, 0x0800, CRC(4cc7d206) SHA1(5cb880083b94bd8220aac1f87d537db7cfeb9013) )
@@ -590,8 +577,6 @@ ROM_START(kaypro484p88)
ROM_SYSTEM_BIOS( 1, "kplus", "MICROCode Consulting KayPLUS 84")
ROMX_LOAD("kplus84.rom", 0x0000, 0x2000, CRC(4551905a) SHA1(48f0964edfad05b214810ae5595638245c30e5c0), ROM_BIOS(1) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -604,8 +589,6 @@ ROM_START(kaypronew2)
ROM_SYSTEM_BIOS( 1, "kplus", "MICROCode Consulting KayPLUS 84")
ROMX_LOAD("kplus84.rom", 0x0000, 0x2000, CRC(4551905a) SHA1(48f0964edfad05b214810ae5595638245c30e5c0), ROM_BIOS(1) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -618,8 +601,6 @@ ROM_START(robie)
ROM_SYSTEM_BIOS( 1, "u", "V1.4")
ROMX_LOAD("robie_u.u34", 0x0000, 0x2000, CRC(da7248b5) SHA1(1dc053b3e44ead47255cc166b7b4b0adaeb3dd3d), ROM_BIOS(1) ) // rom number unknown
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -629,8 +610,6 @@ ROM_START(kaypro4x)
ROM_REGION(0x4000, "roms",0)
ROM_LOAD("81-326.u34", 0x0000, 0x2000, CRC(7f0c3f68) SHA1(54b088a1b2200f9df4b9b347bbefb0115f3a4976) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -645,8 +624,6 @@ ROM_START(kaypro1)
ROM_SYSTEM_BIOS( 2, "kplus", "MICROCode Consulting KayPLUS 84")
ROMX_LOAD("kplus84.rom", 0x0000, 0x2000, CRC(4551905a) SHA1(48f0964edfad05b214810ae5595638245c30e5c0), ROM_BIOS(2) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen",0)
ROM_LOAD("81-235.u9", 0x0000, 0x1000, CRC(5f72da5b) SHA1(8a597000cce1a7e184abfb7bebcb564c6bf24fb7) )
ROM_END
@@ -656,8 +633,6 @@ ROM_START(omni2)
ROM_REGION(0x4000, "roms",0)
ROM_LOAD("omni2.u47", 0x0000, 0x1000, CRC(2883f9e0) SHA1(d98c784e62853582d298bf7ca84c75872847ac9b) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x0800, "chargen", ROMREGION_INVERT)
ROM_LOAD("omni2.u43", 0x0000, 0x0800, CRC(049b3381) SHA1(46f1d4f038747ba9048b075dc617361be088f82a) )
ROM_END
@@ -667,8 +642,6 @@ ROM_START(omni4)
ROM_REGION(0x4000, "roms",0)
ROM_LOAD("omni4.u34", 0x0000, 0x2000, CRC(f24e8521) SHA1(374f2e2b791a807f103744a22c9c8f3af55f1033) )
- ROM_REGION(0x10000, "rambank", ROMREGION_ERASEFF)
-
ROM_REGION(0x1000, "chargen", 0)
ROM_LOAD("omni4.u9", 0x0000, 0x1000, CRC(579665a6) SHA1(261fcdc5a44821de9484340cbe429110400140b4) )
ROM_END
diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp
index d5e753d990f..4ae632098e1 100644
--- a/src/mame/drivers/kinst.cpp
+++ b/src/mame/drivers/kinst.cpp
@@ -196,7 +196,7 @@ public:
m_rambase(*this, "rambase"),
m_rambase2(*this, "rambase2"),
m_control(*this, "control"),
- m_rombase(*this, "rombase"),
+ m_rombase(*this, "user1"),
m_maincpu(*this, "maincpu"),
m_ata(*this, "ata"),
m_dcs(*this, "dcs"),
@@ -218,7 +218,7 @@ private:
required_shared_ptr<uint32_t> m_rambase;
required_shared_ptr<uint32_t> m_rambase2;
required_shared_ptr<uint32_t> m_control;
- required_shared_ptr<uint32_t> m_rombase;
+ required_region_ptr<uint32_t> m_rombase;
required_device<mips3_device> m_maincpu;
required_device<ata_interface_device> m_ata;
required_device<dcs_audio_2k_device> m_dcs;
@@ -484,7 +484,7 @@ void kinst_state::main_map(address_map &map)
map(0x10000080, 0x100000ff).rw(FUNC(kinst_state::control_r), FUNC(kinst_state::control_w)).share("control");
map(0x10000100, 0x1000013f).rw(FUNC(kinst_state::ide_r), FUNC(kinst_state::ide_w));
map(0x10000170, 0x10000173).rw(FUNC(kinst_state::ide_extra_r), FUNC(kinst_state::ide_extra_w));
- map(0x1fc00000, 0x1fc7ffff).rom().region("user1", 0).share("rombase");
+ map(0x1fc00000, 0x1fc7ffff).rom().region("user1", 0);
}
diff --git a/src/mame/drivers/konamigs.cpp b/src/mame/drivers/konamigs.cpp
index a2c9d0a47a0..3a76ecf7652 100644
--- a/src/mame/drivers/konamigs.cpp
+++ b/src/mame/drivers/konamigs.cpp
@@ -59,9 +59,9 @@ public:
, m_rtc_r(*this, "RTCR")
, m_rtc_w(*this, "RTCW")
, m_dipsw_r(*this, "DSW")
- , m_vram(*this, "vram", 0)
- , m_gpuregs(*this, "gpu_regs", 0)
- , m_ymzram(*this, "ymz_ram", 0)
+ , m_vram(*this, "vram")
+ , m_gpuregs(*this, "gpu_regs")
+ , m_ymzram(*this, "ymz_ram")
, m_screen(*this, "screen")
, m_hopper(*this, "hopper")
{ }
diff --git a/src/mame/drivers/kyocera.cpp b/src/mame/drivers/kyocera.cpp
index fbf525ccf1e..1a9efb5a5e3 100644
--- a/src/mame/drivers/kyocera.cpp
+++ b/src/mame/drivers/kyocera.cpp
@@ -97,28 +97,28 @@ void pc8201_state::bankswitch(uint8_t data)
if (rom_bank > 1)
{
/* RAM */
- program.install_readwrite_bank(0x0000, 0x7fff, "bank1");
+ program.install_readwrite_bank(0x0000, 0x7fff, m_bank1);
}
else
{
/* ROM */
- program.install_read_bank(0x0000, 0x7fff, "bank1");
+ program.install_read_bank(0x0000, 0x7fff, m_bank1);
program.unmap_write(0x0000, 0x7fff);
}
- membank("bank1")->set_entry(rom_bank);
+ m_bank1->set_entry(rom_bank);
switch (ram_bank)
{
case 0:
if (m_ram->size() > 16 * 1024)
{
- program.install_readwrite_bank(0x8000, 0xffff, "bank2");
+ program.install_readwrite_bank(0x8000, 0xffff, m_bank2);
}
else
{
program.unmap_readwrite(0x8000, 0xbfff);
- program.install_readwrite_bank(0xc000, 0xffff, "bank2");
+ program.install_readwrite_bank(0xc000, 0xffff, m_bank2);
}
break;
@@ -128,20 +128,20 @@ void pc8201_state::bankswitch(uint8_t data)
case 2:
if (m_ram->size() > 32 * 1024)
- program.install_readwrite_bank(0x8000, 0xffff, "bank2");
+ program.install_readwrite_bank(0x8000, 0xffff, m_bank2);
else
program.unmap_readwrite(0x8000, 0xffff);
break;
case 3:
if (m_ram->size() > 64 * 1024)
- program.install_readwrite_bank(0x8000, 0xffff, "bank2");
+ program.install_readwrite_bank(0x8000, 0xffff, m_bank2);
else
program.unmap_readwrite(0x8000, 0xffff);
break;
}
- membank("bank2")->set_entry(ram_bank);
+ m_bank2->set_entry(ram_bank);
}
void pc8201_state::bank_w(uint8_t data)
@@ -429,7 +429,7 @@ void kc85_state::ctrl_w(uint8_t data)
*/
/* ROM bank selection */
- membank("bank1")->set_entry(BIT(data, 0));
+ m_bank1->set_entry(BIT(data, 0));
/* printer strobe */
m_centronics->write_strobe(BIT(data, 1));
@@ -469,9 +469,9 @@ void tandy200_state::bankswitch(uint8_t data)
}
else
{
- program.install_read_bank(0x0000, 0x7fff, "bank1");
+ program.install_read_bank(0x0000, 0x7fff, m_bank1);
program.unmap_write(0x0000, 0x7fff);
- membank("bank1")->set_entry(rom_bank);
+ m_bank1->set_entry(rom_bank);
}
if (m_ram->size() < ((ram_bank + 1) * 24 * 1024))
@@ -481,8 +481,8 @@ void tandy200_state::bankswitch(uint8_t data)
}
else
{
- program.install_readwrite_bank(0xa000, 0xffff, "bank2");
- membank("bank2")->set_entry(ram_bank);
+ program.install_readwrite_bank(0xa000, 0xffff, m_bank2);
+ m_bank2->set_entry(ram_bank);
}
}
@@ -1156,27 +1156,27 @@ void kc85_state::machine_start()
m_rtc->oe_w(1);
/* configure ROM banking */
- program.install_read_bank(0x0000, 0x7fff, "bank1");
+ program.install_read_bank(0x0000, 0x7fff, m_bank1);
program.unmap_write(0x0000, 0x7fff);
- membank("bank1")->configure_entry(0, m_rom->base());
- membank("bank1")->configure_entry(1, m_opt_region ? m_opt_region->base() : m_rom->base());
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entry(0, m_rom->base());
+ m_bank1->configure_entry(1, m_opt_region ? m_opt_region->base() : m_rom->base());
+ m_bank1->set_entry(0);
/* configure RAM banking */
switch (m_ram->size())
{
case 16 * 1024:
program.unmap_readwrite(0x8000, 0xbfff);
- program.install_readwrite_bank(0xc000, 0xffff, "bank2");
+ program.install_readwrite_bank(0xc000, 0xffff, m_bank2);
break;
case 32 * 1024:
- program.install_readwrite_bank(0x8000, 0xffff,"bank2");
+ program.install_readwrite_bank(0x8000, 0xffff,m_bank2);
break;
}
- membank("bank2")->configure_entry(0, m_ram->pointer());
- membank("bank2")->set_entry(0);
+ m_bank2->configure_entry(0, m_ram->pointer());
+ m_bank2->set_entry(0);
/* register for state saving */
save_item(NAME(m_bank));
@@ -1199,15 +1199,15 @@ void pc8201_state::machine_start()
m_rtc->oe_w(1);
/* configure ROM banking */
- membank("bank1")->configure_entry(0, m_rom->base());
- membank("bank1")->configure_entry(1, m_opt_region ? m_opt_region->base() : m_rom->base());
- membank("bank1")->configure_entries(2, 2, ram + 0x8000, 0x8000);
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entry(0, m_rom->base());
+ m_bank1->configure_entry(1, m_opt_region ? m_opt_region->base() : m_rom->base());
+ m_bank1->configure_entries(2, 2, ram + 0x8000, 0x8000);
+ m_bank1->set_entry(0);
/* configure RAM banking */
- membank("bank2")->configure_entry(0, ram);
- membank("bank2")->configure_entries(2, 2, ram + 0x8000, 0x8000);
- membank("bank2")->set_entry(0);
+ m_bank2->configure_entry(0, ram);
+ m_bank2->configure_entries(2, 2, ram + 0x8000, 0x8000);
+ m_bank2->set_entry(0);
bankswitch(0);
@@ -1233,37 +1233,37 @@ void trsm100_state::machine_start()
m_rtc->oe_w(1);
/* configure ROM banking */
- program.install_read_bank(0x0000, 0x7fff, "bank1");
+ program.install_read_bank(0x0000, 0x7fff, m_bank1);
program.unmap_write(0x0000, 0x7fff);
- membank("bank1")->configure_entry(0, m_rom->base());
- membank("bank1")->configure_entry(1, m_opt_region ? m_opt_region->base() : m_rom->base());
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entry(0, m_rom->base());
+ m_bank1->configure_entry(1, m_opt_region ? m_opt_region->base() : m_rom->base());
+ m_bank1->set_entry(0);
/* configure RAM banking */
switch (m_ram->size())
{
case 8 * 1024:
program.unmap_readwrite(0x8000, 0xcfff);
- program.install_readwrite_bank(0xe000, 0xffff, "bank2");
+ program.install_readwrite_bank(0xe000, 0xffff, m_bank2);
break;
case 16 * 1024:
program.unmap_readwrite(0x8000, 0xbfff);
- program.install_readwrite_bank(0xc000, 0xffff, "bank2");
+ program.install_readwrite_bank(0xc000, 0xffff, m_bank2);
break;
case 24 * 1024:
program.unmap_readwrite(0x8000, 0x9fff);
- program.install_readwrite_bank(0xa000, 0xffff, "bank2");
+ program.install_readwrite_bank(0xa000, 0xffff, m_bank2);
break;
case 32 * 1024:
- program.install_readwrite_bank(0x8000, 0xffff, "bank2");
+ program.install_readwrite_bank(0x8000, 0xffff, m_bank2);
break;
}
- membank("bank2")->configure_entry(0, m_ram->pointer());
- membank("bank2")->set_entry(0);
+ m_bank2->configure_entry(0, m_ram->pointer());
+ m_bank2->set_entry(0);
/* register for state saving */
save_item(NAME(m_bank));
@@ -1280,14 +1280,14 @@ void tandy200_state::machine_start()
m_opt_region = memregion(region_tag.assign(m_opt_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str());
/* configure ROM banking */
- membank("bank1")->configure_entry(0, m_rom->base());
- membank("bank1")->configure_entry(1, m_rom->base() + 0x10000);
- membank("bank1")->configure_entry(2, m_opt_region ? m_opt_region->base() : m_rom->base());
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entry(0, m_rom->base());
+ m_bank1->configure_entry(1, m_rom->base() + 0x10000);
+ m_bank1->configure_entry(2, m_opt_region ? m_opt_region->base() : m_rom->base());
+ m_bank1->set_entry(0);
/* configure RAM banking */
- membank("bank2")->configure_entries(0, 3, m_ram->pointer(), 0x6000);
- membank("bank2")->set_entry(0);
+ m_bank2->configure_entries(0, 3, m_ram->pointer(), 0x6000);
+ m_bank2->set_entry(0);
/* register for state saving */
save_item(NAME(m_bank));
diff --git a/src/mame/drivers/kyugo.cpp b/src/mame/drivers/kyugo.cpp
index 260ede1e56b..3cf137bcd6e 100644
--- a/src/mame/drivers/kyugo.cpp
+++ b/src/mame/drivers/kyugo.cpp
@@ -154,6 +154,13 @@ void kyugo_state::kyugo_main_map(address_map &map)
map(0xf000, 0xf7ff).ram().share(m_shared_ram);
}
+void kyugo_state::srdmissn_main_map(address_map &map)
+{
+ kyugo_main_map(map);
+ map(0x8000, 0x8fff).ram();
+ map(0xe000, 0xe7ff).ram().share(m_shared_ram);
+}
+
void kyugo_state::gyrodine_main_map(address_map &map)
{
kyugo_main_map(map);
@@ -684,6 +691,7 @@ void kyugo_state::srdmissn(machine_config &config)
kyugo_base(config);
// basic machine hardware
+ m_maincpu->set_addrmap(AS_PROGRAM, &kyugo_state::srdmissn_main_map);
m_subcpu->set_addrmap(AS_PROGRAM, &kyugo_state::srdmissn_sub_map);
m_subcpu->set_addrmap(AS_IO, &kyugo_state::srdmissn_sub_portmap);
}
@@ -1576,24 +1584,6 @@ ROM_END
/*************************************
*
- * Game specific initialization
- *
- *************************************/
-
-
-void kyugo_state::init_srdmissn()
-{
- // shared RAM is mapped at 0xe000 as well
- m_maincpu->space(AS_PROGRAM).install_ram(0xe000, 0xe7ff, m_shared_ram);
-
- // extra RAM on sub CPU
- m_subcpu->space(AS_PROGRAM).install_ram(0x8800, 0x8fff);
-}
-
-
-
-/*************************************
- *
* Game drivers
*
*************************************/
@@ -1610,12 +1600,12 @@ GAME( 1985, sonofphx, repulse, repulse, repulse, kyugo_state, empty_init,
GAME( 1985, flashgal, 0, repulse, flashgal, kyugo_state, empty_init, ROT0, "Kyugo / Sega", "Flashgal (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, flashgalk, flashgal, repulse, flashgal, kyugo_state, empty_init, ROT0, "Kyugo / Sega", "Flashgal (set 1, Kyugo logo)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, flashgala, flashgal, flashgala, flashgal, kyugo_state, empty_init, ROT0, "Kyugo / Sega", "Flashgal (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1986, srdmissn, 0, srdmissn, srdmissn, kyugo_state, init_srdmissn, ROT90, "Kyugo / Taito Corporation", "S.R.D. Mission", MACHINE_SUPPORTS_SAVE )
-GAME( 1986, fx, srdmissn, srdmissn, srdmissn, kyugo_state, init_srdmissn, ROT90, "bootleg", "F-X (bootleg of S.R.D. Mission)", MACHINE_SUPPORTS_SAVE )
-GAME( 1986, legend, 0, legend, legend, kyugo_state, init_srdmissn, ROT0, "Kyugo / Sega", "Legend", MACHINE_SUPPORTS_SAVE ) // no copyright (maybe also a bootleg?)
-GAME( 1986, legendb, legend, legend, legend, kyugo_state, init_srdmissn, ROT0, "bootleg", "Legion (bootleg of Legend)", MACHINE_SUPPORTS_SAVE ) // no copyright
-GAME( 1987, airwolf, 0, srdmissn, airwolf, kyugo_state, init_srdmissn, ROT0, "Kyugo", "Airwolf", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, airwolfa, airwolf, srdmissn, airwolf, kyugo_state, init_srdmissn, ROT0, "Kyugo (United Amusements license)", "Airwolf (US)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, skywolf, airwolf, srdmissn, skywolf, kyugo_state, init_srdmissn, ROT0, "bootleg", "Sky Wolf (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, skywolf2, airwolf, srdmissn, airwolf, kyugo_state, init_srdmissn, ROT0, "bootleg", "Sky Wolf (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, skywolf3, airwolf, srdmissn, airwolf, kyugo_state, init_srdmissn, ROT0, "bootleg", "Sky Wolf (set 3)", MACHINE_SUPPORTS_SAVE )
+GAME( 1986, srdmissn, 0, srdmissn, srdmissn, kyugo_state, empty_init, ROT90, "Kyugo / Taito Corporation", "S.R.D. Mission", MACHINE_SUPPORTS_SAVE )
+GAME( 1986, fx, srdmissn, srdmissn, srdmissn, kyugo_state, empty_init, ROT90, "bootleg", "F-X (bootleg of S.R.D. Mission)", MACHINE_SUPPORTS_SAVE )
+GAME( 1986, legend, 0, legend, legend, kyugo_state, empty_init, ROT0, "Kyugo / Sega", "Legend", MACHINE_SUPPORTS_SAVE ) // no copyright (maybe also a bootleg?)
+GAME( 1986, legendb, legend, legend, legend, kyugo_state, empty_init, ROT0, "bootleg", "Legion (bootleg of Legend)", MACHINE_SUPPORTS_SAVE ) // no copyright
+GAME( 1987, airwolf, 0, srdmissn, airwolf, kyugo_state, empty_init, ROT0, "Kyugo", "Airwolf", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, airwolfa, airwolf, srdmissn, airwolf, kyugo_state, empty_init, ROT0, "Kyugo (United Amusements license)", "Airwolf (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, skywolf, airwolf, srdmissn, skywolf, kyugo_state, empty_init, ROT0, "bootleg", "Sky Wolf (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, skywolf2, airwolf, srdmissn, airwolf, kyugo_state, empty_init, ROT0, "bootleg", "Sky Wolf (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, skywolf3, airwolf, srdmissn, airwolf, kyugo_state, empty_init, ROT0, "bootleg", "Sky Wolf (set 3)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/lc80.cpp b/src/mame/drivers/lc80.cpp
index 998845e16d3..d2d7f5945d8 100644
--- a/src/mame/drivers/lc80.cpp
+++ b/src/mame/drivers/lc80.cpp
@@ -294,29 +294,29 @@ void lc80_state::machine_start()
membank("bank4")->configure_entry(0, &ROM[0x2000]);
membank("bank4")->set_entry(0);
- program.install_readwrite_bank(0x0000, 0x07ff, "bank1");
- program.install_readwrite_bank(0x0800, 0x0fff, "bank2");
- program.install_readwrite_bank(0x1000, 0x17ff, "bank3");
+ program.install_readwrite_bank(0x0000, 0x07ff, membank("bank1"));
+ program.install_readwrite_bank(0x0800, 0x0fff, membank("bank2"));
+ program.install_readwrite_bank(0x1000, 0x17ff, membank("bank3"));
switch (m_ram->size())
{
case 1*1024:
- program.install_readwrite_bank(0x2000, 0x23ff, "bank4");
+ program.install_readwrite_bank(0x2000, 0x23ff, membank("bank4"));
program.unmap_readwrite(0x2400, 0x2fff);
break;
case 2*1024:
- program.install_readwrite_bank(0x2000, 0x27ff, "bank4");
+ program.install_readwrite_bank(0x2000, 0x27ff, membank("bank4"));
program.unmap_readwrite(0x2800, 0x2fff);
break;
case 3*1024:
- program.install_readwrite_bank(0x2000, 0x2bff, "bank4");
+ program.install_readwrite_bank(0x2000, 0x2bff, membank("bank4"));
program.unmap_readwrite(0x2c00, 0x2fff);
break;
case 4*1024:
- program.install_readwrite_bank(0x2000, 0x2fff, "bank4");
+ program.install_readwrite_bank(0x2000, 0x2fff, membank("bank4"));
break;
}
diff --git a/src/mame/drivers/leapster.cpp b/src/mame/drivers/leapster.cpp
index 2f7d04b67a4..bf4e4f6779d 100644
--- a/src/mame/drivers/leapster.cpp
+++ b/src/mame/drivers/leapster.cpp
@@ -283,10 +283,7 @@ void leapster_state::machine_start()
if (m_cart_rom)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
-
- space.install_readwrite_bank(0x80000000, 0x807fffff, "cartrom");
- membank("cartrom")->set_base(m_cart_rom->base());
+ m_maincpu->space(AS_PROGRAM).install_rom(0x80000000, 0x807fffff, m_cart_rom->base());
}
}
diff --git a/src/mame/drivers/leland.cpp b/src/mame/drivers/leland.cpp
index 9c510f9c488..88c3936f3dc 100644
--- a/src/mame/drivers/leland.cpp
+++ b/src/mame/drivers/leland.cpp
@@ -84,7 +84,7 @@ void leland_state::master_map_program(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x2000, 0x9fff).bankr(m_master_bankslot[0]);
- map(0xa000, 0xdfff).bankr(m_master_bankslot[1]).w(FUNC(leland_state::leland_battery_ram_w)).share("battery");
+ map(0xa000, 0xdfff).bankr(m_master_bankslot[1]).w(FUNC(leland_state::leland_battery_ram_w));
map(0xe000, 0xefff).ram().share(m_mainram);
map(0xf000, 0xf3ff).rw(FUNC(leland_state::gated_paletteram_r), FUNC(leland_state::gated_paletteram_w)).share("palette");
map(0xf800, 0xf801).w(FUNC(leland_state::master_video_addr_w));
@@ -111,7 +111,7 @@ void ataxx_state::master_map_program_2(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x2000, 0x9fff).bankr(m_master_bankslot[0]);
- map(0xa000, 0xdfff).bankr(m_master_bankslot[1]).w(FUNC(ataxx_state::ataxx_battery_ram_w)).share("battery");
+ map(0xa000, 0xdfff).bankr(m_master_bankslot[1]).w(FUNC(ataxx_state::ataxx_battery_ram_w));
map(0xe000, 0xf7ff).ram().share(m_mainram);
map(0xf800, 0xffff).rw(FUNC(ataxx_state::paletteram_and_misc_r), FUNC(ataxx_state::paletteram_and_misc_w)).share("palette");
}
@@ -178,6 +178,11 @@ void leland_state::slave_map_program(address_map &map)
map(0xffff, 0xffff).w(FUNC(leland_state::ataxx_slave_banksw_w));
}
+void leland_state::asylum_slave_map_program(address_map &map)
+{
+ slave_map_program(map);
+ map(0xf000, 0xfffb).ram();
+}
void ataxx_state::slave_map_io_2(address_map &map)
{
@@ -1081,6 +1086,11 @@ void ataxx_state::wsf(machine_config &config)
WSF_80186(config.replace(), m_sound, 0).set_master_cpu_tag(m_master);
}
+void ataxx_state::asylum(machine_config &config)
+{
+ wsf(config);
+ m_slave->set_addrmap(AS_PROGRAM, &ataxx_state::asylum_slave_map_program);
+}
/*************************************
@@ -3329,9 +3339,6 @@ void ataxx_state::init_asylum()
rotate_memory("master");
rotate_memory("slave");
- /* asylum appears to have some extra RAM for the slave CPU */
- m_slave->space(AS_PROGRAM).install_ram(0xf000, 0xfffb);
-
/* set up additional input ports */
m_master->space(AS_IO).install_read_port(0x0d, 0x0d, "P2");
m_master->space(AS_IO).install_read_port(0x0e, 0x0e, "P1");
@@ -3395,4 +3402,4 @@ GAME( 1990, wsf, 0, wsf, wsf, ataxx_state, init_wsf,
GAME( 1990, wsf3, wsf, wsf, wsf, ataxx_state, init_wsf, ROT0, "Leland Corporation", "World Soccer Finals (rev 3)", 0 )
GAME( 1991, indyheat, 0, wsf, indyheat, ataxx_state, init_indyheat, ROT0, "Leland Corporation", "Danny Sullivan's Indy Heat (rev 1)", 0 )
GAME( 1991, brutforc, 0, wsf, brutforc, ataxx_state, init_brutforc, ROT0, "Leland Corporation", "Brute Force", 0 )
-GAME( 1991, asylum, 0, wsf, brutforc, ataxx_state, init_asylum, ROT270, "Leland Corporation", "Asylum (prototype)", 0 )
+GAME( 1991, asylum, 0, asylum, brutforc, ataxx_state, init_asylum, ROT270, "Leland Corporation", "Asylum (prototype)", 0 )
diff --git a/src/mame/drivers/liberate.cpp b/src/mame/drivers/liberate.cpp
index 0dc6b06c023..14da6b90ad3 100644
--- a/src/mame/drivers/liberate.cpp
+++ b/src/mame/drivers/liberate.cpp
@@ -79,7 +79,7 @@ WRITE8_MEMBER(liberate_state::deco16_bank_w)
if (m_bank)
m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0x800f, read8_delegate(*this, FUNC(liberate_state::deco16_io_r)));
else
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0x800f, "bank1");
+ m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0x800f, membank("bank1"));
}
READ8_MEMBER(liberate_state::prosoccr_bank_r)
diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp
index 04209cc46ab..475c7695edd 100644
--- a/src/mame/drivers/limenko.cpp
+++ b/src/mame/drivers/limenko.cpp
@@ -54,6 +54,7 @@ public:
, m_spriteram(*this, "spriteram")
, m_videoreg(*this, "videoreg")
, m_gfx_region(*this, "gfx")
+ , m_qs1000_bank(*this, "qs1000_bank")
{
}
@@ -87,6 +88,8 @@ private:
required_shared_ptr<u32> m_videoreg;
required_region_ptr<u8> m_gfx_region;
+ memory_bank_creator m_qs1000_bank;
+
tilemap_t *m_bg_tilemap;
tilemap_t *m_md_tilemap;
tilemap_t *m_fg_tilemap;
@@ -200,7 +203,7 @@ void limenko_state::qs1000_p3_w(u8 data)
// ...x .... - ?
// ..x. .... - /IRQ clear
- membank("qs1000:bank")->set_entry(data & 0x07);
+ m_qs1000_bank->set_entry(data & 0x07);
if (!BIT(data, 5))
m_soundlatch->acknowledge_w();
@@ -1071,8 +1074,8 @@ READ32_MEMBER(limenko_state::spotty_speedup_r)
void limenko_state::init_common()
{
// Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM
- m_qs1000->cpu().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank");
- membank("qs1000:bank")->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000);
+ m_qs1000->cpu().space(AS_IO).install_read_bank(0x0100, 0xffff, m_qs1000_bank);
+ m_qs1000_bank->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000);
m_spriteram_bit = 1;
}
diff --git a/src/mame/drivers/lisa.cpp b/src/mame/drivers/lisa.cpp
index f2158394ae1..7b9978d1a95 100644
--- a/src/mame/drivers/lisa.cpp
+++ b/src/mame/drivers/lisa.cpp
@@ -33,7 +33,7 @@ void lisa_state::lisa_fdc_map(address_map &map)
map(0x0000, 0x03ff).ram().share("fdc_ram"); /* RAM (shared with 68000) */
map(0x0400, 0x07ff).rw(FUNC(lisa_state::lisa_fdc_io_r), FUNC(lisa_state::lisa_fdc_io_w)); /* disk controller (IWM and TTL logic) */
map(0x0800, 0x0fff).noprw();
- map(0x1000, 0x1fff).rom().region("fdccpu", 0x1000).share("fdc_rom"); /* ROM */
+ map(0x1000, 0x1fff).rom().region("fdccpu", 0x1000); /* ROM */
}
void lisa_state::lisa210_fdc_map(address_map &map)
@@ -43,7 +43,7 @@ void lisa_state::lisa210_fdc_map(address_map &map)
map(0x0400, 0x07ff).noprw(); /* nothing, or RAM wrap-around ??? */
map(0x0800, 0x0bff).rw(FUNC(lisa_state::lisa_fdc_io_r), FUNC(lisa_state::lisa_fdc_io_w)); /* disk controller (IWM and TTL logic) */
map(0x0c00, 0x0fff).noprw(); /* nothing, or IO port wrap-around ??? */
- map(0x1000, 0x1fff).rom().region("fdccpu", 0x1000).share("fdc_rom"); /* ROM */
+ map(0x1000, 0x1fff).rom().region("fdccpu", 0x1000); /* ROM */
}
diff --git a/src/mame/drivers/m20.cpp b/src/mame/drivers/m20.cpp
index 00c61f10ee6..25f029192ff 100644
--- a/src/mame/drivers/m20.cpp
+++ b/src/mame/drivers/m20.cpp
@@ -348,84 +348,75 @@ void m20_state::install_memory()
/* install mainboard memory (aka DRAM0) */
/* <0>0000 */
- pspace.install_readwrite_bank(0x0000, 0x3fff, 0, "dram0_4000");
- dspace.install_readwrite_bank(0x0000, 0x3fff, 0, "dram0_4000");
+ pspace.install_ram(0x0000, 0x3fff, 0, memptr + 0x4000);
+ dspace.install_ram(0x0000, 0x3fff, 0, memptr + 0x4000);
/* <0>4000 */
- pspace.install_readwrite_bank(0x4000, 0x7fff, 0, "dram0_8000");
+ pspace.install_ram(0x4000, 0x7fff, 0, memptr + 0x8000);
/* <0>8000 */
- pspace.install_readwrite_bank(0x8000, 0xbfff, 0, "dram0_c000");
+ pspace.install_ram(0x8000, 0xbfff, 0, memptr + 0xc000);
/* <0>C000 */
- pspace.install_readwrite_bank(0xc000, 0xcfff, 0, "dram0_10000");
+ pspace.install_ram(0xc000, 0xcfff, 0, memptr + 0x10000);
/* <1>0000 */
- pspace.install_readwrite_bank(0x10000, 0x13fff, 0, "dram0_8000");
- dspace.install_readwrite_bank(0x10000, 0x13fff, 0, "dram0_14000");
+ pspace.install_ram(0x10000, 0x13fff, 0, memptr + 0x8000);
+ dspace.install_ram(0x10000, 0x13fff, 0, memptr + 0x14000);
/* <1>4000 */
- pspace.install_readwrite_bank(0x14000, 0x17fff, 0, "dram0_c000");
- dspace.install_readwrite_bank(0x14000, 0x17fff, 0, "dram0_18000");
+ pspace.install_ram(0x14000, 0x17fff, 0, memptr + 0xc000);
+ dspace.install_ram(0x14000, 0x17fff, 0, memptr + 0x18000);
/* <1>8000 */
- pspace.install_readwrite_bank(0x18000, 0x1bfff, 0, "dram0_10000");
- dspace.install_readwrite_bank(0x18000, 0x1bfff, 0, "dram0_1c000");
+ pspace.install_ram(0x18000, 0x1bfff, 0, memptr + 0x10000);
+ dspace.install_ram(0x18000, 0x1bfff, 0, memptr + 0x1c000);
/* <1>c000 empty*/
/* <2>0000 */
- pspace.install_readwrite_bank(0x20000, 0x23fff, 0, "dram0_14000");
- dspace.install_readwrite_bank(0x20000, 0x23fff, 0, "dram0_14000");
+ pspace.install_ram(0x20000, 0x23fff, 0, memptr + 0x14000);
+ dspace.install_ram(0x20000, 0x23fff, 0, memptr + 0x14000);
/* <2>4000 */
- pspace.install_readwrite_bank(0x24000, 0x27fff, 0, "dram0_18000");
- dspace.install_readwrite_bank(0x24000, 0x27fff, 0, "dram0_18000");
+ pspace.install_ram(0x24000, 0x27fff, 0, memptr + 0x18000);
+ dspace.install_ram(0x24000, 0x27fff, 0, memptr + 0x18000);
/* <2>8000 */
- pspace.install_readwrite_bank(0x28000, 0x2bfff, 0, "dram0_1c000");
- dspace.install_readwrite_bank(0x28000, 0x2bfff, 0, "dram0_1c000");
+ pspace.install_ram(0x28000, 0x2bfff, 0, memptr + 0x1c000);
+ dspace.install_ram(0x28000, 0x2bfff, 0, memptr + 0x1c000);
/* <2>c000 empty*/
/* <3>0000 (video buffer)
- pspace.install_readwrite_bank(0x30000, 0x33fff, 0, "dram0_0000");
- dspace.install_readwrite_bank(0x30000, 0x33fff, 0, "dram0_0000");
+ pspace.install_ram(0x30000, 0x33fff, 0, memptr + 0x0000);
+ dspace.install_ram(0x30000, 0x33fff, 0, memptr + 0x0000);
*/
/* <5>0000 */
- dspace.install_readwrite_bank(0x50000, 0x53fff, 0, "dram0_8000");
+ dspace.install_ram(0x50000, 0x53fff, 0, memptr + 0x8000);
/* <5>4000 */
- dspace.install_readwrite_bank(0x54000, 0x57fff, 0, "dram0_c000");
+ dspace.install_ram(0x54000, 0x57fff, 0, memptr + 0xc000);
/* <5>8000 */
- dspace.install_readwrite_bank(0x58000, 0x5bfff, 0, "dram0_10000");
+ dspace.install_ram(0x58000, 0x5bfff, 0, memptr + 0x10000);
/* <5>c000 expansion bus */
/* <6>0000 */
- pspace.install_readwrite_bank(0x60000, 0x63fff, 0, "dram0_8000");
- dspace.install_readwrite_bank(0x60000, 0x63fff, 0, "dram0_8000");
+ pspace.install_ram(0x60000, 0x63fff, 0, memptr + 0x8000);
+ dspace.install_ram(0x60000, 0x63fff, 0, memptr + 0x8000);
/* <6>4000 */
- pspace.install_readwrite_bank(0x64000, 0x67fff, 0, "dram0_c000");
- dspace.install_readwrite_bank(0x64000, 0x67fff, 0, "dram0_c000");
+ pspace.install_ram(0x64000, 0x67fff, 0, memptr + 0xc000);
+ dspace.install_ram(0x64000, 0x67fff, 0, memptr + 0xc000);
/* <6>8000 */
- pspace.install_readwrite_bank(0x68000, 0x6bfff, 0, "dram0_10000");
- dspace.install_readwrite_bank(0x68000, 0x6bfff, 0, "dram0_10000");
+ pspace.install_ram(0x68000, 0x6bfff, 0, memptr + 0x10000);
+ dspace.install_ram(0x68000, 0x6bfff, 0, memptr + 0x10000);
/* <6>c000 empty*/
/* segment <7> expansion ROM? */
/* <8>0000 */
- pspace.install_readwrite_bank(0x80000, 0x83fff, 0, "dram0_8000");
- dspace.install_readwrite_bank(0x80000, 0x83fff, 0, "dram0_18000");
+ pspace.install_ram(0x80000, 0x83fff, 0, memptr + 0x8000);
+ dspace.install_ram(0x80000, 0x83fff, 0, memptr + 0x18000);
/* <8>4000 */
- pspace.install_readwrite_bank(0x84000, 0x87fff, 0, "dram0_c000");
- dspace.install_readwrite_bank(0x84000, 0x87fff, 0, "dram0_1c000");
+ pspace.install_ram(0x84000, 0x87fff, 0, memptr + 0xc000);
+ dspace.install_ram(0x84000, 0x87fff, 0, memptr + 0x1c000);
/* <9>0000 */
- pspace.install_readwrite_bank(0x90000, 0x93fff, 0, "dram0_18000");
- dspace.install_readwrite_bank(0x90000, 0x93fff, 0, "dram0_18000");
+ pspace.install_ram(0x90000, 0x93fff, 0, memptr + 0x18000);
+ dspace.install_ram(0x90000, 0x93fff, 0, memptr + 0x18000);
/* <9>4000 */
- pspace.install_readwrite_bank(0x94000, 0x97fff, 0, "dram0_1c000");
- dspace.install_readwrite_bank(0x94000, 0x97fff, 0, "dram0_1c000");
+ pspace.install_ram(0x94000, 0x97fff, 0, memptr + 0x1c000);
+ dspace.install_ram(0x94000, 0x97fff, 0, memptr + 0x1c000);
/* <A>0000 */
- pspace.install_readwrite_bank(0xa0000, 0xa3fff, 0, "dram0_8000");
- dspace.install_readwrite_bank(0xa0000, 0xa3fff, 0, "dram0_8000");
+ pspace.install_ram(0xa0000, 0xa3fff, 0, memptr + 0x8000);
+ dspace.install_ram(0xa0000, 0xa3fff, 0, memptr + 0x8000);
/* <A>4000 */
- pspace.install_readwrite_bank(0xa4000, 0xa7fff, 0, "dram0_c000");
- dspace.install_readwrite_bank(0xa4000, 0xa7fff, 0, "dram0_c000");
-
- //membank("dram0_0000")->set_base(memptr);
- membank("dram0_4000")->set_base(memptr + 0x4000);
- membank("dram0_8000")->set_base(memptr + 0x8000);
- membank("dram0_c000")->set_base(memptr + 0xc000);
- membank("dram0_10000")->set_base(memptr + 0x10000);
- membank("dram0_14000")->set_base(memptr + 0x14000);
- membank("dram0_18000")->set_base(memptr + 0x18000);
- membank("dram0_1c000")->set_base(memptr + 0x1c000);
+ pspace.install_ram(0xa4000, 0xa7fff, 0, memptr + 0xc000);
+ dspace.install_ram(0xa4000, 0xa7fff, 0, memptr + 0xc000);
if (m_memsize > 128 * 1024) {
/* install memory expansions (DRAM1..DRAM3) */
@@ -440,9 +431,9 @@ void m20_state::install_memory()
map( 0x88000, 0x8bfff ).ram().share("dram1_4000");
map( 0xa8000, 0xabfff ).ram().share("dram1_4000");
*/
- pspace.install_readwrite_bank(0x2c000, 0x2ffff, 0, "dram1_0000");
- pspace.install_readwrite_bank(0x88000, 0x8bfff, 0, "dram1_4000");
- pspace.install_readwrite_bank(0xa8000, 0xabfff, 0, "dram1_4000");
+ pspace.install_ram(0x2c000, 0x2ffff, 0, memptr + 0x20000);
+ pspace.install_ram(0x88000, 0x8bfff, 0, memptr + 0x24000);
+ pspace.install_ram(0xa8000, 0xabfff, 0, memptr + 0x24000);
/*
data
@@ -451,13 +442,10 @@ void m20_state::install_memory()
map( 0x2c000, 0x2ffff ).ram().share("dram1_0000");
map( 0xa8000, 0xabfff ).ram().share("dram1_4000");
*/
- dspace.install_readwrite_bank(0x4000, 0x7fff, 0, "dram1_4000");
- dspace.install_readwrite_bank(0x1c000, 0x1ffff, 0, "dram1_0000");
- dspace.install_readwrite_bank(0x2c000, 0x2ffff, 0, "dram1_0000");
- dspace.install_readwrite_bank(0xa8000, 0xabfff, 0, "dram1_4000");
-
- membank("dram1_0000")->set_base(memptr + 0x20000);
- membank("dram1_4000")->set_base(memptr + 0x24000);
+ dspace.install_ram(0x4000, 0x7fff, 0, memptr + 0x24000);
+ dspace.install_ram(0x1c000, 0x1ffff, 0, memptr + 0x20000);
+ dspace.install_ram(0x2c000, 0x2ffff, 0, memptr + 0x20000);
+ dspace.install_ram(0xa8000, 0xabfff, 0, memptr + 0x24000);
if (m_memsize > 128 * 1024 + 32768) {
/* DRAM2, 32K */
@@ -467,9 +455,9 @@ void m20_state::install_memory()
map( 0x98000, 0x9bfff ).ram().share("dram2_4000");
map( 0xac000, 0xaffff ).ram().share("dram2_0000");
*/
- pspace.install_readwrite_bank(0x8c000, 0x8ffff, 0, "dram2_0000");
- pspace.install_readwrite_bank(0x98000, 0x9bfff, 0, "dram2_4000");
- pspace.install_readwrite_bank(0xac000, 0xaffff, 0, "dram2_0000");
+ pspace.install_ram(0x8c000, 0x8ffff, 0, memptr + 0x28000);
+ pspace.install_ram(0x98000, 0x9bfff, 0, memptr + 0x2c000);
+ pspace.install_ram(0xac000, 0xaffff, 0, memptr + 0x28000);
/* data
map( 0x08000, 0x0bfff ).ram().share("dram2_0000");
@@ -478,14 +466,11 @@ void m20_state::install_memory()
map( 0x98000, 0x9bfff ).ram().share("dram2_4000");
map( 0xac000, 0xaffff ).ram().share("dram2_0000");
*/
- dspace.install_readwrite_bank(0x8000, 0xbfff, 0, "dram2_0000");
- dspace.install_readwrite_bank(0xc000, 0xffff, 0, "dram2_4000");
- dspace.install_readwrite_bank(0x88000, 0x8bfff, 0, "dram2_4000");
- dspace.install_readwrite_bank(0x98000, 0x9bfff, 0, "dram2_4000");
- dspace.install_readwrite_bank(0xac000, 0xaffff, 0, "dram2_0000");
-
- membank("dram2_0000")->set_base(memptr + 0x28000);
- membank("dram2_4000")->set_base(memptr + 0x2c000);
+ dspace.install_ram(0x8000, 0xbfff, 0, memptr + 0x28000);
+ dspace.install_ram(0xc000, 0xffff, 0, memptr + 0x2c000);
+ dspace.install_ram(0x88000, 0x8bfff, 0, memptr + 0x2c000);
+ dspace.install_ram(0x98000, 0x9bfff, 0, memptr + 0x2c000);
+ dspace.install_ram(0xac000, 0xaffff, 0, memptr + 0x28000);
}
if (m_memsize > 128 * 1024 + 2 * 32768) {
/* DRAM3, 32K */
@@ -494,8 +479,8 @@ void m20_state::install_memory()
map( 0x9c000, 0x9ffff ).ram().share("dram3_0000");
map( 0xb0000, 0xb3fff ).ram().share("dram3_4000");
*/
- pspace.install_readwrite_bank(0x9c000, 0x9ffff, 0, "dram3_0000");
- pspace.install_readwrite_bank(0xb0000, 0xb3fff, 0, "dram3_4000");
+ pspace.install_ram(0x9c000, 0x9ffff, 0, memptr + 0x30000);
+ pspace.install_ram(0xb0000, 0xb3fff, 0, memptr + 0x34000);
/* data
map( 0x44000, 0x47fff ).ram().share("dram3_0000");
@@ -505,15 +490,12 @@ void m20_state::install_memory()
map( 0xb0000, 0xb3fff ).ram().share("dram3_4000");
map( 0xc0000, 0xc3fff ).ram().share("dram3_4000");
*/
- dspace.install_readwrite_bank(0x44000, 0x47fff, 0, "dram3_0000");
- dspace.install_readwrite_bank(0x48000, 0x4bfff, 0, "dram3_4000");
- dspace.install_readwrite_bank(0x8c000, 0x8ffff, 0, "dram3_0000");
- dspace.install_readwrite_bank(0x9c000, 0x9ffff, 0, "dram3_0000");
- dspace.install_readwrite_bank(0xb0000, 0xb3fff, 0, "dram3_4000");
- dspace.install_readwrite_bank(0xc0000, 0xc3fff, 0, "dram3_4000");
-
- membank("dram3_0000")->set_base(memptr + 0x30000);
- membank("dram3_4000")->set_base(memptr + 0x34000);
+ dspace.install_ram(0x44000, 0x47fff, 0, memptr + 0x30000);
+ dspace.install_ram(0x48000, 0x4bfff, 0, memptr + 0x34000);
+ dspace.install_ram(0x8c000, 0x8ffff, 0, memptr + 0x30000);
+ dspace.install_ram(0x9c000, 0x9ffff, 0, memptr + 0x30000);
+ dspace.install_ram(0xb0000, 0xb3fff, 0, memptr + 0x34000);
+ dspace.install_ram(0xc0000, 0xc3fff, 0, memptr + 0x34000);
}
}
else {
@@ -533,16 +515,16 @@ void m20_state::install_memory()
map( 0xb4000, 0xb7fff ).ram().share("dram1_18000");
map( 0xb8000, 0xbbfff ).ram().share("dram1_1c000");
*/
- pspace.install_readwrite_bank(0x2c000, 0x2ffff, 0, "dram1_0000");
- pspace.install_readwrite_bank(0x88000, 0x8bfff, 0, "dram1_4000");
- pspace.install_readwrite_bank(0x8c000, 0x8ffff, 0, "dram1_8000");
- pspace.install_readwrite_bank(0x98000, 0x9bfff, 0, "dram1_c000");
- pspace.install_readwrite_bank(0x9c000, 0x9ffff, 0, "dram1_10000");
- pspace.install_readwrite_bank(0xa8000, 0xabfff, 0, "dram1_4000");
- pspace.install_readwrite_bank(0xac000, 0xaffff, 0, "dram1_8000");
- pspace.install_readwrite_bank(0xb0000, 0xb3fff, 0, "dram1_14000");
- pspace.install_readwrite_bank(0xb4000, 0xb7fff, 0, "dram1_18000");
- pspace.install_readwrite_bank(0xb8000, 0xbbfff, 0, "dram1_1c000");
+ pspace.install_ram(0x2c000, 0x2ffff, 0, memptr + 0x20000);
+ pspace.install_ram(0x88000, 0x8bfff, 0, memptr + 0x24000);
+ pspace.install_ram(0x8c000, 0x8ffff, 0, memptr + 0x28000);
+ pspace.install_ram(0x98000, 0x9bfff, 0, memptr + 0x2c000);
+ pspace.install_ram(0x9c000, 0x9ffff, 0, memptr + 0x30000);
+ pspace.install_ram(0xa8000, 0xabfff, 0, memptr + 0x24000);
+ pspace.install_ram(0xac000, 0xaffff, 0, memptr + 0x28000);
+ pspace.install_ram(0xb0000, 0xb3fff, 0, memptr + 0x34000);
+ pspace.install_ram(0xb4000, 0xb7fff, 0, memptr + 0x38000);
+ pspace.install_ram(0xb8000, 0xbbfff, 0, memptr + 0x3c000);
/* data
map( 0x04000, 0x07fff ).ram().share("dram1_4000");
@@ -558,27 +540,18 @@ void m20_state::install_memory()
map( 0xb4000, 0xb7fff ).ram().share("dram1_18000");
map( 0xb8000, 0xbbfff ).ram().share("dram1_1c000");
*/
- dspace.install_readwrite_bank(0x4000, 0x7fff, 0, "dram1_4000");
- dspace.install_readwrite_bank(0x1c000, 0x1ffff, 0, "dram1_0000");
- dspace.install_readwrite_bank(0x2c000, 0x2ffff, 0, "dram1_0000");
- dspace.install_readwrite_bank(0x88000, 0x8bfff, 0, "dram1_c000");
- dspace.install_readwrite_bank(0x8c000, 0x8ffff, 0, "dram1_10000");
- dspace.install_readwrite_bank(0x98000, 0x9bfff, 0, "dram1_c000");
- dspace.install_readwrite_bank(0x9c000, 0x9ffff, 0, "dram1_10000");
- dspace.install_readwrite_bank(0xa8000, 0xabfff, 0, "dram1_4000");
- dspace.install_readwrite_bank(0xac000, 0xaffff, 0, "dram1_8000");
- dspace.install_readwrite_bank(0xb0000, 0xb3fff, 0, "dram1_14000");
- dspace.install_readwrite_bank(0xb4000, 0xb7fff, 0, "dram1_18000");
- dspace.install_readwrite_bank(0xb8000, 0xbbfff, 0, "dram1_1c000");
-
- membank("dram1_0000")->set_base(memptr + 0x20000);
- membank("dram1_4000")->set_base(memptr + 0x24000);
- membank("dram1_8000")->set_base(memptr + 0x28000);
- membank("dram1_c000")->set_base(memptr + 0x2c000);
- membank("dram1_10000")->set_base(memptr + 0x30000);
- membank("dram1_14000")->set_base(memptr + 0x34000);
- membank("dram1_18000")->set_base(memptr + 0x38000);
- membank("dram1_1c000")->set_base(memptr + 0x3c000);
+ dspace.install_ram(0x4000, 0x7fff, 0, memptr + 0x24000);
+ dspace.install_ram(0x1c000, 0x1ffff, 0, memptr + 0x20000);
+ dspace.install_ram(0x2c000, 0x2ffff, 0, memptr + 0x20000);
+ dspace.install_ram(0x88000, 0x8bfff, 0, memptr + 0x2c000);
+ dspace.install_ram(0x8c000, 0x8ffff, 0, memptr + 0x30000);
+ dspace.install_ram(0x98000, 0x9bfff, 0, memptr + 0x2c000);
+ dspace.install_ram(0x9c000, 0x9ffff, 0, memptr + 0x30000);
+ dspace.install_ram(0xa8000, 0xabfff, 0, memptr + 0x24000);
+ dspace.install_ram(0xac000, 0xaffff, 0, memptr + 0x28000);
+ dspace.install_ram(0xb0000, 0xb3fff, 0, memptr + 0x34000);
+ dspace.install_ram(0xb4000, 0xb7fff, 0, memptr + 0x38000);
+ dspace.install_ram(0xb8000, 0xbbfff, 0, memptr + 0x3c000);
if (m_memsize > 256 * 1024) {
/* DRAM2, 128K */
@@ -595,14 +568,14 @@ void m20_state::install_memory()
map( 0xd4000, 0xd7fff ).ram().share("dram2_18000");
map( 0xd8000, 0xdbfff ).ram().share("dram2_1c000");
*/
- pspace.install_readwrite_bank(0xbc000, 0xbffff, 0, "dram2_0000");
- pspace.install_readwrite_bank(0xc0000, 0xc3fff, 0, "dram2_4000");
- pspace.install_readwrite_bank(0xc4000, 0xc7fff, 0, "dram2_8000");
- pspace.install_readwrite_bank(0xc8000, 0xcbfff, 0, "dram2_c000");
- pspace.install_readwrite_bank(0xcc000, 0xcffff, 0, "dram2_10000");
- pspace.install_readwrite_bank(0xd0000, 0xd3fff, 0, "dram2_14000");
- pspace.install_readwrite_bank(0xd4000, 0xd7fff, 0, "dram2_18000");
- pspace.install_readwrite_bank(0xd8000, 0xdbfff, 0, "dram2_1c000");
+ pspace.install_ram(0xbc000, 0xbffff, 0, memptr + 0x40000);
+ pspace.install_ram(0xc0000, 0xc3fff, 0, memptr + 0x44000);
+ pspace.install_ram(0xc4000, 0xc7fff, 0, memptr + 0x48000);
+ pspace.install_ram(0xc8000, 0xcbfff, 0, memptr + 0x4c000);
+ pspace.install_ram(0xcc000, 0xcffff, 0, memptr + 0x50000);
+ pspace.install_ram(0xd0000, 0xd3fff, 0, memptr + 0x54000);
+ pspace.install_ram(0xd4000, 0xd7fff, 0, memptr + 0x58000);
+ pspace.install_ram(0xd8000, 0xdbfff, 0, memptr + 0x5c000);
/* data
map( 0x08000, 0x0bfff ).ram().share("dram2_0000");
@@ -619,25 +592,16 @@ void m20_state::install_memory()
map( 0xd4000, 0xd7fff ).ram().share("dram2_18000");
map( 0xd8000, 0xdbfff ).ram().share("dram2_1c000");
*/
- dspace.install_readwrite_bank(0x8000, 0xbfff, 0, "dram2_0000");
- dspace.install_readwrite_bank(0xc000, 0xffff, 0, "dram2_4000");
- dspace.install_readwrite_bank(0xbc000, 0xbffff, 0, "dram2_0000");
- dspace.install_readwrite_bank(0xc0000, 0xc3fff, 0, "dram2_4000");
- dspace.install_readwrite_bank(0xc4000, 0xc7fff, 0, "dram2_8000");
- dspace.install_readwrite_bank(0xc8000, 0xcbfff, 0, "dram2_c000");
- dspace.install_readwrite_bank(0xcc000, 0xcffff, 0, "dram2_10000");
- dspace.install_readwrite_bank(0xd0000, 0xd3fff, 0, "dram2_14000");
- dspace.install_readwrite_bank(0xd4000, 0xd7fff, 0, "dram2_18000");
- dspace.install_readwrite_bank(0xd8000, 0xdbfff, 0, "dram2_1c000");
-
- membank("dram2_0000")->set_base(memptr + 0x40000);
- membank("dram2_4000")->set_base(memptr + 0x44000);
- membank("dram2_8000")->set_base(memptr + 0x48000);
- membank("dram2_c000")->set_base(memptr + 0x4c000);
- membank("dram2_10000")->set_base(memptr + 0x50000);
- membank("dram2_14000")->set_base(memptr + 0x54000);
- membank("dram2_18000")->set_base(memptr + 0x58000);
- membank("dram2_1c000")->set_base(memptr + 0x5c000);
+ dspace.install_ram(0x8000, 0xbfff, 0, memptr + 0x40000);
+ dspace.install_ram(0xc000, 0xffff, 0, memptr + 0x44000);
+ dspace.install_ram(0xbc000, 0xbffff, 0, memptr + 0x40000);
+ dspace.install_ram(0xc0000, 0xc3fff, 0, memptr + 0x44000);
+ dspace.install_ram(0xc4000, 0xc7fff, 0, memptr + 0x48000);
+ dspace.install_ram(0xc8000, 0xcbfff, 0, memptr + 0x4c000);
+ dspace.install_ram(0xcc000, 0xcffff, 0, memptr + 0x50000);
+ dspace.install_ram(0xd0000, 0xd3fff, 0, memptr + 0x54000);
+ dspace.install_ram(0xd4000, 0xd7fff, 0, memptr + 0x58000);
+ dspace.install_ram(0xd8000, 0xdbfff, 0, memptr + 0x5c000);
}
if (m_memsize > 384 * 1024) {
/* DRAM3, 128K */
@@ -655,15 +619,15 @@ void m20_state::install_memory()
map( 0xf8000, 0xfbfff ).ram().share("dram3_1c000");
map( 0xfc000, 0xfffff ).ram().share("dram3_0000");
*/
- pspace.install_readwrite_bank(0xdc000, 0xdffff, 0, "dram3_0000");
- pspace.install_readwrite_bank(0xe0000, 0xe3fff, 0, "dram3_4000");
- pspace.install_readwrite_bank(0xe4000, 0xe7fff, 0, "dram3_8000");
- pspace.install_readwrite_bank(0xe8000, 0xebfff, 0, "dram3_c000");
- pspace.install_readwrite_bank(0xec000, 0xeffff, 0, "dram3_10000");
- pspace.install_readwrite_bank(0xf0000, 0xf3fff, 0, "dram3_14000");
- pspace.install_readwrite_bank(0xf4000, 0xf7fff, 0, "dram3_18000");
- pspace.install_readwrite_bank(0xf8000, 0xfbfff, 0, "dram3_1c000");
- pspace.install_readwrite_bank(0xfc000, 0xfffff, 0, "dram3_0000");
+ pspace.install_ram(0xdc000, 0xdffff, 0, memptr + 0x60000);
+ pspace.install_ram(0xe0000, 0xe3fff, 0, memptr + 0x64000);
+ pspace.install_ram(0xe4000, 0xe7fff, 0, memptr + 0x68000);
+ pspace.install_ram(0xe8000, 0xebfff, 0, memptr + 0x6c000);
+ pspace.install_ram(0xec000, 0xeffff, 0, memptr + 0x70000);
+ pspace.install_ram(0xf0000, 0xf3fff, 0, memptr + 0x74000);
+ pspace.install_ram(0xf4000, 0xf7fff, 0, memptr + 0x78000);
+ pspace.install_ram(0xf8000, 0xfbfff, 0, memptr + 0x7c000);
+ pspace.install_ram(0xfc000, 0xfffff, 0, memptr + 0x60000);
/* data
map( 0x44000, 0x47fff ).ram().share("dram3_0000");
@@ -680,26 +644,17 @@ void m20_state::install_memory()
map( 0xf8000, 0xfbfff ).ram().share("dram3_1c000");
map( 0xfc000, 0xfffff ).ram().share("dram3_0000");
*/
- dspace.install_readwrite_bank(0x44000, 0x47fff, 0, "dram3_0000");
- dspace.install_readwrite_bank(0x48000, 0x4bfff,