summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Aaron Giles <aaron@aarongiles.com>2012-09-17 07:43:37 +0000
committerGravatarGravatar Aaron Giles <aaron@aarongiles.com>2012-09-17 07:43:37 +0000
commitcc16777cce9c5a2cac9d88c595b6b5f4ee70a2ea (patch) (github)
tree496c31635729f6af1e37f3337b50e91b1f9fde97
parente25c13f2532730ebf50d0cffa0147393fd8e0228 (diff)
downloadmame-cc16777cce9c5a2cac9d88c595b6b5f4ee70a2ea.tar.bz2
mame-cc16777cce9c5a2cac9d88c595b6b5f4ee70a2ea.zip
Memory handler normalization, part 1.
READ/WRITE_DEVICE*_HANDLERs are now passed an address_space &, and the 8-bit variants get a mem_mask as well. This means they are now directly compatible with the member function delegates. Added a generic address space to the driver_device that can be used when no specific address space is available. Also added DECLARE_READ/WRITE_DEVICE*_HANDLER macros to declare device callbacks with default mem_mask parameters. [Aaron Giles]
-rw-r--r--src/emu/addrmap.c140
-rw-r--r--src/emu/addrmap.h69
-rw-r--r--src/emu/cpu/arm7/arm7.c6
-rw-r--r--src/emu/cpu/arm7/arm7ops.c6
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.h8
-rw-r--r--src/emu/cpu/esrip/esrip.c6
-rw-r--r--src/emu/cpu/m68000/68307ser.c4
-rw-r--r--src/emu/cpu/powerpc/ppccom.c4
-rw-r--r--src/emu/cpu/rsp/rspdrc.c8
-rw-r--r--src/emu/cpu/tms0980/tms0980.c10
-rw-r--r--src/emu/devcb.c68
-rw-r--r--src/emu/devcb.h20
-rw-r--r--src/emu/devconv.h208
-rw-r--r--src/emu/dimemory.c4
-rw-r--r--src/emu/driver.c13
-rw-r--r--src/emu/driver.h15
-rw-r--r--src/emu/imagedev/flopdrv.h2
-rw-r--r--src/emu/machine/6525tpi.h16
-rw-r--r--src/emu/machine/6526cia.h8
-rw-r--r--src/emu/machine/6532riot.h4
-rw-r--r--src/emu/machine/68681.h4
-rw-r--r--src/emu/machine/74123.c7
-rw-r--r--src/emu/machine/74123.h11
-rw-r--r--src/emu/machine/8237dma.h4
-rw-r--r--src/emu/machine/8257dma.h4
-rw-r--r--src/emu/machine/adc1213x.h12
-rw-r--r--src/emu/machine/at28c16.h4
-rw-r--r--src/emu/machine/ds2404.h10
-rw-r--r--src/emu/machine/f3853.h4
-rw-r--r--src/emu/machine/i8243.h6
-rw-r--r--src/emu/machine/idectrl.h18
-rw-r--r--src/emu/machine/ins8154.h8
-rw-r--r--src/emu/machine/k033906.h4
-rw-r--r--src/emu/machine/k053252.h4
-rw-r--r--src/emu/machine/k056230.h8
-rw-r--r--src/emu/machine/latch8.c6
-rw-r--r--src/emu/machine/latch8.h54
-rw-r--r--src/emu/machine/mb14241.h6
-rw-r--r--src/emu/machine/pd4990a.h6
-rw-r--r--src/emu/machine/pic8259.h4
-rw-r--r--src/emu/machine/pit8253.h4
-rw-r--r--src/emu/machine/rp5h01.h14
-rw-r--r--src/emu/machine/s3c2410.h2
-rw-r--r--src/emu/machine/s3c24xx.c12
-rw-r--r--src/emu/machine/smc91c9x.h4
-rw-r--r--src/emu/machine/timekpr.h4
-rw-r--r--src/emu/machine/tms6100.h2
-rw-r--r--src/emu/machine/upd4701.h24
-rw-r--r--src/emu/machine/wd17xx.c16
-rw-r--r--src/emu/machine/wd17xx.h24
-rw-r--r--src/emu/machine/z80dart.c12
-rw-r--r--src/emu/machine/z80dart.h16
-rw-r--r--src/emu/machine/z80dma.h4
-rw-r--r--src/emu/machine/z80sio.c42
-rw-r--r--src/emu/machine/z80sio.h20
-rw-r--r--src/emu/machine/z80sti.h4
-rw-r--r--src/emu/memory.c23
-rw-r--r--src/emu/memory.h41
-rw-r--r--src/emu/sound/2151intf.c6
-rw-r--r--src/emu/sound/2151intf.h10
-rw-r--r--src/emu/sound/2203intf.c8
-rw-r--r--src/emu/sound/2203intf.h12
-rw-r--r--src/emu/sound/2413intf.c4
-rw-r--r--src/emu/sound/2413intf.h6
-rw-r--r--src/emu/sound/2608intf.c16
-rw-r--r--src/emu/sound/2608intf.h18
-rw-r--r--src/emu/sound/2610intf.c16
-rw-r--r--src/emu/sound/2610intf.h18
-rw-r--r--src/emu/sound/2612intf.c18
-rw-r--r--src/emu/sound/2612intf.h24
-rw-r--r--src/emu/sound/262intf.c10
-rw-r--r--src/emu/sound/262intf.h16
-rw-r--r--src/emu/sound/3526intf.c8
-rw-r--r--src/emu/sound/3526intf.h12
-rw-r--r--src/emu/sound/3812intf.c8
-rw-r--r--src/emu/sound/3812intf.h12
-rw-r--r--src/emu/sound/8950intf.c42
-rw-r--r--src/emu/sound/8950intf.h29
-rw-r--r--src/emu/sound/aica.c20
-rw-r--r--src/emu/sound/aica.h8
-rw-r--r--src/emu/sound/astrocde.h2
-rw-r--r--src/emu/sound/ay8910.c12
-rw-r--r--src/emu/sound/ay8910.h16
-rw-r--r--src/emu/sound/c140.h4
-rw-r--r--src/emu/sound/c6280.h4
-rw-r--r--src/emu/sound/digitalk.h2
-rw-r--r--src/emu/sound/discrete.h4
-rw-r--r--src/emu/sound/es5506.h8
-rw-r--r--src/emu/sound/es8712.h2
-rw-r--r--src/emu/sound/gaelco.h4
-rw-r--r--src/emu/sound/ics2115.h4
-rw-r--r--src/emu/sound/iremga20.h4
-rw-r--r--src/emu/sound/k005289.h12
-rw-r--r--src/emu/sound/k007232.h4
-rw-r--r--src/emu/sound/k051649.c2
-rw-r--r--src/emu/sound/k051649.h20
-rw-r--r--src/emu/sound/k053260.h4
-rw-r--r--src/emu/sound/k056800.h8
-rw-r--r--src/emu/sound/msm5232.c12
-rw-r--r--src/emu/sound/msm5232.h4
-rw-r--r--src/emu/sound/multipcm.h4
-rw-r--r--src/emu/sound/n63701x.h2
-rw-r--r--src/emu/sound/namco.c6
-rw-r--r--src/emu/sound/namco.h16
-rw-r--r--src/emu/sound/nes_apu.h4
-rw-r--r--src/emu/sound/nile.h8
-rw-r--r--src/emu/sound/okim6258.h6
-rw-r--r--src/emu/sound/okim6376.h4
-rw-r--r--src/emu/sound/qsound.h4
-rw-r--r--src/emu/sound/rf5c400.h4
-rw-r--r--src/emu/sound/rf5c68.h8
-rw-r--r--src/emu/sound/saa1099.h4
-rw-r--r--src/emu/sound/scsp.c35
-rw-r--r--src/emu/sound/scsp.h8
-rw-r--r--src/emu/sound/segapcm.h4
-rw-r--r--src/emu/sound/sn76496.h4
-rw-r--r--src/emu/sound/snkwave.h2
-rw-r--r--src/emu/sound/sp0250.h2
-rw-r--r--src/emu/sound/sp0256.c2
-rw-r--r--src/emu/sound/sp0256.h6
-rw-r--r--src/emu/sound/st0016.h4
-rw-r--r--src/emu/sound/t6w28.h2
-rw-r--r--src/emu/sound/tiaintf.h2
-rw-r--r--src/emu/sound/tms5110.h12
-rw-r--r--src/emu/sound/tms5220.h4
-rw-r--r--src/emu/sound/upd7759.h2
-rw-r--r--src/emu/sound/vlm5030.h2
-rw-r--r--src/emu/sound/vrender0.h4
-rw-r--r--src/emu/sound/x1_010.c4
-rw-r--r--src/emu/sound/x1_010.h8
-rw-r--r--src/emu/sound/ym2151.c4
-rw-r--r--src/emu/sound/ym2151.h2
-rw-r--r--src/emu/sound/ymf271.h4
-rw-r--r--src/emu/sound/ymf278b.h4
-rw-r--r--src/emu/sound/ymz280b.h4
-rw-r--r--src/emu/sound/zsg2.h4
-rw-r--r--src/emu/video/hd63484.h18
-rw-r--r--src/emu/video/i8275.h6
-rw-r--r--src/emu/video/pc_vga.h4
-rw-r--r--src/emu/video/s2636.h4
-rw-r--r--src/emu/video/tlc34076.h4
-rw-r--r--src/emu/video/tms9927.c10
-rw-r--r--src/emu/video/tms9927.h4
-rw-r--r--src/emu/video/voodoo.c24
-rw-r--r--src/emu/video/voodoo.h20
-rw-r--r--src/mame/audio/8080bw.c30
-rw-r--r--src/mame/audio/asteroid.c14
-rw-r--r--src/mame/audio/atarijsa.c2
-rw-r--r--src/mame/audio/avalnche.c10
-rw-r--r--src/mame/audio/blockade.c2
-rw-r--r--src/mame/audio/bsktball.c8
-rw-r--r--src/mame/audio/bzone.c2
-rw-r--r--src/mame/audio/canyon.c8
-rw-r--r--src/mame/audio/carnival.c4
-rw-r--r--src/mame/audio/circus.c14
-rw-r--r--src/mame/audio/copsnrob.c14
-rw-r--r--src/mame/audio/crbaloon.c6
-rw-r--r--src/mame/audio/dkong.c9
-rw-r--r--src/mame/audio/exidy.c6
-rw-r--r--src/mame/audio/exidy.h12
-rw-r--r--src/mame/audio/firetrk.c16
-rw-r--r--src/mame/audio/galaxian.c20
-rw-r--r--src/mame/audio/galaxian.h14
-rw-r--r--src/mame/audio/gottlieb.c10
-rw-r--r--src/mame/audio/hyprolyb.h4
-rw-r--r--src/mame/audio/irem.c12
-rw-r--r--src/mame/audio/jedi.c2
-rw-r--r--src/mame/audio/leland.c44
-rw-r--r--src/mame/audio/llander.c10
-rw-r--r--src/mame/audio/m72.h18
-rw-r--r--src/mame/audio/m79amb.c16
-rw-r--r--src/mame/audio/mario.c8
-rw-r--r--src/mame/audio/micro3d.c2
-rw-r--r--src/mame/audio/midway.c4
-rw-r--r--src/mame/audio/mw8080bw.c167
-rw-r--r--src/mame/audio/namco52.c2
-rw-r--r--src/mame/audio/namco52.h2
-rw-r--r--src/mame/audio/namco54.c6
-rw-r--r--src/mame/audio/namco54.h2
-rw-r--r--src/mame/audio/orbit.c12
-rw-r--r--src/mame/audio/phoenix.c14
-rw-r--r--src/mame/audio/pleiads.h6
-rw-r--r--src/mame/audio/poolshrk.c8
-rw-r--r--src/mame/audio/qix.c4
-rw-r--r--src/mame/audio/redalert.c16
-rw-r--r--src/mame/audio/scramble.c6
-rw-r--r--src/mame/audio/segag80r.c18
-rw-r--r--src/mame/audio/segasnd.h12
-rw-r--r--src/mame/audio/seibu.h4
-rw-r--r--src/mame/audio/skyraid.c10
-rw-r--r--src/mame/audio/snes_snd.c6
-rw-r--r--src/mame/audio/snes_snd.h12
-rw-r--r--src/mame/audio/snk6502.c2
-rw-r--r--src/mame/audio/spiders.c14
-rw-r--r--src/mame/audio/sprint8.c8
-rw-r--r--src/mame/audio/subs.c10
-rw-r--r--src/mame/audio/taitosnd.h12
-rw-r--r--src/mame/audio/trackfld.h8
-rw-r--r--src/mame/audio/vicdual.c40
-rw-r--r--src/mame/audio/wiping.h2
-rw-r--r--src/mame/drivers/40love.c3
-rw-r--r--src/mame/drivers/4enraya.c2
-rw-r--r--src/mame/drivers/5clown.c4
-rw-r--r--src/mame/drivers/88games.c22
-rw-r--r--src/mame/drivers/aliens.c14
-rw-r--r--src/mame/drivers/amspdwy.c2
-rw-r--r--src/mame/drivers/aristmk4.c12
-rw-r--r--src/mame/drivers/asterix.c2
-rw-r--r--src/mame/drivers/atarisy1.c4
-rw-r--r--src/mame/drivers/atarisy2.c2
-rw-r--r--src/mame/drivers/bagman.c6
-rw-r--r--src/mame/drivers/berzerk.c6
-rw-r--r--src/mame/drivers/bfcobra.c2
-rw-r--r--src/mame/drivers/bfm_sc1.c2
-rw-r--r--src/mame/drivers/bfm_sc2.c2
-rw-r--r--src/mame/drivers/bfm_sc4h.c12
-rw-r--r--src/mame/drivers/bigevglf.c3
-rw-r--r--src/mame/drivers/bishi.c2
-rw-r--r--src/mame/drivers/blockhl.c14
-rw-r--r--src/mame/drivers/bogeyman.c4
-rw-r--r--src/mame/drivers/bottom9.c20
-rw-r--r--src/mame/drivers/buggychl.c3
-rw-r--r--src/mame/drivers/bzone.c2
-rw-r--r--src/mame/drivers/calchase.c12
-rw-r--r--src/mame/drivers/cd32.c2
-rw-r--r--src/mame/drivers/centiped.c8
-rw-r--r--src/mame/drivers/cham24.c6
-rw-r--r--src/mame/drivers/cidelsa.c6
-rw-r--r--src/mame/drivers/circusc.c6
-rw-r--r--src/mame/drivers/cliffhgr.c4
-rw-r--r--src/mame/drivers/cninja.c4
-rw-r--r--src/mame/drivers/contra.c3
-rw-r--r--src/mame/drivers/crbaloon.c10
-rw-r--r--src/mame/drivers/crimfght.c14
-rw-r--r--src/mame/drivers/cubeqst.c8
-rw-r--r--src/mame/drivers/cvs.c18
-rw-r--r--src/mame/drivers/cybertnk.c7
-rw-r--r--src/mame/drivers/dambustr.c2
-rw-r--r--src/mame/drivers/darius.c6
-rw-r--r--src/mame/drivers/dblewing.c3
-rw-r--r--src/mame/drivers/djmain.c14
-rw-r--r--src/mame/drivers/dkong.c2
-rw-r--r--src/mame/drivers/dlair.c20
-rw-r--r--src/mame/drivers/dogfgt.c4
-rw-r--r--src/mame/drivers/dragrace.c44
-rw-r--r--src/mame/drivers/drw80pkr.c4
-rw-r--r--src/mame/drivers/dynadice.c4
-rw-r--r--src/mame/drivers/dynax.c4
-rw-r--r--src/mame/drivers/equites.c4
-rw-r--r--src/mame/drivers/esripsys.c6
-rw-r--r--src/mame/drivers/ettrivia.c18
-rw-r--r--src/mame/drivers/exterm.c2
-rw-r--r--src/mame/drivers/famibox.c6
-rw-r--r--src/mame/drivers/fastlane.c15
-rw-r--r--src/mame/drivers/fgoal.c8
-rw-r--r--src/mame/drivers/firetrk.c14
-rw-r--r--src/mame/drivers/flstory.c3
-rw-r--r--src/mame/drivers/funkball.c16
-rw-r--r--src/mame/drivers/fuukifg3.c4
-rw-r--r--src/mame/drivers/gaelco3d.c6
-rw-r--r--src/mame/drivers/galaxian.c46
-rw-r--r--src/mame/drivers/gamecstl.c12
-rw-r--r--src/mame/drivers/gbusters.c14
-rw-r--r--src/mame/drivers/ghosteo.c2
-rw-r--r--src/mame/drivers/goldnpkr.c8
-rw-r--r--src/mame/drivers/gradius3.c14
-rw-r--r--src/mame/drivers/grchamp.c18
-rw-r--r--src/mame/drivers/gsword.c4
-rw-r--r--src/mame/drivers/gticlub.c12
-rw-r--r--src/mame/drivers/gyruss.c5
-rw-r--r--src/mame/drivers/highvdeo.c4
-rw-r--r--src/mame/drivers/hitme.c8
-rw-r--r--src/mame/drivers/homedata.c4
-rw-r--r--src/mame/drivers/homerun.c2
-rw-r--r--src/mame/drivers/hornet.c22
-rw-r--r--src/mame/drivers/icecold.c8
-rw-r--r--src/mame/drivers/igs011.c12
-rw-r--r--src/mame/drivers/ironhors.c6
-rw-r--r--src/mame/drivers/jpmimpct.c2
-rw-r--r--src/mame/drivers/jpmsys5.c2
-rw-r--r--src/mame/drivers/kaneko16.c20
-rw-r--r--src/mame/drivers/kinst.c8
-rw-r--r--src/mame/drivers/kncljoe.c4
-rw-r--r--src/mame/drivers/ksys573.c22
-rw-r--r--src/mame/drivers/labyrunr.c6
-rw-r--r--src/mame/drivers/ladyfrog.c3
-rw-r--r--src/mame/drivers/laserbat.c6
-rw-r--r--src/mame/drivers/lethal.c28
-rw-r--r--src/mame/drivers/m10.c16
-rw-r--r--src/mame/drivers/m63.c8
-rw-r--r--src/mame/drivers/m72.c5
-rw-r--r--src/mame/drivers/m90.c10
-rw-r--r--src/mame/drivers/madalien.c4
-rw-r--r--src/mame/drivers/mainevt.c14
-rw-r--r--src/mame/drivers/malzak.c2
-rw-r--r--src/mame/drivers/maygay1b.c2
-rw-r--r--src/mame/drivers/mcr.c2
-rw-r--r--src/mame/drivers/mediagx.c16
-rw-r--r--src/mame/drivers/mermaid.c8
-rw-r--r--src/mame/drivers/metro.c6
-rw-r--r--src/mame/drivers/mexico86.c2
-rw-r--r--src/mame/drivers/midqslvr.c12
-rw-r--r--src/mame/drivers/midzeus.c4
-rw-r--r--src/mame/drivers/mirage.c3
-rw-r--r--src/mame/drivers/mirax.c8
-rw-r--r--src/mame/drivers/mlanding.c8
-rw-r--r--src/mame/drivers/model2.c2
-rw-r--r--src/mame/drivers/model3.c2
-rw-r--r--src/mame/drivers/mpu4hw.c18
-rw-r--r--src/mame/drivers/msisaac.c3
-rw-r--r--src/mame/drivers/multfish.c12
-rw-r--r--src/mame/drivers/multigam.c6
-rw-r--r--src/mame/drivers/munchmo.c4
-rw-r--r--src/mame/drivers/mw8080bw.c26
-rw-r--r--src/mame/drivers/mystston.c4
-rw-r--r--src/mame/drivers/namcona1.c6
-rw-r--r--src/mame/drivers/namcos86.c2
-rw-r--r--src/mame/drivers/neogeo.c4
-rw-r--r--src/mame/drivers/neoprint.c4
-rw-r--r--src/mame/drivers/ninjaw.c12
-rw-r--r--src/mame/drivers/norautp.c4
-rw-r--r--src/mame/drivers/nss.c26
-rw-r--r--src/mame/drivers/nwk-tr.c10
-rw-r--r--src/mame/drivers/nycaptor.c3
-rw-r--r--src/mame/drivers/nyny.c4
-rw-r--r--src/mame/drivers/orbit.c21
-rw-r--r--src/mame/drivers/othello.c10
-rw-r--r--src/mame/drivers/othunder.c10
-rw-r--r--src/mame/drivers/overdriv.c4
-rw-r--r--src/mame/drivers/pacman.c4
-rw-r--r--src/mame/drivers/parodius.c10
-rw-r--r--src/mame/drivers/playch10.c6
-rw-r--r--src/mame/drivers/polepos.c4
-rw-r--r--src/mame/drivers/ppmast93.c2
-rw-r--r--src/mame/drivers/prehisle.c2
-rw-r--r--src/mame/drivers/proconn.c24
-rw-r--r--src/mame/drivers/qdrmfgp.c34
-rw-r--r--src/mame/drivers/queen.c12
-rw-r--r--src/mame/drivers/r2dtank.c13
-rw-r--r--src/mame/drivers/rbmk.c4
-rw-r--r--src/mame/drivers/rollerg.c6
-rw-r--r--src/mame/drivers/royalmah.c12
-rw-r--r--src/mame/drivers/rpunch.c2
-rw-r--r--src/mame/drivers/sauro.c2
-rw-r--r--src/mame/drivers/savquest.c12
-rw-r--r--src/mame/drivers/seattle.c23
-rw-r--r--src/mame/drivers/segac2.c2
-rw-r--r--src/mame/drivers/segag80r.c2
-rw-r--r--src/mame/drivers/segag80v.c2
-rw-r--r--src/mame/drivers/segas16a.c4
-rw-r--r--src/mame/drivers/segas16b.c2
-rw-r--r--src/mame/drivers/seta.c12
-rw-r--r--src/mame/drivers/sfcbox.c4
-rw-r--r--src/mame/drivers/shanghai.c25
-rw-r--r--src/mame/drivers/sigmab52.c34
-rw-r--r--src/mame/drivers/skeetsht.c8
-rw-r--r--src/mame/drivers/skydiver.c13
-rw-r--r--src/mame/drivers/slapshot.c8
-rw-r--r--src/mame/drivers/snesb.c4
-rw-r--r--src/mame/drivers/snk.c2
-rw-r--r--src/mame/drivers/snk68.c2
-rw-r--r--src/mame/drivers/spiders.c5
-rw-r--r--src/mame/drivers/sprint2.c15
-rw-r--r--src/mame/drivers/sprint4.c12
-rw-r--r--src/mame/drivers/spy.c14
-rw-r--r--src/mame/drivers/starshp1.c20
-rw-r--r--src/mame/drivers/surpratk.c4
-rw-r--r--src/mame/drivers/system1.c2
-rw-r--r--src/mame/drivers/taito_b.c8
-rw-r--r--src/mame/drivers/taito_h.c4
-rw-r--r--src/mame/drivers/taito_l.c2
-rw-r--r--src/mame/drivers/taito_z.c18
-rw-r--r--src/mame/drivers/taitogn.c4
-rw-r--r--src/mame/drivers/taitowlf.c12
-rw-r--r--src/mame/drivers/tank8.c26
-rw-r--r--src/mame/drivers/thunderx.c14
-rw-r--r--src/mame/drivers/tmnt.c30
-rw-r--r--src/mame/drivers/toaplan2.c4
-rw-r--r--src/mame/drivers/topspeed.c6
-rw-r--r--src/mame/drivers/triplhnt.c26
-rw-r--r--src/mame/drivers/uapce.c2
-rw-r--r--src/mame/drivers/ultratnk.c8
-rw-r--r--src/mame/drivers/ultrsprt.c8
-rw-r--r--src/mame/drivers/vega.c8
-rw-r--r--src/mame/drivers/vegas.c16
-rw-r--r--src/mame/drivers/vendetta.c8
-rw-r--r--src/mame/drivers/vertigo.c4
-rw-r--r--src/mame/drivers/videopin.c12
-rw-r--r--src/mame/drivers/videopkr.c6
-rw-r--r--src/mame/drivers/viper.c12
-rw-r--r--src/mame/drivers/vmetal.c2
-rw-r--r--src/mame/drivers/voyager.c12
-rw-r--r--src/mame/drivers/vsnes.c12
-rw-r--r--src/mame/drivers/warpwarp.c4
-rw-r--r--src/mame/drivers/warriorb.c10
-rw-r--r--src/mame/drivers/wecleman.c12
-rw-r--r--src/mame/drivers/wgp.c6
-rw-r--r--src/mame/drivers/wiz.c8
-rw-r--r--src/mame/drivers/xtom3d.c12
-rw-r--r--src/mame/drivers/zaccaria.c6
-rw-r--r--src/mame/drivers/zn.c9
-rw-r--r--src/mame/includes/8080bw.h8
-rw-r--r--src/mame/includes/asteroid.h14
-rw-r--r--src/mame/includes/atari.h6
-rw-r--r--src/mame/includes/avalnche.h6
-rw-r--r--src/mame/includes/beezer.h10
-rw-r--r--src/mame/includes/blockade.h2
-rw-r--r--src/mame/includes/bsktball.h6
-rw-r--r--src/mame/includes/bzone.h4
-rw-r--r--src/mame/includes/canyon.h8
-rw-r--r--src/mame/includes/cd32.h4
-rw-r--r--src/mame/includes/cps3.h4
-rw-r--r--src/mame/includes/crbaloon.h6
-rw-r--r--src/mame/includes/dc.h8
-rw-r--r--src/mame/includes/firetrk.h14
-rw-r--r--src/mame/includes/flower.h4
-rw-r--r--src/mame/includes/gaelco2.h6
-rw-r--r--src/mame/includes/gomoku.h4
-rw-r--r--src/mame/includes/gridlee.h2
-rw-r--r--src/mame/includes/hanaawas.h2
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/includes/homerun.h2
-rw-r--r--src/mame/includes/leland.h20
-rw-r--r--src/mame/includes/m79amb.h4
-rw-r--r--src/mame/includes/mario.h4
-rw-r--r--src/mame/includes/mcr.h2
-rw-r--r--src/mame/includes/megadriv.h4
-rw-r--r--src/mame/includes/micro3d.h2
-rw-r--r--src/mame/includes/mw8080bw.h50
-rw-r--r--src/mame/includes/n64.h8
-rw-r--r--src/mame/includes/orbit.h8
-rw-r--r--src/mame/includes/phoenix.h6
-rw-r--r--src/mame/includes/polepos.h4
-rw-r--r--src/mame/includes/poolshrk.h8
-rw-r--r--src/mame/includes/qix.h4
-rw-r--r--src/mame/includes/scramble.h14
-rw-r--r--src/mame/includes/segas16a.h2
-rw-r--r--src/mame/includes/simpsons.h2
-rw-r--r--src/mame/includes/skyraid.h2
-rw-r--r--src/mame/includes/spiders.h8
-rw-r--r--src/mame/includes/sprint8.h8
-rw-r--r--src/mame/includes/stfight.h2
-rw-r--r--src/mame/includes/subs.h10
-rw-r--r--src/mame/includes/suna8.h6
-rw-r--r--src/mame/includes/system1.h2
-rw-r--r--src/mame/includes/tatsumi.h4
-rw-r--r--src/mame/includes/tiamc1.h6
-rw-r--r--src/mame/includes/turbo.h16
-rw-r--r--src/mame/includes/tx1.h14
-rw-r--r--src/mame/includes/vectrex.h6
-rw-r--r--src/mame/includes/warpwarp.h8
-rw-r--r--src/mame/includes/xxmissio.h4
-rw-r--r--src/mame/includes/zaxxon.h10
-rw-r--r--src/mame/machine/amiga.c4
-rw-r--r--src/mame/machine/archimds.c4
-rw-r--r--src/mame/machine/atarifb.c36
-rw-r--r--src/mame/machine/beezer.c20
-rw-r--r--src/mame/machine/buggychl.h6
-rw-r--r--src/mame/machine/cd32.c8
-rw-r--r--src/mame/machine/cdicdic.h8
-rw-r--r--src/mame/machine/cdislave.h4
-rw-r--r--src/mame/machine/dc.c8
-rw-r--r--src/mame/machine/gaelco3d.h14
-rw-r--r--src/mame/machine/konppc.c20
-rw-r--r--src/mame/machine/konppc.h12
-rw-r--r--src/mame/machine/leland.c11
-rw-r--r--src/mame/machine/mathbox.h8
-rw-r--r--src/mame/machine/mcr.c12
-rw-r--r--src/mame/machine/mcr68.c4
-rw-r--r--src/mame/machine/megadriv.c6
-rw-r--r--src/mame/machine/megavdp.c2
-rw-r--r--src/mame/machine/mhavoc.c2
-rw-r--r--src/mame/machine/midwayic.c8
-rw-r--r--src/mame/machine/midwayic.h4
-rw-r--r--src/mame/machine/namco06.c4
-rw-r--r--src/mame/machine/namco06.h8
-rw-r--r--src/mame/machine/namco50.h4
-rw-r--r--src/mame/machine/namco51.h4
-rw-r--r--src/mame/machine/namco53.h2
-rw-r--r--src/mame/machine/namco62.h4
-rw-r--r--src/mame/machine/namcoio.h4
-rw-r--r--src/mame/machine/namcos1.c4
-rw-r--r--src/mame/machine/nitedrvr.c15
-rw-r--r--src/mame/machine/nmk004.c99
-rw-r--r--src/mame/machine/nmk112.c2
-rw-r--r--src/mame/machine/nmk112.h4
-rw-r--r--src/mame/machine/playch10.c27
-rw-r--r--src/mame/machine/qix.c16
-rw-r--r--src/mame/machine/simpsons.c2
-rw-r--r--src/mame/machine/snes.c4
-rw-r--r--src/mame/machine/taitoio.c26
-rw-r--r--src/mame/machine/taitoio.h36
-rw-r--r--src/mame/machine/tatsumi.c28
-rw-r--r--src/mame/machine/vectrex.c2
-rw-r--r--src/mame/machine/williams.c28
-rw-r--r--src/mame/video/astrocde.c2
-rw-r--r--src/mame/video/atarirle.h8
-rw-r--r--src/mame/video/boogwing.c8
-rw-r--r--src/mame/video/btoads.c4
-rw-r--r--src/mame/video/cbuster.c3
-rw-r--r--src/mame/video/cninja.c19
-rw-r--r--src/mame/video/combatsc.c26
-rw-r--r--src/mame/video/contra.c40
-rw-r--r--src/mame/video/dassault.c5
-rw-r--r--src/mame/video/dec0.c82
-rw-r--r--src/mame/video/decbac06.c50
-rw-r--r--src/mame/video/decbac06.h44
-rw-r--r--src/mame/video/deco16ic.c12
-rw-r--r--src/mame/video/deco16ic.h24
-rw-r--r--src/mame/video/decocomn.h12
-rw-r--r--src/mame/video/dietgo.c3
-rw-r--r--src/mame/video/dkong.c5
-rw-r--r--src/mame/video/fastlane.c17
-rw-r--r--src/mame/video/flkatck.c23
-rw-r--r--src/mame/video/funkyjet.c3
-rw-r--r--src/mame/video/gp9001.c24
-rw-r--r--src/mame/video/gp9001.h18
-rw-r--r--src/mame/video/gradius3.c5
-rw-r--r--src/mame/video/groundfx.c7
-rw-r--r--src/mame/video/hcastle.c34
-rw-r--r--src/mame/video/itech8.c2
-rw-r--r--src/mame/video/kan_pand.h8
-rw-r--r--src/mame/video/konicdev.c80
-rw-r--r--src/mame/video/konicdev.h262
-rw-r--r--src/mame/video/labyrunr.c33
-rw-r--r--src/mame/video/naughtyb.c4
-rw-r--r--src/mame/video/phoenix.c2
-rw-r--r--src/mame/video/pktgaldx.c3
-rw-r--r--src/mame/video/rohga.c13
-rw-r--r--src/mame/video/seta001.h30
-rw-r--r--src/mame/video/simpsons.c4
-rw-r--r--src/mame/video/skydiver.c6
-rw-r--r--src/mame/video/slapshot.c19
-rw-r--r--src/mame/video/sprint4.c9
-rw-r--r--src/mame/video/subs.c5
-rw-r--r--src/mame/video/supbtime.c3
-rw-r--r--src/mame/video/taito_b.c24
-rw-r--r--src/mame/video/taito_f2.c101
-rw-r--r--src/mame/video/taito_h.c63
-rw-r--r--src/mame/video/taito_o.c21
-rw-r--r--src/mame/video/taitoair.c21
-rw-r--r--src/mame/video/taitoic.c40
-rw-r--r--src/mame/video/taitoic.h110
-rw-r--r--src/mame/video/tia.c2
-rw-r--r--src/mame/video/triplhnt.c5
-rw-r--r--src/mame/video/tumblep.c3
-rw-r--r--src/mame/video/ultratnk.c5
-rw-r--r--src/mame/video/undrfire.c6
-rw-r--r--src/mame/video/vaportra.c3
-rw-r--r--src/mame/video/vectrex.c12
-rw-r--r--src/mame/video/xmen.c5
-rw-r--r--src/mess/audio/dave.c11
-rw-r--r--src/mess/audio/dave.h4
-rw-r--r--src/mess/audio/gb.h8
-rw-r--r--src/mess/audio/mea8000.c6
-rw-r--r--src/mess/audio/mea8000.h6
-rw-r--r--src/mess/audio/t6721.h4
-rw-r--r--src/mess/audio/upd1771.h2
-rw-r--r--src/mess/drivers/abc1600.c76
-rw-r--r--src/mess/drivers/abc80x.c4
-rw-r--r--src/mess/drivers/ace.c2
-rw-r--r--src/mess/drivers/ami1200.c2
-rw-r--r--src/mess/drivers/amiga.c6
-rw-r--r--src/mess/drivers/apf.c16
-rw-r--r--src/mess/drivers/apollo.c6
-rw-r--r--src/mess/drivers/apricot.c18
-rw-r--r--src/mess/drivers/at.c8
-rw-r--r--src/mess/drivers/bebox.c4
-rw-r--r--src/mess/drivers/bigbord2.c14
-rw-r--r--src/mess/drivers/bml3.c4
-rw-r--r--src/mess/drivers/c128.c4
-rw-r--r--src/mess/drivers/c64.c8
-rw-r--r--src/mess/drivers/c65.c4
-rw-r--r--src/mess/drivers/elwro800.c6
-rw-r--r--src/mess/drivers/exelv.c2
-rw-r--r--src/mess/drivers/fm7.c34
-rw-r--r--src/mess/drivers/fmtowns.c28
-rw-r--r--src/mess/drivers/gba.c102
-rw-r--r--src/mess/drivers/homelab.c2
-rw-r--r--src/mess/drivers/ip22.c22
-rw-r--r--src/mess/drivers/m20.c6
-rw-r--r--src/mess/drivers/mikromik.c14
-rw-r--r--src/mess/drivers/msx.c4
-rw-r--r--src/mess/drivers/multi8.c4
-rw-r--r--src/mess/drivers/mz2000.c4
-rw-r--r--src/mess/drivers/mz2500.c16
-rw-r--r--src/mess/drivers/mz6500.c4
-rw-r--r--src/mess/drivers/nanos.c14
-rw-r--r--src/mess/drivers/nascom1.c6
-rw-r--r--src/mess/drivers/nes.c6
-rw-r--r--src/mess/drivers/ng_aes.c4
-rw-r--r--src/mess/drivers/ngp.c2
-rw-r--r--src/mess/drivers/osi.c4
-rw-r--r--src/mess/drivers/p8k.c60
-rw-r--r--src/mess/drivers/palm.c52
-rw-r--r--src/mess/drivers/pasopia7.c6
-rw-r--r--src/mess/drivers/pc1512.c14
-rw-r--r--src/mess/drivers/pc8801.c12
-rw-r--r--src/mess/drivers/pc88va.c6
-rw-r--r--src/mess/drivers/pc9801.c46
-rw-r--r--src/mess/drivers/pcm.c12
-rw-r--r--src/mess/drivers/pcw.c6
-rw-r--r--src/mess/drivers/pes.c4
-rw-r--r--src/mess/drivers/plus4.c4
-rw-r--r--src/mess/drivers/ptcsol.c6
-rw-r--r--src/mess/drivers/ql.c16
-rw-r--r--src/mess/drivers/rt1715.c12
-rw-r--r--src/mess/drivers/smc777.c16
-rw-r--r--src/mess/drivers/snes.c4
-rw-r--r--src/mess/drivers/sorcerer.c6
-rw-r--r--src/mess/drivers/specpls3.c6
-rw-r--r--src/mess/drivers/ssystem3.c5
-rw-r--r--src/mess/drivers/svision.c4
-rw-r--r--src/mess/drivers/trs80.c6
-rw-r--r--src/mess/drivers/trs80m2.c4
-rw-r--r--src/mess/drivers/vic10.c16
-rw-r--r--src/mess/drivers/vidbrain.c2
-rw-r--r--src/mess/drivers/vip.c4
-rw-r--r--src/mess/drivers/vixen.c2
-rw-r--r--src/mess/drivers/vt100.c2
-rw-r--r--src/mess/drivers/wangpc.c4
-rw-r--r--src/mess/drivers/x1.c54
-rw-r--r--src/mess/drivers/x1twin.c12
-rw-r--r--src/mess/drivers/x68k.c22
-rw-r--r--src/mess/drivers/z100.c16
-rw-r--r--src/mess/drivers/z80ne.c8
-rw-r--r--src/mess/formats/m65_snqk.c8
-rw-r--r--src/mess/formats/spec_snqk.c6
-rw-r--r--src/mess/includes/amstrad.h8
-rw-r--r--src/mess/includes/apollo.h28
-rw-r--r--src/mess/includes/c16.h4
-rw-r--r--src/mess/includes/c64.h2
-rw-r--r--src/mess/includes/c64_legacy.h6
-rw-r--r--src/mess/includes/cbmb.h22
-rw-r--r--src/mess/includes/cgenie.h4
-rw-r--r--src/mess/includes/kaypro.h4
-rw-r--r--src/mess/includes/mc68328.h56
-rw-r--r--src/mess/includes/msx.h6
-rw-r--r--src/mess/includes/mtx.h8
-rw-r--r--src/mess/includes/nascom1.h4
-rw-r--r--src/mess/includes/pc.h8
-rw-r--r--src/mess/includes/pokemini.h4
-rw-r--r--src/mess/includes/svision.h4
-rw-r--r--src/mess/includes/vic10.h2
-rw-r--r--src/mess/includes/wswan.h2
-rw-r--r--src/mess/includes/z80ne.h10
-rw-r--r--src/mess/machine/3c505.h4
-rw-r--r--src/mess/machine/990_tap.h4
-rw-r--r--src/mess/machine/a2diskii.c4
-rw-r--r--src/mess/machine/a2echoii.c4
-rw-r--r--src/mess/machine/a2mockingboard.c46
-rw-r--r--src/mess/machine/a7800.c2
-rw-r--r--src/mess/machine/abc77.c2
-rw-r--r--src/mess/machine/aim65.c2
-rw-r--r--src/mess/machine/amigacd.c4
-rw-r--r--src/mess/machine/amigacd.h4
-rw-r--r--src/mess/machine/amstr_pc.c6
-rw-r--r--src/mess/machine/amstrad.c102
-rw-r--r--src/mess/machine/apollo.c32
-rw-r--r--src/mess/machine/apollo_kbd.c16
-rw-r--r--src/mess/machine/apollo_kbd.h10
-rw-r--r--src/mess/machine/apple1.c6
-rw-r--r--src/mess/machine/apple2gs.c4
-rw-r--r--src/mess/machine/apple3.c4
-rw-r--r--src/mess/machine/applefdc.h4
-rw-r--r--src/mess/machine/ataridev.h4
-rw-r--r--src/mess/machine/ay31015.c20
-rw-r--r--src/mess/machine/ay31015.h6
-rw-r--r--src/mess/machine/bbc.c92
-rw-r--r--src/mess/machine/bebox.c4
-rw-r--r--src/mess/machine/beta.c16
-rw-r--r--src/mess/machine/beta.h22
-rw-r--r--src/mess/machine/c128.c16
-rw-r--r--src/mess/machine/c1551.c4
-rw-r--r--src/mess/machine/c64.c20
-rw-r--r--src/mess/machine/c64_currah_speech.c2
-rw-r--r--src/mess/machine/c64_ieee488.c4
-rw-r--r--src/mess/machine/c64_sfx_sound_expander.c4
-rw-r--r--src/mess/machine/c65.c18
-rw-r--r--src/mess/machine/cgenie.c22
-rw-r--r--src/mess/machine/coco_fdc.c38
-rw-r--r--src/mess/machine/compis.c12
-rw-r--r--src/mess/machine/comx_fd.c4
-rw-r--r--src/mess/machine/concept.c30
-rw-r--r--src/mess/machine/cpc_ssa1.c4
-rw-r--r--src/mess/machine/dai.c4
-rw-r--r--src/mess/machine/dgn_beta.c42
-rw-r--r--src/mess/machine/dgnalpha.c22
-rw-r--r--src/mess/machine/ds1315.h8
-rw-r--r--src/mess/machine/e05a03.h4
-rw-r--r--src/mess/machine/gb.c28
-rw-r--r--src/mess/machine/hd63450.h4
-rw-r--r--src/mess/machine/hec2hrp.c18
-rw-r--r--src/mess/machine/hecdisk2.c8
-rw-r--r--src/mess/machine/i8271.c4
-rw-r--r--src/mess/machine/i8271.h12
-rw-r--r--src/mess/machine/iq151_disc2.c6
-rw-r--r--src/mess/machine/isa_adlib.c6
-rw-r--r--src/mess/machine/isa_fdc.c24
-rw-r--r--src/mess/machine/isa_gblaster.c4
-rw-r--r--src/mess/machine/isa_hdc.c4
-rw-r--r--src/mess/machine/isa_ibm_mfc.c2
-rw-r--r--src/mess/machine/isa_ide.c8
-rw-r--r--src/mess/machine/isa_sblaster.c10
-rw-r--r--src/mess/machine/kaypro.c14
-rw-r--r--src/mess/machine/kr2376.c9
-rw-r--r--src/mess/machine/kr2376.h5
-rw-r--r--src/mess/machine/lisa.c21
-rw-r--r--src/mess/machine/lux10828.c16
-rw-r--r--src/mess/machine/mac.c28
-rw-r--r--src/mess/machine/macpci.c12
-rw-r--r--src/mess/machine/mbc55x.c12
-rw-r--r--src/mess/machine/mc68328.c115
-rw-r--r--src/mess/machine/mc68328.h27
-rw-r--r--src/mess/machine/mc6843.h4
-rw-r--r--src/mess/machine/mc6846.c53
-rw-r--r--src/mess/machine/mc6846.h16
-rw-r--r--src/mess/machine/mc6854.h4
-rw-r--r--src/mess/machine/mc80.c12
-rw-r--r--src/mess/machine/micropolis.c10
-rw-r--r--src/mess/machine/micropolis.h12
-rw-r--r--src/mess/machine/mm58274c.h4
-rw-r--r--src/mess/machine/mos6530.h4
-rw-r--r--src/mess/machine/msx.c4
-rw-r--r--src/mess/machine/msx_slot.c140
-rw-r--r--src/mess/machine/mtx.c2
-rw-r--r--src/mess/machine/mz700.c8
-rw-r--r--src/mess/machine/nes_pcb.c2
-rw-r--r--src/mess/machine/odyssey2.c2
-rw-r--r--src/mess/machine/omti8621.c8
-rw-r--r--src/mess/machine/omti8621.h4
-rw-r--r--src/mess/machine/oric.c55
-rw-r--r--src/mess/machine/orion.c44
-rw-r--r--src/mess/machine/osborne1.c4
-rw-r--r--src/mess/machine/partner.c16
-rw-r--r--src/mess/machine/pc.c4
-rw-r--r--src/mess/machine/pc_fdc.c66
-rw-r--r--src/mess/machine/pc_fdc.h4
-rw-r--r--src/mess/machine/pc_lpt.c10
-rw-r--r--src/mess/machine/pc_lpt.h16
-rw-r--r--src/mess/machine/pk8020.c24
-rw-r--r--src/mess/machine/pmd85.c4
-rw-r--r--src/mess/machine/rmnimbus.c50
-rw-r--r--src/mess/machine/s100.c8
-rw-r--r--src/mess/machine/s100.h8
-rw-r--r--src/mess/machine/s100_dj2db.c12
-rw-r--r--src/mess/machine/s100_dj2db.h8
-rw-r--r--src/mess/machine/s100_mm65k16s.c4
-rw-r--r--src/mess/machine/s100_mm65k16s.h4
-rw-r--r--src/mess/machine/s100_wunderbus.c8
-rw-r--r--src/mess/machine/s100_wunderbus.h4
-rw-r--r--src/mess/machine/s3c44b0.c8
-rw-r--r--src/mess/machine/sc499.h4
-rw-r--r--src/mess/machine/sms.c4
-rw-r--r--src/mess/machine/southbridge.c4
-rw-r--r--src/mess/machine/super80.c2
-rw-r--r--src/mess/machine/svi318.c16
-rw-r--r--src/mess/machine/thomflop.c12
-rw-r--r--src/mess/machine/thomson.c38
-rw-r--r--src/mess/machine/ti99/bwg.c8
-rw-r--r--src/mess/machine/ti99/genboard.c8
-rw-r--r--src/mess/machine/ti99/hfdc.c4
-rw-r--r--src/mess/machine/ti99/ti_fdc.c4
-rw-r--r--src/mess/machine/trs80.c2
-rw-r--r--src/mess/machine/tvc_hbf.c4
-rw-r--r--src/mess/machine/upd7002.h6
-rw-r--r--src/mess/machine/upd71071.c4
-rw-r--r--src/mess/machine/upd71071.h4
-rw-r--r--src/mess/machine/upd765.c4
-rw-r--r--src/mess/machine/upd765.h10
-rw-r--r--src/mess/machine/v1050kb.c2
-rw-r--r--src/mess/machine/wswan.c2
-rw-r--r--src/mess/machine/z80ne.c26
-rw-r--r--src/mess/video/733_asr.h4
-rw-r--r--src/mess/video/911_vdt.h4
-rw-r--r--src/mess/video/dl1416.h2
-rw-r--r--src/mess/video/isa_mda.c8
-rw-r--r--src/mess/video/k1ge.h4
-rw-r--r--src/mess/video/vdc8563.h4
-rw-r--r--src/mess/video/vic4567.h6
-rw-r--r--src/mess/video/vic6567.h4
-rw-r--r--src/mess/video/vtvideo.h8
-rw-r--r--src/mess/video/x68k.c2
783 files changed, 4894 insertions, 4802 deletions
diff --git a/src/emu/addrmap.c b/src/emu/addrmap.c
index 787daf27ab0..4c3bea8c4fb 100644
--- a/src/emu/addrmap.c
+++ b/src/emu/addrmap.c
@@ -66,18 +66,10 @@ address_map_entry::address_map_entry(address_map &map, offs_t start, offs_t end)
m_rspace16(NULL),
m_rspace32(NULL),
m_rspace64(NULL),
- m_rdevice8(NULL),
- m_rdevice16(NULL),
- m_rdevice32(NULL),
- m_rdevice64(NULL),
m_wspace8(NULL),
m_wspace16(NULL),
m_wspace32(NULL),
m_wspace64(NULL),
- m_wdevice8(NULL),
- m_wdevice16(NULL),
- m_wdevice32(NULL),
- m_wdevice64(NULL),
m_memory(NULL),
m_bytestart(0),
m_byteend(0),
@@ -234,39 +226,6 @@ void address_map_entry::internal_set_handler(read8_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(8, unitmask, string));
- m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_read.m_bits = 8;
- m_read.m_mask = unitmask;
- m_read.m_name = string;
- device.subtag(m_read.m_tag, tag);
- m_rdevice8 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(8, unitmask, string));
- m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_write.m_bits = 8;
- m_write.m_mask = unitmask;
- m_write.m_name = string;
- device.subtag(m_write.m_tag, tag);
- m_wdevice8 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 unitmask)
-{
- internal_set_handler(device, tag, rfunc, rstring, unitmask);
- internal_set_handler(device, tag, wfunc, wstring, unitmask);
-}
-
-
void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
@@ -336,39 +295,6 @@ void address_map_entry::internal_set_handler(read16_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(16, unitmask, string));
- m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_read.m_bits = 16;
- m_read.m_mask = unitmask;
- m_read.m_name = string;
- device.subtag(m_read.m_tag, tag);
- m_rdevice16 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(16, unitmask, string));
- m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_write.m_bits = 16;
- m_write.m_mask = unitmask;
- m_write.m_name = string;
- device.subtag(m_write.m_tag, tag);
- m_wdevice16 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 unitmask)
-{
- internal_set_handler(device, tag, rfunc, rstring, unitmask);
- internal_set_handler(device, tag, wfunc, wstring, unitmask);
-}
-
-
void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
@@ -438,39 +364,6 @@ void address_map_entry::internal_set_handler(read32_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(32, unitmask, string));
- m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_read.m_bits = 32;
- m_read.m_mask = unitmask;
- m_read.m_name = string;
- device.subtag(m_read.m_tag, tag);
- m_rdevice32 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(32, unitmask, string));
- m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_write.m_bits = 32;
- m_write.m_mask = unitmask;
- m_write.m_name = string;
- device.subtag(m_write.m_tag, tag);
- m_wdevice32 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 unitmask)
-{
- internal_set_handler(device, tag, rfunc, rstring, unitmask);
- internal_set_handler(device, tag, wfunc, wstring, unitmask);
-}
-
-
void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
@@ -540,39 +433,6 @@ void address_map_entry::internal_set_handler(read64_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(64, unitmask, string));
- m_read.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_read.m_bits = 64;
- m_read.m_mask = 0;
- m_read.m_name = string;
- device.subtag(m_read.m_tag, tag);
- m_rdevice64 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string, UINT64 unitmask)
-{
- assert(func != NULL);
- assert(unitmask_is_appropriate(64, unitmask, string));
- m_write.m_type = AMH_LEGACY_DEVICE_HANDLER;
- m_write.m_bits = 64;
- m_write.m_mask = 0;
- m_write.m_name = string;
- device.subtag(m_write.m_tag, tag);
- m_wdevice64 = func;
-}
-
-
-void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 unitmask)
-{
- internal_set_handler(device, tag, rfunc, rstring, unitmask);
- internal_set_handler(device, tag, wfunc, wstring, unitmask);
-}
-
-
void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h
index 92c5d88d764..05e1600b9ec 100644
--- a/src/emu/addrmap.h
+++ b/src/emu/addrmap.h
@@ -62,7 +62,6 @@ enum map_handler_type
AMH_UNMAP,
AMH_DEVICE_DELEGATE,
AMH_LEGACY_SPACE_HANDLER,
- AMH_LEGACY_DEVICE_HANDLER,
AMH_PORT,
AMH_BANK,
AMH_DEVICE_SUBMAP
@@ -160,10 +159,6 @@ public:
read16_space_func m_rspace16; // 16-bit legacy address space handler
read32_space_func m_rspace32; // 32-bit legacy address space handler
read64_space_func m_rspace64; // 64-bit legacy address space handler
- read8_device_func m_rdevice8; // 8-bit legacy device handler
- read16_device_func m_rdevice16; // 16-bit legacy device handler
- read32_device_func m_rdevice32; // 32-bit legacy device handler
- read64_device_func m_rdevice64; // 64-bit legacy device handler
write8_delegate m_wproto8; // 8-bit write proto-delegate
write16_delegate m_wproto16; // 16-bit write proto-delegate
write32_delegate m_wproto32; // 32-bit write proto-delegate
@@ -172,10 +167,6 @@ public:
write16_space_func m_wspace16; // 16-bit legacy address space handler
write32_space_func m_wspace32; // 32-bit legacy address space handler
write64_space_func m_wspace64; // 64-bit legacy address space handler
- write8_device_func m_wdevice8; // 8-bit legacy device handler
- write16_device_func m_wdevice16; // 16-bit legacy device handler
- write32_device_func m_wdevice32; // 32-bit legacy device handler
- write64_device_func m_wdevice64; // 64-bit legacy device handler
address_map_delegate m_submap_delegate;
int m_submap_bits;
@@ -195,9 +186,6 @@ protected:
void internal_set_handler(read8_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write8_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask);
@@ -206,9 +194,6 @@ protected:
void internal_set_handler(read16_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write16_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask);
@@ -217,9 +202,6 @@ protected:
void internal_set_handler(read32_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write32_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask);
@@ -228,9 +210,6 @@ protected:
void internal_set_handler(read64_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write64_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read64_space_func rfunc, const char *rstring, write64_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read64_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, write64_delegate func, UINT64 mask);
void internal_set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 mask);
@@ -255,9 +234,6 @@ public:
void set_handler(read8_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write8_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
void set_handler(const device_t &device, const char *tag, read8_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, write8_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
@@ -278,9 +254,6 @@ public:
void set_handler(read16_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write16_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
void set_handler(const device_t &device, const char *tag, read16_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, write16_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
@@ -289,9 +262,6 @@ public:
void set_handler(read8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); }
void set_handler(write8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT16 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT16 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT16 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT16 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT16 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
@@ -312,9 +282,6 @@ public:
void set_handler(read32_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write32_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
void set_handler(const device_t &device, const char *tag, read32_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, write32_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
@@ -323,9 +290,6 @@ public:
void set_handler(read16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(write16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
void set_handler(const device_t &device, const char *tag, read16_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, write16_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT32 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
@@ -334,9 +298,6 @@ public:
void set_handler(read8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(write8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT32 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
@@ -357,9 +318,6 @@ public:
void set_handler(read64_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write64_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read64_space_func rfunc, const char *rstring, write64_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
- void set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
void set_handler(const device_t &device, const char *tag, read64_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, write64_delegate func) { internal_set_handler(device, tag, func, 0); }
void set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
@@ -368,9 +326,6 @@ public:
void set_handler(read32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(write32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
void set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
@@ -379,9 +334,6 @@ public:
void set_handler(read16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(write16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
void set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
@@ -390,9 +342,6 @@ public:
void set_handler(read8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(write8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
- void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
@@ -546,38 +495,38 @@ void _class :: _name(address_map &map, const device_t &device) \
// legacy device reads
#define AM_DEVREAD_LEGACY(_tag, _handler) \
- curentry->set_handler(device, _tag, _handler, #_handler); \
+ curentry->set_handler(device, _tag, read_delegate(&_handler, #_handler, (device_t *)0)); \
#define AM_DEVREAD8_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, read8_delegate(&_handler, #_handler, (device_t *)0), _unitmask); \
// legacy device writes
#define AM_DEVWRITE_LEGACY(_tag, _handler) \
- curentry->set_handler(device, _tag, _handler, #_handler); \
+ curentry->set_handler(device, _tag, write_delegate(&_handler, #_handler, (device_t *)0)); \
#define AM_DEVWRITE8_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, write8_delegate(&_handler, #_handler, (device_t *)0), _unitmask); \
#define AM_DEVWRITE16_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, write16_delegate(&_handler, #_handler, (device_t *)0), _unitmask); \
// legacy device reads/writes
#define AM_DEVREADWRITE_LEGACY(_tag, _rhandler, _whandler) \
- curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
+ curentry->set_handler(device, _tag, read_delegate(&_rhandler, #_rhandler, (device_t *)0), write_delegate(&_whandler, #_whandler, (device_t *)0)); \
#define AM_DEVREADWRITE8_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, read8_delegate(&_rhandler, #_rhandler, (device_t *)0), write8_delegate(&_whandler, #_whandler, (device_t *)0), _unitmask); \
#define AM_DEVREADWRITE16_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, read16_delegate(&_rhandler, #_rhandler, (device_t *)0), write16_delegate(&_whandler, #_whandler, (device_t *)0), _unitmask); \
#define AM_DEVREADWRITE32_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, read32_delegate(&_rhandler, #_rhandler, (device_t *)0), write32_delegate(&_whandler, #_whandler, (device_t *)0), _unitmask); \
// driver data reads
diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c
index a56cc24cb55..343fc8b1e11 100644
--- a/src/emu/cpu/arm7/arm7.c
+++ b/src/emu/cpu/arm7/arm7.c
@@ -43,9 +43,9 @@
/* prototypes of coprocessor functions */
-static WRITE32_DEVICE_HANDLER(arm7_do_callback);
-static READ32_DEVICE_HANDLER(arm7_rt_r_callback);
-static WRITE32_DEVICE_HANDLER(arm7_rt_w_callback);
+static DECLARE_WRITE32_DEVICE_HANDLER(arm7_do_callback);
+static DECLARE_READ32_DEVICE_HANDLER(arm7_rt_r_callback);
+static DECLARE_WRITE32_DEVICE_HANDLER(arm7_rt_w_callback);
void arm7_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
void arm7_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
diff --git a/src/emu/cpu/arm7/arm7ops.c b/src/emu/cpu/arm7/arm7ops.c
index 4d3d31ade09..861eb18a2f1 100644
--- a/src/emu/cpu/arm7/arm7ops.c
+++ b/src/emu/cpu/arm7/arm7ops.c
@@ -283,7 +283,7 @@ static void HandleCoProcDO(arm_state *cpustate, UINT32 insn)
{
// This instruction simply instructs the co-processor to do something, no data is returned to ARM7 core
if (arm7_coproc_do_callback)
- arm7_coproc_do_callback(cpustate->device, insn, 0, 0); // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation
+ arm7_coproc_do_callback(cpustate->device, *cpustate->program, insn, 0, 0); // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation
else
LOG(("%08x: Co-Processor Data Operation executed, but no callback defined!\n", R15));
}
@@ -299,7 +299,7 @@ static void HandleCoProcRT(arm_state *cpustate, UINT32 insn)
{
if (arm7_coproc_rt_r_callback)
{
- UINT32 res = arm7_coproc_rt_r_callback(cpustate->device, insn, 0); // RT Read handler must parse opcode & return appropriate result
+ UINT32 res = arm7_coproc_rt_r_callback(cpustate->device, *cpustate->program, insn, 0); // RT Read handler must parse opcode & return appropriate result
if (cpustate->pendingUnd == 0)
{
SET_REGISTER(cpustate, (insn >> 12) & 0xf, res);
@@ -312,7 +312,7 @@ static void HandleCoProcRT(arm_state *cpustate, UINT32 insn)
else
{
if (arm7_coproc_rt_w_callback)
- arm7_coproc_rt_w_callback(cpustate->device, insn, GET_REGISTER(cpustate, (insn >> 12) & 0xf), 0);
+ arm7_coproc_rt_w_callback(cpustate->device, *cpustate->program, insn, GET_REGISTER(cpustate, (insn >> 12) & 0xf), 0);
else
LOG(("%08x: Co-Processor Register Transfer executed, but no RT Write callback defined!\n", R15));
}
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.h b/src/emu/cpu/cubeqcpu/cubeqcpu.h
index 226fca6b279..60c01f2be45 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.h
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.h
@@ -139,11 +139,11 @@ struct cubeqst_rot_config
PUBLIC FUNCTIONS
***************************************************************************/
-extern READ16_DEVICE_HANDLER( cubeqcpu_sndram_r );
-extern WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w );
+extern DECLARE_READ16_DEVICE_HANDLER( cubeqcpu_sndram_r );
+extern DECLARE_WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w );
-extern READ16_DEVICE_HANDLER( cubeqcpu_rotram_r );
-extern WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w );
+extern DECLARE_READ16_DEVICE_HANDLER( cubeqcpu_rotram_r );
+extern DECLARE_WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w );
void cubeqcpu_swap_line_banks(device_t *device);
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 4afe1971d52..a93a120a313 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -1701,7 +1701,7 @@ static CPU_EXECUTE( esrip )
/* FDT RAM: /Enable, Direction and /RAM OE */
else if (!bl44 && !_BIT(cpustate->l2, 3) && bl46)
- y_bus = cpustate->fdt_r(device, cpustate->fdt_cnt, 0);
+ y_bus = cpustate->fdt_r(device, *cpustate->program, cpustate->fdt_cnt, 0);
/* IPT RAM: /Enable and /READ */
else if (!_BIT(cpustate->l2, 6) && !_BIT(cpustate->l4, 5))
@@ -1728,7 +1728,7 @@ static CPU_EXECUTE( esrip )
/* FDT RAM */
if (!bl44)
- x_bus = cpustate->fdt_r(device, cpustate->fdt_cnt, 0);
+ x_bus = cpustate->fdt_r(device, *cpustate->program, cpustate->fdt_cnt, 0);
/* Buffer is enabled - write direction */
else if (!BIT(cpustate->l2, 3) && !bl46)
@@ -1753,7 +1753,7 @@ static CPU_EXECUTE( esrip )
/* Write FDT RAM: /Enable, Direction and WRITE */
if (!BIT(cpustate->l2, 3) && !bl46 && !BIT(cpustate->l4, 3))
- cpustate->fdt_w(device, cpustate->fdt_cnt, x_bus, 0);
+ cpustate->fdt_w(device, *cpustate->program, cpustate->fdt_cnt, x_bus, 0);
/* Write IPT RAM: /Enable and /WR */
if (!BIT(cpustate->l2, 7) && !BIT(cpustate->l4, 5))
diff --git a/src/emu/cpu/m68000/68307ser.c b/src/emu/cpu/m68000/68307ser.c
index 6ed1942115d..cb9cda7da0b 100644
--- a/src/emu/cpu/m68000/68307ser.c
+++ b/src/emu/cpu/m68000/68307ser.c
@@ -24,7 +24,7 @@ READ8_HANDLER( m68307_internal_serial_r )
// if we're piggybacking on the existing 68681 implementation...
if (serial->m_duart68681)
{
- if (offset&1) return duart68681_r(serial->m_duart68681, offset>>1);
+ if (offset&1) return duart68681_r(serial->m_duart68681, *m68k->program, offset>>1);
}
else
{
@@ -104,7 +104,7 @@ WRITE8_HANDLER( m68307_internal_serial_w )
// if we're piggybacking on the existing 68681 implementation...
if (serial->m_duart68681)
{
- if (offset&1) duart68681_w(serial->m_duart68681, offset>>1, data);
+ if (offset&1) duart68681_w(serial->m_duart68681, *m68k->program, offset>>1, data);
}
else
{
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index 88c6500b3f0..4baa999a0c8 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -1121,7 +1121,7 @@ void ppccom_execute_mfdcr(powerpc_state *ppc)
else
ppc->param1 = 0;
} else {
- ppc->param1 = ppc->dcr_read_func(ppc->device,ppc->param0,0xffffffff);
+ ppc->param1 = ppc->dcr_read_func(ppc->device,*ppc->program,ppc->param0,0xffffffff);
}
}
@@ -1211,7 +1211,7 @@ void ppccom_execute_mtdcr(powerpc_state *ppc)
if (ppc->param0 < ARRAY_LENGTH(ppc->dcr))
ppc->dcr[ppc->param0] = ppc->param1;
} else {
- ppc->dcr_write_func(ppc->device,ppc->param0,ppc->param1,0xffffffff);
+ ppc->dcr_write_func(ppc->device,*ppc->program,ppc->param0,ppc->param1,0xffffffff);
}
}
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index 41f0f412463..2c59f23a47b 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -472,14 +472,14 @@ static void cfunc_get_cop0_reg(void *param)
{
if(dest)
{
- rsp->r[dest] = (rsp->config->sp_reg_r)(rsp->device, reg, 0x00000000);
+ rsp->r[dest] = (rsp->config->sp_reg_r)(rsp->device, *rsp->program, reg, 0x00000000);
}
}
else if (reg >= 8 && reg < 16)
{
if(dest)
{
- rsp->r[dest] = (rsp->config->dp_reg_r)(rsp->device, reg - 8, 0x00000000);
+ rsp->r[dest] = (rsp->config->dp_reg_r)(rsp->device, *rsp->program, reg - 8, 0x00000000);
}
}
else
@@ -496,11 +496,11 @@ static void cfunc_set_cop0_reg(void *param)
if (reg >= 0 && reg < 8)
{
- (rsp->config->sp_reg_w)(rsp->device, reg, data, 0x00000000);
+ (rsp->config->sp_reg_w)(rsp->device, *rsp->program, reg, data, 0x00000000);
}
else if (reg >= 8 && reg < 16)
{
- (rsp->config->dp_reg_w)(rsp->device, reg - 8, data, 0x00000000);
+ (rsp->config->dp_reg_w)(rsp->device, *rsp->program, reg - 8, data, 0x00000000);
}
else
{
diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c
index c86affd31a4..7fadebee03b 100644
--- a/src/emu/cpu/tms0980/tms0980.c
+++ b/src/emu/cpu/tms0980/tms0980.c
@@ -766,7 +766,7 @@ static void tms0980_set_cki_bus( device_t *device )
case 0x008:
if ( cpustate->config->read_k )
{
- cpustate->cki_bus = cpustate->config->read_k( device, 0 );
+ cpustate->cki_bus = cpustate->config->read_k( device, *cpustate->program, 0, 0xff );
}
else
{
@@ -930,7 +930,7 @@ static CPU_EXECUTE( tms0980 )
cpustate->r = cpustate->r | ( 1 << cpustate->y );
if ( cpustate->config->write_r )
{
- cpustate->config->write_r( device, 0, cpustate->r & cpustate->r_mask, 0xffff );
+ cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff );
}
}
if ( cpustate->decode & F_RSTR )
@@ -938,7 +938,7 @@ static CPU_EXECUTE( tms0980 )
cpustate->r = cpustate->r & ( ~( 1 << cpustate->y ) );
if ( cpustate->config->write_r )
{
- cpustate->config->write_r( device, 0, cpustate->r & cpustate->r_mask, 0xffff );
+ cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff );
}
}
if ( cpustate->decode & F_TDO )
@@ -957,7 +957,7 @@ static CPU_EXECUTE( tms0980 )
if ( cpustate->config->write_o )
{
- cpustate->config->write_o( device, 0, cpustate->o & cpustate->o_mask, 0xffff );
+ cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff );
}
}
if ( cpustate->decode & F_CLO )
@@ -965,7 +965,7 @@ static CPU_EXECUTE( tms0980 )
cpustate->o = 0;
if ( cpustate->config->write_o )
{
- cpustate->config->write_o( device, 0, cpustate->o & cpustate->o_mask, 0xffff );
+ cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff );
}
}
if ( cpustate->decode & F_LDX )
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index 83ddadf6b20..ac30a5cd245 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -232,7 +232,7 @@ int devcb_resolved_read_line::from_port()
int devcb_resolved_read_line::from_read8()
{
- return ((*m_helper.read8_device)(m_object.device, 0) & 1) ? ASSERT_LINE : CLEAR_LINE;
+ return ((*m_helper.read8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), 0, 0xff) & 1) ? ASSERT_LINE : CLEAR_LINE;
}
@@ -336,7 +336,7 @@ void devcb_resolved_write_line::to_port(int state)
void devcb_resolved_write_line::to_write8(int state)
{
- (*m_helper.write8_device)(m_object.device, 0, state);
+ (*m_helper.write8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), 0, state, 0xff);
}
@@ -391,7 +391,10 @@ void devcb_resolved_read8::resolve(const devcb_read8 &desc, device_t &device)
case DEVCB_TYPE_DEVICE:
m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
if (desc.readdevice != NULL)
- *static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(desc.readdevice, desc.name, m_object.device);
+ {
+ m_helper.read8_device = desc.readdevice;
+ *static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(&devcb_resolved_read8::from_read8, desc.name, this);
+ }
else
{
m_helper.read_line = desc.readline;
@@ -428,6 +431,17 @@ UINT8 devcb_resolved_read8::from_port(offs_t offset)
// line read value to an 8-bit value
//-------------------------------------------------
+UINT8 devcb_resolved_read8::from_read8(offs_t offset)
+{
+ return (*m_helper.read8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, 0xff);
+}
+
+
+//-------------------------------------------------
+// from_readline - helper to convert from a device
+// line read value to an 8-bit value
+//-------------------------------------------------
+
UINT8 devcb_resolved_read8::from_readline(offs_t offset)
{
return (*m_helper.read_line)(m_object.device);
@@ -484,7 +498,10 @@ void devcb_resolved_write8::resolve(const devcb_write8 &desc, device_t &device)
case DEVCB_TYPE_DEVICE:
m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
if (desc.writedevice != NULL)
- *static_cast<devcb_write8_delegate *>(this) = devcb_write8_delegate(desc.writedevice, desc.name, m_object.device);
+ {
+ m_helper.write8_device = desc.writedevice;
+ *static_cast<devcb_write8_delegate *>(this) = devcb_write8_delegate(&devcb_resolved_write8::to_write8, desc.name, this);
+ }
else
{
m_helper.write_line = desc.writeline;
@@ -531,6 +548,17 @@ void devcb_resolved_write8::to_port(offs_t offset, UINT8 data)
// memory read value from a line value
//-------------------------------------------------
+void devcb_resolved_write8::to_write8(offs_t offset, UINT8 data)
+{
+ (*m_helper.write8_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, data, 0xff);
+}
+
+
+//-------------------------------------------------
+// to_write8 - helper to convert to an 8-bit
+// memory read value from a line value
+//-------------------------------------------------
+
void devcb_resolved_write8::to_writeline(offs_t offset, UINT8 data)
{
(*m_helper.write_line)(m_object.device, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
@@ -588,7 +616,10 @@ void devcb_resolved_read16::resolve(const devcb_read16 &desc, device_t &device)
case DEVCB_TYPE_DEVICE:
m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
if (desc.readdevice != NULL)
- *static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(desc.readdevice, desc.name, m_object.device);
+ {
+ m_helper.read16_device = desc.readdevice;
+ *static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(&devcb_resolved_read16::from_read16, desc.name, this);
+ }
else
{
m_helper.read_line = desc.readline;
@@ -625,6 +656,17 @@ UINT16 devcb_resolved_read16::from_port(offs_t offset, UINT16 mask)
// line read value to a 16-bit value
//-------------------------------------------------
+UINT16 devcb_resolved_read16::from_read16(offs_t offset, UINT16 mask)
+{
+ return (*m_helper.read16_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, mask);
+}
+
+
+//-------------------------------------------------
+// from_read16 - helper to convert from a device
+// line read value to a 16-bit value
+//-------------------------------------------------
+
UINT16 devcb_resolved_read16::from_readline(offs_t offset, UINT16 mask)
{
return (*m_helper.read_line)(m_object.device);
@@ -681,7 +723,10 @@ void devcb_resolved_write16::resolve(const devcb_write16 &desc, device_t &device
case DEVCB_TYPE_DEVICE:
m_object.device = devcb_resolver::resolve_device(desc.index, desc.tag, device);
if (desc.writedevice != NULL)
- *static_cast<devcb_write16_delegate *>(this) = devcb_write16_delegate(desc.writedevice, desc.name, m_object.device);
+ {
+ m_helper.write16_device = desc.writedevice;
+ *static_cast<devcb_write16_delegate *>(this) = devcb_write16_delegate(&devcb_resolved_write16::to_write16, desc.name, this);
+ }
else
{
m_helper.write_line = desc.writeline;
@@ -728,6 +773,17 @@ void devcb_resolved_write16::to_port(offs_t offset, UINT16 data, UINT16 mask)
// memory read value from a line value
//-------------------------------------------------
+void devcb_resolved_write16::to_write16(offs_t offset, UINT16 data, UINT16 mask)
+{
+ (*m_helper.write16_device)(m_object.device, m_object.device->machine().driver_data()->generic_space(), offset, data, mask);
+}
+
+
+//-------------------------------------------------
+// to_write16 - helper to convert to a 16-bit
+// memory read value from a line value
+//-------------------------------------------------
+
void devcb_resolved_write16::to_writeline(offs_t offset, UINT16 data, UINT16 mask)
{
(*m_helper.write_line)(m_object.device, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index 2f323b41311..011ecc5b937 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -109,18 +109,18 @@ int devcb_line_stub(device_t *device)
// static template for a read8 stub function that calls through a given READ8_MEMBER
template<class _Class, UINT8 (_Class::*_Function)(address_space &, offs_t, UINT8)>
-UINT8 devcb_stub(device_t *device, offs_t offset)
+UINT8 devcb_stub(device_t *device, address_space &space, offs_t offset, UINT8 mem_mask)
{
_Class *target = downcast<_Class *>(device);
- return (target->*_Function)(*device->machine().memory().first_space(), offset, 0xff);
+ return (target->*_Function)(space, offset, mem_mask);
}
// static template for a read16 stub function that calls through a given READ16_MEMBER
template<class _Class, UINT16 (_Class::*_Function)(address_space &, offs_t, UINT16)>
-UINT16 devcb_stub16(device_t *device, offs_t offset, UINT16 mask)
+UINT16 devcb_stub16(device_t *device, address_space &space, offs_t offset, UINT16 mem_mask)
{
_Class *target = downcast<_Class *>(device);
- return (target->*_Function)(*device->machine().memory().first_space(), offset, mask);
+ return (target->*_Function)(space, offset, mem_mask);
}
// static template for a write_line stub function that calls through a given WRITE_LINE_MEMBER
@@ -133,18 +133,18 @@ void devcb_line_stub(device_t *device, int state)
// static template for a write8 stub function that calls through a given WRITE8_MEMBER
template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT8, UINT8)>
-void devcb_stub(device_t *device, offs_t offset, UINT8 data)
+void devcb_stub(device_t *device, address_space &space, offs_t offset, UINT8 data, UINT8 mem_mask)
{
_Class *target = downcast<_Class *>(device);
- (target->*_Function)(*device->machine().memory().first_space(), offset, data, 0xff);
+ (target->*_Function)(space, offset, data, mem_mask);
}
// static template for a write16 stub function that calls through a given WRITE16_MEMBER
template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT16, UINT16)>
-void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask)
+void devcb_stub16(device_t *device, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
{
_Class *target = downcast<_Class *>(device);
- (target->*_Function)(*device->machine().memory().first_space(), offset, data, mask);
+ (target->*_Function)(space, offset, data, mem_mask);
}
#define DEVCB_NULL { DEVCB_TYPE_NULL }
@@ -374,6 +374,7 @@ public:
private:
// internal helpers
UINT8 from_port(offs_t offset);
+ UINT8 from_read8(offs_t offset);
UINT8 from_readline(offs_t offset);
UINT8 from_constant(offs_t offset);
@@ -424,6 +425,7 @@ private:
// internal helpers
void to_null(offs_t offset, UINT8 data);
void to_port(offs_t offset, UINT8 data);
+ void to_write8(offs_t offset, UINT8 data);
void to_writeline(offs_t offset, UINT8 data);
void to_input(offs_t offset, UINT8 data);
@@ -473,6 +475,7 @@ public:
private:
// internal helpers
UINT16 from_port(offs_t offset, UINT16 mask);
+ UINT16 from_read16(offs_t offset, UINT16 mask);
UINT16 from_readline(offs_t offset, UINT16 mask);
UINT16 from_constant(offs_t offset, UINT16 mask);
@@ -523,6 +526,7 @@ private:
// internal helpers
void to_null(offs_t offset, UINT16 data, UINT16 mask);
void to_port(offs_t offset, UINT16 data, UINT16 mask);
+ void to_write16(offs_t offset, UINT16 data, UINT16 mask);
void to_writeline(offs_t offset, UINT16 data, UINT16 mask);
void to_input(offs_t offset, UINT16 data, UINT16 mask);
diff --git a/src/emu/devconv.h b/src/emu/devconv.h
index a7b81a27827..ce64a44b02a 100644
--- a/src/emu/devconv.h
+++ b/src/emu/devconv.h
@@ -85,23 +85,23 @@
*
*************************************/
-INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT16 mem_mask)
+INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 mem_mask)
{
UINT16 result = 0;
if (ACCESSING_BITS_8_15)
- result |= ((UINT16)(*handler)(device, offset * 2 + 0)) << 8;
+ result |= ((UINT16)(*handler)(device, space, offset * 2 + 0, mem_mask >> 8)) << 8;
if (ACCESSING_BITS_0_7)
- result |= ((UINT16)(*handler)(device, offset * 2 + 1)) << 0;
+ result |= ((UINT16)(*handler)(device, space, offset * 2 + 1, mem_mask >> 0)) << 0;
return result;
}
-INLINE void write16be_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT16 data, UINT16 mem_mask)
+INLINE void write16be_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
{
if (ACCESSING_BITS_8_15)
- (*handler)(device, offset * 2 + 0, data >> 8);
+ (*handler)(device, space, offset * 2 + 0, data >> 8, mem_mask >> 8);
if (ACCESSING_BITS_0_7)
- (*handler)(device, offset * 2 + 1, data >> 0);
+ (*handler)(device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
}
@@ -111,23 +111,23 @@ INLINE void write16be_with_write8_device_handler(write8_device_func handler, dev
*
*************************************/
-INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT16 mem_mask)
+INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 mem_mask)
{
UINT16 result = 0;
if (ACCESSING_BITS_0_7)
- result |= ((UINT16) (*handler)(device, offset * 2 + 0)) << 0;
+ result |= ((UINT16) (*handler)(device, space, offset * 2 + 0, mem_mask >> 0)) << 0;
if (ACCESSING_BITS_8_15)
- result |= ((UINT16) (*handler)(device, offset * 2 + 1)) << 8;
+ result |= ((UINT16) (*handler)(device, space, offset * 2 + 1, mem_mask >> 8)) << 8;
return result;
}
-INLINE void write16le_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT16 data, UINT16 mem_mask)
+INLINE void write16le_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
{
if (ACCESSING_BITS_0_7)
- (*handler)(device, offset * 2 + 0, data >> 0);
+ (*handler)(device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
if (ACCESSING_BITS_8_15)
- (*handler)(device, offset * 2 + 1, data >> 8);
+ (*handler)(device, space, offset * 2 + 1, data >> 8, mem_mask >> 8);
}
@@ -137,23 +137,23 @@ INLINE void write16le_with_write8_device_handler(write8_device_func handler, dev
*
*************************************/
-INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_16_31)
- result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 16) << 16;
+ result |= read16be_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 16) << 16;
if (ACCESSING_BITS_0_15)
- result |= read16be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0;
+ result |= read16be_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask) << 0;
return result;
}
-INLINE void write32be_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32be_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_16_31)
- write16be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 16, mem_mask >> 16);
+ write16be_with_write8_device_handler(handler, device, space, offset * 2 + 0, data >> 16, mem_mask >> 16);
if (ACCESSING_BITS_0_15)
- write16be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask);
+ write16be_with_write8_device_handler(handler, device, space, offset * 2 + 1, data, mem_mask);
}
@@ -163,23 +163,23 @@ INLINE void write32be_with_write8_device_handler(write8_device_func handler, dev
*
*************************************/
-INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_0_15)
- result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask) << 0;
+ result |= read16le_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask) << 0;
if (ACCESSING_BITS_16_31)
- result |= read16le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 16) << 16;
+ result |= read16le_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 16) << 16;
return result;
}
-INLINE void write32le_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32le_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_0_15)
- write16le_with_write8_device_handler(handler, device, offset * 2 + 0, data, mem_mask);
+ write16le_with_write8_device_handler(handler, device, space, offset * 2 + 0, data, mem_mask);
if (ACCESSING_BITS_16_31)
- write16le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 16, mem_mask >> 16);
+ write16le_with_write8_device_handler(handler, device, space, offset * 2 + 1, data >> 16, mem_mask >> 16);
}
@@ -189,23 +189,23 @@ INLINE void write32le_with_write8_device_handler(write8_device_func handler, dev
*
*************************************/
-INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_16_31)
- result |= (*handler)(device, offset * 2 + 0, mem_mask >> 16) << 16;
+ result |= (*handler)(device, space, offset * 2 + 0, mem_mask >> 16) << 16;
if (ACCESSING_BITS_0_15)
- result |= (*handler)(device, offset * 2 + 1, mem_mask) << 0;
+ result |= (*handler)(device, space, offset * 2 + 1, mem_mask) << 0;
return result;
}
-INLINE void write32be_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32be_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_16_31)
- (*handler)(device, offset * 2 + 0, data >> 16, mem_mask >> 16);
+ (*handler)(device, space, offset * 2 + 0, data >> 16, mem_mask >> 16);
if (ACCESSING_BITS_0_15)
- (*handler)(device, offset * 2 + 1, data, mem_mask);
+ (*handler)(device, space, offset * 2 + 1, data, mem_mask);
}
@@ -215,23 +215,23 @@ INLINE void write32be_with_16be_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_0_15)
- result |= (*handler)(device, offset * 2 + 0, mem_mask) << 0;
+ result |= (*handler)(device, space, offset * 2 + 0, mem_mask) << 0;
if (ACCESSING_BITS_16_31)
- result |= (*handler)(device, offset * 2 + 1, mem_mask >> 16) << 16;
+ result |= (*handler)(device, space, offset * 2 + 1, mem_mask >> 16) << 16;
return result;
}
-INLINE void write32le_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32le_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_0_15)
- (*handler)(device, offset * 2 + 0, data, mem_mask);
+ (*handler)(device, space, offset * 2 + 0, data, mem_mask);
if (ACCESSING_BITS_16_31)
- (*handler)(device, offset * 2 + 1, data >> 16, mem_mask >> 16);
+ (*handler)(device, space, offset * 2 + 1, data >> 16, mem_mask >> 16);
}
@@ -241,20 +241,20 @@ INLINE void write32le_with_16le_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
mem_mask = FLIPENDIAN_INT32(mem_mask);
- result = read32le_with_16le_device_handler(handler, device, offset, mem_mask);
+ result = read32le_with_16le_device_handler(handler, device, space, offset, mem_mask);
return FLIPENDIAN_INT32(result);
}
-INLINE void write32be_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32be_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
data = FLIPENDIAN_INT32(data);
mem_mask = FLIPENDIAN_INT32(mem_mask);
- write32le_with_16le_device_handler(handler, device, offset, data, mem_mask);
+ write32le_with_16le_device_handler(handler, device, space, offset, data, mem_mask);
}
@@ -264,20 +264,20 @@ INLINE void write32be_with_16le_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
mem_mask = FLIPENDIAN_INT32(mem_mask);
- result = read32be_with_16be_device_handler(handler, device, offset, mem_mask);
+ result = read32be_with_16be_device_handler(handler, device, space, offset, mem_mask);
return FLIPENDIAN_INT32(result);
}
-INLINE void write32le_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32le_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
data = FLIPENDIAN_INT32(data);
mem_mask = FLIPENDIAN_INT32(mem_mask);
- write32be_with_16be_device_handler(handler, device, offset, data, mem_mask);
+ write32be_with_16be_device_handler(handler, device, space, offset, data, mem_mask);
}
@@ -287,23 +287,23 @@ INLINE void write32le_with_16be_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
+ result |= (UINT64)read32be_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 32) << 32;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)read32be_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask) << 0;
+ result |= (UINT64)read32be_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask) << 0;
return result;
}
-INLINE void write64be_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
- write32be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
+ write32be_with_write8_device_handler(handler, device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
if (ACCESSING_BITS_0_31)
- write32be_with_write8_device_handler(handler, device, offset * 2 + 1, data, mem_mask);
+ write32be_with_write8_device_handler(handler, device, space, offset * 2 + 1, data, mem_mask);
}
@@ -313,23 +313,23 @@ INLINE void write64be_with_write8_device_handler(write8_device_func handler, dev
*
*************************************/
-INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
+ result |= (UINT64)read32le_with_read8_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 0) << 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)read32le_with_read8_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
+ result |= (UINT64)read32le_with_read8_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 32) << 32;
return result;
}
-INLINE void write64le_with_write8_device_handler(write8_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_write8_device_handler(write8_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
- write32le_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
+ write32le_with_write8_device_handler(handler, device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
if (ACCESSING_BITS_32_63)
- write32le_with_write8_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
+ write32le_with_write8_device_handler(handler, device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
}
@@ -339,23 +339,23 @@ INLINE void write64le_with_write8_device_handler(write8_device_func handler, dev
*
*************************************/
-INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
+ result |= (UINT64)read32be_with_16be_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 32) << 32;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)read32be_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0;
+ result |= (UINT64)read32be_with_16be_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 0) << 0;
return result;
}
-INLINE void write64be_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
- write32be_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
+ write32be_with_16be_device_handler(handler, device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
if (ACCESSING_BITS_0_31)
- write32be_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0);
+ write32be_with_16be_device_handler(handler, device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
}
@@ -365,23 +365,23 @@ INLINE void write64be_with_16be_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
+ result |= (UINT64)read32le_with_16le_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 0) << 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)read32le_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
+ result |= (UINT64)read32le_with_16le_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 32) << 32;
return result;
}
-INLINE void write64le_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
- write32le_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
+ write32le_with_16le_device_handler(handler, device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
if (ACCESSING_BITS_32_63)
- write32le_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
+ write32le_with_16le_device_handler(handler, device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
}
@@ -391,23 +391,23 @@ INLINE void write64le_with_16le_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 0, mem_mask >> 32) << 32;
+ result |= (UINT64)read32be_with_16le_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 32) << 32;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)read32be_with_16le_device_handler(handler, device, offset * 2 + 1, mem_mask >> 0) << 0;
+ result |= (UINT64)read32be_with_16le_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 0) << 0;
return result;
}
-INLINE void write64be_with_16le_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_16le_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
- write32be_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32);
+ write32be_with_16le_device_handler(handler, device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
if (ACCESSING_BITS_0_31)
- write32be_with_16le_device_handler(handler, device, offset * 2 + 1, data >> 0, mem_mask >> 0);
+ write32be_with_16le_device_handler(handler, device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
}
@@ -417,23 +417,23 @@ INLINE void write64be_with_16le_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 0, mem_mask >> 0) << 0;
+ result |= (UINT64)read32le_with_16be_device_handler(handler, device, space, offset * 2 + 0, mem_mask >> 0) << 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)read32le_with_16be_device_handler(handler, device, offset * 2 + 1, mem_mask >> 32) << 32;
+ result |= (UINT64)read32le_with_16be_device_handler(handler, device, space, offset * 2 + 1, mem_mask >> 32) << 32;
return result;
}
-INLINE void write64le_with_16be_device_handler(write16_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_16be_device_handler(write16_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
- write32le_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0);
+ write32le_with_16be_device_handler(handler, device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
if (ACCESSING_BITS_32_63)
- write32le_with_16be_device_handler(handler, device, offset * 2 + 1, data >> 32, mem_mask >> 32);
+ write32le_with_16be_device_handler(handler, device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
}
@@ -443,23 +443,23 @@ INLINE void write64le_with_16be_device_handler(write16_device_func handler, devi
*
*************************************/
-INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 32) << 32;
+ result |= (UINT64)(*handler)(device, space, offset * 2 + 0, mem_mask >> 32) << 32;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 0) << 0;
+ result |= (UINT64)(*handler)(device, space, offset * 2 + 1, mem_mask >> 0) << 0;
return result;
}
-INLINE void write64be_with_32be_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_32be_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
- (*handler)(device, offset * 2 + 0, data >> 32, mem_mask >> 32);
+ (*handler)(device, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
if (ACCESSING_BITS_0_31)
- (*handler)(device, offset * 2 + 1, data >> 0, mem_mask >> 0);
+ (*handler)(device, space, offset * 2 + 1, data >> 0, mem_mask >> 0);
}
@@ -469,23 +469,23 @@ INLINE void write64be_with_32be_device_handler(write32_device_func handler, devi
*
*************************************/
-INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
- result |= (UINT64)(*handler)(device, offset * 2 + 0, mem_mask >> 0) << 0;
+ result |= (UINT64)(*handler)(device, space, offset * 2 + 0, mem_mask >> 0) << 0;
if (ACCESSING_BITS_32_63)
- result |= (UINT64)(*handler)(device, offset * 2 + 1, mem_mask >> 32) << 32;
+ result |= (UINT64)(*handler)(device, space, offset * 2 + 1, mem_mask >> 32) << 32;
return result;
}
-INLINE void write64le_with_32le_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_32le_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
- (*handler)(device, offset * 2 + 0, data >> 0, mem_mask >> 0);
+ (*handler)(device, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
if (ACCESSING_BITS_32_63)
- (*handler)(device, offset * 2 + 1, data >> 32, mem_mask >> 32);
+ (*handler)(device, space, offset * 2 + 1, data >> 32, mem_mask >> 32);
}
@@ -495,20 +495,20 @@ INLINE void write64le_with_32le_device_handler(write32_device_func handler, devi
*
*************************************/
-INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result;
mem_mask = FLIPENDIAN_INT64(mem_mask);
- result = read64le_with_32le_device_handler(handler, device, offset, mem_mask);
+ result = read64le_with_32le_device_handler(handler, device, space, offset, mem_mask);
return FLIPENDIAN_INT64(result);
}
-INLINE void write64be_with_32le_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_32le_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
data = FLIPENDIAN_INT64(data);
mem_mask = FLIPENDIAN_INT64(mem_mask);
- write64le_with_32le_device_handler(handler, device, offset, data, mem_mask);
+ write64le_with_32le_device_handler(handler, device, space, offset, data, mem_mask);
}
@@ -518,20 +518,20 @@ INLINE void write64be_with_32le_device_handler(write32_device_func handler, devi
*
*************************************/
-INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, device_t *device, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result;
mem_mask = FLIPENDIAN_INT64(mem_mask);
- result = read64be_with_32be_device_handler(handler, device, offset, mem_mask);
+ result = read64be_with_32be_device_handler(handler, device, space, offset, mem_mask);
return FLIPENDIAN_INT64(result);
}
-INLINE void write64le_with_32be_device_handler(write32_device_func handler, device_t *device, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_32be_device_handler(write32_device_func handler, device_t *device, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
data = FLIPENDIAN_INT64(data);
mem_mask = FLIPENDIAN_INT64(mem_mask);
- write64be_with_32be_device_handler(handler, device, offset, data, mem_mask);
+ write64be_with_32be_device_handler(handler, device, space, offset, data, mem_mask);
}
@@ -545,28 +545,28 @@ INLINE void write64le_with_32be_device_handler(write32_device_func handler, devi
#define DEV_READ_TEMPLATE(bits, name, handler, func) \
READ##bits##_DEVICE_HANDLER( name##_r ) \
{ \
- return func(handler, device, offset, mem_mask); \
+ return func(handler, device, space, offset, mem_mask); \
}
#define DEV_READ_TEMPLATE_COND(bits, name, handler, func, cond) \
READ##bits##_DEVICE_HANDLER( name##_r ) \
{ \
if (cond) \
- return func(handler, device, offset, mem_mask); \
+ return func(handler, device, space, offset, mem_mask); \
return 0; \
}
#define DEV_WRITE_TEMPLATE(bits, name, handler, func) \
WRITE##bits##_DEVICE_HANDLER( name##_w ) \
{ \
- func(handler, device, offset, data, mem_mask); \
+ func(handler, device, space, offset, data, mem_mask); \
}
#define DEV_WRITE_TEMPLATE_COND(bits, name, handler, func, cond) \
WRITE##bits##_DEVICE_HANDLER( name##_w ) \
{ \
if (cond) \
- func(handler, device, offset, data, mem_mask); \
+ func(handler, device, space, offset, data, mem_mask); \
}
diff --git a/src/emu/dimemory.c b/src/emu/dimemory.c
index 1f6113937a1..1c33794ac95 100644
--- a/src/emu/dimemory.c
+++ b/src/emu/dimemory.c
@@ -323,9 +323,9 @@ void device_memory_interface::interface_validity_check(validity_checker &valid)
}
// make sure all devices exist
- if (entry->m_read.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_read.m_tag && device().siblingdevice(entry->m_read.m_tag) == NULL)
+ if (entry->m_read.m_type == AMH_DEVICE_DELEGATE && entry->m_read.m_tag && device().siblingdevice(entry->m_read.m_tag) == NULL)
mame_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig->m_name, entry->m_read.m_tag.cstr());
- if (entry->m_write.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_write.m_tag && device().siblingdevice(entry->m_write.m_tag) == NULL)
+ if (entry->m_write.m_type == AMH_DEVICE_DELEGATE && entry->m_write.m_tag && device().siblingdevice(entry->m_write.m_tag) == NULL)
mame_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig->m_name, entry->m_write.m_tag.cstr());
// make sure ports exist
diff --git a/src/emu/driver.c b/src/emu/driver.c
index a2cdb5c08d5..d0fd75f7030 100644
--- a/src/emu/driver.c
+++ b/src/emu/driver.c
@@ -51,6 +51,7 @@
driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag)
: device_t(mconfig, type, "Driver Device", tag, NULL, 0),
+ device_memory_interface(mconfig, *this),
m_generic_paletteram_8(*this, "paletteram"),
m_generic_paletteram2_8(*this, "paletteram2"),
m_generic_paletteram_16(*this, "paletteram"),
@@ -58,6 +59,7 @@ driver_device::driver_device(const machine_config &mconfig, device_type type, co
m_generic_paletteram_32(*this, "paletteram"),
m_generic_paletteram2_32(*this, "paletteram2"),
m_system(NULL),
+ m_generic_space_config("generic", ENDIANNESS_LITTLE, 8, 8),
m_latch_clear_value(0),
m_flip_screen_x(0),
m_flip_screen_y(0)
@@ -313,6 +315,17 @@ void driver_device::device_reset_after_children()
}
+//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *driver_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_generic_space_config : NULL;
+}
+
+
//**************************************************************************
// INTERRUPT ENABLE AND VECTOR HELPERS
diff --git a/src/emu/driver.h b/src/emu/driver.h
index d53ddf536a3..d389e42c74a 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -166,7 +166,8 @@ typedef void (*legacy_callback_func)(running_machine &machine);
// ======================> driver_device
// base class for machine driver-specific devices
-class driver_device : public device_t
+class driver_device : public device_t,
+ public device_memory_interface
{
public:
// construction/destruction
@@ -201,7 +202,11 @@ public:
(machine.driver_data<_DriverClass>()->*_Function)();
}
- void init_0() {};
+ // dummy driver_init callbacks
+ void init_0() { }
+
+ // memory helpers
+ address_space &generic_space() const { return *space(AS_PROGRAM); }
// generic interrupt generators
void generic_pulse_irq_line(device_execute_interface &exec, int irqline, int cycles);
@@ -399,6 +404,9 @@ protected:
virtual void device_start();
virtual void device_reset_after_children();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// internal helpers
inline UINT16 paletteram16_le(offs_t offset) const { return m_generic_paletteram_8[offset & ~1] | (m_generic_paletteram_8[offset | 1] << 8); }
inline UINT16 paletteram16_be(offs_t offset) const { return m_generic_paletteram_8[offset | 1] | (m_generic_paletteram_8[offset & ~1] << 8); }
@@ -425,6 +433,9 @@ private:
driver_callback_delegate m_callbacks[CB_COUNT]; // start/reset callbacks
legacy_callback_func m_legacy_callbacks[CB_COUNT]; // legacy start/reset callbacks
+ // memory state
+ address_space_config m_generic_space_config;
+
// generic audio
UINT16 m_latch_clear_value;
UINT16 m_latched_value[4];
diff --git a/src/emu/imagedev/flopdrv.h b/src/emu/imagedev/flopdrv.h
index 8f113b711f6..a56d09e9a69 100644
--- a/src/emu/imagedev/flopdrv.h
+++ b/src/emu/imagedev/flopdrv.h
@@ -155,7 +155,7 @@ WRITE_LINE_DEVICE_HANDLER( floppy_ds0_w );
WRITE_LINE_DEVICE_HANDLER( floppy_ds1_w );
WRITE_LINE_DEVICE_HANDLER( floppy_ds2_w );
WRITE_LINE_DEVICE_HANDLER( floppy_ds3_w );
-WRITE8_DEVICE_HANDLER( floppy_ds_w );
+DECLARE_WRITE8_DEVICE_HANDLER( floppy_ds_w );
WRITE_LINE_DEVICE_HANDLER( floppy_mon_w );
WRITE_LINE_DEVICE_HANDLER( floppy_drtn_w );
diff --git a/src/emu/machine/6525tpi.h b/src/emu/machine/6525tpi.h
index 548dd4b4532..a777f978eb9 100644
--- a/src/emu/machine/6525tpi.h
+++ b/src/emu/machine/6525tpi.h
@@ -86,17 +86,17 @@ extern const device_type TPI6525;
FUNCTION PROTOTYPES
***************************************************************************/
-READ8_DEVICE_HANDLER( tpi6525_r );
-WRITE8_DEVICE_HANDLER( tpi6525_w );
+DECLARE_READ8_DEVICE_HANDLER( tpi6525_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_w );
-READ8_DEVICE_HANDLER( tpi6525_porta_r );
-WRITE8_DEVICE_HANDLER( tpi6525_porta_w );
+DECLARE_READ8_DEVICE_HANDLER( tpi6525_porta_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_porta_w );
-READ8_DEVICE_HANDLER( tpi6525_portb_r );
-WRITE8_DEVICE_HANDLER( tpi6525_portb_w );
+DECLARE_READ8_DEVICE_HANDLER( tpi6525_portb_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_portb_w );
-READ8_DEVICE_HANDLER( tpi6525_portc_r );
-WRITE8_DEVICE_HANDLER( tpi6525_portc_w );
+DECLARE_READ8_DEVICE_HANDLER( tpi6525_portc_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tpi6525_portc_w );
WRITE_LINE_DEVICE_HANDLER( tpi6525_i0_w );
WRITE_LINE_DEVICE_HANDLER( tpi6525_i1_w );
diff --git a/src/emu/machine/6526cia.h b/src/emu/machine/6526cia.h
index ea17eeae9d7..5ba57e1e7bc 100644
--- a/src/emu/machine/6526cia.h
+++ b/src/emu/machine/6526cia.h
@@ -268,12 +268,12 @@ extern const device_type MOS5710;
***************************************************************************/
/* register access */
-READ8_DEVICE_HANDLER( mos6526_r );
-WRITE8_DEVICE_HANDLER( mos6526_w );
+DECLARE_READ8_DEVICE_HANDLER( mos6526_r );
+DECLARE_WRITE8_DEVICE_HANDLER( mos6526_w );
/* port access */
-READ8_DEVICE_HANDLER( mos6526_pa_r );
-READ8_DEVICE_HANDLER( mos6526_pb_r );
+DECLARE_READ8_DEVICE_HANDLER( mos6526_pa_r );
+DECLARE_READ8_DEVICE_HANDLER( mos6526_pb_r );
/* interrupt request */
READ_LINE_DEVICE_HANDLER( mos6526_irq_r );
diff --git a/src/emu/machine/6532riot.h b/src/emu/machine/6532riot.h
index 88ee8482e93..d82e946c4b8 100644
--- a/src/emu/machine/6532riot.h
+++ b/src/emu/machine/6532riot.h
@@ -121,8 +121,8 @@ extern const device_type RIOT6532;
PROTOTYPES
***************************************************************************/
-READ8_DEVICE_HANDLER( riot6532_r );
-WRITE8_DEVICE_HANDLER( riot6532_w );
+DECLARE_READ8_DEVICE_HANDLER( riot6532_r );
+DECLARE_WRITE8_DEVICE_HANDLER( riot6532_w );
void riot6532_porta_in_set(device_t *device, UINT8 data, UINT8 mask);
void riot6532_portb_in_set(device_t *device, UINT8 data, UINT8 mask);
diff --git a/src/emu/machine/68681.h b/src/emu/machine/68681.h
index 6de4665ded5..1a4b248bd91 100644
--- a/src/emu/machine/68681.h
+++ b/src/emu/machine/68681.h
@@ -40,8 +40,8 @@ extern const device_type DUART68681;
MCFG_DEVICE_CONFIG(_config)
-READ8_DEVICE_HANDLER(duart68681_r);
-WRITE8_DEVICE_HANDLER(duart68681_w);
+DECLARE_READ8_DEVICE_HANDLER(duart68681_r);
+DECLARE_WRITE8_DEVICE_HANDLER(duart68681_w);
void duart68681_rx_data( device_t* device, int ch, UINT8 data );
diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c
index eac124eeae4..526c7d47d88 100644
--- a/src/emu/machine/74123.c
+++ b/src/emu/machine/74123.c
@@ -55,7 +55,6 @@ void ttl74123_device::device_config_complete()
m_a = 0;
m_b = 0;
m_clear = 0;
- memset(&m_output_changed_cb, 0, sizeof(m_output_changed_cb));
}
}
@@ -66,6 +65,8 @@ void ttl74123_device::device_config_complete()
void ttl74123_device::device_start()
{
+ m_output_changed.resolve(m_output_changed_cb, *this);
+
m_timer = machine().scheduler().timer_alloc(FUNC(clear_callback), (void *)this);
/* register for state saving */
@@ -145,7 +146,7 @@ TIMER_CALLBACK( ttl74123_device::output_callback )
void ttl74123_device::output(INT32 param)
{
- m_output_changed_cb(this, 0, param);
+ m_output_changed(0, param);
}
@@ -177,7 +178,7 @@ void ttl74123_device::clear()
{
int output = timer_running();
- m_output_changed_cb(this, 0, output);
+ m_output_changed(0, output);
}
diff --git a/src/emu/machine/74123.h b/src/emu/machine/74123.h
index 1338c4e825d..c7cafe200d9 100644
--- a/src/emu/machine/74123.h
+++ b/src/emu/machine/74123.h
@@ -82,7 +82,7 @@ struct ttl74123_interface
int m_a; /* initial/constant value of the A pin */
int m_b; /* initial/constant value of the B pin */
int m_clear; /* initial/constant value of the Clear pin */
- write8_device_func m_output_changed_cb;
+ devcb_write8 m_output_changed_cb;
};
@@ -122,6 +122,7 @@ private:
void clear();
emu_timer *m_timer;
+ devcb_resolved_write8 m_output_changed;
};
@@ -134,9 +135,9 @@ extern const device_type TTL74123;
PROTOTYPES
***************************************************************************/
-WRITE8_DEVICE_HANDLER( ttl74123_a_w );
-WRITE8_DEVICE_HANDLER( ttl74123_b_w );
-WRITE8_DEVICE_HANDLER( ttl74123_clear_w );
-WRITE8_DEVICE_HANDLER( ttl74123_reset_w ); /* reset the latch */
+DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_clear_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ttl74123_reset_w ); /* reset the latch */
#endif
diff --git a/src/emu/machine/8237dma.h b/src/emu/machine/8237dma.h
index 864aba746ad..94e285b1248 100644
--- a/src/emu/machine/8237dma.h
+++ b/src/emu/machine/8237dma.h
@@ -189,8 +189,8 @@ extern const device_type I8237;
***************************************************************************/
/* register access */
-READ8_DEVICE_HANDLER( i8237_r );
-WRITE8_DEVICE_HANDLER( i8237_w );
+DECLARE_READ8_DEVICE_HANDLER( i8237_r );
+DECLARE_WRITE8_DEVICE_HANDLER( i8237_w );
/* hold acknowledge */
WRITE_LINE_DEVICE_HANDLER( i8237_hlda_w );
diff --git a/src/emu/machine/8257dma.h b/src/emu/machine/8257dma.h
index 0c96150dfa7..365496fc604 100644
--- a/src/emu/machine/8257dma.h
+++ b/src/emu/machine/8257dma.h
@@ -147,8 +147,8 @@ extern const device_type I8257;
***************************************************************************/
/* register access */
-READ8_DEVICE_HANDLER( i8257_r );
-WRITE8_DEVICE_HANDLER( i8257_w );
+DECLARE_READ8_DEVICE_HANDLER( i8257_r );
+DECLARE_WRITE8_DEVICE_HANDLER( i8257_w );
/* hold acknowledge */
WRITE_LINE_DEVICE_HANDLER( i8257_hlda_w );
diff --git a/src/emu/machine/adc1213x.h b/src/emu/machine/adc1213x.h
index d0a2d39c814..0fed72a1064 100644
--- a/src/emu/machine/adc1213x.h
+++ b/src/emu/machine/adc1213x.h
@@ -82,11 +82,11 @@ struct adc12138_interface
PROTOTYPES
***************************************************************************/
-extern WRITE8_DEVICE_HANDLER( adc1213x_di_w );
-extern WRITE8_DEVICE_HANDLER( adc1213x_cs_w );
-extern WRITE8_DEVICE_HANDLER( adc1213x_sclk_w );
-extern WRITE8_DEVICE_HANDLER( adc1213x_conv_w );
-extern READ8_DEVICE_HANDLER( adc1213x_do_r );
-extern READ8_DEVICE_HANDLER( adc1213x_eoc_r );
+extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_di_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_cs_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_sclk_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( adc1213x_conv_w );
+extern DECLARE_READ8_DEVICE_HANDLER( adc1213x_do_r );
+extern DECLARE_READ8_DEVICE_HANDLER( adc1213x_eoc_r );
#endif /* __ADC1213X_H__ */
diff --git a/src/emu/machine/at28c16.h b/src/emu/machine/at28c16.h
index d81fe6abe0e..81206458bef 100644
--- a/src/emu/machine/at28c16.h
+++ b/src/emu/machine/at28c16.h
@@ -84,8 +84,8 @@ extern const device_type AT28C16;
// READ/WRITE HANDLERS
//**************************************************************************
-WRITE8_DEVICE_HANDLER( at28c16_w );
-READ8_DEVICE_HANDLER( at28c16_r );
+DECLARE_WRITE8_DEVICE_HANDLER( at28c16_w );
+DECLARE_READ8_DEVICE_HANDLER( at28c16_r );
WRITE_LINE_DEVICE_HANDLER( at28c16_a9_12v );
WRITE_LINE_DEVICE_HANDLER( at28c16_oe_12v );
diff --git a/src/emu/machine/ds2404.h b/src/emu/machine/ds2404.h
index 8f28e2164c4..6870536e720 100644
--- a/src/emu/machine/ds2404.h
+++ b/src/emu/machine/ds2404.h
@@ -128,13 +128,13 @@ extern const device_type DS2404;
***************************************************************************/
/* 1-wire interface reset */
-WRITE8_DEVICE_HANDLER( ds2404_1w_reset_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ds2404_1w_reset_w );
/* 3-wire interface reset */
-WRITE8_DEVICE_HANDLER( ds2404_3w_reset_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ds2404_3w_reset_w );
-READ8_DEVICE_HANDLER( ds2404_data_r );
-WRITE8_DEVICE_HANDLER( ds2404_data_w );
-WRITE8_DEVICE_HANDLER( ds2404_clk_w );
+DECLARE_READ8_DEVICE_HANDLER( ds2404_data_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ds2404_data_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ds2404_clk_w );
#endif
diff --git a/src/emu/machine/f3853.h b/src/emu/machine/f3853.h
index 9ee50c68c13..cec1fbb48e2 100644
--- a/src/emu/machine/f3853.h
+++ b/src/emu/machine/f3853.h
@@ -120,8 +120,8 @@ extern const device_type F3853;
PROTOTYPES
***************************************************************************/
-READ8_DEVICE_HANDLER( f3853_r );
-WRITE8_DEVICE_HANDLER( f3853_w );
+DECLARE_READ8_DEVICE_HANDLER( f3853_r );
+DECLARE_WRITE8_DEVICE_HANDLER( f3853_w );
void f3853_set_external_interrupt_in_line(device_t *device, int level);
void f3853_set_priority_in_line(device_t *device, int level);
diff --git a/src/emu/machine/i8243.h b/src/emu/machine/i8243.h
index 325a1bdf5ba..881deec4bcb 100644
--- a/src/emu/machine/i8243.h
+++ b/src/emu/machine/i8243.h
@@ -88,10 +88,10 @@ extern const device_type I8243;
PROTOTYPES
***************************************************************************/
-READ8_DEVICE_HANDLER( i8243_p2_r );
-WRITE8_DEVICE_HANDLER( i8243_p2_w );
+DECLARE_READ8_DEVICE_HANDLER( i8243_p2_r );
+DECLARE_WRITE8_DEVICE_HANDLER( i8243_p2_w );
-WRITE8_DEVICE_HANDLER( i8243_prog_w );
+DECLARE_WRITE8_DEVICE_HANDLER( i8243_prog_w );
#endif /* __I8243_H__ */
diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h
index d45b652f8f7..7496f814a30 100644
--- a/src/emu/machine/idectrl.h
+++ b/src/emu/machine/idectrl.h
@@ -172,15 +172,15 @@ void ide_bus_w(device_t *config, int select, int offset, int data);
UINT32 ide_controller_r(device_t *config, int reg, int size);
void ide_controller_w(device_t *config, int reg, int size, UINT32 data);
-READ32_DEVICE_HANDLER( ide_controller32_r );
-WRITE32_DEVICE_HANDLER( ide_controller32_w );
-READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r );
-WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w );
-READ32_DEVICE_HANDLER( ide_bus_master32_r );
-WRITE32_DEVICE_HANDLER( ide_bus_master32_w );
-
-READ16_DEVICE_HANDLER( ide_controller16_r );
-WRITE16_DEVICE_HANDLER( ide_controller16_w );
+DECLARE_READ32_DEVICE_HANDLER( ide_controller32_r );
+DECLARE_WRITE32_DEVICE_HANDLER( ide_controller32_w );
+DECLARE_READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r );
+DECLARE_WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w );
+DECLARE_READ32_DEVICE_HANDLER( ide_bus_master32_r );
+DECLARE_WRITE32_DEVICE_HANDLER( ide_bus_master32_w );
+
+DECLARE_READ16_DEVICE_HANDLER( ide_controller16_r );
+DECLARE_WRITE16_DEVICE_HANDLER( ide_controller16_w );
/* ----- device interface ----- */
diff --git a/src/emu/machine/ins8154.h b/src/emu/machine/ins8154.h
index 1857a428223..12b691baf5f 100644
--- a/src/emu/machine/ins8154.h
+++ b/src/emu/machine/ins8154.h
@@ -116,11 +116,11 @@ extern const device_type INS8154;
PROTOTYPES
***************************************************************************/
-READ8_DEVICE_HANDLER( ins8154_r );
-WRITE8_DEVICE_HANDLER( ins8154_w );
+DECLARE_READ8_DEVICE_HANDLER( ins8154_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ins8154_w );
-WRITE8_DEVICE_HANDLER( ins8154_porta_w );
-WRITE8_DEVICE_HANDLER( ins8154_portb_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ins8154_porta_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ins8154_portb_w );
#endif /* __INS8154_H__ */
diff --git a/src/emu/machine/k033906.h b/src/emu/machine/k033906.h
index 7a46d253539..2e2521ff52c 100644
--- a/src/emu/machine/k033906.h
+++ b/src/emu/machine/k033906.h
@@ -81,8 +81,8 @@ extern const device_type K033906;
PROTOTYPES
***************************************************************************/
-extern READ32_DEVICE_HANDLER( k033906_r );
-extern WRITE32_DEVICE_HANDLER( k033906_w );
+extern DECLARE_READ32_DEVICE_HANDLER( k033906_r );
+extern DECLARE_WRITE32_DEVICE_HANDLER( k033906_w );
extern WRITE_LINE_DEVICE_HANDLER( k033906_set_reg );
diff --git a/src/emu/machine/k053252.h b/src/emu/machine/k053252.h
index 9b714d1c123..8a1f352f063 100644
--- a/src/emu/machine/k053252.h
+++ b/src/emu/machine/k053252.h
@@ -49,8 +49,8 @@ struct k053252_interface
/** Konami 053252 **/
/* CRT and interrupt control unit */
-READ8_DEVICE_HANDLER( k053252_r ); // CCU registers
-WRITE8_DEVICE_HANDLER( k053252_w );
+DECLARE_READ8_DEVICE_HANDLER( k053252_r ); // CCU registers
+DECLARE_WRITE8_DEVICE_HANDLER( k053252_w );
diff --git a/src/emu/machine/k056230.h b/src/emu/machine/k056230.h
index 5d6d67ec103..99a7df8957b 100644
--- a/src/emu/machine/k056230.h
+++ b/src/emu/machine/k056230.h
@@ -80,10 +80,10 @@ extern const device_type K056230;
PROTOTYPES
***************************************************************************/
-extern READ32_DEVICE_HANDLER( lanc_ram_r );
-extern WRITE32_DEVICE_HANDLER( lanc_ram_w );
-extern READ8_DEVICE_HANDLER( k056230_r );
-extern WRITE8_DEVICE_HANDLER( k056230_w );
+extern DECLARE_READ32_DEVICE_HANDLER( lanc_ram_r );
+extern DECLARE_WRITE32_DEVICE_HANDLER( lanc_ram_w );
+extern DECLARE_READ8_DEVICE_HANDLER( k056230_r );
+extern DECLARE_WRITE8_DEVICE_HANDLER( k056230_w );
#endif /* __K056230_H__ */
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index 193ad9abf61..ed99bff2ea0 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -42,7 +42,7 @@ static void update(device_t *device, UINT8 new_val, UINT8 mask)
UINT8 changed = old_val ^ latch8->value;
for (i=0; i<8; i++)
if (((changed & (1<<i)) != 0) && latch8->intf->node_map[i] != 0)
- discrete_sound_w(device->machine().device(latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
+ discrete_sound_w(device->machine().device(latch8->intf->node_device[i]), device->machine().driver_data()->generic_space(), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
}
}
@@ -74,14 +74,14 @@ READ8_DEVICE_HANDLER( latch8_r )
if (read_dev != NULL)
{
res &= ~( 1 << i);
- res |= ((latch8->intf->devread[i].devread_handler(read_dev, 0) >> latch8->intf->devread[i].from_bit) & 0x01) << i;
+ res |= ((latch8->intf->devread[i].devread_handler(read_dev, device->machine().driver_data()->generic_space(), 0, 0xff) >> latch8->intf->devread[i].from_bit) & 0x01) << i;
}
}
}
if (latch8->has_read)
{
/* temporary hack until all relevant systems are devices */
- address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
+ address_space *space = &device->machine().driver_data()->generic_space();
int i;
for (i=0; i<8; i++)
{
diff --git a/src/emu/machine/latch8.h b/src/emu/machine/latch8.h
index a17b7a1839e..e196147398d 100644
--- a/src/emu/machine/latch8.h
+++ b/src/emu/machine/latch8.h
@@ -126,47 +126,47 @@ extern const device_type LATCH8;
/* write & read full byte */
-READ8_DEVICE_HANDLER( latch8_r );
-WRITE8_DEVICE_HANDLER( latch8_w );
+DECLARE_READ8_DEVICE_HANDLER( latch8_r );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_w );
/* reset the latch */
-WRITE8_DEVICE_HANDLER( latch8_reset );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_reset );
/* read bit x */
/* return (latch >> x) & 0x01 */
-READ8_DEVICE_HANDLER( latch8_bit0_r );
-READ8_DEVICE_HANDLER( latch8_bit1_r );
-READ8_DEVICE_HANDLER( latch8_bit2_r );
-READ8_DEVICE_HANDLER( latch8_bit3_r );
-READ8_DEVICE_HANDLER( latch8_bit4_r );
-READ8_DEVICE_HANDLER( latch8_bit5_r );
-READ8_DEVICE_HANDLER( latch8_bit6_r );
-READ8_DEVICE_HANDLER( latch8_bit7_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit0_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit1_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit2_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit3_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit4_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit5_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit6_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit7_r );
/* read inverted bit x */
/* return (latch >> x) & 0x01 */
-READ8_DEVICE_HANDLER( latch8_bit0_q_r );
-READ8_DEVICE_HANDLER( latch8_bit1_q_r );
-READ8_DEVICE_HANDLER( latch8_bit2_q_r );
-READ8_DEVICE_HANDLER( latch8_bit3_q_r );
-READ8_DEVICE_HANDLER( latch8_bit4_q_r );
-READ8_DEVICE_HANDLER( latch8_bit5_q_r );
-READ8_DEVICE_HANDLER( latch8_bit6_q_r );
-READ8_DEVICE_HANDLER( latch8_bit7_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit0_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit1_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit2_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit3_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit4_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit5_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit6_q_r );
+DECLARE_READ8_DEVICE_HANDLER( latch8_bit7_q_r );
/* write bit x from data into bit determined by offset */
/* latch = (latch & ~(1<<offset)) | (((data >> x) & 0x01) << offset) */
-WRITE8_DEVICE_HANDLER( latch8_bit0_w );
-WRITE8_DEVICE_HANDLER( latch8_bit1_w );
-WRITE8_DEVICE_HANDLER( latch8_bit2_w );
-WRITE8_DEVICE_HANDLER( latch8_bit3_w );
-WRITE8_DEVICE_HANDLER( latch8_bit4_w );
-WRITE8_DEVICE_HANDLER( latch8_bit5_w );
-WRITE8_DEVICE_HANDLER( latch8_bit6_w );
-WRITE8_DEVICE_HANDLER( latch8_bit7_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit0_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit1_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit2_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit3_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit4_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit5_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit6_w );
+DECLARE_WRITE8_DEVICE_HANDLER( latch8_bit7_w );
#endif /* __LATCH8_H_ */
diff --git a/src/emu/machine/mb14241.h b/src/emu/machine/mb14241.h
index bd39245a5c1..8155b03d318 100644
--- a/src/emu/machine/mb14241.h
+++ b/src/emu/machine/mb14241.h
@@ -43,9 +43,9 @@ extern const device_type MB14241;
DEVICE I/O FUNCTIONS
***************************************************************************/
-WRITE8_DEVICE_HANDLER ( mb14241_shift_count_w );
-WRITE8_DEVICE_HANDLER ( mb14241_shift_data_w );
-READ8_DEVICE_HANDLER( mb14241_shift_result_r );
+DECLARE_WRITE8_DEVICE_HANDLER ( mb14241_shift_count_w );
+DECLARE_WRITE8_DEVICE_HANDLER ( mb14241_shift_data_w );
+DECLARE_READ8_DEVICE_HANDLER( mb14241_shift_result_r );
#endif /* __MB14241_H__ */
diff --git a/src/emu/machine/pd4990a.h b/src/emu/machine/pd4990a.h
index 3772546835b..b5d5b57c7ac 100644
--- a/src/emu/machine/pd4990a.h
+++ b/src/emu/machine/pd4990a.h
@@ -48,9 +48,9 @@ extern const device_type UPD4990A;
/* this should be refactored, once RTCs get unified */
extern void upd4990a_addretrace( device_t *device );
-extern READ8_DEVICE_HANDLER( upd4990a_testbit_r );
-extern READ8_DEVICE_HANDLER( upd4990a_databit_r );
-extern WRITE16_DEVICE_HANDLER( upd4990a_control_16_w );
+extern DECLARE_READ8_DEVICE_HANDLER( upd4990a_testbit_r );
+extern DECLARE_READ8_DEVICE_HANDLER( upd4990a_databit_r );
+extern DECLARE_WRITE16_DEVICE_HANDLER( upd4990a_control_16_w );
#endif /*__PD4990A_H__*/
diff --git a/src/emu/machine/pic8259.h b/src/emu/machine/pic8259.h
index 99f24b62fed..13a77b94e31 100644
--- a/src/emu/machine/pic8259.h
+++ b/src/emu/machine/pic8259.h
@@ -74,8 +74,8 @@ struct pic8259_interface
/* device interface */
-READ8_DEVICE_HANDLER( pic8259_r );
-WRITE8_DEVICE_HANDLER( pic8259_w );
+DECLARE_READ8_DEVICE_HANDLER( pic8259_r );
+DECLARE_WRITE8_DEVICE_HANDLER( pic8259_w );
int pic8259_acknowledge(device_t *device);
/* interrupt requests */
diff --git a/src/emu/machine/pit8253.h b/src/emu/machine/pit8253.h
index c4af119903b..ad2247222a0 100644
--- a/src/emu/machine/pit8253.h
+++ b/src/emu/machine/pit8253.h
@@ -85,8 +85,8 @@ extern const device_type PIT8254;
MCFG_DEVICE_CONFIG(_intrf)
-READ8_DEVICE_HANDLER( pit8253_r );
-WRITE8_DEVICE_HANDLER( pit8253_w );
+DECLARE_READ8_DEVICE_HANDLER( pit8253_r );
+DECLARE_WRITE8_DEVICE_HANDLER( pit8253_w );
WRITE_LINE_DEVICE_HANDLER( pit8253_clk0_w );
WRITE_LINE_DEVICE_HANDLER( pit8253_clk1_w );
diff --git a/src/emu/machine/rp5h01.h b/src/emu/machine/rp5h01.h
index 5e798ed780e..e784fa4f15f 100644
--- a/src/emu/machine/rp5h01.h
+++ b/src/emu/machine/rp5h01.h
@@ -48,12 +48,12 @@ extern const device_type RP5H01;
PROTOTYPES
***************************************************************************/
-WRITE8_DEVICE_HANDLER( rp5h01_enable_w ); /* /CE */
-WRITE8_DEVICE_HANDLER( rp5h01_reset_w ); /* RESET */
-WRITE8_DEVICE_HANDLER( rp5h01_cs_w ); /* CS */
-WRITE8_DEVICE_HANDLER( rp5h01_clock_w ); /* DATA CLOCK (active low) */
-WRITE8_DEVICE_HANDLER( rp5h01_test_w ); /* TEST */
-READ8_DEVICE_HANDLER( rp5h01_counter_r ); /* COUNTER OUT */
-READ8_DEVICE_HANDLER( rp5h01_data_r ); /* DATA */
+DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_enable_w ); /* /CE */
+DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_reset_w ); /* RESET */
+DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_cs_w ); /* CS */
+DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_clock_w ); /* DATA CLOCK (active low) */
+DECLARE_WRITE8_DEVICE_HANDLER( rp5h01_test_w ); /* TEST */
+DECLARE_READ8_DEVICE_HANDLER( rp5h01_counter_r ); /* COUNTER OUT */
+DECLARE_READ8_DEVICE_HANDLER( rp5h01_data_r ); /* DATA */
#endif /* __RP5H01_H__ */
diff --git a/src/emu/machine/s3c2410.h b/src/emu/machine/s3c2410.h
index 0ed2cf85c2e..98944c1eac9 100644
--- a/src/emu/machine/s3c2410.h
+++ b/src/emu/machine/s3c2410.h
@@ -63,7 +63,7 @@ public:
extern const device_type S3C2410;
-READ32_DEVICE_HANDLER( s3c2410_lcd_r );
+DECLARE_READ32_DEVICE_HANDLER( s3c2410_lcd_r );
/*******************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c
index e4327310f7e..500b96e85e5 100644
--- a/src/emu/machine/s3c24xx.c
+++ b/src/emu/machine/s3c24xx.c
@@ -2686,7 +2686,7 @@ INLINE void iface_i2s_data_w( device_t *device, int ch, UINT16 data)
s3c24xx_t *s3c24xx = get_token( device);
if (s3c24xx->iface->i2s.data_w)
{
- (s3c24xx->iface->i2s.data_w)( device, ch, data, 0);
+ (s3c24xx->iface->i2s.data_w)( device, device->machine().driver_data()->generic_space(), ch, data, 0);
}
}
@@ -2949,7 +2949,7 @@ static UINT32 iface_adc_data_r( device_t *device, int ch)
offs += 2;
}
#endif
- return (s3c24xx->iface->adc.data_r)( device, offs, 0);
+ return (s3c24xx->iface->adc.data_r)( device, device->machine().driver_data()->generic_space(), offs, 0);
}
else
{
@@ -3181,7 +3181,7 @@ INLINE void iface_nand_command_w( device_t *device, UINT8 data)
s3c24xx_t *s3c24xx = get_token( device);
if (s3c24xx->iface->nand.command_w)
{
- (s3c24xx->iface->nand.command_w)( device, 0, data);
+ (s3c24xx->iface->nand.command_w)( device, device->machine().driver_data()->generic_space(), 0, data, 0xff);
}
}
@@ -3190,7 +3190,7 @@ INLINE void iface_nand_address_w( device_t *device, UINT8 data)
s3c24xx_t *s3c24xx = get_token( device);
if (s3c24xx->iface->nand.address_w)
{
- (s3c24xx->iface->nand.address_w)( device, 0, data);
+ (s3c24xx->iface->nand.address_w)( device, device->machine().driver_data()->generic_space(), 0, data, 0xff);
}
}
@@ -3199,7 +3199,7 @@ INLINE UINT8 iface_nand_data_r( device_t *device)
s3c24xx_t *s3c24xx = get_token( device);
if (s3c24xx->iface->nand.data_r)
{
- return (s3c24xx->iface->nand.data_r)( device, 0);
+ return (s3c24xx->iface->nand.data_r)( device, device->machine().driver_data()->generic_space(), 0, 0xff);
}
else
{
@@ -3212,7 +3212,7 @@ INLINE void iface_nand_data_w( device_t *device, UINT8 data)
s3c24xx_t *s3c24xx = get_token( device);
if (s3c24xx->iface->nand.data_w)
{
- (s3c24xx->iface->nand.data_w)( device, 0, data);
+ (s3c24xx->iface->nand.data_w)( device, device->machine().driver_data()->generic_space(), 0, data, 0xff);
}
}
diff --git a/src/emu/machine/smc91c9x.h b/src/emu/machine/smc91c9x.h
index 038b3cc4000..380e96130bb 100644
--- a/src/emu/machine/smc91c9x.h
+++ b/src/emu/machine/smc91c9x.h
@@ -44,8 +44,8 @@ struct smc91c9x_config
FUNCTION PROTOTYPES
***************************************************************************/
-READ16_DEVICE_HANDLER( smc91c9x_r );
-WRITE16_DEVICE_HANDLER( smc91c9x_w );
+DECLARE_READ16_DEVICE_HANDLER( smc91c9x_r );
+DECLARE_WRITE16_DEVICE_HANDLER( smc91c9x_w );
/* ----- device interface ----- */
diff --git a/src/emu/machine/timekpr.h b/src/emu/machine/timekpr.h
index 4dd5cb64aa8..a312985022a 100644
--- a/src/emu/machine/timekpr.h
+++ b/src/emu/machine/timekpr.h
@@ -154,7 +154,7 @@ extern const device_type MK48T08;
// READ/WRITE HANDLERS
//**************************************************************************
-WRITE8_DEVICE_HANDLER( timekeeper_w );
-READ8_DEVICE_HANDLER( timekeeper_r );
+DECLARE_WRITE8_DEVICE_HANDLER( timekeeper_w );
+DECLARE_READ8_DEVICE_HANDLER( timekeeper_r );
#endif // __TIMEKPR_H__
diff --git a/src/emu/machine/tms6100.h b/src/emu/machine/tms6100.h
index 512446b8e62..d44ccc4e56c 100644
--- a/src/emu/machine/tms6100.h
+++ b/src/emu/machine/tms6100.h
@@ -10,7 +10,7 @@
WRITE_LINE_DEVICE_HANDLER( tms6100_m0_w );
WRITE_LINE_DEVICE_HANDLER( tms6100_m1_w );
WRITE_LINE_DEVICE_HANDLER( tms6100_romclock_w );
-WRITE8_DEVICE_HANDLER( tms6100_addr_w );
+DECLARE_WRITE8_DEVICE_HANDLER( tms6100_addr_w );
READ_LINE_DEVICE_HANDLER( tms6100_data_r );
diff --git a/src/emu/machine/upd4701.h b/src/emu/machine/upd4701.h
index e4a8fd519d5..582357a4ebc 100644
--- a/src/emu/machine/upd4701.h
+++ b/src/emu/machine/upd4701.h
@@ -44,18 +44,18 @@ extern const device_type UPD4701;
PROTOTYPES
***************************************************************************/
-extern WRITE8_DEVICE_HANDLER( upd4701_cs_w );
-extern WRITE8_DEVICE_HANDLER( upd4701_xy_w );
-extern WRITE8_DEVICE_HANDLER( upd4701_ul_w );
-extern WRITE8_DEVICE_HANDLER( upd4701_resetx_w );
-extern WRITE8_DEVICE_HANDLER( upd4701_resety_w );
-extern WRITE16_DEVICE_HANDLER( upd4701_x_add );
-extern WRITE16_DEVICE_HANDLER( upd4701_y_add );
-extern WRITE8_DEVICE_HANDLER( upd4701_switches_set );
-
-extern READ16_DEVICE_HANDLER( upd4701_d_r );
-extern READ8_DEVICE_HANDLER( upd4701_cf_r );
-extern READ8_DEVICE_HANDLER( upd4701_sf_r );
+extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_cs_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_xy_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_ul_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_resetx_w );
+extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_resety_w );
+extern DECLARE_WRITE16_DEVICE_HANDLER( upd4701_x_add );
+extern DECLARE_WRITE16_DEVICE_HANDLER( upd4701_y_add );
+extern DECLARE_WRITE8_DEVICE_HANDLER( upd4701_switches_set );
+
+extern DECLARE_READ16_DEVICE_HANDLER( upd4701_d_r );
+extern DECLARE_READ8_DEVICE_HANDLER( upd4701_cf_r );
+extern DECLARE_READ8_DEVICE_HANDLER( upd4701_sf_r );
#endif /* __UPD4701_H__ */
diff --git a/src/emu/machine/wd17xx.c b/src/emu/machine/wd17xx.c
index f40569ec4ec..db50eccc2c6 100644
--- a/src/emu/machine/wd17xx.c
+++ b/src/emu/machine/wd17xx.c
@@ -1993,10 +1993,10 @@ READ8_DEVICE_HANDLER( wd17xx_r )
switch (offset & 0x03)
{
- case 0: data = wd17xx_status_r(device, 0); break;
- case 1: data = wd17xx_track_r(device, 0); break;
- case 2: data = wd17xx_sector_r(device, 0); break;
- case 3: data = wd17xx_data_r(device, 0); break;
+ case 0: data = wd17xx_status_r(device, device->machine().driver_data()->generic_space(), 0); break;
+ case 1: data = wd17xx_track_r(device, device->machine().driver_data()->generic_space(), 0); break;
+ case 2: data = wd17xx_sector_r(device, device->machine().driver_data()->generic_space(), 0); break;
+ case 3: data = wd17xx_data_r(device, device->machine().driver_data()->generic_space(), 0); break;
}
return data;
@@ -2006,10 +2006,10 @@ WRITE8_DEVICE_HANDLER( wd17xx_w )
{
switch (offset & 0x03)
{
- case 0: wd17xx_command_w(device, 0, data); break;
- case 1: wd17xx_track_w(device, 0, data); break;
- case 2: wd17xx_sector_w(device, 0, data); break;
- case 3: wd17xx_data_w(device, 0, data); break;
+ case 0: wd17xx_command_w(device, device->machine().driver_data()->generic_space(), 0, data); break;
+ case 1: wd17xx_track_w(device, device->machine().driver_data()->generic_space(), 0, data); break;
+ case 2: wd17xx_sector_w(device, device->machine().driver_data()->generic_space(), 0, data); break;
+ case 3: wd17xx_data_w(device, device->machine().driver_data()->generic_space(), 0, data); break;
}
}
diff --git a/src/emu/machine/wd17xx.h b/src/emu/machine/wd17xx.h
index 80d85987b80..eb66952d68c 100644
--- a/src/emu/machine/wd17xx.h
+++ b/src/emu/machine/wd17xx.h
@@ -255,18 +255,18 @@ void wd17xx_set_side(device_t *device, UINT8); /* set side wd179x is accessing
void wd17xx_set_pause_time(device_t *device, int usec); /* default is 40 usec if not set */
void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state);
-READ8_DEVICE_HANDLER( wd17xx_status_r );
-READ8_DEVICE_HANDLER( wd17xx_track_r );
-READ8_DEVICE_HANDLER( wd17xx_sector_r );
-READ8_DEVICE_HANDLER( wd17xx_data_r );
-
-WRITE8_DEVICE_HANDLER( wd17xx_command_w );
-WRITE8_DEVICE_HANDLER( wd17xx_track_w );
-WRITE8_DEVICE_HANDLER( wd17xx_sector_w );
-WRITE8_DEVICE_HANDLER( wd17xx_data_w );
-
-READ8_DEVICE_HANDLER( wd17xx_r );
-WRITE8_DEVICE_HANDLER( wd17xx_w );
+DECLARE_READ8_DEVICE_HANDLER( wd17xx_status_r );
+DECLARE_READ8_DEVICE_HANDLER( wd17xx_track_r );
+DECLARE_READ8_DEVICE_HANDLER( wd17xx_sector_r );
+DECLARE_READ8_DEVICE_HANDLER( wd17xx_data_r );
+
+DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_command_w );
+DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_track_w );
+DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_sector_w );
+DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_data_w );
+
+DECLARE_READ8_DEVICE_HANDLER( wd17xx_r );
+DECLARE_WRITE8_DEVICE_HANDLER( wd17xx_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_mr_w );
WRITE_LINE_DEVICE_HANDLER( wd17xx_rdy_w );
diff --git a/src/emu/machine/z80dart.c b/src/emu/machine/z80dart.c
index a74a49c8f61..ff90187c642 100644
--- a/src/emu/machine/z80dart.c
+++ b/src/emu/machine/z80dart.c
@@ -1452,22 +1452,22 @@ WRITE_LINE_DEVICE_HANDLER( z80dart_rxtxcb_w ) { downcast<z80dart_device *>(devic
READ8_DEVICE_HANDLER( z80dart_cd_ba_r )
{
- return (offset & 2) ? z80dart_c_r(device, offset & 1) : z80dart_d_r(device, offset & 1);
+ return (offset & 2) ? z80dart_c_r(device, space, offset & 1) : z80dart_d_r(device, space, offset & 1);
}
WRITE8_DEVICE_HANDLER( z80dart_cd_ba_w )
{
if (offset & 2)
- z80dart_c_w(device, offset & 1, data);
+ z80dart_c_w(device, space, offset & 1, data);
else
- z80dart_d_w(device, offset & 1, data);
+ z80dart_d_w(device, space, offset & 1, data);
}
READ8_DEVICE_HANDLER( z80dart_ba_cd_r )
{
int channel = BIT(offset, 1);
- return (offset & 1) ? z80dart_c_r(device, channel) : z80dart_d_r(device, channel);
+ return (offset & 1) ? z80dart_c_r(device, space, channel) : z80dart_d_r(device, space, channel);
}
WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w )
@@ -1475,7 +1475,7 @@ WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w )
int channel = BIT(offset, 1);
if (offset & 1)
- z80dart_c_w(device, channel, data);
+ z80dart_c_w(device, space, channel, data);
else
- z80dart_d_w(device, channel, data);
+ z80dart_d_w(device, space, channel, data);
}
diff --git a/src/emu/machine/z80dart.h b/src/emu/machine/z80dart.h
index de89be0e6c4..b1e8382834a 100644
--- a/src/emu/machine/z80dart.h
+++ b/src/emu/machine/z80dart.h
@@ -341,19 +341,19 @@ extern const device_type Z80SIO4;
//**************************************************************************
// register access
-READ8_DEVICE_HANDLER( z80dart_cd_ba_r );
-WRITE8_DEVICE_HANDLER( z80dart_cd_ba_w );
+DECLARE_READ8_DEVICE_HANDLER( z80dart_cd_ba_r );
+DECLARE_WRITE8_DEVICE_HANDLER( z80dart_cd_ba_w );
-READ8_DEVICE_HANDLER( z80dart_ba_cd_r );
-WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w );
+DECLARE_READ8_DEVICE_HANDLER( z80dart_ba_cd_r );
+DECLARE_WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w );
// control register access
-WRITE8_DEVICE_HANDLER( z80dart_c_w );
-READ8_DEVICE_HANDLER( z80dart_c_r );
+DECLARE_WRITE8_DEVICE_HANDLER( z80dart_c_w );
+DECLARE_READ8_DEVICE_HANDLER( z80dart_c_r );
// data register access
-WRITE8_DEVICE_HANDLER( z80dart_d_w );
-READ8_DEVICE_HANDLER( z80dart_d_r );
+DECLARE_WRITE8_DEVICE_HANDLER( z80dart_d_w );
+DECLARE_READ8_DEVICE_HANDLER( z80dart_d_r );
// serial clocks
WRITE_LINE_DEVICE_HANDLER( z80dart_rxca_w );
diff --git a/src/emu/machine/z80dma.h b/src/emu/machine/z80dma.h
index 5b50228224f..13c42833101 100644
--- a/src/emu/machine/z80dma.h
+++ b/src/emu/machine/z80dma.h
@@ -168,8 +168,8 @@ extern const device_type Z80DMA;
//**************************************************************************
// register access
-READ8_DEVICE_HANDLER( z80dma_r );
-WRITE8_DEVICE_HANDLER( z80dma_w );
+DECLARE_READ8_DEVICE_HANDLER( z80dma_r );
+DECLARE_WRITE8_DEVICE_HANDLER( z80dma_w );
// ready
WRITE_LINE_DEVICE_HANDLER( z80dma_rdy_w );
diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c
index ce72544e1f4..616b0a61aae 100644
--- a/src/emu/machine/z80sio.c
+++ b/src/emu/machine/z80sio.c
@@ -243,8 +243,8 @@ const UINT8 z80sio_device::k_int_priority[] =
inline void z80sio_device::update_interrupt_state()
{
// if we have a callback, update it with the current state
- if (m_irq_cb != NULL)
- (*m_irq_cb)(this, (z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
+ if (!m_irq.isnull())
+ m_irq((z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -318,17 +318,6 @@ void z80sio_device::device_config_complete()
const z80sio_interface *intf = reinterpret_cast<const z80sio_interface *>(static_config());
if (intf != NULL)
*static_cast<z80sio_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- m_irq_cb = NULL;
- m_dtr_changed_cb = NULL;
- m_rts_changed_cb = NULL;
- m_break_changed_cb = NULL;
- m_transmit_cb = NULL;
- m_receive_poll_cb = NULL;
- }
}
@@ -338,6 +327,13 @@ void z80sio_device::device_config_complete()
void z80sio_device::device_start()
{
+ m_irq.resolve(m_irq_cb, *this);
+ m_dtr_changed.resolve(m_dtr_changed_cb, *this);
+ m_rts_changed.resolve(m_rts_changed_cb, *this);
+ m_break_changed.resolve(m_break_changed_cb, *this);
+ m_transmit.resolve(m_transmit_cb, *this);
+ m_received_poll.resolve(m_received_poll_cb, *this);
+
m_channel[0].start(this, 0);
m_channel[1].start(this, 1);
}
@@ -566,12 +562,12 @@ void z80sio_device::sio_channel::control_write(UINT8 data)
// SIO write register 5
case 5:
- if (((old ^ data) & SIO_WR5_DTR) && m_device->m_dtr_changed_cb)
- (*m_device->m_dtr_changed_cb)(m_device, m_index, (data & SIO_WR5_DTR) != 0);
- if (((old ^ data) & SIO_WR5_SEND_BREAK) && m_device->m_break_changed_cb)
- (*m_device->m_break_changed_cb)(m_device, m_index, (data & SIO_WR5_SEND_BREAK) != 0);
- if (((old ^ data) & SIO_WR5_RTS) && m_device->m_rts_changed_cb)
- (*m_device->m_rts_changed_cb)(m_device, m_index, (data & SIO_WR5_RTS) != 0);
+ if (((old ^ data) & SIO_WR5_DTR) && !m_device->m_dtr_changed.isnull())
+ m_device->m_dtr_changed(m_index, (data & SIO_WR5_DTR) != 0);
+ if (((old ^ data) & SIO_WR5_SEND_BREAK) && !m_device->m_break_changed.isnull())
+ m_device->m_break_changed(m_index, (data & SIO_WR5_SEND_BREAK) != 0);
+ if (((old ^ data) & SIO_WR5_RTS) && !m_device->m_rts_changed.isnull())
+ m_device->m_rts_changed(m_index, (data & SIO_WR5_RTS) != 0);
break;
}
}
@@ -741,8 +737,8 @@ void z80sio_device::sio_channel::serial_callback()
VPRINTF(("serial_callback(%c): Transmitting %02x\n", 'A' + m_index, m_outbuf));
// actually transmit the character
- if (m_device->m_transmit_cb != NULL)
- (*m_device->m_transmit_cb)(m_device, m_index, m_outbuf);
+ if (!m_device->m_transmit.isnull())
+ m_device->m_transmit(m_index, m_outbuf, 0xffff);
// update the status register
m_status[0] |= SIO_RR0_TX_BUFFER_EMPTY;
@@ -756,8 +752,8 @@ void z80sio_device::sio_channel::serial_callback()
}
// ask the polling callback if there is data to receive
- if (m_device->m_receive_poll_cb != NULL)
- data = (*m_device->m_receive_poll_cb)(m_device, m_index);
+ if (!m_device->m_received_poll.isnull())
+ data = INT16(m_device->m_received_poll(m_index, 0xffff));
// if we have buffered data, pull it
if (m_receive_inptr != m_receive_outptr)
diff --git a/src/emu/machine/z80sio.h b/src/emu/machine/z80sio.h
index 501431d3bf1..bc2f0485997 100644
--- a/src/emu/machine/z80sio.h
+++ b/src/emu/machine/z80sio.h
@@ -32,12 +32,12 @@
struct z80sio_interface
{
- void (*m_irq_cb)(device_t *device, int state);
- write8_device_func m_dtr_changed_cb;
- write8_device_func m_rts_changed_cb;
- write8_device_func m_break_changed_cb;
- write8_device_func m_transmit_cb;
- int (*m_receive_poll_cb)(device_t *device, int channel);
+ devcb_write_line m_irq_cb;
+ devcb_write8 m_dtr_changed_cb;
+ devcb_write8 m_rts_changed_cb;
+ devcb_write8 m_break_changed_cb;
+ devcb_write16 m_transmit_cb;
+ devcb_read16 m_received_poll_cb;
};
@@ -140,6 +140,14 @@ private:
sio_channel m_channel[2]; // 2 channels
UINT8 m_int_state[8]; // interrupt states
+ // callbacks
+ devcb_resolved_write_line m_irq;
+ devcb_resolved_write8 m_dtr_changed;
+ devcb_resolved_write8 m_rts_changed;
+ devcb_resolved_write8 m_break_changed;
+ devcb_resolved_write16 m_transmit;
+ devcb_resolved_read16 m_received_poll;
+
static const UINT8 k_int_priority[];
};
diff --git a/src/emu/machine/z80sti.h b/src/emu/machine/z80sti.h
index e316949c038..8d8f369f976 100644
--- a/src/emu/machine/z80sti.h
+++ b/src/emu/machine/z80sti.h
@@ -183,8 +183,8 @@ extern const device_type Z80STI;
//**************************************************************************
// register access
-READ8_DEVICE_HANDLER( z80sti_r );
-WRITE8_DEVICE_HANDLER( z80sti_w );
+DECLARE_READ8_DEVICE_HANDLER( z80sti_r );
+DECLARE_WRITE8_DEVICE_HANDLER( z80sti_w );
// receive clock
WRITE_LINE_DEVICE_HANDLER( z80sti_rc_w );
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 837b67ddd2e..669c246500f 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1998,29 +1998,6 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
}
break;
- case AMH_LEGACY_DEVICE_HANDLER:
- target_device = device().siblingdevice(data.m_tag);
- if (target_device == NULL)
- fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", data.m_tag.cstr(), m_name, m_device.tag());
-
- if (readorwrite == ROW_READ)
- switch (data.m_bits)
- {
- case 8: install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice8, data.m_name, data.m_mask); break;
- case 16: install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice16, data.m_name, data.m_mask); break;
- case 32: install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice32, data.m_name, data.m_mask); break;
- case 64: install_legacy_read_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_rdevice64, data.m_name, data.m_mask); break;
- }
- else
- switch (data.m_bits)
- {
- case 8: install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice8, data.m_name, data.m_mask); break;
- case 16: install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice16, data.m_name, data.m_mask); break;
- case 32: install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice32, data.m_name, data.m_mask); break;
- case 64: install_legacy_write_handler(*target_device, entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, entry.m_wdevice64, data.m_name, data.m_mask); break;
- }
- break;
-
case AMH_PORT:
install_readwrite_port(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror,
(readorwrite == ROW_READ) ? data.m_tag.cstr() : NULL,
diff --git a/src/emu/memory.h b/src/emu/memory.h
index cb3f75f6561..6fc39f47b22 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -122,14 +122,14 @@ typedef UINT64 (*read64_space_func) (ATTR_UNUSED address_space *space, ATTR_UNUS
typedef void (*write64_space_func)(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
// legacy device read/write handlers
-typedef UINT8 (*read8_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset);
-typedef void (*write8_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data);
-typedef UINT16 (*read16_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask);
-typedef void (*write16_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask);
-typedef UINT32 (*read32_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask);
-typedef void (*write32_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask);
-typedef UINT64 (*read64_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask);
-typedef void (*write64_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
+typedef UINT8 (*read8_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask);
+typedef void (*write8_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask);
+typedef UINT16 (*read16_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask);
+typedef void (*write16_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask);
+typedef UINT32 (*read32_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask);
+typedef void (*write32_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask);
+typedef UINT64 (*read64_device_func) (ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask);
+typedef void (*write64_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
// struct with function pointers for accessors; use is generally discouraged unless necessary
@@ -887,14 +887,23 @@ private:
// device read/write handler function macros
-#define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset)
-#define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data)
-#define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask)
-#define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
-#define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask)
-#define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask)
-#define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask)
-#define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask)
+#define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask)
+#define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask)
+#define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask)
+#define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
+#define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask)
+#define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask)
+#define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask)
+#define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask)
+
+#define DECLARE_READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask = 0xff)
+#define DECLARE_WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask = 0xff)
+#define DECLARE_READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask = 0xffff)
+#define DECLARE_WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask = 0xffff)
+#define DECLARE_READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask = 0xffffffff)
+#define DECLARE_WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask = 0xffffffff)
+#define DECLARE_READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask = U64(0xffffffffffffffff))
+#define DECLARE_WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED device_t *device, ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask = U64(0xffffffffffffffff))
// space read/write handler function macros
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index ee9fee15d80..13e563ccb6b 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -112,10 +112,10 @@ WRITE8_DEVICE_HANDLER( ym2151_w )
}
-READ8_DEVICE_HANDLER( ym2151_status_port_r ) { return ym2151_r(device, 1); }
+READ8_DEVICE_HANDLER( ym2151_status_port_r ) { return ym2151_r(device, space, 1); }
-WRITE8_DEVICE_HANDLER( ym2151_register_port_w ) { ym2151_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym2151_data_port_w ) { ym2151_w(device, 1, data); }
+WRITE8_DEVICE_HANDLER( ym2151_register_port_w ) { ym2151_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym2151_data_port_w ) { ym2151_w(device, space, 1, data); }
const device_type YM2151 = &device_creator<ym2151_device>;
diff --git a/src/emu/sound/2151intf.h b/src/emu/sound/2151intf.h
index 840269b0faa..12ee45125dc 100644
--- a/src/emu/sound/2151intf.h
+++ b/src/emu/sound/2151intf.h
@@ -11,12 +11,12 @@ struct ym2151_interface
devcb_write8 portwritehandler;
};
-READ8_DEVICE_HANDLER( ym2151_r );
-WRITE8_DEVICE_HANDLER( ym2151_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2151_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2151_w );
-READ8_DEVICE_HANDLER( ym2151_status_port_r );
-WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
-WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2151_status_port_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
class ym2151_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c
index 34767229718..584035ccb8e 100644
--- a/src/emu/sound/2203intf.c
+++ b/src/emu/sound/2203intf.c
@@ -175,10 +175,10 @@ WRITE8_DEVICE_HANDLER( ym2203_w )
}
-READ8_DEVICE_HANDLER( ym2203_status_port_r ) { return ym2203_r(device, 0); }
-READ8_DEVICE_HANDLER( ym2203_read_port_r ) { return ym2203_r(device, 1); }
-WRITE8_DEVICE_HANDLER( ym2203_control_port_w ) { ym2203_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym2203_write_port_w ) { ym2203_w(device, 1, data); }
+READ8_DEVICE_HANDLER( ym2203_status_port_r ) { return ym2203_r(device, space, 0); }
+READ8_DEVICE_HANDLER( ym2203_read_port_r ) { return ym2203_r(device, space, 1); }
+WRITE8_DEVICE_HANDLER( ym2203_control_port_w ) { ym2203_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym2203_write_port_w ) { ym2203_w(device, space, 1, data); }
const device_type YM2203 = &device_creator<ym2203_device>;
diff --git a/src/emu/sound/2203intf.h b/src/emu/sound/2203intf.h
index 81f5aea9b98..12140727db2 100644
--- a/src/emu/sound/2203intf.h
+++ b/src/emu/sound/2203intf.h
@@ -15,13 +15,13 @@ struct ym2203_interface
devcb_write_line irqhandler;
};
-READ8_DEVICE_HANDLER( ym2203_r );
-WRITE8_DEVICE_HANDLER( ym2203_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2203_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2203_w );
-READ8_DEVICE_HANDLER( ym2203_status_port_r );
-READ8_DEVICE_HANDLER( ym2203_read_port_r );
-WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
-WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2203_status_port_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2203_read_port_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
class ym2203_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c
index 24a5051c3c0..0c7ec87d84b 100644
--- a/src/emu/sound/2413intf.c
+++ b/src/emu/sound/2413intf.c
@@ -111,8 +111,8 @@ WRITE8_DEVICE_HANDLER( ym2413_w )
ym2413_write(info->chip, offset & 1, data);
}
-WRITE8_DEVICE_HANDLER( ym2413_register_port_w ) { ym2413_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym2413_data_port_w ) { ym2413_w(device, 1, data); }
+WRITE8_DEVICE_HANDLER( ym2413_register_port_w ) { ym2413_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym2413_data_port_w ) { ym2413_w(device, space, 1, data); }
const device_type YM2413 = &device_creator<ym2413_device>;
diff --git a/src/emu/sound/2413intf.h b/src/emu/sound/2413intf.h
index a6d7aa9180c..a05e0ee48c9 100644
--- a/src/emu/sound/2413intf.h
+++ b/src/emu/sound/2413intf.h
@@ -5,10 +5,10 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( ym2413_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2413_w );
-WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
-WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
class ym2413_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index 5dfe6f470ea..d51cf322919 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -194,14 +194,14 @@ WRITE8_DEVICE_HANDLER( ym2608_w )
ym2608_write(info->chip, offset & 3, data);
}
-READ8_DEVICE_HANDLER( ym2608_read_port_r ) { return ym2608_r(device, 1); }
-READ8_DEVICE_HANDLER( ym2608_status_port_a_r ) { return ym2608_r(device, 0); }
-READ8_DEVICE_HANDLER( ym2608_status_port_b_r ) { return ym2608_r(device, 2); }
-
-WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w ) { ym2608_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w ) { ym2608_w(device, 2, data); }
-WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w ) { ym2608_w(device, 1, data); }
-WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w ) { ym2608_w(device, 3, data); }
+READ8_DEVICE_HANDLER( ym2608_read_port_r ) { return ym2608_r(device, space, 1); }
+READ8_DEVICE_HANDLER( ym2608_status_port_a_r ) { return ym2608_r(device, space, 0); }
+READ8_DEVICE_HANDLER( ym2608_status_port_b_r ) { return ym2608_r(device, space, 2); }
+
+WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w ) { ym2608_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w ) { ym2608_w(device, space, 2, data); }
+WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w ) { ym2608_w(device, space, 1, data); }
+WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w ) { ym2608_w(device, space, 3, data); }
const device_type YM2608 = &device_creator<ym2608_device>;
diff --git a/src/emu/sound/2608intf.h b/src/emu/sound/2608intf.h
index 597ca3c168a..91571ce2a8e 100644
--- a/src/emu/sound/2608intf.h
+++ b/src/emu/sound/2608intf.h
@@ -16,17 +16,17 @@ struct ym2608_interface
void ( *handler )( device_t *device, int irq ); /* IRQ handler for the YM2608 */
};
-READ8_DEVICE_HANDLER( ym2608_r );
-WRITE8_DEVICE_HANDLER( ym2608_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2608_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2608_w );
-READ8_DEVICE_HANDLER( ym2608_read_port_r );
-READ8_DEVICE_HANDLER( ym2608_status_port_a_r );
-READ8_DEVICE_HANDLER( ym2608_status_port_b_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2608_read_port_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2608_status_port_a_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2608_status_port_b_r );
-WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w );
-WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w );
-WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
-WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2608_control_port_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
class ym2608_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index bef3d200eea..aed83966303 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -207,14 +207,14 @@ WRITE8_DEVICE_HANDLER( ym2610_w )
}
-READ8_DEVICE_HANDLER( ym2610_status_port_a_r ) { return ym2610_r(device, 0); }
-READ8_DEVICE_HANDLER( ym2610_status_port_b_r ) { return ym2610_r(device, 2); }
-READ8_DEVICE_HANDLER( ym2610_read_port_r ) { return ym2610_r(device, 1); }
-
-WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w ) { ym2610_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w ) { ym2610_w(device, 2, data); }
-WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w ) { ym2610_w(device, 1, data); }
-WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w ) { ym2610_w(device, 3, data); }
+READ8_DEVICE_HANDLER( ym2610_status_port_a_r ) { return ym2610_r(device, space, 0); }
+READ8_DEVICE_HANDLER( ym2610_status_port_b_r ) { return ym2610_r(device, space, 2); }
+READ8_DEVICE_HANDLER( ym2610_read_port_r ) { return ym2610_r(device, space, 1); }
+
+WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w ) { ym2610_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w ) { ym2610_w(device, space, 2, data); }
+WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w ) { ym2610_w(device, space, 1, data); }
+WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w ) { ym2610_w(device, space, 3, data); }
const device_type YM2610 = &device_creator<ym2610_device>;
diff --git a/src/emu/sound/2610intf.h b/src/emu/sound/2610intf.h
index eb66606e792..0a584a26fbc 100644
--- a/src/emu/sound/2610intf.h
+++ b/src/emu/sound/2610intf.h
@@ -14,17 +14,17 @@ struct ym2610_interface
void ( *handler )( device_t *device, int irq ); /* IRQ handler for the YM2610 */
};
-READ8_DEVICE_HANDLER( ym2610_r );
-WRITE8_DEVICE_HANDLER( ym2610_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2610_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2610_w );
-READ8_DEVICE_HANDLER( ym2610_status_port_a_r );
-READ8_DEVICE_HANDLER( ym2610_status_port_b_r );
-READ8_DEVICE_HANDLER( ym2610_read_port_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2610_status_port_a_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2610_status_port_b_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2610_read_port_r );
-WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w );
-WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w );
-WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
-WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2610_control_port_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2610_control_port_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
class ym2610_device : public device_t,
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index c796403c142..55afd66f4f0 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -146,15 +146,15 @@ WRITE8_DEVICE_HANDLER( ym2612_w )
}
-READ8_DEVICE_HANDLER( ym2612_status_port_a_r ) { return ym2612_r(device, 0); }
-READ8_DEVICE_HANDLER( ym2612_status_port_b_r ) { return ym2612_r(device, 2); }
-READ8_DEVICE_HANDLER( ym2612_data_port_a_r ) { return ym2612_r(device, 1); }
-READ8_DEVICE_HANDLER( ym2612_data_port_b_r ) { return ym2612_r(device, 3); }
-
-WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w ) { ym2612_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w ) { ym2612_w(device, 2, data); }
-WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w ) { ym2612_w(device, 1, data); }
-WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w ) { ym2612_w(device, 3, data); }
+READ8_DEVICE_HANDLER( ym2612_status_port_a_r ) { return ym2612_r(device, space, 0); }
+READ8_DEVICE_HANDLER( ym2612_status_port_b_r ) { return ym2612_r(device, space, 2); }
+READ8_DEVICE_HANDLER( ym2612_data_port_a_r ) { return ym2612_r(device, space, 1); }
+READ8_DEVICE_HANDLER( ym2612_data_port_b_r ) { return ym2612_r(device, space, 3); }
+
+WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w ) { ym2612_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w ) { ym2612_w(device, space, 2, data); }
+WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w ) { ym2612_w(device, space, 1, data); }
+WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w ) { ym2612_w(device, space, 3, data); }
const device_type YM2612 = &device_creator<ym2612_device>;
diff --git a/src/emu/sound/2612intf.h b/src/emu/sound/2612intf.h
index 902ed020dea..b74e4af0a3f 100644
--- a/src/emu/sound/2612intf.h
+++ b/src/emu/sound/2612intf.h
@@ -12,18 +12,18 @@ struct ym2612_interface
void (*handler)(device_t *device, int irq);
};
-READ8_DEVICE_HANDLER( ym2612_r );
-WRITE8_DEVICE_HANDLER( ym2612_w );
-
-READ8_DEVICE_HANDLER( ym2612_status_port_a_r );
-READ8_DEVICE_HANDLER( ym2612_status_port_b_r );
-READ8_DEVICE_HANDLER( ym2612_data_port_a_r );
-READ8_DEVICE_HANDLER( ym2612_data_port_b_r );
-
-WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w );
-WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w );
-WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w );
-WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
+DECLARE_READ8_DEVICE_HANDLER( ym2612_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2612_w );
+
+DECLARE_READ8_DEVICE_HANDLER( ym2612_status_port_a_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2612_status_port_b_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2612_data_port_a_r );
+DECLARE_READ8_DEVICE_HANDLER( ym2612_data_port_b_r );
+
+DECLARE_WRITE8_DEVICE_HANDLER( ym2612_control_port_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2612_control_port_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
class ym2612_device : public device_t,
diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c
index 0233f7c5577..b9ef593c123 100644
--- a/src/emu/sound/262intf.c
+++ b/src/emu/sound/262intf.c
@@ -124,11 +124,11 @@ WRITE8_DEVICE_HANDLER( ymf262_w )
ymf262_write(info->chip, offset & 3, data);
}
-READ8_DEVICE_HANDLER ( ymf262_status_r ) { return ymf262_r(device, 0); }
-WRITE8_DEVICE_HANDLER( ymf262_register_a_w ) { ymf262_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ymf262_register_b_w ) { ymf262_w(device, 2, data); }
-WRITE8_DEVICE_HANDLER( ymf262_data_a_w ) { ymf262_w(device, 1, data); }
-WRITE8_DEVICE_HANDLER( ymf262_data_b_w ) { ymf262_w(device, 3, data); }
+READ8_DEVICE_HANDLER ( ymf262_status_r ) { return ymf262_r(device, space, 0); }
+WRITE8_DEVICE_HANDLER( ymf262_register_a_w ) { ymf262_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ymf262_register_b_w ) { ymf262_w(device, space, 2, data); }
+WRITE8_DEVICE_HANDLER( ymf262_data_a_w ) { ymf262_w(device, space, 1, data); }
+WRITE8_DEVICE_HANDLER( ymf262_data_b_w ) { ymf262_w(device, space, 3, data); }
const device_type YMF262 = &device_creator<ymf262_device>;
diff --git a/src/emu/sound/262intf.h b/src/emu/sound/262intf.h
index 4dfd374e28f..16eed55142f 100644
--- a/src/emu/sound/262intf.h
+++ b/src/emu/sound/262intf.h
@@ -12,14 +12,14 @@ struct ymf262_interface
};
-READ8_DEVICE_HANDLER( ymf262_r );
-WRITE8_DEVICE_HANDLER( ymf262_w );
-
-READ8_DEVICE_HANDLER ( ymf262_status_r );
-WRITE8_DEVICE_HANDLER( ymf262_register_a_w );
-WRITE8_DEVICE_HANDLER( ymf262_register_b_w );
-WRITE8_DEVICE_HANDLER( ymf262_data_a_w );
-WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
+DECLARE_READ8_DEVICE_HANDLER( ymf262_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf262_w );
+
+DECLARE_READ8_DEVICE_HANDLER ( ymf262_status_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf262_register_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf262_register_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf262_data_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
class ymf262_device : public device_t,
diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c
index f0b50aee8e9..4a905b0b086 100644
--- a/src/emu/sound/3526intf.c
+++ b/src/emu/sound/3526intf.c
@@ -138,10 +138,10 @@ WRITE8_DEVICE_HANDLER( ym3526_w )
ym3526_write(info->chip, offset & 1, data);
}
-READ8_DEVICE_HANDLER( ym3526_status_port_r ) { return ym3526_r(device, 0); }
-READ8_DEVICE_HANDLER( ym3526_read_port_r ) { return ym3526_r(device, 1); }
-WRITE8_DEVICE_HANDLER( ym3526_control_port_w ) { ym3526_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym3526_write_port_w ) { ym3526_w(device, 1, data); }
+READ8_DEVICE_HANDLER( ym3526_status_port_r ) { return ym3526_r(device, space, 0); }
+READ8_DEVICE_HANDLER( ym3526_read_port_r ) { return ym3526_r(device, space, 1); }
+WRITE8_DEVICE_HANDLER( ym3526_control_port_w ) { ym3526_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym3526_write_port_w ) { ym3526_w(device, space, 1, data); }
const device_type YM3526 = &device_creator<ym3526_device>;
diff --git a/src/emu/sound/3526intf.h b/src/emu/sound/3526intf.h
index f75e35c0c48..b828000d4eb 100644
--- a/src/emu/sound/3526intf.h
+++ b/src/emu/sound/3526intf.h
@@ -10,13 +10,13 @@ struct ym3526_interface
devcb_write_line out_int_func;
};
-READ8_DEVICE_HANDLER( ym3526_r );
-WRITE8_DEVICE_HANDLER( ym3526_w );
+DECLARE_READ8_DEVICE_HANDLER( ym3526_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym3526_w );
-READ8_DEVICE_HANDLER( ym3526_status_port_r );
-READ8_DEVICE_HANDLER( ym3526_read_port_r );
-WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
-WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
+DECLARE_READ8_DEVICE_HANDLER( ym3526_status_port_r );
+DECLARE_READ8_DEVICE_HANDLER( ym3526_read_port_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
class ym3526_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c
index 53401de42d5..5a484fa5637 100644
--- a/src/emu/sound/3812intf.c
+++ b/src/emu/sound/3812intf.c
@@ -134,10 +134,10 @@ WRITE8_DEVICE_HANDLER( ym3812_w )
ym3812_write(info->chip, offset & 1, data);
}
-READ8_DEVICE_HANDLER( ym3812_status_port_r ) { return ym3812_r(device, 0); }
-READ8_DEVICE_HANDLER( ym3812_read_port_r ) { return ym3812_r(device, 1); }
-WRITE8_DEVICE_HANDLER( ym3812_control_port_w ) { ym3812_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( ym3812_write_port_w ) { ym3812_w(device, 1, data); }
+READ8_DEVICE_HANDLER( ym3812_status_port_r ) { return ym3812_r(device, space, 0); }
+READ8_DEVICE_HANDLER( ym3812_read_port_r ) { return ym3812_r(device, space, 1); }
+WRITE8_DEVICE_HANDLER( ym3812_control_port_w ) { ym3812_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( ym3812_write_port_w ) { ym3812_w(device, space, 1, data); }
const device_type YM3812 = &device_creator<ym3812_device>;
diff --git a/src/emu/sound/3812intf.h b/src/emu/sound/3812intf.h
index dfa78b933fd..b7bc9f3b51f 100644
--- a/src/emu/sound/3812intf.h
+++ b/src/emu/sound/3812intf.h
@@ -10,13 +10,13 @@ struct ym3812_interface
void (*handler)(device_t *device, int linestate);
};
-READ8_DEVICE_HANDLER( ym3812_r );
-WRITE8_DEVICE_HANDLER( ym3812_w );
+DECLARE_READ8_DEVICE_HANDLER( ym3812_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym3812_w );
-READ8_DEVICE_HANDLER( ym3812_status_port_r );
-READ8_DEVICE_HANDLER( ym3812_read_port_r );
-WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
-WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
+DECLARE_READ8_DEVICE_HANDLER( ym3812_status_port_r );
+DECLARE_READ8_DEVICE_HANDLER( ym3812_read_port_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
class ym3812_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c
index e64b38030ed..738ed362621 100644
--- a/src/emu/sound/8950intf.c
+++ b/src/emu/sound/8950intf.c
@@ -28,7 +28,7 @@ struct y8950_state
emu_timer * timer[2];
void * chip;
const y8950_interface *intf;
- device_t *device;
+ y8950_device *device;
};
@@ -43,7 +43,7 @@ INLINE y8950_state *get_safe_token(device_t *device)
static void IRQHandler(void *param,int irq)
{
y8950_state *info = (y8950_state *)param;
- if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE);
+ if (!info->device->m_handler.isnull()) info->device->m_handler(irq ? ASSERT_LINE : CLEAR_LINE);
}
static TIMER_CALLBACK( timer_callback_0 )
{
@@ -72,31 +72,31 @@ static void TimerHandler(void *param,int c,attotime period)
static unsigned char Y8950PortHandler_r(void *param)
{
y8950_state *info = (y8950_state *)param;
- if (info->intf->portread)
- return info->intf->portread(info->device,0);
+ if (!info->device->m_portread.isnull())
+ return info->device->m_portread(0);
return 0;
}
static void Y8950PortHandler_w(void *param,unsigned char data)
{
y8950_state *info = (y8950_state *)param;
- if (info->intf->portwrite)
- info->intf->portwrite(info->device,0,data);
+ if (!info->device->m_portwrite.isnull())
+ info->device->m_portwrite(0,data);
}
static unsigned char Y8950KeyboardHandler_r(void *param)
{
y8950_state *info = (y8950_state *)param;
- if (info->intf->keyboardread)
- return info->intf->keyboardread(info->device,0);
+ if (!info->device->m_keyboardread.isnull())
+ return info->device->m_keyboardread(0);
return 0;
}
static void Y8950KeyboardHandler_w(void *param,unsigned char data)
{
y8950_state *info = (y8950_state *)param;
- if (info->intf->keyboardwrite)
- info->intf->keyboardwrite(info->device,0,data);
+ if (!info->device->m_keyboardwrite.isnull())
+ info->device->m_keyboardwrite(0,data);
}
static STREAM_UPDATE( y8950_stream_update )
@@ -114,12 +114,12 @@ static void _stream_update(void *param, int interval)
static DEVICE_START( y8950 )
{
- static const y8950_interface dummy = { 0 };
+ static const y8950_interface dummy = { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL };
y8950_state *info = get_safe_token(device);
int rate = device->clock()/72;
info->intf = device->static_config() ? (const y8950_interface *)device->static_config() : &dummy;
- info->device = device;
+ info->device = downcast<y8950_device *>(device);
/* stream system initialize */
info->chip = y8950_init(device,device->clock(),rate);
@@ -167,10 +167,10 @@ WRITE8_DEVICE_HANDLER( y8950_w )
y8950_write(info->chip, offset & 1, data);
}
-READ8_DEVICE_HANDLER( y8950_status_port_r ) { return y8950_r(device, 0); }
-READ8_DEVICE_HANDLER( y8950_read_port_r ) { return y8950_r(device, 1); }
-WRITE8_DEVICE_HANDLER( y8950_control_port_w ) { y8950_w(device, 0, data); }
-WRITE8_DEVICE_HANDLER( y8950_write_port_w ) { y8950_w(device, 1, data); }
+READ8_DEVICE_HANDLER( y8950_status_port_r ) { return y8950_r(device, space, 0); }
+READ8_DEVICE_HANDLER( y8950_read_port_r ) { return y8950_r(device, space, 1); }
+WRITE8_DEVICE_HANDLER( y8950_control_port_w ) { y8950_w(device, space, 0, data); }
+WRITE8_DEVICE_HANDLER( y8950_write_port_w ) { y8950_w(device, space, 1, data); }
const device_type Y8950 = &device_creator<y8950_device>;
@@ -198,6 +198,16 @@ void y8950_device::device_config_complete()
void y8950_device::device_start()
{
+ const y8950_interface *intf = (const y8950_interface *)static_config();
+ if (intf != NULL)
+ {
+ m_handler.resolve(intf->handler_cb, *this);
+ m_keyboardread.resolve(intf->keyboardread_cb, *this);
+ m_keyboardwrite.resolve(intf->keyboardwrite_cb, *this);
+ m_portread.resolve(intf->portread_cb, *this);
+ m_portwrite.resolve(intf->portwrite_cb, *this);
+ }
+
DEVICE_START_NAME( y8950 )(this);
}
diff --git a/src/emu/sound/8950intf.h b/src/emu/sound/8950intf.h
index e8de9ca087c..803cc33c782 100644
--- a/src/emu/sound/8950intf.h
+++ b/src/emu/sound/8950intf.h
@@ -7,21 +7,20 @@
struct y8950_interface
{
- void (*handler)(device_t *device, int linestate);
-
- read8_device_func keyboardread;
- write8_device_func keyboardwrite;
- read8_device_func portread;
- write8_device_func portwrite;
+ devcb_write_line handler_cb;
+ devcb_read8 keyboardread_cb;
+ devcb_write8 keyboardwrite_cb;
+ devcb_read8 portread_cb;
+ devcb_write8 portwrite_cb;
};
-READ8_DEVICE_HANDLER( y8950_r );
-WRITE8_DEVICE_HANDLER( y8950_w );
+DECLARE_READ8_DEVICE_HANDLER( y8950_r );
+DECLARE_WRITE8_DEVICE_HANDLER( y8950_w );
-READ8_DEVICE_HANDLER( y8950_status_port_r );
-READ8_DEVICE_HANDLER( y8950_read_port_r );
-WRITE8_DEVICE_HANDLER( y8950_control_port_w );
-WRITE8_DEVICE_HANDLER( y8950_write_port_w );
+DECLARE_READ8_DEVICE_HANDLER( y8950_status_port_r );
+DECLARE_READ8_DEVICE_HANDLER( y8950_read_port_r );
+DECLARE_WRITE8_DEVICE_HANDLER( y8950_control_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( y8950_write_port_w );
class y8950_device : public device_t,
public device_sound_interface
@@ -44,6 +43,12 @@ protected:
private:
// internal state
void *m_token;
+public:
+ devcb_resolved_write_line m_handler;
+ devcb_resolved_read8 m_keyboardread;
+ devcb_resolved_write8 m_keyboardwrite;
+ devcb_resolved_read8 m_portread;
+ devcb_resolved_write8 m_portwrite;
};
extern const device_type Y8950;
diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c
index 94e84cf476e..81894065b6b 100644
--- a/src/emu/sound/aica.c
+++ b/src/emu/sound/aica.c
@@ -681,7 +681,7 @@ static void AICA_UpdateSlotReg(aica_state *AICA,int s,int r)
}
}
-static void AICA_UpdateReg(aica_state *AICA, int reg)
+static void AICA_UpdateReg(aica_state *AICA, address_space &space, int reg)
{
switch(reg&0xff)
{
@@ -702,7 +702,7 @@ static void AICA_UpdateReg(aica_state *AICA, int reg)
break;
case 0x8:
case 0x9:
- aica_midi_in(AICA->device, 0, AICA->udata.data[0x8/2]&0xff, 0xffff);
+ aica_midi_in(AICA->device, space, 0, AICA->udata.data[0x8/2]&0xff, 0xffff);
break;
case 0x12:
case 0x13:
@@ -823,7 +823,7 @@ static void AICA_UpdateSlotRegR(aica_state *AICA, int slot,int reg)
}
-static void AICA_UpdateRegR(aica_state *AICA, int reg)
+static void AICA_UpdateRegR(aica_state *AICA, address_space &space, int reg)
{
switch(reg&0xff)
{
@@ -894,7 +894,7 @@ static void AICA_UpdateRegR(aica_state *AICA, int reg)
}
}
-static void AICA_w16(aica_state *AICA,unsigned int addr,unsigned short val)
+static void AICA_w16(aica_state *AICA,address_space &space,unsigned int addr,unsigned short val)
{
addr&=0xffff;
if(addr<0x2000)
@@ -919,7 +919,7 @@ static void AICA_w16(aica_state *AICA,unsigned int addr,unsigned short val)
{
// printf("%x to AICA global @ %x\n", val, addr & 0xff);
*((unsigned short *) (AICA->udata.datab+((addr&0xff)))) = val;
- AICA_UpdateReg(AICA, addr&0xff);
+ AICA_UpdateReg(AICA, space, addr&0xff);
}
else if (addr == 0x2d00)
{
@@ -954,7 +954,7 @@ static void AICA_w16(aica_state *AICA,unsigned int addr,unsigned short val)
}
}
-static unsigned short AICA_r16(aica_state *AICA, unsigned int addr)
+static unsigned short AICA_r16(aica_state *AICA, address_space &space, unsigned int addr)
{
unsigned short v=0;
addr&=0xffff;
@@ -973,7 +973,7 @@ static unsigned short AICA_r16(aica_state *AICA, unsigned int addr)
}
else if (addr < 0x28be)
{
- AICA_UpdateRegR(AICA, addr&0xff);
+ AICA_UpdateRegR(AICA, space, addr&0xff);
v= *((unsigned short *) (AICA->udata.datab+((addr&0xff))));
if((addr&0xfffe)==0x2810) AICA->udata.data[0x10/2] &= 0x7FFF; // reset LP on read
}
@@ -1323,7 +1323,7 @@ void aica_set_ram_base(device_t *device, void *base, int size)
READ16_DEVICE_HANDLER( aica_r )
{
aica_state *AICA = get_safe_token(device);
- return AICA_r16(AICA, offset*2);
+ return AICA_r16(AICA, space,offset*2);
}
WRITE16_DEVICE_HANDLER( aica_w )
@@ -1331,9 +1331,9 @@ WRITE16_DEVICE_HANDLER( aica_w )
aica_state *AICA = get_safe_token(device);
UINT16 tmp;
- tmp = AICA_r16(AICA, offset*2);
+ tmp = AICA_r16(AICA, space, offset*2);
COMBINE_DATA(&tmp);
- AICA_w16(AICA, offset*2, tmp);
+ AICA_w16(AICA, space, offset*2, tmp);
}
WRITE16_DEVICE_HANDLER( aica_midi_in )
diff --git a/src/emu/sound/aica.h b/src/emu/sound/aica.h
index 6d450d5b456..87a4b30dfea 100644
--- a/src/emu/sound/aica.h
+++ b/src/emu/sound/aica.h
@@ -18,12 +18,12 @@ struct aica_interface
void aica_set_ram_base(device_t *device, void *base, int size);
// AICA register access
-READ16_DEVICE_HANDLER( aica_r );
-WRITE16_DEVICE_HANDLER( aica_w );
+DECLARE_READ16_DEVICE_HANDLER( aica_r );
+DECLARE_WRITE16_DEVICE_HANDLER( aica_w );
// MIDI I/O access
-WRITE16_DEVICE_HANDLER( aica_midi_in );
-READ16_DEVICE_HANDLER( aica_midi_out_r );
+DECLARE_WRITE16_DEVICE_HANDLER( aica_midi_in );
+DECLARE_READ16_DEVICE_HANDLER( aica_midi_out_r );
class aica_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/astrocde.h b/src/emu/sound/astrocde.h
index ac3ddab5ec9..8a954830761 100644
--- a/src/emu/sound/astrocde.h
+++ b/src/emu/sound/astrocde.h
@@ -5,7 +5,7 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( astrocade_sound_w );
+DECLARE_WRITE8_DEVICE_HANDLER( astrocade_sound_w );
class astrocade_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index 3770aef86d3..752cc08b188 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -1000,7 +1000,7 @@ WRITE8_DEVICE_HANDLER( ay8910_address_w )
#if ENABLE_REGISTER_TEST
return;
#else
- ay8910_data_address_w(device, 1, data);
+ ay8910_data_address_w(device, space, 1, data);
#endif
}
@@ -1009,7 +1009,7 @@ WRITE8_DEVICE_HANDLER( ay8910_data_w )
#if ENABLE_REGISTER_TEST
return;
#else
- ay8910_data_address_w(device, 0, data);
+ ay8910_data_address_w(device, space, 0, data);
#endif
}
@@ -1023,15 +1023,15 @@ static const int mapping8914to8910[16] = { 0, 2, 4, 11, 1, 3, 5, 12, 7, 6, 13, 8
READ8_DEVICE_HANDLER( ay8914_r )
{
UINT16 rv;
- ay8910_address_w(device, 0, mapping8914to8910[offset & 0xff]);
- rv = (UINT16)ay8910_r(device, 0);
+ ay8910_address_w(device, space, 0, mapping8914to8910[offset & 0xff]);
+ rv = (UINT16)ay8910_r(device, space, 0);
return rv;
}
WRITE8_DEVICE_HANDLER( ay8914_w )
{
- ay8910_address_w(device, 0, mapping8914to8910[offset & 0xff]);
- ay8910_data_w(device, 0, data & 0xff);
+ ay8910_address_w(device, space, 0, mapping8914to8910[offset & 0xff]);
+ ay8910_data_w(device, space, 0, data & 0xff);
}
diff --git a/src/emu/sound/ay8910.h b/src/emu/sound/ay8910.h
index e84421c62df..f2e82ca8991 100644
--- a/src/emu/sound/ay8910.h
+++ b/src/emu/sound/ay8910.h
@@ -90,22 +90,22 @@ struct ay8910_interface
void ay8910_set_volume(device_t *device,int channel,int volume);
-READ8_DEVICE_HANDLER( ay8910_r );
-WRITE8_DEVICE_HANDLER( ay8910_address_w );
-WRITE8_DEVICE_HANDLER( ay8910_data_w );
+DECLARE_READ8_DEVICE_HANDLER( ay8910_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ay8910_address_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ay8910_data_w );
/* /RES */
-WRITE8_DEVICE_HANDLER( ay8910_reset_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ay8910_reset_w );
/* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */
-WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
/* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */
-WRITE8_DEVICE_HANDLER( ay8910_address_data_w );
+DECLARE_WRITE8_DEVICE_HANDLER( ay8910_address_data_w );
/* AY8914 handlers needed due to different register map */
-READ8_DEVICE_HANDLER( ay8914_r );
-WRITE8_DEVICE_HANDLER( ay8914_w );
+DECLARE_READ8_DEVICE_HANDLER( ay8914_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ay8914_w );
/*********** An interface for SSG of YM2203 ***********/
diff --git a/src/emu/sound/c140.h b/src/emu/sound/c140.h
index c4f5e637832..681d676d33c 100644
--- a/src/emu/sound/c140.h
+++ b/src/emu/sound/c140.h
@@ -7,8 +7,8 @@
#include "devlegcy.h"
-READ8_DEVICE_HANDLER( c140_r );
-WRITE8_DEVICE_HANDLER( c140_w );
+DECLARE_READ8_DEVICE_HANDLER( c140_r );
+DECLARE_WRITE8_DEVICE_HANDLER( c140_w );
void c140_set_base(device_t *device, void *base);
diff --git a/src/emu/sound/c6280.h b/src/emu/sound/c6280.h
index b1bbecf22f8..41e1e0a3478 100644
--- a/src/emu/sound/c6280.h
+++ b/src/emu/sound/c6280.h
@@ -11,8 +11,8 @@ struct c6280_interface
};
/* Function prototypes */
-WRITE8_DEVICE_HANDLER( c6280_w );
-READ8_DEVICE_HANDLER( c6280_r );
+DECLARE_WRITE8_DEVICE_HANDLER( c6280_w );
+DECLARE_READ8_DEVICE_HANDLER( c6280_r );
class c6280_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/digitalk.h b/src/emu/sound/digitalk.h
index 805c245e033..add7f3428fe 100644
--- a/src/emu/sound/digitalk.h
+++ b/src/emu/sound/digitalk.h
@@ -7,7 +7,7 @@ void digitalker_0_cs_w(device_t *device, int line);
void digitalker_0_cms_w(device_t *device, int line);
void digitalker_0_wr_w(device_t *device, int line);
int digitalker_0_intr_r(device_t *device);
-WRITE8_DEVICE_HANDLER(digitalker_data_w);
+DECLARE_WRITE8_DEVICE_HANDLER(digitalker_data_w);
class digitalker_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index 147194f03ee..3961c4fc2ec 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -4256,8 +4256,8 @@ public:
*
*************************************/
-WRITE8_DEVICE_HANDLER( discrete_sound_w );
-READ8_DEVICE_HANDLER( discrete_sound_r );
+DECLARE_WRITE8_DEVICE_HANDLER( discrete_sound_w );
+DECLARE_READ8_DEVICE_HANDLER( discrete_sound_r );
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
diff --git a/src/emu/sound/es5506.h b/src/emu/sound/es5506.h
index cb1597e6cae..076bfcf24ba 100644
--- a/src/emu/sound/es5506.h
+++ b/src/emu/sound/es5506.h
@@ -20,8 +20,8 @@ struct es5505_interface
UINT16 (*read_port)(device_t *device); /* input port read */
};
-READ16_DEVICE_HANDLER( es5505_r );
-WRITE16_DEVICE_HANDLER( es5505_w );
+DECLARE_READ16_DEVICE_HANDLER( es5505_r );
+DECLARE_WRITE16_DEVICE_HANDLER( es5505_w );
void es5505_voice_bank_w(device_t *device, int voice, int bank);
class es5506_device : public device_t,
@@ -62,8 +62,8 @@ struct es5506_interface
UINT16 (*read_port)(device_t *device); /* input port read */
};
-READ8_DEVICE_HANDLER( es5506_r );
-WRITE8_DEVICE_HANDLER( es5506_w );
+DECLARE_READ8_DEVICE_HANDLER( es5506_r );
+DECLARE_WRITE8_DEVICE_HANDLER( es5506_w );
void es5506_voice_bank_w(device_t *device, int voice, int bank);
class es5505_device : public es5506_device
diff --git a/src/emu/sound/es8712.h b/src/emu/sound/es8712.h
index c57a257cefb..89e0973c64d 100644
--- a/src/emu/sound/es8712.h
+++ b/src/emu/sound/es8712.h
@@ -11,7 +11,7 @@ void es8712_play(device_t *device);
void es8712_set_bank_base(device_t *device, int base);
void es8712_set_frequency(device_t *device, int frequency);
-WRITE8_DEVICE_HANDLER( es8712_w );
+DECLARE_WRITE8_DEVICE_HANDLER( es8712_w );
class es8712_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/gaelco.h b/src/emu/sound/gaelco.h
index a82057f5110..9a4fe4df54f 100644
--- a/src/emu/sound/gaelco.h
+++ b/src/emu/sound/gaelco.h
@@ -11,8 +11,8 @@ struct gaelcosnd_interface
int banks[4]; /* start of each ROM bank */
};
-WRITE16_DEVICE_HANDLER( gaelcosnd_w );
-READ16_DEVICE_HANDLER( gaelcosnd_r );
+DECLARE_WRITE16_DEVICE_HANDLER( gaelcosnd_w );
+DECLARE_READ16_DEVICE_HANDLER( gaelcosnd_r );
class gaelco_gae1_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/ics2115.h b/src/emu/sound/ics2115.h
index 79fc0061276..a1c177708cb 100644
--- a/src/emu/sound/ics2115.h
+++ b/src/emu/sound/ics2115.h
@@ -98,8 +98,8 @@ public:
// inline configuration helpers
static void static_set_irqf(device_t &device, void (*irqf)(device_t *device, int state));
- static READ8_DEVICE_HANDLER(read);
- static WRITE8_DEVICE_HANDLER(write);
+ static DECLARE_READ8_DEVICE_HANDLER(read);
+ static DECLARE_WRITE8_DEVICE_HANDLER(write);
//UINT8 read(offs_t offset);
//void write(offs_t offset, UINT8 data);
static TIMER_CALLBACK(timer_cb_0);
diff --git a/src/emu/sound/iremga20.h b/src/emu/sound/iremga20.h
index c069ee73a9b..407a358d9f5 100644
--- a/src/emu/sound/iremga20.h
+++ b/src/emu/sound/iremga20.h
@@ -10,8 +10,8 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( irem_ga20_w );
-READ8_DEVICE_HANDLER( irem_ga20_r );
+DECLARE_WRITE8_DEVICE_HANDLER( irem_ga20_w );
+DECLARE_READ8_DEVICE_HANDLER( irem_ga20_r );
class iremga20_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/k005289.h b/src/emu/sound/k005289.h
index a51b8422116..a0b390d2a44 100644
--- a/src/emu/sound/k005289.h
+++ b/src/emu/sound/k005289.h
@@ -5,12 +5,12 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( k005289_control_A_w );
-WRITE8_DEVICE_HANDLER( k005289_control_B_w );
-WRITE8_DEVICE_HANDLER( k005289_pitch_A_w );
-WRITE8_DEVICE_HANDLER( k005289_pitch_B_w );
-WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
-WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k005289_control_A_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k005289_control_B_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k005289_pitch_A_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k005289_pitch_B_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
class k005289_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/k007232.h b/src/emu/sound/k007232.h
index f346d1f520b..24284c2cf76 100644
--- a/src/emu/sound/k007232.h
+++ b/src/emu/sound/k007232.h
@@ -14,8 +14,8 @@ struct k007232_interface
void (*portwritehandler)(device_t *, int);
};
-WRITE8_DEVICE_HANDLER( k007232_w );
-READ8_DEVICE_HANDLER( k007232_r );
+DECLARE_WRITE8_DEVICE_HANDLER( k007232_w );
+DECLARE_READ8_DEVICE_HANDLER( k007232_r );
void k007232_set_bank( device_t *device, int chABank, int chBBank );
diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c
index 338b5009058..faef40078de 100644
--- a/src/emu/sound/k051649.c
+++ b/src/emu/sound/k051649.c
@@ -276,7 +276,7 @@ WRITE8_DEVICE_HANDLER( k051649_test_w )
READ8_DEVICE_HANDLER ( k051649_test_r )
{
/* reading the test register sets it to $ff! */
- k051649_test_w(device, offset, 0xff);
+ k051649_test_w(device, space, offset, 0xff);
return 0xff;
}
diff --git a/src/emu/sound/k051649.h b/src/emu/sound/k051649.h
index 5548b0e97e0..65aebff0ce7 100644
--- a/src/emu/sound/k051649.h
+++ b/src/emu/sound/k051649.h
@@ -5,16 +5,16 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( k051649_waveform_w );
-READ8_DEVICE_HANDLER ( k051649_waveform_r );
-WRITE8_DEVICE_HANDLER( k051649_volume_w );
-WRITE8_DEVICE_HANDLER( k051649_frequency_w );
-WRITE8_DEVICE_HANDLER( k051649_keyonoff_w );
-WRITE8_DEVICE_HANDLER( k051649_test_w );
-READ8_DEVICE_HANDLER ( k051649_test_r );
-
-WRITE8_DEVICE_HANDLER( k052539_waveform_w );
-READ8_DEVICE_HANDLER ( k052539_waveform_r );
+DECLARE_WRITE8_DEVICE_HANDLER( k051649_waveform_w );
+DECLARE_READ8_DEVICE_HANDLER ( k051649_waveform_r );
+DECLARE_WRITE8_DEVICE_HANDLER( k051649_volume_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k051649_frequency_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k051649_keyonoff_w );
+DECLARE_WRITE8_DEVICE_HANDLER( k051649_test_w );
+DECLARE_READ8_DEVICE_HANDLER ( k051649_test_r );
+
+DECLARE_WRITE8_DEVICE_HANDLER( k052539_waveform_w );
+DECLARE_READ8_DEVICE_HANDLER ( k052539_waveform_r );
class k051649_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/k053260.h b/src/emu/sound/k053260.h
index d28b3679e32..b51dd367750 100644
--- a/src/emu/sound/k053260.h
+++ b/src/emu/sound/k053260.h
@@ -17,8 +17,8 @@ struct k053260_interface {
};
-WRITE8_DEVICE_HANDLER( k053260_w );
-READ8_DEVICE_HANDLER( k053260_r );
+DECLARE_WRITE8_DEVICE_HANDLER( k053260_w );
+DECLARE_READ8_DEVICE_HANDLER( k053260_r );
class k053260_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/k056800.h b/src/emu/sound/k056800.h
index 7930ea3d56a..ca4a6a42b9b 100644
--- a/src/emu/sound/k056800.h
+++ b/src/emu/sound/k056800.h
@@ -57,10 +57,10 @@ extern const device_type K056800;
DEVICE I/O FUNCTIONS
***************************************************************************/
-READ32_DEVICE_HANDLER( k056800_host_r );
-WRITE32_DEVICE_HANDLER( k056800_host_w );
-READ16_DEVICE_HANDLER( k056800_sound_r );
-WRITE16_DEVICE_HANDLER( k056800_sound_w );
+DECLARE_READ32_DEVICE_HANDLER( k056800_host_r );
+DECLARE_WRITE32_DEVICE_HANDLER( k056800_host_w );
+DECLARE_READ16_DEVICE_HANDLER( k056800_sound_r );
+DECLARE_WRITE16_DEVICE_HANDLER( k056800_sound_w );
#endif /* __K056800_H__ */
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index 71bee8bf1d3..b780bdd8ab1 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -69,7 +69,7 @@ struct msm5232_state {
double external_capacity[8]; /* in Farads, eg 0.39e-6 = 0.36 uF (microFarads) */
device_t *device;
- void (*gate_handler)(device_t *device, int state); /* callback called when the GATE output pin changes state */
+ devcb_resolved_write_line gate_handler;/* callback called when the GATE output pin changes state */
};
@@ -260,10 +260,10 @@ static void msm5232_gate_update(msm5232_state *chip)
{
int new_state = (chip->control2 & 0x20) ? chip->voi[7].GF : 0;
- if (chip->gate != new_state && chip->gate_handler)
+ if (chip->gate != new_state && !chip->gate_handler.isnull())
{
chip->gate = new_state;
- (*chip->gate_handler)(chip->device, new_state);
+ chip->gate_handler(new_state);
}
}
@@ -275,8 +275,8 @@ static DEVICE_RESET( msm5232 )
for (i=0; i<8; i++)
{
- msm5232_w(device,i,0x80);
- msm5232_w(device,i,0x00);
+ msm5232_w(device,device->machine().driver_data()->generic_space(),i,0x80);
+ msm5232_w(device,device->machine().driver_data()->generic_space(),i,0x00);
}
chip->noise_cnt = 0;
chip->noise_rng = 1;
@@ -309,7 +309,7 @@ static void msm5232_init(msm5232_state *chip, const msm5232_interface *intf, int
chip->external_capacity[j] = intf->capacity[j];
}
- chip->gate_handler = intf->gate_handler;
+ chip->gate_handler.resolve(intf->gate_handler_cb, *chip->device);
msm5232_init_tables( chip );
diff --git a/src/emu/sound/msm5232.h b/src/emu/sound/msm5232.h
index 11e9eb3e033..11f8b218639 100644
--- a/src/emu/sound/msm5232.h
+++ b/src/emu/sound/msm5232.h
@@ -8,10 +8,10 @@
struct msm5232_interface
{
double capacity[8]; /* in Farads, capacitors connected to pins: 24,25,26,27 and 37,38,39,40 */
- void (*gate_handler)(device_t *device, int state); /* callback called when the GATE output pin changes state */
+ devcb_write_line gate_handler_cb; /* callback called when the GATE output pin changes state */
};
-WRITE8_DEVICE_HANDLER( msm5232_w );
+DECLARE_WRITE8_DEVICE_HANDLER( msm5232_w );
void msm5232_set_clock(device_t *device, int clock);
diff --git a/src/emu/sound/multipcm.h b/src/emu/sound/multipcm.h
index 4beaa933ea0..a91f23d9273 100644
--- a/src/emu/sound/multipcm.h
+++ b/src/emu/sound/multipcm.h
@@ -5,8 +5,8 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( multipcm_w );
-READ8_DEVICE_HANDLER( multipcm_r );
+DECLARE_WRITE8_DEVICE_HANDLER( multipcm_w );
+DECLARE_READ8_DEVICE_HANDLER( multipcm_r );
void multipcm_set_bank(device_t *device, UINT32 leftoffs, UINT32 rightoffs);
diff --git a/src/emu/sound/n63701x.h b/src/emu/sound/n63701x.h
index 813c2b73263..8cc487f36b5 100644
--- a/src/emu/sound/n63701x.h
+++ b/src/emu/sound/n63701x.h
@@ -5,7 +5,7 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( namco_63701x_w );
+DECLARE_WRITE8_DEVICE_HANDLER( namco_63701x_w );
class namco_63701x_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c
index ec595ad0271..cccd569b686 100644
--- a/src/emu/sound/namco.c
+++ b/src/emu/sound/namco.c
@@ -638,6 +638,7 @@ void mappy_sound_enable(device_t *device, int enable)
chip->sound_enable = enable;
}
+static DECLARE_WRITE8_DEVICE_HANDLER( namco_15xx_w );
static WRITE8_DEVICE_HANDLER( namco_15xx_w )
{
namco_sound *chip = get_safe_token(device);
@@ -704,6 +705,7 @@ static WRITE8_DEVICE_HANDLER( namco_15xx_w )
0x3c ch 0 noise sw
*/
+static DECLARE_WRITE8_DEVICE_HANDLER( namcos1_sound_w );
static WRITE8_DEVICE_HANDLER( namcos1_sound_w )
{
namco_sound *chip = get_safe_token(device);
@@ -781,7 +783,7 @@ WRITE8_DEVICE_HANDLER( namcos1_cus30_w )
}
}
else if (offset < 0x140)
- namcos1_sound_w(device, offset - 0x100,data);
+ namcos1_sound_w(device, space, offset - 0x100,data);
else
chip->wavedata[offset] = data;
}
@@ -803,7 +805,7 @@ READ8_DEVICE_HANDLER( namco_snd_sharedram_r )
WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w )
{
if (offset < 0x40)
- namco_15xx_w(device, offset, data);
+ namco_15xx_w(device, space, offset, data);
else
{
namco_sound *chip = get_safe_token(device);
diff --git a/src/emu/sound/namco.h b/src/emu/sound/namco.h
index ce6cfc7c245..77cb524200f 100644
--- a/src/emu/sound/namco.h
+++ b/src/emu/sound/namco.h
@@ -11,20 +11,20 @@ struct namco_interface
int stereo; /* set to 1 to indicate stereo (e.g., System 1) */
};
-WRITE8_DEVICE_HANDLER( pacman_sound_enable_w );
-WRITE8_DEVICE_HANDLER( pacman_sound_w );
+DECLARE_WRITE8_DEVICE_HANDLER( pacman_sound_enable_w );
+DECLARE_WRITE8_DEVICE_HANDLER( pacman_sound_w );
void polepos_sound_enable(device_t *device, int enable);
-READ8_DEVICE_HANDLER( polepos_sound_r );
-WRITE8_DEVICE_HANDLER( polepos_sound_w );
+DECLARE_READ8_DEVICE_HANDLER( polepos_sound_r );
+DECLARE_WRITE8_DEVICE_HANDLER( polepos_sound_w );
void mappy_sound_enable(device_t *device, int enable);
-WRITE8_DEVICE_HANDLER( namcos1_cus30_w ); /* wavedata + sound registers + RAM */
-READ8_DEVICE_HANDLER( namcos1_cus30_r );
+DECLARE_WRITE8_DEVICE_HANDLER( namcos1_cus30_w ); /* wavedata + sound registers + RAM */
+DECLARE_READ8_DEVICE_HANDLER( namcos1_cus30_r );
-READ8_DEVICE_HANDLER( namco_snd_sharedram_r );
-WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w );
+DECLARE_READ8_DEVICE_HANDLER( namco_snd_sharedram_r );
+DECLARE_WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w );
class namco_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/nes_apu.h b/src/emu/sound/nes_apu.h
index a356b4edcc1..8399232b73a 100644
--- a/src/emu/sound/nes_apu.h
+++ b/src/emu/sound/nes_apu.h
@@ -42,8 +42,8 @@ struct nes_interface
const char *cpu_tag; /* CPU tag */
};
-READ8_DEVICE_HANDLER( nes_psg_r );
-WRITE8_DEVICE_HANDLER( nes_psg_w );
+DECLARE_READ8_DEVICE_HANDLER( nes_psg_r );
+DECLARE_WRITE8_DEVICE_HANDLER( nes_psg_w );
class nesapu_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/nile.h b/src/emu/sound/nile.h
index b378ba476e3..9cb3cbe3d89 100644
--- a/src/emu/sound/nile.h
+++ b/src/emu/sound/nile.h
@@ -5,10 +5,10 @@
#include "devlegcy.h"
-WRITE16_DEVICE_HANDLER( nile_snd_w );
-READ16_DEVICE_HANDLER( nile_snd_r );
-WRITE16_DEVICE_HANDLER( nile_sndctrl_w );
-READ16_DEVICE_HANDLER( nile_sndctrl_r );
+DECLARE_WRITE16_DEVICE_HANDLER( nile_snd_w );
+DECLARE_READ16_DEVICE_HANDLER( nile_snd_r );
+DECLARE_WRITE16_DEVICE_HANDLER( nile_sndctrl_w );
+DECLARE_READ16_DEVICE_HANDLER( nile_sndctrl_r );
class nile_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/okim6258.h b/src/emu/sound/okim6258.h
index 03b9bebe1d8..b9bbcc0f36f 100644
--- a/src/emu/sound/okim6258.h
+++ b/src/emu/sound/okim6258.h
@@ -29,9 +29,9 @@ void okim6258_set_divider(device_t *device, int val);
void okim6258_set_clock(device_t *device, int val);
int okim6258_get_vclk(device_t *device);
-READ8_DEVICE_HANDLER( okim6258_status_r );
-WRITE8_DEVICE_HANDLER( okim6258_data_w );
-WRITE8_DEVICE_HANDLER( okim6258_ctrl_w );
+DECLARE_READ8_DEVICE_HANDLER( okim6258_status_r );
+DECLARE_WRITE8_DEVICE_HANDLER( okim6258_data_w );
+DECLARE_WRITE8_DEVICE_HANDLER( okim6258_ctrl_w );
class okim6258_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/okim6376.h b/src/emu/sound/okim6376.h
index 003bcd14fc1..ece5e6c785b 100644
--- a/src/emu/sound/okim6376.h
+++ b/src/emu/sound/okim6376.h
@@ -7,8 +7,8 @@
/* an interface for the OKIM6376 and similar chips (CPU interface only) */
-READ8_DEVICE_HANDLER( okim6376_r );
-WRITE8_DEVICE_HANDLER( okim6376_w );
+DECLARE_READ8_DEVICE_HANDLER( okim6376_r );
+DECLARE_WRITE8_DEVICE_HANDLER( okim6376_w );
class okim6376_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/qsound.h b/src/emu/sound/qsound.h
index bfc274d461a..86b810e2e4d 100644
--- a/src/emu/sound/qsound.h
+++ b/src/emu/sound/qsound.h
@@ -13,8 +13,8 @@
#define QSOUND_CLOCK 4000000 /* default 4MHz clock */
-WRITE8_DEVICE_HANDLER( qsound_w );
-READ8_DEVICE_HANDLER( qsound_r );
+DECLARE_WRITE8_DEVICE_HANDLER( qsound_w );
+DECLARE_READ8_DEVICE_HANDLER( qsound_r );
class qsound_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/rf5c400.h b/src/emu/sound/rf5c400.h
index 34b5a66e3fd..16bd3455d86 100644
--- a/src/emu/sound/rf5c400.h
+++ b/src/emu/sound/rf5c400.h
@@ -7,8 +7,8 @@
#include "devlegcy.h"
-READ16_DEVICE_HANDLER( rf5c400_r );
-WRITE16_DEVICE_HANDLER( rf5c400_w );
+DECLARE_READ16_DEVICE_HANDLER( rf5c400_r );
+DECLARE_WRITE16_DEVICE_HANDLER( rf5c400_w );
class rf5c400_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/rf5c68.h b/src/emu/sound/rf5c68.h
index 823cb5d35fc..1b8c4996882 100644
--- a/src/emu/sound/rf5c68.h
+++ b/src/emu/sound/rf5c68.h
@@ -10,11 +10,11 @@
#include "devlegcy.h"
/******************************************/
-READ8_DEVICE_HANDLER( rf5c68_r );
-WRITE8_DEVICE_HANDLER( rf5c68_w );
+DECLARE_READ8_DEVICE_HANDLER( rf5c68_r );
+DECLARE_WRITE8_DEVICE_HANDLER( rf5c68_w );
-READ8_DEVICE_HANDLER( rf5c68_mem_r );
-WRITE8_DEVICE_HANDLER( rf5c68_mem_w );
+DECLARE_READ8_DEVICE_HANDLER( rf5c68_mem_r );
+DECLARE_WRITE8_DEVICE_HANDLER( rf5c68_mem_w );
struct rf5c68_interface
{
diff --git a/src/emu/sound/saa1099.h b/src/emu/sound/saa1099.h
index e24ef538777..ccbb1c75f3f 100644
--- a/src/emu/sound/saa1099.h
+++ b/src/emu/sound/saa1099.h
@@ -9,8 +9,8 @@
Philips SAA1099 Sound driver
**********************************************/
-WRITE8_DEVICE_HANDLER( saa1099_control_w );
-WRITE8_DEVICE_HANDLER( saa1099_data_w );
+DECLARE_WRITE8_DEVICE_HANDLER( saa1099_control_w );
+DECLARE_WRITE8_DEVICE_HANDLER( saa1099_data_w );
class saa1099_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index e221cf8f482..f830ba2e630 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -230,7 +230,7 @@ struct scsp_state
device_t *device;
};
-static void dma_scsp(address_space *space, scsp_state *scsp); /*state DMA transfer function*/
+static void dma_scsp(address_space &space, scsp_state *scsp); /*state DMA transfer function*/
#define scsp_dgate scsp->scsp_dmactrl & 0x4000
#define scsp_ddir scsp->scsp_dmactrl & 0x2000
#define scsp_dexe scsp->scsp_dmactrl & 0x1000
@@ -698,11 +698,8 @@ static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r)
}
}
-static void SCSP_UpdateReg(scsp_state *scsp, int reg)
+static void SCSP_UpdateReg(scsp_state *scsp, address_space &space, int reg)
{
- /* temporary hack until this is converted to a device */
- address_space *space = scsp->device->machine().firstcpu->space(AS_PROGRAM);
-
switch(reg&0x3f)
{
case 0x0:
@@ -726,7 +723,7 @@ static void SCSP_UpdateReg(scsp_state *scsp, int reg)
break;
case 0x6:
case 0x7:
- scsp_midi_in(space->machine().device("scsp"), 0, scsp->udata.data[0x6/2]&0xff, 0);
+ scsp_midi_in(space.machine().device("scsp"), space, 0, scsp->udata.data[0x6/2]&0xff, 0);
break;
case 0x12:
case 0x13:
@@ -837,7 +834,7 @@ static void SCSP_UpdateSlotRegR(scsp_state *scsp, int slot,int reg)
}
-static void SCSP_UpdateRegR(scsp_state *scsp, int reg)
+static void SCSP_UpdateRegR(scsp_state *scsp, address_space &space, int reg)
{
switch(reg&0x3f)
{
@@ -885,7 +882,7 @@ static void SCSP_UpdateRegR(scsp_state *scsp, int reg)
}
}
-static void SCSP_w16(scsp_state *scsp,unsigned int addr,unsigned short val)
+static void SCSP_w16(scsp_state *scsp,address_space &space,unsigned int addr,unsigned short val)
{
addr&=0xffff;
if(addr<0x400)
@@ -900,7 +897,7 @@ static void SCSP_w16(scsp_state *scsp,unsigned int addr,unsigned short val)
if (addr < 0x430)
{
*((unsigned short *) (scsp->udata.datab+((addr&0x3f)))) = val;
- SCSP_UpdateReg(scsp, addr&0x3f);
+ SCSP_UpdateReg(scsp, space, addr&0x3f);
}
}
else if(addr<0x700)
@@ -924,7 +921,7 @@ static void SCSP_w16(scsp_state *scsp,unsigned int addr,unsigned short val)
}
}
-static unsigned short SCSP_r16(scsp_state *scsp, unsigned int addr)
+static unsigned short SCSP_r16(scsp_state *scsp, address_space &space, unsigned int addr)
{
unsigned short v=0;
addr&=0xffff;
@@ -941,7 +938,7 @@ static unsigned short SCSP_r16(scsp_state *scsp, unsigned int addr)
{
if (addr < 0x430)
{
- SCSP_UpdateRegR(scsp, addr&0x3f);
+ SCSP_UpdateRegR(scsp, space, addr&0x3f);
v= *((unsigned short *) (scsp->udata.datab+((addr&0x3f))));
}
}
@@ -1180,7 +1177,7 @@ static void SCSP_DoMasterSamples(scsp_state *scsp, int nsamples)
}
/* TODO: this needs to be timer-ized */
-static void dma_scsp(address_space *space, scsp_state *scsp)
+static void dma_scsp(address_space &space, scsp_state *scsp)
{
static UINT16 tmp_dma[3];
int i;
@@ -1212,7 +1209,7 @@ static void dma_scsp(address_space *space, scsp_state *scsp)
{
for(i=0;i < scsp->scsp_dtlg;i+=2)
{
- space->write_word(scsp->scsp_dmea, space->read_word(0x100000|scsp->scsp_drga));
+ space.write_word(scsp->scsp_dmea, space.read_word(0x100000|scsp->scsp_drga));
scsp->scsp_dmea+=2;
scsp->scsp_drga+=2;
}
@@ -1221,7 +1218,7 @@ static void dma_scsp(address_space *space, scsp_state *scsp)
{
for(i=0;i < scsp->scsp_dtlg;i+=2)
{
- space->write_word(0x100000|scsp->scsp_drga,space->read_word(scsp->scsp_dmea));
+ space.write_word(0x100000|scsp->scsp_drga,space.read_word(scsp->scsp_dmea));
scsp->scsp_dmea+=2;
scsp->scsp_drga+=2;
}
@@ -1240,7 +1237,7 @@ static void dma_scsp(address_space *space, scsp_state *scsp)
if(scsp->udata.data[0x1e/2] & 0x10)
{
popmessage("SCSP DMA IRQ triggered, contact MAMEdev");
- space->machine().device("audiocpu")->execute().set_input_line(DecodeSCI(scsp,SCIDMA),HOLD_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(DecodeSCI(scsp,SCIDMA),HOLD_LINE);
}
}
@@ -1302,7 +1299,7 @@ READ16_DEVICE_HANDLER( scsp_r )
scsp->stream->update();
- return SCSP_r16(scsp, offset*2);
+ return SCSP_r16(scsp, space, offset*2);
}
WRITE16_DEVICE_HANDLER( scsp_w )
@@ -1312,9 +1309,9 @@ WRITE16_DEVICE_HANDLER( scsp_w )
scsp->stream->update();
- tmp = SCSP_r16(scsp, offset*2);
+ tmp = SCSP_r16(scsp, space, offset*2);
COMBINE_DATA(&tmp);
- SCSP_w16(scsp,offset*2, tmp);
+ SCSP_w16(scsp,space,offset*2, tmp);
switch(offset*2)
{
@@ -1324,7 +1321,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
case 0x416:
COMBINE_DATA(&scsp->dma_regs[((offset-0x412)/2) & 3]);
if(ACCESSING_BITS_8_15 && offset*2 == 0x416)
- dma_scsp(device->machine().firstcpu->space(AS_PROGRAM), scsp);
+ dma_scsp(space, scsp);
break;
case 0x42a: //check main cpu IRQ
scsp->main_irq(1);
diff --git a/src/emu/sound/scsp.h b/src/emu/sound/scsp.h
index 2eff5ebf971..0369fbcc631 100644
--- a/src/emu/sound/scsp.h
+++ b/src/emu/sound/scsp.h
@@ -19,12 +19,12 @@ struct scsp_interface
void scsp_set_ram_base(device_t *device, void *base);
// SCSP register access
-READ16_DEVICE_HANDLER( scsp_r );
-WRITE16_DEVICE_HANDLER( scsp_w );
+DECLARE_READ16_DEVICE_HANDLER( scsp_r );
+DECLARE_WRITE16_DEVICE_HANDLER( scsp_w );
// MIDI I/O access (used for comms on Model 2/3)
-WRITE16_DEVICE_HANDLER( scsp_midi_in );
-READ16_DEVICE_HANDLER( scsp_midi_out_r );
+DECLARE_WRITE16_DEVICE_HANDLER( scsp_midi_in );
+DECLARE_READ16_DEVICE_HANDLER( scsp_midi_out_r );
extern UINT32* stv_scu;
diff --git a/src/emu/sound/segapcm.h b/src/emu/sound/segapcm.h
index 0419f230879..6a051e4064e 100644
--- a/src/emu/sound/segapcm.h
+++ b/src/emu/sound/segapcm.h
@@ -21,8 +21,8 @@ struct sega_pcm_interface
int bank;
};
-WRITE8_DEVICE_HANDLER( sega_pcm_w );
-READ8_DEVICE_HANDLER( sega_pcm_r );
+DECLARE_WRITE8_DEVICE_HANDLER( sega_pcm_w );
+DECLARE_READ8_DEVICE_HANDLER( sega_pcm_r );
class segapcm_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/sn76496.h b/src/emu/sound/sn76496.h
index 1ce40acaf8b..49e1ee6e971 100644
--- a/src/emu/sound/sn76496.h
+++ b/src/emu/sound/sn76496.h
@@ -6,8 +6,8 @@
#include "devlegcy.h"
READ_LINE_DEVICE_HANDLER( sn76496_ready_r );
-WRITE8_DEVICE_HANDLER( sn76496_w );
-WRITE8_DEVICE_HANDLER( sn76496_stereo_w );
+DECLARE_WRITE8_DEVICE_HANDLER( sn76496_w );
+DECLARE_WRITE8_DEVICE_HANDLER( sn76496_stereo_w );
class sn76496_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/snkwave.h b/src/emu/sound/snkwave.h
index 2ed3a67048d..11a16736b2b 100644
--- a/src/emu/sound/snkwave.h
+++ b/src/emu/sound/snkwave.h
@@ -5,7 +5,7 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( snkwave_w );
+DECLARE_WRITE8_DEVICE_HANDLER( snkwave_w );
class snkwave_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/sp0250.h b/src/emu/sound/sp0250.h
index dba4d8dd6d5..019ab27a296 100644
--- a/src/emu/sound/sp0250.h
+++ b/src/emu/sound/sp0250.h
@@ -9,7 +9,7 @@ struct sp0250_interface {
void (*drq_callback)(device_t *device, int state);
};
-WRITE8_DEVICE_HANDLER( sp0250_w );
+DECLARE_WRITE8_DEVICE_HANDLER( sp0250_w );
UINT8 sp0250_drq_r(device_t *device);
class sp0250_device : public device_t,
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 8996ab3581f..77ca2989f99 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -1317,7 +1317,7 @@ WRITE16_DEVICE_HANDLER( spb640_w )
if( offset == 0 )
{
- sp0256_ALD_w( device, 0, data & 0xff );
+ sp0256_ALD_w( device, space, 0, data & 0xff );
return;
}
diff --git a/src/emu/sound/sp0256.h b/src/emu/sound/sp0256.h
index 6b73fb9860f..d236c638da7 100644
--- a/src/emu/sound/sp0256.h
+++ b/src/emu/sound/sp0256.h
@@ -62,13 +62,13 @@ void sp0256_bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length);
void sp0256_set_clock(device_t *device, int clock);
-WRITE8_DEVICE_HANDLER( sp0256_ALD_w );
+DECLARE_WRITE8_DEVICE_HANDLER( sp0256_ALD_w );
READ_LINE_DEVICE_HANDLER( sp0256_lrq_r );
READ_LINE_DEVICE_HANDLER( sp0256_sby_r );
-READ16_DEVICE_HANDLER( spb640_r );
-WRITE16_DEVICE_HANDLER( spb640_w );
+DECLARE_READ16_DEVICE_HANDLER( spb640_r );
+DECLARE_WRITE16_DEVICE_HANDLER( spb640_w );
class sp0256_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/st0016.h b/src/emu/sound/st0016.h
index 44d60973033..6bd1ad9fdd9 100644
--- a/src/emu/sound/st0016.h
+++ b/src/emu/sound/st0016.h
@@ -10,8 +10,8 @@ struct st0016_interface
UINT8 **p_soundram;
};
-READ8_DEVICE_HANDLER( st0016_snd_r );
-WRITE8_DEVICE_HANDLER( st0016_snd_w );
+DECLARE_READ8_DEVICE_HANDLER( st0016_snd_r );
+DECLARE_WRITE8_DEVICE_HANDLER( st0016_snd_w );
class st0016_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/t6w28.h b/src/emu/sound/t6w28.h
index 528cd39feba..30afa34a0e6 100644
--- a/src/emu/sound/t6w28.h
+++ b/src/emu/sound/t6w28.h
@@ -5,7 +5,7 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( t6w28_w );
+DECLARE_WRITE8_DEVICE_HANDLER( t6w28_w );
class t6w28_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/tiaintf.h b/src/emu/sound/tiaintf.h
index 6ce175789b4..97595b6b683 100644
--- a/src/emu/sound/tiaintf.h
+++ b/src/emu/sound/tiaintf.h
@@ -5,7 +5,7 @@
#include "devlegcy.h"
-WRITE8_DEVICE_HANDLER( tia_sound_w );
+DECLARE_WRITE8_DEVICE_HANDLER( tia_sound_w );
class tia_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/tms5110.h b/src/emu/sound/tms5110.h
index 89ecc861c41..4bd3db7c34b 100644
--- a/src/emu/sound/tms5110.h
+++ b/src/emu/sound/tms5110.h
@@ -38,18 +38,18 @@ struct tms5110_interface
devcb_write_line romclk_func; /* rom clock - Only used to drive the data lines */
};
-WRITE8_DEVICE_HANDLER( tms5110_ctl_w );
-READ8_DEVICE_HANDLER( tms5110_ctl_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tms5110_ctl_w );
+DECLARE_READ8_DEVICE_HANDLER( tms5110_ctl_r );
WRITE_LINE_DEVICE_HANDLER( tms5110_pdc_w );
/* this is only used by cvs.c
* it is not related at all to the speech generation
* and conflicts with the new rom controller interface.
*/
-READ8_DEVICE_HANDLER( tms5110_romclk_hack_r );
+DECLARE_READ8_DEVICE_HANDLER( tms5110_romclk_hack_r );
/* m58817 status line */
-READ8_DEVICE_HANDLER( m58817_status_r );
+DECLARE_READ8_DEVICE_HANDLER( m58817_status_r );
int tms5110_ready_r(device_t *device);
@@ -188,8 +188,8 @@ WRITE_LINE_DEVICE_HANDLER( tmsprom_m0_w );
READ_LINE_DEVICE_HANDLER( tmsprom_data_r );
/* offset is rom # */
-WRITE8_DEVICE_HANDLER( tmsprom_rom_csq_w );
-WRITE8_DEVICE_HANDLER( tmsprom_bit_w );
+DECLARE_WRITE8_DEVICE_HANDLER( tmsprom_rom_csq_w );
+DECLARE_WRITE8_DEVICE_HANDLER( tmsprom_bit_w );
WRITE_LINE_DEVICE_HANDLER( tmsprom_enable_w );
class tmsprom_device : public device_t
diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h
index c3c102f0d3a..0a2e5adcf64 100644
--- a/src/emu/sound/tms5220.h
+++ b/src/emu/sound/tms5220.h
@@ -30,8 +30,8 @@ struct tms5220_interface
WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w );
WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w );
-WRITE8_DEVICE_HANDLER( tms5220_data_w );
-READ8_DEVICE_HANDLER( tms5220_status_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tms5220_data_w );
+DECLARE_READ8_DEVICE_HANDLER( tms5220_status_r );
READ_LINE_DEVICE_HANDLER( tms5220_readyq_r );
READ_LINE_DEVICE_HANDLER( tms5220_intq_r );
diff --git a/src/emu/sound/upd7759.h b/src/emu/sound/upd7759.h
index 3c42863fb3f..db4d1c913a1 100644
--- a/src/emu/sound/upd7759.h
+++ b/src/emu/sound/upd7759.h
@@ -25,7 +25,7 @@ void upd7759_set_bank_base(device_t *device, offs_t base);
void upd7759_reset_w(device_t *device, UINT8 data);
void upd7759_start_w(device_t *device, UINT8 data);
int upd7759_busy_r(device_t *device);
-WRITE8_DEVICE_HANDLER( upd7759_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( upd7759_port_w );
class upd7759_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/vlm5030.h b/src/emu/sound/vlm5030.h
index 87730ec95c8..2a63d25648c 100644
--- a/src/emu/sound/vlm5030.h
+++ b/src/emu/sound/vlm5030.h
@@ -16,7 +16,7 @@ void vlm5030_set_rom(device_t *device, void *speech_rom);
/* get BSY pin level */
int vlm5030_bsy(device_t *device);
/* latch contoll data */
-WRITE8_DEVICE_HANDLER( vlm5030_data_w );
+DECLARE_WRITE8_DEVICE_HANDLER( vlm5030_data_w );
/* set RST pin level : reset / set table address A8-A15 */
void vlm5030_rst (device_t *device, int pin );
/* set VCU pin level : ?? unknown */
diff --git a/src/emu/sound/vrender0.h b/src/emu/sound/vrender0.h
index d1fa8cb95aa..444aa547744 100644
--- a/src/emu/sound/vrender0.h
+++ b/src/emu/sound/vrender0.h
@@ -13,8 +13,8 @@ struct vr0_interface
void vr0_snd_set_areas(device_t *device,UINT32 *texture,UINT32 *frame);
-READ32_DEVICE_HANDLER( vr0_snd_read );
-WRITE32_DEVICE_HANDLER( vr0_snd_write );
+DECLARE_READ32_DEVICE_HANDLER( vr0_snd_read );
+DECLARE_WRITE32_DEVICE_HANDLER( vr0_snd_write );
class vrender0_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index 03cf395a694..7a486e49a97 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -269,7 +269,7 @@ READ16_DEVICE_HANDLER( seta_sound_word_r )
UINT16 ret;
ret = info->HI_WORD_BUF[offset]<<8;
- ret += (seta_sound_r( device, offset )&0xff);
+ ret += (seta_sound_r( device, space, offset )&0xff);
LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, ret ));
return ret;
}
@@ -278,7 +278,7 @@ WRITE16_DEVICE_HANDLER( seta_sound_word_w )
{
x1_010_state *info = get_safe_token(device);
info->HI_WORD_BUF[offset] = (data>>8)&0xff;
- seta_sound_w( device, offset, data&0xff );
+ seta_sound_w( device, space, offset, data&0xff );
LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, data ));
}
diff --git a/src/emu/sound/x1_010.h b/src/emu/sound/x1_010.h
index e765aa984fa..9405d1ea0d6 100644
--- a/src/emu/sound/x1_010.h
+++ b/src/emu/sound/x1_010.h
@@ -12,11 +12,11 @@ struct x1_010_interface
};
-READ8_DEVICE_HANDLER ( seta_sound_r );
-WRITE8_DEVICE_HANDLER( seta_sound_w );
+DECLARE_READ8_DEVICE_HANDLER ( seta_sound_r );
+DECLARE_WRITE8_DEVICE_HANDLER( seta_sound_w );
-READ16_DEVICE_HANDLER ( seta_sound_word_r );
-WRITE16_DEVICE_HANDLER( seta_sound_word_w );
+DECLARE_READ16_DEVICE_HANDLER ( seta_sound_word_r );
+DECLARE_WRITE16_DEVICE_HANDLER( seta_sound_word_w );
void seta_sound_enable_w(device_t *device, int data);
diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c
index fa175e7d8c4..d69801a84de 100644
--- a/src/emu/sound/ym2151.c
+++ b/src/emu/sound/ym2151.c
@@ -163,7 +163,7 @@ struct YM2151
UINT32 noise_tab[32]; /* 17bit Noise Generator periods */
void (*irqhandler)(device_t *device, int irq); /* IRQ function handler */
- write8_device_func porthandler; /* port write function handler */
+ void (*porthandler)(device_t *, offs_t, UINT8); /* port write function handler */
device_t *device;
unsigned int clock; /* chip clock in Hz (passed from 2151intf.c) */
@@ -2492,7 +2492,7 @@ void ym2151_set_irq_handler(void *chip, void(*handler)(device_t *device, int irq
PSG->irqhandler = handler;
}
-void ym2151_set_port_write_handler(void *chip, write8_device_func handler)
+void ym2151_set_port_write_handler(void *chip, void (*handler)(device_t *, offs_t, UINT8))
{
YM2151 *PSG = (YM2151 *)chip;
PSG->porthandler = handler;
diff --git a/src/emu/sound/ym2151.h b/src/emu/sound/ym2151.h
index 045296839b0..b14f764d104 100644
--- a/src/emu/sound/ym2151.h
+++ b/src/emu/sound/ym2151.h
@@ -81,6 +81,6 @@ int ym2151_read_status(void *chip);
void ym2151_set_irq_handler(void *chip, void (*handler)(device_t *device, int irq));
/* set port write handler on YM2151 chip number 'n'*/
-void ym2151_set_port_write_handler(void *chip, write8_device_func handler);
+void ym2151_set_port_write_handler(void *chip, void (*handler)(device_t *, offs_t, UINT8));
#endif /*__YM2151_H__*/
diff --git a/src/emu/sound/ymf271.h b/src/emu/sound/ymf271.h
index d1ff2dab2ec..640b2030b17 100644
--- a/src/emu/sound/ymf271.h
+++ b/src/emu/sound/ymf271.h
@@ -13,8 +13,8 @@ struct ymf271_interface
void (*irq_callback)(device_t *device, int state); /* irq callback */
};
-READ8_DEVICE_HANDLER( ymf271_r );
-WRITE8_DEVICE_HANDLER( ymf271_w );
+DECLARE_READ8_DEVICE_HANDLER( ymf271_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf271_w );
class ymf271_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/ymf278b.h b/src/emu/sound/ymf278b.h
index 9b81b3c2b28..493386b0e77 100644
--- a/src/emu/sound/ymf278b.h
+++ b/src/emu/sound/ymf278b.h
@@ -13,8 +13,8 @@ struct ymf278b_interface
void (*irq_callback)(device_t *device, int state); /* irq callback */
};
-READ8_DEVICE_HANDLER( ymf278b_r );
-WRITE8_DEVICE_HANDLER( ymf278b_w );
+DECLARE_READ8_DEVICE_HANDLER( ymf278b_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ymf278b_w );
class ymf278b_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/ymz280b.h b/src/emu/sound/ymz280b.h
index 7d90c1faf6c..a1328600501 100644
--- a/src/emu/sound/ymz280b.h
+++ b/src/emu/sound/ymz280b.h
@@ -20,8 +20,8 @@ struct ymz280b_interface
devcb_write8 ext_write; /* external RAM write */
};
-READ8_DEVICE_HANDLER ( ymz280b_r );
-WRITE8_DEVICE_HANDLER( ymz280b_w );
+DECLARE_READ8_DEVICE_HANDLER ( ymz280b_r );
+DECLARE_WRITE8_DEVICE_HANDLER( ymz280b_w );
class ymz280b_device : public device_t,
public device_sound_interface
diff --git a/src/emu/sound/zsg2.h b/src/emu/sound/zsg2.h
index c742fc88be2..1d3bf4b58da 100644
--- a/src/emu/sound/zsg2.h
+++ b/src/emu/sound/zsg2.h
@@ -7,8 +7,8 @@
#ifndef __ZSG2_H__
#define __ZSG2_H__
-READ16_DEVICE_HANDLER( zsg2_r );
-WRITE16_DEVICE_HANDLER( zsg2_w );
+DECLARE_READ16_DEVICE_HANDLER( zsg2_r );
+DECLARE_WRITE16_DEVICE_HANDLER( zsg2_w );
struct zsg2_interface
{
diff --git a/src/emu/video/hd63484.h b/src/emu/video/hd63484.h
index 1270af71589..aa4cd95ddf6 100644
--- a/src/emu/video/hd63484.h
+++ b/src/emu/video/hd63484.h
@@ -55,15 +55,15 @@ struct hd63484_interface
DEVICE I/O FUNCTIONS
***************************************************************************/
-READ16_DEVICE_HANDLER( hd63484_status_r );
-WRITE16_DEVICE_HANDLER( hd63484_address_w );
-WRITE16_DEVICE_HANDLER( hd63484_data_w );
-READ16_DEVICE_HANDLER( hd63484_data_r );
-
-READ16_DEVICE_HANDLER( hd63484_ram_r );
-READ16_DEVICE_HANDLER( hd63484_regs_r );
-WRITE16_DEVICE_HANDLER( hd63484_ram_w );
-WRITE16_DEVICE_HANDLER( hd63484_regs_w );
+DECLARE_READ16_DEVICE_HANDLER( hd63484_status_r );
+DECLARE_WRITE16_DEVICE_HANDLER( hd63484_address_w );
+DECLARE_WRITE16_DEVICE_HANDLER( hd63484_data_w );
+DECLARE_READ16_DEVICE_HANDLER( hd63484_data_r );
+
+DECLARE_READ16_DEVICE_HANDLER( hd63484_ram_r );
+DECLARE_READ16_DEVICE_HANDLER( hd63484_regs_r );
+DECLARE_WRITE16_DEVICE_HANDLER( hd63484_ram_w );
+DECLARE_WRITE16_DEVICE_HANDLER( hd63484_regs_w );
#endif /* __HD63484_H__ */
diff --git a/src/emu/video/i8275.h b/src/emu/video/i8275.h
index cd918e0bb70..058a5439ebc 100644
--- a/src/emu/video/i8275.h
+++ b/src/emu/video/i8275.h
@@ -65,13 +65,13 @@ struct i8275_interface
***************************************************************************/
/* register access */
-READ8_DEVICE_HANDLER ( i8275_r );
-WRITE8_DEVICE_HANDLER ( i8275_w );
+DECLARE_READ8_DEVICE_HANDLER ( i8275_r );
+DECLARE_WRITE8_DEVICE_HANDLER ( i8275_w );
/* updates the screen */
void i8275_update(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect);
-WRITE8_DEVICE_HANDLER( i8275_dack_w );
+DECLARE_WRITE8_DEVICE_HANDLER( i8275_dack_w );
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h
index 4bdd3e3a31c..c4bba32fd53 100644
--- a/src/emu/video/pc_vga.h
+++ b/src/emu/video/pc_vga.h
@@ -99,8 +99,8 @@ READ8_HANDLER(s3_mem_r);
WRITE8_HANDLER(s3_mem_w);
READ8_HANDLER( ati_port_03c0_r );
-READ8_DEVICE_HANDLER(ati_port_ext_r);
-WRITE8_DEVICE_HANDLER(ati_port_ext_w);
+DECLARE_READ8_DEVICE_HANDLER(ati_port_ext_r);
+DECLARE_WRITE8_DEVICE_HANDLER(ati_port_ext_w);
READ16_HANDLER(ibm8514_gpstatus_r);
WRITE16_HANDLER(ibm8514_cmd_w);
READ16_HANDLER(mach8_ext_fifo_r);
diff --git a/src/emu/video/s2636.h b/src/emu/video/s2636.h
index 84246e3684d..d655bca86d5 100644
--- a/src/emu/video/s2636.h
+++ b/src/emu/video/s2636.h
@@ -71,8 +71,8 @@ extern const device_type S2636;
D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */
bitmap_ind16 &s2636_update( device_t *device, const rectangle &cliprect );
-WRITE8_DEVICE_HANDLER( s2636_work_ram_w );
-READ8_DEVICE_HANDLER( s2636_work_ram_r );
+DECLARE_WRITE8_DEVICE_HANDLER( s2636_work_ram_w );
+DECLARE_READ8_DEVICE_HANDLER( s2636_work_ram_r );
#endif /* __S2636_H__ */
diff --git a/src/emu/video/tlc34076.h b/src/emu/video/tlc34076.h
index 5914a1db28f..c32f02d50a4 100644
--- a/src/emu/video/tlc34076.h
+++ b/src/emu/video/tlc34076.h
@@ -59,5 +59,5 @@ extern const device_type TLC34076;
DEVICE I/O FUNCTIONS
***************************************************************************/
-WRITE8_DEVICE_HANDLER( tlc34076_w );
-READ8_DEVICE_HANDLER( tlc34076_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tlc34076_w );
+DECLARE_READ8_DEVICE_HANDLER( tlc34076_r );
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index 784f800a937..d8b43665474 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -73,7 +73,7 @@ static void tms9927_state_save_postload(tms9927_state *state)
}
-static void generic_access(device_t *device, offs_t offset)
+static void generic_access(device_t *device, address_space &space, offs_t offset)
{
tms9927_state *tms = get_safe_token(device);
@@ -86,9 +86,9 @@ static void generic_access(device_t *device, offs_t offset)
int cur;
for (cur = 0; cur < 7; cur++)
- tms9927_w(device, cur, tms->selfload[cur]);
+ tms9927_w(device, space, cur, tms->selfload[cur]);
for (cur = 0; cur < 1; cur++)
- tms9927_w(device, cur + 0xc, tms->selfload[cur + 7]);
+ tms9927_w(device, space, cur + 0xc, tms->selfload[cur + 7]);
}
else
popmessage("tms9927: self-load initiated with no PROM!");
@@ -149,7 +149,7 @@ mame_printf_debug("Cursor address changed\n");
break;
default:
- generic_access(device, offset);
+ generic_access(device, space, offset);
break;
}
}
@@ -166,7 +166,7 @@ READ8_DEVICE_HANDLER( tms9927_r )
return tms->reg[offset - 0x08 + 7];
default:
- generic_access(device, offset);
+ generic_access(device, space, offset);
break;
}
return 0xff;
diff --git a/src/emu/video/tms9927.h b/src/emu/video/tms9927.h
index c75f6e25518..5f56d457f88 100644
--- a/src/emu/video/tms9927.h
+++ b/src/emu/video/tms9927.h
@@ -84,8 +84,8 @@ extern const tms9927_interface tms9927_null_interface;
/* basic read/write handlers */
-WRITE8_DEVICE_HANDLER( tms9927_w );
-READ8_DEVICE_HANDLER( tms9927_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tms9927_w );
+DECLARE_READ8_DEVICE_HANDLER( tms9927_r );
/* other queries */
int tms9927_screen_reset(device_t *device);
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index 3559ffdc5d3..abf53c2b3b5 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -4064,9 +4064,9 @@ READ32_DEVICE_HANDLER( banshee_r )
flush_fifos(v, device->machine().time());
if (offset < 0x80000/4)
- result = banshee_io_r(device, offset, mem_mask);
+ result = banshee_io_r(device, space, offset, mem_mask);
else if (offset < 0x100000/4)
- result = banshee_agp_r(device, offset, mem_mask);
+ result = banshee_agp_r(device, space, offset, mem_mask);
else if (offset < 0x200000/4)
logerror("%s:banshee_r(2D:%X)\n", device->machine().describe_context(), (offset*4) & 0xfffff);
else if (offset < 0x600000/4)
@@ -4232,13 +4232,13 @@ READ32_DEVICE_HANDLER( banshee_io_r )
case io_vgad0: case io_vgad4: case io_vgad8: case io_vgadc:
result = 0;
if (ACCESSING_BITS_0_7)
- result |= banshee_vga_r(device, offset*4+0) << 0;
+ result |= banshee_vga_r(device, space, offset*4+0, mem_mask >> 0) << 0;
if (ACCESSING_BITS_8_15)
- result |= banshee_vga_r(device, offset*4+1) << 8;
+ result |= banshee_vga_r(device, space, offset*4+1, mem_mask >> 8) << 8;
if (ACCESSING_BITS_16_23)
- result |= banshee_vga_r(device, offset*4+2) << 16;
+ result |= banshee_vga_r(device, space, offset*4+2, mem_mask >> 16) << 16;
if (ACCESSING_BITS_24_31)
- result |= banshee_vga_r(device, offset*4+3) << 24;
+ result |= banshee_vga_r(device, space, offset*4+3, mem_mask >> 24) << 24;
break;
default:
@@ -4606,9 +4606,9 @@ WRITE32_DEVICE_HANDLER( banshee_w )
flush_fifos(v, device->machine().time());
if (offset < 0x80000/4)
- banshee_io_w(device, offset, data, mem_mask);
+ banshee_io_w(device, space, offset, data, mem_mask);
else if (offset < 0x100000/4)
- banshee_agp_w(device, offset, data, mem_mask);
+ banshee_agp_w(device, space, offset, data, mem_mask);
else if (offset < 0x200000/4)
logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0xfffff, data, mem_mask);
else if (offset < 0x600000/4)
@@ -4780,13 +4780,13 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
case io_vgac0: case io_vgac4: case io_vgac8: case io_vgacc:
case io_vgad0: case io_vgad4: case io_vgad8: case io_vgadc:
if (ACCESSING_BITS_0_7)
- banshee_vga_w(device, offset*4+0, data >> 0);
+ banshee_vga_w(device, space, offset*4+0, data >> 0, mem_mask >> 0);
if (ACCESSING_BITS_8_15)
- banshee_vga_w(device, offset*4+1, data >> 8);
+ banshee_vga_w(device, space, offset*4+1, data >> 8, mem_mask >> 8);
if (ACCESSING_BITS_16_23)
- banshee_vga_w(device, offset*4+2, data >> 16);
+ banshee_vga_w(device, space, offset*4+2, data >> 16, mem_mask >> 16);
if (ACCESSING_BITS_24_31)
- banshee_vga_w(device, offset*4+3, data >> 24);
+ banshee_vga_w(device, space, offset*4+3, data >> 24, mem_mask >> 24);
break;
default:
diff --git a/src/emu/video/voodoo.h b/src/emu/video/voodoo.h
index e0c2a842371..5a71f1f4e81 100644
--- a/src/emu/video/voodoo.h
+++ b/src/emu/video/voodoo.h
@@ -113,16 +113,16 @@ int voodoo_get_type(device_t *device);
int voodoo_is_stalled(device_t *device);
void voodoo_set_init_enable(device_t *device, UINT32 newval);
-READ32_DEVICE_HANDLER( voodoo_r );
-WRITE32_DEVICE_HANDLER( voodoo_w );
-
-READ32_DEVICE_HANDLER( banshee_r );
-WRITE32_DEVICE_HANDLER( banshee_w );
-READ32_DEVICE_HANDLER( banshee_fb_r );
-WRITE32_DEVICE_HANDLER( banshee_fb_w );
-READ32_DEVICE_HANDLER( banshee_io_r );
-WRITE32_DEVICE_HANDLER( banshee_io_w );
-READ32_DEVICE_HANDLER( banshee_rom_r );
+DECLARE_READ32_DEVICE_HANDLER( voodoo_r );
+DECLARE_WRITE32_DEVICE_HANDLER( voodoo_w );
+
+DECLARE_READ32_DEVICE_HANDLER( banshee_r );
+DECLARE_WRITE32_DEVICE_HANDLER( banshee_w );
+DECLARE_READ32_DEVICE_HANDLER( banshee_fb_r );
+DECLARE_WRITE32_DEVICE_HANDLER( banshee_fb_w );
+DECLARE_READ32_DEVICE_HANDLER( banshee_io_r );
+DECLARE_WRITE32_DEVICE_HANDLER( banshee_io_w );
+DECLARE_READ32_DEVICE_HANDLER( banshee_rom_r );
/* ----- device interface ----- */
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index a5b405ff3bd..d735178eaf8 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -282,7 +282,7 @@ WRITE8_MEMBER(_8080bw_state::indianbt_sh_port_2_w)
WRITE8_DEVICE_HANDLER( indianbt_sh_port_3_w )
{
- discrete_sound_w(device, INDIANBT_MUSIC_DATA, data);
+ discrete_sound_w(device, space, INDIANBT_MUSIC_DATA, data);
}
@@ -600,27 +600,27 @@ DISCRETE_SOUND_END
WRITE8_DEVICE_HANDLER( polaris_sh_port_1_w )
{
- discrete_sound_w(device, POLARIS_MUSIC_DATA, data);
+ discrete_sound_w(device, space, POLARIS_MUSIC_DATA, data);
}
WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
{
/* 0x01 - SX0 - Shot */
- discrete_sound_w(device, POLARIS_SX0_EN, data & 0x01);
+ discrete_sound_w(device, space, POLARIS_SX0_EN, data & 0x01);
/* 0x02 - SX1 - Ship Hit (Sub) */
- discrete_sound_w(device, POLARIS_SX1_EN, data & 0x02);
+ discrete_sound_w(device, space, POLARIS_SX1_EN, data & 0x02);
/* 0x04 - SX2 - Ship */
- discrete_sound_w(device, POLARIS_SX2_EN, data & 0x04);
+ discrete_sound_w(device, space, POLARIS_SX2_EN, data & 0x04);
/* 0x08 - SX3 - Explosion */
- discrete_sound_w(device, POLARIS_SX3_EN, data & 0x08);
+ discrete_sound_w(device, space, POLARIS_SX3_EN, data & 0x08);
/* 0x10 - SX4 */
/* 0x20 - SX5 - Sound Enable */
- discrete_sound_w(device, POLARIS_SX5_EN, data & 0x20);
+ discrete_sound_w(device, space, POLARIS_SX5_EN, data & 0x20);
}
WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
@@ -632,16 +632,16 @@ WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
state->m_c8080bw_flip_screen = data & 0x20; /* SX11 */
/* 0x01 - SX6 - Plane Down */
- discrete_sound_w(device, POLARIS_SX6_EN, data & 0x01);
+ discrete_sound_w(device, space, POLARIS_SX6_EN, data & 0x01);
/* 0x02 - SX7 - Plane Up */
- discrete_sound_w(device, POLARIS_SX7_EN, data & 0x02);
+ discrete_sound_w(device, space, POLARIS_SX7_EN, data & 0x02);
/* 0x08 - SX9 - Hit */
- discrete_sound_w(device, POLARIS_SX9_EN, data & 0x08);
+ discrete_sound_w(device, space, POLARIS_SX9_EN, data & 0x08);
/* 0x10 - SX10 - Hit */
- discrete_sound_w(device, POLARIS_SX10_EN, data & 0x10);
+ discrete_sound_w(device, space, POLARIS_SX10_EN, data & 0x10);
}
@@ -789,8 +789,8 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_1_w)
bit 5 - Explosion (SX5) */
//printf( "schaser_sh_port_1_w: %02x\n", data );
- discrete_sound_w(m_discrete, SCHASER_DOT_EN, data & 0x01);
- discrete_sound_w(m_discrete, SCHASER_DOT_SEL, data & 0x02);
+ discrete_sound_w(m_discrete, space, SCHASER_DOT_EN, data & 0x01);
+ discrete_sound_w(m_discrete, space, SCHASER_DOT_SEL, data & 0x02);
/* The effect is a variable rate 555 timer. A diode/resistor array is used to
* select the frequency. Because of the diode voltage drop, we can not use the
@@ -854,9 +854,9 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_2_w)
//printf( "schaser_sh_port_2_w: %02x\n", data );
- discrete_sound_w(m_discrete, SCHASER_MUSIC_BIT, data & 0x01);
+ discrete_sound_w(m_discrete, space, SCHASER_MUSIC_BIT, data & 0x01);
- discrete_sound_w(m_discrete, SCHASER_SND_EN, data & 0x02);
+ discrete_sound_w(m_discrete, space, SCHASER_SND_EN, data & 0x02);
machine().sound().system_enable(data & 0x02);
coin_lockout_global_w(machine(), data & 0x04);
diff --git a/src/mame/audio/asteroid.c b/src/mame/audio/asteroid.c
index 5927d192052..b6cc6990d72 100644
--- a/src/mame/audio/asteroid.c
+++ b/src/mame/audio/asteroid.c
@@ -280,7 +280,7 @@ DISCRETE_SOUND_END
WRITE8_DEVICE_HANDLER( asteroid_explode_w )
{
- discrete_sound_w(device,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2); // Volume
+ discrete_sound_w(device,space,ASTEROID_EXPLODE_DATA,(data&0x3c)>>2); // Volume
/* We will modify the pitch data to send the divider value. */
switch ((data&0xc0))
{
@@ -297,27 +297,27 @@ WRITE8_DEVICE_HANDLER( asteroid_explode_w )
data = 5;
break;
}
- discrete_sound_w(device,ASTEROID_EXPLODE_PITCH, data);
+ discrete_sound_w(device, space, ASTEROID_EXPLODE_PITCH, data);
}
WRITE8_DEVICE_HANDLER( asteroid_thump_w )
{
- discrete_sound_w(device, ASTEROID_THUMP_EN, data & 0x10);
- discrete_sound_w(device, ASTEROID_THUMP_DATA, data & 0x0f);
+ discrete_sound_w(device, space, ASTEROID_THUMP_EN, data & 0x10);
+ discrete_sound_w(device, space, ASTEROID_THUMP_DATA, data & 0x0f);
}
WRITE8_DEVICE_HANDLER( asteroid_sounds_w )
{
- discrete_sound_w(device, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80);
+ discrete_sound_w(device, space, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80);
}
WRITE8_DEVICE_HANDLER( astdelux_sounds_w )
{
/* Only ever activates the thrusters in Astdelux */
- discrete_sound_w(device, ASTEROID_THRUST_EN, data & 0x80);
+ discrete_sound_w(device, space, ASTEROID_THRUST_EN, data & 0x80);
}
WRITE8_DEVICE_HANDLER( asteroid_noise_reset_w )
{
- discrete_sound_w(device, ASTEROID_NOISE_RESET, 0);
+ discrete_sound_w(device, space, ASTEROID_NOISE_RESET, 0);
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index e2d74d4d549..d79748376de 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( jsa1_io_w )
case 0x200: /* /VOICE */
if (tms5220 != NULL)
- tms5220_data_w(tms5220, 0, data);
+ tms5220_data_w(tms5220, *space, 0, data);
break;
case 0x202: /* /WRP */
diff --git a/src/mame/audio/avalnche.c b/src/mame/audio/avalnche.c
index ab262e5f851..6bc3ce3f046 100644
--- a/src/mame/audio/avalnche.c
+++ b/src/mame/audio/avalnche.c
@@ -22,12 +22,12 @@
WRITE8_DEVICE_HANDLER( avalnche_noise_amplitude_w )
{
- discrete_sound_w(device, AVALNCHE_SOUNDLVL_DATA, data & 0x3f);
+ discrete_sound_w(device, space, AVALNCHE_SOUNDLVL_DATA, data & 0x3f);
}
WRITE8_DEVICE_HANDLER( avalnche_attract_enable_w )
{
- discrete_sound_w(device, AVALNCHE_ATTRACT_EN, data & 0x01);
+ discrete_sound_w(device, space, AVALNCHE_ATTRACT_EN, data & 0x01);
}
WRITE8_DEVICE_HANDLER( avalnche_audio_w )
@@ -37,16 +37,16 @@ WRITE8_DEVICE_HANDLER( avalnche_audio_w )
switch (offset & 0x07)
{
case 0x00: /* AUD0 */
- discrete_sound_w(device, AVALNCHE_AUD0_EN, bit);
+ discrete_sound_w(device, space, AVALNCHE_AUD0_EN, bit);
break;
case 0x01: /* AUD1 */
- discrete_sound_w(device, AVALNCHE_AUD1_EN, bit);
+ discrete_sound_w(device, space, AVALNCHE_AUD1_EN, bit);
break;
case 0x02: /* AUD2 */
default:
- discrete_sound_w(device, AVALNCHE_AUD2_EN, bit);
+ discrete_sound_w(device, space, AVALNCHE_AUD2_EN, bit);
break;
}
}
diff --git a/src/mame/audio/blockade.c b/src/mame/audio/blockade.c
index e20f5ed5355..8891f00ac74 100644
--- a/src/mame/audio/blockade.c
+++ b/src/mame/audio/blockade.c
@@ -38,7 +38,7 @@ DISCRETE_SOUND_END
WRITE8_DEVICE_HANDLER( blockade_sound_freq_w )
{
- discrete_sound_w(device,BLOCKADE_NOTE_DATA, data);
+ discrete_sound_w(device,space,BLOCKADE_NOTE_DATA, data);
return;
}
diff --git a/src/mame/audio/bsktball.c b/src/mame/audio/bsktball.c
index 382f35ebeef..578f8fd5c8b 100644
--- a/src/mame/audio/bsktball.c
+++ b/src/mame/audio/bsktball.c
@@ -12,18 +12,18 @@ Sound handlers
***************************************************************************/
WRITE8_DEVICE_HANDLER( bsktball_bounce_w )
{
- discrete_sound_w(device, BSKTBALL_CROWD_DATA, data & 0x0f); // Crowd
- discrete_sound_w(device, BSKTBALL_BOUNCE_EN, data & 0x10); // Bounce
+ discrete_sound_w(device, space, BSKTBALL_CROWD_DATA, data & 0x0f); // Crowd
+ discrete_sound_w(device, space, BSKTBALL_BOUNCE_EN, data & 0x10); // Bounce
}
WRITE8_DEVICE_HANDLER( bsktball_note_w )
{
- discrete_sound_w(device, BSKTBALL_NOTE_DATA, data); // Note
+ discrete_sound_w(device, space, BSKTBALL_NOTE_DATA, data); // Note
}
WRITE8_DEVICE_HANDLER( bsktball_noise_reset_w )
{
- discrete_sound_w(device, BSKTBALL_NOISE_EN, offset & 0x01);
+ discrete_sound_w(device, space, BSKTBALL_NOISE_EN, offset & 0x01);
}
diff --git a/src/mame/audio/bzone.c b/src/mame/audio/bzone.c
index 943047d9b6a..b80ec861c91 100644
--- a/src/mame/audio/bzone.c
+++ b/src/mame/audio/bzone.c
@@ -389,7 +389,7 @@ static const pokey_interface bzone_pokey_interface =
WRITE8_DEVICE_HANDLER( bzone_sounds_w )
{
- discrete_sound_w(device, BZ_INPUT, data);
+ discrete_sound_w(device, space, BZ_INPUT, data);
output_set_value("startled", (data >> 6) & 1);
device->machine().sound().system_enable(data & 0x20);
diff --git a/src/mame/audio/canyon.c b/src/mame/audio/canyon.c
index 5e19f6b56dd..bfc5e129b2a 100644
--- a/src/mame/audio/canyon.c
+++ b/src/mame/audio/canyon.c
@@ -16,25 +16,25 @@
WRITE8_DEVICE_HANDLER( canyon_motor_w )
{
- discrete_sound_w(device, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f);
+ discrete_sound_w(device, space, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f);
}
WRITE8_DEVICE_HANDLER( canyon_explode_w )
{
- discrete_sound_w(device, CANYON_EXPLODE_DATA, data >> 4);
+ discrete_sound_w(device, space, CANYON_EXPLODE_DATA, data >> 4);
}
WRITE8_DEVICE_HANDLER( canyon_attract_w )
{
- discrete_sound_w(device, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02);
+ discrete_sound_w(device, space, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02);
}
WRITE8_DEVICE_HANDLER( canyon_whistle_w )
{
- discrete_sound_w(device, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02);
+ discrete_sound_w(device, space, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02);
}
diff --git a/src/mame/audio/carnival.c b/src/mame/audio/carnival.c
index 406ff929032..af5fd847969 100644
--- a/src/mame/audio/carnival.c
+++ b/src/mame/audio/carnival.c
@@ -274,11 +274,11 @@ static WRITE8_DEVICE_HANDLER( carnival_music_port_2_w )
break;
case PSG_BC_WRITE:
- ay8910_data_w( device, 0, psgData );
+ ay8910_data_w( device, space, 0, psgData );
break;
case PSG_BC_LATCH_ADDRESS:
- ay8910_address_w( device, 0, psgData );
+ ay8910_address_w( device, space, 0, psgData );
break;
}
}
diff --git a/src/mame/audio/circus.c b/src/mame/audio/circus.c
index 314ae123dca..fd37e080afd 100644
--- a/src/mame/audio/circus.c
+++ b/src/mame/audio/circus.c
@@ -184,11 +184,11 @@ WRITE8_MEMBER(circus_state::circus_clown_z_w)
switch ((data & 0x70) >> 4)
{
case 0 : /* All Off */
- discrete_sound_w(m_discrete, CIRCUS_MUSIC_BIT, 0);
+ discrete_sound_w(m_discrete, space, CIRCUS_MUSIC_BIT, 0);
break;
case 1 : /* Music */
- discrete_sound_w(m_discrete, CIRCUS_MUSIC_BIT, 1);
+ discrete_sound_w(m_discrete, space, CIRCUS_MUSIC_BIT, 1);
break;
case 2 : /* Circus = Pop; Rip Cord = Splash */
@@ -217,7 +217,7 @@ WRITE8_MEMBER(circus_state::circus_clown_z_w)
break;
case 2: /* robotbwl */
- discrete_sound_w(m_discrete, ROBOTBWL_MUSIC_BIT, data & 0x08); /* Footsteps */
+ discrete_sound_w(m_discrete, space, ROBOTBWL_MUSIC_BIT, data & 0x08); /* Footsteps */
if (data & 0x40) /* Hit */
m_samples->start(0, 0);
@@ -242,11 +242,11 @@ WRITE8_MEMBER(circus_state::circus_clown_z_w)
switch ((data & 0x70) >> 4)
{
case 0 : /* All Off */
- discrete_sound_w(m_discrete, CRASH_MUSIC_BIT, 0);
+ discrete_sound_w(m_discrete, space, CRASH_MUSIC_BIT, 0);
break;
case 1 : /* Music */
- discrete_sound_w(m_discrete, CRASH_MUSIC_BIT, 1);
+ discrete_sound_w(m_discrete, space, CRASH_MUSIC_BIT, 1);
break;
case 2 : /* Crash */
@@ -254,14 +254,14 @@ WRITE8_MEMBER(circus_state::circus_clown_z_w)
break;
case 3 : /* Normal Video and Beep */
- discrete_sound_w(m_discrete, CRASH_BEEPER_EN, 0);
+ discrete_sound_w(m_discrete, space, CRASH_BEEPER_EN, 0);
break;
case 4 : /* Skid */
break;
case 5 : /* Invert Video and Beep */
- discrete_sound_w(m_discrete, CRASH_BEEPER_EN, 0);
+ discrete_sound_w(m_discrete, space, CRASH_BEEPER_EN, 0);
break;
case 6 : /* Hi Motor */
diff --git a/src/mame/audio/copsnrob.c b/src/mame/audio/copsnrob.c
index 00374b0b547..7795f81b794 100644
--- a/src/mame/audio/copsnrob.c
+++ b/src/mame/audio/copsnrob.c
@@ -704,27 +704,27 @@ WRITE8_MEMBER(copsnrob_state::copsnrob_misc_w)
switch (offset)
{
case 0x00:
- discrete_sound_w(device, COPSNROB_MOTOR3_INV, special_data);
+ discrete_sound_w(device, space, COPSNROB_MOTOR3_INV, special_data);
break;
case 0x01:
- discrete_sound_w(device, COPSNROB_MOTOR2_INV, special_data);
+ discrete_sound_w(device, space, COPSNROB_MOTOR2_INV, special_data);
break;
case 0x02:
- discrete_sound_w(device, COPSNROB_MOTOR1_INV, special_data);
+ discrete_sound_w(device, space, COPSNROB_MOTOR1_INV, special_data);
break;
case 0x03:
- discrete_sound_w(device, COPSNROB_MOTOR0_INV, special_data);
+ discrete_sound_w(device, space, COPSNROB_MOTOR0_INV, special_data);
break;
case 0x04:
- discrete_sound_w(device, COPSNROB_SCREECH_INV, special_data);
+ discrete_sound_w(device, space, COPSNROB_SCREECH_INV, special_data);
break;
case 0x05:
- discrete_sound_w(device, COPSNROB_CRASH_INV, special_data);
+ discrete_sound_w(device, space, COPSNROB_CRASH_INV, special_data);
break;
case 0x06:
@@ -733,7 +733,7 @@ WRITE8_MEMBER(copsnrob_state::copsnrob_misc_w)
break;
case 0x07:
- discrete_sound_w(device, COPSNROB_AUDIO_ENABLE, special_data);
+ discrete_sound_w(device, space, COPSNROB_AUDIO_ENABLE, special_data);
//machine().sound().system_mute(special_data);
break;
diff --git a/src/mame/audio/crbaloon.c b/src/mame/audio/crbaloon.c
index b2efe873dc8..4a7340f48d2 100644
--- a/src/mame/audio/crbaloon.c
+++ b/src/mame/audio/crbaloon.c
@@ -32,13 +32,13 @@
WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq )
{
- discrete_sound_w(device, CRBALOON_MUSIC_DATA, data);
+ discrete_sound_w(device, space, CRBALOON_MUSIC_DATA, data);
}
WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable )
{
- discrete_sound_w(device, CRBALOON_MUSIC_EN, data);
+ discrete_sound_w(device, space, CRBALOON_MUSIC_EN, data);
}
@@ -66,7 +66,7 @@ void crbaloon_audio_set_appear_enable(device_t *sn, int enabled)
WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable )
{
- discrete_sound_w(device, CRBALOON_LAUGH_EN, data);
+ discrete_sound_w(device, space, CRBALOON_LAUGH_EN, data);
}
diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c
index 2bafc7173fe..a929b5f926c 100644
--- a/src/mame/audio/dkong.c
+++ b/src/mame/audio/dkong.c
@@ -1214,7 +1214,7 @@ Addresses found at @0x510, cpu2
static WRITE8_DEVICE_HANDLER( M58817_command_w )
{
- tms5110_ctl_w(device, 0, data & 0x0f);
+ tms5110_ctl_w(device, space, 0, data & 0x0f);
tms5110_pdc_w(device, (data>>4) & 0x01);
/* FIXME 0x20 is CS */
}
@@ -1234,6 +1234,7 @@ WRITE8_MEMBER(dkong_state::dkong_voice_w)
logerror("dkong_speech_w: 0x%02x\n", data);
}
+static DECLARE_READ8_DEVICE_HANDLER( dkong_voice_status_r );
static READ8_DEVICE_HANDLER( dkong_voice_status_r )
{
/* only provided for documentation purposes
@@ -1245,11 +1246,11 @@ static READ8_DEVICE_HANDLER( dkong_voice_status_r )
static READ8_DEVICE_HANDLER( dkong_tune_r )
{
dkong_state *state = device->machine().driver_data<dkong_state>();
- UINT8 page = latch8_r(state->m_dev_vp2, 0) & 0x47;
+ UINT8 page = latch8_r(state->m_dev_vp2, space, 0) & 0x47;
if ( page & 0x40 )
{
- return (latch8_r(device, 0) & 0x0F) | (dkong_voice_status_r(device, 0) << 4);
+ return (latch8_r(device, space, 0) & 0x0F) | (dkong_voice_status_r(device, space, 0) << 4);
}
else
{
@@ -1260,7 +1261,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r )
static WRITE8_DEVICE_HANDLER( dkong_p1_w )
{
- discrete_sound_w(device,DS_DAC,data);
+ discrete_sound_w(device,space,DS_DAC,data);
}
diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c
index fe23703e7c7..387064bad56 100644
--- a/src/mame/audio/exidy.c
+++ b/src/mame/audio/exidy.c
@@ -533,7 +533,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
if (state->m_tms != NULL)
{
logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), riot6532_porta_out_get(state->m_riot));
- tms5220_data_w(state->m_tms, 0, data);
+ tms5220_data_w(state->m_tms, space, 0, data);
}
}
@@ -542,8 +542,8 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
exidy_sound_state *state = get_safe_token(device);
if (state->m_tms != NULL)
{
- logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->m_tms, 0));
- return tms5220_status_r(state->m_tms, 0);
+ logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->m_tms, space, 0));
+ return tms5220_status_r(state->m_tms, space, 0);
}
else
return 0xff;
diff --git a/src/mame/audio/exidy.h b/src/mame/audio/exidy.h
index 429aeb6d26e..622cecae63e 100644
--- a/src/mame/audio/exidy.h
+++ b/src/mame/audio/exidy.h
@@ -60,15 +60,15 @@ private:
extern const device_type EXIDY_VICTORY;
-READ8_DEVICE_HANDLER( exidy_sh6840_r );
-WRITE8_DEVICE_HANDLER( exidy_sh6840_w );
-WRITE8_DEVICE_HANDLER( exidy_sfxctrl_w );
+DECLARE_READ8_DEVICE_HANDLER( exidy_sh6840_r );
+DECLARE_WRITE8_DEVICE_HANDLER( exidy_sh6840_w );
+DECLARE_WRITE8_DEVICE_HANDLER( exidy_sfxctrl_w );
MACHINE_CONFIG_EXTERN( venture_audio );
MACHINE_CONFIG_EXTERN( mtrap_cvsd_audio );
MACHINE_CONFIG_EXTERN( victory_audio );
-READ8_DEVICE_HANDLER( victory_sound_response_r );
-READ8_DEVICE_HANDLER( victory_sound_status_r );
-WRITE8_DEVICE_HANDLER( victory_sound_command_w );
+DECLARE_READ8_DEVICE_HANDLER( victory_sound_response_r );
+DECLARE_READ8_DEVICE_HANDLER( victory_sound_status_r );
+DECLARE_WRITE8_DEVICE_HANDLER( victory_sound_command_w );
diff --git a/src/mame/audio/firetrk.c b/src/mame/audio/firetrk.c
index 21e5178b7f1..63c02d0e94c 100644
--- a/src/mame/audio/firetrk.c
+++ b/src/mame/audio/firetrk.c
@@ -16,50 +16,50 @@ WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w )
state->m_skid[1] = 0;
// also SUPERBUG_SKID_EN
- discrete_sound_w(device, FIRETRUCK_SKID_EN, 1);
+ discrete_sound_w(device, space, FIRETRUCK_SKID_EN, 1);
}
WRITE8_DEVICE_HANDLER( montecar_skid_reset_w )
{
- discrete_sound_w(device, MONTECAR_SKID_EN, 1);
+ discrete_sound_w(device, space, MONTECAR_SKID_EN, 1);
}
WRITE8_DEVICE_HANDLER( firetrk_crash_snd_w )
{
// also SUPERBUG_CRASH_DATA and MONTECAR_CRASH_DATA
- discrete_sound_w(device, FIRETRUCK_CRASH_DATA, data >> 4);
+ discrete_sound_w(device, space, FIRETRUCK_CRASH_DATA, data >> 4);
}
WRITE8_DEVICE_HANDLER( firetrk_skid_snd_w )
{
// also SUPERBUG_SKID_EN and MONTECAR_SKID_EN
- discrete_sound_w(device, FIRETRUCK_SKID_EN, 0);
+ discrete_sound_w(device, space, FIRETRUCK_SKID_EN, 0);
}
WRITE8_DEVICE_HANDLER( firetrk_motor_snd_w )
{
// also MONTECAR_DRONE_MOTOR_DATA
- discrete_sound_w(device, FIRETRUCK_SIREN_DATA, data >> 4);
+ discrete_sound_w(device, space, FIRETRUCK_SIREN_DATA, data >> 4);
// also MONTECAR_MOTOR_DATA
- discrete_sound_w(device, FIRETRUCK_MOTOR_DATA, data & 0x0f);
+ discrete_sound_w(device, space, FIRETRUCK_MOTOR_DATA, data & 0x0f);
}
WRITE8_DEVICE_HANDLER( superbug_motor_snd_w )
{
- discrete_sound_w(device, SUPERBUG_SPEED_DATA, data & 0x0f);
+ discrete_sound_w(device, space, SUPERBUG_SPEED_DATA, data & 0x0f);
}
WRITE8_DEVICE_HANDLER( firetrk_xtndply_w )
{
// also SUPERBUG_ASR_EN (extended play)
- discrete_sound_w(device, FIRETRUCK_XTNDPLY_EN, data);
+ discrete_sound_w(device, space, FIRETRUCK_XTNDPLY_EN, data);
}
diff --git a/src/mame/audio/galaxian.c b/src/mame/audio/galaxian.c
index 951861f711f..f7c6bea24da 100644
--- a/src/mame/audio/galaxian.c
+++ b/src/mame/audio/galaxian.c
@@ -408,7 +408,7 @@ static SOUND_START(galaxian)
/* IC 9J */
WRITE8_DEVICE_HANDLER( galaxian_pitch_w )
{
- discrete_sound_w(device, GAL_INP_PITCH, data );
+ discrete_sound_w(device, space, GAL_INP_PITCH, data );
}
WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w )
@@ -418,29 +418,29 @@ WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w )
if (lfo_val != lfo_val_new)
{
lfo_val = lfo_val_new;
- discrete_sound_w(device, GAL_INP_BG_DAC, lfo_val);
+ discrete_sound_w(device, space, GAL_INP_BG_DAC, lfo_val);
}
}
WRITE8_DEVICE_HANDLER( galaxian_background_enable_w )
{
- discrete_sound_w(device, NODE_RELATIVE(GAL_INP_FS1, offset), data & 0x01);
+ discrete_sound_w(device, space, NODE_RELATIVE(GAL_INP_FS1, offset), data & 0x01);
}
WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w )
{
- discrete_sound_w(device, GAL_INP_HIT, data & 0x01);
+ discrete_sound_w(device, space, GAL_INP_HIT, data & 0x01);
}
WRITE8_DEVICE_HANDLER( galaxian_vol_w )
{
- discrete_sound_w(device, NODE_RELATIVE(GAL_INP_VOL1,offset), data & 0x01);
+ discrete_sound_w(device, space, NODE_RELATIVE(GAL_INP_VOL1,offset), data & 0x01);
}
/* FIXME: rename to fire to be consistent */
WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w )
{
- discrete_sound_w(device, GAL_INP_FIRE, data & 0x01);
+ discrete_sound_w(device, space, GAL_INP_FIRE, data & 0x01);
}
/* FIXME: May be replaced by one call! */
@@ -452,23 +452,23 @@ WRITE8_DEVICE_HANDLER( galaxian_sound_w )
case 0: /* FS1 (controls 555 timer at 8R) */
case 1: /* FS2 (controls 555 timer at 8S) */
case 2: /* FS3 (controls 555 timer at 8T) */
- galaxian_background_enable_w(device, offset, data);
+ galaxian_background_enable_w(device, space, offset, data);
break;
case 3: /* HIT */
- galaxian_noise_enable_w(device, 0, data);
+ galaxian_noise_enable_w(device, space, 0, data);
break;
case 4: /* n/c */
break;
case 5: /* FIRE */
- galaxian_shoot_enable_w(device, 0, data);
+ galaxian_shoot_enable_w(device, space, 0, data);
break;
case 6: /* VOL1 */
case 7: /* VOL2 */
- galaxian_vol_w(device, offset & 1, data);
+ galaxian_vol_w(device, space, offset & 1, data);
break;
}
}
diff --git a/src/mame/audio/galaxian.h b/src/mame/audio/galaxian.h
index bd586385bc4..be423de6a3b 100644
--- a/src/mame/audio/galaxian.h
+++ b/src/mame/audio/galaxian.h
@@ -3,11 +3,11 @@
MACHINE_CONFIG_EXTERN( mooncrst_audio );
MACHINE_CONFIG_EXTERN( galaxian_audio );
-WRITE8_DEVICE_HANDLER( galaxian_sound_w );
-WRITE8_DEVICE_HANDLER( galaxian_pitch_w );
-WRITE8_DEVICE_HANDLER( galaxian_vol_w );
-WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w );
-WRITE8_DEVICE_HANDLER( galaxian_background_enable_w );
-WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w );
-WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_sound_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_pitch_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_vol_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_background_enable_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w );
+DECLARE_WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w );
diff --git a/src/mame/audio/gottlieb.c b/src/mame/audio/gottlieb.c
index 35112571361..be38034f0fb 100644
--- a/src/mame/audio/gottlieb.c
+++ b/src/mame/audio/gottlieb.c
@@ -772,9 +772,9 @@ WRITE8_MEMBER( gottlieb_sound_r2_device::speech_control_w )
// bit 3 selects which of the two 8913 to enable
// bit 4 goes to the 8913 BC1 pin
if ((data & 0x08) != 0)
- ay8910_data_address_w(m_ay1, data >> 4, m_psg_latch);
+ ay8910_data_address_w(m_ay1, space, data >> 4, m_psg_latch);
else
- ay8910_data_address_w(m_ay2, data >> 4, m_psg_latch);
+ ay8910_data_address_w(m_ay2, space, data >> 4, m_psg_latch);
}
}
else
@@ -786,8 +786,8 @@ WRITE8_MEMBER( gottlieb_sound_r2_device::speech_control_w )
else
{
ay8913_device *ay = (data & 0x08) ? m_ay1 : m_ay2;
- ay8910_address_w(ay, 0, m_psg_latch);
- ay8910_data_w(ay, 0, m_psg_data_latch);
+ ay8910_address_w(ay, space, 0, m_psg_latch);
+ ay8910_data_w(ay, space, 0, m_psg_data_latch);
}
}
@@ -795,7 +795,7 @@ WRITE8_MEMBER( gottlieb_sound_r2_device::speech_control_w )
// bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data
if ((previous & 0x40) == 0 && (data & 0x40) != 0)
- sp0250_w(m_sp0250, 0, m_sp0250_latch);
+ sp0250_w(m_sp0250, space, 0, m_sp0250_latch);
// bit 7 goes to the speech chip RESET pin
if ((previous ^ data) & 0x80)
diff --git a/src/mame/audio/hyprolyb.h b/src/mame/audio/hyprolyb.h
index 1e20f7f2df7..d2145720d7b 100644
--- a/src/mame/audio/hyprolyb.h
+++ b/src/mame/audio/hyprolyb.h
@@ -1,5 +1,5 @@
-WRITE8_DEVICE_HANDLER( hyprolyb_adpcm_w );
-READ8_DEVICE_HANDLER( hyprolyb_adpcm_busy_r );
+DECLARE_WRITE8_DEVICE_HANDLER( hyprolyb_adpcm_w );
+DECLARE_READ8_DEVICE_HANDLER( hyprolyb_adpcm_busy_r );
MACHINE_CONFIG_EXTERN( hyprolyb_adpcm );
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index 037b361c168..0edf0d3a374 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -98,17 +98,17 @@ static WRITE8_DEVICE_HANDLER( m6803_port2_w )
{
/* PSG 0 or 1? */
if (state->m_port2 & 0x08)
- ay8910_address_w(state->m_ay1, 0, state->m_port1);
+ ay8910_address_w(state->m_ay1, space, 0, state->m_port1);
if (state->m_port2 & 0x10)
- ay8910_address_w(state->m_ay2, 0, state->m_port1);
+ ay8910_address_w(state->m_ay2, space, 0, state->m_port1);
}
else
{
/* PSG 0 or 1? */
if (state->m_port2 & 0x08)
- ay8910_data_w(state->m_ay1, 0, state->m_port1);
+ ay8910_data_w(state->m_ay1, space, 0, state->m_port1);
if (state->m_port2 & 0x10)
- ay8910_data_w(state->m_ay2, 0, state->m_port1);
+ ay8910_data_w(state->m_ay2, space, 0, state->m_port1);
}
}
state->m_port2 = data;
@@ -128,9 +128,9 @@ static READ8_DEVICE_HANDLER( m6803_port1_r )
/* PSG 0 or 1? */
if (state->m_port2 & 0x08)
- return ay8910_r(state->m_ay1, 0);
+ return ay8910_r(state->m_ay1, space, 0);
if (state->m_port2 & 0x10)
- return ay8910_r(state->m_ay2, 0);
+ return ay8910_r(state->m_ay2, space, 0);
return 0xff;
}
diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c
index 989d6ba994f..6aeaf97e0ee 100644
--- a/src/mame/audio/jedi.c
+++ b/src/mame/audio/jedi.c
@@ -143,7 +143,7 @@ WRITE8_MEMBER(jedi_state::speech_strobe_w)
if ((new_speech_strobe_state != m_speech_strobe_state) && new_speech_strobe_state)
{
device_t *tms = machine().device("tms");
- tms5220_data_w(tms, 0, *m_speech_data);
+ tms5220_data_w(tms, space, 0, *m_speech_data);
}
m_speech_strobe_state = new_speech_strobe_state;
}
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index 5c3ddd2bdd9..6e365ab4d63 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -307,8 +307,8 @@ void leland_dac_update(device_t *device, int dacnum, UINT8 sample)
static void set_dac_frequency(leland_sound_state *state, int which, int frequency);
-static READ16_DEVICE_HANDLER( peripheral_r );
-static WRITE16_DEVICE_HANDLER( peripheral_w );
+static DECLARE_READ16_DEVICE_HANDLER( peripheral_r );
+static DECLARE_WRITE16_DEVICE_HANDLER( peripheral_w );
@@ -1441,9 +1441,9 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
/* handle partials */
if (!ACCESSING_BITS_8_15)
- data = (i80186_internal_port_r(device, offset, 0xff00) & 0xff00) | (data & 0x00ff);
+ data = (i80186_internal_port_r(device, space, offset, 0xff00) & 0xff00) | (data & 0x00ff);
else if (!ACCESSING_BITS_0_7)
- data = (i80186_internal_port_r(device, offset, 0x00ff) & 0x00ff) | (data & 0xff00);
+ data = (i80186_internal_port_r(device, space, offset, 0x00ff) & 0x00ff) | (data & 0xff00);
switch (offset)
{
@@ -2118,13 +2118,13 @@ static WRITE16_DEVICE_HANDLER( ataxx_dac_control )
case 0x01:
case 0x02:
if (ACCESSING_BITS_0_7)
- dac_w(device, offset, data, 0x00ff);
+ dac_w(device, space, offset, data, 0x00ff);
return;
case 0x03:
- dac_w(device, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0xff00);
- dac_w(device, 2, ((data << 10) & 0xe000) | ((data << 7) & 0x1c00) | ((data << 4) & 0x0300), 0xff00);
- dac_w(device, 4, ((data << 8) & 0xc000) | ((data << 6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0xff00);
+ dac_w(device, space, 0, ((data << 13) & 0xe000) | ((data << 10) & 0x1c00) | ((data << 7) & 0x0300), 0xff00);
+ dac_w(device, space, 2, ((data << 10) & 0xe000) | ((data << 7) & 0x1c00) | ((data << 4) & 0x0300), 0xff00);
+ dac_w(device, space, 4, ((data << 8) & 0xc000) | ((data << 6) & 0x3000) | ((data << 4) & 0x0c00) | ((data << 2) & 0x0300), 0xff00);
return;
}
@@ -2159,7 +2159,7 @@ static WRITE16_DEVICE_HANDLER( ataxx_dac_control )
return;
case 0x21:
- dac_w(device, offset - 0x21 + 7, data, mem_mask);
+ dac_w(device, space, offset - 0x21 + 7, data, mem_mask);
return;
}
}
@@ -2195,20 +2195,20 @@ static READ16_DEVICE_HANDLER( peripheral_r )
return ((state->m_clock_active << 1) & 0x7e);
case 1:
- return main_to_sound_comm_r(device, offset, mem_mask);
+ return main_to_sound_comm_r(device, space, offset, mem_mask);
case 2:
- return pit8254_r(device, offset, mem_mask);
+ return pit8254_r(device, space, offset, mem_mask);
case 3:
if (!state->m_has_ym2151)
- return pit8254_r(device, offset | 0x40, mem_mask);
+ return pit8254_r(device, space, offset | 0x40, mem_mask);
else
- return ym2151_r(device->machine().device("ymsnd"), offset);
+ return ym2151_r(device->machine().device("ymsnd"), space, offset);
case 4:
if (state->m_is_redline)
- return pit8254_r(device, offset | 0x80, mem_mask);
+ return pit8254_r(device, space, offset | 0x80, mem_mask);
else
logerror("%05X:Unexpected peripheral read %d/%02X\n", state->m_i80186.cpu->safe_pc(), select, offset*2);
break;
@@ -2230,29 +2230,29 @@ static WRITE16_DEVICE_HANDLER( peripheral_w )
switch (select)
{
case 1:
- sound_to_main_comm_w(device, offset, data, mem_mask);
+ sound_to_main_comm_w(device, space, offset, data, mem_mask);
break;
case 2:
- pit8254_w(device, offset, data, mem_mask);
+ pit8254_w(device, space, offset, data, mem_mask);
break;
case 3:
if (!state->m_has_ym2151)
- pit8254_w(device, offset | 0x40, data, mem_mask);
+ pit8254_w(device, space, offset | 0x40, data, mem_mask);
else
- ym2151_w(device->machine().device("ymsnd"), offset, data);
+ ym2151_w(device->machine().device("ymsnd"), space, offset, data);
break;
case 4:
if (state->m_is_redline)
- pit8254_w(device, offset | 0x80, data, mem_mask);
+ pit8254_w(device, space, offset | 0x80, data, mem_mask);
else
- dac_10bit_w(device, offset, data, mem_mask);
+ dac_10bit_w(device, space, offset, data, mem_mask);
break;
case 5: /* Ataxx/WSF/Indy Heat only */
- ataxx_dac_control(device, offset, data, mem_mask);
+ ataxx_dac_control(device, space, offset, data, mem_mask);
break;
default:
@@ -2276,7 +2276,7 @@ WRITE8_DEVICE_HANDLER( ataxx_80186_control_w )
((data & 0x02) << 5) |
((data & 0x04) << 3) |
((data & 0x08) << 1);
- leland_80186_control_w(device, offset, modified);
+ leland_80186_control_w(device, space, offset, modified);
}
diff --git a/src/mame/audio/llander.c b/src/mame/audio/llander.c
index 0c5f67b80be..085bc9426ff 100644
--- a/src/mame/audio/llander.c
+++ b/src/mame/audio/llander.c
@@ -83,14 +83,14 @@ DISCRETE_SOUND_END
WRITE8_DEVICE_HANDLER( llander_snd_reset_w )
{
/* Resets the LFSR that is used for the white noise generator */
- discrete_sound_w(device, LLANDER_NOISE_RESET, 0); /* Reset */
+ discrete_sound_w(device, space, LLANDER_NOISE_RESET, 0); /* Reset */
}
WRITE8_DEVICE_HANDLER( llander_sounds_w )
{
- discrete_sound_w(device, LLANDER_THRUST_DATA, data & 0x07); /* Thrust volume */
- discrete_sound_w(device, LLANDER_TONE3K_EN, data & 0x10); /* Tone 3KHz enable */
- discrete_sound_w(device, LLANDER_TONE6K_EN, data & 0x20); /* Tone 6KHz enable */
- discrete_sound_w(device, LLANDER_EXPLOD_EN, data & 0x08); /* Explosion */
+ discrete_sound_w(device, space, LLANDER_THRUST_DATA, data & 0x07); /* Thrust volume */
+ discrete_sound_w(device, space, LLANDER_TONE3K_EN, data & 0x10); /* Tone 3KHz enable */
+ discrete_sound_w(device, space, LLANDER_TONE6K_EN, data & 0x20); /* Tone 6KHz enable */
+ discrete_sound_w(device, space, LLANDER_EXPLOD_EN, data & 0x08); /* Explosion */
}
diff --git a/src/mame/audio/m72.h b/src/mame/audio/m72.h
index 5713dd3f4b2..52513f2e4ca 100644
--- a/src/mame/audio/m72.h
+++ b/src/mame/audio/m72.h
@@ -5,18 +5,18 @@
****************************************************************************/
void m72_ym2151_irq_handler(device_t *device, int irq);
-WRITE8_DEVICE_HANDLER( m72_sound_command_byte_w );
-WRITE16_DEVICE_HANDLER( m72_sound_command_w );
-WRITE8_DEVICE_HANDLER( m72_sound_irq_ack_w );
-READ8_DEVICE_HANDLER( m72_sample_r );
-WRITE8_DEVICE_HANDLER( m72_sample_w );
+DECLARE_WRITE8_DEVICE_HANDLER( m72_sound_command_byte_w );
+DECLARE_WRITE16_DEVICE_HANDLER( m72_sound_command_w );
+DECLARE_WRITE8_DEVICE_HANDLER( m72_sound_irq_ack_w );
+DECLARE_READ8_DEVICE_HANDLER( m72_sample_r );
+DECLARE_WRITE8_DEVICE_HANDLER( m72_sample_w );
/* the port goes to different address bits depending on the game */
void m72_set_sample_start(device_t *device, int start);
-WRITE8_DEVICE_HANDLER( vigilant_sample_addr_w );
-WRITE8_DEVICE_HANDLER( shisen_sample_addr_w );
-WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w );
-WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w );
+DECLARE_WRITE8_DEVICE_HANDLER( vigilant_sample_addr_w );
+DECLARE_WRITE8_DEVICE_HANDLER( shisen_sample_addr_w );
+DECLARE_WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w );
+DECLARE_WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w );
class m72_audio_device : public device_t,
public device_sound_interface
diff --git a/src/mame/audio/m79amb.c b/src/mame/audio/m79amb.c
index 65f28e4009c..bbdf646a486 100644
--- a/src/mame/audio/m79amb.c
+++ b/src/mame/audio/m79amb.c
@@ -325,9 +325,9 @@ WRITE8_DEVICE_HANDLER( m79amb_8000_w )
/* these values are not latched */
/* they are pulsed when the port is addressed */
/* the discrete system will just trigger from them */
- discrete_sound_w(device, M79AMB_SHOT_EN, data & 0x01);
- discrete_sound_w(device, M79AMB_BOOM_EN, data & 0x02);
- discrete_sound_w(device, M79AMB_THUD_EN, data & 0x04);
+ discrete_sound_w(device, space, M79AMB_SHOT_EN, data & 0x01);
+ discrete_sound_w(device, space, M79AMB_BOOM_EN, data & 0x02);
+ discrete_sound_w(device, space, M79AMB_THUD_EN, data & 0x04);
};
WRITE8_DEVICE_HANDLER( m79amb_8003_w )
@@ -335,9 +335,9 @@ WRITE8_DEVICE_HANDLER( m79amb_8003_w )
/* Self Test goes low on reset and lights LED */
/* LED goes off on pass */
output_set_value("SELF_TEST", data & 0x01);
- discrete_sound_w(device, M79AMB_MC_REV_EN, data & 0x02);
- discrete_sound_w(device, M79AMB_MC_CONTROL_EN, data & 0x04);
- discrete_sound_w(device, M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08);
- discrete_sound_w(device, M79AMB_WHISTLE_B_EN, data & 0x10);
- discrete_sound_w(device, M79AMB_WHISTLE_A_EN, data & 0x20);
+ discrete_sound_w(device, space, M79AMB_MC_REV_EN, data & 0x02);
+ discrete_sound_w(device, space, M79AMB_MC_CONTROL_EN, data & 0x04);
+ discrete_sound_w(device, space, M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08);
+ discrete_sound_w(device, space, M79AMB_WHISTLE_B_EN, data & 0x10);
+ discrete_sound_w(device, space, M79AMB_WHISTLE_A_EN, data & 0x20);
}
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index bb798c19d4b..17fa2036076 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -494,7 +494,7 @@ READ8_MEMBER(mario_state::mario_sh_tune_r)
static WRITE8_DEVICE_HANDLER( mario_sh_sound_w )
{
- discrete_sound_w(device, DS_DAC, data);
+ discrete_sound_w(device, space, DS_DAC, data);
}
WRITE8_MEMBER(mario_state::mario_sh_p1_w)
@@ -536,13 +536,13 @@ WRITE8_MEMBER(mario_state::mario_sh_tuneselect_w)
/* Mario running sample */
WRITE8_DEVICE_HANDLER( mario_sh1_w )
{
- discrete_sound_w(device, DS_SOUND0_INP, 0);
+ discrete_sound_w(device, space, DS_SOUND0_INP, 0);
}
/* Luigi running sample */
WRITE8_DEVICE_HANDLER( mario_sh2_w )
{
- discrete_sound_w(device, DS_SOUND1_INP, 0);
+ discrete_sound_w(device, space, DS_SOUND1_INP, 0);
}
/* Misc samples */
@@ -576,7 +576,7 @@ WRITE8_MEMBER(mario_state::mario_sh3_w)
I8035_P1_W_AH(space, 3, data & 1);
break;
case 7: /* skid */
- discrete_sound_w(machine().device("discrete"), DS_SOUND7_INP, data & 1);
+ discrete_sound_w(machine().device("discrete"), space, DS_SOUND7_INP, data & 1);
break;
}
}
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index 6dcab28d934..55c856ebac3 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -395,7 +395,7 @@ READ8_MEMBER(micro3d_state::micro3d_sound_io_r)
WRITE8_DEVICE_HANDLER( micro3d_upd7759_w )
{
- upd7759_port_w(device, 0, data);
+ upd7759_port_w(device, space, 0, data);
upd7759_start_w(device, 0);
upd7759_start_w(device, 1);
}
diff --git a/src/mame/audio/midway.c b/src/mame/audio/midway.c
index c80c6b1c09a..cf3339c0ab9 100644
--- a/src/mame/audio/midway.c
+++ b/src/mame/audio/midway.c
@@ -1198,7 +1198,7 @@ WRITE8_MEMBER(midway_squawk_n_talk_device::portb2_w)
// write strobe -- pass the current command to the TMS5200
if (((data ^ m_tms_strobes) & 0x02) && !(data & 0x02))
{
- tms5220_data_w(m_tms5200, offset, m_tms_command);
+ tms5220_data_w(m_tms5200, space, offset, m_tms_command);
// DoT expects the ready line to transition on a command/write here, so we oblige
m_pia1->ca2_w(1);
@@ -1208,7 +1208,7 @@ WRITE8_MEMBER(midway_squawk_n_talk_device::portb2_w)
// read strobe -- read the current status from the TMS5200
else if (((data ^ m_tms_strobes) & 0x01) && !(data & 0x01))
{
- m_pia1->porta_w(tms5220_status_r(m_tms5200, offset));
+ m_pia1->porta_w(tms5220_status_r(m_tms5200, space, offset));
// DoT expects the ready line to transition on a command/write here, so we oblige
m_pia1->ca2_w(1);
diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c
index bc59822faff..558e009a358 100644
--- a/src/mame/audio/mw8080bw.c
+++ b/src/mame/audio/mw8080bw.c
@@ -85,9 +85,9 @@ static const discrete_op_amp_tvca_info midway_music_tvca_info =
WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w )
{
- discrete_sound_w(device, MIDWAY_TONE_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, MIDWAY_TONE_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f);
+ discrete_sound_w(device, space, MIDWAY_TONE_DATA_L, (data >> 1) & 0x1f);
/* D6 and D7 are not connected */
}
@@ -95,7 +95,7 @@ WRITE8_DEVICE_HANDLER( midway_tone_generator_lo_w )
WRITE8_DEVICE_HANDLER( midway_tone_generator_hi_w )
{
- discrete_sound_w(device, MIDWAY_TONE_DATA_H, data & 0x3f);
+ discrete_sound_w(device, space, MIDWAY_TONE_DATA_H, data & 0x3f);
/* D6 and D7 are not connected */
}
@@ -328,11 +328,11 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( tornbase_audio_w )
{
- discrete_sound_w(device, TORNBASE_TONE_240_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, TORNBASE_TONE_240_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, TORNBASE_TONE_960_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, TORNBASE_TONE_960_EN, (data >> 1) & 0x01);
- discrete_sound_w(device, TORNBASE_TONE_120_EN, (data >> 2) & 0x01);
+ discrete_sound_w(device, space, TORNBASE_TONE_120_EN, (data >> 2) & 0x01);
/* if (data & 0x08) enable SIREN sound */
@@ -577,17 +577,18 @@ void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
/* controls need to be active low */
int controls = ~device->machine().root_device().ioport("IN0")->read() & 0xff;
- discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
- discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
- discrete_sound_w(device, MAZE_P2_DATA, (controls >> 4) & 0x0f);
- discrete_sound_w(device, MAZE_JOYSTICK_IN_USE, controls != 0xff);
+ address_space &space = device->machine().driver_data()->generic_space();
+ discrete_sound_w(device, space, MAZE_TONE_TIMING, maze_tone_timing_state);
+ discrete_sound_w(device, space, MAZE_P1_DATA, controls & 0x0f);
+ discrete_sound_w(device, space, MAZE_P2_DATA, (controls >> 4) & 0x0f);
+ discrete_sound_w(device, space, MAZE_JOYSTICK_IN_USE, controls != 0xff);
/* The coin line is connected directly to the discrete circuit. */
/* We can't really do that, so updating it with the tone timing is close enough. */
/* A better option might be to update it at vblank or set a timer to do it. */
/* The only noticeable difference doing it here, is that the controls don't */
/* immediately start making tones if pressed right after the coin is inserted. */
- discrete_sound_w(device, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
+ discrete_sound_w(device, space, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
}
@@ -825,15 +826,15 @@ WRITE8_DEVICE_HANDLER( boothill_audio_w )
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
- discrete_sound_w(device, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
- discrete_sound_w(device, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, BOOTHILL_LEFT_SHOT_EN, (data >> 4) & 0x01);
- discrete_sound_w(device, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, BOOTHILL_RIGHT_SHOT_EN, (data >> 5) & 0x01);
- discrete_sound_w(device, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01);
+ discrete_sound_w(device, space, BOOTHILL_LEFT_HIT_EN, (data >> 6) & 0x01);
- discrete_sound_w(device, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01);
+ discrete_sound_w(device, space, BOOTHILL_RIGHT_HIT_EN, (data >> 7) & 0x01);
}
@@ -1050,16 +1051,16 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( checkmat_audio_w )
{
- discrete_sound_w(device, CHECKMAT_TONE_EN, data & 0x01);
+ discrete_sound_w(device, space, CHECKMAT_TONE_EN, data & 0x01);
- discrete_sound_w(device, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
device->machine().sound().system_enable((data >> 3) & 0x01);
- discrete_sound_w(device, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
- discrete_sound_w(device, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
+ discrete_sound_w(device, space, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
+ discrete_sound_w(device, space, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
}
@@ -1265,15 +1266,15 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
- discrete_sound_w(device, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
- discrete_sound_w(device, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_RIFLE_SHOT_EN, (data >> 4) & 0x01);
- discrete_sound_w(device, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_BOTTLE_HIT_EN, (data >> 5) & 0x01);
- discrete_sound_w(device, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_ROAD_RUNNER_HIT_EN, (data >> 6) & 0x01);
- discrete_sound_w(device, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_CREATURE_HIT_EN, (data >> 7) & 0x01);
}
@@ -1281,9 +1282,9 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_2_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
- discrete_sound_w(device, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, DESERTGU_TRIGGER_CLICK_EN, (data >> 1) & 0x01);
output_set_value("Player1_Gun_Recoil", (data >> 2) & 0x01);
@@ -1528,15 +1529,15 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( dplay_audio_w )
{
- discrete_sound_w(device, DPLAY_TONE_ON_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, DPLAY_TONE_ON_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, DPLAY_CHEER_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, DPLAY_CHEER_EN, (data >> 1) & 0x01);
- discrete_sound_w(device, DPLAY_SIREN_EN, (data >> 2) & 0x01);
+ discrete_sound_w(device, space, DPLAY_SIREN_EN, (data >> 2) & 0x01);
- discrete_sound_w(device, DPLAY_WHISTLE_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, DPLAY_WHISTLE_EN, (data >> 3) & 0x01);
- discrete_sound_w(device, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
coin_counter_w(device->machine(), 0, (data >> 5) & 0x01);
@@ -1950,15 +1951,15 @@ WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->m_port_2_last;
- discrete_sound_w(device, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, CLOWNS_POP_MIDDLE_EN, (data >> 1) & 0x01);
- discrete_sound_w(device, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
+ discrete_sound_w(device, space, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
device->machine().sound().system_enable((data >> 3) & 0x01);
- discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
if (rising_bits & 0x20) state->m_samples->start(0, 0); /* springboard miss */
@@ -2311,22 +2312,22 @@ WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w )
device->machine().sound().system_enable((data >> 2) & 0x01);
- discrete_sound_w(device, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
}
WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w )
{
- discrete_sound_w(device, SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_TARGET_HIT_BOTTOM_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_TARGET_HIT_MIDDLE_EN, (data >> 1) & 0x01);
- discrete_sound_w(device, SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_TARGET_HIT_TOP_EN, (data >> 2) & 0x01);
- discrete_sound_w(device, SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_HIT1_EN, (data >> 3) & 0x01);
- discrete_sound_w(device, SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_HIT2_EN, (data >> 4) & 0x01);
- discrete_sound_w(device, SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, SPACWALK_SPRINGBOARD_MISS_EN, (data >> 5) & 0x01);
}
@@ -2535,17 +2536,17 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
{
- discrete_sound_w(device, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
device->machine().sound().system_enable((data >> 2) & 0x01);
- discrete_sound_w(device, NODE_29, (data >> 3) & 0x07);
+ discrete_sound_w(device, space, NODE_29, (data >> 3) & 0x07);
- discrete_sound_w(device, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
- discrete_sound_w(device, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
- discrete_sound_w(device, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
}
@@ -2553,7 +2554,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
{
- discrete_sound_w(device, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
@@ -2720,13 +2721,13 @@ WRITE8_DEVICE_HANDLER( dogpatch_audio_w )
coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
device->machine().sound().system_enable((data >> 3) & 0x01);
- discrete_sound_w(device, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, DOGPATCH_GAME_ON_EN, (data >> 3) & 0x01);
- discrete_sound_w(device, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, DOGPATCH_LEFT_SHOT_EN, (data >> 4) & 0x01);
- discrete_sound_w(device, DOGPATCH_RIGHT_SHOT_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, DOGPATCH_RIGHT_SHOT_EN, (data >> 5) & 0x01);
- discrete_sound_w(device, DOGPATCH_HIT_EN, (data >> 6) & 0x01);
+ discrete_sound_w(device, space, DOGPATCH_HIT_EN, (data >> 6) & 0x01);
}
@@ -3258,7 +3259,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
/* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL',
but it is never set by the software */
- discrete_sound_w(device, SPCENCTR_CRASH_EN, (data >> 2) & 0x01);
+ discrete_sound_w(device, space, SPCENCTR_CRASH_EN, (data >> 2) & 0x01);
/* D3-D7 are not connected */
}
@@ -3270,9 +3271,9 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
/* set WIND SOUND FREQ(data & 0x0f) 0, if no wind */
- discrete_sound_w(device, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, SPCENCTR_EXPLOSION_EN, (data >> 4) & 0x01);
- discrete_sound_w(device, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, SPCENCTR_PLAYER_SHOT_EN, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
@@ -3286,13 +3287,13 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
/* if (data & 0x01) enable SCREECH (hit the sides) sound */
- discrete_sound_w(device, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, SPCENCTR_ENEMY_SHIP_SHOT_EN, (data >> 1) & 0x01);
state->m_spcenctr_strobe_state = (data >> 2) & 0x01;
output_set_value("LAMP", (data >> 3) & 0x01);
- discrete_sound_w(device, SPCENCTR_BONUS_EN, (data >> 4) & 0x01);
+ discrete_sound_w(device, space, SPCENCTR_BONUS_EN, (data >> 4) & 0x01);
sn76477_enable_w(state->m_sn, (data >> 5) & 0x01); /* saucer sound */
@@ -3468,7 +3469,7 @@ WRITE8_DEVICE_HANDLER( bowler_audio_1_w )
device->machine().sound().system_enable((data >> 2) & 0x01);
- discrete_sound_w(device, BOWLER_FOWL_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, BOWLER_FOWL_EN, (data >> 3) & 0x01);
/* D4 - appears to be a screen flip, but it's
shown unconnected on the schematics for both the
@@ -4189,10 +4190,10 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
sn76477_enable_w(state->m_sn, (~data >> 0) & 0x01); /* saucer sound */
- discrete_sound_w(device, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
device->machine().sound().system_enable(data & 0x20);
@@ -4204,8 +4205,8 @@ WRITE8_DEVICE_HANDLER( invaders_audio_2_w )
{
mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
- discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* the flip screen line is only connected on the cocktail PCB */
if (invaders_is_cabinet_cocktail(device->machine()))
@@ -4590,18 +4591,18 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( blueshrk_audio_w )
{
- discrete_sound_w(device, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
+ discrete_sound_w(device, space, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
- discrete_sound_w(device, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
+ discrete_sound_w(device, space, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
- discrete_sound_w(device, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
+ discrete_sound_w(device, space, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
- discrete_sound_w(device, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
+ discrete_sound_w(device, space, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
/* if (data & 0x10) enable KILLED DIVER sound, this circuit
doesn't appear to be on the schematics */
- discrete_sound_w(device, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
+ discrete_sound_w(device, space, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
}
@@ -4822,10 +4823,10 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
sn76477_enable_w(state->m_sn1, (~data >> 0) & 0x01); /* saucer sound */
- discrete_sound_w(device, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 1), data & 0x02);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 1), data & 0x04);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
device->machine().sound().system_enable(data & 0x20);
@@ -4835,8 +4836,8 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
{
- discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* D5-D7 are not connected */
}
@@ -4848,10 +4849,10 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
sn76477_enable_w(state->m_sn2, (~data >> 0) & 0x01); /* saucer sound */
- discrete_sound_w(device, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_MISSILE_EN, 2), data & 0x02);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_EXPLOSION_EN, 2), data & 0x04);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 2), data & 0x08);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 2), data & 0x10);
/* D5-D7 are not connected */
}
@@ -4859,8 +4860,8 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_4_w )
{
- discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f);
- discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_FLEET_DATA, 2), data & 0x0f);
+ discrete_sound_w(device, space, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 2), data & 0x10);
/* D5-D7 are not connected */
}
diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c
index f3e76bd2132..29c20efa386 100644
--- a/src/mame/audio/namco52.c
+++ b/src/mame/audio/namco52.c
@@ -104,7 +104,7 @@ static READ8_HANDLER( namco_52xx_R1_r )
static WRITE8_HANDLER( namco_52xx_P_w )
{
namco_52xx_state *state = get_safe_token(space->device().owner());
- discrete_sound_w(state->m_discrete, NAMCO_52XX_P_DATA(state->m_basenode), data & 0x0f);
+ discrete_sound_w(state->m_discrete, *space, NAMCO_52XX_P_DATA(state->m_basenode), data & 0x0f);
}
static WRITE8_HANDLER( namco_52xx_R2_w )
diff --git a/src/mame/audio/namco52.h b/src/mame/audio/namco52.h
index 6c76a9a5d51..a338de3bc82 100644
--- a/src/mame/audio/namco52.h
+++ b/src/mame/audio/namco52.h
@@ -21,7 +21,7 @@ struct namco_52xx_interface
MCFG_DEVICE_CONFIG(_interface)
-WRITE8_DEVICE_HANDLER( namco_52xx_write );
+DECLARE_WRITE8_DEVICE_HANDLER( namco_52xx_write );
class namco_52xx_device : public device_t
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index 691571884e3..b0028a5acba 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -93,9 +93,9 @@ static WRITE8_HANDLER( namco_54xx_O_w )
namco_54xx_state *state = get_safe_token(space->device().owner());
UINT8 out = (data & 0x0f);
if (data & 0x10)
- discrete_sound_w(state->m_discrete, NAMCO_54XX_1_DATA(state->m_basenode), out);
+ discrete_sound_w(state->m_discrete, *space, NAMCO_54XX_1_DATA(state->m_basenode), out);
else
- discrete_sound_w(state->m_discrete, NAMCO_54XX_0_DATA(state->m_basenode), out);
+ discrete_sound_w(state->m_discrete, *space, NAMCO_54XX_0_DATA(state->m_basenode), out);
}
static WRITE8_HANDLER( namco_54xx_R1_w )
@@ -103,7 +103,7 @@ static WRITE8_HANDLER( namco_54xx_R1_w )
namco_54xx_state *state = get_safe_token(space->device().owner());
UINT8 out = (data & 0x0f);
- discrete_sound_w(state->m_discrete, NAMCO_54XX_2_DATA(state->m_basenode), out);
+ discrete_sound_w(state->m_discrete, *space, NAMCO_54XX_2_DATA(state->m_basenode), out);
}
diff --git a/src/mame/audio/namco54.h b/src/mame/audio/namco54.h
index 69436b15804..17039a473e5 100644
--- a/src/mame/audio/namco54.h
+++ b/src/mame/audio/namco54.h
@@ -17,7 +17,7 @@ struct namco_54xx_config
MCFG_DEVICE_CONFIG(_config)
-WRITE8_DEVICE_HANDLER( namco_54xx_write );
+DECLARE_WRITE8_DEVICE_HANDLER( namco_54xx_write );
class namco_54xx_device : public device_t
diff --git a/src/mame/audio/orbit.c b/src/mame/audio/orbit.c
index dab18b308db..9ebb838792b 100644
--- a/src/mame/audio/orbit.c
+++ b/src/mame/audio/orbit.c
@@ -15,24 +15,24 @@
WRITE8_DEVICE_HANDLER( orbit_note_w )
{
- discrete_sound_w(device, ORBIT_NOTE_FREQ, (~data) & 0xff);
+ discrete_sound_w(device, space, ORBIT_NOTE_FREQ, (~data) & 0xff);
}
WRITE8_DEVICE_HANDLER( orbit_note_amp_w )
{
- discrete_sound_w(device, ORBIT_ANOTE1_AMP, data & 0x0f);
- discrete_sound_w(device, ORBIT_ANOTE2_AMP, data >> 4);
+ discrete_sound_w(device, space, ORBIT_ANOTE1_AMP, data & 0x0f);
+ discrete_sound_w(device, space, ORBIT_ANOTE2_AMP, data >> 4);
}
WRITE8_DEVICE_HANDLER( orbit_noise_amp_w )
{
- discrete_sound_w(device, ORBIT_NOISE1_AMP, data & 0x0f);
- discrete_sound_w(device, ORBIT_NOISE2_AMP, data >> 4);
+ discrete_sound_w(device, space, ORBIT_NOISE1_AMP, data & 0x0f);
+ discrete_sound_w(device, space, ORBIT_NOISE2_AMP, data >> 4);
}
WRITE8_DEVICE_HANDLER( orbit_noise_rst_w )
{
- discrete_sound_w(device, ORBIT_NOISE_EN, 0);
+ discrete_sound_w(device, space, ORBIT_NOISE_EN, 0);
}
diff --git a/src/mame/audio/phoenix.c b/src/mame/audio/phoenix.c
index efc0b9dbaaa..12c6cf559f8 100644
--- a/src/mame/audio/phoenix.c
+++ b/src/mame/audio/phoenix.c
@@ -494,12 +494,12 @@ WRITE8_DEVICE_HANDLER( phoenix_sound_control_a_w )
{
phoenix_sound_state *state = get_safe_token(device);
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_2_DATA, data & 0x0f);
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_2_DATA, data & 0x0f);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4);
#if 0
/* future handling of noise sounds */
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_3_EN , data & 0x40);
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_4_EN , data & 0x80);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_3_EN , data & 0x40);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_4_EN , data & 0x80);
#endif
state->m_channel->update();
state->m_sound_latch_a = data;
@@ -526,9 +526,9 @@ WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w )
{
phoenix_sound_state *state = get_safe_token(device);
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_1_DATA, data & 0x0f);
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_1_FILT, data & 0x20);
- discrete_sound_w(state->m_discrete, PHOENIX_EFFECT_1_FREQ, data & 0x10);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_1_DATA, data & 0x0f);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_1_FILT, data & 0x20);
+ discrete_sound_w(state->m_discrete, space, PHOENIX_EFFECT_1_FREQ, data & 0x10);
/* update the tune that the MM6221AA is playing */
mm6221aa_tune_w(state->m_tms, data >> 6);
diff --git a/src/mame/audio/pleiads.h b/src/mame/audio/pleiads.h
index 460727b9ef4..6c173920e74 100644
--- a/src/mame/audio/pleiads.h
+++ b/src/mame/audio/pleiads.h
@@ -1,6 +1,6 @@
-WRITE8_DEVICE_HANDLER( pleiads_sound_control_a_w );
-WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w );
-WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w );
+DECLARE_WRITE8_DEVICE_HANDLER( pleiads_sound_control_a_w );
+DECLARE_WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w );
+DECLARE_WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w );
class pleiads_sound_device : public device_t,
public device_sound_interface
diff --git a/src/mame/audio/poolshrk.c b/src/mame/audio/poolshrk.c
index 4450bf83d58..b9730d4bfde 100644
--- a/src/mame/audio/poolshrk.c
+++ b/src/mame/audio/poolshrk.c
@@ -157,20 +157,20 @@ DISCRETE_SOUND_END
WRITE8_DEVICE_HANDLER( poolshrk_scratch_sound_w )
{
- discrete_sound_w(device, POOLSHRK_SCRATCH_SND, offset & 1);
+ discrete_sound_w(device, space, POOLSHRK_SCRATCH_SND, offset & 1);
}
WRITE8_DEVICE_HANDLER( poolshrk_score_sound_w )
{
- discrete_sound_w(device, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
+ discrete_sound_w(device, space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
}
WRITE8_DEVICE_HANDLER( poolshrk_click_sound_w )
{
- discrete_sound_w(device, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
+ discrete_sound_w(device, space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
}
WRITE8_DEVICE_HANDLER( poolshrk_bump_sound_w )
{
- discrete_sound_w(device, POOLSHRK_BUMP_EN, offset & 1);
+ discrete_sound_w(device, space, POOLSHRK_BUMP_EN, offset & 1);
}
diff --git a/src/mame/audio/qix.c b/src/mame/audio/qix.c
index b41b6636758..cc3c6baf3fd 100644
--- a/src/mame/audio/qix.c
+++ b/src/mame/audio/qix.c
@@ -28,12 +28,12 @@ Audio handlers
static WRITE8_DEVICE_HANDLER( qix_dac_w )
{
- discrete_sound_w(device, QIX_DAC_DATA, data);
+ discrete_sound_w(device, space, QIX_DAC_DATA, data);
}
static WRITE8_DEVICE_HANDLER( qix_vol_w )
{
- discrete_sound_w(device, QIX_VOL_DATA, data);
+ discrete_sound_w(device, space, QIX_VOL_DATA, data);
}
diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c
index bd92e93b95b..9461d06dc93 100644
--- a/src/mame/audio/redalert.c
+++ b/src/mame/audio/redalert.c
@@ -86,7 +86,7 @@ static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
/* BC1=1, BDIR=0 : read from PSG */
case 0x01:
- state->m_ay8910_latch_1 = ay8910_r(device, 0);
+ state->m_ay8910_latch_1 = ay8910_r(device, space, 0);
break;
/* BC1=0, BDIR=1 : write to PSG */
@@ -94,7 +94,7 @@ static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
case 0x02:
case 0x03:
default:
- ay8910_data_address_w(device, data, state->m_ay8910_latch_2);
+ ay8910_data_address_w(device, space, data, state->m_ay8910_latch_2);
break;
}
}
@@ -310,28 +310,28 @@ static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
{
case 0x00:
if (state->m_ay8910_latch_1 & 0x10)
- ay8910_data_w(ay1, 0, data);
+ ay8910_data_w(ay1, space, 0, data);
if (state->m_ay8910_latch_1 & 0x20)
- ay8910_data_w(ay2, 0, data);
+ ay8910_data_w(ay2, space, 0, data);
break;
case 0x01:
if (state->m_ay8910_latch_1 & 0x10)
- state->m_ay8910_latch_2 = ay8910_r(ay1, 0);
+ state->m_ay8910_latch_2 = ay8910_r(ay1, space, 0);
if (state->m_ay8910_latch_1 & 0x20)
- state->m_ay8910_latch_2 = ay8910_r(ay2, 0);
+ state->m_ay8910_latch_2 = ay8910_r(ay2, space, 0);
break;
case 0x03:
if (state->m_ay8910_latch_1 & 0x10)
- ay8910_address_w(ay1, 0, data);
+ ay8910_address_w(ay1, space, 0, data);
if (state->m_ay8910_latch_1 & 0x20)
- ay8910_address_w(ay2, 0, data);
+ ay8910_address_w(ay2, space, 0, data);
break;
diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c
index 377e04e259e..73adb292404 100644
--- a/src/mame/audio/scramble.c
+++ b/src/mame/audio/scramble.c
@@ -247,14 +247,14 @@ static WRITE8_DEVICE_HANDLER( ad2083_tms5110_ctrl_w )
{
static const int tbl[8] = {0,4,2,6,1,5,3,7};
- tmsprom_bit_w(device, 0, tbl[data & 0x07]);
+ tmsprom_bit_w(device, space, 0, tbl[data & 0x07]);
switch (data>>3)
{
case 0x01:
- tmsprom_rom_csq_w(device, 1, 0);
+ tmsprom_rom_csq_w(device, space, 1, 0);
break;
case 0x03:
- tmsprom_rom_csq_w(device, 0, 0);
+ tmsprom_rom_csq_w(device, space, 0, 0);
break;
case 0x00:
/* Rom 2 select */
diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c
index f0d1d6ef55a..120e413b329 100644
--- a/src/mame/audio/segag80r.c
+++ b/src/mame/audio/segag80r.c
@@ -376,8 +376,8 @@ WRITE8_MEMBER(segag80r_state::astrob_sound_w)
static SOUND_START( sega005 );
static STREAM_UPDATE( sega005_stream_update );
static TIMER_CALLBACK( sega005_auto_timer );
-static WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
-static WRITE8_DEVICE_HANDLER( sega005_sound_b_w );
+static DECLARE_WRITE8_DEVICE_HANDLER( sega005_sound_a_w );
+static DECLARE_WRITE8_DEVICE_HANDLER( sega005_sound_b_w );
/*
005
@@ -783,14 +783,14 @@ WRITE8_MEMBER(segag80r_state::spaceod_sound_w)
*************************************/
static SOUND_START( monsterb );
-static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w );
-static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
-static READ8_DEVICE_HANDLER( n7751_status_r );
-static WRITE8_DEVICE_HANDLER( n7751_command_w );
-static WRITE8_DEVICE_HANDLER( n7751_rom_control_w );
+static DECLARE_WRITE8_DEVICE_HANDLER( monsterb_sound_a_w );
+static DECLARE_WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
+static DECLARE_READ8_DEVICE_HANDLER( n7751_status_r );
+static DECLARE_WRITE8_DEVICE_HANDLER( n7751_command_w );
+static DECLARE_WRITE8_DEVICE_HANDLER( n7751_rom_control_w );
-static WRITE8_DEVICE_HANDLER( n7751_p2_w );
+static DECLARE_WRITE8_DEVICE_HANDLER( n7751_p2_w );
/*
@@ -1032,7 +1032,7 @@ static WRITE8_DEVICE_HANDLER( n7751_p2_w )
{
segag80r_state *state = device->machine().driver_data<segag80r_state>();
/* write to P2; low 4 bits go to 8243 */
- i8243_p2_w(device, offset, data & 0x0f);
+ i8243_p2_w(device, space, offset, data & 0x0f);
/* output of bit $80 indicates we are ready (1) or busy (0) */
/* no other outputs are used */
diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h
index da998fa3abf..e5d63da0939 100644
--- a/src/mame/audio/segasnd.h
+++ b/src/mame/audio/segasnd.h
@@ -6,15 +6,15 @@
MACHINE_CONFIG_EXTERN( sega_speech_board );
-WRITE8_DEVICE_HANDLER( sega_speech_data_w );
-WRITE8_DEVICE_HANDLER( sega_speech_control_w );
+DECLARE_WRITE8_DEVICE_HANDLER( sega_speech_data_w );
+DECLARE_WRITE8_DEVICE_HANDLER( sega_speech_control_w );
MACHINE_CONFIG_EXTERN( sega_universal_sound_board );
MACHINE_CONFIG_EXTERN( sega_universal_sound_board_rom );
-READ8_DEVICE_HANDLER( sega_usb_status_r );
-WRITE8_DEVICE_HANDLER( sega_usb_data_w );
-READ8_DEVICE_HANDLER( sega_usb_ram_r );
-WRITE8_DEVICE_HANDLER( sega_usb_ram_w );
+DECLARE_READ8_DEVICE_HANDLER( sega_usb_status_r );
+DECLARE_WRITE8_DEVICE_HANDLER( sega_usb_data_w );
+DECLARE_READ8_DEVICE_HANDLER( sega_usb_ram_r );
+DECLARE_WRITE8_DEVICE_HANDLER( sega_usb_ram_w );
diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h
index 13d3e6e3e03..cfe05eb4915 100644
--- a/src/mame/audio/seibu.h
+++ b/src/mame/audio/seibu.h
@@ -60,8 +60,8 @@ MACHINE_RESET( seibu_sound );
void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length);
void seibu_adpcm_decrypt(running_machine &machine, const char *region);
-WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
-WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
+DECLARE_WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
+DECLARE_WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
class seibu_adpcm_device : public device_t,
public device_sound_interface
diff --git a/src/mame/audio/skyraid.c b/src/mame/audio/skyraid.c
index 9e11c7e1b2a..a4c725ff3e0 100644
--- a/src/mame/audio/skyraid.c
+++ b/src/mame/audio/skyraid.c
@@ -292,10 +292,10 @@ WRITE8_DEVICE_HANDLER( skyraid_sound_w )
/* BIT4 => PLANE ON */
/* BIT5 => ATTRACT */
- discrete_sound_w(device, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
- discrete_sound_w(device, SKYRAID_MISSILE_EN, data & 0x02);
- discrete_sound_w(device, SKYRAID_EXPLOSION_EN, data & 0x04);
+ discrete_sound_w(device, space, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
+ discrete_sound_w(device, space, SKYRAID_MISSILE_EN, data & 0x02);
+ discrete_sound_w(device, space, SKYRAID_EXPLOSION_EN, data & 0x04);
set_led_status(device->machine(), 0, !(data & 0x08));
- discrete_sound_w(device, SKYRAID_PLANE_ON_EN, data & 0x10);
- discrete_sound_w(device, SKYRAID_ATTRACT_EN, data & 0x20);
+ discrete_sound_w(device, space, SKYRAID_PLANE_ON_EN, data & 0x10);
+ discrete_sound_w(device, space, SKYRAID_ATTRACT_EN, data & 0x20);
}
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index 323e9e15e43..79d2b3102aa 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -1068,6 +1068,7 @@ void spc700_set_volume(device_t *device,int volume)
I/O for DSP
***************************/
+static DECLARE_READ8_DEVICE_HANDLER( snes_dsp_io_r );
static READ8_DEVICE_HANDLER( snes_dsp_io_r )
{
snes_sound_state *spc700 = get_safe_token(device);
@@ -1083,6 +1084,7 @@ static READ8_DEVICE_HANDLER( snes_dsp_io_r )
return spc700->dsp_regs[offset & 0x7f];
}
+static DECLARE_WRITE8_DEVICE_HANDLER( snes_dsp_io_w );
static WRITE8_DEVICE_HANDLER( snes_dsp_io_w )
{
snes_sound_state *spc700 = get_safe_token(device);
@@ -1118,7 +1120,7 @@ READ8_DEVICE_HANDLER( spc_io_r )
case 0x2: /* Register address */
return spc700->ram[0xf2];
case 0x3: /* Register data */
- return snes_dsp_io_r(device, spc700->ram[0xf2]);
+ return snes_dsp_io_r(device, space, spc700->ram[0xf2]);
case 0x4: /* Port 0 */
case 0x5: /* Port 1 */
case 0x6: /* Port 2 */
@@ -1186,7 +1188,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
break;
case 0x3: /* Register data - 0x80-0xff is a read-only mirror of 0x00-0x7f */
if (!(spc700->ram[0xf2] & 0x80))
- snes_dsp_io_w(device, spc700->ram[0xf2] & 0x7f, data);
+ snes_dsp_io_w(device, space, spc700->ram[0xf2] & 0x7f, data);
break;
case 0x4: /* Port 0 */
case 0x5: /* Port 1 */
diff --git a/src/mame/audio/snes_snd.h b/src/mame/audio/snes_snd.h
index 35eec3b058e..9a10ac49f02 100644
--- a/src/mame/audio/snes_snd.h
+++ b/src/mame/audio/snes_snd.h
@@ -46,12 +46,12 @@ extern const device_type SNES;
I/O PROTOTYPES
***************************************************************************/
-READ8_DEVICE_HANDLER( spc_io_r );
-WRITE8_DEVICE_HANDLER( spc_io_w );
-READ8_DEVICE_HANDLER( spc_ram_r );
-WRITE8_DEVICE_HANDLER( spc_ram_w );
-READ8_DEVICE_HANDLER( spc_port_out );
-WRITE8_DEVICE_HANDLER( spc_port_in );
+DECLARE_READ8_DEVICE_HANDLER( spc_io_r );
+DECLARE_WRITE8_DEVICE_HANDLER( spc_io_w );
+DECLARE_READ8_DEVICE_HANDLER( spc_ram_r );
+DECLARE_WRITE8_DEVICE_HANDLER( spc_ram_w );
+DECLARE_READ8_DEVICE_HANDLER( spc_port_out );
+DECLARE_WRITE8_DEVICE_HANDLER( spc_port_in );
UINT8 *spc_get_ram(device_t *device);
void spc700_set_volume(device_t *device,int volume);
diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c
index 7b26bce34dc..464593a0511 100644
--- a/src/mame/audio/snk6502.c
+++ b/src/mame/audio/snk6502.c
@@ -957,7 +957,7 @@ WRITE8_HANDLER( fantasy_sound_w )
}
/* BOMB */
- discrete_sound_w(space->machine().device("discrete"), FANTASY_BOMB_EN, data & 0x80);
+ discrete_sound_w(space->machine().device("discrete"), *space, FANTASY_BOMB_EN, data & 0x80);
state->m_LastPort1 = data;
break;
diff --git a/src/mame/audio/spiders.c b/src/mame/audio/spiders.c
index d0eead09d0f..fb1a837026e 100644
--- a/src/mame/audio/spiders.c
+++ b/src/mame/audio/spiders.c
@@ -182,22 +182,22 @@ WRITE8_DEVICE_HANDLER( spiders_audio_command_w )
WRITE8_DEVICE_HANDLER( spiders_audio_a_w )
{
- discrete_sound_w(device, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2);
+ discrete_sound_w(device, space, SPIDER_WEB_SOUND_MOD_DATA, 1 + (data & 4) * 8 + (data & 2) * 4 + (data & 1) * 2);
}
WRITE8_DEVICE_HANDLER( spiders_audio_b_w )
{
- discrete_sound_w(device, SPIDERS_WEB_SOUND_DATA, data);
+ discrete_sound_w(device, space, SPIDERS_WEB_SOUND_DATA, data);
}
WRITE8_DEVICE_HANDLER( spiders_audio_ctrl_w )
{
- discrete_sound_w(device, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0);
- discrete_sound_w(device, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0);
- discrete_sound_w(device, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0);
- discrete_sound_w(device, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0);
- discrete_sound_w(device, SPIDERS_X_EN, data & 0x01 ? 1 : 0);
+ discrete_sound_w(device, space, SPIDERS_FIRE_EN, data & 0x10 ? 1 : 0);
+ discrete_sound_w(device, space, SPIDERS_EXP_EN, data & 0x08 ? 1 : 0);
+ discrete_sound_w(device, space, SPIDERS_SUPER_WEB_EXPL_EN, data & 0x04 ? 1 : 0);
+ discrete_sound_w(device, space, SPIDERS_SUPER_WEB_EN, data & 0x02 ? 1 : 0);
+ discrete_sound_w(device, space, SPIDERS_X_EN, data & 0x01 ? 1 : 0);
}
diff --git a/src/mame/audio/sprint8.c b/src/mame/audio/sprint8.c
index 648cd34e661..2fa5a29cddf 100644
--- a/src/mame/audio/sprint8.c
+++ b/src/mame/audio/sprint8.c
@@ -295,20 +295,20 @@ DISCRETE_SOUND_END
WRITE8_DEVICE_HANDLER( sprint8_crash_w )
{
- discrete_sound_w(device, SPRINT8_CRASH_EN, data & 0x01);
+ discrete_sound_w(device, space, SPRINT8_CRASH_EN, data & 0x01);
}
WRITE8_DEVICE_HANDLER( sprint8_screech_w )
{
- discrete_sound_w(device, SPRINT8_SCREECH_EN, data & 0x01);
+ discrete_sound_w(device, space, SPRINT8_SCREECH_EN, data & 0x01);
}
WRITE8_DEVICE_HANDLER( sprint8_attract_w )
{
- discrete_sound_w(device, SPRINT8_ATTRACT_EN, data & 0x01);
+ discrete_sound_w(device, space, SPRINT8_ATTRACT_EN, data & 0x01);
}
WRITE8_DEVICE_HANDLER( sprint8_motor_w )
{
- discrete_sound_w(device, NODE_RELATIVE(SPRINT8_MOTOR1_EN, offset & 0x07), data & 0x01);
+ discrete_sound_w(device, space, NODE_RELATIVE(SPRINT8_MOTOR1_EN, offset & 0x07), data & 0x01);
}
diff --git a/src/mame/audio/subs.c b/src/mame/audio/subs.c
index a21f02c54e6..77302a72c6a 100644
--- a/src/mame/audio/subs.c
+++ b/src/mame/audio/subs.c
@@ -14,28 +14,28 @@ sub sound functions
WRITE8_DEVICE_HANDLER( subs_sonar1_w )
{
- discrete_sound_w(device, SUBS_SONAR1_EN, offset & 0x01);
+ discrete_sound_w(device, space, SUBS_SONAR1_EN, offset & 0x01);
}
WRITE8_DEVICE_HANDLER( subs_sonar2_w )
{
- discrete_sound_w(device, SUBS_SONAR2_EN, offset & 0x01);
+ discrete_sound_w(device, space, SUBS_SONAR2_EN, offset & 0x01);
}
WRITE8_DEVICE_HANDLER( subs_crash_w )
{
- discrete_sound_w(device, SUBS_CRASH_EN, offset & 0x01);
+ discrete_sound_w(device, space, SUBS_CRASH_EN, offset & 0x01);
}
WRITE8_DEVICE_HANDLER( subs_explode_w )
{
- discrete_sound_w(device, SUBS_EXPLODE_EN, offset & 0x01);
+ discrete_sound_w(device, space, SUBS_EXPLODE_EN, offset & 0x01);
}
WRITE8_DEVICE_HANDLER( subs_noise_reset_w )
{
/* Pulse noise reset */
- discrete_sound_w(device, SUBS_NOISE_RESET, 0);
+ discrete_sound_w(device, space, SUBS_NOISE_RESET, 0);
}
diff --git a/src/mame/audio/taitosnd.h b/src/mame/audio/taitosnd.h
index 91c9d47bcb3..c1815f2baa9 100644
--- a/src/mame/audio/taitosnd.h
+++ b/src/mame/audio/taitosnd.h
@@ -48,15 +48,15 @@ extern const device_type TC0140SYT;
***************************************************************************/
/* MASTER (8bit bus) control functions */
-WRITE8_DEVICE_HANDLER( tc0140syt_port_w );
-WRITE8_DEVICE_HANDLER( tc0140syt_comm_w );
-READ8_DEVICE_HANDLER( tc0140syt_comm_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_port_w );
+DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_comm_w );
+DECLARE_READ8_DEVICE_HANDLER( tc0140syt_comm_r );
/* SLAVE (8bit bus) control functions ONLY */
-WRITE8_DEVICE_HANDLER( tc0140syt_slave_port_w );
-READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r );
-WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w );
+DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_slave_port_w );
+DECLARE_READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r );
+DECLARE_WRITE8_DEVICE_HANDLER( tc0140syt_slave_comm_w );
#endif /*__TAITOSND_H__*/
diff --git a/src/mame/audio/trackfld.h b/src/mame/audio/trackfld.h
index 342e1b90ad5..f4137ae6b6d 100644
--- a/src/mame/audio/trackfld.h
+++ b/src/mame/audio/trackfld.h
@@ -1,11 +1,11 @@
WRITE8_HANDLER( konami_sh_irqtrigger_w );
READ8_HANDLER( trackfld_sh_timer_r );
-READ8_DEVICE_HANDLER( trackfld_speech_r );
-WRITE8_DEVICE_HANDLER( trackfld_sound_w );
+DECLARE_READ8_DEVICE_HANDLER( trackfld_speech_r );
+DECLARE_WRITE8_DEVICE_HANDLER( trackfld_sound_w );
READ8_HANDLER( hyperspt_sh_timer_r );
-WRITE8_DEVICE_HANDLER( hyperspt_sound_w );
+DECLARE_WRITE8_DEVICE_HANDLER( hyperspt_sound_w );
WRITE8_HANDLER( konami_SN76496_latch_w );
-WRITE8_DEVICE_HANDLER( konami_SN76496_w );
+DECLARE_WRITE8_DEVICE_HANDLER( konami_SN76496_w );
class trackfld_audio_device : public device_t,
public device_sound_interface
diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c
index e39dc83ad5b..162a3bc787e 100644
--- a/src/mame/audio/vicdual.c
+++ b/src/mame/audio/vicdual.c
@@ -151,12 +151,12 @@ WRITE8_HANDLER( frogs_audio_w )
int new_croak = data & 0x08;
int new_buzzz = data & 0x10;
-// discrete_sound_w(discrete, FROGS_HOP_EN, data & 0x01);
-// discrete_sound_w(discrete, FROGS_JUMP_EN, data & 0x02);
- discrete_sound_w(discrete, FROGS_TONGUE_EN, data & 0x04);
-// discrete_sound_w(discrete, FROGS_CAPTURE_EN, data & 0x08);
-// discrete_sound_w(discrete, FROGS_FLY_EN, data & 0x10);
-// discrete_sound_w(discrete, FROGS_SPLASH_EN, data & 0x80);
+// discrete_sound_w(discrete, *space, FROGS_HOP_EN, data & 0x01);
+// discrete_sound_w(discrete, *space, FROGS_JUMP_EN, data & 0x02);
+ discrete_sound_w(discrete, *space, FROGS_TONGUE_EN, data & 0x04);
+// discrete_sound_w(discrete, *space, FROGS_CAPTURE_EN, data & 0x08);
+// discrete_sound_w(discrete, *space, FROGS_FLY_EN, data & 0x10);
+// discrete_sound_w(discrete, *space, FROGS_SPLASH_EN, data & 0x80);
if (data & 0x01)
samples->start(3, 3); // Hop
@@ -464,13 +464,13 @@ WRITE8_HANDLER( headon_audio_w )
device_t *discrete = space->machine().device("discrete");
if (discrete == NULL)
return;
- discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01);
- discrete_sound_w(discrete, HEADON_SCREECH1_EN, data & 0x02);
- discrete_sound_w(discrete, HEADON_CRASH_EN, data & 0x04);
- discrete_sound_w(discrete, HEADON_HISPEED_CC_EN, data & 0x08);
- discrete_sound_w(discrete, HEADON_SCREECH2_EN, data & 0x10);
- discrete_sound_w(discrete, HEADON_BONUS_EN, data & 0x20);
- discrete_sound_w(discrete, HEADON_CAR_ON_EN, data & 0x40);
+ discrete_sound_w(discrete, *space, HEADON_HISPEED_PC_EN, data & 0x01);
+ discrete_sound_w(discrete, *space, HEADON_SCREECH1_EN, data & 0x02);
+ discrete_sound_w(discrete, *space, HEADON_CRASH_EN, data & 0x04);
+ discrete_sound_w(discrete, *space, HEADON_HISPEED_CC_EN, data & 0x08);
+ discrete_sound_w(discrete, *space, HEADON_SCREECH2_EN, data & 0x10);
+ discrete_sound_w(discrete, *space, HEADON_BONUS_EN, data & 0x20);
+ discrete_sound_w(discrete, *space, HEADON_CAR_ON_EN, data & 0x40);
}
@@ -479,13 +479,13 @@ WRITE8_HANDLER( invho2_audio_w )
device_t *discrete = space->machine().device("discrete");
if (discrete == NULL)
return;
- discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10);
- discrete_sound_w(discrete, HEADON_SCREECH1_EN, data & 0x08);
- discrete_sound_w(discrete, HEADON_CRASH_EN, data & 0x80);
- discrete_sound_w(discrete, HEADON_HISPEED_CC_EN, data & 0x40);
- discrete_sound_w(discrete, HEADON_SCREECH2_EN, data & 0x04);
- discrete_sound_w(discrete, HEADON_BONUS_EN, data & 0x02);
- discrete_sound_w(discrete, HEADON_CAR_ON_EN, data & 0x20);
+ discrete_sound_w(discrete, *space, HEADON_HISPEED_PC_EN, data & 0x10);
+ discrete_sound_w(discrete, *space, HEADON_SCREECH1_EN, data & 0x08);
+ discrete_sound_w(discrete, *space, HEADON_CRASH_EN, data & 0x80);
+ discrete_sound_w(discrete, *space, HEADON_HISPEED_CC_EN, data & 0x40);
+ discrete_sound_w(discrete, *space, HEADON_SCREECH2_EN, data & 0x04);
+ discrete_sound_w(discrete, *space, HEADON_BONUS_EN, data & 0x02);
+ discrete_sound_w(discrete, *space, HEADON_CAR_ON_EN, data & 0x20);
}
diff --git a/src/mame/audio/wiping.h b/src/mame/audio/wiping.h
index d7ab3f23b73..eb559c61aa2 100644
--- a/src/mame/audio/wiping.h
+++ b/src/mame/audio/wiping.h
@@ -22,4 +22,4 @@ private:
extern const device_type WIPING;
-WRITE8_DEVICE_HANDLER( wiping_sound_w );
+DECLARE_WRITE8_DEVICE_HANDLER( wiping_sound_w );
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c
index 0ea5bf2d333..4fd0156e6ca 100644
--- a/src/mame/drivers/40love.c
+++ b/src/mame/drivers/40love.c
@@ -968,7 +968,8 @@ static const ay8910_interface ay8910_config =
static const msm5232_interface msm5232_config =
{
- { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 } /* 1.0 uF capacitors (verified on real PCB) */
+ { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 }, /* 1.0 uF capacitors (verified on real PCB) */
+ DEVCB_NULL
};
/*******************************************************************************/
diff --git a/src/mame/drivers/4enraya.c b/src/mame/drivers/4enraya.c
index d549a308d6a..5266657d61f 100644
--- a/src/mame/drivers/4enraya.c
+++ b/src/mame/drivers/4enraya.c
@@ -72,7 +72,7 @@ WRITE8_MEMBER(_4enraya_state::sound_control_w)
device_t *device = machine().device("aysnd");
if ((m_last_snd_ctrl & m_snd_latch_bit ) == m_snd_latch_bit && (data & m_snd_latch_bit) == 0x00)
- ay8910_data_address_w(device, m_last_snd_ctrl, m_soundlatch);
+ ay8910_data_address_w(device, space, m_last_snd_ctrl, m_soundlatch);
m_last_snd_ctrl = data;
}
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index 914f6521abb..9620e9510c7 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -686,8 +686,8 @@ WRITE8_MEMBER(_5clown_state::cpu_d800_w)
WRITE8_MEMBER(_5clown_state::fclown_ay8910_w)
{
- ay8910_address_w(m_ay8910, 0, offset);
- ay8910_data_w(m_ay8910, 0, data);
+ ay8910_address_w(m_ay8910, space, 0, offset);
+ ay8910_data_w(m_ay8910, space, 0, data);
}
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index a58bc81b472..a054de42e2d 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -38,9 +38,9 @@ READ8_MEMBER(_88games_state::bankedram_r)
else
{
if (m_zoomreadroms)
- return k051316_rom_r(m_k051316, offset);
+ return k051316_rom_r(m_k051316, space, offset);
else
- return k051316_r(m_k051316, offset);
+ return k051316_r(m_k051316, space, offset);
}
}
@@ -50,7 +50,7 @@ WRITE8_MEMBER(_88games_state::bankedram_w)
if (m_videobank)
m_ram[offset] = data;
else
- k051316_w(m_k051316, offset, data);
+ k051316_w(m_k051316, space, offset, data);
}
WRITE8_MEMBER(_88games_state::k88games_5f84_w)
@@ -89,7 +89,7 @@ WRITE8_MEMBER(_88games_state::speech_msg_w)
{
device_t *upd = m_speech_chip ? m_upd_2 : m_upd_1;
- upd7759_port_w(upd, 0, data);
+ upd7759_port_w(upd, space, 0, data);
}
/* special handlers to combine 052109 & 051960 */
@@ -99,25 +99,25 @@ READ8_MEMBER(_88games_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(_88games_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
/*************************************
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 1cefcb3cbef..2474b5e2c22 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -92,25 +92,25 @@ READ8_MEMBER(aliens_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(aliens_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
static ADDRESS_MAP_START( aliens_map, AS_PROGRAM, 8, aliens_state )
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index a7cf7e6818e..be07180e7b4 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -65,7 +65,7 @@ READ8_MEMBER(amspdwy_state::amspdwy_wheel_1_r)
READ8_MEMBER(amspdwy_state::amspdwy_sound_r)
{
device_t *device = machine().device("ymsnd");
- return (ym2151_status_port_r(device, 0) & ~ 0x30) | machine().root_device().ioport("IN0")->read();
+ return (ym2151_status_port_r(device, space, 0) & ~ 0x30) | machine().root_device().ioport("IN0")->read();
}
WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 12f516c57d9..60721f6d406 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -649,13 +649,13 @@ READ8_MEMBER(aristmk4_state::via_a_r)
if (m_ay8910_1&0x03) // SW1 read.
{
- psg_ret = ay8910_r(machine().device("ay1"), 0);
+ psg_ret = ay8910_r(machine().device("ay1"), space, 0);
//logerror("PSG porta ay1 returned %02X\n",psg_ret);
}
else if (m_ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok.
{
- psg_ret = ay8910_r(machine().device("ay2"), 0);
+ psg_ret = ay8910_r(machine().device("ay2"), space, 0);
//logerror("PSG porta ay2 returned %02X\n",psg_ret);
}
return psg_ret;
@@ -750,13 +750,13 @@ WRITE8_MEMBER(aristmk4_state::via_b_w)
break;
case 0x06: //WRITE
{
- ay8910_data_w( machine().device("ay1"), 0 , m_psg_data );
+ ay8910_data_w( machine().device("ay1"), space, 0 , m_psg_data );
//logerror("VIA Port A write data ay1: %02X\n",m_psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
- ay8910_address_w( machine().device("ay1"), 0 , m_psg_data );
+ ay8910_address_w( machine().device("ay1"), space, 0 , m_psg_data );
//logerror("VIA Port B write register ay1: %02X\n",m_psg_data);
break;
}
@@ -777,13 +777,13 @@ WRITE8_MEMBER(aristmk4_state::via_b_w)
break;
case 0x06: //WRITE
{
- ay8910_data_w( machine().device("ay2"), 0 , m_psg_data );
+ ay8910_data_w( machine().device("ay2"), space, 0 , m_psg_data );
//logerror("VIA Port A write data ay2: %02X\n",m_psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
- ay8910_address_w( machine().device("ay2"), 0 , m_psg_data );
+ ay8910_address_w( machine().device("ay2"), space, 0 , m_psg_data );
//logerror("VIA Port B write register ay2: %02X\n",m_psg_data);
break;
}
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index 826e1c0fbb5..2ef76f54fdb 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -67,7 +67,7 @@ static INTERRUPT_GEN( asterix_interrupt )
READ8_MEMBER(asterix_state::asterix_sound_r)
{
device_t *device = machine().device("k053260");
- return k053260_r(device, 2 + offset);
+ return k053260_r(device, space, 2 + offset);
}
static TIMER_CALLBACK( nmi_callback )
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 823ae9eef54..d3f9ad222d4 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -402,14 +402,14 @@ READ8_MEMBER(atarisy1_state::switch_6502_r)
WRITE8_MEMBER(atarisy1_state::via_pa_w)
{
device_t *device = machine().device("tms");
- tms5220_data_w(device, 0, data);
+ tms5220_data_w(device, space, 0, data);
}
READ8_MEMBER(atarisy1_state::via_pa_r)
{
device_t *device = machine().device("tms");
- return tms5220_status_r(device, 0);
+ return tms5220_status_r(device, space, 0);
}
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index c9152a31413..03f45563e33 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -764,7 +764,7 @@ WRITE8_MEMBER(atarisy2_state::tms5220_w)
{
if (m_has_tms5220)
{
- tms5220_data_w(machine().device("tms"), 0, data);
+ tms5220_data_w(machine().device("tms"), space, 0, data);
}
}
diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c
index 12bbb8e79c7..d48ae7d3de9 100644
--- a/src/mame/drivers/bagman.c
+++ b/src/mame/drivers/bagman.c
@@ -81,16 +81,16 @@ WRITE8_MEMBER(bagman_state::bagman_ls259_w)
case 0:
case 1:
case 2:
- tmsprom_bit_w(device, 0, 7 - ((m_ls259_buf[0]<<2) | (m_ls259_buf[1]<<1) | (m_ls259_buf[2]<<0)));
+ tmsprom_bit_w(device, space, 0, 7 - ((m_ls259_buf[0]<<2) | (m_ls259_buf[1]<<1) | (m_ls259_buf[2]<<0)));
break;
case 3:
tmsprom_enable_w(device, m_ls259_buf[offset]);
break;
case 4:
- tmsprom_rom_csq_w(device, 0, m_ls259_buf[offset]);
+ tmsprom_rom_csq_w(device, space, 0, m_ls259_buf[offset]);
break;
case 5:
- tmsprom_rom_csq_w(device, 1, m_ls259_buf[offset]);
+ tmsprom_rom_csq_w(device, space, 1, m_ls259_buf[offset]);
break;
}
}
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index e84438e7415..a2c2e167283 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -548,12 +548,12 @@ WRITE8_MEMBER(berzerk_state::berzerk_audio_w)
/* offset 6 writes to the sfxcontrol latch */
case 6:
- exidy_sfxctrl_w(machine().device("exidy"), data >> 6, data);
+ exidy_sfxctrl_w(machine().device("exidy"), space, data >> 6, data);
break;
/* everything else writes to the 6840 */
default:
- exidy_sh6840_w(machine().device("exidy"), offset, data);
+ exidy_sh6840_w(machine().device("exidy"), space, offset, data);
break;
}
@@ -574,7 +574,7 @@ READ8_MEMBER(berzerk_state::berzerk_audio_r)
return 0;
/* everything else reads from the 6840 */
default:
- return exidy_sh6840_r(machine().device("exidy"), offset);
+ return exidy_sh6840_r(machine().device("exidy"), space, offset);
}
}
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index d198cc9c081..b4e2d9b6678 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -1471,7 +1471,7 @@ WRITE8_MEMBER(bfcobra_state::upd_w)
{
device_t *device = machine().device("upd");
upd7759_reset_w(device, data & 0x80);
- upd7759_port_w(device, 0, data & 0x3f);
+ upd7759_port_w(device, space, 0, data & 0x3f);
upd7759_start_w(device, data & 0x40 ? 0 : 1);
}
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index c629d961d69..53cb816a970 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -602,7 +602,7 @@ WRITE8_MEMBER(bfm_sc1_state::nec_reset_w)
WRITE8_MEMBER(bfm_sc1_state::nec_latch_w)
{
device_t *device = machine().device("upd");
- upd7759_port_w (device, 0, data&0x3F); // setup sample
+ upd7759_port_w (device, space, 0, data&0x3F); // setup sample
upd7759_start_w(device, 0);
upd7759_start_w(device, 1); // start
}
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index a8d2d9086a1..3ed5abed474 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -731,7 +731,7 @@ WRITE8_MEMBER(bfm_sc2_state::nec_latch_w)
upd7759_set_bank_base(device, bank*0x20000);
- upd7759_port_w(device, 0, data&0x3F); // setup sample
+ upd7759_port_w(device, space, 0, data&0x3F); // setup sample
upd7759_start_w(device, 0);
upd7759_start_w(device, 1);
}
diff --git a/src/mame/drivers/bfm_sc4h.c b/src/mame/drivers/bfm_sc4h.c
index 601ca6b7f5c..95d131fce80 100644
--- a/src/mame/drivers/bfm_sc4h.c
+++ b/src/mame/drivers/bfm_sc4h.c
@@ -192,10 +192,10 @@ READ16_MEMBER(sc4_state::sc4_mem_r)
return 0x0000;//space.machine().rand();;
case 0x1244:
- return ymz280b_r(m_ymz,0);
+ return ymz280b_r(m_ymz,space,0);
case 0x1246:
- return ymz280b_r(m_ymz,1);
+ return ymz280b_r(m_ymz,space,1);
default:
logerror("%08x maincpu read access offset %08x mem_mask %04x cs %d (LAMPS etc.)\n", pc, offset*2, mem_mask, cs);
@@ -215,7 +215,7 @@ READ16_MEMBER(sc4_state::sc4_mem_r)
if ((offset>=base) && (offset<end))
{
offset-=base;
- return duart68681_r(m_duart,offset);
+ return duart68681_r(m_duart,space,offset);
}
else
{
@@ -336,11 +336,11 @@ WRITE16_MEMBER(sc4_state::sc4_mem_w)
break;
case 0x1248:
- ymz280b_w(m_ymz,0, data & 0xff);
+ ymz280b_w(m_ymz,space,0, data & 0xff);
break;
case 0x124a:
- ymz280b_w(m_ymz,1, data & 0xff);
+ ymz280b_w(m_ymz,space,1, data & 0xff);
break;
case 0x1330:
@@ -367,7 +367,7 @@ WRITE16_MEMBER(sc4_state::sc4_mem_w)
if ((offset>=base) && (offset<end))
{
offset-=base;
- duart68681_w(m_duart,offset,data&0x00ff);
+ duart68681_w(m_duart,space,offset,data&0x00ff);
}
else
{
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index f80d0cfb797..dee01456218 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -413,7 +413,8 @@ GFXDECODE_END
static const msm5232_interface msm5232_config =
{
- { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 } /* 0.65 (???) uF capacitors */
+ { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }, /* 0.65 (???) uF capacitors */
+ DEVCB_NULL
};
void bigevglf_state::machine_start()
diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c
index a5edbb3ddf9..61f3e0dbaeb 100644
--- a/src/mame/drivers/bishi.c
+++ b/src/mame/drivers/bishi.c
@@ -138,7 +138,7 @@ READ16_MEMBER(bishi_state::bishi_K056832_rom_r)
if (m_cur_control2 & 0x1000)
ouroffs += 4;
- return k056832_bishi_rom_word_r(m_k056832, ouroffs, mem_mask);
+ return k056832_bishi_rom_word_r(m_k056832, space, ouroffs, mem_mask);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index 05aaf75c538..cc541ee13ac 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -69,25 +69,25 @@ READ8_MEMBER(blockhl_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(blockhl_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c
index 80ea4db1bdd..310154fc9b9 100644
--- a/src/mame/drivers/bogeyman.c
+++ b/src/mame/drivers/bogeyman.c
@@ -34,11 +34,11 @@ WRITE8_MEMBER(bogeyman_state::bogeyman_8910_control_w)
// bit 5 goes to 8910 #0 BDIR pin
if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(machine().device("ay1"), m_last_write >> 4, m_psg_latch);
+ ay8910_data_address_w(machine().device("ay1"), space, m_last_write >> 4, m_psg_latch);
// bit 7 goes to 8910 #1 BDIR pin
if ((m_last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(machine().device("ay2"), m_last_write >> 6, m_psg_latch);
+ ay8910_data_address_w(machine().device("ay2"), space, m_last_write >> 6, m_psg_latch);
m_last_write = data;
}
diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c
index aec462323cf..cd00541a535 100644
--- a/src/mame/drivers/bottom9.c
+++ b/src/mame/drivers/bottom9.c
@@ -34,25 +34,25 @@ READ8_MEMBER(bottom9_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(bottom9_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
READ8_MEMBER(bottom9_state::bottom9_bankedram1_r)
@@ -63,9 +63,9 @@ READ8_MEMBER(bottom9_state::bottom9_bankedram1_r)
else
{
if (m_zoomreadroms)
- return k051316_rom_r(m_k051316, offset);
+ return k051316_rom_r(m_k051316, space, offset);
else
- return k051316_r(m_k051316, offset);
+ return k051316_r(m_k051316, space, offset);
}
}
@@ -75,7 +75,7 @@ WRITE8_MEMBER(bottom9_state::bottom9_bankedram1_w)
if (m_k052109_selected)
k052109_051960_w(space, offset, data);
else
- k051316_w(m_k051316, offset, data);
+ k051316_w(m_k051316, space, offset, data);
}
READ8_MEMBER(bottom9_state::bottom9_bankedram2_r)
diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c
index 61e29f667ff..86543a230dd 100644
--- a/src/mame/drivers/buggychl.c
+++ b/src/mame/drivers/buggychl.c
@@ -352,7 +352,8 @@ static const ay8910_interface ay8910_interface_2 =
static const msm5232_interface msm5232_config =
{
- { 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6 } /* default 0.39 uF capacitors (not verified) */
+ { 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6 }, /* default 0.39 uF capacitors (not verified) */
+ DEVCB_NULL
};
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index 1c467ce3992..c1350bffb01 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -286,7 +286,7 @@ WRITE8_MEMBER(bzone_state::redbaron_joysound_w)
{
device_t *device = machine().device("custom");
m_rb_input_select = data & 1;
- redbaron_sounds_w(device, offset, data);
+ redbaron_sounds_w(device, space, offset, data);
}
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index a73e434cc98..47f1ca11388 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -184,13 +184,13 @@ static void ide_interrupt(device_t *device, int state);
READ8_MEMBER(calchase_state::at_dma8237_2_r)
{
device_t *device = machine().device("dma8237_2");
- return i8237_r(device, offset / 2);
+ return i8237_r(device, space, offset / 2);
}
WRITE8_MEMBER(calchase_state::at_dma8237_2_w)
{
device_t *device = machine().device("dma8237_2");
- i8237_w(device, offset / 2, data);
+ i8237_w(device, space, offset / 2, data);
}
READ8_MEMBER(calchase_state::at_page8_r)
@@ -298,13 +298,13 @@ static I8237_INTERFACE( dma8237_2_config )
READ32_MEMBER(calchase_state::ide_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(calchase_state::ide_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
}
@@ -314,14 +314,14 @@ WRITE32_MEMBER(calchase_state::ide_w)
READ32_MEMBER(calchase_state::fdc_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(calchase_state::fdc_w)
{
device_t *device = machine().device("ide");
//mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
- ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
}
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index 34b6bb91018..11b63a22a9a 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -92,7 +92,7 @@ WRITE8_MEMBER(cd32_state::cd32_cia_0_porta_w)
/* bit 2 = Power Led on Amiga */
set_led_status(machine(), 0, (data & 2) ? 0 : 1);
- handle_cd32_joystick_cia(machine(), data, mos6526_r(device, 2));
+ handle_cd32_joystick_cia(machine(), data, mos6526_r(device, space, 2));
}
/*************************************
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 016d9d0da86..59cda529e77 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -736,15 +736,15 @@ ADDRESS_MAP_END
WRITE8_MEMBER(centiped_state::caterplr_AY8910_w)
{
device_t *device = machine().device("pokey");
- ay8910_address_w(device, 0, offset);
- ay8910_data_w(device, 0, data);
+ ay8910_address_w(device, space, 0, offset);
+ ay8910_data_w(device, space, 0, data);
}
READ8_MEMBER(centiped_state::caterplr_AY8910_r)
{
device_t *device = machine().device("pokey");
- ay8910_address_w(device, 0, offset);
- return ay8910_r(device, 0);
+ ay8910_address_w(device, space, 0, offset);
+ return ay8910_r(device, space, 0);
}
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 9ce08855a48..c9e4a8b9e0c 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -148,19 +148,19 @@ WRITE8_MEMBER(cham24_state::sprite_dma_w)
READ8_MEMBER(cham24_state::psg_4015_r)
{
device_t *device = machine().device("nes");
- return nes_psg_r(device,0x15);
+ return nes_psg_r(device,space,0x15);
}
WRITE8_MEMBER(cham24_state::psg_4015_w)
{
device_t *device = machine().device("nes");
- nes_psg_w(device,0x15, data);
+ nes_psg_w(device,space,0x15, data);
}
WRITE8_MEMBER(cham24_state::psg_4017_w)
{
device_t *device = machine().device("nes");
- nes_psg_w(device,0x17, data);
+ nes_psg_w(device,space,0x17, data);
}
diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c
index 26867453793..2cad7ee0ae7 100644
--- a/src/mame/drivers/cidelsa.c
+++ b/src/mame/drivers/cidelsa.c
@@ -64,15 +64,15 @@ WRITE8_MEMBER( draco_state::sound_g_w )
switch (data)
{
case 0x01:
- ay8910_data_w(m_psg, 0, m_psg_latch);
+ ay8910_data_w(m_psg, space, 0, m_psg_latch);
break;
case 0x02:
- m_psg_latch = ay8910_r(m_psg, 0);
+ m_psg_latch = ay8910_r(m_psg, space, 0);
break;
case 0x03:
- ay8910_address_w(m_psg, 0, m_psg_latch);
+ ay8910_address_w(m_psg, space, 0, m_psg_latch);
break;
}
}
diff --git a/src/mame/drivers/circusc.c b/src/mame/drivers/circusc.c
index e240384ad0f..7d2b8481a79 100644
--- a/src/mame/drivers/circusc.c
+++ b/src/mame/drivers/circusc.c
@@ -128,9 +128,9 @@ WRITE8_MEMBER(circusc_state::circusc_sound_w)
/* CS6 */
case 4:
- discrete_sound_w(m_discrete, NODE_05, (offset & 0x20) >> 5);
- discrete_sound_w(m_discrete, NODE_06, (offset & 0x18) >> 3);
- discrete_sound_w(m_discrete, NODE_07, (offset & 0x40) >> 6);
+ discrete_sound_w(m_discrete, space, NODE_05, (offset & 0x20) >> 5);
+ discrete_sound_w(m_discrete, space, NODE_06, (offset & 0x18) >> 3);
+ discrete_sound_w(m_discrete, space, NODE_07, (offset & 0x40) >> 6);
break;
}
}
diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c
index f8f25c01405..156511feb9f 100644
--- a/src/mame/drivers/cliffhgr.c
+++ b/src/mame/drivers/cliffhgr.c
@@ -172,8 +172,8 @@ WRITE8_MEMBER(cliffhgr_state::cliff_sound_overlay_w)
{
device_t *device = machine().device("discrete");
/* audio */
- discrete_sound_w(device, CLIFF_ENABLE_SND_1, data & 1);
- discrete_sound_w(device, CLIFF_ENABLE_SND_2, (data >> 1) & 1);
+ discrete_sound_w(device, space, CLIFF_ENABLE_SND_1, data & 1);
+ discrete_sound_w(device, space, CLIFF_ENABLE_SND_2, (data >> 1) & 1);
// bit 4 (data & 0x10) is overlay related?
}
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 17747b66e28..08093d90912 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -149,14 +149,14 @@ READ16_MEMBER(cninja_state::robocop2_prot_r)
WRITE16_MEMBER(cninja_state::cninja_pf12_control_w)
{
machine().primary_screen->update_partial(machine().primary_screen->vpos());
- deco16ic_pf_control_w(m_deco_tilegen1, offset, data, mem_mask);
+ deco16ic_pf_control_w(m_deco_tilegen1, space, offset, data, mem_mask);
}
WRITE16_MEMBER(cninja_state::cninja_pf34_control_w)
{
machine().primary_screen->update_partial(machine().primary_screen->vpos());
- deco16ic_pf_control_w(m_deco_tilegen2, offset, data, mem_mask);
+ deco16ic_pf_control_w(m_deco_tilegen2, space, offset, data, mem_mask);
}
diff --git a/src/mame/drivers/contra.c b/src/mame/drivers/contra.c
index e67a34336c2..7d9d77ad2a7 100644
--- a/src/mame/drivers/contra.c
+++ b/src/mame/drivers/contra.c
@@ -28,7 +28,8 @@ Dip locations and factory settings verified with manual
static INTERRUPT_GEN( contra_interrupt )
{
contra_state *state = device->machine().driver_data<contra_state>();
- if (k007121_ctrlram_r(state->m_k007121_1, 7) & 0x02)
+ address_space &space = state->generic_space();
+ if (k007121_ctrlram_r(state->m_k007121_1, space, 7) & 0x02)
device->execute().set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
}
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index 5a1a1020f31..cd7cea200dd 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -167,7 +167,7 @@ WRITE8_MEMBER(crbaloon_state::port_sound_w)
machine().sound().system_enable((data & 0x02) ? TRUE : FALSE);
/* D2 - unlabeled - music enable */
- crbaloon_audio_set_music_enable(discrete, 0, (data & 0x04) ? TRUE : FALSE);
+ crbaloon_audio_set_music_enable(discrete, space, 0, (data & 0x04) ? TRUE : FALSE);
/* D3 - EXPLOSION */
crbaloon_audio_set_explosion_enable(sn, (data & 0x08) ? TRUE : FALSE);
@@ -179,7 +179,7 @@ WRITE8_MEMBER(crbaloon_state::port_sound_w)
crbaloon_audio_set_appear_enable(sn, (data & 0x20) ? TRUE : FALSE);
/* D6 - unlabeled - laugh enable */
- crbaloon_audio_set_laugh_enable(discrete, 0, (data & 0x40) ? TRUE : FALSE);
+ crbaloon_audio_set_laugh_enable(discrete, space, 0, (data & 0x40) ? TRUE : FALSE);
/* D7 - unlabeled - goes to PC3259 pin 16 */
@@ -339,12 +339,12 @@ GFXDECODE_END
void crbaloon_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_IO);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_IO);
device_t *discrete = machine().device("discrete");
pc3092_reset();
- port_sound_w(*space, 0, 0);
- crbaloon_audio_set_music_freq(discrete, 0, 0);
+ port_sound_w(space, 0, 0);
+ crbaloon_audio_set_music_freq(discrete, space, 0, 0);
}
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index e5f5c71ee57..3593b6ddb73 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -60,25 +60,25 @@ READ8_MEMBER(crimfght_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(crimfght_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
/********************************************/
diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c
index 3287cf385ce..80e4748a8aa 100644
--- a/src/mame/drivers/cubeqst.c
+++ b/src/mame/drivers/cubeqst.c
@@ -393,22 +393,22 @@ INPUT_PORTS_END
READ16_MEMBER(cubeqst_state::read_rotram)
{
- return cubeqcpu_rotram_r(machine().device("rotate_cpu"), offset, mem_mask);
+ return cubeqcpu_rotram_r(machine().device("rotate_cpu"), space, offset, mem_mask);
}
WRITE16_MEMBER(cubeqst_state::write_rotram)
{
- cubeqcpu_rotram_w(machine().device("rotate_cpu"), offset, data, mem_mask);
+ cubeqcpu_rotram_w(machine().device("rotate_cpu"), space, offset, data, mem_mask);
}
READ16_MEMBER(cubeqst_state::read_sndram)
{
- return cubeqcpu_sndram_r(machine().device("sound_cpu"), offset, mem_mask);
+ return cubeqcpu_sndram_r(machine().device("sound_cpu"), space, offset, mem_mask);
}
WRITE16_MEMBER(cubeqst_state::write_sndram)
{
- cubeqcpu_sndram_w(machine().device("sound_cpu"), offset, data, mem_mask);
+ cubeqcpu_sndram_w(machine().device("sound_cpu"), space, offset, data, mem_mask);
}
static ADDRESS_MAP_START( m68k_program_map, AS_PROGRAM, 16, cubeqst_state )
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index a5df70f5629..d2d18e32577 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -156,7 +156,7 @@ READ8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_r)
if (*m_fo_state)
return m_character_ram[(0 * 0x800) | 0x400 | m_character_ram_page_start | offset];
else
- return s2636_work_ram_r(m_s2636_0, offset);
+ return s2636_work_ram_r(m_s2636_0, space, offset);
}
WRITE8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_w)
@@ -169,7 +169,7 @@ WRITE8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_w)
machine().gfx[1]->mark_dirty((offset / 8) % 256);
}
else
- s2636_work_ram_w(m_s2636_0, offset, data);
+ s2636_work_ram_w(m_s2636_0, space, offset, data);
}
@@ -179,7 +179,7 @@ READ8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_r)
if (*m_fo_state)
return m_character_ram[(1 * 0x800) | 0x400 | m_character_ram_page_start | offset];
else
- return s2636_work_ram_r(m_s2636_1, offset);
+ return s2636_work_ram_r(m_s2636_1, space, offset);
}
WRITE8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_w)
@@ -192,7 +192,7 @@ WRITE8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_w)
machine().gfx[1]->mark_dirty((offset / 8) % 256);
}
else
- s2636_work_ram_w(m_s2636_1, offset, data);
+ s2636_work_ram_w(m_s2636_1, space, offset, data);
}
@@ -202,7 +202,7 @@ READ8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_r)
if (*m_fo_state)
return m_character_ram[(2 * 0x800) | 0x400 | m_character_ram_page_start | offset];
else
- return s2636_work_ram_r(m_s2636_2, offset);
+ return s2636_work_ram_r(m_s2636_2, space, offset);
}
WRITE8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_w)
@@ -215,7 +215,7 @@ WRITE8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_w)
machine().gfx[1]->mark_dirty((offset / 8) % 256);
}
else
- s2636_work_ram_w(m_s2636_2, offset, data);
+ s2636_work_ram_w(m_s2636_2, space, offset, data);
}
@@ -290,7 +290,7 @@ READ8_MEMBER(cvs_state::cvs_393hz_clock_r)
READ8_MEMBER(cvs_state::tms_clock_r)
{
device_t *device = machine().device("tms");
- return tms5110_romclk_hack_r(device, 0) ? 0x80 : 0;
+ return tms5110_romclk_hack_r(device, space, 0) ? 0x80 : 0;
}
static TIMER_CALLBACK( cvs_393hz_timer_cb )
@@ -390,7 +390,7 @@ READ8_MEMBER(cvs_state::cvs_speech_command_r)
/* FIXME: this was by observation on board ???
* -bit 7 is TMS status (active LO) */
- return ((tms5110_ctl_r(m_tms, 0) ^ 1) << 7) | (soundlatch_byte_r(space, 0) & 0x7f);
+ return ((tms5110_ctl_r(m_tms, space, 0) ^ 1) << 7) | (soundlatch_byte_r(space, 0) & 0x7f);
}
@@ -409,7 +409,7 @@ WRITE8_MEMBER(cvs_state::cvs_tms5110_ctl_w)
(m_tms5110_ctl_data[1] << 3); /* CTL8 */
LOG(("CVS: Speech CTL = %04x %02x %02x\n", ctl, offset, data));
- tms5110_ctl_w(device, 0, ctl);
+ tms5110_ctl_w(device, space, 0, ctl);
}
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index 1bf79e58075..74c468fa5fd 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -821,7 +821,12 @@ GFXDECODE_END
static const y8950_interface y8950_config = {
- 0 /* TODO */
+ /* TODO */
+ DEVCB_NULL,
+ DEVCB_NULL,
+ DEVCB_NULL,
+ DEVCB_NULL,
+ DEVCB_NULL
};
static MACHINE_CONFIG_START( cybertnk, cybertnk_state )
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index 5a994bcc3fe..226599175d0 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -73,7 +73,7 @@ WRITE8_MEMBER(dambustr_state::dambustr_noise_enable_w)
device_t *device = machine().device("GAL_AUDIO");
if (data != m_noise_data) {
m_noise_data = data;
- galaxian_noise_enable_w(device, offset, data);
+ galaxian_noise_enable_w(device, space, offset, data);
}
}
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index 5013dd57833..d5eb171821e 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -177,7 +177,7 @@ READ16_MEMBER(darius_state::darius_ioc_r)
switch (offset)
{
case 0x01:
- return (tc0140syt_comm_r(m_tc0140syt, 0) & 0xff); /* sound interface read */
+ return (tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff); /* sound interface read */
case 0x04:
return ioport("P1")->read();
@@ -207,12 +207,12 @@ WRITE16_MEMBER(darius_state::darius_ioc_w)
{
case 0x00: /* sound interface write */
- tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
+ tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
return;
case 0x01: /* sound interface write */
- tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
+ tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
return;
case 0x28: /* unknown, written by both cpus - always 0? */
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index ce848b94e4b..2217562beca 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -104,7 +104,8 @@ UINT16 dblwings_pri_callback(UINT16 x)
static SCREEN_UPDATE_IND16(dblewing)
{
dblewing_state *state = screen.machine().driver_data<dblewing_state>();
- UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
+ address_space &space = state->generic_space();
+ UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
state->flip_screen_set(BIT(flip, 7));
deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index cc905036ccf..b210d55eab7 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -208,7 +208,7 @@ READ32_MEMBER(djmain_state::v_rom_r)
{
device_t *k056832 = machine().device("k056832");
UINT8 *mem8 = memregion("gfx2")->base();
- int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
+ int bank = k056832_word_r(k056832, space, 0x34/2, 0xffff);
offset *= 2;
@@ -280,18 +280,18 @@ READ32_MEMBER(djmain_state::ide_std_r)
{
device_t *device = machine().device("ide");
if (ACCESSING_BITS_0_7)
- return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0xff00) >> 8;
+ return ide_controller16_r(device, space, IDE_STD_OFFSET + offset, 0xff00) >> 8;
else
- return ide_controller16_r(device, IDE_STD_OFFSET + offset, 0xffff) << 16;
+ return ide_controller16_r(device, space, IDE_STD_OFFSET + offset, 0xffff) << 16;
}
WRITE32_MEMBER(djmain_state::ide_std_w)
{
device_t *device = machine().device("ide");
if (ACCESSING_BITS_0_7)
- ide_controller16_w(device, IDE_STD_OFFSET + offset, data << 8, 0xff00);
+ ide_controller16_w(device, space, IDE_STD_OFFSET + offset, data << 8, 0xff00);
else
- ide_controller16_w(device, IDE_STD_OFFSET + offset, data >> 16, 0xffff);
+ ide_controller16_w(device, space, IDE_STD_OFFSET + offset, data >> 16, 0xffff);
}
@@ -299,7 +299,7 @@ READ32_MEMBER(djmain_state::ide_alt_r)
{
device_t *device = machine().device("ide");
if (offset == 0)
- return ide_controller16_r(device, IDE_ALT_OFFSET, 0x00ff) << 24;
+ return ide_controller16_r(device, space, IDE_ALT_OFFSET, 0x00ff) << 24;
return 0;
}
@@ -308,7 +308,7 @@ WRITE32_MEMBER(djmain_state::ide_alt_w)
{
device_t *device = machine().device("ide");
if (offset == 0 && ACCESSING_BITS_16_23)
- ide_controller16_w(device, IDE_ALT_OFFSET, data >> 24, 0x00ff);
+ ide_controller16_w(device, space, IDE_ALT_OFFSET, data >> 24, 0x00ff);
}
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index 949de03dbdd..8637f665d41 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -568,7 +568,7 @@ WRITE8_MEMBER(dkong_state::p8257_drq_w)
READ8_MEMBER(dkong_state::dkong_in2_r)
{
/* mcu status (sound feedback) is inverted bit4 from port B (8039) */
- UINT8 mcustatus = latch8_bit4_q_r(m_dev_vp2, 0);
+ UINT8 mcustatus = latch8_bit4_q_r(m_dev_vp2, space, 0);
UINT8 r;
r = (ioport("IN2")->read() & 0xBF) | (mcustatus << 6);
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index f9a0200d99f..6a8543ca3b4 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -148,24 +148,24 @@ static const UINT8 led_map[16] =
*
*************************************/
-static void dleuro_interrupt(device_t *device, int state)
+static WRITE_LINE_DEVICE_HANDLER( dleuro_interrupt )
{
device->machine().device("maincpu")->execute().set_input_line(0, state);
}
-static WRITE8_DEVICE_HANDLER( serial_transmit )
+static WRITE16_DEVICE_HANDLER( serial_transmit )
{
dlair_state *state = device->machine().driver_data<dlair_state>();
state->laserdisc_data_w(data);
}
-static int serial_receive(device_t *device, int channel)
+static READ16_DEVICE_HANDLER( serial_receive )
{
dlair_state *state = device->machine().driver_data<dlair_state>();
/* if we still have data to send, do it now */
- if (channel == 0 && state->laserdisc_data_available_r() == ASSERT_LINE)
+ if (offset == 0 && state->laserdisc_data_available_r() == ASSERT_LINE)
return state->laserdisc_data_r();
return -1;
@@ -183,12 +183,12 @@ static Z80CTC_INTERFACE( ctc_intf )
static const z80sio_interface sio_intf =
{
- dleuro_interrupt, /* interrupt handler */
- 0, /* DTR changed handler */
- 0, /* RTS changed handler */
- 0, /* BREAK changed handler */
- serial_transmit, /* transmit handler */
- serial_receive /* receive handler */
+ DEVCB_LINE(dleuro_interrupt), /* interrupt handler */
+ DEVCB_NULL, /* DTR changed handler */
+ DEVCB_NULL, /* RTS changed handler */
+ DEVCB_NULL, /* BREAK changed handler */
+ DEVCB_HANDLER(serial_transmit), /* transmit handler */
+ DEVCB_HANDLER(serial_receive) /* receive handler */
};
diff --git a/src/mame/drivers/dogfgt.c b/src/mame/drivers/dogfgt.c
index 8c07fe165e9..3a1ce7e4b1f 100644
--- a/src/mame/drivers/dogfgt.c
+++ b/src/mame/drivers/dogfgt.c
@@ -46,11 +46,11 @@ WRITE8_MEMBER(dogfgt_state::dogfgt_soundcontrol_w)
/* bit 5 goes to 8910 #0 BDIR pin */
if ((m_last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(machine().device("ay1"), m_last_snd_ctrl >> 4, m_soundlatch);
+ ay8910_data_address_w(machine().device("ay1"), space, m_last_snd_ctrl >> 4, m_soundlatch);
/* bit 7 goes to 8910 #1 BDIR pin */
if ((m_last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(machine().device("ay2"), m_last_snd_ctrl >> 6, m_soundlatch);
+ ay8910_data_address_w(machine().device("ay2"), space, m_last_snd_ctrl >> 6, m_soundlatch);
m_last_snd_ctrl = data;
}
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index 3f1ebfb0110..83f0e6565a9 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -33,9 +33,9 @@ static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
}
-static void dragrace_update_misc_flags( running_machine &machine )
+static void dragrace_update_misc_flags( address_space &space )
{
- dragrace_state *state = machine.driver_data<dragrace_state>();
+ dragrace_state *state = space.machine().driver_data<dragrace_state>();
/* 0x0900 = set 3SPEED1 0x00000001
* 0x0901 = set 4SPEED1 0x00000002
* 0x0902 = set 5SPEED1 0x00000004
@@ -67,24 +67,24 @@ static void dragrace_update_misc_flags( running_machine &machine )
* 0x091f = set Player 2 Start Lamp 0x80000000
* 0x0938 = clear 0x0918 - 0x091f
*/
- set_led_status(machine, 0, state->m_misc_flags & 0x00008000);
- set_led_status(machine, 1, state->m_misc_flags & 0x80000000);
-
- discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR1_DATA, ~state->m_misc_flags & 0x0000001f); // Speed1 data*
- discrete_sound_w(state->m_discrete, DRAGRACE_EXPLODE1_EN, (state->m_misc_flags & 0x00000020) ? 1: 0); // Explosion1 enable
- discrete_sound_w(state->m_discrete, DRAGRACE_SCREECH1_EN, (state->m_misc_flags & 0x00000040) ? 1: 0); // Screech1 enable
- discrete_sound_w(state->m_discrete, DRAGRACE_KLEXPL1_EN, (state->m_misc_flags & 0x00000200) ? 1: 0); // KLEXPL1 enable
- discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR1_EN, (state->m_misc_flags & 0x00000800) ? 1: 0); // Motor1 enable
-
- discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR2_DATA, (~state->m_misc_flags & 0x001f0000) >> 0x10); // Speed2 data*
- discrete_sound_w(state->m_discrete, DRAGRACE_EXPLODE2_EN, (state->m_misc_flags & 0x00200000) ? 1: 0); // Explosion2 enable
- discrete_sound_w(state->m_discrete, DRAGRACE_SCREECH2_EN, (state->m_misc_flags & 0x00400000) ? 1: 0); // Screech2 enable
- discrete_sound_w(state->m_discrete, DRAGRACE_KLEXPL2_EN, (state->m_misc_flags & 0x02000000) ? 1: 0); // KLEXPL2 enable
- discrete_sound_w(state->m_discrete, DRAGRACE_MOTOR2_EN, (state->m_misc_flags & 0x08000000) ? 1: 0); // Motor2 enable
-
- discrete_sound_w(state->m_discrete, DRAGRACE_ATTRACT_EN, (state->m_misc_flags & 0x00001000) ? 1: 0); // Attract enable
- discrete_sound_w(state->m_discrete, DRAGRACE_LOTONE_EN, (state->m_misc_flags & 0x00002000) ? 1: 0); // LoTone enable
- discrete_sound_w(state->m_discrete, DRAGRACE_HITONE_EN, (state->m_misc_flags & 0x20000000) ? 1: 0); // HiTone enable
+ set_led_status(space.machine(), 0, state->m_misc_flags & 0x00008000);
+ set_led_status(space.machine(), 1, state->m_misc_flags & 0x80000000);
+
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR1_DATA, ~state->m_misc_flags & 0x0000001f); // Speed1 data*
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_EXPLODE1_EN, (state->m_misc_flags & 0x00000020) ? 1: 0); // Explosion1 enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_SCREECH1_EN, (state->m_misc_flags & 0x00000040) ? 1: 0); // Screech1 enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_KLEXPL1_EN, (state->m_misc_flags & 0x00000200) ? 1: 0); // KLEXPL1 enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR1_EN, (state->m_misc_flags & 0x00000800) ? 1: 0); // Motor1 enable
+
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR2_DATA, (~state->m_misc_flags & 0x001f0000) >> 0x10); // Speed2 data*
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_EXPLODE2_EN, (state->m_misc_flags & 0x00200000) ? 1: 0); // Explosion2 enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_SCREECH2_EN, (state->m_misc_flags & 0x00400000) ? 1: 0); // Screech2 enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_KLEXPL2_EN, (state->m_misc_flags & 0x02000000) ? 1: 0); // KLEXPL2 enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_MOTOR2_EN, (state->m_misc_flags & 0x08000000) ? 1: 0); // Motor2 enable
+
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_ATTRACT_EN, (state->m_misc_flags & 0x00001000) ? 1: 0); // Attract enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_LOTONE_EN, (state->m_misc_flags & 0x00002000) ? 1: 0); // LoTone enable
+ discrete_sound_w(state->m_discrete, space, DRAGRACE_HITONE_EN, (state->m_misc_flags & 0x20000000) ? 1: 0); // HiTone enable
}
WRITE8_MEMBER(dragrace_state::dragrace_misc_w)
@@ -97,7 +97,7 @@ WRITE8_MEMBER(dragrace_state::dragrace_misc_w)
else
m_misc_flags &= (~mask);
logerror("Set %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0900 + offset, mask, m_misc_flags, data & 0x01);
- dragrace_update_misc_flags(machine());
+ dragrace_update_misc_flags(space);
}
WRITE8_MEMBER(dragrace_state::dragrace_misc_clear_w)
@@ -107,7 +107,7 @@ WRITE8_MEMBER(dragrace_state::dragrace_misc_clear_w)
UINT32 mask = 0xff << (((offset >> 3) & 0x03) * 8);
m_misc_flags &= (~mask);
logerror("Clear %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0920 + offset, mask, m_misc_flags, data & 0x01);
- dragrace_update_misc_flags(machine());
+ dragrace_update_misc_flags(space);
}
READ8_MEMBER(dragrace_state::dragrace_input_r)
diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c
index 15a77ab5e3d..45e83a7c725 100644
--- a/src/mame/drivers/drw80pkr.c
+++ b/src/mame/drivers/drw80pkr.c
@@ -195,11 +195,11 @@ WRITE8_MEMBER(drw80pkr_state::drw80pkr_io_w)
// ay8910 control port
if (m_p1 == 0xfc)
- ay8910_address_w(machine().device("aysnd"), 0, data);
+ ay8910_address_w(machine().device("aysnd"), space, 0, data);
// ay8910_write_port_0_w
if (m_p1 == 0xfe)
- ay8910_data_w(machine().device("aysnd"), 0, data);
+ ay8910_data_w(machine().device("aysnd"), space, 0, data);
}
}
diff --git a/src/mame/drivers/dynadice.c b/src/mame/drivers/dynadice.c
index 2c070fb6d7d..0652e8a4b50 100644
--- a/src/mame/drivers/dynadice.c
+++ b/src/mame/drivers/dynadice.c
@@ -93,10 +93,10 @@ WRITE8_MEMBER(dynadice_state::sound_control_w)
*/
if ((data & 7) == 7)
- ay8910_address_w(device, 0, m_ay_data);
+ ay8910_address_w(device, space, 0, m_ay_data);
if ((data & 7) == 6)
- ay8910_data_w(device, 0, m_ay_data);
+ ay8910_data_w(device, space, 0, m_ay_data);
}
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index 2e5f32ecb4d..0d3d1994073 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -1636,8 +1636,8 @@ WRITE8_MEMBER(dynax_state::gekisha_8000_w)
case 0x8050: // CRT controller
case 0x8051: return;
- case 0x8070: ym2413_register_port_w(m_ymsnd, 0, data); return;
- case 0x8071: ym2413_data_port_w(m_ymsnd, 0, data); return;
+ case 0x8070: ym2413_register_port_w(m_ymsnd, space, 0, data); return;
+ case 0x8071: ym2413_data_port_w(m_ymsnd, space, 0, data); return;
case 0x8060: m_keyb = data; return;
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 78ceaf7815b..eb7736e82bb 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -566,7 +566,7 @@ WRITE8_MEMBER(equites_state::equites_8155_portb_w)
equites_update_dac(machine());
}
-static void equites_msm5232_gate( device_t *device, int state )
+static WRITE_LINE_DEVICE_HANDLER( equites_msm5232_gate )
{
}
@@ -1113,7 +1113,7 @@ GFXDECODE_END
static const msm5232_interface equites_5232intf =
{
{ 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6 }, // verified
- equites_msm5232_gate
+ DEVCB_LINE(equites_msm5232_gate)
};
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index cc581d83a22..be1cb3f0ed2 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -524,7 +524,7 @@ READ8_MEMBER(esripsys_state::tms5220_r)
{
/* TMS5220 core returns status bits in D7-D6 */
device_t *tms = machine().device("tms5220nl");
- UINT8 status = tms5220_status_r(tms, 0);
+ UINT8 status = tms5220_status_r(tms, space, 0);
status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5);
return (tms5220_readyq_r(tms) << 7) | (tms5220_intq_r(tms) << 6) | status;
@@ -540,12 +540,12 @@ WRITE8_MEMBER(esripsys_state::tms5220_w)
if (offset == 0)
{
m_tms_data = data;
- tms5220_data_w(tms, 0, m_tms_data);
+ tms5220_data_w(tms, space, 0, m_tms_data);
}
#if 0
if (offset == 1)
{
- tms5220_data_w(tms, 0, m_tms_data);
+ tms5220_data_w(tms, space, 0, m_tms_data);
}
#endif
}
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index 711903fcb4f..5040f670a84 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -115,20 +115,20 @@ WRITE8_MEMBER(ettrivia_state::b800_w)
/* special case to return the value written to 0xb000 */
/* does it reset the chips too ? */
case 0: break;
- case 0xc4: m_b000_ret = ay8910_r(machine().device("ay1"), 0); break;
- case 0x94: m_b000_ret = ay8910_r(machine().device("ay2"), 0); break;
- case 0x86: m_b000_ret = ay8910_r(machine().device("ay3"), 0); break;
+ case 0xc4: m_b000_ret = ay8910_r(machine().device("ay1"), space, 0); break;
+ case 0x94: m_b000_ret = ay8910_r(machine().device("ay2"), space, 0); break;
+ case 0x86: m_b000_ret = ay8910_r(machine().device("ay3"), space, 0); break;
case 0x80:
switch(m_b800_prev)
{
- case 0xe0: ay8910_address_w(machine().device("ay1"),0,m_b000_val); break;
- case 0x98: ay8910_address_w(machine().device("ay2"),0,m_b000_val); break;
- case 0x83: ay8910_address_w(machine().device("ay3"),0,m_b000_val); break;
+ case 0xe0: ay8910_address_w(machine().device("ay1"),space,0,m_b000_val); break;
+ case 0x98: ay8910_address_w(machine().device("ay2"),space,0,m_b000_val); break;
+ case 0x83: ay8910_address_w(machine().device("ay3"),space,0,m_b000_val); break;
- case 0xa0: ay8910_data_w(machine().device("ay1"),0,m_b000_val); break;
- case 0x88: ay8910_data_w(machine().device("ay2"),0,m_b000_val); break;
- case 0x81: ay8910_data_w(machine().device("ay3"),0,m_b000_val); break;
+ case 0xa0: ay8910_data_w(machine().device("ay1"),space,0,m_b000_val); break;
+ case 0x88: ay8910_data_w(machine().device("ay2"),space,0,m_b000_val); break;
+ case 0x81: ay8910_data_w(machine().device("ay3"),space,0,m_b000_val); break;
}
break;
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index d4e8d1c533b..286b0dcbcc9 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -207,7 +207,7 @@ WRITE8_MEMBER(exterm_state::ym2151_data_latch_w)
{
device_t *device = machine().device("ymsnd");
/* bit 7 of the sound control selects which port */
- ym2151_w(device, m_sound_control >> 7, data);
+ ym2151_w(device, space, m_sound_control >> 7, data);
}
diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c
index 2aa36998a79..f450071f0d1 100644
--- a/src/mame/drivers/famibox.c
+++ b/src/mame/drivers/famibox.c
@@ -180,19 +180,19 @@ WRITE8_MEMBER(famibox_state::sprite_dma_w)
READ8_MEMBER(famibox_state::psg_4015_r)
{
device_t *device = machine().device("nes");
- return nes_psg_r(device, 0x15);
+ return nes_psg_r(device, space, 0x15);
}
WRITE8_MEMBER(famibox_state::psg_4015_w)
{
device_t *device = machine().device("nes");
- nes_psg_w(device, 0x15, data);
+ nes_psg_w(device, space, 0x15, data);
}
WRITE8_MEMBER(famibox_state::psg_4017_w)
{
device_t *device = machine().device("nes");
- nes_psg_w(device, 0x17, data);
+ nes_psg_w(device, space, 0x17, data);
}
/******************************************************
diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c
index d028286b156..d3a46c5b006 100644
--- a/src/mame/drivers/fastlane.c
+++ b/src/mame/drivers/fastlane.c
@@ -21,9 +21,10 @@ static TIMER_DEVICE_CALLBACK( fastlane_scanline )
fastlane_state *state = timer.machine().driver_data<fastlane_state>();
int scanline = param;
- if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, 7) & 0x02) // vblank irq
+ address_space &space = state->generic_space();
+ if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x02) // vblank irq
state->m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
- else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, 7) & 0x01) // timer irq
+ else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x01) // timer irq
state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
@@ -32,7 +33,7 @@ WRITE8_MEMBER(fastlane_state::k007121_registers_w)
{
if (offset < 8)
- k007121_ctrl_w(m_k007121, offset, data);
+ k007121_ctrl_w(m_k007121, space, offset, data);
else /* scroll registers */
m_k007121_regs[offset] = data;
}
@@ -59,25 +60,25 @@ WRITE8_MEMBER(fastlane_state::fastlane_bankswitch_w)
READ8_MEMBER(fastlane_state::fastlane_k1_k007232_r)
{
device_t *device = machine().device("konami1");
- return k007232_r(device, offset ^ 1);
+ return k007232_r(device, space, offset ^ 1);
}
WRITE8_MEMBER(fastlane_state::fastlane_k1_k007232_w)
{
device_t *device = machine().device("konami1");
- k007232_w(device, offset ^ 1, data);
+ k007232_w(device, space, offset ^ 1, data);
}
READ8_MEMBER(fastlane_state::fastlane_k2_k007232_r)
{
device_t *device = machine().device("konami2");
- return k007232_r(device, offset ^ 1);
+ return k007232_r(device, space, offset ^ 1);
}
WRITE8_MEMBER(fastlane_state::fastlane_k2_k007232_w)
{
device_t *device = machine().device("konami2");
- k007232_w(device, offset ^ 1, data);
+ k007232_w(device, space, offset ^ 1, data);
}
static ADDRESS_MAP_START( fastlane_map, AS_PROGRAM, 8, fastlane_state )
AM_RANGE(0x0000, 0x005f) AM_RAM_WRITE(k007121_registers_w) AM_SHARE("k007121_regs") /* 007121 registers */
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index f29ee1d2a96..0b9373adfa4 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -137,14 +137,14 @@ WRITE8_MEMBER(fgoal_state::fgoal_row_w)
{
m_row = data;
- mb14241_shift_data_w(m_mb14241, 0, 0);
+ mb14241_shift_data_w(m_mb14241, space, 0, 0);
}
WRITE8_MEMBER(fgoal_state::fgoal_col_w)
{
m_col = data;
- mb14241_shift_count_w(m_mb14241, 0, data);
+ mb14241_shift_count_w(m_mb14241, space, 0, data);
}
READ8_MEMBER(fgoal_state::fgoal_address_hi_r)
@@ -159,14 +159,14 @@ READ8_MEMBER(fgoal_state::fgoal_address_lo_r)
READ8_MEMBER(fgoal_state::fgoal_shifter_r)
{
- UINT8 v = mb14241_shift_result_r(m_mb14241, 0);
+ UINT8 v = mb14241_shift_result_r(m_mb14241, space, 0);
return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0);
}
READ8_MEMBER(fgoal_state::fgoal_shifter_reverse_r)
{
- UINT8 v = mb14241_shift_result_r(m_mb14241, 0);
+ UINT8 v = mb14241_shift_result_r(m_mb14241, space, 0);
return BITSWAP8(v, 0, 1, 2, 3, 4, 5, 6, 7);
}
diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c
index ac0cd7fc88c..9c14c2e2fae 100644
--- a/src/mame/drivers/firetrk.c
+++ b/src/mame/drivers/firetrk.c
@@ -36,7 +36,7 @@ INPUT_CHANGED_MEMBER(firetrk_state::service_mode_switch_changed)
INPUT_CHANGED_MEMBER(firetrk_state::firetrk_horn_changed)
{
device_t *discrete = machine().device("discrete");
- discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval);
+ discrete_sound_w(discrete, generic_space(), FIRETRUCK_HORN_EN, newval);
}
@@ -90,7 +90,7 @@ WRITE8_MEMBER(firetrk_state::firetrk_output_w)
set_led_status(machine(), 3, !(data & 0x08));
/* BIT4 => ATTRACT */
- discrete_sound_w(discrete, FIRETRUCK_ATTRACT_EN, data & 0x10);
+ discrete_sound_w(discrete, space, FIRETRUCK_ATTRACT_EN, data & 0x10);
coin_lockout_w(machine(), 0, !(data & 0x10));
coin_lockout_w(machine(), 1, !(data & 0x10));
@@ -100,7 +100,7 @@ WRITE8_MEMBER(firetrk_state::firetrk_output_w)
/* BIT6 => UNUSED */
/* BIT7 => BELL OUT */
- discrete_sound_w(discrete, FIRETRUCK_BELL_EN, data & 0x80);
+ discrete_sound_w(discrete, space, FIRETRUCK_BELL_EN, data & 0x80);
}
@@ -112,7 +112,7 @@ WRITE8_MEMBER(firetrk_state::superbug_output_w)
set_led_status(machine(), 0, offset & 0x01);
/* BIT1 => ATTRACT */
- discrete_sound_w(discrete, SUPERBUG_ATTRACT_EN, offset & 0x02);
+ discrete_sound_w(discrete, space, SUPERBUG_ATTRACT_EN, offset & 0x02);
coin_lockout_w(machine(), 0, !(offset & 0x02));
coin_lockout_w(machine(), 1, !(offset & 0x02));
@@ -135,7 +135,7 @@ WRITE8_MEMBER(firetrk_state::montecar_output_1_w)
set_led_status(machine(), 1, !(data & 0x02));
/* BIT2 => ATTRACT */
- discrete_sound_w(discrete, MONTECAR_ATTRACT_INV, data & 0x04);
+ discrete_sound_w(discrete, space, MONTECAR_ATTRACT_INV, data & 0x04);
/* BIT3 => UNUSED */
/* BIT4 => UNUSED */
@@ -157,8 +157,8 @@ WRITE8_MEMBER(firetrk_state::montecar_output_2_w)
m_flash = data & 0x80;
- discrete_sound_w(discrete, MONTECAR_BEEPER_EN, data & 0x10);
- discrete_sound_w(discrete, MONTECAR_DRONE_LOUD_DATA, data & 0x0f);
+ discrete_sound_w(discrete, space, MONTECAR_BEEPER_EN, data & 0x10);
+ discrete_sound_w(discrete, space, MONTECAR_DRONE_LOUD_DATA, data & 0x0f);
}
diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c
index f152256a93e..bf4f45ccda8 100644
--- a/src/mame/drivers/flstory.c
+++ b/src/mame/drivers/flstory.c
@@ -997,7 +997,8 @@ static const ay8910_interface ay8910_config =
static const msm5232_interface msm5232_config =
{
- { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 } /* 1.0 uF capacitors (verified on real PCB) */
+ { 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6 }, /* 1.0 uF capacitors (verified on real PCB) */
+ DEVCB_NULL
};
diff --git a/src/mame/drivers/funkball.c b/src/mame/drivers/funkball.c
index 54813ac8ff5..592a40f011f 100644
--- a/src/mame/drivers/funkball.c
+++ b/src/mame/drivers/funkball.c
@@ -247,26 +247,26 @@ static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, in
READ32_MEMBER(funkball_state::ide_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(funkball_state::ide_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
}
READ32_MEMBER(funkball_state::fdc_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(funkball_state::fdc_w)
{
device_t *device = machine().device("ide");
//mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
- ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
}
#endif
@@ -337,13 +337,13 @@ WRITE8_MEMBER(funkball_state::at_page8_w)
READ8_MEMBER(funkball_state::at_dma8237_2_r)
{
device_t *device = machine().device("dma8237_2");
- return i8237_r(device, offset / 2);
+ return i8237_r(device, space, offset / 2);
}
WRITE8_MEMBER(funkball_state::at_dma8237_2_w)
{
device_t *device = machine().device("dma8237_2");
- i8237_w(device, offset / 2, data);
+ i8237_w(device, space, offset / 2, data);
}
WRITE_LINE_MEMBER(funkball_state::pc_dma_hrq_changed)
@@ -436,7 +436,7 @@ READ8_MEMBER(funkball_state::io20_r)
}
else
{
- r = pic8259_r(device, offset);
+ r = pic8259_r(device, space, offset);
}
return r;
}
@@ -456,7 +456,7 @@ WRITE8_MEMBER(funkball_state::io20_w)
}
else
{
- pic8259_w(device, offset, data);
+ pic8259_w(device, space, offset, data);
}
}
diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c
index b8f61914ab7..539eabff04c 100644
--- a/src/mame/drivers/fuukifg3.c
+++ b/src/mame/drivers/fuukifg3.c
@@ -283,11 +283,11 @@ WRITE8_MEMBER(fuuki32_state::snd_z80_w)
WRITE8_MEMBER(fuuki32_state::snd_ymf278b_w)
{
- ymf278b_w(machine().device("ymf1"), offset, data);
+ ymf278b_w(machine().device("ymf1"), space, offset, data);
// also write to ymf262
if (offset < 4)
- ymf262_w(machine().device("ymf2"), offset, data);
+ ymf262_w(machine().device("ymf2"), space, offset, data);
}
static ADDRESS_MAP_START( fuuki32_sound_map, AS_PROGRAM, 8, fuuki32_state )
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index 8a282e3c69c..e78d6e3c68c 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -267,7 +267,7 @@ WRITE32_MEMBER(gaelco3d_state::irq_ack32_w)
if (mem_mask == 0xffff0000)
irq_ack_w(space, offset, data, mem_mask >> 16);
else if (ACCESSING_BITS_0_7)
- gaelco_serial_tr_w(machine().device("serial"), 0, data & 0x01);
+ gaelco_serial_tr_w(machine().device("serial"), space, 0, data & 0x01);
else
logerror("%06X:irq_ack_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
@@ -290,7 +290,7 @@ READ16_MEMBER(gaelco3d_state::eeprom_data_r)
/* bit 0 is clock */
/* bit 1 active */
result &= ~GAELCOSER_EXT_STATUS_MASK;
- result |= gaelco_serial_status_r(machine().device("serial"), 0);
+ result |= gaelco_serial_status_r(machine().device("serial"), space, 0);
}
eeprom_device *eeprom = downcast<eeprom_device *>(device);
@@ -307,7 +307,7 @@ READ32_MEMBER(gaelco3d_state::eeprom_data32_r)
return (eeprom_data_r(space, 0, mem_mask >> 16) << 16) | 0xffff;
else if (ACCESSING_BITS_0_7)
{
- UINT8 data = gaelco_serial_data_r(machine().device("serial"),0);
+ UINT8 data = gaelco_serial_data_r(machine().device("serial"),space,0);
if (LOG)
logerror("%06X:read(%02X) = %08X & %08X\n", machine().device("maincpu")->safe_pc(), offset, data, mem_mask);
return data | 0xffffff00;
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 09e0f31e8b5..b4bb2018747 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -515,8 +515,8 @@ READ8_MEMBER(galaxian_state::konami_ay8910_r)
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), 0);
- if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), 0);
+ if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), space, 0);
+ if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), space, 0);
return result;
}
@@ -526,14 +526,14 @@ WRITE8_MEMBER(galaxian_state::konami_ay8910_w)
/* AV 4,5 ==> AY8910 #2 */
/* the decoding here is very simplistic, and you can address two simultaneously */
if (offset & 0x10)
- ay8910_address_w(machine().device("8910.1"), 0, data);
+ ay8910_address_w(machine().device("8910.1"), space, 0, data);
else if (offset & 0x20)
- ay8910_data_w(machine().device("8910.1"), 0, data);
+ ay8910_data_w(machine().device("8910.1"), space, 0, data);
/* AV6,7 ==> AY8910 #1 */
if (offset & 0x40)
- ay8910_address_w(machine().device("8910.0"), 0, data);
+ ay8910_address_w(machine().device("8910.0"), space, 0, data);
else if (offset & 0x80)
- ay8910_data_w(machine().device("8910.0"), 0, data);
+ ay8910_data_w(machine().device("8910.0"), space, 0, data);
}
@@ -604,7 +604,7 @@ WRITE8_MEMBER(galaxian_state::konami_sound_filter_w)
/* low bit goes to 0.22uF capacitor = 220000pF */
/* high bit goes to 0.047uF capacitor = 47000pF */
- discrete_sound_w(discrete, NODE(3 * which + chan + 11), bits);
+ discrete_sound_w(discrete, space, NODE(3 * which + chan + 11), bits);
}
}
@@ -906,7 +906,7 @@ READ8_MEMBER(galaxian_state::frogger_ay8910_r)
{
/* the decoding here is very simplistic */
UINT8 result = 0xff;
- if (offset & 0x40) result &= ay8910_r(machine().device("8910.0"), 0);
+ if (offset & 0x40) result &= ay8910_r(machine().device("8910.0"), space, 0);
return result;
}
@@ -916,9 +916,9 @@ WRITE8_MEMBER(galaxian_state::frogger_ay8910_w)
/* the decoding here is very simplistic */
/* AV6,7 ==> AY8910 #1 */
if (offset & 0x40)
- ay8910_data_w(machine().device("8910.0"), 0, data);
+ ay8910_data_w(machine().device("8910.0"), space, 0, data);
else if (offset & 0x80)
- ay8910_address_w(machine().device("8910.0"), 0, data);
+ ay8910_address_w(machine().device("8910.0"), space, 0, data);
}
@@ -985,9 +985,9 @@ READ8_MEMBER(galaxian_state::scorpion_ay8910_r)
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x08) result &= ay8910_r(machine().device("8910.2"), 0);
- if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), 0);
- if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), 0);
+ if (offset & 0x08) result &= ay8910_r(machine().device("8910.2"), space, 0);
+ if (offset & 0x20) result &= ay8910_r(machine().device("8910.1"), space, 0);
+ if (offset & 0x80) result &= ay8910_r(machine().device("8910.0"), space, 0);
return result;
}
@@ -995,12 +995,12 @@ READ8_MEMBER(galaxian_state::scorpion_ay8910_r)
WRITE8_MEMBER(galaxian_state::scorpion_ay8910_w)
{
/* the decoding here is very simplistic, and you can address all six simultaneously */
- if (offset & 0x04) ay8910_address_w(machine().device("8910.2"), 0, data);
- if (offset & 0x08) ay8910_data_w(machine().device("8910.2"), 0, data);
- if (offset & 0x10) ay8910_address_w(machine().device("8910.1"), 0, data);
- if (offset & 0x20) ay8910_data_w(machine().device("8910.1"), 0, data);
- if (offset & 0x40) ay8910_address_w(machine().device("8910.0"), 0, data);
- if (offset & 0x80) ay8910_data_w(machine().device("8910.0"), 0, data);
+ if (offset & 0x04) ay8910_address_w(machine().device("8910.2"), space, 0, data);
+ if (offset & 0x08) ay8910_data_w(machine().device("8910.2"), space, 0, data);
+ if (offset & 0x10) ay8910_address_w(machine().device("8910.1"), space, 0, data);
+ if (offset & 0x20) ay8910_data_w(machine().device("8910.1"), space, 0, data);
+ if (offset & 0x40) ay8910_address_w(machine().device("8910.0"), space, 0, data);
+ if (offset & 0x80) ay8910_data_w(machine().device("8910.0"), space, 0, data);
}
@@ -1115,7 +1115,7 @@ WRITE8_MEMBER(galaxian_state::zigzag_ay8910_w)
/* bit 0 = WRITE */
/* bit 1 = C/D */
if ((offset & 1) != 0)
- ay8910_data_address_w(machine().device("aysnd"), offset >> 1, m_zigzag_ay8910_latch);
+ ay8910_data_address_w(machine().device("aysnd"), space, offset >> 1, m_zigzag_ay8910_latch);
break;
case 0x100:
@@ -1208,21 +1208,21 @@ WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_cs_w)
WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_control_w)
{
if (!m_mshuttle_ay8910_cs)
- ay8910_address_w(machine().device("aysnd"), offset, data);
+ ay8910_address_w(machine().device("aysnd"), space, offset, data);
}
WRITE8_MEMBER(galaxian_state::mshuttle_ay8910_data_w)
{
if (!m_mshuttle_ay8910_cs)
- ay8910_data_w(machine().device("aysnd"), offset, data);
+ ay8910_data_w(machine().device("aysnd"), space, offset, data);
}
READ8_MEMBER(galaxian_state::mshuttle_ay8910_data_r)
{
if (!m_mshuttle_ay8910_cs)
- return ay8910_r(machine().device("aysnd"), offset);
+ return ay8910_r(machine().device("aysnd"), space, offset);
return 0xff;
}
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index bf300a82986..01d1c80019d 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -192,13 +192,13 @@ static SCREEN_UPDATE_IND16(gamecstl)
READ8_MEMBER(gamecstl_state::at_dma8237_2_r)
{
device_t *device = machine().device("dma8237_2");
- return i8237_r(device, offset / 2);
+ return i8237_r(device, space, offset / 2);
}
WRITE8_MEMBER(gamecstl_state::at_dma8237_2_w)
{
device_t *device = machine().device("dma8237_2");
- i8237_w(device, offset / 2, data);
+ i8237_w(device, space, offset / 2, data);
}
// Intel 82439TX System Controller (MXTC)
@@ -367,26 +367,26 @@ WRITE32_MEMBER(gamecstl_state::pnp_data_w)
READ32_MEMBER(gamecstl_state::ide_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(gamecstl_state::ide_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
}
READ32_MEMBER(gamecstl_state::fdc_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(gamecstl_state::fdc_w)
{
device_t *device = machine().device("ide");
//mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
- ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
}
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index 1361d38410a..6a53934fbfe 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -127,25 +127,25 @@ READ8_MEMBER(gbusters_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(gbusters_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index d315a68a638..523206fa7f1 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -557,7 +557,7 @@ device_t* s3c2410;
READ32_MEMBER(ghosteo_state::bballoon_speedup_r)
{
- UINT32 ret = s3c2410_lcd_r(s3c2410, offset+0x10/4, mem_mask);
+ UINT32 ret = s3c2410_lcd_r(s3c2410, space, offset+0x10/4, mem_mask);
int pc = space.device().safe_pc();
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index b46d7ae6c45..660119a410c 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -1272,11 +1272,11 @@ WRITE8_MEMBER(goldnpkr_state::wcfalcon_snd_w)
{
if (wcfalcon_flag == 0)
{
- ay8910_data_address_w(machine().device("ay8910"), 0, data);
+ ay8910_data_address_w(machine().device("ay8910"), space, 0, data);
}
else
{
- ay8910_data_address_w(machine().device("ay8910"), 1, data);
+ ay8910_data_address_w(machine().device("ay8910"), space, 1, data);
}
wcfalcon_flag = wcfalcon_flag ^ 1;
@@ -1361,8 +1361,8 @@ WRITE8_MEMBER(goldnpkr_state::sound_w)
logerror("Sound Data: %2x\n",data & 0x0f);
/* discrete sound is connected to PIA1, portA: bits 0-3 */
- discrete_sound_w(device, NODE_01, data >> 3 & 0x01);
- discrete_sound_w(device, NODE_10, data & 0x07);
+ discrete_sound_w(device, space, NODE_01, data >> 3 & 0x01);
+ discrete_sound_w(device, space, NODE_10, data & 0x07);
}
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index 9c9fb15217a..3e6180540cd 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -29,42 +29,42 @@
READ16_MEMBER(gradius3_state::k052109_halfword_r)
{
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE16_MEMBER(gradius3_state::k052109_halfword_w)
{
if (ACCESSING_BITS_0_7)
- k052109_w(m_k052109, offset, data & 0xff);
+ k052109_w(m_k052109, space, offset, data & 0xff);
/* is this a bug in the game or something else? */
if (!ACCESSING_BITS_0_7)
- k052109_w(m_k052109, offset, (data >> 8) & 0xff);
+ k052109_w(m_k052109, space, offset, (data >> 8) & 0xff);
// logerror("%06x half %04x = %04x\n",space.device().safe_pc(),offset,data);
}
READ16_MEMBER(gradius3_state::k051937_halfword_r)
{
- return k051937_r(m_k051960, offset);
+ return k051937_r(m_k051960, space, offset);
}
WRITE16_MEMBER(gradius3_state::k051937_halfword_w)
{
if (ACCESSING_BITS_0_7)
- k051937_w(m_k051960, offset, data & 0xff);
+ k051937_w(m_k051960, space, offset, data & 0xff);
}
READ16_MEMBER(gradius3_state::k051960_halfword_r)
{
- return k051960_r(m_k051960, offset);
+ return k051960_r(m_k051960, space, offset);
}
WRITE16_MEMBER(gradius3_state::k051960_halfword_w)
{
if (ACCESSING_BITS_0_7)
- k051960_w(m_k051960, offset, data & 0xff);
+ k051960_w(m_k051960, space, offset, data & 0xff);
}
WRITE16_MEMBER(gradius3_state::cpuA_ctrl_w)
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index 27630996797..f63cde578fa 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -305,18 +305,18 @@ WRITE8_MEMBER(grchamp_state::cpu1_outputs_w)
/* bit 2-4: ATTACK UP 1-3 */
/* bit 5-6: SIFT 1-2 */
/* bit 7: ENGINE CS */
- discrete_sound_w(discrete, GRCHAMP_ENGINE_CS_EN, data & 0x80);
- discrete_sound_w(discrete, GRCHAMP_SIFT_DATA, (data >> 5) & 0x03);
- discrete_sound_w(discrete, GRCHAMP_ATTACK_UP_DATA, (data >> 2) & 0x07);
- discrete_sound_w(discrete, GRCHAMP_IDLING_EN, data & 0x02);
- discrete_sound_w(discrete, GRCHAMP_FOG_EN, data & 0x01);
+ discrete_sound_w(discrete, space, GRCHAMP_ENGINE_CS_EN, data & 0x80);
+ discrete_sound_w(discrete, space, GRCHAMP_SIFT_DATA, (data >> 5) & 0x03);
+ discrete_sound_w(discrete, space, GRCHAMP_ATTACK_UP_DATA, (data >> 2) & 0x07);
+ discrete_sound_w(discrete, space, GRCHAMP_IDLING_EN, data & 0x02);
+ discrete_sound_w(discrete, space, GRCHAMP_FOG_EN, data & 0x01);
break;
case 0x0d: /* OUTD */
/* bit 0-3: ATTACK SPEED 1-4 */
/* bit 4-7: PLAYER SPEED 1-4 */
- discrete_sound_w(discrete, GRCHAMP_PLAYER_SPEED_DATA, (data >> 4) & 0x0f);
- discrete_sound_w(discrete, GRCHAMP_ATTACK_SPEED_DATA, data & 0x0f);
+ discrete_sound_w(discrete, space, GRCHAMP_PLAYER_SPEED_DATA, (data >> 4) & 0x0f);
+ discrete_sound_w(discrete, space, GRCHAMP_ATTACK_SPEED_DATA, data & 0x0f);
break;
default:
@@ -416,13 +416,13 @@ READ8_MEMBER(grchamp_state::main_to_sub_comm_r)
WRITE8_MEMBER(grchamp_state::grchamp_portA_0_w)
{
device_t *device = machine().device("discrete");
- discrete_sound_w(device, GRCHAMP_A_DATA, data);
+ discrete_sound_w(device, space, GRCHAMP_A_DATA, data);
}
WRITE8_MEMBER(grchamp_state::grchamp_portB_0_w)
{
device_t *device = machine().device("discrete");
- discrete_sound_w(device, GRCHAMP_B_DATA, 255-data);
+ discrete_sound_w(device, space, GRCHAMP_B_DATA, 255-data);
}
WRITE8_MEMBER(grchamp_state::grchamp_portA_2_w)
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index d28e1792065..f4534379ccb 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -293,13 +293,13 @@ WRITE8_MEMBER(gsword_state::gsword_nmi_set_w)
WRITE8_MEMBER(gsword_state::gsword_AY8910_control_port_0_w)
{
device_t *device = machine().device("ay1");
- ay8910_address_w(device,offset,data);
+ ay8910_address_w(device,space,offset,data);
m_fake8910_0 = data;
}
WRITE8_MEMBER(gsword_state::gsword_AY8910_control_port_1_w)
{
device_t *device = machine().device("ay2");
- ay8910_address_w(device,offset,data);
+ ay8910_address_w(device,space,offset,data);
m_fake8910_1 = data;
}
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 7ee53ac59bb..11d30c08207 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -286,38 +286,38 @@ static void voodoo_vblank_1(device_t *device, int param)
READ32_MEMBER(gticlub_state::gticlub_k001604_tile_r)
{
device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
- return k001604_tile_r(k001604, offset, mem_mask);
+ return k001604_tile_r(k001604, space, offset, mem_mask);
}
WRITE32_MEMBER(gticlub_state::gticlub_k001604_tile_w)
{
device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
- k001604_tile_w(k001604, offset, data, mem_mask);
+ k001604_tile_w(k001604, space, offset, data, mem_mask);
}
READ32_MEMBER(gticlub_state::gticlub_k001604_char_r)
{
device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
- return k001604_char_r(k001604, offset, mem_mask);
+ return k001604_char_r(k001604, space, offset, mem_mask);
}
WRITE32_MEMBER(gticlub_state::gticlub_k001604_char_w)
{
device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
- k001604_char_w(k001604, offset, data, mem_mask);
+ k001604_char_w(k001604, space, offset, data, mem_mask);
}
READ32_MEMBER(gticlub_state::gticlub_k001604_reg_r)
{
device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
- return k001604_reg_r(k001604, offset, mem_mask);
+ return k001604_reg_r(k001604, space, offset, mem_mask);
}
WRITE32_MEMBER(gticlub_state::gticlub_k001604_reg_w)
{
device_t *k001604 = machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
- k001604_reg_w(k001604, offset, data, mem_mask);
+ k001604_reg_w(k001604, space, offset, data, mem_mask);
}
diff --git a/src/mame/drivers/gyruss.c b/src/mame/drivers/gyruss.c
index 7c83b85c713..89bb0d6df9f 100644
--- a/src/mame/drivers/gyruss.c
+++ b/src/mame/drivers/gyruss.c
@@ -113,7 +113,7 @@ READ8_MEMBER(gyruss_state::gyruss_portA_r)
WRITE8_MEMBER(gyruss_state::gyruss_dac_w)
{
- discrete_sound_w(m_discrete, NODE(16), data);
+ discrete_sound_w(m_discrete, space, NODE(16), data);
}
WRITE8_MEMBER(gyruss_state::gyruss_irq_clear_w)
@@ -130,7 +130,8 @@ static void filter_w( device_t *device, int chip, int data )
{
/* low bit: 47000pF = 0.047uF */
/* high bit: 220000pF = 0.22uF */
- discrete_sound_w(device, NODE(3 * chip + i + 21), data & 3);
+ address_space &space = device->machine().driver_data()->generic_space();
+ discrete_sound_w(device, space, NODE(3 * chip + i + 21), data & 3);
data >>= 2;
}
}
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index 61eb4f9103b..5cd7d0cf8e7 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -266,7 +266,7 @@ WRITE16_MEMBER(highvdeo_state::tv_oki6376_w)
if (ACCESSING_BITS_0_7 && okidata != data)
{
okidata = data;
- okim6376_w(device, 0, data & ~0x80);
+ okim6376_w(device, space, 0, data & ~0x80);
okim6376_st_w (device, data & 0x80);
}
}
@@ -340,7 +340,7 @@ WRITE16_MEMBER(highvdeo_state::tv_ncf_oki6376_w)
static int okidata;
if (ACCESSING_BITS_0_7 && okidata != data) {
okidata = data;
- okim6376_w(device, 0, data );
+ okim6376_w(device, space, 0, data );
}
}
diff --git a/src/mame/drivers/hitme.c b/src/mame/drivers/hitme.c
index 8404cadf89a..05afa1f7f1b 100644
--- a/src/mame/drivers/hitme.c
+++ b/src/mame/drivers/hitme.c
@@ -194,16 +194,16 @@ WRITE8_MEMBER(hitme_state::output_port_0_w)
attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1));
m_timeout_time = machine().time() + duration;
- discrete_sound_w(device, HITME_DOWNCOUNT_VAL, data);
- discrete_sound_w(device, HITME_OUT0, 1);
+ discrete_sound_w(device, space, HITME_DOWNCOUNT_VAL, data);
+ discrete_sound_w(device, space, HITME_OUT0, 1);
}
WRITE8_MEMBER(hitme_state::output_port_1_w)
{
device_t *device = machine().device("discrete");
- discrete_sound_w(device, HITME_ENABLE_VAL, data);
- discrete_sound_w(device, HITME_OUT1, 1);
+ discrete_sound_w(device, space, HITME_ENABLE_VAL, data);
+ discrete_sound_w(device, space, HITME_OUT1, 1);
}
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index 2d541c13fb0..5f9bfb0b55f 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -359,10 +359,10 @@ WRITE8_MEMBER(homedata_state::reikaids_upd7807_portc_w)
coin_counter_w(machine(), 0, ~data & 0x80);
if (BIT(m_upd7807_portc, 5) && !BIT(data, 5)) /* write clock 1->0 */
- ym2203_w(m_ym, BIT(data, 3), m_upd7807_porta);
+ ym2203_w(m_ym, space, BIT(data, 3), m_upd7807_porta);
if (BIT(m_upd7807_portc, 4) && !BIT(data, 4)) /* read clock 1->0 */
- m_upd7807_porta = ym2203_r(m_ym, BIT(data, 3));
+ m_upd7807_porta = ym2203_r(m_ym, space, BIT(data, 3));
m_upd7807_portc = data;
}
diff --git a/src/mame/drivers/homerun.c b/src/mame/drivers/homerun.c
index 6558033d171..2d4b2494700 100644
--- a/src/mame/drivers/homerun.c
+++ b/src/mame/drivers/homerun.c
@@ -97,7 +97,7 @@ WRITE8_MEMBER(homerun_state::homerun_d7756_sample_w)
m_sample = data;
if (m_d7756 != NULL)
- upd7759_port_w(m_d7756, 0, data);
+ upd7759_port_w(m_d7756, space, 0, data);
}
static ADDRESS_MAP_START( homerun_memmap, AS_PROGRAM, 8, homerun_state )
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 310b6d1b171..2cde6e9a97e 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -377,38 +377,38 @@ public:
READ32_MEMBER(hornet_state::hornet_k037122_sram_r)
{
device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
- return k037122_sram_r(k037122, offset, mem_mask);
+ return k037122_sram_r(k037122, space, offset, mem_mask);
}
WRITE32_MEMBER(hornet_state::hornet_k037122_sram_w)
{
device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
- k037122_sram_w(k037122, offset, data, mem_mask);
+ k037122_sram_w(k037122, space, offset, data, mem_mask);
}
READ32_MEMBER(hornet_state::hornet_k037122_char_r)
{
device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
- return k037122_char_r(k037122, offset, mem_mask);
+ return k037122_char_r(k037122, space, offset, mem_mask);
}
WRITE32_MEMBER(hornet_state::hornet_k037122_char_w)
{
device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
- k037122_char_w(k037122, offset, data, mem_mask);
+ k037122_char_w(k037122, space, offset, data, mem_mask);
}
READ32_MEMBER(hornet_state::hornet_k037122_reg_r)
{
device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
- return k037122_reg_r(k037122, offset, mem_mask);
+ return k037122_reg_r(k037122, space, offset, mem_mask);
}
WRITE32_MEMBER(hornet_state::hornet_k037122_reg_w)
{
device_t *k037122 = machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
- k037122_reg_w(k037122, offset, data, mem_mask);
+ k037122_reg_w(k037122, space, offset, data, mem_mask);
}
static void voodoo_vblank_0(device_t *device, int param)
@@ -490,7 +490,7 @@ READ8_MEMBER(hornet_state::sysreg_r)
0x01 = ADDO (ADC DO)
*/
r = 0xf0 | (eeprom->read_bit() << 3);
- r |= adc1213x_do_r(adc12138, 0) | (adc1213x_eoc_r(adc12138, 0) << 2);
+ r |= adc1213x_do_r(adc12138, space, 0) | (adc1213x_eoc_r(adc12138, space, 0) << 2);
break;
case 4: /* I/O port 4 - DIP switches */
@@ -544,10 +544,10 @@ WRITE8_MEMBER(hornet_state::sysreg_w)
0x02 = ADDI (ADC DI)
0x01 = ADDSCLK (ADC SCLK)
*/
- adc1213x_cs_w(adc12138, 0, (data >> 3) & 0x1);
- adc1213x_conv_w(adc12138, 0, (data >> 2) & 0x1);
- adc1213x_di_w(adc12138, 0, (data >> 1) & 0x1);
- adc1213x_sclk_w(adc12138, 0, data & 0x1);
+ adc1213x_cs_w(adc12138, space, 0, (data >> 3) & 0x1);
+ adc1213x_conv_w(adc12138, space, 0, (data >> 2) & 0x1);
+ adc1213x_di_w(adc12138, space, 0, (data >> 1) & 0x1);
+ adc1213x_sclk_w(adc12138, space, 0, data & 0x1);
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
mame_printf_debug("System register 1 = %02X\n", data);
diff --git a/src/mame/drivers/icecold.c b/src/mame/drivers/icecold.c
index 379faecda20..dd9f1e58838 100644
--- a/src/mame/drivers/icecold.c
+++ b/src/mame/drivers/icecold.c
@@ -221,9 +221,9 @@ READ8_MEMBER( icecold_state::kbd_r )
WRITE8_MEMBER( icecold_state::snd_ctrl_w )
{
if (m_ay_ctrl & ~data & 0x04)
- ay8910_data_address_w(m_ay8910_0, m_ay_ctrl & 0x01, m_sound_latch);
+ ay8910_data_address_w(m_ay8910_0, space, m_ay_ctrl & 0x01, m_sound_latch);
if (m_ay_ctrl & ~data & 0x20)
- ay8910_data_address_w(m_ay8910_1, (m_ay_ctrl>>3) & 0x01, m_sound_latch);
+ ay8910_data_address_w(m_ay8910_1, space, (m_ay_ctrl>>3) & 0x01, m_sound_latch);
m_ay_ctrl = data;
}
@@ -236,9 +236,9 @@ WRITE8_MEMBER( icecold_state::ay_w )
READ8_MEMBER( icecold_state::ay_r )
{
if (m_ay_ctrl & 0x02)
- return ay8910_r(m_ay8910_0, 0);
+ return ay8910_r(m_ay8910_0, space, 0);
if (m_ay_ctrl & 0x10)
- return ay8910_r(m_ay8910_1, 0);
+ return ay8910_r(m_ay8910_1, space, 0);
return 0;
}
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index b1091cd85df..ae53cdb3aac 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -2461,9 +2461,9 @@ READ16_MEMBER(igs011_state::ics2115_word_r)
ics2115_device* ics2115 = machine().device<ics2115_device>("ics");
switch(offset)
{
- case 0: return ics2115_device::read(ics2115, (offs_t)0);
- case 1: return ics2115_device::read(ics2115, (offs_t)1);
- case 2: return (ics2115_device::read(ics2115, (offs_t)3) << 8) | ics2115_device::read(ics2115, (offs_t)2);
+ case 0: return ics2115_device::read(ics2115, space, (offs_t)0);
+ case 1: return ics2115_device::read(ics2115, space, (offs_t)1);
+ case 2: return (ics2115_device::read(ics2115, space, (offs_t)3) << 8) | ics2115_device::read(ics2115, space, (offs_t)2);
}
return 0xff;
}
@@ -2474,11 +2474,11 @@ WRITE16_MEMBER(igs011_state::ics2115_word_w)
switch(offset)
{
case 1:
- if (ACCESSING_BITS_0_7) ics2115_device::write(ics2115,1,data);
+ if (ACCESSING_BITS_0_7) ics2115_device::write(ics2115,space, 1,data);
break;
case 2:
- if (ACCESSING_BITS_0_7) ics2115_device::write(ics2115,2,data);
- if (ACCESSING_BITS_8_15) ics2115_device::write(ics2115,3,data>>8);
+ if (ACCESSING_BITS_0_7) ics2115_device::write(ics2115,space, 2,data);
+ if (ACCESSING_BITS_8_15) ics2115_device::write(ics2115,space, 3,data>>8);
break;
}
}
diff --git a/src/mame/drivers/ironhors.c b/src/mame/drivers/ironhors.c
index 87ce05ff80b..25378618c17 100644
--- a/src/mame/drivers/ironhors.c
+++ b/src/mame/drivers/ironhors.c
@@ -46,9 +46,9 @@ WRITE8_MEMBER(ironhors_state::ironhors_sh_irqtrigger_w)
WRITE8_MEMBER(ironhors_state::ironhors_filter_w)
{
device_t *device = machine().device("disc_ih");
- discrete_sound_w(device, NODE_11, (data & 0x04) >> 2);
- discrete_sound_w(device, NODE_12, (data & 0x02) >> 1);
- discrete_sound_w(device, NODE_13, (data & 0x01) >> 0);
+ discrete_sound_w(device, space, NODE_11, (data & 0x04) >> 2);
+ discrete_sound_w(device, space, NODE_12, (data & 0x02) >> 1);
+ discrete_sound_w(device, space, NODE_13, (data & 0x01) >> 0);
}
/*************************************
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 435de9d12ad..2724d5203e3 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -476,7 +476,7 @@ WRITE16_MEMBER(jpmimpct_state::upd7759_w)
device_t *device = machine().device("upd");
if (ACCESSING_BITS_0_7)
{
- upd7759_port_w(device, 0, data);
+ upd7759_port_w(device, space, 0, data);
upd7759_start_w(device, 0);
upd7759_start_w(device, 1);
}
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 134d3f8ee64..e91ac2601a9 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -316,7 +316,7 @@ WRITE16_MEMBER(jpmsys5_state::jpm_upd7759_w)
{
case 0:
{
- upd7759_port_w(device, 0, data & 0xff);
+ upd7759_port_w(device, space, 0, data & 0xff);
upd7759_start_w(device, 0);
upd7759_start_w(device, 1);
break;
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index b029ccd17aa..3363cc7d4fa 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -162,36 +162,36 @@ READ16_MEMBER(kaneko16_state::kaneko16_ay1_YM2149_r)
{
device_t *device = machine().device("ay1");
/* Each 2149 register is mapped to a different address */
- ay8910_address_w(device,0,offset);
- return ay8910_r(device,0);
+ ay8910_address_w(device,space,0,offset);
+ return ay8910_r(device,space,0);
}
WRITE16_MEMBER(kaneko16_state::kaneko16_ay1_YM2149_w)
{
device_t *device = machine().device("ay1");
/* Each 2149 register is mapped to a different address */
- ay8910_address_w(device,0,offset);
+ ay8910_address_w(device,space,0,offset);
/* The registers are mapped to odd addresses, except one! */
- if (ACCESSING_BITS_0_7) ay8910_data_w(device,0, data & 0xff);
- else ay8910_data_w(device,0,(data >> 8) & 0xff);
+ if (ACCESSING_BITS_0_7) ay8910_data_w(device,space,0, data & 0xff);
+ else ay8910_data_w(device,space,0,(data >> 8) & 0xff);
}
READ16_MEMBER(kaneko16_state::kaneko16_ay2_YM2149_r)
{
device_t *device = machine().device("ay2");
/* Each 2149 register is mapped to a different address */
- ay8910_address_w(device,0,offset);
- return ay8910_r(device,0);
+ ay8910_address_w(device,space,0,offset);
+ return ay8910_r(device,space,0);
}
WRITE16_MEMBER(kaneko16_state::kaneko16_ay2_YM2149_w)
{
device_t *device = machine().device("ay2");
/* Each 2149 register is mapped to a different address */
- ay8910_address_w(device,0,offset);
+ ay8910_address_w(device,space,0,offset);
/* The registers are mapped to odd addresses, except one! */
- if (ACCESSING_BITS_0_7) ay8910_data_w(device,0, data & 0xff);
- else ay8910_data_w(device,0,(data >> 8) & 0xff);
+ if (ACCESSING_BITS_0_7) ay8910_data_w(device,space,0, data & 0xff);
+ else ay8910_data_w(device,space,0,(data >> 8) & 0xff);
}
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index cebdf9b47b9..363e0af6ea2 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -304,28 +304,28 @@ static void ide_interrupt(device_t *device, int state)
READ32_MEMBER(kinst_state::kinst_ide_r)
{
device_t *device = machine().device("ide");
- return midway_ide_asic_r(device, offset / 2, mem_mask);
+ return midway_ide_asic_r(device, space, offset / 2, mem_mask);
}
WRITE32_MEMBER(kinst_state::kinst_ide_w)
{
device_t *device = machine().device("ide");
- midway_ide_asic_w(device, offset / 2, data, mem_mask);
+ midway_ide_asic_w(device, space, offset / 2, data, mem_mask);
}
READ32_MEMBER(kinst_state::kinst_ide_extra_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x3f6/4, 0x00ff0000) >> 16;
+ return ide_controller32_r(device, space, 0x3f6/4, 0x00ff0000) >> 16;
}
WRITE32_MEMBER(kinst_state::kinst_ide_extra_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x3f6/4, data << 16, 0x00ff0000);
+ ide_controller32_w(device, space, 0x3f6/4, data << 16, 0x00ff0000);
}
diff --git a/src/mame/drivers/kncljoe.c b/src/mame/drivers/kncljoe.c
index f1daa576106..d00b7297739 100644
--- a/src/mame/drivers/kncljoe.c
+++ b/src/mame/drivers/kncljoe.c
@@ -76,7 +76,7 @@ WRITE8_MEMBER(kncljoe_state::m6803_port2_w)
{
/* control or data port? */
if (m_port2 & 0x08)
- ay8910_data_address_w(device, m_port2 >> 2, m_port1);
+ ay8910_data_address_w(device, space, m_port2 >> 2, m_port1);
}
m_port2 = data;
}
@@ -86,7 +86,7 @@ READ8_MEMBER(kncljoe_state::m6803_port1_r)
device_t *device = machine().device("aysnd");
if (m_port2 & 0x08)
- return ay8910_r(device, 0);
+ return ay8910_r(device, space, 0);
return 0xff;
}
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index a76409503f1..98f1e005ae9 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -1484,25 +1484,25 @@ READ32_MEMBER(ksys573_state::ge765pwbba_r)
switch (offset)
{
case 0x26:
- upd4701_y_add(upd4701, 0, ioport("uPD4701_y")->read_safe(0), 0xffff);
- upd4701_switches_set(upd4701, 0, ioport("uPD4701_switches")->read_safe(0));
+ upd4701_y_add(upd4701, space, 0, ioport("uPD4701_y")->read_safe(0), 0xffff);
+ upd4701_switches_set(upd4701, space, 0, ioport("uPD4701_switches")->read_safe(0));
- upd4701_cs_w(upd4701, 0, 0);
- upd4701_xy_w(upd4701, 0, 1);
+ upd4701_cs_w(upd4701, space, 0, 0);
+ upd4701_xy_w(upd4701, space, 0, 1);
if (ACCESSING_BITS_0_7)
{
- upd4701_ul_w(upd4701, 0, 0);
- data |= upd4701_d_r(upd4701, 0, 0xffff) << 0;
+ upd4701_ul_w(upd4701, space, 0, 0);
+ data |= upd4701_d_r(upd4701, space, 0, 0xffff) << 0;
}
if (ACCESSING_BITS_16_23)
{
- upd4701_ul_w(upd4701, 0, 1);
- data |= upd4701_d_r(upd4701, 0, 0xffff) << 16;
+ upd4701_ul_w(upd4701, space, 0, 1);
+ data |= upd4701_d_r(upd4701, space, 0, 0xffff) << 16;
}
- upd4701_cs_w(upd4701, 0, 1);
+ upd4701_cs_w(upd4701, space, 0, 1);
break;
default:
@@ -1539,8 +1539,8 @@ WRITE32_MEMBER(ksys573_state::ge765pwbba_w)
case 0x28:
if (ACCESSING_BITS_0_7)
{
- upd4701_resety_w(upd4701, 0, 1);
- upd4701_resety_w(upd4701, 0, 0);
+ upd4701_resety_w(upd4701, space, 0, 1);
+ upd4701_resety_w(upd4701, space, 0, 0);
}
break;
diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c
index 4aaa94c4d1d..a6d35b2b019 100644
--- a/src/mame/drivers/labyrunr.c
+++ b/src/mame/drivers/labyrunr.c
@@ -19,14 +19,16 @@
static INTERRUPT_GEN( labyrunr_vblank_interrupt )
{
labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
- if (k007121_ctrlram_r(state->m_k007121, 7) & 0x02)
+ address_space &space = state->generic_space();
+ if (k007121_ctrlram_r(state->m_k007121, space, 7) & 0x02)
device->execute().set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
}
static INTERRUPT_GEN( labyrunr_timer_interrupt )
{
labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
- if (k007121_ctrlram_r(state->m_k007121, 7) & 0x01)
+ address_space &space = state->generic_space();
+ if (k007121_ctrlram_r(state->m_k007121, space, 7) & 0x01)
device->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/ladyfrog.c b/src/mame/drivers/ladyfrog.c
index cb0fdfb8b53..6d461e670bb 100644
--- a/src/mame/drivers/ladyfrog.c
+++ b/src/mame/drivers/ladyfrog.c
@@ -119,7 +119,8 @@ static const ay8910_interface ay8910_config =
static const msm5232_interface msm5232_config =
{
- { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }
+ { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 },
+ DEVCB_NULL
};
READ8_MEMBER(ladyfrog_state::snd_flag_r)
diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c
index 8fa0333d8cc..3fae707fc50 100644
--- a/src/mame/drivers/laserbat.c
+++ b/src/mame/drivers/laserbat.c
@@ -582,7 +582,7 @@ WRITE_LINE_MEMBER(laserbat_state::zaccaria_irq0b)
READ8_MEMBER(laserbat_state::zaccaria_port0a_r)
{
device_t *ay = (m_active_8910 == 0) ? m_ay1 : m_ay2;
- return ay8910_r(ay, 0);
+ return ay8910_r(ay, space, 0);
}
WRITE8_MEMBER(laserbat_state::zaccaria_port0a_w)
@@ -596,7 +596,7 @@ WRITE8_MEMBER(laserbat_state::zaccaria_port0b_w)
if ((m_last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
{
/* bit 0 goes to the 8910 #0 BC1 pin */
- ay8910_data_address_w(m_ay1, m_last_port0b >> 0, m_port0a);
+ ay8910_data_address_w(m_ay1, space, m_last_port0b >> 0, m_port0a);
}
else if ((m_last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
{
@@ -608,7 +608,7 @@ WRITE8_MEMBER(laserbat_state::zaccaria_port0b_w)
if ((m_last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
{
/* bit 2 goes to the 8910 #1 BC1 pin */
- ay8910_data_address_w(m_ay2, m_last_port0b >> 2, m_port0a);
+ ay8910_data_address_w(m_ay2, space, m_last_port0b >> 2, m_port0a);
}
else if ((m_last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
{
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index c14489aa6a9..17b2dc83ee2 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -266,7 +266,7 @@ READ8_MEMBER(lethal_state::le_4800_r)
case 0x4d:
case 0x4e:
case 0x4f:
- return k053244_r(m_k053244, offset - 0x40);
+ return k053244_r(m_k053244, space, offset - 0x40);
case 0x80:
case 0x81:
@@ -300,22 +300,22 @@ READ8_MEMBER(lethal_state::le_4800_r)
case 0x9d:
case 0x9e:
case 0x9f:
- return k054000_r(m_k054000, offset - 0x80);
+ return k054000_r(m_k054000, space, offset - 0x80);
case 0xca:
return sound_status_r(space, 0);
}
}
else if (offset < 0x1800)
- return k053245_r(m_k053244, (offset - 0x0800) & 0x07ff);
+ return k053245_r(m_k053244, space, (offset - 0x0800) & 0x07ff);
else if (offset < 0x2000)
- return k056832_ram_code_lo_r(m_k056832, offset - 0x1800);
+ return k056832_ram_code_lo_r(m_k056832, space, offset - 0x1800);
else if (offset < 0x2800)
- return k056832_ram_code_hi_r(m_k056832, offset - 0x2000);
+ return k056832_ram_code_hi_r(m_k056832, space, offset - 0x2000);
else if (offset < 0x3000)
- return k056832_ram_attr_lo_r(m_k056832, offset - 0x2800);
+ return k056832_ram_attr_lo_r(m_k056832, space, offset - 0x2800);
else // (offset < 0x3800)
- return k056832_ram_attr_hi_r(m_k056832, offset - 0x3000);
+ return k056832_ram_attr_hi_r(m_k056832, space, offset - 0x3000);
}
return 0;
@@ -358,7 +358,7 @@ WRITE8_MEMBER(lethal_state::le_4800_w)
case 0x4d:
case 0x4e:
case 0x4f:
- k053244_w(m_k053244, offset - 0x40, data);
+ k053244_w(m_k053244, space, offset - 0x40, data);
break;
case 0x80:
@@ -393,7 +393,7 @@ WRITE8_MEMBER(lethal_state::le_4800_w)
case 0x9d:
case 0x9e:
case 0x9f:
- k054000_w(m_k054000, offset - 0x80, data);
+ k054000_w(m_k054000, space, offset - 0x80, data);
break;
default:
@@ -402,15 +402,15 @@ WRITE8_MEMBER(lethal_state::le_4800_w)
}
}
else if (offset < 0x1800)
- k053245_w(m_k053244, (offset - 0x0800) & 0x07ff, data);
+ k053245_w(m_k053244, space, (offset - 0x0800) & 0x07ff, data);
else if (offset < 0x2000)
- k056832_ram_code_lo_w(m_k056832, offset - 0x1800, data);
+ k056832_ram_code_lo_w(m_k056832, space, offset - 0x1800, data);
else if (offset < 0x2800)
- k056832_ram_code_hi_w(m_k056832, offset - 0x2000, data);
+ k056832_ram_code_hi_w(m_k056832, space, offset - 0x2000, data);
else if (offset < 0x3000)
- k056832_ram_attr_lo_w(m_k056832, offset - 0x2800, data);
+ k056832_ram_attr_lo_w(m_k056832, space, offset - 0x2800, data);
else // (offset < 0x3800)
- k056832_ram_attr_hi_w(m_k056832, offset - 0x3000, data);
+ k056832_ram_attr_hi_w(m_k056832, space, offset - 0x3000, data);
}
}
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index bf5acbf1ad0..4370b0f4756 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -141,8 +141,8 @@ static WRITE8_DEVICE_HANDLER( ic8j2_output_changed )
/* written from /Q to A with slight delight */
LOG(("ic8j2: %d\n", data));
- ttl74123_a_w(device, 0, data);
- ttl74123_a_w(state->m_ic8j1, 0, data);
+ ttl74123_a_w(device, space, 0, data);
+ ttl74123_a_w(state->m_ic8j1, space, 0, data);
}
static const ttl74123_interface ic8j1_intf =
@@ -154,7 +154,7 @@ static const ttl74123_interface ic8j1_intf =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
- ic8j1_output_changed
+ DEVCB_HANDLER(ic8j1_output_changed)
};
static const ttl74123_interface ic8j2_intf =
@@ -166,7 +166,7 @@ static const ttl74123_interface ic8j2_intf =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
- ic8j2_output_changed
+ DEVCB_HANDLER(ic8j2_output_changed)
};
/*************************************
@@ -476,8 +476,8 @@ READ8_MEMBER(m10_state::m10_a700_r)
{
//LOG(("rd:%d\n",machine().primary_screen->vpos()));
LOG(("clear\n"));
- ttl74123_clear_w(m_ic8j1, 0, 0);
- ttl74123_clear_w(m_ic8j1, 0, 1);
+ ttl74123_clear_w(m_ic8j1, space, 0, 0);
+ ttl74123_clear_w(m_ic8j1, space, 0, 1);
return 0x00;
}
@@ -486,8 +486,8 @@ READ8_MEMBER(m10_state::m11_a700_r)
//LOG(("rd:%d\n",machine().primary_screen->vpos()));
//m_maincpu->set_input_line(0, CLEAR_LINE);
LOG(("clear\n"));
- ttl74123_clear_w(m_ic8j1, 0, 0);
- ttl74123_clear_w(m_ic8j1, 0, 1);
+ ttl74123_clear_w(m_ic8j1, space, 0, 0);
+ ttl74123_clear_w(m_ic8j1, space, 0, 1);
return 0x00;
}
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index 809e8f82eae..35a814678ef 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -390,13 +390,13 @@ WRITE8_MEMBER(m63_state::snddata_w)
{
if ((m_p2 & 0xf0) == 0xe0)
- ay8910_address_w(m_ay1, 0, offset);
+ ay8910_address_w(m_ay1, space, 0, offset);
else if ((m_p2 & 0xf0) == 0xa0)
- ay8910_data_w(m_ay1, 0, offset);
+ ay8910_data_w(m_ay1, space, 0, offset);
else if (m_ay2 != NULL && (m_p1 & 0xe0) == 0x60)
- ay8910_address_w(m_ay2, 0, offset);
+ ay8910_address_w(m_ay2, space, 0, offset);
else if (m_ay2 != NULL && (m_p1 & 0xe0) == 0x40)
- ay8910_data_w(m_ay2, 0, offset);
+ ay8910_data_w(m_ay2, space, 0, offset);
else if ((m_p2 & 0xf0) == 0x70 )
m_sound_status = offset;
}
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index 5e2a410d422..b5883f1466f 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -437,9 +437,10 @@ static int find_sample(int num)
static INTERRUPT_GEN(fake_nmi)
{
m72_state *state = device->machine().driver_data<m72_state>();
- int sample = m72_sample_r(state->m_audio,0);
+ address_space &space = state->generic_space();
+ int sample = m72_sample_r(state->m_audio,space,0);
if (sample)
- m72_sample_w(state->m_audio,0,sample);
+ m72_sample_w(state->m_audio,space,0,sample);
}
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 6f8c23c7baa..62cb9046c70 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -680,17 +680,19 @@ static const ym2151_interface dynablsb_ym2151_config =
static INTERRUPT_GEN( fake_nmi )
{
m90_state *state = device->machine().driver_data<m90_state>();
- int sample = m72_sample_r(state->m_audio,0);
+ address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
+ int sample = m72_sample_r(state->m_audio,space,0);
if (sample)
- m72_sample_w(state->m_audio,0,sample);
+ m72_sample_w(state->m_audio,space,0,sample);
}
static INTERRUPT_GEN( bomblord_fake_nmi )
{
m90_state *state = device->machine().driver_data<m90_state>();
- int sample = m72_sample_r(state->m_audio,0);
+ address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
+ int sample = m72_sample_r(state->m_audio,space,0);
if (sample != 0x80)
- m72_sample_w(state->m_audio,0,sample);
+ m72_sample_w(state->m_audio,space,0,sample);
}
static INTERRUPT_GEN( m90_interrupt )
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c
index 0164cf5fad2..54313345b40 100644
--- a/src/mame/drivers/madalien.c
+++ b/src/mame/drivers/madalien.c
@@ -69,12 +69,12 @@ READ8_MEMBER(madalien_state::madalien_sound_command_r)
WRITE8_MEMBER(madalien_state::madalien_portA_w)
{
device_t *device = machine().device("discrete");
- discrete_sound_w(device, MADALIEN_8910_PORTA, data);
+ discrete_sound_w(device, space, MADALIEN_8910_PORTA, data);
}
WRITE8_MEMBER(madalien_state::madalien_portB_w)
{
device_t *device = machine().device("discrete");
- discrete_sound_w(device, MADALIEN_8910_PORTB, data);
+ discrete_sound_w(device, space, MADALIEN_8910_PORTB, data);
}
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 8f03ea6d871..54d8ad36640 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -140,25 +140,25 @@ READ8_MEMBER(mainevt_state::k052109_051960_r)
if (k052109_get_rmrd_line(m_k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
- return k051937_r(m_k051960, offset - 0x3800);
+ return k051937_r(m_k051960, space, offset - 0x3800);
else if (offset < 0x3c00)
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
else
- return k051960_r(m_k051960, offset - 0x3c00);
+ return k051960_r(m_k051960, space, offset - 0x3c00);
}
else
- return k052109_r(m_k052109, offset);
+ return k052109_r(m_k052109, space, offset);
}
WRITE8_MEMBER(mainevt_state::k052109_051960_w)
{
if (offset >= 0x3800 && offset < 0x3808)
- k051937_w(m_k051960, offset - 0x3800, data);
+ k051937_w(m_k051960, space, offset - 0x3800, data);
else if (offset < 0x3c00)
- k052109_w(m_k052109, offset, data);
+ k052109_w(m_k052109, space, offset, data);
else
- k051960_w(m_k051960, offset - 0x3c00, data);
+ k051960_w(m_k051960, space, offset - 0x3c00, data);
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index 5211a43561a..9734a59c401 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -74,7 +74,7 @@
READ8_MEMBER(malzak_state::fake_VRLE_r)
{
- return (s2636_work_ram_r(m_s2636_0, 0xcb) & 0x3f) + (machine().primary_screen->vblank() * 0x40);
+ return (s2636_work_ram_r(m_s2636_0, space, 0xcb) & 0x3f) + (machine().primary_screen->vblank() * 0x40);
}
READ8_MEMBER(malzak_state::s2636_portA_r)
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index 80d674cd7f5..b9d007f744b 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -841,7 +841,7 @@ WRITE8_MEMBER(maygay1b_state::m1_latch_w)
WRITE8_MEMBER(maygay1b_state::latch_ch2_w)
{
device_t *msm6376 = machine().device("msm6376");
- okim6376_w(msm6376, 0, data&0x7f);
+ okim6376_w(msm6376, space, 0, data&0x7f);
okim6376_ch2_w(msm6376,data&0x80);
}
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index f77fd90aeba..0e7de1d2b21 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -651,7 +651,7 @@ WRITE8_MEMBER(mcr_state::dotron_op4_w)
*
*************************************/
-WRITE8_DEVICE_HANDLER( mcr_ipu_sio_transmit )
+WRITE16_DEVICE_HANDLER( mcr_ipu_sio_transmit )
{
logerror("ipu_sio_transmit: %02X\n", data);
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index aa90258a903..663da48974b 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -426,38 +426,38 @@ WRITE32_MEMBER(mediagx_state::disp_ctrl_w)
READ8_MEMBER(mediagx_state::at_dma8237_2_r)
{
device_t *device = machine().device("dma8237_2");
- return i8237_r(device, offset / 2);
+ return i8237_r(device, space, offset / 2);
}
WRITE8_MEMBER(mediagx_state::at_dma8237_2_w)
{
device_t *device = machine().device("dma8237_2");
- i8237_w(device, offset / 2, data);
+ i8237_w(device, space, offset / 2, data);
}
READ32_MEMBER(mediagx_state::ide_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(mediagx_state::ide_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
}
READ32_MEMBER(mediagx_state::fdc_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(mediagx_state::fdc_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
}
@@ -565,7 +565,7 @@ READ8_MEMBER(mediagx_state::io20_r)
}
else
{
- r = pic8259_r(device, offset);
+ r = pic8259_r(device, space, offset);
}
return r;
}
@@ -585,7 +585,7 @@ WRITE8_MEMBER(mediagx_state::io20_w)
}
else
{
- pic8259_w(device, offset, data);
+ pic8259_w(device, space, offset, data);
}
}
diff --git a/src/mame/drivers/mermaid.c b/src/mame/drivers/mermaid.c
index 8feb2212118..298dea03759 100644
--- a/src/mame/drivers/mermaid.c
+++ b/src/mame/drivers/mermaid.c
@@ -124,14 +124,14 @@ Stephh's notes (based on the games Z80 code and some tests) :
WRITE8_MEMBER(mermaid_state::mermaid_ay8910_write_port_w)
{
- if (m_ay8910_enable[0]) ay8910_data_w(m_ay1, offset, data);
- if (m_ay8910_enable[1]) ay8910_data_w(m_ay2, offset, data);
+ if (m_ay8910_enable[0]) ay8910_data_w(m_ay1, space, offset, data);
+ if (m_ay8910_enable[1]) ay8910_data_w(m_ay2, space, offset, data);
}
WRITE8_MEMBER(mermaid_state::mermaid_ay8910_control_port_w)
{
- if (m_ay8910_enable[0]) ay8910_address_w(m_ay1, offset, data);
- if (m_ay8910_enable[1]) ay8910_address_w(m_ay2, offset, data);
+ if (m_ay8910_enable[0]) ay8910_address_w(m_ay1, space, offset, data);
+ if (m_ay8910_enable[1]) ay8910_address_w(m_ay2, space, offset, data);
}
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index 69f3ee0a20a..aaa10d1a8cd 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -370,7 +370,7 @@ WRITE8_MEMBER(metro_state::metro_portb_w)
{
if (!BIT(data, 2))
{
- ym2413_w(m_ymsnd, BIT(data, 1), m_porta);
+ ym2413_w(m_ymsnd, space, BIT(data, 1), m_porta);
}
m_portb = data;
return;
@@ -412,13 +412,13 @@ WRITE8_MEMBER(metro_state::daitorid_portb_w)
if (!BIT(data, 2))
{
/* write */
- ym2151_w(m_ymsnd, BIT(data, 1), m_porta);
+ ym2151_w(m_ymsnd, space, BIT(data, 1), m_porta);
}
if (!BIT(data, 3))
{
/* read */
- m_porta = ym2151_r(m_ymsnd, BIT(data, 1));
+ m_porta = ym2151_r(m_ymsnd, space, BIT(data, 1));
}
m_portb = data;
diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c
index c02d431cdb3..04a8cef4808 100644
--- a/src/mame/drivers/mexico86.c
+++ b/src/mame/drivers/mexico86.c
@@ -66,7 +66,7 @@ PS4 J8635 PS4 J8541 PS4 J8648
READ8_MEMBER(mexico86_state::kiki_ym2203_r)
{
device_t *device = machine().device("ymsnd");
- UINT8 result = ym2203_r(device, offset);
+ UINT8 result = ym2203_r(device, space, offset);
if (offset == 0)
result &= 0x7f;
diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c
index 39fd77be878..a2e3c88d91c 100644
--- a/src/mame/drivers/midqslvr.c
+++ b/src/mame/drivers/midqslvr.c
@@ -396,26 +396,26 @@ WRITE32_MEMBER(midqslvr_state::bios_ram_w)
READ32_MEMBER(midqslvr_state::ide_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x1f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(midqslvr_state::ide_w)
{
device_t *device = machine().device("ide");
- ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x1f0/4 + offset, data, mem_mask);
}
READ32_MEMBER(midqslvr_state::fdc_r)
{
device_t *device = machine().device("ide");
- return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
+ return ide_controller32_r(device, space, 0x3f0/4 + offset, mem_mask);
}
WRITE32_MEMBER(midqslvr_state::fdc_w)
{
device_t *device = machine().device("ide");
//mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
- ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
+ ide_controller32_w(device, space, 0x3f0/4 + offset, data, mem_mask);
}
READ8_MEMBER(midqslvr_state::at_page8_r)
@@ -463,13 +463,13 @@ WRITE8_MEMBER(midqslvr_state::at_page8_w)
READ8_MEMBER(midqslvr_state::at_dma8237_2_r)
{
device_t *device = machine().device("dma8237_2");
- return i8237_r(device, offset / 2);
+ return i8237_r(device, space, offset / 2);
}
WRITE8_MEMBER(midqslvr_state::at_dma8237_2_w)
{
device_t *device = machine().device("dma8237_2");
- i8237_w(device, offset / 2, data);
+ i8237_w(device, space, offset / 2, data);
}
WRITE_LINE_MEMBER(midqslvr_state::pc_dma_hrq_changed)
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index b8e313373e3..488aaf3a913 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -158,7 +158,7 @@ WRITE32_MEMBER(midzeus_state::cmos_protect_w)
READ32_MEMBER(midzeus_state::zeus2_timekeeper_r)
{
device_t *device = machine().device("m48t35");
- return timekeeper_r(device, offset) | 0xffffff00;
+ return timekeeper_r(device, space, offset) | 0xffffff00;
}
@@ -166,7 +166,7 @@ WRITE32_MEMBER(midzeus_state::zeus2_timekeeper_w)
{
device_t *device = machine().device("m48t35");
if (bitlatch[2] && !cmos_protected)
- timekeeper_w(device, offset, data);
+ timekeeper_w(device, space, offset, data);
else
logerror("%s:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", machine().describe_context(), bitlatch[2], cmos_protected);
cmos_protected = TRUE;
diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c
index 0b6661765ca..8d04b8fa6b3 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -87,7 +87,8 @@ void miragemi_state::video_start()
static SCREEN_UPDATE_RGB32( mirage )
{
miragemi_state *state = screen.machine().driver_data<miragemi_state>();
- UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
+ address_space &space = screen.machine().driver_data()->generic_space();
+ UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, space, 0, 0xffff);
state->flip_screen_set(BIT(flip, 7));
diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c
index 561f3136d5e..6c1609cf94d 100644
--- a/src/mame/drivers/mirax.c
+++ b/src/mame/drivers/mirax.c
@@ -242,15 +242,15 @@ WRITE8_MEMBER(mirax_state::audio_w)
WRITE8_MEMBER(mirax_state::ay1_sel)
{
device_t *device = machine().device("ay1");
- ay8910_address_w(device,0,m_nAyCtrl);
- ay8910_data_w(device,0,data);
+ ay8910_address_w(device,space,0,m_nAyCtrl);
+ ay8910_data_w(device,space,0,data);
}
WRITE8_MEMBER(mirax_state::ay2_sel)
{
device_t *device = machine().device("ay2");
- ay8910_address_w(device,0,m_nAyCtrl);
- ay8910_data_w(device,0,data);
+ ay8910_address_w(device,space,0,m_nAyCtrl);
+ ay8910_data_w(device,space,0,data);
}
WRITE8_MEMBER(mirax_state::nmi_mask_w)
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index 86cdffa53bb..e03dd2b8af3 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -348,11 +348,11 @@ WRITE16_MEMBER(mlanding_state::ml_to_sound_w)
{
device_t *tc0140syt = machine().device("tc0140syt");
if (offset == 0)
- tc0140syt_port_w(tc0140syt, 0, data & 0xff);
+ tc0140syt_port_w(tc0140syt, space, 0, data & 0xff);
else if (offset == 1)
{
//machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- tc0140syt_comm_w(tc0140syt, 0, data & 0xff);
+ tc0140syt_comm_w(tc0140syt, space, 0, data & 0xff);
}
}
@@ -360,11 +360,11 @@ WRITE8_MEMBER(mlanding_state::ml_sound_to_main_w)
{
device_t *tc0140syt = machine().device("tc0140syt");
if (offset == 0)
- tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff);
+ tc0140syt_slave_port_w(tc0140syt, space, 0, data & 0xff);
else if (offset == 1)
{
//machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
- tc0140syt_slave_comm_w(tc0140syt, 0, data & 0xff);
+ tc0140syt_slave_comm_w(tc0140syt, space, 0, data & 0xff);
}
}
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index ae7c4403326..3aea59d6fb2 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -1014,7 +1014,7 @@ WRITE32_MEMBER(model2_state::model2_serial_w)
{
if (ACCESSING_BITS_0_7 && (offset == 0))
{
- scsp_midi_in(machine().device("scsp"), 0, data&0xff, 0);
+ scsp_midi_in(machine().device("scsp"), space, 0, data&0xff, 0);
// give the 68k time to notice
space.device().execute().spin_until_time(attotime::from_usec(40));
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 57ae44f10f1..6caefd77f25 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1638,7 +1638,7 @@ WRITE8_MEMBER(model3_state::model3_sound_w)
model3_set_irq_line(machine(), 0x40, CLEAR_LINE);
// send to the sound board
- scsp_midi_in(machine().device("scsp1"), 0, data, 0);
+ scsp_midi_in(machine().device("scsp1"), space, 0, data, 0);
if (m_sound_irq_enable)
{
diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c
index 2ce95e8706a..3687c8ebad2 100644
--- a/src/mame/drivers/mpu4hw.c
+++ b/src/mame/drivers/mpu4hw.c
@@ -1119,7 +1119,7 @@ BDIR BC1 |
*/
/* PSG function selected */
-static void update_ay(device_t *device)
+static void update_ay(device_t *device, address_space &space)
{
device_t *ay = device->machine().device("ay8913");
if (!ay) return;
@@ -1145,7 +1145,7 @@ static void update_ay(device_t *device)
{/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */
pia6821_device *pia_ic6 = device->machine().device<pia6821_device>("pia_ic6");
device_t *ay = device->machine().device("ay8913");
- ay8910_data_w(ay, 0, pia_ic6->a_output());
+ ay8910_data_w(ay, space, 0, pia_ic6->a_output());
LOG(("AY Chip Write \n"));
break;
}
@@ -1154,7 +1154,7 @@ static void update_ay(device_t *device)
The register will remain selected until another is chosen.*/
pia6821_device *pia_ic6 = device->machine().device<pia6821_device>("pia_ic6");
device_t *ay = device->machine().device("ay8913");
- ay8910_address_w(ay, 0, pia_ic6->a_output());
+ ay8910_address_w(ay, space, 0, pia_ic6->a_output());
LOG(("AY Chip Select \n"));
break;
}
@@ -1170,7 +1170,7 @@ static void update_ay(device_t *device)
WRITE_LINE_MEMBER(mpu4_state::pia_ic5_cb2_w)
{
device_t *device = machine().device("pia_ic5");
- update_ay(device);
+ update_ay(device, generic_space());
}
@@ -1229,7 +1229,7 @@ WRITE8_MEMBER(mpu4_state::pia_ic6_porta_w)
if (m_mod_number <4)
{
m_ay_data = data;
- update_ay(device);
+ update_ay(device, space);
}
}
@@ -1242,7 +1242,7 @@ WRITE_LINE_MEMBER(mpu4_state::pia_ic6_ca2_w)
{
if ( state ) m_ay8913_address |= 0x01;
else m_ay8913_address &= ~0x01;
- update_ay(device);
+ update_ay(device, generic_space());
}
}
@@ -1255,7 +1255,7 @@ WRITE_LINE_MEMBER(mpu4_state::pia_ic6_cb2_w)
{
if ( state ) m_ay8913_address |= 0x02;
else m_ay8913_address &= ~0x02;
- update_ay(device);
+ update_ay(device, generic_space());
}
}
@@ -1461,7 +1461,7 @@ WRITE8_MEMBER(mpu4_state::pia_gb_porta_w)
{
device_t *msm6376 = machine().device("msm6376");
LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", machine().describe_context(),data));
- okim6376_w(msm6376, 0, data);
+ okim6376_w(msm6376, space, 0, data);
}
WRITE8_MEMBER(mpu4_state::pia_gb_portb_w)
@@ -2292,7 +2292,7 @@ READ8_MEMBER(mpu4_state::bwb_characteriser_r)
WRITE8_MEMBER(mpu4_state::mpu4_ym2413_w)
{
device_t *ym = machine().device("ym2413");
- if (ym) ym2413_w(ym,offset,data);
+ if (ym) ym2413_w(ym,space,offset,data);
}
READ8_MEMBER(mpu4_state::mpu4_ym2413_r)
diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c
index 660a83f1245..c68d2f96cc8 100644
--- a/src/mame/drivers/msisaac.c
+++ b/src/mame/drivers/msisaac.c
@@ -424,7 +424,8 @@ GFXDECODE_END
static const msm5232_interface msm5232_config =
{
- { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 } /* 0.65 (???) uF capacitors (match the sample, not verified) */
+ { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }, /* 0.65 (???) uF capacitors (match the sample, not verified) */
+ DEVCB_NULL
};
diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c
index 4193f77fdd4..4845d5a5033 100644
--- a/src/mame/drivers/multfish.c
+++ b/src/mame/drivers/multfish.c
@@ -363,13 +363,13 @@ WRITE8_MEMBER(multfish_state::multfish_bank_w)
READ8_MEMBER(multfish_state::multfish_timekeeper_r)
{
device_t *device = machine().device("m48t35");
- return timekeeper_r(device, offset + 0x6000);
+ return timekeeper_r(device, space, offset + 0x6000);
}
WRITE8_MEMBER(multfish_state::multfish_timekeeper_w)
{
device_t *device = machine().device("m48t35");
- timekeeper_w(device, offset + 0x6000, data);
+ timekeeper_w(device, space, offset + 0x6000, data);
}
READ8_MEMBER(multfish_state::bankedram_r)
@@ -377,7 +377,7 @@ READ8_MEMBER(multfish_state::bankedram_r)
if ((m_rambk & 0x80) == 0x00)
{
- return timekeeper_r(machine().device("m48t35"), offset + 0x2000*(m_rambk & 0x03));
+ return timekeeper_r(machine().device("m48t35"), space, offset + 0x2000*(m_rambk & 0x03));
}
else
{
@@ -391,7 +391,7 @@ WRITE8_MEMBER(multfish_state::bankedram_w)
if ((m_rambk & 0x80) == 0x00)
{
- timekeeper_w(machine().device("m48t35"), offset + 0x2000*(m_rambk & 0x03), data);
+ timekeeper_w(machine().device("m48t35"), space, offset + 0x2000*(m_rambk & 0x03), data);
}
else
{
@@ -1131,8 +1131,8 @@ MACHINE_RESET_MEMBER(multfish_state,island2a)
multfish_state::machine_reset();
// this set needs preprogrammed data in timekeeper
- timekeeper_w(machine().device("m48t35"), 0x2003 , 0x01);
- timekeeper_w(machine().device("m48t35"), 0x4003 , 0x02);
+ timekeeper_w(machine().device("m48t35"), generic_space(), 0x2003 , 0x01);
+ timekeeper_w(machine().device("m48t35"), generic_space(), 0x4003 , 0x02);
}
static MACHINE_CONFIG_DERIVED( island2a, multfish )
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 68c3e376f04..4379573c253 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -242,19 +242,19 @@ WRITE8_MEMBER(multigam_state::sprite_dma_w)
READ8_MEMBER(multigam_state::psg_4015_r)
{
device_t *device = machine().device("nes");
- return nes_psg_r(device, 0x15);
+ return nes_psg_r(device, space, 0x15);
}
WRITE8_MEMBER(multigam_state::psg_4015_w)
{
device_t *device = machine().device("nes");
- nes_psg_w(device, 0x15, data);
+ nes_psg_w(device, space, 0x15, data);
}
WRITE8_MEMBER(multigam_state::psg_4017_w)
{
device_t *device = machine().device("nes");
- nes_psg_w(device, 0x17, data);
+ nes_psg_w(device, space, 0x17, data);
}
/******************************************************
diff --git a/src/mame/drivers/munchmo.c b/src/mame/drivers/munchmo.c
index fa0f3a6b9ac..bc233fdb25a 100644
--- a/src/mame/drivers/munchmo.c
+++ b/src/mame/drivers/munchmo.c
@@ -74,14 +74,14 @@ WRITE8_MEMBER(munchmo_state::sound_nmi_ack_w)
READ8_MEMBER(munchmo_state::munchmo_ay1reset_r)
{
device_t *device = machine().device("ay1");
- ay8910_reset_w(device,0,0);
+ ay8910_reset_w(device,space,0,0);
return 0;
}
READ8_MEMBER(munchmo_state::munchmo_ay2reset_r)
{
device_t *device = machine().device("ay2");
- ay8910_reset_w(device,0,0);
+ ay8910_reset_w(device,space,0,0);
return 0;
}
/*************************************
diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c
index e4fdd78df28..c40d5ff3276 100644
--- a/src/mame/drivers/mw8080bw.c
+++ b/src/mame/drivers/mw8080bw.c
@@ -168,7 +168,7 @@
READ8_MEMBER(mw8080bw_state::mw8080bw_shift_result_rev_r)
{
- UINT8 ret = mb14241_shift_result_r(m_mb14241, 0);
+ UINT8 ret = mb14241_shift_result_r(m_mb14241, space, 0);
return BITSWAP8(ret,0,1,2,3,4,5,6,7);
}
@@ -184,7 +184,7 @@ READ8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_result_r)
}
else
{
- ret = mb14241_shift_result_r(m_mb14241, 0);
+ ret = mb14241_shift_result_r(m_mb14241, space, 0);
}
return ret;
@@ -192,7 +192,7 @@ READ8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_result_r)
WRITE8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_count_w)
{
- mb14241_shift_count_w(m_mb14241, offset, data);
+ mb14241_shift_count_w(m_mb14241, space, offset, data);
m_rev_shift_res = data & 0x08;
}
@@ -425,10 +425,10 @@ WRITE8_MEMBER(mw8080bw_state::gunfight_io_w)
gunfight_audio_w(space, 0, data);
if (offset & 0x02)
- mb14241_shift_count_w(m_mb14241, 0, data);
+ mb14241_shift_count_w(m_mb14241, space, 0, data);
if (offset & 0x04)
- mb14241_shift_data_w(m_mb14241, 0, data);
+ mb14241_shift_data_w(m_mb14241, space, 0, data);
}
@@ -618,13 +618,13 @@ WRITE8_MEMBER(mw8080bw_state::tornbase_io_w)
{
if (offset & 0x01)
- tornbase_audio_w(machine().device("discrete"), 0, data);
+ tornbase_audio_w(machine().device("discrete"), space, 0, data);
if (offset & 0x02)
- mb14241_shift_count_w(m_mb14241, 0, data);
+ mb14241_shift_count_w(m_mb14241, space, 0, data);
if (offset & 0x04)
- mb14241_shift_data_w(m_mb14241, 0, data);
+ mb14241_shift_data_w(m_mb14241, space, 0, data);
}
@@ -1070,7 +1070,7 @@ MACHINE_CONFIG_END
WRITE8_MEMBER(mw8080bw_state::checkmat_io_w)
{
- if (offset & 0x01) checkmat_audio_w(m_discrete, 0, data);
+ if (offset & 0x01) checkmat_audio_w(m_discrete, space, 0, data);
if (offset & 0x02) watchdog_reset_w(space, 0, data);
}
@@ -2165,13 +2165,13 @@ WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w)
watchdog_reset_w(space, 0, data); /* - - - - - 0 1 0 */
else if ((offset & 0x5f) == 0x01)
- spcenctr_audio_1_w(m_discrete, 0, data); /* - 0 - 0 0 0 0 1 */
+ spcenctr_audio_1_w(m_discrete, space, 0, data); /* - 0 - 0 0 0 0 1 */
else if ((offset & 0x5f) == 0x09)
- spcenctr_audio_2_w(m_discrete, 0, data); /* - 0 - 0 1 0 0 1 */
+ spcenctr_audio_2_w(m_discrete, space, 0, data); /* - 0 - 0 1 0 0 1 */
else if ((offset & 0x5f) == 0x11)
- spcenctr_audio_3_w(m_discrete, 0, data); /* - 0 - 1 0 0 0 1 */
+ spcenctr_audio_3_w(m_discrete, space, 0, data); /* - 0 - 1 0 0 0 1 */
else if ((offset & 0x07) == 0x03)
{ /* - - - - - 0 1 1 */
@@ -2381,7 +2381,7 @@ READ8_MEMBER(mw8080bw_state::bowler_shift_result_r)
anything unusual on the schematics that would cause
the bits to flip */
- return ~mb14241_shift_result_r(m_mb14241, 0);
+ return ~mb14241_shift_result_r(m_mb14241, space, 0);
}
WRITE8_MEMBER(mw8080bw_state::bowler_lights_1_w)
diff --git a/src/mame/drivers/mystston.c b/src/mame/drivers/mystston.c
index 31605d71d8a..8e3c29ae5b9 100644
--- a/src/mame/drivers/mystston.c
+++ b/src/mame/drivers/mystston.c
@@ -77,14 +77,14 @@ WRITE8_MEMBER(mystston_state::mystston_ay8910_select_w)
if (((*m_ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00))
{
/* bit 4 goes to the 8910 #0 BC1 pin */
- ay8910_data_address_w(machine().device("ay1"), *m_ay8910_select >> 4, *m_ay8910_data);
+ ay8910_data_address_w(machine().device("ay1"), space, *m_ay8910_select >> 4, *m_ay8910_data);
}
/* bit 7 goes to 8910 #1 BDIR pin */
if (((*m_ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00))
{
/* bit 6 goes to the 8910 #1 BC1 pin */
- ay8910_data_address_w(machine().device("ay2"), *m_ay8910_select >> 6, *m_ay8910_data);
+ ay8910_data_address_w(machine().device("ay2"), space, *m_ay8910_select >> 6, *m_ay8910_data);
}
*m_ay8910_select = data;
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index f3833e4a1c2..32d60b5f39f 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -806,7 +806,7 @@ READ16_MEMBER(namcona1_state::snd_r)
{
device_t *device = machine().device("c140");
/* can't use DEVREADWRITE8 for this because it is opposite endianness to the CPU for some reason */
- return c140_r(device,offset*2+1) | c140_r(device,offset*2)<<8;
+ return c140_r(device,space,offset*2+1) | c140_r(device,space,offset*2)<<8;
}
WRITE16_MEMBER(namcona1_state::snd_w)
@@ -815,12 +815,12 @@ WRITE16_MEMBER(namcona1_state::snd_w)
/* can't use DEVREADWRITE8 for this because it is opposite endianness to the CPU for some reason */
if (ACCESSING_BITS_0_7)
{
- c140_w(device,(offset*2)+1, data);
+ c140_w(device,space,(offset*2)+1, data);
}
if (ACCESSING_BITS_8_15)
{
- c140_w(device,(offset*2), data>>8);
+ c140_w(device,space,(offset*2), data>>8);
}
}
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index ab0a0e129c5..0ade1d44ffc 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -306,7 +306,7 @@ WRITE8_MEMBER(namcos86_state::cus115_w)
case 1:
case 2:
case 3:
- namco_63701x_w(machine().device("namco2"), (offset & 0x1e00) >> 9,data);
+ namco_63701x_w(machine().device("namco2"), space, (offset & 0x1e00) >> 9,data);
break;
case 4:
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 4522d88af44..00617df2112 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -426,7 +426,7 @@ WRITE16_MEMBER(neogeo_state::io_control_w)
case 0x00: select_controller(machine(), data & 0x00ff); break;
case 0x18: set_output_latch(machine(), data & 0x00ff); break;
case 0x20: set_output_data(machine(), data & 0x00ff); break;
- case 0x28: upd4990a_control_16_w(m_upd4990a, 0, data, mem_mask); break;
+ case 0x28: upd4990a_control_16_w(m_upd4990a, space, 0, data, mem_mask); break;
// case 0x30: break; // coin counters
// case 0x31: break; // coin counters
// case 0x32: break; // coin lockout
@@ -476,7 +476,7 @@ READ16_MEMBER(neogeo_state::neogeo_unmapped_r)
CUSTOM_INPUT_MEMBER(neogeo_state::get_calendar_status)
{
- return (upd4990a_databit_r(m_upd4990a, 0) << 1) | upd4990a_testbit_r(m_upd4990a, 0);
+ return (upd4990a_databit_r(m_upd4990a, generic_space(), 0) << 1) | upd4990a_testbit_r(m_upd4990a, generic_space(), 0);
}
diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c
index 655921aeb00..6e0392789b7 100644
--- a/src/mame/drivers/neoprint.c
+++ b/src/mame/drivers/neoprint.c
@@ -136,12 +136,12 @@ READ16_MEMBER(neoprint_state::neoprint_calendar_r)
//if(space.device().safe_pc() != 0x4b38 )//&& space.device().safe_pc() != 0x5f86 && space.device().safe_pc() != 0x5f90)
// printf("%08x\n",space.device().safe_pc());
- return (upd4990a_databit_r(machine().device("upd4990a"), 0) << 15);
+ return (upd4990a_databit_r(machine().device("upd4990a"), space, 0) << 15);
}
WRITE16_MEMBER(neoprint_state::neoprint_calendar_w)
{
- upd4990a_control_16_w(machine().device("upd4990a"), 0, ((data >> 8) & 7), mem_mask);
+ upd4990a_control_16_w(machine().device("upd4990a"), space, 0, ((data >> 8) & 7), mem_mask);
}
READ8_MEMBER(neoprint_state::neoprint_unk_r)
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 70bf258efac..62c138b5a0b 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -369,9 +369,9 @@ WRITE16_MEMBER(ninjaw_state::ninjaw_sound_w)
{
if (offset == 0)
- tc0140syt_port_w(m_tc0140syt, 0, data & 0xff);
+ tc0140syt_port_w(m_tc0140syt, space, 0, data & 0xff);
else if (offset == 1)
- tc0140syt_comm_w(m_tc0140syt, 0, data & 0xff);
+ tc0140syt_comm_w(m_tc0140syt, space, 0, data & 0xff);
#ifdef MAME_DEBUG
if (data & 0xff00)
@@ -383,7 +383,7 @@ READ16_MEMBER(ninjaw_state::ninjaw_sound_r)
{
if (offset == 1)
- return ((tc0140syt_comm_r(m_tc0140syt, 0) & 0xff));
+ return ((tc0140syt_comm_r(m_tc0140syt, space, 0) & 0xff));
else
return 0;
}
@@ -413,9 +413,9 @@ WRITE8_MEMBER(ninjaw_state::ninjaw_pancontrol)
WRITE16_MEMBER(ninjaw_state::tc0100scn_triple_screen_w)
{
- tc0100scn_word_w(m_tc0100scn_1, offset, data, mem_mask);
- tc0100scn_word_w(m_tc0100scn_2, offset, data, mem_mask);
- tc0100scn_word_w(m_tc0100scn_3, offset, data, mem_mask);
+ tc0100scn_word_w(m_tc0100scn_1, space, offset, data, mem_mask);
+ tc0100scn_word_w(m_tc0100scn_2, space, offset, data, mem_mask);
+ tc0100scn_word_w(m_tc0100scn_3, space, offset, data, mem_mask);
}
/***********************************************************
diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c
index 4fb4f068330..1c2de5cc52c 100644
--- a/src/mame/drivers/norautp.c
+++ b/src/mame/drivers/norautp.c
@@ -669,8 +669,8 @@ WRITE8_MEMBER(norautp_state::soundlamps_w)
output_set_lamp_value(9, (data >> 1) & 1); /* BET / COLLECT lamp */
/* the 4 MSB are for discrete sound */
- discrete_sound_w(discrete, NORAUTP_SND_EN, (data >> 7) & 0x01);
- discrete_sound_w(discrete, NORAUTP_FREQ_DATA, (data >> 4) & 0x07);
+ discrete_sound_w(discrete, space, NORAUTP_SND_EN, (data >> 7) & 0x01);
+ discrete_sound_w(discrete, space, NORAUTP_FREQ_DATA, (data >> 4) & 0x07);
// popmessage("sound bits 4-5-6-7: %02x, %02x, %02x, %02x", ((data >> 4) & 0x01), ((data >> 5) & 0x01), ((data >> 6) & 0x01), ((data >> 7) & 0x01));
}
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index c5bec5f234b..420f1cd9c6f 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -354,12 +354,12 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( spc_ram_100_r )
{
- return spc_ram_r(device, offset + 0x100);
+ return spc_ram_r(device, space, offset + 0x100);
}
static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
{
- spc_ram_w(device, offset + 0x100, data);
+ spc_ram_w(device, space, offset + 0x100, data);
}
static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, nss_state )
@@ -465,13 +465,13 @@ READ8_MEMBER(nss_state::nss_prot_r)
if (m_cart_sel == 0)
{
- rp5h01_enable_w(m_rp5h01, 0, 0);
- data |= ((~rp5h01_counter_r(m_rp5h01, 0)) << 4) & 0x10; /* D4 */
- data |= ((rp5h01_data_r(m_rp5h01, 0)) << 3) & 0x08; /* D3 */
- rp5h01_enable_w(m_rp5h01, 0, 1);
+ rp5h01_enable_w(m_rp5h01, space, 0, 0);
+ data |= ((~rp5h01_counter_r(m_rp5h01, space, 0)) << 4) & 0x10; /* D4 */
+ data |= ((rp5h01_data_r(m_rp5h01, space, 0)) << 3) & 0x08; /* D3 */
+ rp5h01_enable_w(m_rp5h01, space, 0, 1);
}
else
- rp5h01_enable_w(m_rp5h01, 0, 1);
+ rp5h01_enable_w(m_rp5h01, space, 0, 1);
return data;
}
@@ -480,14 +480,14 @@ WRITE8_MEMBER(nss_state::nss_prot_w)
{
if (m_cart_sel == 0)
{
- rp5h01_enable_w(m_rp5h01, 0, 0);
- rp5h01_test_w(m_rp5h01, 0, data & 0x10); /* D4 */
- rp5h01_clock_w(m_rp5h01, 0, data & 0x08); /* D3 */
- rp5h01_cs_w(m_rp5h01, 0, ~data & 0x01);
- rp5h01_enable_w(m_rp5h01, 0, 1);
+ rp5h01_enable_w(m_rp5h01, space, 0, 0);
+ rp5h01_test_w(m_rp5h01, space, 0, data & 0x10); /* D4 */
+ rp5h01_clock_w(m_rp5h01, space, 0, data & 0x08); /* D3 */
+ rp5h01_cs_w(m_rp5h01, space, 0, ~data & 0x01);
+ rp5h01_enable_w(m_rp5h01, space, 0, 1);
}
else
- rp5h01_enable_w(m_rp5h01, 0, 1);
+ rp5h01_enable_w(m_rp5h01, space, 0, 1);
ioport("EEPROMOUT")->write(data, 0xff);
}
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index b95173afc30..25eb08ad126 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -315,7 +315,7 @@ READ32_MEMBER(nwktr_state::sysreg_r)
}
if (ACCESSING_BITS_0_7)
{
- r |= adc1213x_do_r(adc12138, 0) | (adc1213x_eoc_r(adc12138, 0) << 2);
+ r |= adc1213x_do_r(adc12138, space, 0) | (adc1213x_eoc_r(adc12138, space, 0) << 2);
}
}
else if (offset == 1)
@@ -352,10 +352,10 @@ WRITE32_MEMBER(nwktr_state::sysreg_w)
int di = (data >> 25) & 0x1;
int sclk = (data >> 24) & 0x1;
- adc1213x_cs_w(adc12138, 0, cs);
- adc1213x_conv_w(adc12138, 0, conv);
- adc1213x_di_w(adc12138, 0, di);
- adc1213x_sclk_w(adc12138, 0, sclk);
+ adc1213x_cs_w(adc12138, space, 0, cs);
+ adc1213x_conv_w(adc12138, space, 0, conv);
+ adc1213x_di_w(adc12138, space, 0, di);
+ adc1213x_sclk_w(adc12138, space, 0, sclk);
}
if (ACCESSING_BITS_0_7)
{
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index 7a17fad9f2d..b1b9e6ae520 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -318,7 +318,8 @@ static const ay8910_interface ay8910_config =
static const msm5232_interface msm5232_config =
{
- { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 } /* 0.65 (???) uF capacitors (match the sample, not verified) */
+ { 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6, 0.65e-6 }, /* 0.65 (???) uF capacitors (match the sample, not verified) */
+ DEVCB_NULL
};
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index be9358acd3b..edf9e583e88 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -277,7 +277,7 @@ static const ttl74123_interface ic48_1_config =