summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-09-17 08:22:16 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-09-17 08:22:16 +0000
commit3cce7e019e095296b5ce2bb45d19b1209bed961d (patch)
tree4fa76260ac2dee5878fbba70d759ba6a1d4d76bf
parent22b4739aded17790b3f1bf31b9da8ff9e6a0860c (diff)
Memory handler normalization, part 2. Change legacy
read/write handlers to take an address_space & instead of an address_space *. Also update pretty much all other functions to take a reference where appropriate. [Aaron Giles]
-rw-r--r--src/emu/cpu/dsp56k/dsp56mem.c8
-rw-r--r--src/emu/cpu/g65816/g65816.c20
-rw-r--r--src/emu/cpu/g65816/g65816op.h2
-rw-r--r--src/emu/cpu/h6280/h6280.c8
-rw-r--r--src/emu/cpu/h83002/h8_16.c28
-rw-r--r--src/emu/cpu/h83002/h8_8.c4
-rw-r--r--src/emu/cpu/lh5801/5801tbl.c86
-rw-r--r--src/emu/cpu/m37710/m37710.c4
-rw-r--r--src/emu/cpu/m6502/m4510.c6
-rw-r--r--src/emu/cpu/m6502/m6502.c4
-rw-r--r--src/emu/cpu/m6502/m6509.c8
-rw-r--r--src/emu/cpu/m6502/mincce02.h4
-rw-r--r--src/emu/cpu/m6800/m6800.c76
-rw-r--r--src/emu/cpu/m68000/68307bus.c16
-rw-r--r--src/emu/cpu/m68000/68307ser.c32
-rw-r--r--src/emu/cpu/m68000/68307sim.c32
-rw-r--r--src/emu/cpu/m68000/68307sim.h8
-rw-r--r--src/emu/cpu/m68000/68307tmu.c8
-rw-r--r--src/emu/cpu/m68000/68340dma.c8
-rw-r--r--src/emu/cpu/m68000/68340ser.c8
-rw-r--r--src/emu/cpu/m68000/68340sim.c56
-rw-r--r--src/emu/cpu/m68000/68340tmu.c8
-rw-r--r--src/emu/cpu/m68000/m68000.h8
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c16
-rw-r--r--src/emu/cpu/mips/r3000.c84
-rw-r--r--src/emu/cpu/powerpc/ppc.c44
-rw-r--r--src/emu/cpu/powerpc/ppc403.c16
-rw-r--r--src/emu/cpu/powerpc/ppc_mem.c48
-rw-r--r--src/emu/cpu/powerpc/ppccom.c4
-rw-r--r--src/emu/cpu/se3208/se3208.c40
-rw-r--r--src/emu/cpu/sh2/sh2comn.c10
-rw-r--r--src/emu/cpu/sh2/sh2drc.c4
-rw-r--r--src/emu/cpu/sh4/sh3comn.c8
-rw-r--r--src/emu/cpu/sh4/sh4comn.c8
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c4
-rw-r--r--src/emu/cpu/tlcs900/tlcs900.c8
-rw-r--r--src/emu/cpu/tms32051/tms32051.c8
-rw-r--r--src/emu/cpu/tms34010/34010gfx.c122
-rw-r--r--src/emu/cpu/tms34010/tms34010.c31
-rw-r--r--src/emu/cpu/tms34010/tms34010.h4
-rw-r--r--src/emu/cpu/tms7000/tms7000.c8
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h18
-rw-r--r--src/emu/debug/debugcmd.c82
-rw-r--r--src/emu/debug/debugcpu.c404
-rw-r--r--src/emu/debug/debugcpu.h24
-rw-r--r--src/emu/debug/dvdisasm.c16
-rw-r--r--src/emu/debug/dvmemory.c16
-rw-r--r--src/emu/devcb.c18
-rw-r--r--src/emu/machine/53c810.c4
-rw-r--r--src/emu/machine/8042kbdc.c30
-rw-r--r--src/emu/machine/amigafdc.c4
-rw-r--r--src/emu/machine/k056230.c8
-rw-r--r--src/emu/machine/latch8.c2
-rw-r--r--src/emu/machine/pc16552d.c8
-rw-r--r--src/emu/machine/s3c2400.c46
-rw-r--r--src/emu/machine/s3c2410.c52
-rw-r--r--src/emu/machine/s3c2440.c56
-rw-r--r--src/emu/machine/s3c24xx.c26
-rw-r--r--src/emu/machine/tmp68301.c4
-rw-r--r--src/emu/machine/v3021.c2
-rw-r--r--src/emu/memconv.h72
-rw-r--r--src/emu/memory.c96
-rw-r--r--src/emu/memory.h62
-rw-r--r--src/emu/sound/awacs.c4
-rw-r--r--src/emu/sound/awacs.h2
-rw-r--r--src/emu/sound/nile.c4
-rw-r--r--src/emu/sound/pokey.c4
-rw-r--r--src/emu/sound/spu.c4
-rw-r--r--src/emu/sound/vrender0.c4
-rw-r--r--src/emu/video/hd63484.c10
-rw-r--r--src/emu/video/pc_cga.c50
-rw-r--r--src/emu/video/pc_vga.c90
-rw-r--r--src/emu/video/pc_vga.h6
-rw-r--r--src/emu/video/tms34061.c28
-rw-r--r--src/emu/video/tms34061.h4
-rw-r--r--src/mame/audio/8080bw.c10
-rw-r--r--src/mame/audio/amiga.c2
-rw-r--r--src/mame/audio/atarijsa.c84
-rw-r--r--src/mame/audio/cage.c46
-rw-r--r--src/mame/audio/cage.h6
-rw-r--r--src/mame/audio/carnival.c6
-rw-r--r--src/mame/audio/cclimber.c2
-rw-r--r--src/mame/audio/dcs.c66
-rw-r--r--src/mame/audio/depthch.c2
-rw-r--r--src/mame/audio/gorf.c10
-rw-r--r--src/mame/audio/invinco.c4
-rw-r--r--src/mame/audio/irem.c8
-rw-r--r--src/mame/audio/mario.c14
-rw-r--r--src/mame/audio/namco52.c18
-rw-r--r--src/mame/audio/namco54.c14
-rw-r--r--src/mame/audio/pulsar.c4
-rw-r--r--src/mame/audio/seibu.c26
-rw-r--r--src/mame/audio/snes_snd.c4
-rw-r--r--src/mame/audio/snk6502.c20
-rw-r--r--src/mame/audio/t5182.c6
-rw-r--r--src/mame/audio/taito_en.c14
-rw-r--r--src/mame/audio/taitosnd.c4
-rw-r--r--src/mame/audio/targ.c10
-rw-r--r--src/mame/audio/timeplt.c2
-rw-r--r--src/mame/audio/trackfld.c6
-rw-r--r--src/mame/audio/turbo.c2
-rw-r--r--src/mame/audio/vicdual.c48
-rw-r--r--src/mame/audio/wow.c10
-rw-r--r--src/mame/drivers/39in1.c72
-rw-r--r--src/mame/drivers/aleck64.c10
-rw-r--r--src/mame/drivers/appoooh.c4
-rw-r--r--src/mame/drivers/aristmk5.c4
-rw-r--r--src/mame/drivers/armedf.c2
-rw-r--r--src/mame/drivers/astrocde.c4
-rw-r--r--src/mame/drivers/astrocorp.c4
-rw-r--r--src/mame/drivers/atarigt.c60
-rw-r--r--src/mame/drivers/atarisy2.c12
-rw-r--r--src/mame/drivers/atarisy4.c18
-rw-r--r--src/mame/drivers/atetris.c2
-rw-r--r--src/mame/drivers/atvtrack.c4
-rw-r--r--src/mame/drivers/badlands.c10
-rw-r--r--src/mame/drivers/balsente.c32
-rw-r--r--src/mame/drivers/beathead.c4
-rw-r--r--src/mame/drivers/berzerk.c4
-rw-r--r--src/mame/drivers/bfcobra.c26
-rw-r--r--src/mame/drivers/bfm_sc2.c6
-rw-r--r--src/mame/drivers/bfm_sc4h.c26
-rw-r--r--src/mame/drivers/btime.c26
-rw-r--r--src/mame/drivers/bzone.c12
-rw-r--r--src/mame/drivers/cabal.c6
-rw-r--r--src/mame/drivers/calchase.c2
-rw-r--r--src/mame/drivers/calorie.c4
-rw-r--r--src/mame/drivers/cave.c12
-rw-r--r--src/mame/drivers/cham24.c2
-rw-r--r--src/mame/drivers/chihiro.c42
-rw-r--r--src/mame/drivers/chinagat.c22
-rw-r--r--src/mame/drivers/cmmb.c4
-rw-r--r--src/mame/drivers/combatsc.c4
-rw-r--r--src/mame/drivers/commando.c8
-rw-r--r--src/mame/drivers/coolpool.c16
-rw-r--r--src/mame/drivers/coolridr.c10
-rw-r--r--src/mame/drivers/cps2.c48
-rw-r--r--src/mame/drivers/cps3.c8
-rw-r--r--src/mame/drivers/crystal.c70
-rw-r--r--src/mame/drivers/cshooter.c8
-rw-r--r--src/mame/drivers/csplayh5.c4
-rw-r--r--src/mame/drivers/darkmist.c6
-rw-r--r--src/mame/drivers/ddenlovr.c58
-rw-r--r--src/mame/drivers/dec0.c42
-rw-r--r--src/mame/drivers/dec8.c8
-rw-r--r--src/mame/drivers/decocass.c30
-rw-r--r--src/mame/drivers/discoboy.c2
-rw-r--r--src/mame/drivers/dkong.c12
-rw-r--r--src/mame/drivers/eolith.c2
-rw-r--r--src/mame/drivers/eolith16.c2
-rw-r--r--src/mame/drivers/eolithsp.c10
-rw-r--r--src/mame/drivers/exidy.c4
-rw-r--r--src/mame/drivers/exterm.c8
-rw-r--r--src/mame/drivers/famibox.c2
-rw-r--r--src/mame/drivers/fcrash.c10
-rw-r--r--src/mame/drivers/firebeat.c60
-rw-r--r--src/mame/drivers/flstory.c4
-rw-r--r--src/mame/drivers/foodf.c4
-rw-r--r--src/mame/drivers/freekick.c4
-rw-r--r--src/mame/drivers/funworld.c8
-rw-r--r--src/mame/drivers/gaelco.c8
-rw-r--r--src/mame/drivers/galaga.c4
-rw-r--r--src/mame/drivers/galaxian.c196
-rw-r--r--src/mame/drivers/galivan.c2
-rw-r--r--src/mame/drivers/galpanic.c2
-rw-r--r--src/mame/drivers/gamtor.c2
-rw-r--r--src/mame/drivers/gauntlet.c2
-rw-r--r--src/mame/drivers/gladiatr.c14
-rw-r--r--src/mame/drivers/gsword.c16
-rw-r--r--src/mame/drivers/guab.c14
-rw-r--r--src/mame/drivers/hng64.c14
-rw-r--r--src/mame/drivers/homedata.c8
-rw-r--r--src/mame/drivers/hshavoc.c4
-rw-r--r--src/mame/drivers/hyprduel.c16
-rw-r--r--src/mame/drivers/jack.c4
-rw-r--r--src/mame/drivers/jalmah.c6
-rw-r--r--src/mame/drivers/jpmsys5.c8
-rw-r--r--src/mame/drivers/kaneko16.c8
-rw-r--r--src/mame/drivers/kchamp.c4
-rw-r--r--src/mame/drivers/kickgoal.c2
-rw-r--r--src/mame/drivers/klax.c4
-rw-r--r--src/mame/drivers/konamigx.c84
-rw-r--r--src/mame/drivers/konamim2.c10
-rw-r--r--src/mame/drivers/kyugo.c4
-rw-r--r--src/mame/drivers/ladybug.c4
-rw-r--r--src/mame/drivers/liberate.c8
-rw-r--r--src/mame/drivers/macrossp.c2
-rw-r--r--src/mame/drivers/magictg.c6
-rw-r--r--src/mame/drivers/magtouch.c2
-rw-r--r--src/mame/drivers/mainevt.c2
-rw-r--r--src/mame/drivers/mappy.c12
-rw-r--r--src/mame/drivers/mario.c4
-rw-r--r--src/mame/drivers/mediagx.c8
-rw-r--r--src/mame/drivers/megadrvb.c20
-rw-r--r--src/mame/drivers/megaplay.c34
-rw-r--r--src/mame/drivers/megatech.c30
-rw-r--r--src/mame/drivers/metalmx.c4
-rw-r--r--src/mame/drivers/metro.c34
-rw-r--r--src/mame/drivers/midqslvr.c6
-rw-r--r--src/mame/drivers/midvunit.c6
-rw-r--r--src/mame/drivers/missile.c32
-rw-r--r--src/mame/drivers/mitchell.c4
-rw-r--r--src/mame/drivers/model2.c32
-rw-r--r--src/mame/drivers/model3.c6
-rw-r--r--src/mame/drivers/mouser.c4
-rw-r--r--src/mame/drivers/mpu3.c4
-rw-r--r--src/mame/drivers/mpu4hw.c46
-rw-r--r--src/mame/drivers/mpu4vid.c46
-rw-r--r--src/mame/drivers/mquake.c12
-rw-r--r--src/mame/drivers/multigam.c18
-rw-r--r--src/mame/drivers/mystwarr.c10
-rw-r--r--src/mame/drivers/namcona1.c8
-rw-r--r--src/mame/drivers/namcos11.c16
-rw-r--r--src/mame/drivers/namcos12.c18
-rw-r--r--src/mame/drivers/namcos21.c8
-rw-r--r--src/mame/drivers/namcos23.c10
-rw-r--r--src/mame/drivers/naomi.c14
-rw-r--r--src/mame/drivers/nbmj9195.c32
-rw-r--r--src/mame/drivers/neodrvr.c2
-rw-r--r--src/mame/drivers/neogeo.c64
-rw-r--r--src/mame/drivers/ninjakd2.c4
-rw-r--r--src/mame/drivers/niyanpai.c6
-rw-r--r--src/mame/drivers/nmk16.c2
-rw-r--r--src/mame/drivers/nyny.c2
-rw-r--r--src/mame/drivers/ojankohs.c2
-rw-r--r--src/mame/drivers/omegrace.c4
-rw-r--r--src/mame/drivers/opwolf.c4
-rw-r--r--src/mame/drivers/pacman.c8
-rw-r--r--src/mame/drivers/pangofun.c2
-rw-r--r--src/mame/drivers/panicr.c4
-rw-r--r--src/mame/drivers/pastelg.c2
-rw-r--r--src/mame/drivers/pcat_dyn.c2
-rw-r--r--src/mame/drivers/pcat_nit.c2
-rw-r--r--src/mame/drivers/pcktgal.c4
-rw-r--r--src/mame/drivers/pengo.c4
-rw-r--r--src/mame/drivers/photoply.c2
-rw-r--r--src/mame/drivers/pipedrm.c16
-rw-r--r--src/mame/drivers/playch10.c2
-rw-r--r--src/mame/drivers/plygonet.c4
-rw-r--r--src/mame/drivers/pntnpuzl.c2
-rw-r--r--src/mame/drivers/polepos.c4
-rw-r--r--src/mame/drivers/powerbal.c4
-rw-r--r--src/mame/drivers/progolf.c8
-rw-r--r--src/mame/drivers/pturn.c4
-rw-r--r--src/mame/drivers/queen.c2
-rw-r--r--src/mame/drivers/quizpun2.c18
-rw-r--r--src/mame/drivers/r2dx_v33.c24
-rw-r--r--src/mame/drivers/raiden2.c4
-rw-r--r--src/mame/drivers/rallyx.c2
-rw-r--r--src/mame/drivers/redclash.c2
-rw-r--r--src/mame/drivers/renegade.c6
-rw-r--r--src/mame/drivers/safarir.c8
-rw-r--r--src/mame/drivers/saturn.c110
-rw-r--r--src/mame/drivers/savquest.c2
-rw-r--r--src/mame/drivers/seattle.c80
-rw-r--r--src/mame/drivers/segac2.c62
-rw-r--r--src/mame/drivers/segag80r.c22
-rw-r--r--src/mame/drivers/segag80v.c16
-rw-r--r--src/mame/drivers/segas16a.c2
-rw-r--r--src/mame/drivers/segas16b.c28
-rw-r--r--src/mame/drivers/segas24.c2
-rw-r--r--src/mame/drivers/segas32.c66
-rw-r--r--src/mame/drivers/segaxbd.c2
-rw-r--r--src/mame/drivers/seibuspi.c32
-rw-r--r--src/mame/drivers/seicross.c2
-rw-r--r--src/mame/drivers/seta.c4
-rw-r--r--src/mame/drivers/sf.c36
-rw-r--r--src/mame/drivers/shootout.c4
-rw-r--r--src/mame/drivers/sigmab52.c2
-rw-r--r--src/mame/drivers/skimaxx.c8
-rw-r--r--src/mame/drivers/sothello.c12
-rw-r--r--src/mame/drivers/spacefb.c8
-rw-r--r--src/mame/drivers/srumbler.c4
-rw-r--r--src/mame/drivers/ssfindo.c24
-rw-r--r--src/mame/drivers/starwars.c18
-rw-r--r--src/mame/drivers/su2000.c8
-rw-r--r--src/mame/drivers/subsino2.c34
-rw-r--r--src/mame/drivers/suna16.c4
-rw-r--r--src/mame/drivers/suna8.c24
-rw-r--r--src/mame/drivers/superqix.c10
-rw-r--r--src/mame/drivers/supertnk.c10
-rw-r--r--src/mame/drivers/suprgolf.c2
-rw-r--r--src/mame/drivers/system1.c12
-rw-r--r--src/mame/drivers/system16.c4
-rw-r--r--src/mame/drivers/taito_l.c16
-rw-r--r--src/mame/drivers/taitojc.c28
-rw-r--r--src/mame/drivers/taitopjc.c10
-rw-r--r--src/mame/drivers/taitowlf.c2
-rw-r--r--src/mame/drivers/tasman.c4
-rw-r--r--src/mame/drivers/tcl.c4
-rw-r--r--src/mame/drivers/tiamc1.c4
-rw-r--r--src/mame/drivers/tickee.c8
-rw-r--r--src/mame/drivers/tigeroad.c10
-rw-r--r--src/mame/drivers/tmnt.c16
-rw-r--r--src/mame/drivers/toki.c4
-rw-r--r--src/mame/drivers/trackfld.c16
-rw-r--r--src/mame/drivers/trvquest.c2
-rw-r--r--src/mame/drivers/vamphalf.c36
-rw-r--r--src/mame/drivers/vcombat.c12
-rw-r--r--src/mame/drivers/vega.c2
-rw-r--r--src/mame/drivers/vegaeo.c2
-rw-r--r--src/mame/drivers/vegas.c155
-rw-r--r--src/mame/drivers/vendetta.c12
-rw-r--r--src/mame/drivers/vicdual.c36
-rw-r--r--src/mame/drivers/viper.c4
-rw-r--r--src/mame/drivers/voyager.c2
-rw-r--r--src/mame/drivers/vsnes.c4
-rw-r--r--src/mame/drivers/williams.c28
-rw-r--r--src/mame/drivers/wiz.c4
-rw-r--r--src/mame/drivers/xtheball.c12
-rw-r--r--src/mame/drivers/xtom3d.c2
-rw-r--r--src/mame/drivers/zaxxon.c4
-rw-r--r--src/mame/includes/artmagic.h4
-rw-r--r--src/mame/includes/atari.h14
-rw-r--r--src/mame/includes/atarigt.h4
-rw-r--r--src/mame/includes/btoads.h8
-rw-r--r--src/mame/includes/eolithsp.h2
-rw-r--r--src/mame/includes/exterm.h8
-rw-r--r--src/mame/includes/gaelcrpt.h2
-rw-r--r--src/mame/includes/harddriv.h4
-rw-r--r--src/mame/includes/hyprduel.h2
-rw-r--r--src/mame/includes/jpmimpct.h4
-rw-r--r--src/mame/includes/metro.h2
-rw-r--r--src/mame/includes/midtunit.h4
-rw-r--r--src/mame/includes/midyunit.h4
-rw-r--r--src/mame/includes/model3.h10
-rw-r--r--src/mame/includes/nb1414m4.h2
-rw-r--r--src/mame/includes/nbmj9195.h4
-rw-r--r--src/mame/includes/neogeo.h6
-rw-r--r--src/mame/includes/ojankohs.h2
-rw-r--r--src/mame/includes/pastelg.h2
-rw-r--r--src/mame/includes/segaorun.h4
-rw-r--r--src/mame/includes/segas16b.h2
-rw-r--r--src/mame/includes/segas18.h4
-rw-r--r--src/mame/includes/slapstic.h2
-rw-r--r--src/mame/includes/williams.h2
-rw-r--r--src/mame/machine/acitya.c2
-rw-r--r--src/mame/machine/amiga.c126
-rw-r--r--src/mame/machine/archimds.c76
-rw-r--r--src/mame/machine/asic65.c14
-rw-r--r--src/mame/machine/asteroid.c2
-rw-r--r--src/mame/machine/atari.c8
-rw-r--r--src/mame/machine/atarigen.c116
-rw-r--r--src/mame/machine/bagman.c18
-rw-r--r--src/mame/machine/balsente.c6
-rw-r--r--src/mame/machine/bonzeadv.c24
-rw-r--r--src/mame/machine/cchip.c16
-rw-r--r--src/mame/machine/cclimber.c4
-rw-r--r--src/mame/machine/cd32.c2
-rw-r--r--src/mame/machine/cdi070.c192
-rw-r--r--src/mame/machine/cps2crpt.c4
-rw-r--r--src/mame/machine/cx4fn.c50
-rw-r--r--src/mame/machine/cx4oam.c20
-rw-r--r--src/mame/machine/dc.c82
-rw-r--r--src/mame/machine/deco102.c4
-rw-r--r--src/mame/machine/decocass.c224
-rw-r--r--src/mame/machine/decoprot.c188
-rw-r--r--src/mame/machine/fddebug.c32
-rw-r--r--src/mame/machine/gaelcrpt.c6
-rw-r--r--src/mame/machine/galaxold.c8
-rw-r--r--src/mame/machine/harddriv.c230
-rw-r--r--src/mame/machine/kabuki.c8
-rw-r--r--src/mame/machine/kaneko_calc3.c34
-rw-r--r--src/mame/machine/konami1.c4
-rw-r--r--src/mame/machine/konppc.c44
-rw-r--r--src/mame/machine/m68kfmly.c20
-rw-r--r--src/mame/machine/maniach.c38
-rw-r--r--src/mame/machine/mc8123.c4
-rw-r--r--src/mame/machine/mcr68.c4
-rw-r--r--src/mame/machine/md_cart.c160
-rw-r--r--src/mame/machine/megacd.c142
-rw-r--r--src/mame/machine/megadriv.c84
-rw-r--r--src/mame/machine/megasvp.c32
-rw-r--r--src/mame/machine/megavdp.c20
-rw-r--r--src/mame/machine/mhavoc.c6
-rw-r--r--src/mame/machine/micro3d.c10
-rw-r--r--src/mame/machine/midwayic.c62
-rw-r--r--src/mame/machine/midwayic.h10
-rw-r--r--src/mame/machine/midwunit.c4
-rw-r--r--src/mame/machine/midxunit.c4
-rw-r--r--src/mame/machine/model1.c36
-rw-r--r--src/mame/machine/namco50.c8
-rw-r--r--src/mame/machine/namco53.c8
-rw-r--r--src/mame/machine/namcoio.c4
-rw-r--r--src/mame/machine/namcos1.c98
-rw-r--r--src/mame/machine/namcos2.c104
-rw-r--r--src/mame/machine/naomi.c64
-rw-r--r--src/mame/machine/nb1413m3.c32
-rw-r--r--src/mame/machine/nb1414m4.c36
-rw-r--r--src/mame/machine/neoboot.c20
-rw-r--r--src/mame/machine/neoprot.c30
-rw-r--r--src/mame/machine/nmk004.c4
-rw-r--r--src/mame/machine/pcecommn.c6
-rw-r--r--src/mame/machine/pcshare.c4
-rw-r--r--src/mame/machine/pgmprot.c8
-rw-r--r--src/mame/machine/pgmprot1.c54
-rw-r--r--src/mame/machine/pgmprot2.c60
-rw-r--r--src/mame/machine/pgmprot3.c44
-rw-r--r--src/mame/machine/pgmprot4.c24
-rw-r--r--src/mame/machine/pgmprot5.c2
-rw-r--r--src/mame/machine/pgmprot6.c14
-rw-r--r--src/mame/machine/psx.c12
-rw-r--r--src/mame/machine/scramble.c30
-rw-r--r--src/mame/machine/scudsp.c38
-rw-r--r--src/mame/machine/scudsp.h6
-rw-r--r--src/mame/machine/segacrp2.c4
-rw-r--r--src/mame/machine/segacrpt.c14
-rw-r--r--src/mame/machine/segamsys.c38
-rw-r--r--src/mame/machine/segas32.c22
-rw-r--r--src/mame/machine/seicop.c256
-rw-r--r--src/mame/machine/slapstic.c12
-rw-r--r--src/mame/machine/slikshot.c10
-rw-r--r--src/mame/machine/smpc.c60
-rw-r--r--src/mame/machine/snes.c182
-rw-r--r--src/mame/machine/snes7110.c10
-rw-r--r--src/mame/machine/snesbsx.c4
-rw-r--r--src/mame/machine/snescx4.c4
-rw-r--r--src/mame/machine/snesrtc.c4
-rw-r--r--src/mame/machine/snessdd1.c4
-rw-r--r--src/mame/machine/stfight.c8
-rw-r--r--src/mame/machine/stvcd.c2
-rw-r--r--src/mame/machine/stvprot.c48
-rw-r--r--src/mame/machine/tait8741.c48
-rw-r--r--src/mame/machine/taitoio.c20
-rw-r--r--src/mame/machine/taitosj.c4
-rw-r--r--src/mame/machine/theglobp.c2
-rw-r--r--src/mame/machine/twincobr.c38
-rw-r--r--src/mame/machine/williams.c18
-rw-r--r--src/mame/machine/wrally.c2
-rw-r--r--src/mame/machine/xevious.c42
-rw-r--r--src/mame/video/amiga.c4
-rw-r--r--src/mame/video/antic.c4
-rw-r--r--src/mame/video/artmagic.c8
-rw-r--r--src/mame/video/astrocde.c12
-rw-r--r--src/mame/video/atari.c6
-rw-r--r--src/mame/video/atarig1.c4
-rw-r--r--src/mame/video/atarig42.c4
-rw-r--r--src/mame/video/atarigx2.c4
-rw-r--r--src/mame/video/atarisy1.c40
-rw-r--r--src/mame/video/atarisy2.c26
-rw-r--r--src/mame/video/avgdvg.c4
-rw-r--r--src/mame/video/badlands.c4
-rw-r--r--src/mame/video/baraduke.c8
-rw-r--r--src/mame/video/bfm_adr2.c4
-rw-r--r--src/mame/video/bfm_dm01.c4
-rw-r--r--src/mame/video/blstroid.c2
-rw-r--r--src/mame/video/bosco.c6
-rw-r--r--src/mame/video/btoads.c4
-rw-r--r--src/mame/video/capbowl.c4
-rw-r--r--src/mame/video/cave.c24
-rw-r--r--src/mame/video/cischeat.c18
-rw-r--r--src/mame/video/combatsc.c4
-rw-r--r--src/mame/video/cyberbal.c12
-rw-r--r--src/mame/video/dc.c70
-rw-r--r--src/mame/video/decocass.c52
-rw-r--r--src/mame/video/digdug.c4
-rw-r--r--src/mame/video/dogfgt.c4
-rw-r--r--src/mame/video/exterm.c16
-rw-r--r--src/mame/video/fastfred.c20
-rw-r--r--src/mame/video/fuukifg2.c12
-rw-r--r--src/mame/video/fuukifg3.c12
-rw-r--r--src/mame/video/galpani2.c24
-rw-r--r--src/mame/video/galpanic.c6
-rw-r--r--src/mame/video/gauntlet.c8
-rw-r--r--src/mame/video/gtia.c2
-rw-r--r--src/mame/video/gtia.h4
-rw-r--r--src/mame/video/gticlub.c48
-rw-r--r--src/mame/video/harddriv.c42
-rw-r--r--src/mame/video/hng64.c4
-rw-r--r--src/mame/video/homedata.c24
-rw-r--r--src/mame/video/hyhoo.c6
-rw-r--r--src/mame/video/itech8.c12
-rw-r--r--src/mame/video/jpmimpct.c8
-rw-r--r--src/mame/video/konamiic.c36
-rw-r--r--src/mame/video/konicdev.c40
-rw-r--r--src/mame/video/leland.c42
-rw-r--r--src/mame/video/lordgun.c12
-rw-r--r--src/mame/video/mcd212.c38
-rw-r--r--src/mame/video/megasys1.c10
-rw-r--r--src/mame/video/midtunit.c4
-rw-r--r--src/mame/video/midyunit.c8
-rw-r--r--src/mame/video/midzeus2.c12
-rw-r--r--src/mame/video/model3.c46
-rw-r--r--src/mame/video/namcos1.c12
-rw-r--r--src/mame/video/namcos2.c4
-rw-r--r--src/mame/video/namcos22.c8
-rw-r--r--src/mame/video/namcos86.c12
-rw-r--r--src/mame/video/nbmj8688.c24
-rw-r--r--src/mame/video/nbmj9195.c38
-rw-r--r--src/mame/video/neogeo.c4
-rw-r--r--src/mame/video/ojankohs.c16
-rw-r--r--src/mame/video/pastelg.c6
-rw-r--r--src/mame/video/popeye.c4
-rw-r--r--src/mame/video/ppu2c0x.c8
-rw-r--r--src/mame/video/ppu2c0x.h2
-rw-r--r--src/mame/video/redclash.c22
-rw-r--r--src/mame/video/segaic16.c2
-rw-r--r--src/mame/video/segas32.c32
-rw-r--r--src/mame/video/simpsons.c12
-rw-r--r--src/mame/video/skullxbo.c16
-rw-r--r--src/mame/video/skydiver.c18
-rw-r--r--src/mame/video/snes.c70
-rw-r--r--src/mame/video/stvvdp1.c24
-rw-r--r--src/mame/video/stvvdp2.c60
-rw-r--r--src/mame/video/taito_b.c4
-rw-r--r--src/mame/video/taitoic.c10
-rw-r--r--src/mame/video/toaplan1.c8
-rw-r--r--src/mame/video/toobin.c22
-rw-r--r--src/mame/video/vdc.c10
-rw-r--r--src/mame/video/vindictr.c4
-rw-r--r--src/mame/video/vrender0.c4
-rw-r--r--src/mame/video/williams.c22
-rw-r--r--src/mame/video/xevious.c14
-rw-r--r--src/mame/video/ygv608.c8
-rw-r--r--src/mess/drivers/a2600.c94
-rw-r--r--src/mess/drivers/a5105.c4
-rw-r--r--src/mess/drivers/amiga.c8
-rw-r--r--src/mess/drivers/apexc.c6
-rw-r--r--src/mess/drivers/apollo.c4
-rw-r--r--src/mess/drivers/aquarius.c4
-rw-r--r--src/mess/drivers/astrocde.c26
-rw-r--r--src/mess/drivers/atm.c8
-rw-r--r--src/mess/drivers/avigo.c12
-rw-r--r--src/mess/drivers/b16.c4
-rw-r--r--src/mess/drivers/basic52.c4
-rw-r--r--src/mess/drivers/bebox.c10
-rw-r--r--src/mess/drivers/bigbord2.c12
-rw-r--r--src/mess/drivers/bullet.c4
-rw-r--r--src/mess/drivers/c128.c4
-rw-r--r--src/mess/drivers/c64.c4
-rw-r--r--src/mess/drivers/cd2650.c8
-rw-r--r--src/mess/drivers/d6800.c4
-rw-r--r--src/mess/drivers/dc.c24
-rw-r--r--src/mess/drivers/dmv.c4
-rw-r--r--src/mess/drivers/enterp.c36
-rw-r--r--src/mess/drivers/esq5505.c2
-rw-r--r--src/mess/drivers/fk1.c4
-rw-r--r--src/mess/drivers/fm7.c78
-rw-r--r--src/mess/drivers/fmtowns.c2
-rw-r--r--src/mess/drivers/gba.c6
-rw-r--r--src/mess/drivers/gp32.c8
-rw-r--r--src/mess/drivers/homelab.c4
-rw-r--r--src/mess/drivers/indiana.c2
-rw-r--r--src/mess/drivers/instruct.c4
-rw-r--r--src/mess/drivers/ip22.c42
-rw-r--r--src/mess/drivers/itt3030.c4
-rw-r--r--src/mess/drivers/lynx.c8
-rw-r--r--src/mess/drivers/mc10.c4
-rw-r--r--src/mess/drivers/megadriv.c14
-rw-r--r--src/mess/drivers/mikromik.c4
-rw-r--r--src/mess/drivers/mmodular.c26
-rw-r--r--src/mess/drivers/nanos.c10
-rw-r--r--src/mess/drivers/nc.c14
-rw-r--r--src/mess/drivers/nes.c2
-rw-r--r--src/mess/drivers/next.c6
-rw-r--r--src/mess/drivers/ng_aes.c68
-rw-r--r--src/mess/drivers/p8k.c4
-rw-r--r--src/mess/drivers/palm.c6
-rw-r--r--src/mess/drivers/pc6001.c6
-rw-r--r--src/mess/drivers/pc88va.c6
-rw-r--r--src/mess/drivers/pc9801.c4
-rw-r--r--src/mess/drivers/pce220.c4
-rw-r--r--src/mess/drivers/pcw.c6
-rw-r--r--src/mess/drivers/pcw16.c66
-rw-r--r--src/mess/drivers/pentagon.c8
-rw-r--r--src/mess/drivers/pipbug.c4
-rw-r--r--src/mess/drivers/psion.c8
-rw-r--r--src/mess/drivers/psx.c4
-rw-r--r--src/mess/drivers/px4.c28
-rw-r--r--src/mess/drivers/qx10.c4
-rw-r--r--src/mess/drivers/samcoupe.c6
-rw-r--r--src/mess/drivers/sc2.c2
-rw-r--r--src/mess/drivers/scorpion.c8
-rw-r--r--src/mess/drivers/spc1000.c10
-rw-r--r--src/mess/drivers/spec128.c8
-rw-r--r--src/mess/drivers/specpls3.c34
-rw-r--r--src/mess/drivers/spectrum.c10
-rw-r--r--src/mess/drivers/super6.c4
-rw-r--r--src/mess/drivers/timex.c160
-rw-r--r--src/mess/drivers/trs80m2.c4
-rw-r--r--src/mess/drivers/tvc.c16
-rw-r--r--src/mess/drivers/vc4000.c10
-rw-r--r--src/mess/drivers/vidbrain.c2
-rw-r--r--src/mess/drivers/vii.c22
-rw-r--r--src/mess/drivers/vt520.c4
-rw-r--r--src/mess/drivers/vtech1.c22
-rw-r--r--src/mess/drivers/x07.c10
-rw-r--r--src/mess/drivers/x1.c18
-rw-r--r--src/mess/drivers/x1twin.c2
-rw-r--r--src/mess/drivers/x68k.c202
-rw-r--r--src/mess/formats/ace_ace.c4
-rw-r--r--src/mess/formats/cbm_snqk.c64
-rw-r--r--src/mess/formats/m65_snqk.c10
-rw-r--r--src/mess/formats/spec_snqk.c140
-rw-r--r--src/mess/formats/z80bin.c22
-rw-r--r--src/mess/includes/samcoupe.h2
-rw-r--r--src/mess/machine/990_hd.c4
-rw-r--r--src/mess/machine/a7800.c10
-rw-r--r--src/mess/machine/aim65.c4
-rw-r--r--src/mess/machine/amigacd.c88
-rw-r--r--src/mess/machine/amigacrt.c26
-rw-r--r--src/mess/machine/amstr_pc.c44
-rw-r--r--src/mess/machine/amstrad.c18
-rw-r--r--src/mess/machine/apollo.c18
-rw-r--r--src/mess/machine/apple1.c4
-rw-r--r--src/mess/machine/apple2.c16
-rw-r--r--src/mess/machine/apple2gs.c88
-rw-r--r--src/mess/machine/apple3.c54
-rw-r--r--src/mess/machine/at.c6
-rw-r--r--src/mess/machine/ataricrt.c66
-rw-r--r--src/mess/machine/b2m.c52
-rw-r--r--src/mess/machine/bebox.c72
-rw-r--r--src/mess/machine/c64.c126
-rw-r--r--src/mess/machine/c65.c104
-rw-r--r--src/mess/machine/cgenie.c146
-rw-r--r--src/mess/machine/comx_clm.c10
-rw-r--r--src/mess/machine/concept.c34
-rw-r--r--src/mess/machine/corvushd.c8
-rw-r--r--src/mess/machine/cpc_ssa1.c10
-rw-r--r--src/mess/machine/dccons.c30
-rw-r--r--src/mess/machine/dgn_beta.c64
-rw-r--r--src/mess/machine/europc.c14
-rw-r--r--src/mess/machine/galaxy.c20
-rw-r--r--src/mess/machine/gb.c64
-rw-r--r--src/mess/machine/hd63450.c60
-rw-r--r--src/mess/machine/hec2hrp.c16
-rw-r--r--src/mess/machine/hecdisk2.c46
-rw-r--r--src/mess/machine/hp48.c44
-rw-r--r--src/mess/machine/intv.c20
-rw-r--r--src/mess/machine/iq151_staper.c8
-rw-r--r--src/mess/machine/isa.c22
-rw-r--r--src/mess/machine/kaypro.c12
-rw-r--r--src/mess/machine/kc.c98
-rw-r--r--src/mess/machine/lisa.c8
-rw-r--r--src/mess/machine/llc.c10
-rw-r--r--src/mess/machine/lux21046.c4
-rw-r--r--src/mess/machine/lviv.c12
-rw-r--r--src/mess/machine/lynx.c4
-rw-r--r--src/mess/machine/mac.c24
-rw-r--r--src/mess/machine/mbc55x.c14
-rw-r--r--src/mess/machine/mbee.c14
-rw-r--r--src/mess/machine/mboard.c16
-rw-r--r--src/mess/machine/microtan.c10
-rw-r--r--src/mess/machine/mpc105.c6
-rw-r--r--src/mess/machine/msx_slot.c66
-rw-r--r--src/mess/machine/mz700.c2
-rw-r--r--src/mess/machine/nes.c44
-rw-r--r--src/mess/machine/nes_ines.c36
-rw-r--r--src/mess/machine/nes_mmc.c12
-rw-r--r--src/mess/machine/nes_pcb.c2010
-rw-r--r--src/mess/machine/northbridge.c6
-rw-r--r--src/mess/machine/nubus.c4
-rw-r--r--src/mess/machine/oric.c92
-rw-r--r--src/mess/machine/orion.c112
-rw-r--r--src/mess/machine/osborne1.c10
-rw-r--r--src/mess/machine/partner.c64
-rw-r--r--src/mess/machine/pc.c4
-rw-r--r--src/mess/machine/pc1350.c12
-rw-r--r--src/mess/machine/pc1403.c4
-rw-r--r--src/mess/machine/pc_fdc.c64
-rw-r--r--src/mess/machine/pc_joy.c14
-rw-r--r--src/mess/machine/pc_joy.h4
-rw-r--r--src/mess/machine/pecom.c14
-rw-r--r--src/mess/machine/pet.c100
-rw-r--r--src/mess/machine/pk8020.c494
-rw-r--r--src/mess/machine/pmd85.c64
-rw-r--r--src/mess/machine/pokemini.c10
-rw-r--r--src/mess/machine/poly88.c4
-rw-r--r--src/mess/machine/pp01.c24
-rw-r--r--src/mess/machine/primo.c10
-rw-r--r--src/mess/machine/radio86.c4
-rw-r--r--src/mess/machine/rmnimbus.c32
-rw-r--r--src/mess/machine/s3c44b0.c38
-rw-r--r--src/mess/machine/samcoupe.c60
-rw-r--r--src/mess/machine/sgi.c170
-rw-r--r--src/mess/machine/sms.c70
-rw-r--r--src/mess/machine/snescart.c6
-rw-r--r--src/mess/machine/sorcerer.c24
-rw-r--r--src/mess/machine/special.c46
-rw-r--r--src/mess/machine/tandy1t.c20
-rw-r--r--src/mess/machine/tf20.c12
-rw-r--r--src/mess/machine/thomflop.c148
-rw-r--r--src/mess/machine/thomson.c386
-rw-r--r--src/mess/machine/ti85.c34
-rw-r--r--src/mess/machine/trs80.c4
-rw-r--r--src/mess/machine/upd71071.c6
-rw-r--r--src/mess/machine/vector06.c10
-rw-r--r--src/mess/machine/vtech2.c16
-rw-r--r--src/mess/machine/wswan.c10
-rw-r--r--src/mess/machine/x68k_neptunex.c4
-rw-r--r--src/mess/machine/x68k_scsiext.c8
-rw-r--r--src/mess/machine/z80ne.c16
-rw-r--r--src/mess/machine/zx.c12
-rw-r--r--src/mess/video/a7800.c6
-rw-r--r--src/mess/video/ac1.c8
-rw-r--r--src/mess/video/apple3.c10
-rw-r--r--src/mess/video/bbc.c6
-rw-r--r--src/mess/video/cgenie.c10
-rw-r--r--src/mess/video/cirrus.c2
-rw-r--r--src/mess/video/dai.c134
-rw-r--r--src/mess/video/dgn_beta.c2
-rw-r--r--src/mess/video/epnick.c2
-rw-r--r--src/mess/video/galaxy.c8
-rw-r--r--src/mess/video/gb.c14
-rw-r--r--src/mess/video/gf4500.c4
-rw-r--r--src/mess/video/hp48.c4
-rw-r--r--src/mess/video/intv.c4
-rw-r--r--src/mess/video/iq151_grafik.c8
-rw-r--r--src/mess/video/irisha.c6
-rw-r--r--src/mess/video/isa_cga.c4
-rw-r--r--src/mess/video/isa_svga_cirrus.c2
-rw-r--r--src/mess/video/isa_svga_s3.c2
-rw-r--r--src/mess/video/isa_svga_tseng.c2
-rw-r--r--src/mess/video/isa_vga.c2
-rw-r--r--src/mess/video/isa_vga_ati.c2
-rw-r--r--src/mess/video/kramermc.c4
-rw-r--r--src/mess/video/newport.c22
-rw-r--r--src/mess/video/nubus_cb264.c2
-rw-r--r--src/mess/video/oric.c6
-rw-r--r--src/mess/video/pc1251.c4
-rw-r--r--src/mess/video/pc1350.c4
-rw-r--r--src/mess/video/pc1401.c4
-rw-r--r--src/mess/video/pc1403.c4
-rw-r--r--src/mess/video/pc_aga.c44
-rw-r--r--src/mess/video/pc_t1t.c32
-rw-r--r--src/mess/video/stic.c4
-rw-r--r--src/mess/video/ti85.c4
-rw-r--r--src/mess/video/x68k.c34
728 files changed, 9473 insertions, 9501 deletions
diff --git a/src/emu/cpu/dsp56k/dsp56mem.c b/src/emu/cpu/dsp56k/dsp56mem.c
index a1f6a077f1a..dcbb6d766e8 100644
--- a/src/emu/cpu/dsp56k/dsp56mem.c
+++ b/src/emu/cpu/dsp56k/dsp56mem.c
@@ -485,20 +485,20 @@ void dsp56k_io_reset(dsp56k_core* cpustate)
READ16_HANDLER( program_r )
{
- dsp56k_core* cpustate = get_safe_token(&space->device());
+ dsp56k_core* cpustate = get_safe_token(&space.device());
return cpustate->program_ram[offset];
}
WRITE16_HANDLER( program_w )
{
- dsp56k_core* cpustate = get_safe_token(&space->device());
+ dsp56k_core* cpustate = get_safe_token(&space.device());
cpustate->program_ram[offset] = data;
}
/* Work */
READ16_HANDLER( peripheral_register_r )
{
- dsp56k_core* cpustate = get_safe_token(&space->device());
+ dsp56k_core* cpustate = get_safe_token(&space.device());
// (printf) logerror("Peripheral read 0x%04x\n", O2A(offset));
switch (O2A(offset))
@@ -633,7 +633,7 @@ READ16_HANDLER( peripheral_register_r )
WRITE16_HANDLER( peripheral_register_w )
{
- dsp56k_core* cpustate = get_safe_token(&space->device());
+ dsp56k_core* cpustate = get_safe_token(&space.device());
// Its primary behavior is RAM
// COMBINE_DATA(&cpustate->peripheral_ram[offset]);
diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c
index 8cb5856c58f..1211686a145 100644
--- a/src/emu/cpu/g65816/g65816.c
+++ b/src/emu/cpu/g65816/g65816.c
@@ -585,14 +585,14 @@ Triforce pieces in Zelda 3 intro) */
static WRITE8_HANDLER( wrmpya_w )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
cpustate->wrmpya = data;
}
static WRITE8_HANDLER( wrmpyb_w )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
cpustate->wrmpyb = data;
cpustate->rdmpy = cpustate->wrmpya * cpustate->wrmpyb;
@@ -601,21 +601,21 @@ static WRITE8_HANDLER( wrmpyb_w )
static WRITE8_HANDLER( wrdivl_w )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
cpustate->wrdiv = (data) | (cpustate->wrdiv & 0xff00);
}
static WRITE8_HANDLER( wrdivh_w )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
cpustate->wrdiv = (data << 8) | (cpustate->wrdiv & 0xff);
}
static WRITE8_HANDLER( wrdvdd_w )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
UINT16 quotient, remainder;
cpustate->dvdd = data;
@@ -629,31 +629,31 @@ static WRITE8_HANDLER( wrdvdd_w )
static WRITE8_HANDLER( memsel_w )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
cpustate->fastROM = data & 1;
}
static READ8_HANDLER( rddivl_r )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
return cpustate->rddiv & 0xff;
}
static READ8_HANDLER( rddivh_r )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
return cpustate->rddiv >> 8;
}
static READ8_HANDLER( rdmpyl_r )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
return cpustate->rdmpy & 0xff;
}
static READ8_HANDLER( rdmpyh_r )
{
- g65816i_cpu_struct *cpustate = get_safe_token(&space->device());
+ g65816i_cpu_struct *cpustate = get_safe_token(&space.device());
return cpustate->rdmpy >> 8;
}
diff --git a/src/emu/cpu/g65816/g65816op.h b/src/emu/cpu/g65816/g65816op.h
index d8b852a9004..55532a10fbc 100644
--- a/src/emu/cpu/g65816/g65816op.h
+++ b/src/emu/cpu/g65816/g65816op.h
@@ -85,7 +85,7 @@ INLINE uint g65816i_read_8_direct(g65816i_cpu_struct *cpustate, uint address)
INLINE uint g65816i_read_8_vector(g65816i_cpu_struct *cpustate, uint address)
{
if (READ_VECTOR)
- return READ_VECTOR(cpustate->program, address);
+ return READ_VECTOR(*cpustate->program, address);
else
return g65816i_read_8_normal(cpustate, address);
}
diff --git a/src/emu/cpu/h6280/h6280.c b/src/emu/cpu/h6280/h6280.c
index 382910e827b..9d303120f70 100644
--- a/src/emu/cpu/h6280/h6280.c
+++ b/src/emu/cpu/h6280/h6280.c
@@ -288,7 +288,7 @@ static void set_irq_line(h6280_Regs* cpustate, int irqline, int state)
READ8_HANDLER( h6280_irq_status_r )
{
int status;
- h6280_Regs *cpustate = get_safe_token(&space->device());
+ h6280_Regs *cpustate = get_safe_token(&space.device());
switch (offset&3)
{
@@ -307,7 +307,7 @@ READ8_HANDLER( h6280_irq_status_r )
WRITE8_HANDLER( h6280_irq_status_w )
{
- h6280_Regs *cpustate = get_safe_token(&space->device());
+ h6280_Regs *cpustate = get_safe_token(&space.device());
cpustate->io_buffer=data;
switch (offset&3)
{
@@ -326,13 +326,13 @@ WRITE8_HANDLER( h6280_irq_status_w )
READ8_HANDLER( h6280_timer_r )
{
/* only returns countdown */
- h6280_Regs *cpustate = get_safe_token(&space->device());
+ h6280_Regs *cpustate = get_safe_token(&space.device());
return ((cpustate->timer_value >> 10)&0x7F)|(cpustate->io_buffer&0x80);
}
WRITE8_HANDLER( h6280_timer_w )
{
- h6280_Regs *cpustate = get_safe_token(&space->device());
+ h6280_Regs *cpustate = get_safe_token(&space.device());
cpustate->io_buffer=data;
switch (offset & 1) {
case 0: /* Counter preload */
diff --git a/src/emu/cpu/h83002/h8_16.c b/src/emu/cpu/h83002/h8_16.c
index 2fcce22ce83..511ba2f7b48 100644
--- a/src/emu/cpu/h83002/h8_16.c
+++ b/src/emu/cpu/h83002/h8_16.c
@@ -536,7 +536,7 @@ static CPU_SET_INFO( h8s_2394 )
static READ16_HANDLER( h8_itu_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
@@ -557,7 +557,7 @@ static READ16_HANDLER( h8_itu_r )
static WRITE16_HANDLER( h8_itu_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
@@ -577,7 +577,7 @@ static WRITE16_HANDLER( h8_itu_w )
static READ16_HANDLER( h8_3007_itu_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
@@ -597,7 +597,7 @@ static READ16_HANDLER( h8_3007_itu_r )
}
static WRITE16_HANDLER( h8_3007_itu_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
@@ -617,7 +617,7 @@ static WRITE16_HANDLER( h8_3007_itu_w )
static READ16_HANDLER( h8_3007_itu1_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
@@ -637,7 +637,7 @@ static READ16_HANDLER( h8_3007_itu1_r )
}
static WRITE16_HANDLER( h8_3007_itu1_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
@@ -657,7 +657,7 @@ static WRITE16_HANDLER( h8_3007_itu1_w )
static WRITE16_HANDLER( h8s2241_per_regs_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
h8s2241_per_regs_write_16(h8, (offset << 1), data);
@@ -674,7 +674,7 @@ static WRITE16_HANDLER( h8s2241_per_regs_w )
static WRITE16_HANDLER( h8s2246_per_regs_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
h8s2246_per_regs_write_16(h8, (offset << 1), data);
@@ -691,7 +691,7 @@ static WRITE16_HANDLER( h8s2246_per_regs_w )
static WRITE16_HANDLER( h8s2323_per_regs_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
h8s2323_per_regs_write_16(h8, (offset << 1), data);
@@ -708,7 +708,7 @@ static WRITE16_HANDLER( h8s2323_per_regs_w )
static WRITE16_HANDLER( h8s2394_per_regs_w )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
h8s2394_per_regs_write_16(h8, (offset << 1), data);
@@ -725,7 +725,7 @@ static WRITE16_HANDLER( h8s2394_per_regs_w )
static READ16_HANDLER( h8s2241_per_regs_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
return h8s2241_per_regs_read_16(h8, (offset << 1));
@@ -743,7 +743,7 @@ static READ16_HANDLER( h8s2241_per_regs_r )
static READ16_HANDLER( h8s2246_per_regs_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
return h8s2246_per_regs_read_16(h8, (offset << 1));
@@ -761,7 +761,7 @@ static READ16_HANDLER( h8s2246_per_regs_r )
static READ16_HANDLER( h8s2323_per_regs_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
return h8s2323_per_regs_read_16(h8, (offset << 1));
@@ -779,7 +779,7 @@ static READ16_HANDLER( h8s2323_per_regs_r )
static READ16_HANDLER( h8s2394_per_regs_r )
{
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
if (mem_mask == 0xffff)
{
return h8s2394_per_regs_read_16(h8, (offset << 1));
diff --git a/src/emu/cpu/h83002/h8_8.c b/src/emu/cpu/h83002/h8_8.c
index 73f3273d5c7..3102c6e7d0f 100644
--- a/src/emu/cpu/h83002/h8_8.c
+++ b/src/emu/cpu/h83002/h8_8.c
@@ -515,7 +515,7 @@ static READ8_HANDLER( h8330_itu_r )
UINT8 reg;
UINT64 frc;
static const UINT64 divider[4] = { 2, 8, 32, 1 };
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
reg = (offset + 0x88) & 0xff;
@@ -603,7 +603,7 @@ static READ8_HANDLER( h8330_itu_r )
static WRITE8_HANDLER( h8330_itu_w )
{
UINT8 reg;
- h83xx_state *h8 = get_safe_token(&space->device());
+ h83xx_state *h8 = get_safe_token(&space.device());
reg = (offset + 0x88) & 0xff;
diff --git a/src/emu/cpu/lh5801/5801tbl.c b/src/emu/cpu/lh5801/5801tbl.c
index 3ebaa96691f..65701c50f4a 100644
--- a/src/emu/cpu/lh5801/5801tbl.c
+++ b/src/emu/cpu/lh5801/5801tbl.c
@@ -35,10 +35,10 @@ INLINE void lh5801_adc(lh5801_state *cpustate, UINT8 data)
cpustate->a=lh5801_add_generic(cpustate,cpustate->a,data,cpustate->t&C);
}
-INLINE void lh5801_add_mem(lh5801_state *cpustate, address_space *space, int addr, UINT8 data)
+INLINE void lh5801_add_mem(lh5801_state *cpustate, address_space &space, int addr, UINT8 data)
{
- int v=lh5801_add_generic(cpustate, space->read_byte(addr),data,0);
- space->write_byte(addr,v);
+ int v=lh5801_add_generic(cpustate, space.read_byte(addr),data,0);
+ space.write_byte(addr,v);
}
INLINE void lh5801_adr(lh5801_state *cpustate, PAIR *reg)
@@ -95,12 +95,12 @@ INLINE void lh5801_and(lh5801_state *cpustate, UINT8 data)
if (!cpustate->a) cpustate->t|=Z;
}
-INLINE void lh5801_and_mem(lh5801_state *cpustate, address_space *space, int addr, UINT8 data)
+INLINE void lh5801_and_mem(lh5801_state *cpustate, address_space &space, int addr, UINT8 data)
{
- data&=space->read_byte(addr);
+ data&=space.read_byte(addr);
cpustate->t&=~Z;
if (!data) cpustate->t|=Z;
- space->write_byte(addr,data);
+ space.write_byte(addr,data);
}
INLINE void lh5801_bit(lh5801_state *cpustate, UINT8 a, UINT8 b)
@@ -123,12 +123,12 @@ INLINE void lh5801_ora(lh5801_state *cpustate, UINT8 data)
if (!cpustate->a) cpustate->t|=Z;
}
-INLINE void lh5801_ora_mem(lh5801_state *cpustate, address_space *space, int addr, UINT8 data)
+INLINE void lh5801_ora_mem(lh5801_state *cpustate, address_space &space, int addr, UINT8 data)
{
- data|=space->read_byte(addr);
+ data|=space.read_byte(addr);
cpustate->t&=~Z;
if (!data) cpustate->t|=Z;
- space->write_byte(addr,data);
+ space.write_byte(addr,data);
}
INLINE void lh5801_lda(lh5801_state *cpustate, UINT8 data)
@@ -270,20 +270,20 @@ INLINE void lh5801_aex(lh5801_state *cpustate)
// flags?
}
-INLINE void lh5801_drl(lh5801_state *cpustate, address_space *space, int adr)
+INLINE void lh5801_drl(lh5801_state *cpustate, address_space &space, int adr)
{
- UINT16 t=cpustate->a|(space->read_byte(adr)<<8);
+ UINT16 t=cpustate->a|(space.read_byte(adr)<<8);
cpustate->a=t>>8;
- space->write_byte(adr,t>>4);
+ space.write_byte(adr,t>>4);
}
-INLINE void lh5801_drr(lh5801_state *cpustate, address_space *space, int adr)
+INLINE void lh5801_drr(lh5801_state *cpustate, address_space &space, int adr)
{
- UINT16 t=space->read_byte(adr)|(cpustate->a<<8);
+ UINT16 t=space.read_byte(adr)|(cpustate->a<<8);
cpustate->a=t;
- space->write_byte(adr,t>>4);
+ space.write_byte(adr,t>>4);
}
INLINE void lh5801_rol(lh5801_state *cpustate)
@@ -398,29 +398,29 @@ static void lh5801_instruction_fd(lh5801_state *cpustate)
case 0x40: lh5801_inc(cpustate,&XH);cpustate->icount-=9;break;
case 0x42: lh5801_dec(cpustate,&XH);cpustate->icount-=9;break;
case 0x48: X=S;cpustate->icount-=11;break;
- case 0x49: lh5801_and_mem(cpustate, cpustate->io, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x49: lh5801_and_mem(cpustate, *cpustate->io, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x4a: X=X;cpustate->icount-=11;break; //!!!
- case 0x4b: lh5801_ora_mem(cpustate, cpustate->io, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x4b: lh5801_ora_mem(cpustate, *cpustate->io, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x4c: cpustate->bf=0;/*off !*/ cpustate->icount-=8;break;
case 0x4d: lh5801_bit(cpustate,cpustate->io->read_byte(X), cpustate->direct->read_decrypted_byte(P++));cpustate->icount-=14;break;
case 0x4e: S=X;cpustate->icount-=11;break;
- case 0x4f: lh5801_add_mem(cpustate, cpustate->io, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x4f: lh5801_add_mem(cpustate, *cpustate->io, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x50: lh5801_inc(cpustate,&YH);cpustate->icount-=9;break;
case 0x52: lh5801_dec(cpustate,&YH);cpustate->icount-=9;break;
case 0x58: X=P;cpustate->icount-=11;break;
- case 0x59: lh5801_and_mem(cpustate, cpustate->io, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x59: lh5801_and_mem(cpustate, *cpustate->io, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x5a: Y=X;cpustate->icount-=11;break;
- case 0x5b: lh5801_ora_mem(cpustate, cpustate->io, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x5b: lh5801_ora_mem(cpustate, *cpustate->io, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x5d: lh5801_bit(cpustate,cpustate->io->read_byte(Y), cpustate->direct->read_decrypted_byte(P++));cpustate->icount-=14;break;
case 0x5e: lh5801_jmp(cpustate,X);cpustate->icount-=11;break; // P=X
- case 0x5f: lh5801_add_mem(cpustate, cpustate->io, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x5f: lh5801_add_mem(cpustate, *cpustate->io, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x60: lh5801_inc(cpustate,&UH);cpustate->icount-=9;break;
case 0x62: lh5801_dec(cpustate,&UH);cpustate->icount-=9;break;
- case 0x69: lh5801_and_mem(cpustate, cpustate->io, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x69: lh5801_and_mem(cpustate, *cpustate->io, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x6a: U=X;cpustate->icount-=11;break;
- case 0x6b: lh5801_ora_mem(cpustate, cpustate->io, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x6b: lh5801_ora_mem(cpustate, *cpustate->io, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x6d: lh5801_bit(cpustate,cpustate->io->read_byte(X), cpustate->direct->read_decrypted_byte(P++));cpustate->icount-=14;break;
- case 0x6f: lh5801_add_mem(cpustate, cpustate->io, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
+ case 0x6f: lh5801_add_mem(cpustate, *cpustate->io, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=17;break;
case 0x81: cpustate->t|=IE; /*sie !*/cpustate->icount-=8;break;
case 0x88: lh5801_push_word(cpustate,X); cpustate->icount-=14;break;
case 0x8a: lh5801_pop(cpustate); cpustate->icount-=12; break;
@@ -449,18 +449,18 @@ static void lh5801_instruction_fd(lh5801_state *cpustate)
case 0xca: lh5801_adr(cpustate,&cpustate->x);cpustate->icount-=11;break;
case 0xcc: /*atp sends a to data bus*/cpustate->icount-=9;break;
case 0xce: lh5801_am(cpustate,cpustate->a); cpustate->icount-=9; break;
- case 0xd3: lh5801_drr(cpustate, cpustate->io, X); cpustate->icount-=16; break;
- case 0xd7: lh5801_drl(cpustate, cpustate->io, X); cpustate->icount-=16; break;
+ case 0xd3: lh5801_drr(cpustate, *cpustate->io, X); cpustate->icount-=16; break;
+ case 0xd7: lh5801_drl(cpustate, *cpustate->io, X); cpustate->icount-=16; break;
case 0xda: lh5801_adr(cpustate,&cpustate->y);cpustate->icount-=11;break;
case 0xde: lh5801_am(cpustate,cpustate->a|0x100); cpustate->icount-=9; break;
case 0xea: lh5801_adr(cpustate,&cpustate->u);cpustate->icount-=11;break;
case 0xe9:
adr=lh5801_readop_word(cpustate);
- lh5801_and_mem(cpustate, cpustate->io, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=23;
+ lh5801_and_mem(cpustate, *cpustate->io, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=23;
break;
case 0xeb:
adr=lh5801_readop_word(cpustate);
- lh5801_ora_mem(cpustate, cpustate->io, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=23;
+ lh5801_ora_mem(cpustate, *cpustate->io, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=23;
break;
case 0xec: cpustate->t=cpustate->a; cpustate->icount-=9;break;
case 0xed:
@@ -469,7 +469,7 @@ static void lh5801_instruction_fd(lh5801_state *cpustate)
cpustate->icount-=20;break;
case 0xef:
adr=lh5801_readop_word(cpustate);
- lh5801_add_mem(cpustate, cpustate->io, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=23;
+ lh5801_add_mem(cpustate, *cpustate->io, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=23;
break;
default:
@@ -542,13 +542,13 @@ static void lh5801_instruction(lh5801_state *cpustate)
case 0x46: X--;cpustate->icount-=5;break;
case 0x47: lh5801_lde(cpustate,&cpustate->x);cpustate->icount-=6;break;
case 0x48: XH=cpustate->direct->read_decrypted_byte(P++);cpustate->icount-=6;break;
- case 0x49: lh5801_and_mem(cpustate, cpustate->program, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x49: lh5801_and_mem(cpustate, *cpustate->program, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x4a: XL=cpustate->direct->read_decrypted_byte(P++);cpustate->icount-=6;break;
- case 0x4b: lh5801_ora_mem(cpustate, cpustate->program, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x4b: lh5801_ora_mem(cpustate, *cpustate->program, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x4c: lh5801_cpa(cpustate,XH, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
case 0x4d: lh5801_bit(cpustate,cpustate->program->read_byte(X), cpustate->direct->read_decrypted_byte(P++));cpustate->icount-=10;break;
case 0x4e: lh5801_cpa(cpustate,XL, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
- case 0x4f: lh5801_add_mem(cpustate, cpustate->program, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x4f: lh5801_add_mem(cpustate, *cpustate->program, X, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x50: lh5801_inc(cpustate,&YL);cpustate->icount-=5;break;
case 0x51: lh5801_sin(cpustate,&cpustate->y); cpustate->icount-=6;break;
case 0x52: lh5801_dec(cpustate,&YL);cpustate->icount-=5;break;
@@ -558,13 +558,13 @@ static void lh5801_instruction(lh5801_state *cpustate)
case 0x56: Y--;cpustate->icount-=5;break;
case 0x57: lh5801_lde(cpustate,&cpustate->y);cpustate->icount-=6;break;
case 0x58: YH=cpustate->direct->read_decrypted_byte(P++);cpustate->icount-=6;break;
- case 0x59: lh5801_and_mem(cpustate, cpustate->program, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x59: lh5801_and_mem(cpustate, *cpustate->program, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x5a: YL=cpustate->direct->read_decrypted_byte(P++);cpustate->icount-=6;break;
- case 0x5b: lh5801_ora_mem(cpustate, cpustate->program, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x5b: lh5801_ora_mem(cpustate, *cpustate->program, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x5c: lh5801_cpa(cpustate,YH, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
case 0x5d: lh5801_bit(cpustate,cpustate->program->read_byte(Y), cpustate->direct->read_decrypted_byte(P++));cpustate->icount-=10;break;
case 0x5e: lh5801_cpa(cpustate,YL, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
- case 0x5f: lh5801_add_mem(cpustate, cpustate->program, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x5f: lh5801_add_mem(cpustate, *cpustate->program, Y, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x60: lh5801_inc(cpustate,&UL);cpustate->icount-=5;break;
case 0x61: lh5801_sin(cpustate,&cpustate->u); cpustate->icount-=6;break;
case 0x62: lh5801_dec(cpustate,&UL);cpustate->icount-=5;break;
@@ -574,13 +574,13 @@ static void lh5801_instruction(lh5801_state *cpustate)
case 0x66: U--;cpustate->icount-=5;break;
case 0x67: lh5801_lde(cpustate,&cpustate->u);cpustate->icount-=6;break;
case 0x68: UH=cpustate->direct->read_decrypted_byte(P++);cpustate->icount-=6;break;
- case 0x69: lh5801_and_mem(cpustate, cpustate->program, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x69: lh5801_and_mem(cpustate, *cpustate->program, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x6a: UL=cpustate->direct->read_decrypted_byte(P++);cpustate->icount-=6;break;
- case 0x6b: lh5801_ora_mem(cpustate, cpustate->program, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x6b: lh5801_ora_mem(cpustate, *cpustate->program, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x6c: lh5801_cpa(cpustate,UH, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
case 0x6d: lh5801_bit(cpustate,cpustate->program->read_byte(U), cpustate->direct->read_decrypted_byte(P++));cpustate->icount-=10;break;
case 0x6e: lh5801_cpa(cpustate,UL, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
- case 0x6f: lh5801_add_mem(cpustate, cpustate->program, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
+ case 0x6f: lh5801_add_mem(cpustate, *cpustate->program, U, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=13;break;
case 0x80: lh5801_sbc(cpustate,XH); cpustate->icount-=6;break;
case 0x81: lh5801_branch_plus(cpustate,!(cpustate->t&C)); cpustate->icount-=8; break;
case 0x82: lh5801_adc(cpustate,XH); cpustate->icount-=6;break;
@@ -648,9 +648,9 @@ static void lh5801_instruction(lh5801_state *cpustate)
case 0xcd: lh5801_vector(cpustate,1, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=7;break;
case 0xcf: lh5801_vector(cpustate,cpustate->t&V, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=8;break;
case 0xd1: lh5801_ror(cpustate); cpustate->icount-=6; break;
- case 0xd3: lh5801_drr(cpustate, cpustate->program, X); cpustate->icount-=12; break;
+ case 0xd3: lh5801_drr(cpustate, *cpustate->program, X); cpustate->icount-=12; break;
case 0xd5: lh5801_shr(cpustate); cpustate->icount-=6; break;
- case 0xd7: lh5801_drl(cpustate, cpustate->program, X); cpustate->icount-=12; break;
+ case 0xd7: lh5801_drl(cpustate, *cpustate->program, X); cpustate->icount-=12; break;
case 0xd9: lh5801_shl(cpustate); cpustate->icount-=6; break;
case 0xdb: lh5801_rol(cpustate); cpustate->icount-=6; break;
case 0xdd: lh5801_inc(cpustate,&cpustate->a);cpustate->icount-=5;break;
@@ -658,17 +658,17 @@ static void lh5801_instruction(lh5801_state *cpustate)
case 0xe1: cpustate->pu=1;/*spu!*/ cpustate->icount-=4; break;
case 0xe3: cpustate->pu=0;/*rpu!*/ cpustate->icount-=4; break;
case 0xe9:
- adr=lh5801_readop_word(cpustate);lh5801_and_mem(cpustate, cpustate->program, adr, cpustate->direct->read_decrypted_byte(P++));
+ adr=lh5801_readop_word(cpustate);lh5801_and_mem(cpustate, *cpustate->program, adr, cpustate->direct->read_decrypted_byte(P++));
cpustate->icount-=19;break;
case 0xeb:
- adr=lh5801_readop_word(cpustate);lh5801_ora_mem(cpustate, cpustate->program, adr, cpustate->direct->read_decrypted_byte(P++));
+ adr=lh5801_readop_word(cpustate);lh5801_ora_mem(cpustate, *cpustate->program, adr, cpustate->direct->read_decrypted_byte(P++));
cpustate->icount-=19;break;
case 0xed:
adr=lh5801_readop_word(cpustate);lh5801_bit(cpustate,cpustate->program->read_byte(adr), cpustate->direct->read_decrypted_byte(P++));
cpustate->icount-=16;break;
case 0xef:
adr=lh5801_readop_word(cpustate);
- lh5801_add_mem(cpustate, cpustate->program, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=19;
+ lh5801_add_mem(cpustate, *cpustate->program, adr, cpustate->direct->read_decrypted_byte(P++)); cpustate->icount-=19;
break;
case 0xf1: lh5801_aex(cpustate); cpustate->icount-=6; break;
case 0xf5: cpustate->program->write_byte(Y++, cpustate->program->read_byte(X++)); cpustate->icount-=7; break; //tin
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index e1d67504fde..598980dd0a8 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -599,7 +599,7 @@ static void m37710_internal_w(m37710i_cpu_struct *cpustate, int offset, UINT8 da
static READ16_HANDLER( m37710_internal_word_r )
{
- m37710i_cpu_struct *cpustate = get_safe_token(&space->device());
+ m37710i_cpu_struct *cpustate = get_safe_token(&space.device());
UINT16 ret = 0;
if (mem_mask & 0x00ff)
@@ -612,7 +612,7 @@ static READ16_HANDLER( m37710_internal_word_r )
static WRITE16_HANDLER( m37710_internal_word_w )
{
- m37710i_cpu_struct *cpustate = get_safe_token(&space->device());
+ m37710i_cpu_struct *cpustate = get_safe_token(&space.device());
if (mem_mask & 0x00ff)
m37710_internal_w(cpustate, offset*2, data & 0xff);
diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c
index 9b8afb813fd..1c259efe054 100644
--- a/src/emu/cpu/m6502/m4510.c
+++ b/src/emu/cpu/m6502/m4510.c
@@ -346,7 +346,7 @@ UINT8 m4510_get_port(legacy_cpu_device *device)
static READ8_HANDLER( m4510_read_0000 )
{
UINT8 result = 0x00;
- m4510_Regs *cpustate = get_safe_token(&space->device());
+ m4510_Regs *cpustate = get_safe_token(&space.device());
switch(offset)
{
@@ -363,7 +363,7 @@ static READ8_HANDLER( m4510_read_0000 )
static WRITE8_HANDLER( m4510_write_0000 )
{
- m4510_Regs *cpustate = get_safe_token(&space->device());
+ m4510_Regs *cpustate = get_safe_token(&space.device());
switch(offset)
{
@@ -375,7 +375,7 @@ static WRITE8_HANDLER( m4510_write_0000 )
break;
}
- cpustate->out_port_func(0, m4510_get_port(downcast<legacy_cpu_device *>(&space->device())));
+ cpustate->out_port_func(0, m4510_get_port(downcast<legacy_cpu_device *>(&space.device())));
}
static ADDRESS_MAP_START(m4510_mem, AS_PROGRAM, 8, legacy_cpu_device)
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
index add50195952..38bd935763e 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -374,7 +374,7 @@ UINT8 m6510_get_port(legacy_cpu_device *device)
static READ8_HANDLER( m6510_read_0000 )
{
- m6502_Regs *cpustate = get_safe_token(&space->device());
+ m6502_Regs *cpustate = get_safe_token(&space.device());
UINT8 result = 0x00;
switch(offset)
@@ -400,7 +400,7 @@ static READ8_HANDLER( m6510_read_0000 )
static WRITE8_HANDLER( m6510_write_0000 )
{
- m6502_Regs *cpustate = get_safe_token(&space->device());
+ m6502_Regs *cpustate = get_safe_token(&space.device());
switch(offset)
{
diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c
index a8ed661689c..405452cddf8 100644
--- a/src/emu/cpu/m6502/m6509.c
+++ b/src/emu/cpu/m6502/m6509.c
@@ -102,21 +102,21 @@ INLINE m6509_Regs *get_safe_token(device_t *device)
static READ8_HANDLER( m6509_read_00000 )
{
- m6509_Regs *cpustate = get_safe_token(&space->device());
+ m6509_Regs *cpustate = get_safe_token(&space.device());
return cpustate->pc_bank.b.h2;
}
static READ8_HANDLER( m6509_read_00001 )
{
- m6509_Regs *cpustate = get_safe_token(&space->device());
+ m6509_Regs *cpustate = get_safe_token(&space.device());
return cpustate->ind_bank.b.h2;
}
static WRITE8_HANDLER( m6509_write_00000 )
{
- m6509_Regs *cpustate = get_safe_token(&space->device());
+ m6509_Regs *cpustate = get_safe_token(&space.device());
cpustate->pc_bank.b.h2=data&0xf;
cpustate->pc.w.h=cpustate->pc_bank.w.h;
@@ -124,7 +124,7 @@ static WRITE8_HANDLER( m6509_write_00000 )
static WRITE8_HANDLER( m6509_write_00001 )
{
- m6509_Regs *cpustate = get_safe_token(&space->device());
+ m6509_Regs *cpustate = get_safe_token(&space.device());
cpustate->ind_bank.b.h2=data&0xf;
}
diff --git a/src/emu/cpu/m6502/mincce02.h b/src/emu/cpu/m6502/mincce02.h
index fca4d51044f..a54d02fec9e 100644
--- a/src/emu/cpu/m6502/mincce02.h
+++ b/src/emu/cpu/m6502/mincce02.h
@@ -47,8 +47,8 @@
#define PPC cpustate->ppc.d
-#define RDMEM_ID(a) cpustate->rdmem_id(cpustate->space, a)
-#define WRMEM_ID(a,d) cpustate->wrmem_id(cpustate->space, a, d)
+#define RDMEM_ID(a) cpustate->rdmem_id(*cpustate->space, a)
+#define WRMEM_ID(a,d) cpustate->wrmem_id(*cpustate->space, a, d)
#define IRQ_STATE cpustate->irq_state
#define AFTER_CLI cpustate->after_cli
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index abaefffb24b..448c5787aa3 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1396,7 +1396,7 @@ INLINE void set_os3(m6800_state *cpustate, int state)
READ8_HANDLER( m6801_io_r )
{
- m6800_state *cpustate = get_safe_token(&space->device());
+ m6800_state *cpustate = get_safe_token(&space.device());
UINT8 data = 0;
@@ -1427,7 +1427,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_P3DDR:
- logerror("M6801 '%s' Port 3 DDR is a write-only register\n", space->device().tag());
+ logerror("M6801 '%s' Port 3 DDR is a write-only register\n", space.device().tag());
break;
case IO_P4DDR:
@@ -1435,11 +1435,11 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_P3DATA:
- if (!space->debugger_access())
+ if (!space.debugger_access())
{
if (cpustate->p3csr_is3_flag_read)
{
- //logerror("M6801 '%s' Cleared IS3\n", space->device().tag());
+ //logerror("M6801 '%s' Cleared IS3\n", space.device().tag());
cpustate->p3csr &= ~M6801_P3CSR_IS3_FLAG;
cpustate->p3csr_is3_flag_read = 0;
}
@@ -1456,7 +1456,7 @@ READ8_HANDLER( m6801_io_r )
data = (cpustate->io->read_byte(M6801_PORT3) & (cpustate->port3_ddr ^ 0xff))
| (cpustate->port3_data & cpustate->port3_ddr);
- if (!space->debugger_access())
+ if (!space.debugger_access())
{
cpustate->port3_latched = 0;
@@ -1481,7 +1481,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_CH:
- if(!(cpustate->pending_tcsr&TCSR_TOF) && !space->debugger_access())
+ if(!(cpustate->pending_tcsr&TCSR_TOF) && !space.debugger_access())
{
cpustate->tcsr &= ~TCSR_TOF;
MODIFIED_tcsr;
@@ -1494,7 +1494,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_OCRH:
- if(!(cpustate->pending_tcsr&TCSR_OCF) && !space->debugger_access())
+ if(!(cpustate->pending_tcsr&TCSR_OCF) && !space.debugger_access())
{
cpustate->tcsr &= ~TCSR_OCF;
MODIFIED_tcsr;
@@ -1503,7 +1503,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_OCRL:
- if(!(cpustate->pending_tcsr&TCSR_OCF) && !space->debugger_access())
+ if(!(cpustate->pending_tcsr&TCSR_OCF) && !space.debugger_access())
{
cpustate->tcsr &= ~TCSR_OCF;
MODIFIED_tcsr;
@@ -1512,7 +1512,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_ICRH:
- if(!(cpustate->pending_tcsr&TCSR_ICF) && !space->debugger_access())
+ if(!(cpustate->pending_tcsr&TCSR_ICF) && !space.debugger_access())
{
cpustate->tcsr &= ~TCSR_ICF;
MODIFIED_tcsr;
@@ -1525,7 +1525,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_P3CSR:
- if ((cpustate->p3csr & M6801_P3CSR_IS3_FLAG) && !space->debugger_access())
+ if ((cpustate->p3csr & M6801_P3CSR_IS3_FLAG) && !space.debugger_access())
{
cpustate->p3csr_is3_flag_read = 1;
}
@@ -1538,7 +1538,7 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_TRCSR:
- if (!space->debugger_access())
+ if (!space.debugger_access())
{
if (cpustate->trcsr & M6800_TRCSR_TDRE)
{
@@ -1560,18 +1560,18 @@ READ8_HANDLER( m6801_io_r )
break;
case IO_RDR:
- if (!space->debugger_access())
+ if (!space.debugger_access())
{
if (cpustate->trcsr_read_orfe)
{
- //logerror("M6801 '%s' Cleared ORFE\n", space->device().tag());
+ //logerror("M6801 '%s' Cleared ORFE\n", space.device().tag());
cpustate->trcsr_read_orfe = 0;
cpustate->trcsr &= ~M6800_TRCSR_ORFE;
}
if (cpustate->trcsr_read_rdrf)
{
- //logerror("M6801 '%s' Cleared RDRF\n", space->device().tag());
+ //logerror("M6801 '%s' Cleared RDRF\n", space.device().tag());
cpustate->trcsr_read_rdrf = 0;
cpustate->trcsr &= ~M6800_TRCSR_RDRF;
}
@@ -1600,7 +1600,7 @@ READ8_HANDLER( m6801_io_r )
case IO_ICR2H:
case IO_ICR2L:
default:
- logerror("M6801 '%s' PC %04x: warning - read from reserved internal register %02x\n",space->device().tag(),space->device().safe_pc(),offset);
+ logerror("M6801 '%s' PC %04x: warning - read from reserved internal register %02x\n",space.device().tag(),space.device().safe_pc(),offset);
}
return data;
@@ -1608,12 +1608,12 @@ READ8_HANDLER( m6801_io_r )
WRITE8_HANDLER( m6801_io_w )
{
- m6800_state *cpustate = get_safe_token(&space->device());
+ m6800_state *cpustate = get_safe_token(&space.device());
switch (offset)
{
case IO_P1DDR:
- //logerror("M6801 '%s' Port 1 Data Direction Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 1 Data Direction Register: %02x\n", space.device().tag(), data);
if (cpustate->port1_ddr != data)
{
@@ -1626,7 +1626,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_P2DDR:
- //logerror("M6801 '%s' Port 2 Data Direction Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 2 Data Direction Register: %02x\n", space.device().tag(), data);
if (cpustate->port2_ddr != data)
{
@@ -1634,12 +1634,12 @@ WRITE8_HANDLER( m6801_io_w )
write_port2(cpustate);
if (cpustate->port2_ddr & 2)
- logerror("CPU '%s' PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",space->device().tag(),space->device().safe_pc());
+ logerror("CPU '%s' PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",space.device().tag(),space.device().safe_pc());
}
break;
case IO_P1DATA:
- //logerror("M6801 '%s' Port 1 Data Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 1 Data Register: %02x\n", space.device().tag(), data);
cpustate->port1_data = data;
if(cpustate->port1_ddr == 0xff)
@@ -1649,7 +1649,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_P2DATA:
- //logerror("M6801 '%s' Port 2 Data Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 2 Data Register: %02x\n", space.device().tag(), data);
cpustate->port2_data = data;
cpustate->port2_written = 1;
@@ -1657,7 +1657,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_P3DDR:
- //logerror("M6801 '%s' Port 3 Data Direction Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 3 Data Direction Register: %02x\n", space.device().tag(), data);
if (cpustate->port3_ddr != data)
{
@@ -1670,7 +1670,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_P4DDR:
- //logerror("M6801 '%s' Port 4 Data Direction Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 4 Data Direction Register: %02x\n", space.device().tag(), data);
if (cpustate->port4_ddr != data)
{
@@ -1683,11 +1683,11 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_P3DATA:
- //logerror("M6801 '%s' Port 3 Data Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 3 Data Register: %02x\n", space.device().tag(), data);
if (cpustate->p3csr_is3_flag_read)
{
- //logerror("M6801 '%s' Cleared IS3\n", space->device().tag());
+ //logerror("M6801 '%s' Cleared IS3\n", space.device().tag());
cpustate->p3csr &= ~M6801_P3CSR_IS3_FLAG;
cpustate->p3csr_is3_flag_read = 0;
}
@@ -1710,7 +1710,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_P4DATA:
- //logerror("M6801 '%s' Port 4 Data Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 4 Data Register: %02x\n", space.device().tag(), data);
cpustate->port4_data = data;
if(cpustate->port4_ddr == 0xff)
@@ -1720,7 +1720,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_TCSR:
- //logerror("M6801 '%s' Timer Control and Status Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Timer Control and Status Register: %02x\n", space.device().tag(), data);
cpustate->tcsr = data;
cpustate->pending_tcsr &= cpustate->tcsr;
@@ -1730,7 +1730,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_CH:
- //logerror("M6801 '%s' Counter High Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Counter High Register: %02x\n", space.device().tag(), data);
cpustate->latch09 = data & 0xff; /* 6301 only */
CT = 0xfff8;
@@ -1739,7 +1739,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_CL: /* 6301 only */
- //logerror("M6801 '%s' Counter Low Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Counter Low Register: %02x\n", space.device().tag(), data);
CT = (cpustate->latch09 << 8) | (data & 0xff);
TOH = CTH;
@@ -1747,7 +1747,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_OCRH:
- //logerror("M6801 '%s' Output Compare High Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Output Compare High Register: %02x\n", space.device().tag(), data);
if( cpustate->output_compare.b.h != data)
{
@@ -1757,7 +1757,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_OCRL:
- //logerror("M6801 '%s' Output Compare Low Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Output Compare Low Register: %02x\n", space.device().tag(), data);
if( cpustate->output_compare.b.l != data)
{
@@ -1769,23 +1769,23 @@ WRITE8_HANDLER( m6801_io_w )
case IO_ICRH:
case IO_ICRL:
case IO_RDR:
- //logerror("CPU '%s' PC %04x: warning - write %02x to read only internal register %02x\n",space->device().tag(),space->device().safe_pc(),data,offset);
+ //logerror("CPU '%s' PC %04x: warning - write %02x to read only internal register %02x\n",space.device().tag(),space.device().safe_pc(),data,offset);
break;
case IO_P3CSR:
- //logerror("M6801 '%s' Port 3 Control and Status Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Port 3 Control and Status Register: %02x\n", space.device().tag(), data);
cpustate->p3csr = data;
break;
case IO_RMCR:
- //logerror("M6801 '%s' Rate and Mode Control Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Rate and Mode Control Register: %02x\n", space.device().tag(), data);
set_rmcr(cpustate, data);
break;
case IO_TRCSR:
- //logerror("M6801 '%s' Transmit/Receive Control and Status Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' Transmit/Receive Control and Status Register: %02x\n", space.device().tag(), data);
if ((data & M6800_TRCSR_TE) && !(cpustate->trcsr & M6800_TRCSR_TE))
{
@@ -1803,7 +1803,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_TDR:
- //logerror("M6800 '%s' Transmit Data Register: %02x\n", space->device().tag(), data);
+ //logerror("M6800 '%s' Transmit Data Register: %02x\n", space.device().tag(), data);
if (cpustate->trcsr_read_tdre)
{
@@ -1814,7 +1814,7 @@ WRITE8_HANDLER( m6801_io_w )
break;
case IO_RCR:
- //logerror("M6801 '%s' RAM Control Register: %02x\n", space->device().tag(), data);
+ //logerror("M6801 '%s' RAM Control Register: %02x\n", space.device().tag(), data);
cpustate->ram_ctrl = data;
break;
@@ -1831,7 +1831,7 @@ WRITE8_HANDLER( m6801_io_w )
case IO_ICR2H:
case IO_ICR2L:
default:
- logerror("M6801 '%s' PC %04x: warning - write %02x to reserved internal register %02x\n",space->device().tag(),space->device().safe_pc(),data,offset);
+ logerror("M6801 '%s' PC %04x: warning - write %02x to reserved internal register %02x\n",space.device().tag(),space.device().safe_pc(),data,offset);
break;
}
}
diff --git a/src/emu/cpu/m68000/68307bus.c b/src/emu/cpu/m68000/68307bus.c
index bc6785916bd..f065f129173 100644
--- a/src/emu/cpu/m68000/68307bus.c
+++ b/src/emu/cpu/m68000/68307bus.c
@@ -7,29 +7,29 @@
READ8_HANDLER( m68307_internal_mbus_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_mbus* mbus = m68k->m68307MBUS;
assert(mbus != NULL);
UINT8 retval;
if (mbus)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset)
{
case m68307BUS_MADR:
logerror("%08x m68307_internal_mbus_r %08x (MADR - M-Bus Address Register)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68307BUS_MFDR:
logerror("%08x m68307_internal_mbus_r %08x (MFDR - M-Bus Frequency Divider Register)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68307BUS_MBCR:
logerror("%08x m68307_internal_mbus_r %08x (MFCR - M-Bus Control Register)\n", pc, offset);
- return mbus->m_MFCR;//space->machine().rand();
+ return mbus->m_MFCR;//space.machine().rand();
case m68307BUS_MBSR:
logerror("%08x m68307_internal_mbus_r %08x (MBSR - M-Bus Status Register)\n", pc, offset);
@@ -42,7 +42,7 @@ READ8_HANDLER( m68307_internal_mbus_r )
case m68307BUS_MBDR:
logerror("%08x m68307_internal_mbus_r %08x (MBDR - M-Bus Data I/O Register)\n", pc, offset);
mbus->m_intpend = true;
- return 0xff;//space->machine().rand();
+ return 0xff;//space.machine().rand();
default:
logerror("%08x m68307_internal_mbus_r %08x (UNKNOWN / ILLEGAL)\n", pc, offset);
@@ -55,13 +55,13 @@ READ8_HANDLER( m68307_internal_mbus_r )
WRITE8_HANDLER( m68307_internal_mbus_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_mbus* mbus = m68k->m68307MBUS;
assert(mbus != NULL);
if (mbus)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset)
{
diff --git a/src/emu/cpu/m68000/68307ser.c b/src/emu/cpu/m68000/68307ser.c
index cb9cda7da0b..ef4279fd398 100644
--- a/src/emu/cpu/m68000/68307ser.c
+++ b/src/emu/cpu/m68000/68307ser.c
@@ -15,7 +15,7 @@
READ8_HANDLER( m68307_internal_serial_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_serial* serial = m68k->m68307SERIAL;
assert(serial != NULL);
@@ -29,57 +29,57 @@ READ8_HANDLER( m68307_internal_serial_r )
else
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset)
{
case m68307SER_UMR1_UMR2:
logerror("%08x m68307_internal_serial_r %08x (UMR1, UMR2 - UART Mode Register)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68307SER_USR_UCSR:
logerror("%08x m68307_internal_serial_r %08x (USR, UCSR - UART Status/Clock Select Register)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68307SER_UCR:
logerror("%08x m68307_internal_serial_r %08x (UCR - UART Command Register)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68307SER_URB_UTB:
logerror("%08x m68307_internal_serial_r %08x (URB, UTB - UART Recieve/Transmit Buffer)\n", pc, offset);
- return 0xff;//space->machine().rand();
+ return 0xff;//space.machine().rand();
case m68307SER_UIPCR_UACR:
logerror("%08x m68307_internal_serial_r %08x (UIPCR, UACR - UART Input Port Change Register / UART Control Register)\n", pc, offset);
- return 0xff;//space->machine().rand();
+ return 0xff;//space.machine().rand();
case m68307SER_UISR_UIMR:
logerror("%08x m68307_internal_serial_r %08x (UISR, UIMR - UART Interrupt Status Register / UART Interrupt Mask Register)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
case m68307SER_UBG1:
logerror("%08x m68307_internal_serial_r %08x (UBG1 - UART Baud Rate Gen. Precaler MSB)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
case m68307SER_UBG2:
logerror("%08x m68307_internal_serial_r %08x (UBG1 - UART Baud Rate Gen. Precaler LSB)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
case m68307SER_UIVR:
logerror("%08x m68307_internal_serial_r %08x (UIVR - UART Interrupt Vector Register)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
case m68307SER_UIP:
logerror("%08x m68307_internal_serial_r %08x (UIP - UART Register Input Port)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
case m68307SER_UOP1:
logerror("%08x m68307_internal_serial_r %08x (UOP1 - UART Output Port Bit Set Cmd)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
case m68307SER_UOP0:
logerror("%08x m68307_internal_serial_r %08x (UOP0 - UART Output Port Bit Reset Cmd)\n", pc, offset);
- return space->machine().rand() & 0x87;
+ return space.machine().rand() & 0x87;
default:
logerror("%08x m68307_internal_serial_r %08x (UNKNOWN / ILLEGAL)\n", pc, offset);
@@ -93,11 +93,11 @@ READ8_HANDLER( m68307_internal_serial_r )
WRITE8_HANDLER( m68307_internal_serial_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_serial* serial = m68k->m68307SERIAL;
assert(serial != NULL);
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
if (serial)
{
diff --git a/src/emu/cpu/m68000/68307sim.c b/src/emu/cpu/m68000/68307sim.c
index 2e922dabbe2..a53a7e21a1e 100644
--- a/src/emu/cpu/m68000/68307sim.c
+++ b/src/emu/cpu/m68000/68307sim.c
@@ -6,11 +6,11 @@
READ16_HANDLER( m68307_internal_sim_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_sim* sim = m68k->m68307SIM;
assert(sim != NULL);
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
if (sim)
{
@@ -43,11 +43,11 @@ READ16_HANDLER( m68307_internal_sim_r )
WRITE16_HANDLER( m68307_internal_sim_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_sim* sim = m68k->m68307SIM;
assert(sim != NULL);
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
if (sim)
{
@@ -150,10 +150,10 @@ void m68307_sim::write_paddr(UINT16 data, UINT16 mem_mask)
}
-UINT16 m68307_sim::read_padat(address_space *space, UINT16 mem_mask)
+UINT16 m68307_sim::read_padat(address_space &space, UINT16 mem_mask)
{
- int pc = space->device().safe_pc();
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ int pc = space.device().safe_pc();
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
if (m68k->m_m68307_porta_r)
{
@@ -177,10 +177,10 @@ UINT16 m68307_sim::read_padat(address_space *space, UINT16 mem_mask)
}
-void m68307_sim::write_padat(address_space *space, UINT16 data, UINT16 mem_mask)
+void m68307_sim::write_padat(address_space &space, UINT16 data, UINT16 mem_mask)
{
- int pc = space->device().safe_pc();
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ int pc = space.device().safe_pc();
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
COMBINE_DATA(&m_padat);
if (m68k->m_m68307_porta_w)
@@ -203,10 +203,10 @@ void m68307_sim::write_pbddr(UINT16 data, UINT16 mem_mask)
COMBINE_DATA(&m_pbddr);
}
-UINT16 m68307_sim::read_pbdat(address_space *space, UINT16 mem_mask)
+UINT16 m68307_sim::read_pbdat(address_space &space, UINT16 mem_mask)
{
- int pc = space->device().safe_pc();
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ int pc = space.device().safe_pc();
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
if (m68k->m_m68307_portb_r)
{
@@ -230,10 +230,10 @@ UINT16 m68307_sim::read_pbdat(address_space *space, UINT16 mem_mask)
}
-void m68307_sim::write_pbdat(address_space *space, UINT16 data, UINT16 mem_mask)
+void m68307_sim::write_pbdat(address_space &space, UINT16 data, UINT16 mem_mask)
{
- int pc = space->device().safe_pc();
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ int pc = space.device().safe_pc();
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
COMBINE_DATA(&m_pbdat);
if (m68k->m_m68307_portb_w)
diff --git a/src/emu/cpu/m68000/68307sim.h b/src/emu/cpu/m68000/68307sim.h
index ff8e447dd00..b5aff2b21a8 100644
--- a/src/emu/cpu/m68000/68307sim.h
+++ b/src/emu/cpu/m68000/68307sim.h
@@ -51,13 +51,13 @@ class m68307_sim
void write_pacnt(UINT16 data, UINT16 mem_mask);
void write_paddr(UINT16 data, UINT16 mem_mask);
- UINT16 read_padat(address_space *space, UINT16 mem_mask);
- void write_padat(address_space *space, UINT16 data, UINT16 mem_mask);
+ UINT16 read_padat(address_space &space, UINT16 mem_mask);
+ void write_padat(address_space &space, UINT16 data, UINT16 mem_mask);
void write_pbcnt(UINT16 data, UINT16 mem_mask);
void write_pbddr(UINT16 data, UINT16 mem_mask);
- UINT16 read_pbdat(address_space *space, UINT16 mem_mask);
- void write_pbdat(address_space *space, UINT16 data, UINT16 mem_mask);
+ UINT16 read_pbdat(address_space &space, UINT16 mem_mask);
+ void write_pbdat(address_space &space, UINT16 data, UINT16 mem_mask);
diff --git a/src/emu/cpu/m68000/68307tmu.c b/src/emu/cpu/m68000/68307tmu.c
index d4ab8b894e6..bf1916a4566 100644
--- a/src/emu/cpu/m68000/68307tmu.c
+++ b/src/emu/cpu/m68000/68307tmu.c
@@ -6,13 +6,13 @@
READ16_HANDLER( m68307_internal_timer_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_timer* timer = m68k->m68307TIMER;
assert(timer != NULL);
if (timer)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
int which = offset & 0x8;
switch (offset&0x7)
@@ -34,13 +34,13 @@ READ16_HANDLER( m68307_internal_timer_r )
WRITE16_HANDLER( m68307_internal_timer_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68307_timer* timer = m68k->m68307TIMER;
assert(timer != NULL);
if (timer)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
int which = offset & 0x8;
switch (offset&0x7)
diff --git a/src/emu/cpu/m68000/68340dma.c b/src/emu/cpu/m68000/68340dma.c
index 567349b9745..34d604bd064 100644
--- a/src/emu/cpu/m68000/68340dma.c
+++ b/src/emu/cpu/m68000/68340dma.c
@@ -6,13 +6,13 @@
READ32_HANDLER( m68340_internal_dma_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_dma* dma = m68k->m68340DMA;
assert(dma != NULL);
if (dma)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_dma_r %08x, (%08x)\n", pc, offset*4,mem_mask);
}
@@ -21,13 +21,13 @@ READ32_HANDLER( m68340_internal_dma_r )
WRITE32_HANDLER( m68340_internal_dma_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_dma* dma = m68k->m68340DMA;
assert(dma != NULL);
if (dma)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_dma_w %08x, %08x (%08x)\n", pc, offset*4,data,mem_mask);
}
}
diff --git a/src/emu/cpu/m68000/68340ser.c b/src/emu/cpu/m68000/68340ser.c
index e438a92a22e..98565ed58c5 100644
--- a/src/emu/cpu/m68000/68340ser.c
+++ b/src/emu/cpu/m68000/68340ser.c
@@ -6,13 +6,13 @@
READ32_HANDLER( m68340_internal_serial_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_serial* serial = m68k->m68340SERIAL;
assert(serial != NULL);
if (serial)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_serial_r %08x, (%08x)\n", pc, offset*4,mem_mask);
}
@@ -21,13 +21,13 @@ READ32_HANDLER( m68340_internal_serial_r )
WRITE32_HANDLER( m68340_internal_serial_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_serial* serial = m68k->m68340SERIAL;
assert(serial != NULL);
if (serial)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_serial_w %08x, %08x (%08x)\n", pc, offset*4,data,mem_mask);
}
diff --git a/src/emu/cpu/m68000/68340sim.c b/src/emu/cpu/m68000/68340sim.c
index 25753696909..c407ca9baeb 100644
--- a/src/emu/cpu/m68000/68340sim.c
+++ b/src/emu/cpu/m68000/68340sim.c
@@ -6,43 +6,43 @@
READ16_HANDLER( m68340_internal_sim_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_sim* sim = m68k->m68340SIM;
assert(sim != NULL);
if (sim)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset<<1)
{
case m68340SIM_MCR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (MCR - Module Configuration Register)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_SYNCR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (SYNCR - Clock Synthesizer Register)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_AVR_RSR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (AVR, RSR - Auto Vector Register, Reset Status Register)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_SWIV_SYPCR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (SWIV_SYPCR - Software Interrupt Vector, System Protection Control Register)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PICR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (PICR - Periodic Interrupt Control Register)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PITR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (PITR - Periodic Interrupt Timer Register)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_SWSR:
logerror("%08x m68340_internal_sim_r %04x, (%04x) (SWSR - Software Service)\n", pc, offset*2,mem_mask);
- return space->machine().rand();
+ return space.machine().rand();
default:
logerror("%08x m68340_internal_sim_r %04x, (%04x)\n", pc, offset*2,mem_mask);
@@ -57,51 +57,51 @@ READ16_HANDLER( m68340_internal_sim_r )
READ8_HANDLER( m68340_internal_sim_ports_r )
{
offset += 0x10;
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_sim* sim = m68k->m68340SIM;
assert(sim != NULL);
if (sim)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset)
{
case m68340SIM_PORTA:
logerror("%08x m68340_internal_sim_r %04x (PORTA - Port A Data)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_DDRA:
logerror("%08x m68340_internal_sim_r %04x (DDRA - Port A Data Direction)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PPRA1:
logerror("%08x m68340_internal_sim_r %04x (PPRA1 - Port A Pin Assignment 1)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PPRA2:
logerror("%08x m68340_internal_sim_r %04x (PPRA2 - Port A Pin Assignment 2)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PORTB:
logerror("%08x m68340_internal_sim_r %04x (PORTB - Port B Data 0)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PORTB1:
logerror("%08x m68340_internal_sim_r %04x (PORTB1 - Port B Data 1)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_DDRB:
logerror("%08x m68340_internal_sim_r %04x (DDR - Port B Data Direction)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
case m68340SIM_PPARB:
logerror("%08x m68340_internal_sim_r %04x (PPARB - Port B Pin Assignment)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
default:
logerror("%08x m68340_internal_sim_r %04x (ILLEGAL?)\n", pc, offset);
- return space->machine().rand();
+ return space.machine().rand();
}
}
@@ -113,13 +113,13 @@ READ32_HANDLER( m68340_internal_sim_cs_r )
{
offset += m68340SIM_AM_CS0>>2;
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_sim* sim = m68k->m68340SIM;
assert(sim != NULL);
if (sim)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset<<2)
{
@@ -143,13 +143,13 @@ READ32_HANDLER( m68340_internal_sim_cs_r )
WRITE16_HANDLER( m68340_internal_sim_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_sim* sim = m68k->m68340SIM;
assert(sim != NULL);
if (sim)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset<<1)
{
@@ -193,13 +193,13 @@ WRITE16_HANDLER( m68340_internal_sim_w )
WRITE8_HANDLER( m68340_internal_sim_ports_w )
{
offset += 0x10;
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_sim* sim = m68k->m68340SIM;
assert(sim != NULL);
if (sim)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset)
{
@@ -246,13 +246,13 @@ WRITE8_HANDLER( m68340_internal_sim_ports_w )
WRITE32_HANDLER( m68340_internal_sim_cs_w )
{
offset += m68340SIM_AM_CS0>>2;
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_sim* sim = m68k->m68340SIM;
assert(sim != NULL);
if (sim)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
switch (offset<<2)
{
diff --git a/src/emu/cpu/m68000/68340tmu.c b/src/emu/cpu/m68000/68340tmu.c
index 8a878a6a993..f19093c4e10 100644
--- a/src/emu/cpu/m68000/68340tmu.c
+++ b/src/emu/cpu/m68000/68340tmu.c
@@ -7,13 +7,13 @@
READ32_HANDLER( m68340_internal_timer_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_timer* timer = m68k->m68340TIMER;
assert(timer != NULL);
if (timer)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_timer_r %08x, (%08x)\n", pc, offset*4,mem_mask);
}
@@ -22,13 +22,13 @@ READ32_HANDLER( m68340_internal_timer_r )
WRITE32_HANDLER( m68340_internal_timer_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
m68340_timer* timer = m68k->m68340TIMER;
assert(timer != NULL);
if (timer)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_timer_w %08x, %08x (%08x)\n", pc, offset*4,data,mem_mask);
}
}
diff --git a/src/emu/cpu/m68000/m68000.h b/src/emu/cpu/m68000/m68000.h
index 0612bf0cf50..8f6a6e577f3 100644
--- a/src/emu/cpu/m68000/m68000.h
+++ b/src/emu/cpu/m68000/m68000.h
@@ -101,10 +101,10 @@ typedef void (*m68k_cmpild_func)(device_t *device, UINT32 data, UINT8 reg);
typedef void (*m68k_rte_func)(device_t *device);
typedef int (*m68k_tas_func)(device_t *device);
-typedef UINT8 (*m68307_porta_read_callback)(address_space *space, bool dedicated, UINT8 line_mask);
-typedef void (*m68307_porta_write_callback)(address_space *space, bool dedicated, UINT8 data, UINT8 line_mask);
-typedef UINT16 (*m68307_portb_read_callback)(address_space *space, bool dedicated, UINT16 line_mask);
-typedef void (*m68307_portb_write_callback)(address_space *space, bool dedicated, UINT16 data, UINT16 line_mask);
+typedef UINT8 (*m68307_porta_read_callback)(address_space &space, bool dedicated, UINT8 line_mask);
+typedef void (*m68307_porta_write_callback)(address_space &space, bool dedicated, UINT8 data, UINT8 line_mask);
+typedef UINT16 (*m68307_portb_read_callback)(address_space &space, bool dedicated, UINT16 line_mask);
+typedef void (*m68307_portb_write_callback)(address_space &space, bool dedicated, UINT16 data, UINT16 line_mask);
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index 0a1e143709c..60894d717b7 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -2075,9 +2075,9 @@ static CPU_INIT( m68307 )
static READ16_HANDLER( m68307_internal_base_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68307_internal_base_r %08x, (%04x)\n", pc, offset*2,mem_mask);
switch (offset<<1)
@@ -2094,9 +2094,9 @@ static READ16_HANDLER( m68307_internal_base_r )
static WRITE16_HANDLER( m68307_internal_base_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68307_internal_base_w %08x, %04x (%04x)\n", pc, offset*2,data,mem_mask);
int base = 0;
//int mask = 0;
@@ -2763,17 +2763,17 @@ CPU_GET_INFO( scc68070 )
static READ32_HANDLER( m68340_internal_base_r )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
- int pc = space->device().safe_pc();
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_base_r %08x, (%08x)\n", pc, offset*4,mem_mask);
return m68k->m68340_base;
}
static WRITE32_HANDLER( m68340_internal_base_w )
{
- m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x m68340_internal_base_w %08x, %08x (%08x)\n", pc, offset*4,data,mem_mask);
// other conditions?
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index e8c93795d44..5c210db49cb 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -98,13 +98,13 @@ CPU_DISASSEMBLE( r3000le );
#define SETPC(R,x) do { (R)->nextpc = (x); } while (0)
#define SETPCL(R,x,l) do { (R)->nextpc = (x); (R)->r[l] = (R)->pc + 4; } while (0)
-#define RBYTE(R,x) (*(R)->cur.read_byte)((R)->program, x)
-#define RWORD(R,x) (*(R)->cur.read_word)((R)->program, x)
-#define RLONG(R,x) (*(R)->cur.read_dword)((R)->program, x)
+#define RBYTE(R,x) (*(R)->cur.read_byte)(*(R)->program, x)
+#define RWORD(R,x) (*(R)->cur.read_word)(*(R)->program, x)
+#define RLONG(R,x) (*(R)->cur.read_dword)(*(R)->program, x)
-#define WBYTE(R,x,v) (*(R)->cur.write_byte)((R)->program, x, v)
-#define WWORD(R,x,v) (*(R)->cur.write_word)((R)->program, x, v)
-#define WLONG(R,x,v) (*(R)->cur.write_dword)((R)->program, x, v)
+#define WBYTE(R,x,v) (*(R)->cur.write_byte)(*(R)->program, x, v)
+#define WWORD(R,x,v) (*(R)->cur.write_word)(*(R)->program, x, v)
+#define WLONG(R,x,v) (*(R)->cur.write_dword)(*(R)->program, x, v)
#define SR cpr[0][COP0_Status]
#define CAUSE cpr[0][COP0_Cause]
@@ -187,19 +187,19 @@ static void lwr_le(r3000_state *r3000, UINT32 op);
static void swl_le(r3000_state *r3000, UINT32 op);
static void swr_le(r3000_state *r3000, UINT32 op);
-static UINT8 readcache_be(address_space *space, offs_t offset);
-static UINT16 readcache_be_word(address_space *space, offs_t offset);
-static UINT32 readcache_be_dword(address_space *space, offs_t offset);
-static void writecache_be(address_space *space, offs_t offset, UINT8 data);
-static void writecache_be_word(address_space *space, offs_t offset, UINT16 data);
-static void writecache_be_dword(address_space *space, offs_t offset, UINT32 data);
+static UINT8 readcache_be(address_space &space, offs_t offset);
+static UINT16 readcache_be_word(address_space &space, offs_t offset);
+static UINT32 readcache_be_dword(address_space &space, offs_t offset);
+static void writecache_be(address_space &space, offs_t offset, UINT8 data);
+static void writecache_be_word(address_space &space, offs_t offset, UINT16 data);
+static void writecache_be_dword(address_space &space, offs_t offset, UINT32 data);
-static UINT8 readcache_le(address_space *space, offs_t offset);
-static UINT16 readcache_le_word(address_space *space, offs_t offset);
-static UINT32 readcache_le_dword(address_space *space, offs_t offset);
-static void writecache_le(address_space *space, offs_t offset, UINT8 data);
-static void writecache_le_word(address_space *space, offs_t offset, UINT16 data);
-static void writecache_le_dword(address_space *space, offs_t offset, UINT32 data);
+static UINT8 readcache_le(address_space &space, offs_t offset);
+static UINT16 readcache_le_word(address_space &space, offs_t offset);
+static UINT32 readcache_le_dword(address_space &space, offs_t offset);
+static void writecache_le(address_space &space, offs_t offset, UINT8 data);
+static void writecache_le_word(address_space &space, offs_t offset, UINT16 data);
+static void writecache_le_dword(address_space &space, offs_t offset, UINT32 data);
@@ -892,86 +892,86 @@ static CPU_EXECUTE( r3000 )
CACHE I/O
***************************************************************************/
-static UINT8 readcache_be(address_space *space, offs_t offset)
+static UINT8 readcache_be(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? r3000->cache[BYTE4_XOR_BE(offset)] : 0xff;
}
-static UINT16 readcache_be_word(address_space *space, offs_t offset)
+static UINT16 readcache_be_word(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT16 *)&r3000->cache[WORD_XOR_BE(offset)] : 0xffff;
}
-static UINT32 readcache_be_dword(address_space *space, offs_t offset)
+static UINT32 readcache_be_dword(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT32 *)&r3000->cache[offset] : 0xffffffff;
}
-static void writecache_be(address_space *space, offs_t offset, UINT8 data)
+static void writecache_be(address_space &space, offs_t offset, UINT8 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) r3000->cache[BYTE4_XOR_BE(offset)] = data;
}
-static void writecache_be_word(address_space *space, offs_t offset, UINT16 data)
+static void writecache_be_word(address_space &space, offs_t offset, UINT16 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT16 *)&r3000->cache[WORD_XOR_BE(offset)] = data;
}
-static void writecache_be_dword(address_space *space, offs_t offset, UINT32 data)
+static void writecache_be_dword(address_space &space, offs_t offset, UINT32 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT32 *)&r3000->cache[offset] = data;
}
-static UINT8 readcache_le(address_space *space, offs_t offset)
+static UINT8 readcache_le(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? r3000->cache[BYTE4_XOR_LE(offset)] : 0xff;
}
-static UINT16 readcache_le_word(address_space *space, offs_t offset)
+static UINT16 readcache_le_word(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT16 *)&r3000->cache[WORD_XOR_LE(offset)] : 0xffff;
}
-static UINT32 readcache_le_dword(address_space *space, offs_t offset)
+static UINT32 readcache_le_dword(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT32 *)&r3000->cache[offset] : 0xffffffff;
}
-static void writecache_le(address_space *space, offs_t offset, UINT8 data)
+static void writecache_le(address_space &space, offs_t offset, UINT8 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) r3000->cache[BYTE4_XOR_LE(offset)] = data;
}
-static void writecache_le_word(address_space *space, offs_t offset, UINT16 data)
+static void writecache_le_word(address_space &space, offs_t offset, UINT16 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT16 *)&r3000->cache[WORD_XOR_LE(offset)] = data;
}
-static void writecache_le_dword(address_space *space, offs_t offset, UINT32 data)
+static void writecache_le_dword(address_space &space, offs_t offset, UINT32 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT32 *)&r3000->cache[offset] = data;
}
diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c
index 2cecbab2d8b..50dae022440 100644
--- a/src/emu/cpu/powerpc/ppc.c
+++ b/src/emu/cpu/powerpc/ppc.c
@@ -330,20 +330,20 @@ struct PPC_REGS {
/* PowerPC function pointers for memory accesses/exceptions */
jmp_buf exception_jmpbuf;
- UINT8 (*read8)(address_space *space, offs_t address);
- UINT16 (*read16)(address_space *space, offs_t address);
- UINT32 (*read32)(address_space *space, offs_t address);
- UINT64 (*read64)(address_space *space, offs_t address);
- void (*write8)(address_space *space, offs_t address, UINT8 data);
- void (*write16)(address_space *space, offs_t address, UINT16 data);
- void (*write32)(address_space *space, offs_t address, UINT32 data);
- void (*write64)(address_space *space, offs_t address, UINT64 data);
- UINT16 (*read16_unaligned)(address_space *space, offs_t address);
- UINT32 (*read32_unaligned)(address_space *space, offs_t address);
- UINT64 (*read64_unaligned)(address_space *space, offs_t address);
- void (*write16_unaligned)(address_space *space, offs_t address, UINT16 data);
- void (*write32_unaligned)(address_space *space, offs_t address, UINT32 data);
- void (*write64_unaligned)(address_space *space, offs_t address, UINT64 data);
+ UINT8 (*read8)(address_space &space, offs_t address);
+ UINT16 (*read16)(address_space &space, offs_t address);
+ UINT32 (*read32)(address_space &space, offs_t address);
+ UINT64 (*read64)(address_space &space, offs_t address);
+ void (*write8)(address_space &space, offs_t address, UINT8 data);
+ void (*write16)(address_space &space, offs_t address, UINT16 data);
+ void (*write32)(address_space &space, offs_t address, UINT32 data);
+ void (*write64)(address_space &space, offs_t address, UINT64 data);
+ UINT16 (*read16_unaligned)(address_space &space, offs_t address);
+ UINT32 (*read32_unaligned)(address_space &space, offs_t address);
+ UINT64 (*read64_unaligned)(address_space &space, offs_t address);
+ void (*write16_unaligned)(address_space &space, offs_t address, UINT16 data);
+ void (*write32_unaligned)(address_space &space, offs_t address, UINT32 data);
+ void (*write64_unaligned)(address_space &space, offs_t address, UINT64 data);
void (* optable19[1024])(UINT32);
void (* optable31[1024])(UINT32);
@@ -786,14 +786,14 @@ INLINE UINT32 ppc_get_spr(int spr)
return 0;
}
-static UINT8 ppc_read8_translated(address_space *space, offs_t address);
-static UINT16 ppc_read16_translated(address_space *space, offs_t address);
-static UINT32 ppc_read32_translated(address_space *space, offs_t address);
-static UINT64 ppc_read64_translated(address_space *space, offs_t address);
-static void ppc_write8_translated(address_space *space, offs_t address, UINT8 data);
-static void ppc_write16_translated(address_space *space, offs_t address, UINT16 data);
-static void ppc_write32_translated(address_space *space, offs_t address, UINT32 data);
-static void ppc_write64_translated(address_space *space, offs_t address, UINT64 data);
+static UINT8 ppc_read8_translated(address_space &space, offs_t address);
+static UINT16 ppc_read16_translated(address_space &space, offs_t address);
+static UINT32 ppc_read32_translated(address_space &space, offs_t address);
+static UINT64 ppc_read64_translated(address_space &space, offs_t address);
+static void ppc_write8_translated(address_space &space, offs_t address, UINT8 data);
+static void ppc_write16_translated(address_space &space, offs_t address, UINT16 data);
+static void ppc_write32_translated(address_space &space, offs_t address, UINT32 data);
+static void ppc_write64_translated(address_space &space, offs_t address, UINT64 data);
INLINE void ppc_set_msr(UINT32 value)
{
diff --git a/src/emu/cpu/powerpc/ppc403.c b/src/emu/cpu/powerpc/ppc403.c
index fca554c5811..94f34bd0600 100644
--- a/src/emu/cpu/powerpc/ppc403.c
+++ b/src/emu/cpu/powerpc/ppc403.c
@@ -906,47 +906,47 @@ static void ppc403_dma_exec(int ch)
/*********************************************************************************/
-static UINT8 ppc403_read8(address_space *space, UINT32 a)
+static UINT8 ppc403_read8(address_space &space, UINT32 a)
{
if(a >= 0x40000000 && a <= 0x4000000f) /* Serial Port */
return ppc403_spu_r(a);
- return space->read_byte(a);
+ return space.read_byte(a);
}
#define ppc403_read16 memory_read_word_32be
#define ppc403_read32 memory_read_dword_32be
-static void ppc403_write8(address_space *space, UINT32 a, UINT8 d)
+static void ppc403_write8(address_space &space, UINT32 a, UINT8 d)
{
if( a >= 0x40000000 && a <= 0x4000000f ) /* Serial Port */
{
ppc403_spu_w(a, d);
return;
}
- space->write_byte(a, d);
+ space.write_byte(a, d);
}
#define ppc403_write16 memory_write_word_32be
#define ppc403_write32 memory_write_dword_32be
-static UINT16 ppc403_read16_unaligned(address_space *space, UINT32 a)
+static UINT16 ppc403_read16_unaligned(address_space &space, UINT32 a)
{
fatalerror("ppc: Unaligned read16 %08X at %08X\n", a, ppc.pc);
return 0;
}
-static UINT32 ppc403_read32_unaligned(address_space *space, UINT32 a)
+static UINT32 ppc403_read32_unaligned(address_space &space, UINT32 a)
{
fatalerror("ppc: Unaligned read32 %08X at %08X\n", a, ppc.pc);
return 0;
}
-static void ppc403_write16_unaligned(address_space *space, UINT32 a, UINT16 d)
+static void ppc403_write16_unaligned(address_space &space, UINT32 a, UINT16 d)
{
fatalerror("ppc: Unaligned write16 %08X, %04X at %08X\n", a, d, ppc.pc);
}
-static void ppc403_write32_unaligned(address_space *space, UINT32 a, UINT32 d)
+static void ppc403_write32_unaligned(address_space &space, UINT32 a, UINT32 d)
{
fatalerror("ppc: Unaligned write32 %08X, %08X at %08X\n", a, d, ppc.pc);
}
diff --git a/src/emu/cpu/powerpc/ppc_mem.c b/src/emu/cpu/powerpc/ppc_mem.c
index 2763b383a6b..e1a3b5fee80 100644
--- a/src/emu/cpu/powerpc/ppc_mem.c
+++ b/src/emu/cpu/powerpc/ppc_mem.c
@@ -66,29 +66,29 @@ INLINE void WRITE64(UINT32 a, UINT64 d)
/***********************************************************************/
-static UINT16 ppc_read16_unaligned(address_space *space, UINT32 a)
+static UINT16 ppc_read16_unaligned(address_space &space, UINT32 a)
{
return ((UINT16)ppc.read8(space, a+0) << 8) | ((UINT16)ppc.read8(space, a+1) << 0);
}
-static UINT32 ppc_read32_unaligned(address_space *space, UINT32 a)
+static UINT32 ppc_read32_unaligned(address_space &space, UINT32 a)
{
return ((UINT32)ppc.read8(space, a+0) << 24) | ((UINT32)ppc.read8(space, a+1) << 16) |
((UINT32)ppc.read8(space, a+2) << 8) | ((UINT32)ppc.read8(space, a+3) << 0);
}
-static UINT64 ppc_read64_unaligned(address_space *space, UINT32 a)
+static UINT64 ppc_read64_unaligned(address_space &space, UINT32 a)
{
return ((UINT64)READ32(space, a+0) << 32) | (UINT64)(READ32(space, a+4));
}
-static void ppc_write16_unaligned(address_space *space, UINT32 a, UINT16 d)
+static void ppc_write16_unaligned(address_space &space, UINT32 a, UINT16 d)
{
ppc.write8(space, a+0, (UINT8)(d >> 8));
ppc.write8(space, a+1, (UINT8)(d));
}
-static void ppc_write32_unaligned(address_space *space, UINT32 a, UINT32 d)
+static void ppc_write32_unaligned(address_space &space, UINT32 a, UINT32 d)
{
ppc.write8(space, a+0, (UINT8)(d >> 24));
ppc.write8(space, a+1, (UINT8)(d >> 16));
@@ -96,7 +96,7 @@ static void ppc_write32_unaligned(address_space *space, UINT32 a, UINT32 d)
ppc.write8(space, a+3, (UINT8)(d >> 0));
}
-static void ppc_write64_unaligned(address_space *space, UINT32 a, UINT64 d)
+static void ppc_write64_unaligned(address_space &space, UINT32 a, UINT64 d)
{
ppc.write32(space, a+0, (UINT32)(d >> 32));
ppc.write32(space, a+4, (UINT32)(d));
@@ -289,59 +289,59 @@ static int ppc_translate_address_cb(address_spacenum space, offs_t *addr)
return success;
}
-static UINT8 ppc_read8_translated(address_space *space, offs_t address)
+static UINT8 ppc_read8_translated(address_space &space, offs_t address)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_READ);
- return space->read_byte(address);
+ return space.read_byte(address);
}
-static UINT16 ppc_read16_translated(address_space *space, offs_t address)
+static UINT16 ppc_read16_translated(address_space &space, offs_t address)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_READ);
- return space->read_word(address);
+ return space.read_word(address);
}
-static UINT32 ppc_read32_translated(address_space *space, offs_t address)
+static UINT32 ppc_read32_translated(address_space &space, offs_t address)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_READ);
- return space->read_dword(address);
+ return space.read_dword(address);
}
-static UINT64 ppc_read64_translated(address_space *space, offs_t address)
+static UINT64 ppc_read64_translated(address_space &space, offs_t address)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_READ);
- return space->read_qword(address);
+ return space.read_qword(address);
}
-static void ppc_write8_translated(address_space *space, offs_t address, UINT8 data)
+static void ppc_write8_translated(address_space &space, offs_t address, UINT8 data)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_WRITE);
- space->write_byte(address, data);
+ space.write_byte(address, data);
}
-static void ppc_write16_translated(address_space *space, offs_t address, UINT16 data)
+static void ppc_write16_translated(address_space &space, offs_t address, UINT16 data)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_WRITE);
- space->write_word(address, data);
+ space.write_word(address, data);
}
-static void ppc_write32_translated(address_space *space, offs_t address, UINT32 data)
+static void ppc_write32_translated(address_space &space, offs_t address, UINT32 data)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_WRITE);
- space->write_dword(address, data);
+ space.write_dword(address, data);
}
-static void ppc_write64_translated(address_space *space, offs_t address, UINT64 data)
+static void ppc_write64_translated(address_space &space, offs_t address, UINT64 data)
{
ppc_translate_address(&address, PPC_TRANSLATE_DATA | PPC_TRANSLATE_WRITE);
- space->write_qword(address, data);
+ space.write_qword(address, data);
}
#ifndef PPC_DRC
-static UINT32 ppc_readop_translated(address_space *space, offs_t address)
+static UINT32 ppc_readop_translated(address_space &space, offs_t address)
{
ppc_translate_address(&address, PPC_TRANSLATE_CODE | PPC_TRANSLATE_READ);
- return space->read_dword(address);
+ return space.read_dword(address);
}
#endif
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index 4baa999a0c8..b3c4345d39f 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -2337,7 +2337,7 @@ updateirq:
static READ8_HANDLER( ppc4xx_spu_r )
{
- powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(&space->device())->token();
+ powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(&space.device())->token();
UINT8 result = 0xff;
switch (offset)
@@ -2364,7 +2364,7 @@ static READ8_HANDLER( ppc4xx_spu_r )
static WRITE8_HANDLER( ppc4xx_spu_w )
{
- powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(&space->device())->token();
+ powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(&space.device())->token();
UINT8 oldstate, newstate;
if (PRINTF_SPU)
diff --git a/src/emu/cpu/se3208/se3208.c b/src/emu/cpu/se3208/se3208.c
index 5653c60958a..039b38f98dc 100644
--- a/src/emu/cpu/se3208/se3208.c
+++ b/src/emu/cpu/se3208/se3208.c
@@ -65,47 +65,47 @@ INLINE se3208_state_t *get_safe_token(device_t *device)
return (se3208_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
-INLINE UINT32 read_dword_unaligned(address_space *space, UINT32 address)
+INLINE UINT32 read_dword_unaligned(address_space &space, UINT32 address)
{
if (address & 3)
- return space->read_byte(address) | space->read_byte(address+1)<<8 | space->read_byte(address+2)<<16 | space->read_byte(address+3)<<24;
+ return space.read_byte(address) | space.read_byte(address+1)<<8 | space.read_byte(address+2)<<16 | space.read_byte(address+3)<<24;
else
- return space->read_dword(address);
+ return space.read_dword(address);
}
-INLINE UINT16 read_word_unaligned(address_space *space, UINT32 address)
+INLINE UINT16 read_word_unaligned(address_space &space, UINT32 address)
{
if (address & 1)
- return space->read_byte(address) | space->read_byte(address+1)<<8;
+ return space.read_byte(address) | space.read_byte(address+1)<<8;
else
- return space->read_word(address);
+ return space.read_word(address);
}
-INLINE void write_dword_unaligned(address_space *space, UINT32 address, UINT32 data)
+INLINE void write_dword_unaligned(address_space &space, UINT32 address, UINT32 data)
{
if (address & 3)
{
- space->write_byte(address, data & 0xff);
- space->write_byte(address+1, (data>>8)&0xff);
- space->write_byte(address+2, (data>>16)&0xff);
- space->write_byte(address+3, (data>>24)&0xff);
+ space.write_byte(address, data & 0xff);
+ space.write_byte(address+1, (data>>8)&0xff);
+ space.write_byte(address+2, (data>>16)&0xff);
+ space.write_byte(address+3, (data>>24)&0xff);
}
else
{
- space->write_dword(address, data);
+ space.write_dword(address, data);
}
}
-INLINE void write_word_unaligned(address_space *space, UINT32 address, UINT16 data)
+INLINE void write_word_unaligned(address_space &space, UINT32 address, UINT16 data)
{
if (address & 1)
{
- space->write_byte(address, data & 0xff);
- space->write_byte(address+1, (data>>8)&0xff);
+ space.write_byte(address, data & 0xff);
+ space.write_byte(address+1, (data>>8)&0xff);
}
else
{
- space->write_word(address, data);
+ space.write_word(address, data);
}
}
@@ -117,12 +117,12 @@ INLINE UINT8 SE3208_Read8(se3208_state_t *se3208_state, UINT32 addr)
INLINE UINT16 SE3208_Read16(se3208_state_t *se3208_state, UINT32 addr)
{
- return read_word_unaligned(se3208_state->program,addr);
+ return read_word_unaligned(*se3208_state->program,addr);
}
INLINE UINT32 SE3208_Read32(se3208_state_t *se3208_state, UINT32 addr)
{
- return read_dword_unaligned(se3208_state->program,addr);
+ return read_dword_unaligned(*se3208_state->program,addr);
}
INLINE void SE3208_Write8(se3208_state_t *se3208_state, UINT32 addr,UINT8 val)
@@ -132,12 +132,12 @@ INLINE void SE3208_Write8(se3208_state_t *se3208_state, UINT32 addr,UINT8 val)
INLINE void SE3208_Write16(se3208_state_t *se3208_state, UINT32 addr,UINT16 val)
{
- write_word_unaligned(se3208_state->program,addr,val);
+ write_word_unaligned(*se3208_state->program,addr,val);
}
INLINE void SE3208_Write32(se3208_state_t *se3208_state, UINT32 addr,UINT32 val)
{
- write_dword_unaligned(se3208_state->program,addr,val);
+ write_dword_unaligned(*se3208_state->program,addr,val);
}
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 21129b19e7c..586c8fd0291 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -27,7 +27,7 @@ static const int div_tab[4] = { 3, 5, 7, 0 };
INLINE UINT32 RL(sh2_state *sh2, offs_t A)
{
if (A >= 0xe0000000)
- return sh2_internal_r(sh2->internal, (A & 0x1fc)>>2, 0xffffffff);
+ return sh2_internal_r(*sh2->internal, (A & 0x1fc)>>2, 0xffffffff);
if (A >= 0xc0000000)
return sh2->program->read_dword(A);
@@ -42,7 +42,7 @@ INLINE void WL(sh2_state *sh2, offs_t A, UINT32 V)
{
if (A >= 0xe0000000)
{
- sh2_internal_w(sh2->internal, (A & 0x1fc)>>2, V, 0xffffffff);
+ sh2_internal_w(*sh2->internal, (A & 0x1fc)>>2, V, 0xffffffff);
return;
}
@@ -508,7 +508,7 @@ static void sh2_dmac_check(sh2_state *sh2, int dma)
WRITE32_HANDLER( sh2_internal_w )
{
- sh2_state *sh2 = GET_SH2(&space->device());
+ sh2_state *sh2 = GET_SH2(&space.device());
UINT32 old;
#ifdef USE_SH2DRC
@@ -522,7 +522,7 @@ WRITE32_HANDLER( sh2_internal_w )
// logerror("sh2_internal_w: Write %08x (%x), %08x @ %08x\n", 0xfffffe00+offset*4, offset, data, mem_mask);
// if(offset != 0x20)
-// printf("sh2_internal_w: Write %08x (%x), %08x @ %08x (PC %x)\n", 0xfffffe00+offset*4, offset, data, mem_mask, space->device().safe_pc());
+// printf("sh2_internal_w: Write %08x (%x), %08x @ %08x (PC %x)\n", 0xfffffe00+offset*4, offset, data, mem_mask, space.device().safe_pc());
switch( offset )
{
@@ -688,7 +688,7 @@ WRITE32_HANDLER( sh2_internal_w )
READ32_HANDLER( sh2_internal_r )
{
- sh2_state *sh2 = GET_SH2(&space->device());
+ sh2_state *sh2 = GET_SH2(&space.device());
#ifdef USE_SH2DRC
offset &= 0x7f;
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index 118429057c6..4f0eff81f5d 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -149,7 +149,7 @@ INLINE sh2_state *get_safe_token(device_t *device)
INLINE UINT16 RW(sh2_state *sh2, offs_t A)
{
if (A >= 0xe0000000)
- return sh2_internal_r(sh2->internal, (A & 0x1fc)>>2, 0xffff << (((~A) & 2)*8)) >> (((~A) & 2)*8);
+ return sh2_internal_r(*sh2->internal, (A & 0x1fc)>>2, 0xffff << (((~A) & 2)*8)) >> (((~A) & 2)*8);
if (A >= 0xc0000000)
return sh2->program->read_word(A);
@@ -160,7 +160,7 @@ INLINE UINT16 RW(sh2_state *sh2, offs_t A)
INLINE UINT32 RL(sh2_state *sh2, offs_t A)
{
if (A >= 0xe0000000)
- return sh2_internal_r(sh2->internal, (A & 0x1fc)>>2, 0xffffffff);
+ return sh2_internal_r(*sh2->internal, (A & 0x1fc)>>2, 0xffffffff);
if (A >= 0xc0000000)
return sh2->program->read_dword(A);
diff --git a/src/emu/cpu/sh4/sh3comn.c b/src/emu/cpu/sh4/sh3comn.c
index e364ebb50e4..f2f3a35b26a 100644
--- a/src/emu/cpu/sh4/sh3comn.c
+++ b/src/emu/cpu/sh4/sh3comn.c
@@ -12,7 +12,7 @@
WRITE32_HANDLER( sh3_internal_high_w )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
COMBINE_DATA(&sh4->m_sh3internal_upper[offset]);
switch (offset)
@@ -75,7 +75,7 @@ WRITE32_HANDLER( sh3_internal_high_w )
READ32_HANDLER( sh3_internal_high_r )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
UINT32 ret = 0;
@@ -140,7 +140,7 @@ READ32_HANDLER( sh3_internal_high_r )
READ32_HANDLER( sh3_internal_r )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
if (offset<0x1000)
{
@@ -385,7 +385,7 @@ READ32_HANDLER( sh3_internal_r )
WRITE32_HANDLER( sh3_internal_w )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index a159dc48bba..bc28ef457af 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -669,7 +669,7 @@ void sh4_handler_ipra_w(sh4_state *sh4, UINT32 data, UINT32 mem_mask)
WRITE32_HANDLER( sh4_internal_w )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
int a;
UINT32 addr = (offset << 2) + 0xfe000000;
offset = ((addr & 0xfc) >> 2) | ((addr & 0x1fe0000) >> 11);
@@ -897,7 +897,7 @@ WRITE32_HANDLER( sh4_internal_w )
READ32_HANDLER( sh4_internal_r )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
if (sh4->cpu_type != CPU_TYPE_SH4)
fatalerror("sh4_internal_r uses sh4->m[] with SH3\n");
@@ -1247,7 +1247,7 @@ UINT32 sh4_getsqremap(sh4_state *sh4, UINT32 address)
READ64_HANDLER( sh4_tlb_r )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
int offs = offset*8;
@@ -1265,7 +1265,7 @@ READ64_HANDLER( sh4_tlb_r )
WRITE64_HANDLER( sh4_tlb_w )
{
- sh4_state *sh4 = get_safe_token(&space->device());
+ sh4_state *sh4 = get_safe_token(&space.device());
int offs = offset*8;
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index fbada882f9f..64045b74947 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -2283,7 +2283,7 @@ FFED BX R/W Reset Description
static READ8_HANDLER( t90_internal_registers_r )
{
- t90_Regs *cpustate = get_safe_token(&space->device());
+ t90_Regs *cpustate = get_safe_token(&space.device());
#define RIO cpustate->io->read_byte( T90_IOBASE+offset )
@@ -2498,7 +2498,7 @@ static WRITE8_HANDLER( t90_internal_registers_w )
{
#define WIO cpustate->io->write_byte( T90_IOBASE+offset, data )
- t90_Regs *cpustate = get_safe_token(&space->device());
+ t90_Regs *cpustate = get_safe_token(&space.device());
UINT8 out_mask;
UINT8 old = cpustate->internal_registers[offset];
switch ( T90_IOBASE + offset )
diff --git a/src/emu/cpu/tlcs900/tlcs900.c b/src/emu/cpu/tlcs900/tlcs900.c
index bb817a235f6..630cff01cef 100644
--- a/src/emu/cpu/tlcs900/tlcs900.c
+++ b/src/emu/cpu/tlcs900/tlcs900.c
@@ -983,7 +983,7 @@ static void tlcs900_input_level_change( tlcs900_state *cpustate, int input, int
static READ8_HANDLER( tlcs900_internal_r )
{
- tlcs900_state *cpustate = get_safe_token( &space->device() );
+ tlcs900_state *cpustate = get_safe_token( &space.device() );
return cpustate->reg[ offset ];
}
@@ -991,7 +991,7 @@ static READ8_HANDLER( tlcs900_internal_r )
static WRITE8_HANDLER( tlcs900_internal_w )
{
- tlcs900_state *cpustate = get_safe_token( &space->device() );
+ tlcs900_state *cpustate = get_safe_token( &space.device() );
switch ( offset )
{
@@ -1767,7 +1767,7 @@ static CPU_RESET( tmp95c063 )
static READ8_HANDLER( tmp95c063_internal_r )
{
- tlcs900_state *cpustate = get_safe_token( &space->device() );
+ tlcs900_state *cpustate = get_safe_token( &space.device() );
if (!cpustate->port_read.isnull())
{
@@ -1794,7 +1794,7 @@ static READ8_HANDLER( tmp95c063_internal_r )
static WRITE8_HANDLER( tmp95c063_internal_w )
{
- tlcs900_state *cpustate = get_safe_token( &space->device() );
+ tlcs900_state *cpustate = get_safe_token( &space.device() );
switch ( offset )
{
diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c
index 366335638c7..d22f28beafb 100644
--- a/src/emu/cpu/tms32051/tms32051.c
+++ b/src/emu/cpu/tms32051/tms32051.c
@@ -413,7 +413,7 @@ static CPU_EXECUTE( tms )
static READ16_HANDLER( cpuregs_r )
{
- tms32051_state *cpustate = get_safe_token(&space->device());
+ tms32051_state *cpustate = get_safe_token(&space.device());
switch (offset)
{
@@ -458,7 +458,7 @@ static READ16_HANDLER( cpuregs_r )
case 0x28: return 0; // PDWSR
default:
- if(!space->debugger_access())
+ if(!space.debugger_access())
fatalerror("32051: cpuregs_r: unimplemented memory-mapped register %02X at %04X\n", offset, cpustate->pc-1);
}
@@ -467,7 +467,7 @@ static READ16_HANDLER( cpuregs_r )
static WRITE16_HANDLER( cpuregs_w )
{
- tms32051_state *cpustate = get_safe_token(&space->device());
+ tms32051_state *cpustate = get_safe_token(&space.device());
switch (offset)
{
@@ -536,7 +536,7 @@ static WRITE16_HANDLER( cpuregs_w )
case 0x28: break; // PDWSR
default:
- if(!space->debugger_access())
+ if(!space.debugger_access())
fatalerror("32051: cpuregs_w: unimplemented memory-mapped register %02X, data %04X at %04X\n", offset, data, cpustate->pc-1);
}
}
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c
index fa3be3134ae..757f57b5b8c 100644
--- a/src/emu/cpu/tms34010/34010gfx.c
+++ b/src/emu/cpu/tms34010/34010gfx.c
@@ -201,28 +201,28 @@ static int compute_pixblt_b_cycles(int left_partials, int right_partials, int fu
/* Shift register handling */
-static void memory_w(address_space *space, offs_t offset,UINT16 data)
+static void memory_w(address_space &space, offs_t offset,UINT16 data)
{
- space->write_word(offset, data);
+ space.write_word(offset, data);
}
-static UINT16 memory_r(address_space *space, offs_t offset)
+static UINT16 memory_r(address_space &space, offs_t offset)
{
- return space->read_word(offset);
+ return space.read_word(offset);
}
-static void shiftreg_w(address_space *space, offs_t offset,UINT16 data)
+static void shiftreg_w(address_space &space, offs_t offset,UINT16 data)
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
if (tms->config->from_shiftreg)
(*tms->config->from_shiftreg)(space, (UINT32)(offset << 3) & ~15, &tms->shiftreg[0]);
else
logerror("From ShiftReg function not set. PC = %08X\n", tms->pc);
}
-static UINT16 shiftreg_r(address_space *space, offs_t offset)
+static UINT16 shiftreg_r(address_space &space, offs_t offset)
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
if (tms->config->to_shiftreg)
(*tms->config->to_shiftreg)(space, (UINT32)(offset << 3) & ~15, &tms->shiftreg[0]);
else
@@ -230,9 +230,9 @@ static UINT16 shiftreg_r(address_space *space, offs_t offset)
return tms->shiftreg[0];
}
-static UINT16 dummy_shiftreg_r(address_space *space, offs_t offset)
+static UINT16 dummy_shiftreg_r(address_space &space, offs_t offset)
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
return tms->shiftreg[0];
}
@@ -1038,8 +1038,8 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
if (!P_FLAG(tms))
{
int dx, dy, x, y, /*words,*/ yreverse;
- void (*word_write)(address_space *space,offs_t address,UINT16 data);
- UINT16 (*word_read)(address_space *space,offs_t address);
+ void (*word_write)(address_space &space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(address_space &space,offs_t address);
UINT32 readwrites = 0;
UINT32 saddr, daddr;
XY dstxy = { 0 };
@@ -1113,13 +1113,13 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
UINT32 srcword, dstword = 0;
/* fetch the initial source word */
- srcword = (*word_read)(tms->program, srcwordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, srcwordaddr++ << 1);
readwrites++;
/* fetch the initial dest word */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY || (daddr & 0x0f) != 0)
{
- dstword = (*word_read)(tms->program, dstwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dstwordaddr << 1);
readwrites++;
}
@@ -1132,7 +1132,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* fetch more words if necessary */
if (srcbit + BITS_PER_PIXEL > 16)
{
- srcword |= (*word_read)(tms->program, srcwordaddr++ << 1) << 16;
+ srcword |= (*word_read)(*tms->program, srcwordaddr++ << 1) << 16;
readwrites++;
}
@@ -1149,7 +1149,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
if (dstbit + BITS_PER_PIXEL > 16)
{
- dstword |= (*word_read)(tms->program, (dstwordaddr + 1) << 1) << 16;
+ dstword |= (*word_read)(*tms->program, (dstwordaddr + 1) << 1) << 16;
readwrites++;
}
@@ -1164,7 +1164,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
dstbit += BITS_PER_PIXEL;
if (dstbit > 16)
{
- (*word_write)(tms->program, dstwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dstwordaddr++ << 1, dstword);
readwrites++;
dstbit -= 16;
dstword >>= 16;
@@ -1177,13 +1177,13 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* if we're right-partial, read and mask the remaining bits */
if (dstbit != 16)
{
- UINT16 origdst = (*word_read)(tms->program, dstwordaddr << 1);
+ UINT16 origdst = (*word_read)(*tms->program, dstwordaddr << 1);
UINT16 mask = 0xffff << dstbit;
dstword = (dstword & ~mask) | (origdst & mask);
readwrites++;
}
- (*word_write)(tms->program, dstwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dstwordaddr++ << 1, dstword);
readwrites++;
}
@@ -1215,14 +1215,14 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
dwordaddr = daddr >> 4;
/* fetch the initial source word */
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK << (saddr & 15);
/* handle the left partial word */
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK << (daddr & 15);
/* loop over partials */
@@ -1231,7 +1231,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* fetch another word if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK;
}
@@ -1253,7 +1253,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* loop over full words */
@@ -1261,7 +1261,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
{
/* fetch the destination word (if necessary) */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK;
@@ -1272,7 +1272,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* fetch another word if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK;
}
@@ -1294,14 +1294,14 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK;
/* loop over partials */
@@ -1311,7 +1311,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
if (srcmask == 0)
{
LOGGFX((" right fetch @ %08x\n", swordaddr));
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK;
}
@@ -1333,7 +1333,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
#endif
@@ -1385,8 +1385,8 @@ static void FUNCTION_NAME(pixblt_r)(tms34010_state *tms, int src_is_linear, int
if (!P_FLAG(tms))
{
int dx, dy, x, y, words, yreverse;
- void (*word_write)(address_space *space,offs_t address,UINT16 data);
- UINT16 (*word_read)(address_space *space,offs_t address);
+ void (*word_write)(address_space &space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(address_space &space,offs_t address);
UINT32 saddr, daddr;
XY dstxy = { 0 };
@@ -1484,14 +1484,14 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
dwordaddr = (daddr + 15) >> 4;
/* fetch the initial source word */
- srcword = (*word_read)(tms->program, --swordaddr << 1);
+ srcword = (*word_read)(*tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << ((saddr - BITS_PER_PIXEL) & 15);
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, --dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, --dwordaddr << 1);
dstmask = PIXEL_MASK << ((daddr - BITS_PER_PIXEL) & 15);
/* loop over partials */
@@ -1500,7 +1500,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch source pixel if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, --swordaddr << 1);
+ srcword = (*word_read)(*tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
}
@@ -1522,7 +1522,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
}
/* write the result */
- (*word_write)(tms->program, dwordaddr << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr << 1, dstword);
}
/* loop over full words */
@@ -1531,7 +1531,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch the destination word (if necessary) */
dwordaddr--;
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
@@ -1542,7 +1542,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch source pixel if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, --swordaddr << 1);
+ srcword = (*word_read)(*tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
}
@@ -1564,14 +1564,14 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
}
/* write the result */
- (*word_write)(tms->program, dwordaddr << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr << 1, dstword);
}
/* handle the left partial word */
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, --dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, --dwordaddr << 1);
dstmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
/* loop over partials */
@@ -1580,7 +1580,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch the source pixel if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, --swordaddr << 1);
+ srcword = (*word_read)(*tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
}
@@ -1602,7 +1602,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
}
/* write the result */
- (*word_write)(tms->program, dwordaddr << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr << 1, dstword);
}
/* update for next row */
@@ -1650,8 +1650,8 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
if (!P_FLAG(tms))
{
int dx, dy, x, y, words, left_partials, right_partials, full_words;
- void (*word_write)(address_space *space,offs_t address,UINT16 data);
- UINT16 (*word_read)(address_space *space,offs_t address);
+ void (*word_write)(address_space &space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(address_space &space,offs_t address);
UINT32 saddr, daddr;
XY dstxy = { 0 };
@@ -1727,14 +1727,14 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
dwordaddr = daddr >> 4;
/* fetch the initial source word */
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = 1 << (saddr & 15);
/* handle the left partial word */
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK << (daddr & 15);
/* loop over partials */
@@ -1751,7 +1751,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
srcmask <<= 1;
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = 0x0001;
}
@@ -1760,7 +1760,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* loop over full words */
@@ -1768,7 +1768,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
{
/* fetch the destination word (if necessary) */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK;
@@ -1787,7 +1787,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
srcmask <<= 1;
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = 0x0001;
}
@@ -1796,14 +1796,14 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK;
/* loop over partials */
@@ -1820,7 +1820,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
srcmask <<= 1;
if (srcmask == 0)
{
- srcword = (*word_read)(tms->program, swordaddr++ << 1);
+ srcword = (*word_read)(*tms->program, swordaddr++ << 1);
srcmask = 0x0001;
}
@@ -1829,7 +1829,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* update for next row */
@@ -1864,8 +1864,8 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
if (!P_FLAG(tms))
{
int dx, dy, x, y, words, left_partials, right_partials, full_words;
- void (*word_write)(address_space *space,offs_t address,UINT16 data);
- UINT16 (*word_read)(address_space *space,offs_t address);
+ void (*word_write)(address_space &space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(address_space &space,offs_t address);
UINT32 daddr;
XY dstxy = { 0 };
@@ -1943,7 +1943,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK << (daddr & 15);
/* loop over partials */
@@ -1960,7 +1960,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* loop over full words */
@@ -1968,7 +1968,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
{
/* fetch the destination word (if necessary) */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK;
@@ -1987,14 +1987,14 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(tms->program, dwordaddr << 1);
+ dstword = (*word_read)(*tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK;
/* loop over partials */
@@ -2011,7 +2011,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(tms->program, dwordaddr++ << 1, dstword);
+ (*word_write)(*tms->program, dwordaddr++ << 1, dstword);
}
/* update for next row */
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index ba1e9963a76..2f884388bbd 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -316,7 +316,7 @@ static UINT32 read_pixel_32(tms34010_state *tms, offs_t offset)
static UINT32 read_pixel_shiftreg(tms34010_state *tms, offs_t offset)
{
if (tms->config->to_shiftreg)
- tms->config->to_shiftreg(tms->program, offset, &tms->shiftreg[0]);
+ tms->config->to_shiftreg(*tms->program, offset, &tms->shiftreg[0]);
else
fatalerror("To ShiftReg function not set. PC = %08X\n", tms->pc);
return tms->shiftreg[0];
@@ -460,7 +460,7 @@ static void write_pixel_r_t_32(tms34010_state *tms, offs_t offset, UINT32 data)
static void write_pixel_shiftreg(tms34010_state *tms, offs_t offset, UINT32 data)
{
if (tms->config->from_shiftreg)
- tms->config->from_shiftreg(tms->program, offset, &tms->shiftreg[0]);
+ tms->config->from_shiftreg(*tms->program, offset, &tms->shiftreg[0]);
else
fatalerror("From ShiftReg function not set. PC = %08X\n", tms->pc);
}
@@ -699,7 +699,7 @@ static CPU_RESET( tms34010 )
/* the first time we are run */
tms->reset_deferred = tms->config->halt_on_reset;
if (tms->config->halt_on_reset)
- tms34010_io_register_w(device->space(AS_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff);
+ tms34010_io_register_w(*device->space(AS_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff);
}
@@ -1193,7 +1193,7 @@ static const char *const ioreg_name[] =
WRITE16_HANDLER( tms34010_io_register_w )
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
int oldreg, newreg;
/* Set register */
@@ -1222,7 +1222,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
break;
case REG_PMASK:
- if (data) logerror("Plane masking not supported. PC=%08X\n", space->device().safe_pc());
+ if (data) logerror("Plane masking not supported. PC=%08X\n", space.device().safe_pc());
break;
case REG_DPYCTL:
@@ -1262,12 +1262,12 @@ WRITE16_HANDLER( tms34010_io_register_w )
if (!(oldreg & 0x0080) && (newreg & 0x0080))
{
if (tms->config->output_int)
- (*tms->config->output_int)(&space->device(), 1);
+ (*tms->config->output_int)(&space.device(), 1);
}
else if ((oldreg & 0x0080) && !(newreg & 0x0080))
{
if (tms->config->output_int)
- (*tms->config->output_int)(&space->device(), 0);
+ (*tms->config->output_int)(&space.device(), 0);
}
/* input interrupt? (should really be state-based, but the functions don't exist!) */
@@ -1336,7 +1336,7 @@ static const char *const ioreg020_name[] =
WRITE16_HANDLER( tms34020_io_register_w )
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
int oldreg, newreg;
/* Set register */
@@ -1373,7 +1373,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
case REG020_PMASKL:
case REG020_PMASKH:
- if (data) logerror("Plane masking not supported. PC=%08X\n", space->device().safe_pc());
+ if (data) logerror("Plane masking not supported. PC=%08X\n", space.device().safe_pc());
break;
case REG020_DPYCTL:
@@ -1413,12 +1413,12 @@ WRITE16_HANDLER( tms34020_io_register_w )
if (!(oldreg & 0x0080) && (newreg & 0x0080))
{
if (tms->config->output_int)
- (*tms->config->output_int)(&space->device(), 1);
+ (*tms->config->output_int)(&space.device(), 1);
}
else if ((oldreg & 0x0080) && !(newreg & 0x0080))
{
if (tms->config->output_int)
- (*tms->config->output_int)(&space->device(), 0);
+ (*tms->config->output_int)(&space.device(), 0);
}
/* input interrupt? (should really be state-based, but the functions don't exist!) */
@@ -1499,7 +1499,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
READ16_HANDLER( tms34010_io_register_r )
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
int result, total;
// if (LOG_CONTROL_REGS)
@@ -1542,7 +1542,7 @@ READ16_HANDLER( tms34010_io_register_r )
READ16_HANDLER( tms34020_io_register_r )
{
- tms34010_state *tms = get_safe_token(&space->device());
+ tms34010_state *tms = get_safe_token(&space.device());
int result, total;
// if (LOG_CONTROL_REGS)
@@ -1595,7 +1595,6 @@ static void tms34010_state_postload(tms34010_state *tms)
void tms34010_host_w(device_t *cpu, int reg, int data)
{
- address_space *space;
tms34010_state *tms = get_safe_token(cpu);
unsigned int addr;
@@ -1629,12 +1628,14 @@ void tms34010_host_w(device_t *cpu, int reg, int data)
/* control register */
case TMS34010_HOST_CONTROL:
+ {
tms->external_host_access = TRUE;
- space = tms->device->space(AS_PROGRAM);
+ address_space &space = *tms->device->space(AS_PROGRAM);
tms34010_io_register_w(space, REG_HSTCTLH, data & 0xff00, 0xffff);
tms34010_io_register_w(space, REG_HSTCTLL, data & 0x00ff, 0xffff);
tms->external_host_access = FALSE;
break;
+ }
/* error case */
default:
diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h
index 621182c6f49..ebc21b953f1 100644
--- a/src/emu/cpu/tms34010/tms34010.h
+++ b/src/emu/cpu/tms34010/tms34010.h
@@ -197,8 +197,8 @@ struct tms34010_config
void (*scanline_callback_ind16)(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
void (*scanline_callback_rgb32)(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
void (*output_int)(device_t *device, int state); /* output interrupt callback */
- void (*to_shiftreg)(address_space *space, offs_t, UINT16 *); /* shift register write */
- void (*from_shiftreg)(address_space *space, offs_t, UINT16 *); /* shift register read */
+ void (*to_shiftreg)(address_space &space, offs_t, UINT16 *); /* shift register write */
+ void (*from_shiftreg)(address_space &space, offs_t, UINT16 *); /* shift register read */
};
diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c
index 346f2bb9b14..7142ff4afd8 100644
--- a/src/emu/cpu/tms7000/tms7000.c
+++ b/src/emu/cpu/tms7000/tms7000.c
@@ -557,7 +557,7 @@ static void tms7000_service_timer1( device_t *device )
static WRITE8_HANDLER( tms70x0_pf_w ) /* Perpherial file write */
{
- tms7000_state *cpustate = get_safe_token(&space->device());
+ tms7000_state *cpustate = get_safe_token(&space.device());
UINT8 temp1, temp2, temp3;
switch( offset )
@@ -626,7 +626,7 @@ static WRITE8_HANDLER( tms70x0_pf_w ) /* Perpherial file write */
static READ8_HANDLER( tms70x0_pf_r ) /* Perpherial file read */
{
- tms7000_state *cpustate = get_safe_token(&space->device());
+ tms7000_state *cpustate = get_safe_token(&space.device());
UINT8 result;
UINT8 temp1, temp2, temp3;
@@ -719,12 +719,12 @@ static UINT16 bcd_sub( UINT16 a, UINT16 b)
}
static WRITE8_HANDLER( tms7000_internal_w ) {
- tms7000_state *cpustate = get_safe_token(&space->device());
+ tms7000_state *cpustate = get_safe_token(&space.device());
cpustate->rf[ offset ] = data;
}
static READ8_HANDLER( tms7000_internal_r ) {
- tms7000_state *cpustate = get_safe_token(&space->device());
+ tms7000_state *cpustate = get_safe_token(&space.device());
return cpustate->rf[ offset ];
}
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index 2e8f7c06ba0..5d9bf06e7b5 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -529,7 +529,7 @@ static void reset_decrementer(tms99xx_state *cpustate);
READ16_HANDLER(ti990_10_internal_r)
{
//return cpustate->ROM[offset];
- return space->read_word(0x1ffc00+offset);
+ return space.read_word(0x1ffc00+offset);
}
#endif
@@ -541,13 +541,13 @@ READ16_HANDLER(ti990_10_internal_r)
*/
READ8_HANDLER(tms9995_internal1_r)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
return cpustate->RAM[offset];
}
WRITE8_HANDLER(tms9995_internal1_w)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
cpustate->RAM[offset]=data;
}
@@ -556,13 +556,13 @@ WRITE8_HANDLER(tms9995_internal1_w)
*/
READ8_HANDLER(tms9995_internal2_r)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
return cpustate->RAM[offset+0xfc];
}
WRITE8_HANDLER(tms9995_internal2_w)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
cpustate->RAM[offset+0xfc]=data;
}
@@ -1076,7 +1076,7 @@ INLINE void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data)
#if (TMS99XX_MODEL == TI990_10_ID)
READ8_HANDLER(ti990_10_mapper_cru_r)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
int reply = 0;
switch(cpustate->mapper_cru_read_register)
@@ -1115,7 +1115,7 @@ INLINE void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data)
WRITE8_HANDLER(ti990_10_mapper_cru_w)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
switch (offset)
{
case 0:
@@ -1157,13 +1157,13 @@ INLINE void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data)
READ8_HANDLER(ti990_10_eir_cru_r)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
return (offset == 1) ? (cpustate->error_interrupt_register & 0xff) : 0;
}
WRITE8_HANDLER(ti990_10_eir_cru_w)
{
- tms99xx_state *cpustate = get_safe_token(&space->device());
+ tms99xx_state *cpustate = get_safe_token(&space.device());
if (offset < 4) /* does not work for EIR_MAPERR */
{
cpustate->error_interrupt_register &= ~ (1 << offset);
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 8e566855a6e..f06fb261457 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -159,9 +159,9 @@ static void execute_unmount(running_machine &machine, int ref, int params, const
given address is valid for cheating
-------------------------------------------------*/
-INLINE int cheat_address_is_valid(address_space *space, offs_t address)
+INLINE int cheat_address_is_valid(address_space &space, offs_t address)
{
- return debug_cpu_translate(space, TRANSLATE_READ, &address) && (space->get_write_ptr(address) != NULL);
+ return debug_cpu_translate(space, TRANSLATE_READ, &address) && (space.get_write_ptr(address) != NULL);
}
@@ -208,7 +208,7 @@ INLINE UINT64 cheat_byte_swap(const cheat_system *cheatsys, UINT64 value)
and swapping if necessary
-------------------------------------------------*/
-INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space *space, offs_t address)
+INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address)
{
return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, debug_read_memory(space, address, cheatsys->width, TRUE)));
}
@@ -557,7 +557,7 @@ int debug_command_parameter_cpu(running_machine &machine, const char *param, dev
address space
-------------------------------------------------*/
-int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result)
+int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space *&result)
{
device_t *cpu;
@@ -566,8 +566,8 @@ int debug_command_parameter_cpu_space(running_machine &machine, const char *para
return FALSE;
/* fetch the space pointer */
- *result = cpu->memory().space(spacenum);
- if (*result == NULL)
+ result = cpu->memory().space(spacenum);
+ if (result == NULL)
{
debug_console_printf(machine, "No matching memory space found for CPU '%s'\n", cpu->tag());
return FALSE;
@@ -1321,7 +1321,7 @@ static void execute_wpset(running_machine &machine, int ref, int params, const c
int wpnum;
/* CPU is implicit */
- if (!debug_command_parameter_cpu_space(machine, NULL, ref, &space))
+ if (!debug_command_parameter_cpu_space(machine, NULL, ref, space))
return;
/* param 1 is the address */
@@ -1536,7 +1536,7 @@ static void execute_save(running_machine &machine, int ref, int params, const ch
return;
if (!debug_command_parameter_number(machine, param[2], &length))
return;
- if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, ref, &space))
+ if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, ref, space))
return;
/* determine the addresses to write */
@@ -1554,7 +1554,7 @@ static void execute_save(running_machine &machine, int ref, int params, const ch
/* now write the data out */
for (i = offset; i <= endoffset; i++)
{
- UINT8 byte = debug_read_byte(space, i, TRUE);
+ UINT8 byte = debug_read_byte(*space, i, TRUE);
fwrite(&byte, 1, 1, f);
}
@@ -1580,7 +1580,7 @@ static void execute_load(running_machine &machine, int ref, int params, const ch
return;
if (!debug_command_parameter_number(machine, param[2], &length))
return;
- if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, ref, &space))
+ if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, ref, space))
return;
/* determine the addresses to read */
@@ -1603,7 +1603,7 @@ static void execute_load(running_machine &machine, int ref, int params, const ch
/* check if end of file has been reached and stop loading if it has */
if (feof(f))
break;
- debug_write_byte(space, i, byte, TRUE);
+ debug_write_byte(*space, i, byte, TRUE);
}
/* close the file */
fclose(f);
@@ -1634,7 +1634,7 @@ static void execute_dump(running_machine &machine, int ref, int params, const ch
return;
if (!debug_command_parameter_number(machine, param[4], &ascii))
return;
- if (!debug_command_parameter_cpu_space(machine, (params > 5) ? param[5] : NULL, ref, &space))
+ if (!debug_command_parameter_cpu_space(machine, (params > 5) ? param[5] : NULL, ref, space))
return;
/* further validation */
@@ -1673,9 +1673,9 @@ static void execute_dump(running_machine &machine, int ref, int params, const ch
if (i + j <= endoffset)
{
offs_t curaddr = i + j;
- if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
+ if (debug_cpu_translate(*space, TRANSLATE_READ_DEBUG, &curaddr))
{
- UINT64 value = debug_read_memory(space, i + j, width, TRUE);
+ UINT64 value = debug_read_memory(*space, i + j, width, TRUE);
outdex += sprintf(&output[outdex], " %s", core_i64_hex_format(value, width * 2));
}
else
@@ -1692,9 +1692,9 @@ static void execute_dump(running_machine &machine, int ref, int params, const ch
for (j = 0; j < 16 && (i + j) <= endoffset; j++)
{
offs_t curaddr = i + j;
- if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
+ if (debug_cpu_translate(*space, TRANSLATE_READ_DEBUG, &curaddr))
{
- UINT8 byte = debug_read_byte(space, i + j, TRUE);
+ UINT8 byte = debug_read_byte(*space, i + j, TRUE);
outdex += sprintf(&output[outdex], "%c", (byte >= 32 && byte < 127) ? byte : '.');
}
else
@@ -1730,7 +1730,7 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con
memset(cheat_region, 0, sizeof(cheat_region));
/* validate parameters */
- if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, AS_PROGRAM, &space))
+ if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, AS_PROGRAM, space))
return;
if (ref == 0)
@@ -1815,7 +1815,7 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con
for (i = 0; i <= region_count; i++)
if (!cheat_region[i].disabled)
for (curaddr = cheat_region[i].offset; curaddr <= cheat_region[i].endoffset; curaddr += cheat.width)
- if (cheat_address_is_valid(space, curaddr))
+ if (cheat_address_is_valid(*space, curaddr))
real_length++;
if (real_length == 0)
@@ -1844,7 +1844,7 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con
return;
}
- if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, AS_PROGRAM, &space))
+ if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, AS_PROGRAM, space))
return;
cheat_map *newmap = auto_alloc_array(machine, cheat_map, cheat.length + real_length);
@@ -1861,9 +1861,9 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con
for (i = 0; i < region_count; i++)
if (!cheat_region[i].disabled)
for (curaddr = cheat_region[i].offset; curaddr <= cheat_region[i].endoffset; curaddr += cheat.width)
- if (cheat_address_is_valid(space, curaddr))
+ if (cheat_address_is_valid(*space, curaddr))
{
- cheat.cheatmap[active_cheat].previous_value = cheat_read_extended(&cheat, space, curaddr);
+ cheat.cheatmap[active_cheat].previous_value = cheat_read_extended(&cheat, *space, curaddr);
cheat.cheatmap[active_cheat].first_value = cheat.cheatmap[active_cheat].previous_value;
cheat.cheatmap[active_cheat].offset = curaddr;
cheat.cheatmap[active_cheat].state = 1;
@@ -1911,7 +1911,7 @@ static void execute_cheatnext(running_machine &machine, int ref, int params, con
return;
}
- if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, AS_PROGRAM, &space))
+ if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, AS_PROGRAM, space))
return;
if (params > 1 && !debug_command_parameter_number(machine, param[1], &comp_value))
@@ -1951,7 +1951,7 @@ static void execute_cheatnext(running_machine &machine, int ref, int params, con
for (cheatindex = 0; cheatindex < cheat.length; cheatindex += 1)
if (cheat.cheatmap[cheatindex].state == 1)
{
- UINT64 cheat_value = cheat_read_extended(&cheat, space, cheat.cheatmap[cheatindex].offset);
+ UINT64 cheat_value = cheat_read_extended(&cheat, *space, cheat.cheatmap[cheatindex].offset);
UINT64 comp_byte = (ref == 0) ? cheat.cheatmap[cheatindex].previous_value : cheat.cheatmap[cheatindex].first_value;
UINT8 disable_byte = FALSE;
@@ -2066,7 +2066,7 @@ static void execute_cheatlist(running_machine &machine, int ref, int params, con
UINT64 sizemask;
FILE *f = NULL;
- if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, AS_PROGRAM, &space))
+ if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, AS_PROGRAM, space))
return;
if (!debug_command_parameter_cpu(machine, &cheat.cpu, &cpu))
@@ -2097,7 +2097,7 @@ static void execute_cheatlist(running_machine &machine, int ref, int params, con
{
if (cheat.cheatmap[cheatindex].state == 1)
{
- UINT64 value = cheat_byte_swap(&cheat, cheat_read_extended(&cheat, space, cheat.cheatmap[cheatindex].offset)) & sizemask;
+ UINT64 value = cheat_byte_swap(&cheat, cheat_read_extended(&cheat, *space, cheat.cheatmap[cheatindex].offset)) & sizemask;
offs_t address = space->byte_to_address(cheat.cheatmap[cheatindex].offset);
if (params > 0)
@@ -2167,7 +2167,7 @@ static void execute_find(running_machine &machine, int ref, int params, const ch
return;
if (!debug_command_parameter_number(machine, param[1], &length))
return;
- if (!debug_command_parameter_cpu_space(machine, NULL, ref, &space))
+ if (!debug_command_parameter_cpu_space(machine, NULL, ref, space))
return;
/* further validation */
@@ -2223,10 +2223,10 @@ static void execute_find(running_machine &machine, int ref, int params, const ch
{
switch (data_size[j])
{
- case 1: match = ((UINT8)debug_read_byte(space, i + suboffset, TRUE) == (UINT8)data_to_find[j]); break;
- case 2: match = ((UINT16)debug_read_word(space, i + suboffset, TRUE) == (UINT16)data_to_find[j]); break;
- case 4: match = ((UINT32)debug_read_dword(space, i + suboffset, TRUE) == (UINT32)data_to_find[j]); break;
- case 8: match = ((UINT64)debug_read_qword(space, i + suboffset, TRUE) == (UINT64)data_to_find[j]); break;
+ case 1: match = ((UINT8)debug_read_byte(*space, i + suboffset, TRUE) == (UINT8)data_to_find[j]); break;
+ case 2: match = ((UINT16)debug_read_word(*space, i + suboffset, TRUE) == (UINT16)data_to_find[j]); break;
+ case 4: match = ((UINT32)debug_read_dword(*space, i + suboffset, TRUE) == (UINT32)data_to_find[j]); break;
+ case 8: match = ((UINT64)debug_read_qword(*space, i + suboffset, TRUE) == (UINT64)data_to_find[j]); break;
default: /* all other cases are wildcards */ break;
}
suboffset += data_size[j] & 0x0f;
@@ -2265,7 +2265,7 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
return;
if (!debug_command_parameter_number(machine, param[3], &bytes))
return;
- if (!debug_command_parameter_cpu_space(machine, (params > 4) ? param[4] : NULL, AS_PROGRAM, &space))
+ if (!debug_command_parameter_cpu_space(machine, (params > 4) ? param[4] : NULL, AS_PROGRAM, space))
return;
/* determine the width of the bytes */
@@ -2302,15 +2302,15 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
/* make sure we can translate the address */
tempaddr = pcbyte;
- if (debug_cpu_translate(space, TRANSLATE_FETCH_DEBUG, &tempaddr))
+ if (debug_cpu_translate(*space, TRANSLATE_FETCH_DEBUG, &tempaddr))
{
UINT8 opbuf[64], argbuf[64];
/* fetch the bytes up to the maximum */
for (numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, FALSE);
- argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, TRUE);
+ opbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, FALSE);
+ argbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, TRUE);
}
/* disassemble the result */
@@ -2323,7 +2323,7 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
int startdex = outdex;
numbytes = space->address_to_byte(numbytes);
for (j = 0; j < numbytes; j += minbytes)
- outdex += sprintf(&output[outdex], "%s ", core_i64_hex_format(debug_read_opcode(space, pcbyte + j, minbytes, FALSE), minbytes * 2));
+ outdex += sprintf(&output[outdex], "%s ", core_i64_hex_format(debug_read_opcode(*space, pcbyte + j, minbytes, FALSE), minbytes * 2));
if (outdex - startdex < byteswidth)
outdex += sprintf(&output[outdex], "%*s", byteswidth - (outdex - startdex), "");
outdex += sprintf(&output[outdex], " ");
@@ -2449,7 +2449,7 @@ static void execute_history(running_machine &machine, int ref, int params, const
{
/* validate parameters */
address_space *space;
- if (!debug_command_parameter_cpu_space(machine, (params > 0) ? param[0] : NULL, AS_PROGRAM, &space))
+ if (!debug_command_parameter_cpu_space(machine, (params > 0) ? param[0] : NULL, AS_PROGRAM, space))
return;
UINT64 count = device_debug::HISTORY_SIZE;
@@ -2473,8 +2473,8 @@ static void execute_history(running_machine &machine, int ref, int params, const
UINT8 opbuf[64], argbuf[64];
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, false);
- argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, true);
+ opbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, false);
+ argbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, true);
}
char buffer[200];
@@ -2557,7 +2557,7 @@ static void execute_map(running_machine &machine, int ref, int params, const cha
return;
/* CPU is implicit */
- if (!debug_command_parameter_cpu_space(machine, NULL, ref, &space))
+ if (!debug_command_parameter_cpu_space(machine, NULL, ref, space))
return;
/* do the translation first */
@@ -2565,9 +2565,9 @@ static void execute_map(running_machine &machine, int ref, int params, const cha
{
static const char *const intnames[] = { "Read", "Write", "Fetch" };
taddress = space->address_to_byte(address) & space->bytemask();
- if (debug_cpu_translate(space, intention, &taddress))
+ if (debug_cpu_translate(*space, intention, &taddress))
{
- const char *mapname = const_cast<address_space *>(space)->get_handler_string((intention == TRANSLATE_WRITE_DEBUG) ? ROW_WRITE : ROW_READ, taddress);
+ const char *mapname = space->get_handler_string((intention == TRANSLATE_WRITE_DEBUG) ? ROW_WRITE : ROW_READ, taddress);
debug_console_printf(machine, "%7s: %s logical == %s physical -> %s\n", intnames[intention & 3], core_i64_hex_format(address, space->logaddrchars()), core_i64_hex_format(space->byte_to_address(taddress), space->addrchars()), mapname);
}
else
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index f60ddee0554..d24ad7282ca 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -115,10 +115,10 @@ static void process_source_file(running_machine &machine);
/* expression handlers */
static UINT64 expression_read_memory(void *param, const char *name, expression_space space, UINT32 address, int size);
-static UINT64 expression_read_program_direct(address_space *space, int opcode, offs_t address, int size);
+static UINT64 expression_read_program_direct(address_space &space, int opcode, offs_t address, int size);
static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size);
static void expression_write_memory(void *param, const char *name, expression_space space, UINT32 address, int size, UINT64 data);
-static void expression_write_program_direct(address_space *space, int opcode, offs_t address, int size, UINT64 data);
+static void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, UINT64 data);
static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data);
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space);
@@ -448,11 +448,11 @@ bool debug_comment_load(running_machine &machine)
address
-------------------------------------------------*/
-int debug_cpu_translate(address_space *space, int intention, offs_t *address)
+int debug_cpu_translate(address_space &space, int intention, offs_t *address)
{
device_memory_interface *memory;
- if (space->device().interface(memory))
- return memory->translate(space->spacenum(), intention, *address);
+ if (space.device().interface(memory))
+ return memory->translate(space.spacenum(), intention, *address);
return true;
}
@@ -466,33 +466,32 @@ int debug_cpu_translate(address_space *space, int intention, offs_t *address)
the specified memory space
-------------------------------------------------*/
-UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translation)
+UINT8 debug_read_byte(address_space &space, offs_t address, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
UINT64 custom;
UINT8 result;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, return 0xff */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
result = 0xff;
/* if there is a custom read handler, and it returns true, use that value */
- else if (space->device().memory().read(space->spacenum(), address, 1, custom))
+ else if (space.device().memory().read(space.spacenum(), address, 1, custom))
result = custom;
/* otherwise, call the byte reading function for the translated address */
else
- result = space->read_byte(address);
+ result = space.read_byte(address);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
return result;
}
@@ -502,14 +501,13 @@ UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translati
specified memory space
-------------------------------------------------*/
-UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translation)
+UINT16 debug_read_word(address_space &space, offs_t address, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
UINT16 result;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* if this is misaligned read, or if there are no word readers, just read two bytes */
if ((address & 1) != 0)
@@ -518,7 +516,7 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
UINT8 byte1 = debug_read_byte(space, address + 1, apply_translation);
/* based on the endianness, the result is assembled differently */
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
result = byte0 | (byte1 << 8);
else
result = byte1 | (byte0 << 8);
@@ -530,22 +528,22 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
UINT64 custom;
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, return 0xffff */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
result = 0xffff;
/* if there is a custom read handler, and it returns true, use that value */
- else if (space->device().memory().read(space->spacenum(), address, 2, custom))
+ else if (space.device().memory().read(space.spacenum(), address, 2, custom))
result = custom;
/* otherwise, call the byte reading function for the translated address */
else
- result = space->read_word(address);
+ result = space.read_word(address);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
}
return result;
@@ -557,14 +555,13 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
specified memory space
-------------------------------------------------*/
-UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_translation)
+UINT32 debug_read_dword(address_space &space, offs_t address, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
UINT32 result;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* if this is misaligned read, or if there are no dword readers, just read two words */
if ((address & 3) != 0)
@@ -573,7 +570,7 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
UINT16 word1 = debug_read_word(space, address + 2, apply_translation);
/* based on the endianness, the result is assembled differently */
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
result = word0 | (word1 << 16);
else
result = word1 | (word0 << 16);
@@ -585,22 +582,22 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
UINT64 custom;
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, return 0xffffffff */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
result = 0xffffffff;
/* if there is a custom read handler, and it returns true, use that value */
- else if (space->device().memory().read(space->spacenum(), address, 4, custom))
+ else if (space.device().memory().read(space.spacenum(), address, 4, custom))
result = custom;
/* otherwise, call the byte reading function for the translated address */
else
- result = space->read_dword(address);
+ result = space.read_dword(address);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
}
return result;
@@ -612,14 +609,13 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
specified memory space
-------------------------------------------------*/
-UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_translation)
+UINT64 debug_read_qword(address_space &space, offs_t address, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
UINT64 result;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* if this is misaligned read, or if there are no qword readers, just read two dwords */
if ((address & 7) != 0)
@@ -628,7 +624,7 @@ UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_transla
UINT32 dword1 = debug_read_dword(space, address + 4, apply_translation);
/* based on the endianness, the result is assembled differently */
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
result = dword0 | ((UINT64)dword1 << 32);
else
result = dword1 | ((UINT64)dword0 << 32);
@@ -640,22 +636,22 @@ UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_transla
UINT64 custom;
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, return 0xffffffffffffffff */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
result = ~(UINT64)0;
/* if there is a custom read handler, and it returns true, use that value */
- else if (space->device().memory().read(space->spacenum(), address, 8, custom))
+ else if (space.device().memory().read(space.spacenum(), address, 8, custom))
result = custom;
/* otherwise, call the byte reading function for the translated address */
else
- result = space->read_qword(address);
+ result = space.read_qword(address);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
}
return result;
@@ -667,7 +663,7 @@ UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_transla
from the specified memory space
-------------------------------------------------*/
-UINT64 debug_read_memory(address_space *space, offs_t address, int size, int apply_translation)
+UINT64 debug_read_memory(address_space &space, offs_t address, int size, int apply_translation)
{
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
switch (size)
@@ -686,31 +682,30 @@ UINT64 debug_read_memory(address_space *space, offs_t address, int size, int app
specified memory space
-------------------------------------------------*/
-void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int apply_translation)
+void debug_write_byte(address_space &space, offs_t address, UINT8 data, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, we're done */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
;
/* if there is a custom write handler, and it returns true, use that */
- else if (space->device().memory().write(space->spacenum(), address, 1, data))
+ else if (space.device().memory().write(space.spacenum(), address, 1, data))
;
/* otherwise, call the byte reading function for the translated address */
else
- space->write_byte(address, data);
+ space.write_byte(address, data);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
global->memory_modified = true;
}
@@ -720,18 +715,17 @@ void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int app
specified memory space
-------------------------------------------------*/
-void debug_write_word(address_space *_space, offs_t address, UINT16 data, int apply_translation)
+void debug_write_word(address_space &space, offs_t address, UINT16 data, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* if this is a misaligned write, or if there are no word writers, just read two bytes */
if ((address & 1) != 0)
{
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
{
debug_write_byte(space, address + 0, data >> 0, apply_translation);
debug_write_byte(space, address + 1, data >> 8, apply_translation);
@@ -747,22 +741,22 @@ void debug_write_word(address_space *_space, offs_t address, UINT16 data, int ap
else
{
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, we're done */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
;
/* if there is a custom write handler, and it returns true, use that */
- else if (space->device().memory().write(space->spacenum(), address, 2, data))
+ else if (space.device().memory().write(space.spacenum(), address, 2, data))
;
/* otherwise, call the byte reading function for the translated address */
else
- space->write_word(address, data);
+ space.write_word(address, data);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
global->memory_modified = true;
}
}
@@ -773,18 +767,17 @@ void debug_write_word(address_space *_space, offs_t address, UINT16 data, int ap
specified memory space
-------------------------------------------------*/
-void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int apply_translation)
+void debug_write_dword(address_space &space, offs_t address, UINT32 data, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* if this is a misaligned write, or if there are no dword writers, just read two words */
if ((address & 3) != 0)
{
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
{
debug_write_word(space, address + 0, data >> 0, apply_translation);
debug_write_word(space, address + 2, data >> 16, apply_translation);
@@ -800,22 +793,22 @@ void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int a
else
{
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, we're done */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
;
/* if there is a custom write handler, and it returns true, use that */
- else if (space->device().memory().write(space->spacenum(), address, 4, data))
+ else if (space.device().memory().write(space.spacenum(), address, 4, data))
;
/* otherwise, call the byte reading function for the translated address */
else
- space->write_dword(address, data);
+ space.write_dword(address, data);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
global->memory_modified = true;
}
}
@@ -826,18 +819,17 @@ void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int a
specified memory space
-------------------------------------------------*/
-void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int apply_translation)
+void debug_write_qword(address_space &space, offs_t address, UINT64 data, int apply_translation)
{
- address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
/* mask against the logical byte mask */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* if this is a misaligned write, or if there are no qword writers, just read two dwords */
if ((address & 7) != 0)
{
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
{
debug_write_dword(space, address + 0, data >> 0, apply_translation);
debug_write_dword(space, address + 4, data >> 32, apply_translation);
@@ -853,22 +845,22 @@ void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int a
else
{
/* all accesses from this point on are for the debugger */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* translate if necessary; if not mapped, we're done */
if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
;
/* if there is a custom write handler, and it returns true, use that */
- else if (space->device().memory().write(space->spacenum(), address, 8, data))
+ else if (space.device().memory().write(space.spacenum(), address, 8, data))
;
/* otherwise, call the byte reading function for the translated address */
else
- space->write_qword(address, data);
+ space.write_qword(address, data);
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
global->memory_modified = true;
}
}
@@ -879,7 +871,7 @@ void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int a
to the specified memory space
-------------------------------------------------*/
-void debug_write_memory(address_space *space, offs_t address, UINT64 data, int size, int apply_translation)
+void debug_write_memory(address_space &space, offs_t address, UINT64 data, int size, int apply_translation)
{
switch (size)
{
@@ -896,32 +888,31 @@ void debug_write_memory(address_space *space, offs_t address, UINT64 data, int s
the given offset from opcode space
-------------------------------------------------*/
-UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int arg)
+UINT64 debug_read_opcode(address_space &space, offs_t address, int size, int arg)
{
- address_space *space = const_cast<address_space *>(_space);
UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2;
- debugcpu_private *global = space->machine().debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
/* keep in logical range */
- address &= space->logbytemask();
+ address &= space.logbytemask();
/* return early if we got the result directly */
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
device_memory_interface *memory;
- if (space->device().interface(memory) && memory->readop(address, size, result2))
+ if (space.device().interface(memory) && memory->readop(address, size, result2))
{
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
return result2;
}
/* if we're bigger than the address bus, break into smaller pieces */
- if (size > space->data_width() / 8)
+ if (size > space.data_width() / 8)
{
int halfsize = size / 2;
UINT64 r0 = debug_read_opcode(space, address + 0, halfsize, arg);
UINT64 r1 = debug_read_opcode(space, address + halfsize, halfsize, arg);
- if (space->endianness() == ENDIANNESS_LITTLE)
+ if (space.endianness() == ENDIANNESS_LITTLE)
return r0 | (r1 << (8 * halfsize));
else
return r1 | (r0 << (8 * halfsize));
@@ -932,9 +923,9 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
return result;
/* keep in physical range */
- address &= space->bytemask();
+ address &= space.bytemask();
offs_t addrxor = 0;
- switch (space->data_width() / 8 * 10 + size)
+ switch (space.data_width() / 8 * 10 + size)
{
/* dump opcodes in bytes from a byte-sized bus */
case 11:
@@ -942,7 +933,7 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
/* dump opcodes in bytes from a word-sized bus */
case 21:
- addrxor = (space->endianness() == ENDIANNESS_LITTLE) ? BYTE_XOR_LE(0) : BYTE_XOR_BE(0);
+ addrxor = (space.endianness() == ENDIANNESS_LITTLE) ? BYTE_XOR_LE(0) : BYTE_XOR_BE(0);
break;
/* dump opcodes in words from a word-sized bus */
@@ -951,12 +942,12 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
/* dump opcodes in bytes from a dword-sized bus */
case 41:
- addrxor = (space->endianness() == ENDIANNESS_LITTLE) ? BYTE4_XOR_LE(0) : BYTE4_XOR_BE(0);
+ addrxor = (space.endianness() == ENDIANNESS_LITTLE) ? BYTE4_XOR_LE(0) : BYTE4_XOR_BE(0);
break;
/* dump opcodes in words from a dword-sized bus */
case 42:
- addrxor = (space->endianness() == ENDIANNESS_LITTLE) ? WORD_XOR_LE(0) : WORD_XOR_BE(0);
+ addrxor = (space.endianness() == ENDIANNESS_LITTLE) ? WORD_XOR_LE(0) : WORD_XOR_BE(0);
break;
/* dump opcodes in dwords from a dword-sized bus */
@@ -965,17 +956,17 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
/* dump opcodes in bytes from a qword-sized bus */
case 81:
- addrxor = (space->endianness() == ENDIANNESS_LITTLE) ? BYTE8_XOR_LE(0) : BYTE8_XOR_BE(0);
+ addrxor = (space.endianness() == ENDIANNESS_LITTLE) ? BYTE8_XOR_LE(0) : BYTE8_XOR_BE(0);
break;
/* dump opcodes in words from a qword-sized bus */
case 82:
- addrxor = (space->endianness() == ENDIANNESS_LITTLE) ? WORD2_XOR_LE(0) : WORD2_XOR_BE(0);
+ addrxor = (space.endianness() == ENDIANNESS_LITTLE) ? WORD2_XOR_LE(0) : WORD2_XOR_BE(0);
break;
/* dump opcodes in dwords from a qword-sized bus */
case 84:
- addrxor = (space->endianness() == ENDIANNESS_LITTLE) ? DWORD_XOR_LE(0) : DWORD_XOR_BE(0);
+ addrxor = (space.endianness() == ENDIANNESS_LITTLE) ? DWORD_XOR_LE(0) : DWORD_XOR_BE(0);
break;
/* dump opcodes in qwords from a qword-sized bus */
@@ -983,27 +974,27 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
break;
default:
- fatalerror("debug_read_opcode: unknown type = %d\n", space->data_width() / 8 * 10 + size);
+ fatalerror("debug_read_opcode: unknown type = %d\n", space.data_width() / 8 * 10 + size);
break;
}
/* turn on debugger access */
if (!global->debugger_access)
- space->set_debugger_access(global->debugger_access = true);
+ space.set_debugger_access(global->debugger_access = true);
/* switch off the size and handle unaligned accesses */
switch (size)
{
case 1:
- result = (arg) ? space->direct().read_raw_byte(address, addrxor) : space->direct().read_decrypted_byte(address, addrxor);
+ result = (arg) ? space.direct().read_raw_byte(address, addrxor) : space.direct().read_decrypted_byte(address, addrxor);
break;
case 2:
- result = (arg) ? space->direct().read_raw_word(address & ~1, addrxor) : space->direct().read_decrypted_word(address & ~1, addrxor);
+ result = (arg) ? space.direct().read_raw_word(address & ~1, addrxor) : space.direct().read_decrypted_word(address & ~1, addrxor);
if ((address & 1) != 0)
{
- result2 = (arg) ? space->direct().read_raw_word((address & ~1) + 2, addrxor) : space->direct().read_decrypted_word((address & ~1) + 2, addrxor);
- if (space->endianness() == ENDIANNESS_LITTLE)
+ result2 = (arg) ? space.direct().read_raw_word((address & ~1) + 2, addrxor) : space.direct().read_decrypted_word((address & ~1) + 2, addrxor);
+ if (space.endianness() == ENDIANNESS_LITTLE)
result = (result >> (8 * (address & 1))) | (result2 << (16 - 8 * (address & 1)));
else
result = (result << (8 * (address & 1))) | (result2 >> (16 - 8 * (address & 1)));
@@ -1012,11 +1003,11 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
break;
case 4:
- result = (arg) ? space->direct().read_raw_dword(address & ~3, addrxor) : space->direct().read_decrypted_dword(address & ~3, addrxor);
+ result = (arg) ? space.direct().read_raw_dword(address & ~3, addrxor) : space.direct().read_decrypted_dword(address & ~3, addrxor);
if ((address & 3) != 0)
{
- result2 = (arg) ? space->direct().read_raw_dword((address & ~3) + 4, addrxor) : space->direct().read_decrypted_dword((address & ~3) + 4, addrxor);
- if (space->endianness() == ENDIANNESS_LITTLE)
+ result2 = (arg) ? space.direct().read_raw_dword((address & ~3) + 4, addrxor) : space.direct().read_decrypted_dword((address & ~3) + 4, addrxor);
+ if (space.endianness() == ENDIANNESS_LITTLE)
result = (result >> (8 * (address & 3))) | (result2 << (32 - 8 * (address & 3)));
else
result = (result << (8 * (address & 3))) | (result2 >> (32 - 8 * (address & 3)));
@@ -1025,11 +1016,11 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
break;
case 8:
- result = (arg) ? space->direct().read_raw_qword(address & ~7, addrxor) : space->direct().read_decrypted_qword(address & ~7, addrxor);
+ result = (arg) ? space.direct().read_raw_qword(address & ~7, addrxor) : space.direct().read_decrypted_qword(address & ~7, addrxor);
if ((address & 7) != 0)
{
- result2 = (arg) ? space->direct().read_raw_qword((address & ~7) + 8, addrxor) : space->direct().read_decrypted_qword((address & ~7) + 8, addrxor);
- if (space->endianness() == ENDIANNESS_LITTLE)
+ result2 = (arg) ? space.direct().read_raw_qword((address & ~7) + 8, addrxor) : space.direct().read_decrypted_qword((address & ~7) + 8, addrxor);
+ if (space.endianness() == ENDIANNESS_LITTLE)
result = (result >> (8 * (address & 7))) | (result2 << (64 - 8 * (address & 7)));
else
result = (result << (8 * (address & 7))) | (result2 >> (64 - 8 * (address & 7)));
@@ -1038,7 +1029,7 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
}
/* no longer accessing via the debugger */
- space->set_debugger_access(global->debugger_access = false);
+ space.set_debugger_access(global->debugger_access = false);
return result;
}
@@ -1178,7 +1169,7 @@ static UINT64 expression_read_memory(void *param, const char *name, expression_s
device = debug_cpu_get_visible_cpu(machine);
space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
if (space != NULL)
- result = debug_read_memory(space, space->address_to_byte(address), size, true);
+ result = debug_read_memory(*space, space->address_to_byte(address), size, true);
break;
case EXPSPACE_PROGRAM_PHYSICAL:
@@ -1191,7 +1182,7 @@ static UINT64 expression_read_memory(void *param, const char *name, expression_s
device = debug_cpu_get_visible_cpu(machine);
space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
if (space != NULL)
- result = debug_read_memory(space, space->address_to_byte(address), size, false);
+ result = debug_read_memory(*space, space->address_to_byte(address), size, false);
break;
case EXPSPACE_OPCODE:
@@ -1200,7 +1191,7 @@ static UINT64 expression_read_memory(void *param, const char *name, expression_s
device = expression_get_device(machine, name);
if (device == NULL)
device = debug_cpu_get_visible_cpu(machine);
- result = expression_read_program_direct(device->memory().space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size);
+ result = expression_read_program_direct(*device->memory().space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size);
break;
case EXPSPACE_REGION:
@@ -1221,56 +1212,51 @@ static UINT64 expression_read_memory(void *param, const char *name, expression_s
directly from an opcode or RAM pointer
-------------------------------------------------*/
-static UINT64 expression_read_program_direct(address_space *_space, int opcode, offs_t address, int size)
+static UINT64 expression_read_program_direct(address_space &space, int opcode, offs_t address, int size)
{
- address_space *space = const_cast<address_space *>(_space);
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
+ UINT8 *base;
+
+ /* adjust the address into a byte address, but not if being called recursively */
+ if ((opcode & 2) == 0)
+ address = space.address_to_byte(address);
- if (space != NULL)
+ /* call ourself recursively until we are byte-sized */
+ if (size > 1)
{
- UINT8 *base;
+ int halfsize = size / 2;
+ UINT64 r0, r1;
- /* adjust the address into a byte address, but not if being called recursively */
- if ((opcode & 2) == 0)
- address = space->address_to_byte(address);
+ /* read each half, from lower address to upper address */
+ r0 = expression_read_program_direct(space, opcode | 2, address + 0, halfsize);
+ r1 = expression_read_program_direct(space, opcode | 2, address + halfsize, halfsize);
- /* call ourself recursively until we are byte-sized */
- if (size > 1)
- {
- int halfsize = size / 2;
- UINT64 r0, r1;
-
- /* read each half, from lower address to upper address */
- r0 = expression_read_program_direct(space, opcode | 2, address + 0, halfsize);
- r1 = expression_read_program_direct(space, opcode | 2, address + halfsize, halfsize);
+ /* assemble based on the target endianness */
+ if (space.endianness() == ENDIANNESS_LITTLE)
+ result = r0 | (r1 << (8 * halfsize));
+ else
+ result = r1 | (r0 << (8 * halfsize));
+ }
- /* assemble based on the target endianness */
- if (space->endianness() == ENDIANNESS_LITTLE)
- result = r0 | (r1 << (8 * halfsize));
- else
- result = r1 | (r0 << (8 * halfsize));
- }
+ /* handle the byte-sized final requests */
+ else
+ {
+ /* lowmask specified which address bits are within the databus width */
+ offs_t lowmask = space.data_width() / 8 - 1;
- /* handle the byte-sized final requests */
+ /* get the base of memory, aligned to the address minus the lowbits */
+ if (opcode & 1)
+ base = (UINT8 *)space.direct().read_decrypted_ptr(address & ~lowmask);
else
- {
- /* lowmask specified which address bits are within the databus width */
- offs_t lowmask = space->data_width() / 8 - 1;
+ base = (UINT8 *)space.get_read_ptr(address & ~lowmask);
- /* get the base of memory, aligned to the address minus the lowbits */
- if (opcode & 1)
- base = (UINT8 *)space->direct().read_decrypted_ptr(address & ~lowmask);
+ /* if we have a valid base, return the appropriate byte */
+ if (base != NULL)
+ {
+ if (space.endianness() == ENDIANNESS_LITTLE)
+ result = base[BYTE8_XOR_LE(address) & lowmask];
else
- base = (UINT8 *)space->get_read_ptr(address & ~lowmask);
-
- /* if we have a valid base, return the appropriate byte */
- if (base != NULL)
- {
- if (space->endianness() == ENDIANNESS_LITTLE)
- result = base[BYTE8_XOR_LE(address) & lowmask];
- else
- result = base[BYTE8_XOR_BE(address) & lowmask];
- }
+ result = base[BYTE8_XOR_BE(address) & lowmask];
}
}
return result;
@@ -1349,7 +1335,7 @@ static void expression_write_memory(void *param, const char *name, expression_sp
device = debug_cpu_get_visible_cpu(machine);
space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
if (space != NULL)
- debug_write_memory(space, space->address_to_byte(address), data, size, true);
+ debug_write_memory(*space, space->address_to_byte(address), data, size, true);
break;
case EXPSPACE_PROGRAM_PHYSICAL:
@@ -1362,7 +1348,7 @@ static void expression_write_memory(void *param, const char *name, expression_sp
device = debug_cpu_get_visible_cpu(machine);
space = device->memory().space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
if (space != NULL)
- debug_write_memory(space, space->address_to_byte(address), data, size, false);
+ debug_write_memory(*space, space->address_to_byte(address), data, size, false);
break;
case EXPSPACE_OPCODE:
@@ -1371,7 +1357,7 @@ static void expression_write_memory(void *param, const char *name, expression_sp
device = expression_get_device(machine, name);
if (device == NULL)
device = debug_cpu_get_visible_cpu(machine);
- expression_write_program_direct(device->memory().space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size, data);
+ expression_write_program_direct(*device->memory().space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size, data);
break;
case EXPSPACE_REGION:
@@ -1391,63 +1377,59 @@ static void expression_write_memory(void *param, const char *name, expression_sp
directly to an opcode or RAM pointer
-------------------------------------------------*/
-static void expression_write_program_direct(address_space *_space, int opcode, offs_t address, int size, UINT64 data)
+static void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, UINT64 data)
{
- address_space *space = const_cast<address_space *>(_space);
- if (space != NULL)
- {
- debugcpu_private *global = space->machine().debugcpu_data;
- UINT8 *base;
+ debugcpu_private *global = space.machine().debugcpu_data;
+ UINT8 *base;
- /* adjust the address into a byte address, but not if being called recursively */
- if ((opcode & 2) == 0)
- address = space->address_to_byte(address);
+ /* adjust the address into a byte address, but not if being called recursively */
+ if ((opcode & 2) == 0)
+ address = space.address_to_byte(address);
- /* call ourself recursively until we are byte-sized */
- if (size > 1)
+ /* call ourself recursively until we are byte-sized */
+ if (size > 1)
+ {
+ int halfsize = size / 2;
+ UINT64 r0, r1, halfmask;
+
+ /* break apart based on the target endianness */
+ halfmask = ~(UINT64)0 >> (64 - 8 * halfsize);
+ if (space.endianness() == ENDIANNESS_LITTLE)
{
- int halfsize = size / 2;
- UINT64 r0, r1, halfmask;
+ r0 = data & halfmask;
+ r1 = (data >> (8 * halfsize)) & halfmask;
+ }
+ else
+ {
+ r0 = (data >> (8 * halfsize)) & halfmask;
+ r1 = data & halfmask;
+ }
- /* break apart based on the target endianness */
- halfmask = ~(UINT64)0 >> (64 - 8 * halfsize);
- if (space->endianness() == ENDIANNESS_LITTLE)
- {
- r0 = data & halfmask;
- r1 = (data >> (8 * halfsize)) & halfmask;
- }
- else
- {
- r0 = (data >> (8 * halfsize)) & halfmask;
- r1 = data & halfmask;
- }
+ /* write each half, from lower address to upper address */
+ expression_write_program_direct(space, opcode | 2, address + 0, halfsize, r0);
+ expression_write_program_direct(space, opcode | 2, address + halfsize, halfsize, r1);
+ }
- /* write each half, from lower address to upper address */
- expression_write_program_direct(space, opcode | 2, address + 0, halfsize, r0);
- expression_write_program_direct(space, opcode | 2, address + halfsize, halfsize, r1);
- }
+ /* handle the byte-sized final case */
+ else
+ {
+ /* lowmask specified which address bits are within the databus width */
+ offs_t lowmask = space.data_width() / 8 - 1;
- /* handle the byte-sized final case */
+ /* get the base of memory, aligned to the address minus the lowbits */
+ if (opcode & 1)
+ base = (UINT8 *)space.direct().read_decrypted_ptr(address & ~lowmask);
else
- {
- /* lowmask specified which address bits are within the databus width */
- offs_t lowmask = space->data_width() / 8 - 1;
+ base = (UINT8 *)space.get_read_ptr(address & ~lowmask);
- /* get the base of memory, aligned to the address minus the lowbits */
- if (opcode & 1)
- base = (UINT8 *)space->direct().read_decrypted_ptr(address & ~lowmask);
+ /* if we have a valid base, write the appropriate byte */
+ if (base != NULL)
+ {
+ if (space.endianness() == ENDIANNESS_LITTLE)
+ base[BYTE8_XOR_LE(address) & lowmask] = data;
else
- base = (UINT8 *)space->get_read_ptr(address & ~lowmask);
-
- /* if we have a valid base, write the appropriate byte */
- if (base != NULL)
- {
- if (space->endianness() == ENDIANNESS_LITTLE)
- base[BYTE8_XOR_LE(address) & lowmask] = data;
- else
- base[BYTE8_XOR_BE(address) & lowmask] = data;
- global->memory_modified = true;
- }
+ base[BYTE8_XOR_BE(address) & lowmask] = data;
+ global->memory_modified = true;
}
}
}
@@ -2057,8 +2039,8 @@ offs_t device_debug::disassemble(char *buffer, offs_t pc, const UINT8 *oprom, co
#ifdef MAME_DEBUG
if (m_memory != NULL && m_disasm != NULL)
{
- address_space *space = m_memory->space(AS_PROGRAM);
- int bytes = space->address_to_byte(result & DASMFLAG_LENGTHMASK);
+ address_space &space = *m_memory->space(AS_PROGRAM);
+ int bytes = space.address_to_byte(result & DASMFLAG_LENGTHMASK);
assert(bytes >= m_disasm->min_opcode_bytes());
assert(bytes <= m_disasm->max_opcode_bytes());
(void) bytes; // appease compiler
@@ -2684,9 +2666,7 @@ UINT32 device_debug::compute_opcode_crc32(offs_t address) const
return 0;
// no program interface, just fail
- address_space *space = m_memory->space(AS_PROGRAM);
- if (space == NULL)
- return 0;
+ address_space &space = *m_memory->space(AS_PROGRAM);
// zero out the buffers
UINT8 opbuf[64], argbuf[64];
@@ -2703,8 +2683,8 @@ UINT32 device_debug::compute_opcode_crc32(offs_t address) const
// disassemble and then convert to bytes
char buff[256];
- int numbytes = disassemble(buff, address & space->logaddrmask(), opbuf, argbuf) & DASMFLAG_LENGTHMASK;
- numbytes = space->address_to_byte(numbytes);
+ int numbytes = disassemble(buff, address & space.logaddrmask(), opbuf, argbuf) & DASMFLAG_LENGTHMASK;
+ numbytes = space.address_to_byte(numbytes);
// return a CRC of the resulting bytes
return crc32(0, argbuf, numbytes);
@@ -3036,8 +3016,8 @@ UINT32 device_debug::dasm_wrapped(astring &buffer, offs_t pc)
assert(m_memory != NULL && m_disasm != NULL);
// determine the adjusted PC
- address_space *space = m_memory->space(AS_PROGRAM);
- offs_t pcbyte = space->address_to_byte(pc) & space->bytemask();
+ address_space &space = *m_memory->space(AS_PROGRAM);
+ offs_t pcbyte = space.address_to_byte(pc) & space.bytemask();
// fetch the bytes up to the maximum
UINT8 opbuf[64], argbuf[64];
@@ -3100,8 +3080,8 @@ UINT64 device_debug::get_totalcycles(symbol_table &table, void *ref)
UINT64 device_debug::get_logunmap(symbol_table &table, void *ref)
{
- address_space *space = reinterpret_cast<address_space *>(table.globalref());
- return space->log_unmap();
+ address_space &space = *reinterpret_cast<address_space *>(table.globalref());
+ return space.log_unmap();
}
@@ -3112,8 +3092,8 @@ UINT64 device_debug::get_logunmap(symbol_table &table, void *ref)
void device_debug::set_logunmap(symbol_table &table, void *ref, UINT64 value)
{
- address_space *space = reinterpret_cast<address_space *>(table.globalref());
- space->set_log_unmap(value ? true : false);
+ address_space &space = *reinterpret_cast<address_space *>(table.globalref());
+ space.set_log_unmap(value ? true : false);
}
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index 984ab789d12..86d0106d7ad 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -422,40 +422,40 @@ bool debug_comment_load(running_machine &machine);
/* ----- debugger memory accessors ----- */
/* return the physical address corresponding to the given logical address */
-int debug_cpu_translate(address_space *space, int intention, offs_t *address);
+int debug_cpu_translate(address_space &space, int intention, offs_t *address);
/* return a byte from the the specified memory space */
-UINT8 debug_read_byte(address_space *space, offs_t address, int apply_translation);
+UINT8 debug_read_byte(address_space &space, offs_t address, int apply_translation);
/* return a word from the the specified memory space */
-UINT16 debug_read_word(address_space *space, offs_t address, int apply_translation);
+UINT16 debug_read_word(address_space &space, offs_t address, int apply_translation);
/* return a dword from the the specified memory space */
-UINT32 debug_read_dword(address_space *space, offs_t address, int apply_translation);
+UINT32 debug_read_dword(address_space &space, offs_t address, int apply_translation);
/* return a qword from the the specified memory space */
-UINT64 debug_read_qword(address_space *space, offs_t address, int apply_translation);
+UINT64 debug_read_qword(address_space &space, offs_t address, int apply_translation);
/* return 1,2,4 or 8 bytes from the specified memory space */
-UINT64 debug_read_memory(address_space *space, offs_t address, int size, int apply_translation);
+UINT64 debug_read_memory(address_space &space, offs_t address, int size, int apply_translation);
/* write a byte to the specified memory space */
-void debug_write_byte(address_space *space, offs_t address, UINT8 data, int apply_translation);
+void debug_write_byte(address_space &space, offs_t address, UINT8 data, int apply_translation);
/* write a word to the specified memory space */
-void debug_write_word(address_space *space, offs_t address, UINT16 data, int apply_translation);
+void debug_write_word(address_space &space, offs_t address, UINT16 data, int apply_translation);
/* write a dword to the specified memory space */
-void debug_write_dword(address_space *space, offs_t address, UINT32 data, int apply_translation);
+void debug_write_dword(address_space &space, offs_t address, UINT32 data, int apply_translation);
/* write a qword to the specified memory space */
-void debug_write_qword(address_space *space, offs_t address, UINT64 data, int apply_translation);
+void debug_write_qword(address_space &space, offs_t address, UINT64 data, int apply_translation);
/* write 1,2,4 or 8 bytes to the specified memory space */
-void debug_write_memory(address_space *space, offs_t address, UINT64 data, int size, int apply_translation);
+void debug_write_memory(address_space &space, offs_t address, UINT64 data, int size, int apply_translation);
/* read 1,2,4 or 8 bytes at the given offset from opcode space */
-UINT64 debug_read_opcode(address_space *space, offs_t offset, int size, int arg);
+UINT64 debug_read_opcode(address_space &space, offs_t offset, int size, int arg);
#endif
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index 6cc43afb4c4..96820a82eb9 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -263,8 +263,8 @@ offs_t debug_view_disasm::find_pc_backwards(offs_t targetpc, int numinstrs)
while (curpcbyte < fillpcbyte)
{
fillpcbyte--;
- opbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1, FALSE);
- argbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1, TRUE);
+ opbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(*source.m_space, fillpcbyte, 1, FALSE);
+ argbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(*source.m_space, fillpcbyte, 1, TRUE);
}
// loop until we get past the target instruction
@@ -278,7 +278,7 @@ offs_t debug_view_disasm::find_pc_backwards(offs_t targetpc, int numinstrs)
// get the disassembly, but only if mapped
instlen = 1;
- if (debug_cpu_translate(source.m_space, TRANSLATE_FETCH, &physpcbyte))
+ if (debug_cpu_translate(*source.m_space, TRANSLATE_FETCH, &physpcbyte))
{
char dasmbuffer[100];
instlen = source.m_device.debug()->disassemble(dasmbuffer, scanpc, &opbuf[1000 + scanpcbyte - targetpcbyte], &argbuf[1000 + scanpcbyte - targetpcbyte]) & DASMFLAG_LENGTHMASK;
@@ -322,12 +322,12 @@ void debug_view_disasm::generate_bytes(offs_t pcbyte, int numbytes, int minbytes
// output the first value
int offset = 0;
if (maxchars >= char_num * minbytes)
- offset = sprintf(string, "%s", core_i64_format(debug_read_opcode(source.m_space, pcbyte, minbytes, FALSE), minbytes * char_num, source.is_octal()));
+ offset = sprintf(string, "%s", core_i64_format(debug_read_opcode(*source.m_space, pcbyte, minbytes, FALSE), minbytes * char_num, source.is_octal()));
// output subsequent values
int byte;
for (byte = minbytes; byte < numbytes && offset + 1 + char_num * minbytes < maxchars; byte += minbytes)
- offset += sprintf(&string[offset], " %s", core_i64_format(debug_read_opcode(source.m_space, pcbyte + byte, minbytes, encrypted), minbytes * char_num, source.is_octal()));
+ offset += sprintf(&string[offset], " %s", core_i64_format(debug_read_opcode(*source.m_space, pcbyte + byte, minbytes, encrypted), minbytes * char_num, source.is_octal()));
// if we ran out of room, indicate more
string[maxchars - 1] = 0;
@@ -407,15 +407,15 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
char buffer[100];
int numbytes = 0;
offs_t physpcbyte = pcbyte;
- if (debug_cpu_translate(source.m_space, TRANSLATE_FETCH_DEBUG, &physpcbyte))
+ if (debug_cpu_translate(*source.m_space, TRANSLATE_FETCH_DEBUG, &physpcbyte))
{
UINT8 opbuf[64], argbuf[64];
// fetch the bytes up to the maximum
for (numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1, FALSE);
- argbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1, TRUE);
+ opbuf[numbytes] = debug_read_opcode(*source.m_space, pcbyte + numbytes, 1, FALSE);
+ argbuf[numbytes] = debug_read_opcode(*source.m_space, pcbyte + numbytes, 1, TRUE);
}
// disassemble the result
diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c
index 5acec26e2cf..a8ebc452702 100644
--- a/src/emu/debug/dvmemory.c
+++ b/src/emu/debug/dvmemory.c
@@ -627,10 +627,10 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data)
{
switch (size)
{
- case 1: data = debug_read_byte(source.m_space, offs, !m_no_translation); break;
- case 2: data = debug_read_word(source.m_space, offs, !m_no_translation); break;
- case 4: data = debug_read_dword(source.m_space, offs, !m_no_translation); break;
- case 8: data = debug_read_qword(source.m_space, offs, !m_no_translation); break;
+ case 1: data = debug_read_byte(*source.m_space, offs, !m_no_translation); break;
+ case 2: data = debug_read_word(*source.m_space, offs, !m_no_translation); break;
+ case 4: data = debug_read_dword(*source.m_space, offs, !m_no_translation); break;
+ case 8: data = debug_read_qword(*source.m_space, offs, !m_no_translation); break;
}
}
return ismapped;
@@ -674,10 +674,10 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data)
{
switch (size)
{
- case 1: debug_write_byte(source.m_space, offs, data, !m_no_translation); break;
- case 2: debug_write_word(source.m_space, offs, data, !m_no_translation); break;
- case 4: debug_write_dword(source.m_space, offs, data, !m_no_translation); break;
- case 8: debug_write_qword(source.m_space, offs, data, !m_no_translation); break;
+ case 1: debug_write_byte(*source.m_space, offs, data, !m_no_translation); break;
+ case 2: debug_write_word(*source.m_space, offs, data, !m_no_translation); break;
+ case 4: debug_write_dword(*source.m_space, offs, data, !m_no_translation); break;
+ case 8: debug_write_qword(*source.m_space, offs, data, !m_no_translation); break;
}
return;
}
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index ac30a5cd245..43157465c10 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -66,7 +66,7 @@ public:
static ioport_port *resolve_port(const char *tag, device_t &current);
static device_t *resolve_device(int index, const char *tag, device_t &current);
static device_execute_interface *resolve_execute_interface(const char *tag, device_t &current);
- static address_space *resolve_space(int index, const char *tag, device_t &current);
+ static address_space &resolve_space(int index, const char *tag, device_t &current);
};
@@ -131,7 +131,7 @@ device_execute_interface *devcb_resolver::resolve_execute_interface(const char *
// given a device tag and a space index
//-------------------------------------------------
-address_space *devcb_resolver::resolve_space(int index, const char *tag, device_t &current)
+address_space &devcb_resolver::resolve_space(int index, const char *tag, device_t &current)
{
// find our target device
device_t *targetdev = current.siblingdevice(tag);
@@ -148,7 +148,7 @@ address_space *devcb_resolver::resolve_space(int index, const char *tag, device_
if (result == NULL)
throw emu_fatalerror("Unable to find device '%s' space %d (requested by %s '%s')", tag, index, current.name(), current.tag());
- return result;
+ return *result;
}
@@ -201,7 +201,7 @@ void devcb_resolved_read_line::resolve(const devcb_read_line &desc, device_t &de
break;
case DEVCB_TYPE_LEGACY_SPACE:
- m_object.space = devcb_resolver::resolve_space(desc.index, desc.tag, device);
+ m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
m_helper.read8_space = desc.readspace;
*static_cast<devcb_read_line_delegate *>(this) = devcb_read_line_delegate(&devcb_resolved_read_line::from_read8, desc.name, this);
break;
@@ -295,7 +295,7 @@ void devcb_resolved_write_line::resolve(const devcb_write_line &desc, device_t &
break;
case DEVCB_TYPE_LEGACY_SPACE:
- m_object.space = devcb_resolver::resolve_space(desc.index, desc.tag, device);
+ m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
m_helper.write8_space = desc.writespace;
*static_cast<devcb_write_line_delegate *>(this) = devcb_write_line_delegate(&devcb_resolved_write_line::to_write8, desc.name, this);
break;
@@ -403,7 +403,7 @@ void devcb_resolved_read8::resolve(const devcb_read8 &desc, device_t &device)
break;
case DEVCB_TYPE_LEGACY_SPACE:
- m_object.space = devcb_resolver::resolve_space(desc.index, desc.tag, device);
+ m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_read8_delegate *>(this) = devcb_read8_delegate(desc.readspace, desc.name, m_object.space);
break;
@@ -510,7 +510,7 @@ void devcb_resolved_write8::resolve(const devcb_write8 &desc, device_t &device)
break;
case DEVCB_TYPE_LEGACY_SPACE:
- m_object.space = devcb_resolver::resolve_space(desc.index, desc.tag, device);
+ m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_write8_delegate *>(this) = devcb_write8_delegate(desc.writespace, desc.name, m_object.space);
break;
@@ -628,7 +628,7 @@ void devcb_resolved_read16::resolve(const devcb_read16 &desc, device_t &device)
break;
case DEVCB_TYPE_LEGACY_SPACE:
- m_object.space = devcb_resolver::resolve_space(desc.index, desc.tag, device);
+ m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_read16_delegate *>(this) = devcb_read16_delegate(desc.readspace, desc.name, m_object.space);
break;
@@ -735,7 +735,7 @@ void devcb_resolved_write16::resolve(const devcb_write16 &desc, device_t &device
break;
case DEVCB_TYPE_LEGACY_SPACE:
- m_object.space = devcb_resolver::resolve_space(desc.index, desc.tag, device);
+ m_object.space = &devcb_resolver::resolve_space(desc.index, desc.tag, device);
*static_cast<devcb_write16_delegate *>(this) = devcb_write16_delegate(desc.writespace, desc.name, m_object.space);
break;
diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c
index 95e1d60572a..9ddcc16bc3e 100644
--- a/src/emu/machine/53c810.c
+++ b/src/emu/machine/53c810.c
@@ -393,7 +393,7 @@ void lsi53c810_device::dma_exec()
UINT8 lsi53c810_device::lsi53c810_reg_r( int offset )
{
-// logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, space->device().safe_pc());
+// logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, space.device().safe_pc());
switch(offset)
{
case 0x00: /* SCNTL0 */
@@ -476,7 +476,7 @@ UINT8 lsi53c810_device::lsi53c810_reg_r( int offset )
void lsi53c810_device::lsi53c810_reg_w(int offset, UINT8 data)
{
-// logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, space->device().safe_pc());
+// logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, space.device().safe_pc());
switch(offset)
{
case 0x00: /* SCNTL0 */
diff --git a/src/emu/machine/8042kbdc.c b/src/emu/machine/8042kbdc.c
index 30ddc299838..a9c00e761b8 100644
--- a/src/emu/machine/8042kbdc.c
+++ b/src/emu/machine/8042kbdc.c
@@ -370,7 +370,7 @@ READ8_HANDLER(kbdc8042_8_r)
/* at386 self test doesn't like this */
at_8042_clear_keyboard_received();
}
- at_8042_check_keyboard(space->machine());
+ at_8042_check_keyboard(space.machine());
break;
case 1:
@@ -398,14 +398,14 @@ READ8_HANDLER(kbdc8042_8_r)
break;
case 2:
- if (kbdc8042.get_out2(space->machine()))
+ if (kbdc8042.get_out2(space.machine()))
data |= 0x20;
else
data &= ~0x20;
break;
case 4:
- at_8042_check_keyboard(space->machine());
+ at_8042_check_keyboard(space.machine());
if (kbdc8042.keyboard.received || kbdc8042.mouse.received)
data |= 1;
@@ -451,7 +451,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
/* normal case */
kbdc8042.data = data;
kbdc8042.sending=1;
- at_keyboard_write(space->machine(), data);
+ at_keyboard_write(space.machine(), data);
break;
case 1:
@@ -465,14 +465,14 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- keyboard clock (output)
* `------------ keyboard data (output)
*/
- at_8042_set_outport(space->machine(), data, 0);
+ at_8042_set_outport(space.machine(), data, 0);
break;
case 2:
/* preceded by writing 0xD2 to port 60h */
kbdc8042.data = data;
kbdc8042.sending=1;
- at_keyboard_write(space->machine(), data);
+ at_keyboard_write(space.machine(), data);
break;
case 3:
@@ -496,7 +496,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
case 1:
kbdc8042.speaker = data;
if (kbdc8042.set_spkr)
- kbdc8042.set_spkr(space->machine(), kbdc8042.speaker);
+ kbdc8042.set_spkr(space.machine(), kbdc8042.speaker);
break;
@@ -519,13 +519,13 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.mouse.on = 1;
break;
case 0xa9: /* test mouse */
- at_8042_receive(space->machine(), PS2_MOUSE_ON ? 0x00 : 0xff);
+ at_8042_receive(space.machine(), PS2_MOUSE_ON ? 0x00 : 0xff);
break;
case 0xaa: /* selftest */
- at_8042_receive(space->machine(), 0x55);
+ at_8042_receive(space.machine(), 0x55);
break;
case 0xab: /* test keyboard */
- at_8042_receive(space->machine(), KEYBOARD_ON ? 0x00 : 0xff);
+ at_8042_receive(space.machine(), KEYBOARD_ON ? 0x00 : 0xff);
break;
case 0xad: /* disable keyboard interface */
kbdc8042.keyboard.on = 0;
@@ -543,7 +543,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- 1=primary display is MDA, 0=CGA
* `------------ 1=keyboard not inhibited; 0=inhibited
*/
- at_8042_receive(space->machine(), kbdc8042.inport);
+ at_8042_receive(space.machine(), kbdc8042.inport);
break;
case 0xc1: /* read input port 3..0 until write to 0x60 */
kbdc8042.status_read_mode = 1;
@@ -552,7 +552,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.status_read_mode = 2;
break;
case 0xd0: /* read output port */
- at_8042_receive(space->machine(), kbdc8042.outport);
+ at_8042_receive(space.machine(), kbdc8042.outport);
break;
case 0xd1:
/* write output port; next byte written to port 60h is placed on
@@ -581,7 +581,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
break;
case 0xe0:
/* read test inputs; read T1/T0 test inputs into bit 1/0 */
- at_8042_receive(space->machine(), 0x00);
+ at_8042_receive(space.machine(), 0x00);
break;
case 0xf0:
@@ -597,8 +597,8 @@ WRITE8_HANDLER(kbdc8042_8_w)
* the bits low set in the command byte. The only pulse that has
* an effect currently is bit 0, which pulses the CPU's reset line
*/
- space->machine().firstcpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
- at_8042_set_outport(space->machine(), kbdc8042.outport | 0x02, 0);
+ space.machine().firstcpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ at_8042_set_outport(space.machine(), kbdc8042.outport | 0x02, 0);
break;
}
kbdc8042.sending = 1;
diff --git a/src/emu/machine/amigafdc.c b/src/emu/machine/amigafdc.c
index a7920220188..21dcca3f916 100644
--- a/src/emu/machine/amigafdc.c
+++ b/src/emu/machine/amigafdc.c
@@ -96,7 +96,7 @@ void amiga_fdc::device_reset()
void amiga_fdc::dma_done()
{
dma_state = DMA_IDLE;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
amiga_custom_w(space, REG_INTREQ, 0x8000 | INTENA_DSKBLK, 0xffff);
}
@@ -233,7 +233,7 @@ void amiga_fdc::live_run(attotime limit)
cur_live.bit_counter = 0;
}
dskbyt |= 0x1000;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
amiga_custom_w(space, REG_INTREQ, 0x8000 | INTENA_DSKSYN, 0xffff);
} else
dskbyt &= ~0x1000;
diff --git a/src/emu/machine/k056230.c b/src/emu/machine/k056230.c
index 4be52dfc0e5..0028da56a1b 100644
--- a/src/emu/machine/k056230.c
+++ b/src/emu/machine/k056230.c
@@ -82,7 +82,7 @@ READ8_DEVICE_HANDLER_TRAMPOLINE(k056230, k056230_r)
}
}
-// mame_printf_debug("k056230_r: %d at %08X\n", offset, space->device().safe_pc());
+// mame_printf_debug("k056230_r: %d at %08X\n", offset, space.device().safe_pc());
return 0;
}
@@ -132,17 +132,17 @@ WRITE8_DEVICE_HANDLER_TRAMPOLINE(k056230, k056230_w)
break;
}
}
-// mame_printf_debug("k056230_w: %d, %02X at %08X\n", offset, data, space->device().safe_pc());
+// mame_printf_debug("k056230_w: %d, %02X at %08X\n", offset, data, space.device().safe_pc());
}
READ32_DEVICE_HANDLER_TRAMPOLINE(k056230, lanc_ram_r)
{
- //mame_printf_debug("LANC_RAM_r: %08X, %08X at %08X\n", offset, mem_mask, space->device().safe_pc());
+ //mame_printf_debug("LANC_RAM_r: %08X, %08X at %08X\n", offset, mem_mask, space.device().safe_pc());
return m_ram[offset & 0x7ff];
}
WRITE32_DEVICE_HANDLER_TRAMPOLINE(k056230, lanc_ram_w)
{
- //mame_printf_debug("LANC_RAM_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space->device().safe_pc());
+ //mame_printf_debug("LANC_RAM_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
COMBINE_DATA(m_ram + (offset & 0x7ff));
}
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index ed99bff2ea0..6b24a68fe1e 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -81,7 +81,7 @@ READ8_DEVICE_HANDLER( latch8_r )
if (latch8->has_read)
{
/* temporary hack until all relevant systems are devices */
- address_space *space = &device->machine().driver_data()->generic_space();
+ address_space &space = device->machine().driver_data()->generic_space();
int i;
for (i=0; i<8; i++)
{
diff --git a/src/emu/machine/pc16552d.c b/src/emu/machine/pc16552d.c
index 02ed609ba53..08d7d263a3f 100644
--- a/src/emu/machine/pc16552d.c
+++ b/src/emu/machine/pc16552d.c
@@ -420,20 +420,20 @@ void pc16552d_rx_data(running_machine &machine, int chip, int channel, UINT8 dat
READ8_HANDLER(pc16552d_0_r)
{
- return duart_r(space->machine(), 0, offset);
+ return duart_r(space.machine(), 0, offset);
}
WRITE8_HANDLER(pc16552d_0_w)
{
- duart_w(space->machine(), 0, offset, data);
+ duart_w(space.machine(), 0, offset, data);
}
READ8_HANDLER(pc16552d_1_r)
{
- return duart_r(space->machine(), 1, offset);
+ return duart_r(space.machine(), 1, offset);
}
WRITE8_HANDLER(pc16552d_1_w)
{
- duart_w(space->machine(), 1, offset, data);
+ duart_w(space.machine(), 1, offset, data);
}
diff --git a/src/emu/machine/s3c2400.c b/src/emu/machine/s3c2400.c
index bca0e4614ff..69a8a737c68 100644
--- a/src/emu/machine/s3c2400.c
+++ b/src/emu/machine/s3c2400.c
@@ -38,30 +38,30 @@ UINT32 s3c2400_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
DEVICE_START( s3c2400 )
{
- address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
DEVICE_START_CALL(s3c24xx);
- space->install_legacy_readwrite_handler( *device, 0x14000000, 0x1400003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
- space->install_legacy_readwrite_handler( *device, 0x14200000, 0x1420005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
- space->install_legacy_readwrite_handler( *device, 0x14400000, 0x14400017, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
- space->install_legacy_readwrite_handler( *device, 0x14600000, 0x1460001b, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x14600020, 0x1460003b, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
- space->install_legacy_readwrite_handler( *device, 0x14600040, 0x1460005b, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
- space->install_legacy_readwrite_handler( *device, 0x14600060, 0x1460007b, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
- space->install_legacy_readwrite_handler( *device, 0x14800000, 0x14800017, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
- space->install_legacy_readwrite_handler( *device, 0x14a00000, 0x14a003ff, FUNC(s3c2400_lcd_r), FUNC(s3c24xx_lcd_w));
- space->install_legacy_readwrite_handler( *device, 0x14a00400, 0x14a007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
- space->install_legacy_readwrite_handler( *device, 0x15000000, 0x1500002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
- space->install_legacy_readwrite_handler( *device, 0x15004000, 0x1500402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
- space->install_legacy_readwrite_handler( *device, 0x15100000, 0x15100043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
- space->install_legacy_readwrite_handler( *device, 0x15200140, 0x152001fb, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
- space->install_legacy_readwrite_handler( *device, 0x15300000, 0x1530000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
- space->install_legacy_readwrite_handler( *device, 0x15400000, 0x1540000f, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
- space->install_legacy_readwrite_handler( *device, 0x15508000, 0x15508013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
- space->install_legacy_readwrite_handler( *device, 0x15600000, 0x1560005b, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
- space->install_legacy_readwrite_handler( *device, 0x15700040, 0x1570008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
- space->install_legacy_readwrite_handler( *device, 0x15800000, 0x15800007, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
- space->install_legacy_readwrite_handler( *device, 0x15900000, 0x15900017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
- space->install_legacy_readwrite_handler( *device, 0x15a00000, 0x15a0003f, FUNC(s3c24xx_mmc_r), FUNC(s3c24xx_mmc_w));
+ space.install_legacy_readwrite_handler( *device, 0x14000000, 0x1400003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
+ space.install_legacy_readwrite_handler( *device, 0x14200000, 0x1420005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
+ space.install_legacy_readwrite_handler( *device, 0x14400000, 0x14400017, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
+ space.install_legacy_readwrite_handler( *device, 0x14600000, 0x1460001b, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x14600020, 0x1460003b, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x14600040, 0x1460005b, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
+ space.install_legacy_readwrite_handler( *device, 0x14600060, 0x1460007b, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
+ space.install_legacy_readwrite_handler( *device, 0x14800000, 0x14800017, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
+ space.install_legacy_readwrite_handler( *device, 0x14a00000, 0x14a003ff, FUNC(s3c2400_lcd_r), FUNC(s3c24xx_lcd_w));
+ space.install_legacy_readwrite_handler( *device, 0x14a00400, 0x14a007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
+ space.install_legacy_readwrite_handler( *device, 0x15000000, 0x1500002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x15004000, 0x1500402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x15100000, 0x15100043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
+ space.install_legacy_readwrite_handler( *device, 0x15200140, 0x152001fb, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
+ space.install_legacy_readwrite_handler( *device, 0x15300000, 0x1530000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
+ space.install_legacy_readwrite_handler( *device, 0x15400000, 0x1540000f, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
+ space.install_legacy_readwrite_handler( *device, 0x15508000, 0x15508013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
+ space.install_legacy_readwrite_handler( *device, 0x15600000, 0x1560005b, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
+ space.install_legacy_readwrite_handler( *device, 0x15700040, 0x1570008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
+ space.install_legacy_readwrite_handler( *device, 0x15800000, 0x15800007, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
+ space.install_legacy_readwrite_handler( *device, 0x15900000, 0x15900017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x15a00000, 0x15a0003f, FUNC(s3c24xx_mmc_r), FUNC(s3c24xx_mmc_w));
s3c24xx_video_start( device, device->machine());
}
diff --git a/src/emu/machine/s3c2410.c b/src/emu/machine/s3c2410.c
index 6cbbad3c2c6..ec5258449b4 100644
--- a/src/emu/machine/s3c2410.c
+++ b/src/emu/machine/s3c2410.c
@@ -38,33 +38,33 @@ UINT32 s3c2410_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
DEVICE_START( s3c2410 )
{
- address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
DEVICE_START_CALL(s3c24xx);
- space->install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
- space->install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
- space->install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
- space->install_legacy_readwrite_handler( *device, 0x4b000000, 0x4b000023, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x4b000040, 0x4b000063, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
- space->install_legacy_readwrite_handler( *device, 0x4b000080, 0x4b0000a3, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
- space->install_legacy_readwrite_handler( *device, 0x4b0000c0, 0x4b0000e3, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
- space->install_legacy_readwrite_handler( *device, 0x4c000000, 0x4c000017, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
- space->install_legacy_readwrite_handler( *device, 0x4d000000, 0x4d000063, FUNC(s3c2410_lcd_r), FUNC(s3c24xx_lcd_w));
- space->install_legacy_readwrite_handler( *device, 0x4d000400, 0x4d0007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
- space->install_legacy_readwrite_handler( *device, 0x4e000000, 0x4e000017, FUNC(s3c24xx_nand_r), FUNC(s3c24xx_nand_w));
- space->install_legacy_readwrite_handler( *device, 0x50000000, 0x5000002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
- space->install_legacy_readwrite_handler( *device, 0x50004000, 0x5000402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
- space->install_legacy_readwrite_handler( *device, 0x50008000, 0x5000802b, FUNC(s3c24xx_uart_2_r), FUNC(s3c24xx_uart_2_w));
- space->install_legacy_readwrite_handler( *device, 0x51000000, 0x51000043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
- space->install_legacy_readwrite_handler( *device, 0x52000140, 0x5200026f, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
- space->install_legacy_readwrite_handler( *device, 0x53000000, 0x5300000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
- space->install_legacy_readwrite_handler( *device, 0x54000000, 0x5400000f, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
- space->install_legacy_readwrite_handler( *device, 0x55000000, 0x55000013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
- space->install_legacy_readwrite_handler( *device, 0x56000000, 0x560000bf, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
- space->install_legacy_readwrite_handler( *device, 0x57000040, 0x5700008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
- space->install_legacy_readwrite_handler( *device, 0x58000000, 0x58000013, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
- space->install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
- space->install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
- space->install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
+ space.install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
+ space.install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
+ space.install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b000000, 0x4b000023, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b000040, 0x4b000063, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b000080, 0x4b0000a3, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b0000c0, 0x4b0000e3, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
+ space.install_legacy_readwrite_handler( *device, 0x4c000000, 0x4c000017, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
+ space.install_legacy_readwrite_handler( *device, 0x4d000000, 0x4d000063, FUNC(s3c2410_lcd_r), FUNC(s3c24xx_lcd_w));
+ space.install_legacy_readwrite_handler( *device, 0x4d000400, 0x4d0007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
+ space.install_legacy_readwrite_handler( *device, 0x4e000000, 0x4e000017, FUNC(s3c24xx_nand_r), FUNC(s3c24xx_nand_w));
+ space.install_legacy_readwrite_handler( *device, 0x50000000, 0x5000002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x50004000, 0x5000402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x50008000, 0x5000802b, FUNC(s3c24xx_uart_2_r), FUNC(s3c24xx_uart_2_w));
+ space.install_legacy_readwrite_handler( *device, 0x51000000, 0x51000043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
+ space.install_legacy_readwrite_handler( *device, 0x52000140, 0x5200026f, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
+ space.install_legacy_readwrite_handler( *device, 0x53000000, 0x5300000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
+ space.install_legacy_readwrite_handler( *device, 0x54000000, 0x5400000f, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
+ space.install_legacy_readwrite_handler( *device, 0x55000000, 0x55000013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
+ space.install_legacy_readwrite_handler( *device, 0x56000000, 0x560000bf, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
+ space.install_legacy_readwrite_handler( *device, 0x57000040, 0x5700008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
+ space.install_legacy_readwrite_handler( *device, 0x58000000, 0x58000013, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
+ space.install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
s3c24xx_video_start( device, device->machine());
}
diff --git a/src/emu/machine/s3c2440.c b/src/emu/machine/s3c2440.c
index 1c84ffed35b..a6f3e5fe538 100644
--- a/src/emu/machine/s3c2440.c
+++ b/src/emu/machine/s3c2440.c
@@ -38,34 +38,34 @@ UINT32 s3c2440_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
DEVICE_START( s3c2440 )
{
- address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
- space->install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
- space->install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
- space->install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
- space->install_legacy_readwrite_handler( *device, 0x4b000000, 0x4b000023, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x4b000040, 0x4b000063, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
- space->install_legacy_readwrite_handler( *device, 0x4b000080, 0x4b0000a3, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
- space->install_legacy_readwrite_handler( *device, 0x4b0000c0, 0x4b0000e3, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
- space->install_legacy_readwrite_handler( *device, 0x4c000000, 0x4c00001b, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
- space->install_legacy_readwrite_handler( *device, 0x4d000000, 0x4d000063, FUNC(s3c2440_lcd_r), FUNC(s3c24xx_lcd_w));
- space->install_legacy_readwrite_handler( *device, 0x4d000400, 0x4d0007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
- space->install_legacy_readwrite_handler( *device, 0x4e000000, 0x4e00003f, FUNC(s3c24xx_nand_r), FUNC(s3c24xx_nand_w));
- space->install_legacy_readwrite_handler( *device, 0x4f000000, 0x4f0000a3, FUNC(s3c24xx_cam_r), FUNC(s3c24xx_cam_w));
- space->install_legacy_readwrite_handler( *device, 0x50000000, 0x5000002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
- space->install_legacy_readwrite_handler( *device, 0x50004000, 0x5000402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
- space->install_legacy_readwrite_handler( *device, 0x50008000, 0x5000802b, FUNC(s3c24xx_uart_2_r), FUNC(s3c24xx_uart_2_w));
- space->install_legacy_readwrite_handler( *device, 0x51000000, 0x51000043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
- space->install_legacy_readwrite_handler( *device, 0x52000140, 0x5200026f, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
- space->install_legacy_readwrite_handler( *device, 0x53000000, 0x5300000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
- space->install_legacy_readwrite_handler( *device, 0x54000000, 0x54000013, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
- space->install_legacy_readwrite_handler( *device, 0x55000000, 0x55000013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
- space->install_legacy_readwrite_handler( *device, 0x56000000, 0x560000df, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
- space->install_legacy_readwrite_handler( *device, 0x57000040, 0x5700008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
- space->install_legacy_readwrite_handler( *device, 0x58000000, 0x58000017, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
- space->install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
- space->install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
- space->install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
- space->install_legacy_readwrite_handler( *device, 0x5b000000, 0x5b00001f, FUNC(s3c24xx_ac97_r), FUNC(s3c24xx_ac97_w));
+ address_space &space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ space.install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
+ space.install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
+ space.install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b000000, 0x4b000023, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b000040, 0x4b000063, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b000080, 0x4b0000a3, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
+ space.install_legacy_readwrite_handler( *device, 0x4b0000c0, 0x4b0000e3, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
+ space.install_legacy_readwrite_handler( *device, 0x4c000000, 0x4c00001b, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
+ space.install_legacy_readwrite_handler( *device, 0x4d000000, 0x4d000063, FUNC(s3c2440_lcd_r), FUNC(s3c24xx_lcd_w));
+ space.install_legacy_readwrite_handler( *device, 0x4d000400, 0x4d0007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
+ space.install_legacy_readwrite_handler( *device, 0x4e000000, 0x4e00003f, FUNC(s3c24xx_nand_r), FUNC(s3c24xx_nand_w));
+ space.install_legacy_readwrite_handler( *device, 0x4f000000, 0x4f0000a3, FUNC(s3c24xx_cam_r), FUNC(s3c24xx_cam_w));
+ space.install_legacy_readwrite_handler( *device, 0x50000000, 0x5000002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x50004000, 0x5000402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x50008000, 0x5000802b, FUNC(s3c24xx_uart_2_r), FUNC(s3c24xx_uart_2_w));
+ space.install_legacy_readwrite_handler( *device, 0x51000000, 0x51000043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
+ space.install_legacy_readwrite_handler( *device, 0x52000140, 0x5200026f, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
+ space.install_legacy_readwrite_handler( *device, 0x53000000, 0x5300000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
+ space.install_legacy_readwrite_handler( *device, 0x54000000, 0x54000013, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
+ space.install_legacy_readwrite_handler( *device, 0x55000000, 0x55000013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
+ space.install_legacy_readwrite_handler( *device, 0x56000000, 0x560000df, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
+ space.install_legacy_readwrite_handler( *device, 0x57000040, 0x5700008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
+ space.install_legacy_readwrite_handler( *device, 0x58000000, 0x58000017, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
+ space.install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
+ space.install_legacy_readwrite_handler( *device, 0x5b000000, 0x5b00001f, FUNC(s3c24xx_ac97_r), FUNC(s3c24xx_ac97_w));
DEVICE_START_CALL(s3c24xx);
s3c24xx_video_start( device, device->machine());
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c
index 500b96e85e5..12f4931dc33 100644
--- a/src/emu/machine/s3c24xx.c
+++ b/src/emu/machine/s3c24xx.c
@@ -301,9 +301,9 @@ static void s3c24xx_lcd_dma_init( device_t *device)
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- address_space* space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space& space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
UINT8 *vram, data[4];
- vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
+ vram = (UINT8 *)space.get_read_ptr( s3c24xx->lcd.vramaddr_cur);
for (int i = 0; i < 2; i++)
{
data[i*2+0] = *vram++;
@@ -314,7 +314,7 @@ static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx->lcd.vramaddr_cur += s3c24xx->lcd.offsize << 1;
s3c24xx->lcd.pagewidth_cur = 0;
- vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
+ vram = (UINT8 *)space.get_read_ptr( s3c24xx->lcd.vramaddr_cur);
}
}
if (s3c24xx->lcd.hwswp == 0)
@@ -345,9 +345,9 @@ static UINT32 s3c24xx_lcd_dma_read( device_t *device)
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- address_space* space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space& space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
UINT8 *vram, data[4];
- vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
+ vram = (UINT8 *)space.get_read_ptr( s3c24xx->lcd.vramaddr_cur);
for (int i = 0; i < 2; i++)
{
if (s3c24xx->lcd.hwswp == 0)
@@ -398,7 +398,7 @@ static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx->lcd.vramaddr_cur += s3c24xx->lcd.offsize << 1;
s3c24xx->lcd.pagewidth_cur = 0;
- vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
+ vram = (UINT8 *)space.get_read_ptr( s3c24xx->lcd.vramaddr_cur);
}
else
{
@@ -1611,7 +1611,7 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs;
UINT32 curr_tc, curr_src, curr_dst;
- address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
int dsz, inc_src, inc_dst, servmode, tsz;
const UINT32 ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3};
verboselog( device->machine(), 5, "DMA %d trigger\n", ch);
@@ -1636,9 +1636,9 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
{
switch (dsz)
{
- case 0 : space->write_byte( curr_dst, space->read_byte( curr_src)); break;
- case 1 : space->write_word( curr_dst, space->read_word( curr_src)); break;
- case 2 : space->write_dword( curr_dst, space->read_dword( curr_src)); break;
+ case 0 : space.write_byte( curr_dst, space.read_byte( curr_src)); break;
+ case 1 : space.write_word( curr_dst, space.read_word( curr_src)); break;
+ case 2 : space.write_dword( curr_dst, space.read_dword( curr_src)); break;
}
if (inc_src == 0) curr_src += (1 << dsz);
if (inc_dst == 0) curr_dst += (1 << dsz);
@@ -3701,9 +3701,9 @@ static DEVICE_START( s3c24xx )
int om1 = iface_core_pin_r( device, S3C24XX_CORE_PIN_OM1);
if ((om0 == 0) && (om1 == 0))
{
- address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
- space->install_ram( 0x00000000, 0x00000fff, s3c24xx->steppingstone);
- space->install_ram( 0x40000000, 0x40000fff, s3c24xx->steppingstone);
+ address_space &space = *device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
+ space.install_ram( 0x00000000, 0x00000fff, s3c24xx->steppingstone);
+ space.install_ram( 0x40000000, 0x40000fff, s3c24xx->steppingstone);
}
#endif
}
diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c
index 1ade2c721c5..f46175844e6 100644
--- a/src/emu/machine/tmp68301.c
+++ b/src/emu/machine/tmp68301.c
@@ -166,7 +166,7 @@ WRITE16_HANDLER( tmp68301_regs_w )
if (!ACCESSING_BITS_0_7) return;
-// logerror("CPU #0 PC %06X: TMP68301 Reg %04X<-%04X & %04X\n",space->device().safe_pc(),offset*2,data,mem_mask^0xffff);
+// logerror("CPU #0 PC %06X: TMP68301 Reg %04X<-%04X & %04X\n",space.device().safe_pc(),offset*2,data,mem_mask^0xffff);
switch( offset * 2 )
{
@@ -177,7 +177,7 @@ WRITE16_HANDLER( tmp68301_regs_w )
{
int i = ((offset*2) >> 5) & 3;
- tmp68301_update_timer( space->machine(), i );
+ tmp68301_update_timer( space.machine(), i );
}
break;
}
diff --git a/src/emu/machine/v3021.c b/src/emu/machine/v3021.c
index 13d2d5796a4..09ed13a7bdb 100644
--- a/src/emu/machine/v3021.c
+++ b/src/emu/machine/v3021.c
@@ -176,7 +176,7 @@ WRITE8_MEMBER( v3021_device::write )
break;
case 0xf: //Load Date
- //space->machine().base_datetime(m_systime);
+ //space.machine().base_datetime(m_systime);
break;
}
}
diff --git a/src/emu/memconv.h b/src/emu/memconv.h
index c802126ac55..5abdf6c792c 100644
--- a/src/emu/memconv.h
+++ b/src/emu/memconv.h
@@ -85,7 +85,7 @@
*
*************************************/
-INLINE UINT16 read16be_with_read8_handler(read8_space_func handler, address_space *space, offs_t offset, UINT16 mem_mask)
+INLINE UINT16 read16be_with_read8_handler(read8_space_func handler, address_space &space, offs_t offset, UINT16 mem_mask)
{
UINT16 result = 0;
if (ACCESSING_BITS_8_15)
@@ -96,7 +96,7 @@ INLINE UINT16 read16be_with_read8_handler(read8_space_func handler, address_spac
}
-INLINE void write16be_with_write8_handler(write8_space_func handler, address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask)
+INLINE void write16be_with_write8_handler(write8_space_func handler, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
{
if (ACCESSING_BITS_8_15)
(*handler)(space, offset * 2 + 0, data >> 8);
@@ -111,7 +111,7 @@ INLINE void write16be_with_write8_handler(write8_space_func handler, address_spa
*
*************************************/
-INLINE UINT16 read16le_with_read8_handler(read8_space_func handler, address_space *space, offs_t offset, UINT16 mem_mask)
+INLINE UINT16 read16le_with_read8_handler(read8_space_func handler, address_space &space, offs_t offset, UINT16 mem_mask)
{
UINT16 result = 0;
if (ACCESSING_BITS_0_7)
@@ -122,7 +122,7 @@ INLINE UINT16 read16le_with_read8_handler(read8_space_func handler, address_spac
}
-INLINE void write16le_with_write8_handler(write8_space_func handler, address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask)
+INLINE void write16le_with_write8_handler(write8_space_func handler, address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask)
{
if (ACCESSING_BITS_0_7)
(*handler)(space, offset * 2 + 0, data >> 0);
@@ -137,7 +137,7 @@ INLINE void write16le_with_write8_handler(write8_space_func handler, address_spa
*
*************************************/
-INLINE UINT32 read32be_with_read8_handler(read8_space_func handler, address_space *space, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32be_with_read8_handler(read8_space_func handler, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_16_31)
@@ -148,7 +148,7 @@ INLINE UINT32 read32be_with_read8_handler(read8_space_func handler, address_spac
}
-INLINE void write32be_with_write8_handler(write8_space_func handler, address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32be_with_write8_handler(write8_space_func handler, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_16_31)
write16be_with_write8_handler(handler, space, offset * 2 + 0, data >> 16, mem_mask >> 16);
@@ -163,7 +163,7 @@ INLINE void write32be_with_write8_handler(write8_space_func handler, address_spa
*
*************************************/
-INLINE UINT32 read32le_with_read8_handler(read8_space_func handler, address_space *space, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32le_with_read8_handler(read8_space_func handler, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_0_15)
@@ -174,7 +174,7 @@ INLINE UINT32 read32le_with_read8_handler(read8_space_func handler, address_spac
}
-INLINE void write32le_with_write8_handler(write8_space_func handler, address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32le_with_write8_handler(write8_space_func handler, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_0_15)
write16le_with_write8_handler(handler, space, offset * 2 + 0, data, mem_mask);
@@ -189,7 +189,7 @@ INLINE void write32le_with_write8_handler(write8_space_func handler, address_spa
*
*************************************/
-INLINE UINT32 read32be_with_16be_handler(read16_space_func handler, address_space *space, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32be_with_16be_handler(read16_space_func handler, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_16_31)
@@ -200,7 +200,7 @@ INLINE UINT32 read32be_with_16be_handler(read16_space_func handler, address_spac
}
-INLINE void write32be_with_16be_handler(write16_space_func handler, address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32be_with_16be_handler(write16_space_func handler, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_16_31)
(*handler)(space, offset * 2 + 0, data >> 16, mem_mask >> 16);
@@ -215,7 +215,7 @@ INLINE void write32be_with_16be_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT32 read32le_with_16le_handler(read16_space_func handler, address_space *space, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32le_with_16le_handler(read16_space_func handler, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
if (ACCESSING_BITS_0_15)
@@ -226,7 +226,7 @@ INLINE UINT32 read32le_with_16le_handler(read16_space_func handler, address_spac
}
-INLINE void write32le_with_16le_handler(write16_space_func handler, address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32le_with_16le_handler(write16_space_func handler, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
if (ACCESSING_BITS_0_15)
(*handler)(space, offset * 2 + 0, data, mem_mask);
@@ -241,7 +241,7 @@ INLINE void write32le_with_16le_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT32 read32be_with_16le_handler(read16_space_func handler, address_space *space, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32be_with_16le_handler(read16_space_func handler, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
mem_mask = FLIPENDIAN_INT32(mem_mask);
@@ -250,7 +250,7 @@ INLINE UINT32 read32be_with_16le_handler(read16_space_func handler, address_spac
}
-INLINE void write32be_with_16le_handler(write16_space_func handler, address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32be_with_16le_handler(write16_space_func handler, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
data = FLIPENDIAN_INT32(data);
mem_mask = FLIPENDIAN_INT32(mem_mask);
@@ -264,7 +264,7 @@ INLINE void write32be_with_16le_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT32 read32le_with_16be_handler(read16_space_func handler, address_space *space, offs_t offset, UINT32 mem_mask)
+INLINE UINT32 read32le_with_16be_handler(read16_space_func handler, address_space &space, offs_t offset, UINT32 mem_mask)
{
UINT32 result = 0;
mem_mask = FLIPENDIAN_INT32(mem_mask);
@@ -273,7 +273,7 @@ INLINE UINT32 read32le_with_16be_handler(read16_space_func handler, address_spac
}
-INLINE void write32le_with_16be_handler(write16_space_func handler, address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask)
+INLINE void write32le_with_16be_handler(write16_space_func handler, address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask)
{
data = FLIPENDIAN_INT32(data);
mem_mask = FLIPENDIAN_INT32(mem_mask);
@@ -287,7 +287,7 @@ INLINE void write32le_with_16be_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT64 read64be_with_read8_handler(read8_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64be_with_read8_handler(read8_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
@@ -298,7 +298,7 @@ INLINE UINT64 read64be_with_read8_handler(read8_space_func handler, address_spac
}
-INLINE void write64be_with_write8_handler(write8_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_write8_handler(write8_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
write32be_with_write8_handler(handler, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
@@ -313,7 +313,7 @@ INLINE void write64be_with_write8_handler(write8_space_func handler, address_spa
*
*************************************/
-INLINE UINT64 read64le_with_read8_handler(read8_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64le_with_read8_handler(read8_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
@@ -324,7 +324,7 @@ INLINE UINT64 read64le_with_read8_handler(read8_space_func handler, address_spac
}
-INLINE void write64le_with_write8_handler(write8_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_write8_handler(write8_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
write32le_with_write8_handler(handler, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
@@ -339,7 +339,7 @@ INLINE void write64le_with_write8_handler(write8_space_func handler, address_spa
*
*************************************/
-INLINE UINT32 read64be_with_16be_handler(read16_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64be_with_16be_handler(read16_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
@@ -350,7 +350,7 @@ INLINE UINT32 read64be_with_16be_handler(read16_space_func handler, address_spac
}
-INLINE void write64be_with_16be_handler(write16_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_16be_handler(write16_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
write32be_with_16be_handler(handler, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
@@ -365,7 +365,7 @@ INLINE void write64be_with_16be_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT32 read64le_with_16le_handler(read16_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64le_with_16le_handler(read16_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
@@ -376,7 +376,7 @@ INLINE UINT32 read64le_with_16le_handler(read16_space_func handler, address_spac
}
-INLINE void write64le_with_16le_handler(write16_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_16le_handler(write16_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
write32le_with_16le_handler(handler, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
@@ -391,7 +391,7 @@ INLINE void write64le_with_16le_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT32 read64be_with_16le_handler(read16_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64be_with_16le_handler(read16_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
@@ -402,7 +402,7 @@ INLINE UINT32 read64be_with_16le_handler(read16_space_func handler, address_spac
}
-INLINE void write64be_with_16le_handler(write16_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_16le_handler(write16_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
write32be_with_16le_handler(handler, space, offset * 2 + 0, data >> 32, mem_mask >> 32);
@@ -417,7 +417,7 @@ INLINE void write64be_with_16le_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT32 read64le_with_16be_handler(read16_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT32 read64le_with_16be_handler(read16_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
@@ -428,7 +428,7 @@ INLINE UINT32 read64le_with_16be_handler(read16_space_func handler, address_spac
}
-INLINE void write64le_with_16be_handler(write16_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_16be_handler(write16_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
write32le_with_16be_handler(handler, space, offset * 2 + 0, data >> 0, mem_mask >> 0);
@@ -443,7 +443,7 @@ INLINE void write64le_with_16be_handler(write16_space_func handler, address_spac
*
*************************************/
-INLINE UINT64 read64be_with_32be_handler(read32_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64be_with_32be_handler(read32_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_32_63)
@@ -454,7 +454,7 @@ INLINE UINT64 read64be_with_32be_handler(read32_space_func handler, address_spac
}
-INLINE void write64be_with_32be_handler(write32_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_32be_handler(write32_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_32_63)
(*handler)(space, offset * 2 + 0, data >> 32, mem_mask >> 32);
@@ -469,7 +469,7 @@ INLINE void write64be_with_32be_handler(write32_space_func handler, address_spac
*
*************************************/
-INLINE UINT64 read64le_with_32le_handler(read32_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64le_with_32le_handler(read32_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result = 0;
if (ACCESSING_BITS_0_31)
@@ -480,7 +480,7 @@ INLINE UINT64 read64le_with_32le_handler(read32_space_func handler, address_spac
}
-INLINE void write64le_with_32le_handler(write32_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_32le_handler(write32_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
if (ACCESSING_BITS_0_31)
(*handler)(space, offset * 2 + 0, data >> 0, mem_mask >> 0);
@@ -495,7 +495,7 @@ INLINE void write64le_with_32le_handler(write32_space_func handler, address_spac
*
*************************************/
-INLINE UINT64 read64be_with_32le_handler(read32_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64be_with_32le_handler(read32_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result;
mem_mask = FLIPENDIAN_INT64(mem_mask);
@@ -504,7 +504,7 @@ INLINE UINT64 read64be_with_32le_handler(read32_space_func handler, address_spac
}
-INLINE void write64be_with_32le_handler(write32_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64be_with_32le_handler(write32_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
data = FLIPENDIAN_INT64(data);
mem_mask = FLIPENDIAN_INT64(mem_mask);
@@ -518,7 +518,7 @@ INLINE void write64be_with_32le_handler(write32_space_func handler, address_spac
*
*************************************/
-INLINE UINT64 read64le_with_32be_handler(read32_space_func handler, address_space *space, offs_t offset, UINT64 mem_mask)
+INLINE UINT64 read64le_with_32be_handler(read32_space_func handler, address_space &space, offs_t offset, UINT64 mem_mask)
{
UINT64 result;
mem_mask = FLIPENDIAN_INT64(mem_mask);
@@ -527,7 +527,7 @@ INLINE UINT64 read64le_with_32be_handler(read32_space_func handler, address_spac
}
-INLINE void write64le_with_32be_handler(write32_space_func handler, address_space *space, offs_t offset, UINT64 data, UINT64 mem_mask)
+INLINE void write64le_with_32be_handler(write32_space_func handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask)
{
data = FLIPENDIAN_INT64(data);
mem_mask = FLIPENDIAN_INT64(mem_mask);
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 669c246500f..23e7f64c800 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1022,20 +1022,20 @@ public:
// generate accessor table
virtual void accessors(data_accessors &accessors) const
{
- accessors.read_byte = reinterpret_cast<UINT8 (*)(address_space *, offs_t)>(&read_byte_static);
- accessors.read_word = reinterpret_cast<UINT16 (*)(address_space *, offs_t)>(&read_word_static);
- accessors.read_word_masked = reinterpret_cast<UINT16 (*)(address_space *, offs_t, UINT16)>(&read_word_masked_static);
- accessors.read_dword = reinterpret_cast<UINT32 (*)(address_space *, offs_t)>(&read_dword_static);
- accessors.read_dword_masked = reinterpret_cast<UINT32 (*)(address_space *, offs_t, UINT32)>(&read_dword_masked_static);
- accessors.read_qword = reinterpret_cast<UINT64 (*)(address_space *, offs_t)>(&read_qword_static);
- accessors.read_qword_masked = reinterpret_cast<UINT64 (*)(address_space *, offs_t, UINT64)>(&read_qword_masked_static);
- accessors.write_byte = reinterpret_cast<void (*)(address_space *, offs_t, UINT8)>(&write_byte_static);
- accessors.write_word = reinterpret_cast<void (*)(address_space *, offs_t, UINT16)>(&write_word_static);
- accessors.write_word_masked = reinterpret_cast<void (*)(address_space *, offs_t, UINT16, UINT16)>(&write_word_masked_static);
- accessors.write_dword = reinterpret_cast<void (*)(address_space *, offs_t, UINT32)>(&write_dword_static);
- accessors.write_dword_masked = reinterpret_cast<void (*)(address_space *, offs_t, UINT32, UINT32)>(&write_dword_masked_static);
- accessors.write_qword = reinterpret_cast<void (*)(address_space *, offs_t, UINT64)>(&write_qword_static);
- accessors.write_qword_masked = reinterpret_cast<void (*)(address_space *, offs_t, UINT64, UINT64)>(&write_qword_masked_static);
+ accessors.read_byte = reinterpret_cast<UINT8 (*)(address_space &, offs_t)>(&read_byte_static);
+ accessors.read_word = reinterpret_cast<UINT16 (*)(address_space &, offs_t)>(&read_word_static);
+ accessors.read_word_masked = reinterpret_cast<UINT16 (*)(address_space &, offs_t, UINT16)>(&read_word_masked_static);
+ accessors.read_dword = reinterpret_cast<UINT32 (*)(address_space &, offs_t)>(&read_dword_static);
+ accessors.read_dword_masked = reinterpret_cast<UINT32 (*)(address_space &, offs_t, UINT32)>(&read_dword_masked_static);
+ accessors.read_qword = reinterpret_cast<UINT64 (*)(address_space &, offs_t)>(&read_qword_static);
+ accessors.read_qword_masked = reinterpret_cast<UINT64 (*)(address_space &, offs_t, UINT64)>(&read_qword_masked_static);
+ accessors.write_byte = reinterpret_cast<void (*)(address_space &, offs_t, UINT8)>(&write_byte_static);
+ accessors.write_word = reinterpret_cast<void (*)(address_space &, offs_t, UINT16)>(&write_word_static);
+ accessors.write_word_masked = reinterpret_cast<void (*)(address_space &, offs_t, UINT16, UINT16)>(&write_word_masked_static);
+ accessors.write_dword = reinterpret_cast<void (*)(address_space &, offs_t, UINT32)>(&write_dword_static);
+ accessors.write_dword_masked = reinterpret_cast<void (*)(address_space &, offs_t, UINT32, UINT32)>(&write_dword_masked_static);
+ accessors.write_qword = reinterpret_cast<void (*)(address_space &, offs_t, UINT64)>(&write_qword_static);
+ accessors.write_qword_masked = reinterpret_cast<void (*)(address_space &, offs_t, UINT64, UINT64)>(&write_qword_masked_static);
}
// return a pointer to the read bank, or NULL if none
@@ -1441,20 +1441,20 @@ public:
void write_qword_unaligned(offs_t address, UINT64 data, UINT64 mask) { write_direct<UINT64, false>(address, data, mask); }
// static access to these functions
- static UINT8 read_byte_static(this_type *space, offs_t address) { return (NATIVE_BITS == 8) ? space->read_native(address & ~NATIVE_MASK) : space->read_direct<UINT8, true>(address, 0xff); }
- static UINT16 read_word_static(this_type *space, offs_t address) { return (NATIVE_BITS == 16) ? space->read_native(address & ~NATIVE_MASK) : space->read_direct<UINT16, true>(address, 0xffff); }
- static UINT16 read_word_masked_static(this_type *space, offs_t address, UINT16 mask) { return space->read_direct<UINT16, true>(address, mask); }
- static UINT32 read_dword_static(this_type *space, offs_t address) { return (NATIVE_BITS == 32) ? space->read_native(address & ~NATIVE_MASK) : space->read_direct<UINT32, true>(address, 0xffffffff); }
- static UINT32 read_dword_masked_static(this_type *space, offs_t address, UINT32 mask) { return space->read_direct<UINT32, true>(address, mask); }
- static UINT64 read_qword_static(this_type *space, offs_t address) { return (NATIVE_BITS == 64) ? space->read_native(address & ~NATIVE_MASK) : space->read_direct<UINT64, true>(address, U64(0xffffffffffffffff)); }
- static UINT64 read_qword_masked_static(this_type *space, offs_t address, UINT64 mask) { return space->read_direct<UINT64, true>(address, mask); }
- static void write_byte_static(this_type *space, offs_t address, UINT8 data) { if (NATIVE_BITS == 8) space->write_native(address & ~NATIVE_MASK, data); else space->write_direct<UINT8, true>(address, data, 0xff); }
- static void write_word_static(this_type *space, offs_t address, UINT16 data) { if (NATIVE_BITS == 16) space->write_native(address & ~NATIVE_MASK, data); else space->write_direct<UINT16, true>(address, data, 0xffff); }
- static void write_word_masked_static(this_type *space, offs_t address, UINT16 data, UINT16 mask) { space->write_direct<UINT16, true>(address, data, mask); }
- static void write_dword_static(this_type *space, offs_t address, UINT32 data) { if (NATIVE_BITS == 32) space->write_native(address & ~NATIVE_MASK, data); else space->write_direct<UINT32, true>(address, data, 0xffffffff); }
- static void write_dword_masked_static(this_type *space, offs_t address, UINT32 data, UINT32 mask) { space->write_direct<UINT32, true>(address, data, mask); }
- static void write_qword_static(this_type *space, offs_t address, UINT64 data) { if (NATIVE_BITS == 64) space->write_native(address & ~NATIVE_MASK, data); else space->write_direct<UINT64, true>(address, data, U64(0xffffffffffffffff)); }
- static void write_qword_masked_static(this_type *space, offs_t address, UINT64 data, UINT64 mask) { space->write_direct<UINT64, true>(address, data, mask); }
+ static UINT8 read_byte_static(this_type &space, offs_t address) { return (NATIVE_BITS == 8) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct<UINT8, true>(address, 0xff); }
+ static UINT16 read_word_static(this_type &space, offs_t address) { return (NATIVE_BITS == 16) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct<UINT16, true>(address, 0xffff); }
+ static UINT16 read_word_masked_static(this_type &space, offs_t address, UINT16 mask) { return space.read_direct<UINT16, true>(address, mask); }
+ static UINT32 read_dword_static(this_type &space, offs_t address) { return (NATIVE_BITS == 32) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct<UINT32, true>(address, 0xffffffff); }
+ static UINT32 read_dword_masked_static(this_type &space, offs_t address, UINT32 mask) { return space.read_direct<UINT32, true>(address, mask); }
+ static UINT64 read_qword_static(this_type &space, offs_t address) { return (NATIVE_BITS == 64) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct<UINT64, true>(address, U64(0xffffffffffffffff)); }
+ static UINT64 read_qword_masked_static(this_type &space, offs_t address, UINT64 mask) { return space.read_direct<UINT64, true>(address, mask); }
+ static void write_byte_static(this_type &space, offs_t address, UINT8 data) { if (NATIVE_BITS == 8) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct<UINT8, true>(address, data, 0xff); }
+ static void write_word_static(this_type &space, offs_t address, UINT16 data) { if (NATIVE_BITS == 16) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct<UINT16, true>(address, data, 0xffff); }
+ static void write_word_masked_static(this_type &space, offs_t address, UINT16 data, UINT16 mask) { space.write_direct<UINT16, true>(address, data, mask); }
+ static void write_dword_static(this_type &space, offs_t address, UINT32 data) { if (NATIVE_BITS == 32) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct<UINT32, true>(address, data, 0xffffffff); }
+ static void write_dword_masked_static(this_type &space, offs_t address, UINT32 data, UINT32 mask) { space.write_direct<UINT32, true>(address, data, mask); }
+ static void write_qword_static(this_type &space, offs_t address, UINT64 data) { if (NATIVE_BITS == 64) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct<UINT64, true>(address, data, U64(0xffffffffffffffff)); }
+ static void write_qword_masked_static(this_type &space, offs_t address, UINT64 data, UINT64 mask) { space.write_direct<UINT64, true>(address, data, mask); }
address_table_read m_read; // memory read lookup table
address_table_write m_write; // memory write lookup table
@@ -4984,7 +4984,7 @@ UINT16 handler_entry_read::read_stub_16(address_space &space, offs_t offset, UIN
offs_t aoffset = offset * si.m_multiplier + si.m_offset;
UINT8 val;
if (m_sub_is_legacy[index])
- val = m_sublegacy_info[index].handler.space8(m_sublegacy_info[index].object.space, aoffset);
+ val = m_sublegacy_info[index].handler.space8(*m_sublegacy_info[index].object.space, aoffset);
else
val = m_subread[index].r8(space, aoffset, submask);
result |= val << si.m_shift;
@@ -5015,10 +5015,10 @@ UINT32 handler_entry_read::read_stub_32(address_space &space, offs_t offset, UIN
switch (si.m_size)
{
case 8:
- val = m_sublegacy_info[index].handler.space8(m_sublegacy_info[index].object.space, aoffset);
+ val = m_sublegacy_info[index].handler.space8(*m_sublegacy_info[index].object.space, aoffset);
break;
case 16:
- val = m_sublegacy_info[index].handler.space16(m_sublegacy_info[index].object.space, aoffset, submask);
+ val = m_sublegacy_info[index].handler.space16(*m_sublegacy_info[index].object.space, aoffset, submask);
break;
}
}
@@ -5062,13 +5062,13 @@ UINT64 handler_entry_read::read_stub_64(address_space &space, offs_t offset, UIN
switch (si.m_size)
{
case 8:
- val = m_sublegacy_info[index].handler.space8(m_sublegacy_info[index].object.space, aoffset);
+ val = m_sublegacy_info[index].handler.space8(*m_sublegacy_info[index].object.space, aoffset);
break;
case 16:
- val = m_sublegacy_info[index].handler.space16(m_sublegacy_info[index].object.space, aoffset, submask);
+ val = m_sublegacy_info[index].handler.space16(*m_sublegacy_info[index].object.space, aoffset, submask);
break;
case 32:
- val = m_sublegacy_info[index].handler.space32(m_sublegacy_info[index].object.space, aoffset, submask);
+ val = m_sublegacy_info[index].handler.space32(*m_sublegacy_info[index].object.space, aoffset, submask);
break;
}
}
@@ -5101,22 +5101,22 @@ UINT64 handler_entry_read::read_stub_64(address_space &space, offs_t offset, UIN
UINT8 handler_entry_read::read_stub_legacy(address_space &space, offs_t offset, UINT8 mask)
{
- return m_legacy_info.handler.space8(m_legacy_info.object.space, offset);
+ return m_legacy_info.handler.space8(*m_legacy_info.object.space, offset);
}
UINT16 handler_entry_read::read_stub_legacy(address_space &space, offs_t offset, UINT16 mask)
{
- return m_legacy_info.handler.space16(m_legacy_info.object.space, offset, mask);
+ return m_legacy_info.handler.space16(*m_legacy_info.object.space, offset, mask);
}
UINT32 handler_entry_read::read_stub_legacy(address_space &space, offs_t offset, UINT32 mask)
{
- return m_legacy_info.handler.space32(m_legacy_info.object.space, offset, mask);
+ return m_legacy_info.handler.space32(*m_legacy_info.object.space, offset, mask);
}
UINT64 handler_entry_read::read_stub_legacy(address_space &space, offs_t offset, UINT64 mask)
{
- return m_legacy_info.handler.space64(m_legacy_info.object.space, offset, mask);
+ return m_legacy_info.handler.space64(*m_legacy_info.object.space, offset, mask);
}
@@ -5438,7 +5438,7 @@ void handler_entry_write::write_stub_16(address_space &space, offs_t offset, UIN
offs_t aoffset = offset * si.m_multiplier + si.m_offset;
UINT8 adata = data >> si.m_shift;
if (m_sub_is_legacy[index])
- m_sublegacy_info[index].handler.space8(m_sublegacy_info[index].object.space, aoffset, adata);
+ m_sublegacy_info[index].handler.space8(*m_sublegacy_info[index].object.space, aoffset, adata);
else
m_subwrite[index].w8(space, aoffset, adata, submask);
}
@@ -5466,10 +5466,10 @@ void handler_entry_write::write_stub_32(address_space &space, offs_t offset, UIN
switch (si.m_size)
{
case 8:
- m_sublegacy_info[index].handler.space8(m_sublegacy_info[index].object.space, aoffset, adata);
+ m_sublegacy_info[index].handler.space8(*m_sublegacy_info[index].object.space, aoffset, adata);
break;
case 16:
- m_sublegacy_info[index].handler.space16(m_sublegacy_info[index].object.space, aoffset, adata, submask);
+ m_sublegacy_info[index].handler.space16(*m_sublegacy_info[index].object.space, aoffset, adata, submask);
break;
}
}
@@ -5510,13 +5510,13 @@ void handler_entry_write::write_stub_64(address_space &space, offs_t offset, UIN
switch (si.m_size)
{
case 8:
- m_sublegacy_info[index].handler.space8(m_sublegacy_info[index].object.space, aoffset, adata);
+ m_sublegacy_info[index].handler.space8(*m_sublegacy_info[index].object.space, aoffset, adata);
break;
case 16:
- m_sublegacy_info[index].handler.space16(m_sublegacy_info[index].object.space, aoffset, adata, submask);
+ m_sublegacy_info[index].handler.space16(*m_sublegacy_info[index].object.space, aoffset, adata, submask);
break;
case 32:
- m_sublegacy_info[index].handler.space32(m_sublegacy_info[index].object.space, aoffset, adata, submask);
+ m_sublegacy_info[index].handler.space32(*m_sublegacy_info[index].object.space, aoffset, adata, submask);
break;
}
}
@@ -5547,20 +5547,20 @@ void handler_entry_write::write_stub_64(address_space &space, offs_t offset, UIN
void handler_entry_write::write_stub_legacy(address_space &space, offs_t offset, UINT8 data, UINT8 mask)
{
- m_legacy_info.handler.space8(m_legacy_info.object.space, offset, data);
+ m_legacy_info.handler.space8(*m_legacy_info.object.space, offset, data);
}
void handler_entry_write::write_stub_legacy(address_space &space, offs_t offset, UINT16 data, UINT16 mask)
{
- m_legacy_info.handler.space16(m_legacy_info.object.space, offset, data, mask);
+ m_legacy_info.handler.space16(*m_legacy_info.object.space, offset, data, mask);
}
void handler_entry_write::write_stub_legacy(address_space &space, offs_t offset, UINT32 data, UINT32 mask)
{
- m_legacy_info.handler.space32(m_legacy_info.object.space, offset, data, mask);
+ m_legacy_info.handler.space32(*m_legacy_info.object.space, offset, data, mask);
}
void handler_entry_write::write_stub_legacy(address_space &space, offs_t offset, UINT64 data, UINT64 mask)
{
- m_legacy_info.handler.space64(m_legacy_info.object.space, offset, data, mask);
+ m_legacy_info.handler.space64(*m_legacy_info.object.space, offset, data, mask);
}
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 6fc39f47b22..d9f6d7d7525 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -112,14 +112,14 @@ typedef delegate<void (address_map &, const device_t &)> address_map_delegate;
// legacy space read/write handlers
-typedef UINT8 (*read8_space_func) (ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset);
-typedef void (*write8_space_func) (ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data);
-typedef UINT16 (*read16_space_func) (ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask);
-typedef void (*write16_space_func)(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask);
-typedef UINT32 (*read32_space_func) (ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask);
-typedef void (*write32_space_func)(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask);
-typedef UINT64 (*read64_space_func) (ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask);
-typedef void (*write64_space_func)(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask);
+typedef UINT8 (*read8_space_func) (ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset);
+typedef void (*write8_space_func) (ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data);
+typedef UINT16 (*read16_space_func) (ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask);
+typedef void (*write16_space_func)(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask);
+typedef UINT32 (*read32_space_func) (ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask);
+typedef void (*write32_space_func)(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask);
+typedef UINT64 (*read64_space_func) (ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask);
+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 address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask);
@@ -135,21 +135,21 @@ typedef void (*write64_device_func)(ATTR_UNUSED device_t *device, ATTR_UNUSED ad
// struct with function pointers for accessors; use is generally discouraged unless necessary
struct data_accessors
{
- UINT8 (*read_byte)(address_space *space, offs_t byteaddress);
- UINT16 (*read_word)(address_space *space, offs_t byteaddress);
- UINT16 (*read_word_masked)(address_space *space, offs_t byteaddress, UINT16 mask);
- UINT32 (*read_dword)(address_space *space, offs_t byteaddress);
- UINT32 (*read_dword_masked)(address_space *space, offs_t byteaddress, UINT32 mask);
- UINT64 (*read_qword)(address_space *space, offs_t byteaddress);
- UINT64 (*read_qword_masked)(address_space *space, offs_t byteaddress, UINT64 mask);
-
- void (*write_byte)(address_space *space, offs_t byteaddress, UINT8 data);
- void (*write_word)(address_space *space, offs_t byteaddress, UINT16 data);
- void (*write_word_masked)(address_space *space, offs_t byteaddress, UINT16 data, UINT16 mask);
- void (*write_dword)(address_space *space, offs_t byteaddress, UINT32 data);
- void (*write_dword_masked)(address_space *space, offs_t byteaddress, UINT32 data, UINT32 mask);
- void (*write_qword)(address_space *space, offs_t byteaddress, UINT64 data);
- void (*write_qword_masked)(address_space *space, offs_t byteaddress, UINT64 data, UINT64 mask);
+ UINT8 (*read_byte)(address_space &space, offs_t byteaddress);
+ UINT16 (*read_word)(address_space &space, offs_t byteaddress);
+ UINT16 (*read_word_masked)(address_space &space, offs_t byteaddress, UINT16 mask);
+ UINT32 (*read_dword)(address_space &space, offs_t byteaddress);
+ UINT32 (*read_dword_masked)(address_space &space, offs_t byteaddress, UINT32 mask);
+ UINT64 (*read_qword)(address_space &space, offs_t byteaddress);
+ UINT64 (*read_qword_masked)(address_space &space, offs_t byteaddress, UINT64 mask);
+
+ void (*write_byte)(address_space &space, offs_t byteaddress, UINT8 data);
+ void (*write_word)(address_space &space, offs_t byteaddress, UINT16 data);
+ void (*write_word_masked)(address_space &space, offs_t byteaddress, UINT16 data, UINT16 mask);
+ void (*write_dword)(address_space &space, offs_t byteaddress, UINT32 data);
+ void (*write_dword_masked)(address_space &space, offs_t byteaddress, UINT32 data, UINT32 mask);
+ void (*write_qword)(address_space &space, offs_t byteaddress, UINT64 data);
+ void (*write_qword_masked)(address_space &space, offs_t byteaddress, UINT64 data, UINT64 mask);
};
@@ -876,14 +876,14 @@ private:
// space read/write handler function macros
-#define READ8_HANDLER(name) UINT8 name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset)
-#define WRITE8_HANDLER(name) void name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data)
-#define READ16_HANDLER(name) UINT16 name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask)
-#define WRITE16_HANDLER(name) void name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
-#define READ32_HANDLER(name) UINT32 name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask)
-#define WRITE32_HANDLER(name) void name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask)
-#define READ64_HANDLER(name) UINT64 name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask)
-#define WRITE64_HANDLER(name) void name(ATTR_UNUSED address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask)
+#define READ8_HANDLER(name) UINT8 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset)
+#define WRITE8_HANDLER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data)
+#define READ16_HANDLER(name) UINT16 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask)
+#define WRITE16_HANDLER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask)
+#define READ32_HANDLER(name) UINT32 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask)
+#define WRITE32_HANDLER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask)
+#define READ64_HANDLER(name) UINT64 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask)
+#define WRITE64_HANDLER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask)
// device read/write handler function macros
diff --git a/src/emu/sound/awacs.c b/src/emu/sound/awacs.c
index fda9f1ae8b6..6664082bd6c 100644
--- a/src/emu/sound/awacs.c
+++ b/src/emu/sound/awacs.c
@@ -166,9 +166,9 @@ WRITE8_MEMBER( awacs_device::write )
m_regs[offset] = data;
}
-void awacs_device::set_dma_base(address_space *space, int offset0, int offset1)
+void awacs_device::set_dma_base(address_space &space, int offset0, int offset1)
{
- m_dma_space = space;
+ m_dma_space = &space;
m_dma_offset_0 = offset0;
m_dma_offset_1 = offset1;
}
diff --git a/src/emu/sound/awacs.h b/src/emu/sound/awacs.h
index de6e521ef70..ff4bfe6d8f9 100644
--- a/src/emu/sound/awacs.h
+++ b/src/emu/sound/awacs.h
@@ -43,7 +43,7 @@ public:
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
- void set_dma_base(address_space *space, int offset0, int offset1);
+ void set_dma_base(address_space &space, int offset0, int offset1);
sound_stream *m_stream;
diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c
index 73b0a9fa024..8f58f480177 100644
--- a/src/emu/sound/nile.c
+++ b/src/emu/sound/nile.c
@@ -77,7 +77,7 @@ WRITE16_DEVICE_HANDLER( nile_sndctrl_w )
COMBINE_DATA(&info->ctrl);
-// printf("CTRL: %04x -> %04x (PC=%x)\n", ctrl, info->ctrl, space->device().safe_pc());
+// printf("CTRL: %04x -> %04x (PC=%x)\n", ctrl, info->ctrl, space.device().safe_pc());
ctrl^=info->ctrl;
}
@@ -132,7 +132,7 @@ WRITE16_DEVICE_HANDLER( nile_snd_w )
info->vpos[v] = info->frac[v] = info->lponce[v] = 0;
}
- //printf("v%02d: %04x to reg %02d (PC=%x)\n", v, info->sound_regs[offset], r, space->device().safe_pc());
+ //printf("v%02d: %04x to reg %02d (PC=%x)\n", v, info->sound_regs[offset], r, space.device().safe_pc());
}
static STREAM_UPDATE( nile_update )
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index 01965f21495..aacf79d4389 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -1296,7 +1296,7 @@ READ8_HANDLER( quad_pokeyn_r )
int pokey_num = (offset >> 3) & ~0x04;
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
- pokey_device *pokey = space->machine().device<pokey_device>(devname[pokey_num]);
+ pokey_device *pokey = space.machine().device<pokey_device>(devname[pokey_num]);
return pokey->read(pokey_reg);
}
@@ -1307,7 +1307,7 @@ WRITE8_HANDLER( quad_pokeyn_w )
int pokey_num = (offset >> 3) & ~0x04;
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
- pokey_device *pokey = space->machine().device<pokey_device>(devname[pokey_num]);
+ pokey_device *pokey = space.machine().device<pokey_device>(devname[pokey_num]);
pokey->write(pokey_reg, data);
}
diff --git a/src/emu/sound/spu.c b/src/emu/sound/spu.c
index 6deaf8d1fca..4a3409695cc 100644
--- a/src/emu/sound/spu.c
+++ b/src/emu/sound/spu.c
@@ -3106,7 +3106,7 @@ void spu_device::dma_write( UINT32 n_address, INT32 n_size )
READ16_HANDLER( spu_r )
{
- spu_device *spu = space->machine().device<spu_device>("spu");
+ spu_device *spu = space.machine().device<spu_device>("spu");
if (spu == NULL )
{
@@ -3118,7 +3118,7 @@ READ16_HANDLER( spu_r )
WRITE16_HANDLER( spu_w )
{
- spu_device *spu = space->machine().device<spu_device>("spu");
+ spu_device *spu = space.machine().device<spu_device>("spu");
if (spu == NULL)
{
diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c
index a2cc8d215a3..ef3e267aea8 100644
--- a/src/emu/sound/vrender0.c
+++ b/src/emu/sound/vrender0.c
@@ -83,8 +83,8 @@ static const unsigned short ULawTo16[]=
#define ENVVOL(chan) (VR0->SOUNDREGS[(0x20/4)*chan+0x04/4]&0xffffff)
/*
-#define GETSOUNDREG16(Chan,Offs) space->read_word(VR0->Intf.reg_base+0x20*Chan+Offs)
-#define GETSOUNDREG32(Chan,Offs) space->read_dword(VR0->Intf.reg_base+0x20*Chan+Offs)
+#define GETSOUNDREG16(Chan,Offs) space.read_word(VR0->Intf.reg_base+0x20*Chan+Offs)
+#define GETSOUNDREG32(Chan,Offs) space.read_dword(VR0->Intf.reg_base+0x20*Chan+Offs)
#define CURSADDR(chan) GETSOUNDREG32(chan,0x00)
#define DSADDR(chan) GETSOUNDREG16(chan,0x08)
diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c
index c227908a13b..1d683aefd20 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -1467,8 +1467,8 @@ static void hd63484_command_w(device_t *device, UINT16 cmd)
READ16_DEVICE_HANDLER( hd63484_status_r )
{
-// if (space->device().safe_pc() != 0xfced6 && space->device().safe_pc() != 0xfe1d6)
-// logerror("%05x: HD63484 status read\n",space->device().safe_pc());
+// if (space.device().safe_pc() != 0xfced6 && space.device().safe_pc() != 0xfe1d6)
+// logerror("%05x: HD63484 status read\n",space.device().safe_pc());
return 0xff22 | (device->machine().rand() & 0x0004); /* write FIFO ready + command end + (read FIFO ready or read FIFO not ready) */
}
@@ -1495,7 +1495,7 @@ WRITE16_DEVICE_HANDLER( hd63484_data_w )
hd63484->regno += 2; /* autoincrement */
#if LOG_COMMANDS
-// logerror("PC %05x: HD63484 register %02x write %04x\n", space->device().safe_pc(), hd63484->regno, hd63484->reg[hd63484->regno/2]);
+// logerror("PC %05x: HD63484 register %02x write %04x\n", space.device().safe_pc(), hd63484->regno, hd63484->reg[hd63484->regno/2]);
#endif
if (hd63484->regno == 0) /* FIFO */
@@ -1512,14 +1512,14 @@ READ16_DEVICE_HANDLER( hd63484_data_r )
else if (hd63484->regno == 0)
{
#if LOG_COMMANDS
-// logerror("%05x: HD63484 read FIFO\n", space->device().safe_pc());
+// logerror("%05x: HD63484 read FIFO\n", space.device().safe_pc());
#endif
res = hd63484->readfifo;
}
else
{
#if LOG_COMMANDS
-// logerror("%05x: HD63484 read register %02x\n", space->device().safe_pc(), hd63484->regno);
+// logerror("%05x: HD63484 read register %02x\n", space.device().safe_pc(), hd63484->regno);
#endif
res = 0;
}
diff --git a/src/emu/video/pc_cga.c b/src/emu/video/pc_cga.c
index 579b336eda7..e6c1dc791b1 100644
--- a/src/emu/video/pc_cga.c
+++ b/src/emu/video/pc_cga.c
@@ -329,10 +329,10 @@ static int internal_pc_cga_video_start(running_machine &machine)
static VIDEO_START( pc_cga )
{
int buswidth;
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
- space->install_readwrite_bank(0xb8000, 0xbbfff, 0, 0x04000, "bank11" );
+ space.install_readwrite_bank(0xb8000, 0xbbfff, 0, 0x04000, "bank11" );
buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
UINT64 mask = 0;
switch(buswidth)
@@ -370,11 +370,11 @@ static VIDEO_START( pc_cga )
static VIDEO_START( pc_cga32k )
{
int buswidth;
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
- space->install_readwrite_bank(0xb8000, 0xbffff, "bank11" );
+ space.install_readwrite_bank(0xb8000, 0xbffff, "bank11" );
buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
UINT64 mask = 0;
switch(buswidth)
@@ -1136,7 +1136,7 @@ static void pc_cga_plantronics_w(running_machine &machine, int data)
static WRITE8_HANDLER ( char_ram_w )
{
- UINT8 *gfx = space->machine().root_device().memregion("gfx1")->base();
+ UINT8 *gfx = space.machine().root_device().memregion("gfx1")->base();
offset ^= BIT(offset, 12);
logerror("write char ram %04x %02x\n",offset,data);
gfx[offset + 0x0000] = data;
@@ -1147,14 +1147,14 @@ static WRITE8_HANDLER ( char_ram_w )
static READ8_HANDLER ( char_ram_r )
{
- UINT8 *gfx = space->machine().root_device().memregion("gfx1")->base();
+ UINT8 *gfx = space.machine().root_device().memregion("gfx1")->base();
offset ^= BIT(offset, 12);
return gfx[offset];
}
static READ8_HANDLER( pc_cga8_r )
{
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(CGA_MC6845_NAME);
int data = 0xff;
switch( offset )
{
@@ -1162,7 +1162,7 @@ static READ8_HANDLER( pc_cga8_r )
/* return last written mc6845 address value here? */
break;
case 1: case 3: case 5: case 7:
- data = mc6845->register_r( *space, offset );
+ data = mc6845->register_r( space, offset );
break;
case 10:
data = cga.vsync | ( ( data & 0x40 ) >> 4 ) | cga.hsync;
@@ -1182,27 +1182,27 @@ static WRITE8_HANDLER( pc_cga8_w )
switch(offset) {
case 0: case 2: case 4: case 6:
- mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME);
- mc6845->address_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(CGA_MC6845_NAME);
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME);
- mc6845->register_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(CGA_MC6845_NAME);
+ mc6845->register_w( space, offset, data );
break;
case 8:
- pc_cga_mode_control_w(space->machine(), data);
+ pc_cga_mode_control_w(space.machine(), data);
break;
case 9:
- pc_cga_color_select_w(space->machine(), data);
+ pc_cga_color_select_w(space.machine(), data);
break;
case 0x0d:
- pc_cga_plantronics_w(space->machine(), data);
+ pc_cga_plantronics_w(space.machine(), data);
break;
case 0x0f:
// Not sure if some all CGA cards have ability to upload char definition
// The original CGA card had a char rom
- UINT8 buswidth = space->machine().firstcpu->space_config(AS_PROGRAM)->m_databus_width;
- address_space *space_prg = space->machine().firstcpu->space(AS_PROGRAM);
+ UINT8 buswidth = space.machine().firstcpu->space_config(AS_PROGRAM)->m_databus_width;
+ address_space *space_prg = space.machine().firstcpu->space(AS_PROGRAM);
cga.p3df = data;
if (data & 1) {
UINT64 mask = 0;
@@ -1485,20 +1485,20 @@ static MC6845_UPDATE_ROW( pc1512_gfx_4bpp_update_row )
static WRITE8_HANDLER ( pc1512_w )
{
UINT8 *videoram = cga.videoram;
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(CGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(CGA_MC6845_NAME);
switch (offset)
{
case 0: case 2: case 4: case 6:
data &= 0x1F;
- mc6845->address_w( *space, offset, data );
+ mc6845->address_w( space, offset, data );
pc1512.mc6845_address = data;
break;
case 1: case 3: case 5: case 7:
if ( ! pc1512.mc6845_locked_register[pc1512.mc6845_address] )
{
- mc6845->register_w( *space, offset, data );
+ mc6845->register_w( space, offset, data );
if ( mc6845_writeonce_register[pc1512.mc6845_address] )
{
pc1512.mc6845_locked_register[pc1512.mc6845_address] = 1;
@@ -1514,7 +1514,7 @@ static WRITE8_HANDLER ( pc1512_w )
}
else
{
- space->machine().root_device().membank("bank1")->set_base(videoram + videoram_offset[0]);
+ space.machine().root_device().membank("bank1")->set_base(videoram + videoram_offset[0]);
}
cga.mode_control = data;
switch( cga.mode_control & 0x3F )
@@ -1572,7 +1572,7 @@ static WRITE8_HANDLER ( pc1512_w )
pc1512.read = data;
if ( ( cga.mode_control & 0x12 ) == 0x12 )
{
- space->machine().root_device().membank("bank1")->set_base(videoram + videoram_offset[data & 3]);
+ space.machine().root_device().membank("bank1")->set_base(videoram + videoram_offset[data & 3]);
}
break;
@@ -1635,12 +1635,12 @@ static VIDEO_START( pc1512 )
cga.videoram_size = 0x10000;
cga.videoram = auto_alloc_array(machine, UINT8, 0x10000 );
- address_space *space = machine.firstcpu->space( AS_PROGRAM );
+ address_space &space = *machine.firstcpu->space( AS_PROGRAM );
address_space *io_space = machine.firstcpu->space( AS_IO );
- space->install_read_bank( 0xb8000, 0xbbfff, 0, 0x0C000, "bank1" );
+ space.install_read_bank( 0xb8000, 0xbbfff, 0, 0x0C000, "bank1" );
machine.root_device().membank("bank1")->set_base(cga.videoram + videoram_offset[0]);
- space->install_legacy_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, FUNC(pc1512_videoram_w), 0xffff);
+ space.install_legacy_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, FUNC(pc1512_videoram_w), 0xffff);
io_space->install_legacy_readwrite_handler( 0x3d0, 0x3df, FUNC(pc1512_r), FUNC(pc1512_w), 0xffff);
diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c
index 5da7d50ce85..cea4b1c6eb8 100644
--- a/src/emu/video/pc_vga.c
+++ b/src/emu/video/pc_vga.c
@@ -1462,8 +1462,8 @@ static READ8_HANDLER(vga_crtc_r)
vga.attribute.state = 0;
data = 0;
- hsync = space->machine().primary_screen->hblank() & 1;
- vsync = vga_vblank(space->machine()); //space->machine().primary_screen->vblank() & 1;
+ hsync = space.machine().primary_screen->hblank() & 1;
+ vsync = vga_vblank(space.machine()); //space.machine().primary_screen->vblank() & 1;
data |= (hsync | vsync) & 1; // DD - display disable register
data |= (vsync & 1) << 3; // VRetrace register
@@ -1513,11 +1513,11 @@ static WRITE8_HANDLER(vga_crtc_w)
data);
}
- crtc_reg_write(space->machine(),vga.crtc.index,data);
- //space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ crtc_reg_write(space.machine(),vga.crtc.index,data);
+ //space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
#if 0
if((vga.crtc.index & 0xfe) != 0x0e)
- printf("%02x %02x %d\n",vga.crtc.index,data,space->machine().primary_screen->vpos());
+ printf("%02x %02x %d\n",vga.crtc.index,data,space.machine().primary_screen->vpos());
#endif
break;
@@ -1687,7 +1687,7 @@ READ8_HANDLER( vga_port_03c0_r )
break;
case 0xf:
- data = gc_reg_read(space->machine(),vga.gc.index);
+ data = gc_reg_read(space.machine(),vga.gc.index);
break;
}
return data;
@@ -1700,7 +1700,7 @@ READ8_HANDLER(vga_port_03d0_r)
data = vga_crtc_r(space, offset);
if(offset == 8)
{
- logerror("VGA: 0x3d8 read at %08x\n",space->device().safe_pc());
+ logerror("VGA: 0x3d8 read at %08x\n",space.device().safe_pc());
data = 0; // TODO: PC-200 reads back CGA register here, everything else returns open bus OR CGA emulation of register 0x3d8
}
@@ -1801,7 +1801,7 @@ WRITE8_HANDLER(vga_port_03c0_w)
break;
case 2:
vga.miscellaneous_output=data;
- recompute_params(space->machine());
+ recompute_params(space.machine());
break;
case 3:
vga.oak.reg = data;
@@ -1822,8 +1822,8 @@ WRITE8_HANDLER(vga_port_03c0_w)
vga.sequencer.data[vga.sequencer.index] = data;
}
- seq_reg_write(space->machine(),vga.sequencer.index,data);
- recompute_params(space->machine());
+ seq_reg_write(space.machine(),vga.sequencer.index,data);
+ recompute_params(space.machine());
break;
case 6:
vga.dac.mask=data;
@@ -1863,7 +1863,7 @@ WRITE8_HANDLER(vga_port_03c0_w)
vga.gc.index=data;
break;
case 0xf:
- gc_reg_write(space->machine(),vga.gc.index,data);
+ gc_reg_write(space.machine(),vga.gc.index,data);
break;
}
}
@@ -1920,7 +1920,7 @@ READ8_HANDLER(vga_mem_r)
if(vga.sequencer.data[4] & 4)
{
int data;
- if (!space->debugger_access())
+ if (!space.debugger_access())
{
vga.gc.latch[0]=vga.memory[(offset)];
vga.gc.latch[1]=vga.memory[(offset)+0x10000];
@@ -2043,7 +2043,7 @@ void pc_vga_init(running_machine &machine, read8_space_func read_dipswitch, cons
}
-void pc_vga_io_init(running_machine &machine, address_space *mem_space, offs_t mem_offset, address_space *io_space, offs_t port_offset)
+void pc_vga_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset)
{
int buswidth;
UINT64 mask = 0;
@@ -2071,11 +2071,11 @@ void pc_vga_io_init(running_machine &machine, address_space *mem_space, offs_t m
fatalerror("VGA: Bus width %d not supported\n", buswidth);
break;
}
- io_space->install_legacy_readwrite_handler(port_offset + 0x3b0, port_offset + 0x3bf, FUNC(vga_port_03b0_r), FUNC(vga_port_03b0_w), mask);
- io_space->install_legacy_readwrite_handler(port_offset + 0x3c0, port_offset + 0x3cf, FUNC(vga_port_03c0_r), FUNC(vga_port_03c0_w), mask);
- io_space->install_legacy_readwrite_handler(port_offset + 0x3d0, port_offset + 0x3df, FUNC(vga_port_03d0_r), FUNC(vga_port_03d0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3b0, port_offset + 0x3bf, FUNC(vga_port_03b0_r), FUNC(vga_port_03b0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3c0, port_offset + 0x3cf, FUNC(vga_port_03c0_r), FUNC(vga_port_03c0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3d0, port_offset + 0x3df, FUNC(vga_port_03d0_r), FUNC(vga_port_03d0_w), mask);
- mem_space->install_legacy_readwrite_handler(mem_offset + 0x00000, mem_offset + 0x1ffff, FUNC(vga_mem_r), FUNC(vga_mem_w), mask);
+ mem_space.install_legacy_readwrite_handler(mem_offset + 0x00000, mem_offset + 0x1ffff, FUNC(vga_mem_r), FUNC(vga_mem_w), mask);
}
VIDEO_START( vga )
@@ -2313,7 +2313,7 @@ READ8_HANDLER(tseng_et4k_03b0_r)
switch(offset)
{
case 5:
- res = tseng_crtc_reg_read(space->machine(),vga.crtc.index);
+ res = tseng_crtc_reg_read(space.machine(),vga.crtc.index);
break;
case 8:
res = et4k.reg_3d8;
@@ -2335,7 +2335,7 @@ WRITE8_HANDLER(tseng_et4k_03b0_w)
{
case 5:
vga.crtc.data[vga.crtc.index] = data;
- tseng_crtc_reg_write(space->machine(),vga.crtc.index,data);
+ tseng_crtc_reg_write(space.machine(),vga.crtc.index,data);
break;
case 8:
et4k.reg_3d8 = data;
@@ -2349,7 +2349,7 @@ WRITE8_HANDLER(tseng_et4k_03b0_w)
break;
}
}
- tseng_define_video_mode(space->machine());
+ tseng_define_video_mode(space.machine());
}
@@ -2360,7 +2360,7 @@ READ8_HANDLER(tseng_et4k_03c0_r)
switch(offset)
{
case 0x05:
- res = tseng_seq_reg_read(space->machine(),vga.sequencer.index);
+ res = tseng_seq_reg_read(space.machine(),vga.sequencer.index);
break;
case 0x0d:
res = svga.bank_w & 0xf;
@@ -2392,7 +2392,7 @@ WRITE8_HANDLER(tseng_et4k_03c0_w)
switch(offset)
{
case 0x05:
- tseng_seq_reg_write(space->machine(),vga.sequencer.index,data);
+ tseng_seq_reg_write(space.machine(),vga.sequencer.index,data);
break;
case 0x0d:
svga.bank_w = data & 0xf;
@@ -2408,7 +2408,7 @@ WRITE8_HANDLER(tseng_et4k_03c0_w)
vga_port_03c0_w(space,offset,data);
break;
}
- tseng_define_video_mode(space->machine());
+ tseng_define_video_mode(space.machine());
}
READ8_HANDLER(tseng_et4k_03d0_r)
@@ -2420,7 +2420,7 @@ READ8_HANDLER(tseng_et4k_03d0_r)
switch(offset)
{
case 5:
- res = tseng_crtc_reg_read(space->machine(),vga.crtc.index);
+ res = tseng_crtc_reg_read(space.machine(),vga.crtc.index);
break;
case 8:
res = et4k.reg_3d8;
@@ -2442,9 +2442,9 @@ WRITE8_HANDLER(tseng_et4k_03d0_w)
{
case 5:
vga.crtc.data[vga.crtc.index] = data;
- tseng_crtc_reg_write(space->machine(),vga.crtc.index,data);
+ tseng_crtc_reg_write(space.machine(),vga.crtc.index,data);
//if((vga.crtc.index & 0xfe) != 0x0e)
- // printf("%02x %02x %d\n",vga.crtc.index,data,space->machine().primary_screen->vpos());
+ // printf("%02x %02x %d\n",vga.crtc.index,data,space.machine().primary_screen->vpos());
break;
case 8:
et4k.reg_3d8 = data;
@@ -2458,7 +2458,7 @@ WRITE8_HANDLER(tseng_et4k_03d0_w)
break;
}
}
- tseng_define_video_mode(space->machine());
+ tseng_define_video_mode(space.machine());
}
READ8_HANDLER( tseng_mem_r )
@@ -2489,7 +2489,7 @@ Trident implementation
******************************************/
-void pc_svga_trident_io_init(running_machine &machine, address_space *mem_space, offs_t mem_offset, address_space *io_space, offs_t port_offset)
+void pc_svga_trident_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset)
{
int buswidth;
UINT64 mask = 0;
@@ -2517,11 +2517,11 @@ void pc_svga_trident_io_init(running_machine &machine, address_space *mem_space,
fatalerror("VGA: Bus width %d not supported\n", buswidth);
break;
}
- io_space->install_legacy_readwrite_handler(port_offset + 0x3b0, port_offset + 0x3bf, FUNC(vga_port_03b0_r), FUNC(vga_port_03b0_w), mask);
- io_space->install_legacy_readwrite_handler(port_offset + 0x3c0, port_offset + 0x3cf, FUNC(trident_03c0_r), FUNC(trident_03c0_w), mask);
- io_space->install_legacy_readwrite_handler(port_offset + 0x3d0, port_offset + 0x3df, FUNC(trident_03d0_r), FUNC(trident_03d0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3b0, port_offset + 0x3bf, FUNC(vga_port_03b0_r), FUNC(vga_port_03b0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3c0, port_offset + 0x3cf, FUNC(trident_03c0_r), FUNC(trident_03c0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3d0, port_offset + 0x3df, FUNC(trident_03d0_r), FUNC(trident_03d0_w), mask);
- mem_space->install_legacy_readwrite_handler(mem_offset + 0x00000, mem_offset + 0x1ffff, FUNC(trident_mem_r), FUNC(trident_mem_w), mask);
+ mem_space.install_legacy_readwrite_handler(mem_offset + 0x00000, mem_offset + 0x1ffff, FUNC(trident_mem_r), FUNC(trident_mem_w), mask);
// D3h = TGUI9660XGi
svga.id = 0xd3; // TODO: hardcoded for California Chase
@@ -2582,7 +2582,7 @@ READ8_HANDLER(trident_03c0_r)
switch(offset)
{
case 0x05:
- res = trident_seq_reg_read(space->machine(),vga.sequencer.index);
+ res = trident_seq_reg_read(space.machine(),vga.sequencer.index);
break;
default:
res = vga_port_03c0_r(space,offset);
@@ -2597,7 +2597,7 @@ WRITE8_HANDLER(trident_03c0_w)
switch(offset)
{
case 0x05:
- trident_seq_reg_write(space->machine(),vga.sequencer.index,data);
+ trident_seq_reg_write(space.machine(),vga.sequencer.index,data);
break;
default:
vga_port_03c0_w(space,offset,data);
@@ -3014,7 +3014,7 @@ READ8_HANDLER(s3_port_03b0_r)
switch(offset)
{
case 5:
- res = s3_crtc_reg_read(space->machine(),vga.crtc.index);
+ res = s3_crtc_reg_read(space.machine(),vga.crtc.index);
break;
default:
res = vga_port_03b0_r(space,offset);
@@ -3033,7 +3033,7 @@ WRITE8_HANDLER(s3_port_03b0_w)
{
case 5:
vga.crtc.data[vga.crtc.index] = data;
- s3_crtc_reg_write(space->machine(),vga.crtc.index,data);
+ s3_crtc_reg_write(space.machine(),vga.crtc.index,data);
break;
default:
vga_port_03b0_w(space,offset,data);
@@ -3075,7 +3075,7 @@ READ8_HANDLER(s3_port_03d0_r)
switch(offset)
{
case 5:
- res = s3_crtc_reg_read(space->machine(),vga.crtc.index);
+ res = s3_crtc_reg_read(space.machine(),vga.crtc.index);
break;
default:
res = vga_port_03d0_r(space,offset);
@@ -3094,7 +3094,7 @@ WRITE8_HANDLER(s3_port_03d0_w)
{
case 5:
vga.crtc.data[vga.crtc.index] = data;
- s3_crtc_reg_write(space->machine(),vga.crtc.index,data);
+ s3_crtc_reg_write(space.machine(),vga.crtc.index,data);
break;
default:
vga_port_03d0_w(space,offset,data);
@@ -4835,7 +4835,7 @@ WRITE8_HANDLER(vga_port_gamtor_03d0_w)
}
}
-void pc_vga_gamtor_io_init(running_machine &machine, address_space *mem_space, offs_t mem_offset, address_space *io_space, offs_t port_offset)
+void pc_vga_gamtor_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset)
{
int buswidth;
UINT64 mask = 0;
@@ -4863,11 +4863,11 @@ void pc_vga_gamtor_io_init(running_machine &machine, address_space *mem_space, o
fatalerror("VGA: Bus width %d not supported\n", buswidth);
break;
}
- io_space->install_legacy_readwrite_handler(port_offset + 0x3b0, port_offset + 0x3bf, FUNC(vga_port_gamtor_03b0_r), FUNC(vga_port_gamtor_03b0_w), mask);
- io_space->install_legacy_readwrite_handler(port_offset + 0x3c0, port_offset + 0x3cf, FUNC(vga_port_gamtor_03c0_r), FUNC(vga_port_gamtor_03c0_w), mask);
- io_space->install_legacy_readwrite_handler(port_offset + 0x3d0, port_offset + 0x3df, FUNC(vga_port_gamtor_03d0_r), FUNC(vga_port_gamtor_03d0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3b0, port_offset + 0x3bf, FUNC(vga_port_gamtor_03b0_r), FUNC(vga_port_gamtor_03b0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3c0, port_offset + 0x3cf, FUNC(vga_port_gamtor_03c0_r), FUNC(vga_port_gamtor_03c0_w), mask);
+ io_space.install_legacy_readwrite_handler(port_offset + 0x3d0, port_offset + 0x3df, FUNC(vga_port_gamtor_03d0_r), FUNC(vga_port_gamtor_03d0_w), mask);
- mem_space->install_legacy_readwrite_handler(mem_offset + 0x00000, mem_offset + 0x1ffff, FUNC(vga_gamtor_mem_r), FUNC(vga_gamtor_mem_w), mask);
+ mem_space.install_legacy_readwrite_handler(mem_offset + 0x00000, mem_offset + 0x1ffff, FUNC(vga_gamtor_mem_r), FUNC(vga_gamtor_mem_w), mask);
}
static void ati_define_video_mode(running_machine &machine)
@@ -5079,7 +5079,7 @@ bit 0 SENSE is the result of a wired-OR of 3 comparators, one
*/
READ16_HANDLER(mach8_status_r)
{
- return vga_vblank(space->machine()) << 1;
+ return vga_vblank(space.machine()) << 1;
}
WRITE16_HANDLER(mach8_htotal_w)
@@ -5112,7 +5112,7 @@ bit 0-3 Interrupt requests. These bits show the state of internal interrupt
READ16_HANDLER(mach8_substatus_r)
{
// TODO:
- if(vga_vblank(space->machine()) != 0) // not correct, but will do for now
+ if(vga_vblank(space.machine()) != 0) // not correct, but will do for now
ibm8514.substatus |= 0x01;
return ibm8514.substatus;
}
diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h
index c4bba32fd53..c944a6d654a 100644
--- a/src/emu/video/pc_vga.h
+++ b/src/emu/video/pc_vga.h
@@ -26,9 +26,9 @@ struct pc_svga_interface
};
void pc_vga_init(running_machine &machine, read8_space_func read_dipswitch, const struct pc_svga_interface *svga_intf);
-void pc_vga_io_init(running_machine &machine, address_space *mem_space, offs_t mem_offset, address_space *io_space, offs_t port_offset);
-void pc_vga_gamtor_io_init(running_machine &machine, address_space *mem_space, offs_t mem_offset, address_space *io_space, offs_t port_offset);
-void pc_svga_trident_io_init(running_machine &machine, address_space *mem_space, offs_t mem_offset, address_space *io_space, offs_t port_offset);
+void pc_vga_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset);
+void pc_vga_gamtor_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset);
+void pc_svga_trident_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset);
void pc_vga_reset(running_machine &machine);
void *pc_vga_memory(void);
size_t pc_vga_memory_size(void);
diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c
index b4ad0d6aa2d..8baf62b3e8a 100644
--- a/src/emu/video/tms34061.c
+++ b/src/emu/video/tms34061.c
@@ -164,7 +164,7 @@ static TIMER_CALLBACK( tms34061_interrupt )
*
*************************************/
-static void register_w(address_space *space, offs_t offset, UINT8 data)
+static void register_w(address_space &space, offs_t offset, UINT8 data)
{
int scanline;
int regnum = offset >> 2;
@@ -184,7 +184,7 @@ static void register_w(address_space *space, offs_t offset, UINT8 data)
}
/* log it */
- if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space->machine().describe_context(), regnames[regnum], tms34061.regs[regnum]);
+ if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space.machine().describe_context(), regnames[regnum], tms34061.regs[regnum]);
/* update the state of things */
switch (regnum)
@@ -235,7 +235,7 @@ static void register_w(address_space *space, offs_t offset, UINT8 data)
*
*************************************/
-static UINT8 register_r(address_space *space, offs_t offset)
+static UINT8 register_r(address_space &space, offs_t offset)
{
int regnum = offset >> 2;
UINT16 result;
@@ -262,7 +262,7 @@ static UINT8 register_r(address_space *space, offs_t offset)
}
/* log it */
- if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space->machine().describe_context(), regnames[regnum], result);
+ if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space.machine().describe_context(), regnames[regnum], result);
return (offset & 0x02) ? (result >> 8) : result;
}
@@ -357,7 +357,7 @@ INLINE void adjust_xyaddress(int offset)
}
-static void xypixel_w(address_space *space, int offset, UINT8 data)
+static void xypixel_w(address_space &space, int offset, UINT8 data)
{
/* determine the offset, then adjust it */
offs_t pixeloffs = tms34061.regs[TMS34061_XYADDRESS];
@@ -369,7 +369,7 @@ static void xypixel_w(address_space *space, int offset, UINT8 data)
/* mask to the VRAM size */
pixeloffs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space->machine().describe_context(), pixeloffs, data, tms34061.latchdata);
+ if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space.machine().describe_context(), pixeloffs, data, tms34061.latchdata);
/* set the pixel data */
tms34061.vram[pixeloffs] = data;
@@ -377,7 +377,7 @@ static void xypixel_w(address_space *space, int offset, UINT8 data)
}
-static UINT8 xypixel_r(address_space *space, int offset)
+static UINT8 xypixel_r(address_space &space, int offset)
{
/* determine the offset, then adjust it */
offs_t pixeloffs = tms34061.regs[TMS34061_XYADDRESS];
@@ -402,7 +402,7 @@ static UINT8 xypixel_r(address_space *space, int offset)
*
*************************************/
-void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
+void tms34061_w(address_space &space, int col, int row, int func, UINT8 data)
{
offs_t offs;
@@ -425,7 +425,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
offs = ((row << tms34061.intf.rowshift) | col) & tms34061.vrammask;
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
- if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space->machine().describe_context(), offs, data, tms34061.latchdata);
+ if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space.machine().describe_context(), offs, data, tms34061.latchdata);
if (tms34061.vram[offs] != data || tms34061.latchram[offs] != tms34061.latchdata)
{
tms34061.vram[offs] = data;
@@ -439,7 +439,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
offs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space->machine().describe_context(), offs);
+ if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space.machine().describe_context(), offs);
memcpy(&tms34061.vram[offs], tms34061.shiftreg, (size_t)1 << tms34061.intf.rowshift);
memset(&tms34061.latchram[offs], tms34061.latchdata, (size_t)1 << tms34061.intf.rowshift);
@@ -451,20 +451,20 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
offs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space->machine().describe_context(), offs);
+ if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space.machine().describe_context(), offs);
tms34061.shiftreg = &tms34061.vram[offs];
break;
/* log anything else */
default:
- logerror("%s:Unsupported TMS34061 function %d\n", space->machine().describe_context(), func);
+ logerror("%s:Unsupported TMS34061 function %d\n", space.machine().describe_context(), func);
break;
}
}
-UINT8 tms34061_r(address_space *space, int col, int row, int func)
+UINT8 tms34061_r(address_space &space, int col, int row, int func)
{
int result = 0;
offs_t offs;
@@ -512,7 +512,7 @@ UINT8 tms34061_r(address_space *space, int col, int row, int func)
/* log anything else */
default:
- logerror("%s:Unsupported TMS34061 function %d\n", space->machine().describe_context(),
+ logerror("%s:Unsupported TMS34061 function %d\n", space.machine().describe_context(),
func);
break;
}
diff --git a/src/emu/video/tms34061.h b/src/emu/video/tms34061.h
index 0128785d9ef..97ab6ba0b9d 100644
--- a/src/emu/video/tms34061.h
+++ b/src/emu/video/tms34061.h
@@ -62,8 +62,8 @@ struct tms34061_display
void tms34061_start(running_machine &machine, const struct tms34061_interface *interface);
/* reads/writes to the 34061 */
-UINT8 tms34061_r(address_space *space, int col, int row, int func);
-void tms34061_w(address_space *space, int col, int row, int func, UINT8 data);
+UINT8 tms34061_r(address_space &space, int col, int row, int func);
+void tms34061_w(address_space &space, int col, int row, int func, UINT8 data);
/* latch settings */
READ8_HANDLER( tms34061_latch_r );
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index d735178eaf8..25776310b02 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -897,9 +897,9 @@ static TIMER_CALLBACK( schaser_effect_555_cb )
static void schaser_reinit_555_time_remain(_8080bw_state *state)
{
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
state->m_schaser_effect_555_time_remain = attotime::from_double(state->m_schaser_effect_555_time_remain_savable);
- state->schaser_sh_port_2_w(*space, 0, state->m_port_2_last_extra);
+ state->schaser_sh_port_2_w(space, 0, state->m_port_2_last_extra);
}
@@ -918,12 +918,12 @@ MACHINE_START_MEMBER(_8080bw_state,schaser_sh)
MACHINE_RESET_MEMBER(_8080bw_state,schaser_sh)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_schaser_effect_555_is_low = 0;
m_schaser_effect_555_timer->adjust(attotime::never);
- schaser_sh_port_1_w(*space, 0, 0);
- schaser_sh_port_2_w(*space, 0, 0);
+ schaser_sh_port_1_w(space, 0, 0);
+ schaser_sh_port_2_w(space, 0, 0);
m_schaser_effect_555_time_remain = attotime::zero;
m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double();
}
diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c
index 925f20782a0..bf2f61ef889 100644
--- a/src/mame/audio/amiga.c
+++ b/src/mame/audio/amiga.c
@@ -76,7 +76,7 @@ INLINE amiga_audio *get_safe_token( device_t *device )
static TIMER_CALLBACK( signal_irq )
{
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index d79748376de..4cb02e7601c 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -203,7 +203,7 @@ void atarijsa_reset(void)
static READ8_HANDLER( jsa1_io_r )
{
- atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
+ atarigen_state *atarigen = space.machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -227,8 +227,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = space->machine().root_device().ioport("JSAI")->read();
- if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
+ result = space.machine().root_device().ioport("JSAI")->read();
+ if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( jsa1_io_w )
case 0x200: /* /VOICE */
if (tms5220 != NULL)
- tms5220_data_w(tms5220, *space, 0, data);
+ tms5220_data_w(tms5220, space, 0, data);
break;
case 0x202: /* /WRP */
@@ -298,11 +298,11 @@ static WRITE8_HANDLER( jsa1_io_w )
}
/* reset the YM2151 if needed */
- if ((data&1) == 0) space->machine().device("ymsnd")->reset();
+ if ((data&1) == 0) space.machine().device("ymsnd")->reset();
/* coin counters */
- coin_counter_w(space->machine(), 1, (data >> 5) & 1);
- coin_counter_w(space->machine(), 0, (data >> 4) & 1);
+ coin_counter_w(space.machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space.machine(), 0, (data >> 4) & 1);
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
@@ -318,7 +318,7 @@ static WRITE8_HANDLER( jsa1_io_w )
tms5220_volume = ((data >> 6) & 3) * 100 / 3;
pokey_volume = ((data >> 4) & 3) * 100 / 3;
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
- update_all_volumes(space->machine());
+ update_all_volumes(space.machine());
break;
}
}
@@ -333,14 +333,14 @@ static WRITE8_HANDLER( jsa1_io_w )
static READ8_HANDLER( jsa2_io_r )
{
- atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
+ atarigen_state *atarigen = space.machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
{
case 0x000: /* /RDV */
if (oki6295 != NULL)
- result = oki6295->read(*space, offset);
+ result = oki6295->read(space, offset);
else
logerror("atarijsa: Unknown read at %04X\n", offset & 0x206);
break;
@@ -360,8 +360,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = space->machine().root_device().ioport("JSAII")->read();
- if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
+ result = space.machine().root_device().ioport("JSAII")->read();
+ if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -398,7 +398,7 @@ static WRITE8_HANDLER( jsa2_io_w )
case 0x200: /* /WRV */
if (oki6295 != NULL)
- oki6295->write(*space, offset, data);
+ oki6295->write(space, offset, data);
else
logerror("atarijsa: Unknown write (%02X) at %04X\n", data & 0xff, offset & 0x206);
break;
@@ -419,14 +419,14 @@ static WRITE8_HANDLER( jsa2_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) space->machine().device("ymsnd")->reset();
+ if ((data&1) == 0) space.machine().device("ymsnd")->reset();
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine(), 1, (data >> 5) & 1);
- coin_counter_w(space->machine(), 0, (data >> 4) & 1);
+ coin_counter_w(space.machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space.machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
if (oki6295 != NULL)
@@ -443,7 +443,7 @@ static WRITE8_HANDLER( jsa2_io_w )
*/
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine());
+ update_all_volumes(space.machine());
break;
}
}
@@ -458,14 +458,14 @@ static WRITE8_HANDLER( jsa2_io_w )
static READ8_HANDLER( jsa3_io_r )
{
- atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
+ atarigen_state *atarigen = space.machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
{
case 0x000: /* /RDV */
if (oki6295 != NULL)
- result = oki6295->read(*space, offset);
+ result = oki6295->read(space, offset);
break;
case 0x002: /* /RDP */
@@ -483,8 +483,8 @@ static READ8_HANDLER( jsa3_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = space->machine().root_device().ioport("JSAIII")->read();
- if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
+ result = space.machine().root_device().ioport("JSAIII")->read();
+ if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -511,7 +511,7 @@ static WRITE8_HANDLER( jsa3_io_w )
{
case 0x000: /* /RDV */
overall_volume = data * 100 / 127;
- update_all_volumes(space->machine());
+ update_all_volumes(space.machine());
break;
case 0x002: /* /RDP */
@@ -525,7 +525,7 @@ static WRITE8_HANDLER( jsa3_io_w )
case 0x200: /* /WRV */
if (oki6295 != NULL)
- oki6295->write(*space, offset, data);
+ oki6295->write(space, offset, data);
break;
case 0x202: /* /WRP */
@@ -544,18 +544,18 @@ static WRITE8_HANDLER( jsa3_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) space->machine().device("ymsnd")->reset();
+ if ((data&1) == 0) space.machine().device("ymsnd")->reset();
/* update the OKI bank */
if (oki6295 != NULL)
- space->machine().root_device().membank("bank12")->set_entry((space->machine().root_device().membank("bank12")->entry() & 2) | ((data >> 1) & 1));
+ space.machine().root_device().membank("bank12")->set_entry((space.machine().root_device().membank("bank12")->entry() & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine(), 1, (data >> 5) & 1);
- coin_counter_w(space->machine(), 0, (data >> 4) & 1);
+ coin_counter_w(space.machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space.machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
if (oki6295 != NULL) oki6295->set_pin7(data & 8);
@@ -572,12 +572,12 @@ static WRITE8_HANDLER( jsa3_io_w )
/* update the OKI bank */
if (oki6295 != NULL)
- space->machine().root_device().membank("bank12")->set_entry((space->machine().root_device().membank("bank12")->entry() & 1) | ((data >> 3) & 2));
+ space.machine().root_device().membank("bank12")->set_entry((space.machine().root_device().membank("bank12")->entry() & 1) | ((data >> 3) & 2));
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine());
+ update_all_volumes(space.machine());
break;
}
}
@@ -592,14 +592,14 @@ static WRITE8_HANDLER( jsa3_io_w )
static READ8_HANDLER( jsa3s_io_r )
{
- atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
+ atarigen_state *atarigen = space.machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
{
case 0x000: /* /RDV */
if (oki6295_l != NULL)
- result = ((offset & 1) ? oki6295_r : oki6295_l)->read(*space, offset);
+ result = ((offset & 1) ? oki6295_r : oki6295_l)->read(space, offset);
break;
case 0x002: /* /RDP */
@@ -617,8 +617,8 @@ static READ8_HANDLER( jsa3s_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = space->machine().root_device().ioport("JSAIII")->read();
- if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
+ result = space.machine().root_device().ioport("JSAIII")->read();
+ if (!(space.machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -645,7 +645,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
{
case 0x000: /* /RDV */
overall_volume = data * 100 / 127;
- update_all_volumes(space->machine());
+ update_all_volumes(space.machine());
break;
case 0x002: /* /RDP */
@@ -659,7 +659,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
case 0x200: /* /WRV */
if (oki6295_l != NULL)
- ((offset & 1) ? oki6295_r : oki6295_l)->write(*space, 0, data);
+ ((offset & 1) ? oki6295_r : oki6295_l)->write(space, 0, data);
break;
case 0x202: /* /WRP */
@@ -678,17 +678,17 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) space->machine().device("ymsnd")->reset();
+ if ((data&1) == 0) space.machine().device("ymsnd")->reset();
/* update the OKI bank */
- space->machine().root_device().membank("bank12")->set_entry((space->machine().root_device().membank("bank12")->entry() & 2) | ((data >> 1) & 1));
+ space.machine().root_device().membank("bank12")->set_entry((space.machine().root_device().membank("bank12")->entry() & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine(), 1, (data >> 5) & 1);
- coin_counter_w(space->machine(), 0, (data >> 4) & 1);
+ coin_counter_w(space.machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space.machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
oki6295_l->set_pin7(data & 8);
@@ -705,13 +705,13 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* update the OKI bank */
- space->machine().root_device().membank("bank12")->set_entry((space->machine().root_device().membank("bank12")->entry() & 1) | ((data >> 3) & 2));
- space->machine().root_device().membank("bank14")->set_entry(data >> 6);
+ space.machine().root_device().membank("bank12")->set_entry((space.machine().root_device().membank("bank12")->entry() & 1) | ((data >> 3) & 2));
+ space.machine().root_device().membank("bank14")->set_entry(data >> 6);
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine());
+ update_all_volumes(space.machine());
break;
}
}
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index 65e694a9692..5c13f66d421 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -204,11 +204,11 @@ void cage_set_irq_handler(void (*irqhandler)(running_machine &, int))
}
-void cage_reset_w(address_space *space, int state)
+void cage_reset_w(address_space &space, int state)
{
cage_t *sndstate = &cage;
if (state)
- cage_control_w(space->machine(), 0);
+ cage_control_w(space.machine(), 0);
sndstate->cpu->set_input_line(INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -246,7 +246,7 @@ static TIMER_DEVICE_CALLBACK( dma_timer_callback )
}
-static void update_dma_state(address_space *space)
+static void update_dma_state(address_space &space)
{
cage_t *state = &cage;
UINT32 *tms32031_io_regs = state->tms32031_io_regs;
@@ -272,7 +272,7 @@ static void update_dma_state(address_space *space)
inc = (tms32031_io_regs[DMA_GLOBAL_CTL] >> 4) & 1;
for (i = 0; i < tms32031_io_regs[DMA_TRANSFER_COUNT]; i++)
{
- sound_data[i % STACK_SOUND_BUFSIZE] = space->read_dword(addr * 4);
+ sound_data[i % STACK_SOUND_BUFSIZE] = space.read_dword(addr * 4);
addr += inc;
if (i % STACK_SOUND_BUFSIZE == STACK_SOUND_BUFSIZE - 1)
dmadac_transfer(&state->dmadac[0], DAC_BUFFER_CHANNELS, 1, DAC_BUFFER_CHANNELS, STACK_SOUND_BUFSIZE / DAC_BUFFER_CHANNELS, sound_data);
@@ -410,7 +410,7 @@ static READ32_HANDLER( tms32031_io_r )
}
if (LOG_32031_IOPORTS)
- logerror("CAGE:%06X:%s read -> %08X\n", space->device().safe_pc(), register_names[offset & 0x7f], result);
+ logerror("CAGE:%06X:%s read -> %08X\n", space.device().safe_pc(), register_names[offset & 0x7f], result);
return result;
}
@@ -423,7 +423,7 @@ static WRITE32_HANDLER( tms32031_io_w )
COMBINE_DATA(&tms32031_io_regs[offset]);
if (LOG_32031_IOPORTS)
- logerror("CAGE:%06X:%s write = %08X\n", space->device().safe_pc(), register_names[offset & 0x7f], tms32031_io_regs[offset]);
+ logerror("CAGE:%06X:%s write = %08X\n", space.device().safe_pc(), register_names[offset & 0x7f], tms32031_io_regs[offset]);
switch (offset)
{
@@ -462,7 +462,7 @@ static WRITE32_HANDLER( tms32031_io_w )
case SPORT_GLOBAL_CTL:
case SPORT_TIMER_CTL:
case SPORT_TIMER_PERIOD:
- update_serial(space->machine());
+ update_serial(space.machine());
break;
}
}
@@ -506,9 +506,9 @@ static READ32_HANDLER( cage_from_main_r )
{
cage_t *state = &cage;
if (LOG_COMM)
- logerror("%06X:CAGE read command = %04X\n", space->device().safe_pc(), state->from_main);
+ logerror("%06X:CAGE read command = %04X\n", space.device().safe_pc(), state->from_main);
state->cpu_to_cage_ready = 0;
- update_control_lines(space->machine());
+ update_control_lines(space.machine());
state->cpu->set_input_line(TMS3203X_IRQ0, CLEAR_LINE);
return state->from_main;
}
@@ -519,7 +519,7 @@ static WRITE32_HANDLER( cage_from_main_ack_w )
if (LOG_COMM)
{
cage_t *state = &cage;
- logerror("%06X:CAGE ack command = %04X\n", space->device().safe_pc(), state->from_main);
+ logerror("%06X:CAGE ack command = %04X\n", space.device().safe_pc(), state->from_main);
}
}
@@ -528,11 +528,11 @@ static WRITE32_HANDLER( cage_to_main_w )
{
cage_t *state = &cage;
if (LOG_COMM)
- logerror("%06X:Data from CAGE = %04X\n", space->device().safe_pc(), data);
- driver_device *drvstate = space->machine().driver_data<driver_device>();
- drvstate->soundlatch_word_w(*space, 0, data, mem_mask);
+ logerror("%06X:Data from CAGE = %04X\n", space.device().safe_pc(), data);
+ driver_device *drvstate = space.machine().driver_data<driver_device>();
+ drvstate->soundlatch_word_w(space, 0, data, mem_mask);
state->cage_to_cpu_ready = 1;
- update_control_lines(space->machine());
+ update_control_lines(space.machine());
}
@@ -548,15 +548,15 @@ static READ32_HANDLER( cage_io_status_r )
}
-UINT16 cage_main_r(address_space *space)
+UINT16 cage_main_r(address_space &space)
{
cage_t *state = &cage;
- driver_device *drvstate = space->machine().driver_data<driver_device>();
+ driver_device *drvstate = space.machine().driver_data<driver_device>();
if (LOG_COMM)
- logerror("%s:main read data = %04X\n", space->machine().describe_context(), drvstate->soundlatch_word_r(*space, 0, 0));
+ logerror("%s:main read data = %04X\n", space.machine().describe_context(), drvstate->soundlatch_word_r(space, 0, 0));
state->cage_to_cpu_ready = 0;
- update_control_lines(space->machine());
- return drvstate->soundlatch_word_r(*space, 0, 0xffff);
+ update_control_lines(space.machine());
+ return drvstate->soundlatch_word_r(space, 0, 0xffff);
}
@@ -570,11 +570,11 @@ static TIMER_CALLBACK( cage_deferred_w )
}
-void cage_main_w(address_space *space, UINT16 data)
+void cage_main_w(address_space &space, UINT16 data)
{
if (LOG_COMM)
- logerror("%s:Command to CAGE = %04X\n", space->machine().describe_context(), data);
- space->machine().scheduler().synchronize(FUNC(cage_deferred_w), data);
+ logerror("%s:Command to CAGE = %04X\n", space.machine().describe_context(), data);
+ space.machine().scheduler().synchronize(FUNC(cage_deferred_w), data);
}
@@ -637,7 +637,7 @@ static WRITE32_HANDLER( speedup_w )
{
cage_t *state = &cage;
- space->device().execute().eat_cycles(100);
+ space.device().execute().eat_cycles(100);
COMBINE_DATA(&state->speedup_ram[offset]);
}
diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h
index 40294161e61..0c1dd7a9f0c 100644
--- a/src/mame/audio/cage.h
+++ b/src/mame/audio/cage.h
@@ -12,10 +12,10 @@ MACHINE_CONFIG_EXTERN( cage_seattle );
void cage_init(running_machine &machine, offs_t speedup);
void cage_set_irq_handler(void (*irqhandler)(running_machine &, int));
-void cage_reset_w(address_space *space, int state);
+void cage_reset_w(address_space &space, int state);
-UINT16 cage_main_r(address_space *space);
-void cage_main_w(address_space *space, UINT16 data);
+UINT16 cage_main_r(address_space &space);
+void cage_main_w(address_space &space, UINT16 data);
UINT16 cage_control_r(running_machine &machine);
void cage_control_w(running_machine &machine, UINT16 data);
diff --git a/src/mame/audio/carnival.c b/src/mame/audio/carnival.c
index af5fd847969..ddd355fcbaf 100644
--- a/src/mame/audio/carnival.c
+++ b/src/mame/audio/carnival.c
@@ -127,7 +127,7 @@ static int psgData = 0;
WRITE8_HANDLER( carnival_audio_1_w )
{
static int port1State = 0;
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@@ -206,7 +206,7 @@ WRITE8_HANDLER( carnival_audio_1_w )
WRITE8_HANDLER( carnival_audio_2_w )
{
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@@ -236,7 +236,7 @@ WRITE8_HANDLER( carnival_audio_2_w )
if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET )
/* reset output is no longer asserted active low */
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE );
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE );
}
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index eaaa9be2f58..9551ec3745e 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -74,7 +74,7 @@ WRITE8_HANDLER( cclimber_sample_trigger_w )
if (data == 0)
return;
- cclimber_play_sample(space->machine(), 32 * sample_num,sample_freq,sample_volume);
+ cclimber_play_sample(space.machine(), 32 * sample_num,sample_freq,sample_volume);
}
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index 01e3e57d957..c52ed546a77 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -1081,11 +1081,11 @@ static WRITE16_HANDLER( dcs_dataram_w )
static WRITE16_HANDLER( dcs_data_bank_select_w )
{
dcs.sounddata_bank = data & 0x7ff;
- space->machine().root_device().membank("databank")->set_entry(dcs.sounddata_bank % dcs.sounddata_banks);
+ space.machine().root_device().membank("databank")->set_entry(dcs.sounddata_bank % dcs.sounddata_banks);
/* bit 11 = sound board led */
#if 0
- set_led_status(space->machine(), 2, data & 0x800);
+ set_led_status(space.machine(), 2, data & 0x800);
#endif
}
@@ -1253,9 +1253,9 @@ static WRITE16_HANDLER( sdrc_w )
case 0:
sdrc.reg[0] = data;
if (diff & 0x1833)
- sdrc_remap_memory(space->machine());
+ sdrc_remap_memory(space.machine());
if (diff & 0x0380)
- sdrc_update_bank_pointers(space->machine());
+ sdrc_update_bank_pointers(space.machine());
break;
/* offset 1 controls RAM mapping */
@@ -1263,14 +1263,14 @@ static WRITE16_HANDLER( sdrc_w )
sdrc.reg[1] = data;
//dmadac_enable(&dcs.dmadac[0], dcs.channels, SDRC_MUTE);
if (diff & 0x0003)
- sdrc_remap_memory(space->machine());
+ sdrc_remap_memory(space.machine());
break;
/* offset 2 controls paging */
case 2:
sdrc.reg[2] = data;
if (diff & 0x1fff)
- sdrc_update_bank_pointers(space->machine());
+ sdrc_update_bank_pointers(space.machine());
break;
/* offset 3 controls security */
@@ -1352,13 +1352,13 @@ static WRITE16_HANDLER( dsio_w )
dmadac_enable(&dcs.dmadac[0], dcs.channels, DSIO_MUTE);
/* bit 0 resets the FIFO */
- midway_ioasic_fifo_reset_w(space->machine(), DSIO_EMPTY_FIFO ^ 1);
+ midway_ioasic_fifo_reset_w(space.machine(), DSIO_EMPTY_FIFO ^ 1);
break;
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
- space->machine().root_device().membank("databank")->set_entry(DSIO_DM_PG % dcs.sounddata_banks);
+ space.machine().root_device().membank("databank")->set_entry(DSIO_DM_PG % dcs.sounddata_banks);
break;
}
}
@@ -1413,24 +1413,24 @@ static WRITE16_HANDLER( denver_w )
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
- dcs.dmadac[chan] = space->machine().device<dmadac_sound_device>(buffer);
+ dcs.dmadac[chan] = space.machine().device<dmadac_sound_device>(buffer);
}
dmadac_enable(&dcs.dmadac[0], dcs.channels, enable);
if (dcs.channels < 6)
dmadac_enable(&dcs.dmadac[dcs.channels], 6 - dcs.channels, FALSE);
- recompute_sample_rate(space->machine());
+ recompute_sample_rate(space.machine());
}
break;
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
- space->machine().root_device().membank("databank")->set_entry(DENV_DM_PG % dcs.sounddata_bank);
+ space.machine().root_device().membank("databank")->set_entry(DENV_DM_PG % dcs.sounddata_bank);
break;
/* offset 3 controls FIFO reset */
case 3:
- midway_ioasic_fifo_reset_w(space->machine(), 1);
+ midway_ioasic_fifo_reset_w(space.machine(), 1);
break;
}
}
@@ -1447,7 +1447,7 @@ WRITE32_HANDLER( dsio_idma_addr_w )
{
dsio_state &dsio = dcs.dsio;
if (LOG_DCS_TRANSFERS)
- logerror("%08X:IDMA_addr = %04X\n", space->device().safe_pc(), data);
+ logerror("%08X:IDMA_addr = %04X\n", space.device().safe_pc(), data);
downcast<adsp2181_device *>(dcs.cpu)->idma_addr_w(data);
if (data == 0)
dsio.start_on_next_write = 2;
@@ -1457,7 +1457,7 @@ WRITE32_HANDLER( dsio_idma_addr_w )
WRITE32_HANDLER( dsio_idma_data_w )
{
dsio_state &dsio = dcs.dsio;
- UINT32 pc = space->device().safe_pc();
+ UINT32 pc = space.device().safe_pc();
if (ACCESSING_BITS_0_15)
{
if (LOG_DCS_TRANSFERS)
@@ -1483,7 +1483,7 @@ READ32_HANDLER( dsio_idma_data_r )
UINT32 result;
result = downcast<adsp2181_device *>(dcs.cpu)->idma_data_r();
if (LOG_DCS_TRANSFERS)
- logerror("%08X:IDMA_data_r(%04X) = %04X\n", space->device().safe_pc(), downcast<adsp2181_device *>(dcs.cpu)->idma_addr_r(), result);
+ logerror("%08X:IDMA_data_r(%04X) = %04X\n", space.device().safe_pc(), downcast<adsp2181_device *>(dcs.cpu)->idma_addr_r(), result);
return result;
}
@@ -1607,7 +1607,7 @@ void dcs_data_w(running_machine &machine, int data)
static WRITE16_HANDLER( input_latch_ack_w )
{
if (!dcs.last_input_empty && dcs.input_empty_cb)
- (*dcs.input_empty_cb)(space->machine(), dcs.last_input_empty = 1);
+ (*dcs.input_empty_cb)(space.machine(), dcs.last_input_empty = 1);
SET_INPUT_EMPTY();
dcs.cpu->set_input_line(ADSP2105_IRQ2, CLEAR_LINE);
}
@@ -1618,7 +1618,7 @@ static READ16_HANDLER( input_latch_r )
if (dcs.auto_ack)
input_latch_ack_w(space,0,0,0xffff);
if (LOG_DCS_IO)
- logerror("%08X:input_latch_r(%04X)\n", space->device().safe_pc(), dcs.input_data);
+ logerror("%08X:input_latch_r(%04X)\n", space.device().safe_pc(), dcs.input_data);
return dcs.input_data;
}
@@ -1640,8 +1640,8 @@ static TIMER_CALLBACK( latch_delayed_w )
static WRITE16_HANDLER( output_latch_w )
{
if (LOG_DCS_IO)
- logerror("%08X:output_latch_w(%04X) (empty=%d)\n", space->device().safe_pc(), data, IS_OUTPUT_EMPTY());
- space->machine().scheduler().synchronize(FUNC(latch_delayed_w), data);
+ logerror("%08X:output_latch_w(%04X) (empty=%d)\n", space.device().safe_pc(), data, IS_OUTPUT_EMPTY());
+ space.machine().scheduler().synchronize(FUNC(latch_delayed_w), data);
}
@@ -1694,8 +1694,8 @@ static TIMER_CALLBACK( output_control_delayed_w )
static WRITE16_HANDLER( output_control_w )
{
if (LOG_DCS_IO)
- logerror("%04X:output_control = %04X\n", space->device().safe_pc(), data);
- space->machine().scheduler().synchronize(FUNC(output_control_delayed_w), data);
+ logerror("%04X:output_control = %04X\n", space.device().safe_pc(), data);
+ space.machine().scheduler().synchronize(FUNC(output_control_delayed_w), data);
}
@@ -1858,7 +1858,7 @@ static READ16_HANDLER( adsp_control_r )
break;
case TIMER_COUNT_REG:
- update_timer_count(space->machine());
+ update_timer_count(space.machine());
result = dcs.control_regs[offset];
break;
@@ -1880,9 +1880,9 @@ static WRITE16_HANDLER( adsp_control_w )
/* bit 9 forces a reset */
if (data & 0x0200)
{
- logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", space->device().safe_pc());
+ logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", space.device().safe_pc());
dcs.cpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
- dcs_boot(space->machine());
+ dcs_boot(space.machine());
dcs.control_regs[SYSCONTROL_REG] = 0;
}
@@ -1914,23 +1914,23 @@ static WRITE16_HANDLER( adsp_control_w )
data = (data & 0xff) + 1;
if (data != dcs.timer_scale)
{
- update_timer_count(space->machine());
+ update_timer_count(space.machine());
dcs.timer_scale = data;
- reset_timer(space->machine());
+ reset_timer(space.machine());
}
break;
case TIMER_COUNT_REG:
dcs.timer_start_count = data;
- reset_timer(space->machine());
+ reset_timer(space.machine());
break;
case TIMER_PERIOD_REG:
if (data != dcs.timer_period)
{
- update_timer_count(space->machine());
+ update_timer_count(space.machine());
dcs.timer_period = data;
- reset_timer(space->machine());
+ reset_timer(space.machine());
}
break;
@@ -2076,7 +2076,7 @@ static void sound_tx_callback(adsp21xx_device &device, int port, INT32 data)
static READ16_HANDLER( dcs_polling_r )
{
if (dcs.polling_count++ > 5)
- space->device().execute().eat_cycles(10000);
+ space.device().execute().eat_cycles(10000);
return *dcs.polling_base;
}
@@ -2137,7 +2137,7 @@ static TIMER_CALLBACK( s1_ack_callback2 )
machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
return;
}
- output_latch_w(dcs.cpu->space(AS_PROGRAM), 0, 0x000a, 0xffff);
+ output_latch_w(*dcs.cpu->space(AS_PROGRAM), 0, 0x000a, 0xffff);
}
@@ -2149,7 +2149,7 @@ static TIMER_CALLBACK( s1_ack_callback1 )
machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
return;
}
- output_latch_w(dcs.cpu->space(AS_PROGRAM), 0, param, 0xffff);
+ output_latch_w(*dcs.cpu->space(AS_PROGRAM), 0, param, 0xffff);
/* chain to the next word we need to write back */
machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
@@ -2281,7 +2281,7 @@ static int preprocess_stage_1(running_machine &machine, UINT16 data)
static TIMER_CALLBACK( s2_ack_callback )
{
- address_space *space = dcs.cpu->space(AS_PROGRAM);
+ address_space &space = *dcs.cpu->space(AS_PROGRAM);
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
diff --git a/src/mame/audio/depthch.c b/src/mame/audio/depthch.c
index 8e243ac975a..ba319581dca 100644
--- a/src/mame/audio/depthch.c
+++ b/src/mame/audio/depthch.c
@@ -55,7 +55,7 @@ enum
WRITE8_HANDLER( depthch_audio_w )
{
static int port1State = 0;
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
diff --git a/src/mame/audio/gorf.c b/src/mame/audio/gorf.c
index 5dc80d19aad..584cea59eb8 100644
--- a/src/mame/audio/gorf.c
+++ b/src/mame/audio/gorf.c
@@ -114,8 +114,8 @@ READ8_HANDLER( gorf_speech_r )
{
UINT8 data = offset >> 8;
#if USE_FAKE_VOTRAX
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- samples_device *samples = space->machine().device<samples_device>("samples");
+ astrocde_state *state = space.machine().driver_data<astrocde_state>();
+ samples_device *samples = space.machine().device<samples_device>("samples");
int Phoneme, Intonation;
int i = 0;
offset &= 0xff;
@@ -172,9 +172,9 @@ READ8_HANDLER( gorf_speech_r )
}
}
#else
- votrax_sc01_device *votrax = space->machine().device<votrax_sc01_device>("votrax");
- votrax->inflection_w(*space, 0, data >> 6);
- votrax->write(*space, 0, data);
+ votrax_sc01_device *votrax = space.machine().device<votrax_sc01_device>("votrax");
+ votrax->inflection_w(space, 0, data >> 6);
+ votrax->write(space, 0, data);
#endif
/* Note : We should really also use volume in this as well as frequency */
diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c
index fb7ea82ce31..e73c0bc309f 100644
--- a/src/mame/audio/invinco.c
+++ b/src/mame/audio/invinco.c
@@ -65,7 +65,7 @@ enum
WRITE8_HANDLER( invinco_audio_w )
{
static int port2State = 0;
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
@@ -108,6 +108,6 @@ WRITE8_HANDLER( invinco_audio_w )
}
#if 0
- logerror("Went LO: %02X %04X\n", bitsGoneLow, space->device().safe_pc());
+ logerror("Went LO: %02X %04X\n", bitsGoneLow, space.device().safe_pc());
#endif
}
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index 0edf0d3a374..3a1bd93021b 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -63,11 +63,11 @@ static DEVICE_START( irem_audio )
WRITE8_HANDLER( irem_sound_cmd_w )
{
- driver_device *drvstate = space->machine().driver_data<driver_device>();
+ driver_device *drvstate = space.machine().driver_data<driver_device>();
if ((data & 0x80) == 0)
- drvstate->soundlatch_byte_w(*space, 0, data & 0x7f);
+ drvstate->soundlatch_byte_w(space, 0, data & 0x7f);
else
- space->machine().device("iremsound")->execute().set_input_line(0, ASSERT_LINE);
+ space.machine().device("iremsound")->execute().set_input_line(0, ASSERT_LINE);
}
@@ -181,7 +181,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_1_porta_w )
static WRITE8_HANDLER( sound_irq_ack_w )
{
- space->machine().device("iremsound")->execute().set_input_line(0, CLEAR_LINE);
+ space.machine().device("iremsound")->execute().set_input_line(0, CLEAR_LINE);
}
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index 17fa2036076..301f066da89 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -437,19 +437,19 @@ static SOUND_START( mario )
static SOUND_RESET( mario )
{
mario_state *state = machine.driver_data<mario_state>();
- address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("audiocpu")->memory().space(AS_PROGRAM);
#if USE_8039
set_ea(machine, 1);
#endif
/* FIXME: convert to latch8 */
- state->soundlatch_clear_byte_w(*space, 0, 0);
- state->soundlatch2_clear_byte_w(*space, 0, 0);
- state->soundlatch3_clear_byte_w(*space, 0, 0);
- state->soundlatch4_clear_byte_w(*space, 0, 0);
- state->I8035_P1_W(*space, 0x00); /* Input port */
- I8035_P2_W(*space, 0xff); /* Port is in high impedance state after reset */
+ state->soundlatch_clear_byte_w(space, 0, 0);
+ state->soundlatch2_clear_byte_w(space, 0, 0);
+ state->soundlatch3_clear_byte_w(space, 0, 0);
+ state->soundlatch4_clear_byte_w(space, 0, 0);
+ state->I8035_P1_W(space, 0x00); /* Input port */
+ I8035_P2_W(space, 0xff); /* Port is in high impedance state after reset */
state->m_last = 0;
}
diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c
index 29c20efa386..9c1df99c82a 100644
--- a/src/mame/audio/namco52.c
+++ b/src/mame/audio/namco52.c
@@ -78,50 +78,50 @@ static TIMER_CALLBACK( namco_52xx_latch_callback )
static READ8_HANDLER( namco_52xx_K_r )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
return state->m_latched_cmd & 0x0f;
}
static READ8_HANDLER( namco_52xx_SI_r )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
return state->m_si(0) ? 1 : 0;
}
static READ8_HANDLER( namco_52xx_R0_r )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
return state->m_romread(state->m_address) & 0x0f;
}
static READ8_HANDLER( namco_52xx_R1_r )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
return state->m_romread(state->m_address) >> 4;
}
static WRITE8_HANDLER( namco_52xx_P_w )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
- discrete_sound_w(state->m_discrete, *space, NAMCO_52XX_P_DATA(state->m_basenode), data & 0x0f);
+ namco_52xx_state *state = get_safe_token(space.device().owner());
+ discrete_sound_w(state->m_discrete, space, NAMCO_52XX_P_DATA(state->m_basenode), data & 0x0f);
}
static WRITE8_HANDLER( namco_52xx_R2_w )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
state->m_address = (state->m_address & 0xfff0) | ((data & 0xf) << 0);
}
static WRITE8_HANDLER( namco_52xx_R3_w )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
state->m_address = (state->m_address & 0xff0f) | ((data & 0xf) << 4);
}
static WRITE8_HANDLER( namco_52xx_O_w )
{
- namco_52xx_state *state = get_safe_token(space->device().owner());
+ namco_52xx_state *state = get_safe_token(space.device().owner());
if (data & 0x10)
state->m_address = (state->m_address & 0x0fff) | ((data & 0xf) << 12);
else
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index b0028a5acba..62403340043 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -77,33 +77,33 @@ static TIMER_CALLBACK( namco_54xx_latch_callback )
static READ8_HANDLER( namco_54xx_K_r )
{
- namco_54xx_state *state = get_safe_token(space->device().owner());
+ namco_54xx_state *state = get_safe_token(space.device().owner());
return state->m_latched_cmd >> 4;
}
static READ8_HANDLER( namco_54xx_R0_r )
{
- namco_54xx_state *state = get_safe_token(space->device().owner());
+ namco_54xx_state *state = get_safe_token(space.device().owner());
return state->m_latched_cmd & 0x0f;
}
static WRITE8_HANDLER( namco_54xx_O_w )
{
- namco_54xx_state *state = get_safe_token(space->device().owner());
+ namco_54xx_state *state = get_safe_token(space.device().owner());
UINT8 out = (data & 0x0f);
if (data & 0x10)
- discrete_sound_w(state->m_discrete, *space, 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, *space, 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 )
{
- namco_54xx_state *state = get_safe_token(space->device().owner());
+ namco_54xx_state *state = get_safe_token(space.device().owner());
UINT8 out = (data & 0x0f);
- discrete_sound_w(state->m_discrete, *space, 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/pulsar.c b/src/mame/audio/pulsar.c
index c9caf1ac089..0703a6003ec 100644
--- a/src/mame/audio/pulsar.c
+++ b/src/mame/audio/pulsar.c
@@ -87,7 +87,7 @@ static int port1State = 0;
WRITE8_HANDLER( pulsar_audio_1_w )
{
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
@@ -138,7 +138,7 @@ WRITE8_HANDLER( pulsar_audio_1_w )
WRITE8_HANDLER( pulsar_audio_2_w )
{
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
static int port2State = 0;
int bitsChanged;
int bitsGoneHigh;
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index dda832a1d43..9f11923d629 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -104,12 +104,12 @@ static UINT8 decrypt_opcode(int a,int src)
void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length)
{
- address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
UINT8 *rom = machine.root_device().memregion(cpu)->base();
int i;
- space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
+ space.set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
for (i = 0;i < length;i++)
{
@@ -296,7 +296,7 @@ static void update_irq_lines(running_machine &machine, int param)
WRITE8_HANDLER( seibu_irq_clear_w )
{
/* Denjin Makai and SD Gundam doesn't like this, it's tied to the rst18 ack ONLY so it could be related to it. */
- //update_irq_lines(space->machine(), VECTOR_INIT);
+ //update_irq_lines(space.machine(), VECTOR_INIT);
}
WRITE8_HANDLER( seibu_rst10_ack_w )
@@ -306,7 +306,7 @@ WRITE8_HANDLER( seibu_rst10_ack_w )
WRITE8_HANDLER( seibu_rst18_ack_w )
{
- update_irq_lines(space->machine(), RST18_CLEAR);
+ update_irq_lines(space.machine(), RST18_CLEAR);
}
void seibu_ym3812_irqhandler(device_t *device, int linestate)
@@ -349,13 +349,13 @@ static int main2sub_pending,sub2main_pending;
WRITE8_HANDLER( seibu_bank_w )
{
- space->machine().root_device().membank("bank1")->set_entry(data & 1);
+ space.machine().root_device().membank("bank1")->set_entry(data & 1);
}
WRITE8_HANDLER( seibu_coin_w )
{
- coin_counter_w(space->machine(), 0,data & 1);
- coin_counter_w(space->machine(), 1,data & 2);
+ coin_counter_w(space.machine(), 0,data & 1);
+ coin_counter_w(space.machine(), 1,data & 2);
}
READ8_HANDLER( seibu_soundlatch_r )
@@ -382,7 +382,7 @@ static WRITE8_HANDLER( seibu_pending_w )
READ16_HANDLER( seibu_main_word_r )
{
- //logerror("%06x: seibu_main_word_r(%x)\n",space->device().safe_pc(),offset);
+ //logerror("%06x: seibu_main_word_r(%x)\n",space.device().safe_pc(),offset);
switch (offset)
{
case 2:
@@ -391,14 +391,14 @@ READ16_HANDLER( seibu_main_word_r )
case 5:
return main2sub_pending ? 1 : 0;
default:
- //logerror("%06x: seibu_main_word_r(%x)\n",space->device().safe_pc(),offset);
+ //logerror("%06x: seibu_main_word_r(%x)\n",space.device().safe_pc(),offset);
return 0xffff;
}
}
WRITE16_HANDLER( seibu_main_word_w )
{
- //printf("%06x: seibu_main_word_w(%x,%02x)\n",space->device().safe_pc(),offset,data);
+ //printf("%06x: seibu_main_word_w(%x,%02x)\n",space.device().safe_pc(),offset,data);
if (ACCESSING_BITS_0_7)
{
switch (offset)
@@ -408,7 +408,7 @@ WRITE16_HANDLER( seibu_main_word_w )
main2sub[offset] = data;
break;
case 4:
- update_irq_lines(space->machine(), RST18_ASSERT);
+ update_irq_lines(space.machine(), RST18_ASSERT);
break;
case 2: //Sengoku Mahjong writes here
case 6:
@@ -417,7 +417,7 @@ WRITE16_HANDLER( seibu_main_word_w )
main2sub_pending = 1;
break;
default:
- //logerror("%06x: seibu_main_word_w(%x,%02x)\n",space->device().safe_pc(),offset,data);
+ //logerror("%06x: seibu_main_word_w(%x,%02x)\n",space.device().safe_pc(),offset,data);
break;
}
}
@@ -440,7 +440,7 @@ WRITE16_HANDLER( seibu_main_mustb_w )
// logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]);
- update_irq_lines(space->machine(), RST18_ASSERT);
+ update_irq_lines(space.machine(), RST18_ASSERT);
}
/***************************************************************************/
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index 79d2b3102aa..e58dc3b61d6 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -1125,7 +1125,7 @@ READ8_DEVICE_HANDLER( spc_io_r )
case 0x5: /* Port 1 */
case 0x6: /* Port 2 */
case 0x7: /* Port 3 */
- // mame_printf_debug("SPC: rd %02x @ %d, PC=%x\n", spc700->port_in[offset - 4], offset - 4, space->device().safe_pc());
+ // mame_printf_debug("SPC: rd %02x @ %d, PC=%x\n", spc700->port_in[offset - 4], offset - 4, space.device().safe_pc());
return spc700->port_in[offset - 4];
case 0x8: //normal RAM, can be read even if the ram disabled flag ($f0 bit 1) is active
case 0x9:
@@ -1194,7 +1194,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
case 0x5: /* Port 1 */
case 0x6: /* Port 2 */
case 0x7: /* Port 3 */
- // mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset & 3, space->device().safe_pc());
+ // mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset & 3, space.device().safe_pc());
spc700->port_out[offset - 4] = data;
device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
break;
diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c
index 464593a0511..755925a14bd 100644
--- a/src/mame/audio/snk6502.c
+++ b/src/mame/audio/snk6502.c
@@ -676,7 +676,7 @@ int snk6502_music0_playing(running_machine &machine)
WRITE8_HANDLER( sasuke_sound_w )
{
- device_t *device = space->machine().device("snk6502");
+ device_t *device = space.machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
samples_device *samples = state->m_samples;
TONE *tone_channels = state->m_tone_channels;
@@ -746,7 +746,7 @@ WRITE8_HANDLER( sasuke_sound_w )
WRITE8_HANDLER( satansat_sound_w )
{
- device_t *device = space->machine().device("snk6502");
+ device_t *device = space.machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
samples_device *samples = state->m_samples;
TONE *tone_channels = state->m_tone_channels;
@@ -813,7 +813,7 @@ WRITE8_HANDLER( satansat_sound_w )
WRITE8_HANDLER( vanguard_sound_w )
{
- device_t *device = space->machine().device("snk6502");
+ device_t *device = space.machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
samples_device *samples = state->m_samples;
TONE *tone_channels = state->m_tone_channels;
@@ -863,7 +863,7 @@ WRITE8_HANDLER( vanguard_sound_w )
}
/* SHOT B */
- sn76477_enable_w(space->machine().device("sn76477.2"), (data & 0x40) ? 0 : 1);
+ sn76477_enable_w(space.machine().device("sn76477.2"), (data & 0x40) ? 0 : 1);
state->m_LastPort1 = data;
break;
@@ -914,7 +914,7 @@ WRITE8_HANDLER( vanguard_sound_w )
WRITE8_HANDLER( fantasy_sound_w )
{
- device_t *device = space->machine().device("snk6502");
+ device_t *device = space.machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->m_tone_channels;
@@ -957,7 +957,7 @@ WRITE8_HANDLER( fantasy_sound_w )
}
/* BOMB */
- discrete_sound_w(space->machine().device("discrete"), *space, FANTASY_BOMB_EN, data & 0x80);
+ discrete_sound_w(space.machine().device("discrete"), space, FANTASY_BOMB_EN, data & 0x80);
state->m_LastPort1 = data;
break;
@@ -1021,8 +1021,8 @@ WRITE8_HANDLER( fantasy_sound_w )
/* select tune in ROM based on sound command byte */
tone_channels[2].base = 0x1000 + ((data & 0x70) << 4);
tone_channels[2].mask = 0xff;
- snk6502_state *state = space->machine().driver_data<snk6502_state>();
- state->snk6502_flipscreen_w(*space, 0, data);
+ snk6502_state *state = space.machine().driver_data<snk6502_state>();
+ state->snk6502_flipscreen_w(space, 0, data);
break;
}
}
@@ -1220,7 +1220,7 @@ WRITE8_HANDLER( vanguard_speech_w )
0x054ce
};
- snk6502_speech_w(space->machine(), data, vanguard_table, 2);
+ snk6502_speech_w(space.machine(), data, vanguard_table, 2);
}
WRITE8_HANDLER( fantasy_speech_w )
@@ -1245,7 +1245,7 @@ WRITE8_HANDLER( fantasy_speech_w )
0
};
- snk6502_speech_w(space->machine(), data, fantasy_table, 0);
+ snk6502_speech_w(space.machine(), data, fantasy_table, 0);
}
diff --git a/src/mame/audio/t5182.c b/src/mame/audio/t5182.c
index 8535b36cde7..0c15894d4f1 100644
--- a/src/mame/audio/t5182.c
+++ b/src/mame/audio/t5182.c
@@ -219,17 +219,17 @@ static TIMER_CALLBACK( setirq_callback )
WRITE8_HANDLER( t5182_sound_irq_w )
{
- space->machine().scheduler().synchronize(FUNC(setirq_callback), CPU_ASSERT);
+ space.machine().scheduler().synchronize(FUNC(setirq_callback), CPU_ASSERT);
}
static WRITE8_HANDLER( t5182_ym2151_irq_ack_w )
{
- space->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ACK);
+ space.machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ACK);
}
static WRITE8_HANDLER( t5182_cpu_irq_ack_w )
{
- space->machine().scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
+ space.machine().scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
}
static void t5182_ym2151_irq_handler(device_t *device, int irq)
diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c
index 5233244e394..3c706bf3861 100644
--- a/src/mame/audio/taito_en.c
+++ b/src/mame/audio/taito_en.c
@@ -64,7 +64,7 @@ static WRITE16_HANDLER( en_68000_share_w )
static WRITE16_HANDLER( en_es5505_bank_w )
{
- UINT32 max_banks_this_game = (space->machine().root_device().memregion("ensoniq.0")->bytes()/0x200000)-1;
+ UINT32 max_banks_this_game = (space.machine().root_device().memregion("ensoniq.0")->bytes()/0x200000)-1;
#if 0
{
@@ -76,13 +76,13 @@ static WRITE16_HANDLER( en_es5505_bank_w )
/* mask out unused bits */
data &= max_banks_this_game;
- es5505_voice_bank_w(space->machine().device("ensoniq"),offset,data<<20);
+ es5505_voice_bank_w(space.machine().device("ensoniq"),offset,data<<20);
}
static WRITE16_HANDLER( en_volume_w )
{
if (ACCESSING_BITS_8_15)
- mb87078_data_w(space->machine().device("mb87078"), data >> 8, offset ^ 1);
+ mb87078_data_w(space.machine().device("mb87078"), data >> 8, offset ^ 1);
}
@@ -94,7 +94,7 @@ static WRITE16_HANDLER( en_volume_w )
static READ16_HANDLER( es5510_dsp_r )
{
-// logerror("%06x: DSP read offset %04x (data is %04x)\n",space->device().safe_pc(),offset,es5510_dsp_ram[offset]);
+// logerror("%06x: DSP read offset %04x (data is %04x)\n",space.device().safe_pc(),offset,es5510_dsp_ram[offset]);
// if (es_tmp) return es5510_dsp_ram[offset];
/*
switch (offset) {
@@ -106,7 +106,7 @@ static READ16_HANDLER( es5510_dsp_r )
*/
// offset<<=1;
-//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space->machine().rand()%0xffff;
+//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space.machine().rand()%0xffff;
switch(offset)
{
@@ -125,10 +125,10 @@ static READ16_HANDLER( es5510_dsp_r )
static WRITE16_HANDLER( es5510_dsp_w )
{
- UINT8 *snd_mem = (UINT8 *)space->machine().root_device().memregion("ensoniq.0")->base();
+ UINT8 *snd_mem = (UINT8 *)space.machine().root_device().memregion("ensoniq.0")->base();
// if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0)
-// logerror("%06x: DSP write offset %04x %04x\n",space->device().safe_pc(),offset,data);
+// logerror("%06x: DSP write offset %04x %04x\n",space.device().safe_pc(),offset,data);
COMBINE_DATA(&es5510_dsp_ram[offset]);
diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c
index 6581a89f8d5..cbebae68734 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -109,7 +109,7 @@ WRITE8_DEVICE_HANDLER( tc0140syt_comm_w )
break;
case 0x04: // port status
- //logerror("taitosnd: Master issued control value %02x (PC = %08x) \n",data, space->device().safe_pc() );
+ //logerror("taitosnd: Master issued control value %02x (PC = %08x) \n",data, space.device().safe_pc() );
/* this does a hi-lo transition to reset the sound cpu */
if (data)
tc0140syt->slavecpu->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
@@ -240,7 +240,7 @@ READ8_DEVICE_HANDLER( tc0140syt_slave_comm_r )
break;
case 0x01: // mode #1
- //logerror("taitosnd: Slave cpu receives 0/1 : %01x%01x PC=%4x\n", tc0140syt->slavedata[1] , tc0140syt->slavedata[0],space->device().safe_pc());
+ //logerror("taitosnd: Slave cpu receives 0/1 : %01x%01x PC=%4x\n", tc0140syt->slavedata[1] , tc0140syt->slavedata[0],space.device().safe_pc());
tc0140syt->status &= ~TC0140SYT_PORT01_FULL;
res = tc0140syt->slavedata[tc0140syt->submode ++];
break;
diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c
index 13039ca0853..216dcc165b4 100644
--- a/src/mame/audio/targ.c
+++ b/src/mame/audio/targ.c
@@ -61,11 +61,11 @@ static void adjust_sample(samples_device *samples, UINT8 freq)
WRITE8_HANDLER( targ_audio_1_w )
{
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
/* CPU music */
if ((data & 0x01) != (port_1_last & 0x01))
- space->machine().device<dac_device>("dac")->write_unsigned8((data & 0x01) * 0xff);
+ space.machine().device<dac_device>("dac")->write_unsigned8((data & 0x01) * 0xff);
/* shot */
if (FALLING_EDGE(0x02) && !samples->playing(0)) samples->start(0,1);
@@ -114,8 +114,8 @@ WRITE8_HANDLER( targ_audio_2_w )
{
if ((data & 0x01) && !(port_2_last & 0x01))
{
- samples_device *samples = space->machine().device<samples_device>("samples");
- UINT8 *prom = space->machine().root_device().memregion("targ")->base();
+ samples_device *samples = space.machine().device<samples_device>("samples");
+ UINT8 *prom = space.machine().root_device().memregion("targ")->base();
tone_pointer = (tone_pointer + 1) & 0x0f;
@@ -128,7 +128,7 @@ WRITE8_HANDLER( targ_audio_2_w )
WRITE8_HANDLER( spectar_audio_2_w )
{
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
adjust_sample(samples, data);
}
diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c
index ea1ae862ca7..929f51fa13e 100644
--- a/src/mame/audio/timeplt.c
+++ b/src/mame/audio/timeplt.c
@@ -144,7 +144,7 @@ static WRITE8_DEVICE_HANDLER( timeplt_filter_w )
WRITE8_HANDLER( timeplt_sh_irqtrigger_w )
{
- device_t *audio = space->machine().device("timeplt_audio");
+ device_t *audio = space.machine().device("timeplt_audio");
timeplt_audio_state *state = get_safe_token(audio);
if (state->m_last_irq_state == 0 && data)
diff --git a/src/mame/audio/trackfld.c b/src/mame/audio/trackfld.c
index f3a3683fa49..18cbaae6048 100644
--- a/src/mame/audio/trackfld.c
+++ b/src/mame/audio/trackfld.c
@@ -71,7 +71,7 @@ static DEVICE_RESET( trackfld_audio )
READ8_HANDLER( trackfld_sh_timer_r )
{
- UINT32 clock = space->machine().device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE;
+ UINT32 clock = space.machine().device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE;
return clock & 0xF;
}
@@ -104,7 +104,7 @@ WRITE8_DEVICE_HANDLER( trackfld_sound_w )
READ8_HANDLER( hyperspt_sh_timer_r )
{
- device_t *audio = space->machine().device("trackfld_audio");
+ device_t *audio = space.machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
UINT32 clock = state->m_audiocpu->total_cycles() / TIMER_RATE;
@@ -142,7 +142,7 @@ WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
WRITE8_HANDLER( konami_sh_irqtrigger_w )
{
- device_t *audio = space->machine().device("trackfld_audio");
+ device_t *audio = space.machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
if (state->m_last_irq == 0 && data)
{
diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c
index 8b2279fa5f5..0baabb427f1 100644
--- a/src/mame/audio/turbo.c
+++ b/src/mame/audio/turbo.c
@@ -112,7 +112,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
#else
if (((data ^ state->m_last_sound_a) & 0x1e) && (state->m_last_sound_a & 0x1e) != 0x1e)
- space->machine().scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
+ space.machine().scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
else
update_sound_a(data);
diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c
index 162a3bc787e..9b4129816cb 100644
--- a/src/mame/audio/vicdual.c
+++ b/src/mame/audio/vicdual.c
@@ -144,19 +144,19 @@ MACHINE_START_MEMBER(vicdual_state,frogs_audio)
WRITE8_HANDLER( frogs_audio_w )
{
- samples_device *samples = space->machine().device<samples_device>("samples");
- device_t *discrete = space->machine().device("discrete");
+ samples_device *samples = space.machine().device<samples_device>("samples");
+ device_t *discrete = space.machine().device("discrete");
static int last_croak = 0;
static int last_buzzz = 0;
int new_croak = data & 0x08;
int new_buzzz = data & 0x10;
-// 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);
+// 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
@@ -461,31 +461,31 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( headon_audio_w )
{
- device_t *discrete = space->machine().device("discrete");
+ device_t *discrete = space.machine().device("discrete");
if (discrete == NULL)
return;
- 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);
+ 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);
}
WRITE8_HANDLER( invho2_audio_w )
{
- device_t *discrete = space->machine().device("discrete");
+ device_t *discrete = space.machine().device("discrete");
if (discrete == NULL)
return;
- 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);
+ 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/wow.c b/src/mame/audio/wow.c
index 415998f49a4..7d0355b9cf4 100644
--- a/src/mame/audio/wow.c
+++ b/src/mame/audio/wow.c
@@ -105,8 +105,8 @@ READ8_HANDLER( wow_speech_r )
{
UINT8 data = offset >> 8;
#if USE_FAKE_VOTRAX
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
- samples_device *samples = space->machine().device<samples_device>("samples");
+ astrocde_state *state = space.machine().driver_data<astrocde_state>();
+ samples_device *samples = space.machine().device<samples_device>("samples");
int Phoneme/*, Intonation*/;
int i = 0;
offset &= 0xff;
@@ -166,9 +166,9 @@ READ8_HANDLER( wow_speech_r )
}
}
#else
- votrax_sc01_device *votrax = space->machine().device<votrax_sc01_device>("votrax");
- votrax->inflection_w(*space, 0, data >> 6);
- votrax->write(*space, 0, data);
+ votrax_sc01_device *votrax = space.machine().device<votrax_sc01_device>("votrax");
+ votrax->inflection_w(space, 0, data >> 6);
+ votrax->write(space, 0, data);
#endif
/* Note : We should really also use volume in this as well as frequency */
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index 994b6e2f1ed..8f07a266ef3 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -97,7 +97,7 @@ static void pxa255_set_irq_line(running_machine& machine, UINT32 line, int state
-static void pxa255_lcd_load_dma_descriptor(address_space* space, UINT32 address, int channel);
+static void pxa255_lcd_load_dma_descriptor(address_space & space, UINT32 address, int channel);
static void pxa255_lcd_irq_check(running_machine& machine);
static void pxa255_lcd_dma_kickoff(running_machine& machine, int channel);
static void pxa255_lcd_check_load_next_branch(running_machine& machine, int channel);
@@ -278,11 +278,11 @@ static void pxa255_dma_load_descriptor_and_start(running_machine& machine, int c
// Load the next descriptor
- address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
- dma_regs->dsadr[channel] = space->read_dword(dma_regs->ddadr[channel] + 0x4);
- dma_regs->dtadr[channel] = space->read_dword(dma_regs->ddadr[channel] + 0x8);
- dma_regs->dcmd[channel] = space->read_dword(dma_regs->ddadr[channel] + 0xc);
- dma_regs->ddadr[channel] = space->read_dword(dma_regs->ddadr[channel]);
+ address_space &space = *machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ dma_regs->dsadr[channel] = space.read_dword(dma_regs->ddadr[channel] + 0x4);
+ dma_regs->dtadr[channel] = space.read_dword(dma_regs->ddadr[channel] + 0x8);
+ dma_regs->dcmd[channel] = space.read_dword(dma_regs->ddadr[channel] + 0xc);
+ dma_regs->ddadr[channel] = space.read_dword(dma_regs->ddadr[channel]);
// Start our end-of-transfer timer
switch(channel)
@@ -318,13 +318,13 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
UINT16 temp16;
UINT32 temp32;
- address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space &space = *machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
switch(param)
{
case 3:
for(index = 0; index < count; index += 4)
{
- state->m_words[index >> 2] = space->read_dword(sadr);
+ state->m_words[index >> 2] = space.read_dword(sadr);
state->m_samples[(index >> 1) + 0] = (INT16)(state->m_words[index >> 2] >> 16);
state->m_samples[(index >> 1) + 1] = (INT16)(state->m_words[index >> 2] & 0xffff);
sadr += 4;
@@ -337,18 +337,18 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
switch(dma_regs->dcmd[param] & PXA255_DCMD_SIZE)
{
case PXA255_DCMD_SIZE_8:
- temp8 = space->read_byte(sadr);
- space->write_byte(tadr, temp8);
+ temp8 = space.read_byte(sadr);
+ space.write_byte(tadr, temp8);
index++;
break;
case PXA255_DCMD_SIZE_16:
- temp16 = space->read_word(sadr);
- space->write_word(tadr, temp16);
+ temp16 = space.read_word(sadr);
+ space.write_word(tadr, temp16);
index += 2;
break;
case PXA255_DCMD_SIZE_32:
- temp32 = space->read_dword(sadr);
- space->write_dword(tadr, temp32);
+ temp32 = space.read_dword(sadr);
+ space.write_dword(tadr, temp32);
index += 4;
break;
default:
@@ -1058,20 +1058,20 @@ WRITE32_MEMBER(_39in1_state::pxa255_gpio_w)
*/
-static void pxa255_lcd_load_dma_descriptor(address_space* space, UINT32 address, int channel)
+static void pxa255_lcd_load_dma_descriptor(address_space & space, UINT32 address, int channel)
{
- _39in1_state *state = space->machine().driver_data<_39in1_state>();
+ _39in1_state *state = space.machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->m_lcd_regs;
- lcd_regs->dma[channel].fdadr = space->read_dword(address);
- lcd_regs->dma[channel].fsadr = space->read_dword(address + 0x04);
- lcd_regs->dma[channel].fidr = space->read_dword(address + 0x08);
- lcd_regs->dma[channel].ldcmd = space->read_dword(address + 0x0c);
- verboselog( space->machine(), 4, "pxa255_lcd_load_dma_descriptor, address = %08x, channel = %d\n", address, channel);
- verboselog( space->machine(), 4, " DMA Frame Descriptor: %08x\n", lcd_regs->dma[channel].fdadr );
- verboselog( space->machine(), 4, " DMA Frame Source Address: %08x\n", lcd_regs->dma[channel].fsadr );
- verboselog( space->machine(), 4, " DMA Frame ID: %08x\n", lcd_regs->dma[channel].fidr );
- verboselog( space->machine(), 4, " DMA Command: %08x\n", lcd_regs->dma[channel].ldcmd );
+ lcd_regs->dma[channel].fdadr = space.read_dword(address);
+ lcd_regs->dma[channel].fsadr = space.read_dword(address + 0x04);
+ lcd_regs->dma[channel].fidr = space.read_dword(address + 0x08);
+ lcd_regs->dma[channel].ldcmd = space.read_dword(address + 0x0c);
+ verboselog( space.machine(), 4, "pxa255_lcd_load_dma_descriptor, address = %08x, channel = %d\n", address, channel);
+ verboselog( space.machine(), 4, " DMA Frame Descriptor: %08x\n", lcd_regs->dma[channel].fdadr );
+ verboselog( space.machine(), 4, " DMA Frame Source Address: %08x\n", lcd_regs->dma[channel].fsadr );
+ verboselog( space.machine(), 4, " DMA Frame ID: %08x\n", lcd_regs->dma[channel].fidr );
+ verboselog( space.machine(), 4, " DMA Command: %08x\n", lcd_regs->dma[channel].ldcmd );
}
static void pxa255_lcd_irq_check(running_machine& machine)
@@ -1111,24 +1111,24 @@ static void pxa255_lcd_dma_kickoff(running_machine& machine, int channel)
if(lcd_regs->dma[channel].ldcmd & PXA255_LDCMD_PAL)
{
- address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space &space = *machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
int length = lcd_regs->dma[channel].ldcmd & 0x000fffff;
int index = 0;
for(index = 0; index < length; index += 2)
{
- UINT16 color = space->read_word((lcd_regs->dma[channel].fsadr &~ 1) + index);
+ UINT16 color = space.read_word((lcd_regs->dma[channel].fsadr &~ 1) + index);
state->m_pxa255_lcd_palette[index >> 1] = (((((color >> 11) & 0x1f) << 3) | (color >> 13)) << 16) | (((((color >> 5) & 0x3f) << 2) | ((color >> 9) & 0x3)) << 8) | (((color & 0x1f) << 3) | ((color >> 2) & 0x7));
palette_set_color_rgb(machine, index >> 1, (((color >> 11) & 0x1f) << 3) | (color >> 13), (((color >> 5) & 0x3f) << 2) | ((color >> 9) & 0x3), ((color & 0x1f) << 3) | ((color >> 2) & 0x7));
}
}
else
{
- address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space &space = *machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
int length = lcd_regs->dma[channel].ldcmd & 0x000fffff;
int index = 0;
for(index = 0; index < length; index++)
{
- state->m_pxa255_lcd_framebuffer[index] = space->read_byte(lcd_regs->dma[channel].fsadr + index);
+ state->m_pxa255_lcd_framebuffer[index] = space.read_byte(lcd_regs->dma[channel].fsadr + index);
}
}
}
@@ -1143,11 +1143,11 @@ static void pxa255_lcd_check_load_next_branch(running_machine& machine, int chan
{
verboselog( machine, 4, "pxa255_lcd_check_load_next_branch: Taking branch\n" );
lcd_regs->fbr[channel] &= ~1;
- address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
- //lcd_regs->fbr[channel] = (space->read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003);
+ address_space &space = *machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ //lcd_regs->fbr[channel] = (space.read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003);
//printf( "%08x\n", lcd_regs->fbr[channel] );
pxa255_lcd_load_dma_descriptor(space, lcd_regs->fbr[channel] & 0xfffffff0, 0);
- lcd_regs->fbr[channel] = (space->read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003);
+ lcd_regs->fbr[channel] = (space.read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003);
pxa255_lcd_dma_kickoff(machine, 0);
if(lcd_regs->fbr[channel] & 2)
{
@@ -1308,7 +1308,7 @@ WRITE32_MEMBER(_39in1_state::pxa255_lcd_w)
verboselog( machine(), 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", data, mem_mask );
if(!lcd_regs->dma[0].eof->enabled())
{
- pxa255_lcd_load_dma_descriptor(&space, data & 0xfffffff0, 0);
+ pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 0);
}
else
{
@@ -1329,7 +1329,7 @@ WRITE32_MEMBER(_39in1_state::pxa255_lcd_w)
verboselog( machine(), 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", data, mem_mask );
if(!lcd_regs->dma[1].eof->enabled())
{
- pxa255_lcd_load_dma_descriptor(&space, data & 0xfffffff0, 1);
+ pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 1);
}
else
{
@@ -1464,8 +1464,8 @@ DRIVER_INIT_MEMBER(_39in1_state,39in1)
m_dmadac[1] = machine().device<dmadac_sound_device>("dac2");
m_eeprom = machine().device<eeprom_device>("eeprom");
- address_space *space = machine().device<pxa255_device>("maincpu")->space(AS_PROGRAM);
- space->install_read_handler (0xa0151648, 0xa015164b, read32_delegate(FUNC(_39in1_state::prot_cheater_r), this));
+ address_space &space = *machine().device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ space.install_read_handler (0xa0151648, 0xa015164b, read32_delegate(FUNC(_39in1_state::prot_cheater_r), this));
}
static ADDRESS_MAP_START( 39in1_map, AS_PROGRAM, 32, _39in1_state )
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 66e8acab5b0..14f78825e2e 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -188,7 +188,7 @@ static WRITE32_HANDLER( aleck_dips_w )
break;
default:
- logerror("Unknown aleck_dips_w(0x%08x, 0x%08x, %08x) @ 0x%08x PC=%08x\n", offset, data, mem_mask, 0xc0800000 + offset*4, space->device().safe_pc());
+ logerror("Unknown aleck_dips_w(0x%08x, 0x%08x, %08x) @ 0x%08x PC=%08x\n", offset, data, mem_mask, 0xc0800000 + offset*4, space.device().safe_pc());
}
}
@@ -199,12 +199,12 @@ static READ32_HANDLER( aleck_dips_r )
switch( offset )
{
case 0:
- return (space->machine().root_device().ioport("IN0")->read()); /* mtetrisc has regular inputs here */
+ return (space.machine().root_device().ioport("IN0")->read()); /* mtetrisc has regular inputs here */
case 1:
- return (space->machine().root_device().ioport("IN1")->read());
+ return (space.machine().root_device().ioport("IN1")->read());
case 2:
{
- UINT32 val = space->machine().root_device().ioport("INMJ")->read();
+ UINT32 val = space.machine().root_device().ioport("INMJ")->read();
switch( dip_read_offset >> 8 & 0xff )
{
@@ -227,7 +227,7 @@ static READ32_HANDLER( aleck_dips_r )
}
default:
{
- logerror("Unknown aleck_dips_r(0x%08x, 0x%08x) @ 0x%08x PC=%08x\n", offset, 0xc0800000 + offset*4, mem_mask, space->device().safe_pc());
+ logerror("Unknown aleck_dips_r(0x%08x, 0x%08x) @ 0x%08x PC=%08x\n", offset, 0xc0800000 + offset*4, mem_mask, space.device().safe_pc());
return 0;
}
}
diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c
index a24952b099d..5aeb41b0982 100644
--- a/src/mame/drivers/appoooh.c
+++ b/src/mame/drivers/appoooh.c
@@ -613,8 +613,8 @@ DRIVER_INIT_MEMBER(appoooh_state,robowres)
DRIVER_INIT_MEMBER(appoooh_state,robowresb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x1c000);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x1c000);
}
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index 1af554f2472..59f6b417e01 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -209,7 +209,7 @@ READ32_MEMBER(aristmk5_state::mk5_ioc_r)
return (m_flyback) | (ioc_regs[CONTROL] & 0x7c) | (1<<1) | 1;
}
- return archimedes_ioc_r(&space,offset,mem_mask);
+ return archimedes_ioc_r(space,offset,mem_mask);
}
WRITE32_MEMBER(aristmk5_state::mk5_ioc_w)
@@ -228,7 +228,7 @@ WRITE32_MEMBER(aristmk5_state::mk5_ioc_w)
return;
}
else
- archimedes_ioc_w(&space,offset,data,mem_mask);
+ archimedes_ioc_w(space,offset,data,mem_mask);
}
}
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index bbc27cc8f5c..6d69a25fb7f 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -317,7 +317,7 @@ WRITE16_MEMBER(armedf_state::terraf_io_w)
{
if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition
- nb_1414m4_exec(&space,(m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram,m_fg_scrollx,m_fg_scrolly,m_tx_tilemap);
+ nb_1414m4_exec(space,(m_text_videoram[0] << 8) | (m_text_videoram[1] & 0xff),m_text_videoram,m_fg_scrollx,m_fg_scrolly,m_tx_tilemap);
COMBINE_DATA(&m_vreg);
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index f291cc0b532..074995f8b10 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -455,9 +455,9 @@ WRITE8_MEMBER(astrocde_state::profpac_banksw_w)
static void profbank_banksw_restore(running_machine &machine)
{
astrocde_state *state = machine.driver_data<astrocde_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_IO);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_IO);
- state->profpac_banksw_w(*space, 0, state->m_profpac_bank);
+ state->profpac_banksw_w(space, 0, state->m_profpac_bank);
}
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index db0bda7a4f9..d4c724cf22e 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -192,7 +192,7 @@ WRITE16_MEMBER(astrocorp_state::astrocorp_sound_bank_w)
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * ((data >> 8) & 1));
-// logerror("CPU #0 PC %06X: OKI bank %08X\n", space->device().safe_pc(), data);
+// logerror("CPU #0 PC %06X: OKI bank %08X\n", space.device().safe_pc(), data);
}
}
@@ -203,7 +203,7 @@ WRITE16_MEMBER(astrocorp_state::skilldrp_sound_bank_w)
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 1));
-// logerror("CPU #0 PC %06X: OKI bank %08X\n", space->device().safe_pc(), data);
+// logerror("CPU #0 PC %06X: OKI bank %08X\n", space.device().safe_pc(), data);
}
}
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index 6855d359f83..f2b70528324 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -80,7 +80,7 @@ MACHINE_RESET_MEMBER(atarigt_state,atarigt)
static void cage_irq_callback(running_machine &machine, int reason)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (reason)
atarigen_sound_int_gen(machine.device("maincpu"));
@@ -201,7 +201,7 @@ WRITE32_MEMBER(atarigt_state::latch_w)
if (ACCESSING_BITS_16_23)
{
- //cage_reset_w(&space, data & 0x00100000);
+ //cage_reset_w(space, data & 0x00100000);
coin_counter_w(machine(), 0, data & 0x00080000);
coin_counter_w(machine(), 1, data & 0x00010000);
}
@@ -236,7 +236,7 @@ READ32_MEMBER(atarigt_state::sound_data_r)
if (ACCESSING_BITS_0_15)
result |= cage_control_r(machine());
if (ACCESSING_BITS_16_31)
- result |= cage_main_r(&space) << 16;
+ result |= cage_main_r(space) << 16;
return result;
}
@@ -246,7 +246,7 @@ WRITE32_MEMBER(atarigt_state::sound_data_w)
if (ACCESSING_BITS_0_15)
cage_control_w(machine(), data);
if (ACCESSING_BITS_16_31)
- cage_main_w(&space, data >> 16);
+ cage_main_w(space, data >> 16);
}
@@ -271,9 +271,9 @@ static void tmek_update_mode(atarigt_state *state, offs_t offset)
}
-static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
+static void tmek_protection_w(address_space &space, offs_t offset, UINT16 data)
{
- atarigt_state *state = space->machine().driver_data<atarigt_state>();
+ atarigt_state *state = space.machine().driver_data<atarigt_state>();
/*
T-Mek init:
($387C0) = $0001
@@ -282,7 +282,7 @@ static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
Read ($38488)
*/
- if (LOG_PROTECTION) logerror("%06X:Protection W@%06X = %04X\n", space->device().safe_pcbase(), offset, data);
+ if (LOG_PROTECTION) logerror("%06X:Protection W@%06X = %04X\n", space.device().safe_pcbase(), offset, data);
/* track accesses */
tmek_update_mode(state, offset);
@@ -295,10 +295,10 @@ static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
}
}
-static void tmek_protection_r(address_space *space, offs_t offset, UINT16 *data)
+static void tmek_protection_r(address_space &space, offs_t offset, UINT16 *data)
{
- atarigt_state *state = space->machine().driver_data<atarigt_state>();
- if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", space->device().safe_pcbase(), offset);
+ atarigt_state *state = space.machine().driver_data<atarigt_state>();
+ if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", space.device().safe_pcbase(), offset);
/* track accesses */
tmek_update_mode(state, offset);
@@ -362,12 +362,12 @@ static void primage_update_mode(atarigt_state *state, offs_t offset)
-static void primrage_protection_w(address_space *space, offs_t offset, UINT16 data)
+static void primrage_protection_w(address_space &space, offs_t offset, UINT16 data)
{
- atarigt_state *state = space->machine().driver_data<atarigt_state>();
+ atarigt_state *state = space.machine().driver_data<atarigt_state>();
if (LOG_PROTECTION)
{
- UINT32 pc = space->device().safe_pcbase();
+ UINT32 pc = space.device().safe_pcbase();
switch (pc)
{
/* protection code from 20f90 - 21000 */
@@ -400,7 +400,7 @@ static void primrage_protection_w(address_space *space, offs_t offset, UINT16 da
/* catch anything else */
default:
- logerror("%06X:Unknown protection W@%06X = %04X\n", space->device().safe_pcbase(), offset, data);
+ logerror("%06X:Unknown protection W@%06X = %04X\n", space.device().safe_pcbase(), offset, data);
break;
}
}
@@ -433,15 +433,15 @@ static void primrage_protection_w(address_space *space, offs_t offset, UINT16 da
-static void primrage_protection_r(address_space *space, offs_t offset, UINT16 *data)
+static void primrage_protection_r(address_space &space, offs_t offset, UINT16 *data)
{
- atarigt_state *state = space->machine().driver_data<atarigt_state>();
+ atarigt_state *state = space.machine().driver_data<atarigt_state>();
/* track accesses */
primage_update_mode(state, offset);
if (LOG_PROTECTION)
{
- UINT32 pc = space->device().safe_pcbase();
+ UINT32 pc = space.device().safe_pcbase();
UINT32 p1, p2, a6;
switch (pc)
{
@@ -461,9 +461,9 @@ if (LOG_PROTECTION)
case 0x275bc:
break;
case 0x275cc:
- a6 = space->device().state().state_int(M68K_A6);
- p1 = (space->read_word(a6+8) << 16) | space->read_word(a6+10);
- p2 = (space->read_word(a6+12) << 16) | space->read_word(a6+14);
+ a6 = space.device().state().state_int(M68K_A6);
+ p1 = (space.read_word(a6+8) << 16) | space.read_word(a6+10);
+ p2 = (space.read_word(a6+12) << 16) | space.read_word(a6+14);
logerror("Known Protection @ 275BC(%08X, %08X): R@%06X ", p1, p2, offset);
break;
case 0x275d2:
@@ -479,8 +479,8 @@ if (LOG_PROTECTION)
/* protection code from 3d8dc - 3d95a */
case 0x3d8f4:
- a6 = space->device().state().state_int(M68K_A6);
- p1 = (space->read_word(a6+12) << 16) | space->read_word(a6+14);
+ a6 = space.device().state().state_int(M68K_A6);
+ p1 = (space.read_word(a6+12) << 16) | space.read_word(a6+14);
logerror("Known Protection @ 3D8F4(%08X): R@%06X ", p1, offset);
break;
case 0x3d8fa:
@@ -490,8 +490,8 @@ if (LOG_PROTECTION)
/* protection code from 437fa - 43860 */
case 0x43814:
- a6 = space->device().state().state_int(M68K_A6);
- p1 = space->read_dword(a6+14) & 0xffffff;
+ a6 = space.device().state().state_int(M68K_A6);
+ p1 = space.read_dword(a6+14) & 0xffffff;
logerror("Known Protection @ 43814(%08X): R@%06X ", p1, offset);
break;
case 0x4381c:
@@ -504,7 +504,7 @@ if (LOG_PROTECTION)
/* catch anything else */
default:
- logerror("%06X:Unknown protection R@%06X\n", space->device().safe_pcbase(), offset);
+ logerror("%06X:Unknown protection R@%06X\n", space.device().safe_pcbase(), offset);
break;
}
}
@@ -557,13 +557,13 @@ READ32_MEMBER(atarigt_state::colorram_protection_r)
if (ACCESSING_BITS_16_31)
{
result = atarigt_colorram_r(address);
- (*m_protection_r)(&space, address, &result);
+ (*m_protection_r)(space, address, &result);
result32 |= result << 16;
}
if (ACCESSING_BITS_0_15)
{
result = atarigt_colorram_r(address + 2);
- (*m_protection_r)(&space, address + 2, &result);
+ (*m_protection_r)(space, address + 2, &result);
result32 |= result;
}
@@ -579,13 +579,13 @@ WRITE32_MEMBER(atarigt_state::colorram_protection_w)
{
if (!m_ignore_writes)
atarigt_colorram_w(address, data >> 16, mem_mask >> 16);
- (*m_protection_w)(&space, address, data >> 16);
+ (*m_protection_w)(space, address, data >> 16);
}
if (ACCESSING_BITS_0_15)
{
if (!m_ignore_writes)
atarigt_colorram_w(address + 2, data, mem_mask);
- (*m_protection_w)(&space, address + 2, data);
+ (*m_protection_w)(space, address + 2, data);
}
}
@@ -1257,7 +1257,7 @@ WRITE32_MEMBER(atarigt_state::tmek_pf_w)
if (pc == 0x25834 || pc == 0x25860)
logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)space.device().state().state_int(M68K_A3) - 2);
- atarigen_playfield32_w(&space, offset, data, mem_mask);
+ atarigen_playfield32_w(space, offset, data, mem_mask);
}
DRIVER_INIT_MEMBER(atarigt_state,tmek)
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 03f45563e33..d7e33dadbdb 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -341,11 +341,11 @@ WRITE16_MEMBER(atarisy2_state::bankselect_w)
static void bankselect_postload(running_machine &machine)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
atarisy2_state *state = machine.driver_data<atarisy2_state>();
- state->bankselect_w(*space, 0, state->m_bankselect[0], 0xffff);
- state->bankselect_w(*space, 1, state->m_bankselect[1], 0xffff);
+ state->bankselect_w(space, 0, state->m_bankselect[0], 0xffff);
+ state->bankselect_w(space, 1, state->m_bankselect[1], 0xffff);
}
@@ -725,7 +725,7 @@ READ16_MEMBER(atarisy2_state::sound_r)
atarigen_update_interrupts(machine());
/* handle it normally otherwise */
- return atarigen_sound_r(&space,offset,0xffff);
+ return atarigen_sound_r(space,offset,0xffff);
}
@@ -737,7 +737,7 @@ WRITE8_MEMBER(atarisy2_state::sound_6502_w)
atarigen_update_interrupts(machine());
/* handle it normally otherwise */
- atarigen_6502_sound_w(&space, offset, data);
+ atarigen_6502_sound_w(space, offset, data);
}
@@ -749,7 +749,7 @@ READ8_MEMBER(atarisy2_state::sound_6502_r)
atarigen_update_interrupts(machine());
/* handle it normally otherwise */
- return atarigen_6502_sound_r(&space, offset);
+ return atarigen_6502_sound_r(space, offset);
}
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 4fe2e989c85..353939fecd4 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -804,7 +804,7 @@ INLINE UINT8 hex_to_ascii(UINT8 in)
return in;
}
-void load_ldafile(address_space *space, const UINT8 *file)
+void load_ldafile(address_space &space, const UINT8 *file)
{
#define READ_CHAR() file[i++]
int i = 0;
@@ -847,7 +847,7 @@ void load_ldafile(address_space *space, const UINT8 *file)
{
UINT8 data = READ_CHAR();
sum += data;
- space->write_byte(addr++, data);
+ space.write_byte(addr++, data);
} while (--len);
sum += READ_CHAR();
@@ -858,7 +858,7 @@ void load_ldafile(address_space *space, const UINT8 *file)
}
/* Load memory space with data from a Tektronix-Extended HEX file */
-void load_hexfile(address_space *space, const UINT8 *file)
+void load_hexfile(address_space &space, const UINT8 *file)
{
#define READ_HEX_CHAR() hex_to_ascii(file[i++])
@@ -942,7 +942,7 @@ void load_hexfile(address_space *space, const UINT8 *file)
sum += data & 0xf;
if (record == 6)
- space->write_byte(addr++, data);
+ space.write_byte(addr++, data);
len -= 2;
}
@@ -963,7 +963,7 @@ next_line:
DRIVER_INIT_MEMBER(atarisy4_state,laststar)
{
- address_space *main = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &main = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Allocate 16kB of shared RAM */
m_shared_ram[0] = auto_alloc_array_clear(machine(), UINT16, 0x2000);
@@ -975,7 +975,7 @@ DRIVER_INIT_MEMBER(atarisy4_state,laststar)
/* Set up the DSP */
membank("dsp0_bank0")->set_base(m_shared_ram[0]);
membank("dsp0_bank1")->set_base(&m_shared_ram[0][0x800]);
- load_ldafile(machine().device("dsp0")->memory().space(AS_PROGRAM), memregion("dsp")->base());
+ load_ldafile(*machine().device("dsp0")->memory().space(AS_PROGRAM), memregion("dsp")->base());
}
DRIVER_INIT_MEMBER(atarisy4_state,airrace)
@@ -985,17 +985,17 @@ DRIVER_INIT_MEMBER(atarisy4_state,airrace)
m_shared_ram[1] = auto_alloc_array_clear(machine(), UINT16, 0x4000);
/* Populate RAM with data from the HEX files */
- load_hexfile(machine().device("maincpu")->memory().space(AS_PROGRAM), memregion("code")->base());
+ load_hexfile(*machine().device("maincpu")->memory().space(AS_PROGRAM), memregion("code")->base());
/* Set up the first DSP */
membank("dsp0_bank0")->set_base(m_shared_ram[0]);
membank("dsp0_bank1")->set_base(&m_shared_ram[0][0x800]);
- load_ldafile(machine().device("dsp0")->memory().space(AS_PROGRAM), memregion("dsp")->base());
+ load_ldafile(*machine().device("dsp0")->memory().space(AS_PROGRAM), memregion("dsp")->base());
/* Set up the second DSP */
membank("dsp1_bank0")->set_base(m_shared_ram[1]);
membank("dsp1_bank1")->set_base(&m_shared_ram[1][0x800]);
- load_ldafile(machine().device("dsp1")->memory().space(AS_PROGRAM), memregion("dsp")->base());
+ load_ldafile(*machine().device("dsp1")->memory().space(AS_PROGRAM), memregion("dsp")->base());
}
void atarisy4_state::machine_reset()
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index f78b2bc97c3..23309f483e7 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -139,7 +139,7 @@ void atetris_state::machine_reset()
READ8_MEMBER(atetris_state::atetris_slapstic_r)
{
int result = m_slapstic_base[0x2000 + offset];
- int new_bank = slapstic_tweak(&space, offset) & 1;
+ int new_bank = slapstic_tweak(space, offset) & 1;
/* update for the new bank */
if (new_bank != m_current_bank)
diff --git a/src/mame/drivers/atvtrack.c b/src/mame/drivers/atvtrack.c
index 9e60ee416c1..144907e50b7 100644
--- a/src/mame/drivers/atvtrack.c
+++ b/src/mame/drivers/atvtrack.c
@@ -339,13 +339,11 @@ void atvtrack_state::machine_start()
void atvtrack_state::machine_reset()
{
- address_space *as;
-
// Probably just after reset the cpu executes some bootsrtap routine from a memory inside the fpga.
// The routine initializes the cpu, copies the boot program from the flash memories into the cpu sdram
// and finally executes it.
// Here there is the setup of the cpu, the boot program is copied in machine_start
- as = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &as = *machine().device("maincpu")->memory().space(AS_PROGRAM);
// set cpu PC register to 0x0c7f0000
machine().device("maincpu")->state().set_pc(0x0c7f0000);
// set BCR2 to 1
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index 3ed13d7e18e..5b77846ca52 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -187,7 +187,7 @@ static void update_interrupts(running_machine &machine)
static void scanline_update(screen_device &screen, int scanline)
{
- address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* sound IRQ is on 32V */
if (scanline & 32)
@@ -290,7 +290,7 @@ READ8_MEMBER(badlands_state::audio_io_r)
break;
case 0x002: /* /RDP */
- result = atarigen_6502_sound_r(&space, offset);
+ result = atarigen_6502_sound_r(space, offset);
break;
case 0x004: /* /RDIO */
@@ -312,7 +312,7 @@ READ8_MEMBER(badlands_state::audio_io_r)
break;
case 0x006: /* /IRQACK */
- atarigen_6502_irq_ack_r(&space, 0);
+ atarigen_6502_irq_ack_r(space, 0);
break;
case 0x200: /* /VOICE */
@@ -339,7 +339,7 @@ WRITE8_MEMBER(badlands_state::audio_io_w)
break;
case 0x006: /* /IRQACK */
- atarigen_6502_irq_ack_r(&space, 0);
+ atarigen_6502_irq_ack_r(space, 0);
break;
case 0x200: /* n/c */
@@ -347,7 +347,7 @@ WRITE8_MEMBER(badlands_state::audio_io_w)
break;
case 0x202: /* /WRP */
- atarigen_6502_sound_w(&space, offset, data);
+ atarigen_6502_sound_w(space, offset, data);
break;
case 0x204: /* WRIO */
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index 9286cf2bf7d..39e53042375 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -2163,47 +2163,47 @@ DRIVER_INIT_MEMBER(balsente_state,minigolf2) { expand_roms(machine(), 0x0c);
DRIVER_INIT_MEMBER(balsente_state,toggle) { expand_roms(machine(), EXPAND_ALL); config_shooter_adc(machine(), FALSE, 0 /* noanalog */); }
DRIVER_INIT_MEMBER(balsente_state,nametune)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
expand_roms(machine(), EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 0 /* noanalog */);
}
DRIVER_INIT_MEMBER(balsente_state,nstocker)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
expand_roms(machine(), EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine(), TRUE, 1);
}
DRIVER_INIT_MEMBER(balsente_state,sfootbal)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
expand_roms(machine(), EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 0);
}
DRIVER_INIT_MEMBER(balsente_state,spiker)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_readwrite_handler(0x9f80, 0x9f8f, read8_delegate(FUNC(balsente_state::spiker_expand_r),this), write8_delegate(FUNC(balsente_state::spiker_expand_w),this));
- space->install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_readwrite_handler(0x9f80, 0x9f8f, read8_delegate(FUNC(balsente_state::spiker_expand_r),this), write8_delegate(FUNC(balsente_state::spiker_expand_w),this));
+ space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
expand_roms(machine(), EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 1);
}
DRIVER_INIT_MEMBER(balsente_state,stompin)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_write_handler(0x9f00, 0x9f00, write8_delegate(FUNC(balsente_state::balsente_rombank2_select_w),this));
expand_roms(machine(), 0x0c | SWAP_HALVES); config_shooter_adc(machine(), FALSE, 32);
}
DRIVER_INIT_MEMBER(balsente_state,rescraid) { expand_roms(machine(), EXPAND_NONE); config_shooter_adc(machine(), FALSE, 0 /* noanalog */); }
DRIVER_INIT_MEMBER(balsente_state,grudge)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_handler(0x9400, 0x9400, read8_delegate(FUNC(balsente_state::grudge_steering_r),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_read_handler(0x9400, 0x9400, read8_delegate(FUNC(balsente_state::grudge_steering_r),this));
expand_roms(machine(), EXPAND_NONE); config_shooter_adc(machine(), FALSE, 0);
}
DRIVER_INIT_MEMBER(balsente_state,shrike)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_readwrite_handler(0x9e00, 0x9fff, read8_delegate(FUNC(balsente_state::shrike_shared_6809_r),this), write8_delegate(FUNC(balsente_state::shrike_shared_6809_w),this));
- space->install_write_handler(0x9e01, 0x9e01, write8_delegate(FUNC(balsente_state::shrike_sprite_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_readwrite_handler(0x9e00, 0x9fff, read8_delegate(FUNC(balsente_state::shrike_shared_6809_r),this), write8_delegate(FUNC(balsente_state::shrike_shared_6809_w),this));
+ space.install_write_handler(0x9e01, 0x9e01, write8_delegate(FUNC(balsente_state::shrike_sprite_select_w),this));
machine().device("68k")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x10000, 0x1001f, read16_delegate(FUNC(balsente_state::shrike_io_68k_r),this), write16_delegate(FUNC(balsente_state::shrike_io_68k_w),this));
expand_roms(machine(), EXPAND_ALL); config_shooter_adc(machine(), FALSE, 32);
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 5f25634372a..5e56d8d318e 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -303,14 +303,14 @@ READ32_MEMBER( beathead_state::input_2_r )
READ32_MEMBER( beathead_state::sound_data_r )
{
- return atarigen_sound_r(&space, offset, 0xffff);
+ return atarigen_sound_r(space, offset, 0xffff);
}
WRITE32_MEMBER( beathead_state::sound_data_w )
{
if (ACCESSING_BITS_0_7)
- atarigen_sound_w(&space, offset, data, mem_mask);
+ atarigen_sound_w(space, offset, data, mem_mask);
}
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index a2c2e167283..1886939820e 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -582,10 +582,10 @@ READ8_MEMBER(berzerk_state::berzerk_audio_r)
static SOUND_RESET(berzerk)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_IO);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_IO);
berzerk_state *state = machine.driver_data<berzerk_state>();
/* clears the flip-flop controlling the volume and freq on the speech chip */
- state->berzerk_audio_w(*space, 4, 0x40);
+ state->berzerk_audio_w(space, 4, 0x40);
}
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index b4e2d9b6678..032a3f545bc 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -457,11 +457,11 @@ INLINE UINT8* blitter_get_addr(running_machine &machine, UINT32 addr)
The Flare One blitter is a simpler design with slightly different parameters
and will require hardware tests to figure everything out correctly.
*/
-static void RunBlit(address_space *space)
+static void RunBlit(address_space &space)
{
-#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space->machine(), blitter.program.addr++))
+#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space.machine(), blitter.program.addr++))
- bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
+ bfcobra_state *state = space.machine().driver_data<bfcobra_state>();
struct blitter_t &blitter = state->m_blitter;
int cycles_used = 0;
@@ -571,7 +571,7 @@ static void RunBlit(address_space *space)
blitter.source.addr0 -=blitter.step;
}
- *blitter_get_addr(space->machine(), blitter.dest.addr) = blitter.pattern;
+ *blitter_get_addr(space.machine(), blitter.dest.addr) = blitter.pattern;
cycles_used++;
} while (--innercnt);
@@ -585,7 +585,7 @@ static void RunBlit(address_space *space)
if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
{
- srcdata = *(blitter_get_addr(space->machine(), blitter.source.addr & 0xfffff));
+ srcdata = *(blitter_get_addr(space.machine(), blitter.source.addr & 0xfffff));
blitter.source.loword++;
cycles_used++;
}
@@ -595,7 +595,7 @@ static void RunBlit(address_space *space)
{
if (LOOPTYPE == 0 || LOOPTYPE == 1)
{
- srcdata = *(blitter_get_addr(space->machine(), blitter.source.addr & 0xfffff));
+ srcdata = *(blitter_get_addr(space.machine(), blitter.source.addr & 0xfffff));
cycles_used++;
if (blitter.modectl & MODE_SSIGN)
@@ -610,7 +610,7 @@ static void RunBlit(address_space *space)
/* Read destination pixel? */
if (LOOPTYPE == 0)
{
- dstdata = *blitter_get_addr(space->machine(), blitter.dest.addr & 0xfffff);
+ dstdata = *blitter_get_addr(space.machine(), blitter.dest.addr & 0xfffff);
cycles_used++;
}
@@ -679,10 +679,10 @@ static void RunBlit(address_space *space)
The existing destination pixel is used as a lookup
into the table and the colours is replaced.
*/
- UINT8 dest = *blitter_get_addr(space->machine(), blitter.dest.addr);
- UINT8 newcol = *(blitter_get_addr(space->machine(), (blitter.source.addr + dest) & 0xfffff));
+ UINT8 dest = *blitter_get_addr(space.machine(), blitter.dest.addr);
+ UINT8 newcol = *(blitter_get_addr(space.machine(), (blitter.source.addr + dest) & 0xfffff));
- *blitter_get_addr(space->machine(), blitter.dest.addr) = newcol;
+ *blitter_get_addr(space.machine(), blitter.dest.addr) = newcol;
cycles_used += 3;
}
else
@@ -701,7 +701,7 @@ static void RunBlit(address_space *space)
if (blitter.compfunc & CMPFUNC_LOG0)
final_result |= ~result & ~dstdata;
- *blitter_get_addr(space->machine(), blitter.dest.addr) = final_result;
+ *blitter_get_addr(space.machine(), blitter.dest.addr) = final_result;
cycles_used++;
}
}
@@ -741,7 +741,7 @@ static void RunBlit(address_space *space)
} while (blitter.command & CMD_RUN);
/* Burn Z80 cycles while blitter is in operation */
- space->device().execute().spin_until_time(attotime::from_nsec( (1000000000 / Z80_XTAL)*cycles_used * 2 ) );
+ space.device().execute().spin_until_time(attotime::from_nsec( (1000000000 / Z80_XTAL)*cycles_used * 2 ) );
}
@@ -1008,7 +1008,7 @@ WRITE8_MEMBER(bfcobra_state::chipset_w)
m_blitter.command = data;
if (data & CMD_RUN)
- RunBlit(&space);
+ RunBlit(space);
else
mame_printf_debug("Blitter stopped by IO.\n");
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index 3ed5abed474..0c4f3734f53 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -3694,9 +3694,9 @@ WRITE8_MEMBER(bfm_sc2_state::dmd_reset_w)
MACHINE_START_MEMBER(bfm_sc2_state,sc2dmd)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_handler(0x2800, 0x2800, 0, 0, write8_delegate(FUNC(bfm_sc2_state::vfd1_dmd_w),this));
- space->install_write_handler(0x2900, 0x2900, 0, 0, write8_delegate(FUNC(bfm_sc2_state::dmd_reset_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_write_handler(0x2800, 0x2800, 0, 0, write8_delegate(FUNC(bfm_sc2_state::vfd1_dmd_w),this));
+ space.install_write_handler(0x2900, 0x2900, 0, 0, write8_delegate(FUNC(bfm_sc2_state::dmd_reset_w),this));
}
/* machine driver for scorpion2 board */
diff --git a/src/mame/drivers/bfm_sc4h.c b/src/mame/drivers/bfm_sc4h.c
index 95d131fce80..a8e580067b2 100644
--- a/src/mame/drivers/bfm_sc4h.c
+++ b/src/mame/drivers/bfm_sc4h.c
@@ -344,7 +344,7 @@ WRITE16_MEMBER(sc4_state::sc4_mem_w)
break;
case 0x1330:
- bfm_sc4_reel4_w(&space,0,data&0xf);
+ bfm_sc4_reel4_w(space,0,data&0xf);
//m_meterstatus = (m_meterstatus&0x3f) | ((data & 0x30) << 2);
sec.write_data_line(~data&0x10);
break;
@@ -504,9 +504,9 @@ void bfm_sc4_write_serial_vfd(running_machine &machine, bool cs, bool clock, boo
}
-void bfm_sc4_68307_porta_w(address_space *space, bool dedicated, UINT8 data, UINT8 line_mask)
+void bfm_sc4_68307_porta_w(address_space &space, bool dedicated, UINT8 data, UINT8 line_mask)
{
- sc4_state *state = space->machine().driver_data<sc4_state>();
+ sc4_state *state = space.machine().driver_data<sc4_state>();
state->m_reel12_latch = data;
@@ -524,7 +524,7 @@ void bfm_sc4_68307_porta_w(address_space *space, bool dedicated, UINT8 data, UIN
static WRITE8_HANDLER( bfm_sc4_reel3_w )
{
- sc4_state *state = space->machine().driver_data<sc4_state>();
+ sc4_state *state = space.machine().driver_data<sc4_state>();
state->m_reel3_latch = data;
@@ -538,7 +538,7 @@ static WRITE8_HANDLER( bfm_sc4_reel3_w )
static WRITE8_HANDLER( bfm_sc4_reel4_w )
{
- sc4_state *state = space->machine().driver_data<sc4_state>();
+ sc4_state *state = space.machine().driver_data<sc4_state>();
state->m_reel4_latch = data;
@@ -550,29 +550,29 @@ static WRITE8_HANDLER( bfm_sc4_reel4_w )
awp_draw_reel(3);
}
-void bfm_sc4_68307_portb_w(address_space *space, bool dedicated, UINT16 data, UINT16 line_mask)
+void bfm_sc4_68307_portb_w(address_space &space, bool dedicated, UINT16 data, UINT16 line_mask)
{
// if (dedicated == false)
{
- int pc = space->device().safe_pc();
- //m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
+ int pc = space.device().safe_pc();
+ //m68ki_cpu_core *m68k = m68k_get_safe_token(&space.device());
// serial output to the VFD at least..
logerror("%08x bfm_sc4_68307_portb_w %04x %04x\n", pc, data, line_mask);
- bfm_sc4_write_serial_vfd(space->machine(), (data & 0x4000)?1:0, (data & 0x1000)?1:0, !(data & 0x2000)?1:0);
+ bfm_sc4_write_serial_vfd(space.machine(), (data & 0x4000)?1:0, (data & 0x1000)?1:0, !(data & 0x2000)?1:0);
bfm_sc4_reel3_w(space, 0, (data&0x0f00)>>8);
}
}
-UINT8 bfm_sc4_68307_porta_r(address_space *space, bool dedicated, UINT8 line_mask)
+UINT8 bfm_sc4_68307_porta_r(address_space &space, bool dedicated, UINT8 line_mask)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
logerror("%08x bfm_sc4_68307_porta_r\n", pc);
- return space->machine().rand();
+ return space.machine().rand();
}
-UINT16 bfm_sc4_68307_portb_r(address_space *space, bool dedicated, UINT16 line_mask)
+UINT16 bfm_sc4_68307_portb_r(address_space &space, bool dedicated, UINT16 line_mask)
{
if (dedicated==false)
{
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 3dd318c9e42..38f04ae4500 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -199,9 +199,9 @@ INLINE UINT8 swap_bits_5_6(UINT8 data)
}
-static void btime_decrypt( address_space *space )
+static void btime_decrypt( address_space &space )
{
- btime_state *state = space->machine().driver_data<btime_state>();
+ btime_state *state = space.machine().driver_data<btime_state>();
UINT8 *src, *src1;
int addr, addr1;
@@ -211,11 +211,11 @@ static void btime_decrypt( address_space *space )
/* xxxx xxx1 xxxx x1xx are encrypted. */
/* get the address of the next opcode */
- addr = space->device().safe_pc();
+ addr = space.device().safe_pc();
/* however if the previous instruction was JSR (which caused a write to */
/* the stack), fetch the address of the next instruction. */
- addr1 = space->device().safe_pcbase();
+ addr1 = space.device().safe_pcbase();
src1 = (addr1 < 0x9000) ? state->m_rambase : state->memregion("maincpu")->base();
if (decrypted[addr1] == 0x20) /* JSR $xxxx */
addr = src1[addr1 + 1] + 256 * src1[addr1 + 2];
@@ -280,7 +280,7 @@ WRITE8_MEMBER(btime_state::btime_w)
m_rambase[offset] = data;
- btime_decrypt(&space);
+ btime_decrypt(space);
}
WRITE8_MEMBER(btime_state::tisland_w)
@@ -299,7 +299,7 @@ WRITE8_MEMBER(btime_state::tisland_w)
m_rambase[offset] = data;
- btime_decrypt(&space);
+ btime_decrypt(space);
}
WRITE8_MEMBER(btime_state::zoar_w)
@@ -317,7 +317,7 @@ WRITE8_MEMBER(btime_state::zoar_w)
m_rambase[offset] = data;
- btime_decrypt(&space);
+ btime_decrypt(space);
}
WRITE8_MEMBER(btime_state::disco_w)
@@ -331,7 +331,7 @@ WRITE8_MEMBER(btime_state::disco_w)
m_rambase[offset] = data;
- btime_decrypt(&space);
+ btime_decrypt(space);
}
@@ -2038,18 +2038,18 @@ ROM_END
static void decrypt_C10707_cpu(running_machine &machine, const char *cputag)
{
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
UINT8 *rom = machine.root_device().memregion(cputag)->base();
offs_t addr;
- space->set_decrypted_region(0x0000, 0xffff, decrypt);
+ space.set_decrypted_region(0x0000, 0xffff, decrypt);
/* Swap bits 5 & 6 for opcodes */
for (addr = 0; addr < 0x10000; addr++)
decrypt[addr] = swap_bits_5_6(rom[addr]);
- if (&space->device() == machine.device("maincpu"))
+ if (&space.device() == machine.device("maincpu"))
decrypted = decrypt;
}
@@ -2068,11 +2068,11 @@ READ8_MEMBER(btime_state::wtennis_reset_hack_r)
static void init_rom1(running_machine &machine)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- space->set_decrypted_region(0x0000, 0xffff, decrypted);
+ space.set_decrypted_region(0x0000, 0xffff, decrypted);
/* For now, just copy the RAM array over to ROM. Decryption will happen */
/* at run time, since the CPU applies the decryption only if the previous */
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index c1350bffb01..e3f01181a95 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -876,12 +876,12 @@ WRITE8_MEMBER(bzone_state::analog_select_w)
DRIVER_INIT_MEMBER(bzone_state,bradley)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_ram(0x400, 0x7ff);
- space->install_read_port(0x1808, 0x1808, "1808");
- space->install_read_port(0x1809, 0x1809, "1809");
- space->install_read_handler(0x180a, 0x180a, read8_delegate(FUNC(bzone_state::analog_data_r),this));
- space->install_write_handler(0x1848, 0x1850, write8_delegate(FUNC(bzone_state::analog_select_w),this));
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_ram(0x400, 0x7ff);
+ space.install_read_port(0x1808, 0x1808, "1808");
+ space.install_read_port(0x1809, 0x1809, "1809");
+ space.install_read_handler(0x180a, 0x180a, read8_delegate(FUNC(bzone_state::analog_data_r),this));
+ space.install_write_handler(0x1848, 0x1850, write8_delegate(FUNC(bzone_state::analog_select_w),this));
}
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 43a963cb8d6..08373963777 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -102,7 +102,7 @@ READ16_MEMBER(cabal_state::track_r)
WRITE16_MEMBER(cabal_state::cabal_sound_irq_trigger_word_w)
{
- seibu_main_word_w(&space,4,data,mem_mask);
+ seibu_main_word_w(space,4,data,mem_mask);
/* spin for a while to let the Z80 read the command, otherwise coins "stick" */
space.device().execute().spin_until_time(attotime::from_usec(50));
@@ -848,11 +848,11 @@ ROM_END
static void seibu_sound_bootleg(running_machine &machine,const char *cpu,int length)
{
- address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
UINT8 *rom = machine.root_device().memregion(cpu)->base();
- space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
+ space.set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
memcpy(decrypt, rom+length, length);
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 47f1ca11388..d274b3c6ece 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -977,7 +977,7 @@ DRIVER_INIT_MEMBER(calchase_state,calchase)
m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4);
pc_vga_init(machine(), vga_setting, NULL);
- pc_svga_trident_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_svga_trident_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, calchase_set_keyb_int);
intel82439tx_init(machine());
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index 64680a501cc..3ca95f3695c 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -554,8 +554,8 @@ DRIVER_INIT_MEMBER(calorie_state,calorie)
DRIVER_INIT_MEMBER(calorie_state,calorieb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x10000);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 97f209465a8..653dba9acbf 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -809,9 +809,9 @@ READ16_MEMBER(cave_state::pwrinst2_eeprom_r)
return ~8 + ((eeprom->read_bit() & 1) ? 8 : 0);
}
-INLINE void vctrl_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int GFX)
+INLINE void vctrl_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int GFX)
{
- cave_state *state = space->machine().driver_data<cave_state>();
+ cave_state *state = space.machine().driver_data<cave_state>();
UINT16 *VCTRL = state->m_vctrl[GFX];
if (offset == 4 / 2)
{
@@ -826,10 +826,10 @@ INLINE void vctrl_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem
}
COMBINE_DATA(&VCTRL[offset]);
}
-WRITE16_MEMBER(cave_state::pwrinst2_vctrl_0_w){ vctrl_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(cave_state::pwrinst2_vctrl_1_w){ vctrl_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(cave_state::pwrinst2_vctrl_2_w){ vctrl_w(&space, offset, data, mem_mask, 2); }
-WRITE16_MEMBER(cave_state::pwrinst2_vctrl_3_w){ vctrl_w(&space, offset, data, mem_mask, 3); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_0_w){ vctrl_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_1_w){ vctrl_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_2_w){ vctrl_w(space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(cave_state::pwrinst2_vctrl_3_w){ vctrl_w(space, offset, data, mem_mask, 3); }
static ADDRESS_MAP_START( pwrinst2_map, AS_PROGRAM, 16, cave_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index c9e4a8b9e0c..25ea74e3063 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -142,7 +142,7 @@ WRITE8_MEMBER(cham24_state::sprite_dma_w)
{
int source = (data & 7);
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
- ppu->spriteram_dma(&space, source);
+ ppu->spriteram_dma(space, source);
}
READ8_MEMBER(cham24_state::psg_4015_r)
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 287e246f545..c71f939f006 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -619,7 +619,7 @@ St. Instr. Comment
*/
/* jamtable disassembler */
-static void jamtable_disasm(running_machine &machine, address_space *space,UINT32 address,UINT32 size) // 0xff000080 == fff00080
+static void jamtable_disasm(running_machine &machine, address_space &space,UINT32 address,UINT32 size) // 0xff000080 == fff00080
{
offs_t base,addr;
UINT32 opcode,op1,op2;
@@ -636,11 +636,11 @@ static void jamtable_disasm(running_machine &machine, address_space *space,UINT3
while (1)
{
base=addr;
- opcode=space->read_byte(addr);
+ opcode=space.read_byte(addr);
addr++;
- op1=space->read_dword_unaligned(addr);
+ op1=space.read_dword_unaligned(addr);
addr+=4;
- op2=space->read_dword_unaligned(addr);
+ op2=space.read_dword_unaligned(addr);
addr+=4;
if (opcode == 0xe1)
{
@@ -717,7 +717,7 @@ static void jamtable_disasm(running_machine &machine, address_space *space,UINT3
static void jamtable_disasm_command(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space=machine.firstcpu->space();
+ address_space &space=*machine.firstcpu->space();
UINT64 addr,size;
if (params < 2)
@@ -731,7 +731,7 @@ static void jamtable_disasm_command(running_machine &machine, int ref, int param
static void dump_string_command(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space=machine.firstcpu->space();
+ address_space &space=*machine.firstcpu->space();
UINT64 addr;
offs_t address;
UINT32 length,maximumlength;
@@ -747,9 +747,9 @@ static void dump_string_command(running_machine &machine, int ref, int params, c
debug_console_printf(machine,"Address is unmapped.\n");
return;
}
- length=space->read_word_unaligned(address);
- maximumlength=space->read_word_unaligned(address+2);
- buffer=space->read_dword_unaligned(address+4);
+ length=space.read_word_unaligned(address);
+ maximumlength=space.read_word_unaligned(address+2);
+ buffer=space.read_dword_unaligned(address+4);
debug_console_printf(machine,"Length %d word\n",length);
debug_console_printf(machine,"MaximumLength %d word\n",maximumlength);
debug_console_printf(machine,"Buffer %08X byte* ",buffer);
@@ -762,7 +762,7 @@ static void dump_string_command(running_machine &machine, int ref, int params, c
length=256;
for (int a=0;a < length;a++)
{
- UINT8 c=space->read_byte(buffer+a);
+ UINT8 c=space.read_byte(buffer+a);
debug_console_printf(machine,"%c",c);
}
debug_console_printf(machine,"\n");
@@ -770,7 +770,7 @@ static void dump_string_command(running_machine &machine, int ref, int params, c
static void dump_process_command(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space=machine.firstcpu->space();
+ address_space &space=*machine.firstcpu->space();
UINT64 addr;
offs_t address;
@@ -784,19 +784,19 @@ static void dump_process_command(running_machine &machine, int ref, int params,
debug_console_printf(machine,"Address is unmapped.\n");
return;
}
- debug_console_printf(machine,"ReadyListHead {%08X,%08X} _LIST_ENTRY\n",space->read_dword_unaligned(address),space->read_dword_unaligned(address+4));
- debug_console_printf(machine,"ThreadListHead {%08X,%08X} _LIST_ENTRY\n",space->read_dword_unaligned(address+8),space->read_dword_unaligned(address+12));
- debug_console_printf(machine,"StackCount %d dword\n",space->read_dword_unaligned(address+16));
- debug_console_printf(machine,"ThreadQuantum %d dword\n",space->read_dword_unaligned(address+20));
- debug_console_printf(machine,"BasePriority %d byte\n",space->read_byte(address+24));
- debug_console_printf(machine,"DisableBoost %d byte\n",space->read_byte(address+25));
- debug_console_printf(machine,"DisableQuantum %d byte\n",space->read_byte(address+26));
- debug_console_printf(machine,"_padding %d byte\n",space->read_byte(address+27));
+ debug_console_printf(machine,"ReadyListHead {%08X,%08X} _LIST_ENTRY\n",space.read_dword_unaligned(address),space.read_dword_unaligned(address+4));
+ debug_console_printf(machine,"ThreadListHead {%08X,%08X} _LIST_ENTRY\n",space.read_dword_unaligned(address+8),space.read_dword_unaligned(address+12));
+ debug_console_printf(machine,"StackCount %d dword\n",space.read_dword_unaligned(address+16));
+ debug_console_printf(machine,"ThreadQuantum %d dword\n",space.read_dword_unaligned(address+20));
+ debug_console_printf(machine,"BasePriority %d byte\n",space.read_byte(address+24));
+ debug_console_printf(machine,"DisableBoost %d byte\n",space.read_byte(address+25));
+ debug_console_printf(machine,"DisableQuantum %d byte\n",space.read_byte(address+26));
+ debug_console_printf(machine,"_padding %d byte\n",space.read_byte(address+27));
}
static void dump_list_command(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space=machine.firstcpu->space();
+ address_space &space=*machine.firstcpu->space();
UINT64 addr,offs,start,old;
offs_t address,offset;
@@ -830,7 +830,7 @@ static void dump_list_command(running_machine &machine, int ref, int params, con
else
debug_console_printf(machine,"%08X\n",(UINT32)addr);
old=addr;
- addr=space->read_dword_unaligned(address);
+ addr=space.read_dword_unaligned(address);
if (addr == start)
break;
if (addr == old)
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 72a5013e85a..97827b39278 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -135,12 +135,12 @@ static TIMER_DEVICE_CALLBACK( chinagat_scanline )
static WRITE8_HANDLER( chinagat_interrupt_w )
{
- ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ ddragon_state *state = space.machine().driver_data<ddragon_state>();
switch (offset)
{
case 0: /* 3e00 - SND irq */
- state->soundlatch_byte_w(*space, 0, data);
+ state->soundlatch_byte_w(space, 0, data);
state->m_snd_cpu->execute().set_input_line(state->m_sound_irq, (state->m_sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
break;
@@ -170,7 +170,7 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
---- -x-- Flip screen
--x- ---- Enable video ???
****************************/
- ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ ddragon_state *state = space.machine().driver_data<ddragon_state>();
state->m_scrolly_hi = ((data & 0x02) >> 1);
state->m_scrollx_hi = data & 0x01;
@@ -180,21 +180,21 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
static WRITE8_HANDLER( chinagat_bankswitch_w )
{
- space->machine().root_device().membank("bank1")->set_entry(data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
+ space.machine().root_device().membank("bank1")->set_entry(data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
}
static WRITE8_HANDLER( chinagat_sub_bankswitch_w )
{
- space->machine().root_device().membank("bank4")->set_entry(data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
+ space.machine().root_device().membank("bank4")->set_entry(data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
}
static READ8_HANDLER( saiyugoub1_mcu_command_r )
{
- ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ ddragon_state *state = space.machine().driver_data<ddragon_state>();
#if 0
if (state->m_mcu_command == 0x78)
{
- space->machine().device<cpu_device>("mcu")->suspend(SUSPEND_REASON_HALT, 1); /* Suspend (speed up) */
+ space.machine().device<cpu_device>("mcu")->suspend(SUSPEND_REASON_HALT, 1); /* Suspend (speed up) */
}
#endif
return state->m_mcu_command;
@@ -202,19 +202,19 @@ static READ8_HANDLER( saiyugoub1_mcu_command_r )
static WRITE8_HANDLER( saiyugoub1_mcu_command_w )
{
- ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ ddragon_state *state = space.machine().driver_data<ddragon_state>();
state->m_mcu_command = data;
#if 0
if (data != 0x78)
{
- space->machine().device<cpu_device>("mcu")->resume(SUSPEND_REASON_HALT); /* Wake up */
+ space.machine().device<cpu_device>("mcu")->resume(SUSPEND_REASON_HALT); /* Wake up */
}
#endif
}
static WRITE8_HANDLER( saiyugoub1_adpcm_rom_addr_w )
{
- ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ ddragon_state *state = space.machine().driver_data<ddragon_state>();
/* i8748 Port 1 write */
state->m_i8748_P1 = data;
}
@@ -290,7 +290,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
static READ8_HANDLER( saiyugoub1_m5205_irq_r )
{
- ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ ddragon_state *state = space.machine().driver_data<ddragon_state>();
if (state->m_adpcm_sound_irq)
{
state->m_adpcm_sound_irq = 0;
diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c
index a022f9a216a..bb0f20ee12d 100644
--- a/src/mame/drivers/cmmb.c
+++ b/src/mame/drivers/cmmb.c
@@ -143,11 +143,11 @@ READ8_MEMBER(cmmb_state::cmmb_input_r)
/*
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000 + (0x10000 * (data & 0x03));
- space->machine().root_device().membank("bank1")->set_base(&ROM[bankaddress]);
+ space.machine().root_device().membank("bank1")->set_base(&ROM[bankaddress]);
}
*/
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 36f3125abd5..8b1012fd21f 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -707,7 +707,7 @@ MACHINE_START_MEMBER(combatsc_state,combatscb)
void combatsc_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
memset(m_io_ram, 0x00, 0x4000);
@@ -726,7 +726,7 @@ void combatsc_state::machine_reset()
m_sign[i] = 0;
}
- combatsc_bankselect_w(*space, 0, 0);
+ combatsc_bankselect_w(space, 0, 0);
}
/* combat school (original) */
diff --git a/src/mame/drivers/commando.c b/src/mame/drivers/commando.c
index a4beedbfdf3..1205396936d 100644
--- a/src/mame/drivers/commando.c
+++ b/src/mame/drivers/commando.c
@@ -511,12 +511,12 @@ ROM_END
DRIVER_INIT_MEMBER(commando_state,commando)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0xc000);
int A;
- space->set_decrypted_region(0x0000, 0xbfff, decrypt);
+ space.set_decrypted_region(0x0000, 0xbfff, decrypt);
// the first opcode is *not* encrypted
decrypt[0] = rom[0];
@@ -531,12 +531,12 @@ DRIVER_INIT_MEMBER(commando_state,commando)
DRIVER_INIT_MEMBER(commando_state,spaceinv)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0xc000);
int A;
- space->set_decrypted_region(0x0000, 0xbfff, decrypt);
+ space.set_decrypted_region(0x0000, 0xbfff, decrypt);
// the first opcode *is* encrypted
for (A = 0; A < 0xc000; A++)
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 780d7b133a4..b8913bc56f7 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -109,17 +109,17 @@ static void coolpool_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int s
*
*************************************/
-static void coolpool_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void coolpool_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- coolpool_state *state = space->machine().driver_data<coolpool_state>();
+ coolpool_state *state = space.machine().driver_data<coolpool_state>();
memcpy(shiftreg, &state->m_vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
}
-static void coolpool_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void coolpool_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- coolpool_state *state = space->machine().driver_data<coolpool_state>();
+ coolpool_state *state = space.machine().driver_data<coolpool_state>();
memcpy(&state->m_vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
}
@@ -308,9 +308,9 @@ static int amerdart_trackball_dec(int data)
return data;
}
-static int amerdart_trackball_direction(address_space *space, int num, int data)
+static int amerdart_trackball_direction(address_space &space, int num, int data)
{
- coolpool_state *state = space->machine().driver_data<coolpool_state>();
+ coolpool_state *state = space.machine().driver_data<coolpool_state>();
UINT16 result_x = (data & 0x0c) >> 2;
UINT16 result_y = (data & 0x03) >> 0;
@@ -415,10 +415,10 @@ READ16_MEMBER(coolpool_state::amerdart_trackball_r)
m_dy[2] = (INT8)(m_newy[2] - m_oldy[2]);
/* Determine Trackball 1 direction state */
- m_result = (m_result & 0xf0ff) | (amerdart_trackball_direction(&space, 1, ((m_result >> 8) & 0xf)) << 8);
+ m_result = (m_result & 0xf0ff) | (amerdart_trackball_direction(space, 1, ((m_result >> 8) & 0xf)) << 8);
/* Determine Trackball 2 direction state */
- m_result = (m_result & 0x0fff) | (amerdart_trackball_direction(&space, 2, ((m_result >> 12) & 0xf)) << 12);
+ m_result = (m_result & 0x0fff) | (amerdart_trackball_direction(space, 2, ((m_result >> 12) & 0xf)) << 12);
// logerror("%08X:read port 6 (X=%02X Y=%02X oldX=%02X oldY=%02X oldRes=%04X Res=%04X)\n", space.device().safe_pc(), m_newx, m_newy, m_oldx, m_oldy, m_lastresult, m_result);
diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c
index aec1ebb59cf..62c8900adfc 100644
--- a/src/mame/drivers/coolridr.c
+++ b/src/mame/drivers/coolridr.c
@@ -593,9 +593,9 @@ WRITE32_MEMBER(coolridr_state::sysh1_pal_w)
/* FIXME: this seems to do a hell lot of stuff, it's not ST-V SCU but still somewhat complex :/ */
-static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
+static void sysh1_dma_transfer( address_space &space, UINT16 dma_index )
{
- coolridr_state *state = space->machine().driver_data<coolridr_state>();
+ coolridr_state *state = space.machine().driver_data<coolridr_state>();
UINT32 src,dst,size,type,s_i;
UINT8 end_dma_mark;
@@ -644,14 +644,14 @@ static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
//size/=2;
if((src & 0xff00000) == 0x3e00000)
return; //FIXME: kludge to avoid palette corruption
- //debugger_break(space->machine());
+ //debugger_break(space.machine());
}
if(type == 0xc || type == 0xd || type == 0xe)
{
for(s_i=0;s_i<size;s_i+=4)
{
- space->write_dword(dst,space->read_dword(src));
+ space.write_dword(dst,space.read_dword(src));
dst+=4;
src+=4;
}
@@ -676,7 +676,7 @@ WRITE32_MEMBER(coolridr_state::sysh1_dma_w)
if(offset*4 == 0x000)
{
if((m_framebuffer_vram[offset] & 0xff00000) == 0xfe00000)
- sysh1_dma_transfer(&space, m_framebuffer_vram[offset] & 0xffff);
+ sysh1_dma_transfer(space, m_framebuffer_vram[offset] & 0xffff);
}
}
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index dd0e6642e23..e1602dfccfe 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -692,7 +692,7 @@ static const eeprom_interface cps2_eeprom_interface =
static WRITE16_HANDLER( cps2_eeprom_port_w )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
if (ACCESSING_BITS_8_15)
{
@@ -724,38 +724,38 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
if (state->m_audiocpu != NULL)
state->m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE);
- coin_counter_w(space->machine(), 0, data & 0x0001);
- if ((strncmp(space->machine().system().name, "pzloop2", 8) == 0) ||
- (strncmp(space->machine().system().name, "pzloop2j", 8) == 0) ||
- (strncmp(space->machine().system().name, "pzloop2jr1", 8) == 0))
+ coin_counter_w(space.machine(), 0, data & 0x0001);
+ if ((strncmp(space.machine().system().name, "pzloop2", 8) == 0) ||
+ (strncmp(space.machine().system().name, "pzloop2j", 8) == 0) ||
+ (strncmp(space.machine().system().name, "pzloop2jr1", 8) == 0))
{
// Puzz Loop 2 uses coin counter 2 input to switch between stick and paddle controls
state->m_readpaddle = data & 0x0002;
}
else
{
- coin_counter_w(space->machine(), 1, data & 0x0002);
+ coin_counter_w(space.machine(), 1, data & 0x0002);
}
- if (strncmp(space->machine().system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
+ if (strncmp(space.machine().system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
{
- coin_lockout_w(space->machine(), 0, data & 0x0010);
- coin_lockout_w(space->machine(), 1, data & 0x0020);
- coin_lockout_w(space->machine(), 2, data & 0x0040);
- coin_lockout_w(space->machine(), 3, data & 0x0080);
+ coin_lockout_w(space.machine(), 0, data & 0x0010);
+ coin_lockout_w(space.machine(), 1, data & 0x0020);
+ coin_lockout_w(space.machine(), 2, data & 0x0040);
+ coin_lockout_w(space.machine(), 3, data & 0x0080);
}
else
{
- coin_lockout_w(space->machine(), 0, ~data & 0x0010);
- coin_lockout_w(space->machine(), 1, ~data & 0x0020);
- coin_lockout_w(space->machine(), 2, ~data & 0x0040);
- coin_lockout_w(space->machine(), 3, ~data & 0x0080);
+ coin_lockout_w(space.machine(), 0, ~data & 0x0010);
+ coin_lockout_w(space.machine(), 1, ~data & 0x0020);
+ coin_lockout_w(space.machine(), 2, ~data & 0x0040);
+ coin_lockout_w(space.machine(), 3, ~data & 0x0080);
}
/*
- set_led_status(space->machine(), 0, data & 0x01);
- set_led_status(space->machine(), 1, data & 0x10);
- set_led_status(space->machine(), 2, data & 0x20);
+ set_led_status(space.machine(), 0, data & 0x01);
+ set_led_status(space.machine(), 1, data & 0x10);
+ set_led_status(space.machine(), 2, data & 0x20);
*/
}
}
@@ -769,7 +769,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
static READ16_HANDLER( cps2_qsound_volume_r )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
/* Extra adapter memory (0x660000-0x663fff) available when bit 14 = 0 */
/* Network adapter (ssf2tb) present when bit 15 = 0 */
@@ -795,7 +795,7 @@ static READ16_HANDLER( kludge_r )
static READ16_HANDLER( joy_or_paddle_r )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
if (state->m_readpaddle != 0)
return (state->ioport("IN0")->read());
@@ -8147,13 +8147,13 @@ DRIVER_INIT_MEMBER(cps_state,pzloop2)
static READ16_HANDLER( gigaman2_dummyqsound_r )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
return state->m_gigaman2_dummyqsound_ram[offset];
};
static WRITE16_HANDLER( gigaman2_dummyqsound_w )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
state->m_gigaman2_dummyqsound_ram[offset] = data;
};
@@ -8176,7 +8176,7 @@ static void gigaman2_gfx_reorder(running_machine &machine)
DRIVER_INIT_MEMBER(cps_state,gigaman2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT16 *rom = (UINT16 *)memregion("maincpu")->base();
int length = memregion("maincpu")->bytes();
@@ -8188,7 +8188,7 @@ DRIVER_INIT_MEMBER(cps_state,gigaman2)
save_pointer(NAME(m_gigaman2_dummyqsound_ram), 0x20000 / 2);
machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigaman2_dummyqsound_r), FUNC(gigaman2_dummyqsound_w)); // no qsound..
- space->set_decrypted_region(0x000000, (length) - 1, &rom[length/4]);
+ space.set_decrypted_region(0x000000, (length) - 1, &rom[length/4]);
m68k_set_encrypted_opcode_range(machine().device("maincpu"), 0, length);
}
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 8c46ba35284..267a211aede 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -1456,9 +1456,9 @@ WRITE32_MEMBER(cps3_state::cps3_gfxflash_w)
-static UINT32 cps3_flashmain_r(address_space *space, int which, UINT32 offset, UINT32 mem_mask)
+static UINT32 cps3_flashmain_r(address_space &space, int which, UINT32 offset, UINT32 mem_mask)
{
- cps3_state *state = space->machine().driver_data<cps3_state>();
+ cps3_state *state = space.machine().driver_data<cps3_state>();
UINT32 result = 0;
if (state->m_simm[which][0] == NULL || state->m_simm[which][1] == NULL || state->m_simm[which][2] == NULL || state->m_simm[which][3] == NULL)
@@ -1494,7 +1494,7 @@ static UINT32 cps3_flashmain_r(address_space *space, int which, UINT32 offset, U
READ32_MEMBER(cps3_state::cps3_flash1_r)
{
- UINT32 retvalue = cps3_flashmain_r(&space, 0, offset,mem_mask);
+ UINT32 retvalue = cps3_flashmain_r(space, 0, offset,mem_mask);
if (m_altEncryption) return retvalue;
@@ -1504,7 +1504,7 @@ READ32_MEMBER(cps3_state::cps3_flash1_r)
READ32_MEMBER(cps3_state::cps3_flash2_r)
{
- UINT32 retvalue = cps3_flashmain_r(&space, 1, offset,mem_mask);
+ UINT32 retvalue = cps3_flashmain_r(space, 1, offset,mem_mask);
if (m_altEncryption) return retvalue;
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index e10ce926893..dee733d7012 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -195,13 +195,13 @@ public:
static void IntReq( running_machine &machine, int num )
{
crystal_state *state = machine.driver_data<crystal_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
- UINT32 IntEn = space->read_dword(0x01800c08);
- UINT32 IntPend = space->read_dword(0x01800c0c);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
+ UINT32 IntEn = space.read_dword(0x01800c08);
+ UINT32 IntPend = space.read_dword(0x01800c0c);
if (IntEn & (1 << num))
{
IntPend |= (1 << num);
- space->write_dword(0x01800c0c, IntPend);
+ space.write_dword(0x01800c0c, IntPend);
state->m_maincpu->set_input_line(SE3208_INT, ASSERT_LINE);
}
#ifdef IDLE_LOOP_SPEEDUP
@@ -273,8 +273,8 @@ WRITE32_MEMBER(crystal_state::IntAck_w)
static IRQ_CALLBACK( icallback )
{
crystal_state *state = device->machine().driver_data<crystal_state>();
- address_space *space = device->memory().space(AS_PROGRAM);
- UINT32 IntPend = space->read_dword(0x01800c0c);
+ address_space &space = *device->memory().space(AS_PROGRAM);
+ UINT32 IntPend = space.read_dword(0x01800c0c);
int i;
for (i = 0; i < 32; ++i)
@@ -309,14 +309,14 @@ static TIMER_CALLBACK( Timercb )
IntReq(machine, num[which]);
}
-INLINE void Timer_w( address_space *space, int which, UINT32 data, UINT32 mem_mask )
+INLINE void Timer_w( address_space &space, int which, UINT32 data, UINT32 mem_mask )
{
- crystal_state *state = space->machine().driver_data<crystal_state>();
+ crystal_state *state = space.machine().driver_data<crystal_state>();
if (((data ^ state->m_Timerctrl[which]) & 1) && (data & 1)) //Timer activate
{
int PD = (data >> 8) & 0xff;
- int TCV = space->read_dword(0x01801404 + which * 8);
+ int TCV = space.read_dword(0x01801404 + which * 8);
attotime period = attotime::from_hz(43000000) * ((PD + 1) * (TCV + 1));
if (state->m_Timerctrl[which] & 2)
@@ -329,7 +329,7 @@ INLINE void Timer_w( address_space *space, int which, UINT32 data, UINT32 mem_ma
WRITE32_MEMBER(crystal_state::Timer0_w)
{
- Timer_w(&space, 0, data, mem_mask);
+ Timer_w(space, 0, data, mem_mask);
}
READ32_MEMBER(crystal_state::Timer0_r)
@@ -339,7 +339,7 @@ READ32_MEMBER(crystal_state::Timer0_r)
WRITE32_MEMBER(crystal_state::Timer1_w)
{
- Timer_w(&space, 1, data, mem_mask);
+ Timer_w(space, 1, data, mem_mask);
}
READ32_MEMBER(crystal_state::Timer1_r)
@@ -349,7 +349,7 @@ READ32_MEMBER(crystal_state::Timer1_r)
WRITE32_MEMBER(crystal_state::Timer2_w)
{
- Timer_w(&space, 2, data, mem_mask);
+ Timer_w(space, 2, data, mem_mask);
}
READ32_MEMBER(crystal_state::Timer2_r)
@@ -359,7 +359,7 @@ READ32_MEMBER(crystal_state::Timer2_r)
WRITE32_MEMBER(crystal_state::Timer3_w)
{
- Timer_w(&space, 3, data, mem_mask);
+ Timer_w(space, 3, data, mem_mask);
}
READ32_MEMBER(crystal_state::Timer3_r)
@@ -418,45 +418,45 @@ WRITE32_MEMBER(crystal_state::PIO_w)
COMBINE_DATA(&m_PIO);
}
-INLINE void DMA_w( address_space *space, int which, UINT32 data, UINT32 mem_mask )
+INLINE void DMA_w( address_space &space, int which, UINT32 data, UINT32 mem_mask )
{
- crystal_state *state = space->machine().driver_data<crystal_state>();
+ crystal_state *state = space.machine().driver_data<crystal_state>();
if (((data ^ state->m_DMActrl[which]) & (1 << 10)) && (data & (1 << 10))) //DMAOn
{
UINT32 CTR = data;
- UINT32 SRC = space->read_dword(0x01800804 + which * 0x10);
- UINT32 DST = space->read_dword(0x01800808 + which * 0x10);
- UINT32 CNT = space->read_dword(0x0180080C + which * 0x10);
+ UINT32 SRC = space.read_dword(0x01800804 + which * 0x10);
+ UINT32 DST = space.read_dword(0x01800808 + which * 0x10);
+ UINT32 CNT = space.read_dword(0x0180080C + which * 0x10);
int i;
if (CTR & 0x2) //32 bits
{
for (i = 0; i < CNT; ++i)
{
- UINT32 v = space->read_dword(SRC + i * 4);
- space->write_dword(DST + i * 4, v);
+ UINT32 v = space.read_dword(SRC + i * 4);
+ space.write_dword(DST + i * 4, v);
}
}
else if (CTR & 0x1) //16 bits
{
for (i = 0; i < CNT; ++i)
{
- UINT16 v = space->read_word(SRC + i * 2);
- space->write_word(DST + i * 2, v);
+ UINT16 v = space.read_word(SRC + i * 2);
+ space.write_word(DST + i * 2, v);
}
}
else //8 bits
{
for (i = 0; i < CNT; ++i)
{
- UINT8 v = space->read_byte(SRC + i);
- space->write_byte(DST + i, v);
+ UINT8 v = space.read_byte(SRC + i);
+ space.write_byte(DST + i, v);
}
}
data &= ~(1 << 10);
- space->write_dword(0x0180080C + which * 0x10, 0);
- IntReq(space->machine(), 7 + which);
+ space.write_dword(0x0180080C + which * 0x10, 0);
+ IntReq(space.machine(), 7 + which);
}
COMBINE_DATA(&state->m_DMActrl[which]);
}
@@ -468,7 +468,7 @@ READ32_MEMBER(crystal_state::DMA0_r)
WRITE32_MEMBER(crystal_state::DMA0_w)
{
- DMA_w(&space, 0, data, mem_mask);
+ DMA_w(space, 0, data, mem_mask);
}
READ32_MEMBER(crystal_state::DMA1_r)
@@ -478,7 +478,7 @@ READ32_MEMBER(crystal_state::DMA1_r)
WRITE32_MEMBER(crystal_state::DMA1_w)
{
- DMA_w(&space, 1, data, mem_mask);
+ DMA_w(space, 1, data, mem_mask);
}
@@ -636,21 +636,21 @@ void crystal_state::machine_reset()
PatchReset(machine());
}
-static UINT16 GetVidReg( address_space *space, UINT16 reg )
+static UINT16 GetVidReg( address_space &space, UINT16 reg )
{
- return space->read_word(0x03000000 + reg);
+ return space.read_word(0x03000000 + reg);
}
-static void SetVidReg( address_space *space, UINT16 reg, UINT16 val )
+static void SetVidReg( address_space &space, UINT16 reg, UINT16 val )
{
- space->write_word(0x03000000 + reg, val);
+ space.write_word(0x03000000 + reg, val);
}
static SCREEN_UPDATE_IND16( crystal )
{
crystal_state *state = screen.machine().driver_data<crystal_state>();
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
int DoFlip;
UINT32 B0 = 0x0;
@@ -716,7 +716,7 @@ static SCREEN_VBLANK(crystal)
if (vblank_on)
{
crystal_state *state = screen.machine().driver_data<crystal_state>();
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT16 head, tail;
int DoFlip = 0;
@@ -724,7 +724,7 @@ static SCREEN_VBLANK(crystal)
tail = GetVidReg(space, 0x80);
while ((head & 0x7ff) != (tail & 0x7ff))
{
- UINT16 Packet0 = space->read_word(0x03800000 + head * 64);
+ UINT16 Packet0 = space.read_word(0x03800000 + head * 64);
if (Packet0 & 0x81)
DoFlip = 1;
head++;
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index 7a23b06680f..b9e3f2b08d0 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -287,12 +287,12 @@ ADDRESS_MAP_END
READ8_MEMBER(cshooter_state::seibu_sound_comms_r)
{
- return seibu_main_word_r(&space,offset,0x00ff);
+ return seibu_main_word_r(space,offset,0x00ff);
}
WRITE8_MEMBER(cshooter_state::seibu_sound_comms_w)
{
- seibu_main_word_w(&space,offset,data,0x00ff);
+ seibu_main_word_w(space,offset,data,0x00ff);
}
static ADDRESS_MAP_START( airraid_map, AS_PROGRAM, 8, cshooter_state )
@@ -676,12 +676,12 @@ DRIVER_INIT_MEMBER(cshooter_state,cshooter)
DRIVER_INIT_MEMBER(cshooter_state,cshootere)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int A;
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
for (A = 0x0000;A < 0x8000;A++)
{
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index b3287ee2904..75672633080 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -585,14 +585,14 @@ static Z80CTC_INTERFACE( ctc_intf )
void csplayh5_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
for (i = 0; i < 5; i++)
{
m_pio_dir[i] = m_pio_latch[i] = 0;
- tmpz84c011_pio_w(*space, i, 0);
+ tmpz84c011_pio_w(space, i, 0);
}
}
diff --git a/src/mame/drivers/darkmist.c b/src/mame/drivers/darkmist.c
index 39fa9d36c4e..f6f4cdd8320 100644
--- a/src/mame/drivers/darkmist.c
+++ b/src/mame/drivers/darkmist.c
@@ -400,7 +400,7 @@ static void decrypt_snd(running_machine &machine)
DRIVER_INIT_MEMBER(darkmist_state,darkmist)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i, len;
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine(), UINT8, 0x10000);
@@ -436,8 +436,8 @@ DRIVER_INIT_MEMBER(darkmist_state,darkmist)
decrypt[i] = p;
}
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
- space->machine().root_device().membank("bank1")->set_base(&ROM[0x010000]);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.machine().root_device().membank("bank1")->set_base(&ROM[0x010000]);
/* adr line swaps */
ROM = machine().root_device().memregion("user1")->base();
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index 8cafa9fba83..bc7d2bed0ec 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -688,9 +688,9 @@ INLINE void log_blit( running_machine &machine, int data )
#endif
}
-static void blitter_w( address_space *space, int blitter, offs_t offset, UINT8 data, int irq_vector )
+static void blitter_w( address_space &space, int blitter, offs_t offset, UINT8 data, int irq_vector )
{
- dynax_state *state = space->machine().driver_data<dynax_state>();
+ dynax_state *state = space.machine().driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -720,7 +720,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
case 0x03:
- ddenlovr_blit_flip_w(space->machine(), data);
+ ddenlovr_blit_flip_w(space.machine(), data);
break;
case 0x04:
@@ -789,57 +789,57 @@ g_profiler.start(PROFILER_VIDEO);
case 0x24:
- log_blit(space->machine(), data);
+ log_blit(space.machine(), data);
switch (data)
{
- case 0x04: blit_fill_xy(space->machine(), 0, 0);
+ case 0x04: blit_fill_xy(space.machine(), 0, 0);
break;
- case 0x14: blit_fill_xy(space->machine(), state->m_ddenlovr_blit_x, state->m_ddenlovr_blit_y);
+ case 0x14: blit_fill_xy(space.machine(), state->m_ddenlovr_blit_x, state->m_ddenlovr_blit_y);
break;
- case 0x10: state->m_ddenlovr_blit_address = blit_draw(space->machine(), state->m_ddenlovr_blit_address, state->m_ddenlovr_blit_x);
+ case 0x10: state->m_ddenlovr_blit_address = blit_draw(space.machine(), state->m_ddenlovr_blit_address, state->m_ddenlovr_blit_x);
break;
- case 0x13: blit_horiz_line(space->machine());
+ case 0x13: blit_horiz_line(space.machine());
break;
- case 0x1b: blit_vert_line(space->machine());
+ case 0x1b: blit_vert_line(space.machine());
break;
- case 0x1c: blit_rect_xywh(space->machine());
+ case 0x1c: blit_rect_xywh(space.machine());
break;
// These two are issued one after the other (43 then 8c)
// 8c is issued immediately after 43 has finished, without
// changing any argument
case 0x43: break;
- case 0x8c: blit_rect_yh(space->machine());
+ case 0x8c: blit_rect_yh(space.machine());
break;
default:
;
#ifdef MAME_DEBUG
popmessage("unknown blitter command %02x", data);
- logerror("%06x: unknown blitter command %02x\n", space->device().safe_pc(), data);
+ logerror("%06x: unknown blitter command %02x\n", space.device().safe_pc(), data);
#endif
}
if (irq_vector)
/* quizchq */
- space->device().execute().set_input_line_and_vector(0, HOLD_LINE, irq_vector);
+ space.device().execute().set_input_line_and_vector(0, HOLD_LINE, irq_vector);
else
{
/* ddenlovr */
if (state->m_ddenlovr_blitter_irq_enable)
{
state->m_ddenlovr_blitter_irq_flag = 1;
- space->device().execute().set_input_line(1, HOLD_LINE);
+ space.device().execute().set_input_line(1, HOLD_LINE);
}
}
break;
default:
- logerror("%06x: Blitter %d reg %02x = %02x\n", space->device().safe_pc(), blitter, state->m_ddenlovr_blit_regs[blitter], data);
+ logerror("%06x: Blitter %d reg %02x = %02x\n", space.device().safe_pc(), blitter, state->m_ddenlovr_blit_regs[blitter], data);
break;
}
}
@@ -1205,13 +1205,13 @@ g_profiler.stop();
WRITE8_MEMBER(dynax_state::rongrong_blitter_w)
{
- blitter_w(&space, 0, offset, data, 0xf8);
+ blitter_w(space, 0, offset, data, 0xf8);
}
WRITE16_MEMBER(dynax_state::ddenlovr_blitter_w)
{
if (ACCESSING_BITS_0_7)
- blitter_w(&space, 0, offset, data & 0xff, 0);
+ blitter_w(space, 0, offset, data & 0xff, 0);
}
@@ -2080,11 +2080,11 @@ WRITE8_MEMBER(dynax_state::mmpanic_soundlatch_w)
WRITE8_MEMBER(dynax_state::mmpanic_blitter_w)
{
- blitter_w(&space, 0, offset, data, 0xdf); // RST 18
+ blitter_w(space, 0, offset, data, 0xdf); // RST 18
}
WRITE8_MEMBER(dynax_state::mmpanic_blitter2_w)
{
- blitter_w(&space, 1, offset, data, 0xdf); // RST 18
+ blitter_w(space, 1, offset, data, 0xdf); // RST 18
}
static void mmpanic_update_leds(running_machine &machine)
@@ -2750,7 +2750,7 @@ WRITE8_MEMBER(dynax_state::mjmyster_coincounter_w)
WRITE8_MEMBER(dynax_state::mjmyster_blitter_w)
{
- blitter_w(&space, 0, offset, data, 0xfc);
+ blitter_w(space, 0, offset, data, 0xfc);
}
static ADDRESS_MAP_START( mjmyster_portmap, AS_IO, 8, dynax_state )
@@ -2922,7 +2922,7 @@ WRITE8_MEMBER(dynax_state::hginga_blitter_w)
break;
}
}
- blitter_w(&space, 0, offset, data, 0xfc);
+ blitter_w(space, 0, offset, data, 0xfc);
}
static ADDRESS_MAP_START( hginga_portmap, AS_IO, 8, dynax_state )
@@ -2956,10 +2956,10 @@ ADDRESS_MAP_END
Hanafuda Hana Gokou
***************************************************************************/
-static UINT8 hgokou_player_r( address_space *space, int player )
+static UINT8 hgokou_player_r( address_space &space, int player )
{
- dynax_state *state = space->machine().driver_data<dynax_state>();
- UINT8 hopper_bit = ((state->m_hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
+ dynax_state *state = space.machine().driver_data<dynax_state>();
+ UINT8 hopper_bit = ((state->m_hopper && !(space.machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
if (!BIT(state->m_input_sel, 0)) return state->ioport(player ? "KEY5" : "KEY0")->read() | hopper_bit;
if (!BIT(state->m_input_sel, 1)) return state->ioport(player ? "KEY6" : "KEY1")->read() | hopper_bit;
@@ -2980,8 +2980,8 @@ READ8_MEMBER(dynax_state::hgokou_input_r)
switch (m_dsw_sel)
{
case 0x20: return ioport("SYSTEM")->read();
- case 0x21: return hgokou_player_r(&space, 1);
- case 0x22: return hgokou_player_r(&space, 0);
+ case 0x21: return hgokou_player_r(space, 1);
+ case 0x22: return hgokou_player_r(space, 0);
case 0x23: return m_coins;
}
logerror("%06x: warning, unknown bits read, dsw_sel = %02x\n", space.device().safe_pc(), m_dsw_sel);
@@ -3077,12 +3077,12 @@ READ8_MEMBER(dynax_state::hgokbang_input_r)
m_input_sel = 0xfe;
return 0; // discarded
case 0xa1:
- ret = hgokou_player_r(&space, 1);
+ ret = hgokou_player_r(space, 1);
m_input_sel <<= 1; // auto-increment input_sel
m_input_sel |= 1;
return ret;
case 0xa2:
- ret = hgokou_player_r(&space, 0);
+ ret = hgokou_player_r(space, 0);
m_input_sel <<= 1; // auto-increment input_sel
m_input_sel |= 1;
return ret;
@@ -3389,7 +3389,7 @@ CUSTOM_INPUT_MEMBER(dynax_state::mjflove_blitter_r)
WRITE8_MEMBER(dynax_state::mjflove_blitter_w)
{
- blitter_w(&space, 0, offset, data, 0);
+ blitter_w(space, 0, offset, data, 0);
}
WRITE8_MEMBER(dynax_state::mjflove_coincounter_w)
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index 1dc9a965c70..5b7ef10c7b0 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -422,35 +422,35 @@ READ16_MEMBER(dec0_state::slyspy_state_r)
void slyspy_set_protection_map(running_machine& machine, int type)
{
dec0_state *state = machine.driver_data<dec0_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
deco_bac06_device *tilegen1 = (deco_bac06_device*)state->m_tilegen1;
deco_bac06_device *tilegen2 = (deco_bac06_device*)state->m_tilegen2;
- space->install_write_handler( 0x240000, 0x24ffff, write16_delegate(FUNC(dec0_state::unmapped_w),state));
+ space.install_write_handler( 0x240000, 0x24ffff, write16_delegate(FUNC(dec0_state::unmapped_w),state));
- space->install_write_handler( 0x24a000, 0x24a001, write16_delegate(FUNC(dec0_state::slyspy_state_w),state));
- space->install_read_handler( 0x244000, 0x244001, read16_delegate(FUNC(dec0_state::slyspy_state_r),state));
+ space.install_write_handler( 0x24a000, 0x24a001, write16_delegate(FUNC(dec0_state::slyspy_state_w),state));
+ space.install_read_handler( 0x244000, 0x244001, read16_delegate(FUNC(dec0_state::slyspy_state_r),state));
switch (type)
{
case 0:
- space->install_legacy_write_handler( *tilegen2, 0x240000, 0x240007, FUNC(deco_bac06_pf_control_0_w));
- space->install_legacy_write_handler( *tilegen2, 0x240010, 0x240017, FUNC(deco_bac06_pf_control_1_w));
+ space.install_legacy_write_handler( *tilegen2, 0x240000, 0x240007, FUNC(deco_bac06_pf_control_0_w));
+ space.install_legacy_write_handler( *tilegen2, 0x240010, 0x240017, FUNC(deco_bac06_pf_control_1_w));
- space->install_legacy_write_handler( *tilegen2, 0x242000, 0x24207f, FUNC(deco_bac06_pf_colscroll_w));
- space->install_legacy_write_handler( *tilegen2, 0x242400, 0x2427ff, FUNC(deco_bac06_pf_rowscroll_w));
+ space.install_legacy_write_handler( *tilegen2, 0x242000, 0x24207f, FUNC(deco_bac06_pf_colscroll_w));
+ space.install_legacy_write_handler( *tilegen2, 0x242400, 0x2427ff, FUNC(deco_bac06_pf_rowscroll_w));
- space->install_legacy_write_handler( *tilegen2, 0x246000, 0x247fff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen2, 0x246000, 0x247fff, FUNC(deco_bac06_pf_data_w));
- space->install_legacy_write_handler( *tilegen1, 0x248000, 0x280007, FUNC(deco_bac06_pf_control_0_w));
- space->install_legacy_write_handler( *tilegen1, 0x248010, 0x280017, FUNC(deco_bac06_pf_control_1_w));
+ space.install_legacy_write_handler( *tilegen1, 0x248000, 0x280007, FUNC(deco_bac06_pf_control_0_w));
+ space.install_legacy_write_handler( *tilegen1, 0x248010, 0x280017, FUNC(deco_bac06_pf_control_1_w));
- space->install_legacy_write_handler( *tilegen1, 0x24c000, 0x24c07f, FUNC(deco_bac06_pf_colscroll_w));
- space->install_legacy_write_handler( *tilegen1, 0x24c400, 0x24c7ff, FUNC(deco_bac06_pf_rowscroll_w));
+ space.install_legacy_write_handler( *tilegen1, 0x24c000, 0x24c07f, FUNC(deco_bac06_pf_colscroll_w));
+ space.install_legacy_write_handler( *tilegen1, 0x24c400, 0x24c7ff, FUNC(deco_bac06_pf_rowscroll_w));
- space->install_legacy_write_handler( *tilegen1, 0x24e000, 0x24ffff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen1, 0x24e000, 0x24ffff, FUNC(deco_bac06_pf_data_w));
break;
@@ -458,26 +458,26 @@ void slyspy_set_protection_map(running_machine& machine, int type)
// 0x240000 - 0x241fff not mapped
// 0x242000 - 0x243fff not mapped
// 0x246000 - 0x247fff not mapped
- space->install_legacy_write_handler( *tilegen1, 0x248000, 0x249fff, FUNC(deco_bac06_pf_data_w));
- space->install_legacy_write_handler( *tilegen2, 0x24c000, 0x24dfff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen1, 0x248000, 0x249fff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen2, 0x24c000, 0x24dfff, FUNC(deco_bac06_pf_data_w));
// 0x24e000 - 0x24ffff not mapped
break;
case 2:
- space->install_legacy_write_handler( *tilegen2, 0x240000, 0x241fff, FUNC(deco_bac06_pf_data_w));
- space->install_legacy_write_handler( *tilegen1, 0x242000, 0x243fff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen2, 0x240000, 0x241fff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen1, 0x242000, 0x243fff, FUNC(deco_bac06_pf_data_w));
// 0x242000 - 0x243fff not mapped
// 0x246000 - 0x247fff not mapped
// 0x248000 - 0x249fff not mapped
// 0x24c000 - 0x24dfff not mapped
- space->install_legacy_write_handler( *tilegen1, 0x24e000, 0x24ffff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen1, 0x24e000, 0x24ffff, FUNC(deco_bac06_pf_data_w));
break;
case 3:
- space->install_legacy_write_handler( *tilegen1, 0x240000, 0x241fff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen1, 0x240000, 0x241fff, FUNC(deco_bac06_pf_data_w));
// 0x242000 - 0x243fff not mapped
// 0x246000 - 0x247fff not mapped
- space->install_legacy_write_handler( *tilegen2, 0x248000, 0x249fff, FUNC(deco_bac06_pf_data_w));
+ space.install_legacy_write_handler( *tilegen2, 0x248000, 0x249fff, FUNC(deco_bac06_pf_data_w));
// 0x24c000 - 0x24dfff not mapped
// 0x24e000 - 0x24ffff not mapped
break;
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 943d9fd42d4..1e5a898dc0e 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -72,8 +72,8 @@ static SCREEN_VBLANK( dec8 )
// rising edge
if (vblank_on)
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
- state->dec8_mxc06_karn_buffer_spriteram_w(*space, 0, 0);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ state->dec8_mxc06_karn_buffer_spriteram_w(space, 0, 0);
}
}
@@ -3527,7 +3527,7 @@ DRIVER_INIT_MEMBER(dec8_state,dec8)
/* Ghostbusters, Darwin, Oscar use a "Deco 222" custom 6502 for sound. */
DRIVER_INIT_MEMBER(dec8_state,deco222)
{
- address_space *space = machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("audiocpu")->memory().space(AS_PROGRAM);
int A;
UINT8 *decrypt;
UINT8 *rom;
@@ -3536,7 +3536,7 @@ DRIVER_INIT_MEMBER(dec8_state,deco222)
rom = memregion("audiocpu")->base();
decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- space->set_decrypted_region(0x8000, 0xffff, decrypt);
+ space.set_decrypted_region(0x8000, 0xffff, decrypt);
for (A = 0x8000; A < 0x10000; A++)
decrypt[A - 0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index c451a5a97d8..0441c562ff7 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -57,42 +57,42 @@ INLINE int swap_bits_5_6(int data)
static WRITE8_HANDLER( ram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_decrypted[0x0000 + offset] = swap_bits_5_6(data);
state->m_rambase[0x0000 + offset] = data;
}
static WRITE8_HANDLER( charram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_decrypted[0x6000 + offset] = swap_bits_5_6(data);
decocass_charram_w(space, offset, data);
}
static WRITE8_HANDLER( fgvideoram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_decrypted[0xc000 + offset] = swap_bits_5_6(data);
decocass_fgvideoram_w(space, offset, data);
}
static WRITE8_HANDLER( fgcolorram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_decrypted[0xc400 + offset] = swap_bits_5_6(data);
decocass_colorram_w(space, offset, data);
}
static WRITE8_HANDLER( tileram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_decrypted[0xd000 + offset] = swap_bits_5_6(data);
decocass_tileram_w(space, offset, data);
}
static WRITE8_HANDLER( objectram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_decrypted[0xd800 + offset] = swap_bits_5_6(data);
decocass_objectram_w(space, offset, data);
}
@@ -102,14 +102,14 @@ static WRITE8_HANDLER( mirrorcolorram_w ) { offset = ((offset >> 5) & 0x1f) | ((
static READ8_HANDLER( mirrorvideoram_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
return state->m_fgvideoram[offset];
}
static READ8_HANDLER( mirrorcolorram_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
return state->m_colorram[offset];
}
@@ -1600,15 +1600,15 @@ ROM_END
DRIVER_INIT_MEMBER(decocass_state,decocass)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
int A;
/* allocate memory and mark all RAM regions with their decrypted pointers */
m_decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
- space->set_decrypted_region(0x0000, 0xc7ff, &m_decrypted[0x0000]);
- space->set_decrypted_region(0xd000, 0xdbff, &m_decrypted[0xd000]);
- space->set_decrypted_region(0xf000, 0xffff, &m_decrypted[0xf000]);
+ space.set_decrypted_region(0x0000, 0xc7ff, &m_decrypted[0x0000]);
+ space.set_decrypted_region(0xd000, 0xdbff, &m_decrypted[0xd000]);
+ space.set_decrypted_region(0xf000, 0xffff, &m_decrypted[0xf000]);
/* Swap bits 5 & 6 for opcodes */
for (A = 0xf000; A < 0x10000; A++)
@@ -1654,7 +1654,7 @@ DRIVER_INIT_MEMBER(decocass_state,decocrom)
static READ8_HANDLER( cdsteljn_input_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 res;
static const char *const portnames[2][4] = {
{"P1_MP0", "P1_MP1", "P1_MP2", "P1_MP3"},
@@ -1663,14 +1663,14 @@ static READ8_HANDLER( cdsteljn_input_r )
if(offset & 6)
return decocass_input_r(space,offset);
- res = space->machine().root_device().ioport(portnames[offset & 1][state->m_mux_data])->read();
+ res = space.machine().root_device().ioport(portnames[offset & 1][state->m_mux_data])->read();
return res;
}
static WRITE8_HANDLER( cdsteljn_mux_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_mux_data = (data & 0xc) >> 2;
/* bit 0 and 1 are p1/p2 lamps */
diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c
index dc87182ec5a..247485ac1f5 100644
--- a/src/mame/drivers/discoboy.c
+++ b/src/mame/drivers/discoboy.c
@@ -206,7 +206,7 @@ void discoboy_setrombank( running_machine &machine, UINT8 data )
{
UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
data &= 0x2f;
- space->machine().root_device().membank("bank1")->set_base(&ROM[0x6000 + (data * 0x1000)] );
+ space.machine().root_device().membank("bank1")->set_base(&ROM[0x6000 + (data * 0x1000)] );
}
#endif
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index 8637f665d41..2c7ea4a5c98 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -347,8 +347,8 @@ Donkey Kong Junior Notes
*
*************************************/
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dk3_dma )
{
@@ -3139,17 +3139,17 @@ DRIVER_INIT_MEMBER(dkong_state,strtheat)
DRIVER_INIT_MEMBER(dkong_state,dkongx)
{
UINT8 *decrypted;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x5fff, "bank1" );
machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xffff, "bank2" );
- space->install_write_handler(0xe000, 0xe000, write8_delegate(FUNC(dkong_state::braze_a15_w),this));
+ space.install_write_handler(0xe000, 0xe000, write8_delegate(FUNC(dkong_state::braze_a15_w),this));
- space->install_read_handler(0xc800, 0xc800, read8_delegate(FUNC(dkong_state::braze_eeprom_r),this));
- space->install_write_handler(0xc800, 0xc800, write8_delegate(FUNC(dkong_state::braze_eeprom_w),this));
+ space.install_read_handler(0xc800, 0xc800, read8_delegate(FUNC(dkong_state::braze_eeprom_r),this));
+ space.install_write_handler(0xc800, 0xc800, write8_delegate(FUNC(dkong_state::braze_eeprom_w),this));
braze_decrypt_rom(machine(), decrypted);
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 9f71d5d9a4e..2d4c4b34525 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -125,7 +125,7 @@ READ32_MEMBER(eolith_state::eolith_custom_r)
bit 8 = ???
bit 9 = ???
*/
- eolith_speedup_read(&space);
+ eolith_speedup_read(space);
return (ioport("IN0")->read() & ~0x300) | (machine().rand() & 0x300);
}
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 0eb54fde3ac..9d35dea24eb 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -61,7 +61,7 @@ WRITE16_MEMBER(eolith16_state::eeprom_w)
READ16_MEMBER(eolith16_state::eolith16_custom_r)
{
- eolith_speedup_read(&space);
+ eolith_speedup_read(space);
return ioport("SPECIAL")->read();
}
diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c
index f4d9af60fdc..cd5b1abcd59 100644
--- a/src/mame/drivers/eolithsp.c
+++ b/src/mame/drivers/eolithsp.c
@@ -18,19 +18,19 @@ static int eolith_speedup_resume_scanline;
static int eolith_vblank = 0;
static int eolith_scanline = 0;
-void eolith_speedup_read(address_space *space)
+void eolith_speedup_read(address_space &space)
{
/* for debug */
- //if ((space->device().safe_pc()!=eolith_speedup_address) && (eolith_vblank!=1) )
- // printf("%s:eolith speedup_read data %02x\n",space->machine().describe_context(), eolith_vblank);
+ //if ((space.device().safe_pc()!=eolith_speedup_address) && (eolith_vblank!=1) )
+ // printf("%s:eolith speedup_read data %02x\n",space.machine().describe_context(), eolith_vblank);
if (eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline)
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
if ((pc==eolith_speedup_address) || (pc==eolith_speedup_address2))
{
- space->device().execute().spin_until_trigger(1000);
+ space.device().execute().spin_until_trigger(1000);
}
}
}
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index 47f0b283af2..24df2a13f69 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -1493,12 +1493,12 @@ DRIVER_INIT_MEMBER(exidy_state,pepper2)
DRIVER_INIT_MEMBER(exidy_state,fax)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
exidy_video_config(machine(), 0x04, 0x04, TRUE);
/* reset the ROM bank */
- fax_bank_select_w(*space,0,0);
+ fax_bank_select_w(space,0,0);
}
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index 286b0dcbcc9..fb85df50d96 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -95,9 +95,9 @@ READ16_MEMBER(exterm_state::exterm_host_data_r)
*
*************************************/
-static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 mem_mask)
+static UINT16 exterm_trackball_port_r(address_space &space, int which, UINT16 mem_mask)
{
- exterm_state *state = space->machine().driver_data<exterm_state>();
+ exterm_state *state = space.machine().driver_data<exterm_state>();
UINT16 port;
/* Read the fake input port */
@@ -125,13 +125,13 @@ static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 me
READ16_MEMBER(exterm_state::exterm_input_port_0_r)
{
- return exterm_trackball_port_r(&space, 0, mem_mask);
+ return exterm_trackball_port_r(space, 0, mem_mask);
}
READ16_MEMBER(exterm_state::exterm_input_port_1_r)
{
- return exterm_trackball_port_r(&space, 1, mem_mask);
+ return exterm_trackball_port_r(space, 1, mem_mask);
}
diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c
index f450071f0d1..22320ae46ef 100644
--- a/src/mame/drivers/famibox.c
+++ b/src/mame/drivers/famibox.c
@@ -174,7 +174,7 @@ WRITE8_MEMBER(famibox_state::sprite_dma_w)
{
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
int source = (data & 7);
- ppu->spriteram_dma(&space, source);
+ ppu->spriteram_dma(space, source);
}
READ8_MEMBER(famibox_state::psg_4015_r)
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index fb0cd8ecd6a..372a84265be 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -42,18 +42,18 @@ from 2.bin to 9.bin program eproms
static WRITE16_HANDLER( fcrash_soundlatch_w )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
state->m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
static WRITE8_HANDLER( fcrash_snd_bankswitch_w )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
state->m_msm_1->set_output_gain(0, (data & 0x08) ? 0.0 : 1.0);
state->m_msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0);
@@ -84,13 +84,13 @@ static void m5205_int2( device_t *device )
static WRITE8_HANDLER( fcrash_msm5205_0_data_w )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
state->m_sample_buffer1 = data;
}
static WRITE8_HANDLER( fcrash_msm5205_1_data_w )
{
- cps_state *state = space->machine().driver_data<cps_state>();
+ cps_state *state = space.machine().driver_data<cps_state>();
state->m_sample_buffer2 = data;
}
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 134ee49a208..ae6378af0a3 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -707,22 +707,22 @@ static void GCU_w(running_machine &machine, int chip, UINT32 offset, UINT32 data
static READ32_HANDLER(gcu0_r)
{
- return GCU_r(space->machine(), 0, offset, mem_mask);
+ return GCU_r(space.machine(), 0, offset, mem_mask);
}
static WRITE32_HANDLER(gcu0_w)
{
- GCU_w(space->machine(), 0, offset, data, mem_mask);
+ GCU_w(space.machine(), 0, offset, data, mem_mask);
}
static READ32_HANDLER(gcu1_r)
{
- return GCU_r(space->machine(), 1, offset, mem_mask);
+ return GCU_r(space.machine(), 1, offset, mem_mask);
}
static WRITE32_HANDLER(gcu1_w)
{
- GCU_w(space->machine(), 1, offset, data, mem_mask);
+ GCU_w(space.machine(), 1, offset, data, mem_mask);
}
/*****************************************************************************/
@@ -733,15 +733,15 @@ static READ32_HANDLER(input_r)
if (ACCESSING_BITS_24_31)
{
- r |= (space->machine().root_device().ioport("IN0")->read() & 0xff) << 24;
+ r |= (space.machine().root_device().ioport("IN0")->read() & 0xff) << 24;
}
if (ACCESSING_BITS_8_15)
{
- r |= (space->machine().root_device().ioport("IN1")->read() & 0xff) << 8;
+ r |= (space.machine().root_device().ioport("IN1")->read() & 0xff) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= (space->machine().root_device().ioport("IN2")->read() & 0xff);
+ r |= (space.machine().root_device().ioport("IN2")->read() & 0xff);
}
return r;
@@ -751,17 +751,17 @@ static READ32_HANDLER( sensor_r )
{
if (offset == 0)
{
- return space->machine().root_device().ioport("SENSOR1")->read() | 0x01000100;
+ return space.machine().root_device().ioport("SENSOR1")->read() | 0x01000100;
}
else
{
- return space->machine().root_device().ioport("SENSOR2")->read() | 0x01000100;
+ return space.machine().root_device().ioport("SENSOR2")->read() | 0x01000100;
}
}
static READ32_HANDLER(flashram_r)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
{
@@ -784,7 +784,7 @@ static READ32_HANDLER(flashram_r)
static WRITE32_HANDLER(flashram_w)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
if (ACCESSING_BITS_24_31)
{
state->m_flash[0]->write((offset*4)+0, (data >> 24) & 0xff);
@@ -805,7 +805,7 @@ static WRITE32_HANDLER(flashram_w)
static READ32_HANDLER(soundflash_r)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
UINT32 r = 0;
fujitsu_29f016a_device *chip;
if (offset >= 0 && offset < 0x200000/4)
@@ -840,7 +840,7 @@ static READ32_HANDLER(soundflash_r)
static WRITE32_HANDLER(soundflash_w)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
fujitsu_29f016a_device *chip;
if (offset >= 0 && offset < 0x200000/4)
{
@@ -1220,12 +1220,12 @@ static READ32_HANDLER( atapi_command_r )
// printf("atapi_command_r: %08X, %08X\n", offset, mem_mask);
if (ACCESSING_BITS_16_31)
{
- r = atapi_command_reg_r(space->machine(), offset*2);
+ r = atapi_command_reg_r(space.machine(), offset*2);
return ATAPI_ENDIAN(r) << 16;
}
else
{
- r = atapi_command_reg_r(space->machine(), (offset*2) + 1);
+ r = atapi_command_reg_r(space.machine(), (offset*2) + 1);
return ATAPI_ENDIAN(r) << 0;
}
}
@@ -1236,11 +1236,11 @@ static WRITE32_HANDLER( atapi_command_w )
if (ACCESSING_BITS_16_31)
{
- atapi_command_reg_w(space->machine(), offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
+ atapi_command_reg_w(space.machine(), offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
}
else
{
- atapi_command_reg_w(space->machine(), (offset*2) + 1, ATAPI_ENDIAN((data >> 0) & 0xffff));
+ atapi_command_reg_w(space.machine(), (offset*2) + 1, ATAPI_ENDIAN((data >> 0) & 0xffff));
}
}
@@ -1252,12 +1252,12 @@ static READ32_HANDLER( atapi_control_r )
if (ACCESSING_BITS_16_31)
{
- r = atapi_control_reg_r(space->machine(), offset*2);
+ r = atapi_control_reg_r(space.machine(), offset*2);
return ATAPI_ENDIAN(r) << 16;
}
else
{
- r = atapi_control_reg_r(space->machine(), (offset*2) + 1);
+ r = atapi_control_reg_r(space.machine(), (offset*2) + 1);
return ATAPI_ENDIAN(r) << 0;
}
}
@@ -1266,11 +1266,11 @@ static WRITE32_HANDLER( atapi_control_w )
{
if (ACCESSING_BITS_16_31)
{
- atapi_control_reg_w(space->machine(), offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
+ atapi_control_reg_w(space.machine(), offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
}
else
{
- atapi_control_reg_w(space->machine(), (offset*2) + 1, ATAPI_ENDIAN(data >> 0) & 0xff);
+ atapi_control_reg_w(space.machine(), (offset*2) + 1, ATAPI_ENDIAN(data >> 0) & 0xff);
}
}
@@ -1335,7 +1335,7 @@ static const int ppd_cab_data[2] = { 0x1, 0x9 };
static READ32_HANDLER( cabinet_r )
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
UINT32 r = 0;
// printf("cabinet_r: %08X, %08X\n", offset, mem_mask);
@@ -1361,11 +1361,11 @@ static READ32_HANDLER( keyboard_wheel_r )
{
if (offset == 0) // Keyboard Wheel (P1)
{
- return space->machine().root_device().ioport("WHEEL_P1")->read() << 24;
+ return space.machine().root_device().ioport("WHEEL_P1")->read() << 24;
}
else if (offset == 2) // Keyboard Wheel (P2)
{
- return space->machine().root_device().ioport("WHEEL_P2")->read() << 24;
+ return space.machine().root_device().ioport("WHEEL_P2")->read() << 24;
}
return 0;
@@ -1500,7 +1500,7 @@ static TIMER_CALLBACK( keyboard_timer_callback )
static READ32_HANDLER( extend_board_irq_r)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
@@ -1513,7 +1513,7 @@ static READ32_HANDLER( extend_board_irq_r)
static WRITE32_HANDLER( extend_board_irq_w )
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
// printf("extend_board_irq_w: %08X, %08X, %08X\n", data, offset, mem_mask);
if (ACCESSING_BITS_24_31)
@@ -1667,7 +1667,7 @@ static WRITE32_HANDLER( lamp_output3_ppp_w )
static READ32_HANDLER(ppc_spu_share_r)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
@@ -1692,7 +1692,7 @@ static READ32_HANDLER(ppc_spu_share_r)
static WRITE32_HANDLER(ppc_spu_share_w)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
if (ACCESSING_BITS_24_31)
{
state->m_spu_shared_ram[(offset * 4) + 0] = (data >> 24) & 0xff;
@@ -1714,13 +1714,13 @@ static WRITE32_HANDLER(ppc_spu_share_w)
#ifdef UNUSED_FUNCTION
static READ16_HANDLER(m68k_spu_share_r)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
return state->m_spu_shared_ram[offset] << 8;
}
static WRITE16_HANDLER(m68k_spu_share_w)
{
- firebeat_state *state = space->machine().driver_data<firebeat_state>();
+ firebeat_state *state = space.machine().driver_data<firebeat_state>();
state->m_spu_shared_ram[offset] = (data >> 8) & 0xff;
}
#endif
diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c
index bf4f45ccda8..4975c8d99a3 100644
--- a/src/mame/drivers/flstory.c
+++ b/src/mame/drivers/flstory.c
@@ -119,9 +119,9 @@ ADDRESS_MAP_END
CUSTOM_INPUT_MEMBER(flstory_state::victnine_mcu_status_bit01_r)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
- return (victnine_mcu_status_r(*space, 0) & 3);
+ return (victnine_mcu_status_r(space, 0) & 3);
}
static ADDRESS_MAP_START( victnine_map, AS_PROGRAM, 8, flstory_state )
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index 9dee82fcc60..4afeb21835e 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -164,9 +164,9 @@ WRITE8_MEMBER(foodf_state::digital_w)
m_nvram->store(data & 0x02);
if (!(data & 0x04))
- atarigen_scanline_int_ack_w(&space,0,0,0xffff);
+ atarigen_scanline_int_ack_w(space,0,0,0xffff);
if (!(data & 0x08))
- atarigen_video_int_ack_w(&space,0,0,0xffff);
+ atarigen_video_int_ack_w(space,0,0,0xffff);
output_set_led_value(0, (data >> 4) & 1);
output_set_led_value(1, (data >> 5) & 1);
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 536cc24bce0..592d8697410 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -1125,8 +1125,8 @@ ROM_END
DRIVER_INIT_MEMBER(freekick_state,gigasb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0xbfff, machine().root_device().memregion("maincpu")->base() + 0x10000);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0xbfff, machine().root_device().memregion("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c
index 484036967e5..5175865d59c 100644
--- a/src/mame/drivers/funworld.c
+++ b/src/mame/drivers/funworld.c
@@ -4535,7 +4535,7 @@ DRIVER_INIT_MEMBER(funworld_state,multiwin)
******************************************************/
{
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4553,7 +4553,7 @@ DRIVER_INIT_MEMBER(funworld_state,multiwin)
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x8000, 0xffff, machine().root_device().memregion("maincpu")->base() + 0x18000);
+ space.set_decrypted_region(0x8000, 0xffff, machine().root_device().memregion("maincpu")->base() + 0x18000);
}
DRIVER_INIT_MEMBER(funworld_state,royalcdc)
@@ -4568,7 +4568,7 @@ DRIVER_INIT_MEMBER(funworld_state,royalcdc)
******************************************************/
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4606,7 +4606,7 @@ DRIVER_INIT_MEMBER(funworld_state,royalcdc)
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x6000, 0xffff, machine().root_device().memregion("maincpu")->base() + 0x16000);
+ space.set_decrypted_region(0x6000, 0xffff, machine().root_device().memregion("maincpu")->base() + 0x16000);
}
diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c
index c3e06876285..93f4e4172a0 100644
--- a/src/mame/drivers/gaelco.c
+++ b/src/mame/drivers/gaelco.c
@@ -75,7 +75,7 @@ WRITE16_MEMBER(gaelco_state::gaelco_vram_encrypted_w)
{
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
- data = gaelco_decrypt(&space, offset, data, 0x0f, 0x4228);
+ data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
COMBINE_DATA(&m_videoram[offset]);
m_tilemap[offset >> 11]->mark_tile_dirty(((offset << 1) & 0x0fff) >> 2);
@@ -86,7 +86,7 @@ WRITE16_MEMBER(gaelco_state::gaelco_encrypted_w)
{
// mame_printf_debug("gaelco_encrypted_w!!\n");
- data = gaelco_decrypt(&space, offset, data, 0x0f, 0x4228);
+ data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
COMBINE_DATA(&m_screen[offset]);
}
@@ -96,7 +96,7 @@ WRITE16_MEMBER(gaelco_state::thoop_vram_encrypted_w)
{
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
- data = gaelco_decrypt(&space, offset, data, 0x0e, 0x4228);
+ data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
COMBINE_DATA(&m_videoram[offset]);
m_tilemap[offset >> 11]->mark_tile_dirty(((offset << 1) & 0x0fff) >> 2);
@@ -106,7 +106,7 @@ WRITE16_MEMBER(gaelco_state::thoop_encrypted_w)
{
// mame_printf_debug("gaelco_encrypted_w!!\n");
- data = gaelco_decrypt(&space, offset, data, 0x0e, 0x4228);
+ data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
COMBINE_DATA(&m_screen[offset]);
}
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index d40b8c4b89a..fb749f8c19c 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -889,12 +889,12 @@ MACHINE_START_MEMBER(galaga_state,galaga)
static void bosco_latch_reset(running_machine &machine)
{
galaga_state *state = machine.driver_data<galaga_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
for (i = 0;i < 8;i++)
- state->bosco_latch_w(*space,i,0);
+ state->bosco_latch_w(space,i,0);
}
MACHINE_RESET_MEMBER(galaga_state,galaga)
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index b4bb2018747..39aa3c537f5 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -1066,17 +1066,17 @@ static I8255A_INTERFACE( scorpion_ppi8255_1_intf )
INPUT_CHANGED_MEMBER(galaxian_state::gmgalax_game_changed)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* new value is the selected game */
m_gmgalax_selected_game = newval;
/* select the bank and graphics bank based on it */
membank("bank1")->set_entry(m_gmgalax_selected_game);
- galaxian_gfxbank_w(*space, 0, m_gmgalax_selected_game);
+ galaxian_gfxbank_w(space, 0, m_gmgalax_selected_game);
/* reset the stars */
- galaxian_stars_enable_w(*space, 0, 0);
+ galaxian_stars_enable_w(space, 0, 0);
/* reset the CPU */
machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
@@ -2742,11 +2742,11 @@ static void common_init(
static void unmap_galaxian_sound(running_machine &machine, offs_t base)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(base + 0x0004, base + 0x0007, 0, 0x07f8);
- space->unmap_write(base + 0x0800, base + 0x0807, 0, 0x07f8);
- space->unmap_write(base + 0x1800, base + 0x1800, 0, 0x07ff);
+ space.unmap_write(base + 0x0004, base + 0x0007, 0, 0x07f8);
+ space.unmap_write(base + 0x0800, base + 0x0807, 0, 0x07f8);
+ space.unmap_write(base + 0x1800, base + 0x1800, 0, 0x07ff);
}
@@ -2765,37 +2765,37 @@ DRIVER_INIT_MEMBER(galaxian_state,galaxian)
DRIVER_INIT_MEMBER(galaxian_state,nolock)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
/* ...but coin lockout disabled/disconnected */
- space->unmap_write(0x6002, 0x6002, 0, 0x7f8);
+ space.unmap_write(0x6002, 0x6002, 0, 0x7f8);
}
DRIVER_INIT_MEMBER(galaxian_state,azurian)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* yellow bullets instead of white ones */
common_init(machine(), scramble_draw_bullet, galaxian_draw_background, NULL, NULL);
/* coin lockout disabled */
- space->unmap_write(0x6002, 0x6002, 0, 0x7f8);
+ space.unmap_write(0x6002, 0x6002, 0, 0x7f8);
}
DRIVER_INIT_MEMBER(galaxian_state,gmgalax)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info);
/* ROM is banked */
- space->install_read_bank(0x0000, 0x3fff, "bank1");
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
@@ -2806,37 +2806,37 @@ DRIVER_INIT_MEMBER(galaxian_state,gmgalax)
DRIVER_INIT_MEMBER(galaxian_state,pisces)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- space->install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
+ space.install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
}
DRIVER_INIT_MEMBER(galaxian_state,batman2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- space->install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
+ space.install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
}
DRIVER_INIT_MEMBER(galaxian_state,frogg)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
common_init(machine(), galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
/* ...but needs a full 2k of RAM */
- space->install_ram(0x4000, 0x47ff);
+ space.install_ram(0x4000, 0x47ff);
}
@@ -2866,19 +2866,19 @@ DRIVER_INIT_MEMBER(galaxian_state,mooncrsu)
DRIVER_INIT_MEMBER(galaxian_state,mooncrgx)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* LEDs and coin lockout replaced by graphics banking */
- space->install_write_handler(0x6000, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
+ space.install_write_handler(0x6000, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
}
DRIVER_INIT_MEMBER(galaxian_state,moonqsr)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
/* video extensions */
@@ -2886,7 +2886,7 @@ DRIVER_INIT_MEMBER(galaxian_state,moonqsr)
/* decrypt program code */
decode_mooncrst(machine(), 0x8000, decrypt);
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
}
WRITE8_MEMBER(galaxian_state::artic_gfxbank_w)
@@ -2896,13 +2896,13 @@ WRITE8_MEMBER(galaxian_state::artic_gfxbank_w)
DRIVER_INIT_MEMBER(galaxian_state,pacmanbl)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
/* ...but coin lockout disabled/disconnected */
- space->install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::artic_gfxbank_w),this));
+ space.install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::artic_gfxbank_w),this));
}
READ8_MEMBER(galaxian_state::tenspot_dsw_read)
@@ -2956,7 +2956,7 @@ void galaxian_state::tenspot_set_game_bank(running_machine& machine, int bank, i
DRIVER_INIT_MEMBER(galaxian_state,tenspot)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* these are needed for batman part 2 to work properly, this banking is probably a property of the artic board,
which tenspot appears to have copied */
@@ -2965,18 +2965,18 @@ DRIVER_INIT_MEMBER(galaxian_state,tenspot)
//common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- //space->install_legacy_write_handler(0x6002, 0x6002, 0, 0x7f8, FUNC(galaxian_gfxbank_w));
+ //space.install_legacy_write_handler(0x6002, 0x6002, 0, 0x7f8, FUNC(galaxian_gfxbank_w));
DRIVER_INIT_CALL(galaxian);
- space->install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::artic_gfxbank_w),this));
+ space.install_write_handler(0x6002, 0x6002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::artic_gfxbank_w),this));
m_tenspot_current_game = 0;
tenspot_set_game_bank(machine(), m_tenspot_current_game, 0);
- space->install_read_handler(0x7000, 0x7000, read8_delegate(FUNC(galaxian_state::tenspot_dsw_read),this));
+ space.install_read_handler(0x7000, 0x7000, read8_delegate(FUNC(galaxian_state::tenspot_dsw_read),this));
}
@@ -2993,7 +2993,7 @@ DRIVER_INIT_MEMBER(galaxian_state,devilfsg)
DRIVER_INIT_MEMBER(galaxian_state,zigzag)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), NULL, galaxian_draw_background, NULL, NULL);
@@ -3003,28 +3003,28 @@ DRIVER_INIT_MEMBER(galaxian_state,zigzag)
m_numspritegens = 2;
/* make ROMs 2 & 3 swappable */
- space->install_read_bank(0x2000, 0x2fff, "bank1");
- space->install_read_bank(0x3000, 0x3fff, "bank2");
+ space.install_read_bank(0x2000, 0x2fff, "bank1");
+ space.install_read_bank(0x3000, 0x3fff, "bank2");
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
/* also re-install the fixed ROM area as a bank in order to inform the memory system that
the fixed area only extends to 0x1fff */
- space->install_read_bank(0x0000, 0x1fff, "bank3");
+ space.install_read_bank(0x0000, 0x1fff, "bank3");
membank("bank3")->set_base(memregion("maincpu")->base() + 0x0000);
/* handler for doing the swaps */
- space->install_write_handler(0x7002, 0x7002, 0, 0x07f8, write8_delegate(FUNC(galaxian_state::zigzag_bankswap_w),this));
- zigzag_bankswap_w(*space, 0, 0);
+ space.install_write_handler(0x7002, 0x7002, 0, 0x07f8, write8_delegate(FUNC(galaxian_state::zigzag_bankswap_w),this));
+ zigzag_bankswap_w(space, 0, 0);
/* coin lockout disabled */
- space->unmap_write(0x6002, 0x6002, 0, 0x7f8);
+ space.unmap_write(0x6002, 0x6002, 0, 0x7f8);
/* remove the galaxian sound hardware */
unmap_galaxian_sound(machine(), 0x6000);
/* install our AY-8910 handler */
- space->install_write_handler(0x4800, 0x4fff, write8_delegate(FUNC(galaxian_state::zigzag_ay8910_w),this));
+ space.install_write_handler(0x4800, 0x4fff, write8_delegate(FUNC(galaxian_state::zigzag_ay8910_w),this));
}
@@ -3037,15 +3037,15 @@ DRIVER_INIT_MEMBER(galaxian_state,jumpbug)
DRIVER_INIT_MEMBER(galaxian_state,checkman)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
address_space *iospace = machine().device("maincpu")->memory().space(AS_IO);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- space->unmap_write(0xb000, 0xb000, 0, 0x7f8);
- space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
+ space.unmap_write(0xb000, 0xb000, 0, 0x7f8);
+ space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
/* attach the sound command handler */
iospace->install_write_handler(0x00, 0x00, 0, 0xffff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this));
@@ -3057,50 +3057,50 @@ DRIVER_INIT_MEMBER(galaxian_state,checkman)
DRIVER_INIT_MEMBER(galaxian_state,checkmaj)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
/* attach the sound command handler */
- space->install_write_handler(0x7800, 0x7800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this));
+ space.install_write_handler(0x7800, 0x7800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this));
/* for the title screen */
- space->install_read_handler(0x3800, 0x3800, read8_delegate(FUNC(galaxian_state::checkmaj_protection_r),this));
+ space.install_read_handler(0x3800, 0x3800, read8_delegate(FUNC(galaxian_state::checkmaj_protection_r),this));
}
DRIVER_INIT_MEMBER(galaxian_state,dingo)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
/* attach the sound command handler */
- space->install_write_handler(0x7800, 0x7800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this));
+ space.install_write_handler(0x7800, 0x7800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this));
- space->install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::dingo_3000_r),this));
- space->install_read_handler(0x3035, 0x3035, read8_delegate(FUNC(galaxian_state::dingo_3035_r),this));
+ space.install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::dingo_3000_r),this));
+ space.install_read_handler(0x3035, 0x3035, read8_delegate(FUNC(galaxian_state::dingo_3035_r),this));
}
DRIVER_INIT_MEMBER(galaxian_state,dingoe)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
address_space *iospace = machine().device("maincpu")->memory().space(AS_IO);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- space->unmap_write(0xb000, 0xb000, 0, 0x7f8);
- space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
+ space.unmap_write(0xb000, 0xb000, 0, 0x7f8);
+ space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
/* attach the sound command handler */
iospace->install_write_handler(0x00, 0x00, 0, 0xffff, write8_delegate(FUNC(galaxian_state::checkman_sound_command_w),this));
- space->install_read_handler(0x3001, 0x3001, read8_delegate(FUNC(galaxian_state::dingoe_3001_r),this)); /* Protection check */
+ space.install_read_handler(0x3001, 0x3001, read8_delegate(FUNC(galaxian_state::dingoe_3001_r),this)); /* Protection check */
/* decrypt program code */
decode_dingoe(machine());
@@ -3109,45 +3109,45 @@ DRIVER_INIT_MEMBER(galaxian_state,dingoe)
DRIVER_INIT_MEMBER(galaxian_state,skybase)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
/* coin lockout replaced by graphics bank */
- space->install_write_handler(0xa002, 0xa002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
+ space.install_write_handler(0xa002, 0xa002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::galaxian_gfxbank_w),this));
/* needs a full 2k of RAM */
- space->install_ram(0x8000, 0x87ff);
+ space.install_ram(0x8000, 0x87ff);
/* extend ROM */
- space->install_rom(0x0000, 0x5fff, memregion("maincpu")->base());
+ space.install_rom(0x0000, 0x5fff, memregion("maincpu")->base());
}
DRIVER_INIT_MEMBER(galaxian_state,kong)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, upper_extend_sprite_info);
/* needs a full 2k of RAM */
- space->install_ram(0x8000, 0x87ff);
+ space.install_ram(0x8000, 0x87ff);
/* extend ROM */
- space->install_rom(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base());
+ space.install_rom(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base());
}
static void mshuttle_decode(running_machine &machine, const UINT8 convtable[8][16])
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
int A;
- space->set_decrypted_region(0x0000, 0xffff, decrypt);
+ space.set_decrypted_region(0x0000, 0xffff, decrypt);
for (A = 0x0000;A < 0x10000;A++)
{
@@ -3254,18 +3254,18 @@ DRIVER_INIT_MEMBER(galaxian_state,fantastc)
DRIVER_INIT_MEMBER(galaxian_state,kingball)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
/* disable the stars */
- space->unmap_write(0xb004, 0xb004, 0, 0x07f8);
+ space.unmap_write(0xb004, 0xb004, 0, 0x07f8);
- space->install_write_handler(0xb000, 0xb000, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_sound1_w),this));
- space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
- space->install_write_handler(0xb002, 0xb002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_sound2_w),this));
- space->install_write_handler(0xb003, 0xb003, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_speech_dip_w),this));
+ space.install_write_handler(0xb000, 0xb000, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_sound1_w),this));
+ space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
+ space.install_write_handler(0xb002, 0xb002, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_sound2_w),this));
+ space.install_write_handler(0xb003, 0xb003, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::kingball_speech_dip_w),this));
state_save_register_global(machine(), m_kingball_speech_dip);
state_save_register_global(machine(), m_kingball_sound);
@@ -3274,41 +3274,41 @@ DRIVER_INIT_MEMBER(galaxian_state,kingball)
DRIVER_INIT_MEMBER(galaxian_state,scorpnmc)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- space->unmap_write(0xb000, 0xb000, 0, 0x7f8);
- space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
+ space.unmap_write(0xb000, 0xb000, 0, 0x7f8);
+ space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
/* extra ROM */
- space->install_rom(0x5000, 0x67ff, memregion("maincpu")->base() + 0x5000);
+ space.install_rom(0x5000, 0x67ff, memregion("maincpu")->base() + 0x5000);
/* install RAM at $4000-$4800 */
- space->install_ram(0x4000, 0x47ff);
+ space.install_ram(0x4000, 0x47ff);
/* doesn't appear to use original RAM */
- space->unmap_readwrite(0x8000, 0x87ff);
+ space.unmap_readwrite(0x8000, 0x87ff);
}
DRIVER_INIT_MEMBER(galaxian_state,thepitm)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* move the interrupt enable from $b000 to $b001 */
- space->unmap_write(0xb000, 0xb000, 0, 0x7f8);
- space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
+ space.unmap_write(0xb000, 0xb000, 0, 0x7f8);
+ space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::irq_enable_w),this));
/* disable the stars */
- space->unmap_write(0xb004, 0xb004, 0, 0x07f8);
+ space.unmap_write(0xb004, 0xb004, 0, 0x07f8);
/* extend ROM */
- space->install_rom(0x0000, 0x47ff, memregion("maincpu")->base());
+ space.install_rom(0x0000, 0x47ff, memregion("maincpu")->base());
}
/*************************************
@@ -3319,13 +3319,13 @@ DRIVER_INIT_MEMBER(galaxian_state,thepitm)
DRIVER_INIT_MEMBER(galaxian_state,theend)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), theend_draw_bullet, galaxian_draw_background, NULL, NULL);
/* coin counter on the upper bit of port C */
- space->unmap_write(0x6802, 0x6802, 0, 0x7f8);
+ space.unmap_write(0x6802, 0x6802, 0, 0x7f8);
}
@@ -3338,22 +3338,22 @@ DRIVER_INIT_MEMBER(galaxian_state,scramble)
DRIVER_INIT_MEMBER(galaxian_state,explorer)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), scramble_draw_bullet, scramble_draw_background, NULL, NULL);
/* watchdog works for writes as well? (or is it just disabled?) */
- space->install_write_handler(0x7000, 0x7000, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::watchdog_reset_w),this));
+ space.install_write_handler(0x7000, 0x7000, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::watchdog_reset_w),this));
/* I/O appears to be direct, not via PPIs */
- space->unmap_readwrite(0x8000, 0xffff);
- space->install_read_port(0x8000, 0x8000, 0, 0xffc, "IN0");
- space->install_read_port(0x8001, 0x8001, 0, 0xffc, "IN1");
- space->install_read_port(0x8002, 0x8002, 0, 0xffc, "IN2");
- space->install_read_port(0x8003, 0x8003, 0, 0xffc, "IN3");
- space->install_write_handler(0x8000, 0x8000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::soundlatch_byte_w),this));
- space->install_write_handler(0x9000, 0x9000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::explorer_sound_control_w),this));
+ space.unmap_readwrite(0x8000, 0xffff);
+ space.install_read_port(0x8000, 0x8000, 0, 0xffc, "IN0");
+ space.install_read_port(0x8001, 0x8001, 0, 0xffc, "IN1");
+ space.install_read_port(0x8002, 0x8002, 0, 0xffc, "IN2");
+ space.install_read_port(0x8003, 0x8003, 0, 0xffc, "IN3");
+ space.install_write_handler(0x8000, 0x8000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::soundlatch_byte_w),this));
+ space.install_write_handler(0x9000, 0x9000, 0, 0xfff, write8_delegate(FUNC(galaxian_state::explorer_sound_control_w),this));
}
@@ -3371,14 +3371,14 @@ DRIVER_INIT_MEMBER(galaxian_state,sfx)
DRIVER_INIT_MEMBER(galaxian_state,atlantis)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), scramble_draw_bullet, scramble_draw_background, NULL, NULL);
/* watchdog is at $7800? (or is it just disabled?) */
- space->unmap_read(0x7000, 0x7000, 0, 0x7ff);
- space->install_read_handler(0x7800, 0x7800, 0, 0x7ff, read8_delegate(FUNC(galaxian_state::watchdog_reset_r),this));
+ space.unmap_read(0x7000, 0x7000, 0, 0x7ff);
+ space.install_read_handler(0x7800, 0x7800, 0, 0x7ff, read8_delegate(FUNC(galaxian_state::watchdog_reset_r),this));
}
@@ -3413,16 +3413,16 @@ DRIVER_INIT_MEMBER(galaxian_state,frogger)
DRIVER_INIT_MEMBER(galaxian_state,froggrmc)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine(), NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
- space->install_write_handler(0xa800, 0xa800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::soundlatch_byte_w),this));
- space->install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::froggrmc_sound_control_w),this));
+ space.install_write_handler(0xa800, 0xa800, 0, 0x7ff, write8_delegate(FUNC(galaxian_state::soundlatch_byte_w),this));
+ space.install_write_handler(0xb001, 0xb001, 0, 0x7f8, write8_delegate(FUNC(galaxian_state::froggrmc_sound_control_w),this));
/* actually needs 2k of RAM */
- space->install_ram(0x8000, 0x87ff);
+ space.install_ram(0x8000, 0x87ff);
/* decrypt */
decode_frogger_sound(machine());
@@ -3458,7 +3458,7 @@ DRIVER_INIT_MEMBER(galaxian_state,amidar)
DRIVER_INIT_MEMBER(galaxian_state,scorpion)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
common_init(machine(), scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
@@ -3466,11 +3466,11 @@ DRIVER_INIT_MEMBER(galaxian_state,scorpion)
machine().device("audiocpu")->memory().space(AS_IO)->install_readwrite_handler(0x00, 0xff, read8_delegate(FUNC(galaxian_state::scorpion_ay8910_r),this), write8_delegate(FUNC(galaxian_state::scorpion_ay8910_w),this));
/* extra ROM */
- space->install_read_bank(0x5800, 0x67ff, "bank1");
+ space.install_read_bank(0x5800, 0x67ff, "bank1");
membank("bank1")->set_base(memregion("maincpu")->base() + 0x5800);
/* no background related */
-// space->nop_write(0x6803, 0x6803);
+// space.nop_write(0x6803, 0x6803);
machine().device("audiocpu")->memory().space(AS_PROGRAM)->install_read_handler(0x3000, 0x3000, read8_delegate(FUNC(galaxian_state::scorpion_digitalker_intr_r),this));
/*
diff --git a/src/mame/drivers/galivan.c b/src/mame/drivers/galivan.c
index 78089123b39..aa185cfe993 100644
--- a/src/mame/drivers/galivan.c
+++ b/src/mame/drivers/galivan.c
@@ -92,7 +92,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(galivan_state::blit_trigger_w)
{
- nb_1414m4_exec(&space,(m_videoram[0] << 8) | (m_videoram[1] & 0xff),m_videoram,m_scrollx,m_scrolly,m_tx_tilemap);
+ nb_1414m4_exec(space,(m_videoram[0] << 8) | (m_videoram[1] & 0xff),m_videoram,m_scrollx,m_scrolly,m_tx_tilemap);
}
static ADDRESS_MAP_START( ninjemak_io_map, AS_IO, 8, galivan_state )
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 04ccbe53df2..48905e69e4f 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -207,7 +207,7 @@ WRITE16_MEMBER(galpanic_state::galpanic_bgvideoram_mirror_w)
for(i = 0; i < 8; i++)
{
// or offset + i * 0x2000 ?
- galpanic_bgvideoram_w(&space, offset * 8 + i, data, mem_mask);
+ galpanic_bgvideoram_w(space, offset * 8 + i, data, mem_mask);
}
}
diff --git a/src/mame/drivers/gamtor.c b/src/mame/drivers/gamtor.c
index f40a65ba099..339c221f89f 100644
--- a/src/mame/drivers/gamtor.c
+++ b/src/mame/drivers/gamtor.c
@@ -1254,7 +1254,7 @@ static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color
DRIVER_INIT_MEMBER(gaminator_state,gaminator)
{
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_gamtor_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x44000000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x40000000);
+ pc_vga_gamtor_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x44000000, *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x40000000);
}
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 597c7e13ec6..6bfb7d601d8 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -145,7 +145,7 @@ static void update_interrupts(running_machine &machine)
static void scanline_update(screen_device &screen, int scanline)
{
- address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* sound IRQ is on 32V */
if (scanline & 32)
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index a05e5ff1ca8..079b2eb697d 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -202,14 +202,14 @@ WRITE8_MEMBER(gladiatr_state::gladiatr_bankswitch_w)
static READ8_HANDLER( gladiator_dsw1_r )
{
- int orig = space->machine().root_device().ioport("DSW1")->read()^0xff;
+ int orig = space.machine().root_device().ioport("DSW1")->read()^0xff;
return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
}
static READ8_HANDLER( gladiator_dsw2_r )
{
- int orig = space->machine().root_device().ioport("DSW2")->read()^0xff;
+ int orig = space.machine().root_device().ioport("DSW2")->read()^0xff;
return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
}
@@ -218,15 +218,15 @@ static READ8_HANDLER( gladiator_controls_r )
{
int coins = 0;
- if( space->machine().root_device().ioport("COINS")->read() & 0xc0 ) coins = 0x80;
+ if( space.machine().root_device().ioport("COINS")->read() & 0xc0 ) coins = 0x80;
switch(offset)
{
case 0x01: /* start button , coins */
- return space->machine().root_device().ioport("IN0")->read() | coins;
+ return space.machine().root_device().ioport("IN0")->read() | coins;
case 0x02: /* Player 1 Controller , coins */
- return space->machine().root_device().ioport("IN1")->read() | coins;
+ return space.machine().root_device().ioport("IN1")->read() | coins;
case 0x04: /* Player 2 Controller , coins */
- return space->machine().root_device().ioport("IN2")->read() | coins;
+ return space.machine().root_device().ioport("IN2")->read() | coins;
}
/* unknown */
return 0;
@@ -237,7 +237,7 @@ static READ8_HANDLER( gladiator_button3_r )
switch(offset)
{
case 0x01: /* button 3 */
- return space->machine().root_device().ioport("IN3")->read();
+ return space.machine().root_device().ioport("IN3")->read();
}
/* unknown */
return 0;
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index f4534379ccb..6aa47103f60 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -191,13 +191,13 @@ static READ8_HANDLER( gsword_8741_2_r )
switch (offset)
{
case 0x01: /* start button , coins */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
case 0x02: /* Player 1 Controller */
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x04: /* Player 2 Controller */
- return space->machine().root_device().ioport("IN3")->read();
+ return space.machine().root_device().ioport("IN3")->read();
// default:
-// logerror("8741-2 unknown read %d PC=%04x\n",offset,space->device().safe_pc());
+// logerror("8741-2 unknown read %d PC=%04x\n",offset,space.device().safe_pc());
}
/* unknown */
return 0;
@@ -208,14 +208,14 @@ static READ8_HANDLER( gsword_8741_3_r )
switch (offset)
{
case 0x01: /* start button */
- return space->machine().root_device().ioport("IN2")->read();
+ return space.machine().root_device().ioport("IN2")->read();
case 0x02: /* Player 1 Controller? */
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x04: /* Player 2 Controller? */
- return space->machine().root_device().ioport("IN3")->read();
+ return space.machine().root_device().ioport("IN3")->read();
}
/* unknown */
-// logerror("8741-3 unknown read %d PC=%04x\n",offset,space->device().safe_pc());
+// logerror("8741-3 unknown read %d PC=%04x\n",offset,space.device().safe_pc());
return 0;
}
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index fec1fcf027c..8471ab4a51c 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -157,10 +157,10 @@ WRITE16_MEMBER(guab_state::guab_tms34061_w)
col = offset <<= 1;
if (ACCESSING_BITS_8_15)
- tms34061_w(&space, col, row, func, data >> 8);
+ tms34061_w(space, col, row, func, data >> 8);
if (ACCESSING_BITS_0_7)
- tms34061_w(&space, col | 1, row, func, data & 0xff);
+ tms34061_w(space, col | 1, row, func, data & 0xff);
}
@@ -177,10 +177,10 @@ READ16_MEMBER(guab_state::guab_tms34061_r)
col = offset <<= 1;
if (ACCESSING_BITS_8_15)
- data |= tms34061_r(&space, col, row, func) << 8;
+ data |= tms34061_r(space, col, row, func) << 8;
if (ACCESSING_BITS_0_7)
- data |= tms34061_r(&space, col | 1, row, func);
+ data |= tms34061_r(space, col | 1, row, func);
return data;
}
@@ -607,11 +607,11 @@ INPUT_CHANGED_MEMBER(guab_state::coin_inserted)
if (newval == 0)
{
UINT32 credit;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Get the current credit value and add the new coin value */
- credit = space->read_dword(0x8002c) + (UINT32)(FPTR)param;
- space->write_dword(0x8002c, credit);
+ credit = space.read_dword(0x8002c) + (UINT32)(FPTR)param;
+ space.write_dword(0x8002c, credit);
}
}
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 9a900d659bf..558b3297c30 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -563,9 +563,9 @@ READ32_MEMBER(hng64_state::hng64_sysregs_r)
}
/* preliminary dma code, dma is used to copy program code -> ram */
-static void hng64_do_dma(address_space *space)
+static void hng64_do_dma(address_space &space)
{
- hng64_state *state = space->machine().driver_data<hng64_state>();
+ hng64_state *state = space.machine().driver_data<hng64_state>();
//printf("Performing DMA Start %08x Len %08x Dst %08x\n", state->m_dma_start, state->m_dma_len, state->m_dma_dst);
@@ -573,8 +573,8 @@ static void hng64_do_dma(address_space *space)
{
UINT32 dat;
- dat = space->read_dword(state->m_dma_start);
- space->write_dword(state->m_dma_dst, dat);
+ dat = space.read_dword(state->m_dma_start);
+ space.write_dword(state->m_dma_dst, dat);
state->m_dma_start += 4;
state->m_dma_dst += 4;
state->m_dma_len--;
@@ -621,7 +621,7 @@ WRITE32_MEMBER(hng64_state::hng64_sysregs_w)
case 0x1214: m_dma_dst = m_sysregs[offset]; break;
case 0x1224:
m_dma_len = m_sysregs[offset];
- hng64_do_dma(&space);
+ hng64_do_dma(space);
break;
//default:
// printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], space.device().safe_pc());
@@ -1806,8 +1806,8 @@ void hng64_state::machine_reset()
KL5C80_virtual_mem_sync(this);
- address_space *space = machine().device<z80_device>("comm")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(hng64_state::KL5C80_direct_handler), this));
+ address_space &space = *machine().device<z80_device>("comm")->space(AS_PROGRAM);
+ space.set_direct_update_handler(direct_update_delegate(FUNC(hng64_state::KL5C80_direct_handler), this));
machine().device("comm")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip
// machine().device("comm")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner...
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index 5f9bfb0b55f..eeb0c492420 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -1212,10 +1212,10 @@ MACHINE_RESET_MEMBER(homedata_state,homedata)
MACHINE_RESET_MEMBER(homedata_state,pteacher)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* on reset, ports are set as input (high impedance), therefore 0xff output */
- pteacher_upd7807_portc_w(*space, 0, 0xff);
+ pteacher_upd7807_portc_w(space, 0, 0xff);
MACHINE_RESET_CALL_MEMBER(homedata);
@@ -1228,10 +1228,10 @@ MACHINE_RESET_MEMBER(homedata_state,pteacher)
MACHINE_RESET_MEMBER(homedata_state,reikaids)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* on reset, ports are set as input (high impedance), therefore 0xff output */
- reikaids_upd7807_portc_w(*space, 0, 0xff);
+ reikaids_upd7807_portc_w(space, 0, 0xff);
MACHINE_RESET_CALL_MEMBER(homedata);
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index 0763209c4fc..c631448ed08 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -218,8 +218,8 @@ DRIVER_INIT_MEMBER(md_cons_state,hshavoc)
*/
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->nop_write(0x200000, 0x201fff);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.nop_write(0x200000, 0x201fff);
}
DRIVER_INIT_CALL(megadriv);
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index 490feac9ce5..4647425ad8c 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -268,15 +268,15 @@ INLINE int blt_read( const UINT8 *ROM, const int offs )
return ROM[offs];
}
-void hyprduel_state::blt_write( address_space *space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask )
+void hyprduel_state::blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask )
{
switch( tmap )
{
- case 1: hyprduel_vram_0_w(*space, offs,data,mask); break;
- case 2: hyprduel_vram_1_w(*space, offs, data, mask); break;
- case 3: hyprduel_vram_2_w(*space, offs, data, mask); break;
+ case 1: hyprduel_vram_0_w(space, offs,data,mask); break;
+ case 2: hyprduel_vram_1_w(space, offs, data, mask); break;
+ case 3: hyprduel_vram_2_w(space, offs, data, mask); break;
}
-// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine().describe_context(), tmap, offs, data, mask);
+// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space.machine().describe_context(), tmap, offs, data, mask);
}
@@ -344,7 +344,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
src_offs++;
dst_offs &= 0xffff;
- blt_write(&space, tmap, dst_offs, b2, mask);
+ blt_write(space, tmap, dst_offs, b2, mask);
dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1)));
}
break;
@@ -360,7 +360,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
while (count--)
{
dst_offs &= 0xffff;
- blt_write(&space, tmap, dst_offs, b2 << shift, mask);
+ blt_write(space, tmap, dst_offs, b2 << shift, mask);
dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1)));
b2++;
}
@@ -377,7 +377,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
while (count--)
{
dst_offs &= 0xffff;
- blt_write(&space, tmap, dst_offs, b2, mask);
+ blt_write(space, tmap, dst_offs, b2, mask);
dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1)));
}
break;
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index cb8f12a2fa0..21fcba48d82 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -1290,12 +1290,12 @@ ROM_END
static void treahunt_decode( running_machine &machine )
{
int A;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000);
int data;
- space->set_decrypted_region(0x0000, 0x3fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x3fff, decrypt);
/* Thanks to Mike Balfour for helping out with the decryption */
for (A = 0; A < 0x4000; A++)
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index da4aca56c76..0eb92c796d2 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -730,7 +730,7 @@ WRITE16_MEMBER(jalmah_state::urashima_dma_w)
static void daireika_palette_dma(running_machine &machine, UINT16 val)
{
//jalmah_state *state = machine.driver_data<jalmah_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 index_1, index_2, src_addr, tmp_addr;
/*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */
/*a1=88000*/
@@ -739,10 +739,10 @@ static void daireika_palette_dma(running_machine &machine, UINT16 val)
for(index_1 = 0; index_1 < 0x200; index_1 += 0x20)
{
tmp_addr = src_addr;
- src_addr = space->read_dword(src_addr);
+ src_addr = space.read_dword(src_addr);
for(index_2 = 0; index_2 < 0x20; index_2 += 2)
- space->write_word(0x88000 + index_2 + index_1, space->read_word(src_addr + index_2));
+ space.write_word(0x88000 + index_2 + index_1, space.read_word(src_addr + index_2));
src_addr = tmp_addr + 4;
}
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index e91ac2601a9..a1035e1f1b6 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -161,10 +161,10 @@ WRITE16_MEMBER(jpmsys5_state::sys5_tms34061_w)
}
if (ACCESSING_BITS_8_15)
- tms34061_w(&space, col, row, func, data >> 8);
+ tms34061_w(space, col, row, func, data >> 8);
if (ACCESSING_BITS_0_7)
- tms34061_w(&space, col | 1, row, func, data & 0xff);
+ tms34061_w(space, col | 1, row, func, data & 0xff);
}
READ16_MEMBER(jpmsys5_state::sys5_tms34061_r)
@@ -185,10 +185,10 @@ READ16_MEMBER(jpmsys5_state::sys5_tms34061_r)
}
if (ACCESSING_BITS_8_15)
- data |= tms34061_r(&space, col, row, func) << 8;
+ data |= tms34061_r(space, col, row, func) << 8;
if (ACCESSING_BITS_0_7)
- data |= tms34061_r(&space, col | 1, row, func);
+ data |= tms34061_r(space, col | 1, row, func);
return data;
}
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 3363cc7d4fa..926942eb965 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -335,7 +335,7 @@ WRITE16_MEMBER(kaneko16_gtmr_state::bloodwar_oki_0_bank_w)
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0xf) );
-// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",space->device().safe_pc(),data);
+// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",space.device().safe_pc(),data);
}
}
@@ -346,7 +346,7 @@ WRITE16_MEMBER(kaneko16_gtmr_state::bloodwar_oki_1_bank_w)
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * data );
-// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",space->device().safe_pc(),data);
+// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",space.device().safe_pc(),data);
}
}
@@ -476,7 +476,7 @@ WRITE16_MEMBER(kaneko16_gtmr_state::gtmr_oki_0_bank_w)
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base( 0x40000 * (data & 0xF) );
-// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",space->device().safe_pc(),data);
+// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",space.device().safe_pc(),data);
}
}
@@ -487,7 +487,7 @@ WRITE16_MEMBER(kaneko16_gtmr_state::gtmr_oki_1_bank_w)
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base( 0x40000 * (data & 0x1) );
-// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",space->device().safe_pc(),data);
+// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",space.device().safe_pc(),data);
}
}
diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c
index 347db748c3d..8016d090e52 100644
--- a/src/mame/drivers/kchamp.c
+++ b/src/mame/drivers/kchamp.c
@@ -713,12 +713,12 @@ ROM_END
static UINT8 *decrypt_code(running_machine &machine)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
int A;
- space->set_decrypted_region(0x0000, 0xffff, decrypted);
+ space.set_decrypted_region(0x0000, 0xffff, decrypted);
for (A = 0; A < 0x10000; A++)
decrypted[A] = (rom[A] & 0x55) | ((rom[A] & 0x88) >> 2) | ((rom[A] & 0x22) << 2);
diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c
index b3c335e2450..a6b47fdfdec 100644
--- a/src/mame/drivers/kickgoal.c
+++ b/src/mame/drivers/kickgoal.c
@@ -155,7 +155,7 @@ WRITE16_MEMBER(kickgoal_state::kickgoal_snd_w)
okim6295_device *oki = downcast<okim6295_device *>(device);
if (ACCESSING_BITS_0_7)
{
- logerror("PC:%06x Writing %04x to Sound CPU\n",space->device().safe_pcbase(),data);
+ logerror("PC:%06x Writing %04x to Sound CPU\n",space.device().safe_pcbase(),data);
if (data >= 0x40) {
if (data == 0xfe) {
oki->write(0,0x40); /* Stop playing the melody */
diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c
index ee48315c5a5..c2761bcda8e 100644
--- a/src/mame/drivers/klax.c
+++ b/src/mame/drivers/klax.c
@@ -48,8 +48,8 @@ static void scanline_update(screen_device &screen, int scanline)
WRITE16_MEMBER(klax_state::interrupt_ack_w)
{
- atarigen_scanline_int_ack_w(&space, offset, data, mem_mask);
- atarigen_video_int_ack_w(&space, offset, data, mem_mask);
+ atarigen_scanline_int_ack_w(space, offset, data, mem_mask);
+ atarigen_video_int_ack_w(space, offset, data, mem_mask);
}
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index e1650d98c0e..805b337d1f0 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -179,7 +179,7 @@ static struct sprite_entry {
UINT32 adr;
} sprites[0x100];
-static void generate_sprites(address_space *space, UINT32 src, UINT32 spr, int count)
+static void generate_sprites(address_space &space, UINT32 src, UINT32 spr, int count)
{
int i;
int scount;
@@ -190,9 +190,9 @@ static void generate_sprites(address_space *space, UINT32 src, UINT32 spr, int c
for(i=0; i<count; i++) {
UINT32 adr = src + 0x100*i;
int pri;
- if(!space->read_word(adr+2))
+ if(!space.read_word(adr+2))
continue;
- pri = space->read_word(adr+28);
+ pri = space.read_word(adr+28);
if(pri < 256) {
sprites[ecount].pri = pri;
@@ -205,39 +205,39 @@ static void generate_sprites(address_space *space, UINT32 src, UINT32 spr, int c
for(i=0; i<ecount; i++) {
UINT32 adr = sprites[i].adr;
if(adr) {
- UINT32 set =(space->read_word(adr) << 16)|space->read_word(adr+2);
- UINT16 glob_x = space->read_word(adr+4);
- UINT16 glob_y = space->read_word(adr+8);
- UINT16 flip_x = space->read_word(adr+12) ? 0x1000 : 0x0000;
- UINT16 flip_y = space->read_word(adr+14) ? 0x2000 : 0x0000;
+ UINT32 set =(space.read_word(adr) << 16)|space.read_word(adr+2);
+ UINT16 glob_x = space.read_word(adr+4);
+ UINT16 glob_y = space.read_word(adr+8);
+ UINT16 flip_x = space.read_word(adr+12) ? 0x1000 : 0x0000;
+ UINT16 flip_y = space.read_word(adr+14) ? 0x2000 : 0x0000;
UINT16 glob_f = flip_x | (flip_y ^ 0x2000);
- UINT16 zoom_x = space->read_word(adr+20);
- UINT16 zoom_y = space->read_word(adr+22);
+ UINT16 zoom_x = space.read_word(adr+20);
+ UINT16 zoom_y = space.read_word(adr+22);
UINT16 color_val = 0x0000;
UINT16 color_mask = 0xffff;
UINT16 color_set = 0x0000;
UINT16 color_rotate = 0x0000;
UINT16 v;
- v = space->read_word(adr+24);
+ v = space.read_word(adr+24);
if(v & 0x8000) {
color_mask = 0xf3ff;
color_val |= (v & 3) << 10;
}
- v = space->read_word(adr+26);
+ v = space.read_word(adr+26);
if(v & 0x8000) {
color_mask &= 0xfcff;
color_val |= (v & 3) << 8;
}
- v = space->read_word(adr+18);
+ v = space.read_word(adr+18);
if(v & 0x8000) {
color_mask &= 0xff1f;
color_val |= v & 0xe0;
}
- v = space->read_word(adr+16);
+ v = space.read_word(adr+16);
if(v & 0x8000)
color_set = v & 0x1f;
if(v & 0x4000)
@@ -250,14 +250,14 @@ static void generate_sprites(address_space *space, UINT32 src, UINT32 spr, int c
if(set >= 0x200000 && set < 0xd00000)
{
- UINT16 count2 = space->read_word(set);
+ UINT16 count2 = space.read_word(set);
set += 2;
while(count2) {
- UINT16 idx = space->read_word(set);
- UINT16 flip = space->read_word(set+2);
- UINT16 col = space->read_word(set+4);
- short y = space->read_word(set+6);
- short x = space->read_word(set+8);
+ UINT16 idx = space.read_word(set);
+ UINT16 flip = space.read_word(set+2);
+ UINT16 col = space.read_word(set+4);
+ short y = space.read_word(set+6);
+ short x = space.read_word(set+8);
if(idx == 0xffff) {
set = (flip<<16) | col;
@@ -292,13 +292,13 @@ static void generate_sprites(address_space *space, UINT32 src, UINT32 spr, int c
if(color_rotate)
col = (col & 0xffe0) | ((col + color_rotate) & 0x1f);
- space->write_word(spr , (flip ^ glob_f) | sprites[i].pri);
- space->write_word(spr+ 2, idx);
- space->write_word(spr+ 4, y);
- space->write_word(spr+ 6, x);
- space->write_word(spr+ 8, zoom_y);
- space->write_word(spr+10, zoom_x);
- space->write_word(spr+12, col);
+ space.write_word(spr , (flip ^ glob_f) | sprites[i].pri);
+ space.write_word(spr+ 2, idx);
+ space.write_word(spr+ 4, y);
+ space.write_word(spr+ 6, x);
+ space.write_word(spr+ 8, zoom_y);
+ space.write_word(spr+10, zoom_x);
+ space.write_word(spr+12, col);
spr += 16;
scount++;
if(scount == 256)
@@ -311,45 +311,45 @@ static void generate_sprites(address_space *space, UINT32 src, UINT32 spr, int c
}
}
while(scount < 256) {
- space->write_word(spr, scount);
+ space.write_word(spr, scount);
scount++;
spr += 16;
}
}
-static void tkmmpzdm_esc(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
+static void tkmmpzdm_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
{
- konamigx_esc_alert(space->machine().driver_data<konamigx_state>()->m_workram, 0x0142, 0x100, 0);
+ konamigx_esc_alert(space.machine().driver_data<konamigx_state>()->m_workram, 0x0142, 0x100, 0);
}
-static void dragoonj_esc(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
+static void dragoonj_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
{
- konamigx_esc_alert(space->machine().driver_data<konamigx_state>()->m_workram, 0x5c00, 0x100, 0);
+ konamigx_esc_alert(space.machine().driver_data<konamigx_state>()->m_workram, 0x5c00, 0x100, 0);
}
-static void sal2_esc(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
+static void sal2_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
{
- konamigx_esc_alert(space->machine().driver_data<konamigx_state>()->m_workram, 0x1c8c, 0x172, 1);
+ konamigx_esc_alert(space.machine().driver_data<konamigx_state>()->m_workram, 0x1c8c, 0x172, 1);
}
-static void sexyparo_esc(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
+static void sexyparo_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
{
// The d20000 should probably be p3
generate_sprites(space, 0xc00604, 0xd20000, 0xfc);
}
-static void tbyahhoo_esc(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
+static void tbyahhoo_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
{
generate_sprites(space, 0xc00000, 0xd20000, 0x100);
}
-static void daiskiss_esc(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
+static void daiskiss_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
{
generate_sprites(space, 0xc00000, 0xd20000, 0x100);
}
static UINT8 esc_program[4096];
-static void (*esc_cb)(address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);
+static void (*esc_cb)(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);
WRITE32_MEMBER(konamigx_state::esc_w)
{
@@ -404,7 +404,7 @@ WRITE32_MEMBER(konamigx_state::esc_w)
UINT32 p2 = (space.read_word(params+4)<<16) | space.read_word(params+6);
UINT32 p3 = (space.read_word(params+8)<<16) | space.read_word(params+10);
UINT32 p4 = (space.read_word(params+12)<<16) | space.read_word(params+14);
- esc_cb(&space, p1, p2, p3, p4);
+ esc_cb(space, p1, p2, p3, p4);
}
break;
default:
@@ -531,7 +531,7 @@ WRITE32_MEMBER(konamigx_state::control_w)
waitskip.data = DATA; \
waitskip.mask = MASK; \
resume_trigger= 1000; \
- space->install_legacy_read_handler \
+ space.install_legacy_read_handler \
((BASE+START)&~3, (BASE+END)|3, FUNC(waitskip_r));}
static int suspension_active, resume_trigger;
@@ -909,12 +909,12 @@ READ32_MEMBER(konamigx_state::le2_gun_V_r)
READ32_MEMBER(konamigx_state::gx5bppspr_r)
{
- return (K055673_rom_word_r(&space, offset*2+1, 0xffff) | K055673_rom_word_r(&space, offset*2, 0xffff)<<16);
+ return (K055673_rom_word_r(space, offset*2+1, 0xffff) | K055673_rom_word_r(space, offset*2, 0xffff)<<16);
}
READ32_MEMBER(konamigx_state::gx6bppspr_r)
{
- return (K055673_GX6bpp_rom_word_r(&space, offset*2+1, 0xffff) | K055673_GX6bpp_rom_word_r(&space, offset*2, 0xffff)<<16);
+ return (K055673_GX6bpp_rom_word_r(space, offset*2+1, 0xffff) | K055673_GX6bpp_rom_word_r(space, offset*2, 0xffff)<<16);
}
READ32_MEMBER(konamigx_state::type1_roz_r1)
diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c
index fd24a938eb6..2ac302ff76b 100644
--- a/src/mame/drivers/konamim2.c
+++ b/src/mame/drivers/konamim2.c
@@ -818,9 +818,9 @@ static void cde_handle_reports(running_machine &machine)
}
}
-static void cde_dma_transfer(address_space *space, int channel, int next)
+static void cde_dma_transfer(address_space &space, int channel, int next)
{
- konamim2_state *state = space->machine().driver_data<konamim2_state>();
+ konamim2_state *state = space.machine().driver_data<konamim2_state>();
UINT32 address;
//int length;
int i;
@@ -838,7 +838,7 @@ static void cde_dma_transfer(address_space *space, int channel, int next)
for (i=0; i < state->m_cde_dma[channel].next_length; i++)
{
- space->write_byte(address, 0xff); // TODO: do the real transfer...
+ space.write_byte(address, 0xff); // TODO: do the real transfer...
address++;
}
}
@@ -976,13 +976,13 @@ WRITE64_MEMBER(konamim2_state::cde_w)
{
m_cde_dma[0].dma_done = 1;
- cde_dma_transfer(&space, 0, 0);
+ cde_dma_transfer(space, 0, 0);
}
if (d & 0x40)
{
m_cde_dma[0].dma_done = 1;
- cde_dma_transfer(&space, 0, 1);
+ cde_dma_transfer(space, 0, 1);
}
break;
}
diff --git a/src/mame/drivers/kyugo.c b/src/mame/drivers/kyugo.c
index 406a0c3e7b3..f48f01f1fb8 100644
--- a/src/mame/drivers/kyugo.c
+++ b/src/mame/drivers/kyugo.c
@@ -510,10 +510,10 @@ void kyugo_state::machine_start()
void kyugo_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
// must start with interrupts and sub CPU disabled
m_nmi_mask = 0;
- kyugo_sub_cpu_control_w(*space, 0, 0);
+ kyugo_sub_cpu_control_w(space, 0, 0);
m_scroll_x_lo = 0;
m_scroll_x_hi = 0;
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index 7df6b10b018..a74202be6ef 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -1068,12 +1068,12 @@ DRIVER_INIT_MEMBER(ladybug_state,dorodon)
/* decode the opcodes */
offs_t i;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x6000);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *table = machine().root_device().memregion("user1")->base();
- space->set_decrypted_region(0x0000, 0x5fff, decrypted);
+ space.set_decrypted_region(0x0000, 0x5fff, decrypted);
for (i = 0; i < 0x6000; i++)
decrypted[i] = table[rom[i]];
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 07230e1fffe..a9de6e18a60 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -1346,7 +1346,7 @@ ROM_END
static void sound_cpu_decrypt(running_machine &machine)
{
- address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
int i;
@@ -1355,7 +1355,7 @@ static void sound_cpu_decrypt(running_machine &machine)
for (i = 0xc000; i < 0x10000; i++)
decrypted[i - 0xc000] = ((rom[i] & 0x20) << 1) | ((rom[i] & 0x40) >> 1) | (rom[i] & 0x9f);
- space->set_decrypted_region(0xc000, 0xffff, decrypted);
+ space.set_decrypted_region(0xc000, 0xffff, decrypted);
}
DRIVER_INIT_MEMBER(liberate_state,prosport)
@@ -1380,11 +1380,11 @@ DRIVER_INIT_MEMBER(liberate_state,yellowcb)
DRIVER_INIT_MEMBER(liberate_state,liberate)
{
int A;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
- space->set_decrypted_region(0x0000, 0xffff, decrypted);
+ space.set_decrypted_region(0x0000, 0xffff, decrypted);
/* Swap bits for opcodes only, not data */
for (A = 0; A < 0x10000; A++) {
diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c
index 6ce64ee5696..0d2f21762b3 100644
--- a/src/mame/drivers/macrossp.c
+++ b/src/mame/drivers/macrossp.c
@@ -579,7 +579,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- // macrossp_state *state = space->machine().driver_data<macrossp_state>();
+ // macrossp_state *state = space.machine().driver_data<macrossp_state>();
logerror("ES5506 irq %d\n", irq);
/* IRQ lines 1 & 4 on the sound 68000 are definitely triggered by the ES5506,
diff --git a/src/mame/drivers/magictg.c b/src/mame/drivers/magictg.c
index e4729ab344e..1896ae146a1 100644
--- a/src/mame/drivers/magictg.c
+++ b/src/mame/drivers/magictg.c
@@ -334,7 +334,7 @@ static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function,
#if defined(USE_TWO_3DFX)
static UINT32 voodoo_1_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
{
- magictg_state* state = space->machine().driver_data<magictg_state>();
+ magictg_state* state = space.machine().driver_data<magictg_state>();
UINT32 val = 0;
switch (reg)
@@ -356,7 +356,7 @@ static UINT32 voodoo_1_pci_r(device_t *busdevice, device_t *device, int function
static void voodoo_1_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
{
- magictg_state* state = space->machine().driver_data<magictg_state>();
+ magictg_state* state = space.machine().driver_data<magictg_state>();
switch (reg)
{
@@ -473,7 +473,7 @@ READ32_MEMBER( magictg_state::zr36120_r )
else
{
/* Post office */
- res = 0;//mame_rand(space->machine);//m_zr36120.as_regs[0x48/4];
+ res = 0;//mame_rand(space.machine);//m_zr36120.as_regs[0x48/4];
}
mame_printf_debug("PINKEYE_R[%x]\n", offset);
return res;
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index cab9e4c5e6b..8452326117d 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -249,7 +249,7 @@ ROM_END
DRIVER_INIT_MEMBER(magtouch_state,magtouch)
{
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
GAME( 1995, magtouch, 0, magtouch, magtouch, magtouch_state, magtouch, ROT0, "Micro Manufacturing", "Magical Touch", GAME_NOT_WORKING | GAME_NO_SOUND )
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 54d8ad36640..5f880cd3378 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -126,7 +126,7 @@ WRITE8_MEMBER(mainevt_state::dv_sh_bankswitch_w)
device_t *device = machine().device("k007232");
int bank_A, bank_B;
-//logerror("CPU #1 PC: %04x bank switch = %02x\n",space->device().safe_pc(),data);
+//logerror("CPU #1 PC: %04x bank switch = %02x\n",space.device().safe_pc(),data);
/* bits 0-3 select the 007232 banks */
bank_A = (data & 0x3);
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 56eb7802754..b673f9957e1 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -717,32 +717,32 @@ WRITE8_MEMBER(mappy_state::mappy_latch_w)
MACHINE_RESET_MEMBER(mappy_state,superpac)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
for (i = 0; i < 0x10; i += 2)
- superpac_latch_w(*space,i,0);
+ superpac_latch_w(space,i,0);
}
MACHINE_RESET_MEMBER(mappy_state,phozon)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
for (i = 0; i < 0x10; i += 2)
- phozon_latch_w(*space, i, 0);
+ phozon_latch_w(space, i, 0);
}
MACHINE_RESET_MEMBER(mappy_state,mappy)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
for (i = 0; i < 0x10; i += 2)
- mappy_latch_w(*space, i, 0);
+ mappy_latch_w(space, i, 0);
}
/* different games need different interrupt generators & timers because they use different Namco I/O devices */
diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c
index 89dc87c4228..0100bb8260c 100644
--- a/src/mame/drivers/mario.c
+++ b/src/mame/drivers/mario.c
@@ -101,8 +101,8 @@ write:
*
*************************************/
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( mario_dma )
{
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 663da48974b..b619428efd7 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -1259,14 +1259,14 @@ static void init_mediagx(running_machine &machine)
#if SPEEDUP_HACKS
-INLINE UINT32 generic_speedup(address_space *space, int idx)
+INLINE UINT32 generic_speedup(address_space &space, int idx)
{
- mediagx_state *state = space->machine().driver_data<mediagx_state>();
+ mediagx_state *state = space.machine().driver_data<mediagx_state>();
- if (space->device().safe_pc() == state->m_speedup_table[idx].pc)
+ if (space.device().safe_pc() == state->m_speedup_table[idx].pc)
{
state->m_speedup_hits[idx]++;
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
}
return state->m_main_ram[state->m_speedup_table[idx].offset/4];
}
diff --git a/src/mame/drivers/megadrvb.c b/src/mame/drivers/megadrvb.c
index 2959ae7eb0b..721a57cf31a 100644
--- a/src/mame/drivers/megadrvb.c
+++ b/src/mame/drivers/megadrvb.c
@@ -273,13 +273,13 @@ static WRITE16_HANDLER( aladmdb_w )
- aladmdb_w : 1b2d18 - data = aa00 (only once on reset)
- aladmdb_w : 1b2d42 - data = 0000 (only once on reset)
*/
- logerror("aladmdb_w : %06x - data = %04x\n",space->device().safe_pc(),data);
+ logerror("aladmdb_w : %06x - data = %04x\n",space.device().safe_pc(),data);
}
static READ16_HANDLER( aladmdb_r )
{
- md_boot_state *state = space->machine().driver_data<md_boot_state>();
- if (space->device().safe_pc()==0x1b2a56)
+ md_boot_state *state = space.machine().driver_data<md_boot_state>();
+ if (space.device().safe_pc()==0x1b2a56)
{
state->m_aladmdb_mcu_port = state->ioport("MCU")->read();
@@ -288,11 +288,11 @@ static READ16_HANDLER( aladmdb_r )
else
return (0x100); //MCU status, needed if you fall into a pitfall
}
- if (space->device().safe_pc()==0x1b2a72) return 0x0000;
- if (space->device().safe_pc()==0x1b2d24) return (space->machine().root_device().ioport("MCU")->read() & 0x00f0) | 0x1200; // difficulty
- if (space->device().safe_pc()==0x1b2d4e) return 0x0000;
+ if (space.device().safe_pc()==0x1b2a72) return 0x0000;
+ if (space.device().safe_pc()==0x1b2d24) return (space.machine().root_device().ioport("MCU")->read() & 0x00f0) | 0x1200; // difficulty
+ if (space.device().safe_pc()==0x1b2d4e) return 0x0000;
- logerror("aladbl_r : %06x\n",space->device().safe_pc());
+ logerror("aladbl_r : %06x\n",space.device().safe_pc());
return 0x0000;
}
@@ -300,19 +300,19 @@ static READ16_HANDLER( aladmdb_r )
static READ16_HANDLER( mk3mdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return space->machine().root_device().ioport(dswname[offset])->read();
+ return space.machine().root_device().ioport(dswname[offset])->read();
}
static READ16_HANDLER( ssf2mdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return space->machine().root_device().ioport(dswname[offset])->read();
+ return space.machine().root_device().ioport(dswname[offset])->read();
}
static READ16_HANDLER( srmdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return space->machine().root_device().ioport(dswname[offset])->read();
+ return space.machine().root_device().ioport(dswname[offset])->read();
}
static READ16_HANDLER( topshoot_200051_r )
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index 09020779754..5ff9610bb58 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -376,7 +376,7 @@ INPUT_PORTS_END
static READ8_HANDLER( megaplay_bios_banksel_r )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
return state->m_bios_bank;
}
@@ -387,7 +387,7 @@ static WRITE8_HANDLER( megaplay_bios_banksel_w )
It should be possible to multiplex different game ROMs at
0x000000-0x3fffff based on these bits.
*/
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
state->m_bios_bank = data;
state->m_bios_mode = MP_ROM;
// logerror("BIOS: ROM bank %i selected [0x%02x]\n",bios_bank >> 6, data);
@@ -395,13 +395,13 @@ static WRITE8_HANDLER( megaplay_bios_banksel_w )
static READ8_HANDLER( megaplay_bios_gamesel_r )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
return state->m_bios_6403;
}
static WRITE8_HANDLER( megaplay_bios_gamesel_w )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
state->m_bios_6403 = data;
// logerror("BIOS: 0x6403 write: 0x%02x\n",data);
@@ -426,7 +426,7 @@ static READ16_HANDLER( megaplay_io_read )
static READ8_HANDLER( bank_r )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
UINT8* bank = state->memregion("mtbios")->base();
UINT32 fulladdress = state->m_mp_bios_bank_addr + offset;
@@ -450,7 +450,7 @@ static READ8_HANDLER( bank_r )
}
else
{
- return space->machine().root_device().memregion("maincpu")->base()[fulladdress ^ 1];
+ return space.machine().root_device().memregion("maincpu")->base()[fulladdress ^ 1];
}
}
else if (fulladdress >= 0xa10000 && fulladdress <= 0xa1001f) // IO Acess
@@ -467,7 +467,7 @@ static READ8_HANDLER( bank_r )
static WRITE8_HANDLER( bank_w )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
UINT32 fulladdress = state->m_mp_bios_bank_addr + offset;
if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM / Megaplay Custom Addresses
@@ -516,7 +516,7 @@ static READ8_HANDLER( megaplay_bios_6204_r )
static WRITE8_HANDLER( megaplay_bios_width_w )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
state->m_bios_width = data;
megadrive_io_data_regs[2] = (megadrive_io_data_regs[2] & 0x07) | ((data & 0xf8));
// logerror("BIOS: 0x6204 - Width write: %02x\n", data);
@@ -524,7 +524,7 @@ static WRITE8_HANDLER( megaplay_bios_width_w )
static READ8_HANDLER( megaplay_bios_6404_r )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
// logerror("BIOS: 0x6404 read: returned 0x%02x\n",bios_6404 | (bios_6403 & 0x10) >> 4);
return (state->m_bios_6404 & 0xfe) | ((state->m_bios_6403 & 0x10) >> 4);
// return state->m_bios_6404 | (state->m_bios_6403 & 0x10) >> 4;
@@ -532,9 +532,9 @@ static READ8_HANDLER( megaplay_bios_6404_r )
static WRITE8_HANDLER( megaplay_bios_6404_w )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
if(((state->m_bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c))
- space->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
state->m_bios_6404 = data;
// logerror("BIOS: 0x6404 write: 0x%02x\n", data);
@@ -548,20 +548,20 @@ static READ8_HANDLER( megaplay_bios_6600_r )
function to make the BIOS check all 4 slots (3 and 4 will be "not used")
return (state->m_bios_6600 & 0xfe) | (state->m_bios_bank & 0x01);
*/
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
return state->m_bios_6600;// & 0xfe;
}
static WRITE8_HANDLER( megaplay_bios_6600_w )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
state->m_bios_6600 = data;
// logerror("BIOS: 0x6600 write: 0x%02x\n",data);
}
static WRITE8_HANDLER( megaplay_game_w )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
if (state->m_readpos == 1)
state->m_game_banksel = 0;
state->m_game_banksel |= (1 << (state->m_readpos - 1)) * (data & 0x01);
@@ -573,7 +573,7 @@ static WRITE8_HANDLER( megaplay_game_w )
state->m_bios_mode = MP_GAME;
state->m_readpos = 1;
// popmessage("Game bank selected: 0x%03x", state->m_game_banksel);
- logerror("BIOS [0x%04x]: 68K address space bank selected: 0x%03x\n", space->device().safe_pcbase(), state->m_game_banksel);
+ logerror("BIOS [0x%04x]: 68K address space bank selected: 0x%03x\n", space.device().safe_pcbase(), state->m_game_banksel);
}
state->m_mp_bios_bank_addr = ((state->m_mp_bios_bank_addr >> 1) | (data << 23)) & 0xff8000;
@@ -847,13 +847,13 @@ static void mplay_start(running_machine &machine)
static READ16_HANDLER( megadriv_68k_read_z80_extra_ram )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
return state->m_ic36_ram[(offset << 1) ^ 1] | (state->m_ic36_ram[(offset << 1)] << 8);
}
static WRITE16_HANDLER( megadriv_68k_write_z80_extra_ram )
{
- mplay_state *state = space->machine().driver_data<mplay_state>();
+ mplay_state *state = space.machine().driver_data<mplay_state>();
if (!ACCESSING_BITS_0_7) // byte (MSB) access
{
state->m_ic36_ram[(offset << 1)] = (data & 0xff00) >> 8;
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index f25e9f50649..0ade696422c 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -209,7 +209,7 @@ INPUT_PORTS_END
/* MEGATECH specific */
static READ8_HANDLER( megatech_cart_select_r )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
return state->m_mt_cart_select_reg;
}
@@ -292,16 +292,16 @@ static WRITE8_HANDLER( megatech_cart_select_w )
but it stores something in (banked?) ram
because it always seems to show the
same instructions ... */
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
state->m_mt_cart_select_reg = data;
- megatech_select_game(space->machine(), state->m_mt_cart_select_reg);
+ megatech_select_game(space.machine(), state->m_mt_cart_select_reg);
}
static READ8_HANDLER( bios_ctrl_r )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
if (offset == 0)
return 0;
@@ -313,7 +313,7 @@ static READ8_HANDLER( bios_ctrl_r )
static WRITE8_HANDLER( bios_ctrl_w )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
if (offset == 1)
{
@@ -333,16 +333,16 @@ static WRITE8_HANDLER( bios_ctrl_w )
static READ8_HANDLER( megatech_z80_read_68k_banked_data )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
- address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
+ address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space();
UINT8 ret = space68k->read_byte(state->m_mt_bank_addr + offset);
return ret;
}
static WRITE8_HANDLER( megatech_z80_write_68k_banked_data )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
- address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
+ address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space();
space68k->write_byte(state->m_mt_bank_addr + offset,data);
}
@@ -354,18 +354,18 @@ static void megatech_z80_bank_w(running_machine &machine, UINT16 data)
static WRITE8_HANDLER( mt_z80_bank_w )
{
- megatech_z80_bank_w(space->machine(), data & 1);
+ megatech_z80_bank_w(space.machine(), data & 1);
}
static READ8_HANDLER( megatech_banked_ram_r )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
return state->m_megatech_banked_ram[offset + 0x1000 * (state->m_mt_cart_select_reg & 0x07)];
}
static WRITE8_HANDLER( megatech_banked_ram_w )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
state->m_megatech_banked_ram[offset + 0x1000 * (state->m_mt_cart_select_reg & 0x07)] = data;
}
@@ -391,14 +391,14 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( megatech_bios_port_ctrl_w )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
+ mtech_state *state = space.machine().driver_data<mtech_state>();
state->m_bios_port_ctrl = data;
}
static READ8_HANDLER( megatech_bios_joypad_r )
{
- mtech_state *state = space->machine().driver_data<mtech_state>();
- return megatech_bios_port_cc_dc_r(space->machine(), offset, state->m_bios_port_ctrl);
+ mtech_state *state = space.machine().driver_data<mtech_state>();
+ return megatech_bios_port_cc_dc_r(space.machine(), offset, state->m_bios_port_ctrl);
}
static WRITE8_HANDLER (megatech_bios_port_7f_w)
diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c
index 37835e6a720..bc924cdba4f 100644
--- a/src/mame/drivers/metalmx.c
+++ b/src/mame/drivers/metalmx.c
@@ -352,7 +352,7 @@ READ32_MEMBER(metalmx_state::sound_data_r)
if (ACCESSING_BITS_0_15)
result |= cage_control_r(machine());
if (ACCESSING_BITS_16_31)
- result |= cage_main_r(&space) << 16;
+ result |= cage_main_r(space) << 16;
return result;
}
@@ -361,7 +361,7 @@ WRITE32_MEMBER(metalmx_state::sound_data_w)
if (ACCESSING_BITS_0_15)
cage_control_w(machine(), data);
if (ACCESSING_BITS_16_31)
- cage_main_w(&space, data >> 16);
+ cage_main_w(space, data >> 16);
}
static void cage_irq_callback(running_machine &machine, int reason)
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index aaa10d1a8cd..93f7e8db10a 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -133,10 +133,10 @@ READ16_MEMBER(metro_state::metro_irq_cause_r)
static void update_irq_state( running_machine &machine )
{
metro_state *state = machine.driver_data<metro_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
/* Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*) */
- UINT16 irq = state->metro_irq_cause_r(*space, 0, 0xffff) & ~*state->m_irq_enable;
+ UINT16 irq = state->metro_irq_cause_r(space, 0, 0xffff) & ~*state->m_irq_enable;
if (state->m_irq_line == -1) /* mouja, gakusai, gakusai2, dokyusei, dokyusp */
{
@@ -266,15 +266,15 @@ static void ymf278b_interrupt( device_t *device, int active )
static int metro_io_callback( device_t *device, int ioline, int state )
{
metro_state *driver_state = device->machine().driver_data<metro_state>();
- address_space *space = driver_state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *driver_state->m_maincpu->space(AS_PROGRAM);
UINT8 data = 0;
switch (ioline)
{
case UPD7810_RXD: /* read the RxD line */
- data = driver_state->soundlatch_byte_r(*space, 0);
+ data = driver_state->soundlatch_byte_r(space, 0);
state = data & 1;
- driver_state->soundlatch_byte_w(*space, 0, data >> 1);
+ driver_state->soundlatch_byte_w(space, 0, data >> 1);
break;
default:
logerror("upd7810 ioline %d not handled\n", ioline);
@@ -580,15 +580,15 @@ INLINE int blt_read( const UINT8 *ROM, const int offs )
return ROM[offs];
}
-void metro_state::blt_write( address_space *space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask )
+void metro_state::blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask )
{
switch(tmap)
{
- case 1: metro_vram_0_w(*space, offs, data, mask); break;
- case 2: metro_vram_1_w(*space, offs, data, mask); break;
- case 3: metro_vram_2_w(*space, offs, data, mask); break;
+ case 1: metro_vram_0_w(space, offs, data, mask); break;
+ case 2: metro_vram_1_w(space, offs, data, mask); break;
+ case 3: metro_vram_2_w(space, offs, data, mask); break;
}
-// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine().describe_context(), tmap, offs, data, mask);
+// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space.machine().describe_context(), tmap, offs, data, mask);
}
@@ -655,7 +655,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
src_offs++;
dst_offs &= 0xffff;
- blt_write(&space, tmap, dst_offs, b2, mask);
+ blt_write(space, tmap, dst_offs, b2, mask);
dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1)));
}
break;
@@ -669,7 +669,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
while (count--)
{
dst_offs &= 0xffff;
- blt_write(&space, tmap, dst_offs, b2 << shift, mask);
+ blt_write(space, tmap, dst_offs, b2 << shift, mask);
dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1)));
b2++;
}
@@ -684,7 +684,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
while (count--)
{
dst_offs &= 0xffff;
- blt_write(&space, tmap, dst_offs, b2, mask);
+ blt_write(space, tmap, dst_offs, b2, mask);
dst_offs = ((dst_offs + 1) & (0x100 - 1)) | (dst_offs & (~(0x100 - 1)));
}
break;
@@ -5945,14 +5945,14 @@ static void metro_common( running_machine &machine )
DRIVER_INIT_MEMBER(metro_state,metro)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
metro_common(machine());
m_porta = 0x00;
m_portb = 0x00;
m_busy_sndcpu = 0;
- metro_sound_rombank_w(*space, 0, 0x00);
+ metro_sound_rombank_w(space, 0, 0x00);
}
DRIVER_INIT_MEMBER(metro_state,karatour)
@@ -5972,14 +5972,14 @@ DRIVER_INIT_MEMBER(metro_state,karatour)
DRIVER_INIT_MEMBER(metro_state,daitorid)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
metro_common(machine());
m_porta = 0x00;
m_portb = 0x00;
m_busy_sndcpu = 0;
- daitorid_sound_rombank_w(*space, 0, 0x00);
+ daitorid_sound_rombank_w(space, 0, 0x00);
}
diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c
index a2e3c88d91c..76bef4501f4 100644
--- a/src/mame/drivers/midqslvr.c
+++ b/src/mame/drivers/midqslvr.c
@@ -253,7 +253,7 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi
static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- address_space *space = busdevice->machine().firstcpu->space( AS_PROGRAM );
+ address_space &space = *busdevice->machine().firstcpu->space( AS_PROGRAM );
midqslvr_state *state = busdevice->machine().driver_data<midqslvr_state>();
function &= 3;
@@ -275,7 +275,7 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function,
return (((class_code_val[function]) >> (reg & 3)*8) & 0xff);
}
- printf("%08x PIIX4: read %d, %02X\n", space->device().safe_pc(), function, reg);
+ printf("%08x PIIX4: read %d, %02X\n", space.device().safe_pc(), function, reg);
return state->m_piix4_config_reg[function][reg];
}
@@ -672,7 +672,7 @@ void midqslvr_state::machine_start()
kbdc8042_init(machine(), &at8042);
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
void midqslvr_state::machine_reset()
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index 63286540608..b69a7ae2e42 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -362,20 +362,20 @@ WRITE32_MEMBER(midvunit_state::bit_reset_w)
READ32_MEMBER(midvunit_state::offroadc_serial_status_r)
{
- int status = midway_serial_pic2_status_r(&space);
+ int status = midway_serial_pic2_status_r(space);
return (ioport("991030")->read() & 0x7fff7fff) | (status << 31) | (status << 15);
}
READ32_MEMBER(midvunit_state::offroadc_serial_data_r)
{
- return midway_serial_pic2_r(&space) << 16;
+ return midway_serial_pic2_r(space) << 16;
}
WRITE32_MEMBER(midvunit_state::offroadc_serial_data_w)
{
- midway_serial_pic2_w(&space, data >> 16);
+ midway_serial_pic2_w(space, data >> 16);
}
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index f712e5b5850..d0181210700 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -517,8 +517,8 @@ void missile_state::machine_start()
m_flipscreen = 0;
/* set up an opcode base handler since we use mapped handlers for RAM */
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(missile_state::missile_direct_handler), this));
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.set_direct_update_handler(direct_update_delegate(FUNC(missile_state::missile_direct_handler), this));
/* create a timer to speed/slow the CPU */
m_cpu_timer = machine().scheduler().timer_alloc(FUNC(adjust_cpu_speed));
@@ -552,10 +552,10 @@ void missile_state::machine_reset()
*
*************************************/
-INLINE int get_madsel(address_space *space)
+INLINE int get_madsel(address_space &space)
{
- missile_state *state = space->machine().driver_data<missile_state>();
- UINT16 pc = space->device().safe_pcbase();
+ missile_state *state = space.machine().driver_data<missile_state>();
+ UINT16 pc = space.device().safe_pcbase();
/* if we're at a different instruction than last time, reset our delay counter */
if (pc != state->m_madsel_lastpc)
@@ -564,7 +564,7 @@ INLINE int get_madsel(address_space *space)
/* MADSEL signal disables standard address decoding and routes
writes to video RAM; it is enabled if the IRQ signal is clear
and the low 5 bits of the fetched opcode are 0x01 */
- if (!state->m_irq_state && (space->direct().read_decrypted_byte(pc) & 0x1f) == 0x01)
+ if (!state->m_irq_state && (space.direct().read_decrypted_byte(pc) & 0x1f) == 0x01)
{
/* the MADSEL signal goes high 5 cycles after the opcode is identified;
this effectively skips the indirect memory read. Since this is difficult
@@ -590,9 +590,9 @@ INLINE offs_t get_bit3_addr(offs_t pixaddr)
}
-static void write_vram(address_space *space, offs_t address, UINT8 data)
+static void write_vram(address_space &space, offs_t address, UINT8 data)
{
- missile_state *state = space->machine().driver_data<missile_state>();
+ missile_state *state = space.machine().driver_data<missile_state>();
UINT8 *videoram = state->m_videoram;
static const UINT8 data_lookup[4] = { 0x00, 0x0f, 0xf0, 0xff };
offs_t vramaddr;
@@ -617,14 +617,14 @@ static void write_vram(address_space *space, offs_t address, UINT8 data)
videoram[vramaddr] = (videoram[vramaddr] & vrammask) | (vramdata & ~vrammask);
/* account for the extra clock cycle */
- space->device().execute().adjust_icount(-1);
+ space.device().execute().adjust_icount(-1);
}
}
-static UINT8 read_vram(address_space *space, offs_t address)
+static UINT8 read_vram(address_space &space, offs_t address)
{
- missile_state *state = space->machine().driver_data<missile_state>();
+ missile_state *state = space.machine().driver_data<missile_state>();
UINT8 *videoram = state->m_videoram;
offs_t vramaddr;
UINT8 vramdata;
@@ -653,7 +653,7 @@ static UINT8 read_vram(address_space *space, offs_t address)
result &= ~0x20;
/* account for the extra clock cycle */
- space->device().execute().adjust_icount(-1);
+ space.device().execute().adjust_icount(-1);
}
return result;
}
@@ -714,9 +714,9 @@ WRITE8_MEMBER(missile_state::missile_w)
UINT8 *videoram = m_videoram;
/* if we're in MADSEL mode, write to video RAM */
- if (get_madsel(&space))
+ if (get_madsel(space))
{
- write_vram(&space, offset, data);
+ write_vram(space, offset, data);
return;
}
@@ -776,8 +776,8 @@ READ8_MEMBER(missile_state::missile_r)
UINT8 result = 0xff;
/* if we're in MADSEL mode, read from video RAM */
- if (get_madsel(&space))
- return read_vram(&space, offset);
+ if (get_madsel(space))
+ return read_vram(space, offset);
/* otherwise, strip A15 and handle manually */
offset &= 0x7fff;
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index 01197e078a6..77578fe22c9 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -2104,8 +2104,8 @@ ROM_END
static void bootleg_decode( running_machine &machine )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x50000);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine.root_device().memregion("maincpu")->base() + 0x50000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0, 16, machine.root_device().memregion("maincpu")->base() + 0x60000, 0x4000);
}
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 3aea59d6fb2..8502d9e9a0b 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -176,18 +176,18 @@ static void copro_fifoin_push(device_t *device, UINT32 data)
#define COPRO_FIFOOUT_SIZE 32000
-static UINT32 copro_fifoout_pop(address_space *space)
+static UINT32 copro_fifoout_pop(address_space &space)
{
- model2_state *state = space->machine().driver_data<model2_state>();
+ model2_state *state = space.machine().driver_data<model2_state>();
UINT32 r;
if (state->m_copro_fifoout_num == 0)
{
/* Reading from empty FIFO causes the i960 to enter wait state */
- i960_stall(&space->device());
+ i960_stall(&space.device());
/* spin the main cpu and let the TGP catch up */
- space->device().execute().spin_until_time(attotime::from_usec(100));
+ space.device().execute().spin_until_time(attotime::from_usec(100));
return 0;
}
@@ -208,11 +208,11 @@ static UINT32 copro_fifoout_pop(address_space *space)
{
if (state->m_copro_fifoout_num == COPRO_FIFOOUT_SIZE)
{
- sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, ASSERT_LINE);
}
else
{
- sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, CLEAR_LINE);
}
}
@@ -639,7 +639,7 @@ WRITE32_MEMBER(model2_state::copro_function_port_w)
READ32_MEMBER(model2_state::copro_fifo_r)
{
//logerror("copro_fifo_r: %08X, %08X\n", offset, mem_mask);
- return copro_fifoout_pop(&space);
+ return copro_fifoout_pop(space);
}
WRITE32_MEMBER(model2_state::copro_fifo_w)
@@ -963,33 +963,33 @@ WRITE32_MEMBER(model2_state::model2_irq_w)
}
-static int snd_68k_ready_r(address_space *space)
+static int snd_68k_ready_r(address_space &space)
{
- int sr = space->machine().device("audiocpu")->state().state_int(M68K_SR);
+ int sr = space.machine().device("audiocpu")->state().state_int(M68K_SR);
if ((sr & 0x0700) > 0x0100)
{
- space->device().execute().spin_until_time(attotime::from_usec(40));
+ space.device().execute().spin_until_time(attotime::from_usec(40));
return 0; // not ready yet, interrupts disabled
}
return 0xff;
}
-static void snd_latch_to_68k_w(address_space *space, int data)
+static void snd_latch_to_68k_w(address_space &space, int data)
{
- model2_state *state = space->machine().driver_data<model2_state>();
+ model2_state *state = space.machine().driver_data<model2_state>();
if (!snd_68k_ready_r(space))
{
- space->device().execute().spin_until_time(attotime::from_usec(40));
+ space.device().execute().spin_until_time(attotime::from_usec(40));
}
state->m_to_68k = data;
- space->machine().device("audiocpu")->execute().set_input_line(2, HOLD_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(2, HOLD_LINE);
// give the 68k time to notice
- space->device().execute().spin_until_time(attotime::from_usec(40));
+ space.device().execute().spin_until_time(attotime::from_usec(40));
}
READ32_MEMBER(model2_state::model2_serial_r)
@@ -1006,7 +1006,7 @@ WRITE32_MEMBER(model2_state::model2o_serial_w)
{
if (mem_mask == 0x0000ffff)
{
- snd_latch_to_68k_w(&space, data&0xff);
+ snd_latch_to_68k_w(space, data&0xff);
}
}
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 6caefd77f25..f7d9f9f74f0 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1059,9 +1059,9 @@ WRITE64_MEMBER(model3_state::scsi_w)
static UINT32 scsi_fetch(running_machine &machine, UINT32 dsp)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 result;
- result = space->read_dword(dsp);
+ result = space.read_dword(dsp);
return FLIPENDIAN_INT32(result);
}
@@ -1159,7 +1159,7 @@ WRITE64_MEMBER(model3_state::real3d_dma_w)
static void real3d_dma_callback(running_machine &machine, UINT32 src, UINT32 dst, int length, int byteswap)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch(dst >> 24)
{
case 0x88: /* Display List End Trigger */
diff --git a/src/mame/drivers/mouser.c b/src/mame/drivers/mouser.c
index a879a137508..8af6bb0c178 100644
--- a/src/mame/drivers/mouser.c
+++ b/src/mame/drivers/mouser.c
@@ -289,12 +289,12 @@ DRIVER_INIT_MEMBER(mouser_state,mouser)
/* Decode the opcodes */
offs_t i;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x6000);
UINT8 *table = machine().root_device().memregion("user1")->base();
- space->set_decrypted_region(0x0000, 0x5fff, decrypted);
+ space.set_decrypted_region(0x0000, 0x5fff, decrypted);
for (i = 0; i < 0x6000; i++)
{
diff --git a/src/mame/drivers/mpu3.c b/src/mame/drivers/mpu3.c
index 32d7958c19a..525dc1444ae 100644
--- a/src/mame/drivers/mpu3.c
+++ b/src/mame/drivers/mpu3.c
@@ -933,11 +933,11 @@ static const mpu3_chr_table hprvpr_data[64] = {
DRIVER_INIT_MEMBER(mpu3_state,m3hprvpr)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_disp_func=METER_PORT;
m_current_chr_table = hprvpr_data;
- space->install_readwrite_handler(0xc000, 0xc000 , read8_delegate(FUNC(mpu3_state::characteriser_r), this),write8_delegate(FUNC(mpu3_state::characteriser_w), this));
+ space.install_readwrite_handler(0xc000, 0xc000 , read8_delegate(FUNC(mpu3_state::characteriser_r), this),write8_delegate(FUNC(mpu3_state::characteriser_w), this));
}
diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c
index 3687c8ebad2..1506f0955d4 100644
--- a/src/mame/drivers/mpu4hw.c
+++ b/src/mame/drivers/mpu4hw.c
@@ -2303,28 +2303,28 @@ READ8_MEMBER(mpu4_state::mpu4_ym2413_r)
}
-void mpu4_install_mod4yam_space(address_space *space)
+void mpu4_install_mod4yam_space(address_space &space)
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
- space->install_read_handler(0x0880, 0x0882, read8_delegate(FUNC(mpu4_state::mpu4_ym2413_r),state));
- space->install_write_handler(0x0880, 0x0881, write8_delegate(FUNC(mpu4_state::mpu4_ym2413_w),state));
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
+ space.install_read_handler(0x0880, 0x0882, read8_delegate(FUNC(mpu4_state::mpu4_ym2413_r),state));
+ space.install_write_handler(0x0880, 0x0881, write8_delegate(FUNC(mpu4_state::mpu4_ym2413_w),state));
}
-void mpu4_install_mod4oki_space(address_space *space)
+void mpu4_install_mod4oki_space(address_space &space)
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
- pia6821_device *pia_ic4ss = space->machine().device<pia6821_device>("pia_ic4ss");
- ptm6840_device *ptm_ic3ss = space->machine().device<ptm6840_device>("ptm_ic3ss");
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
+ pia6821_device *pia_ic4ss = space.machine().device<pia6821_device>("pia_ic4ss");
+ ptm6840_device *ptm_ic3ss = space.machine().device<ptm6840_device>("ptm_ic3ss");
- space->install_readwrite_handler(0x0880, 0x0883, 0, 0, read8_delegate(FUNC(pia6821_device::read), pia_ic4ss), write8_delegate(FUNC(pia6821_device::write), pia_ic4ss));
- space->install_read_handler(0x08c0, 0x08c7, 0, 0, read8_delegate(FUNC(ptm6840_device::read), ptm_ic3ss));
- space->install_write_handler(0x08c0, 0x08c7, 0, 0, write8_delegate(FUNC(mpu4_state::ic3ss_w),state));
+ space.install_readwrite_handler(0x0880, 0x0883, 0, 0, read8_delegate(FUNC(pia6821_device::read), pia_ic4ss), write8_delegate(FUNC(pia6821_device::write), pia_ic4ss));
+ space.install_read_handler(0x08c0, 0x08c7, 0, 0, read8_delegate(FUNC(ptm6840_device::read), ptm_ic3ss));
+ space.install_write_handler(0x08c0, 0x08c7, 0, 0, write8_delegate(FUNC(mpu4_state::ic3ss_w),state));
}
-void mpu4_install_mod4bwb_space(address_space *space)
+void mpu4_install_mod4bwb_space(address_space &space)
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
- space->install_readwrite_handler(0x0810, 0x0810, 0, 0, read8_delegate(FUNC(mpu4_state::bwb_characteriser_r),state),write8_delegate(FUNC(mpu4_state::bwb_characteriser_w),state));
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
+ space.install_readwrite_handler(0x0810, 0x0810, 0, 0, read8_delegate(FUNC(mpu4_state::bwb_characteriser_r),state),write8_delegate(FUNC(mpu4_state::bwb_characteriser_w),state));
mpu4_install_mod4oki_space(space);
}
@@ -2359,7 +2359,7 @@ MACHINE_START_MEMBER(mpu4_state,mod2)
MACHINE_START_MEMBER(mpu4_state,mpu4yam)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
mpu4_config_common(machine());
m_link7a_connected=0;
@@ -2369,7 +2369,7 @@ MACHINE_START_MEMBER(mpu4_state,mpu4yam)
MACHINE_START_MEMBER(mpu4_state,mpu4oki)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
mpu4_config_common(machine());
m_link7a_connected=0;
@@ -2379,7 +2379,7 @@ MACHINE_START_MEMBER(mpu4_state,mpu4oki)
MACHINE_START_MEMBER(mpu4_state,mpu4bwb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
mpu4_config_common(machine());
m_link7a_connected=0;
@@ -2588,7 +2588,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m4default_alt)
DRIVER_INIT_MEMBER(mpu4_state,m4default_big)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
DRIVER_INIT_CALL(m4default);
int size = machine().root_device().memregion( "maincpu" )->bytes();
@@ -2599,8 +2599,8 @@ DRIVER_INIT_MEMBER(mpu4_state,m4default_big)
else
{
m_bwb_bank=1;
- space->install_write_handler(0x0858, 0x0858, 0, 0, write8_delegate(FUNC(mpu4_state::bankswitch_w),this));
- space->install_write_handler(0x0878, 0x0878, 0, 0, write8_delegate(FUNC(mpu4_state::bankset_w),this));
+ space.install_write_handler(0x0858, 0x0858, 0, 0, write8_delegate(FUNC(mpu4_state::bankswitch_w),this));
+ space.install_write_handler(0x0878, 0x0878, 0, 0, write8_delegate(FUNC(mpu4_state::bankset_w),this));
}
}
@@ -2620,10 +2620,10 @@ WRITE8_MEMBER(mpu4_state::crystal_sound_w)
DRIVER_INIT_MEMBER(mpu4_state,m_frkstn)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
DRIVER_INIT_CALL(m4default_big);
- space->install_read_handler(0x0880, 0x0880, 0, 0, read8_delegate(FUNC(mpu4_state::crystal_sound_r),this));
- space->install_write_handler(0x0881, 0x0881, 0, 0, write8_delegate(FUNC(mpu4_state::crystal_sound_w),this));
+ space.install_read_handler(0x0880, 0x0880, 0, 0, read8_delegate(FUNC(mpu4_state::crystal_sound_r),this));
+ space.install_write_handler(0x0881, 0x0881, 0, 0, write8_delegate(FUNC(mpu4_state::crystal_sound_w),this));
}
// thanks to Project Amber for descramble information
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index bb317d7595b..e8e368bfe99 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -525,20 +525,20 @@ static SCREEN_UPDATE_RGB32(mpu4_vid)
static READ16_HANDLER( mpu4_vid_vidram_r )
{
- mpu4vid_state *state = space->machine().driver_data<mpu4vid_state>();
+ mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
return state->m_vid_vidram[offset];
}
static WRITE16_HANDLER( mpu4_vid_vidram_w )
{
- mpu4vid_state *state = space->machine().driver_data<mpu4vid_state>();
+ mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
COMBINE_DATA(&state->m_vid_vidram[offset]);
offset <<= 1;
- space->machine().gfx[state->m_gfx_index+0]->mark_dirty(offset/0x20);
- space->machine().gfx[state->m_gfx_index+1]->mark_dirty(offset/0x20);
- space->machine().gfx[state->m_gfx_index+2]->mark_dirty(offset/0x20);
- space->machine().gfx[state->m_gfx_index+3]->mark_dirty(offset/0x20);
+ space.machine().gfx[state->m_gfx_index+0]->mark_dirty(offset/0x20);
+ space.machine().gfx[state->m_gfx_index+1]->mark_dirty(offset/0x20);
+ space.machine().gfx[state->m_gfx_index+2]->mark_dirty(offset/0x20);
+ space.machine().gfx[state->m_gfx_index+3]->mark_dirty(offset/0x20);
}
@@ -581,7 +581,7 @@ VIDEO_START_MEMBER(mpu4vid_state,mpu4_vid)
static WRITE16_HANDLER( ef9369_w )
{
- mpu4vid_state *state = space->machine().driver_data<mpu4vid_state>();
+ mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
struct ef9369_t &pal = state->m_pal;
data &= 0x00ff;
@@ -611,7 +611,7 @@ static WRITE16_HANDLER( ef9369_w )
col = pal.clut[entry] & 0xfff;
/* Update the MAME palette */
- palette_set_color_rgb(space->machine(), entry, pal4bit(col >> 8), pal4bit(col >> 4), pal4bit(col >> 0));
+ palette_set_color_rgb(space.machine(), entry, pal4bit(col >> 8), pal4bit(col >> 4), pal4bit(col >> 0));
}
/* Address register auto-increment */
@@ -623,7 +623,7 @@ static WRITE16_HANDLER( ef9369_w )
static READ16_HANDLER( ef9369_r )
{
- mpu4vid_state *state = space->machine().driver_data<mpu4vid_state>();
+ mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
struct ef9369_t &pal = state->m_pal;
if ((offset & 1) == 0)
{
@@ -660,7 +660,7 @@ static READ16_HANDLER( ef9369_r )
WRITE16_HANDLER( bt471_w )
{
- mpu4vid_state *state = space->machine().driver_data<mpu4vid_state>();
+ mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
struct bt471_t &bt471 = state->m_bt471;
UINT8 val = data & 0xff;
{
@@ -684,7 +684,7 @@ WRITE16_HANDLER( bt471_w )
if (++*addr_cnt == 3)
{
- palette_set_color(space->machine(), bt471.address, MAKE_RGB(color[0], color[1], color[2]));
+ palette_set_color(space.machine(), bt471.address, MAKE_RGB(color[0], color[1], color[2]));
*addr_cnt = 0;
/* Address register increments */
@@ -1597,14 +1597,14 @@ Characteriser (CHR)
static WRITE16_HANDLER( characteriser16_w )
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
int x;
int call=data;
- LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", space->device().safe_pcbase(),offset,data));
+ LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", space.device().safe_pcbase(),offset,data));
if (!state->m_current_chr_table)
{
- logerror("No Characteriser Table @ %04x\n", space->device().safe_pcbase());
+ logerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
return;
}
@@ -1629,20 +1629,20 @@ static WRITE16_HANDLER( characteriser16_w )
static READ16_HANDLER( characteriser16_r )
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
- LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", space->device().safe_pcbase(),offset,state->m_current_chr_table[state->m_prot_col].response));
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
+ LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", space.device().safe_pcbase(),offset,state->m_current_chr_table[state->m_prot_col].response));
LOG_CHR(("Characteriser read offset %02X \n",offset));
LOG_CHR(("Characteriser read data %02X \n",state->m_current_chr_table[state->m_prot_col].response));
if (!state->m_current_chr_table)
{
- logerror("No Characteriser Table @ %04x\n", space->device().safe_pcbase());
+ logerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
return 0x00;
}
/* hack for 'invalid questions' error on time machine.. I guess it wants them to decode properly for startup check? */
- if (space->device().safe_pcbase()==0x283a)
+ if (space.device().safe_pcbase()==0x283a)
{
return 0x00;
}
@@ -1669,13 +1669,13 @@ Precedent suggests this is not that dangerous an assumption to make.
static WRITE16_HANDLER( bwb_characteriser16_w )
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
int x;
int call=data &0xff;
- LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", space->device().safe_pcbase(),offset,data));
+ LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", space.device().safe_pcbase(),offset,data));
if (!state->m_current_chr_table)
{
- logerror("No Characteriser Table @ %04x\n", space->device().safe_pcbase());
+ logerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
return;
}
@@ -1695,7 +1695,7 @@ static WRITE16_HANDLER( bwb_characteriser16_w )
state->m_init_col =0;
}
}
- state->m_chr_value = space->machine().rand();
+ state->m_chr_value = space.machine().rand();
for (x = 0; x < 4; x++)
{
if (state->m_current_chr_table[(x)].call == call)
@@ -1713,7 +1713,7 @@ static WRITE16_HANDLER( bwb_characteriser16_w )
static READ16_HANDLER( bwb_characteriser16_r )
{
- mpu4_state *state = space->machine().driver_data<mpu4_state>();
+ mpu4_state *state = space.machine().driver_data<mpu4_state>();
LOG_CHR(("Characteriser read offset %02X \n",offset));
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index ed93f6854eb..82a833557e7 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -87,8 +87,8 @@ static WRITE8_DEVICE_HANDLER( mquake_cia_0_portb_w )
static READ8_HANDLER( es5503_sample_r )
{
- UINT8 *rom = space->machine().root_device().memregion("es5503")->base();
- es5503_device *es5503 = space->machine().device<es5503_device>("es5503");
+ UINT8 *rom = space.machine().root_device().memregion("es5503")->base();
+ es5503_device *es5503 = space.machine().device<es5503_device>("es5503");
return rom[offset + (es5503->get_channel_strobe() * 0x10000)];
}
@@ -100,21 +100,21 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( output_w )
{
if (ACCESSING_BITS_0_7)
- logerror("%06x:output_w(%x) = %02x\n", space->device().safe_pc(), offset, data);
+ logerror("%06x:output_w(%x) = %02x\n", space.device().safe_pc(), offset, data);
}
static READ16_HANDLER( coin_chip_r )
{
if (offset == 1)
- return space->machine().root_device().ioport("COINCHIP")->read();
- logerror("%06x:coin_chip_r(%02x) & %04x\n", space->device().safe_pc(), offset, mem_mask);
+ return space.machine().root_device().ioport("COINCHIP")->read();
+ logerror("%06x:coin_chip_r(%02x) & %04x\n", space.device().safe_pc(), offset, mem_mask);
return 0xffff;
}
static WRITE16_HANDLER( coin_chip_w )
{
- logerror("%06x:coin_chip_w(%02x) = %04x & %04x\n", space->device().safe_pc(), offset, data, mem_mask);
+ logerror("%06x:coin_chip_w(%02x) = %04x & %04x\n", space.device().safe_pc(), offset, data, mem_mask);
}
// inputs at 282000, 282002 (full word)
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 4379573c253..084e2abb536 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -236,7 +236,7 @@ WRITE8_MEMBER(multigam_state::sprite_dma_w)
{
int source = (data & 7);
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
- ppu->spriteram_dma(&space, source);
+ ppu->spriteram_dma(space, source);
}
READ8_MEMBER(multigam_state::psg_4015_r)
@@ -1138,9 +1138,9 @@ void multigam_state::machine_reset()
MACHINE_RESET_MEMBER(multigam_state,multigm3)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset the ppu */
- multigm3_switch_prg_rom(*space, 0, 0x01 );
+ multigm3_switch_prg_rom(space, 0, 0x01 );
};
void multigam_state::machine_start()
@@ -1360,8 +1360,8 @@ ROM_END
DRIVER_INIT_MEMBER(multigam_state,multigam)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- multigam_switch_prg_rom(*space, 0x0, 0x01);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ multigam_switch_prg_rom(space, 0x0, 0x01);
}
static void multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble)
@@ -1375,7 +1375,7 @@ static void multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble
DRIVER_INIT_MEMBER(multigam_state,multigm3)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a };
@@ -1384,12 +1384,12 @@ DRIVER_INIT_MEMBER(multigam_state,multigm3)
m_multigmc_mmc3_6000_ram = auto_alloc_array(machine(), UINT8, 0x2000);
- multigam_switch_prg_rom(*space, 0x0, 0x01);
+ multigam_switch_prg_rom(space, 0x0, 0x01);
}
DRIVER_INIT_MEMBER(multigam_state,multigmt)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8* buf = auto_alloc_array(machine(), UINT8, 0x80000);
UINT8 *rom;
@@ -1425,7 +1425,7 @@ DRIVER_INIT_MEMBER(multigam_state,multigmt)
}
auto_free(machine(), buf);
- multigam_switch_prg_rom(*space, 0x0, 0x01);
+ multigam_switch_prg_rom(space, 0x0, 0x01);
};
GAME( 1992, multigam, 0, multigam, multigam, multigam_state, multigam, ROT0, "<unknown>", "Multi Game (set 1)", 0 )
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index 3c71760a441..94405f64751 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -207,7 +207,7 @@ READ16_MEMBER(mystwarr_state::sound_status_msb_r)
WRITE16_MEMBER(mystwarr_state::irq_ack_w)
{
- K056832_b_word_w(&space, offset, data, mem_mask);
+ K056832_b_word_w(space, offset, data, mem_mask);
if (offset == 3 && ACCESSING_BITS_0_7)
{
@@ -227,7 +227,7 @@ READ16_MEMBER(mystwarr_state::K053247_scattered_word_r)
else
{
offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4);
- return K053247_word_r(&space,offset,mem_mask);
+ return K053247_word_r(space,offset,mem_mask);
}
}
@@ -242,7 +242,7 @@ WRITE16_MEMBER(mystwarr_state::K053247_scattered_word_w)
{
offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4);
- K053247_word_w(&space,offset,data,mem_mask);
+ K053247_word_w(space,offset,data,mem_mask);
}
}
@@ -377,7 +377,7 @@ READ16_MEMBER(mystwarr_state::K053247_martchmp_word_r)
else
{
offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2);
- return K053247_word_r(&space,offset,mem_mask);
+ return K053247_word_r(space,offset,mem_mask);
}
}
@@ -391,7 +391,7 @@ WRITE16_MEMBER(mystwarr_state::K053247_martchmp_word_w)
{
offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2);
- K053247_word_w(&space,offset,data,mem_mask);
+ K053247_word_w(space,offset,data,mem_mask);
}
}
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index 32d60b5f39f..522dca08f48 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -495,7 +495,7 @@ static int transfer_dword( running_machine &machine, UINT32 dest, UINT32 source
{
namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 data;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if( source>=0x400000 && source<0xc00000 )
{
@@ -516,15 +516,15 @@ static int transfer_dword( running_machine &machine, UINT32 dest, UINT32 source
}
if( dest>=0xf00000 && dest<0xf02000 )
{
- state->namcona1_paletteram_w(*space, (dest-0xf00000)/2, data, 0xffff );
+ state->namcona1_paletteram_w(space, (dest-0xf00000)/2, data, 0xffff );
}
else if( dest>=0xf40000 && dest<0xf80000 )
{
- state->namcona1_gfxram_w(*space, (dest-0xf40000)/2, data, 0xffff );
+ state->namcona1_gfxram_w(space, (dest-0xf40000)/2, data, 0xffff );
}
else if( dest>=0xff0000 && dest<0xffc000 )
{
- state->namcona1_videoram_w(*space, (dest-0xff0000)/2, data, 0xffff );
+ state->namcona1_videoram_w(space, (dest-0xff0000)/2, data, 0xffff );
}
else if( dest>=0xfff000 && dest<0x1000000 )
{
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index b8a982a7f59..1db2947c2cd 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -628,9 +628,9 @@ READ32_MEMBER(namcos11_state::keycus_c443_r)
return data;
}
-INLINE void bankswitch_rom8( address_space *space, const char *bank, int n_data )
+INLINE void bankswitch_rom8( address_space &space, const char *bank, int n_data )
{
- space->machine().root_device().membank( bank )->set_entry( ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) );
+ space.machine().root_device().membank( bank )->set_entry( ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) );
}
static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" };
@@ -641,11 +641,11 @@ WRITE32_MEMBER(namcos11_state::bankswitch_rom32_w)
if( ACCESSING_BITS_0_15 )
{
- bankswitch_rom8( &space, bankname[offset * 2], data & 0xffff );
+ bankswitch_rom8( space, bankname[offset * 2], data & 0xffff );
}
if( ACCESSING_BITS_16_31 )
{
- bankswitch_rom8( &space, bankname[offset * 2 + 1], data >> 16 );
+ bankswitch_rom8( space, bankname[offset * 2 + 1], data >> 16 );
}
}
@@ -664,9 +664,9 @@ WRITE32_MEMBER(namcos11_state::bankswitch_rom64_upper_w)
}
}
-INLINE void bankswitch_rom64( address_space *space, const char *bank, int n_data )
+INLINE void bankswitch_rom64( address_space &space, const char *bank, int n_data )
{
- namcos11_state *state = space->machine().driver_data<namcos11_state>();
+ namcos11_state *state = space.machine().driver_data<namcos11_state>();
/* todo: verify behaviour */
state->membank( bank )->set_entry( ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ state->m_n_bankoffset ) );
@@ -678,11 +678,11 @@ WRITE32_MEMBER(namcos11_state::bankswitch_rom64_w)
if( ACCESSING_BITS_0_15 )
{
- bankswitch_rom64( &space, bankname[offset * 2], data & 0xffff );
+ bankswitch_rom64( space, bankname[offset * 2], data & 0xffff );
}
if( ACCESSING_BITS_16_31 )
{
- bankswitch_rom64( &space, bankname[offset * 2 + 1], data >> 16 );
+ bankswitch_rom64( space, bankname[offset * 2 + 1], data >> 16 );
}
}
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index af9c0f3a48f..6b7a17185a6 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1386,10 +1386,10 @@ READ32_MEMBER(namcos12_state::tektagt_protection_3_r)
MACHINE_RESET_MEMBER(namcos12_state,namcos12)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- bankoffset_w(*space,0,0,0xffffffff);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ bankoffset_w(space,0,0,0xffffffff);
- space->install_write_handler(0x1f801000, 0x1f801003, write32_delegate(FUNC(namcos12_state::s12_dma_bias_w),this));
+ space.install_write_handler(0x1f801000, 0x1f801003, write32_delegate(FUNC(namcos12_state::s12_dma_bias_w),this));
m_has_tektagt_dma = 0;
@@ -1402,9 +1402,9 @@ MACHINE_RESET_MEMBER(namcos12_state,namcos12)
strcmp( machine().system().name, "tektagtja" ) == 0 )
{
m_has_tektagt_dma = 1;
- space->install_readwrite_handler(0x1fb00000, 0x1fb00003, read32_delegate(FUNC(namcos12_state::tektagt_protection_1_r),this), write32_delegate(FUNC(namcos12_state::tektagt_protection_1_w),this));
- space->install_readwrite_handler(0x1fb80000, 0x1fb80003, read32_delegate(FUNC(namcos12_state::tektagt_protection_2_r),this), write32_delegate(FUNC(namcos12_state::tektagt_protection_2_w),this));
- space->install_read_handler(0x1f700000, 0x1f700003, read32_delegate(FUNC(namcos12_state::tektagt_protection_3_r),this));
+ space.install_readwrite_handler(0x1fb00000, 0x1fb00003, read32_delegate(FUNC(namcos12_state::tektagt_protection_1_r),this), write32_delegate(FUNC(namcos12_state::tektagt_protection_1_w),this));
+ space.install_readwrite_handler(0x1fb80000, 0x1fb80003, read32_delegate(FUNC(namcos12_state::tektagt_protection_2_r),this), write32_delegate(FUNC(namcos12_state::tektagt_protection_2_w),this));
+ space.install_read_handler(0x1f700000, 0x1f700003, read32_delegate(FUNC(namcos12_state::tektagt_protection_3_r),this));
}
if( strcmp( machine().system().name, "tektagt" ) == 0 ||
@@ -1430,9 +1430,9 @@ MACHINE_RESET_MEMBER(namcos12_state,namcos12)
strcmp( machine().system().name, "ghlpanic" ) == 0 )
{
/* this is based on guesswork, it might not even be keycus. */
- space->install_read_bank (0x1fc20280, 0x1fc2028b, "bank2" );
- space->install_write_handler(0x1f008000, 0x1f008003, write32_delegate(FUNC(namcos12_state::kcon_w),this));
- space->install_write_handler(0x1f018000, 0x1f018003, write32_delegate(FUNC(namcos12_state::kcoff_w),this));
+ space.install_read_bank (0x1fc20280, 0x1fc2028b, "bank2" );
+ space.install_write_handler(0x1f008000, 0x1f008003, write32_delegate(FUNC(namcos12_state::kcon_w),this));
+ space.install_write_handler(0x1f018000, 0x1f018003, write32_delegate(FUNC(namcos12_state::kcoff_w),this));
memset( m_kcram, 0, sizeof( m_kcram ) );
membank( "bank2" )->set_base( m_kcram );
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index 06e9b5df966..562ec9dfecf 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -524,9 +524,9 @@ namcos21_kickstart( running_machine &machine, int internal )
}
static UINT16
-ReadWordFromSlaveInput( address_space *space )
+ReadWordFromSlaveInput( address_space &space )
{
- namcos21_state *state = space->machine().driver_data<namcos21_state>();
+ namcos21_state *state = space.machine().driver_data<namcos21_state>();
UINT16 data = 0;
if( state->m_mpDspState->slaveBytesAvailable>0 )
{
@@ -537,7 +537,7 @@ ReadWordFromSlaveInput( address_space *space )
{
state->m_mpDspState->slaveBytesAdvertised--;
}
- if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", space->machine().describe_context(), data, state->m_mpDspState->slaveBytesAvailable );
+ if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", space.machine().describe_context(), data, state->m_mpDspState->slaveBytesAvailable );
}
return data;
} /* ReadWordFromSlaveInput */
@@ -853,7 +853,7 @@ RenderSlaveOutput( running_machine &machine, UINT16 data )
READ16_MEMBER(namcos21_state::slave_port0_r)
{
- return ReadWordFromSlaveInput(&space);
+ return ReadWordFromSlaveInput(space);
} /* slave_port0_r */
WRITE16_MEMBER(namcos21_state::slave_port0_w)
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index 83e02a4bd01..d3d4b09bb25 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -2128,14 +2128,14 @@ static void p3d_flush(namcos23_state *state, const UINT16 *p, int size)
render.count[render.cur]++;
}
-static void p3d_dma(address_space *space, UINT32 adr, UINT32 size)
+static void p3d_dma(address_space &space, UINT32 adr, UINT32 size)
{
- namcos23_state *state = space->machine().driver_data<namcos23_state>();
+ namcos23_state *state = space.machine().driver_data<namcos23_state>();
UINT16 buffer[256];
adr &= 0x1fffffff;
int pos = 0;
while(pos < size) {
- UINT16 h = space->read_word(adr+pos);
+ UINT16 h = space.read_word(adr+pos);
pos += 2;
@@ -2155,7 +2155,7 @@ static void p3d_dma(address_space *space, UINT32 adr, UINT32 size)
}
for(int i=0; i < psize; i++) {
- buffer[i] = space->read_word(adr+pos);
+ buffer[i] = space.read_word(adr+pos);
pos += 2;
}
@@ -2199,7 +2199,7 @@ WRITE32_MEMBER(namcos23_state::p3d_w)
case 0x8: COMBINE_DATA(&m_p3d_size); return;
case 0x9:
if(data & 1)
- p3d_dma(&space, m_p3d_address, m_p3d_size);
+ p3d_dma(space, m_p3d_address, m_p3d_size);
return;
case 0x17:
machine().device("maincpu")->execute().set_input_line(MIPS3_IRQ1, CLEAR_LINE);
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index aac838a54d4..42d625a10c6 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -1416,14 +1416,14 @@ static const struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1,
static READ64_HANDLER( naomi_arm_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
return *(reinterpret_cast<UINT64 *>(state->dc_sound_ram.target())+offset);
}
static WRITE64_HANDLER( naomi_arm_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
COMBINE_DATA(reinterpret_cast<UINT64 *>(state->dc_sound_ram.target()) + offset);
}
@@ -1517,7 +1517,7 @@ static WRITE64_DEVICE_HANDLER( eeprom_93c46a_w )
// SB_LMMODE0
static WRITE64_HANDLER( ta_texture_directpath0_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int mode = state->pvrctrl_regs[SB_LMMODE0]&1;
if (mode&1)
@@ -1534,7 +1534,7 @@ static WRITE64_DEVICE_HANDLER( eeprom_93c46a_w )
// SB_LMMODE1
static WRITE64_HANDLER( ta_texture_directpath1_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int mode = state->pvrctrl_regs[SB_LMMODE1]&1;
if (mode&1)
@@ -1724,11 +1724,11 @@ static READ64_HANDLER( aw_modem_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
if (reg == 0x280/4)
{
- UINT32 coins = space->machine().root_device().ioport("COINS")->read();
+ UINT32 coins = space.machine().root_device().ioport("COINS")->read();
if (coins & 0x01)
{
@@ -1752,7 +1752,7 @@ static WRITE64_HANDLER( aw_modem_w )
UINT64 shift;
UINT32 dat;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
mame_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask);
}
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 87a7e5b738b..93c150bca6a 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -52,9 +52,9 @@ WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundclr_w)
soundlatch_clear_byte_w(space, 0, 0);
}
-static void nbmj9195_outcoin_flag_w(address_space *space, int data)
+static void nbmj9195_outcoin_flag_w(address_space &space, int data)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
// bit0: coin in counter
// bit1: coin out counter
// bit2: hopper
@@ -75,9 +75,9 @@ static int nbmj9195_dipsw_r(running_machine &machine)
return (((state->ioport("DSWA")->read() & 0xff) | ((state->ioport("DSWB")->read() & 0xff) << 8)) >> state->m_dipswbitsel) & 0x01;
}
-static void nbmj9195_dipswbitsel_w(address_space *space, int data)
+static void nbmj9195_dipswbitsel_w(address_space &space, int data)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
switch (data & 0xc0)
{
case 0x00:
@@ -95,9 +95,9 @@ static void nbmj9195_dipswbitsel_w(address_space *space, int data)
}
}
-static void mscoutm_inputportsel_w(address_space *space, int data)
+static void mscoutm_inputportsel_w(address_space &space, int data)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
state->m_mscoutm_inputport = (data ^ 0xff);
}
@@ -316,17 +316,17 @@ WRITE8_MEMBER(nbmj9195_state::tmpz84c011_pio_w)
switch (offset)
{
case 0: /* PA_0 */
- mscoutm_inputportsel_w(&space, data); // NB22090
+ mscoutm_inputportsel_w(space, data); // NB22090
break;
case 1: /* PB_0 */
break;
case 2: /* PC_0 */
break;
case 3: /* PD_0 */
- nbmj9195_clutsel_w(&space, data);
+ nbmj9195_clutsel_w(space, data);
break;
case 4: /* PE_0 */
- nbmj9195_gfxflag2_w(&space, data); // NB22090
+ nbmj9195_gfxflag2_w(space, data); // NB22090
break;
case 5: /* PA_1 */
@@ -358,13 +358,13 @@ WRITE8_MEMBER(nbmj9195_state::tmpz84c011_pio_w)
case 1: /* PB_0 */
break;
case 2: /* PC_0 */
- nbmj9195_dipswbitsel_w(&space, data);
+ nbmj9195_dipswbitsel_w(space, data);
break;
case 3: /* PD_0 */
- nbmj9195_clutsel_w(&space, data);
+ nbmj9195_clutsel_w(space, data);
break;
case 4: /* PE_0 */
- nbmj9195_outcoin_flag_w(&space, data);
+ nbmj9195_outcoin_flag_w(space, data);
break;
case 5: /* PA_1 */
@@ -636,27 +636,27 @@ static Z80CTC_INTERFACE( ctc_intf_audio )
void nbmj9195_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
for (i = 0; i < (5 * 2); i++)
{
m_pio_dir[i] = m_pio_latch[i] = 0;
- tmpz84c011_pio_w(*space, i, 0);
+ tmpz84c011_pio_w(space, i, 0);
}
}
DRIVER_INIT_MEMBER(nbmj9195_state,nbmj9195)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ROM = memregion("audiocpu")->base();
// sound program patch
ROM[0x0213] = 0x00; // DI -> NOP
// initialize sound rom bank
- nbmj9195_soundbank_w(*space, 0, 0);
+ nbmj9195_soundbank_w(space, 0, 0);
logerror("DRIVER_INIT( nbmj9195 )\n");
}
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 58727cb2387..d7b011bd7fd 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -9834,7 +9834,7 @@ DRIVER_INIT_MEMBER(neogeo_state,lans2004)
static READ16_HANDLER( sbp_lowerrom_r )
{
- UINT16* rom = (UINT16*)space->machine().root_device().memregion("maincpu")->base();
+ UINT16* rom = (UINT16*)space.machine().root_device().memregion("maincpu")->base();
UINT16 origdata = rom[(offset+(0x200/2))];
UINT16 data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4);
int realoffset = 0x200+(offset*2);
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 00617df2112..72f2395f847 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -217,28 +217,28 @@ void neogeo_set_display_position_interrupt_control( running_machine &machine, UI
}
-void neogeo_set_display_counter_msb( address_space *space, UINT16 data )
+void neogeo_set_display_counter_msb( address_space &space, UINT16 data )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
state->m_display_counter = (state->m_display_counter & 0x0000ffff) | ((UINT32)data << 16);
- if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", space->device().safe_pc(), state->m_display_counter);
+ if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", space.device().safe_pc(), state->m_display_counter);
}
-void neogeo_set_display_counter_lsb( address_space *space, UINT16 data )
+void neogeo_set_display_counter_lsb( address_space &space, UINT16 data )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
state->m_display_counter = (state->m_display_counter & 0xffff0000) | data;
- if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", space->device().safe_pc(), state->m_display_counter);
+ if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", space.device().safe_pc(), state->m_display_counter);
if (state->m_display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE)
{
if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_RELATIVE ");
- adjust_display_position_interrupt_timer(space->machine());
+ adjust_display_position_interrupt_timer(space.machine());
}
}
@@ -649,15 +649,15 @@ static void _set_main_cpu_bank_address( running_machine &machine )
}
-void neogeo_set_main_cpu_bank_address( address_space *space, UINT32 bank_address )
+void neogeo_set_main_cpu_bank_address( address_space &space, UINT32 bank_address )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
- if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", space->device().safe_pc(), bank_address);
+ if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", space.device().safe_pc(), bank_address);
state->m_main_cpu_bank_address = bank_address;
- _set_main_cpu_bank_address(space->machine());
+ _set_main_cpu_bank_address(space.machine());
}
@@ -678,14 +678,14 @@ WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w)
bank_address = 0x100000;
}
- neogeo_set_main_cpu_bank_address(&space, bank_address);
+ neogeo_set_main_cpu_bank_address(space, bank_address);
}
}
static void main_cpu_banking_init( running_machine &machine )
{
- address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &mainspace = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* create vector banks */
machine.root_device().membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base());
@@ -716,21 +716,21 @@ static void set_audio_cpu_banking( running_machine &machine )
}
-static void audio_cpu_bank_select( address_space *space, int region, UINT8 bank )
+static void audio_cpu_bank_select( address_space &space, int region, UINT8 bank )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", space->device().safe_pc(), region, bank);
+ if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", space.device().safe_pc(), region, bank);
state->m_audio_cpu_banks[region] = bank;
- set_audio_cpu_banking(space->machine());
+ set_audio_cpu_banking(space.machine());
}
READ8_MEMBER(neogeo_state::audio_cpu_bank_select_f000_f7ff_r)
{
- audio_cpu_bank_select(&space, 0, offset >> 8);
+ audio_cpu_bank_select(space, 0, offset >> 8);
return 0;
}
@@ -738,7 +738,7 @@ READ8_MEMBER(neogeo_state::audio_cpu_bank_select_f000_f7ff_r)
READ8_MEMBER(neogeo_state::audio_cpu_bank_select_e000_efff_r)
{
- audio_cpu_bank_select(&space, 1, offset >> 8);
+ audio_cpu_bank_select(space, 1, offset >> 8);
return 0;
}
@@ -746,7 +746,7 @@ READ8_MEMBER(neogeo_state::audio_cpu_bank_select_e000_efff_r)
READ8_MEMBER(neogeo_state::audio_cpu_bank_select_c000_dfff_r)
{
- audio_cpu_bank_select(&space, 2, offset >> 8);
+ audio_cpu_bank_select(space, 2, offset >> 8);
return 0;
}
@@ -754,15 +754,15 @@ READ8_MEMBER(neogeo_state::audio_cpu_bank_select_c000_dfff_r)
READ8_MEMBER(neogeo_state::audio_cpu_bank_select_8000_bfff_r)
{
- audio_cpu_bank_select(&space, 3, offset >> 8);
+ audio_cpu_bank_select(space, 3, offset >> 8);
return 0;
}
-static void _set_audio_cpu_rom_source( address_space *space )
+static void _set_audio_cpu_rom_source( address_space &space )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
/* if (!state->memregion("audiobios")->base()) */
state->m_audio_cpu_rom_source = 1;
@@ -774,16 +774,16 @@ static void _set_audio_cpu_rom_source( address_space *space )
{
state->m_audio_cpu_rom_source_last = state->m_audio_cpu_rom_source;
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space->device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
+ if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space.device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
}
}
-static void set_audio_cpu_rom_source( address_space *space, UINT8 data )
+static void set_audio_cpu_rom_source( address_space &space, UINT8 data )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
state->m_audio_cpu_rom_source = data;
_set_audio_cpu_rom_source(space);
@@ -826,7 +826,7 @@ static void audio_cpu_banking_init( running_machine &machine )
set_audio_cpu_banking(machine);
state->m_audio_cpu_rom_source_last = 0;
- set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
+ set_audio_cpu_rom_source(*machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
}
@@ -848,7 +848,7 @@ WRITE16_MEMBER(neogeo_state::system_control_w)
default:
case 0x00: neogeo_set_screen_dark(machine(), bit); break;
case 0x01: set_main_cpu_vector_table_source(machine(), bit);
- set_audio_cpu_rom_source(&space, bit); /* this is a guess */
+ set_audio_cpu_rom_source(space, bit); /* this is a guess */
break;
case 0x05: neogeo_set_fixed_layer_source(machine(), bit); break;
case 0x06: set_save_ram_unlock(machine(), bit); break;
@@ -982,7 +982,7 @@ static void neogeo_postload(running_machine &machine)
_set_main_cpu_bank_address(machine);
_set_main_cpu_vector_table_source(machine);
set_audio_cpu_banking(machine);
- _set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM));
+ _set_audio_cpu_rom_source(*machine.device("maincpu")->memory().space(AS_PROGRAM));
set_outputs(machine);
}
@@ -1050,11 +1050,11 @@ void neogeo_state::machine_start()
void neogeo_state::machine_reset()
{
offs_t offs;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset system control registers */
for (offs = 0; offs < 8; offs++)
- system_control_w(*space, offs, 0, 0x00ff);
+ system_control_w(space, offs, 0, 0x00ff);
machine().device("maincpu")->reset();
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index 61b0b59fe6b..cfc9dbb8b74 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -1469,8 +1469,8 @@ DRIVER_INIT_MEMBER(ninjakd2_state,ninjakd2)
DRIVER_INIT_MEMBER(ninjakd2_state,bootleg)
{
- address_space *space = machine().device("soundcpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("soundcpu")->base() + 0x10000);
+ address_space &space = *machine().device("soundcpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("soundcpu")->base() + 0x10000);
gfx_unscramble(machine());
}
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index 0029530329a..90303d19f6e 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -245,14 +245,14 @@ static Z80CTC_INTERFACE( ctc_intf )
void niyanpai_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
for (i = 0; i < 5; i++)
{
m_pio_dir[i] = m_pio_latch[i] = 0;
- tmpz84c011_pio_w(*space, i, 0);
+ tmpz84c011_pio_w(space, i, 0);
}
}
@@ -308,7 +308,7 @@ READ16_MEMBER(niyanpai_state::musobana_inputport_0_r)
CUSTOM_INPUT_MEMBER(niyanpai_state::musobana_outcoin_flag_r)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
// tmp68301_parallel_interface[0x05]
// bit 0 coin counter
// bit 2 motor on
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 630d69ba9b8..62dd24b6c75 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -4708,7 +4708,7 @@ WRITE8_MEMBER(nmk16_state::twinactn_oki_bank_w)
if (data & (~3))
logerror("%s: invalid oki bank %02x\n", machine().describe_context(), data);
-// logerror("%04x: oki bank %02x\n", space->device().safe_pc(), data);
+// logerror("%04x: oki bank %02x\n", space.device().safe_pc(), data);
}
static ADDRESS_MAP_START( twinactn_sound_cpu, AS_PROGRAM, 8, nmk16_state )
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index edf9e583e88..f3d0e3d0350 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -466,7 +466,7 @@ WRITE8_MEMBER(nyny_state::nyny_ay8910_37_port_a_w)
{
/* not sure what this does */
- /*logerror("%x PORT A write %x at Y=%x X=%x\n", space->device().safe_pc(), data, space->machine().primary_screen->vpos(), space->machine().primary_screen->hpos());*/
+ /*logerror("%x PORT A write %x at Y=%x X=%x\n", space.device().safe_pc(), data, space.machine().primary_screen->vpos(), space.machine().primary_screen->hpos());*/
}
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index 995be5d4824..e8bca062d3c 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -99,7 +99,7 @@ WRITE8_MEMBER(ojankohs_state::ojankoc_ctrl_w)
m_adpcm_reset = BIT(data, 4);
msm5205_reset_w(m_msm, !BIT(data, 4));
- ojankoc_flipscreen(&space, data);
+ ojankoc_flipscreen(space, data);
}
WRITE8_MEMBER(ojankohs_state::ojankohs_portselect_w)
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index 2665ed7975a..2ff92f6b0b2 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -246,7 +246,7 @@ public:
void omegrace_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Omega Race expects the vector processor to be ready. */
avgdvg_reset_w(space, 0, 0);
}
@@ -261,7 +261,7 @@ void omegrace_state::machine_reset()
READ8_MEMBER(omegrace_state::omegrace_vg_go_r)
{
- avgdvg_go_w(&space,0,0);
+ avgdvg_go_w(space,0,0);
return 0;
}
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index 1eab0f661cd..adb77d1099d 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -499,7 +499,7 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_b_w)
msm5205_reset_w(device, 0);
}
-// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,space->device().safe_pc() );
+// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() );
}
@@ -522,7 +522,7 @@ WRITE8_MEMBER(opwolf_state::opwolf_adpcm_c_w)
msm5205_reset_w(device, 0);
}
-// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,space->device().safe_pc() );
+// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() );
}
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index fea831e0cfd..da584f40be7 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -5744,13 +5744,13 @@ ROM_END
static void maketrax_rom_decode(running_machine &machine)
{
pacman_state *state = machine.driver_data<pacman_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
- space->set_decrypted_region(0x0000, 0x3fff, decrypted);
+ space.set_decrypted_region(0x0000, 0x3fff, decrypted);
memcpy(decrypted,rom,0x4000);
@@ -5777,13 +5777,13 @@ DRIVER_INIT_MEMBER(pacman_state,maketrax)
static void korosuke_rom_decode(running_machine &machine)
{
pacman_state *state = machine.driver_data<pacman_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
- space->set_decrypted_region(0x0000, 0x3fff, decrypted);
+ space.set_decrypted_region(0x0000, 0x3fff, decrypted);
memcpy(decrypted,rom,0x4000);
diff --git a/src/mame/drivers/pangofun.c b/src/mame/drivers/pangofun.c
index 9ffe986dc93..a3c1a6087b3 100644
--- a/src/mame/drivers/pangofun.c
+++ b/src/mame/drivers/pangofun.c
@@ -244,7 +244,7 @@ ROM_END
DRIVER_INIT_MEMBER(pangofun_state,pangofun)
{
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
GAME( 1995, pangofun, 0, pangofun, pangofun, pangofun_state, pangofun, ROT0, "InfoCube", "Pango Fun (Italy)", GAME_NOT_WORKING|GAME_NO_SOUND )
diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c
index bd83bde872b..61d36faa83f 100644
--- a/src/mame/drivers/panicr.c
+++ b/src/mame/drivers/panicr.c
@@ -311,7 +311,7 @@ WRITE8_MEMBER(panicr_state::panicr_output_w)
READ8_MEMBER(panicr_state::t5182shared_r)
{
if ((offset & 1) == 0)
- return t5182_sharedram_r(&space, offset/2);
+ return t5182_sharedram_r(space, offset/2);
else
return 0;
}
@@ -319,7 +319,7 @@ READ8_MEMBER(panicr_state::t5182shared_r)
WRITE8_MEMBER(panicr_state::t5182shared_w)
{
if ((offset & 1) == 0)
- t5182_sharedram_w(&space, offset/2, data);
+ t5182_sharedram_w(space, offset/2, data);
}
diff --git a/src/mame/drivers/pastelg.c b/src/mame/drivers/pastelg.c
index 8a723982812..6c423a4fb4b 100644
--- a/src/mame/drivers/pastelg.c
+++ b/src/mame/drivers/pastelg.c
@@ -47,7 +47,7 @@ READ8_MEMBER(pastelg_state::pastelg_sndrom_r)
{
UINT8 *ROM = memregion("voice")->base();
- return ROM[pastelg_blitter_src_addr_r(&space) & 0x7fff];
+ return ROM[pastelg_blitter_src_addr_r(space) & 0x7fff];
}
static ADDRESS_MAP_START( pastelg_map, AS_PROGRAM, 8, pastelg_state )
diff --git a/src/mame/drivers/pcat_dyn.c b/src/mame/drivers/pcat_dyn.c
index d49afd76d74..b479557c2ee 100644
--- a/src/mame/drivers/pcat_dyn.c
+++ b/src/mame/drivers/pcat_dyn.c
@@ -197,7 +197,7 @@ ROM_END
DRIVER_INIT_MEMBER(pcat_dyn_state,pcat_dyn)
{
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
GAME( 1995, toursol, 0, pcat_dyn, pcat_dyn, pcat_dyn_state, pcat_dyn, ROT0, "Dynamo", "Tournament Solitaire (V1.06, 08/03/95)", GAME_NOT_WORKING|GAME_NO_SOUND )
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index b7d86696d7e..6b344caf77f 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -427,7 +427,7 @@ DRIVER_INIT_MEMBER(pcat_nit_state,pcat_nit)
machine().device<nvram_device>("nvram")->set_base(m_banked_nvram, 0x2000);
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
GAME( 1993, bonanza, 0, pcat_nit, pcat_nit, pcat_nit_state, pcat_nit, ROT0, "New Image Technologies", "Bonanza (Revision 3)", GAME_NOT_WORKING|GAME_NO_SOUND )
diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c
index d71d7ba8dde..03e78f4a69e 100644
--- a/src/mame/drivers/pcktgal.c
+++ b/src/mame/drivers/pcktgal.c
@@ -411,11 +411,11 @@ ROM_END
DRIVER_INIT_MEMBER(pcktgal_state,deco222)
{
int A;
- address_space *space = machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
UINT8 *rom = machine().root_device().memregion("audiocpu")->base();
- space->set_decrypted_region(0x8000, 0xffff, decrypted);
+ space.set_decrypted_region(0x8000, 0xffff, decrypted);
/* bits 5 and 6 of the opcodes are swapped */
for (A = 0x8000;A < 0x18000;A++)
diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c
index 72e757985df..2588e5c61d7 100644
--- a/src/mame/drivers/pengo.c
+++ b/src/mame/drivers/pengo.c
@@ -692,12 +692,12 @@ DRIVER_INIT_MEMBER(pengo_state,penta)
{ 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, /* ...1...1...0.... */
{ 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 } /* ...1...1...1.... */
};
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
int A;
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
for (A = 0x0000;A < 0x8000;A++)
{
diff --git a/src/mame/drivers/photoply.c b/src/mame/drivers/photoply.c
index adf61d86cbb..2ee5ca93f10 100644
--- a/src/mame/drivers/photoply.c
+++ b/src/mame/drivers/photoply.c
@@ -378,7 +378,7 @@ ROM_END
DRIVER_INIT_MEMBER(photoply_state,photoply)
{
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
GAME( 199?, photoply, 0, photoply, photoply, photoply_state, photoply, ROT0, "Funworld", "Photo Play 2000 (v2.01)", GAME_NOT_WORKING|GAME_NO_SOUND )
diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c
index 4d44b76d41d..b486649b6b8 100644
--- a/src/mame/drivers/pipedrm.c
+++ b/src/mame/drivers/pipedrm.c
@@ -175,7 +175,7 @@ Added Multiple Coin Feature:
static WRITE8_HANDLER( pipedrm_bankswitch_w )
{
- fromance_state *state = space->machine().driver_data<fromance_state>();
+ fromance_state *state = space.machine().driver_data<fromance_state>();
/*
Bit layout:
@@ -191,14 +191,14 @@ static WRITE8_HANDLER( pipedrm_bankswitch_w )
state->membank("bank1")->set_entry(data & 0x7);
/* map to the fromance gfx register */
- state->fromance_gfxreg_w(*space, offset, ((data >> 6) & 0x01) | /* flipscreen */
+ state->fromance_gfxreg_w(space, offset, ((data >> 6) & 0x01) | /* flipscreen */
((~data >> 2) & 0x02)); /* videoram select */
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- space->machine().root_device().membank("bank2")->set_entry(data & 0x01);
+ space.machine().root_device().membank("bank2")->set_entry(data & 0x01);
}
@@ -225,19 +225,19 @@ static TIMER_CALLBACK( delayed_command_w )
static WRITE8_HANDLER( sound_command_w )
{
- space->machine().scheduler().synchronize(FUNC(delayed_command_w), data | 0x100);
+ space.machine().scheduler().synchronize(FUNC(delayed_command_w), data | 0x100);
}
static WRITE8_HANDLER( sound_command_nonmi_w )
{
- space->machine().scheduler().synchronize(FUNC(delayed_command_w), data);
+ space.machine().scheduler().synchronize(FUNC(delayed_command_w), data);
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- fromance_state *state = space->machine().driver_data<fromance_state>();
+ fromance_state *state = space.machine().driver_data<fromance_state>();
state->m_pending_command = 0;
state->m_subcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -245,14 +245,14 @@ static WRITE8_HANDLER( pending_command_clear_w )
static READ8_HANDLER( pending_command_r )
{
- fromance_state *state = space->machine().driver_data<fromance_state>();
+ fromance_state *state = space.machine().driver_data<fromance_state>();
return state->m_pending_command;
}
static READ8_HANDLER( sound_command_r )
{
- fromance_state *state = space->machine().driver_data<fromance_state>();
+ fromance_state *state = space.machine().driver_data<fromance_state>();
return state->m_sound_command;
}
diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c
index ba85601f69d..daaf9583f71 100644
--- a/src/mame/drivers/playch10.c
+++ b/src/mame/drivers/playch10.c
@@ -332,7 +332,7 @@ WRITE8_MEMBER(playch10_state::sprite_dma_w)
{
int source = ( data & 7 );
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
- ppu->spriteram_dma(&space, source);
+ ppu->spriteram_dma(space, source);
}
/* Only used in single monitor bios */
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index c25246bd3d4..66e3c4edfff 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -738,8 +738,8 @@ DRIVER_INIT_MEMBER(polygonet_state,polygonet)
memset(m_dsp56k_bank04_ram, 0, sizeof(m_dsp56k_bank04_ram));
/* The dsp56k occasionally executes out of mapped memory */
- address_space *space = machine().device<dsp56k_device>("dsp")->space(AS_PROGRAM);
- m_dsp56k_update_handler = space->set_direct_update_handler(direct_update_delegate(FUNC(polygonet_state::plygonet_dsp56k_direct_handler), this));
+ address_space &space = *machine().device<dsp56k_device>("dsp")->space(AS_PROGRAM);
+ m_dsp56k_update_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(polygonet_state::plygonet_dsp56k_direct_handler), this));
/* save states */
save_item(NAME(m_dsp56k_bank00_ram));
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 0455c2cae73..5512ddf64bd 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -385,7 +385,7 @@ DRIVER_INIT_MEMBER(pntnpuzl_state,pip)
// rom[0x2696/2] = 0x4e71;
// rom[0x26a0/2] = 0x4e71;
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3c0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3a0000, *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3c0000);
}
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index 18de7399d02..2f444a26791 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -463,12 +463,12 @@ static TIMER_DEVICE_CALLBACK( polepos_scanline )
MACHINE_RESET_MEMBER(polepos_state,polepos)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
for (i = 0; i < 8; i++)
- polepos_latch_w(*space, i, 0);
+ polepos_latch_w(space, i, 0);
/* set the interrupt vectors (this shouldn't be needed) */
machine().device("sub")->execute().set_input_line_vector(0, Z8000_NVI);
diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c
index b6215296072..01c7ce0b49e 100644
--- a/src/mame/drivers/powerbal.c
+++ b/src/mame/drivers/powerbal.c
@@ -47,7 +47,7 @@ static WRITE16_DEVICE_HANDLER( magicstk_coin_eeprom_w )
static WRITE16_HANDLER( magicstk_bgvideoram_w )
{
- playmark_state *state = space->machine().driver_data<playmark_state>();
+ playmark_state *state = space.machine().driver_data<playmark_state>();
COMBINE_DATA(&state->m_videoram1[offset]);
state->m_bg_tilemap->mark_tile_dirty(offset);
@@ -55,7 +55,7 @@ static WRITE16_HANDLER( magicstk_bgvideoram_w )
static WRITE16_HANDLER( tile_banking_w )
{
- playmark_state *state = space->machine().driver_data<playmark_state>();
+ playmark_state *state = space.machine().driver_data<playmark_state>();
if (((data >> 12) & 0x0f) != state->m_tilebank)
{
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index 47cc078f59b..98bfbcecf33 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -502,11 +502,11 @@ ROM_END
DRIVER_INIT_MEMBER(progolf_state,progolf)
{
int A;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
- space->set_decrypted_region(0x0000,0xffff, decrypted);
+ space.set_decrypted_region(0x0000,0xffff, decrypted);
/* Swap bits 5 & 6 for opcodes */
for (A = 0xb000 ; A < 0x10000 ; A++)
@@ -516,11 +516,11 @@ DRIVER_INIT_MEMBER(progolf_state,progolf)
DRIVER_INIT_MEMBER(progolf_state,progolfa)
{
int A;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
- space->set_decrypted_region(0x0000,0xffff, decrypted);
+ space.set_decrypted_region(0x0000,0xffff, decrypted);
/* data is likely to not be encrypted, just the opcodes are. */
for (A = 0x0000 ; A < 0x10000 ; A++)
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 55e2f2a765c..d8500ed2436 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -479,8 +479,8 @@ static INTERRUPT_GEN( pturn_main_intgen )
void pturn_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- soundlatch_clear_byte_w(*space,0,0);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ soundlatch_clear_byte_w(space,0,0);
}
static MACHINE_CONFIG_START( pturn, pturn_state )
diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c
index 48f5e8e5a97..8c778de06d7 100644
--- a/src/mame/drivers/queen.c
+++ b/src/mame/drivers/queen.c
@@ -656,7 +656,7 @@ void queen_state::machine_start()
kbdc8042_init(machine(), &at8042);
pc_vga_init(machine(), ::vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
void queen_state::machine_reset()
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index ea52a2cfb44..42ef66c9fab 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -200,11 +200,11 @@ void quizpun2_state::machine_reset()
prot.addr = 0;
}
-static void log_protection( address_space *space, const char *warning )
+static void log_protection( address_space &space, const char *warning )
{
- quizpun2_state *state = space->machine().driver_data<quizpun2_state>();
+ quizpun2_state *state = space.machine().driver_data<quizpun2_state>();
struct prot_t &prot = state->m_prot;
- logerror("%04x: protection - %s (state %x, wait %x, param %02x, cmd %02x, addr %02x)\n", space->device().safe_pc(), warning,
+ logerror("%04x: protection - %s (state %x, wait %x, param %02x, cmd %02x, addr %02x)\n", space.device().safe_pc(), warning,
prot.state,
prot.wait_param,
prot.param,
@@ -242,7 +242,7 @@ READ8_MEMBER(quizpun2_state::quizpun2_protection_r)
break;
default:
- log_protection(&space, "unknown address");
+ log_protection(space, "unknown address");
ret = 0x2e59 >> ((prot.addr & 1) ? 0 : 8); // return the address of: XOR A, RET
}
break;
@@ -255,12 +255,12 @@ READ8_MEMBER(quizpun2_state::quizpun2_protection_r)
}
default:
- log_protection(&space, "unknown read");
+ log_protection(space, "unknown read");
ret = 0x00;
}
#if VERBOSE_PROTECTION_LOG
- log_protection(&space, "info READ");
+ log_protection(space, "info READ");
#endif
prot.addr++;
@@ -305,7 +305,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
prot.addr = 0;
}
else
- log_protection(&space, "unknown command");
+ log_protection(space, "unknown command");
}
else if (prot.cmd >= 0x00 && prot.cmd <= 0x0f )
{
@@ -320,7 +320,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
else
{
prot.state = STATE_IDLE;
- log_protection(&space, "unknown command");
+ log_protection(space, "unknown command");
}
}
else
@@ -332,7 +332,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w)
}
#if VERBOSE_PROTECTION_LOG
- log_protection(&space, "info WRITE");
+ log_protection(space, "info WRITE");
#endif
}
diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c
index 8dfb67ed251..e90a9d67178 100644
--- a/src/mame/drivers/r2dx_v33.c
+++ b/src/mame/drivers/r2dx_v33.c
@@ -231,7 +231,7 @@ static SCREEN_UPDATE_IND16( rdx_v33 )
{
static UINT32 src_addr = 0x100000;
static int frame;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
//if(screen.machine().input().code_pressed_once(KEYCODE_A))
// src_addr+=0x800;
@@ -247,14 +247,14 @@ static SCREEN_UPDATE_IND16( rdx_v33 )
if(frame == 5)
{
int i,data;
- static UINT8 *rom = space->machine().root_device().memregion("mainprg")->base();
+ static UINT8 *rom = space.machine().root_device().memregion("mainprg")->base();
for(i=0;i<0x800;i+=2)
{
data = rom[src_addr+i+0];
- space->write_byte(i+0xd000+0, data);
+ space.write_byte(i+0xd000+0, data);
data = rom[src_addr+i+1];
- space->write_byte(i+0xd000+1, data);
+ space.write_byte(i+0xd000+1, data);
}
popmessage("%08x 1",src_addr);
@@ -440,9 +440,9 @@ READ16_MEMBER(r2dx_v33_state::nzerotea_sound_comms_r)
{
switch(offset+0x780)
{
- case (0x788/2): return seibu_main_word_r(&space,2,0xffff);
- case (0x78c/2): return seibu_main_word_r(&space,3,0xffff);
- case (0x794/2): return seibu_main_word_r(&space,5,0xffff);
+ case (0x788/2): return seibu_main_word_r(space,2,0xffff);
+ case (0x78c/2): return seibu_main_word_r(space,3,0xffff);
+ case (0x794/2): return seibu_main_word_r(space,5,0xffff);
}
return 0xffff;
@@ -453,11 +453,11 @@ WRITE16_MEMBER(r2dx_v33_state::nzerotea_sound_comms_w)
{
switch(offset+0x780)
{
- case (0x780/2): { seibu_main_word_w(&space,0,data,0x00ff); break; }
- case (0x784/2): { seibu_main_word_w(&space,1,data,0x00ff); break; }
- //case (0x790/2): { seibu_main_word_w(&space,4,data,0x00ff); break; }
- case (0x794/2): { seibu_main_word_w(&space,4,data,0x00ff); break; }
- case (0x798/2): { seibu_main_word_w(&space,6,data,0x00ff); break; }
+ case (0x780/2): { seibu_main_word_w(space,0,data,0x00ff); break; }
+ case (0x784/2): { seibu_main_word_w(space,1,data,0x00ff); break; }
+ //case (0x790/2): { seibu_main_word_w(space,4,data,0x00ff); break; }
+ case (0x794/2): { seibu_main_word_w(space,4,data,0x00ff); break; }
+ case (0x798/2): { seibu_main_word_w(space,6,data,0x00ff); break; }
}
}
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index ef272c1896d..037a9ec88ee 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -1159,12 +1159,12 @@ MACHINE_RESET_MEMBER(raiden2_state,xsedae)
READ16_MEMBER(raiden2_state::raiden2_sound_comms_r)
{
- return seibu_main_word_r(&space,(offset >> 1) & 7,0xffff);
+ return seibu_main_word_r(space,(offset >> 1) & 7,0xffff);
}
WRITE16_MEMBER(raiden2_state::raiden2_sound_comms_w)
{
- seibu_main_word_w(&space,(offset >> 1) & 7,data,0x00ff);
+ seibu_main_word_w(space,(offset >> 1) & 7,data,0x00ff);
}
WRITE16_MEMBER(raiden2_state::raiden2_bank_w)
diff --git a/src/mame/drivers/rallyx.c b/src/mame/drivers/rallyx.c
index 2633fd454e8..0c9ea1308ce 100644
--- a/src/mame/drivers/rallyx.c
+++ b/src/mame/drivers/rallyx.c
@@ -273,7 +273,7 @@ WRITE8_MEMBER(rallyx_state::locomotn_latch_w)
switch (offset)
{
case 0x00: /* SOUNDON */
- timeplt_sh_irqtrigger_w(&space,0,bit);
+ timeplt_sh_irqtrigger_w(space,0,bit);
break;
case 0x01: /* INTST */
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index edbf1aac9e6..7574cb45799 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -27,7 +27,7 @@ TODO:
static WRITE8_HANDLER( irqack_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
state->m_maincpu->set_input_line(0, CLEAR_LINE);
}
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 398cdd0558d..0b7467aa3f7 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -316,11 +316,11 @@ DRIVER_INIT_MEMBER(renegade_state,kuniokun)
DRIVER_INIT_MEMBER(renegade_state,kuniokunb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Remove the MCU handlers */
- space->unmap_readwrite(0x3804, 0x3804);
- space->unmap_read(0x3805, 0x3805);
+ space.unmap_readwrite(0x3804, 0x3804);
+ space.unmap_read(0x3805, 0x3805);
}
diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c
index 941a405ca91..d1ebca0ebee 100644
--- a/src/mame/drivers/safarir.c
+++ b/src/mame/drivers/safarir.c
@@ -154,8 +154,8 @@ void safarir_state::palette_init()
TILE_GET_INFO_MEMBER(safarir_state::get_bg_tile_info)
{
int color;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 code = ram_r(*space,tile_index | 0x400);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 code = ram_r(space,tile_index | 0x400);
if (code & 0x80)
color = 6; /* yellow */
@@ -176,8 +176,8 @@ TILE_GET_INFO_MEMBER(safarir_state::get_bg_tile_info)
TILE_GET_INFO_MEMBER(safarir_state::get_fg_tile_info)
{
int color, flags;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 code = ram_r(*space,tile_index);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 code = ram_r(space,tile_index);
if (code & 0x80)
color = 7; /* white */
diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c
index 65295718489..ceba5514e6a 100644
--- a/src/mame/drivers/saturn.c
+++ b/src/mame/drivers/saturn.c
@@ -122,8 +122,8 @@ static int DectoBCD(int num)
}
static void scu_do_transfer(running_machine &machine,UINT8 event);
-static void scu_dma_direct(address_space *space, UINT8 dma_ch); /*DMA level 0 direct transfer function*/
-static void scu_dma_indirect(address_space *space, UINT8 dma_ch); /*DMA level 0 indirect transfer function*/
+static void scu_dma_direct(address_space &space, UINT8 dma_ch); /*DMA level 0 direct transfer function*/
+static void scu_dma_indirect(address_space &space, UINT8 dma_ch); /*DMA level 0 indirect transfer function*/
/**************************************************************************************/
@@ -239,7 +239,7 @@ DMA TODO:
static void scu_do_transfer(running_machine &machine,UINT8 event)
{
saturn_state *state = machine.driver_data<saturn_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
for(i=0;i<3;i++)
@@ -282,7 +282,7 @@ static void scu_test_pending_irq(running_machine &machine)
static READ32_HANDLER( saturn_scu_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT32 res;
/*TODO: write only registers must return 0 or open bus */
@@ -290,11 +290,11 @@ static READ32_HANDLER( saturn_scu_r )
{
case 0x5c/4:
// Super Major League and Shin Megami Tensei - Akuma Zensho reads from there (undocumented), DMA status mirror?
- if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",space->device().safe_pc());
+ if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",space.device().safe_pc());
res = state->m_scu_regs[0x7c/4];
break;
case 0x7c/4:
- if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",space->device().safe_pc());
+ if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",space.device().safe_pc());
res = state->m_scu_regs[offset];
break;
case 0x80/4:
@@ -305,19 +305,19 @@ static READ32_HANDLER( saturn_scu_r )
res = dsp_ram_addr_r();
break;
case 0xa0/4:
- if(LOG_SCU) logerror("(PC=%08x) IRQ mask reg read %08x MASK=%08x\n",space->device().safe_pc(),mem_mask,state->m_scu_regs[0xa0/4]);
+ if(LOG_SCU) logerror("(PC=%08x) IRQ mask reg read %08x MASK=%08x\n",space.device().safe_pc(),mem_mask,state->m_scu_regs[0xa0/4]);
res = state->m_scu.ism;
break;
case 0xa4/4:
- if(LOG_SCU) logerror("(PC=%08x) IRQ status reg read %08x MASK=%08x\n",space->device().safe_pc(),mem_mask,state->m_scu_regs[0xa0/4]);
+ if(LOG_SCU) logerror("(PC=%08x) IRQ status reg read %08x MASK=%08x\n",space.device().safe_pc(),mem_mask,state->m_scu_regs[0xa0/4]);
res = state->m_scu.ist;
break;
case 0xc8/4:
- logerror("(PC=%08x) SCU version reg read\n",space->device().safe_pc());
+ logerror("(PC=%08x) SCU version reg read\n",space.device().safe_pc());
res = 0x00000004;/*SCU Version 4, OK? */
break;
default:
- if(LOG_SCU) logerror("(PC=%08x) SCU reg read at %d = %08x\n",space->device().safe_pc(),offset,state->m_scu_regs[offset]);
+ if(LOG_SCU) logerror("(PC=%08x) SCU reg read at %d = %08x\n",space.device().safe_pc(),offset,state->m_scu_regs[offset]);
res = state->m_scu_regs[offset];
break;
}
@@ -329,7 +329,7 @@ static READ32_HANDLER( saturn_scu_r )
static WRITE32_HANDLER( saturn_scu_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
COMBINE_DATA(&state->m_scu_regs[offset]);
@@ -390,10 +390,10 @@ static WRITE32_HANDLER( saturn_scu_w )
case 0x98/4: /*if(LOG_SCU) logerror("timer 1 mode data = %08x\n",state->m_scu_regs[38]);*/ break;
case 0xa0/4: /* IRQ mask */
state->m_scu.ism = state->m_scu_regs[0xa0/4];
- scu_test_pending_irq(space->machine());
+ scu_test_pending_irq(space.machine());
break;
case 0xa4/4: /* IRQ control */
- if(LOG_SCU) logerror("PC=%08x IRQ status reg set:%08x %08x\n",space->device().safe_pc(),state->m_scu_regs[41],mem_mask);
+ if(LOG_SCU) logerror("PC=%08x IRQ status reg set:%08x %08x\n",space.device().safe_pc(),state->m_scu_regs[41],mem_mask);
state->m_scu.ist &= state->m_scu_regs[offset];
break;
case 0xa8/4: if(LOG_SCU) logerror("A-Bus IRQ ACK %08x\n",state->m_scu_regs[42]); break;
@@ -441,28 +441,28 @@ static TIMER_CALLBACK( dma_lv2_ended )
DnMV_0(2);
}
-static void scu_single_transfer(address_space *space, UINT32 src, UINT32 dst,UINT8 *src_shift)
+static void scu_single_transfer(address_space &space, UINT32 src, UINT32 dst,UINT8 *src_shift)
{
UINT32 src_data;
if(src & 1)
{
/* Road Blaster does a work ram h to color ram with offsetted source address, do some data rotation */
- src_data = ((space->read_dword(src & 0x07fffffc) & 0x00ffffff)<<8);
- src_data |= ((space->read_dword((src & 0x07fffffc)+4) & 0xff000000) >> 24);
+ src_data = ((space.read_dword(src & 0x07fffffc) & 0x00ffffff)<<8);
+ src_data |= ((space.read_dword((src & 0x07fffffc)+4) & 0xff000000) >> 24);
src_data >>= (*src_shift)*16;
}
else
- src_data = space->read_dword(src & 0x07fffffc) >> (*src_shift)*16;
+ src_data = space.read_dword(src & 0x07fffffc) >> (*src_shift)*16;
- space->write_word(dst,src_data);
+ space.write_word(dst,src_data);
*src_shift ^= 1;
}
-static void scu_dma_direct(address_space *space, UINT8 dma_ch)
+static void scu_dma_direct(address_space &space, UINT8 dma_ch)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT32 tmp_src,tmp_dst,tmp_size;
UINT8 cd_transfer_flag;
@@ -501,9 +501,9 @@ static void scu_dma_direct(address_space *space, UINT8 dma_ch)
for (i = 0; i < state->m_scu.size[dma_ch];i+=state->m_scu.dst_add[dma_ch])
{
- space->write_dword(state->m_scu.dst[dma_ch],space->read_dword(state->m_scu.src[dma_ch]));
+ space.write_dword(state->m_scu.dst[dma_ch],space.read_dword(state->m_scu.src[dma_ch]));
if(state->m_scu.dst_add[dma_ch] == 8)
- space->write_dword(state->m_scu.dst[dma_ch]+4,space->read_dword(state->m_scu.src[dma_ch]));
+ space.write_dword(state->m_scu.dst[dma_ch]+4,space.read_dword(state->m_scu.src[dma_ch]));
state->m_scu.src[dma_ch]+=state->m_scu.src_add[dma_ch];
state->m_scu.dst[dma_ch]+=state->m_scu.dst_add[dma_ch];
@@ -536,16 +536,16 @@ static void scu_dma_direct(address_space *space, UINT8 dma_ch)
/*TODO: this is completely wrong HW-wise ... */
switch(dma_ch)
{
- case 0: space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended)); break;
- case 1: space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended)); break;
- case 2: space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended)); break;
+ case 0: space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended)); break;
+ case 1: space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended)); break;
+ case 2: space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended)); break;
}
}
}
-static void scu_dma_indirect(address_space *space,UINT8 dma_ch)
+static void scu_dma_indirect(address_space &space,UINT8 dma_ch)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
/*Helper to get out of the cycle*/
UINT8 job_done = 0;
@@ -561,9 +561,9 @@ static void scu_dma_indirect(address_space *space,UINT8 dma_ch)
do{
tmp_src = state->m_scu.index[dma_ch];
- indirect_size = space->read_dword(state->m_scu.index[dma_ch]);
- indirect_src = space->read_dword(state->m_scu.index[dma_ch]+8);
- indirect_dst = space->read_dword(state->m_scu.index[dma_ch]+4);
+ indirect_size = space.read_dword(state->m_scu.index[dma_ch]);
+ indirect_src = space.read_dword(state->m_scu.index[dma_ch]+8);
+ indirect_dst = space.read_dword(state->m_scu.index[dma_ch]+4);
/*Indirect Mode end factor*/
if(indirect_src & 0x80000000)
@@ -599,8 +599,8 @@ static void scu_dma_indirect(address_space *space,UINT8 dma_ch)
}
}
- //if(DRUP(0)) space->write_dword(tmp_src+8,state->m_scu.src[0]|job_done ? 0x80000000 : 0);
- //if(DWUP(0)) space->write_dword(tmp_src+4,state->m_scu.dst[0]);
+ //if(DRUP(0)) space.write_dword(tmp_src+8,state->m_scu.src[0]|job_done ? 0x80000000 : 0);
+ //if(DWUP(0)) space.write_dword(tmp_src+4,state->m_scu.dst[0]);
state->m_scu.index[dma_ch] = tmp_src+0xc;
@@ -610,9 +610,9 @@ static void scu_dma_indirect(address_space *space,UINT8 dma_ch)
/*TODO: this is completely wrong HW-wise ... */
switch(dma_ch)
{
- case 0: space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended)); break;
- case 1: space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended)); break;
- case 2: space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended)); break;
+ case 0: space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended)); break;
+ case 1: space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended)); break;
+ case 2: space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended)); break;
}
}
}
@@ -622,18 +622,18 @@ static void scu_dma_indirect(address_space *space,UINT8 dma_ch)
static WRITE16_HANDLER( saturn_soundram_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
- //space->machine().scheduler().synchronize(); // force resync
+ //space.machine().scheduler().synchronize(); // force resync
COMBINE_DATA(&state->m_sound_ram[offset]);
}
static READ16_HANDLER( saturn_soundram_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
- //space->machine().scheduler().synchronize(); // force resync
+ //space.machine().scheduler().synchronize(); // force resync
return state->m_sound_ram[offset];
}
@@ -641,26 +641,26 @@ static READ16_HANDLER( saturn_soundram_r )
/* communication,SLAVE CPU acquires data from the MASTER CPU and triggers an irq. */
static WRITE32_HANDLER( minit_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
- //logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->device().tag(), space->device().safe_pc(),data);
- space->machine().scheduler().boost_interleave(state->m_minit_boost_timeslice, attotime::from_usec(state->m_minit_boost));
- space->machine().scheduler().trigger(1000);
+ //logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space.device().tag(), space.device().safe_pc(),data);
+ space.machine().scheduler().boost_interleave(state->m_minit_boost_timeslice, attotime::from_usec(state->m_minit_boost));
+ space.machine().scheduler().trigger(1000);
sh2_set_frt_input(state->m_slave, PULSE_LINE);
}
static WRITE32_HANDLER( sinit_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
- //logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->device().tag(), space->device().safe_pc(),data);
- space->machine().scheduler().boost_interleave(state->m_sinit_boost_timeslice, attotime::from_usec(state->m_sinit_boost));
+ //logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space.device().tag(), space.device().safe_pc(),data);
+ space.machine().scheduler().boost_interleave(state->m_sinit_boost_timeslice, attotime::from_usec(state->m_sinit_boost));
sh2_set_frt_input(state->m_maincpu, PULSE_LINE);
}
static READ8_HANDLER(saturn_backupram_r)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
if(!(offset & 1))
return 0; // yes, it makes sure the "holes" are there.
@@ -670,7 +670,7 @@ static READ8_HANDLER(saturn_backupram_r)
static WRITE8_HANDLER(saturn_backupram_w)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
if(!(offset & 1))
return;
@@ -743,7 +743,7 @@ static NVRAM_HANDLER(saturn)
static READ8_HANDLER( saturn_cart_type_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
const int cart_ram_header[7] = { 0xff, 0x21, 0x22, 0x23, 0x24, 0x5a, 0x5c };
return cart_ram_header[state->m_cart_type];
@@ -1981,35 +1981,35 @@ static WRITE32_HANDLER( saturn_null_ram_w )
static READ32_HANDLER( saturn_cart_dram0_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
return state->m_cart_dram[offset];
}
static WRITE32_HANDLER( saturn_cart_dram0_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
COMBINE_DATA(&state->m_cart_dram[offset]);
}
static READ32_HANDLER( saturn_cart_dram1_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
return state->m_cart_dram[offset+0x200000/4];
}
static WRITE32_HANDLER( saturn_cart_dram1_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
COMBINE_DATA(&state->m_cart_dram[offset+0x200000/4]);
}
static READ32_HANDLER( saturn_cs1_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT32 res;
res = 0;
@@ -2023,7 +2023,7 @@ static READ32_HANDLER( saturn_cs1_r )
static WRITE32_HANDLER( saturn_cs1_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
if(ACCESSING_BITS_16_23)
state->m_cart_backupram[offset*2+0] = (data & 0x00ff0000) >> 16;
diff --git a/src/mame/drivers/savquest.c b/src/mame/drivers/savquest.c
index 4627cf1ab6d..d98db1fe5a2 100644
--- a/src/mame/drivers/savquest.c
+++ b/src/mame/drivers/savquest.c
@@ -529,7 +529,7 @@ void savquest_state::machine_start()
kbdc8042_init(machine(), &at8042);
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
void savquest_state::machine_reset()
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index cf039de5ff2..5a8b953bffc 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -506,7 +506,7 @@ static void vblank_assert(device_t *device, int state);
static void update_vblank_irq(running_machine &machine);
static void galileo_reset(running_machine &machine);
static TIMER_CALLBACK( galileo_timer_callback );
-static void galileo_perform_dma(address_space *space, int which);
+static void galileo_perform_dma(address_space &space, int which);
static void voodoo_stall(device_t *device, int stall);
static void widget_reset(running_machine &machine);
static void update_widget_irq(running_machine &machine);
@@ -798,9 +798,9 @@ static void vblank_assert(device_t *device, int state)
*
*************************************/
-static UINT32 pci_bridge_r(address_space *space, UINT8 reg, UINT8 type)
+static UINT32 pci_bridge_r(address_space &space, UINT8 reg, UINT8 type)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
UINT32 result = state->m_galileo.pci_bridge_regs[reg];
switch (reg)
@@ -815,17 +815,17 @@ static UINT32 pci_bridge_r(address_space *space, UINT8 reg, UINT8 type)
}
if (LOG_PCI)
- logerror("%08X:PCI bridge read: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, result);
+ logerror("%08X:PCI bridge read: reg %d type %d = %08X\n", space.device().safe_pc(), reg, type, result);
return result;
}
-static void pci_bridge_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
+static void pci_bridge_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
state->m_galileo.pci_bridge_regs[reg] = data;
if (LOG_PCI)
- logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, data);
+ logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", space.device().safe_pc(), reg, type, data);
}
@@ -836,9 +836,9 @@ static void pci_bridge_w(address_space *space, UINT8 reg, UINT8 type, UINT32 dat
*
*************************************/
-static UINT32 pci_3dfx_r(address_space *space, UINT8 reg, UINT8 type)
+static UINT32 pci_3dfx_r(address_space &space, UINT8 reg, UINT8 type)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
UINT32 result = state->m_galileo.pci_3dfx_regs[reg];
switch (reg)
@@ -853,14 +853,14 @@ static UINT32 pci_3dfx_r(address_space *space, UINT8 reg, UINT8 type)
}
if (LOG_PCI)
- logerror("%08X:PCI 3dfx read: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, result);
+ logerror("%08X:PCI 3dfx read: reg %d type %d = %08X\n", space.device().safe_pc(), reg, type, result);
return result;
}
-static void pci_3dfx_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
+static void pci_3dfx_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
state->m_galileo.pci_3dfx_regs[reg] = data;
switch (reg)
@@ -876,7 +876,7 @@ static void pci_3dfx_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
break;
}
if (LOG_PCI)
- logerror("%08X:PCI 3dfx write: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, data);
+ logerror("%08X:PCI 3dfx write: reg %d type %d = %08X\n", space.device().safe_pc(), reg, type, data);
}
@@ -887,9 +887,9 @@ static void pci_3dfx_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
*
*************************************/
-static UINT32 pci_ide_r(address_space *space, UINT8 reg, UINT8 type)
+static UINT32 pci_ide_r(address_space &space, UINT8 reg, UINT8 type)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
UINT32 result = state->m_galileo.pci_ide_regs[reg];
switch (reg)
@@ -904,17 +904,17 @@ static UINT32 pci_ide_r(address_space *space, UINT8 reg, UINT8 type)
}
if (LOG_PCI)
- logerror("%08X:PCI IDE read: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, result);
+ logerror("%08X:PCI IDE read: reg %d type %d = %08X\n", space.device().safe_pc(), reg, type, result);
return result;
}
-static void pci_ide_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
+static void pci_ide_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
state->m_galileo.pci_ide_regs[reg] = data;
if (LOG_PCI)
- logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, data);
+ logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", space.device().safe_pc(), reg, type, data);
}
@@ -973,9 +973,9 @@ static TIMER_CALLBACK( galileo_timer_callback )
*
*************************************/
-static int galileo_dma_fetch_next(address_space *space, int which)
+static int galileo_dma_fetch_next(address_space &space, int which)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
galileo_data &galileo = state->m_galileo;
offs_t address = 0;
UINT32 data;
@@ -990,34 +990,34 @@ static int galileo_dma_fetch_next(address_space *space, int which)
if (galileo.reg[GREG_DMA0_CONTROL + which] & 0x400)
{
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
- update_galileo_irqs(space->machine());
+ update_galileo_irqs(space.machine());
}
galileo.reg[GREG_DMA0_CONTROL + which] &= ~0x5000;
return 0;
}
/* fetch the byte count */
- data = space->read_dword(address); address += 4;
+ data = space.read_dword(address); address += 4;
galileo.reg[GREG_DMA0_COUNT + which] = data;
/* fetch the source address */
- data = space->read_dword(address); address += 4;
+ data = space.read_dword(address); address += 4;
galileo.reg[GREG_DMA0_SOURCE + which] = data;
/* fetch the dest address */
- data = space->read_dword(address); address += 4;
+ data = space.read_dword(address); address += 4;
galileo.reg[GREG_DMA0_DEST + which] = data;
/* fetch the next record address */
- data = space->read_dword(address); address += 4;
+ data = space.read_dword(address); address += 4;
galileo.reg[GREG_DMA0_NEXT + which] = data;
return 1;
}
-static void galileo_perform_dma(address_space *space, int which)
+static void galileo_perform_dma(address_space &space, int which)
{
- seattle_state *state = space->machine().driver_data<seattle_state>();
+ seattle_state *state = space.machine().driver_data<seattle_state>();
galileo_data &galileo = state->m_galileo;
do
{
@@ -1068,7 +1068,7 @@ static void galileo_perform_dma(address_space *space, int which)
}
/* write the data and advance */
- voodoo_w(state->m_voodoo, *space, (dstaddr & 0xffffff) / 4, space->read_dword(srcaddr), 0xffffffff);
+ voodoo_w(state->m_voodoo, space, (dstaddr & 0xffffff) / 4, space.read_dword(srcaddr), 0xffffffff);
srcaddr += srcinc;
dstaddr += dstinc;
bytesleft -= 4;
@@ -1080,7 +1080,7 @@ static void galileo_perform_dma(address_space *space, int which)
{
while (bytesleft > 0)
{
- space->write_byte(dstaddr, space->read_byte(srcaddr));
+ space.write_byte(dstaddr, space.read_byte(srcaddr));
srcaddr += srcinc;
dstaddr += dstinc;
bytesleft--;
@@ -1101,7 +1101,7 @@ static void galileo_perform_dma(address_space *space, int which)
if (!(galileo.reg[GREG_DMA0_CONTROL + which] & 0x400))
{
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
- update_galileo_irqs(space->machine());
+ update_galileo_irqs(space.machine());
}
} while (galileo_dma_fetch_next(space, which));
@@ -1169,15 +1169,15 @@ READ32_MEMBER(seattle_state::galileo_r)
/* unit 0 is the PCI bridge */
if (unit == 0 && func == 0)
- result = pci_bridge_r(&space, reg, type);
+ result = pci_bridge_r(space, reg, type);
/* unit 8 is the 3dfx card */
else if (unit == 8 && func == 0)
- result = pci_3dfx_r(&space, reg, type);
+ result = pci_3dfx_r(space, reg, type);
/* unit 9 is the IDE controller */
else if (unit == 9 && func == 0)
- result = pci_ide_r(&space, reg, type);
+ result = pci_ide_r(space, reg, type);
/* anything else, just log */
else
@@ -1230,12 +1230,12 @@ WRITE32_MEMBER(seattle_state::galileo_w)
/* fetch next record */
if (data & 0x2000)
- galileo_dma_fetch_next(&space, which);
+ galileo_dma_fetch_next(space, which);
galileo.reg[offset] &= ~0x2000;
/* if enabling, start the DMA */
if (!(oldata & 0x1000) && (data & 0x1000))
- galileo_perform_dma(&space, which);
+ galileo_perform_dma(space, which);
break;
}
@@ -1308,15 +1308,15 @@ WRITE32_MEMBER(seattle_state::galileo_w)
/* unit 0 is the PCI bridge */
if (unit == 0 && func == 0)
- pci_bridge_w(&space, reg, type, data);
+ pci_bridge_w(space, reg, type, data);
/* unit 8 is the 3dfx card */
else if (unit == 8 && func == 0)
- pci_3dfx_w(&space, reg, type, data);
+ pci_3dfx_w(space, reg, type, data);
/* unit 9 is the IDE controller */
else if (unit == 9 && func == 0)
- pci_ide_w(&space, reg, type, data);
+ pci_ide_w(space, reg, type, data);
/* anything else, just log */
else
@@ -1403,7 +1403,7 @@ static void voodoo_stall(device_t *device, int stall)
for (which = 0; which < 4; which++)
if (state->m_galileo.dma_stalled_on_voodoo[which])
{
- address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
if (LOG_DMA) logerror("Resuming DMA%d on voodoo\n", which);
/* mark this DMA as no longer stalled */
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 3819ff7630e..cefaa669259 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -201,7 +201,7 @@ static WRITE16_DEVICE_HANDLER( segac2_upd7759_w )
/* handle reads from the paletteram */
static READ16_HANDLER( palette_r )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
offset &= 0x1ff;
if (state->m_segac2_alt_palette_mode)
offset = ((offset << 1) & 0x100) | ((offset << 2) & 0x80) | ((~offset >> 2) & 0x40) | ((offset >> 1) & 0x20) | (offset & 0x1f);
@@ -212,7 +212,7 @@ static READ16_HANDLER( palette_r )
/* handle writes to the paletteram */
static WRITE16_HANDLER( palette_w )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
int r, g, b, newword;
int tmpr, tmpg, tmpb;
@@ -232,7 +232,7 @@ static WRITE16_HANDLER( palette_w )
b = ((newword >> 7) & 0x1e) | ((newword >> 14) & 0x01);
/* set the color */
- palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space.machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
// megadrive_vdp_palette_lookup[offset] = (b) | (g << 5) | (r << 10);
// megadrive_vdp_palette_lookup_sprite[offset] = (b) | (g << 5) | (r << 10);
@@ -240,13 +240,13 @@ static WRITE16_HANDLER( palette_w )
tmpr = r >> 1;
tmpg = g >> 1;
tmpb = b >> 1;
- palette_set_color_rgb(space->machine(), offset + 0x800, pal5bit(tmpr), pal5bit(tmpg), pal5bit(tmpb));
+ palette_set_color_rgb(space.machine(), offset + 0x800, pal5bit(tmpr), pal5bit(tmpg), pal5bit(tmpb));
// how is it calculated on c2?
tmpr = tmpr | 0x10;
tmpg = tmpg | 0x10;
tmpb = tmpb | 0x10;
- palette_set_color_rgb(space->machine(), offset + 0x1000, pal5bit(tmpr), pal5bit(tmpg), pal5bit(tmpb));
+ palette_set_color_rgb(space.machine(), offset + 0x1000, pal5bit(tmpr), pal5bit(tmpg), pal5bit(tmpb));
}
@@ -319,7 +319,7 @@ static void recompute_palette_tables( running_machine &machine )
static READ16_HANDLER( io_chip_r )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
static const char *const portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
offset &= 0x1f/2;
@@ -340,8 +340,8 @@ static READ16_HANDLER( io_chip_r )
/* otherwise, return an input port */
if (offset == 0x04/2 && state->m_sound_banks)
- return (space->machine().root_device().ioport(portnames[offset])->read() & 0xbf) | (upd7759_busy_r(space->machine().device("upd")) << 6);
- return space->machine().root_device().ioport(portnames[offset])->read();
+ return (space.machine().root_device().ioport(portnames[offset])->read() & 0xbf) | (upd7759_busy_r(space.machine().device("upd")) << 6);
+ return space.machine().root_device().ioport(portnames[offset])->read();
/* 'SEGA' protection */
case 0x10/2:
@@ -369,7 +369,7 @@ static READ16_HANDLER( io_chip_r )
static WRITE16_HANDLER( io_chip_w )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
UINT8 newbank;
// UINT8 old;
@@ -401,10 +401,10 @@ static WRITE16_HANDLER( io_chip_w )
D1 : To CN1 pin J. (Coin meter 2)
D0 : To CN1 pin 8. (Coin meter 1)
*/
-/* coin_lockout_w(space->machine(), 1, data & 0x08);
- coin_lockout_w(space->machine(), 0, data & 0x04); */
- coin_counter_w(space->machine(), 1, data & 0x02);
- coin_counter_w(space->machine(), 0, data & 0x01);
+/* coin_lockout_w(space.machine(), 1, data & 0x08);
+ coin_lockout_w(space.machine(), 0, data & 0x04); */
+ coin_counter_w(space.machine(), 1, data & 0x02);
+ coin_counter_w(space.machine(), 0, data & 0x01);
break;
/* banking */
@@ -422,13 +422,13 @@ static WRITE16_HANDLER( io_chip_w )
newbank = data & 3;
if (newbank != state->m_palbank)
{
- //space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() + 1);
+ //space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos() + 1);
state->m_palbank = newbank;
- recompute_palette_tables(space->machine());
+ recompute_palette_tables(space.machine());
}
if (state->m_sound_banks > 1)
{
- device_t *upd = space->machine().device("upd");
+ device_t *upd = space.machine().device("upd");
newbank = (data >> 2) & (state->m_sound_banks - 1);
upd7759_set_bank_base(upd, newbank * 0x20000);
}
@@ -438,7 +438,7 @@ static WRITE16_HANDLER( io_chip_w )
case 0x1c/2:
if (state->m_sound_banks > 1)
{
- device_t *upd = space->machine().device("upd");
+ device_t *upd = space.machine().device("upd");
upd7759_reset_w(upd, (data >> 1) & 1);
}
break;
@@ -458,14 +458,14 @@ static WRITE16_HANDLER( io_chip_w )
static WRITE16_HANDLER( control_w )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
/* skip if not LSB */
if (!ACCESSING_BITS_0_7)
return;
data &= 0x0f;
/* bit 0 controls display enable */
- //segac2_enable_display(space->machine(), ~data & 1);
+ //segac2_enable_display(space.machine(), ~data & 1);
state->m_segac2_enable_display = ~data & 1;
/* bit 1 resets the protection */
@@ -474,7 +474,7 @@ static WRITE16_HANDLER( control_w )
/* bit 2 controls palette shuffling; only ribbit and twinsqua use this feature */
state->m_segac2_alt_palette_mode = ((~data & 4) >> 2);
- recompute_palette_tables(space->machine());
+ recompute_palette_tables(space.machine());
}
@@ -494,8 +494,8 @@ static WRITE16_HANDLER( control_w )
/* protection chip reads */
static READ16_HANDLER( prot_r )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
- if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", space->device().safe_pcbase(), state->m_prot_func ? state->m_prot_read_buf : 0xff);
+ segac2_state *state = space.machine().driver_data<segac2_state>();
+ if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", space.device().safe_pcbase(), state->m_prot_func ? state->m_prot_read_buf : 0xff);
return state->m_prot_read_buf | 0xf0;
}
@@ -503,7 +503,7 @@ static READ16_HANDLER( prot_r )
/* protection chip writes */
static WRITE16_HANDLER( prot_w )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
int new_sp_palbase = (data >> 2) & 3;
int new_bg_palbase = data & 3;
int table_index;
@@ -521,16 +521,16 @@ static WRITE16_HANDLER( prot_w )
/* determine the value to return, should a read occur */
if (state->m_prot_func)
state->m_prot_read_buf = state->m_prot_func(table_index);
- if (LOG_PROTECTION) logerror("%06X:protection w=%02X, new result=%02X\n", space->device().safe_pcbase(), data & 0x0f, state->m_prot_read_buf);
+ if (LOG_PROTECTION) logerror("%06X:protection w=%02X, new result=%02X\n", space.device().safe_pcbase(), data & 0x0f, state->m_prot_read_buf);
/* if the palette changed, force an update */
if (new_sp_palbase != state->m_sp_palbase || new_bg_palbase != state->m_bg_palbase)
{
- //space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() + 1);
+ //space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos() + 1);
state->m_sp_palbase = new_sp_palbase;
state->m_bg_palbase = new_bg_palbase;
- recompute_palette_tables(space->machine());
- if (LOG_PALETTE) logerror("Set palbank: %d/%d (scan=%d)\n", state->m_bg_palbase, state->m_sp_palbase, space->machine().primary_screen->vpos());
+ recompute_palette_tables(space.machine());
+ if (LOG_PALETTE) logerror("Set palbank: %d/%d (scan=%d)\n", state->m_bg_palbase, state->m_sp_palbase, space.machine().primary_screen->vpos());
}
}
@@ -565,8 +565,8 @@ static WRITE16_HANDLER( counter_timer_w )
break;
case 0x10: /* coin counter */
-// coin_counter_w(space->machine(), 0,1);
-// coin_counter_w(space->machine(), 0,0);
+// coin_counter_w(space.machine(), 0,1);
+// coin_counter_w(space.machine(), 0,0);
break;
case 0x12: /* set coinage info -- followed by two 4-bit values */
@@ -596,13 +596,13 @@ static WRITE16_HANDLER( counter_timer_w )
static READ16_HANDLER( printer_r )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
return state->m_cam_data;
}
static WRITE16_HANDLER( print_club_camera_w )
{
- segac2_state *state = space->machine().driver_data<segac2_state>();
+ segac2_state *state = space.machine().driver_data<segac2_state>();
state->m_cam_data = data;
}
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index 9604b9ba212..ac833cbabfd 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -166,29 +166,29 @@ void segag80r_state::machine_start()
*
*************************************/
-static offs_t decrypt_offset(address_space *space, offs_t offset)
+static offs_t decrypt_offset(address_space &space, offs_t offset)
{
- segag80r_state *state = space->machine().driver_data<segag80r_state>();
+ segag80r_state *state = space.machine().driver_data<segag80r_state>();
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
- offs_t pc = space->device().safe_pcbase();
- if ((UINT16)pc == 0xffff || space->read_byte(pc) != 0x32)
+ offs_t pc = space.device().safe_pcbase();
+ if ((UINT16)pc == 0xffff || space.read_byte(pc) != 0x32)
return offset;
/* fetch the low byte of the address and munge it */
- return (offset & 0xff00) | (*state->m_decrypt)(pc, space->read_byte(pc + 1));
+ return (offset & 0xff00) | (*state->m_decrypt)(pc, space.read_byte(pc + 1));
}
WRITE8_MEMBER(segag80r_state::mainram_w)
{
- m_mainram[decrypt_offset(&space, offset)] = data;
+ m_mainram[decrypt_offset(space, offset)] = data;
}
-WRITE8_MEMBER(segag80r_state::vidram_w){ segag80r_videoram_w(space, decrypt_offset(&space, offset), data); }
-WRITE8_MEMBER(segag80r_state::monsterb_vidram_w){ monsterb_videoram_w(space, decrypt_offset(&space, offset), data); }
-WRITE8_MEMBER(segag80r_state::pignewt_vidram_w){ pignewt_videoram_w(space, decrypt_offset(&space, offset), data); }
-WRITE8_MEMBER(segag80r_state::sindbadm_vidram_w){ sindbadm_videoram_w(space, decrypt_offset(&space, offset), data); }
-WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("usbsnd"); sega_usb_ram_w(device, space, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
+WRITE8_MEMBER(segag80r_state::vidram_w){ segag80r_videoram_w(space, decrypt_offset(space, offset), data); }
+WRITE8_MEMBER(segag80r_state::monsterb_vidram_w){ monsterb_videoram_w(space, decrypt_offset(space, offset), data); }
+WRITE8_MEMBER(segag80r_state::pignewt_vidram_w){ pignewt_videoram_w(space, decrypt_offset(space, offset), data); }
+WRITE8_MEMBER(segag80r_state::sindbadm_vidram_w){ sindbadm_videoram_w(space, decrypt_offset(space, offset), data); }
+WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("usbsnd"); sega_usb_ram_w(device, space, decrypt_offset(*machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index 00e0c17d039..9e7f5570933 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -184,28 +184,28 @@ void segag80v_state::machine_start()
*
*************************************/
-static offs_t decrypt_offset(address_space *space, offs_t offset)
+static offs_t decrypt_offset(address_space &space, offs_t offset)
{
- segag80v_state *state = space->machine().driver_data<segag80v_state>();
+ segag80v_state *state = space.machine().driver_data<segag80v_state>();
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
- offs_t pc = space->device().safe_pcbase();
- if ((UINT16)pc == 0xffff || space->read_byte(pc) != 0x32)
+ offs_t pc = space.device().safe_pcbase();
+ if ((UINT16)pc == 0xffff || space.read_byte(pc) != 0x32)
return offset;
/* fetch the low byte of the address and munge it */
- return (offset & 0xff00) | (*state->m_decrypt)(pc, space->read_byte(pc + 1));
+ return (offset & 0xff00) | (*state->m_decrypt)(pc, space.read_byte(pc + 1));
}
WRITE8_MEMBER(segag80v_state::mainram_w)
{
- m_mainram[decrypt_offset(&space, offset)] = data;
+ m_mainram[decrypt_offset(space, offset)] = data;
}
-WRITE8_MEMBER(segag80v_state::usb_ram_w){ sega_usb_ram_w(m_usb, space, decrypt_offset(machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
+WRITE8_MEMBER(segag80v_state::usb_ram_w){ sega_usb_ram_w(m_usb, space, decrypt_offset(*machine().device("maincpu")->memory().space(AS_PROGRAM), offset), data); }
WRITE8_MEMBER(segag80v_state::vectorram_w)
{
- m_vectorram[decrypt_offset(&space, offset)] = data;
+ m_vectorram[decrypt_offset(space, offset)] = data;
}
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index a32e8ff34ec..427d9dc85d4 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -767,7 +767,7 @@ void segas16a_state::quartet_i8751_sim()
m_maincpu->set_input_line(4, HOLD_LINE);
// X scroll values
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
segaic16_textram_0_w(space, 0xff8/2, m_workram[0x0d14/2], 0xffff);
segaic16_textram_0_w(space, 0xffa/2, m_workram[0x0d18/2], 0xffff);
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index c0d124023b7..1c868d097d3 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1369,14 +1369,14 @@ void segas16b_state::altbeast_common_i8751_sim(offs_t soundoffs, offs_t inputoff
m_maincpu->set_input_line(4, HOLD_LINE);
// set tile banks
- address_space *space = m_maincpu->space(AS_PROGRAM);
- rom_5704_bank_w(*space, 1, m_workram[0x3094/2] & 0x00ff, 0x00ff);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ rom_5704_bank_w(space, 1, m_workram[0x3094/2] & 0x00ff, 0x00ff);
// process any new sound data
UINT16 temp = m_workram[soundoffs];
if ((temp & 0xff00) != 0x0000)
{
- m_mapper->write(*space, 0x03, temp >> 8);
+ m_mapper->write(space, 0x03, temp >> 8);
m_workram[soundoffs] = temp & 0x00ff;
}
@@ -1414,8 +1414,8 @@ void segas16b_state::ddux_i8751_sim()
UINT16 temp = m_workram[0x0bd0/2];
if ((temp & 0xff00) != 0x0000)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- m_mapper->write(*space, 0x03, temp >> 8);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ m_mapper->write(space, 0x03, temp >> 8);
m_workram[0x0bd0/2] = temp & 0x00ff;
}
}
@@ -1444,8 +1444,8 @@ void segas16b_state::goldnaxe_i8751_sim()
UINT16 temp = m_workram[0x2cfc/2];
if ((temp & 0xff00) != 0x0000)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- m_mapper->write(*space, 0x03, temp >> 8);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ m_mapper->write(space, 0x03, temp >> 8);
m_workram[0x2cfc/2] = temp & 0x00ff;
}
@@ -1471,8 +1471,8 @@ void segas16b_state::tturf_i8751_sim()
temp = m_workram[0x01d0/2];
if ((temp & 0xff00) != 0x0000)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- m_mapper->write(*space, 0x03, temp);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ m_mapper->write(space, 0x03, temp);
m_workram[0x01d0/2] = temp & 0x00ff;
}
@@ -1497,8 +1497,8 @@ void segas16b_state::wb3_i8751_sim()
UINT16 temp = m_workram[0x0008/2];
if ((temp & 0x00ff) != 0x0000)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- m_mapper->write(*space, 0x03, temp >> 8);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ m_mapper->write(space, 0x03, temp >> 8);
m_workram[0x0008/2] = temp & 0xff00;
}
}
@@ -1620,9 +1620,9 @@ WRITE16_MEMBER( segas16b_state::hwchamp_custom_io_w )
// bit 4 is GONG
// if (data & 0x10) popmessage("GONG");
// are the following really lamps?
- // set_led_status(space->machine(), 1,data & 0x20);
- // set_led_status(space->machine(), 2,data & 0x40);
- // set_led_status(space->machine(), 3,data & 0x80);
+ // set_led_status(space.machine(), 1,data & 0x20);
+ // set_led_status(space.machine(), 2,data & 0x40);
+ // set_led_status(space.machine(), 3,data & 0x80);
break;
}
break;
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index ad992df72be..aaaa02b4933 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -1031,7 +1031,7 @@ static void irq_ym(device_t *device, int irq)
READ16_MEMBER ( segas24_state::sys16_io_r )
{
- // logerror("IO read %02x (%s:%x)\n", offset, space->device().tag(), space->device().safe_pc());
+ // logerror("IO read %02x (%s:%x)\n", offset, space.device().tag(), space.device().safe_pc());
if(offset < 8)
return (this->*io_r)(offset);
else if (offset < 0x20) {
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 1fed4c3430e..f38c4e341e3 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -446,12 +446,12 @@ static TIMER_DEVICE_CALLBACK( signal_v60_irq_callback )
}
-static void int_control_w(address_space *space, int offset, UINT8 data)
+static void int_control_w(address_space &space, int offset, UINT8 data)
{
- segas32_state *state = space->machine().driver_data<segas32_state>();
+ segas32_state *state = space.machine().driver_data<segas32_state>();
int duration;
-// logerror("%06X:int_control_w(%X) = %02X\n", space->device().safe_pc(), offset, data);
+// logerror("%06X:int_control_w(%X) = %02X\n", space.device().safe_pc(), offset, data);
switch (offset)
{
case 0:
@@ -468,12 +468,12 @@ static void int_control_w(address_space *space, int offset, UINT8 data)
case 6: /* mask */
state->m_v60_irq_control[offset] = data;
- update_irq_state(space->machine());
+ update_irq_state(space.machine());
break;
case 7: /* acknowledge */
state->m_v60_irq_control[offset] &= data;
- update_irq_state(space->machine());
+ update_irq_state(space.machine());
break;
case 8:
@@ -502,7 +502,7 @@ static void int_control_w(address_space *space, int offset, UINT8 data)
case 13:
case 14:
case 15: /* signal IRQ to sound CPU */
- signal_sound_irq(space->machine(), SOUND_IRQ_V60);
+ signal_sound_irq(space.machine(), SOUND_IRQ_V60);
break;
}
}
@@ -529,9 +529,9 @@ READ16_MEMBER(segas32_state::interrupt_control_16_r)
WRITE16_MEMBER(segas32_state::interrupt_control_16_w)
{
if (ACCESSING_BITS_0_7)
- int_control_w(&space, offset*2+0, data);
+ int_control_w(space, offset*2+0, data);
if (ACCESSING_BITS_8_15)
- int_control_w(&space, offset*2+1, data >> 8);
+ int_control_w(space, offset*2+1, data >> 8);
}
@@ -552,13 +552,13 @@ READ32_MEMBER(segas32_state::interrupt_control_32_r)
WRITE32_MEMBER(segas32_state::interrupt_control_32_w)
{
if (ACCESSING_BITS_0_7)
- int_control_w(&space, offset*4+0, data);
+ int_control_w(space, offset*4+0, data);
if (ACCESSING_BITS_8_15)
- int_control_w(&space, offset*4+1, data >> 8);
+ int_control_w(space, offset*4+1, data >> 8);
if (ACCESSING_BITS_16_23)
- int_control_w(&space, offset*4+2, data >> 16);
+ int_control_w(space, offset*4+2, data >> 16);
if (ACCESSING_BITS_24_31)
- int_control_w(&space, offset*4+3, data >> 24);
+ int_control_w(space, offset*4+3, data >> 24);
}
@@ -587,9 +587,9 @@ static INTERRUPT_GEN( start_of_vblank_int )
*
*************************************/
-static UINT16 common_io_chip_r(address_space *space, int which, offs_t offset, UINT16 mem_mask)
+static UINT16 common_io_chip_r(address_space &space, int which, offs_t offset, UINT16 mem_mask)
{
- segas32_state *state = space->machine().driver_data<segas32_state>();
+ segas32_state *state = space.machine().driver_data<segas32_state>();
static const char *const portnames[2][8] =
{
{ "P1_A", "P2_A", "PORTC_A", "PORTD_A", "SERVICE12_A", "SERVICE34_A", "PORTG_A", "PORTH_A" },
@@ -639,9 +639,9 @@ static UINT16 common_io_chip_r(address_space *space, int which, offs_t offset, U
}
-static void common_io_chip_w(address_space *space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
+static void common_io_chip_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- segas32_state *state = space->machine().driver_data<segas32_state>();
+ segas32_state *state = space.machine().driver_data<segas32_state>();
// UINT8 old;
/* only LSB matters */
@@ -673,15 +673,15 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
if (which == 0)
{
- eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
+ eeprom_device *eeprom = space.machine().device<eeprom_device>("eeprom");
eeprom->write_bit(data & 0x80);
eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
eeprom->set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
}
-/* coin_lockout_w(space->machine(), 1 + 2*which, data & 0x08);
- coin_lockout_w(space->machine(), 0 + 2*which, data & 0x04);*/
- coin_counter_w(space->machine(), 1 + 2*which, data & 0x02);
- coin_counter_w(space->machine(), 0 + 2*which, data & 0x01);
+/* coin_lockout_w(space.machine(), 1 + 2*which, data & 0x08);
+ coin_lockout_w(space.machine(), 0 + 2*which, data & 0x04);*/
+ coin_counter_w(space.machine(), 1 + 2*which, data & 0x02);
+ coin_counter_w(space.machine(), 0 + 2*which, data & 0x01);
break;
/* tile banking */
@@ -691,7 +691,7 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
else
{
/* multi-32 EEPROM access */
- eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
+ eeprom_device *eeprom = space.machine().device<eeprom_device>("eeprom");
eeprom->write_bit(data & 0x80);
eeprom->set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
eeprom->set_clock_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
@@ -702,7 +702,7 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
case 0x1c/2:
state->m_system32_displayenable[which] = (data & 0x02);
if (which == 0)
- space->machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
+ space.machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
break;
}
}
@@ -710,45 +710,45 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
READ16_MEMBER(segas32_state::io_chip_r)
{
- return common_io_chip_r(&space, 0, offset, mem_mask);
+ return common_io_chip_r(space, 0, offset, mem_mask);
}
WRITE16_MEMBER(segas32_state::io_chip_w)
{
- common_io_chip_w(&space, 0, offset, data, mem_mask);
+ common_io_chip_w(space, 0, offset, data, mem_mask);
}
READ32_MEMBER(segas32_state::io_chip_0_r)
{
- return common_io_chip_r(&space, 0, offset*2+0, mem_mask) |
- (common_io_chip_r(&space, 0, offset*2+1, mem_mask >> 16) << 16);
+ return common_io_chip_r(space, 0, offset*2+0, mem_mask) |
+ (common_io_chip_r(space, 0, offset*2+1, mem_mask >> 16) << 16);
}
WRITE32_MEMBER(segas32_state::io_chip_0_w)
{
if (ACCESSING_BITS_0_15)
- common_io_chip_w(&space, 0, offset*2+0, data, mem_mask);
+ common_io_chip_w(space, 0, offset*2+0, data, mem_mask);
if (ACCESSING_BITS_16_31)
- common_io_chip_w(&space, 0, offset*2+1, data >> 16, mem_mask >> 16);
+ common_io_chip_w(space, 0, offset*2+1, data >> 16, mem_mask >> 16);
}
READ32_MEMBER(segas32_state::io_chip_1_r)
{
- return common_io_chip_r(&space, 1, offset*2+0, mem_mask) |
- (common_io_chip_r(&space, 1, offset*2+1, mem_mask >> 16) << 16);
+ return common_io_chip_r(space, 1, offset*2+0, mem_mask) |
+ (common_io_chip_r(space, 1, offset*2+1, mem_mask >> 16) << 16);
}
WRITE32_MEMBER(segas32_state::io_chip_1_w)
{
if (ACCESSING_BITS_0_15)
- common_io_chip_w(&space, 1, offset*2+0, data, mem_mask);
+ common_io_chip_w(space, 1, offset*2+0, data, mem_mask);
if (ACCESSING_BITS_16_31)
- common_io_chip_w(&space, 1, offset*2+1, data >> 16, mem_mask >> 16);
+ common_io_chip_w(space, 1, offset*2+1, data >> 16, mem_mask >> 16);
}
diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c
index 267070ec165..3f4bb1af793 100644
--- a/src/mame/drivers/segaxbd.c
+++ b/src/mame/drivers/segaxbd.c
@@ -619,7 +619,7 @@ READ16_MEMBER( segaxbd_state::rascot_excs_r )
logerror("%06X:rascot_excs_r(%04X)\n", m_maincpu->pc(), offset*2);
// probably receives commands from the server here
- //return space->machine().rand() & 0xff;
+ //return space.machine().rand() & 0xff;
return 0xff;
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index da8ea32daed..97b8d827a2f 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -741,13 +741,13 @@ Notes:
/********************************************************************/
-static UINT8 z80_fifoout_pop(address_space *space)
+static UINT8 z80_fifoout_pop(address_space &space)
{
- seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
+ seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
UINT8 r;
if (state->m_fifoout_wpos == state->m_fifoout_rpos)
{
- logerror("Sound FIFOOUT underflow at %08X\n", space->device().safe_pc());
+ logerror("Sound FIFOOUT underflow at %08X\n", space.device().safe_pc());
}
r = state->m_fifoout_data[state->m_fifoout_rpos++];
if(state->m_fifoout_rpos == FIFO_SIZE)
@@ -763,9 +763,9 @@ static UINT8 z80_fifoout_pop(address_space *space)
return r;
}
-static void z80_fifoout_push(address_space *space, UINT8 data)
+static void z80_fifoout_push(address_space &space, UINT8 data)
{
- seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
+ seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
state->m_fifoout_data[state->m_fifoout_wpos++] = data;
if (state->m_fifoout_wpos == FIFO_SIZE)
{
@@ -773,19 +773,19 @@ static void z80_fifoout_push(address_space *space, UINT8 data)
}
if(state->m_fifoout_wpos == state->m_fifoout_rpos)
{
- fatalerror("Sound FIFOOUT overflow at %08X\n", space->device().safe_pc());
+ fatalerror("Sound FIFOOUT overflow at %08X\n", space.device().safe_pc());
}
state->m_fifoout_read_request = 1;
}
-static UINT8 z80_fifoin_pop(address_space *space)
+static UINT8 z80_fifoin_pop(address_space &space)
{
- seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
+ seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
UINT8 r;
if (state->m_fifoin_wpos == state->m_fifoin_rpos)
{
- fatalerror("Sound FIFOIN underflow at %08X\n", space->device().safe_pc());
+ fatalerror("Sound FIFOIN underflow at %08X\n", space.device().safe_pc());
}
r = state->m_fifoin_data[state->m_fifoin_rpos++];
if(state->m_fifoin_rpos == FIFO_SIZE)
@@ -801,9 +801,9 @@ static UINT8 z80_fifoin_pop(address_space *space)
return r;
}
-static void z80_fifoin_push(address_space *space, UINT8 data)
+static void z80_fifoin_push(address_space &space, UINT8 data)
{
- seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
+ seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
state->m_fifoin_data[state->m_fifoin_wpos++] = data;
if(state->m_fifoin_wpos == FIFO_SIZE)
{
@@ -811,7 +811,7 @@ static void z80_fifoin_push(address_space *space, UINT8 data)
}
if(state->m_fifoin_wpos == state->m_fifoin_rpos)
{
- fatalerror("Sound FIFOIN overflow at %08X\n", space->device().safe_pc());
+ fatalerror("Sound FIFOIN overflow at %08X\n", space.device().safe_pc());
}
state->m_fifoin_read_request = 1;
@@ -835,7 +835,7 @@ WRITE8_MEMBER(seibuspi_state::sb_coin_w)
READ32_MEMBER(seibuspi_state::sound_fifo_r)
{
- UINT8 r = z80_fifoout_pop(&space);
+ UINT8 r = z80_fifoout_pop(space);
return r;
}
@@ -843,7 +843,7 @@ READ32_MEMBER(seibuspi_state::sound_fifo_r)
WRITE32_MEMBER(seibuspi_state::sound_fifo_w)
{
if( ACCESSING_BITS_0_7 ) {
- z80_fifoin_push(&space, data & 0xff);
+ z80_fifoin_push(space, data & 0xff);
}
}
@@ -955,14 +955,14 @@ CUSTOM_INPUT_MEMBER(seibuspi_state::ejsakura_keyboard_r)
READ8_MEMBER(seibuspi_state::z80_soundfifo_r)
{
- UINT8 r = z80_fifoin_pop(&space);
+ UINT8 r = z80_fifoin_pop(space);
return r;
}
WRITE8_MEMBER(seibuspi_state::z80_soundfifo_w)
{
- z80_fifoout_push(&space, data);
+ z80_fifoout_push(space, data);
}
READ8_MEMBER(seibuspi_state::z80_soundfifo_status_r)
diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c
index ec0904ecd80..34da218086b 100644
--- a/src/mame/drivers/seicross.c
+++ b/src/mame/drivers/seicross.c
@@ -90,7 +90,7 @@ READ8_MEMBER(seicross_state::friskyt_portB_r)
WRITE8_MEMBER(seicross_state::friskyt_portB_w)
{
- //logerror("PC %04x: 8910 port B = %02x\n", space->device().safe_pc(), data);
+ //logerror("PC %04x: 8910 port B = %02x\n", space.device().safe_pc(), data);
/* bit 0 is IRQ enable */
m_irq_mask = data & 1;
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index 19e3cb474e5..2bb5985ff8e 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -3177,8 +3177,8 @@ ADDRESS_MAP_END
MACHINE_RESET_MEMBER(seta_state,calibr50)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- sub_bankswitch_w(*space, 0, 0);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ sub_bankswitch_w(space, 0, 0);
}
WRITE8_MEMBER(seta_state::calibr50_soundlatch2_w)
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 7a0d4f43b93..f32f1f40fe3 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -53,10 +53,10 @@ WRITE16_MEMBER(sf_state::soundcmd_w)
/* The protection of the Japanese (and alt US) version */
/* I'd love to see someone dump the 68705 / i8751 roms */
-static void write_dword( address_space *space, offs_t offset, UINT32 data )
+static void write_dword( address_space &space, offs_t offset, UINT32 data )
{
- space->write_word(offset, data >> 16);
- space->write_word(offset + 2, data);
+ space.write_word(offset, data >> 16);
+ space.write_word(offset + 2, data);
}
WRITE16_MEMBER(sf_state::protection_w)
@@ -81,21 +81,21 @@ WRITE16_MEMBER(sf_state::protection_w)
base = 0x1b6e8 + 0x300e * map;
- write_dword(&space, 0xffc01c, 0x16bfc + 0x270 * map);
- write_dword(&space, 0xffc020, base + 0x80);
- write_dword(&space, 0xffc024, base);
- write_dword(&space, 0xffc028, base + 0x86);
- write_dword(&space, 0xffc02c, base + 0x8e);
- write_dword(&space, 0xffc030, base + 0x20e);
- write_dword(&space, 0xffc034, base + 0x30e);
- write_dword(&space, 0xffc038, base + 0x38e);
- write_dword(&space, 0xffc03c, base + 0x40e);
- write_dword(&space, 0xffc040, base + 0x80e);
- write_dword(&space, 0xffc044, base + 0xc0e);
- write_dword(&space, 0xffc048, base + 0x180e);
- write_dword(&space, 0xffc04c, base + 0x240e);
- write_dword(&space, 0xffc050, 0x19548 + 0x60 * map);
- write_dword(&space, 0xffc054, 0x19578 + 0x60 * map);
+ write_dword(space, 0xffc01c, 0x16bfc + 0x270 * map);
+ write_dword(space, 0xffc020, base + 0x80);
+ write_dword(space, 0xffc024, base);
+ write_dword(space, 0xffc028, base + 0x86);
+ write_dword(space, 0xffc02c, base + 0x8e);
+ write_dword(space, 0xffc030, base + 0x20e);
+ write_dword(space, 0xffc034, base + 0x30e);
+ write_dword(space, 0xffc038, base + 0x38e);
+ write_dword(space, 0xffc03c, base + 0x40e);
+ write_dword(space, 0xffc040, base + 0x80e);
+ write_dword(space, 0xffc044, base + 0xc0e);
+ write_dword(space, 0xffc048, base + 0x180e);
+ write_dword(space, 0xffc04c, base + 0x240e);
+ write_dword(space, 0xffc050, 0x19548 + 0x60 * map);
+ write_dword(space, 0xffc054, 0x19578 + 0x60 * map);
break;
}
case 2:
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index 00810833463..cb5678f517a 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -404,13 +404,13 @@ ROM_END
DRIVER_INIT_MEMBER(shootout_state,shootout)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int length = machine().root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, length - 0x8000);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
int A;
- space->set_decrypted_region(0x8000, 0xffff, decrypt);
+ space.set_decrypted_region(0x8000, 0xffff, decrypt);
for (A = 0x8000;A < length;A++)
decrypt[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x40) >> 1) | ((rom[A] & 0x20) << 1);
diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c
index ee47d83b8a0..b58f76176aa 100644
--- a/src/mame/drivers/sigmab52.c
+++ b/src/mame/drivers/sigmab52.c
@@ -283,7 +283,7 @@ READ8_MEMBER(sigmab52_state::acrtc_r)
else
{
- return 0x7b; //fake status read (instead HD63484_status_r(&space, 0, 0xff); )
+ return 0x7b; //fake status read (instead HD63484_status_r(space, 0, 0xff); )
}
}
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index 63a9164d9a3..8aa78bcf288 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -165,15 +165,15 @@ static SCREEN_UPDATE_IND16( skimaxx )
*************************************/
// TODO: Might not be used
-static void skimaxx_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void skimaxx_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
+ skimaxx_state *state = space.machine().driver_data<skimaxx_state>();
memcpy(shiftreg, &state->m_fg_buffer[TOWORD(address)], 512 * sizeof(UINT16));
}
-static void skimaxx_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void skimaxx_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
+ skimaxx_state *state = space.machine().driver_data<skimaxx_state>();
memcpy(&state->m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
}
diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c
index 4fdb7d6eb2d..f0db267e30b 100644
--- a/src/mame/drivers/sothello.c
+++ b/src/mame/drivers/sothello.c
@@ -206,27 +206,27 @@ ADDRESS_MAP_END
/* sub 6809 */
-static void unlock_shared_ram(address_space *space)
+static void unlock_shared_ram(address_space &space)
{
- sothello_state *state = space->machine().driver_data<sothello_state>();
- if(!space->machine().device<cpu_device>("sub")->suspended(SUSPEND_REASON_HALT))
+ sothello_state *state = space.machine().driver_data<sothello_state>();
+ if(!space.machine().device<cpu_device>("sub")->suspended(SUSPEND_REASON_HALT))
{
state->m_subcpu_status|=1;
}
else
{
- logerror("Sub cpu active! @%x\n",space->device().safe_pc());
+ logerror("Sub cpu active! @%x\n",space.device().safe_pc());
}
}
WRITE8_MEMBER(sothello_state::subcpu_status_w)
{
- unlock_shared_ram(&space);
+ unlock_shared_ram(space);
}
READ8_MEMBER(sothello_state::subcpu_status_r)
{
- unlock_shared_ram(&space);
+ unlock_shared_ram(space);
return 0;
}
diff --git a/src/mame/drivers/spacefb.c b/src/mame/drivers/spacefb.c
index f62c319d35f..7f06f0d2d46 100644
--- a/src/mame/drivers/spacefb.c
+++ b/src/mame/drivers/spacefb.c
@@ -180,11 +180,11 @@ void spacefb_state::machine_start()
void spacefb_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_IO);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_IO);
/* the 3 output ports are cleared on reset */
- spacefb_port_0_w(*space, 0, 0);
- spacefb_port_1_w(*space, 0, 0);
- spacefb_port_2_w(*space, 0, 0);
+ spacefb_port_0_w(space, 0, 0);
+ spacefb_port_1_w(space, 0, 0);
+ spacefb_port_2_w(space, 0, 0);
start_interrupt_timer(machine());
}
diff --git a/src/mame/drivers/srumbler.c b/src/mame/drivers/srumbler.c
index 716f524eafd..2330139b6bd 100644
--- a/src/mame/drivers/srumbler.c
+++ b/src/mame/drivers/srumbler.c
@@ -45,9 +45,9 @@ WRITE8_MEMBER(srumbler_state::srumbler_bankswitch_w)
void srumbler_state::machine_start()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* initialize banked ROM pointers */
- srumbler_bankswitch_w(*space,0,0);
+ srumbler_bankswitch_w(space,0,0);
}
static TIMER_DEVICE_CALLBACK( srumbler_interrupt )
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index c65f8acc035..324d1d2219f 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -350,23 +350,23 @@ static void PS7500_reset(running_machine &machine)
state->m_PS7500timer1->adjust( attotime::never);
}
-typedef void (*ssfindo_speedup_func)(address_space *space);
+typedef void (*ssfindo_speedup_func)(address_space &space);
ssfindo_speedup_func ssfindo_speedup;
-static void ssfindo_speedups(address_space* space)
+static void ssfindo_speedups(address_space& space)
{
- if (space->device().safe_pc()==0x2d6c8) // ssfindo
- space->device().execute().spin_until_time(attotime::from_usec(20));
- else if (space->device().safe_pc()==0x2d6bc) // ssfindo
- space->device().execute().spin_until_time(attotime::from_usec(20));
+ if (space.device().safe_pc()==0x2d6c8) // ssfindo
+ space.device().execute().spin_until_time(attotime::from_usec(20));
+ else if (space.device().safe_pc()==0x2d6bc) // ssfindo
+ space.device().execute().spin_until_time(attotime::from_usec(20));
}
-static void ppcar_speedups(address_space* space)
+static void ppcar_speedups(address_space& space)
{
- if (space->device().safe_pc()==0x000bc8) // ppcar
- space->device().execute().spin_until_time(attotime::from_usec(20));
- else if (space->device().safe_pc()==0x000bbc) // ppcar
- space->device().execute().spin_until_time(attotime::from_usec(20));
+ if (space.device().safe_pc()==0x000bc8) // ppcar
+ space.device().execute().spin_until_time(attotime::from_usec(20));
+ else if (space.device().safe_pc()==0x000bbc) // ppcar
+ space.device().execute().spin_until_time(attotime::from_usec(20));
}
@@ -394,7 +394,7 @@ READ32_MEMBER(ssfindo_state::PS7500_IO_r)
return (m_PS7500_IO[IRQSTA] & m_PS7500_IO[IRQMSKA]) | 0x80;
case IOCR: //TODO: nINT1, OD[n] p.81
- if (ssfindo_speedup) ssfindo_speedup(&space);
+ if (ssfindo_speedup) ssfindo_speedup(space);
if( m_iocr_hack)
{
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index b122fe9b905..c5e122a6a72 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -48,7 +48,7 @@ void starwars_state::machine_reset()
/* ESB-specific */
if (m_is_esb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset the slapstic */
slapstic_reset();
@@ -56,7 +56,7 @@ void starwars_state::machine_reset()
memcpy(m_slapstic_base, &m_slapstic_source[m_slapstic_current_bank * 0x2000], 0x2000);
/* reset all the banks */
- starwars_out_w(*space, 4, 0);
+ starwars_out_w(space, 4, 0);
}
/* reset the matrix processor */
@@ -84,9 +84,9 @@ WRITE8_MEMBER(starwars_state::irq_ack_w)
*
*************************************/
-static void esb_slapstic_tweak(address_space *space, offs_t offset)
+static void esb_slapstic_tweak(address_space &space, offs_t offset)
{
- starwars_state *state = space->machine().driver_data<starwars_state>();
+ starwars_state *state = space.machine().driver_data<starwars_state>();
int new_bank = slapstic_tweak(space, offset);
/* update for the new bank */
@@ -101,14 +101,14 @@ static void esb_slapstic_tweak(address_space *space, offs_t offset)
READ8_MEMBER(starwars_state::esb_slapstic_r)
{
int result = m_slapstic_base[offset];
- esb_slapstic_tweak(&space, offset);
+ esb_slapstic_tweak(space, offset);
return result;
}
WRITE8_MEMBER(starwars_state::esb_slapstic_w)
{
- esb_slapstic_tweak(&space, offset);
+ esb_slapstic_tweak(space, offset);
}
@@ -135,7 +135,7 @@ DIRECT_UPDATE_MEMBER(starwars_state::esb_setdirect)
{
m_slapstic_last_pc = pc;
m_slapstic_last_address = address;
- esb_slapstic_tweak(&direct.space(), address & 0x1fff);
+ esb_slapstic_tweak(direct.space(), address & 0x1fff);
}
return ~0;
}
@@ -514,8 +514,8 @@ DRIVER_INIT_MEMBER(starwars_state,esb)
m_slapstic_base = &rom[0x08000];
/* install an opcode base handler */
- address_space *space = machine().device<m6809_device>("maincpu")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(starwars_state::esb_setdirect), this));
+ address_space &space = *machine().device<m6809_device>("maincpu")->space(AS_PROGRAM);
+ space.set_direct_update_handler(direct_update_delegate(FUNC(starwars_state::esb_setdirect), this));
/* install read/write handlers for it */
machine().device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_handler(0x8000, 0x9fff, read8_delegate(FUNC(starwars_state::esb_slapstic_r),this), write8_delegate(FUNC(starwars_state::esb_slapstic_w),this));
diff --git a/src/mame/drivers/su2000.c b/src/mame/drivers/su2000.c
index 5fd9c78558d..c5ab5c17423 100644
--- a/src/mame/drivers/su2000.c
+++ b/src/mame/drivers/su2000.c
@@ -260,7 +260,7 @@ static IRQ_CALLBACK( pc_irq_callback )
void su2000_state::machine_start()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_pit8254 = machine().device("pit8254");
m_pic8259_1 = machine().device("pic8259_1");
@@ -276,8 +276,8 @@ void su2000_state::machine_start()
/* HMA */
offs_t ram_limit = 0x100000 + PC_RAM_SIZE - 0x0a0000;
- space->install_read_bank(0x100000, ram_limit - 1, "hma_bank");
- space->install_write_bank(0x100000, ram_limit - 1, "hma_bank");
+ space.install_read_bank(0x100000, ram_limit - 1, "hma_bank");
+ space.install_write_bank(0x100000, ram_limit - 1, "hma_bank");
membank("hma_bank")->set_base(m_pc_ram + 0xa0000);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(pc_irq_callback);
@@ -287,7 +287,7 @@ void su2000_state::machine_start()
kbdc8042_init(machine(), &at8042);
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
void su2000_state::machine_reset()
diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c
index 38281c5f06b..358521fde37 100644
--- a/src/mame/drivers/subsino2.c
+++ b/src/mame/drivers/subsino2.c
@@ -210,7 +210,7 @@ WRITE8_MEMBER(subsino2_state::ss9601_byte_lo2_w)
}
-INLINE void ss9601_videoram_w(layer_t *l, vram_t vram, address_space *space, offs_t offset, UINT8 data)
+INLINE void ss9601_videoram_w(layer_t *l, vram_t vram, address_space &space, offs_t offset, UINT8 data)
{
l->videorams[vram][offset] = data;
@@ -239,24 +239,24 @@ INLINE void ss9601_videoram_w(layer_t *l, vram_t vram, address_space *space, off
// Layer 0
WRITE8_MEMBER(subsino2_state::ss9601_videoram_0_hi_w)
{
- ss9601_videoram_w(&m_layers[0], VRAM_HI, &space, offset, data);
+ ss9601_videoram_w(&m_layers[0], VRAM_HI, space, offset, data);
}
WRITE8_MEMBER(subsino2_state::ss9601_videoram_0_lo_w)
{
- ss9601_videoram_w(&m_layers[0], VRAM_LO, &space, offset, data);
+ ss9601_videoram_w(&m_layers[0], VRAM_LO, space, offset, data);
}
WRITE8_MEMBER(subsino2_state::ss9601_videoram_0_hi_lo_w)
{
- ss9601_videoram_w(&m_layers[0], VRAM_HI, &space, offset, data);
- ss9601_videoram_w(&m_layers[0], VRAM_LO, &space, offset, m_ss9601_byte_lo);
+ ss9601_videoram_w(&m_layers[0], VRAM_HI, space, offset, data);
+ ss9601_videoram_w(&m_layers[0], VRAM_LO, space, offset, m_ss9601_byte_lo);
}
WRITE8_MEMBER(subsino2_state::ss9601_videoram_0_hi_lo2_w)
{
- ss9601_videoram_w(&m_layers[0], VRAM_HI, &space, offset, data);
- ss9601_videoram_w(&m_layers[0], VRAM_LO, &space, offset, m_ss9601_byte_lo2);
+ ss9601_videoram_w(&m_layers[0], VRAM_HI, space, offset, data);
+ ss9601_videoram_w(&m_layers[0], VRAM_LO, space, offset, m_ss9601_byte_lo2);
}
READ8_MEMBER(subsino2_state::ss9601_videoram_0_hi_r)
@@ -272,24 +272,24 @@ READ8_MEMBER(subsino2_state::ss9601_videoram_0_lo_r)
// Layer 1
WRITE8_MEMBER(subsino2_state::ss9601_videoram_1_hi_w)
{
- ss9601_videoram_w(&m_layers[1], VRAM_HI, &space, offset, data);
+ ss9601_videoram_w(&m_layers[1], VRAM_HI, space, offset, data);
}
WRITE8_MEMBER(subsino2_state::ss9601_videoram_1_lo_w)
{
- ss9601_videoram_w(&m_layers[1], VRAM_LO, &space, offset, data);
+ ss9601_videoram_w(&m_layers[1], VRAM_LO, space, offset, data);
}
WRITE8_MEMBER(subsino2_state::ss9601_videoram_1_hi_lo_w)
{
- ss9601_videoram_w(&m_layers[1], VRAM_HI, &space, offset, data);
- ss9601_videoram_w(&m_layers[1], VRAM_LO, &space, offset, m_ss9601_byte_lo);
+ ss9601_videoram_w(&m_layers[1], VRAM_HI, space, offset, data);
+ ss9601_videoram_w(&m_layers[1], VRAM_LO, space, offset, m_ss9601_byte_lo);
}
WRITE8_MEMBER(subsino2_state::ss9601_videoram_1_hi_lo2_w)
{
- ss9601_videoram_w(&m_layers[1], VRAM_HI, &space, offset, data);
- ss9601_videoram_w(&m_layers[1], VRAM_LO, &space, offset, m_ss9601_byte_lo2);
+ ss9601_videoram_w(&m_layers[1], VRAM_HI, space, offset, data);
+ ss9601_videoram_w(&m_layers[1], VRAM_LO, space, offset, m_ss9601_byte_lo2);
}
READ8_MEMBER(subsino2_state::ss9601_videoram_1_hi_r)
@@ -1084,11 +1084,11 @@ WRITE8_MEMBER(subsino2_state::mtrain_videoram_w)
vram_t vram = (m_ss9601_byte_lo & 0x08) ? VRAM_HI : VRAM_LO;
switch (m_ss9601_byte_lo & (~0x08))
{
- case 0x00: ss9601_videoram_w(&m_layers[1], vram, &space, offset, data);
- ss9601_videoram_w(&m_layers[1], vram, &space, offset+0x1000, data); break;
+ case 0x00: ss9601_videoram_w(&m_layers[1], vram, space, offset, data);
+ ss9601_videoram_w(&m_layers[1], vram, space, offset+0x1000, data); break;
- case 0x04: ss9601_videoram_w(&m_layers[0], vram, &space, offset, data);
- ss9601_videoram_w(&m_layers[0], vram, &space, offset+0x1000, data); break;
+ case 0x04: ss9601_videoram_w(&m_layers[0], vram, space, offset, data);
+ ss9601_videoram_w(&m_layers[0], vram, space, offset+0x1000, data); break;
case 0x06: m_ss9601_reelrams[vram][offset] = data; break;
}
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index 9047b7b0125..becf170a4c8 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -361,8 +361,8 @@ ADDRESS_MAP_END
MACHINE_RESET_MEMBER(suna16_state,uballoon)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- uballoon_pcm_1_bankswitch_w(*space, 0, 0);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ uballoon_pcm_1_bankswitch_w(space, 0, 0);
}
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index cbdd8742c5b..9143442f2ee 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -81,8 +81,8 @@ DRIVER_INIT_MEMBER(suna8_state,hardhead)
/* Non encrypted bootleg */
DRIVER_INIT_MEMBER(suna8_state,hardhedb)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x48000);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x48000);
machine().root_device().membank("bank1")->configure_entries(0, 16, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -92,13 +92,13 @@ DRIVER_INIT_MEMBER(suna8_state,hardhedb)
static UINT8 *brickzn_decrypt(running_machine &machine)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
size_t size = machine.root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int i;
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
/* Opcodes and data */
for (i = 0; i < 0x50000; i++)
@@ -222,14 +222,14 @@ DRIVER_INIT_MEMBER(suna8_state,brickznv4)
DRIVER_INIT_MEMBER(suna8_state,hardhea2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
size_t size = machine().root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
UINT8 x;
int i;
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
/* Address lines scrambling */
memcpy(decrypt, RAM, size);
@@ -309,14 +309,14 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
DRIVER_INIT_MEMBER(suna8_state,starfigh)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
size_t size = machine().root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
UINT8 x;
int i;
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
/* Address lines scrambling */
memcpy(decrypt, RAM, size);
@@ -377,14 +377,14 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh)
DRIVER_INIT_MEMBER(suna8_state,sparkman)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
size_t size = machine().root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
UINT8 x;
int i;
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
/* Address lines scrambling */
memcpy(decrypt, RAM, size);
@@ -1832,8 +1832,8 @@ static TIMER_DEVICE_CALLBACK( hardhea2_interrupt )
MACHINE_RESET_MEMBER(suna8_state,hardhea2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- hardhea2_rambank_0_w(*space,0,0);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ hardhea2_rambank_0_w(space,0,0);
}
static MACHINE_CONFIG_DERIVED( hardhea2, brickzn )
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 323f8be1179..44938140d19 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -172,13 +172,13 @@ The MCU acts this way:
READ8_MEMBER(superqix_state::in4_mcu_r)
{
-// logerror("%04x: in4_mcu_r\n",space->device().safe_pc());
+// logerror("%04x: in4_mcu_r\n",space.device().safe_pc());
return ioport("P2")->read() | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
}
READ8_MEMBER(superqix_state::sqix_from_mcu_r)
{
-// logerror("%04x: read mcu answer (%02x)\n",space->device().safe_pc(),m_from_mcu);
+// logerror("%04x: read mcu answer (%02x)\n",space.device().safe_pc(),m_from_mcu);
return m_from_mcu;
}
@@ -198,7 +198,7 @@ READ8_MEMBER(superqix_state::mcu_acknowledge_r)
WRITE8_MEMBER(superqix_state::sqix_z80_mcu_w)
{
-// logerror("%04x: sqix_z80_mcu_w %02x\n",space->device().safe_pc(),data);
+// logerror("%04x: sqix_z80_mcu_w %02x\n",space.device().safe_pc(),data);
m_portb = data;
}
@@ -473,7 +473,7 @@ READ8_MEMBER(superqix_state::hotsmash_from_mcu_r)
READ8_MEMBER(superqix_state::hotsmash_ay_port_a_r)
{
-// logerror("%04x: ay_port_a_r and mcu_pending is %d\n",space->device().safe_pc(),m_from_mcu_pending);
+// logerror("%04x: ay_port_a_r and mcu_pending is %d\n",space.device().safe_pc(),m_from_mcu_pending);
return ioport("SYSTEM")->read() | 0x40 | ((m_from_mcu_pending^1) << 7);
}
@@ -515,7 +515,7 @@ READ8_MEMBER(superqix_state::pbillian_from_mcu_r)
READ8_MEMBER(superqix_state::pbillian_ay_port_a_r)
{
-// logerror("%04x: ay_port_a_r\n",space->device().safe_pc());
+// logerror("%04x: ay_port_a_r\n",space.device().safe_pc());
/* bits 76------ MCU status bits */
return (machine().rand() & 0xc0) | machine().root_device().ioport("BUTTONS")->read();
}
diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c
index c6c23aeb7b9..c199cb03093 100644
--- a/src/mame/drivers/supertnk.c
+++ b/src/mame/drivers/supertnk.c
@@ -287,12 +287,12 @@ static SCREEN_UPDATE_RGB32( supertnk )
void supertnk_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- supertnk_bankswitch_0_w(*space, 0, 0);
- supertnk_bankswitch_1_w(*space, 0, 0);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ supertnk_bankswitch_0_w(space, 0, 0);
+ supertnk_bankswitch_1_w(space, 0, 0);
- supertnk_bitplane_select_0_w(*space, 0, 0);
- supertnk_bitplane_select_1_w(*space, 0, 0);
+ supertnk_bitplane_select_0_w(space, 0, 0);
+ supertnk_bitplane_select_1_w(space, 0, 0);
}
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index c821cbd771a..9a84c6d586e 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -270,7 +270,7 @@ WRITE8_MEMBER(suprgolf_state::rom_bank_select_w)
//popmessage("%08x %02x",((data & 0x3f) * 0x4000),data);
-// mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,space->device().safe_pcbase());
+// mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,space.device().safe_pcbase());
membank("bank2")->set_base(region_base + (data&0x3f ) * 0x4000);
m_msm_nmi_mask = data & 0x40;
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 930f003744d..f24a73e730f 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -4704,7 +4704,7 @@ READ8_MEMBER(system1_state::nob_start_r)
DRIVER_INIT_MEMBER(system1_state,nob)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
address_space *iospace = machine().device("maincpu")->memory().space(AS_IO);
DRIVER_INIT_CALL(bank44);
@@ -4712,7 +4712,7 @@ DRIVER_INIT_MEMBER(system1_state,nob)
/* hack to fix incorrect JMP at start, which should obviously be to $0080 */
/* patching the ROM causes errors in the self-test */
/* in real-life, it could be some behavior dependent upon M1 */
- space->install_read_handler(0x0001, 0x0001, read8_delegate(FUNC(system1_state::nob_start_r),this));
+ space.install_read_handler(0x0001, 0x0001, read8_delegate(FUNC(system1_state::nob_start_r),this));
/* install MCU communications */
iospace->install_readwrite_handler(0x18, 0x18, 0x00, 0x00, read8_delegate(FUNC(system1_state::nob_maincpu_latch_r),this), write8_delegate(FUNC(system1_state::nob_maincpu_latch_w),this));
@@ -4752,16 +4752,16 @@ DRIVER_INIT_MEMBER(system1_state,nobb)
DRIVER_INIT_MEMBER(system1_state,bootleg)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x10000);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x10000);
DRIVER_INIT_CALL(bank00);
}
DRIVER_INIT_MEMBER(system1_state,bootsys2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x20000);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.set_decrypted_region(0x0000, 0x7fff, machine().root_device().memregion("maincpu")->base() + 0x20000);
machine().root_device().membank("bank1")->configure_decrypted_entries(0, 4, machine().root_device().memregion("maincpu")->base() + 0x30000, 0x4000);
DRIVER_INIT_CALL(bank0c);
}
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index a1592de7f51..5892d8570a2 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -3294,7 +3294,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,goldnaxeb1)
int i;
UINT8 *ROM = memregion("maincpu")->base();
UINT8 *KEY = memregion("decryption")->base();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 data[0x1000];
// the decryption key is in a rom (part of an MSDOS executable...)
@@ -3313,7 +3313,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,goldnaxeb1)
m_decrypted_region[i] = ROM[i] ^ data[(i & 0xfff) ^ 1];
}
- space->set_decrypted_region(0x00000, 0xbffff, m_decrypted_region);
+ space.set_decrypted_region(0x00000, 0xbffff, m_decrypted_region);
DRIVER_INIT_CALL(common);
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 5bc74e000d5..d5319b3b974 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -433,36 +433,36 @@ READ8_MEMBER(taitol_state::rambankswitch_r)
return m_cur_rambank[offset];
}
-static void bank_w(address_space *space, offs_t offset, UINT8 data, int banknum )
+static void bank_w(address_space &space, offs_t offset, UINT8 data, int banknum )
{
- taitol_state *state = space->machine().driver_data<taitol_state>();
+ taitol_state *state = space.machine().driver_data<taitol_state>();
if (state->m_current_base[banknum][offset] != data)
{
state->m_current_base[banknum][offset] = data;
if (state->m_current_notifier[banknum])
- state->m_current_notifier[banknum](space->machine(), offset);
+ state->m_current_notifier[banknum](space.machine(), offset);
}
}
WRITE8_MEMBER(taitol_state::bank0_w)
{
- bank_w(&space, offset, data, 0);
+ bank_w(space, offset, data, 0);
}
WRITE8_MEMBER(taitol_state::bank1_w)
{
- bank_w(&space, offset, data, 1);
+ bank_w(space, offset, data, 1);
}
WRITE8_MEMBER(taitol_state::bank2_w)
{
- bank_w(&space, offset, data, 2);
+ bank_w(space, offset, data, 2);
}
WRITE8_MEMBER(taitol_state::bank3_w)
{
- bank_w(&space, offset, data, 3);
+ bank_w(space, offset, data, 3);
}
WRITE8_MEMBER(taitol_state::control2_w)
@@ -1777,7 +1777,7 @@ WRITE8_MEMBER(taitol_state::portA_w)
m_cur_bank = data & 0x03;
bankaddress = m_cur_bank * 0x4000;
membank("bank7")->set_base(&RAM[bankaddress]);
- //logerror ("YM2203 bank change val=%02x pc=%04x\n", m_cur_bank, space->device().safe_pc() );
+ //logerror ("YM2203 bank change val=%02x pc=%04x\n", m_cur_bank, space.device().safe_pc() );
}
}
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 7c2b9565860..1f74c22e415 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -569,9 +569,9 @@ WRITE32_MEMBER(taitojc_state::dsp_shared_w)
-static UINT8 mcu_comm_reg_r(address_space *space, int reg)
+static UINT8 mcu_comm_reg_r(address_space &space, int reg)
{
- taitojc_state *state = space->machine().driver_data<taitojc_state>();
+ taitojc_state *state = space.machine().driver_data<taitojc_state>();
UINT8 r = 0;
switch (reg)
@@ -588,7 +588,7 @@ static UINT8 mcu_comm_reg_r(address_space *space, int reg)
}
default:
{
- //mame_printf_debug("hc11_reg_r: %02X at %08X\n", reg, space->device().safe_pc());
+ //mame_printf_debug("hc11_reg_r: %02X at %08X\n", reg, space.device().safe_pc());
break;
}
}
@@ -596,9 +596,9 @@ static UINT8 mcu_comm_reg_r(address_space *space, int reg)
return r;
}
-static void mcu_comm_reg_w(address_space *space, int reg, UINT8 data)
+static void mcu_comm_reg_w(address_space &space, int reg, UINT8 data)
{
- taitojc_state *state = space->machine().driver_data<taitojc_state>();
+ taitojc_state *state = space.machine().driver_data<taitojc_state>();
switch (reg)
{
@@ -615,7 +615,7 @@ static void mcu_comm_reg_w(address_space *space, int reg, UINT8 data)
}
default:
{
- //mame_printf_debug("hc11_reg_w: %02X, %02X at %08X\n", reg, data, space->device().safe_pc());
+ //mame_printf_debug("hc11_reg_w: %02X, %02X at %08X\n", reg, data, space.device().safe_pc());
break;
}
}
@@ -628,19 +628,19 @@ READ32_MEMBER(taitojc_state::mcu_comm_r)
if (ACCESSING_BITS_24_31)
{
- r |= mcu_comm_reg_r(&space, reg + 0) << 24;
+ r |= mcu_comm_reg_r(space, reg + 0) << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= mcu_comm_reg_r(&space, reg + 1) << 16;
+ r |= mcu_comm_reg_r(space, reg + 1) << 16;
}
if (ACCESSING_BITS_8_15)
{
- r |= mcu_comm_reg_r(&space, reg + 2) << 8;
+ r |= mcu_comm_reg_r(space, reg + 2) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= mcu_comm_reg_r(&space, reg + 3) << 0;
+ r |= mcu_comm_reg_r(space, reg + 3) << 0;
}
return r;
@@ -652,19 +652,19 @@ WRITE32_MEMBER(taitojc_state::mcu_comm_w)
if (ACCESSING_BITS_24_31)
{
- mcu_comm_reg_w(&space, reg + 0, (data >> 24) & 0xff);
+ mcu_comm_reg_w(space, reg + 0, (data >> 24) & 0xff);
}
if (ACCESSING_BITS_16_23)
{
- mcu_comm_reg_w(&space, reg + 1, (data >> 16) & 0xff);
+ mcu_comm_reg_w(space, reg + 1, (data >> 16) & 0xff);
}
if (ACCESSING_BITS_8_15)
{
- mcu_comm_reg_w(&space, reg + 2, (data >> 8) & 0xff);
+ mcu_comm_reg_w(space, reg + 2, (data >> 8) & 0xff);
}
if (ACCESSING_BITS_0_7)
{
- mcu_comm_reg_w(&space, reg + 3, (data >> 0) & 0xff);
+ mcu_comm_reg_w(space, reg + 3, (data >> 0) & 0xff);
}
}
diff --git a/src/mame/drivers/taitopjc.c b/src/mame/drivers/taitopjc.c
index d4e16e8cd54..f90cd3c7916 100644
--- a/src/mame/drivers/taitopjc.c
+++ b/src/mame/drivers/taitopjc.c
@@ -130,7 +130,7 @@ static SCREEN_UPDATE_RGB32( taitopjc )
static UINT32 video_address;
-static UINT32 videochip_r(address_space *space, offs_t address)
+static UINT32 videochip_r(address_space &space, offs_t address)
{
UINT32 r = 0;
@@ -142,14 +142,14 @@ static UINT32 videochip_r(address_space *space, offs_t address)
return r;
}
-static void videochip_w(address_space *space, offs_t address, UINT32 data)
+static void videochip_w(address_space &space, offs_t address, UINT32 data)
{
if (address >= 0x20000000 && address < 0x20008000)
{
//UINT32 r = (data >> 16) & 0xff;
//UINT32 g = (data >> 8) & 0xff;
//UINT32 b = (data >> 0) & 0xff;
- //palette_set_color_rgb(space->machine, address & 0x7fff, r, g, b);
+ //palette_set_color_rgb(space.machine, address & 0x7fff, r, g, b);
}
else if (address >= 0x1003d000 && address < 0x1003f000)
{
@@ -177,7 +177,7 @@ READ64_MEMBER(taitopjc_state::video_r)
{
if (ACCESSING_BITS_32_63)
{
- r |= (UINT64)(videochip_r(&space, video_address)) << 32;
+ r |= (UINT64)(videochip_r(space, video_address)) << 32;
}
}
@@ -191,7 +191,7 @@ WRITE64_MEMBER(taitopjc_state::video_w)
if (ACCESSING_BITS_32_63)
{
//printf("Address %08X = %08X\n", video_address, (UINT32)(data >> 32));
- videochip_w(&space, video_address, (UINT32)(data >> 32));
+ videochip_w(space, video_address, (UINT32)(data >> 32));
}
}
if (offset == 1)
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 1f9c13ae93d..1c1f7e246f8 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -709,7 +709,7 @@ DRIVER_INIT_MEMBER(taitowlf_state,taitowlf)
kbdc8042_init(machine(), &at8042);
#if ENABLE_VGA
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
#endif
}
diff --git a/src/mame/drivers/tasman.c b/src/mame/drivers/tasman.c
index 7c37046c0c1..00a5e3c5c68 100644
--- a/src/mame/drivers/tasman.c
+++ b/src/mame/drivers/tasman.c
@@ -137,13 +137,13 @@ WRITE32_MEMBER(kongambl_state::eeprom_w)
static READ32_HANDLER( test_r )
{
- return -1;//space->machine().rand();
+ return -1;//space.machine().rand();
}
/*
static READ32_HANDLER( rng_r )
{
- return space->machine().rand();
+ return space.machine().rand();
}
*/
diff --git a/src/mame/drivers/tcl.c b/src/mame/drivers/tcl.c
index 2664af310ae..b7482bf984e 100644
--- a/src/mame/drivers/tcl.c
+++ b/src/mame/drivers/tcl.c
@@ -189,7 +189,7 @@ DRIVER_INIT_MEMBER(tcl_state,tcl)
{
/* only the first part is decrypted (and verified)*/
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *dest = machine().root_device().memregion("maincpu")->base();
int len = machine().root_device().memregion("maincpu")->bytes();
UINT8 *src = auto_alloc_array(machine(), UINT8, len);
@@ -215,7 +215,7 @@ DRIVER_INIT_MEMBER(tcl_state,tcl)
}
auto_free(machine(), src);
- space->set_decrypted_region(0x0000, 0x7fff, dest+0x10000);
+ space.set_decrypted_region(0x0000, 0x7fff, dest+0x10000);
}
GAME( 1995, tcl, 0, tcl, tcl, tcl_state, tcl, ROT0, "Uniwang", "Taiwan Chess Legend", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/tiamc1.c b/src/mame/drivers/tiamc1.c
index e7aab7be9f1..bb63512628c 100644
--- a/src/mame/drivers/tiamc1.c
+++ b/src/mame/drivers/tiamc1.c
@@ -120,8 +120,8 @@
void tiamc1_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- tiamc1_bankswitch_w(*space, 0, 0);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ tiamc1_bankswitch_w(space, 0, 0);
}
WRITE8_MEMBER(tiamc1_state::tiamc1_control_w)
diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c
index 8106ac20e20..cc3a823be6e 100644
--- a/src/mame/drivers/tickee.c
+++ b/src/mame/drivers/tickee.c
@@ -250,17 +250,17 @@ READ16_MEMBER(tickee_state::rapidfir_transparent_r)
}
-static void rapidfir_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void rapidfir_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- tickee_state *state = space->machine().driver_data<tickee_state>();
+ tickee_state *state = space.machine().driver_data<tickee_state>();
if (address < 0x800000)
memcpy(shiftreg, &state->m_vram[TOWORD(address)], TOBYTE(0x2000));
}
-static void rapidfir_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void rapidfir_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- tickee_state *state = space->machine().driver_data<tickee_state>();
+ tickee_state *state = space.machine().driver_data<tickee_state>();
if (address < 0x800000)
memcpy(&state->m_vram[TOWORD(address)], shiftreg, TOBYTE(0x2000));
}
diff --git a/src/mame/drivers/tigeroad.c b/src/mame/drivers/tigeroad.c
index c889774d138..25a7012ac17 100644
--- a/src/mame/drivers/tigeroad.c
+++ b/src/mame/drivers/tigeroad.c
@@ -79,12 +79,12 @@ static const int f1dream_2450_lookup[32] = {
0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0,
0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0, 0x0003, 0x0080, 0x0006, 0x0060, 0x0000, 0x00e0, 0x000a, 0x00c0 };
-static void f1dream_protection_w(address_space *space)
+static void f1dream_protection_w(address_space &space)
{
- tigeroad_state *state = space->machine().driver_data<tigeroad_state>();
+ tigeroad_state *state = space.machine().driver_data<tigeroad_state>();
int indx;
int value = 255;
- int prevpc = space->device().safe_pcbase();
+ int prevpc = space.device().safe_pcbase();
if (prevpc == 0x244c)
{
@@ -139,14 +139,14 @@ static void f1dream_protection_w(address_space *space)
else if ((prevpc == 0x27f8) || (prevpc == 0x511a) || (prevpc == 0x5142) || (prevpc == 0x516a))
{
/* The main CPU stuffs the byte for the soundlatch into 0xfffffd.*/
- state->soundlatch_byte_w(*space,2,state->m_ram16[0x3ffc/2]);
+ state->soundlatch_byte_w(space,2,state->m_ram16[0x3ffc/2]);
}
}
WRITE16_MEMBER(tigeroad_state::f1dream_control_w)
{
logerror("protection write, PC: %04x FFE1 Value:%01x\n",space.device().safe_pc(), m_ram16[0x3fe0/2]);
- f1dream_protection_w(&space);
+ f1dream_protection_w(space);
}
WRITE16_MEMBER(tigeroad_state::tigeroad_soundcmd_w)
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index 94749f2846a..3d6e984c815 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -773,9 +773,9 @@ INLINE UINT32 tmnt2_get_word( running_machine &machine, UINT32 addr )
return 0;
}
-static void tmnt2_put_word( address_space *space, UINT32 addr, UINT16 data )
+static void tmnt2_put_word( address_space &space, UINT32 addr, UINT16 data )
{
- tmnt_state *state = space->machine().driver_data<tmnt_state>();
+ tmnt_state *state = space.machine().driver_data<tmnt_state>();
UINT32 offs;
if (addr >= 0x180000 / 2 && addr <= 0x183fff / 2)
@@ -785,7 +785,7 @@ static void tmnt2_put_word( address_space *space, UINT32 addr, UINT16 data )
if (!(offs & 0x0031))
{
offs = ((offs & 0x000e) >> 1) | ((offs & 0x1fc0) >> 3);
- k053245_word_w(state->m_k053245, *space, offs, data, 0xffff);
+ k053245_word_w(state->m_k053245, space, offs, data, 0xffff);
}
}
else if (addr >= 0x104000 / 2 && addr <= 0x107fff / 2)
@@ -905,11 +905,11 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w)
xoffs += xmod;
yoffs += ymod;
- tmnt2_put_word(&space, dst_addr + 0, attr1);
- tmnt2_put_word(&space, dst_addr + 2, code);
- tmnt2_put_word(&space, dst_addr + 4, (UINT32)yoffs);
- tmnt2_put_word(&space, dst_addr + 6, (UINT32)xoffs);
- tmnt2_put_word(&space, dst_addr + 12, attr2 | color);
+ tmnt2_put_word(space, dst_addr + 0, attr1);
+ tmnt2_put_word(space, dst_addr + 2, code);
+ tmnt2_put_word(space, dst_addr + 4, (UINT32)yoffs);
+ tmnt2_put_word(space, dst_addr + 6, (UINT32)xoffs);
+ tmnt2_put_word(space, dst_addr + 12, attr2 | color);
}
#else // for reference; do not remove
WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w)
diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c
index 5624f7927e3..a8efe3789ef 100644
--- a/src/mame/drivers/toki.c
+++ b/src/mame/drivers/toki.c
@@ -860,14 +860,14 @@ DRIVER_INIT_MEMBER(toki_state,jujuba)
/* Decrypt data for z80 program */
{
- address_space *space = machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x20000);
UINT8 *rom = machine().root_device().memregion("audiocpu")->base();
int i;
memcpy(decrypt,rom,0x20000);
- space->set_decrypted_region(0x0000, 0x1fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x1fff, decrypt);
for (i = 0;i < 0x2000;i++)
{
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index 882b05bbcff..c8519b735ec 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -1447,7 +1447,7 @@ DRIVER_INIT_MEMBER(trackfld_state,trackfld)
DRIVER_INIT_MEMBER(trackfld_state,atlantol)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *decrypt;
int A;
@@ -1459,16 +1459,16 @@ DRIVER_INIT_MEMBER(trackfld_state,atlantol)
for (A = 0; A < 0x6000; A++)
decrypt[A] = rom[A];
- space->set_decrypted_region(0x0000, 0xffff, decrypt);
+ space.set_decrypted_region(0x0000, 0xffff, decrypt);
- space->install_write_handler(0x0800, 0x0800, write8_delegate(FUNC(trackfld_state::atlantol_gfxbank_w),this));
- space->nop_write(0x1000, 0x1000);
+ space.install_write_handler(0x0800, 0x0800, write8_delegate(FUNC(trackfld_state::atlantol_gfxbank_w),this));
+ space.nop_write(0x1000, 0x1000);
/* unmapped areas read as ROM */
- space->install_read_bank(0x0000, 0x11ff, "bank10");
- space->install_read_bank(0x1380, 0x17ff, "bank11");
- space->install_read_bank(0x2000, 0x27ff, "bank12");
- space->install_read_bank(0x4000, 0x5fff, "bank13");
+ space.install_read_bank(0x0000, 0x11ff, "bank10");
+ space.install_read_bank(0x1380, 0x17ff, "bank11");
+ space.install_read_bank(0x2000, 0x27ff, "bank12");
+ space.install_read_bank(0x4000, 0x5fff, "bank13");
membank("bank10")->set_base(&rom[0x0000]);
membank("bank11")->set_base(&rom[0x1380]);
membank("bank12")->set_base(&rom[0x2000]);
diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c
index 9b5cea50246..9dc327f340a 100644
--- a/src/mame/drivers/trvquest.c
+++ b/src/mame/drivers/trvquest.c
@@ -43,7 +43,7 @@ Notes:
static READ8_HANDLER( trvquest_question_r )
{
- gameplan_state *state = space->machine().driver_data<gameplan_state>();
+ gameplan_state *state = space.machine().driver_data<gameplan_state>();
return state->memregion("questions")->base()[*state->m_trvquest_question * 0x2000 + offset];
}
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 335965f1bc7..113c8130248 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -2207,9 +2207,9 @@ ROM_START( boonggab )
ROM_COPY( "user2", 0x0e0000, 0x1e0000, 0x020000)
ROM_END
-static int irq_active(address_space *space)
+static int irq_active(address_space &space)
{
- UINT32 FCR = space->device().state().state_int(27);
+ UINT32 FCR = space.device().state().state_int(27);
if( !(FCR&(1<<29)) ) // int 2 (irq 4)
return 1;
else
@@ -2220,7 +2220,7 @@ READ16_MEMBER(vamphalf_state::vamphalf_speedup_r)
{
if(space.device().safe_pc() == 0x82de)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2233,7 +2233,7 @@ READ16_MEMBER(vamphalf_state::vamphafk_speedup_r)
{
if(space.device().safe_pc() == 0x82de)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2246,7 +2246,7 @@ READ16_MEMBER(vamphalf_state::misncrft_speedup_r)
{
if(space.device().safe_pc() == 0xecc8)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2259,7 +2259,7 @@ READ16_MEMBER(vamphalf_state::coolmini_speedup_r)
{
if(space.device().safe_pc() == 0x75f7a)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2272,7 +2272,7 @@ READ16_MEMBER(vamphalf_state::suplup_speedup_r)
{
if(space.device().safe_pc() == 0xaf18a )
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2285,7 +2285,7 @@ READ16_MEMBER(vamphalf_state::luplup_speedup_r)
{
if(space.device().safe_pc() == 0xaefac )
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2298,7 +2298,7 @@ READ16_MEMBER(vamphalf_state::luplup29_speedup_r)
{
if(space.device().safe_pc() == 0xae6c0 )
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2311,7 +2311,7 @@ READ16_MEMBER(vamphalf_state::puzlbang_speedup_r)
{
if(space.device().safe_pc() == 0xae6d2 )
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2326,7 +2326,7 @@ READ32_MEMBER(vamphalf_state::wyvernwg_speedup_r)
if(pc == 0x10758)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2341,7 +2341,7 @@ READ32_MEMBER(vamphalf_state::wyvernwga_speedup_r)
if(pc == 0x10758)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2356,7 +2356,7 @@ READ32_MEMBER(vamphalf_state::finalgdr_speedup_r)
{
if(space.device().safe_pc() == 0x1c212)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2370,7 +2370,7 @@ READ32_MEMBER(vamphalf_state::mrkicker_speedup_r)
UINT32 pc = space.device().safe_pc();
if(pc == 0x469de || pc == 0x46a36)
{
-// if(irq_active(&space))
+// if(irq_active(space))
// space.device().execute().spin_until_interrupt();
// else
space.device().execute().eat_cycles(50);
@@ -2384,7 +2384,7 @@ READ16_MEMBER(vamphalf_state::dquizgo2_speedup_r)
{
if(space.device().safe_pc() == 0xaa622)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2412,7 +2412,7 @@ READ16_MEMBER(vamphalf_state::jmpbreak_speedup_r)
{
if(space.device().safe_pc() == 0x983c)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2425,7 +2425,7 @@ READ16_MEMBER(vamphalf_state::mrdig_speedup_r)
{
if(space.device().safe_pc() == 0x1710)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
else
space.device().execute().eat_cycles(50);
@@ -2460,7 +2460,7 @@ READ16_MEMBER(vamphalf_state::boonggab_speedup_r)
{
if(space.device().safe_pc() == 0x13198)
{
- if(irq_active(&space))
+ if(irq_active(space))
space.device().execute().spin_until_interrupt();
}
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 5aac4f32f14..42f74d818bf 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -446,11 +446,11 @@ DRIVER_INIT_MEMBER(vcombat_state,vcombat)
UINT8 *ROM = memregion("maincpu")->base();
/* The two i860s execute out of RAM */
- address_space *space = machine().device<i860_device>("vid_0")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this));
+ address_space &v0space = *machine().device<i860_device>("vid_0")->space(AS_PROGRAM);
+ v0space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this));
- space = machine().device<i860_device>("vid_1")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_1_direct_handler), this));
+ address_space &v1space = *machine().device<i860_device>("vid_1")->space(AS_PROGRAM);
+ v1space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_1_direct_handler), this));
/* Allocate the 68000 framebuffers */
m_m68k_framebuffer[0] = auto_alloc_array(machine(), UINT16, 0x8000);
@@ -493,8 +493,8 @@ DRIVER_INIT_MEMBER(vcombat_state,shadfgtr)
m_i860_framebuffer[1][1] = NULL;
/* The i860 executes out of RAM */
- address_space *space = machine().device<i860_device>("vid_0")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this));
+ address_space &space = *machine().device<i860_device>("vid_0")->space(AS_PROGRAM);
+ space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this));
}
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c
index 0d219df9fa0..9f6b41831f8 100644
--- a/src/mame/drivers/vega.c
+++ b/src/mame/drivers/vega.c
@@ -297,7 +297,7 @@ READ8_MEMBER(vega_state::extern_r)
{
/* AY 3-8910 */
ay8910_data_w(m_ay8910, space, 0, offset);
- return 0xff;//mame_rand(space->machine);
+ return 0xff;//mame_rand(space.machine);
}
break;
diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c
index b474642df7a..509ff998828 100644
--- a/src/mame/drivers/vegaeo.c
+++ b/src/mame/drivers/vegaeo.c
@@ -127,7 +127,7 @@ WRITE32_MEMBER(vegaeo_state::vega_misc_w)
READ32_MEMBER(vegaeo_state::vegaeo_custom_read)
{
- eolith_speedup_read(&space);
+ eolith_speedup_read(space);
return ioport("SYSTEM")->read();
}
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index 870027d4800..50c3b7b5585 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -608,14 +608,14 @@ void vegas_state::machine_reset()
static WRITE32_HANDLER( cmos_unlock_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
state->m_cmos_unlocked = 1;
}
static WRITE32_HANDLER( timekeeper_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
if (state->m_cmos_unlocked)
{
if ((mem_mask & 0x000000ff) != 0)
@@ -631,13 +631,13 @@ static WRITE32_HANDLER( timekeeper_w )
state->m_cmos_unlocked = 0;
}
else
- logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", space->device().safe_pc(), offset, data, mem_mask);
+ logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", space.device().safe_pc(), offset, data, mem_mask);
}
static READ32_HANDLER( timekeeper_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
UINT32 result = 0xffffffff;
if ((mem_mask & 0x000000ff) != 0)
result = (result & ~0x000000ff) | (state->m_timekeeper->read(offset * 4 + 0) << 0);
@@ -662,7 +662,7 @@ static READ32_HANDLER( timekeeper_r )
static READ32_HANDLER( pci_bridge_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
UINT32 result = state->m_pci_bridge_regs[offset];
switch (offset)
@@ -677,17 +677,17 @@ static READ32_HANDLER( pci_bridge_r )
}
if (LOG_PCI)
- logerror("%06X:PCI bridge read: reg %d = %08X\n", space->device().safe_pc(), offset, result);
+ logerror("%06X:PCI bridge read: reg %d = %08X\n", space.device().safe_pc(), offset, result);
return result;
}
static WRITE32_HANDLER( pci_bridge_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
state->m_pci_bridge_regs[offset] = data;
if (LOG_PCI)
- logerror("%06X:PCI bridge write: reg %d = %08X\n", space->device().safe_pc(), offset, data);
+ logerror("%06X:PCI bridge write: reg %d = %08X\n", space.device().safe_pc(), offset, data);
}
@@ -700,7 +700,7 @@ static WRITE32_HANDLER( pci_bridge_w )
static READ32_HANDLER( pci_ide_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
UINT32 result = state->m_pci_ide_regs[offset];
switch (offset)
@@ -717,40 +717,40 @@ static READ32_HANDLER( pci_ide_r )
}
if (LOG_PCI)
- logerror("%06X:PCI IDE read: reg %d = %08X\n", space->device().safe_pc(), offset, result);
+ logerror("%06X:PCI IDE read: reg %d = %08X\n", space.device().safe_pc(), offset, result);
return result;
}
static WRITE32_HANDLER( pci_ide_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
state->m_pci_ide_regs[offset] = data;
switch (offset)
{
case 0x04: /* address register */
state->m_pci_ide_regs[offset] &= 0xfffffff0;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
break;
case 0x05: /* address register */
state->m_pci_ide_regs[offset] &= 0xfffffffc;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
break;
case 0x08: /* address register */
state->m_pci_ide_regs[offset] &= 0xfffffff0;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
break;
case 0x14: /* interrupt pending */
if (data & 4)
- ide_interrupt(space->machine().device("ide"), 0);
+ ide_interrupt(space.machine().device("ide"), 0);
break;
}
if (LOG_PCI)
- logerror("%06X:PCI IDE write: reg %d = %08X\n", space->device().safe_pc(), offset, data);
+ logerror("%06X:PCI IDE write: reg %d = %08X\n", space.device().safe_pc(), offset, data);
}
@@ -763,7 +763,7 @@ static WRITE32_HANDLER( pci_ide_w )
static READ32_HANDLER( pci_3dfx_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
int voodoo_type = voodoo_get_type(state->m_voodoo);
UINT32 result = state->m_pci_3dfx_regs[offset];
@@ -790,14 +790,14 @@ static READ32_HANDLER( pci_3dfx_r )
}
if (LOG_PCI)
- logerror("%06X:PCI 3dfx read: reg %d = %08X\n", space->device().safe_pc(), offset, result);
+ logerror("%06X:PCI 3dfx read: reg %d = %08X\n", space.device().safe_pc(), offset, result);
return result;
}
static WRITE32_HANDLER( pci_3dfx_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
int voodoo_type = voodoo_get_type(state->m_voodoo);
state->m_pci_3dfx_regs[offset] = data;
@@ -809,14 +809,14 @@ static WRITE32_HANDLER( pci_3dfx_w )
state->m_pci_3dfx_regs[offset] &= 0xff000000;
else
state->m_pci_3dfx_regs[offset] &= 0xfe000000;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
break;
case 0x05: /* address register */
if (voodoo_type >= TYPE_VOODOO_BANSHEE)
{
state->m_pci_3dfx_regs[offset] &= 0xfe000000;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
}
break;
@@ -824,7 +824,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
if (voodoo_type >= TYPE_VOODOO_BANSHEE)
{
state->m_pci_3dfx_regs[offset] &= 0xffffff00;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
}
break;
@@ -832,7 +832,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
if (voodoo_type >= TYPE_VOODOO_BANSHEE)
{
state->m_pci_3dfx_regs[offset] &= 0xffff0000;
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
}
break;
@@ -842,7 +842,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
}
if (LOG_PCI)
- logerror("%06X:PCI 3dfx write: reg %d = %08X\n", space->device().safe_pc(), offset, data);
+ logerror("%06X:PCI 3dfx write: reg %d = %08X\n", space.device().safe_pc(), offset, data);
}
@@ -953,7 +953,7 @@ static TIMER_CALLBACK( nile_timer_callback )
static READ32_HANDLER( nile_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
UINT32 result = state->m_nile_regs[offset];
int logit = 1, which;
@@ -961,37 +961,37 @@ static READ32_HANDLER( nile_r )
{
case NREG_CPUSTAT+0: /* CPU status */
case NREG_CPUSTAT+1: /* CPU status */
- if (LOG_NILE) logerror("%08X:NILE READ: CPU status(%03X) = %08X\n", space->device().safe_pc(), offset*4, result);
+ if (LOG_NILE) logerror("%08X:NILE READ: CPU status(%03X) = %08X\n", space.device().safe_pc(), offset*4, result);
logit = 0;
break;
case NREG_INTCTRL+0: /* Interrupt control */
case NREG_INTCTRL+1: /* Interrupt control */
- if (LOG_NILE) logerror("%08X:NILE READ: interrupt control(%03X) = %08X\n", space->device().safe_pc(), offset*4, result);
+ if (LOG_NILE) logerror("%08X:NILE READ: interrupt control(%03X) = %08X\n", space.device().safe_pc(), offset*4, result);
logit = 0;
break;
case NREG_INTSTAT0+0: /* Interrupt status 0 */
case NREG_INTSTAT0+1: /* Interrupt status 0 */
- if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 0(%03X) = %08X\n", space->device().safe_pc(), offset*4, result);
+ if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 0(%03X) = %08X\n", space.device().safe_pc(), offset*4, result);
logit = 0;
break;
case NREG_INTSTAT1+0: /* Interrupt status 1 */
case NREG_INTSTAT1+1: /* Interrupt status 1 */
- if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 1/enable(%03X) = %08X\n", space->device().safe_pc(), offset*4, result);
+ if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 1/enable(%03X) = %08X\n", space.device().safe_pc(), offset*4, result);
logit = 0;
break;
case NREG_INTCLR+0: /* Interrupt clear */
case NREG_INTCLR+1: /* Interrupt clear */
- if (LOG_NILE) logerror("%08X:NILE READ: interrupt clear(%03X) = %08X\n", space->device().safe_pc(), offset*4, result);
+ if (LOG_NILE) logerror("%08X:NILE READ: interrupt clear(%03X) = %08X\n", space.device().safe_pc(), offset*4, result);
logit = 0;
break;
case NREG_INTPPES+0: /* PCI Interrupt control */
case NREG_INTPPES+1: /* PCI Interrupt control */
- if (LOG_NILE) logerror("%08X:NILE READ: PCI interrupt control(%03X) = %08X\n", space->device().safe_pc(), offset*4, result);
+ if (LOG_NILE) logerror("%08X:NILE READ: PCI interrupt control(%03X) = %08X\n", space.device().safe_pc(), offset*4, result);
logit = 0;
break;
@@ -1018,7 +1018,7 @@ static READ32_HANDLER( nile_r )
result = state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK;
}
- if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", space->device().safe_pc(), which, offset*4, result);
+ if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", space.device().safe_pc(), which, offset*4, result);
logit = 0;
break;
@@ -1059,14 +1059,14 @@ static READ32_HANDLER( nile_r )
}
if (LOG_NILE && logit)
- logerror("%06X:nile read from offset %03X = %08X\n", space->device().safe_pc(), offset*4, result);
+ logerror("%06X:nile read from offset %03X = %08X\n", space.device().safe_pc(), offset*4, result);
return result;
}
static WRITE32_HANDLER( nile_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
UINT32 olddata = state->m_nile_regs[offset];
int logit = 1, which;
@@ -1076,42 +1076,42 @@ static WRITE32_HANDLER( nile_w )
{
case NREG_CPUSTAT+0: /* CPU status */
case NREG_CPUSTAT+1: /* CPU status */
- if (LOG_NILE) logerror("%08X:NILE WRITE: CPU status(%03X) = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: CPU status(%03X) = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
logit = 0;
break;
case NREG_INTCTRL+0: /* Interrupt control */
case NREG_INTCTRL+1: /* Interrupt control */
- if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
logit = 0;
- update_nile_irqs(space->machine());
+ update_nile_irqs(space.machine());
break;
case NREG_INTSTAT0+0: /* Interrupt status 0 */
case NREG_INTSTAT0+1: /* Interrupt status 0 */
- if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
logit = 0;
- update_nile_irqs(space->machine());
+ update_nile_irqs(space.machine());
break;
case NREG_INTSTAT1+0: /* Interrupt status 1 */
case NREG_INTSTAT1+1: /* Interrupt status 1 */
- if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
logit = 0;
- update_nile_irqs(space->machine());
+ update_nile_irqs(space.machine());
break;
case NREG_INTCLR+0: /* Interrupt clear */
case NREG_INTCLR+1: /* Interrupt clear */
- if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
logit = 0;
state->m_nile_irq_state &= ~(state->m_nile_regs[offset] & ~0xf00);
- update_nile_irqs(space->machine());
+ update_nile_irqs(space.machine());
break;
case NREG_INTPPES+0: /* PCI Interrupt control */
case NREG_INTPPES+1: /* PCI Interrupt control */
- if (LOG_NILE) logerror("%08X:NILE WRITE: PCI interrupt control(%03X) = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: PCI interrupt control(%03X) = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
logit = 0;
break;
@@ -1127,7 +1127,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_PCIINIT1+0: /* PCI master */
if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs[offset] & 0xe) == 0xa))
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
logit = 0;
break;
@@ -1136,7 +1136,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_T2CTRL+1: /* general purpose timer control (control bits) */
case NREG_T3CTRL+1: /* watchdog timer control (control bits) */
which = (offset - NREG_T0CTRL) / 4;
- if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", space->device().safe_pc(), which, offset*4, data, mem_mask);
+ if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", space.device().safe_pc(), which, offset*4, data, mem_mask);
logit = 0;
/* timer just enabled? */
@@ -1165,7 +1165,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_T2CNTR: /* general purpose timer control (counter) */
case NREG_T3CNTR: /* watchdog timer control (counter) */
which = (offset - NREG_T0CTRL) / 4;
- if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", space->device().safe_pc(), which, offset*4, data, mem_mask);
+ if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", space.device().safe_pc(), which, offset*4, data, mem_mask);
logit = 0;
if (state->m_nile_regs[offset - 1] & 1)
@@ -1181,7 +1181,7 @@ static WRITE32_HANDLER( nile_w )
logit = 0;
break;
case NREG_UARTIER: /* serial interrupt enable */
- update_nile_irqs(space->machine());
+ update_nile_irqs(space.machine());
break;
case NREG_VID:
@@ -1215,12 +1215,12 @@ static WRITE32_HANDLER( nile_w )
case NREG_DCS8:
case NREG_PCIW0:
case NREG_PCIW1:
- remap_dynamic_addresses(space->machine());
+ remap_dynamic_addresses(space.machine());
break;
}
if (LOG_NILE && logit)
- logerror("%06X:nile write to offset %03X = %08X & %08X\n", space->device().safe_pc(), offset*4, data, mem_mask);
+ logerror("%06X:nile write to offset %03X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
@@ -1303,14 +1303,14 @@ static void ethernet_interrupt(device_t *device, int state)
static READ32_HANDLER( sio_irq_clear_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
return state->m_sio_irq_clear;
}
static WRITE32_HANDLER( sio_irq_clear_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7)
{
state->m_sio_irq_clear = data;
@@ -1318,15 +1318,15 @@ static WRITE32_HANDLER( sio_irq_clear_w )
/* bit 0x01 seems to be used to reset the IOASIC */
if (!(data & 0x01))
{
- midway_ioasic_reset(space->machine());
- dcs_reset_w(space->machine(), data & 0x01);
+ midway_ioasic_reset(space.machine());
+ dcs_reset_w(space.machine(), data & 0x01);
}
/* they toggle bit 0x08 low to reset the VBLANK */
if (!(data & 0x08))
{
state->m_sio_irq_state &= ~0x20;
- update_sio_irqs(space->machine());
+ update_sio_irqs(space.machine());
}
}
}
@@ -1334,39 +1334,39 @@ static WRITE32_HANDLER( sio_irq_clear_w )
static READ32_HANDLER( sio_irq_enable_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
return state->m_sio_irq_enable;
}
static WRITE32_HANDLER( sio_irq_enable_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7)
{
state->m_sio_irq_enable = data;
- update_sio_irqs(space->machine());
+ update_sio_irqs(space.machine());
}
}
static READ32_HANDLER( sio_irq_cause_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
return state->m_sio_irq_state & state->m_sio_irq_enable;
}
static READ32_HANDLER( sio_irq_status_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
return state->m_sio_irq_state;
}
static WRITE32_HANDLER( sio_led_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7)
state->m_sio_led_state = data;
}
@@ -1374,7 +1374,7 @@ static WRITE32_HANDLER( sio_led_w )
static READ32_HANDLER( sio_led_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
return state->m_sio_led_state;
}
@@ -1388,13 +1388,13 @@ static READ32_HANDLER( sio_led_r )
static WRITE32_HANDLER( sio_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7) offset += 0;
if (ACCESSING_BITS_8_15) offset += 1;
if (ACCESSING_BITS_16_23) offset += 2;
if (ACCESSING_BITS_24_31) offset += 3;
if (LOG_SIO && offset != 0)
- logerror("%08X:sio write to offset %X = %02X\n", space->device().safe_pc(), offset, data >> (offset*8));
+ logerror("%08X:sio write to offset %X = %02X\n", space.device().safe_pc(), offset, data >> (offset*8));
if (offset < 4)
state->m_sio_data[offset] = data >> (offset*8);
if (offset == 1)
@@ -1404,7 +1404,7 @@ static WRITE32_HANDLER( sio_w )
static READ32_HANDLER( sio_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
UINT32 result = 0;
if (ACCESSING_BITS_0_7) offset += 0;
if (ACCESSING_BITS_8_15) offset += 1;
@@ -1413,7 +1413,7 @@ static READ32_HANDLER( sio_r )
if (offset < 4)
result = state->m_sio_data[0] | (state->m_sio_data[1] << 8) | (state->m_sio_data[2] << 16) | (state->m_sio_data[3] << 24);
if (LOG_SIO && offset != 2)
- logerror("%08X:sio read from offset %X = %02X\n", space->device().safe_pc(), offset, result >> (offset*8));
+ logerror("%08X:sio read from offset %X = %02X\n", space.device().safe_pc(), offset, result >> (offset*8));
return result;
}
@@ -1427,18 +1427,18 @@ static READ32_HANDLER( sio_r )
static READ32_HANDLER( analog_port_r )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
return state->m_pending_analog_read;
}
static WRITE32_HANDLER( analog_port_w )
{
- vegas_state *state = space->machine().driver_data<vegas_state>();
+ vegas_state *state = space.machine().driver_data<vegas_state>();
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
if (data < 8 || data > 15)
- logerror("%08X:Unexpected analog port select = %08X\n", space->device().safe_pc(), data);
+ logerror("%08X:Unexpected analog port select = %08X\n", space.device().safe_pc(), data);
state->m_pending_analog_read = state->ioport(portnames[data & 7])->read_safe(0);
}
@@ -1452,13 +1452,13 @@ static WRITE32_HANDLER( analog_port_w )
static WRITE32_HANDLER( vegas_watchdog_w )
{
- space->device().execute().eat_cycles(100);
+ space.device().execute().eat_cycles(100);
}
static WRITE32_HANDLER( asic_fifo_w )
{
- midway_ioasic_fifo_w(space->machine(), data);
+ midway_ioasic_fifo_w(space.machine(), data);
}
@@ -1508,7 +1508,7 @@ static WRITE32_DEVICE_HANDLER( ethernet_w )
static WRITE32_HANDLER( dcs3_fifo_full_w )
{
- midway_ioasic_fifo_full_w(space->machine(), data);
+ midway_ioasic_fifo_full_w(space.machine(), data);
}
@@ -1681,21 +1681,20 @@ static void remap_dynamic_addresses(running_machine &machine)
/* now remap everything */
if (LOG_DYNAMIC) logerror("remap_dynamic_addresses:\n");
- address_space *space = const_cast<address_space *>(machine.device<cpu_device>("maincpu")->space(AS_PROGRAM));
- assert(space != NULL);
+ address_space &space = *machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for (addr = 0; addr < state->m_dynamic_count; addr++)
{
if (LOG_DYNAMIC) logerror(" installing: %08X-%08X %s,%s\n", dynamic[addr].start, dynamic[addr].end, dynamic[addr].rdname, dynamic[addr].wrname);
if (dynamic[addr].mread == NOP_HANDLER)
- machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(dynamic[addr].start, dynamic[addr].end);
+ space.nop_read(dynamic[addr].start, dynamic[addr].end);
else if (dynamic[addr].mread != NULL)
- space->install_legacy_read_handler(dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mread, dynamic[addr].rdname);
+ space.install_legacy_read_handler(dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mread, dynamic[addr].rdname);
if (dynamic[addr].mwrite != NULL)
- space->install_legacy_write_handler(dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mwrite, dynamic[addr].wrname);
+ space.install_legacy_write_handler(dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mwrite, dynamic[addr].wrname);
if (dynamic[addr].dread != NULL || dynamic[addr].dwrite != NULL)
- space->install_legacy_readwrite_handler(*dynamic[addr].device, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].dread, dynamic[addr].rdname, dynamic[addr].dwrite, dynamic[addr].wrname);
+ space.install_legacy_readwrite_handler(*dynamic[addr].device, dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].dread, dynamic[addr].rdname, dynamic[addr].dwrite, dynamic[addr].wrname);
}
if (LOG_DYNAMIC)
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index 794e96c256d..dc24040f873 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -164,19 +164,19 @@ WRITE8_MEMBER(vendetta_state::vendetta_K052109_w)
static void vendetta_video_banking( running_machine &machine, int select )
{
vendetta_state *state = machine.driver_data<vendetta_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (select & 1)
{
- space->install_read_bank(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, "bank4" );
- space->install_write_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, write8_delegate(FUNC(vendetta_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state) );
- space->install_legacy_readwrite_handler(*state->m_k053246, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k053247_r), FUNC(k053247_w) );
+ space.install_read_bank(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, "bank4" );
+ space.install_write_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, write8_delegate(FUNC(vendetta_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state) );
+ space.install_legacy_readwrite_handler(*state->m_k053246, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k053247_r), FUNC(k053247_w) );
state->membank("bank4")->set_base(state->m_generic_paletteram_8);
}
else
{
- space->install_readwrite_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, read8_delegate(FUNC(vendetta_state::vendetta_K052109_r),state), write8_delegate(FUNC(vendetta_state::vendetta_K052109_w),state) );
- space->install_legacy_readwrite_handler(*state->m_k052109, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k052109_r), FUNC(k052109_w) );
+ space.install_readwrite_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, read8_delegate(FUNC(vendetta_state::vendetta_K052109_r),state), write8_delegate(FUNC(vendetta_state::vendetta_K052109_w),state) );
+ space.install_legacy_readwrite_handler(*state->m_k052109, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k052109_r), FUNC(k052109_w) );
}
}
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index f706548208d..36a7d0209bb 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -243,7 +243,7 @@ READ8_MEMBER(vicdual_state::depthch_io_r)
WRITE8_MEMBER(vicdual_state::depthch_io_w)
{
if (offset & 0x01) assert_coin_status(machine());
- if (offset & 0x04) depthch_audio_w(&space, 0, data);
+ if (offset & 0x04) depthch_audio_w(space, 0, data);
}
@@ -409,7 +409,7 @@ READ8_MEMBER(vicdual_state::frogs_io_r)
WRITE8_MEMBER(vicdual_state::frogs_io_w)
{
if (offset & 0x01) assert_coin_status(machine());
- if (offset & 0x02) frogs_audio_w(&space, 0, data);
+ if (offset & 0x02) frogs_audio_w(space, 0, data);
}
@@ -529,7 +529,7 @@ READ8_MEMBER(vicdual_state::sspaceat_io_r)
WRITE8_MEMBER(vicdual_state::headon_io_w)
{
if (offset & 0x01) assert_coin_status(machine());
- if (offset & 0x02) headon_audio_w(&space, 0, data);
+ if (offset & 0x02) headon_audio_w(space, 0, data);
if (offset & 0x04) { /* vicdual_palette_bank_w(0, data) */ } /* not written to */
}
@@ -730,7 +730,7 @@ READ8_MEMBER(vicdual_state::headon2_io_r)
WRITE8_MEMBER(vicdual_state::headon2_io_w)
{
if (offset & 0x01) assert_coin_status(machine());
- if (offset & 0x02) headon_audio_w(&space, 0, data);
+ if (offset & 0x02) headon_audio_w(space, 0, data);
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
if (offset & 0x08) { /* schematics show this as going into a shifer circuit, but never written to */ }
if (offset & 0x10) { /* schematics show this as going to an edge connector, but never written to */ }
@@ -943,8 +943,8 @@ MACHINE_CONFIG_END
WRITE8_MEMBER(vicdual_state::invho2_io_w)
{
- if (offset & 0x01) invho2_audio_w(&space, 0, data);
- if (offset & 0x02) invinco_audio_w(&space, 0, data);
+ if (offset & 0x01) invho2_audio_w(space, 0, data);
+ if (offset & 0x02) invinco_audio_w(space, 0, data);
if (offset & 0x08) assert_coin_status(machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -952,7 +952,7 @@ WRITE8_MEMBER(vicdual_state::invho2_io_w)
WRITE8_MEMBER(vicdual_state::invds_io_w)
{
- if (offset & 0x01) invinco_audio_w(&space, 0, data);
+ if (offset & 0x01) invinco_audio_w(space, 0, data);
if (offset & 0x02) { /* deepscan_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status(machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
@@ -961,8 +961,8 @@ WRITE8_MEMBER(vicdual_state::invds_io_w)
WRITE8_MEMBER(vicdual_state::sspacaho_io_w)
{
- if (offset & 0x01) invho2_audio_w(&space, 0, data);
- if (offset & 0x02) { /* s&spaceatt_audio_w(&space, 0, data) */ }
+ if (offset & 0x01) invho2_audio_w(space, 0, data);
+ if (offset & 0x02) { /* s&spaceatt_audio_w(space, 0, data) */ }
if (offset & 0x08) assert_coin_status(machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -970,7 +970,7 @@ WRITE8_MEMBER(vicdual_state::sspacaho_io_w)
WRITE8_MEMBER(vicdual_state::tranqgun_io_w)
{
- if (offset & 0x01) { /* tranqgun_audio_w(&space, 0, data) */ }
+ if (offset & 0x01) { /* tranqgun_audio_w(space, 0, data) */ }
if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
if (offset & 0x08) assert_coin_status(machine());
}
@@ -978,8 +978,8 @@ WRITE8_MEMBER(vicdual_state::tranqgun_io_w)
WRITE8_MEMBER(vicdual_state::spacetrk_io_w)
{
- if (offset & 0x01) { /* &spacetrk_audio_w(&space, 0, data) */ }
- if (offset & 0x02) { /* &spacetrk_audio_w(&space, 0, data) */ }
+ if (offset & 0x01) { /* &spacetrk_audio_w(space, 0, data) */ }
+ if (offset & 0x02) { /* &spacetrk_audio_w(space, 0, data) */ }
if (offset & 0x08) assert_coin_status(machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -987,8 +987,8 @@ WRITE8_MEMBER(vicdual_state::spacetrk_io_w)
WRITE8_MEMBER(vicdual_state::carnival_io_w)
{
- if (offset & 0x01) carnival_audio_1_w(&space, 0, data);
- if (offset & 0x02) carnival_audio_2_w(&space, 0, data);
+ if (offset & 0x01) carnival_audio_1_w(space, 0, data);
+ if (offset & 0x02) carnival_audio_2_w(space, 0, data);
if (offset & 0x08) assert_coin_status(machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -996,7 +996,7 @@ WRITE8_MEMBER(vicdual_state::carnival_io_w)
WRITE8_MEMBER(vicdual_state::brdrline_io_w)
{
- if (offset & 0x01) { /* brdrline_audio_w(&space, 0, data) */ }
+ if (offset & 0x01) { /* brdrline_audio_w(space, 0, data) */ }
if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
if (offset & 0x08) assert_coin_status(machine());
}
@@ -1004,8 +1004,8 @@ WRITE8_MEMBER(vicdual_state::brdrline_io_w)
WRITE8_MEMBER(vicdual_state::pulsar_io_w)
{
- if (offset & 0x01) pulsar_audio_1_w(&space, 0, data);
- if (offset & 0x02) pulsar_audio_2_w(&space, 0, data);
+ if (offset & 0x01) pulsar_audio_1_w(space, 0, data);
+ if (offset & 0x02) pulsar_audio_2_w(space, 0, data);
if (offset & 0x08) assert_coin_status(machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -2273,7 +2273,7 @@ READ8_MEMBER(vicdual_state::invinco_io_r)
WRITE8_MEMBER(vicdual_state::invinco_io_w)
{
if (offset & 0x01) assert_coin_status(machine());
- if (offset & 0x02) invinco_audio_w(&space, 0, data);
+ if (offset & 0x02) invinco_audio_w(space, 0, data);
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
}
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index ea29930b93f..0d2c5e3aa93 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -1132,11 +1132,11 @@ WRITE32_MEMBER(viper_state::epic_w)
/*
READ64_MEMBER(viper_state::epic_64be_r)
{
- return read64be_with_32le_handler(epic_r, &space, offset, mem_mask);
+ return read64be_with_32le_handler(epic_r, space, offset, mem_mask);
}
WRITE64_MEMBER(viper_state::epic_64be_w)
{
- write64be_with_32le_handler(epic_w, &space, offset, data, mem_mask);
+ write64be_with_32le_handler(epic_w, space, offset, data, mem_mask);
}
*/
diff --git a/src/mame/drivers/voyager.c b/src/mame/drivers/voyager.c
index bee83776fc1..59cbcf1910c 100644
--- a/src/mame/drivers/voyager.c
+++ b/src/mame/drivers/voyager.c
@@ -801,7 +801,7 @@ DRIVER_INIT_MEMBER(voyager_state,voyager)
m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4);
pc_vga_init(machine(), vga_setting, NULL);
- pc_svga_trident_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_svga_trident_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, voyager_set_keyb_int);
intel82439tx_init(machine());
diff --git a/src/mame/drivers/vsnes.c b/src/mame/drivers/vsnes.c
index 39a1a474d89..49a94c66dfd 100644
--- a/src/mame/drivers/vsnes.c
+++ b/src/mame/drivers/vsnes.c
@@ -153,14 +153,14 @@ WRITE8_MEMBER(vsnes_state::sprite_dma_0_w)
{
int source = ( data & 7 );
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu1");
- ppu->spriteram_dma( &space, source );
+ ppu->spriteram_dma( space, source );
}
WRITE8_MEMBER(vsnes_state::sprite_dma_1_w)
{
int source = ( data & 7 );
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu2");
- ppu->spriteram_dma( &space, source );
+ ppu->spriteram_dma( space, source );
}
WRITE8_MEMBER(vsnes_state::vsnes_coin_counter_w)
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index bb0765f749c..84a45416b8c 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -519,23 +519,23 @@ static ADDRESS_MAP_START( defender_map, AS_PROGRAM, 8, williams_state )
ADDRESS_MAP_END
-void defender_install_io_space(address_space *space)
+void defender_install_io_space(address_space &space)
{
- williams_state *state = space->machine().driver_data<williams_state>();
- pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1");
+ williams_state *state = space.machine().driver_data<williams_state>();
+ pia6821_device *pia_0 = space.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = space.machine().device<pia6821_device>("pia_1");
/* this routine dynamically installs the memory mapped above from c000-cfff */
- space->install_write_bank (0xc000, 0xc00f, 0, 0x03e0, "bank4");
- space->install_write_handler (0xc010, 0xc01f, 0, 0x03e0, write8_delegate(FUNC(williams_state::defender_video_control_w),state));
- space->install_write_handler (0xc3ff, 0xc3ff, write8_delegate(FUNC(williams_state::williams_watchdog_reset_w),state));
- space->install_read_bank(0xc400, 0xc4ff, 0, 0x0300, "bank3");
- space->install_write_handler(0xc400, 0xc4ff, 0, 0x0300, write8_delegate(FUNC(williams_state::williams_cmos_w),state));
- space->install_read_handler (0xc800, 0xcbff, 0, 0x03e0, read8_delegate(FUNC(williams_state::williams_video_counter_r),state));
- space->install_readwrite_handler(0xcc00, 0xcc03, 0, 0x03e0, read8_delegate(FUNC(pia6821_device::read), pia_1), write8_delegate(FUNC(pia6821_device::write), pia_1));
- space->install_readwrite_handler(0xcc04, 0xcc07, 0, 0x03e0, read8_delegate(FUNC(pia6821_device::read), pia_0), write8_delegate(FUNC(pia6821_device::write), pia_0));
- state->membank("bank3")->set_base(space->machine().driver_data<williams_state>()->m_nvram);
- state->membank("bank4")->set_base(space->machine().driver_data<williams_state>()->m_generic_paletteram_8);
+ space.install_write_bank (0xc000, 0xc00f, 0, 0x03e0, "bank4");
+ space.install_write_handler (0xc010, 0xc01f, 0, 0x03e0, write8_delegate(FUNC(williams_state::defender_video_control_w),state));
+ space.install_write_handler (0xc3ff, 0xc3ff, write8_delegate(FUNC(williams_state::williams_watchdog_reset_w),state));
+ space.install_read_bank(0xc400, 0xc4ff, 0, 0x0300, "bank3");
+ space.install_write_handler(0xc400, 0xc4ff, 0, 0x0300, write8_delegate(FUNC(williams_state::williams_cmos_w),state));
+ space.install_read_handler (0xc800, 0xcbff, 0, 0x03e0, read8_delegate(FUNC(williams_state::williams_video_counter_r),state));
+ space.install_readwrite_handler(0xcc00, 0xcc03, 0, 0x03e0, read8_delegate(FUNC(pia6821_device::read), pia_1), write8_delegate(FUNC(pia6821_device::write), pia_1));
+ space.install_readwrite_handler(0xcc04, 0xcc07, 0, 0x03e0, read8_delegate(FUNC(pia6821_device::read), pia_0), write8_delegate(FUNC(pia6821_device::write), pia_0));
+ state->membank("bank3")->set_base(space.machine().driver_data<williams_state>()->m_nvram);
+ state->membank("bank4")->set_base(space.machine().driver_data<williams_state>()->m_generic_paletteram_8);
}
diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c
index 5019c97b542..074f9f55b54 100644
--- a/src/mame/drivers/wiz.c
+++ b/src/mame/drivers/wiz.c
@@ -1059,14 +1059,14 @@ DRIVER_INIT_MEMBER(wiz_state,stinger)
{ 5,3,7, 0x80 },
{ 5,7,3, 0x28 }
};
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
int size = machine().root_device().memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
int A;
const UINT8 *tbl;
- space->set_decrypted_region(0x0000, 0xffff, decrypt);
+ space.set_decrypted_region(0x0000, 0xffff, decrypt);
for (A = 0x0000;A < 0x10000;A++)
{
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index 44e62edb9bb..766b58203bf 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -89,27 +89,27 @@ static void xtheball_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap
*
*************************************/
-static void xtheball_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void xtheball_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- xtheball_state *state = space->machine().driver_data<xtheball_state>();
+ xtheball_state *state = space.machine().driver_data<xtheball_state>();
if (address >= 0x01000000 && address <= 0x010fffff)
memcpy(shiftreg, &state->m_vram_bg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
else if (address >= 0x02000000 && address <= 0x020fffff)
memcpy(shiftreg, &state->m_vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
else
- logerror("%s:xtheball_to_shiftreg(%08X)\n", space->machine().describe_context(), address);
+ logerror("%s:xtheball_to_shiftreg(%08X)\n", space.machine().describe_context(), address);
}
-static void xtheball_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+static void xtheball_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- xtheball_state *state = space->machine().driver_data<xtheball_state>();
+ xtheball_state *state = space.machine().driver_data<xtheball_state>();
if (address >= 0x01000000 && address <= 0x010fffff)
memcpy(&state->m_vram_bg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
else if (address >= 0x02000000 && address <= 0x020fffff)
memcpy(&state->m_vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
else
- logerror("%s:xtheball_from_shiftreg(%08X)\n", space->machine().describe_context(), address);
+ logerror("%s:xtheball_from_shiftreg(%08X)\n", space.machine().describe_context(), address);
}
diff --git a/src/mame/drivers/xtom3d.c b/src/mame/drivers/xtom3d.c
index 81e8a8cec30..913d634f591 100644
--- a/src/mame/drivers/xtom3d.c
+++ b/src/mame/drivers/xtom3d.c
@@ -664,7 +664,7 @@ void xtom3d_state::machine_start()
kbdc8042_init(machine(), &at8042);
pc_vga_init(machine(), vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
void xtom3d_state::machine_reset()
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index 0fecd7b7380..8acdece266b 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -1523,12 +1523,12 @@ static void zaxxonj_decode(running_machine &machine, const char *cputag)
};
int A;
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion(cputag)->base();
int size = machine.root_device().memregion(cputag)->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
- space->set_decrypted_region(0x0000, size - 1, decrypt);
+ space.set_decrypted_region(0x0000, size - 1, decrypt);
for (A = 0x0000; A < size; A++)
{
diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h
index c0298c17601..1d2a633aa0b 100644
--- a/src/mame/includes/artmagic.h
+++ b/src/mame/includes/artmagic.h
@@ -56,8 +56,8 @@ public:
-void artmagic_to_shiftreg(address_space *space, offs_t address, UINT16 *data);
-void artmagic_from_shiftreg(address_space *space, offs_t address, UINT16 *data);
+void artmagic_to_shiftreg(address_space &space, offs_t address, UINT16 *data);
+void artmagic_from_shiftreg(address_space &space, offs_t address, UINT16 *data);
void artmagic_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h
index 3c2e671a444..5aaba7e9be3 100644
--- a/src/mame/includes/atari.h
+++ b/src/mame/includes/atari.h
@@ -213,7 +213,7 @@ struct VIDEO {
UINT16 data[HWIDTH]; /* graphics data buffer (text through chargen) */
};
-typedef void (*atari_renderer_func)(address_space *space, VIDEO *video);
+typedef void (*atari_renderer_func)(address_space &space, VIDEO *video);
struct ANTIC {
atari_renderer_func renderer; /* current renderer */
@@ -263,11 +263,11 @@ struct ANTIC {
bitmap_ind16 *bitmap;
};
-#define RDANTIC(space) space->read_byte(antic.dpage+antic.doffs)
-#define RDVIDEO(space,o) space->read_byte(antic.vpage+((antic.voffs+(o))&VOFFS))
-#define RDCHGEN(space,o) space->read_byte(antic.chbase+(o))
-#define RDPMGFXS(space,o) space->read_byte(antic.pmbase_s+(o)+(antic.scanline>>1))
-#define RDPMGFXD(space,o) space->read_byte(antic.pmbase_d+(o)+antic.scanline)
+#define RDANTIC(space) space.read_byte(antic.dpage+antic.doffs)
+#define RDVIDEO(space,o) space.read_byte(antic.vpage+((antic.voffs+(o))&VOFFS))
+#define RDCHGEN(space,o) space.read_byte(antic.chbase+(o))
+#define RDPMGFXS(space,o) space.read_byte(antic.pmbase_s+(o)+(antic.scanline>>1))
+#define RDPMGFXD(space,o) space.read_byte(antic.pmbase_d+(o)+antic.scanline)
#define PREPARE() \
UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]
@@ -538,7 +538,7 @@ void antic_reset(void);
READ8_HANDLER ( atari_antic_r );
WRITE8_HANDLER ( atari_antic_w );
-#define ANTIC_RENDERER(name) void name(address_space *space, VIDEO *video)
+#define ANTIC_RENDERER(name) void name(address_space &space, VIDEO *video)
ANTIC_RENDERER( antic_mode_0_xx );
ANTIC_RENDERER( antic_mode_2_32 );
diff --git a/src/mame/includes/atarigt.h b/src/mame/includes/atarigt.h
index 7acf6c434ed..36bf17c7cde 100644
--- a/src/mame/includes/atarigt.h
+++ b/src/mame/includes/atarigt.h
@@ -38,8 +38,8 @@ public:
required_shared_ptr<UINT32> m_mo_command;
- void (*m_protection_w)(address_space *space, offs_t offset, UINT16 data);
- void (*m_protection_r)(address_space *space, offs_t offset, UINT16 *data);
+ void (*m_protection_w)(address_space &space, offs_t offset, UINT16 data);
+ void (*m_protection_r)(address_space &space, offs_t offset, UINT16 *data);
UINT8 m_ignore_writes;
offs_t m_protaddr[ADDRSEQ_COUNT];
diff --git a/src/mame/includes/btoads.h b/src/mame/includes/btoads.h
index 578242a3c45..82bc146382a 100644
--- a/src/mame/includes/btoads.h
+++ b/src/mame/includes/btoads.h
@@ -57,10 +57,10 @@ public:
DECLARE_READ16_MEMBER( vram_fg_display_r );
DECLARE_READ16_MEMBER( vram_fg_draw_r );
void render_sprite_row(UINT16 *sprite_source, UINT32 address);
- void to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
- static void static_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg) { space->machine().driver_data<btoads_state>()->to_shiftreg(space, address, shiftreg); }
- void from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
- static void static_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg) { space->machine().driver_data<btoads_state>()->from_shiftreg(space, address, shiftreg); }
+ void to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
+ static void static_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg) { space.machine().driver_data<btoads_state>()->to_shiftreg(space, address, shiftreg); }
+ void from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
+ static void static_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg) { space.machine().driver_data<btoads_state>()->from_shiftreg(space, address, shiftreg); }
void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
static void static_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) { screen.machine().driver_data<btoads_state>()->scanline_update(screen, bitmap, scanline, params); }
diff --git a/src/mame/includes/eolithsp.h b/src/mame/includes/eolithsp.h
index c4f1aa29211..975393fcb13 100644
--- a/src/mame/includes/eolithsp.h
+++ b/src/mame/includes/eolithsp.h
@@ -1,6 +1,6 @@
/*----------- defined in drivers/eolithsp.c -----------*/
-void eolith_speedup_read(address_space *space);
+void eolith_speedup_read(address_space &space);
void init_eolith_speedup(running_machine &machine);
TIMER_DEVICE_CALLBACK( eolith_speedup );
diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h
index 6f34004a33a..1c1eac602dd 100644
--- a/src/mame/includes/exterm.h
+++ b/src/mame/includes/exterm.h
@@ -43,7 +43,7 @@ public:
void exterm_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params);
-void exterm_to_shiftreg_master(address_space *space, UINT32 address, UINT16* shiftreg);
-void exterm_from_shiftreg_master(address_space *space, UINT32 address, UINT16* shiftreg);
-void exterm_to_shiftreg_slave(address_space *space, UINT32 address, UINT16* shiftreg);
-void exterm_from_shiftreg_slave(address_space *space, UINT32 address, UINT16* shiftreg);
+void exterm_to_shiftreg_master(address_space &space, UINT32 address, UINT16* shiftreg);
+void exterm_from_shiftreg_master(address_space &space, UINT32 address, UINT16* shiftreg);
+void exterm_to_shiftreg_slave(address_space &space, UINT32 address, UINT16* shiftreg);
+void exterm_from_shiftreg_slave(address_space &space, UINT32 address, UINT16* shiftreg);
diff --git a/src/mame/includes/gaelcrpt.h b/src/mame/includes/gaelcrpt.h
index cb56ca81983..897484de1fd 100644
--- a/src/mame/includes/gaelcrpt.h
+++ b/src/mame/includes/gaelcrpt.h
@@ -1,3 +1,3 @@
/*----------- defined in machine/gaelcrpt.c -----------*/
-UINT16 gaelco_decrypt(address_space *space, int offset, int data, int param1, int param2);
+UINT16 gaelco_decrypt(address_space &space, int offset, int data, int param1, int param2);
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index da5c18d733d..c12941d8595 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -356,8 +356,8 @@ DECLARE_WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w );
/*----------- defined in video/harddriv.c -----------*/
-void hdgsp_write_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
-void hdgsp_read_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
+void hdgsp_write_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
+void hdgsp_read_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
READ16_HANDLER( hdgsp_control_lo_r );
WRITE16_HANDLER( hdgsp_control_lo_w );
diff --git a/src/mame/includes/hyprduel.h b/src/mame/includes/hyprduel.h
index 1e4dda27e78..fc19a9650cf 100644
--- a/src/mame/includes/hyprduel.h
+++ b/src/mame/includes/hyprduel.h
@@ -77,7 +77,7 @@ public:
DECLARE_WRITE16_MEMBER(hyprduel_window_w);
DECLARE_WRITE16_MEMBER(hyprduel_scrollreg_w);
DECLARE_WRITE16_MEMBER(hyprduel_scrollreg_init_w);
- void blt_write( address_space *space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask );
+ void blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask );
DECLARE_DRIVER_INIT(magerror);
DECLARE_DRIVER_INIT(hyprduel);
TILE_GET_INFO_MEMBER(get_tile_info_0_8bit);
diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h
index 7429fcaa78b..47c26fdc199 100644
--- a/src/mame/includes/jpmimpct.h
+++ b/src/mame/includes/jpmimpct.h
@@ -114,8 +114,8 @@ public:
/*----------- defined in video/jpmimpct.c -----------*/
-void jpmimpct_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
-void jpmimpct_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
+void jpmimpct_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
+void jpmimpct_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
void jpmimpct_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params);
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index eaf76144a2b..efb09d3ceb3 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -132,7 +132,7 @@ public:
DECLARE_WRITE16_MEMBER(metro_vram_1_w);
DECLARE_WRITE16_MEMBER(metro_vram_2_w);
DECLARE_WRITE16_MEMBER(metro_window_w);
- void blt_write( address_space *space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask );
+ void blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask );
DECLARE_CUSTOM_INPUT_MEMBER(custom_soundstatus_r);
DECLARE_WRITE16_MEMBER(gakusai_oki_bank_hi_w);
DECLARE_WRITE16_MEMBER(gakusai_oki_bank_lo_w);
diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h
index 3fda8e63987..d86ee6473f4 100644
--- a/src/mame/includes/midtunit.h
+++ b/src/mame/includes/midtunit.h
@@ -87,8 +87,8 @@ extern UINT8 midtunit_gfx_rom_large;
-void midtunit_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
-void midtunit_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
+void midtunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
+void midtunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h
index 38f6f269138..9e8e0d9fedc 100644
--- a/src/mame/includes/midyunit.h
+++ b/src/mame/includes/midyunit.h
@@ -129,8 +129,8 @@ public:
-void midyunit_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
-void midyunit_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg);
+void midyunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
+void midyunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index f4d1c074673..93511c44449 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -220,8 +220,8 @@ void model3_tap_reset(running_machine &machine);
SCREEN_UPDATE_IND16(model3);
void real3d_display_list_end(running_machine &machine);
-void real3d_display_list1_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
-void real3d_display_list2_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
-void real3d_vrom_texture_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
-void real3d_texture_fifo_dma(address_space *space, UINT32 src, int length, int byteswap);
-void real3d_polygon_ram_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
+void real3d_display_list1_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap);
+void real3d_display_list2_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap);
+void real3d_vrom_texture_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap);
+void real3d_texture_fifo_dma(address_space &space, UINT32 src, int length, int byteswap);
+void real3d_polygon_ram_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap);
diff --git a/src/mame/includes/nb1414m4.h b/src/mame/includes/nb1414m4.h
index dbaad8bbfe5..b09b96ba301 100644
--- a/src/mame/includes/nb1414m4.h
+++ b/src/mame/includes/nb1414m4.h
@@ -1 +1 @@
-void nb_1414m4_exec(address_space *space,UINT16 mcu_cmd,UINT8 *vram,UINT16 &scrollx,UINT16 &scrolly,tilemap_t *tilemap);
+void nb_1414m4_exec(address_space &space,UINT16 mcu_cmd,UINT8 *vram,UINT16 &scrollx,UINT16 &scrolly,tilemap_t *tilemap);
diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h
index 8132f04deb1..e18c10d259f 100644
--- a/src/mame/includes/nbmj9195.h
+++ b/src/mame/includes/nbmj9195.h
@@ -122,5 +122,5 @@ SCREEN_UPDATE_IND16( nbmj9195 );
-void nbmj9195_clutsel_w(address_space *space, int data);
-void nbmj9195_gfxflag2_w(address_space *space, int data);
+void nbmj9195_clutsel_w(address_space &space, int data);
+void nbmj9195_gfxflag2_w(address_space &space, int data);
diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h
index a04537e9f02..731d5847e33 100644
--- a/src/mame/includes/neogeo.h
+++ b/src/mame/includes/neogeo.h
@@ -213,10 +213,10 @@ public:
/*----------- defined in drivers/neogeo.c -----------*/
void neogeo_set_display_position_interrupt_control(running_machine &machine, UINT16 data);
-void neogeo_set_display_counter_msb(address_space *space, UINT16 data);
-void neogeo_set_display_counter_lsb(address_space *space, UINT16 data);
+void neogeo_set_display_counter_msb(address_space &space, UINT16 data);
+void neogeo_set_display_counter_lsb(address_space &space, UINT16 data);
void neogeo_acknowledge_interrupt(running_machine &machine, UINT16 data);
-void neogeo_set_main_cpu_bank_address(address_space *space, UINT32 bank_address);
+void neogeo_set_main_cpu_bank_address(address_space &space, UINT32 bank_address);
DEVICE_IMAGE_LOAD( neo_cartridge );
diff --git a/src/mame/includes/ojankohs.h b/src/mame/includes/ojankohs.h
index 80e3da148a6..51b3bf3f8df 100644
--- a/src/mame/includes/ojankohs.h
+++ b/src/mame/includes/ojankohs.h
@@ -85,5 +85,5 @@ public:
SCREEN_UPDATE_IND16( ojankohs );
SCREEN_UPDATE_IND16( ojankoc );
-void ojankoc_flipscreen(address_space *space, int data);
+void ojankoc_flipscreen(address_space &space, int data);
diff --git a/src/mame/includes/pastelg.h b/src/mame/includes/pastelg.h
index b447f2d8afc..4dd243e39ba 100644
--- a/src/mame/includes/pastelg.h
+++ b/src/mame/includes/pastelg.h
@@ -44,4 +44,4 @@ SCREEN_UPDATE_IND16( pastelg );
-int pastelg_blitter_src_addr_r(address_space *space);
+int pastelg_blitter_src_addr_r(address_space &space);
diff --git a/src/mame/includes/segaorun.h b/src/mame/includes/segaorun.h
index 28faca9ebe8..0087dd26527 100644
--- a/src/mame/includes/segaorun.h
+++ b/src/mame/includes/segaorun.h
@@ -101,9 +101,9 @@ public:
// wrappers for legacy functions (to be removed)
template<read16_space_func _Legacy>
- READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(&space, offset, mem_mask); }
+ READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(space, offset, mem_mask); }
template<write16_space_func _Legacy>
- WRITE16_MEMBER( legacy_wrapper ) { _Legacy(&space, offset, data, mem_mask); }
+ WRITE16_MEMBER( legacy_wrapper ) { _Legacy(space, offset, data, mem_mask); }
protected:
// timer IDs
diff --git a/src/mame/includes/segas16b.h b/src/mame/includes/segas16b.h
index a474c861c32..eb0b0b32096 100644
--- a/src/mame/includes/segas16b.h
+++ b/src/mame/includes/segas16b.h
@@ -141,7 +141,7 @@ public:
// wrappers for legacy functions (to be removed)
template<write16_space_func _Legacy>
- WRITE16_MEMBER( legacy_wrapper ) { _Legacy(&space, offset, data, mem_mask); }
+ WRITE16_MEMBER( legacy_wrapper ) { _Legacy(space, offset, data, mem_mask); }
protected:
// internal types
diff --git a/src/mame/includes/segas18.h b/src/mame/includes/segas18.h
index 402ce82ba95..e08e4d18c5d 100644
--- a/src/mame/includes/segas18.h
+++ b/src/mame/includes/segas18.h
@@ -113,9 +113,9 @@ public:
// wrappers for legacy functions (to be removed)
template<read16_space_func _Legacy>
- READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(&space, offset, mem_mask); }
+ READ16_MEMBER( legacy_wrapper_r ) { return _Legacy(space, offset, mem_mask); }
template<write16_space_func _Legacy>
- WRITE16_MEMBER( legacy_wrapper ) { _Legacy(&space, offset, data, mem_mask); }
+ WRITE16_MEMBER( legacy_wrapper ) { _Legacy(space, offset, data, mem_mask); }
protected:
// timer IDs
diff --git a/src/mame/includes/slapstic.h b/src/mame/includes/slapstic.h
index 4caa8ab3a35..1466b220124 100644
--- a/src/mame/includes/slapstic.h
+++ b/src/mame/includes/slapstic.h
@@ -15,4 +15,4 @@ void slapstic_init(running_machine &machine, int chip);
void slapstic_reset(void);
int slapstic_bank(void);
-int slapstic_tweak(address_space *space, offs_t offset);
+int slapstic_tweak(address_space &space, offs_t offset);
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index 9544fc09604..6ad5d484f30 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -123,7 +123,7 @@ public:
/*----------- defined in drivers/williams.c -----------*/
-void defender_install_io_space(address_space *space);
+void defender_install_io_space(address_space &space);
/*----------- defined in machine/williams.c -----------*/
diff --git a/src/mame/machine/acitya.c b/src/mame/machine/acitya.c
index 875005cbc77..18bf6bcc6b1 100644
--- a/src/mame/machine/acitya.c
+++ b/src/mame/machine/acitya.c
@@ -152,7 +152,7 @@ static void acitya_decrypt_rom_B(running_machine &machine)
READ8_HANDLER( acitya_decrypt_rom )
{
- pacman_state *state = space->machine().driver_data<pacman_state>();
+ pacman_state *state = space.machine().driver_data<pacman_state>();
if (offset & 0x01)
{
state->m_counter = (state->m_counter - 1) & 0x0F;
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c
index 3db22d69dfa..13ea8a200a0 100644
--- a/src/mame/machine/amiga.c
+++ b/src/mame/machine/amiga.c
@@ -261,9 +261,9 @@ void amiga_machine_config(running_machine &machine, const amiga_machine_interfac
static void amiga_m68k_reset(device_t *device)
{
amiga_state *state = device->machine().driver_data<amiga_state>();
- address_space *space = device->memory().space(AS_PROGRAM);
+ address_space &space = *device->memory().space(AS_PROGRAM);
- logerror("Executed RESET at PC=%06x\n", space->device().safe_pc());
+ logerror("Executed RESET at PC=%06x\n", space.device().safe_pc());
/* Initialize the various chips */
device->machine().device("cia_0")->reset();
@@ -274,7 +274,7 @@ static void amiga_m68k_reset(device_t *device)
/* set the overlay bit */
if ( IS_AGA(state->m_intf) )
{
- space->write_byte( 0xbfa001, 1 );
+ space.write_byte( 0xbfa001, 1 );
}
else
{
@@ -318,7 +318,7 @@ static TIMER_CALLBACK( scanline_callback )
if (scanline == 0)
{
/* signal VBLANK IRQ */
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff);
/* clock the first CIA TOD */
mos6526_tod_w(cia_0, 1);
@@ -939,7 +939,7 @@ static TIMER_CALLBACK( amiga_blitter_proc )
CUSTOM_REG(REG_DMACON) &= ~0x4000;
/* signal an interrupt */
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff);
/* reset the blitter timer */
state->m_blitter_timer->reset( );
@@ -953,15 +953,15 @@ static TIMER_CALLBACK( amiga_blitter_proc )
*
*************************************/
-static void blitter_setup(address_space *space)
+static void blitter_setup(address_space &space)
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
int ticks, width, height, blittime;
/* is there another blitting in progress? */
if (CUSTOM_REG(REG_DMACON) & 0x4000)
{
- logerror("%s - This program is playing tricks with the blitter\n", space->machine().describe_context() );
+ logerror("%s - This program is playing tricks with the blitter\n", space.machine().describe_context() );
return;
}
@@ -994,7 +994,7 @@ static void blitter_setup(address_space *space)
if ( CUSTOM_REG(REG_DMACON) & 0x0400 )
{
/* simulate the 68k not running while the blit is going */
- space->device().execute().adjust_icount(-(blittime/2) );
+ space.device().execute().adjust_icount(-(blittime/2) );
blittime = BLITTER_NASTY_DELAY;
}
@@ -1007,7 +1007,7 @@ static void blitter_setup(address_space *space)
CUSTOM_REG(REG_DMACON) |= 0x4000;
/* set a timer */
- state->m_blitter_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime( blittime ));
+ state->m_blitter_timer->adjust( downcast<cpu_device *>(&space.device())->cycles_to_attotime( blittime ));
}
@@ -1027,22 +1027,22 @@ READ16_HANDLER( amiga_cia_r )
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
if ((offset & 0x0800) == 0)
{
- cia = space->machine().device("cia_1");
+ cia = space.machine().device("cia_1");
shift = 8;
}
/* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
else
{
- cia = space->machine().device("cia_0");
+ cia = space.machine().device("cia_0");
shift = 0;
}
/* handle the reads */
- data = mos6526_r(cia, *space, offset >> 7);
+ data = mos6526_r(cia, space, offset >> 7);
if (LOG_CIA)
- logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", space->device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask);
+ logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", space.device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask);
return data << shift;
}
@@ -1060,14 +1060,14 @@ WRITE16_HANDLER( amiga_cia_w )
device_t *cia;
if (LOG_CIA)
- logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", space->device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask);
+ logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", space.device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask);
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
if ((offset & 0x0800) == 0)
{
if (!ACCESSING_BITS_8_15)
return;
- cia = space->machine().device("cia_1");
+ cia = space.machine().device("cia_1");
data >>= 8;
}
@@ -1076,12 +1076,12 @@ WRITE16_HANDLER( amiga_cia_w )
{
if (!ACCESSING_BITS_0_7)
return;
- cia = space->machine().device("cia_0");
+ cia = space.machine().device("cia_0");
data &= 0xff;
}
/* handle the writes */
- mos6526_w(cia, *space, offset >> 7, (UINT8) data);
+ mos6526_w(cia, space, offset >> 7, (UINT8) data);
}
@@ -1094,13 +1094,13 @@ WRITE16_HANDLER( amiga_cia_w )
void amiga_cia_0_irq(device_t *device, int state)
{
- amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff);
}
void amiga_cia_1_irq(device_t *device, int state)
{
- amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff);
+ amiga_custom_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff);
}
@@ -1152,7 +1152,7 @@ static void custom_reset(running_machine &machine)
READ16_HANDLER( amiga_custom_r )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
UINT16 temp;
switch (offset & 0xff)
@@ -1165,11 +1165,11 @@ READ16_HANDLER( amiga_custom_r )
case REG_VPOSR:
CUSTOM_REG(REG_VPOSR) &= 0xff00;
- CUSTOM_REG(REG_VPOSR) |= amiga_gethvpos(*space->machine().primary_screen) >> 16;
+ CUSTOM_REG(REG_VPOSR) |= amiga_gethvpos(*space.machine().primary_screen) >> 16;
return CUSTOM_REG(REG_VPOSR);
case REG_VHPOSR:
- return amiga_gethvpos(*space->machine().primary_screen) & 0xffff;
+ return amiga_gethvpos(*space.machine().primary_screen) & 0xffff;
case REG_SERDATR:
CUSTOM_REG(REG_SERDATR) &= ~0x4000;
@@ -1178,12 +1178,12 @@ READ16_HANDLER( amiga_custom_r )
case REG_JOY0DAT:
if (state->m_intf->joy0dat_r != NULL)
- return (*state->m_intf->joy0dat_r)(space->machine());
+ return (*state->m_intf->joy0dat_r)(space.machine());
return state->ioport("JOY0DAT")->read_safe(0xffff);
case REG_JOY1DAT:
if (state->m_intf->joy1dat_r != NULL)
- return (*state->m_intf->joy1dat_r)(space->machine());
+ return (*state->m_intf->joy1dat_r)(space.machine());
return state->ioport("JOY1DAT")->read_safe(0xffff);
case REG_POTGOR:
@@ -1196,7 +1196,7 @@ READ16_HANDLER( amiga_custom_r )
return state->ioport("POT1DAT")->read_safe(0x0000);
case REG_DSKBYTR:
- return space->machine().device<amiga_fdc>("fdc")->dskbytr_r();
+ return space.machine().device<amiga_fdc>("fdc")->dskbytr_r();
case REG_INTENAR:
return CUSTOM_REG(REG_INTENA);
@@ -1205,11 +1205,11 @@ READ16_HANDLER( amiga_custom_r )
return CUSTOM_REG(REG_INTREQ);
case REG_COPJMP1:
- amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP1LCH));
+ amiga_copper_setpc(space.machine(), CUSTOM_REG_LONG(REG_COP1LCH));
break;
case REG_COPJMP2:
- amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP2LCH));
+ amiga_copper_setpc(space.machine(), CUSTOM_REG_LONG(REG_COP2LCH));
break;
case REG_CLXDAT:
@@ -1221,14 +1221,14 @@ READ16_HANDLER( amiga_custom_r )
return CUSTOM_REG(REG_DENISEID);
case REG_DSKPTH:
- return space->machine().device<amiga_fdc>("fdc")->dskpth_r();
+ return space.machine().device<amiga_fdc>("fdc")->dskpth_r();
case REG_DSKPTL:
- return space->machine().device<amiga_fdc>("fdc")->dskptl_r();
+ return space.machine().device<amiga_fdc>("fdc")->dskptl_r();
}
if (LOG_CUSTOM)
- logerror("%06X:read from custom %s\n", space->device().safe_pc(), amiga_custom_names[offset & 0xff]);
+ logerror("%06X:read from custom %s\n", space.device().safe_pc(), amiga_custom_names[offset & 0xff]);
return 0xffff;
}
@@ -1249,20 +1249,20 @@ static TIMER_CALLBACK( finish_serial_write )
CUSTOM_REG(REG_SERDATR) |= 0x3000;
/* signal an interrupt */
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff);
}
WRITE16_HANDLER( amiga_custom_w )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
device_t *cia_0;
device_t *cia_1;
UINT16 temp;
offset &= 0xff;
if (LOG_CUSTOM)
- logerror("%06X:write to custom %s = %04X\n", space->device().safe_pc(), amiga_custom_names[offset & 0xff], data);
+ logerror("%06X:write to custom %s = %04X\n", space.device().safe_pc(), amiga_custom_names[offset & 0xff], data);
switch (offset)
{
@@ -1274,31 +1274,31 @@ WRITE16_HANDLER( amiga_custom_w )
break;
case REG_DSKSYNC:
- space->machine().device<amiga_fdc>("fdc")->dsksync_w(data);
+ space.machine().device<amiga_fdc>("fdc")->dsksync_w(data);
break;
case REG_DSKPTH:
- space->machine().device<amiga_fdc>("fdc")->dskpth_w(data);
+ space.machine().device<amiga_fdc>("fdc")->dskpth_w(data);
break;
case REG_DSKPTL:
- space->machine().device<amiga_fdc>("fdc")->dskptl_w(data);
+ space.machine().device<amiga_fdc>("fdc")->dskptl_w(data);
break;
case REG_DSKLEN:
- space->machine().device<amiga_fdc>("fdc")->dsklen_w(data);
+ space.machine().device<amiga_fdc>("fdc")->dsklen_w(data);
break;
case REG_POTGO:
if (state->m_intf->potgo_w != NULL)
- (*state->m_intf->potgo_w)(space->machine(), data);
+ (*state->m_intf->potgo_w)(space.machine(), data);
break;
case REG_SERDAT:
if (state->m_intf->serdat_w != NULL)
- (*state->m_intf->serdat_w)(space->machine(), data);
+ (*state->m_intf->serdat_w)(space.machine(), data);
CUSTOM_REG(REG_SERDATR) &= ~0x3000;
- space->machine().scheduler().timer_set(amiga_get_serial_char_period(space->machine()), FUNC(finish_serial_write));
+ space.machine().scheduler().timer_set(amiga_get_serial_char_period(space.machine()), FUNC(finish_serial_write));
break;
case REG_BLTSIZE:
@@ -1342,19 +1342,19 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_SPR0PTL: case REG_SPR1PTL: case REG_SPR2PTL: case REG_SPR3PTL:
case REG_SPR4PTL: case REG_SPR5PTL: case REG_SPR6PTL: case REG_SPR7PTL:
- amiga_sprite_dma_reset(space->machine(), (offset - REG_SPR0PTL) / 2);
+ amiga_sprite_dma_reset(space.machine(), (offset - REG_SPR0PTL) / 2);
break;
case REG_SPR0CTL: case REG_SPR1CTL: case REG_SPR2CTL: case REG_SPR3CTL:
case REG_SPR4CTL: case REG_SPR5CTL: case REG_SPR6CTL: case REG_SPR7CTL:
/* disable comparitor on writes here */
- amiga_sprite_enable_comparitor(space->machine(), (offset - REG_SPR0CTL) / 4, FALSE);
+ amiga_sprite_enable_comparitor(space.machine(), (offset - REG_SPR0CTL) / 4, FALSE);
break;
case REG_SPR0DATA: case REG_SPR1DATA: case REG_SPR2DATA: case REG_SPR3DATA:
case REG_SPR4DATA: case REG_SPR5DATA: case REG_SPR6DATA: case REG_SPR7DATA:
/* enable comparitor on writes here */
- amiga_sprite_enable_comparitor(space->machine(), (offset - REG_SPR0DATA) / 4, TRUE);
+ amiga_sprite_enable_comparitor(space.machine(), (offset - REG_SPR0DATA) / 4, TRUE);
break;
case REG_COP1LCH: case REG_COP2LCH:
@@ -1362,11 +1362,11 @@ WRITE16_HANDLER( amiga_custom_w )
break;
case REG_COPJMP1:
- amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP1LCH));
+ amiga_copper_setpc(space.machine(), CUSTOM_REG_LONG(REG_COP1LCH));
break;
case REG_COPJMP2:
- amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP2LCH));
+ amiga_copper_setpc(space.machine(), CUSTOM_REG_LONG(REG_COP2LCH));
break;
case REG_DDFSTRT:
@@ -1389,11 +1389,11 @@ WRITE16_HANDLER( amiga_custom_w )
/* bits BBUSY (14) and BZERO (13) are read-only */
data &= 0x9fff;
data = (data & 0x8000) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff));
- space->machine().device<amiga_fdc>("fdc")->dmacon_set(data);
+ space.machine().device<amiga_fdc>("fdc")->dmacon_set(data);
/* if 'blitter-nasty' has been turned on and we have a blit pending, reschedule it */
if ( ( data & 0x400 ) && ( CUSTOM_REG(REG_DMACON) & 0x4000 ) )
- state->m_blitter_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime( BLITTER_NASTY_DELAY ));
+ state->m_blitter_timer->adjust( downcast<cpu_device *>(&space.device())->cycles_to_attotime( BLITTER_NASTY_DELAY ));
break;
@@ -1404,9 +1404,9 @@ WRITE16_HANDLER( amiga_custom_w )
CUSTOM_REG(offset) = data;
if ( temp & 0x8000 ) /* if we're enabling irq's, delay a bit */
- state->m_irq_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
+ state->m_irq_timer->adjust( downcast<cpu_device *>(&space.device())->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
else /* if we're disabling irq's, process right away */
- update_irqs(space->machine());
+ update_irqs(space.machine());
break;
case REG_INTREQ:
@@ -1416,22 +1416,22 @@ WRITE16_HANDLER( amiga_custom_w )
CUSTOM_REG(REG_SERDATR) &= ~0x8000;
data = (data & 0x8000) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff));
- cia_0 = space->machine().device("cia_0");
- cia_1 = space->machine().device("cia_1");
+ cia_0 = space.machine().device("cia_0");
+ cia_1 = space.machine().device("cia_1");
if ( mos6526_irq_r( cia_0 ) ) data |= INTENA_PORTS;
if ( mos6526_irq_r( cia_1 ) ) data |= INTENA_EXTER;
CUSTOM_REG(offset) = data;
if ( temp & 0x8000 ) /* if we're generating irq's, delay a bit */
- state->m_irq_timer->adjust( space->machine().device<cpu_device>("maincpu")->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
+ state->m_irq_timer->adjust( space.machine().device<cpu_device>("maincpu")->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
else /* if we're clearing irq's, process right away */
- update_irqs(space->machine());
+ update_irqs(space.machine());
break;
case REG_ADKCON:
amiga_audio_update(state->m_sound_device);
data = (data & 0x8000) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff));
- space->machine().device<amiga_fdc>("fdc")->adkcon_set(data);
+ space.machine().device<amiga_fdc>("fdc")->adkcon_set(data);
break;
case REG_AUD0LCL: case REG_AUD0LCH: case REG_AUD0LEN: case REG_AUD0PER: case REG_AUD0VOL:
@@ -1469,7 +1469,7 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_COLOR28: case REG_COLOR29: case REG_COLOR30: case REG_COLOR31:
if (IS_AGA(state->m_intf))
{
- amiga_aga_palette_write(space->machine(), offset - REG_COLOR00, data);
+ amiga_aga_palette_write(space.machine(), offset - REG_COLOR00, data);
}
else
{
@@ -1480,11 +1480,11 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_DIWSTRT:
case REG_DIWSTOP:
if (IS_AGA(state->m_intf))
- amiga_aga_diwhigh_written(space->machine(), 0);
+ amiga_aga_diwhigh_written(space.machine(), 0);
break;
case REG_DIWHIGH:
if (IS_AGA(state->m_intf))
- amiga_aga_diwhigh_written(space->machine(), 1);
+ amiga_aga_diwhigh_written(space.machine(), 1);
break;
default:
@@ -1509,7 +1509,7 @@ WRITE16_HANDLER( amiga_custom_w )
void amiga_serial_in_w(running_machine &machine, UINT16 data)
{
amiga_state *state = machine.driver_data<amiga_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int mask = (CUSTOM_REG(REG_SERPER) & 0x8000) ? 0x1ff : 0xff;
/* copy the data to the low 8 bits of SERDATR and set RBF */
@@ -1600,7 +1600,7 @@ static void autoconfig_reset(running_machine &machine)
READ16_HANDLER( amiga_autoconfig_r )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
autoconfig_device *cur_autoconfig = state->m_cur_autoconfig;
UINT8 byte;
int i;
@@ -1716,7 +1716,7 @@ READ16_HANDLER( amiga_autoconfig_r )
case 0x40/4:
byte = 0x00;
if (cur_autoconfig->device.int_control_r)
- byte = (*cur_autoconfig->device.int_control_r)(space->machine());
+ byte = (*cur_autoconfig->device.int_control_r)(space.machine());
break;
default:
@@ -1739,7 +1739,7 @@ READ16_HANDLER( amiga_autoconfig_r )
WRITE16_HANDLER( amiga_autoconfig_w )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
autoconfig_device *cur_autoconfig = state->m_cur_autoconfig;
int move_to_next = FALSE;
@@ -1777,7 +1777,7 @@ WRITE16_HANDLER( amiga_autoconfig_w )
{
logerror("Install to %06X\n", cur_autoconfig->base);
if (cur_autoconfig->base && cur_autoconfig->device.install)
- (*cur_autoconfig->device.install)(space->machine(), cur_autoconfig->base);
+ (*cur_autoconfig->device.install)(space.machine(), cur_autoconfig->base);
state->m_cur_autoconfig = cur_autoconfig->next;
}
}
diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c
index 4b6775bb504..80d69f0417d 100644
--- a/src/mame/machine/archimds.c
+++ b/src/mame/machine/archimds.c
@@ -115,17 +115,17 @@ static TIMER_CALLBACK( vidc_vblank )
/* TODO: what type of DMA this is, burst or cycle steal? Docs doesn't explain it (4 usec is the DRAM refresh). */
static TIMER_CALLBACK( vidc_video_tick )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
static UINT8 *vram = machine.root_device().memregion("vram")->base();
UINT32 size;
size = vidc_vidend-vidc_vidstart+0x10;
for(vidc_vidcur = 0;vidc_vidcur < size;vidc_vidcur++)
- vram[vidc_vidcur] = (space->read_byte(vidc_vidstart+vidc_vidcur));
+ vram[vidc_vidcur] = (space.read_byte(vidc_vidstart+vidc_vidcur));
if(video_dma_on)
- vid_timer->adjust(space->machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vid_timer->adjust(space.machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
else
vid_timer->adjust(attotime::never);
}
@@ -133,7 +133,7 @@ static TIMER_CALLBACK( vidc_video_tick )
/* audio DMA */
static TIMER_CALLBACK( vidc_audio_tick )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 ulaw_comp;
INT16 res;
UINT8 ch;
@@ -176,13 +176,13 @@ static TIMER_CALLBACK( vidc_audio_tick )
for(ch=0;ch<8;ch++)
{
- UINT8 ulaw_temp = (space->read_byte(vidc_sndstart+vidc_sndcur + ch)) ^ 0xff;
+ UINT8 ulaw_temp = (space.read_byte(vidc_sndstart+vidc_sndcur + ch)) ^ 0xff;
ulaw_comp = (ulaw_temp>>1) | ((ulaw_temp&1)<<7);
res = mulawTable[ulaw_comp];
- space->machine().device<dac_device>(dac_port[ch & 7])->write_signed16(res^0x8000);
+ space.machine().device<dac_device>(dac_port[ch & 7])->write_signed16(res^0x8000);
}
vidc_sndcur+=8;
@@ -196,7 +196,7 @@ static TIMER_CALLBACK( vidc_audio_tick )
{
snd_timer->adjust(attotime::never);
for(ch=0;ch<8;ch++)
- space->machine().device<dac_device>(dac_port[ch & 7])->write_signed16(0x8000);
+ space.machine().device<dac_device>(dac_port[ch & 7])->write_signed16(0x8000);
}
}
}
@@ -289,7 +289,7 @@ READ32_HANDLER(archimedes_memc_logical_r)
{
UINT32 *rom;
- rom = (UINT32 *)space->machine().root_device().memregion("maincpu")->base();
+ rom = (UINT32 *)space.machine().root_device().memregion("maincpu")->base();
return rom[offset & 0x1fffff];
}
@@ -355,7 +355,7 @@ READ32_HANDLER(aristmk5_drame_memc_logical_r)
{
UINT32 *rom;
- rom = (UINT32 *)space->machine().root_device().memregion("maincpu")->base();
+ rom = (UINT32 *)space.machine().root_device().memregion("maincpu")->base();
return rom[offset & 0x1fffff];
}
@@ -423,8 +423,8 @@ DIRECT_UPDATE_HANDLER( a310_setopbase )
void archimedes_driver_init(running_machine &machine)
{
archimedes_memc_physmem = reinterpret_cast<UINT32 *>(machine.root_device().memshare("physicalram")->ptr());
-// address_space *space = machine.device<arm_device>("maincpu")->space(AS_PROGRAM);
-// space->set_direct_update_handler(direct_update_delegate(FUNC(a310_setopbase), &machine));
+// address_space &space = *machine.device<arm_device>("maincpu")->space(AS_PROGRAM);
+// space.set_direct_update_handler(direct_update_delegate(FUNC(a310_setopbase), &machine));
}
static const char *const ioc_regnames[] =
@@ -474,7 +474,7 @@ static void latch_timer_cnt(int tmr)
static READ32_HANDLER( ioc_ctrl_r )
{
if(IOC_LOG)
- logerror("IOC: R %s = %02x (PC=%x) %02x\n", ioc_regnames[offset&0x1f], ioc_regs[offset&0x1f], space->device() .safe_pc( ),offset & 0x1f);
+ logerror("IOC: R %s = %02x (PC=%x) %02x\n", ioc_regnames[offset&0x1f], ioc_regs[offset&0x1f], space.device() .safe_pc( ),offset & 0x1f);
switch (offset & 0x1f)
{
@@ -484,16 +484,16 @@ static READ32_HANDLER( ioc_ctrl_r )
static UINT8 flyback; //internal name for vblank here
int vert_pos;
- vert_pos = space->machine().primary_screen->vpos();
+ vert_pos = space.machine().primary_screen->vpos();
flyback = (vert_pos <= vidc_regs[VIDC_VDSR] || vert_pos >= vidc_regs[VIDC_VDER]) ? 0x80 : 0x00;
- i2c_data = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
+ i2c_data = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
return (flyback) | (ioc_regs[CONTROL] & 0x7c) | (i2c_clk<<1) | i2c_data;
}
case KART: // keyboard read
- archimedes_request_irq_b(space->machine(), ARCHIMEDES_IRQB_KBD_XMIT_EMPTY);
+ archimedes_request_irq_b(space.machine(), ARCHIMEDES_IRQB_KBD_XMIT_EMPTY);
break;
case IRQ_STATUS_A:
@@ -536,7 +536,7 @@ static READ32_HANDLER( ioc_ctrl_r )
case T3_LATCH_HI: return (ioc_timerout[3]>>8)&0xff;
default:
if(!IOC_LOG)
- logerror("IOC: R %s = %02x (PC=%x) %02x\n", ioc_regnames[offset&0x1f], ioc_regs[offset&0x1f], space->device() .safe_pc( ),offset & 0x1f);
+ logerror("IOC: R %s = %02x (PC=%x) %02x\n", ioc_regnames[offset&0x1f], ioc_regs[offset&0x1f], space.device() .safe_pc( ),offset & 0x1f);
break;
}
@@ -547,14 +547,14 @@ static READ32_HANDLER( ioc_ctrl_r )
static WRITE32_HANDLER( ioc_ctrl_w )
{
if(IOC_LOG)
- logerror("IOC: W %02x @ reg %s (PC=%x)\n", data&0xff, ioc_regnames[offset&0x1f], space->device() .safe_pc( ));
+ logerror("IOC: W %02x @ reg %s (PC=%x)\n", data&0xff, ioc_regnames[offset&0x1f], space.device() .safe_pc( ));
switch (offset&0x1f)
{
case CONTROL: // I2C bus control
//logerror("IOC I2C: CLK %d DAT %d\n", (data>>1)&1, data&1);
- i2cmem_sda_write(space->machine().device("i2cmem"), data & 0x01);
- i2cmem_scl_write(space->machine().device("i2cmem"), (data & 0x02) >> 1);
+ i2cmem_sda_write(space.machine().device("i2cmem"), data & 0x01);
+ i2cmem_scl_write(space.machine().device("i2cmem"), (data & 0x02) >> 1);
i2c_clk = (data & 2) >> 1;
break;
@@ -571,10 +571,10 @@ static WRITE32_HANDLER( ioc_ctrl_w )
ioc_regs[IRQ_MASK_A] = data & 0xff;
if(data & 0x80) //force an IRQ
- archimedes_request_irq_a(space->machine(),ARCHIMEDES_IRQA_FORCE);
+ archimedes_request_irq_a(space.machine(),ARCHIMEDES_IRQA_FORCE);
if(data & 0x08) //set up the VBLANK timer
- vbl_timer->adjust(space->machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vbl_timer->adjust(space.machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
break;
@@ -582,7 +582,7 @@ static WRITE32_HANDLER( ioc_ctrl_w )
ioc_regs[FIQ_MASK] = data & 0xff;
if(data & 0x80) //force a FIRQ
- archimedes_request_fiq(space->machine(),ARCHIMEDES_FIQ_FORCE);
+ archimedes_request_fiq(space.machine(),ARCHIMEDES_FIQ_FORCE);
break;
@@ -593,7 +593,7 @@ static WRITE32_HANDLER( ioc_ctrl_w )
//if (ioc_regs[IRQ_STATUS_A] == 0)
{
//printf("IRQ clear A\n");
- space->machine().device("maincpu")->execute().set_input_line(ARM_IRQ_LINE, CLEAR_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(ARM_IRQ_LINE, CLEAR_LINE);
}
break;
@@ -655,7 +655,7 @@ static WRITE32_HANDLER( ioc_ctrl_w )
default:
if(!IOC_LOG)
- logerror("IOC: W %02x @ reg %s (PC=%x)\n", data&0xff, ioc_regnames[offset&0x1f], space->device() .safe_pc( ));
+ logerror("IOC: W %02x @ reg %s (PC=%x)\n", data&0xff, ioc_regnames[offset&0x1f], space.device() .safe_pc( ));
ioc_regs[offset&0x1f] = data & 0xff;
break;
@@ -665,7 +665,7 @@ static WRITE32_HANDLER( ioc_ctrl_w )
READ32_HANDLER(archimedes_ioc_r)
{
UINT32 ioc_addr;
- device_t *fdc = (device_t *)space->machine().device("wd1772");
+ device_t *fdc = (device_t *)space.machine().device("wd1772");
ioc_addr = offset*4;
@@ -684,7 +684,7 @@ READ32_HANDLER(archimedes_ioc_r)
case 1:
if (fdc) {
logerror("17XX: R @ addr %x mask %08x\n", offset*4, mem_mask);
- return wd17xx_data_r(fdc, *space, offset&0xf);
+ return wd17xx_data_r(fdc, space, offset&0xf);
} else {
logerror("Read from FDC device?\n");
return 0;
@@ -721,7 +721,7 @@ READ32_HANDLER(archimedes_ioc_r)
WRITE32_HANDLER(archimedes_ioc_w)
{
UINT32 ioc_addr;
- device_t *fdc = (device_t *)space->machine().device("wd1772");
+ device_t *fdc = (device_t *)space.machine().device("wd1772");
ioc_addr = offset*4;
@@ -740,7 +740,7 @@ WRITE32_HANDLER(archimedes_ioc_w)
case 1:
if (fdc) {
logerror("17XX: %x to addr %x mask %08x\n", data, offset*4, mem_mask);
- wd17xx_data_w(fdc, *space, offset&0xf, data&0xff);
+ wd17xx_data_w(fdc, space, offset&0xf, data&0xff);
} else {
logerror("Write to FDC device?\n");
}
@@ -779,7 +779,7 @@ WRITE32_HANDLER(archimedes_ioc_w)
}
- logerror("(PC=%08x) I/O: W %x @ %x (mask %08x)\n", space->device().safe_pc(), data, (offset*4)+0x3000000, mem_mask);
+ logerror("(PC=%08x) I/O: W %x @ %x (mask %08x)\n", space.device().safe_pc(), data, (offset*4)+0x3000000, mem_mask);
}
READ32_HANDLER(archimedes_vidc_r)
@@ -866,9 +866,9 @@ WRITE32_HANDLER(archimedes_vidc_w)
r = (val & 0x000f) >> 0;
if(reg == 0x40 && val & 0xfff)
- logerror("WARNING: border color write here (PC=%08x)!\n",space->device().safe_pc());
+ logerror("WARNING: border color write here (PC=%08x)!\n",space.device().safe_pc());
- palette_set_color_rgb(space->machine(), reg >> 2, pal4bit(r), pal4bit(g), pal4bit(b) );
+ palette_set_color_rgb(space.machine(), reg >> 2, pal4bit(r), pal4bit(g), pal4bit(b) );
/* handle 8bpp colors here */
if(reg <= 0x3c)
@@ -881,7 +881,7 @@ WRITE32_HANDLER(archimedes_vidc_w)
g = ((val & 0x030) >> 4) | ((i & 0x20) >> 3) | ((i & 0x40) >> 3);
r = ((val & 0x007) >> 0) | ((i & 0x10) >> 1);
- palette_set_color_rgb(space->machine(), (reg >> 2) + 0x100 + i, pal4bit(r), pal4bit(g), pal4bit(b) );
+ palette_set_color_rgb(space.machine(), (reg >> 2) + 0x100 + i, pal4bit(r), pal4bit(g), pal4bit(b) );
}
}
@@ -921,14 +921,14 @@ WRITE32_HANDLER(archimedes_vidc_w)
logerror("VIDC: %s = %d\n", vrnames[(reg-0x80)/4], vidc_regs[reg]);
//#endif
- vidc_dynamic_res_change(space->machine());
+ vidc_dynamic_res_change(space.machine());
}
else if(reg == 0xe0)
{
vidc_bpp_mode = ((val & 0x0c) >> 2);
vidc_interlace = ((val & 0x40) >> 6);
vidc_pixel_clk = (val & 0x03);
- vidc_dynamic_res_change(space->machine());
+ vidc_dynamic_res_change(space.machine());
}
else
{
@@ -977,13 +977,13 @@ WRITE32_HANDLER(archimedes_memc_w)
case 6:
vidc_sndcur = 0;
- archimedes_request_irq_b(space->machine(), ARCHIMEDES_IRQB_SOUND_EMPTY);
+ archimedes_request_irq_b(space.machine(), ARCHIMEDES_IRQB_SOUND_EMPTY);
break;
case 7: /* Control */
memc_pagesize = ((data>>2) & 3);
- logerror("(PC = %08x) MEMC: %x to Control (page size %d, %s, %s)\n", space->device().safe_pc(), data & 0x1ffc, page_sizes[memc_pagesize], ((data>>10)&1) ? "Video DMA on" : "Video DMA off", ((data>>11)&1) ? "Sound DMA on" : "Sound DMA off");
+ logerror("(PC = %08x) MEMC: %x to Control (page size %d, %s, %s)\n", space.device().safe_pc(), data & 0x1ffc, page_sizes[memc_pagesize], ((data>>10)&1) ? "Video DMA on" : "Video DMA off", ((data>>11)&1) ? "Sound DMA on" : "Sound DMA off");
video_dma_on = ((data>>10)&1);
audio_dma_on = ((data>>11)&1);
@@ -991,7 +991,7 @@ WRITE32_HANDLER(archimedes_memc_w)
if ((data>>10)&1)
{
vidc_vidcur = 0;
- vid_timer->adjust(space->machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vid_timer->adjust(space.machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
}
if ((data>>11)&1)
@@ -1088,6 +1088,6 @@ WRITE32_HANDLER(archimedes_memc_page_w)
// now go ahead and set the mapping in the page table
memc_pages[log] = phys + (memc*0x80);
-// printf("PC=%08x = MEMC_PAGE(%d): W %08x: log %x to phys %x, MEMC %d, perms %d\n", space->device().safe_pc(),memc_pagesize, data, log, phys, memc, perms);
+// printf("PC=%08x = MEMC_PAGE(%d): W %08x: log %x to phys %x, MEMC %d, perms %d\n", space.device().safe_pc(),memc_pagesize, data, log, phys, memc, perms);
}
diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c
index 4e0b8d86739..36e9b138caa 100644
--- a/src/mame/machine/asic65.c
+++ b/src/mame/machine/asic65.c
@@ -138,7 +138,7 @@ void asic65_config(running_machine &machine, int asictype)
void asic65_reset(running_machine &machine, int state)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* rom-based means reset and clear states */
if (asic65.cpu != NULL)
@@ -191,8 +191,8 @@ WRITE16_HANDLER( asic65_data_w )
/* rom-based use a deferred write mechanism */
if (asic65.type == ASIC65_ROMBASED)
{
- space->machine().scheduler().synchronize(FUNC(m68k_asic65_deferred_w), data | (offset << 16));
- space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ space.machine().scheduler().synchronize(FUNC(m68k_asic65_deferred_w), data | (offset << 16));
+ space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
return;
}
@@ -211,7 +211,7 @@ WRITE16_HANDLER( asic65_data_w )
else
{
int command = (data < MAX_COMMANDS) ? command_map[asic65.type][data] : OP_UNKNOWN;
- if (asic65.log) fprintf(asic65.log, "\n(%06X)%c%04X:", space->device().safe_pcbase(), (command == OP_UNKNOWN) ? '*' : ' ', data);
+ if (asic65.log) fprintf(asic65.log, "\n(%06X)%c%04X:", space.device().safe_pcbase(), (command == OP_UNKNOWN) ? '*' : ' ', data);
/* set the command number and reset the parameter/result indices */
asic65.command = data;
@@ -230,7 +230,7 @@ READ16_HANDLER( asic65_r )
if (asic65.type == ASIC65_ROMBASED)
{
asic65._68full = 0;
- space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
+ space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
return asic65._68data;
}
@@ -448,7 +448,7 @@ READ16_HANDLER( asic65_io_r )
/* bit 14 = 68FULL */
/* bit 13 = XFLG */
/* bit 12 = controlled by jumper */
- space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
+ space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
return (asic65.tfull << 15) | (asic65._68full << 14) | (asic65.xflg << 13) | 0x0000;
}
else
@@ -501,7 +501,7 @@ static READ16_HANDLER( asic65_stat_r )
static READ16_HANDLER( asci65_get_bio )
{
if (!asic65.tfull)
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
return asic65.tfull ? CLEAR_LINE : ASSERT_LINE;
}
diff --git a/src/mame/machine/asteroid.c b/src/mame/machine/asteroid.c
index dafaf4d8ffa..192f0020b9f 100644
--- a/src/mame/machine/asteroid.c
+++ b/src/mame/machine/asteroid.c
@@ -134,5 +134,5 @@ WRITE8_MEMBER(asteroid_state::astdelux_led_w)
void asteroid_state::machine_reset()
{
asteroid_bank_switch_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
- avgdvg_reset_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
+ avgdvg_reset_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
}
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index a858920401c..78b12eb9b3b 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -275,15 +275,15 @@ static void pokey_reset(running_machine &machine)
}
-static UINT8 console_read(address_space *space)
+static UINT8 console_read(address_space &space)
{
- return space->machine().root_device().ioport("console")->read();
+ return space.machine().root_device().ioport("console")->read();
}
-static void console_write(address_space *space, UINT8 data)
+static void console_write(address_space &space, UINT8 data)
{
- dac_device *dac = space->machine().device<dac_device>("dac");
+ dac_device *dac = space.machine().device<dac_device>("dac");
if (data & 0x08)
dac->write_unsigned8((UINT8)-120);
else
diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c
index 8b3e179c255..682b1e36e21 100644
--- a/src/mame/machine/atarigen.c
+++ b/src/mame/machine/atarigen.c
@@ -236,16 +236,16 @@ INTERRUPT_GEN( atarigen_scanline_int_gen )
WRITE16_HANDLER( atarigen_scanline_int_ack_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_scanline_int_state = 0;
- (*state->m_update_int_callback)(space->machine());
+ (*state->m_update_int_callback)(space.machine());
}
WRITE32_HANDLER( atarigen_scanline_int_ack32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_scanline_int_state = 0;
- (*state->m_update_int_callback)(space->machine());
+ (*state->m_update_int_callback)(space.machine());
}
@@ -269,16 +269,16 @@ INTERRUPT_GEN( atarigen_sound_int_gen )
WRITE16_HANDLER( atarigen_sound_int_ack_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_sound_int_state = 0;
- (*state->m_update_int_callback)(space->machine());
+ (*state->m_update_int_callback)(space.machine());
}
WRITE32_HANDLER( atarigen_sound_int_ack32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_sound_int_state = 0;
- (*state->m_update_int_callback)(space->machine());
+ (*state->m_update_int_callback)(space.machine());
}
@@ -302,16 +302,16 @@ INTERRUPT_GEN( atarigen_video_int_gen )
WRITE16_HANDLER( atarigen_video_int_ack_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_video_int_state = 0;
- (*state->m_update_int_callback)(space->machine());
+ (*state->m_update_int_callback)(space.machine());
}
WRITE32_HANDLER( atarigen_video_int_ack32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_video_int_state = 0;
- (*state->m_update_int_callback)(space->machine());
+ (*state->m_update_int_callback)(space.machine());
}
@@ -358,13 +358,13 @@ void atarigen_eeprom_reset(atarigen_state *state)
WRITE16_HANDLER( atarigen_eeprom_enable_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_eeprom_unlocked = 1;
}
WRITE32_HANDLER( atarigen_eeprom_enable32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_eeprom_unlocked = 1;
}
@@ -378,7 +378,7 @@ WRITE32_HANDLER( atarigen_eeprom_enable32_w )
WRITE16_HANDLER( atarigen_eeprom_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
if (!state->m_eeprom_unlocked)
return;
@@ -389,7 +389,7 @@ WRITE16_HANDLER( atarigen_eeprom_w )
WRITE32_HANDLER( atarigen_eeprom32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
if (!state->m_eeprom_unlocked)
return;
@@ -409,19 +409,19 @@ WRITE32_HANDLER( atarigen_eeprom32_w )
READ16_HANDLER( atarigen_eeprom_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
return state->m_eeprom[offset] | 0xff00;
}
READ16_HANDLER( atarigen_eeprom_upper_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
return state->m_eeprom[offset] | 0x00ff;
}
READ32_HANDLER( atarigen_eeprom_upper32_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
return (state->m_eeprom[offset * 2] << 16) | state->m_eeprom[offset * 2 + 1] | 0x00ff00ff;
}
@@ -468,7 +468,7 @@ DIRECT_UPDATE_MEMBER(atarigen_state::atarigen_slapstic_setdirect)
{
m_slapstic_last_pc = pc;
m_slapstic_last_address = address;
- atarigen_slapstic_r(&direct.space(), (address >> 1) & 0x3fff, 0xffff);
+ atarigen_slapstic_r(direct.space(), (address >> 1) & 0x3fff, 0xffff);
}
return ~0;
}
@@ -511,8 +511,8 @@ void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int ch
state->m_slapstic_base = base;
state->m_slapstic_mirror = mirror;
- address_space *space = downcast<cpu_device *>(device)->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::atarigen_slapstic_setdirect), state));
+ address_space &space = *downcast<cpu_device *>(device)->space(AS_PROGRAM);
+ space.set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::atarigen_slapstic_setdirect), state));
}
}
@@ -540,7 +540,7 @@ void atarigen_slapstic_reset(atarigen_state *state)
WRITE16_HANDLER( atarigen_slapstic_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
update_bank(state, slapstic_tweak(space, offset));
}
@@ -553,7 +553,7 @@ WRITE16_HANDLER( atarigen_slapstic_w )
READ16_HANDLER( atarigen_slapstic_r )
{
/* fetch the result from the current bank first */
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
int result = state->m_slapstic[offset & 0xfff];
/* then determine the new one */
@@ -607,17 +607,17 @@ INTERRUPT_GEN( atarigen_6502_irq_gen )
READ8_HANDLER( atarigen_6502_irq_ack_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_timed_int = 0;
- update_6502_irq(space->machine());
+ update_6502_irq(space.machine());
return 0;
}
WRITE8_HANDLER( atarigen_6502_irq_ack_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_timed_int = 0;
- update_6502_irq(space->machine());
+ update_6502_irq(space.machine());
}
@@ -641,7 +641,7 @@ void atarigen_ym2151_irq_gen(device_t *device, int irq)
WRITE16_HANDLER( atarigen_sound_reset_w )
{
- space->machine().scheduler().synchronize(FUNC(delayed_sound_reset));
+ space.machine().scheduler().synchronize(FUNC(delayed_sound_reset));
}
@@ -666,19 +666,19 @@ void atarigen_sound_reset(running_machine &machine)
WRITE16_HANDLER( atarigen_sound_w )
{
if (ACCESSING_BITS_0_7)
- space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space.machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
WRITE16_HANDLER( atarigen_sound_upper_w )
{
if (ACCESSING_BITS_8_15)
- space->machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 8) & 0xff);
+ space.machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 8) & 0xff);
}
WRITE32_HANDLER( atarigen_sound_upper32_w )
{
if (ACCESSING_BITS_24_31)
- space->machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 24) & 0xff);
+ space.machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 24) & 0xff);
}
@@ -691,7 +691,7 @@ WRITE32_HANDLER( atarigen_sound_upper32_w )
READ16_HANDLER( atarigen_sound_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_sound_to_cpu_ready = 0;
atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
return state->m_sound_to_cpu | 0xff00;
@@ -699,7 +699,7 @@ READ16_HANDLER( atarigen_sound_r )
READ16_HANDLER( atarigen_sound_upper_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_sound_to_cpu_ready = 0;
atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
return (state->m_sound_to_cpu << 8) | 0x00ff;
@@ -707,7 +707,7 @@ READ16_HANDLER( atarigen_sound_upper_r )
READ32_HANDLER( atarigen_sound_upper32_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_sound_to_cpu_ready = 0;
atarigen_sound_int_ack32_w(space, 0, 0, 0xffff);
return (state->m_sound_to_cpu << 24) | 0x00ffffff;
@@ -721,7 +721,7 @@ READ32_HANDLER( atarigen_sound_upper32_r )
WRITE8_HANDLER( atarigen_6502_sound_w )
{
- space->machine().scheduler().synchronize(FUNC(delayed_6502_sound_w), data);
+ space.machine().scheduler().synchronize(FUNC(delayed_6502_sound_w), data);
}
@@ -732,7 +732,7 @@ WRITE8_HANDLER( atarigen_6502_sound_w )
READ8_HANDLER( atarigen_6502_sound_r )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
state->m_cpu_to_sound_ready = 0;
state->m_sound_cpu->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
return state->m_cpu_to_sound;
@@ -764,7 +764,7 @@ static void update_6502_irq(running_machine &machine)
static TIMER_CALLBACK( delayed_sound_reset )
{
atarigen_state *state = machine.driver_data<atarigen_state>();
- address_space *space = state->m_sound_cpu->memory().space(AS_PROGRAM);
+ address_space &space = *state->m_sound_cpu->memory().space(AS_PROGRAM);
/* unhalt and reset the sound CPU */
if (param == 0)
@@ -1125,7 +1125,7 @@ static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newwor
/* scanline IRQ ack here */
case 0x1e:
/* hack: this should be a device */
- atarigen_scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
+ atarigen_scanline_int_ack_w(*screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
break;
/* log anything else */
@@ -1177,14 +1177,14 @@ UINT16 atarivc_r(screen_device &screen, offs_t offset)
WRITE16_HANDLER( atarigen_alpha_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_alpha[offset]);
state->m_alpha_tilemap->mark_tile_dirty(offset);
}
WRITE32_HANDLER( atarigen_alpha32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_alpha32[offset]);
if (ACCESSING_BITS_16_31)
state->m_alpha_tilemap->mark_tile_dirty(offset * 2);
@@ -1194,7 +1194,7 @@ WRITE32_HANDLER( atarigen_alpha32_w )
WRITE16_HANDLER( atarigen_alpha2_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_alpha2[offset]);
state->m_alpha2_tilemap->mark_tile_dirty(offset);
}
@@ -1224,14 +1224,14 @@ void atarigen_set_playfield2_latch(atarigen_state *state, int data)
WRITE16_HANDLER( atarigen_playfield_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield[offset]);
state->m_playfield_tilemap->mark_tile_dirty(offset);
}
WRITE32_HANDLER( atarigen_playfield32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield32[offset]);
if (ACCESSING_BITS_16_31)
state->m_playfield_tilemap->mark_tile_dirty(offset * 2);
@@ -1241,7 +1241,7 @@ WRITE32_HANDLER( atarigen_playfield32_w )
WRITE16_HANDLER( atarigen_playfield2_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield2[offset]);
state->m_playfield2_tilemap->mark_tile_dirty(offset);
}
@@ -1255,7 +1255,7 @@ WRITE16_HANDLER( atarigen_playfield2_w )
WRITE16_HANDLER( atarigen_playfield_large_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield[offset]);
state->m_playfield_tilemap->mark_tile_dirty(offset / 2);
}
@@ -1269,7 +1269,7 @@ WRITE16_HANDLER( atarigen_playfield_large_w )
WRITE16_HANDLER( atarigen_playfield_upper_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield_upper[offset]);
state->m_playfield_tilemap->mark_tile_dirty(offset);
}
@@ -1283,7 +1283,7 @@ WRITE16_HANDLER( atarigen_playfield_upper_w )
WRITE16_HANDLER( atarigen_playfield_dual_upper_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield_upper[offset]);
state->m_playfield_tilemap->mark_tile_dirty(offset);
state->m_playfield2_tilemap->mark_tile_dirty(offset);
@@ -1299,7 +1299,7 @@ WRITE16_HANDLER( atarigen_playfield_dual_upper_w )
WRITE16_HANDLER( atarigen_playfield_latched_lsb_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield[offset]);
state->m_playfield_tilemap->mark_tile_dirty(offset);
@@ -1318,7 +1318,7 @@ WRITE16_HANDLER( atarigen_playfield_latched_lsb_w )
WRITE16_HANDLER( atarigen_playfield_latched_msb_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield[offset]);
state->m_playfield_tilemap->mark_tile_dirty(offset);
@@ -1337,7 +1337,7 @@ WRITE16_HANDLER( atarigen_playfield_latched_msb_w )
WRITE16_HANDLER( atarigen_playfield2_latched_msb_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_playfield2[offset]);
state->m_playfield2_tilemap->mark_tile_dirty(offset);
@@ -1395,7 +1395,7 @@ void atarigen_halt_until_hblank_0(screen_device &screen)
WRITE16_HANDLER( atarigen_666_paletteram_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
int newword, r, g, b;
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
@@ -1405,7 +1405,7 @@ WRITE16_HANDLER( atarigen_666_paletteram_w )
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine(), offset, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space.machine(), offset, pal6bit(r), pal6bit(g), pal6bit(b));
}
@@ -1416,7 +1416,7 @@ WRITE16_HANDLER( atarigen_666_paletteram_w )
WRITE16_HANDLER( atarigen_expanded_666_paletteram_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
if (ACCESSING_BITS_8_15)
@@ -1430,7 +1430,7 @@ WRITE16_HANDLER( atarigen_expanded_666_paletteram_w )
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine(), palentry & 0x1ff, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space.machine(), palentry & 0x1ff, pal6bit(r), pal6bit(g), pal6bit(b));
}
}
@@ -1441,7 +1441,7 @@ WRITE16_HANDLER( atarigen_expanded_666_paletteram_w )
WRITE32_HANDLER( atarigen_666_paletteram32_w )
{
- atarigen_state *state = space->machine().driver_data<atarigen_state>();
+ atarigen_state *state = space.machine().driver_data<atarigen_state>();
int newword, r, g, b;
COMBINE_DATA(&state->m_generic_paletteram_32[offset]);
@@ -1454,7 +1454,7 @@ WRITE32_HANDLER( atarigen_666_paletteram32_w )
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine(), offset * 2, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space.machine(), offset * 2, pal6bit(r), pal6bit(g), pal6bit(b));
}
if (ACCESSING_BITS_0_15)
@@ -1465,7 +1465,7 @@ WRITE32_HANDLER( atarigen_666_paletteram32_w )
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine(), offset * 2 + 1, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space.machine(), offset * 2 + 1, pal6bit(r), pal6bit(g), pal6bit(b));
}
}
diff --git a/src/mame/machine/bagman.c b/src/mame/machine/bagman.c
index fe61f8e4c7a..567df6a04e1 100644
--- a/src/mame/machine/bagman.c
+++ b/src/mame/machine/bagman.c
@@ -210,15 +210,15 @@ UINT8 line;
MACHINE_RESET_MEMBER(bagman_state,bagman)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- bagman_pal16r6_w(*space, 0, 1); /*pin 2*/
- bagman_pal16r6_w(*space, 1, 1); /*pin 3*/
- bagman_pal16r6_w(*space, 2, 1); /*pin 4*/
- bagman_pal16r6_w(*space, 3, 1); /*pin 5*/
- bagman_pal16r6_w(*space, 4, 1); /*pin 6*/
- bagman_pal16r6_w(*space, 5, 1); /*pin 7*/
- bagman_pal16r6_w(*space, 6, 1); /*pin 8*/
- bagman_pal16r6_w(*space, 7, 1); /*pin 9*/
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ bagman_pal16r6_w(space, 0, 1); /*pin 2*/
+ bagman_pal16r6_w(space, 1, 1); /*pin 3*/
+ bagman_pal16r6_w(space, 2, 1); /*pin 4*/
+ bagman_pal16r6_w(space, 3, 1); /*pin 5*/
+ bagman_pal16r6_w(space, 4, 1); /*pin 6*/
+ bagman_pal16r6_w(space, 5, 1); /*pin 7*/
+ bagman_pal16r6_w(space, 6, 1); /*pin 8*/
+ bagman_pal16r6_w(space, 7, 1); /*pin 9*/
update_pal();
}
diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c
index 3fa53271e3f..0a03899470f 100644
--- a/src/mame/machine/balsente.c
+++ b/src/mame/machine/balsente.c
@@ -137,7 +137,7 @@ void balsente_state::machine_start()
void balsente_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int numbanks;
/* reset counters; counter 2's gate is tied high */
@@ -163,8 +163,8 @@ void balsente_state::machine_reset()
m_grudge_steering_result = 0;
/* reset the 6850 chips */
- balsente_m6850_w(*space, 0, 3);
- balsente_m6850_sound_w(*space, 0, 3);
+ balsente_m6850_w(space, 0, 3);
+ balsente_m6850_sound_w(space, 0, 3);
/* reset the noise generator */
memset(m_noise_position, 0, sizeof(m_noise_position));
diff --git a/src/mame/machine/bonzeadv.c b/src/mame/machine/bonzeadv.c
index c015259e214..f0d6e16921c 100644
--- a/src/mame/machine/bonzeadv.c
+++ b/src/mame/machine/bonzeadv.c
@@ -376,16 +376,16 @@ WRITE16_HANDLER( bonzeadv_cchip_ctrl_w )
WRITE16_HANDLER( bonzeadv_cchip_bank_w )
{
- asuka_state *state = space->machine().driver_data<asuka_state>();
+ asuka_state *state = space.machine().driver_data<asuka_state>();
state->m_current_bank = data & 7;
}
WRITE16_HANDLER( bonzeadv_cchip_ram_w )
{
- asuka_state *state = space->machine().driver_data<asuka_state>();
+ asuka_state *state = space.machine().driver_data<asuka_state>();
-// if (space->device().safe_pc()!=0xa028)
-// logerror("%08x: write %04x %04x cchip\n", space->device().safe_pc(), offset, data);
+// if (space.device().safe_pc()!=0xa028)
+// logerror("%08x: write %04x %04x cchip\n", space.device().safe_pc(), offset, data);
if (state->m_current_bank == 0)
{
@@ -393,20 +393,20 @@ WRITE16_HANDLER( bonzeadv_cchip_ram_w )
{
state->m_cc_port = data;
- coin_lockout_w(space->machine(), 1, data & 0x80);
- coin_lockout_w(space->machine(), 0, data & 0x40);
- coin_counter_w(space->machine(), 1, data & 0x20);
- coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_lockout_w(space.machine(), 1, data & 0x80);
+ coin_lockout_w(space.machine(), 0, data & 0x40);
+ coin_counter_w(space.machine(), 1, data & 0x20);
+ coin_counter_w(space.machine(), 0, data & 0x10);
}
if (offset == 0x0e && data != 0x00)
{
- WriteRestartPos(space->machine(), state->m_current_round);
+ WriteRestartPos(space.machine(), state->m_current_round);
}
if (offset == 0x0f && data != 0x00)
{
- WriteLevelData(space->machine());
+ WriteLevelData(space.machine());
}
if (offset == 0x10)
@@ -438,9 +438,9 @@ READ16_HANDLER( bonzeadv_cchip_ctrl_r )
READ16_HANDLER( bonzeadv_cchip_ram_r )
{
- asuka_state *state = space->machine().driver_data<asuka_state>();
+ asuka_state *state = space.machine().driver_data<asuka_state>();
-// logerror("%08x: read %04x cchip\n", space->device().safe_pc(), offset);
+// logerror("%08x: read %04x cchip\n", space.device().safe_pc(), offset);
if (state->m_current_bank == 0)
{
diff --git a/src/mame/machine/cchip.c b/src/mame/machine/cchip.c
index a2aea9185c2..6cacb58a9a6 100644
--- a/src/mame/machine/cchip.c
+++ b/src/mame/machine/cchip.c
@@ -83,14 +83,14 @@ WRITE16_HANDLER( cchip1_ram_w )
{
cc_port = data;
- coin_lockout_w(space->machine(), 1, data & 0x08);
- coin_lockout_w(space->machine(), 0, data & 0x04);
- coin_counter_w(space->machine(), 1, data & 0x02);
- coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_lockout_w(space.machine(), 1, data & 0x08);
+ coin_lockout_w(space.machine(), 0, data & 0x04);
+ coin_counter_w(space.machine(), 1, data & 0x02);
+ coin_counter_w(space.machine(), 0, data & 0x01);
}
else
{
-logerror("cchip1_w pc: %06x bank %02x offset %04x: %02x\n",space->device().safe_pc(),current_bank,offset,data);
+logerror("cchip1_w pc: %06x bank %02x offset %04x: %02x\n",space.device().safe_pc(),current_bank,offset,data);
}
}
@@ -117,9 +117,9 @@ READ16_HANDLER( cchip1_ram_r )
{
switch (offset)
{
- case 0x00: return space->machine().root_device().ioport("IN0")->read(); /* Player 1 controls + START1 */
- case 0x01: return space->machine().root_device().ioport("IN1")->read(); /* Player 2 controls + START2 */
- case 0x02: return space->machine().root_device().ioport("IN2")->read(); /* COINn + SERVICE1 + TILT */
+ case 0x00: return space.machine().root_device().ioport("IN0")->read(); /* Player 1 controls + START1 */
+ case 0x01: return space.machine().root_device().ioport("IN1")->read(); /* Player 2 controls + START2 */
+ case 0x02: return space.machine().root_device().ioport("IN2")->read(); /* COINn + SERVICE1 + TILT */
case 0x03: return cc_port;
}
}
diff --git a/src/mame/machine/cclimber.c b/src/mame/machine/cclimber.c
index d7aa9e54f9d..c26b55c6a48 100644
--- a/src/mame/machine/cclimber.c
+++ b/src/mame/machine/cclimber.c
@@ -6,12 +6,12 @@
static void cclimber_decode(running_machine &machine, const UINT8 convtable[8][16])
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
int A;
- space->set_decrypted_region(0x0000, 0xffff, decrypt);
+ space.set_decrypted_region(0x0000, 0xffff, decrypt);
for (A = 0x0000;A < 0x10000;A++)
{
diff --git a/src/mame/machine/cd32.c b/src/mame/machine/cd32.c
index 37971be4f52..966d9cd6314 100644
--- a/src/mame/machine/cd32.c
+++ b/src/mame/machine/cd32.c
@@ -399,7 +399,7 @@ static void akiko_set_cd_status(akiko_state *state, UINT32 status)
if ( state->m_cdrom_status[0] & state->m_cdrom_status[1] )
{
if (LOG_AKIKO_CD) logerror( "Akiko CD IRQ\n" );
- amiga_custom_w(state->m_space, REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*state->m_space, REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
}
diff --git a/src/mame/machine/cdi070.c b/src/mame/machine/cdi070.c
index a87fb590847..133f218236b 100644
--- a/src/mame/machine/cdi070.c
+++ b/src/mame/machine/cdi070.c
@@ -415,7 +415,7 @@ TIMER_CALLBACK( scc68070_tx_callback )
READ16_HANDLER( scc68070_periphs_r )
{
- cdi_state *state = space->machine().driver_data<cdi_state>();
+ cdi_state *state = space.machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->m_scc68070_regs;
switch(offset)
@@ -428,31 +428,31 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2000/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", scc68070->i2c.data_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", scc68070->i2c.data_register, mem_mask);
}
return scc68070->i2c.data_register;
case 0x2002/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", scc68070->i2c.address_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", scc68070->i2c.address_register, mem_mask);
}
return scc68070->i2c.address_register;
case 0x2004/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", scc68070->i2c.status_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", scc68070->i2c.status_register, mem_mask);
}
return scc68070->i2c.status_register;
case 0x2006/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", scc68070->i2c.control_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", scc68070->i2c.control_register, mem_mask);
}
return scc68070->i2c.control_register;
case 0x2008/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", scc68070->i2c.clock_control_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", scc68070->i2c.clock_control_register, mem_mask);
}
return scc68070->i2c.clock_control_register;
@@ -460,32 +460,32 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2010/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: UART Mode Register: %04x & %04x\n", scc68070->uart.mode_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: UART Mode Register: %04x & %04x\n", scc68070->uart.mode_register, mem_mask);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.mode_register | 0x20;
case 0x2012/2:
scc68070->uart.status_register |= (1 << 1);
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: UART Status Register: %04x & %04x\n", scc68070->uart.status_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: UART Status Register: %04x & %04x\n", scc68070->uart.status_register, mem_mask);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
if((scc68070->picr2 >> 4) & 7)
{
- space->machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), ASSERT_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), ASSERT_LINE);
}
if(scc68070->picr2 & 7)
{
- space->machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + ((scc68070->picr2 & 7) - 1), ASSERT_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + ((scc68070->picr2 & 7) - 1), ASSERT_LINE);
}
return scc68070->uart.status_register;
@@ -493,45 +493,45 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2014/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: UART Clock Select: %04x & %04x\n", scc68070->uart.clock_select, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: UART Clock Select: %04x & %04x\n", scc68070->uart.clock_select, mem_mask);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.clock_select | 0x08;
case 0x2016/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: UART Command Register: %02x & %04x\n", scc68070->uart.command_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: UART Command Register: %02x & %04x\n", scc68070->uart.command_register, mem_mask);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.command_register | 0x80;
case 0x2018/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: UART Transmit Holding Register: %02x & %04x\n", scc68070->uart.transmit_holding_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: UART Transmit Holding Register: %02x & %04x\n", scc68070->uart.transmit_holding_register, mem_mask);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.transmit_holding_register;
case 0x201a/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: UART Receive Holding Register: %02x & %04x\n", scc68070->uart.receive_holding_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: UART Receive Holding Register: %02x & %04x\n", scc68070->uart.receive_holding_register, mem_mask);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
if((scc68070->picr2 >> 4) & 7)
{
- space->machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), CLEAR_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), CLEAR_LINE);
}
scc68070->uart.receive_holding_register = scc68070->uart.receive_buffer[0];
@@ -550,31 +550,31 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2020/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: Timer Control Register: %02x & %04x\n", scc68070->timers.timer_control_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Timer Control Register: %02x & %04x\n", scc68070->timers.timer_control_register, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 12, "scc68070_periphs_r: Timer Status Register: %02x & %04x\n", scc68070->timers.timer_status_register, mem_mask);
+ verboselog(space.machine(), 12, "scc68070_periphs_r: Timer Status Register: %02x & %04x\n", scc68070->timers.timer_status_register, mem_mask);
}
return (scc68070->timers.timer_status_register << 8) | scc68070->timers.timer_control_register;
case 0x2022/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: Timer Reload Register: %04x & %04x\n", scc68070->timers.reload_register, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Timer Reload Register: %04x & %04x\n", scc68070->timers.reload_register, mem_mask);
return scc68070->timers.reload_register;
case 0x2024/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: Timer 0: %04x & %04x\n", scc68070->timers.timer0, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Timer 0: %04x & %04x\n", scc68070->timers.timer0, mem_mask);
return scc68070->timers.timer0;
case 0x2026/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: Timer 1: %04x & %04x\n", scc68070->timers.timer1, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Timer 1: %04x & %04x\n", scc68070->timers.timer1, mem_mask);
return scc68070->timers.timer1;
case 0x2028/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: Timer 2: %04x & %04x\n", scc68070->timers.timer2, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Timer 2: %04x & %04x\n", scc68070->timers.timer2, mem_mask);
return scc68070->timers.timer2;
// PICR1: 80002045
case 0x2044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 1: %02x & %04x\n", scc68070->picr1, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 1: %02x & %04x\n", scc68070->picr1, mem_mask);
}
return scc68070->picr1;
@@ -582,7 +582,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 2: %02x & %04x\n", scc68070->picr2, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 2: %02x & %04x\n", scc68070->picr2, mem_mask);
}
return scc68070->picr2 & 0x77;
@@ -591,65 +591,65 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x4040/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Error Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_error, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Error Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_error, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Status Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_status, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Status Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_status, mem_mask);
}
return (scc68070->dma.channel[(offset - 0x2000) / 32].channel_status << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].channel_error;
case 0x4004/2:
case 0x4044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Operation Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].operation_control, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Operation Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].operation_control, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Device Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_control, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Device Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_control, mem_mask);
}
return (scc68070->dma.channel[(offset - 0x2000) / 32].device_control << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].operation_control;
case 0x4006/2:
case 0x4046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Channel Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_control, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Channel Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_control, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Sequence Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Sequence Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control, mem_mask);
}
return (scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].channel_control;
case 0x400a/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter, mem_mask);
return scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter;
case 0x400c/2:
case 0x404c/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter >> 16), mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter >> 16), mem_mask);
return (scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter >> 16);
case 0x400e/2:
case 0x404e/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter, mem_mask);
return scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter;
case 0x4014/2:
case 0x4054/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter >> 16), mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter >> 16), mem_mask);
return (scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter >> 16);
case 0x4016/2:
case 0x4056/2:
- verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter, mem_mask);
return scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter;
// MMU: 80008000 to 8000807f
case 0x8000/2: // Status / Control register
if(ACCESSING_BITS_0_7)
{ // Control
- verboselog(space->machine(), 2, "scc68070_periphs_r: MMU Control: %02x & %04x\n", scc68070->mmu.control, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: MMU Control: %02x & %04x\n", scc68070->mmu.control, mem_mask);
return scc68070->mmu.control;
} // Status
else
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: MMU Status: %02x & %04x\n", scc68070->mmu.status, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: MMU Status: %02x & %04x\n", scc68070->mmu.status, mem_mask);
return scc68070->mmu.status;
}
break;
@@ -661,7 +661,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x8068/2:
case 0x8070/2:
case 0x8078/2: // Attributes (SD0-7)
- verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].attr, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].attr, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].attr;
case 0x8042/2:
case 0x804a/2:
@@ -671,7 +671,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x806a/2:
case 0x8072/2:
case 0x807a/2: // Segment Length (SD0-7)
- verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].length, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].length, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].length;
case 0x8044/2:
case 0x804c/2:
@@ -683,7 +683,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x807c/2: // Segment Number (SD0-7, A0=1 only)
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d segment: %02x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].segment, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: MMU descriptor %d segment: %02x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].segment, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].segment;
}
break;
@@ -695,10 +695,10 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x806e/2:
case 0x8076/2:
case 0x807e/2: // Base Address (SD0-7)
- verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].base, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_r: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].base, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].base;
default:
- verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
break;
}
@@ -707,14 +707,14 @@ READ16_HANDLER( scc68070_periphs_r )
WRITE16_HANDLER( scc68070_periphs_w )
{
- cdi_state *state = space->machine().driver_data<cdi_state>();
+ cdi_state *state = space.machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->m_scc68070_regs;
switch(offset)
{
// Interrupts: 80001001
case 0x1000/2: // LIR priority level
- verboselog(space->machine(), 2, "scc68070_periphs_w: LIR: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: LIR: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->lir);
break;
@@ -722,35 +722,35 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2000/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.data_register = data & 0x00ff;
}
break;
case 0x2002/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.address_register = data & 0x00ff;
}
break;
case 0x2004/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.status_register = data & 0x00ff;
}
break;
case 0x2006/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.control_register = data & 0x00ff;
}
break;
case 0x2008/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.clock_control_register = data & 0x00ff;
}
break;
@@ -759,70 +759,70 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2010/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: UART Mode Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: UART Mode Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.mode_register = data & 0x00ff;
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2012/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: UART Status Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: UART Status Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.status_register = data & 0x00ff;
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2014/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: UART Clock Select: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: UART Clock Select: %04x & %04x\n", data, mem_mask);
scc68070->uart.clock_select = data & 0x00ff;
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2016/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: UART Command Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: UART Command Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.command_register = data & 0x00ff;
- scc68070_uart_rx_check(space->machine(), scc68070);
- scc68070_uart_tx_check(space->machine(), scc68070);
+ scc68070_uart_rx_check(space.machine(), scc68070);
+ scc68070_uart_tx_check(space.machine(), scc68070);
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2018/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: UART Transmit Holding Register: %04x & %04x: %c\n", data, mem_mask, (data >= 0x20 && data < 0x7f) ? (data & 0x00ff) : ' ');
- scc68070_uart_tx(space->machine(), scc68070, data & 0x00ff);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: UART Transmit Holding Register: %04x & %04x: %c\n", data, mem_mask, (data >= 0x20 && data < 0x7f) ? (data & 0x00ff) : ' ');
+ scc68070_uart_tx(space.machine(), scc68070, data & 0x00ff);
scc68070->uart.transmit_holding_register = data & 0x00ff;
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x201a/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: UART Receive Holding Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: UART Receive Holding Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.receive_holding_register = data & 0x00ff;
}
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
@@ -830,35 +830,35 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2020/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: Timer Control Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Timer Control Register: %04x & %04x\n", data, mem_mask);
scc68070->timers.timer_control_register = data & 0x00ff;
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 12, "scc68070_periphs_w: Timer Status Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 12, "scc68070_periphs_w: Timer Status Register: %04x & %04x\n", data, mem_mask);
scc68070->timers.timer_status_register &= ~(data >> 8);
if(!scc68070->timers.timer_status_register)
{
UINT8 interrupt = scc68070->picr1 & 7;
- space->machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (interrupt - 1), CLEAR_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (interrupt - 1), CLEAR_LINE);
}
}
break;
case 0x2022/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: Timer Reload Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Timer Reload Register: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.reload_register);
break;
case 0x2024/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: Timer 0: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Timer 0: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.timer0);
scc68070_set_timer_callback(&state->m_scc68070_regs, 0);
break;
case 0x2026/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: Timer 1: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Timer 1: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.timer1);
break;
case 0x2028/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: Timer 2: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Timer 2: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.timer2);
break;
@@ -866,7 +866,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 1: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 1: %04x & %04x\n", data, mem_mask);
scc68070->picr1 = data & 0x00ff;
}
break;
@@ -875,7 +875,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 2: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 2: %04x & %04x\n", data, mem_mask);
scc68070->picr2 = data & 0x00ff;
}
break;
@@ -885,11 +885,11 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x4040/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Error (invalid): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Error (invalid): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Status: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Status: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].channel_status &= ~(data & 0xb0);
}
break;
@@ -897,12 +897,12 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x4044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Operation Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Operation Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].operation_control = data & 0x00ff;
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Device Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Device Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].device_control = data >> 8;
}
break;
@@ -910,7 +910,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x4046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Channel Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Channel Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].channel_control = data & 0x007f;
if(data & CCR_SO)
{
@@ -919,35 +919,35 @@ WRITE16_HANDLER( scc68070_periphs_w )
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Sequence Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Sequence Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control = data >> 8;
}
break;
case 0x400a/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
COMBINE_DATA(&scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter);
break;
case 0x400c/2:
case 0x404c/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter &= ~(mem_mask << 16);
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter |= data << 16;
break;
case 0x400e/2:
case 0x404e/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter &= ~mem_mask;
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter |= data;
break;
case 0x4014/2:
case 0x4054/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter &= ~(mem_mask << 16);
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter |= data << 16;
break;
case 0x4016/2:
case 0x4056/2:
- verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter &= ~mem_mask;
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter |= data;
break;
@@ -956,12 +956,12 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x8000/2: // Status / Control register
if(ACCESSING_BITS_0_7)
{ // Control
- verboselog(space->machine(), 2, "scc68070_periphs_w: MMU Control: %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: MMU Control: %04x & %04x\n", data, mem_mask);
scc68070->mmu.control = data & 0x00ff;
} // Status
else
{
- verboselog(space->machine(), 0, "scc68070_periphs_w: MMU Status (invalid): %04x & %04x\n", data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: MMU Status (invalid): %04x & %04x\n", data, mem_mask);
}
break;
case 0x8040/2:
@@ -972,7 +972,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x8068/2:
case 0x8070/2:
case 0x8078/2: // Attributes (SD0-7)
- verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
COMBINE_DATA(&scc68070->mmu.desc[(offset - 0x4020) / 4].attr);
break;
case 0x8042/2:
@@ -983,7 +983,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x806a/2:
case 0x8072/2:
case 0x807a/2: // Segment Length (SD0-7)
- verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
COMBINE_DATA(&scc68070->mmu.desc[(offset - 0x4020) / 4].length);
break;
case 0x8044/2:
@@ -996,7 +996,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x807c/2: // Segment Number (SD0-7, A0=1 only)
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d segment: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: MMU descriptor %d segment: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
scc68070->mmu.desc[(offset - 0x4020) / 4].segment = data & 0x00ff;
}
break;
@@ -1008,11 +1008,11 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x806e/2:
case 0x8076/2:
case 0x807e/2: // Base Address (SD0-7)
- verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space.machine(), 2, "scc68070_periphs_w: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
COMBINE_DATA(&scc68070->mmu.desc[(offset - 0x4020) / 4].base);
break;
default:
- verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space.machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
break;
}
}
diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c
index 0fe9125bdbd..aab2fd7ff4f 100644
--- a/src/mame/machine/cps2crpt.c
+++ b/src/mame/machine/cps2crpt.c
@@ -632,7 +632,7 @@ static void optimise_sboxes(struct optimised_sbox* out, const struct sbox* in)
static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UINT32 upper_limit)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
int length = machine.root_device().memregion("maincpu")->bytes();
UINT16 *dec = auto_alloc_array(machine, UINT16, length/2);
@@ -720,7 +720,7 @@ static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UIN
}
}
- space->set_decrypted_region(0x000000, length - 1, dec);
+ space.set_decrypted_region(0x000000, length - 1, dec);
m68k_set_encrypted_opcode_range(machine.device("maincpu"), 0, length);
}
diff --git a/src/mame/machine/cx4fn.c b/src/mame/machine/cx4fn.c
index 050e9be6a9a..c51d6511264 100644
--- a/src/mame/machine/cx4fn.c
+++ b/src/mame/machine/cx4fn.c
@@ -101,46 +101,46 @@ static void CX4_C4DrawWireFrame(running_machine &machine)
UINT8 Color;
INT32 i;
- address_space *space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
+ address_space &space = *machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for(i = cx4.ram[0x0295]; i > 0; i--, line += 5)
{
- if(space->read_byte(line) == 0xff &&
- space->read_byte(line + 1) == 0xff)
+ if(space.read_byte(line) == 0xff &&
+ space.read_byte(line + 1) == 0xff)
{
INT32 tmp = line - 5;
- while(space->read_byte(tmp + 2) == 0xff &&
- space->read_byte(tmp + 3) == 0xff &&
+ while(space.read_byte(tmp + 2) == 0xff &&
+ space.read_byte(tmp + 3) == 0xff &&
(tmp + 2) >= 0)
{
tmp -= 5;
}
point1 = (CX4_read(0x1f82) << 16) |
- (space->read_byte(tmp + 2) << 8) |
- space->read_byte(tmp + 3);
+ (space.read_byte(tmp + 2) << 8) |
+ space.read_byte(tmp + 3);
}
else
{
point1 = (CX4_read(0x1f82) << 16) |
- (space->read_byte(line) << 8) |
- space->read_byte(line + 1);
+ (space.read_byte(line) << 8) |
+ space.read_byte(line + 1);
}
point2 = (CX4_read(0x1f82) << 16) |
- (space->read_byte(line + 2) << 8) |
- space->read_byte(line + 3);
-
- X1=(space->read_byte(point1 + 0) << 8) |
- space->read_byte(point1 + 1);
- Y1=(space->read_byte(point1 + 2) << 8) |
- space->read_byte(point1 + 3);
- Z1=(space->read_byte(point1 + 4) << 8) |
- space->read_byte(point1 + 5);
- X2=(space->read_byte(point2 + 0) << 8) |
- space->read_byte(point2 + 1);
- Y2=(space->read_byte(point2 + 2) << 8) |
- space->read_byte(point2 + 3);
- Z2=(space->read_byte(point2 + 4) << 8) |
- space->read_byte(point2 + 5);
- Color = space->read_byte(line + 4);
+ (space.read_byte(line + 2) << 8) |
+ space.read_byte(line + 3);
+
+ X1=(space.read_byte(point1 + 0) << 8) |
+ space.read_byte(point1 + 1);
+ Y1=(space.read_byte(point1 + 2) << 8) |
+ space.read_byte(point1 + 3);
+ Z1=(space.read_byte(point1 + 4) << 8) |
+ space.read_byte(point1 + 5);
+ X2=(space.read_byte(point2 + 0) << 8) |
+ space.read_byte(point2 + 1);
+ Y2=(space.read_byte(point2 + 2) << 8) |
+ space.read_byte(point2 + 3);
+ Z2=(space.read_byte(point2 + 4) << 8) |
+ space.read_byte(point2 + 5);
+ Color = space.read_byte(line + 4);
CX4_C4DrawLine(X1, Y1, Z1, X2, Y2, Z2, Color);
}
}
diff --git a/src/mame/machine/cx4oam.c b/src/mame/machine/cx4oam.c
index c0cafe07017..916d1647c40 100644
--- a/src/mame/machine/cx4oam.c
+++ b/src/mame/machine/cx4oam.c
@@ -44,7 +44,7 @@ static void CX4_op00_00(running_machine &machine)
offset = (cx4.ram[0x626] & 3) * 2;
srcptr = 0x220;
- address_space *space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
+ address_space &space = *machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for(i = cx4.ram[0x620]; i > 0 && sprcount > 0; i--, srcptr += 16)
{
UINT32 spraddr = CX4_readl(srcptr + 7);
@@ -54,38 +54,38 @@ static void CX4_op00_00(running_machine &machine)
sprname = cx4.ram[srcptr + 5];
sprattr = cx4.ram[srcptr + 4] | cx4.ram[srcptr + 6];
- if(space->read_byte(spraddr))
+ if(space.read_byte(spraddr))
{
INT16 x, y;
INT32 sprcnt;
- for(sprcnt = space->read_byte(spraddr++); sprcnt > 0 && sprcount > 0; sprcnt--, spraddr += 4)
+ for(sprcnt = space.read_byte(spraddr++); sprcnt > 0 && sprcount > 0; sprcnt--, spraddr += 4)
{
- x = (INT8)space->read_byte(spraddr + 1);
+ x = (INT8)space.read_byte(spraddr + 1);
if(sprattr & 0x40)
{
- x = -x - ((space->read_byte(spraddr) & 0x20) ? 16 : 8);
+ x = -x - ((space.read_byte(spraddr) & 0x20) ? 16 : 8);
}
x += sprx;
if(x >= -16 && x <= 272)
{
- y = (INT8)space->read_byte(spraddr + 2);
+ y = (INT8)space.read_byte(spraddr + 2);
if(sprattr & 0x80)
{
- y = -y - ((space->read_byte(spraddr) & 0x20) ? 16 : 8);
+ y = -y - ((space.read_byte(spraddr) & 0x20) ? 16 : 8);
}
y += spry;
if(y >= -16 && y <= 224)
{
cx4.ram[oamptr ] = (UINT8)x;
cx4.ram[oamptr + 1] = (UINT8)y;
- cx4.ram[oamptr + 2] = sprname + space->read_byte(spraddr + 3);
- cx4.ram[oamptr + 3] = sprattr ^ (space->read_byte(spraddr) & 0xc0);
+ cx4.ram[oamptr + 2] = sprname + space.read_byte(spraddr + 3);
+ cx4.ram[oamptr + 3] = sprattr ^ (space.read_byte(spraddr) & 0xc0);
cx4.ram[oamptr2] &= ~(3 << offset);
if(x & 0x100)
{
cx4.ram[oamptr2] |= 1 << offset;
}
- if(space->read_byte(spraddr) & 0x20)
+ if(space.read_byte(spraddr) & 0x20)
{
cx4.ram[oamptr2] |= 2 << offset;
}
diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c
index 77247d311d3..14b30855bbf 100644
--- a/src/mame/machine/dc.c
+++ b/src/mame/machine/dc.c
@@ -128,9 +128,9 @@ static TIMER_CALLBACK( yuv_fifo_irq )
dc_update_interrupt_status(machine);
}
-static void wave_dma_execute(address_space *space)
+static void wave_dma_execute(address_space &space)
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
UINT32 src,dst,size;
dst = state->m_wave_dma.aica_addr;
@@ -144,7 +144,7 @@ static void wave_dma_execute(address_space *space)
{
for(;size<state->m_wave_dma.size;size+=4)
{
- space->write_dword(dst,space->read_dword(src));
+ space.write_dword(dst,space.read_dword(src));
src+=4;
dst+=4;
}
@@ -153,7 +153,7 @@ static void wave_dma_execute(address_space *space)
{
for(;size<state->m_wave_dma.size;size+=4)
{
- space->write_dword(src,space->read_dword(dst));
+ space.write_dword(src,space.read_dword(dst));
src+=4;
dst+=4;
}
@@ -166,12 +166,12 @@ static void wave_dma_execute(address_space *space)
state->m_wave_dma.flag = (state->m_wave_dma.indirect & 1) ? 1 : 0;
/* Note: if you trigger an instant DMA IRQ trigger, sfz3upper doesn't play any bgm. */
/* TODO: timing of this */
- space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(aica_dma_irq));
+ space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(aica_dma_irq));
}
-static void pvr_dma_execute(address_space *space)
+static void pvr_dma_execute(address_space &space)
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
UINT32 src,dst,size;
dst = state->m_pvr_dma.pvr_addr;
@@ -190,7 +190,7 @@ static void pvr_dma_execute(address_space *space)
{
for(;size<state->m_pvr_dma.size;size+=4)
{
- space->write_dword(dst,space->read_dword(src));
+ space.write_dword(dst,space.read_dword(src));
src+=4;
dst+=4;
}
@@ -199,14 +199,14 @@ static void pvr_dma_execute(address_space *space)
{
for(;size<state->m_pvr_dma.size;size+=4)
{
- space->write_dword(src,space->read_dword(dst));
+ space.write_dword(src,space.read_dword(dst));
src+=4;
dst+=4;
}
}
/* Note: do not update the params, since this DMA type doesn't support it. */
/* TODO: timing of this */
- space->machine().scheduler().timer_set(attotime::from_usec(250), FUNC(pvr_dma_irq));
+ space.machine().scheduler().timer_set(attotime::from_usec(250), FUNC(pvr_dma_irq));
}
// register decode helpers
@@ -321,7 +321,7 @@ void dc_update_interrupt_status(running_machine &machine)
{
if((state->dc_sysctrl_regs[SB_G2DTNRM] & state->dc_sysctrl_regs[SB_ISTNRM]) || (state->dc_sysctrl_regs[SB_G2DTEXT] & state->dc_sysctrl_regs[SB_ISTEXT]))
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
printf("Wave DMA HW trigger\n");
wave_dma_execute(space);
@@ -333,7 +333,7 @@ void dc_update_interrupt_status(running_machine &machine)
{
if((state->dc_sysctrl_regs[SB_PDTNRM] & state->dc_sysctrl_regs[SB_ISTNRM]) || (state->dc_sysctrl_regs[SB_PDTEXT] & state->dc_sysctrl_regs[SB_ISTEXT]))
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
printf("PVR-DMA HW trigger\n");
pvr_dma_execute(space);
@@ -343,17 +343,17 @@ void dc_update_interrupt_status(running_machine &machine)
READ64_HANDLER( dc_sysctrl_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
#if DEBUG_SYSCTRL
if ((reg != 0x40) && (reg != 0x41) && (reg != 0x42) && (reg != 0x23) && (reg > 2)) // filter out IRQ status reads
{
- mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %" I64FMT "x (PC=%x)\n", 0x5f6800+reg*4, state->dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, space->device().safe_pc());
+ mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %" I64FMT "x (PC=%x)\n", 0x5f6800+reg*4, state->dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, space.device().safe_pc());
}
#endif
@@ -362,7 +362,7 @@ READ64_HANDLER( dc_sysctrl_r )
WRITE64_HANDLER( dc_sysctrl_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
@@ -370,7 +370,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
UINT32 address;
struct sh4_ddt_dma ddtdata;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = state->dc_sysctrl_regs[reg];
state->dc_sysctrl_regs[reg] = dat; // 5f6800+off*4=dat
@@ -393,7 +393,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
ddtdata.direction=0;
ddtdata.channel=2;
ddtdata.mode=25; //011001
- sh4_dma_ddt(space->machine().device("maincpu"),&ddtdata);
+ sh4_dma_ddt(space.machine().device("maincpu"),&ddtdata);
#if DEBUG_SYSCTRL
if ((address >= 0x11000000) && (address <= 0x11FFFFFF))
if (state->dc_sysctrl_regs[SB_LMMODE0])
@@ -419,26 +419,26 @@ WRITE64_HANDLER( dc_sysctrl_w )
state->dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length;
/* 200 usecs breaks sfz3upper */
- space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(ch2_dma_irq));
+ space.machine().scheduler().timer_set(attotime::from_usec(50), FUNC(ch2_dma_irq));
/* simulate YUV FIFO processing here */
if((address & 0x1800000) == 0x0800000)
- space->machine().scheduler().timer_set(attotime::from_usec(500), FUNC(yuv_fifo_irq));
+ space.machine().scheduler().timer_set(attotime::from_usec(500), FUNC(yuv_fifo_irq));
}
break;
case SB_ISTNRM:
state->dc_sysctrl_regs[SB_ISTNRM] = old & ~(dat | 0xC0000000); // bits 31,30 ro
- dc_update_interrupt_status(space->machine());
+ dc_update_interrupt_status(space.machine());
break;
case SB_ISTEXT:
state->dc_sysctrl_regs[SB_ISTEXT] = old;
- dc_update_interrupt_status(space->machine());
+ dc_update_interrupt_status(space.machine());
break;
case SB_ISTERR:
state->dc_sysctrl_regs[SB_ISTERR] = old & ~dat;
- dc_update_interrupt_status(space->machine());
+ dc_update_interrupt_status(space.machine());
break;
case SB_SDST:
if(dat & 1)
@@ -448,7 +448,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
state->dc_sysctrl_regs[SB_SDST] = 0;
state->dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_SORT;
- dc_update_interrupt_status(space->machine());
+ dc_update_interrupt_status(space.machine());
}
break;
}
@@ -463,7 +463,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
READ64_HANDLER( dc_gdrom_r )
{
-// dc_state *state = space->machine().driver_data<dc_state>();
+// dc_state *state = space.machine().driver_data<dc_state>();
UINT32 off;
@@ -486,7 +486,7 @@ READ64_HANDLER( dc_gdrom_r )
WRITE64_HANDLER( dc_gdrom_w )
{
-// dc_state *state = space->machine().driver_data<dc_state>();
+// dc_state *state = space.machine().driver_data<dc_state>();
UINT32 dat,off;
if ((int)~mem_mask & 1)
@@ -505,24 +505,24 @@ WRITE64_HANDLER( dc_gdrom_w )
READ64_HANDLER( dc_g2_ctrl_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
mame_printf_verbose("G2CTRL: Unmapped read %08x\n", 0x5f7800+reg*4);
return (UINT64)state->g2bus_regs[reg] << shift;
}
WRITE64_HANDLER( dc_g2_ctrl_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat;
UINT8 old;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
state->g2bus_regs[reg] = dat; // 5f7800+reg*4=dat
@@ -608,14 +608,14 @@ INLINE int decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
READ64_HANDLER( pvr_ctrl_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
reg = decode_reg_64(offset, mem_mask, &shift);
#if DEBUG_PVRCTRL
- mame_printf_verbose("PVRCTRL: [%08x] read %x @ %x (reg %x), mask %" I64FMT "x (PC=%x)\n", 0x5f7c00+reg*4, state->pvrctrl_regs[reg], offset, reg, mem_mask, space->device().safe_pc());
+ mame_printf_verbose("PVRCTRL: [%08x] read %x @ %x (reg %x), mask %" I64FMT "x (PC=%x)\n", 0x5f7c00+reg*4, state->pvrctrl_regs[reg], offset, reg, mem_mask, space.device().safe_pc());
#endif
return (UINT64)state->pvrctrl_regs[reg] << shift;
@@ -623,7 +623,7 @@ READ64_HANDLER( pvr_ctrl_r )
WRITE64_HANDLER( pvr_ctrl_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat;
@@ -664,11 +664,11 @@ WRITE64_HANDLER( pvr_ctrl_w )
READ64_HANDLER( dc_modem_r )
{
-// dc_state *state = space->machine().driver_data<dc_state>();
+// dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
// from ElSemi: this makes Atomiswave do it's "verbose boot" with a Sammy logo and diagnostics instead of just running the cart.
// our PVR emulation is apparently not good enough for that to work yet though.
@@ -683,23 +683,23 @@ READ64_HANDLER( dc_modem_r )
WRITE64_HANDLER( dc_modem_w )
{
-// dc_state *state = space->machine().driver_data<dc_state>();
+// dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
mame_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask);
}
READ64_HANDLER( dc_rtc_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
- reg = decode_reg3216_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg3216_64(space.machine(), offset, mem_mask, &shift);
mame_printf_verbose("RTC: Unmapped read %08x\n", 0x710000+reg*4);
return (UINT64)state->dc_rtcregister[reg] << shift;
@@ -707,12 +707,12 @@ READ64_HANDLER( dc_rtc_r )
WRITE64_HANDLER( dc_rtc_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 old,dat;
- reg = decode_reg3216_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg3216_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = state->dc_rtcregister[reg];
state->dc_rtcregister[reg] = dat & 0xFFFF; // 5f6c00+off*4=dat
diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c
index 823aa288711..caa40be3cde 100644
--- a/src/mame/machine/deco102.c
+++ b/src/mame/machine/deco102.c
@@ -50,7 +50,7 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor)
void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor)
{
int i;
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
UINT16 *rom = (UINT16 *)machine.root_device().memregion(cputag)->base();
int size = machine.root_device().memregion(cputag)->bytes();
UINT16 *opcodes = auto_alloc_array(machine, UINT16, size / 2);
@@ -58,7 +58,7 @@ void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int addre
memcpy(buf, rom, size);
- space->set_decrypted_region(0, size - 1, opcodes);
+ space.set_decrypted_region(0, size - 1, opcodes);
m68k_set_encrypted_opcode_range(machine.device(cputag), 0, size);
for (i = 0; i < size / 2; i++)
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 76b144e7ace..785c3b9c5f6 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -59,9 +59,9 @@ WRITE8_HANDLER( decocass_coin_counter_w )
WRITE8_HANDLER( decocass_sound_command_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
- LOG(2,("CPU %s sound command -> $%02x\n", space->device().tag(), data));
- state->soundlatch_byte_w(*space, 0, data);
+ decocass_state *state = space.machine().driver_data<decocass_state>();
+ LOG(2,("CPU %s sound command -> $%02x\n", space.device().tag(), data));
+ state->soundlatch_byte_w(space, 0, data);
state->m_sound_ack |= 0x80;
/* remove snd cpu data ack bit. i don't see it in the schems, but... */
state->m_sound_ack &= ~0x40;
@@ -70,33 +70,33 @@ WRITE8_HANDLER( decocass_sound_command_w )
READ8_HANDLER( decocass_sound_data_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
- UINT8 data = state->soundlatch2_byte_r(*space, 0);
- LOG(2,("CPU %s sound data <- $%02x\n", space->device().tag(), data));
+ decocass_state *state = space.machine().driver_data<decocass_state>();
+ UINT8 data = state->soundlatch2_byte_r(space, 0);
+ LOG(2,("CPU %s sound data <- $%02x\n", space.device().tag(), data));
return data;
}
READ8_HANDLER( decocass_sound_ack_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data = state->m_sound_ack; /* D6+D7 */
- LOG(4,("CPU %s sound ack <- $%02x\n", space->device().tag(), data));
+ LOG(4,("CPU %s sound ack <- $%02x\n", space.device().tag(), data));
return data;
}
WRITE8_HANDLER( decocass_sound_data_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
- LOG(2,("CPU %s sound data -> $%02x\n", space->device().tag(), data));
- state->soundlatch2_byte_w(*space, 0, data);
+ decocass_state *state = space.machine().driver_data<decocass_state>();
+ LOG(2,("CPU %s sound data -> $%02x\n", space.device().tag(), data));
+ state->soundlatch2_byte_w(space, 0, data);
state->m_sound_ack |= 0x40;
}
READ8_HANDLER( decocass_sound_command_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
- UINT8 data = state->soundlatch_byte_r(*space, 0);
- LOG(4,("CPU %s sound command <- $%02x\n", space->device().tag(), data));
+ decocass_state *state = space.machine().driver_data<decocass_state>();
+ UINT8 data = state->soundlatch_byte_r(space, 0);
+ LOG(4,("CPU %s sound command <- $%02x\n", space.device().tag(), data));
state->m_audiocpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
state->m_sound_ack &= ~0x80;
return data;
@@ -112,14 +112,14 @@ TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen )
WRITE8_HANDLER( decocass_sound_nmi_enable_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_audio_nmi_enabled = 1;
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
}
READ8_HANDLER( decocass_sound_nmi_enable_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_audio_nmi_enabled = 1;
state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
return 0xff;
@@ -127,29 +127,29 @@ READ8_HANDLER( decocass_sound_nmi_enable_r )
READ8_HANDLER( decocass_sound_data_ack_reset_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data = 0xff;
- LOG(2,("CPU %s sound ack rst <- $%02x\n", space->device().tag(), data));
+ LOG(2,("CPU %s sound ack rst <- $%02x\n", space.device().tag(), data));
state->m_sound_ack &= ~0x40;
return data;
}
WRITE8_HANDLER( decocass_sound_data_ack_reset_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
- LOG(2,("CPU %s sound ack rst -> $%02x\n", space->device().tag(), data));
+ decocass_state *state = space.machine().driver_data<decocass_state>();
+ LOG(2,("CPU %s sound ack rst -> $%02x\n", space.device().tag(), data));
state->m_sound_ack &= ~0x40;
}
WRITE8_HANDLER( decocass_nmi_reset_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE );
}
WRITE8_HANDLER( decocass_quadrature_decoder_reset_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
/* just latch the analog controls here */
state->m_quadrature_decoder[0] = state->ioport("AN0")->read();
@@ -174,14 +174,14 @@ WRITE8_HANDLER( decocass_adc_w )
*/
READ8_HANDLER( decocass_input_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data = 0xff;
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
switch (offset & 7)
{
case 0: case 1: case 2:
- data = space->machine().root_device().ioport(portnames[offset & 7])->read();
+ data = space.machine().root_device().ioport(portnames[offset & 7])->read();
break;
case 3: case 4: case 5: case 6:
data = state->m_quadrature_decoder[(offset & 7) - 3];
@@ -209,8 +209,8 @@ READ8_HANDLER( decocass_input_r )
WRITE8_HANDLER( decocass_reset_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
- LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ decocass_state *state = space.machine().driver_data<decocass_state>();
+ LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
state->m_decocass_reset = data;
/* CPU #1 active high reset */
@@ -277,7 +277,7 @@ static void decocass_fno( running_machine &machine, offs_t offset, UINT8 data )
static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -289,7 +289,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data,
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -297,7 +297,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
+ UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -337,7 +337,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->m_type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
state->m_latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -357,7 +357,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
static READ8_HANDLER( decocass_type1_pass_136_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -369,7 +369,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data,
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -377,7 +377,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
+ UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -417,7 +417,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->m_type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
state->m_latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -437,7 +437,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -449,7 +449,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data,
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -457,7 +457,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
+ UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -497,7 +497,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
(((state->m_latch1 >> MAP7(state->m_type1_inmap)) & 1) << MAP7(state->m_type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
state->m_latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -517,7 +517,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -529,7 +529,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data,
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -537,7 +537,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
+ UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -577,7 +577,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->m_type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
state->m_latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -599,7 +599,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -611,7 +611,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data,
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -619,7 +619,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
+ UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
if (state->m_firsttime)
{
@@ -659,7 +659,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->m_type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n",
- space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
state->m_latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -680,7 +680,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
***************************************************************************/
static READ8_HANDLER( decocass_type2_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == state->m_type2_xx_latch)
@@ -689,7 +689,7 @@ static READ8_HANDLER( decocass_type2_r )
{
UINT8 *prom = state->memregion("dongle")->base();
data = prom[256 * state->m_type2_d2_latch + state->m_type2_promaddr];
- LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, 256 * state->m_type2_d2_latch + state->m_type2_promaddr));
+ LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, 256 * state->m_type2_d2_latch + state->m_type2_promaddr));
}
else
{
@@ -703,30 +703,30 @@ static READ8_HANDLER( decocass_type2_r )
else
data = offset & 0xff;
- LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, offset & 1 ? "STATUS" : "DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, offset & 1 ? "STATUS" : "DATA"));
}
return data;
}
static WRITE8_HANDLER( decocass_type2_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (1 == state->m_type2_xx_latch)
{
if (1 == (offset & 1))
{
- LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
else
{
state->m_type2_promaddr = data;
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, state->m_type2_promaddr));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, state->m_type2_promaddr));
return;
}
}
else
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA"));
}
if (1 == (offset & 1))
{
@@ -740,7 +740,7 @@ static WRITE8_HANDLER( decocass_type2_w )
upi41_master_w(state->m_mcu, offset & 1, data);
#ifdef MAME_DEBUG
- decocass_fno(space->machine(), offset, data);
+ decocass_fno(space.machine(), offset, data);
#endif
}
@@ -764,7 +764,7 @@ static WRITE8_HANDLER( decocass_type2_w )
***************************************************************************/
static READ8_HANDLER( decocass_type3_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data, save;
if (1 == (offset & 1))
@@ -773,7 +773,7 @@ static READ8_HANDLER( decocass_type3_r )
{
UINT8 *prom = state->memregion("dongle")->base();
data = prom[state->m_type3_ctrs];
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, state->m_type3_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, state->m_type3_ctrs));
if (++state->m_type3_ctrs == 4096)
state->m_type3_ctrs = 0;
}
@@ -782,12 +782,12 @@ static READ8_HANDLER( decocass_type3_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
}
@@ -796,7 +796,7 @@ static READ8_HANDLER( decocass_type3_r )
if (1 == state->m_type3_pal_19)
{
save = data = 0xff; /* open data bus? */
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
else
{
@@ -938,7 +938,7 @@ static READ8_HANDLER( decocass_type3_r )
(BIT(save, 7) << 7);
}
state->m_type3_d0_latch = save & 1;
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
}
else
{
@@ -952,7 +952,7 @@ static READ8_HANDLER( decocass_type3_r )
(BIT(save, 5) << 5) |
(BIT(save, 6) << 7) |
(BIT(save, 7) << 6);
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
state->m_type3_d0_latch = save & 1;
}
}
@@ -963,13 +963,13 @@ static READ8_HANDLER( decocass_type3_r )
static WRITE8_HANDLER( decocass_type3_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (1 == (offset & 1))
{
if (1 == state->m_type3_pal_19)
{
state->m_type3_ctrs = data << 4;
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, "LDCTRS"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, "LDCTRS"));
return;
}
else
@@ -981,11 +981,11 @@ static WRITE8_HANDLER( decocass_type3_w )
if (1 == state->m_type3_pal_19)
{
/* write nowhere?? */
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, "nowhere?"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, "nowhere?"));
return;
}
}
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->m_mcu, offset, data);
}
@@ -1004,7 +1004,7 @@ static WRITE8_HANDLER( decocass_type3_w )
static READ8_HANDLER( decocass_type4_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -1012,22 +1012,22 @@ static READ8_HANDLER( decocass_type4_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
else
{
if (state->m_type4_latch)
{
- UINT8 *prom = space->machine().root_device().memregion("dongle")->base();
+ UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
data = prom[state->m_type4_ctrs];
- LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.', state->m_type4_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.', state->m_type4_ctrs));
state->m_type4_ctrs = (state->m_type4_ctrs + 1) & 0x7fff;
}
else
@@ -1035,12 +1035,12 @@ static READ8_HANDLER( decocass_type4_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 0);
- LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
}
@@ -1050,13 +1050,13 @@ static READ8_HANDLER( decocass_type4_r )
static WRITE8_HANDLER( decocass_type4_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (1 == (offset & 1))
{
if (1 == state->m_type4_latch)
{
state->m_type4_ctrs = (state->m_type4_ctrs & 0x00ff) | ((data & 0x7f) << 8);
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, state->m_type4_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, state->m_type4_ctrs));
return;
}
else
@@ -1070,11 +1070,11 @@ static WRITE8_HANDLER( decocass_type4_w )
if (state->m_type4_latch)
{
state->m_type4_ctrs = (state->m_type4_ctrs & 0xff00) | data;
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, state->m_type4_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, state->m_type4_ctrs));
return;
}
}
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->m_mcu, offset, data);
}
@@ -1089,7 +1089,7 @@ static WRITE8_HANDLER( decocass_type4_w )
static READ8_HANDLER( decocass_type5_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -1097,12 +1097,12 @@ static READ8_HANDLER( decocass_type5_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
else
@@ -1110,19 +1110,19 @@ static READ8_HANDLER( decocass_type5_r )
if (state->m_type5_latch)
{
data = 0x55; /* Only a fixed value? It looks like this is all we need to do */
- LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
}
else
{
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 0);
- LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
}
@@ -1132,12 +1132,12 @@ static READ8_HANDLER( decocass_type5_r )
static WRITE8_HANDLER( decocass_type5_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (1 == (offset & 1))
{
if (1 == state->m_type5_latch)
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, "latch #2??"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, "latch #2??"));
return;
}
else
@@ -1149,11 +1149,11 @@ static WRITE8_HANDLER( decocass_type5_w )
if (state->m_type5_latch)
{
/* write nowhere?? */
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, "nowhere?"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, "nowhere?"));
return;
}
}
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->m_mcu, offset, data);
}
@@ -1167,7 +1167,7 @@ static WRITE8_HANDLER( decocass_type5_w )
static READ8_HANDLER( decocass_nodong_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -1175,12 +1175,12 @@ static READ8_HANDLER( decocass_nodong_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
else
@@ -1188,12 +1188,12 @@ static READ8_HANDLER( decocass_nodong_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->m_mcu, 0);
- LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, (data >= 32) ? data : '.'));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
@@ -1208,7 +1208,7 @@ static READ8_HANDLER( decocass_nodong_r )
READ8_HANDLER( decocass_e5xx_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
/* E5x2-E5x3 and mirrors */
@@ -1227,8 +1227,8 @@ READ8_HANDLER( decocass_e5xx_r )
(!tape_is_present(state->m_cassette) << 7); /* D7 = cassette present */
LOG(4,("%10s 6502-PC: %04x decocass_e5xx_r(%02x): $%02x <- STATUS (%s%s%s%s%s%s%s%s)\n",
- space->machine().time().as_string(6),
- space->device().safe_pcbase(),
+ space.machine().time().as_string(6),
+ space.device().safe_pcbase(),
offset, data,
data & 0x01 ? "" : "REQ/",
data & 0x02 ? "" : " FNO/",
@@ -1251,7 +1251,7 @@ READ8_HANDLER( decocass_e5xx_r )
WRITE8_HANDLER( decocass_e5xx_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (state->m_dongle_w)
{
(*state->m_dongle_w)(space, offset, data);
@@ -1260,15 +1260,15 @@ WRITE8_HANDLER( decocass_e5xx_w )
if (0 == (offset & E5XX_MASK))
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->m_mcu, offset & 1, data);
#ifdef MAME_DEBUG
- decocass_fno(space->machine(), offset, data);
+ decocass_fno(space.machine(), offset, data);
#endif
}
else
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", space->machine().time().as_string(6), space->device().safe_pcbase(), offset, data));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
}
}
@@ -1286,7 +1286,7 @@ WRITE8_HANDLER( decocass_e5xx_w )
WRITE8_HANDLER( decocass_e900_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_de0091_enable = data & 1;
state->membank("bank1")->set_entry(data & 1);
/* Perhaps the second row of ROMs is enabled by another bit.
@@ -1298,7 +1298,7 @@ WRITE8_HANDLER( decocass_e900_w )
WRITE8_HANDLER( decocass_de0091_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
/* don't allow writes to the ROMs */
if (!state->m_de0091_enable)
decocass_charram_w(space, offset, data);
@@ -1719,12 +1719,12 @@ MACHINE_RESET_MEMBER(decocass_state,cflyball)
WRITE8_HANDLER( i8041_p1_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data != state->m_i8041_p1_write_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p1_w: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine().time().as_string(6),
- space->device().safe_pcbase(),
+ space.machine().time().as_string(6),
+ space.device().safe_pcbase(),
data,
data & 0x01 ? "" : "DATA-WRT",
data & 0x02 ? "" : " DATA-CLK",
@@ -1754,14 +1754,14 @@ WRITE8_HANDLER( i8041_p1_w )
READ8_HANDLER( i8041_p1_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data = state->m_i8041_p1;
if (data != state->m_i8041_p1_read_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p1_r: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine().time().as_string(6),
- space->device().safe_pcbase(),
+ space.machine().time().as_string(6),
+ space.device().safe_pcbase(),
data,
data & 0x01 ? "" : "DATA-WRT",
data & 0x02 ? "" : " DATA-CLK",
@@ -1778,12 +1778,12 @@ READ8_HANDLER( i8041_p1_r )
WRITE8_HANDLER( i8041_p2_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data != state->m_i8041_p2_write_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p2_w: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine().time().as_string(6),
- space->device().safe_pcbase(),
+ space.machine().time().as_string(6),
+ space.device().safe_pcbase(),
data,
data & 0x01 ? "" : "FNO/",
data & 0x02 ? "" : " EOT/",
@@ -1800,7 +1800,7 @@ WRITE8_HANDLER( i8041_p2_w )
READ8_HANDLER( i8041_p2_r )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
UINT8 data;
data = (state->m_i8041_p2 & ~0xe0) | tape_get_status_bits(state->m_cassette);
@@ -1808,8 +1808,8 @@ READ8_HANDLER( i8041_p2_r )
if (data != state->m_i8041_p2_read_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p2_r: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine().time().as_string(6),
- space->device().safe_pcbase(),
+ space.machine().time().as_string(6),
+ space.device().safe_pcbase(),
data,
data & 0x01 ? "" : "FNO/",
data & 0x02 ? "" : " EOT/",
diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c
index b283b1b308d..48ac36cf5ed 100644
--- a/src/mame/machine/decoprot.c
+++ b/src/mame/machine/decoprot.c
@@ -111,11 +111,11 @@ void decoprot_reset(running_machine &machine)
WRITE16_HANDLER( deco16_104_prot_w ) /* Wizard Fire */
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
if (offset == (0x150 / 2))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
@@ -124,7 +124,7 @@ WRITE16_HANDLER( deco16_104_prot_w ) /* Wizard Fire */
&& offset != (0x370 >> 1) && offset != (0x3c0 >> 1) && offset != (0x430 >> 1) && offset != (0x460 >> 1)
&& offset != (0x5a0 >> 1) && offset != (0x5b0 >> 1) && offset != (0x6e0 >> 1) && offset != (0x7d0 >> 1)
)
- logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n", space->device().safe_pc(), offset << 1, data);
+ logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n", space.device().safe_pc(), offset << 1, data);
COMBINE_DATA(&deco16_prot_ram[offset]);
}
@@ -133,16 +133,16 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */
{
switch (offset<<1) {
case 0x110: /* Player input */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
case 0x36c: /* Coins */
case 0x334: /* Probably also, c6, 2c0, 2e0, 4b2, 46a, 4da, rohga is 44c */
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x0dc:
- return space->machine().root_device().ioport("IN1")->read()<<4;
+ return space.machine().root_device().ioport("IN1")->read()<<4;
case 0x494: /* Dips */
- return space->machine().root_device().ioport("DSW1_2")->read();
+ return space.machine().root_device().ioport("DSW1_2")->read();
case 0x244:
return deco16_prot_ram[0];
@@ -223,7 +223,7 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */
return ((deco16_prot_ram[0x460/2]&0x0007)<<13) | ((deco16_prot_ram[0x460/2]&0x0008)<<9);
}
- logerror("Deco Protection PC %06x: warning - read unmapped memory address %04x\n",space->device().safe_pc(),offset<<1);
+ logerror("Deco Protection PC %06x: warning - read unmapped memory address %04x\n",space.device().safe_pc(),offset<<1);
return 0;
}
@@ -231,11 +231,11 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */
WRITE16_HANDLER( deco16_60_prot_w ) /* Edward Randy */
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
if (offset == (0x64 / 2))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
}
COMBINE_DATA(&deco16_prot_ram[offset]);
@@ -252,7 +252,7 @@ if (offset!=0x32 && offset!=0x36/2 && offset!=0x9e/2 && offset!=0x76/2
&& offset!=0x40/2 && offset!=0x54/2 && offset!=0x56/2 && offset!=0x58/2 && offset!=0x6a/2 && offset!=0x2c/2
&& offset!=0 && offset!=0x34 && offset!=0x8a && offset!=0x8e && offset!=0x92 && offset!=0x96
)
-logerror("Protection PC %06x: warning - write %04x to %04x\n",space->device().safe_pc(),data,offset<<1);
+logerror("Protection PC %06x: warning - write %04x to %04x\n",space.device().safe_pc(),data,offset<<1);
}
@@ -367,9 +367,9 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
/* Player 1 & 2 controls, read in IRQ then written *back* to protection device */
case 0x50: /* written to 9e byte */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
case 0x6f8: /* written to 76 byte */
- return (space->machine().root_device().ioport("IN0")->read()>>8)|(space->machine().root_device().ioport("IN0")->read()<<8); /* byte swap IN0 */
+ return (space.machine().root_device().ioport("IN0")->read()>>8)|(space.machine().root_device().ioport("IN0")->read()<<8); /* byte swap IN0 */
case 0x5c: /* After coin insert, high 0x8000 bit set starts game */
return deco16_prot_ram[0x3b];
@@ -379,9 +379,9 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return ((deco16_prot_ram[0x9e/2]&0xff00)>>8) | ((deco16_prot_ram[0x9e/2]&0x00ff)<<8);
case 0xac: /* Dip switches */
- return space->machine().root_device().ioport("DSW")->read();
+ return space.machine().root_device().ioport("DSW")->read();
case 0xc2:
- return space->machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
+ return space.machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
case 0x5d4: /* The state of the dips last frame */
return deco16_prot_ram[0x34/2];
@@ -393,7 +393,7 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return (((deco16_prot_ram[0]&0xfff0)>>0) | ((deco16_prot_ram[0]&0x000c)>>2) | ((deco16_prot_ram[0]&0x0003)<<2)) & (~deco16_prot_ram[0x36/2]);
case 0x76a: /* Coins */
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x284: /* Bit shifting with inverted mask register */
return (((deco16_prot_ram[0x40/2]&0xfff0)>>0) | ((deco16_prot_ram[0x40/2]&0x0007)<<1) | ((deco16_prot_ram[0x40/2]&0x0008)>>3)) & (~deco16_prot_ram[0x36/2]);
@@ -407,12 +407,12 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return (((deco16_prot_ram[0x6a/2]&0x00f0)<<4) | ((deco16_prot_ram[0x6a/2]&0x0f00)<<4) | ((deco16_prot_ram[0x6a/2]&0x0007)<<5) | ((deco16_prot_ram[0x6a/2]&0x0008)<<1)) & (~deco16_prot_ram[0x36/2]);
case 0x7d6: /* XOR IN0 */
- return space->machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
+ return space.machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
case 0x4b4:
return ((deco16_prot_ram[0x32/2]&0x00f0)<<8) | ((deco16_prot_ram[0x32/2]&0x000e)<<7) | ((deco16_prot_ram[0x32/2]&0x0001)<<11);
}
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space->device().safe_pc(),offset*2);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space.device().safe_pc(),offset*2);
return 0;
}
@@ -422,11 +422,11 @@ static int mutantf_port_0e_hack=0, mutantf_port_6a_hack=0,mutantf_port_e8_hack=0
WRITE16_HANDLER( deco16_66_prot_w ) /* Mutant Fighter */
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
if (offset == (0x64 / 2))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
@@ -458,7 +458,7 @@ WRITE16_HANDLER( deco16_66_prot_w ) /* Mutant Fighter */
&& offset!=0xb6 && offset!=0xfa && offset!=0xe4 && offset!=0x3a && offset!=0x1e
&& offset!=0x38 && offset!=0x92 && offset!=0xa2 && offset!=0x308 && offset!=0x40e
)
- logerror("Protection PC %06x: warning - write %04x to %04x\n",space->device().safe_pc(),data,offset);
+ logerror("Protection PC %06x: warning - write %04x to %04x\n",space.device().safe_pc(),data,offset);
}
READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
@@ -470,15 +470,15 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
switch (offset*2) {
case 0xac: /* Dip switches */
- return space->machine().root_device().ioport("DSW")->read();
+ return space.machine().root_device().ioport("DSW")->read();
case 0xc2: /* Dip switches */
- return space->machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
+ return space.machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
case 0x46: /* Coins */
- return space->machine().root_device().ioport("IN1")->read() ^ deco16_prot_ram[0x2c/2];
+ return space.machine().root_device().ioport("IN1")->read() ^ deco16_prot_ram[0x2c/2];
case 0x50: /* Player 1 & 2 input ports */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
case 0x63c: /* Player 1 & 2 input ports */
- return space->machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
+ return space.machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
case 0x5f4:
return deco16_prot_ram[0x18/2];
@@ -556,7 +556,7 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
{
int ret=mutantf_port_0e_hack;
mutantf_port_0e_hack=0x800;
- //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space->device().safe_pc(),offset<<1);
+ //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space.device().safe_pc(),offset<<1);
return ret;
}
@@ -564,7 +564,7 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
{
int ret=mutantf_port_6a_hack;
mutantf_port_6a_hack=0x2866;
- //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space->device().safe_pc(),offset<<1);
+ //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space.device().safe_pc(),offset<<1);
return ret;
}
@@ -572,20 +572,20 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
{
int ret=mutantf_port_e8_hack;
mutantf_port_e8_hack=0x2401;
- //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space->device().safe_pc(),offset<<1);
+ //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space.device().safe_pc(),offset<<1);
return ret;
}
case 0xaa: /* ??? */
- //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space->device().safe_pc(),offset<<1);
+ //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space.device().safe_pc(),offset<<1);
return 0xc080;
case 0x42: /* Strange, but consistent */
- //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space->device().safe_pc(),offset<<1);
+ //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",space.device().safe_pc(),offset<<1);
return deco16_prot_ram[0x2c/2]^0x5302;
case 0x48: /* Correct for test data, but I wonder if the 0x1800 is from an address, not a constant */
- //logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space->device().safe_pc(),offset<<1);
+ //logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space.device().safe_pc(),offset<<1);
return (0x1800) & (~deco16_prot_ram[0x36/2]);
case 0x52:
@@ -602,7 +602,7 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
popmessage("Deco66: Read unmapped port %04x\n",offset*2);
#endif
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space->device().safe_pc(),offset<<1);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space.device().safe_pc(),offset<<1);
return 0;
}
@@ -610,11 +610,11 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
WRITE16_HANDLER( deco16_104_cninja_prot_w )
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
if (offset == (0xa8 / 2))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
@@ -655,16 +655,16 @@ READ16_HANDLER( deco16_104_cninja_prot_r )
return deco16_prot_ram[15];
case 0x36: /* Dip switches */
- return space->machine().root_device().ioport("DSW")->read();
+ return space.machine().root_device().ioport("DSW")->read();
case 0x1c8: /* Coins */
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x22c: /* Player 1 & 2 input ports */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
}
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space->device().safe_pc(),offset);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",space.device().safe_pc(),offset);
return 0;
}
@@ -672,13 +672,13 @@ READ16_HANDLER( deco16_104_cninja_prot_r )
WRITE16_HANDLER( deco16_146_funkyjet_prot_w )
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
COMBINE_DATA(&deco16_prot_ram[offset]);
if (offset == (0x10a >> 1))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
}
@@ -753,15 +753,15 @@ READ16_HANDLER( deco16_146_funkyjet_prot_r )
return ((deco16_prot_ram[0x78e>>1]>>4)&0xff00) | (deco16_prot_ram[0x78e>>1]&0x000f) | ((deco16_prot_ram[0x78e>>1]<<8)&0xf000);
case 0x00c >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
- return space->machine().root_device().ioport("INPUTS")->read();
+ return space.machine().root_device().ioport("INPUTS")->read();
case 0x778 >> 1: /* Credits */
- return space->machine().root_device().ioport("SYSTEM")->read();
+ return space.machine().root_device().ioport("SYSTEM")->read();
case 0x382 >> 1: /* DIPS */
- return space->machine().root_device().ioport("DSW")->read();
+ return space.machine().root_device().ioport("DSW")->read();
}
- if (space->device().safe_pc()!=0xc0ea)
- logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", space->device().safe_pc(), offset<<1, space->machine().root_device().ioport("INPUTS")->read());
+ if (space.device().safe_pc()!=0xc0ea)
+ logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", space.device().safe_pc(), offset<<1, space.machine().root_device().ioport("INPUTS")->read());
return 0;
}
@@ -794,11 +794,11 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w )
COMBINE_DATA(&decoprot_buffer_ram[offset]);
else
COMBINE_DATA(&deco16_prot_ram[offset]);
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
if (offset == (0xa8 / 2))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
@@ -810,11 +810,11 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w )
offset=offset*2;
- //logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",space->device().safe_pc(),offset,data);
+ //logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",space.device().safe_pc(),offset,data);
if (offset==0xee || offset==0x42 || offset==0xa8)
return;
-// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",space->device().safe_pc(),offset,data);
+// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",space.device().safe_pc(),offset,data);
#if 1
// 66 7c 7e 28 58 4a 9e
@@ -831,7 +831,7 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w )
return;
// if (offset==0x3c)
-// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",space->device().safe_pc(),offset,data);
+// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",space.device().safe_pc(),offset,data);
// Actually read:
// 22 24 26 2c 2e 30 32 3c 40 44 46 48 60 62 66 6a 6e 76 7e 80 82 84 86 88 8a 8c 90 94 96 98 9a 9c a0 c0 c4 c6 c8 cc ce d6 dc de
@@ -859,7 +859,7 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w )
return;
#endif
- logerror("CONTROL PC %06x: warning - write unmapped protection memory address %04x %04x\n",space->device().safe_pc(),offset,data);
+ logerror("CONTROL PC %06x: warning - write unmapped protection memory address %04x %04x\n",space.device().safe_pc(),offset,data);
}
READ16_HANDLER( deco16_104_rohga_prot_r )
@@ -867,17 +867,17 @@ READ16_HANDLER( deco16_104_rohga_prot_r )
const UINT16* prot_ram=decoprot_buffer_ram_selected ? decoprot_buffer_ram : deco16_prot_ram;
// if (offset!=0x88/2 && offset!=0x44c/2 && offset!=0x36c/2 && offset!=0x292/2)
-// logerror("Protection PC %06x: warning - read prot address %04x\n",space->device().safe_pc(),offset<<1);
+// logerror("Protection PC %06x: warning - read prot address %04x\n",space.device().safe_pc(),offset<<1);
switch (offset) {
case 0x88/2: /* Player 1 & 2 input ports */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
case 0x36c/2:
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x44c/2:
- return ((space->machine().root_device().ioport("IN1")->read() & 0x7)<<13)|((space->machine().root_device().ioport("IN1")->read() & 0x8)<<9);
+ return ((space.machine().root_device().ioport("IN1")->read() & 0x7)<<13)|((space.machine().root_device().ioport("IN1")->read() & 0x8)<<9);
case 0x292/2: /* Dips */
- return space->machine().root_device().ioport("DSW1_2")->read();
+ return space.machine().root_device().ioport("DSW1_2")->read();
case 0x44/2:
return ((((DECO_PORT(0x2c)&0x000f)<<12)) ^ deco16_xor) & (~deco16_mask);
@@ -1212,7 +1212,7 @@ READ16_HANDLER( deco16_104_rohga_prot_r )
return DECO_PORT(0x58);
}
- logerror("Protection PC %06x: warning - read unmapped protection address %04x\n",space->device().safe_pc(),offset<<1);
+ logerror("Protection PC %06x: warning - read unmapped protection address %04x\n",space.device().safe_pc(),offset<<1);
return 0;
}
@@ -1221,15 +1221,15 @@ READ16_HANDLER( deco16_104_rohga_prot_r )
static WRITE16_HANDLER( deco16_146_core_prot_w )
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
const int writeport=offset;
const int sndport=0x260;
const int xorport=0x340;
const int maskport=0x6c0;
if (writeport == sndport)
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
@@ -1244,7 +1244,7 @@ static WRITE16_HANDLER( deco16_146_core_prot_w )
COMBINE_DATA(&decoprot_buffer_ram[offset>>1]);
// if (offset!=0x5e0 && offset!=0x340 && offset!=0 && offset!=0x3d0 && offset!=0x280)
-// logerror("%08x: Write protection port %04x, data %04x (%08x)\n", space->device().safe_pc(), offset, data, mem_mask);
+// logerror("%08x: Write protection port %04x, data %04x (%08x)\n", space.device().safe_pc(), offset, data, mem_mask);
}
static READ16_HANDLER( deco16_146_core_prot_r )
@@ -1256,11 +1256,11 @@ static READ16_HANDLER( deco16_146_core_prot_r )
switch (offset)
{
case 0x582: /* Player 1 & Player 2 */
- return space->machine().root_device().ioport("IN0")->read();
+ return space.machine().root_device().ioport("IN0")->read();
case 0x04c: /* Coins/VBL */
- return space->machine().root_device().ioport("IN1")->read();
+ return space.machine().root_device().ioport("IN1")->read();
case 0x672: /* Dip switches */
- return space->machine().root_device().ioport("DSW1_2")->read();
+ return space.machine().root_device().ioport("DSW1_2")->read();
case 0x13a:
return ((DECO_PORT(0x190)&0x00f0)<<8) | ((DECO_PORT(0x190)&0x0003)<<10) | ((DECO_PORT(0x190)&0x000c)<<6);
@@ -1318,9 +1318,9 @@ static READ16_HANDLER( deco16_146_core_prot_r )
/*********************************************************************************/
-// case 0x582: return space->machine().root_device().ioport("IN0")->read(); /* IN0 */
-// case 0x672: return space->machine().root_device().ioport("IN1")->read(); /* IN1 */
-// case 0x04c: return space->machine().device<eeprom_device>("eeprom")->read_bit();
+// case 0x582: return space.machine().root_device().ioport("IN0")->read(); /* IN0 */
+// case 0x672: return space.machine().root_device().ioport("IN1")->read(); /* IN1 */
+// case 0x04c: return space.machine().device<eeprom_device>("eeprom")->read_bit();
case 0x468:
val=DECO_PORT(0x570);
@@ -1642,7 +1642,7 @@ static READ16_HANDLER( deco16_146_core_prot_r )
return val & (~deco16_mask);
}
- //logerror("Protection PC %06x: warning - read fully unmapped protection address %04x\n", space->device().safe_pc(), offset);
+ //logerror("Protection PC %06x: warning - read fully unmapped protection address %04x\n", space.device().safe_pc(), offset);
return 0;
}
@@ -1667,9 +1667,9 @@ READ32_HANDLER( deco16_146_fghthist_prot_r )
/* Special case inputs, because this is the only game with an eprom */
switch (addr)
{
- case 0x582: return (space->machine().root_device().ioport("IN0")->read()<<16) | 0xffff; /* IN0 */
- case 0x672: return (space->machine().root_device().ioport("IN1")->read()<<16) | 0xffff; /* IN1 */
- case 0x04c: return (space->machine().device<eeprom_device>("eeprom")->read_bit()<<16) | 0xffff;
+ case 0x582: return (space.machine().root_device().ioport("IN0")->read()<<16) | 0xffff; /* IN0 */
+ case 0x672: return (space.machine().root_device().ioport("IN1")->read()<<16) | 0xffff; /* IN1 */
+ case 0x04c: return (space.machine().device<eeprom_device>("eeprom")->read_bit()<<16) | 0xffff;
}
/* Handle 'one shots' - writing data to an address, then immediately reading it back */
@@ -1694,7 +1694,7 @@ READ32_HANDLER( deco16_146_fghthist_prot_r )
&& addr!=0x1ae && addr!=0x1d6 && addr!=0x4f8 && addr!=0x614 // cnofirmed
&& addr!=0x5ae && addr!=0x50a && addr!=0x476 && addr!=0x328 && addr!=0x3e && addr!=0x558 // dbl check these later
&& addr!=0x444 && addr!=0x46a // confirmed
- && space->device().safe_pc()!=0x16448 // hmm
+ && space.device().safe_pc()!=0x16448 // hmm
&& addr!=0x67a
&& addr!=0x6c2 && addr!=0xac && addr!=0x416 && addr!=0x2c2 // confirmed
&& addr!=0x3d8
@@ -1717,10 +1717,10 @@ READ32_HANDLER( deco16_146_fghthist_prot_r )
&& addr!=0x440 && addr!=0x460
)
{
- logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", space->device().safe_pc(), addr, val);
+ logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", space.device().safe_pc(), addr, val);
popmessage("Read protection port %04x", addr);
}
- // logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", space->device().safe_pc(), addr, val);
+ // logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", space.device().safe_pc(), addr, val);
return (val<<16)|0xffff;
}
@@ -1743,26 +1743,26 @@ READ16_HANDLER( dietgo_104_prot_r )
{
switch (offset * 2)
{
- case 0x298: return space->machine().root_device().ioport("IN0")->read();
- case 0x342: return space->machine().root_device().ioport("IN1")->read();
- case 0x506: return space->machine().root_device().ioport("DSW")->read();
+ case 0x298: return space.machine().root_device().ioport("IN0")->read();
+ case 0x342: return space.machine().root_device().ioport("IN1")->read();
+ case 0x506: return space.machine().root_device().ioport("DSW")->read();
}
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space->device().safe_pc(), offset<<1);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset<<1);
return 0;
}
WRITE16_HANDLER( dietgo_104_prot_w )
{
- driver_device *state = space->machine().driver_data<driver_device>();
+ driver_device *state = space.machine().driver_data<driver_device>();
if (offset == (0x380 / 2))
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
return;
}
- logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n", space->device().safe_pc(), offset << 1, data);
+ logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n", space.device().safe_pc(), offset << 1, data);
}
/**********************************************************************************/
@@ -1772,15 +1772,15 @@ READ16_HANDLER( deco16_104_pktgaldx_prot_r )
const UINT16* prot_ram=deco16_prot_ram;
switch (offset * 2)
{
- case 0x5b2: return space->machine().root_device().ioport("SYSTEM")->read();
- case 0x44c: return space->machine().root_device().ioport("DSW")->read();
- case 0x042: return space->machine().root_device().ioport("INPUTS")->read();
+ case 0x5b2: return space.machine().root_device().ioport("SYSTEM")->read();
+ case 0x44c: return space.machine().root_device().ioport("DSW")->read();
+ case 0x042: return space.machine().root_device().ioport("INPUTS")->read();
case 0x510: return DECO_PORT(0);
case 0x51a: return DECO_PORT(2);
}
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space->device().safe_pc(), offset<<1);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset<<1);
return 0;
}
@@ -1788,7 +1788,7 @@ READ16_HANDLER( deco16_104_pktgaldx_prot_r )
WRITE16_HANDLER( deco16_104_pktgaldx_prot_w )
{
COMBINE_DATA(&deco16_prot_ram[offset]);
-// logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",space->device().safe_pc(),offset<<1,data);
+// logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",space.device().safe_pc(),offset<<1,data);
}
/**********************************************************************************/
diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c
index 8cbbcb16674..a1aaacfa7d9 100644
--- a/src/mame/machine/fddebug.c
+++ b/src/mame/machine/fddebug.c
@@ -312,7 +312,7 @@ static void execute_fdcset(running_machine &machine, int ref, int params, const
static void execute_fdclist(running_machine &machine, int ref, int params, const char **param);
static void execute_fdcsearch(running_machine &machine, int ref, int params, const char **param);
-static fd1094_possibility *try_all_possibilities(address_space *space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata);
+static fd1094_possibility *try_all_possibilities(address_space &space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata);
static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, UINT8 status);
static void perform_constrained_search(running_machine &machine);
@@ -322,8 +322,8 @@ static int does_key_work_for_constraints(const UINT16 *base, UINT8 *key);
static UINT32 reconstruct_base_seed(int keybaseaddr, UINT32 startseed);
static void build_optable(running_machine &machine);
-static int validate_ea(address_space *space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags);
-static int validate_opcode(address_space *space, UINT32 pc, const UINT8 *opdata, int maxwords);
+static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags);
+static int validate_opcode(address_space &space, UINT32 pc, const UINT8 *opdata, int maxwords);
@@ -464,14 +464,14 @@ INLINE void print_possibilities(running_machine &machine)
0=no, 1=yes, 2=unlikely
-----------------------------------------------*/
-INLINE int pc_is_valid(address_space *space, UINT32 pc, UINT32 flags)
+INLINE int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags)
{
/* if we're odd or out of range, fail */
if ((pc & 1) == 1)
return 0;
if (pc & 0xff000000)
return 0;
- if (space->direct().read_decrypted_ptr(pc) == NULL)
+ if (space.direct().read_decrypted_ptr(pc) == NULL)
return 0;
return 1;
}
@@ -482,7 +482,7 @@ INLINE int pc_is_valid(address_space *space, UINT32 pc, UINT32 flags)
valid? 0=no, 1=yes, 2=unlikely
-----------------------------------------------*/
-INLINE int addr_is_valid(address_space *space, UINT32 addr, UINT32 flags)
+INLINE int addr_is_valid(address_space &space, UINT32 addr, UINT32 flags)
{
/* if this a JMP, the address is a PC */
if (flags & OF_JMP)
@@ -495,7 +495,7 @@ INLINE int addr_is_valid(address_space *space, UINT32 addr, UINT32 flags)
return 0;
/* if we're invalid, fail */
- if (strcmp(const_cast<address_space *>(space)->get_handler_string(ROW_READ, addr), "segaic16_memory_mapper_lsb_r") == 0)
+ if (strcmp(const_cast<address_space &>(space)->get_handler_string(ROW_READ, addr), "segaic16_memory_mapper_lsb_r") == 0)
return 2;
return 1;
@@ -747,7 +747,7 @@ static int instruction_hook(device_t &device, offs_t curpc)
}
/* try all possible decodings at the current pc */
- posscount = try_all_possibilities(device.memory().space(AS_PROGRAM), curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
+ posscount = try_all_possibilities(*device.memory().space(AS_PROGRAM), curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
if (keydirty)
fd1094_regenerate_key(device.machine());
@@ -1075,8 +1075,8 @@ static void execute_fdpc(running_machine &machine, int ref, int params, const ch
static void execute_fdsearch(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space = debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM);
- int pc = space->device().safe_pc();
+ address_space &space = *debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM);
+ int pc = space.device().safe_pc();
int length, first = TRUE;
UINT8 instrdata[2];
UINT16 decoded;
@@ -1114,8 +1114,8 @@ static void execute_fdsearch(running_machine &machine, int ref, int params, cons
}
/* set this as our current PC and run the instruction hook */
- space->device().state().set_pc(pc);
- if (instruction_hook(space->device(), pc))
+ space.device().state().set_pc(pc);
+ if (instruction_hook(space.device(), pc))
break;
}
keystatus[pc/2] |= SEARCH_MASK;
@@ -1201,7 +1201,7 @@ static void execute_fdsearch(running_machine &machine, int ref, int params, cons
static void execute_fddasm(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space = debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM);
+ address_space &space = *debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM);
int origstate = fd1094_set_state(keyregion, -1);
const char *filename;
int skipped = FALSE;
@@ -1406,7 +1406,7 @@ static void execute_fdcsearch(running_machine &machine, int ref, int params, con
length
-----------------------------------------------*/
-static fd1094_possibility *try_all_possibilities(address_space *space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata)
+static fd1094_possibility *try_all_possibilities(address_space &space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata)
{
UINT8 keymask, keystat;
UINT16 possvalue[4];
@@ -2249,7 +2249,7 @@ static void build_optable(running_machine &machine)
valid or not, and return the length
-----------------------------------------------*/
-static int validate_ea(address_space *space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags)
+static int validate_ea(address_space &space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags)
{
UINT32 addr;
int valid;
@@ -2319,7 +2319,7 @@ static int validate_ea(address_space *space, UINT32 pc, UINT8 modereg, const UIN
the length specified
-----------------------------------------------*/
-static int validate_opcode(address_space *space, UINT32 pc, const UINT8 *opdata, int maxwords)
+static int validate_opcode(address_space &space, UINT32 pc, const UINT8 *opdata, int maxwords)
{
UINT32 immvalue = 0;
int iffy = FALSE;
diff --git a/src/mame/machine/gaelcrpt.c b/src/mame/machine/gaelcrpt.c
index e1dff00e98f..eafbdf1a05e 100644
--- a/src/mame/machine/gaelcrpt.c
+++ b/src/mame/machine/gaelcrpt.c
@@ -120,11 +120,11 @@ static int decrypt(int const param1, int const param2, int const enc_prev_word,
-UINT16 gaelco_decrypt(address_space *space, int offset, int data, int param1, int param2)
+UINT16 gaelco_decrypt(address_space &space, int offset, int data, int param1, int param2)
{
static int lastpc, lastoffset, lastencword, lastdecword;
- int thispc = space->device().safe_pc();
+ int thispc = space.device().safe_pc();
// int savedata = data;
/* check if 2nd half of 32 bit */
@@ -146,7 +146,7 @@ UINT16 gaelco_decrypt(address_space *space, int offset, int data, int param1, in
lastdecword = data;
-// logerror("%s : data1 = %4x > %4x @ %8x\n",space->machine().describe_context(),savedata,data,lastoffset);
+// logerror("%s : data1 = %4x > %4x @ %8x\n",space.machine().describe_context(),savedata,data,lastoffset);
}
return data;
}
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index f19249e97fe..f51c0ce6237 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -319,11 +319,11 @@ DRIVER_INIT_MEMBER(galaxold_state,mooncrgx)
DRIVER_INIT_MEMBER(galaxold_state,moonqsr)
{
offs_t i;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine().root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
for (i = 0;i < 0x8000;i++)
decrypt[i] = decode_mooncrst(rom[i],i);
@@ -397,7 +397,7 @@ Pin layout is such that links can replace the PAL if encryption is not used.
DRIVER_INIT_MEMBER(galaxold_state,4in1)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
offs_t i, len = memregion("maincpu")->bytes();
UINT8 *RAM = memregion("maincpu")->base();
@@ -408,7 +408,7 @@ DRIVER_INIT_MEMBER(galaxold_state,4in1)
/* games are banked at 0x0000 - 0x3fff */
membank("bank1")->configure_entries(0, 4, &RAM[0x10000], 0x4000);
- _4in1_bank_w(*space, 0, 0); /* set the initial CPU bank */
+ _4in1_bank_w(space, 0, 0); /* set the initial CPU bank */
state_save_register_global(machine(), m__4in1_bank);
}
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index 5244a7e23cc..7d404ce5b9a 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -123,9 +123,9 @@ INTERRUPT_GEN( hd68k_irq_gen )
WRITE16_HANDLER( hd68k_irq_ack_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
state->m_irq_state = 0;
- atarigen_update_interrupts(space->machine());
+ atarigen_update_interrupts(space.machine());
}
@@ -154,7 +154,7 @@ void hdmsp_irq_gen(device_t *device, int irqstate)
READ16_HANDLER( hd68k_gsp_io_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT16 result;
offset = (offset / 2) ^ 1;
state->m_hd34010_host_access = TRUE;
@@ -166,7 +166,7 @@ READ16_HANDLER( hd68k_gsp_io_r )
WRITE16_HANDLER( hd68k_gsp_io_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
offset = (offset / 2) ^ 1;
state->m_hd34010_host_access = TRUE;
tms34010_host_w(state->m_gsp, offset, data);
@@ -183,7 +183,7 @@ WRITE16_HANDLER( hd68k_gsp_io_w )
READ16_HANDLER( hd68k_msp_io_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT16 result;
offset = (offset / 2) ^ 1;
state->m_hd34010_host_access = TRUE;
@@ -195,7 +195,7 @@ READ16_HANDLER( hd68k_msp_io_r )
WRITE16_HANDLER( hd68k_msp_io_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
offset = (offset / 2) ^ 1;
if (state->m_msp != NULL)
{
@@ -230,8 +230,8 @@ READ16_HANDLER( hd68k_port0_r )
.....
0x8000 = SW1 #1
*/
- int temp = (space->machine().root_device().ioport("SW1")->read() << 8) | space->machine().root_device().ioport("IN0")->read();
- if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0002;
+ int temp = (space.machine().root_device().ioport("SW1")->read() << 8) | space.machine().root_device().ioport("IN0")->read();
+ if (atarigen_get_hblank(*space.machine().primary_screen)) temp ^= 0x0002;
temp ^= 0x0018; /* both EOCs always high for now */
return temp;
}
@@ -239,7 +239,7 @@ READ16_HANDLER( hd68k_port0_r )
READ16_HANDLER( hdc68k_port1_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT16 result = state->ioport("a80000")->read();
UINT16 diff = result ^ state->m_hdc68k_last_port1;
@@ -268,7 +268,7 @@ READ16_HANDLER( hdc68k_port1_r )
READ16_HANDLER( hda68k_port1_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT16 result = state->ioport("a80000")->read();
/* merge in the wheel edge latch bit */
@@ -281,13 +281,13 @@ READ16_HANDLER( hda68k_port1_r )
READ16_HANDLER( hdc68k_wheel_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* grab the new wheel value and upconvert to 12 bits */
UINT16 new_wheel = state->ioport("12BADC0")->read() << 4;
/* hack to display the wheel position */
- if (space->machine().input().code_pressed(KEYCODE_LSHIFT))
+ if (space.machine().input().code_pressed(KEYCODE_LSHIFT))
popmessage("%04X", new_wheel);
/* if we crossed the center line, latch the edge bit */
@@ -302,21 +302,21 @@ READ16_HANDLER( hdc68k_wheel_r )
READ16_HANDLER( hd68k_adc8_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_adc8_data;
}
READ16_HANDLER( hd68k_adc12_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_adc12_byte ? ((state->m_adc12_data >> 8) & 0x0f) : (state->m_adc12_data & 0xff);
}
READ16_HANDLER( hd68k_sound_reset_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
if (state->m_jsacpu != NULL)
atarijsa_reset();
return ~0;
@@ -334,7 +334,7 @@ WRITE16_HANDLER( hd68k_adc_control_w )
{
static const char *const adc8names[] = { "8BADC0", "8BADC1", "8BADC2", "8BADC3", "8BADC4", "8BADC5", "8BADC6", "8BADC7" };
static const char *const adc12names[] = { "12BADC0", "12BADC1", "12BADC2", "12BADC3" };
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_adc_control);
@@ -349,7 +349,7 @@ WRITE16_HANDLER( hd68k_adc_control_w )
if (state->m_adc_control & 0x40)
{
state->m_adc12_select = (state->m_adc_control >> 4) & 0x03;
- state->m_adc12_data = space->machine().root_device().ioport(adc12names[state->m_adc12_select])->read() << 4;
+ state->m_adc12_data = space.machine().root_device().ioport(adc12names[state->m_adc12_select])->read() << 4;
}
/* bit 7 selects which byte of the 12 bit data to read */
@@ -376,7 +376,7 @@ WRITE16_HANDLER( hd68k_wr0_write )
case 6: /* CC1 */
case 7: /* CC2 */
- coin_counter_w(space->machine(), offset - 6, data);
+ coin_counter_w(space.machine(), offset - 6, data);
break;
}
}
@@ -400,7 +400,7 @@ WRITE16_HANDLER( hd68k_wr2_write )
WRITE16_HANDLER( hd68k_nwr_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
data = (offset >> 3) & 1;
@@ -411,7 +411,7 @@ WRITE16_HANDLER( hd68k_nwr_w )
{
case 0: /* CR2 */
case 1: /* CR1 */
- set_led_status(space->machine(), offset, data);
+ set_led_status(space.machine(), offset, data);
break;
case 2: /* LC1 */
break;
@@ -440,7 +440,7 @@ WRITE16_HANDLER( hd68k_nwr_w )
WRITE16_HANDLER( hdc68k_wheel_edge_reset_w )
{
/* reset the edge latch */
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
state->m_hdc68k_wheel_edge = 0;
}
@@ -454,14 +454,14 @@ WRITE16_HANDLER( hdc68k_wheel_edge_reset_w )
READ16_HANDLER( hd68k_zram_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_eeprom[offset];
}
WRITE16_HANDLER( hd68k_zram_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
if (state->m_m68k_zp1 == 0 && state->m_m68k_zp2 == 1)
COMBINE_DATA(&state->m_eeprom[offset]);
}
@@ -490,7 +490,7 @@ void harddriv_duart_irq_handler(device_t *device, int state, UINT8 vector)
WRITE16_HANDLER( hdgsp_io_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* detect an enabling of the shift register and force yielding */
if (offset == REG_DPYCTL)
@@ -500,13 +500,13 @@ WRITE16_HANDLER( hdgsp_io_w )
{
state->m_last_gsp_shiftreg = new_shiftreg;
if (new_shiftreg)
- space->device().execute().yield();
+ space.device().execute().yield();
}
}
/* detect changes to HEBLNK and HSBLNK and force an update before they change */
if ((offset == REG_HEBLNK || offset == REG_HSBLNK) && data != tms34010_io_register_r(space, offset, 0xffff))
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1);
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos() - 1);
tms34010_io_register_w(space, offset, data, mem_mask);
}
@@ -521,7 +521,7 @@ WRITE16_HANDLER( hdgsp_io_w )
WRITE16_HANDLER( hdgsp_protection_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* this memory address is incremented whenever a protection check fails */
/* after it reaches a certain value, the GSP will randomly trash a */
@@ -543,7 +543,7 @@ WRITE16_HANDLER( hdgsp_protection_w )
READ16_HANDLER( hd68k_adsp_program_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT32 word = state->m_adsp_pgm_memory[offset/2];
return (!(offset & 1)) ? (word >> 16) : (word & 0xffff);
}
@@ -551,7 +551,7 @@ READ16_HANDLER( hd68k_adsp_program_r )
WRITE16_HANDLER( hd68k_adsp_program_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT32 *base = &state->m_adsp_pgm_memory[offset/2];
UINT32 oldword = *base;
UINT16 temp;
@@ -581,26 +581,26 @@ WRITE16_HANDLER( hd68k_adsp_program_w )
READ16_HANDLER( hd68k_adsp_data_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_adsp_data_memory[offset];
}
WRITE16_HANDLER( hd68k_adsp_data_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_adsp_data_memory[offset]);
/* any write to $1FFF is taken to be a trigger; synchronize the CPUs */
if (offset == 0x1fff)
{
- logerror("%06X:ADSP sync address written (%04X)\n", space->device().safe_pcbase(), data);
- space->machine().scheduler().synchronize();
+ logerror("%06X:ADSP sync address written (%04X)\n", space.device().safe_pcbase(), data);
+ space.machine().scheduler().synchronize();
state->m_adsp->signal_interrupt_trigger();
}
else
- logerror("%06X:ADSP W@%04X (%04X)\n", space->device().safe_pcbase(), offset, data);
+ logerror("%06X:ADSP W@%04X (%04X)\n", space.device().safe_pcbase(), offset, data);
}
@@ -613,7 +613,7 @@ WRITE16_HANDLER( hd68k_adsp_data_w )
READ16_HANDLER( hd68k_adsp_buffer_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* logerror("hd68k_adsp_buffer_r(%04X)\n", offset);*/
return state->m_som_memory[state->m_m68k_adsp_buffer_bank * 0x2000 + offset];
}
@@ -621,7 +621,7 @@ READ16_HANDLER( hd68k_adsp_buffer_r )
WRITE16_HANDLER( hd68k_adsp_buffer_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_som_memory[state->m_m68k_adsp_buffer_bank * 0x2000 + offset]);
}
@@ -687,7 +687,7 @@ static TIMER_CALLBACK( deferred_adsp_bank_switch )
WRITE16_HANDLER( hd68k_adsp_control_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
int val = (offset >> 3) & 1;
@@ -703,7 +703,7 @@ WRITE16_HANDLER( hd68k_adsp_control_w )
case 3:
logerror("ADSP bank = %d (deferred)\n", val);
- space->machine().scheduler().synchronize(FUNC(deferred_adsp_bank_switch), val);
+ space.machine().scheduler().synchronize(FUNC(deferred_adsp_bank_switch), val);
break;
case 5:
@@ -719,7 +719,7 @@ WRITE16_HANDLER( hd68k_adsp_control_w )
/* a yield in this case is not enough */
/* we would need to increase the interleaving otherwise */
/* note that this only affects the test mode */
- space->device().execute().spin();
+ space.device().execute().spin();
}
break;
@@ -736,14 +736,14 @@ WRITE16_HANDLER( hd68k_adsp_control_w )
/* a yield in this case is not enough */
/* we would need to increase the interleaving otherwise */
/* note that this only affects the test mode */
- space->device().execute().spin();
+ space.device().execute().spin();
}
break;
case 7:
logerror("ADSP reset = %d\n", val);
state->m_adsp->set_input_line(INPUT_LINE_RESET, val ? CLEAR_LINE : ASSERT_LINE);
- space->device().execute().yield();
+ space.device().execute().yield();
break;
default:
@@ -755,20 +755,20 @@ WRITE16_HANDLER( hd68k_adsp_control_w )
WRITE16_HANDLER( hd68k_adsp_irq_clear_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
- logerror("%06X:68k clears ADSP interrupt\n", space->device().safe_pcbase());
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
+ logerror("%06X:68k clears ADSP interrupt\n", space.device().safe_pcbase());
state->m_adsp_irq_state = 0;
- atarigen_update_interrupts(space->machine());
+ atarigen_update_interrupts(space.machine());
}
READ16_HANDLER( hd68k_adsp_irq_state_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int result = 0xfffd;
if (state->m_adsp_xflag) result ^= 2;
if (state->m_adsp_irq_state) result ^= 1;
- logerror("%06X:68k reads ADSP interrupt state = %04x\n", space->device().safe_pcbase(), result);
+ logerror("%06X:68k reads ADSP interrupt state = %04x\n", space.device().safe_pcbase(), result);
return result;
}
@@ -782,7 +782,7 @@ READ16_HANDLER( hd68k_adsp_irq_state_r )
READ16_HANDLER( hdadsp_special_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
switch (offset & 7)
{
case 0: /* /SIMBUF */
@@ -801,7 +801,7 @@ READ16_HANDLER( hdadsp_special_r )
break;
default:
- logerror("%04X:hdadsp_special_r(%04X)\n", space->device().safe_pcbase(), offset);
+ logerror("%04X:hdadsp_special_r(%04X)\n", space.device().safe_pcbase(), offset);
break;
}
return 0;
@@ -810,7 +810,7 @@ READ16_HANDLER( hdadsp_special_r )
WRITE16_HANDLER( hdadsp_special_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
switch (offset & 7)
{
case 1: /* /SIMCLK */
@@ -830,9 +830,9 @@ WRITE16_HANDLER( hdadsp_special_w )
break;
case 6: /* /GINT */
- logerror("%04X:ADSP signals interrupt\n", space->device().safe_pcbase());
+ logerror("%04X:ADSP signals interrupt\n", space.device().safe_pcbase());
state->m_adsp_irq_state = 1;
- atarigen_update_interrupts(space->machine());
+ atarigen_update_interrupts(space.machine());
break;
case 7: /* /MP */
@@ -840,7 +840,7 @@ WRITE16_HANDLER( hdadsp_special_w )
break;
default:
- logerror("%04X:hdadsp_special_w(%04X)=%04X\n", space->device().safe_pcbase(), offset, data);
+ logerror("%04X:hdadsp_special_w(%04X)=%04X\n", space.device().safe_pcbase(), offset, data);
break;
}
}
@@ -870,7 +870,7 @@ static void update_ds3_irq(harddriv_state *state)
WRITE16_HANDLER( hd68k_ds3_control_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int val = (offset >> 3) & 1;
switch (offset & 7)
@@ -895,7 +895,7 @@ WRITE16_HANDLER( hd68k_ds3_control_w )
/* a yield in this case is not enough */
/* we would need to increase the interleaving otherwise */
/* note that this only affects the test mode */
- space->device().execute().spin();
+ space.device().execute().spin();
}
break;
@@ -911,7 +911,7 @@ WRITE16_HANDLER( hd68k_ds3_control_w )
update_ds3_irq(state);
}
state->m_ds3_reset = val;
- space->device().execute().yield();
+ space.device().execute().yield();
logerror("DS III reset = %d\n", val);
break;
@@ -935,7 +935,7 @@ WRITE16_HANDLER( hd68k_ds3_control_w )
READ16_HANDLER( hd68k_ds3_girq_state_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int result = 0x0fff;
if (state->m_ds3_g68flag) result ^= 0x8000;
if (state->m_ds3_gflag) result ^= 0x4000;
@@ -947,16 +947,16 @@ READ16_HANDLER( hd68k_ds3_girq_state_r )
READ16_HANDLER( hd68k_ds3_gdata_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
- offs_t pc = space->device().safe_pc();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
+ offs_t pc = space.device().safe_pc();
state->m_ds3_gflag = 0;
update_ds3_irq(state);
- logerror("%06X:hd68k_ds3_gdata_r(%04X)\n", space->device().safe_pcbase(), state->m_ds3_gdata);
+ logerror("%06X:hd68k_ds3_gdata_r(%04X)\n", space.device().safe_pcbase(), state->m_ds3_gdata);
/* attempt to optimize the transfer if conditions are right */
- if (&space->device() == state->m_maincpu && pc == state->m_ds3_transfer_pc &&
+ if (&space.device() == state->m_maincpu && pc == state->m_ds3_transfer_pc &&
!(!state->m_ds3_g68flag && state->m_ds3_g68irqs) && !(state->m_ds3_gflag && state->m_ds3_gfirqs))
{
UINT32 destaddr = state->m_maincpu->state_int(M68K_A1);
@@ -970,7 +970,7 @@ READ16_HANDLER( hd68k_ds3_gdata_r )
while (count68k > 0 && state->m_adsp_data_memory[0x16e6] > 0)
{
- space->write_word(destaddr, state->m_ds3_gdata);
+ space.write_word(destaddr, state->m_ds3_gdata);
{
state->m_adsp_data_memory[0x16e6]--;
state->m_ds3_gdata = state->m_adsp_pgm_memory[i6] >> 8;
@@ -986,8 +986,8 @@ READ16_HANDLER( hd68k_ds3_gdata_r )
/* if we just cleared the IRQ, we are going to do some VERY timing critical reads */
/* it is important that all the CPUs be in sync before we continue, so spin a little */
/* while to let everyone else catch up */
- space->device().execute().spin_until_trigger(DS3_TRIGGER);
- space->machine().scheduler().trigger(DS3_TRIGGER, attotime::from_usec(5));
+ space.device().execute().spin_until_trigger(DS3_TRIGGER);
+ space.machine().scheduler().trigger(DS3_TRIGGER, attotime::from_usec(5));
return state->m_ds3_gdata;
}
@@ -995,9 +995,9 @@ READ16_HANDLER( hd68k_ds3_gdata_r )
WRITE16_HANDLER( hd68k_ds3_gdata_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
- logerror("%06X:hd68k_ds3_gdata_w(%04X)\n", space->device().safe_pcbase(), state->m_ds3_gdata);
+ logerror("%06X:hd68k_ds3_gdata_w(%04X)\n", space.device().safe_pcbase(), state->m_ds3_gdata);
COMBINE_DATA(&state->m_ds3_g68data);
state->m_ds3_g68flag = 1;
@@ -1039,7 +1039,7 @@ WRITE16_HANDLER( hd68k_ds3_sdata_w )
READ16_HANDLER( hdds3_special_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int result;
switch (offset & 7)
@@ -1069,7 +1069,7 @@ READ16_HANDLER( hdds3_special_r )
WRITE16_HANDLER( hdds3_special_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* IMPORTANT! these data values also write through to the underlying RAM */
state->m_adsp_data_memory[offset] = data;
@@ -1077,19 +1077,19 @@ WRITE16_HANDLER( hdds3_special_w )
switch (offset & 7)
{
case 0:
- logerror("%04X:ADSP sets gdata to %04X\n", space->device().safe_pcbase(), data);
+ logerror("%04X:ADSP sets gdata to %04X\n", space.device().safe_pcbase(), data);
state->m_ds3_gdata = data;
state->m_ds3_gflag = 1;
update_ds3_irq(state);
/* once we've written data, trigger the main CPU to wake up again */
- space->machine().scheduler().trigger(DS3_TRIGGER);
+ space.machine().scheduler().trigger(DS3_TRIGGER);
break;
case 1:
- logerror("%04X:ADSP sets interrupt = %d\n", space->device().safe_pcbase(), (data >> 1) & 1);
+ logerror("%04X:ADSP sets interrupt = %d\n", space.device().safe_pcbase(), (data >> 1) & 1);
state->m_adsp_irq_state = (data >> 1) & 1;
- hd68k_update_interrupts(space->machine());
+ hd68k_update_interrupts(space.machine());
break;
case 2:
@@ -1136,7 +1136,7 @@ WRITE16_HANDLER( hdds3_control_w )
READ16_HANDLER( hd68k_ds3_program_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT32 *base = &state->m_adsp_pgm_memory[offset & 0x1fff];
UINT32 word = *base;
return (!(offset & 0x2000)) ? (word >> 8) : (word & 0xff);
@@ -1145,7 +1145,7 @@ READ16_HANDLER( hd68k_ds3_program_r )
WRITE16_HANDLER( hd68k_ds3_program_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT32 *base = &state->m_adsp_pgm_memory[offset & 0x1fff];
UINT32 oldword = *base;
UINT16 temp;
@@ -1195,7 +1195,7 @@ void hddsk_update_pif(dsp32c_device &device, UINT32 pins)
WRITE16_HANDLER( hd68k_dsk_control_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int val = (offset >> 3) & 1;
switch (offset & 7)
{
@@ -1214,7 +1214,7 @@ WRITE16_HANDLER( hd68k_dsk_control_w )
break;
case 4: /* ASIC65 reset */
- asic65_reset(space->machine(), !val);
+ asic65_reset(space.machine(), !val);
break;
case 7: /* LED */
@@ -1236,42 +1236,42 @@ WRITE16_HANDLER( hd68k_dsk_control_w )
READ16_HANDLER( hd68k_dsk_ram_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_dsk_ram[offset];
}
WRITE16_HANDLER( hd68k_dsk_ram_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_dsk_ram[offset]);
}
READ16_HANDLER( hd68k_dsk_zram_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_dsk_zram[offset];
}
WRITE16_HANDLER( hd68k_dsk_zram_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_dsk_zram[offset]);
}
READ16_HANDLER( hd68k_dsk_small_rom_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_dsk_rom[offset & 0x1ffff];
}
READ16_HANDLER( hd68k_dsk_rom_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_dsk_rom[offset];
}
@@ -1285,7 +1285,7 @@ READ16_HANDLER( hd68k_dsk_rom_r )
WRITE16_HANDLER( hd68k_dsk_dsp32_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
state->m_dsk_pio_access = TRUE;
state->m_dsp32->pio_w(offset, data);
state->m_dsk_pio_access = FALSE;
@@ -1294,7 +1294,7 @@ WRITE16_HANDLER( hd68k_dsk_dsp32_w )
READ16_HANDLER( hd68k_dsk_dsp32_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT16 result;
state->m_dsk_pio_access = TRUE;
result = state->m_dsp32->pio_r(offset);
@@ -1318,7 +1318,7 @@ static TIMER_CALLBACK( rddsp32_sync_cb )
WRITE32_HANDLER( rddsp32_sync0_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
if (state->m_dsk_pio_access)
{
UINT32 *dptr = &state->m_rddsp32_sync[0][offset];
@@ -1326,7 +1326,7 @@ WRITE32_HANDLER( rddsp32_sync0_w )
COMBINE_DATA(&newdata);
state->m_dataptr[state->m_next_msp_sync % MAX_MSP_SYNC] = dptr;
state->m_dataval[state->m_next_msp_sync % MAX_MSP_SYNC] = newdata;
- space->machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->m_next_msp_sync++ % MAX_MSP_SYNC);
+ space.machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->m_next_msp_sync++ % MAX_MSP_SYNC);
}
else
COMBINE_DATA(&state->m_rddsp32_sync[0][offset]);
@@ -1335,7 +1335,7 @@ WRITE32_HANDLER( rddsp32_sync0_w )
WRITE32_HANDLER( rddsp32_sync1_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
if (state->m_dsk_pio_access)
{
UINT32 *dptr = &state->m_rddsp32_sync[1][offset];
@@ -1343,7 +1343,7 @@ WRITE32_HANDLER( rddsp32_sync1_w )
COMBINE_DATA(&newdata);
state->m_dataptr[state->m_next_msp_sync % MAX_MSP_SYNC] = dptr;
state->m_dataval[state->m_next_msp_sync % MAX_MSP_SYNC] = newdata;
- space->machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->m_next_msp_sync++ % MAX_MSP_SYNC);
+ space.machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->m_next_msp_sync++ % MAX_MSP_SYNC);
}
else
COMBINE_DATA(&state->m_rddsp32_sync[1][offset]);
@@ -1368,7 +1368,7 @@ WRITE16_HANDLER( hddspcom_control_w )
switch (offset & 7)
{
case 2: /* ASIC65 reset */
- asic65_reset(space->machine(), !val);
+ asic65_reset(space.machine(), !val);
break;
default:
@@ -1398,7 +1398,7 @@ WRITE16_HANDLER( rd68k_slapstic_w )
READ16_HANDLER( rd68k_slapstic_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int bank = slapstic_tweak(space, offset & 0x3fff) * 0x4000;
return state->m_m68k_slapstic_base[bank + (offset & 0x3fff)];
}
@@ -1440,14 +1440,14 @@ static int st68k_sloop_tweak(harddriv_state *state, offs_t offset)
WRITE16_HANDLER( st68k_sloop_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
st68k_sloop_tweak(state, offset & 0x3fff);
}
READ16_HANDLER( st68k_sloop_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int bank = st68k_sloop_tweak(state, offset) * 0x4000;
return state->m_m68k_slapstic_base[bank + (offset & 0x3fff)];
}
@@ -1455,7 +1455,7 @@ READ16_HANDLER( st68k_sloop_r )
READ16_HANDLER( st68k_sloop_alt_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
if (state->m_st68k_last_alt_sloop_offset == 0x00fe)
{
switch (offset*2)
@@ -1508,14 +1508,14 @@ static int st68k_protosloop_tweak(harddriv_state *state, offs_t offset)
WRITE16_HANDLER( st68k_protosloop_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
st68k_protosloop_tweak(state, offset & 0x3fff);
}
READ16_HANDLER( st68k_protosloop_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int bank = st68k_protosloop_tweak(state, offset) * 0x4000;
return state->m_m68k_slapstic_base[bank + (offset & 0x3fff)];
}
@@ -1538,16 +1538,16 @@ READ16_HANDLER( st68k_protosloop_r )
READ16_HANDLER( hdgsp_speedup_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int result = state->m_gsp_speedup_addr[0][offset];
/* if both this address and the other important address are not $ffff */
/* then we can spin until something gets written */
if (result != 0xffff && state->m_gsp_speedup_addr[1][0] != 0xffff &&
- &space->device() == state->m_gsp && space->device().safe_pc() == state->m_gsp_speedup_pc)
+ &space.device() == state->m_gsp && space.device().safe_pc() == state->m_gsp_speedup_pc)
{
state->m_gsp_speedup_count[0]++;
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
}
return result;
@@ -1556,7 +1556,7 @@ READ16_HANDLER( hdgsp_speedup_r )
WRITE16_HANDLER( hdgsp_speedup1_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_gsp_speedup_addr[0][offset]);
@@ -1568,7 +1568,7 @@ WRITE16_HANDLER( hdgsp_speedup1_w )
WRITE16_HANDLER( hdgsp_speedup2_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_gsp_speedup_addr[1][offset]);
@@ -1589,15 +1589,15 @@ WRITE16_HANDLER( hdgsp_speedup2_w )
READ16_HANDLER( rdgsp_speedup1_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int result = state->m_gsp_speedup_addr[0][offset];
/* if this address is equal to $f000, spin until something gets written */
- if (&space->device() == state->m_gsp && space->device().safe_pc() == state->m_gsp_speedup_pc &&
- (result & 0xff) < space->device().state().state_int(TMS34010_A1))
+ if (&space.device() == state->m_gsp && space.device().safe_pc() == state->m_gsp_speedup_pc &&
+ (result & 0xff) < space.device().state().state_int(TMS34010_A1))
{
state->m_gsp_speedup_count[0]++;
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
}
return result;
@@ -1606,9 +1606,9 @@ READ16_HANDLER( rdgsp_speedup1_r )
WRITE16_HANDLER( rdgsp_speedup1_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_gsp_speedup_addr[0][offset]);
- if (&space->device() != state->m_gsp)
+ if (&space.device() != state->m_gsp)
state->m_gsp->signal_interrupt_trigger();
}
@@ -1627,13 +1627,13 @@ WRITE16_HANDLER( rdgsp_speedup1_w )
READ16_HANDLER( hdmsp_speedup_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int data = state->m_msp_speedup_addr[offset];
- if (data == 0 && &space->device() == state->m_msp && space->device().safe_pc() == state->m_msp_speedup_pc)
+ if (data == 0 && &space.device() == state->m_msp && space.device().safe_pc() == state->m_msp_speedup_pc)
{
state->m_msp_speedup_count[0]++;
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
}
return data;
@@ -1642,7 +1642,7 @@ READ16_HANDLER( hdmsp_speedup_r )
WRITE16_HANDLER( hdmsp_speedup_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->m_msp_speedup_addr[offset]);
if (offset == 0 && state->m_msp_speedup_addr[offset] != 0)
state->m_msp->signal_interrupt_trigger();
@@ -1662,13 +1662,13 @@ WRITE16_HANDLER( hdmsp_speedup_w )
READ16_HANDLER( hdadsp_speedup_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int data = state->m_adsp_data_memory[0x1fff];
- if (data == 0xffff && &space->device() == state->m_adsp && space->device().safe_pc() <= 0x3b)
+ if (data == 0xffff && &space.device() == state->m_adsp && space.device().safe_pc() <= 0x3b)
{
state->m_adsp_speedup_count[0]++;
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
}
return data;
@@ -1677,13 +1677,13 @@ READ16_HANDLER( hdadsp_speedup_r )
READ16_HANDLER( hdds3_speedup_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int data = *state->m_ds3_speedup_addr;
- if (data != 0 && &space->device() == state->m_adsp && space->device().safe_pc() == state->m_ds3_speedup_pc)
+ if (data != 0 && &space.device() == state->m_adsp && space.device().safe_pc() == state->m_ds3_speedup_pc)
{
state->m_adsp_speedup_count[2]++;
- space->device().execute().spin_until_interrupt();
+ space.device().execute().spin_until_interrupt();
}
return data;
diff --git a/src/mame/machine/kabuki.c b/src/mame/machine/kabuki.c
index e95ce4f1478..d17695ad922 100644
--- a/src/mame/machine/kabuki.c
+++ b/src/mame/machine/kabuki.c
@@ -161,13 +161,13 @@ static void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data,
static void mitchell_decode(running_machine &machine, int swap_key1,int swap_key2,int addr_key,int xor_key)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine.root_device().memregion("maincpu")->bytes());
int numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
int i;
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
kabuki_decode(rom,decrypt,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
rom += 0x10000;
@@ -202,11 +202,11 @@ void block_decode(running_machine &machine) { mitchell_decode(machine,0x02461
static void cps1_decode(running_machine &machine,int swap_key1,int swap_key2,int addr_key,int xor_key)
{
- address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
- space->set_decrypted_region(0x0000, 0x7fff, decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypt);
kabuki_decode(rom,decrypt,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
}
diff --git a/src/mame/machine/kaneko_calc3.c b/src/mame/machine/kaneko_calc3.c
index 23cf251f59a..f56bee238bc 100644
--- a/src/mame/machine/kaneko_calc3.c
+++ b/src/mame/machine/kaneko_calc3.c
@@ -1243,7 +1243,7 @@ UINT8 kaneko_calc3_device::shift_bits(UINT8 dat, int bits)
int kaneko_calc3_device::calc3_decompress_table(running_machine& machine, int tabnum, UINT8* dstram, int dstoffset)
{
calc3_t &calc3 = m_calc3;
- address_space *space = machine.device(":maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(":maincpu")->memory().space(AS_PROGRAM);
UINT8* datarom = memregion(":calc3_rom")->base();
UINT8 numregions;
@@ -1344,11 +1344,11 @@ int kaneko_calc3_device::calc3_decompress_table(running_machine& machine, int ta
//printf("save to eeprom\n");
{
- address_space *eeprom_space = space->machine().device<eeprom_device>(":eeprom")->space();
+ address_space *eeprom_space = space.machine().device<eeprom_device>(":eeprom")->space();
for (i=0;i<0x80;i++)
{
- eeprom_space->write_byte(i, space->read_byte(calc3.eeprom_addr+0x200000+i));
+ eeprom_space->write_byte(i, space.read_byte(calc3.eeprom_addr+0x200000+i));
}
}
@@ -1446,10 +1446,7 @@ int kaneko_calc3_device::calc3_decompress_table(running_machine& machine, int ta
if(local_counter>1)
{
- if (space)
- {
- space->write_byte(dstoffset+i, dat);
- }
+ space.write_byte(dstoffset+i, dat);
// debug, used to output tables at the start
if (dstram)
@@ -1520,10 +1517,7 @@ int kaneko_calc3_device::calc3_decompress_table(running_machine& machine, int ta
if(local_counter>1)
{
- if (space)
- {
- space->write_byte(dstoffset+i, dat);
- }
+ space.write_byte(dstoffset+i, dat);
// debug, used to output tables at the start
if (dstram)
@@ -1639,11 +1633,11 @@ void kaneko_calc3_device::calc3_mcu_run(running_machine &machine)
calc3_t &calc3 = m_calc3;
UINT16 mcu_command;
int i;
- address_space *space = machine.device(":maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(":maincpu")->memory().space(AS_PROGRAM);
if ( calc3.mcu_status != (1|2|4|8) ) return;
- if (calc3.dsw_addr) space->write_byte(calc3.dsw_addr+0x200000, ( ~ioport(":DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
+ if (calc3.dsw_addr) space.write_byte(calc3.dsw_addr+0x200000, ( ~ioport(":DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
//calc3.mcu_status = 0;
@@ -1684,7 +1678,7 @@ void kaneko_calc3_device::calc3_mcu_run(running_machine &machine)
printf("Calc 3 Init Command - %04x ROM Checksum Address\n", calc3.checksumaddress);
printf("Calc 3 Init Command - %08x Data Write Address\n", calc3.writeaddress);
#endif
- // space->write_byte(calc3.dsw_addr+0x200000, ( ~ioport("DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
+ // space.write_byte(calc3.dsw_addr+0x200000, ( ~ioport("DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
m_calc3_mcuram[calc3.checksumaddress / 2] = calc3.mcu_crc; // MCU Rom Checksum!
@@ -1695,11 +1689,11 @@ void kaneko_calc3_device::calc3_mcu_run(running_machine &machine)
}
#endif
{
- address_space *eeprom_space = space->machine().device<eeprom_device>(":eeprom")->space();
+ address_space *eeprom_space = space.machine().device<eeprom_device>(":eeprom")->space();
for (i=0;i<0x80;i++)
{
- space->write_byte(calc3.eeprom_addr+0x200000+i, eeprom_space->read_byte(i));
+ space.write_byte(calc3.eeprom_addr+0x200000+i, eeprom_space->read_byte(i));
}
}
@@ -1738,12 +1732,12 @@ void kaneko_calc3_device::calc3_mcu_run(running_machine &machine)
printf("writing back address %08x to %08x %08x\n", calc3.writeaddress_current, commandaddr,write);
#endif
- space->write_byte(write+0x200000, calc3.data_header[0]);
- space->write_byte(write+0x200001, calc3.data_header[1]);
+ space.write_byte(write+0x200000, calc3.data_header[0]);
+ space.write_byte(write+0x200001, calc3.data_header[1]);
write=commandaddr+(char)commandunk;
- space->write_word(write+0x200000, (calc3.writeaddress_current>>16)&0xffff);
- space->write_word(write+0x200002, (calc3.writeaddress_current&0xffff));
+ space.write_word(write+0x200000, (calc3.writeaddress_current>>16)&0xffff);
+ space.write_word(write+0x200002, (calc3.writeaddress_current&0xffff));
calc3.writeaddress_current += ((length+3)&(~1));
}
diff --git a/src/mame/machine/konami1.c b/src/mame/machine/konami1.c
index caa810bb8e4..5d0d4df4f03 100644
--- a/src/mame/machine/konami1.c
+++ b/src/mame/machine/konami1.c
@@ -42,13 +42,13 @@ static UINT8 konami1_decodebyte( UINT8 opcode, UINT16 address )
UINT8 *konami1_decode(running_machine &machine, const char *cpu)
{
- address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cpu)->memory().space(AS_PROGRAM);
const UINT8 *rom = machine.root_device().memregion(cpu)->base();
int size = machine.root_device().memregion(cpu)->bytes();
int A;
UINT8 *decrypted = auto_alloc_array(machine, UINT8, size);
- space->set_decrypted_region(0x0000, 0xffff, decrypted);
+ space.set_decrypted_region(0x0000, 0xffff, decrypted);
for (A = 0;A < size;A++)
{
diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c
index 60790f1f84e..e953b33fac8 100644
--- a/src/mame/machine/konppc.c
+++ b/src/mame/machine/konppc.c
@@ -129,7 +129,7 @@ READ32_HANDLER( cgboard_dsp_comm_r_ppc )
{
if (cgboard_id < MAX_CG_BOARDS)
{
-// mame_printf_debug("dsp_cmd_r: (board %d) %08X, %08X at %08X\n", cgboard_id, offset, mem_mask, space->device().safe_pc());
+// mame_printf_debug("dsp_cmd_r: (board %d) %08X, %08X at %08X\n", cgboard_id, offset, mem_mask, space.device().safe_pc());
return dsp_comm_sharc[cgboard_id][offset] | (dsp_state[cgboard_id] << 16);
}
else
@@ -142,9 +142,9 @@ WRITE32_HANDLER( cgboard_dsp_comm_w_ppc )
{
const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2";
const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2";
- device_t *dsp = space->machine().device(dsptag);
- device_t *k033906 = space->machine().device(pcitag);
-// mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, space->device().safe_pc());
+ device_t *dsp = space.machine().device(dsptag);
+ device_t *k033906 = space.machine().device(pcitag);
+// mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, space.device().safe_pc());
if (cgboard_id < MAX_CG_BOARDS)
{
@@ -198,7 +198,7 @@ WRITE32_HANDLER( cgboard_dsp_shared_w_ppc )
{
if (cgboard_id < MAX_CG_BOARDS)
{
- space->machine().scheduler().trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround)
+ space.machine().scheduler().trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround)
COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD)));
}
}
@@ -212,7 +212,7 @@ static UINT32 dsp_comm_sharc_r(int board, int offset)
return dsp_comm_ppc[board][offset];
}
-static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32 data)
+static void dsp_comm_sharc_w(address_space &space, int board, int offset, UINT32 data)
{
if (offset >= 2)
{
@@ -225,12 +225,12 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
case CGBOARD_TYPE_GTICLUB:
{
//machine.device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG0, ASSERT_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 0, ASSERT_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 0, ASSERT_LINE);
if (offset == 1)
{
if (data & 0x03)
- space->machine().device("dsp")->execute().set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
+ space.machine().device("dsp")->execute().set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE);
}
break;
}
@@ -239,7 +239,7 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
case CGBOARD_TYPE_HANGPLT:
{
const char *dsptag = (board == 0) ? "dsp" : "dsp2";
- device_t *device = space->machine().device(dsptag);
+ device_t *device = space.machine().device(dsptag);
if (offset == 1)
{
@@ -254,7 +254,7 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
{
int offset = (data & 0x08) ? 1 : 0;
- space->machine().root_device().membank(texture_bank[board])->set_entry(offset);
+ space.machine().root_device().membank(texture_bank[board])->set_entry(offset);
}
}
break;
@@ -268,14 +268,14 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
{
int offset = (data & 0x08) ? 1 : 0;
- space->machine().root_device().membank(texture_bank[board])->set_entry(offset);
+ space.machine().root_device().membank(texture_bank[board])->set_entry(offset);
}
}
break;
}
}
-// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", space->machine().describe_context(), data, offset, mem_mask);
+// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", space.machine().describe_context(), data, offset, mem_mask);
dsp_comm_sharc[board][offset] = data;
}
@@ -351,10 +351,10 @@ WRITE32_HANDLER( cgboard_1_shared_sharc_w )
/*****************************************************************************/
-static UINT32 nwk_fifo_r(address_space *space, int board)
+static UINT32 nwk_fifo_r(address_space &space, int board)
{
const char *dsptag = (board == 0) ? "dsp" : "dsp2";
- device_t *device = space->machine().device(dsptag);
+ device_t *device = space.machine().device(dsptag);
UINT32 data;
if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r)
@@ -409,32 +409,32 @@ static void nwk_fifo_w(running_machine &machine, int board, UINT32 data)
READ32_HANDLER( K033906_0_r )
{
- device_t *k033906_1 = space->machine().device("k033906_1");
+ device_t *k033906_1 = space.machine().device("k033906_1");
if (nwk_device_sel[0] & 0x01)
return nwk_fifo_r(space, 0);
else
- return k033906_r(k033906_1, *space, offset, mem_mask);
+ return k033906_r(k033906_1, space, offset, mem_mask);
}
WRITE32_HANDLER( K033906_0_w )
{
- device_t *k033906_1 = space->machine().device("k033906_1");
- k033906_w(k033906_1, *space, offset, data, mem_mask);
+ device_t *k033906_1 = space.machine().device("k033906_1");
+ k033906_w(k033906_1, space, offset, data, mem_mask);
}
READ32_HANDLER( K033906_1_r )
{
- device_t *k033906_2 = space->machine().device("k033906_2");
+ device_t *k033906_2 = space.machine().device("k033906_2");
if (nwk_device_sel[1] & 0x01)
return nwk_fifo_r(space, 1);
else
- return k033906_r(k033906_2, *space, offset, mem_mask);
+ return k033906_r(k033906_2, space, offset, mem_mask);
}
WRITE32_HANDLER(K033906_1_w)
{
- device_t *k033906_2 = space->machine().device("k033906_2");
- k033906_w(k033906_2, *space, offset, data, mem_mask);
+ device_t *k033906_2 = space.machine().device("k033906_2");
+ k033906_w(k033906_2, space, offset, data, mem_mask);
}
/*****************************************************************************/
diff --git a/src/mame/machine/m68kfmly.c b/src/mame/machine/m68kfmly.c
index 068afd1e629..456ebd20666 100644
--- a/src/mame/machine/m68kfmly.c
+++ b/src/mame/machine/m68kfmly.c
@@ -148,70 +148,70 @@ static UINT16 tmp68301_timer[0x50];
READ16_HANDLER( tmp68301_address_decoder_r )
{
- LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", space->device().safe_pc(), (0xfffc00 + (offset * 2))));
+ LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", space.device().safe_pc(), (0xfffc00 + (offset * 2))));
return tmp68301_address_decoder[offset];
}
WRITE16_HANDLER( tmp68301_address_decoder_w )
{
- LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", space->device().safe_pc(), (0xfffc00 + (offset * 2)), data));
+ LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", space.device().safe_pc(), (0xfffc00 + (offset * 2)), data));
tmp68301_address_decoder[offset] = data;
}
READ16_HANDLER( tmp68301_interrupt_controller_r )
{
- LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", space->device().safe_pc(), (0xfffc80 + (offset * 2))));
+ LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", space.device().safe_pc(), (0xfffc80 + (offset * 2))));
return tmp68301_interrupt_controller[offset];
}
WRITE16_HANDLER( tmp68301_interrupt_controller_w )
{
- LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", space->device().safe_pc(), (0xfffc80 + (offset * 2)), data));
+ LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", space.device().safe_pc(), (0xfffc80 + (offset * 2)), data));
tmp68301_interrupt_controller[offset] = data;
}
READ16_HANDLER( tmp68301_parallel_interface_r )
{
- LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", space->device().safe_pc(), (0xfffd00 + (offset * 2))));
+ LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", space.device().safe_pc(), (0xfffd00 + (offset * 2))));
return tmp68301_parallel_interface[offset];
}
WRITE16_HANDLER( tmp68301_parallel_interface_w )
{
- LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", space->device().safe_pc(), (0xfffd00 + (offset * 2)), data));
+ LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", space.device().safe_pc(), (0xfffd00 + (offset * 2)), data));
tmp68301_parallel_interface[offset] = data;
}
READ16_HANDLER( tmp68301_serial_interface_r )
{
- LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", space->device().safe_pc(), (0xfffd80 + (offset * 2))));
+ LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", space.device().safe_pc(), (0xfffd80 + (offset * 2))));
return tmp68301_serial_interface[offset];
}
WRITE16_HANDLER( tmp68301_serial_interface_w )
{
- LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", space->device().safe_pc(), (0xfffd80 + (offset * 2)), data));
+ LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", space.device().safe_pc(), (0xfffd80 + (offset * 2)), data));
tmp68301_serial_interface[offset] = data;
}
READ16_HANDLER( tmp68301_timer_r )
{
- LOG(("PC %08X: TMP68301_timer_r (%08X)\n", space->device().safe_pc(), (0xfffe00 + (offset * 2))));
+ LOG(("PC %08X: TMP68301_timer_r (%08X)\n", space.device().safe_pc(), (0xfffe00 + (offset * 2))));
return tmp68301_timer[offset];
}
WRITE16_HANDLER( tmp68301_timer_w )
{
- LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", space->device().safe_pc(), (0xfffe00 + (offset * 2)), data));
+ LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", space.device().safe_pc(), (0xfffe00 + (offset * 2)), data));
tmp68301_timer[offset] = data;
}
diff --git a/src/mame/machine/maniach.c b/src/mame/machine/maniach.c
index fd07c38ce4d..e459ec0dbcf 100644
--- a/src/mame/machine/maniach.c
+++ b/src/mame/machine/maniach.c
@@ -21,23 +21,23 @@
READ8_HANDLER( maniach_68705_port_a_r )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
- //logerror("%04x: 68705 port A read %02x\n", space->device().safe_pc(), state->m_port_a_in);
+ //logerror("%04x: 68705 port A read %02x\n", space.device().safe_pc(), state->m_port_a_in);
return (state->m_port_a_out & state->m_ddr_a) | (state->m_port_a_in & ~state->m_ddr_a);
}
WRITE8_HANDLER( maniach_68705_port_a_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
- //logerror("%04x: 68705 port A write %02x\n", space->device().safe_pc(), data);
+ //logerror("%04x: 68705 port A write %02x\n", space.device().safe_pc(), data);
state->m_port_a_out = data;
}
WRITE8_HANDLER( maniach_68705_ddr_a_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
state->m_ddr_a = data;
}
@@ -54,15 +54,15 @@ WRITE8_HANDLER( maniach_68705_ddr_a_w )
READ8_HANDLER( maniach_68705_port_b_r )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
return (state->m_port_b_out & state->m_ddr_b) | (state->m_port_b_in & ~state->m_ddr_b);
}
WRITE8_HANDLER( maniach_68705_port_b_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
- //logerror("%04x: 68705 port B write %02x\n", space->device().safe_pc(), data);
+ //logerror("%04x: 68705 port B write %02x\n", space.device().safe_pc(), data);
if (BIT(state->m_ddr_b, 1) && BIT(~data, 1) && BIT(state->m_port_b_out, 1))
{
@@ -82,14 +82,14 @@ WRITE8_HANDLER( maniach_68705_port_b_w )
WRITE8_HANDLER( maniach_68705_ddr_b_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
state->m_ddr_b = data;
}
READ8_HANDLER( maniach_68705_port_c_r )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
state->m_port_c_in = 0;
@@ -106,45 +106,45 @@ READ8_HANDLER( maniach_68705_port_c_r )
WRITE8_HANDLER( maniach_68705_port_c_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
- //logerror("%04x: 68705 port C write %02x\n", space->device().safe_pc(), data);
+ //logerror("%04x: 68705 port C write %02x\n", space.device().safe_pc(), data);
state->m_port_c_out = data;
}
WRITE8_HANDLER( maniach_68705_ddr_c_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
state->m_ddr_c = data;
}
WRITE8_HANDLER( maniach_mcu_w )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
- //logerror("%04x: 3040_w %02x\n", space->device().safe_pc(), data);
+ //logerror("%04x: 3040_w %02x\n", space.device().safe_pc(), data);
state->m_from_main = data;
state->m_main_sent = 1;
}
READ8_HANDLER( maniach_mcu_r )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
- //logerror("%04x: 3040_r %02x\n", space->device().safe_pc(), state->m_from_mcu);
+ //logerror("%04x: 3040_r %02x\n", space.device().safe_pc(), state->m_from_mcu);
state->m_mcu_sent = 0;
return state->m_from_mcu;
}
READ8_HANDLER( maniach_mcu_status_r )
{
- matmania_state *state = space->machine().driver_data<matmania_state>();
+ matmania_state *state = space.machine().driver_data<matmania_state>();
int res = 0;
/* bit 0 = when 0, mcu has sent data to the main cpu */
/* bit 1 = when 1, mcu is ready to receive data from main cpu */
- //logerror("%04x: 3041_r\n", space->device().safe_pc());
+ //logerror("%04x: 3041_r\n", space.device().safe_pc());
if (!state->m_mcu_sent)
res |= 0x01;
if (!state->m_main_sent)
diff --git a/src/mame/machine/mc8123.c b/src/mame/machine/mc8123.c
index 93af8de623e..052166f20fb 100644
--- a/src/mame/machine/mc8123.c
+++ b/src/mame/machine/mc8123.c
@@ -377,7 +377,7 @@ static UINT8 mc8123_decrypt(offs_t addr,UINT8 val,const UINT8 *key,int opcode)
void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks)
{
- address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cpu)->memory().space(AS_PROGRAM);
int fixed_length = numbanks == 1 ? 0xc000 : 0x8000;
UINT8 *decrypted1 = auto_alloc_array(machine, UINT8, fixed_length);
UINT8 *decrypted2 = numbanks > 1 ? auto_alloc_array(machine, UINT8, 0x4000 * numbanks) : 0;
@@ -385,7 +385,7 @@ void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *k
UINT8 *key = machine.root_device().memregion(keyrgn)->base();
int A, bank;
- space->set_decrypted_region(0x0000, fixed_length-1, decrypted1);
+ space.set_decrypted_region(0x0000, fixed_length-1, decrypted1);
for (A = 0x0000;A < fixed_length;A++)
{
diff --git a/src/mame/machine/mcr68.c b/src/mame/machine/mcr68.c
index 011ef0a4dc0..c8eb69ade74 100644
--- a/src/mame/machine/mcr68.c
+++ b/src/mame/machine/mcr68.c
@@ -289,8 +289,8 @@ WRITE8_DEVICE_HANDLER( zwackery_pia1_w )
WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w )
{
mcr68_state *drvstate = device->machine().driver_data<mcr68_state>();
- address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
- drvstate->m_chip_squeak_deluxe->write(*space, 0, (state << 4) | drvstate->m_zwackery_sound_data);
+ address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ drvstate->m_chip_squeak_deluxe->write(space, 0, (state << 4) | drvstate->m_zwackery_sound_data);
}
diff --git a/src/mame/machine/md_cart.c b/src/mame/machine/md_cart.c
index ddbef4295f8..3cc5662ab50 100644
--- a/src/mame/machine/md_cart.c
+++ b/src/mame/machine/md_cart.c
@@ -189,7 +189,7 @@ static int md_get_pcb_id(const char *pcb)
*************************************/
static WRITE16_HANDLER( genesis_ssf2_bank_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
UINT8 *ROM = state->memregion("maincpu")->base();
if ((state->m_md_cart.ssf2_lastoff != offset) || (state->m_md_cart.ssf2_lastdata != data))
@@ -236,20 +236,20 @@ static WRITE16_HANDLER( genesis_ssf2_bank_w )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( l3alt_pdat_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.l3alt_pdat = data;
}
static WRITE16_HANDLER( l3alt_pcmd_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.l3alt_pcmd = data;
}
#endif
static READ16_HANDLER( l3alt_prot_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
int retdata = 0;
offset &= 0x07;
@@ -296,7 +296,7 @@ static READ16_HANDLER( l3alt_prot_r )
static WRITE16_HANDLER( l3alt_prot_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
offset &= 0x7;
switch (offset)
@@ -321,7 +321,7 @@ static WRITE16_HANDLER( l3alt_bank_w )
{
case 0:
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
/* printf("%06x data %04x\n",activecpu_get_pc(), data); */
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + (data & 0xffff) * 0x8000], 0x8000);
}
@@ -341,14 +341,14 @@ static WRITE16_HANDLER( l3alt_bank_w )
*************************************/
static WRITE16_HANDLER( realtec_402000_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.realtec_bank_addr = 0;
state->m_md_cart.realtec_bank_size = (data >> 8) & 0x1f;
}
static WRITE16_HANDLER( realtec_400000_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
int bankdata = (data >> 9) & 0x7;
UINT8 *ROM = state->memregion("maincpu")->base();
@@ -362,7 +362,7 @@ static WRITE16_HANDLER( realtec_400000_w )
static WRITE16_HANDLER( realtec_404000_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
int bankdata = (data >> 8) & 0x3;
UINT8 *ROM = state->memregion("maincpu")->base();
@@ -381,7 +381,7 @@ static WRITE16_HANDLER( realtec_404000_w )
*************************************/
static WRITE16_HANDLER( chifi3_bank_w )
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
if (data == 0xf100) // *hit player
{
@@ -417,7 +417,7 @@ static WRITE16_HANDLER( chifi3_bank_w )
}
else
{
- logerror("%06x chifi3, bankw? %04x %04x\n", space->device().safe_pc(), offset, data);
+ logerror("%06x chifi3, bankw? %04x %04x\n", space.device().safe_pc(), offset, data);
}
}
@@ -434,47 +434,47 @@ static READ16_HANDLER( chifi3_prot_r )
04cefa chifi3, prot_r? 65262
*/
- if (space->device().safe_pc() == 0x01782) // makes 'VS' screen appear
+ if (space.device().safe_pc() == 0x01782) // makes 'VS' screen appear
{
- retdat = space->device().state().state_int(M68K_D3) & 0xff;
+ retdat = space.device().state().state_int(M68K_D3) & 0xff;
retdat <<= 8;
return retdat;
}
- else if (space->device().safe_pc() == 0x1c24) // background gfx etc.
+ else if (space.device().safe_pc() == 0x1c24) // background gfx etc.
{
- retdat = space->device().state().state_int(M68K_D3) & 0xff;
+ retdat = space.device().state().state_int(M68K_D3) & 0xff;
retdat <<= 8;
return retdat;
}
- else if (space->device().safe_pc() == 0x10c4a) // unknown
+ else if (space.device().safe_pc() == 0x10c4a) // unknown
{
- return space->machine().rand();
+ return space.machine().rand();
}
- else if (space->device().safe_pc() == 0x10c50) // unknown
+ else if (space.device().safe_pc() == 0x10c50) // unknown
{
- return space->machine().rand();
+ return space.machine().rand();
}
- else if (space->device().safe_pc() == 0x10c52) // relates to the game speed..
+ else if (space.device().safe_pc() == 0x10c52) // relates to the game speed..
{
- retdat = space->device().state().state_int(M68K_D4) & 0xff;
+ retdat = space.device().state().state_int(M68K_D4) & 0xff;
retdat <<= 8;
return retdat;
}
- else if (space->device().safe_pc() == 0x061ae)
+ else if (space.device().safe_pc() == 0x061ae)
{
- retdat = space->device().state().state_int(M68K_D3) & 0xff;
+ retdat = space.device().state().state_int(M68K_D3) & 0xff;
retdat <<= 8;
return retdat;
}
- else if (space->device().safe_pc() == 0x061b0)
+ else if (space.device().safe_pc() == 0x061b0)
{
- retdat = space->device().state().state_int(M68K_D3) & 0xff;
+ retdat = space.device().state().state_int(M68K_D3) & 0xff;
retdat <<= 8;
return retdat;
}
else
{
- logerror("%06x chifi3, prot_r? %04x\n", space->device().safe_pc(), offset);
+ logerror("%06x chifi3, prot_r? %04x\n", space.device().safe_pc(), offset);
}
return 0;
@@ -485,7 +485,7 @@ static READ16_HANDLER( chifi3_prot_r )
*************************************/
static WRITE16_HANDLER( s19in1_bank )
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
memcpy(ROM + 0x000000, ROM + 0x400000 + ((offset << 1) * 0x10000), 0x80000);
}
@@ -494,7 +494,7 @@ static WRITE16_HANDLER( s19in1_bank )
*************************************/
static WRITE16_HANDLER( kaiju_bank_w )
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
memcpy(ROM + 0x000000, ROM + 0x400000 + (data & 0x7f) * 0x8000, 0x8000);
}
@@ -503,20 +503,20 @@ static WRITE16_HANDLER( kaiju_bank_w )
*************************************/
static READ16_HANDLER( soulb_400006_r )
{
-// printf("%06x soulb_400006_r\n",space->device().safe_pc());
+// printf("%06x soulb_400006_r\n",space.device().safe_pc());
return 0xf000;
}
static READ16_HANDLER( soulb_400002_r )
{
-// printf("%06x soulb_400002_r\n",space->device().safe_pc());
+// printf("%06x soulb_400002_r\n",space.device().safe_pc());
return 0x9800;
}
static READ16_HANDLER( soulb_400004_r )
{
// return 0x9800;
-// printf("%06x soulb_400004_r\n",space->device().safe_pc());
+// printf("%06x soulb_400004_r\n",space.device().safe_pc());
//
return 0xc900;
//aa
@@ -601,7 +601,7 @@ static READ16_HANDLER( kof99_A13000_r )
static READ16_HANDLER( radica_bank_select )
{
int bank = offset & 0x3f;
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
memcpy(ROM, ROM + 0x400000 + (bank * 0x10000), 0x400000);
return 0;
}
@@ -624,13 +624,13 @@ static READ16_HANDLER( redclif_prot2_r )
*************************************/
static READ16_HANDLER( squirrel_king_extra_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
return state->m_md_cart.squirrel_king_extra;
}
static WRITE16_HANDLER( squirrel_king_extra_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.squirrel_king_extra = data;
}
@@ -639,25 +639,25 @@ static WRITE16_HANDLER( squirrel_king_extra_w )
*************************************/
static READ16_HANDLER( lion2_prot1_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
return state->m_md_cart.lion2_prot1_data;
}
static READ16_HANDLER( lion2_prot2_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
return state->m_md_cart.lion2_prot2_data;
}
static WRITE16_HANDLER ( lion2_prot1_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.lion2_prot1_data = data;
}
static WRITE16_HANDLER ( lion2_prot2_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.lion2_prot2_data = data;
}
@@ -741,11 +741,11 @@ static READ16_HANDLER( topfig_6BD294_r ) /* colours on title screen */
cpu #0 (PC=001771A2): unmapped program memory word read from 006BD294 & 00FF
*/
- if (space->device().safe_pc()==0x1771a2) return 0x50;
+ if (space.device().safe_pc()==0x1771a2) return 0x50;
else
{
x++;
- logerror("%06x topfig_6BD294_r %04x\n",space->device().safe_pc(), x);
+ logerror("%06x topfig_6BD294_r %04x\n",space.device().safe_pc(), x);
return x;
}
}
@@ -754,25 +754,25 @@ static READ16_HANDLER( topfig_6F5344_r ) // after char select
{
static int x = -1;
- if (space->device().safe_pc()==0x4C94E)
+ if (space.device().safe_pc()==0x4C94E)
{
- return space->machine().device("maincpu")->state().state_int((M68K_D0)) & 0xff;
+ return space.machine().device("maincpu")->state().state_int((M68K_D0)) & 0xff;
}
else
{
x++;
- logerror("%06x topfig_6F5344_r %04x\n",space->device().safe_pc(), x);
+ logerror("%06x topfig_6F5344_r %04x\n",space.device().safe_pc(), x);
return x;
}
}
static WRITE16_HANDLER( topfig_bank_w )
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
if (data == 0x002a)
{
memcpy(ROM + 0x060000, ROM + 0x570000, 0x8000); // == 0x2e*0x8000?!
- // printf("%06x offset %06x, data %04x\n",space->device().safe_pc(), offset, data);
+ // printf("%06x offset %06x, data %04x\n",space.device().safe_pc(), offset, data);
}
else if (data==0x0035) // characters ingame
@@ -788,11 +788,11 @@ static WRITE16_HANDLER( topfig_bank_w )
memcpy(ROM + 0x060000, ROM + 0x460000, 0x8000);
memcpy(ROM + 0x020000, ROM + 0x420000, 0x8000);
memcpy(ROM + 0x058000, ROM + 0x458000, 0x8000);
- // printf("%06x offset %06x, data %04x\n",space->device().safe_pc(), offset, data);
+ // printf("%06x offset %06x, data %04x\n",space.device().safe_pc(), offset, data);
}
else
{
- logerror("%06x offset %06x, data %04x\n", space->device().safe_pc(), offset, data);
+ logerror("%06x offset %06x, data %04x\n", space.device().safe_pc(), offset, data);
}
}
@@ -815,7 +815,7 @@ static READ16_HANDLER( topfig_645B44_r )
*************************************/
static WRITE16_HANDLER( mc_12in1_bank_w )
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
logerror("offset %06x", offset << 17);
memcpy(ROM + 0x000000, ROM + VIRGIN_COPY_GEN + ((offset & 0x3f) << 17), 0x100000);
}
@@ -836,7 +836,7 @@ static WRITE16_HANDLER( genesis_TMSS_bank_w )
static WRITE16_HANDLER( psolar_bank_w )
{
- UINT8 *ROM = space->machine().root_device().memregion("maincpu")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
logerror("switch bank %02x, page %02x\n",offset, data);
memcpy(&ROM[0x280000 + (0x80000 * offset)], &ROM[VIRGIN_COPY_GEN + (0x80000 * (data&0x0f))], 0x80000);
}
@@ -879,7 +879,7 @@ static READ16_HANDLER( psolar_hack_r )
*************************************/
static READ16_HANDLER( genesis_sram_read )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
UINT8 *ROM;
int rom_offset;
@@ -896,7 +896,7 @@ static READ16_HANDLER( genesis_sram_read )
static WRITE16_HANDLER( genesis_sram_write )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
if (state->m_md_cart.sram_active)
{
if (!state->m_md_cart.sram_readonly)
@@ -923,7 +923,7 @@ static void install_sram_rw_handlers(running_machine &machine, bool mask_addr)
static WRITE16_HANDLER( genesis_sram_toggle )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
/* unsure if this is actually supposed to toggle or just switch on?
Yet to encounter game that utilizes */
@@ -931,18 +931,18 @@ static WRITE16_HANDLER( genesis_sram_toggle )
state->m_md_cart.sram_readonly = (data & 2) ? 1 : 0;
if (state->m_md_cart.sram_active && !state->m_md_cart.sram_handlers_installed)
- install_sram_rw_handlers(space->machine(), TRUE);
+ install_sram_rw_handlers(space.machine(), TRUE);
}
static READ16_HANDLER( sega_6658a_reg_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
return state->m_md_cart.sram_active;
}
static WRITE16_HANDLER( sega_6658a_reg_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
if (data == 1)
state->m_md_cart.sram_active = 1;
if (data == 0)
@@ -957,88 +957,88 @@ static WRITE16_HANDLER( sega_6658a_reg_w )
static READ16_HANDLER( nba_jam_eeprom_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
-// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
+// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
return state->m_md_cart.i2c_mem & 1;
}
static WRITE16_HANDLER( nba_jam_eeprom_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.i2c_clk = (data & 0x0002) >> 1;
state->m_md_cart.i2c_mem = (data & 0x0001);
-// i2cmem_sda_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_mem);
+// i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
+// i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
}
static READ16_HANDLER( nba_jam_te_eeprom_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
-// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
+// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
return (state->m_md_cart.i2c_mem & 1);
}
static WRITE16_HANDLER( nba_jam_te_eeprom_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.i2c_clk = ((data & 0x0100) >> 8);
state->m_md_cart.i2c_mem = data & 0x0001;
-// i2cmem_sda_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_mem);
+// i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
+// i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
}
static READ16_HANDLER( ea_nhlpa_eeprom_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
-// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
+// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
return (state->m_md_cart.i2c_mem & 1) << 7;
}
static WRITE16_HANDLER( ea_nhlpa_eeprom_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.i2c_clk = ((data & 0x0040) >> 6);
state->m_md_cart.i2c_mem = ((data & 0x0080) >> 7);
-// i2cmem_sda_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_mem);
+// i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
+// i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
}
/* TODO: identical as NBA Jam, used as kludge */
static READ16_HANDLER( wboy_v_eeprom_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
-// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
+// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
return ~state->m_md_cart.i2c_mem & 1;
}
static WRITE16_HANDLER( wboy_v_eeprom_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.i2c_clk = (data & 0x0002) >> 1;
state->m_md_cart.i2c_mem = (data & 0x0001);
-// i2cmem_sda_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_mem);
+// i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
+// i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
}
static READ16_HANDLER( codemasters_eeprom_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
-// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
+// state->m_md_cart.i2c_mem = (i2cmem_sda_read(space.machine().device("i2cmem")) & 1);
return (state->m_md_cart.i2c_mem & 1) << 7;
}
static WRITE16_HANDLER( codemasters_eeprom_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_md_cart.i2c_clk = (data & 0x0200) >> 9;
state->m_md_cart.i2c_mem = (data & 0x0100) >> 8;
-// i2cmem_sda_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine().device("i2cmem"), state->m_md_cart.i2c_mem);
+// i2cmem_sda_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_clk);
+// i2cmem_scl_write(space.machine().device("i2cmem"), state->m_md_cart.i2c_mem);
}
/* ST M95320 32Kbit serial EEPROM implementation */
diff --git a/src/mame/machine/megacd.c b/src/mame/machine/megacd.c
index ebf5622ce7d..4c99600e437 100644
--- a/src/mame/machine/megacd.c
+++ b/src/mame/machine/megacd.c
@@ -886,7 +886,7 @@ void CDC_End_Transfer(running_machine& machine)
void CDC_Do_DMA(running_machine& machine, int rate)
{
- address_space* space = machine.device(":segacd:segacd_68k")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device(":segacd:segacd_68k")->memory().space(AS_PROGRAM);
UINT32 dstoffset, length;
UINT8 *dest;
@@ -949,8 +949,8 @@ void CDC_Do_DMA(running_machine& machine, int rate)
if (PCM_DMA)
{
- space->write_byte(0xff2000+(((dstoffset*2)+1)&0x1fff),data >> 8);
- space->write_byte(0xff2000+(((dstoffset*2)+3)&0x1fff),data & 0xff);
+ space.write_byte(0xff2000+(((dstoffset*2)+1)&0x1fff),data >> 8);
+ space.write_byte(0xff2000+(((dstoffset*2)+3)&0x1fff),data & 0xff);
// printf("PCM_DMA writing %04x %04x\n",0xff2000+(dstoffset*2), data);
}
else
@@ -967,7 +967,7 @@ void CDC_Do_DMA(running_machine& machine, int rate)
dest[dstoffset+1] = data >>8;
dest[dstoffset+0] = data&0xff;
- segacd_mark_tiles_dirty(space->machine(), dstoffset/2);
+ segacd_mark_tiles_dirty(space.machine(), dstoffset/2);
}
else
{
@@ -975,11 +975,11 @@ void CDC_Do_DMA(running_machine& machine, int rate)
if (!(scd_rammode & 1))
{
- segacd_1meg_mode_word_write(space->machine(),(dstoffset+0x20000)/2, data, 0xffff, 0);
+ segacd_1meg_mode_word_write(space.machine(),(dstoffset+0x20000)/2, data, 0xffff, 0);
}
else
{
- segacd_1meg_mode_word_write(space->machine(),(dstoffset+0x00000)/2, data, 0xffff, 0);
+ segacd_1meg_mode_word_write(space.machine(),(dstoffset+0x00000)/2, data, 0xffff, 0);
}
}
@@ -1233,7 +1233,7 @@ static tilemap_t *segacd_stampmap[4];
static WRITE16_HANDLER( scd_a12000_halt_reset_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
UINT16 old_halt = a12000_halt_reset_reg;
@@ -1244,24 +1244,24 @@ static WRITE16_HANDLER( scd_a12000_halt_reset_w )
// reset line
if (a12000_halt_reset_reg&0x0001)
{
- space->machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+ space.machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
if (!(old_halt&0x0001)) printf("clear reset slave\n");
}
else
{
- space->machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ space.machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
if ((old_halt&0x0001)) printf("assert reset slave\n");
}
// request BUS
if (a12000_halt_reset_reg&0x0002)
{
- space->machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+ space.machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
if (!(old_halt&0x0002)) printf("halt slave\n");
}
else
{
- space->machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
+ space.machine().device(":segacd:segacd_68k")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
if ((old_halt&0x0002)) printf("resume slave\n");
}
}
@@ -1270,7 +1270,7 @@ static WRITE16_HANDLER( scd_a12000_halt_reset_w )
{
if (a12000_halt_reset_reg&0x0100)
{
- running_machine& machine = space->machine();
+ running_machine& machine = space.machine();
CHECK_SCD_LV2_INTERRUPT
}
@@ -1286,7 +1286,7 @@ static WRITE16_HANDLER( scd_a12000_halt_reset_w )
static READ16_HANDLER( scd_a12000_halt_reset_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return a12000_halt_reset_reg;
}
@@ -1305,7 +1305,7 @@ static READ16_HANDLER( scd_a12000_halt_reset_r )
static READ16_HANDLER( scd_a12002_memory_mode_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
int temp = scd_rammode;
int temp2 = 0;
@@ -1343,7 +1343,7 @@ static WRITE8_HANDLER( scd_a12002_memory_mode_w_8_15 )
static WRITE8_HANDLER( scd_a12002_memory_mode_w_0_7 )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
//printf("scd_a12002_memory_mode_w_0_7 %04x\n",data);
@@ -1369,7 +1369,7 @@ static WRITE8_HANDLER( scd_a12002_memory_mode_w_0_7 )
static WRITE16_HANDLER( scd_a12002_memory_mode_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15)
scd_a12002_memory_mode_w_8_15(space, 0, data>>8);
@@ -1383,7 +1383,7 @@ static WRITE16_HANDLER( scd_a12002_memory_mode_w )
static READ16_HANDLER( segacd_sub_memory_mode_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
int temp = scd_rammode;
int temp2 = 0;
@@ -1405,7 +1405,7 @@ WRITE8_HANDLER( segacd_sub_memory_mode_w_8_15 )
WRITE8_HANDLER( segacd_sub_memory_mode_w_0_7 )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
segacd_memory_priority_mode = (data&0x0018)>>3;
@@ -1465,7 +1465,7 @@ WRITE8_HANDLER( segacd_sub_memory_mode_w_0_7 )
static WRITE16_HANDLER( segacd_sub_memory_mode_w )
{
//printf("segacd_sub_memory_mode_w %04x %04x\n", data, mem_mask);
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15)
segacd_sub_memory_mode_w_8_15(space, 0, data>>8);
@@ -1488,13 +1488,13 @@ static UINT16 segacd_comms_flags = 0x0000;
static READ16_HANDLER( segacd_comms_flags_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_comms_flags;
}
static WRITE16_HANDLER( segacd_comms_flags_subcpu_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15) // Dragon's Lair
{
@@ -1510,7 +1510,7 @@ static WRITE16_HANDLER( segacd_comms_flags_subcpu_w )
static WRITE16_HANDLER( segacd_comms_flags_maincpu_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15)
{
@@ -1561,19 +1561,19 @@ UINT16 segacd_comms_part2[0x8];
static READ16_HANDLER( segacd_comms_main_part1_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_comms_part1[offset];
}
static WRITE16_HANDLER( segacd_comms_main_part1_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
COMBINE_DATA(&segacd_comms_part1[offset]);
}
static READ16_HANDLER( segacd_comms_main_part2_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_comms_part2[offset];
}
@@ -1585,7 +1585,7 @@ static WRITE16_HANDLER( segacd_comms_main_part2_w )
static READ16_HANDLER( segacd_comms_sub_part1_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_comms_part1[offset];
}
@@ -1596,13 +1596,13 @@ static WRITE16_HANDLER( segacd_comms_sub_part1_w )
static READ16_HANDLER( segacd_comms_sub_part2_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_comms_part2[offset];
}
static WRITE16_HANDLER( segacd_comms_sub_part2_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
COMBINE_DATA(&segacd_comms_part2[offset]);
}
@@ -1720,7 +1720,7 @@ static WRITE16_HANDLER( segacd_main_dataram_part1_w )
if (!(scd_rammode&1))
{
COMBINE_DATA(&segacd_dataram[offset]);
- segacd_mark_tiles_dirty(space->machine(), offset);
+ segacd_mark_tiles_dirty(space.machine(), offset);
}
else
{
@@ -1738,11 +1738,11 @@ static WRITE16_HANDLER( segacd_main_dataram_part1_w )
// ret bit set by sub cpu determines which half of WorkRAM we have access to?
if (scd_rammode&1)
{
- segacd_1meg_mode_word_write(space->machine(), offset+0x20000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space.machine(), offset+0x20000/2, data, mem_mask, 0);
}
else
{
- segacd_1meg_mode_word_write(space->machine(), offset+0x00000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space.machine(), offset+0x00000/2, data, mem_mask, 0);
}
}
else
@@ -1771,13 +1771,13 @@ static READ16_HANDLER( scd_hint_vector_r )
static READ16_HANDLER( scd_a12006_hint_register_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_hint_register;
}
static WRITE16_HANDLER( scd_a12006_hint_register_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
COMBINE_DATA(&segacd_hint_register);
}
@@ -2275,12 +2275,12 @@ static TIMER_CALLBACK( segacd_access_timer_callback )
READ16_HANDLER( cdc_data_sub_r )
{
- return CDC_Host_r(space->machine(), READ_SUB);
+ return CDC_Host_r(space.machine(), READ_SUB);
}
READ16_HANDLER( cdc_data_main_r )
{
- return CDC_Host_r(space->machine(), READ_MAIN);
+ return CDC_Host_r(space.machine(), READ_MAIN);
}
@@ -2304,7 +2304,7 @@ READ16_HANDLER( segacd_stopwatch_timer_r )
/* main CPU map set up in INIT */
void segacd_init_main_cpu( running_machine& machine )
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
segacd_font_bits = reinterpret_cast<UINT16 *>(machine.root_device().memshare(":segacd:segacd_font")->ptr());
segacd_backupram = reinterpret_cast<UINT16 *>(machine.root_device().memshare(":segacd:backupram")->ptr());
@@ -2315,36 +2315,36 @@ void segacd_init_main_cpu( running_machine& machine )
segacd_4meg_prgbank = 0;
- space->unmap_readwrite (0x020000,0x3fffff);
+ space.unmap_readwrite (0x020000,0x3fffff);
-// space->install_read_bank(0x0020000, 0x003ffff, "scd_4m_prgbank");
-// space->machine().root_device().membank("scd_4m_prgbank")->set_base(segacd_4meg_prgram + segacd_4meg_prgbank * 0x20000 );
- space->install_legacy_read_handler (0x0020000, 0x003ffff, FUNC(scd_4m_prgbank_ram_r) );
- space->install_legacy_write_handler (0x0020000, 0x003ffff, FUNC(scd_4m_prgbank_ram_w) );
+// space.install_read_bank(0x0020000, 0x003ffff, "scd_4m_prgbank");
+// space.machine().root_device().membank("scd_4m_prgbank")->set_base(segacd_4meg_prgram + segacd_4meg_prgbank * 0x20000 );
+ space.install_legacy_read_handler (0x0020000, 0x003ffff, FUNC(scd_4m_prgbank_ram_r) );
+ space.install_legacy_write_handler (0x0020000, 0x003ffff, FUNC(scd_4m_prgbank_ram_w) );
segacd_wordram_mapped = 1;
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x23ffff, FUNC(segacd_main_dataram_part1_r), FUNC(segacd_main_dataram_part1_w)); // RAM shared with sub
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x23ffff, FUNC(segacd_main_dataram_part1_r), FUNC(segacd_main_dataram_part1_w)); // RAM shared with sub
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12000, 0xa12001, FUNC(scd_a12000_halt_reset_r), FUNC(scd_a12000_halt_reset_w)); // sub-cpu control
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12002, 0xa12003, FUNC(scd_a12002_memory_mode_r), FUNC(scd_a12002_memory_mode_w)); // memory mode / write protect
- //space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12004, 0xa12005, FUNC(segacd_cdc_mode_address_r), FUNC(segacd_cdc_mode_address_w));
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12006, 0xa12007, FUNC(scd_a12006_hint_register_r), FUNC(scd_a12006_hint_register_w)); // where HINT points on main CPU
- //space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0xa12008, 0xa12009, FUNC(cdc_data_main_r));
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12000, 0xa12001, FUNC(scd_a12000_halt_reset_r), FUNC(scd_a12000_halt_reset_w)); // sub-cpu control
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12002, 0xa12003, FUNC(scd_a12002_memory_mode_r), FUNC(scd_a12002_memory_mode_w)); // memory mode / write protect
+ //space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12004, 0xa12005, FUNC(segacd_cdc_mode_address_r), FUNC(segacd_cdc_mode_address_w));
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12006, 0xa12007, FUNC(scd_a12006_hint_register_r), FUNC(scd_a12006_hint_register_w)); // where HINT points on main CPU
+ //space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0xa12008, 0xa12009, FUNC(cdc_data_main_r));
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200c, 0xa1200d, FUNC(segacd_stopwatch_timer_r), FUNC(segacd_stopwatch_timer_w)); // starblad
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200c, 0xa1200d, FUNC(segacd_stopwatch_timer_r), FUNC(segacd_stopwatch_timer_w)); // starblad
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200e, 0xa1200f, FUNC(segacd_comms_flags_r), FUNC(segacd_comms_flags_maincpu_w)); // communication flags block
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200e, 0xa1200f, FUNC(segacd_comms_flags_r), FUNC(segacd_comms_flags_maincpu_w)); // communication flags block
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12010, 0xa1201f, FUNC(segacd_comms_main_part1_r), FUNC(segacd_comms_main_part1_w));
- space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12020, 0xa1202f, FUNC(segacd_comms_main_part2_r), FUNC(segacd_comms_main_part2_w));
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12010, 0xa1201f, FUNC(segacd_comms_main_part1_r), FUNC(segacd_comms_main_part1_w));
+ space.machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12020, 0xa1202f, FUNC(segacd_comms_main_part2_r), FUNC(segacd_comms_main_part2_w));
machine.device(":segacd:segacd_68k")->execute().set_irq_acknowledge_callback(segacd_sub_int_callback);
- space->install_legacy_read_handler (0x0000070, 0x0000073, FUNC(scd_hint_vector_r) );
+ space.install_legacy_read_handler (0x0000070, 0x0000073, FUNC(scd_hint_vector_r) );
segacd_gfx_conversion_timer = machine.scheduler().timer_alloc(FUNC(segacd_gfx_conversion_timer_callback));
segacd_gfx_conversion_timer->adjust(attotime::never);
@@ -2551,7 +2551,7 @@ static WRITE16_HANDLER( segacd_sub_dataram_part1_w )
if (scd_rammode&1)
{
COMBINE_DATA(&segacd_dataram[offset]);
- segacd_mark_tiles_dirty(space->machine(), offset);
+ segacd_mark_tiles_dirty(space.machine(), offset);
}
else
{
@@ -2578,11 +2578,11 @@ static WRITE16_HANDLER( segacd_sub_dataram_part1_w )
if (scd_rammode&1)
{
- segacd_1meg_mode_word_write(space->machine(), offset/2+0x00000/2, data , mem_mask, 1);
+ segacd_1meg_mode_word_write(space.machine(), offset/2+0x00000/2, data , mem_mask, 1);
}
else
{
- segacd_1meg_mode_word_write(space->machine(), offset/2+0x20000/2, data, mem_mask, 1);
+ segacd_1meg_mode_word_write(space.machine(), offset/2+0x20000/2, data, mem_mask, 1);
}
// printf("Unspported: segacd_sub_dataram_part1_w in mode 1 (Word RAM Expander - 1 Byte Per Pixel) %04x\n", data);
@@ -2626,11 +2626,11 @@ static WRITE16_HANDLER( segacd_sub_dataram_part2_w )
// ret bit set by sub cpu determines which half of WorkRAM we have access to?
if (scd_rammode&1)
{
- segacd_1meg_mode_word_write(space->machine(),offset+0x00000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space.machine(),offset+0x00000/2, data, mem_mask, 0);
}
else
{
- segacd_1meg_mode_word_write(space->machine(),offset+0x20000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space.machine(),offset+0x20000/2, data, mem_mask, 0);
}
}
@@ -2640,7 +2640,7 @@ static WRITE16_HANDLER( segacd_sub_dataram_part2_w )
static READ16_HANDLER( segacd_irq_mask_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return segacd_irq_mask;
}
@@ -2649,7 +2649,7 @@ static WRITE16_HANDLER( segacd_irq_mask_w )
if (ACCESSING_BITS_0_7)
{
UINT16 control = CDD_CONTROL;
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
// printf("segacd_irq_mask_w %04x %04x (CDD control is %04x)\n",data, mem_mask, control);
if (data & 0x10)
@@ -2659,7 +2659,7 @@ static WRITE16_HANDLER( segacd_irq_mask_w )
if (!(segacd_irq_mask & 0x10))
{
segacd_irq_mask = data & 0x7e;
- CDD_Process(space->machine(), 0);
+ CDD_Process(space.machine(), 0);
return;
}
}
@@ -2677,7 +2677,7 @@ static WRITE16_HANDLER( segacd_irq_mask_w )
static READ16_HANDLER( segacd_cdd_ctrl_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
return CDD_CONTROL;
}
@@ -2687,7 +2687,7 @@ static WRITE16_HANDLER( segacd_cdd_ctrl_w )
if (ACCESSING_BITS_0_7)
{
UINT16 control = CDD_CONTROL;
- if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space.machine().scheduler().synchronize();
//printf("segacd_cdd_ctrl_w %04x %04x (control %04x irq %04x\n", data, mem_mask, control, segacd_irq_mask);
@@ -2699,7 +2699,7 @@ static WRITE16_HANDLER( segacd_cdd_ctrl_w )
{
if (segacd_irq_mask&0x10)
{
- CDD_Process(space->machine(), 1);
+ CDD_Process(space.machine(), 1);
}
}
}
@@ -2725,7 +2725,7 @@ static WRITE8_HANDLER( segacd_cdd_tx_w )
if(offset == 9)
{
- CDD_Import(space->machine());
+ CDD_Import(space.machine());
}
}
@@ -2858,7 +2858,7 @@ WRITE16_HANDLER( segacd_trace_vector_base_address_w )
//int i;
UINT8 pix = 0x0;
- pix = read_pixel_from_stampmap(space->machine(), srcbitmap, xbase>>(3+8), ybase>>(3+8));
+ pix = read_pixel_from_stampmap(space.machine(), srcbitmap, xbase>>(3+8), ybase>>(3+8));
xbase += deltax;
ybase += deltay;
@@ -2878,10 +2878,10 @@ WRITE16_HANDLER( segacd_trace_vector_base_address_w )
offset+=countx & 0x7;
- write_pixel( space->machine(), pix, offset );
+ write_pixel( space.machine(), pix, offset );
- segacd_mark_tiles_dirty(space->machine(), (offset>>3));
- segacd_mark_tiles_dirty(space->machine(), (offset>>3)+1);
+ segacd_mark_tiles_dirty(space.machine(), (offset>>3));
+ segacd_mark_tiles_dirty(space.machine(), (offset>>3)+1);
}
@@ -3032,12 +3032,12 @@ WRITE16_HANDLER( segacd_cdfader_w )
//printf("%f\n",cdfader_vol);
- cdda_set_volume(space->machine().device(":segacd:cdda"), cdfader_vol);
+ cdda_set_volume(space.machine().device(":segacd:cdda"), cdfader_vol);
}
READ16_HANDLER( segacd_backupram_r )
{
- if(ACCESSING_BITS_8_15 && !(space->debugger_access()))
+ if(ACCESSING_BITS_8_15 && !(space.debugger_access()))
printf("Warning: read to backupram even bytes! [%04x]\n",offset);
return segacd_backupram[offset] & 0xff;
@@ -3048,7 +3048,7 @@ WRITE16_HANDLER( segacd_backupram_w )
if(ACCESSING_BITS_0_7)
segacd_backupram[offset] = data;
- if(ACCESSING_BITS_8_15 && !(space->debugger_access()))
+ if(ACCESSING_BITS_8_15 && !(space.debugger_access()))
printf("Warning: write to backupram even bytes! [%04x] %02x\n",offset,data);
}
diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c
index 68ef263e9c9..473cc8c4e43 100644
--- a/src/mame/machine/megadriv.c
+++ b/src/mame/machine/megadriv.c
@@ -84,13 +84,13 @@ static void megadriv_z80_bank_w(UINT16 data)
static WRITE16_HANDLER( megadriv_68k_z80_bank_write )
{
- //logerror("%06x: 68k writing bit to bank register %01x\n", space->device().safe_pc(),data&0x01);
+ //logerror("%06x: 68k writing bit to bank register %01x\n", space.device().safe_pc(),data&0x01);
megadriv_z80_bank_w(data&0x01);
}
static WRITE8_HANDLER(megadriv_z80_z80_bank_w)
{
- //logerror("%04x: z80 writing bit to bank register %01x\n", space->device().safe_pc(),data&0x01);
+ //logerror("%04x: z80 writing bit to bank register %01x\n", space.device().safe_pc(),data&0x01);
megadriv_z80_bank_w(data&0x01);
}
@@ -413,11 +413,11 @@ READ16_HANDLER( megadriv_68k_io_read )
D0 : Bit 0 of version number
*/
- //return (space->machine().rand()&0x0f0f)|0xf0f0;//0x0000;
+ //return (space.machine().rand()&0x0f0f)|0xf0f0;//0x0000;
switch (offset)
{
case 0:
- logerror("%06x read version register\n", space->device().safe_pc());
+ logerror("%06x read version register\n", space.device().safe_pc());
retdata = megadrive_region_export<<7 | // Export
megadrive_region_pal<<6 | // NTSC
(sega_cd_connected?0x00:0x20) | // 0x20 = no sega cd
@@ -434,7 +434,7 @@ READ16_HANDLER( megadriv_68k_io_read )
case 0x2:
case 0x3:
// retdata = megadrive_io_read_data_port(offset-1);
- retdata = megadrive_io_read_data_port_ptr(space->machine(), offset-1);
+ retdata = megadrive_io_read_data_port_ptr(space.machine(), offset-1);
break;
case 0x4:
@@ -532,28 +532,28 @@ WRITE16_HANDLER( megadriv_68k_io_write )
case 0x2:
case 0x3:
// megadrive_io_write_data_port(offset-1,data);
- megadrive_io_write_data_port_ptr(space->machine(), offset-1,data);
+ megadrive_io_write_data_port_ptr(space.machine(), offset-1,data);
break;
case 0x4:
case 0x5:
case 0x6:
- megadrive_io_write_ctrl_port(space->machine(),offset-4,data);
+ megadrive_io_write_ctrl_port(space.machine(),offset-4,data);
break;
/* Serial I/O Registers */
- case 0x7: megadrive_io_write_tx_port(space->machine(),0,data); break;
- case 0x8: megadrive_io_write_rx_port(space->machine(),0,data); break;
- case 0x9: megadrive_io_write_sctrl_port(space->machine(),0,data); break;
+ case 0x7: megadrive_io_write_tx_port(space.machine(),0,data); break;
+ case 0x8: megadrive_io_write_rx_port(space.machine(),0,data); break;
+ case 0x9: megadrive_io_write_sctrl_port(space.machine(),0,data); break;
- case 0xa: megadrive_io_write_tx_port(space->machine(),1,data); break;
- case 0xb: megadrive_io_write_rx_port(space->machine(),1,data); break;
- case 0xc: megadrive_io_write_sctrl_port(space->machine(),1,data); break;
+ case 0xa: megadrive_io_write_tx_port(space.machine(),1,data); break;
+ case 0xb: megadrive_io_write_rx_port(space.machine(),1,data); break;
+ case 0xc: megadrive_io_write_sctrl_port(space.machine(),1,data); break;
- case 0xd: megadrive_io_write_tx_port(space->machine(),2,data); break;
- case 0xe: megadrive_io_write_rx_port(space->machine(),2,data); break;
- case 0xf: megadrive_io_write_sctrl_port(space->machine(),2,data); break;
+ case 0xd: megadrive_io_write_tx_port(space.machine(),2,data); break;
+ case 0xe: megadrive_io_write_rx_port(space.machine(),2,data); break;
+ case 0xf: megadrive_io_write_sctrl_port(space.machine(),2,data); break;
}
}
@@ -601,8 +601,8 @@ static READ16_HANDLER( megadriv_68k_read_z80_ram )
}
else
{
- logerror("%06x: 68000 attempting to access Z80 (read) address space without bus\n", space->device().safe_pc());
- return space->machine().rand();
+ logerror("%06x: 68000 attempting to access Z80 (read) address space without bus\n", space.device().safe_pc());
+ return space.machine().rand();
}
}
@@ -628,7 +628,7 @@ static WRITE16_HANDLER( megadriv_68k_write_z80_ram )
}
else
{
- logerror("%06x: 68000 attempting to access Z80 (write) address space without bus\n", space->device().safe_pc());
+ logerror("%06x: 68000 attempting to access Z80 (write) address space without bus\n", space.device().safe_pc());
}
}
@@ -644,7 +644,7 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus )
the value is never zero. Time Killers is the most fussy, and doesn't like the
read_next_instruction function from system16, so I just return a random value
in the unused bits */
- UINT16 nextvalue = space->machine().rand();//read_next_instruction(space)&0xff00;
+ UINT16 nextvalue = space.machine().rand();//read_next_instruction(space)&0xff00;
/* Check if the 68k has the z80 bus */
@@ -653,13 +653,13 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus )
if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = nextvalue | 0x0100;
else retvalue = (nextvalue & 0xfeff);
- //logerror("%06x: 68000 check z80 Bus (byte MSB access) returning %04x mask %04x\n", space->device().safe_pc(),retvalue, mem_mask);
+ //logerror("%06x: 68000 check z80 Bus (byte MSB access) returning %04x mask %04x\n", space.device().safe_pc(),retvalue, mem_mask);
return retvalue;
}
else if (!ACCESSING_BITS_8_15) // is this valid?
{
- //logerror("%06x: 68000 check z80 Bus (byte LSB access) %04x\n", space->device().safe_pc(),mem_mask);
+ //logerror("%06x: 68000 check z80 Bus (byte LSB access) %04x\n", space.device().safe_pc(),mem_mask);
if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = 0x0001;
else retvalue = 0x0000;
@@ -667,11 +667,11 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus )
}
else
{
- //logerror("%06x: 68000 check z80 Bus (word access) %04x\n", space->device().safe_pc(),mem_mask);
+ //logerror("%06x: 68000 check z80 Bus (word access) %04x\n", space.device().safe_pc(),mem_mask);
if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = nextvalue | 0x0100;
else retvalue = (nextvalue & 0xfeff);
- // mame_printf_debug("%06x: 68000 check z80 Bus (word access) %04x %04x\n", space->device().safe_pc(),mem_mask, retvalue);
+ // mame_printf_debug("%06x: 68000 check z80 Bus (word access) %04x %04x\n", space.device().safe_pc(),mem_mask, retvalue);
return retvalue;
}
}
@@ -708,12 +708,12 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus )
{
if (data & 0x0100)
{
- //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_has_bus = 0;
}
else
{
- //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_has_bus = 1;
}
}
@@ -721,12 +721,12 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus )
{
if (data & 0x0001)
{
- //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_has_bus = 0;
}
else
{
- //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_has_bus = 1;
}
}
@@ -734,19 +734,19 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus )
{
if (data & 0x0100)
{
- //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_has_bus = 0;
}
else
{
- //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_has_bus = 1;
}
}
/* If the z80 is running, sync the z80 execution state */
if ( ! genz80.z80_is_reset )
- space->machine().scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
+ space.machine().scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
}
static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
@@ -755,12 +755,12 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
{
if (data & 0x0100)
{
- //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_is_reset = 0;
}
else
{
- //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_is_reset = 1;
}
}
@@ -768,12 +768,12 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
{
if (data & 0x0001)
{
- //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_is_reset = 0;
}
else
{
- //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_is_reset = 1;
}
}
@@ -781,16 +781,16 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
{
if (data & 0x0100)
{
- //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_is_reset = 0;
}
else
{
- //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", space->device().safe_pc(),data,mem_mask);
+ //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", space.device().safe_pc(),data,mem_mask);
genz80.z80_is_reset = 1;
}
}
- space->machine().scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
+ space.machine().scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
}
@@ -800,14 +800,14 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
// z80 area of the 68k if games misbehave
static READ8_HANDLER( z80_read_68k_banked_data )
{
- address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
+ address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space();
UINT8 ret = space68k->read_byte(genz80.z80_bank_addr+offset);
return ret;
}
static WRITE8_HANDLER( z80_write_68k_banked_data )
{
- address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
+ address_space *space68k = space.machine().device<legacy_cpu_device>("maincpu")->space();
space68k->write_byte(genz80.z80_bank_addr+offset,data);
}
@@ -820,7 +820,7 @@ static WRITE8_HANDLER( megadriv_z80_vdp_write )
case 0x13:
case 0x15:
case 0x17:
- sn76496_w(space->machine().device("snsnd"), *space, 0, data);
+ sn76496_w(space.machine().device("snsnd"), space, 0, data);
break;
default:
@@ -834,7 +834,7 @@ static WRITE8_HANDLER( megadriv_z80_vdp_write )
static READ8_HANDLER( megadriv_z80_vdp_read )
{
mame_printf_debug("megadriv_z80_vdp_read %02x\n",offset);
- return space->machine().rand();
+ return space.machine().rand();
}
static READ8_HANDLER( megadriv_z80_unmapped_read )
diff --git a/src/mame/machine/megasvp.c b/src/mame/machine/megasvp.c
index 74b2c0d60a1..923bf33fee5 100644
--- a/src/mame/machine/megasvp.c
+++ b/src/mame/machine/megasvp.c
@@ -56,9 +56,9 @@ INLINE void overwrite_write(UINT16 *dst, UINT16 d)
if (d & 0x000f) { *dst &= ~0x000f; *dst |= d & 0x000f; }
}
-static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
+static UINT32 pm_io(address_space &space, int reg, int write, UINT32 d)
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
if (state->m_emu_status & SSP_PMC_SET)
{
state->m_pmac_read[write ? reg + 6 : reg] = state->m_pmc.d;
@@ -71,7 +71,7 @@ static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
}
- if (reg == 4 || (space->device().state().state_int(SSP_ST) & 0x60))
+ if (reg == 4 || (space.device().state().state_int(SSP_ST) & 0x60))
{
#define CADDR ((((mode<<16)&0x7f0000)|addr)<<1)
UINT16 *dram = (UINT16 *)state->m_dram;
@@ -112,7 +112,7 @@ static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
int addr = state->m_pmac_read[reg]&0xffff;
if ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct
{
- UINT16 *ROM = (UINT16 *) space->machine().root_device().memregion("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) space.machine().root_device().memregion("maincpu")->base();
state->m_pmac_read[reg] += 1;
d = ROM[addr|((mode&0xf)<<16)];
}
@@ -141,7 +141,7 @@ static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
static READ16_HANDLER( read_PM0 )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 d = pm_io(space, 0, 0, 0);
if (d != (UINT32)-1) return d;
d = state->m_XST2;
@@ -151,7 +151,7 @@ static READ16_HANDLER( read_PM0 )
static WRITE16_HANDLER( write_PM0 )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 r = pm_io(space, 0, 1, data);
if (r != (UINT32)-1) return;
state->m_XST2 = data; // ?
@@ -189,7 +189,7 @@ static WRITE16_HANDLER( write_PM2 )
static READ16_HANDLER( read_XST )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 d = pm_io(space, 3, 0, 0);
if (d != (UINT32)-1) return d;
@@ -198,7 +198,7 @@ static READ16_HANDLER( read_XST )
static WRITE16_HANDLER( write_XST )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 r = pm_io(space, 3, 1, data);
if (r != (UINT32)-1) return;
@@ -218,7 +218,7 @@ static WRITE16_HANDLER( write_PM4 )
static READ16_HANDLER( read_PMC )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
state->m_emu_status |= SSP_PMC_SET;
state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
@@ -231,7 +231,7 @@ static READ16_HANDLER( read_PMC )
static WRITE16_HANDLER( write_PMC )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
if (state->m_emu_status & SSP_PMC_HAVE_ADDR) {
state->m_emu_status |= SSP_PMC_SET;
state->m_emu_status &= ~SSP_PMC_HAVE_ADDR;
@@ -244,7 +244,7 @@ static WRITE16_HANDLER( write_PMC )
static READ16_HANDLER( read_AL )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
state->m_emu_status &= ~(SSP_PMC_SET|SSP_PMC_HAVE_ADDR);
return 0;
}
@@ -257,7 +257,7 @@ static WRITE16_HANDLER( write_AL )
static READ16_HANDLER( svp_68k_io_r )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 d;
switch (offset)
{
@@ -273,7 +273,7 @@ static READ16_HANDLER( svp_68k_io_r )
static WRITE16_HANDLER( svp_68k_io_w )
{
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
switch (offset)
{
// 0xa15000, 0xa15002
@@ -288,7 +288,7 @@ static WRITE16_HANDLER( svp_68k_io_w )
static READ16_HANDLER( svp_68k_cell1_r )
{
// this is rewritten 68k test code
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 a1 = offset;
a1 = (a1 & 0x7001) | ((a1 & 0x3e) << 6) | ((a1 & 0xfc0) >> 5);
return ((UINT16 *)state->m_dram)[a1];
@@ -297,7 +297,7 @@ static READ16_HANDLER( svp_68k_cell1_r )
static READ16_HANDLER( svp_68k_cell2_r )
{
// this is rewritten 68k test code
- mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
+ mdsvp_state *state = space.machine().driver_data<mdsvp_state>();
UINT32 a1 = offset;
a1 = (a1 & 0x7801) | ((a1 & 0x1e) << 6) | ((a1 & 0x7e0) >> 4);
return ((UINT16 *)state->m_dram)[a1];
@@ -333,7 +333,7 @@ static UINT8 megadrive_io_read_data_port_svp(running_machine &machine, int portn
static READ16_HANDLER( svp_speedup_r )
{
- space->device().execute().spin_until_time(attotime::from_usec(100));
+ space.device().execute().spin_until_time(attotime::from_usec(100));
return 0x0425;
}
diff --git a/src/mame/machine/megavdp.c b/src/mame/machine/megavdp.c
index 9df2638a4b0..3d16cc38ffd 100644
--- a/src/mame/machine/megavdp.c
+++ b/src/mame/machine/megavdp.c
@@ -471,9 +471,9 @@ void sega_genesis_vdp_device::update_m_vdp_code_and_address(void)
((m_vdp_command_part2 & 0x0003) << 14);
}
-UINT16 (*vdp_get_word_from_68k_mem)(running_machine &machine, UINT32 source, address_space* space68k);
+UINT16 (*vdp_get_word_from_68k_mem)(running_machine &machine, UINT32 source, address_space& space68k);
-UINT16 vdp_get_word_from_68k_mem_default(running_machine &machine, UINT32 source, address_space* space68k)
+UINT16 vdp_get_word_from_68k_mem_default(running_machine &machine, UINT32 source, address_space * space68k)
{
// should we limit the valid areas here?
// how does this behave with the segacd etc?
@@ -574,7 +574,7 @@ void sega_genesis_vdp_device::megadrive_do_insta_68k_to_vram_dma(running_machine
for (count = 0;count<(length>>1);count++)
{
- vdp_vram_write(vdp_get_word_from_68k_mem(machine, source, m_space68k));
+ vdp_vram_write(vdp_get_word_from_68k_mem(machine, source, *m_space68k));
source+=2;
if (source>0xffffff) source = 0xe00000;
}
@@ -600,7 +600,7 @@ void sega_genesis_vdp_device::megadrive_do_insta_68k_to_cram_dma(running_machine
{
//if (m_vdp_address>=0x80) return; // abandon
- write_cram_value(machine, (m_vdp_address&0x7e)>>1, vdp_get_word_from_68k_mem(machine, source, m_space68k));
+ write_cram_value(machine, (m_vdp_address&0x7e)>>1, vdp_get_word_from_68k_mem(machine, source, *m_space68k));
source+=2;
if (source>0xffffff) source = 0xfe0000;
@@ -628,7 +628,7 @@ void sega_genesis_vdp_device::megadrive_do_insta_68k_to_vsram_dma(running_machin
{
if (m_vdp_address>=0x80) return; // abandon
- m_vsram[(m_vdp_address&0x7e)>>1] = vdp_get_word_from_68k_mem(machine, source, m_space68k);
+ m_vsram[(m_vdp_address&0x7e)>>1] = vdp_get_word_from_68k_mem(machine, source, *m_space68k);
source+=2;
if (source>0xffffff) source = 0xfe0000;
@@ -855,7 +855,7 @@ WRITE16_MEMBER( sega_genesis_vdp_device::megadriv_vdp_w )
case 0x14:
case 0x16:
if (ACCESSING_BITS_0_7) sn76496_w(space.machine().device(":snsnd"), space, 0, data & 0xff);
- //if (ACCESSING_BITS_8_15) sn76496_w(space->machine().device("snsnd"), 0, (data >>8) & 0xff);
+ //if (ACCESSING_BITS_8_15) sn76496_w(space.machine().device("snsnd"), 0, (data >>8) & 0xff);
break;
default:
@@ -1265,8 +1265,8 @@ READ16_MEMBER( sega_genesis_vdp_device::megadriv_vdp_r )
case 0x06:
// if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read control port access, offset %04x mem_mask %04x\n",offset,mem_mask);
retvalue = megadriv_vdp_ctrl_port_r(space.machine());
- // retvalue = space->machine().rand();
- // mame_printf_debug("%06x: Read Control Port at scanline %d hpos %d (return %04x)\n",space->device().safe_pc(),genesis_get_scanline_counter(machine), get_hposition(space.machine()),retvalue);
+ // retvalue = space.machine().rand();
+ // mame_printf_debug("%06x: Read Control Port at scanline %d hpos %d (return %04x)\n",space.device().safe_pc(),genesis_get_scanline_counter(machine), get_hposition(space.machine()),retvalue);
break;
case 0x08:
@@ -1275,8 +1275,8 @@ READ16_MEMBER( sega_genesis_vdp_device::megadriv_vdp_r )
case 0x0e:
// if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read HV counter port access, offset %04x mem_mask %04x\n",offset,mem_mask);
retvalue = megadriv_read_hv_counters(space.machine());
- // retvalue = space->machine().rand();
- // mame_printf_debug("%06x: Read HV counters at scanline %d hpos %d (return %04x)\n",space->device().safe_pc(),genesis_get_scanline_counter(machine), get_hposition(space.machine()),retvalue);
+ // retvalue = space.machine().rand();
+ // mame_printf_debug("%06x: Read HV counters at scanline %d hpos %d (return %04x)\n",space.device().safe_pc(),genesis_get_scanline_counter(machine), get_hposition(space.machine()),retvalue);
break;
case 0x10:
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index 42e81a1b958..90d887a828f 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -82,7 +82,7 @@ void mhavoc_state::machine_start()
void mhavoc_state::machine_reset()
{
- address_space *space = machine().device("alpha")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("alpha")->memory().space(AS_PROGRAM);
m_has_gamma_cpu = (machine().device("gamma") != NULL);
membank("bank1")->configure_entry(0, m_zram0);
@@ -90,8 +90,8 @@ void mhavoc_state::machine_reset()
membank("bank2")->configure_entries(0, 4, memregion("alpha")->base() + 0x10000, 0x2000);
/* reset RAM/ROM banks to 0 */
- mhavoc_ram_banksel_w(*space, 0, 0);
- mhavoc_rom_banksel_w(*space, 0, 0);
+ mhavoc_ram_banksel_w(space, 0, 0);
+ mhavoc_rom_banksel_w(space, 0, 0);
/* reset alpha comm status */
m_alpha_data = 0;
diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c
index ac47c55b72b..45a2ce58ceb 100644
--- a/src/mame/machine/micro3d.c
+++ b/src/mame/machine/micro3d.c
@@ -605,7 +605,7 @@ WRITE32_MEMBER(micro3d_state::drmath_intr2_ack)
DRIVER_INIT_MEMBER(micro3d_state,micro3d)
{
- address_space *space = machine().device("drmath")->memory().space(AS_DATA);
+ address_space &space = *machine().device("drmath")->memory().space(AS_DATA);
i8051_set_serial_tx_callback(machine().device("audiocpu"), data_from_i8031);
i8051_set_serial_rx_callback(machine().device("audiocpu"), data_to_i8031);
@@ -614,7 +614,7 @@ DRIVER_INIT_MEMBER(micro3d_state,micro3d)
/* The Am29000 program seems to rely on RAM from 0x00470000 onwards being
non-zero on a reset, otherwise the 3D object data doesn't get uploaded! */
- space->write_dword(0x00470000, 0xa5a5a5a5);
+ space.write_dword(0x00470000, 0xa5a5a5a5);
/* TODO? BOTSS crashes when starting the final stage because the 68000
overwrites memory in use by the Am29000. Slowing down the 68000 slightly
@@ -624,11 +624,11 @@ DRIVER_INIT_MEMBER(micro3d_state,micro3d)
DRIVER_INIT_MEMBER(micro3d_state,botss)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Required to pass the hardware version check */
- space->install_read_handler(0x140000, 0x140001, read16_delegate(FUNC(micro3d_state::botss_140000_r),this));
- space->install_read_handler(0x180000, 0x180001, read16_delegate(FUNC(micro3d_state::botss_180000_r),this));
+ space.install_read_handler(0x140000, 0x140001, read16_delegate(FUNC(micro3d_state::botss_140000_r),this));
+ space.install_read_handler(0x180000, 0x180001, read16_delegate(FUNC(micro3d_state::botss_180000_r),this));
DRIVER_INIT_CALL(micro3d);
}
diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c
index 05371cc139d..68b9c41f0db 100644
--- a/src/mame/machine/midwayic.c
+++ b/src/mame/machine/midwayic.c
@@ -205,17 +205,17 @@ UINT8 midway_serial_pic_status_r(void)
}
-UINT8 midway_serial_pic_r(address_space *space)
+UINT8 midway_serial_pic_r(address_space &space)
{
- logerror("%s:security R = %04X\n", space->machine().describe_context(), serial.buffer);
+ logerror("%s:security R = %04X\n", space.machine().describe_context(), serial.buffer);
serial.status = 1;
return serial.buffer;
}
-void midway_serial_pic_w(address_space *space, UINT8 data)
+void midway_serial_pic_w(address_space &space, UINT8 data)
{
- logerror("%s:security W = %04X\n", space->machine().describe_context(), data);
+ logerror("%s:security W = %04X\n", space.machine().describe_context(), data);
/* status seems to reflect the clock bit */
serial.status = (data >> 4) & 1;
@@ -292,31 +292,31 @@ void midway_serial_pic2_set_default_nvram(const UINT8 *nvram)
}
-UINT8 midway_serial_pic2_status_r(address_space *space)
+UINT8 midway_serial_pic2_status_r(address_space &space)
{
UINT8 result = 0;
/* if we're still holding the data ready bit high, do it */
if (pic.latch & 0xf00)
{
- if (space->machine().time() > pic.latch_expire_time)
+ if (space.machine().time() > pic.latch_expire_time)
pic.latch &= 0xff;
else
pic.latch -= 0x100;
result = 1;
}
- logerror("%s:PIC status %d\n", space->machine().describe_context(), result);
+ logerror("%s:PIC status %d\n", space.machine().describe_context(), result);
return result;
}
-UINT8 midway_serial_pic2_r(address_space *space)
+UINT8 midway_serial_pic2_r(address_space &space)
{
UINT8 result = 0;
/* PIC data register */
- logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", space->machine().describe_context(), pic.index, pic.total, pic.latch);
+ logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", space.machine().describe_context(), pic.index, pic.total, pic.latch);
/* return the current result */
if (pic.latch & 0xf00)
@@ -331,9 +331,9 @@ UINT8 midway_serial_pic2_r(address_space *space)
}
-void midway_serial_pic2_w(address_space *space, UINT8 data)
+void midway_serial_pic2_w(address_space &space, UINT8 data)
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
static FILE *nvramlog;
if (LOG_NVRAM && !nvramlog)
nvramlog = fopen("nvram.log", "w");
@@ -862,7 +862,7 @@ READ32_HANDLER( midway_ioasic_r )
switch (offset)
{
case IOASIC_PORT0:
- result = space->machine().root_device().ioport("DIPS")->read();
+ result = space.machine().root_device().ioport("DIPS")->read();
/* bit 0 seems to be a ready flag before shuffling happens */
if (!ioasic.shuffle_active)
{
@@ -874,15 +874,15 @@ READ32_HANDLER( midway_ioasic_r )
break;
case IOASIC_PORT1:
- result = space->machine().root_device().ioport("SYSTEM")->read();
+ result = space.machine().root_device().ioport("SYSTEM")->read();
break;
case IOASIC_PORT2:
- result = space->machine().root_device().ioport("IN1")->read();
+ result = space.machine().root_device().ioport("IN1")->read();
break;
case IOASIC_PORT3:
- result = space->machine().root_device().ioport("IN2")->read();
+ result = space.machine().root_device().ioport("IN2")->read();
break;
case IOASIC_UARTIN:
@@ -894,13 +894,13 @@ READ32_HANDLER( midway_ioasic_r )
result = 0;
if (ioasic.has_dcs)
{
- result |= ((dcs_control_r(space->machine()) >> 4) ^ 0x40) & 0x00c0;
- result |= ioasic_fifo_status_r(&space->device()) & 0x0038;
- result |= dcs_data2_r(space->machine()) & 0xff00;
+ result |= ((dcs_control_r(space.machine()) >> 4) ^ 0x40) & 0x00c0;
+ result |= ioasic_fifo_status_r(&space.device()) & 0x0038;
+ result |= dcs_data2_r(space.machine()) & 0xff00;
}
else if (ioasic.has_cage)
{
- result |= (cage_control_r(space->machine()) << 6) ^ 0x80;
+ result |= (cage_control_r(space.machine()) << 6) ^ 0x80;
}
else
result |= 0x48;
@@ -910,9 +910,9 @@ READ32_HANDLER( midway_ioasic_r )
result = 0;
if (ioasic.has_dcs)
{
- result = dcs_data_r(space->machine());
+ result = dcs_data_r(space.machine());
if (ioasic.auto_ack)
- dcs_ack_w(space->machine());
+ dcs_ack_w(space.machine());
}
else if (ioasic.has_cage)
result = cage_main_r(space);
@@ -932,7 +932,7 @@ READ32_HANDLER( midway_ioasic_r )
}
if (LOG_IOASIC && offset != IOASIC_SOUNDSTAT && offset != IOASIC_SOUNDIN)
- logerror("%06X:ioasic_r(%d) = %08X\n", space->device().safe_pc(), offset, result);
+ logerror("%06X:ioasic_r(%d) = %08X\n", space.device().safe_pc(), offset, result);
return result;
}
@@ -957,7 +957,7 @@ WRITE32_HANDLER( midway_ioasic_w )
newreg = ioasic.reg[offset];
if (LOG_IOASIC && offset != IOASIC_SOUNDOUT)
- logerror("%06X:ioasic_w(%d) = %08X\n", space->device().safe_pc(), offset, data);
+ logerror("%06X:ioasic_w(%d) = %08X\n", space.device().safe_pc(), offset, data);
switch (offset)
{
@@ -984,7 +984,7 @@ WRITE32_HANDLER( midway_ioasic_w )
{
/* we're in loopback mode -- copy to the input */
ioasic.reg[IOASIC_UARTIN] = (newreg & 0x00ff) | 0x1000;
- update_ioasic_irq(space->machine());
+ update_ioasic_irq(space.machine());
}
else if (PRINTF_DEBUG)
mame_printf_debug("%c", data & 0xff);
@@ -994,31 +994,31 @@ WRITE32_HANDLER( midway_ioasic_w )
/* sound reset? */
if (ioasic.has_dcs)
{
- dcs_reset_w(space->machine(), ~newreg & 1);
+ dcs_reset_w(space.machine(), ~newreg & 1);
}
else if (ioasic.has_cage)
{
if ((oldreg ^ newreg) & 1)
{
- cage_control_w(space->machine(), 0);
+ cage_control_w(space.machine(), 0);
if (!(~newreg & 1))
- cage_control_w(space->machine(), 3);
+ cage_control_w(space.machine(), 3);
}
}
/* FIFO reset? */
- midway_ioasic_fifo_reset_w(space->machine(), ~newreg & 4);
+ midway_ioasic_fifo_reset_w(space.machine(), ~newreg & 4);
break;
case IOASIC_SOUNDOUT:
if (ioasic.has_dcs)
- dcs_data_w(space->machine(), newreg);
+ dcs_data_w(space.machine(), newreg);
else if (ioasic.has_cage)
cage_main_w(space, newreg);
break;
case IOASIC_SOUNDIN:
- dcs_ack_w(space->machine());
+ dcs_ack_w(space.machine());
/* acknowledge data read */
break;
@@ -1040,7 +1040,7 @@ WRITE32_HANDLER( midway_ioasic_w )
/* bit 14 = LED? */
if ((oldreg ^ newreg) & 0x3ff6)
logerror("IOASIC int control = %04X\n", data);
- update_ioasic_irq(space->machine());
+ update_ioasic_irq(space.machine());
break;
default:
diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h
index 565f982ecfe..50571c71bd5 100644
--- a/src/mame/machine/midwayic.h
+++ b/src/mame/machine/midwayic.h
@@ -9,16 +9,16 @@
void midway_serial_pic_init(running_machine &machine, int upper);
void midway_serial_pic_reset_w(int state);
UINT8 midway_serial_pic_status_r(void);
-UINT8 midway_serial_pic_r(address_space *space);
-void midway_serial_pic_w(address_space *space, UINT8 data);
+UINT8 midway_serial_pic_r(address_space &space);
+void midway_serial_pic_w(address_space &space, UINT8 data);
/* 2nd generation Midway serial/NVRAM/RTC PIC */
void midway_serial_pic2_init(running_machine &machine, int upper, int yearoffs);
void midway_serial_pic2_set_default_nvram(const UINT8 *nvram);
-UINT8 midway_serial_pic2_status_r(address_space *space);
-UINT8 midway_serial_pic2_r(address_space *space);
-void midway_serial_pic2_w(address_space *space, UINT8 data);
+UINT8 midway_serial_pic2_status_r(address_space &space);
+UINT8 midway_serial_pic2_r(address_space &space);
+void midway_serial_pic2_w(address_space &space, UINT8 data);
NVRAM_HANDLER( midway_serial_pic2 );
diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c
index dd4df1016fd..58c6e92de9a 100644
--- a/src/mame/machine/midwunit.c
+++ b/src/mame/machine/midwunit.c
@@ -360,14 +360,14 @@ MACHINE_RESET_MEMBER(midwunit_state,midwunit)
READ16_MEMBER(midwunit_state::midwunit_security_r)
{
- return midway_serial_pic_r(&space);
+ return midway_serial_pic_r(space);
}
WRITE16_MEMBER(midwunit_state::midwunit_security_w)
{
if (offset == 0 && ACCESSING_BITS_0_7)
- midway_serial_pic_w(&space, data);
+ midway_serial_pic_w(space, data);
}
diff --git a/src/mame/machine/midxunit.c b/src/mame/machine/midxunit.c
index de9c248581c..a22eecb3429 100644
--- a/src/mame/machine/midxunit.c
+++ b/src/mame/machine/midxunit.c
@@ -334,7 +334,7 @@ MACHINE_RESET_MEMBER(midxunit_state,midxunit)
READ16_MEMBER(midxunit_state::midxunit_security_r)
{
- return midway_serial_pic_r(&space);
+ return midway_serial_pic_r(space);
}
WRITE16_MEMBER(midxunit_state::midxunit_security_w)
@@ -347,7 +347,7 @@ WRITE16_MEMBER(midxunit_state::midxunit_security_w)
WRITE16_MEMBER(midxunit_state::midxunit_security_clock_w)
{
if (offset == 0 && ACCESSING_BITS_0_7)
- midway_serial_pic_w(&space, ((~data & 2) << 3) | m_security_bits);
+ midway_serial_pic_w(space, ((~data & 2) << 3) | m_security_bits);
}
diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c
index fa6c6f9e17b..ce9061edfff 100644
--- a/src/mame/machine/model1.c
+++ b/src/mame/machine/model1.c
@@ -11,12 +11,12 @@
#define TGP_FUNCTION(name) void name(running_machine &machine)
-static UINT32 fifoout_pop(address_space *space)
+static UINT32 fifoout_pop(address_space &space)
{
- model1_state *state = space->machine().driver_data<model1_state>();
+ model1_state *state = space.machine().driver_data<model1_state>();
UINT32 v;
if(state->m_fifoout_wpos == state->m_fifoout_rpos) {
- fatalerror("TGP FIFOOUT underflow (%x)\n", space->device().safe_pc());
+ fatalerror("TGP FIFOOUT underflow (%x)\n", space.device().safe_pc());
}
v = state->m_fifoout_data[state->m_fifoout_rpos++];
if(state->m_fifoout_rpos == FIFO_SIZE)
@@ -57,10 +57,10 @@ static UINT32 fifoin_pop(model1_state *state)
return v;
}
-static void fifoin_push(address_space *space, UINT32 data)
+static void fifoin_push(address_space &space, UINT32 data)
{
- model1_state *state = space->machine().driver_data<model1_state>();
- // logerror("TGP FIFOIN write %08x (%x)\n", data, space->device().safe_pc());
+ model1_state *state = space.machine().driver_data<model1_state>();
+ // logerror("TGP FIFOIN write %08x (%x)\n", data, space.device().safe_pc());
state->m_fifoin_data[state->m_fifoin_wpos++] = data;
if(state->m_fifoin_wpos == FIFO_SIZE)
state->m_fifoin_wpos = 0;
@@ -68,7 +68,7 @@ static void fifoin_push(address_space *space, UINT32 data)
logerror("TGP FIFOIN overflow\n");
state->m_fifoin_cbcount--;
if(!state->m_fifoin_cbcount)
- state->m_fifoin_cb(space->machine());
+ state->m_fifoin_cb(space.machine());
}
static float fifoin_pop_f(model1_state *state)
@@ -1938,7 +1938,7 @@ static TGP_FUNCTION( function_get_swa )
READ16_MEMBER(model1_state::model1_tgp_copro_r)
{
if(!offset) {
- m_copro_r = fifoout_pop(&space);
+ m_copro_r = fifoout_pop(space);
return m_copro_r;
} else
return m_copro_r >> 16;
@@ -1949,7 +1949,7 @@ WRITE16_MEMBER(model1_state::model1_tgp_copro_w)
if(offset) {
m_copro_w = (m_copro_w & 0x0000ffff) | (data << 16);
m_pushpc = space.device().safe_pc();
- fifoin_push(&space, m_copro_w);
+ fifoin_push(space, m_copro_w);
} else
m_copro_w = (m_copro_w & 0xffff0000) | data;
}
@@ -2071,12 +2071,12 @@ static int copro_fifoin_pop(device_t *device, UINT32 *result)
return 1;
}
-static void copro_fifoin_push(address_space *space, UINT32 data)
+static void copro_fifoin_push(address_space &space, UINT32 data)
{
- model1_state *state = space->machine().driver_data<model1_state>();
+ model1_state *state = space.machine().driver_data<model1_state>();
if (state->m_copro_fifoin_num == FIFO_SIZE)
{
- fatalerror("Copro FIFOIN overflow (at %08X)\n", space->device().safe_pc());
+ fatalerror("Copro FIFOIN overflow (at %08X)\n", space.device().safe_pc());
return;
}
@@ -2090,17 +2090,17 @@ static void copro_fifoin_push(address_space *space, UINT32 data)
state->m_copro_fifoin_num++;
}
-static UINT32 copro_fifoout_pop(address_space *space)
+static UINT32 copro_fifoout_pop(address_space &space)
{
- model1_state *state = space->machine().driver_data<model1_state>();
+ model1_state *state = space.machine().driver_data<model1_state>();
UINT32 r;
if (state->m_copro_fifoout_num == 0)
{
// Reading from empty FIFO causes the v60 to enter wait state
- v60_stall(space->machine().device("maincpu"));
+ v60_stall(space.machine().device("maincpu"));
- space->machine().scheduler().synchronize();
+ space.machine().scheduler().synchronize();
return 0;
}
@@ -2204,7 +2204,7 @@ READ16_MEMBER(model1_state::model1_vr_tgp_r)
{
if (!offset)
{
- m_vr_r = copro_fifoout_pop(&space);
+ m_vr_r = copro_fifoout_pop(space);
return m_vr_r;
}
else
@@ -2216,7 +2216,7 @@ WRITE16_MEMBER(model1_state::model1_vr_tgp_w)
if (offset)
{
m_vr_w = (m_vr_w & 0x0000ffff) | (data << 16);
- copro_fifoin_push(&space, m_vr_w);
+ copro_fifoin_push(space, m_vr_w);
}
else
m_vr_w = (m_vr_w & 0xffff0000) | data;
diff --git a/src/mame/machine/namco50.c b/src/mame/machine/namco50.c
index 9ed4eec7e16..64588ca61c0 100644
--- a/src/mame/machine/namco50.c
+++ b/src/mame/machine/namco50.c
@@ -170,19 +170,19 @@ static TIMER_CALLBACK( namco_50xx_readrequest_callback )
static READ8_HANDLER( namco_50xx_K_r )
{
- namco_50xx_state *state = get_safe_token(space->device().owner());
+ namco_50xx_state *state = get_safe_token(space.device().owner());
return state->m_latched_cmd >> 4;
}
static READ8_HANDLER( namco_50xx_R0_r )
{
- namco_50xx_state *state = get_safe_token(space->device().owner());
+ namco_50xx_state *state = get_safe_token(space.device().owner());
return state->m_latched_cmd & 0x0f;
}
static READ8_HANDLER( namco_50xx_R2_r )
{
- namco_50xx_state *state = get_safe_token(space->device().owner());
+ namco_50xx_state *state = get_safe_token(space.device().owner());
return state->m_latched_rw & 1;
}
@@ -190,7 +190,7 @@ static READ8_HANDLER( namco_50xx_R2_r )
static WRITE8_HANDLER( namco_50xx_O_w )
{
- namco_50xx_state *state = get_safe_token(space->device().owner());
+ namco_50xx_state *state = get_safe_token(space.device().owner());
UINT8 out = (data & 0x0f);
if (data & 0x10)
state->m_portO = (state->m_portO & 0x0f) | (out << 4);
diff --git a/src/mame/machine/namco53.c b/src/mame/machine/namco53.c
index 4939ef58b6b..cc4a21e8193 100644
--- a/src/mame/machine/namco53.c
+++ b/src/mame/machine/namco53.c
@@ -82,19 +82,19 @@ INLINE namco_53xx_state *get_safe_token(device_t *device)
static READ8_HANDLER( namco_53xx_K_r )
{
- namco_53xx_state *state = get_safe_token(space->device().owner());
+ namco_53xx_state *state = get_safe_token(space.device().owner());
return state->m_k(0);
}
static READ8_HANDLER( namco_53xx_Rx_r )
{
- namco_53xx_state *state = get_safe_token(space->device().owner());
+ namco_53xx_state *state = get_safe_token(space.device().owner());
return state->m_in[offset](0);
}
static WRITE8_HANDLER( namco_53xx_O_w )
{
- namco_53xx_state *state = get_safe_token(space->device().owner());
+ namco_53xx_state *state = get_safe_token(space.device().owner());
UINT8 out = (data & 0x0f);
if (data & 0x10)
state->m_portO = (state->m_portO & 0x0f) | (out << 4);
@@ -104,7 +104,7 @@ static WRITE8_HANDLER( namco_53xx_O_w )
static WRITE8_HANDLER( namco_53xx_P_w )
{
- namco_53xx_state *state = get_safe_token(space->device().owner());
+ namco_53xx_state *state = get_safe_token(space.device().owner());
state->m_p(0, data);
}
diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c
index dd57c60e4d2..6a8fe528e21 100644
--- a/src/mame/machine/namcoio.c
+++ b/src/mame/machine/namcoio.c
@@ -461,7 +461,7 @@ READ8_DEVICE_HANDLER( namcoio_r )
namcoio_state *namcoio = get_safe_token(device);
offset &= 0x3f;
-// LOG(("%04x: I/O read: mode %d, offset %d = %02x\n", space->device().safe_pc(), offset / 16, namcoio_ram[(offset & 0x30) + 8], offset & 0x0f, namcoio_ram[offset]&0x0f));
+// LOG(("%04x: I/O read: mode %d, offset %d = %02x\n", space.device().safe_pc(), offset / 16, namcoio_ram[(offset & 0x30) + 8], offset & 0x0f, namcoio_ram[offset]&0x0f));
return 0xf0 | namcoio->ram[offset];
}
@@ -472,7 +472,7 @@ WRITE8_DEVICE_HANDLER( namcoio_w )
offset &= 0x3f;
data &= 0x0f; // RAM is 4-bit wide
-// LOG(("%04x: I/O write %d: offset %d = %02x\n", space->device().safe_pc(), offset / 16, offset & 0x0f, data));
+// LOG(("%04x: I/O write %d: offset %d = %02x\n", space.device().safe_pc(), offset / 16, offset & 0x0f, data));
namcoio->ram[offset] = data;
}
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index 8f6bd26b81f..8c9defb86b9 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -12,9 +12,9 @@
/* hardware elements of 1Mbytes physical memory space */
-INLINE UINT8 bank_r(address_space *space, offs_t offset, int bank)
+INLINE UINT8 bank_r(address_space &space, offs_t offset, int bank)
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
return (*state->m_active_bank[bank].bank_handler_r )(space, offset + state->m_active_bank[bank].bank_offset);
}
@@ -35,9 +35,9 @@ static READ8_HANDLER( bank14_r ) { return bank_r(space, offset, 13); }
static READ8_HANDLER( bank15_r ) { return bank_r(space, offset, 14); }
static READ8_HANDLER( bank16_r ) { return bank_r(space, offset, 15); }
-INLINE void bank_w(address_space *space, offs_t offset, UINT8 data, int bank)
+INLINE void bank_w(address_space &space, offs_t offset, UINT8 data, int bank)
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
(*state->m_active_bank[bank].bank_handler_w )(space, offset + state->m_active_bank[bank].bank_offset, data);
}
@@ -88,13 +88,13 @@ static READ8_HANDLER( faceoff_inputs_r );
static READ8_HANDLER( no_key_r )
{
- popmessage("CPU %s PC %08x: keychip read %04x\n", space->device().tag(), space->device().safe_pc(), offset);
+ popmessage("CPU %s PC %08x: keychip read %04x\n", space.device().tag(), space.device().safe_pc(), offset);
return 0;
}
static WRITE8_HANDLER( no_key_w )
{
- popmessage("CPU %s PC %08x: keychip write %04x=%02x\n", space->device().tag(), space->device().safe_pc(), offset, data);
+ popmessage("CPU %s PC %08x: keychip write %04x=%02x\n", space.device().tag(), space.device().safe_pc(), offset, data);
}
@@ -199,8 +199,8 @@ CPU #0 PC e3d4: keychip read 0003 [AND #$37 = key no.]
*/
static READ8_HANDLER( key_type1_r )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
-// logerror("CPU %s PC %04x: keychip read %04x\n", space->device().tag(), space->device().safe_pc(), offset);
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
+// logerror("CPU %s PC %04x: keychip read %04x\n", space.device().tag(), space.device().safe_pc(), offset);
if (offset < 3)
{
@@ -231,8 +231,8 @@ static READ8_HANDLER( key_type1_r )
static WRITE8_HANDLER( key_type1_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
-// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->device().tag(), space->device().safe_pc(), offset, data);
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
+// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space.device().tag(), space.device().safe_pc(), offset, data);
if (offset < 4)
state->m_key[offset] = data;
@@ -384,8 +384,8 @@ CPU #0 PC e574: keychip read 0001
static READ8_HANDLER( key_type2_r )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
-// logerror("CPU %s PC %04x: keychip read %04x\n", space->device().tag(), space->device().safe_pc(), offset);
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
+// logerror("CPU %s PC %04x: keychip read %04x\n", space.device().tag(), space.device().safe_pc(), offset);
state->m_key_numerator_high_word = 0;
@@ -404,8 +404,8 @@ static READ8_HANDLER( key_type2_r )
static WRITE8_HANDLER( key_type2_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
-// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->device().tag(), space->device().safe_pc(), offset, data);
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
+// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space.device().tag(), space.device().safe_pc(), offset, data);
if (offset < 5)
{
@@ -512,10 +512,10 @@ CPU #0 PC e45a: keychip read 0030 [discarded]
static READ8_HANDLER( key_type3_r )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
int op;
-// logerror("CPU %s PC %04x: keychip read %04x\n", space->device().tag(), space->device().safe_pc(), offset);
+// logerror("CPU %s PC %04x: keychip read %04x\n", space.device().tag(), space.device().safe_pc(), offset);
/* I need to handle blastoff's read from 0858. The game previously writes to 0858,
using it as temporary storage, so maybe it expects to act as RAM, however
@@ -526,20 +526,20 @@ static READ8_HANDLER( key_type3_r )
op = (offset & 0x70) >> 4;
if (op == state->m_key_reg) return state->m_key_id;
- if (op == state->m_key_rng) return space->machine().rand();
+ if (op == state->m_key_rng) return space.machine().rand();
if (op == state->m_key_swap4) return (state->m_key[state->m_key_swap4_arg] << 4) | (state->m_key[state->m_key_swap4_arg] >> 4);
if (op == state->m_key_bottom4) return (offset << 4) | (state->m_key[state->m_key_swap4_arg] & 0x0f);
if (op == state->m_key_top4) return (offset << 4) | (state->m_key[state->m_key_swap4_arg] >> 4);
- popmessage("CPU %s PC %08x: keychip read %04x", space->device().tag(), space->device().safe_pc(), offset);
+ popmessage("CPU %s PC %08x: keychip read %04x", space.device().tag(), space.device().safe_pc(), offset);
return 0;
}
static WRITE8_HANDLER( key_type3_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
-// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->device().tag(), space->device().safe_pc(), offset, data);
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
+// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space.device().tag(), space.device().safe_pc(), offset, data);
state->m_key[(offset & 0x70) >> 4] = data;
}
@@ -605,13 +605,13 @@ WRITE8_MEMBER(namcos1_state::namcos1_watchdog_w)
static READ8_HANDLER( soundram_r )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
if (offset < 0x1000)
{
offset &= 0x3ff;
/* CUS 30 */
- return namcos1_cus30_r(space->machine().device("namco"),*space,offset);
+ return namcos1_cus30_r(space.machine().device("namco"),space,offset);
}
else
{
@@ -624,13 +624,13 @@ static READ8_HANDLER( soundram_r )
static WRITE8_HANDLER( soundram_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
if (offset < 0x1000)
{
offset &= 0x3ff;
/* CUS 30 */
- namcos1_cus30_w(space->machine().device("namco"),*space,offset,data);
+ namcos1_cus30_w(space.machine().device("namco"),space,offset,data);
}
else
{
@@ -646,21 +646,21 @@ static WRITE8_HANDLER( soundram_w )
static WRITE8_HANDLER( rom_w )
{
- logerror("CPU %s PC %04x: warning - write %02x to rom address %04x\n", space->device().tag(), space->device().safe_pc(), data, offset);
+ logerror("CPU %s PC %04x: warning - write %02x to rom address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
}
/* error handlers */
static READ8_HANDLER( unknown_r )
{
- logerror("CPU %s PC %04x: warning - read from unknown chip\n", space->device().tag(), space->device().safe_pc() );
-// popmessage("CPU %s PC %04x: read from unknown chip", space->device().tag(), space->device().safe_pc() );
+ logerror("CPU %s PC %04x: warning - read from unknown chip\n", space.device().tag(), space.device().safe_pc() );
+// popmessage("CPU %s PC %04x: read from unknown chip", space.device().tag(), space.device().safe_pc() );
return 0;
}
static WRITE8_HANDLER( unknown_w )
{
- logerror("CPU %s PC %04x: warning - wrote to unknown chip\n", space->device().tag(), space->device().safe_pc() );
-// popmessage("CPU %s PC %04x: wrote to unknown chip", space->device().tag(), space->device().safe_pc() );
+ logerror("CPU %s PC %04x: warning - wrote to unknown chip\n", space.device().tag(), space.device().safe_pc() );
+// popmessage("CPU %s PC %04x: wrote to unknown chip", space.device().tag(), space.device().safe_pc() );
}
/* Main bankswitching routine */
@@ -672,7 +672,7 @@ static void set_bank(running_machine &machine, int banknum, const bankhandler *h
"bank9", "bank10", "bank11", "bank12", "bank13", "bank14", "bank15", "bank16"
};
static const char *const cputags[] = { "maincpu", "sub" };
- address_space *space = machine.device(cputags[(banknum >> 3) & 1])->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputags[(banknum >> 3) & 1])->memory().space(AS_PROGRAM);
int bankstart = (banknum & 7) * 0x2000;
/* for BANK handlers , memory direct and OP-code base */
@@ -683,12 +683,12 @@ static void set_bank(running_machine &machine, int banknum, const bankhandler *h
if (!handler->bank_handler_r)
{
if (state->m_active_bank[banknum].bank_handler_r)
- space->install_read_bank(bankstart, bankstart + 0x1fff, banktags[banknum]);
+ space.install_read_bank(bankstart, bankstart + 0x1fff, banktags[banknum]);
}
else
{
if (!state->m_active_bank[banknum].bank_handler_r)
- space->install_legacy_read_handler(bankstart, bankstart + 0x1fff, io_bank_handler_r[banknum].func, io_bank_handler_r[banknum].name);
+ space.install_legacy_read_handler(bankstart, bankstart + 0x1fff, io_bank_handler_r[banknum].func, io_bank_handler_r[banknum].name);
}
/* write handlers (except for the 0xe000-0xffff range) */
@@ -697,12 +697,12 @@ static void set_bank(running_machine &machine, int banknum, const bankhandler *h
if (!handler->bank_handler_w)
{
if (state->m_active_bank[banknum].bank_handler_w)
- space->install_write_bank(bankstart, bankstart + 0x1fff, banktags[banknum]);
+ space.install_write_bank(bankstart, bankstart + 0x1fff, banktags[banknum]);
}
else
{
if (!state->m_active_bank[banknum].bank_handler_r)
- space->install_legacy_write_handler(bankstart, bankstart + 0x1fff, io_bank_handler_w[banknum].func, io_bank_handler_w[banknum].name);
+ space.install_legacy_write_handler(bankstart, bankstart + 0x1fff, io_bank_handler_w[banknum].func, io_bank_handler_w[banknum].name);
}
}
@@ -1281,9 +1281,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (space->machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space->machine().root_device().ioport("PADDLE0")->read()&0x0f);
+ ret = (space.machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space.machine().root_device().ioport("PADDLE0")->read()&0x0f);
else
- ret = (space->machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space->machine().root_device().ioport("PADDLE1")->read()&0x0f);
+ ret = (space.machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space.machine().root_device().ioport("PADDLE1")->read()&0x0f);
qstrobe ^= 0x40;
@@ -1294,9 +1294,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (space->machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space->machine().root_device().ioport("PADDLE0")->read()>>4);
+ ret = (space.machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space.machine().root_device().ioport("PADDLE0")->read()>>4);
else
- ret = (space->machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space->machine().root_device().ioport("PADDLE1")->read()>>4);
+ ret = (space.machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space.machine().root_device().ioport("PADDLE1")->read()>>4);
if (!qstrobe) qnum ^= 0x20;
@@ -1326,7 +1326,7 @@ static READ8_HANDLER( berabohm_buttons_r )
{
int inp = input_count;
- if (inp == 4) res = space->machine().root_device().ioport("CONTROL0")->read();
+ if (inp == 4) res = space.machine().root_device().ioport("CONTROL0")->read();
else
{
char portname[40];
@@ -1335,7 +1335,7 @@ static READ8_HANDLER( berabohm_buttons_r )
static int counter[4];
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = space->machine().root_device().ioport(portname)->read();
+ res = space.machine().root_device().ioport(portname)->read();
if (res & 0x80)
{
if (counter[inp] >= 0)
@@ -1359,7 +1359,7 @@ static READ8_HANDLER( berabohm_buttons_r )
counter[inp] = -1;
#else
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = space->machine().root_device().ioport(portname)->read();
+ res = space.machine().root_device().ioport(portname)->read();
if (res & 1) res = 0x7f; /* weak */
else if (res & 2) res = 0x48; /* medium */
else if (res & 4) res = 0x40; /* strong */
@@ -1370,7 +1370,7 @@ static READ8_HANDLER( berabohm_buttons_r )
}
else
{
- res = space->machine().root_device().ioport("CONTROL1")->read() & 0x8f;
+ res = space.machine().root_device().ioport("CONTROL1")->read() & 0x8f;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1412,13 +1412,13 @@ static READ8_HANDLER( faceoff_inputs_r )
if (offset == 0)
{
- res = (space->machine().root_device().ioport("CONTROL0")->read() & 0x80) | stored_input[0];
+ res = (space.machine().root_device().ioport("CONTROL0")->read() & 0x80) | stored_input[0];
return res;
}
else
{
- res = space->machine().root_device().ioport("CONTROL1")->read() & 0x80;
+ res = space.machine().root_device().ioport("CONTROL1")->read() & 0x80;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1433,17 +1433,17 @@ static READ8_HANDLER( faceoff_inputs_r )
switch (input_count)
{
case 0:
- stored_input[0] = space->machine().root_device().ioport("IN0")->read() & 0x1f;
- stored_input[1] = (space->machine().root_device().ioport("IN3")->read() & 0x07) << 3;
+ stored_input[0] = space.machine().root_device().ioport("IN0")->read() & 0x1f;
+ stored_input[1] = (space.machine().root_device().ioport("IN3")->read() & 0x07) << 3;
break;
case 3:
- stored_input[0] = space->machine().root_device().ioport("IN2")->read() & 0x1f;
+ stored_input[0] = space.machine().root_device().ioport("IN2")->read() & 0x1f;
break;
case 4:
- stored_input[0] = space->machine().root_device().ioport("IN1")->read() & 0x1f;
- stored_input[1] = space->machine().root_device().ioport("IN3")->read() & 0x18;
+ stored_input[0] = space.machine().root_device().ioport("IN1")->read() & 0x1f;
+ stored_input[1] = space.machine().root_device().ioport("IN3")->read() & 0x18;
break;
default:
diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c
index eae15deb97b..218b7f80dfc 100644
--- a/src/mame/machine/namcos2.c
+++ b/src/mame/machine/namcos2.c
@@ -113,7 +113,7 @@ MACHINE_START_MEMBER(namcos2_shared_state,namcos2)
MACHINE_RESET_MEMBER(namcos2_shared_state,namcos2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
mFinalLapProtCount = 0;
namcos2_mcu_analog_ctrl = 0;
namcos2_mcu_analog_data = 0xaa;
@@ -154,7 +154,7 @@ READ16_HANDLER( namcos2_68k_eeprom_r ){
/* 68000 Shared memory area - Data ROM area */
/*************************************************************/
READ16_HANDLER( namcos2_68k_data_rom_r ){
- UINT16 *ROM = (UINT16 *)space->machine().root_device().memregion("user1")->base();
+ UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion("user1")->base();
return ROM[offset];
}
@@ -229,7 +229,7 @@ sws93 1993 334 $014e
READ16_HANDLER( namcos2_68k_key_r )
{
- switch (space->machine().driver_data<namcos2_shared_state>()->m_gametype)
+ switch (space.machine().driver_data<namcos2_shared_state>()->m_gametype)
{
case NAMCOS2_ORDYNE:
switch(offset)
@@ -340,8 +340,8 @@ READ16_HANDLER( namcos2_68k_key_r )
{
// case 3: return 0x142;
case 4: return 0x142;
- // case 3: popmessage("blah %08x",space->device().safe_pc());
- default: return space->machine().rand();
+ // case 3: popmessage("blah %08x",space.device().safe_pc());
+ default: return space.machine().rand();
}
break;
@@ -398,12 +398,12 @@ READ16_HANDLER( namcos2_68k_key_r )
- return space->machine().rand()&0xffff;
+ return space.machine().rand()&0xffff;
}
WRITE16_HANDLER( namcos2_68k_key_w )
{
- int gametype = space->machine().driver_data<namcos2_shared_state>()->m_gametype;
+ int gametype = space.machine().driver_data<namcos2_shared_state>()->m_gametype;
if( gametype == NAMCOS2_MARVEL_LAND && offset == 5 )
{
if (data == 0x615E) sendval = 1;
@@ -464,7 +464,7 @@ static void InitC148(void)
}
static UINT16
-ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
+ReadWriteC148( address_space &space, offs_t offset, UINT16 data, int bWrite )
{
offs_t addr = ((offset * 2) + 0x1c0000) & 0x1fe000;
device_t *altcpu = NULL;
@@ -472,22 +472,22 @@ ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
UINT16 *pC148RegAlt = NULL;
UINT16 result = 0;
- if (&space->device() == space->machine().device("maincpu"))
+ if (&space.device() == space.machine().device("maincpu"))
{
pC148Reg = namcos2_68k_master_C148;
- altcpu = space->machine().device("slave");
+ altcpu = space.machine().device("slave");
pC148RegAlt = namcos2_68k_slave_C148;
}
- else if (&space->device() == space->machine().device("slave"))
+ else if (&space.device() == space.machine().device("slave"))
{
pC148Reg = namcos2_68k_slave_C148;
- altcpu = space->machine().device("maincpu");
+ altcpu = space.machine().device("maincpu");
pC148RegAlt = namcos2_68k_master_C148;
}
- else if (&space->device() == space->machine().device("gpu"))
+ else if (&space.device() == space.machine().device("gpu"))
{
pC148Reg = namcos2_68k_gpu_C148;
- altcpu = space->machine().device("maincpu");
+ altcpu = space.machine().device("maincpu");
pC148RegAlt = namcos2_68k_master_C148;
}
@@ -498,7 +498,7 @@ ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
// If writing an IRQ priority register, clear any pending IRQs.
// Dirt Fox and Winning Run require this behaviour
if (reg < 8)
- space->device().execute().set_input_line(pC148Reg[reg], CLEAR_LINE);
+ space.device().execute().set_input_line(pC148Reg[reg], CLEAR_LINE);
pC148Reg[reg] = data & 0x0007;
}
@@ -541,26 +541,26 @@ ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
/* IRQ ack */
case 0x1d6000: /* NAMCOS2_C148_CPUIRQ */
// if( bWrite ) mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
- space->device().execute().set_input_line(pC148Reg[NAMCOS2_C148_CPUIRQ], CLEAR_LINE);
+ space.device().execute().set_input_line(pC148Reg[NAMCOS2_C148_CPUIRQ], CLEAR_LINE);
break;
case 0x1d8000: /* NAMCOS2_C148_EXIRQ */
// if( bWrite ) mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
- space->device().execute().set_input_line(pC148Reg[NAMCOS2_C148_EXIRQ], CLEAR_LINE);
+ space.device().execute().set_input_line(pC148Reg[NAMCOS2_C148_EXIRQ], CLEAR_LINE);
break;
case 0x1da000: /* NAMCOS2_C148_POSIRQ */
// if( bWrite ) mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
- space->device().execute().set_input_line(pC148Reg[NAMCOS2_C148_POSIRQ], CLEAR_LINE);
+ space.device().execute().set_input_line(pC148Reg[NAMCOS2_C148_POSIRQ], CLEAR_LINE);
break;
case 0x1dc000: /* NAMCOS2_C148_SERIRQ */
// if( bWrite ) mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
- space->device().execute().set_input_line(pC148Reg[NAMCOS2_C148_SERIRQ], CLEAR_LINE);
+ space.device().execute().set_input_line(pC148Reg[NAMCOS2_C148_SERIRQ], CLEAR_LINE);
break;
case 0x1de000: /* NAMCOS2_C148_VBLANKIRQ */
- space->device().execute().set_input_line(pC148Reg[NAMCOS2_C148_VBLANKIRQ], CLEAR_LINE);
+ space.device().execute().set_input_line(pC148Reg[NAMCOS2_C148_VBLANKIRQ], CLEAR_LINE);
break;
@@ -569,42 +569,42 @@ ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
break;
case 0x1e2000: /* Sound CPU Reset control */
- if (&space->device() == space->machine().device("maincpu")) /* ? */
+ if (&space.device() == space.machine().device("maincpu")) /* ? */
{
if (data & 0x01)
{
/* Resume execution */
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
- space->device().execute().yield();
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+ space.device().execute().yield();
}
else
{
/* Suspend execution */
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
if (namcos2_kickstart != NULL)
{
//printf( "dspkick=0x%x\n", data );
if (data & 0x04)
{
- (*namcos2_kickstart)(space->machine(), 1);
+ (*namcos2_kickstart)(space.machine(), 1);
}
}
}
break;
case 0x1e4000: /* Alt 68000 & IO CPU Reset */
- if (&space->device() == space->machine().device("maincpu")) /* ? */
+ if (&space.device() == space.machine().device("maincpu")) /* ? */
{
if (data & 0x01)
{ /* Resume execution */
- ResetAllSubCPUs(space->machine(), CLEAR_LINE);
+ ResetAllSubCPUs(space.machine(), CLEAR_LINE);
/* Give the new CPU an immediate slice of the action */
- space->device().execute().yield();
+ space.device().execute().yield();
}
else
{ /* Suspend execution */
- ResetAllSubCPUs(space->machine(), ASSERT_LINE);
+ ResetAllSubCPUs(space.machine(), ASSERT_LINE);
}
}
break;
@@ -711,10 +711,10 @@ INTERRUPT_GEN( namcos2_68k_gpu_vblank )
WRITE8_HANDLER( namcos2_sound_bankselect_w )
{
- UINT8 *RAM=space->machine().root_device().memregion("audiocpu")->base();
- UINT32 max = (space->machine().root_device().memregion("audiocpu")->bytes() - 0x10000) / 0x4000;
+ UINT8 *RAM=space.machine().root_device().memregion("audiocpu")->base();
+ UINT32 max = (space.machine().root_device().memregion("audiocpu")->bytes() - 0x10000) / 0x4000;
int bank = ( data >> 4 ) % max; /* 991104.CAB */
- space->machine().root_device().membank(BANKED_SOUND_ROM)->set_base(&RAM[ 0x10000 + ( 0x4000 * bank ) ] );
+ space.machine().root_device().membank(BANKED_SOUND_ROM)->set_base(&RAM[ 0x10000 + ( 0x4000 * bank ) ] );
}
/**************************************************************/
@@ -738,28 +738,28 @@ WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
switch((data>>2) & 0x07)
{
case 0:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN0")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN0")->read();
break;
case 1:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN1")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN1")->read();
break;
case 2:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN2")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN2")->read();
break;
case 3:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN3")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN3")->read();
break;
case 4:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN4")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN4")->read();
break;
case 5:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN5")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN5")->read();
break;
case 6:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN6")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN6")->read();
break;
case 7:
- namcos2_mcu_analog_data=space->machine().root_device().ioport("AN7")->read();
+ namcos2_mcu_analog_data=space.machine().root_device().ioport("AN7")->read();
break;
default:
output_set_value("anunk",data);
@@ -776,7 +776,7 @@ WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
/* If the interrupt enable bit is set trigger an A/D IRQ */
if(data & 0x20)
{
- generic_pulse_irq_line(space->machine().device("mcu"), HD63705_INT_ADCONV, 1);
+ generic_pulse_irq_line(space.machine().device("mcu"), HD63705_INT_ADCONV, 1);
}
}
}
@@ -817,14 +817,14 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
int data = 0;
/* Read/convert the bits one at a time */
- if(space->machine().root_device().ioport("AN0")->read() > threshold) data |= 0x01;
- if(space->machine().root_device().ioport("AN1")->read() > threshold) data |= 0x02;
- if(space->machine().root_device().ioport("AN2")->read() > threshold) data |= 0x04;
- if(space->machine().root_device().ioport("AN3")->read() > threshold) data |= 0x08;
- if(space->machine().root_device().ioport("AN4")->read() > threshold) data |= 0x10;
- if(space->machine().root_device().ioport("AN5")->read() > threshold) data |= 0x20;
- if(space->machine().root_device().ioport("AN6")->read() > threshold) data |= 0x40;
- if(space->machine().root_device().ioport("AN7")->read() > threshold) data |= 0x80;
+ if(space.machine().root_device().ioport("AN0")->read() > threshold) data |= 0x01;
+ if(space.machine().root_device().ioport("AN1")->read() > threshold) data |= 0x02;
+ if(space.machine().root_device().ioport("AN2")->read() > threshold) data |= 0x04;
+ if(space.machine().root_device().ioport("AN3")->read() > threshold) data |= 0x08;
+ if(space.machine().root_device().ioport("AN4")->read() > threshold) data |= 0x10;
+ if(space.machine().root_device().ioport("AN5")->read() > threshold) data |= 0x20;
+ if(space.machine().root_device().ioport("AN6")->read() > threshold) data |= 0x40;
+ if(space.machine().root_device().ioport("AN7")->read() > threshold) data |= 0x80;
/* Return the result */
return data;
@@ -832,18 +832,18 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
READ8_HANDLER( namcos2_input_port_0_r )
{
- int data = space->machine().root_device().ioport("MCUB")->read();
+ int data = space.machine().root_device().ioport("MCUB")->read();
return data;
}
READ8_HANDLER( namcos2_input_port_10_r )
{
- int data = space->machine().root_device().ioport("MCUH")->read();
+ int data = space.machine().root_device().ioport("MCUH")->read();
return data;
}
READ8_HANDLER( namcos2_input_port_12_r )
{
- int data = space->machine().root_device().ioport("MCUDI0")->read();
+ int data = space.machine().root_device().ioport("MCUDI0")->read();
return data;
}
diff --git a/src/mame/machine/naomi.c b/src/mame/machine/naomi.c
index eb1c5d5d0ae..24364f9dda7 100644
--- a/src/mame/machine/naomi.c
+++ b/src/mame/machine/naomi.c
@@ -27,34 +27,34 @@ UINT16 actel_id;
static READ64_HANDLER( naomi_biose_idle_skip_r )
{
- if (space->device().safe_pc()==0xc04173c)
- space->device().execute().spin_until_time(attotime::from_usec(500));
- //space->device().execute().spin_until_interrupt();
+ if (space.device().safe_pc()==0xc04173c)
+ space.device().execute().spin_until_time(attotime::from_usec(500));
+ //space.device().execute().spin_until_interrupt();
// else
-// printf("%08x\n", space->device().safe_pc());
+// printf("%08x\n", space.device().safe_pc());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2ad238/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2ad238/8];
}
static READ64_HANDLER( naomi_biosh_idle_skip_r )
{
- if (space->device().safe_pc()==0xc045ffc)
- space->device().execute().spin_until_time(attotime::from_usec(500));
+ if (space.device().safe_pc()==0xc045ffc)
+ space.device().execute().spin_until_time(attotime::from_usec(500));
-// printf("%08x\n", space->device().safe_pc());
+// printf("%08x\n", space.device().safe_pc());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2b0600/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2b0600/8];
}
static READ64_HANDLER( naomi2_biose_idle_skip_r )
{
- if (space->device().safe_pc()==0xc04637c)
- space->device().execute().spin_until_time(attotime::from_usec(500));
- //space->device().execute().spin_until_interrupt();
+ if (space.device().safe_pc()==0xc04637c)
+ space.device().execute().spin_until_time(attotime::from_usec(500));
+ //space.device().execute().spin_until_interrupt();
// else
-// printf("%08x\n", space->device().safe_pc());
+// printf("%08x\n", space.device().safe_pc());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2b0600/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2b0600/8];
}
static UINT8 asciihex_to_dec(UINT8 in)
@@ -242,10 +242,10 @@ DRIVER_INIT_MEMBER(dc_state,naomigd_mp)
static READ64_HANDLER( naomigd_ggxxsla_idle_skip_r )
{
- if (space->device().safe_pc()==0x0c0c9adc)
- space->device().execute().spin_until_time(attotime::from_usec(500));
+ if (space.device().safe_pc()==0x0c0c9adc)
+ space.device().execute().spin_until_time(attotime::from_usec(500));
- return space->machine().driver_data<dc_state>()->dc_ram[0x1aae18/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x1aae18/8];
}
DRIVER_INIT_MEMBER(dc_state,ggxxsla)
@@ -256,10 +256,10 @@ DRIVER_INIT_MEMBER(dc_state,ggxxsla)
static READ64_HANDLER( naomigd_ggxx_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0b5c3c) // or 0xc0bab0c
- space->device().execute().spin_until_time(attotime::from_usec(500));
+ if (space.device().safe_pc()==0xc0b5c3c) // or 0xc0bab0c
+ space.device().execute().spin_until_time(attotime::from_usec(500));
- return space->machine().driver_data<dc_state>()->dc_ram[0x1837b8/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x1837b8/8];
}
@@ -271,12 +271,12 @@ DRIVER_INIT_MEMBER(dc_state,ggxx)
static READ64_HANDLER( naomigd_ggxxrl_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0b84bc) // or 0xc0bab0c
- space->device().execute().spin_until_time(attotime::from_usec(500));
+ if (space.device().safe_pc()==0xc0b84bc) // or 0xc0bab0c
+ space.device().execute().spin_until_time(attotime::from_usec(500));
- //printf("%08x\n", space->device().safe_pc());
+ //printf("%08x\n", space.device().safe_pc());
- return space->machine().driver_data<dc_state>()->dc_ram[0x18d6c8/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x18d6c8/8];
}
DRIVER_INIT_MEMBER(dc_state,ggxxrl)
@@ -288,10 +288,10 @@ DRIVER_INIT_MEMBER(dc_state,ggxxrl)
/* at least speeds up the annoying copyright screens ;-) */
static READ64_HANDLER( naomigd_sfz3ugd_idle_skip_r )
{
- if (space->device().safe_pc()==0xc36a2dc)
- space->device().execute().spin_until_time(attotime::from_usec(500));
+ if (space.device().safe_pc()==0xc36a2dc)
+ space.device().execute().spin_until_time(attotime::from_usec(500));
- return space->machine().driver_data<dc_state>()->dc_ram[0x5dc900/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x5dc900/8];
}
DRIVER_INIT_MEMBER(dc_state,sfz3ugd)
@@ -333,13 +333,13 @@ DRIVER_INIT_MEMBER(dc_state,kick4csh)
static READ64_HANDLER( hotd2_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0cfcbc)
- space->device().execute().spin_until_time(attotime::from_usec(500));
- //space->device().execute().spin_until_interrupt();
+ if (space.device().safe_pc()==0xc0cfcbc)
+ space.device().execute().spin_until_time(attotime::from_usec(500));
+ //space.device().execute().spin_until_interrupt();
// else
-// printf("%08x\n", space->device().safe_pc());
+// printf("%08x\n", space.device().safe_pc());
- return space->machine().driver_data<dc_state>()->dc_ram[0xa25fb8/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0xa25fb8/8];
}
DRIVER_INIT_MEMBER(dc_state,hotd2)
diff --git a/src/mame/machine/nb1413m3.c b/src/mame/machine/nb1413m3.c
index 576b0c0c099..47abd53040f 100644
--- a/src/mame/machine/nb1413m3.c
+++ b/src/mame/machine/nb1413m3.c
@@ -209,7 +209,7 @@ READ8_HANDLER( nb1413m3_sndrom_r )
int rombank;
/* get top 8 bits of the I/O port address */
- offset = (offset << 8) | (space->device().state().state_int(Z80_BC) >> 8);
+ offset = (offset << 8) | (space.device().state().state_int(Z80_BC) >> 8);
switch (nb1413m3_type)
{
@@ -296,8 +296,8 @@ READ8_HANDLER( nb1413m3_sndrom_r )
popmessage("Sound ROM %02X:%05X [B1:%02X B2:%02X]", rombank, offset, nb1413m3_sndrombank1, nb1413m3_sndrombank2);
#endif
- if (offset < space->machine().root_device().memregion(nb1413m3_sndromrgntag)->bytes())
- return space->machine().root_device().memregion(nb1413m3_sndromrgntag)->base()[offset];
+ if (offset < space.machine().root_device().memregion(nb1413m3_sndromrgntag)->bytes())
+ return space.machine().root_device().memregion(nb1413m3_sndromrgntag)->base()[offset];
else
{
popmessage("read past sound ROM length (%05x[%02X])",offset, rombank);
@@ -320,7 +320,7 @@ WRITE8_HANDLER( nb1413m3_sndrombank2_w )
READ8_HANDLER( nb1413m3_gfxrom_r )
{
- UINT8 *GFXROM = space->machine().root_device().memregion("gfx1")->base();
+ UINT8 *GFXROM = space.machine().root_device().memregion("gfx1")->base();
return GFXROM[(0x20000 * (nb1413m3_gfxrombank | ((nb1413m3_sndrombank1 & 0x02) << 3))) + ((0x0200 * nb1413m3_gfxradr_h) + (0x0002 * nb1413m3_gfxradr_l)) + (offset & 0x01)];
}
@@ -363,12 +363,12 @@ CUSTOM_INPUT( nb1413m3_outcoin_flag_r )
READ8_HANDLER( nb1413m3_inputport0_r )
{
- return ((space->machine().root_device().ioport("SYSTEM")->read() & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
+ return ((space.machine().root_device().ioport("SYSTEM")->read() & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
}
READ8_HANDLER( nb1413m3_inputport1_r )
{
- device_t &root = space->machine().root_device();
+ device_t &root = space.machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_HYHOO:
@@ -420,7 +420,7 @@ READ8_HANDLER( nb1413m3_inputport1_r )
READ8_HANDLER( nb1413m3_inputport2_r )
{
- device_t &root = space->machine().root_device();
+ device_t &root = space.machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_HYHOO:
@@ -495,7 +495,7 @@ READ8_HANDLER( nb1413m3_inputport3_r )
READ8_HANDLER( nb1413m3_dipsw1_r )
{
- device_t &root = space->machine().root_device();
+ device_t &root = space.machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_KANATUEN:
@@ -533,13 +533,13 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
((root.ioport("DSWA")->read() & 0x01) << 4) | ((root.ioport("DSWA")->read() & 0x04) << 3) |
((root.ioport("DSWA")->read() & 0x10) << 2) | ((root.ioport("DSWA")->read() & 0x40) << 1));
default:
- return space->machine().root_device().ioport("DSWA")->read();
+ return space.machine().root_device().ioport("DSWA")->read();
}
}
READ8_HANDLER( nb1413m3_dipsw2_r )
{
- device_t &root = space->machine().root_device();
+ device_t &root = space.machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_KANATUEN:
@@ -577,18 +577,18 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
((root.ioport("DSWA")->read() & 0x02) << 3) | ((root.ioport("DSWA")->read() & 0x08) << 2) |
((root.ioport("DSWA")->read() & 0x20) << 1) | ((root.ioport("DSWA")->read() & 0x80) << 0));
default:
- return space->machine().root_device().ioport("DSWB")->read();
+ return space.machine().root_device().ioport("DSWB")->read();
}
}
READ8_HANDLER( nb1413m3_dipsw3_l_r )
{
- return ((space->machine().root_device().ioport("DSWC")->read() & 0xf0) >> 4);
+ return ((space.machine().root_device().ioport("DSWC")->read() & 0xf0) >> 4);
}
READ8_HANDLER( nb1413m3_dipsw3_h_r )
{
- return ((space->machine().root_device().ioport("DSWC")->read() & 0x0f) >> 0);
+ return ((space.machine().root_device().ioport("DSWC")->read() & 0x0f) >> 0);
}
WRITE8_HANDLER( nb1413m3_outcoin_w )
@@ -629,7 +629,7 @@ WRITE8_HANDLER( nb1413m3_outcoin_w )
break;
}
- set_led_status(space->machine(), 2, nb1413m3_outcoin_flag); // out coin
+ set_led_status(space.machine(), 2, nb1413m3_outcoin_flag); // out coin
}
WRITE8_HANDLER( nb1413m3_vcrctrl_w )
@@ -637,11 +637,11 @@ WRITE8_HANDLER( nb1413m3_vcrctrl_w )
if (data & 0x08)
{
popmessage(" ** VCR CONTROL ** ");
- set_led_status(space->machine(), 2, 1);
+ set_led_status(space.machine(), 2, 1);
}
else
{
- set_led_status(space->machine(), 2, 0);
+ set_led_status(space.machine(), 2, 0);
}
}
diff --git a/src/mame/machine/nb1414m4.c b/src/mame/machine/nb1414m4.c
index 5f59bf00707..c79b080d239 100644
--- a/src/mame/machine/nb1414m4.c
+++ b/src/mame/machine/nb1414m4.c
@@ -29,9 +29,9 @@ Notes:
#include "emu.h"
#include "includes/nb1414m4.h"
-static void nichibutsu_1414m4_dma(address_space *space,UINT16 src,UINT16 dst,UINT16 size, UINT8 condition,UINT8 *vram)
+static void nichibutsu_1414m4_dma(address_space &space,UINT16 src,UINT16 dst,UINT16 size, UINT8 condition,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
int i;
for(i=0;i<size;i++)
@@ -45,7 +45,7 @@ static void nichibutsu_1414m4_dma(address_space *space,UINT16 src,UINT16 dst,UIN
}
}
-static void nichibutsu_1414m4_fill(address_space *space,UINT16 dst,UINT8 tile,UINT8 pal,UINT8 *vram)
+static void nichibutsu_1414m4_fill(address_space &space,UINT16 dst,UINT8 tile,UINT8 pal,UINT8 *vram)
{
int i;
@@ -59,11 +59,11 @@ static void nichibutsu_1414m4_fill(address_space *space,UINT16 dst,UINT8 tile,UI
}
}
-static void insert_coin_msg(address_space *space,UINT8 *vram)
+static void insert_coin_msg(address_space &space,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
int credit_count = (vram[0xf] & 0xff);
- UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
+ UINT8 fl_cond = space.machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
UINT16 dst;
if(credit_count == 0)
@@ -80,11 +80,11 @@ static void insert_coin_msg(address_space *space,UINT8 *vram)
}
}
-static void credit_msg(address_space *space,UINT8 *vram)
+static void credit_msg(address_space &space,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
int credit_count = (vram[0xf] & 0xff);
- UINT8 fl_cond = space->machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
+ UINT8 fl_cond = space.machine().primary_screen->frame_number() & 0x10; /* for insert coin "flickering" */
UINT16 dst;
dst = ((data[0x023]<<8)|(data[0x024]&0xff)) & 0x3fff;
@@ -107,12 +107,12 @@ static void credit_msg(address_space *space,UINT8 *vram)
}
}
-static void kozure_score_msg(address_space *space,UINT16 dst,UINT8 src_base,UINT8 *vram)
+static void kozure_score_msg(address_space &space,UINT16 dst,UINT8 src_base,UINT8 *vram)
{
int i;
UINT8 first_digit;
UINT8 res;
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
first_digit = 0;
@@ -138,9 +138,9 @@ static void kozure_score_msg(address_space *space,UINT16 dst,UINT8 src_base,UINT
}
-static void nichibutsu_1414m4_0200(address_space *space, UINT16 mcu_cmd,UINT8 *vram)
+static void nichibutsu_1414m4_0200(address_space &space, UINT16 mcu_cmd,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
UINT16 dst;
dst = (data[0x330+((mcu_cmd & 0xf)*2)]<<8)|(data[0x331+((mcu_cmd & 0xf)*2)]&0xff);
@@ -183,9 +183,9 @@ static void nichibutsu_1414m4_0200(address_space *space, UINT16 mcu_cmd,UINT8 *v
[0x10] coinage B
[0x11] sound test num
*/
-static void nichibutsu_1414m4_0600(address_space *space, UINT8 is2p,UINT8 *vram)
+static void nichibutsu_1414m4_0600(address_space &space, UINT8 is2p,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
UINT16 dst;
int i;
@@ -239,9 +239,9 @@ static void nichibutsu_1414m4_0600(address_space *space, UINT8 is2p,UINT8 *vram)
nichibutsu_1414m4_dma(space,0x310 + (((vram[0x06] >> (7-i)) & 1) * 6),dst + (i * 0x20),0x3,1,vram);
}
-static void nichibutsu_1414m4_0e00(address_space *space,UINT16 mcu_cmd,UINT8 *vram)
+static void nichibutsu_1414m4_0e00(address_space &space,UINT16 mcu_cmd,UINT8 *vram)
{
- UINT8 * data = (UINT8 *)space->machine().root_device().memregion("blit_data")->base();
+ UINT8 * data = (UINT8 *)space.machine().root_device().memregion("blit_data")->base();
UINT16 dst;
dst = ((data[0xdf]<<8)|(data[0xe0]&0xff)) & 0x3fff;
@@ -271,7 +271,7 @@ static void nichibutsu_1414m4_0e00(address_space *space,UINT16 mcu_cmd,UINT8 *vr
}
}
-void nb_1414m4_exec(address_space *space,UINT16 mcu_cmd,UINT8 *vram,UINT16 &scrollx,UINT16 &scrolly,tilemap_t *tilemap)
+void nb_1414m4_exec(address_space &space,UINT16 mcu_cmd,UINT8 *vram,UINT16 &scrollx,UINT16 &scrolly,tilemap_t *tilemap)
{
/* latch fg scroll values */
scrollx = (vram[0x0d] & 0xff) | ((vram[0x0e] & 0xff) << 8);
diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c
index 0cafdef28aa..35f59b5dfca 100644
--- a/src/mame/machine/neoboot.c
+++ b/src/mame/machine/neoboot.c
@@ -139,7 +139,7 @@ void kog_px_decrypt( running_machine &machine )
static UINT16 kof10thExtraRAMB[0x01000];
-static void kof10thBankswitch(address_space *space, UINT16 nBank)
+static void kof10thBankswitch(address_space &space, UINT16 nBank)
{
UINT32 bank = 0x100000 + ((nBank & 7) << 20);
if (bank >= 0x700000)
@@ -155,10 +155,10 @@ static READ16_HANDLER( kof10th_RAMB_r )
static WRITE16_HANDLER( kof10th_custom_w )
{
if (!kof10thExtraRAMB[0xFFE]) { // Write to RAM bank A
- UINT16 *prom = (UINT16*)space->machine().root_device().memregion( "maincpu" )->base();
+ UINT16 *prom = (UINT16*)space.machine().root_device().memregion( "maincpu" )->base();
COMBINE_DATA(&prom[(0xE0000/2) + (offset & 0xFFFF)]);
} else { // Write S data on-the-fly
- UINT8 *srom = space->machine().root_device().memregion( "fixed" )->base();
+ UINT8 *srom = space.machine().root_device().memregion( "fixed" )->base();
srom[offset] = BITSWAP8(data,7,6,0,4,3,2,1,5);
}
}
@@ -169,7 +169,7 @@ static WRITE16_HANDLER( kof10th_bankswitch_w )
if (offset == 0x5FFF8) { // Standard bankswitch
kof10thBankswitch(space, data);
} else if (offset == 0x5FFFC && kof10thExtraRAMB[0xFFC] != data) { // Special bankswitch
- UINT8 *src = space->machine().root_device().memregion( "maincpu" )->base();
+ UINT8 *src = space.machine().root_device().memregion( "maincpu" )->base();
memcpy (src + 0x10000, src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff);
}
COMBINE_DATA(&kof10thExtraRAMB[offset & 0xFFF]);
@@ -702,19 +702,19 @@ void lans2004_decrypt_68k( running_machine &machine )
static READ16_HANDLER( mslug5_prot_r )
{
- logerror("PC %06x: access protected\n",space->device().safe_pc());
+ logerror("PC %06x: access protected\n",space.device().safe_pc());
return 0xa0;
}
static WRITE16_HANDLER ( ms5plus_bankswitch_w )
{
int bankaddress;
- logerror("offset: %06x PC %06x: set banking %04x\n",offset,space->device().safe_pc(),data);
+ logerror("offset: %06x PC %06x: set banking %04x\n",offset,space.device().safe_pc(),data);
if ((offset == 0)&&(data == 0xa0))
{
bankaddress=0xa0;
neogeo_set_main_cpu_bank_address(space, bankaddress);
- logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,space->device().safe_pc(),bankaddress);
+ logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,space.device().safe_pc(),bankaddress);
}
else if(offset == 2)
{
@@ -722,7 +722,7 @@ static WRITE16_HANDLER ( ms5plus_bankswitch_w )
//data=data&7;
bankaddress=data*0x100000;
neogeo_set_main_cpu_bank_address(space, bankaddress);
- logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,space->device().safe_pc(),bankaddress);
+ logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,space.device().safe_pc(),bankaddress);
}
}
@@ -924,7 +924,7 @@ static WRITE16_HANDLER( kof2003_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff1)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)space->machine().root_device().memregion("maincpu")->base();
+ UINT8* mem = (UINT8 *)space.machine().root_device().memregion("maincpu")->base();
cr[BYTE_XOR_LE(0x1ff0)] = 0xa0;
cr[BYTE_XOR_LE(0x1ff1)] &= 0xfe;
@@ -942,7 +942,7 @@ static WRITE16_HANDLER( kof2003p_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff0)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)space->machine().root_device().memregion("maincpu")->base();
+ UINT8* mem = (UINT8 *)space.machine().root_device().memregion("maincpu")->base();
cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe;
cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c
index 2c1440775e3..f42f7a87b93 100644
--- a/src/mame/machine/neoprot.c
+++ b/src/mame/machine/neoprot.c
@@ -24,7 +24,7 @@
static READ16_HANDLER( fatfury2_protection_16_r )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
UINT16 res = state->m_fatfury2_prot_data >> 24;
switch (offset)
@@ -42,7 +42,7 @@ static READ16_HANDLER( fatfury2_protection_16_r )
return ((res & 0xf0) >> 4) | ((res & 0x0f) << 4);
default:
- logerror("unknown protection read at pc %06x, offset %08x\n", space->device().safe_pc(), offset << 1);
+ logerror("unknown protection read at pc %06x, offset %08x\n", space.device().safe_pc(), offset << 1);
return 0;
}
}
@@ -50,7 +50,7 @@ static READ16_HANDLER( fatfury2_protection_16_r )
static WRITE16_HANDLER( fatfury2_protection_16_w )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
switch (offset)
{
@@ -89,7 +89,7 @@ static WRITE16_HANDLER( fatfury2_protection_16_w )
break;
default:
- logerror("unknown protection write at pc %06x, offset %08x, data %02x\n", space->device().safe_pc(), offset, data);
+ logerror("unknown protection write at pc %06x, offset %08x, data %02x\n", space.device().safe_pc(), offset, data);
break;
}
}
@@ -119,24 +119,24 @@ void fatfury2_install_protection( running_machine &machine )
static WRITE16_HANDLER ( kof98_prot_w )
{
/* info from razoola */
- UINT16* mem16 = (UINT16*)space->machine().root_device().memregion("maincpu")->base();
+ UINT16* mem16 = (UINT16*)space.machine().root_device().memregion("maincpu")->base();
switch (data)
{
case 0x0090:
- logerror ("%06x kof98 - protection 0x0090 old %04x %04x\n", space->device().safe_pc(), mem16[0x100/2], mem16[0x102/2]);
+ logerror ("%06x kof98 - protection 0x0090 old %04x %04x\n", space.device().safe_pc(), mem16[0x100/2], mem16[0x102/2]);
mem16[0x100/2] = 0x00c2;
mem16[0x102/2] = 0x00fd;
break;
case 0x00f0:
- logerror ("%06x kof98 - protection 0x00f0 old %04x %04x\n", space->device().safe_pc(), mem16[0x100/2], mem16[0x102/2]);
+ logerror ("%06x kof98 - protection 0x00f0 old %04x %04x\n", space.device().safe_pc(), mem16[0x100/2], mem16[0x102/2]);
mem16[0x100/2] = 0x4e45;
mem16[0x102/2] = 0x4f2d;
break;
default: // 00aa is written, but not needed?
- logerror ("%06x kof98 - unknown protection write %04x\n", space->device().safe_pc(), data);
+ logerror ("%06x kof98 - unknown protection write %04x\n", space.device().safe_pc(), data);
break;
}
}
@@ -375,7 +375,7 @@ static READ16_HANDLER( prot_9a37_r )
static READ16_HANDLER( sma_random_r )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
UINT16 old = state->m_neogeo_rng;
UINT16 newbit = ((state->m_neogeo_rng >> 2) ^
@@ -500,9 +500,9 @@ static void pvc_prot2( running_machine &machine ) // on writes to e8/e9/ea/eb
}
-static void pvc_write_bankswitch( address_space *space )
+static void pvc_write_bankswitch( address_space &space )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
UINT32 bankaddress;
bankaddress = ((state->m_pvc_cartridge_ram[0xff8] >> 8)|(state->m_pvc_cartridge_ram[0xff9] << 8));
@@ -515,20 +515,20 @@ static void pvc_write_bankswitch( address_space *space )
static READ16_HANDLER( pvc_prot_r )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
return state->m_pvc_cartridge_ram[offset];
}
static WRITE16_HANDLER( pvc_prot_w )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
COMBINE_DATA(&state->m_pvc_cartridge_ram[offset] );
if (offset == 0xff0)
- pvc_prot1(space->machine());
+ pvc_prot1(space.machine());
else if(offset >= 0xff4 && offset <= 0xff5)
- pvc_prot2(space->machine());
+ pvc_prot2(space.machine());
else if(offset >= 0xff8)
pvc_write_bankswitch(space);
}
diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c
index 852005d0ca1..b8064a03ce0 100644
--- a/src/mame/machine/nmk004.c
+++ b/src/mame/machine/nmk004.c
@@ -1067,7 +1067,7 @@ WRITE16_HANDLER( NMK004_w )
{
if (ACCESSING_BITS_0_7)
{
-//logerror("%06x: NMK004_w %02x\n",space->device().safe_pc(),data);
+//logerror("%06x: NMK004_w %02x\n",space.device().safe_pc(),data);
NMK004_state.from_main = data & 0xff;
}
}
@@ -1077,7 +1077,7 @@ READ16_HANDLER( NMK004_r )
//static int last;
int res = NMK004_state.to_main;
-//if (res != last) logerror("%06x: NMK004_r %02x\n",space->device().safe_pc(),res);
+//if (res != last) logerror("%06x: NMK004_r %02x\n",space.device().safe_pc(),res);
//last = res;
return res;
diff --git a/src/mame/machine/pcecommn.c b/src/mame/machine/pcecommn.c
index 41096d8bb99..93c1479f6a6 100644
--- a/src/mame/machine/pcecommn.c
+++ b/src/mame/machine/pcecommn.c
@@ -27,7 +27,7 @@ MACHINE_RESET( pce ) {
/* todo: how many input ports does the PCE have? */
WRITE8_HANDLER ( pce_joystick_w )
{
- h6280io_set_buffer(&space->device(), data);
+ h6280io_set_buffer(&space.device(), data);
/* bump counter on a low-to-high transition of bit 1 */
if((!joystick_data_select) && (data & JOY_CLOCK))
{
@@ -51,11 +51,11 @@ READ8_HANDLER ( pce_joystick_r )
if ( pce_joystick_readinputport_callback != NULL )
{
- data = pce_joystick_readinputport_callback(space->machine());
+ data = pce_joystick_readinputport_callback(space.machine());
}
else
{
- data = space->machine().root_device().ioport("JOY")->read();
+ data = space.machine().root_device().ioport("JOY")->read();
}
if(joystick_data_select) data >>= 4;
ret = (data & 0x0F) | pce.io_port_options;
diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c
index 73bf2106238..a296dd7fa76 100644
--- a/src/mame/machine/pcshare.c
+++ b/src/mame/machine/pcshare.c
@@ -166,7 +166,7 @@ static READ8_HANDLER( pc_dma_read_byte )
offs_t page_offset = (((offs_t) dma_offset[0][dma_channel]) << 16)
& 0xFF0000;
- return space->read_byte(page_offset + offset);
+ return space.read_byte(page_offset + offset);
}
@@ -175,7 +175,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
offs_t page_offset = (((offs_t) dma_offset[0][dma_channel]) << 16)
& 0xFF0000;
- space->write_byte(page_offset + offset, data);
+ space.write_byte(page_offset + offset, data);
}
static READ8_HANDLER(dma_page_select_r)
diff --git a/src/mame/machine/pgmprot.c b/src/mame/machine/pgmprot.c
index 91d2fad3c7a..9caca92a5a4 100644
--- a/src/mame/machine/pgmprot.c
+++ b/src/mame/machine/pgmprot.c
@@ -54,7 +54,7 @@ static void asic3_compute_hold(running_machine &machine)
READ16_HANDLER( pgm_asic3_r )
{
- pgm_asic3_state *state = space->machine().driver_data<pgm_asic3_state>();
+ pgm_asic3_state *state = space.machine().driver_data<pgm_asic3_state>();
UINT8 res = 0;
/* region is supplied by the protection device */
@@ -98,7 +98,7 @@ READ16_HANDLER( pgm_asic3_r )
WRITE16_HANDLER( pgm_asic3_w )
{
- pgm_asic3_state *state = space->machine().driver_data<pgm_asic3_state>();
+ pgm_asic3_state *state = space.machine().driver_data<pgm_asic3_state>();
if(ACCESSING_BITS_0_7)
{
@@ -127,14 +127,14 @@ WRITE16_HANDLER( pgm_asic3_w )
{
state->m_asic3_y = state->m_asic3_reg & 7;
state->m_asic3_z = data;
- asic3_compute_hold(space->machine());
+ asic3_compute_hold(space.machine());
}
}
}
WRITE16_HANDLER( pgm_asic3_reg_w )
{
- pgm_asic3_state *state = space->machine().driver_data<pgm_asic3_state>();
+ pgm_asic3_state *state = space.machine().driver_data<pgm_asic3_state>();
if(ACCESSING_BITS_0_7)
state->m_asic3_reg = data & 0xff;
diff --git a/src/mame/machine/pgmprot1.c b/src/mame/machine/pgmprot1.c
index b9ffbc4c2b2..2dd93cecde8 100644
--- a/src/mame/machine/pgmprot1.c
+++ b/src/mame/machine/pgmprot1.c
@@ -58,18 +58,18 @@
static READ32_HANDLER( pgm_arm7_type1_protlatch_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
- space->machine().scheduler().synchronize(); // force resync
+ space.machine().scheduler().synchronize(); // force resync
return (state->m_pgm_arm_type1_highlatch_68k_w << 16) | (state->m_pgm_arm_type1_lowlatch_68k_w);
}
static WRITE32_HANDLER( pgm_arm7_type1_protlatch_w )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
- space->machine().scheduler().synchronize(); // force resync
+ space.machine().scheduler().synchronize(); // force resync
if (ACCESSING_BITS_16_31)
{
@@ -85,9 +85,9 @@ static WRITE32_HANDLER( pgm_arm7_type1_protlatch_w )
static READ16_HANDLER( pgm_arm7_type1_68k_protlatch_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
- space->machine().scheduler().synchronize(); // force resync
+ space.machine().scheduler().synchronize(); // force resync
switch (offset)
{
@@ -99,9 +99,9 @@ static READ16_HANDLER( pgm_arm7_type1_68k_protlatch_r )
static WRITE16_HANDLER( pgm_arm7_type1_68k_protlatch_w )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
- space->machine().scheduler().synchronize(); // force resync
+ space.machine().scheduler().synchronize(); // force resync
switch (offset)
{
@@ -117,21 +117,21 @@ static WRITE16_HANDLER( pgm_arm7_type1_68k_protlatch_w )
static READ16_HANDLER( pgm_arm7_type1_ram_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
UINT16 *share16 = reinterpret_cast<UINT16 *>(state->m_arm7_shareram.target());
if (PGMARM7LOGERROR)
- logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space->device().safe_pc());
+ logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space.device().safe_pc());
return share16[BYTE_XOR_LE(offset << 1)];
}
static WRITE16_HANDLER( pgm_arm7_type1_ram_w )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
UINT16 *share16 = reinterpret_cast<UINT16 *>(state->m_arm7_shareram.target());
if (PGMARM7LOGERROR)
- logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space->device().safe_pc());
+ logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space.device().safe_pc());
COMBINE_DATA(&share16[BYTE_XOR_LE(offset << 1)]);
}
@@ -140,7 +140,7 @@ static WRITE16_HANDLER( pgm_arm7_type1_ram_w )
static READ32_HANDLER( pgm_arm7_type1_unk_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
return state->m_pgm_arm_type1_counter++;
}
@@ -151,19 +151,19 @@ static READ32_HANDLER( pgm_arm7_type1_exrom_r )
static READ32_HANDLER( pgm_arm7_type1_shareram_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, state->m_arm7_shareram[offset], mem_mask, space->device().safe_pc());
+ logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, state->m_arm7_shareram[offset], mem_mask, space.device().safe_pc());
return state->m_arm7_shareram[offset];
}
static WRITE32_HANDLER( pgm_arm7_type1_shareram_w )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, space->device().safe_pc());
+ logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, space.device().safe_pc());
COMBINE_DATA(&state->m_arm7_shareram[offset]);
}
@@ -271,7 +271,7 @@ void pgm_arm7_type1_latch_init( running_machine &machine )
static READ16_HANDLER( kovsh_fake_region_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
int regionhack = state->ioport("RegionHack")->read();
if (regionhack != 0xff) return regionhack;
@@ -301,7 +301,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,kovsh)
/* Fake remapping of ASIC commands to the ones used by KOVSH due to the lack of the real ARM rom for this set */
WRITE16_HANDLER( kovshp_asic27a_write_word )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
switch (offset)
{
@@ -519,7 +519,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,kovqhsgs)
static READ16_HANDLER( pgm_arm7_type1_sim_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
if (offset == 0)
{
@@ -561,21 +561,21 @@ void command_handler_ddp3(pgm_arm_type1_state *state, int pc)
break;
case 0x67: // set high bits
- // printf("%06x command %02x | %04x\n", space->device().safe_pc(), state->m_ddp3lastcommand, state->m_value0);
+ // printf("%06x command %02x | %04x\n", space.device().safe_pc(), state->m_ddp3lastcommand, state->m_value0);
state->m_valueresponse = 0x880000;
state->m_curslots = (state->m_value0 & 0xff00)>>8;
state->m_slots[state->m_curslots] = (state->m_value0 & 0x00ff) << 16;
break;
case 0xe5: // set low bits for operation?
- // printf("%06x command %02x | %04x\n", space->device().safe_pc(), state->m_ddp3lastcommand, state->m_value0);
+ // printf("%06x command %02x | %04x\n", space.device().safe_pc(), state->m_ddp3lastcommand, state->m_value0);
state->m_valueresponse = 0x880000;
state->m_slots[state->m_curslots] |= (state->m_value0 & 0xffff);
break;
case 0x8e: // read back result of operations
- // printf("%06x command %02x | %04x\n", space->device().safe_pc(), state->m_ddp3lastcommand, state->m_value0);
+ // printf("%06x command %02x | %04x\n", space.device().safe_pc(), state->m_ddp3lastcommand, state->m_value0);
state->m_valueresponse = state->m_slots[state->m_value0&0xff];
break;
@@ -1349,8 +1349,8 @@ void command_handler_oldsplus(pgm_arm_type1_state *state, int pc)
static WRITE16_HANDLER( pgm_arm7_type1_sim_w )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
- int pc = space->device().safe_pc();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
+ int pc = space.device().safe_pc();
if (offset == 0)
{
@@ -1387,14 +1387,14 @@ static WRITE16_HANDLER( pgm_arm7_type1_sim_w )
static READ16_HANDLER( pgm_arm7_type1_sim_protram_r )
{
if (offset == 4)
- return space->machine().root_device().ioport("Region")->read();
+ return space.machine().root_device().ioport("Region")->read();
return 0x0000;
}
static READ16_HANDLER( pstars_arm7_type1_sim_protram_r )
{
- pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
+ pgm_arm_type1_state *state = space.machine().driver_data<pgm_arm_type1_state>();
if (offset == 4) //region
return state->ioport("Region")->read();
diff --git a/src/mame/machine/pgmprot2.c b/src/mame/machine/pgmprot2.c
index dfd61cc466f..a072ccafb01 100644
--- a/src/mame/machine/pgmprot2.c
+++ b/src/mame/machine/pgmprot2.c
@@ -35,58 +35,58 @@
static READ32_HANDLER( arm7_latch_arm_r )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
state->m_prot->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE ); // guess
if (PGMARM7LOGERROR)
- logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", state->m_kov2_latchdata_68k_w, mem_mask, space->device().safe_pc());
+ logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", state->m_kov2_latchdata_68k_w, mem_mask, space.device().safe_pc());
return state->m_kov2_latchdata_68k_w;
}
static WRITE32_HANDLER( arm7_latch_arm_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, space->device().safe_pc());
+ logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, space.device().safe_pc());
COMBINE_DATA(&state->m_kov2_latchdata_arm_w);
}
static READ32_HANDLER( arm7_shareram_r )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, state->m_arm7_shareram[offset], mem_mask, space->device().safe_pc());
+ logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, state->m_arm7_shareram[offset], mem_mask, space.device().safe_pc());
return state->m_arm7_shareram[offset];
}
static WRITE32_HANDLER( arm7_shareram_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, space->device().safe_pc());
+ logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, space.device().safe_pc());
COMBINE_DATA(&state->m_arm7_shareram[offset]);
}
static READ16_HANDLER( arm7_latch_68k_r )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
if (PGMARM7LOGERROR)
- logerror("M68K: Latch read: %04x (%04x) (%06x)\n", state->m_kov2_latchdata_arm_w & 0x0000ffff, mem_mask, space->device().safe_pc());
+ logerror("M68K: Latch read: %04x (%04x) (%06x)\n", state->m_kov2_latchdata_arm_w & 0x0000ffff, mem_mask, space.device().safe_pc());
return state->m_kov2_latchdata_arm_w;
}
static WRITE16_HANDLER( arm7_latch_68k_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
if (PGMARM7LOGERROR)
- logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, space->device().safe_pc());
+ logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, space.device().safe_pc());
COMBINE_DATA(&state->m_kov2_latchdata_68k_w);
state->m_prot->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE ); // guess
@@ -94,21 +94,21 @@ static WRITE16_HANDLER( arm7_latch_68k_w )
static READ16_HANDLER( arm7_ram_r )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
UINT16 *share16 = reinterpret_cast<UINT16 *>(state->m_arm7_shareram.target());
if (PGMARM7LOGERROR)
- logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space->device().safe_pc());
+ logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space.device().safe_pc());
return share16[BYTE_XOR_LE(offset)];
}
static WRITE16_HANDLER( arm7_ram_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
UINT16 *share16 = reinterpret_cast<UINT16 *>(state->m_arm7_shareram.target());
if (PGMARM7LOGERROR)
- logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space->device().safe_pc());
+ logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space.device().safe_pc());
COMBINE_DATA(&share16[BYTE_XOR_LE(offset)]);
}
@@ -174,8 +174,8 @@ static void kov2_latch_init( running_machine &machine )
static WRITE32_HANDLER( kov2_arm_region_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
- int pc = space->device().safe_pc();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
+ int pc = space.device().safe_pc();
int regionhack = state->ioport("RegionHack")->read();
if (pc==0x190 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0);
COMBINE_DATA(&state->m_arm7_shareram[0x138/4]);
@@ -227,8 +227,8 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,kov2p)
static WRITE32_HANDLER( martmast_arm_region_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
- int pc = space->device().safe_pc();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
+ int pc = space.device().safe_pc();
int regionhack = state->ioport("RegionHack")->read();
if (pc==0x170 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0);
COMBINE_DATA(&state->m_arm7_shareram[0x138/4]);
@@ -248,8 +248,8 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,martmast)
static WRITE32_HANDLER( ddp2_arm_region_w )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
- int pc = space->device().safe_pc();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
+ int pc = space.device().safe_pc();
int regionhack = state->ioport("RegionHack")->read();
if (pc==0x0174 && regionhack != 0xff) data = (data & 0x0000ffff) | (regionhack << 16);
COMBINE_DATA(&state->m_arm7_shareram[0x0]);
@@ -257,20 +257,20 @@ static WRITE32_HANDLER( ddp2_arm_region_w )
static READ32_HANDLER( ddp2_speedup_r )
{
- pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
- int pc = space->device().safe_pc();
+ pgm_arm_type2_state *state = space.machine().driver_data<pgm_arm_type2_state>();
+ int pc = space.device().safe_pc();
UINT32 data = state->m_arm_ram[0x300c/4];
if (pc==0x080109b4)
{
/* if we've hit the loop where this is read and both values are 0 then the only way out is an interrupt */
- int r4 = (space->device().state().state_int(ARM7_R4));
+ int r4 = (space.device().state().state_int(ARM7_R4));
r4 += 0xe;
if (r4==0x18002f9e)
{
UINT32 data2 = state->m_arm_ram[0x2F9C/4]&0xffff0000;
- if ((data==0x00000000) && (data2==0x00000000)) space->device().execute().spin_until_interrupt();
+ if ((data==0x00000000) && (data2==0x00000000)) space.device().execute().spin_until_interrupt();
}
}
@@ -279,12 +279,12 @@ static READ32_HANDLER( ddp2_speedup_r )
static READ16_HANDLER( ddp2_main_speedup_r )
{
- pgm_state *state = space->machine().driver_data<pgm_state>();
+ pgm_state *state = space.machine().driver_data<pgm_state>();
UINT16 data = state->m_mainram[0x0ee54/2];
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
- if (pc == 0x149dce) space->device().execute().spin_until_interrupt();
- if (pc == 0x149cfe) space->device().execute().spin_until_interrupt();
+ if (pc == 0x149dce) space.device().execute().spin_until_interrupt();
+ if (pc == 0x149cfe) space.device().execute().spin_until_interrupt();
return data;
diff --git a/src/mame/machine/pgmprot3.c b/src/mame/machine/pgmprot3.c
index 1d141ab048e..6171571f8f3 100644
--- a/src/mame/machine/pgmprot3.c
+++ b/src/mame/machine/pgmprot3.c
@@ -43,27 +43,27 @@
static WRITE32_HANDLER( svg_arm7_ram_sel_w )
{
// printf("svg_arm7_ram_sel_w %08x\n", data);
- space->machine().scheduler().synchronize(); // force resync
+ space.machine().scheduler().synchronize(); // force resync
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
state->m_svg_ram_sel = data & 1;
}
static READ32_HANDLER( svg_arm7_shareram_r )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
return state->m_svg_shareram[state->m_svg_ram_sel & 1][offset];
}
static WRITE32_HANDLER( svg_arm7_shareram_w )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
COMBINE_DATA(&state->m_svg_shareram[state->m_svg_ram_sel & 1][offset]);
}
static READ16_HANDLER( svg_m68k_ram_r )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
int ram_sel = (state->m_svg_ram_sel & 1) ^ 1;
UINT16 *share16 = (UINT16 *)(state->m_svg_shareram[ram_sel & 1]);
@@ -72,7 +72,7 @@ static READ16_HANDLER( svg_m68k_ram_r )
static WRITE16_HANDLER( svg_m68k_ram_w )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
int ram_sel = (state->m_svg_ram_sel & 1) ^ 1;
UINT16 *share16 = (UINT16 *)(state->m_svg_shareram[ram_sel & 1]);
@@ -86,25 +86,25 @@ static READ16_HANDLER( svg_68k_nmi_r )
static WRITE16_HANDLER( svg_68k_nmi_w )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
generic_pulse_irq_line(state->m_prot, ARM7_FIRQ_LINE, 1);
}
static WRITE16_HANDLER( svg_latch_68k_w )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
if (PGMARM7LOGERROR)
- logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, space->device().safe_pc());
+ logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, space.device().safe_pc());
COMBINE_DATA(&state->m_svg_latchdata_68k_w);
}
static READ16_HANDLER( svg_latch_68k_r )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
if (PGMARM7LOGERROR)
- logerror("M68K: Latch read: %04x (%04x) (%06x)\n", state->m_svg_latchdata_arm_w & 0x0000ffff, mem_mask, space->device().safe_pc());
+ logerror("M68K: Latch read: %04x (%04x) (%06x)\n", state->m_svg_latchdata_arm_w & 0x0000ffff, mem_mask, space.device().safe_pc());
return state->m_svg_latchdata_arm_w;
}
@@ -112,19 +112,19 @@ static READ16_HANDLER( svg_latch_68k_r )
static READ32_HANDLER( svg_latch_arm_r )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", state->m_svg_latchdata_68k_w, mem_mask, space->device().safe_pc());
+ logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", state->m_svg_latchdata_68k_w, mem_mask, space.device().safe_pc());
return state->m_svg_latchdata_68k_w;
}
static WRITE32_HANDLER( svg_latch_arm_w )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
if (PGMARM7LOGERROR)
- logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, space->device().safe_pc());
+ logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, space.device().safe_pc());
COMBINE_DATA(&state->m_svg_latchdata_arm_w);
}
@@ -267,20 +267,20 @@ DRIVER_INIT_MEMBER(pgm_arm_type3_state,killbldp)
static READ32_HANDLER( dmnfrnt_speedup_r )
{
- pgm_arm_type3_state *state = space->machine().driver_data<pgm_arm_type3_state>();
- int pc = space->device().safe_pc();
- if (pc == 0x8000fea) space->device().execute().eat_cycles(500);
+ pgm_arm_type3_state *state = space.machine().driver_data<pgm_arm_type3_state>();
+ int pc = space.device().safe_pc();
+ if (pc == 0x8000fea) space.device().execute().eat_cycles(500);
// else printf("dmn_speedup_r %08x\n", pc);
return state->m_arm_ram[0x000444/4];
}
static READ16_HANDLER( dmnfrnt_main_speedup_r )
{
- pgm_state *state = space->machine().driver_data<pgm_state>();
+ pgm_state *state = space.machine().driver_data<pgm_state>();
UINT16 data = state->m_mainram[0xa03c/2];
- int pc = space->device().safe_pc();
- if (pc == 0x10193a) space->device().execute().spin_until_interrupt();
- else if (pc == 0x1019a4) space->device().execute().spin_until_interrupt();
+ int pc = space.device().safe_pc();
+ if (pc == 0x10193a) space.device().execute().spin_until_interrupt();
+ else if (pc == 0x1019a4) space.device().execute().spin_until_interrupt();
return data;
}
diff --git a/src/mame/machine/pgmprot4.c b/src/mame/machine/pgmprot4.c
index 52ab9d1a673..25971f5e225 100644
--- a/src/mame/machine/pgmprot4.c
+++ b/src/mame/machine/pgmprot4.c
@@ -111,7 +111,7 @@ static void IGS022_do_dma(running_machine& machine, UINT16 src, UINT16 dst, UINT
for (x = 0; x < size; x++)
{
- //UINT16 *RAMDUMP = (UINT16*)space->machine().root_device().memregion("user2")->base();
+ //UINT16 *RAMDUMP = (UINT16*)space.machine().root_device().memregion("user2")->base();
//UINT16 dat = RAMDUMP[dst + x];
UINT16 dat2 = PROTROM[src + x];
@@ -279,21 +279,21 @@ static WRITE16_HANDLER( killbld_igs025_prot_w )
{
// mame_printf_debug("killbrd prot r\n");
// return 0;
- pgm_022_025_state *state = space->machine().driver_data<pgm_022_025_state>();
+ pgm_022_025_state *state = space.machine().driver_data<pgm_022_025_state>();
offset &= 0xf;
if (offset == 0)
state->m_kb_cmd = data;
else //offset==2
{
- logerror("%06X: ASIC25 W CMD %X VAL %X\n", space->device().safe_pc(), state->m_kb_cmd, data);
+ logerror("%06X: ASIC25 W CMD %X VAL %X\n", space.device().safe_pc(), state->m_kb_cmd, data);
if (state->m_kb_cmd == 0)
state->m_kb_reg = data;
else if (state->m_kb_cmd == 2)
{
if (data == 1) //Execute cmd
{
- IGS022_handle_command(space->machine());
+ IGS022_handle_command(space.machine());
state->m_kb_reg++;
}
}
@@ -307,7 +307,7 @@ static WRITE16_HANDLER( killbld_igs025_prot_w )
static READ16_HANDLER( killbld_igs025_prot_r )
{
// mame_printf_debug("killbld prot w\n");
- pgm_022_025_state *state = space->machine().driver_data<pgm_022_025_state>();
+ pgm_022_025_state *state = space.machine().driver_data<pgm_022_025_state>();
UINT16 res ;
offset &= 0xf;
@@ -334,7 +334,7 @@ static READ16_HANDLER( killbld_igs025_prot_r )
}
else
{
- UINT32 protvalue = 0x89911400 | space->machine().root_device().ioport("Region")->read();
+ UINT32 protvalue = 0x89911400 | space.machine().root_device().ioport("Region")->read();
ret = (protvalue >> (8 * (state->m_kb_ptr - 1))) & 0xff;
}
@@ -342,7 +342,7 @@ static READ16_HANDLER( killbld_igs025_prot_r )
}
}
- logerror("%06X: ASIC25 R CMD %X VAL %X\n", space->device().safe_pc(), state->m_kb_cmd, res);
+ logerror("%06X: ASIC25 R CMD %X VAL %X\n", space.device().safe_pc(), state->m_kb_cmd, res);
return res;
}
@@ -451,7 +451,7 @@ static int ptr=0;
static UINT8 dw3_swap;
static WRITE16_HANDLER( drgw3_igs025_prot_w )
{
- pgm_022_025_state *state = space->machine().driver_data<pgm_022_025_state>();
+ pgm_022_025_state *state = space.machine().driver_data<pgm_022_025_state>();
offset&=0xf;
@@ -459,7 +459,7 @@ static WRITE16_HANDLER( drgw3_igs025_prot_w )
state->m_kb_cmd=data;
else //offset==2
{
- printf("%06X: ASIC25 W CMD %X VAL %X\n",space->device().safe_pc(),state->m_kb_cmd,data);
+ printf("%06X: ASIC25 W CMD %X VAL %X\n",space.device().safe_pc(),state->m_kb_cmd,data);
if(state->m_kb_cmd==0)
reg=data;
else if(state->m_kb_cmd==3) //??????????
@@ -478,7 +478,7 @@ static WRITE16_HANDLER( drgw3_igs025_prot_w )
static READ16_HANDLER( drgw3_igs025_prot_r )
{
// mame_printf_debug("killbld prot w\n");
- pgm_022_025_state *state = space->machine().driver_data<pgm_022_025_state>();
+ pgm_022_025_state *state = space.machine().driver_data<pgm_022_025_state>();
UINT16 res ;
@@ -510,13 +510,13 @@ static READ16_HANDLER( drgw3_igs025_prot_r )
else if(state->m_kb_cmd==5)
{
UINT32 protvalue;
- protvalue = 0x60000|space->machine().root_device().ioport("Region")->read();
+ protvalue = 0x60000|space.machine().root_device().ioport("Region")->read();
res=(protvalue>>(8*(ptr-1)))&0xff;
}
}
- logerror("%06X: ASIC25 R CMD %X VAL %X\n",space->device().safe_pc(),state->m_kb_cmd,res);
+ logerror("%06X: ASIC25 R CMD %X VAL %X\n",space.device().safe_pc(),state->m_kb_cmd,res);
return res;
}
diff --git a/src/mame/machine/pgmprot5.c b/src/mame/machine/pgmprot5.c
index deae479984a..5ff134b3686 100644
--- a/src/mame/machine/pgmprot5.c
+++ b/src/mame/machine/pgmprot5.c
@@ -32,7 +32,7 @@ READ16_HANDLER( dw2_d80000_r )
// if(dw2reg<0x20) //NOT SURE!!
{
//The value at 0x80EECE is computed in the routine at 0x107c18
- pgm_state *state = space->machine().driver_data<pgm_state>();
+ pgm_state *state = space.machine().driver_data<pgm_state>();
UINT16 d = state->m_mainram[0xEECE/2];
UINT16 d2 = 0;
d = (d >> 8) | (d << 8);
diff --git a/src/mame/machine/pgmprot6.c b/src/mame/machine/pgmprot6.c
index 834104f0147..fe871f541e3 100644
--- a/src/mame/machine/pgmprot6.c
+++ b/src/mame/machine/pgmprot6.c
@@ -106,7 +106,7 @@ MACHINE_RESET_MEMBER(pgm_028_025_state,olds)
static READ16_HANDLER( olds_r )
{
- pgm_028_025_state *state = space->machine().driver_data<pgm_028_025_state>();
+ pgm_028_025_state *state = space.machine().driver_data<pgm_028_025_state>();
UINT16 res = 0;
if (offset == 1)
@@ -124,18 +124,18 @@ static READ16_HANDLER( olds_r )
}
}
- logerror("%06X: ASIC25 R CMD %X VAL %X\n", space->device().safe_pc(), state->m_kb_cmd, res);
+ logerror("%06X: ASIC25 R CMD %X VAL %X\n", space.device().safe_pc(), state->m_kb_cmd, res);
return res;
}
static WRITE16_HANDLER( olds_w )
{
- pgm_028_025_state *state = space->machine().driver_data<pgm_028_025_state>();
+ pgm_028_025_state *state = space.machine().driver_data<pgm_028_025_state>();
if (offset == 0)
state->m_kb_cmd = data;
else //offset==2
{
- logerror("%06X: ASIC25 W CMD %X VAL %X\n",space->device().safe_pc(), state->m_kb_cmd, data);
+ logerror("%06X: ASIC25 W CMD %X VAL %X\n",space.device().safe_pc(), state->m_kb_cmd, data);
if (state->m_kb_cmd == 0)
state->m_kb_reg = data;
else if(state->m_kb_cmd == 2) //a bitswap=
@@ -165,7 +165,7 @@ static WRITE16_HANDLER( olds_w )
UINT16 val0 = state->m_sharedprotram[0x3050 / 2]; //CMD_FORMAT
{
if ((cmd0 & 0xff) == 0x2)
- olds_write_reg(space->machine(), val0, olds_read_reg(space->machine(), val0) + 0x10000);
+ olds_write_reg(space.machine(), val0, olds_read_reg(space.machine(), val0) + 0x10000);
}
break;
}
@@ -184,8 +184,8 @@ static WRITE16_HANDLER( olds_w )
static READ16_HANDLER( olds_prot_swap_r )
{
- pgm_state *state = space->machine().driver_data<pgm_state>();
- if (space->device().safe_pc() < 0x100000) //bios
+ pgm_state *state = space.machine().driver_data<pgm_state>();
+ if (space.device().safe_pc() < 0x100000) //bios
return state->m_mainram[0x178f4 / 2];
else //game
return state->m_mainram[0x178d8 / 2];
diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c
index 402d35dcb49..18288e85780 100644
--- a/src/mame/machine/psx.c
+++ b/src/mame/machine/psx.c
@@ -35,7 +35,7 @@ void psx_driver_init( running_machine &machine )
WRITE32_HANDLER( psx_com_delay_w )
{
- psx_state *p_psx = space->machine().driver_data<psx_state>();
+ psx_state *p_psx = space.machine().driver_data<psx_state>();
COMBINE_DATA( &p_psx->n_com_delay );
verboselog( p_psx, 1, "psx_com_delay_w( %08x %08x )\n", data, mem_mask );
@@ -43,7 +43,7 @@ WRITE32_HANDLER( psx_com_delay_w )
READ32_HANDLER( psx_com_delay_r )
{
- psx_state *p_psx = space->machine().driver_data<psx_state>();
+ psx_state *p_psx = space.machine().driver_data<psx_state>();
verboselog( p_psx, 1, "psx_com_delay_r( %08x )\n", mem_mask );
return p_psx->n_com_delay;
@@ -72,14 +72,14 @@ void psx_sio_input( running_machine &machine, int n_port, int n_mask, int n_data
READ32_HANDLER( psx_gpu_r )
{
- psxgpu_device *gpu = downcast<psxgpu_device *>( space->machine().device("gpu") );
- return gpu->read( *space, offset, mem_mask );
+ psxgpu_device *gpu = downcast<psxgpu_device *>( space.machine().device("gpu") );
+ return gpu->read( space, offset, mem_mask );
}
WRITE32_HANDLER( psx_gpu_w )
{
- psxgpu_device *gpu = downcast<psxgpu_device *>( space->machine().device("gpu") );
- gpu->write( *space, offset, data, mem_mask );
+ psxgpu_device *gpu = downcast<psxgpu_device *>( space.machine().device("gpu") );
+ gpu->write( space, offset, data, mem_mask );
}
void psx_lightgun_set( running_machine &machine, int n_x, int n_y )
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index 06c454ee4b9..810b1c14eee 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -87,16 +87,16 @@ static READ8_HANDLER( mariner_protection_2_r )
READ8_HANDLER( triplep_pip_r )
{
- logerror("PC %04x: triplep read port 2\n",space->device().safe_pc());
- if (space->device().safe_pc() == 0x015a) return 0xff;
- else if (space->device().safe_pc() == 0x0886) return 0x05;
+ logerror("PC %04x: triplep read port 2\n",space.device().safe_pc());
+ if (space.device().safe_pc() == 0x015a) return 0xff;
+ else if (space.device().safe_pc() == 0x0886) return 0x05;
else return 0;
}
READ8_HANDLER( triplep_pap_r )
{
- logerror("PC %04x: triplep read port 3\n",space->device().safe_pc());
- if (space->device().safe_pc() == 0x015d) return 0x04;
+ logerror("PC %04x: triplep read port 3\n",space.device().safe_pc());
+ if (space.device().safe_pc() == 0x015d) return 0x04;
else return 0;
}
@@ -115,37 +115,37 @@ static void cavelon_banksw(running_machine &machine)
static READ8_HANDLER( cavelon_banksw_r )
{
- scramble_state *state = space->machine().driver_data<scramble_state>();
- cavelon_banksw(space->machine());
+ scramble_state *state = space.machine().driver_data<scramble_state>();
+ cavelon_banksw(space.machine());
if ((offset >= 0x0100) && (offset <= 0x0103))
- return state->m_ppi8255_0->read(*space, offset - 0x0100);
+ return state->m_ppi8255_0->read(space, offset - 0x0100);
else if ((offset >= 0x0200) && (offset <= 0x0203))
- return state->m_ppi8255_1->read(*space, offset - 0x0200);
+ return state->m_ppi8255_1->read(space, offset - 0x0200);
return 0xff;
}
static WRITE8_HANDLER( cavelon_banksw_w )
{
- scramble_state *state = space->machine().driver_data<scramble_state>();
- cavelon_banksw(space->machine());
+ scramble_state *state = space.machine().driver_data<scramble_state>();
+ cavelon_banksw(space.machine());
if ((offset >= 0x0100) && (offset <= 0x0103))
- state->m_ppi8255_0->write(*space, offset - 0x0100, data);
+ state->m_ppi8255_0->write(space, offset - 0x0100, data);
else if ((offset >= 0x0200) && (offset <= 0x0203))
- state->m_ppi8255_1->write(*space, offset - 0x0200, data);
+ state->m_ppi8255_1->write(space, offset - 0x0200, data);
}
READ8_HANDLER( hunchbks_mirror_r )
{
- return space->read_byte(0x1000+offset);
+ return space.read_byte(0x1000+offset);
}
WRITE8_HANDLER( hunchbks_mirror_w )
{
- space->write_byte(0x1000+offset,data);
+ space.write_byte(0x1000+offset,data);
}
diff --git a/src/mame/machine/scudsp.c b/src/mame/machine/scudsp.c
index 1626d4c1aeb..b107130eb34 100644
--- a/src/mame/machine/scudsp.c
+++ b/src/mame/machine/scudsp.c
@@ -275,9 +275,9 @@ static void dsp_set_dest_mem_reg_2( UINT32 mode, UINT32 value )
}
}
-static UINT32 dsp_compute_condition( address_space *space, UINT32 condition )
+static UINT32 dsp_compute_condition( address_space &space, UINT32 condition )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT32 result = 0;
switch( condition & 0xf )
@@ -333,16 +333,16 @@ static UINT32 dsp_get_mem_source_dma( UINT32 memcode, UINT32 counter )
return 0;
}
-UINT32 dsp_prg_ctrl_r(address_space *space)
+UINT32 dsp_prg_ctrl_r(address_space &space)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
return (state->m_scu_regs[0x80/4] & 0x06ff8000) | (dsp_reg.pc & 0xff);
}
-void dsp_prg_ctrl_w(address_space *space, UINT32 data)
+void dsp_prg_ctrl_w(address_space &space, UINT32 data)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
if(LEF) dsp_reg.pc = (data & 0xff);
if(EXF) dsp_execute_program(space);
@@ -394,9 +394,9 @@ UINT32 dsp_ram_addr_r()
return data;
}
-static void dsp_operation(address_space *space)
+static void dsp_operation(address_space &space)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
INT64 i1,i2;
INT32 i3;
int update_ct[4] = {0,0,0,0};
@@ -597,7 +597,7 @@ static void dsp_operation(address_space *space)
}
-static void dsp_move_immediate( address_space *space )
+static void dsp_move_immediate( address_space &space )
{
UINT32 value;
@@ -619,9 +619,9 @@ static void dsp_move_immediate( address_space *space )
}
-static void dsp_dma( address_space *space )
+static void dsp_dma( address_space &space )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT8 hold = (opcode & 0x4000) >> 14;
UINT32 add = (opcode & 0x38000) >> 15;
@@ -681,11 +681,11 @@ static void dsp_dma( address_space *space )
if ( source >= 0x06000000 && source <= 0x060fffff )
{
- data = space->read_dword(source );
+ data = space.read_dword(source );
}
else
{
- data = (space->read_word(source)<<16) | space->read_word(source+2);
+ data = (space.read_word(source)<<16) | space.read_word(source+2);
//popmessage( "Bad DSP DMA mem read = %08X", source );
#if DEBUG_DSP
//fprintf( log_file, "/*Bad DSP DMA mem read = %08X*/\n", source );
@@ -718,7 +718,7 @@ static void dsp_dma( address_space *space )
#endif
for ( counter = 0; counter < transfer_cnt; counter++ )
{
- space->write_dword(dest, dsp_get_mem_source_dma( dsp_mem, counter ) );
+ space.write_dword(dest, dsp_get_mem_source_dma( dsp_mem, counter ) );
dest += add;
}
@@ -732,7 +732,7 @@ static void dsp_dma( address_space *space )
T0F_0;
}
-static void dsp_jump( address_space *space )
+static void dsp_jump( address_space &space )
{
if ( opcode & 0x3f80000 )
{
@@ -761,14 +761,14 @@ static TIMER_CALLBACK( dsp_ended )
EF_1;
}
-static void dsp_end( address_space *dmaspace )
+static void dsp_end( address_space &dmaspace )
{
- saturn_state *state = dmaspace->machine().driver_data<saturn_state>();
+ saturn_state *state = dmaspace.machine().driver_data<saturn_state>();
if(opcode & 0x08000000)
{
/*ENDI*/
- dmaspace->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dsp_ended));
+ dmaspace.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dsp_ended));
}
EXF_0; /* END / ENDI */
@@ -827,7 +827,7 @@ static void dsp_dump_mem( FILE *f )
}
#endif
-void dsp_execute_program(address_space *dmaspace)
+void dsp_execute_program(address_space &dmaspace)
{
UINT32 cycles_run = 0;
UINT8 cont = 1;
diff --git a/src/mame/machine/scudsp.h b/src/mame/machine/scudsp.h
index a11f939c4ac..52184964978 100644
--- a/src/mame/machine/scudsp.h
+++ b/src/mame/machine/scudsp.h
@@ -1,10 +1,10 @@
/*SCU DSP stuff*/
-void dsp_prg_ctrl_w(address_space *space, UINT32 data);
+void dsp_prg_ctrl_w(address_space &space, UINT32 data);
void dsp_prg_data(UINT32 data);
void dsp_ram_addr_ctrl(UINT32 data);
void dsp_ram_addr_w(UINT32 data);
-UINT32 dsp_prg_ctrl_r(address_space *space);
+UINT32 dsp_prg_ctrl_r(address_space &space);
UINT32 dsp_ram_addr_r(void);
-void dsp_execute_program(address_space *dmaspace);
+void dsp_execute_program(address_space &dmaspace);
diff --git a/src/mame/machine/segacrp2.c b/src/mame/machine/segacrp2.c
index bf439274d54..8d79ae5eb9f 100644
--- a/src/mame/machine/segacrp2.c
+++ b/src/mame/machine/segacrp2.c
@@ -60,11 +60,11 @@ static void sega_decode_2(running_machine &machine,const char *cputag,
};
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion(cputag)->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x8000);
- space->set_decrypted_region(0x0000, 0x7fff, decrypted);
+ space.set_decrypted_region(0x0000, 0x7fff, decrypted);
for (A = 0x0000;A < 0x8000;A++)
diff --git a/src/mame/machine/segacrpt.c b/src/mame/machine/segacrpt.c
index 3f861bfc610..3ff52b608d9 100644
--- a/src/mame/machine/segacrpt.c
+++ b/src/mame/machine/segacrpt.c
@@ -217,13 +217,13 @@ static void sega_decode(running_machine &machine, const char *cputag, const UINT
{
int A;
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
int length = machine.root_device().memregion(cputag)->bytes();
int cryptlen = MIN(length, 0x8000);
UINT8 *rom = machine.root_device().memregion(cputag)->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0xc000);
- space->set_decrypted_region(0x0000, cryptlen - 1, decrypted);
+ space.set_decrypted_region(0x0000, cryptlen - 1, decrypted);
for (A = 0x0000;A < cryptlen;A++)
{
@@ -439,7 +439,7 @@ void toprollr_decode(running_machine &machine, const char *cputag, const char *r
int A;
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion(regiontag)->base();
int bankstart;
decrypted = auto_alloc_array(machine, UINT8, 0x6000*3);
@@ -473,8 +473,8 @@ void toprollr_decode(running_machine &machine, const char *cputag, const char *r
machine.root_device().membank("bank1")->configure_entries(0,3, machine.root_device().memregion(regiontag)->base(),0x6000);
machine.root_device().membank("bank1")->configure_decrypted_entries(0,3,decrypted,0x6000);
- space->set_decrypted_region(0x0000, 0x5fff, decrypted);
- space->machine().root_device().membank("bank1")->set_entry(0);
+ space.set_decrypted_region(0x0000, 0x5fff, decrypted);
+ space.machine().root_device().membank("bank1")->set_entry(0);
}
@@ -797,7 +797,7 @@ void jongkyo_decode(running_machine &machine, const char *cputag)
int A;
- address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *rom = machine.root_device().memregion(cputag)->base();
decrypted = auto_alloc_array(machine, UINT8, 0x9000);
@@ -832,7 +832,7 @@ void jongkyo_decode(running_machine &machine, const char *cputag)
machine.root_device().membank("bank1")->configure_entries(0,8, machine.root_device().memregion(cputag)->base()+0x7000,0x0400);
machine.root_device().membank("bank1")->configure_decrypted_entries(0,8,decrypted+0x7000,0x0400);
- space->set_decrypted_region(0x0000, 0x6bff, decrypted);
+ space.set_decrypted_region(0x0000, 0x6bff, decrypted);
machine.root_device().membank("bank1")->set_entry(0);
}
diff --git a/src/mame/machine/segamsys.c b/src/mame/machine/segamsys.c
index 865c22cd44f..17569358c92 100644
--- a/src/mame/machine/segamsys.c
+++ b/src/mame/machine/segamsys.c
@@ -485,7 +485,7 @@ static UINT8 vdp_data_r(struct sms_vdp *chip)
return retdata;
}
-static void vdp_data_w(address_space *space, UINT8 data, struct sms_vdp* chip)
+static void vdp_data_w(address_space &space, UINT8 data, struct sms_vdp* chip)
{
/* data writes clear the pending flag */
chip->cmd_pend = 0;
@@ -522,7 +522,7 @@ static void vdp_data_w(address_space *space, UINT8 data, struct sms_vdp* chip)
g = (palword & 0x00f0)>>4;
b = (palword & 0x0f00)>>8;
rgb_t rgb = MAKE_RGB(pal4bit(r), pal4bit(g), pal4bit(b));
- //palette_set_color(space->machine(),(chip->addr_reg&0x3e)/2, rgb);
+ //palette_set_color(space.machine(),(chip->addr_reg&0x3e)/2, rgb);
chip->cram_mamecolours[(chip->addr_reg&0x3e)/2]=rgb;
}
}
@@ -538,7 +538,7 @@ static void vdp_data_w(address_space *space, UINT8 data, struct sms_vdp* chip)
g = (data & 0x0c)>>2;
b = (data & 0x30)>>4;
rgb_t rgb = MAKE_RGB(pal2bit(r), pal2bit(g), pal2bit(b));
- //palette_set_color(space->machine(),chip->addr_reg&0x1f, rgb);
+ //palette_set_color(space.machine(),chip->addr_reg&0x1f, rgb);
chip->cram_mamecolours[chip->addr_reg&0x1f]=rgb;
}
@@ -551,7 +551,7 @@ static void vdp_data_w(address_space *space, UINT8 data, struct sms_vdp* chip)
}
-static UINT8 vdp_ctrl_r(address_space *space, struct sms_vdp *chip)
+static UINT8 vdp_ctrl_r(address_space &space, struct sms_vdp *chip)
{
UINT8 retvalue;
@@ -565,7 +565,7 @@ static UINT8 vdp_ctrl_r(address_space *space, struct sms_vdp *chip)
chip->sprite_collision = 0;
chip->sprite_overflow = 0;
- (chip->set_irq)(space->machine(), 0); // clear IRQ;
+ (chip->set_irq)(space.machine(), 0); // clear IRQ;
return retvalue;
@@ -615,7 +615,7 @@ static void vdp_set_register(running_machine &machine, struct sms_vdp *chip)
// printf("VDP: setting register %01x to %02x\n",reg, chip->cmd_part1);
}
-static void vdp_ctrl_w(address_space *space, UINT8 data, struct sms_vdp *chip)
+static void vdp_ctrl_w(address_space &space, UINT8 data, struct sms_vdp *chip)
{
if (chip->cmd_pend)
{ /* Part 2 of a command word write */
@@ -636,7 +636,7 @@ static void vdp_ctrl_w(address_space *space, UINT8 data, struct sms_vdp *chip)
break;
case 0x2: /* REG setting */
- vdp_set_register(space->machine(), chip);
+ vdp_set_register(space.machine(), chip);
chip->writemode = 0;
break;
@@ -1479,7 +1479,7 @@ static UINT8 ioport_gg00_r(running_machine& machine)
READ8_HANDLER( sms_ioport_gg00_r )
{
- return ioport_gg00_r(space->machine());
+ return ioport_gg00_r(space.machine());
}
@@ -1564,7 +1564,7 @@ static UINT8* sms_rom;
/* the SMS inputs should be more complex, like the megadrive ones */
READ8_HANDLER (megatech_sms_ioport_dc_r)
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
/* 2009-05 FP: would it be worth to give separate inputs to SMS? SMS has only 2 keys A,B (which are B,C on megadrive) */
/* bit 4: TL-A; bit 5: TR-A */
return (machine.root_device().ioport("PAD1")->read() & 0x3f) | ((machine.root_device().ioport("PAD2")->read() & 0x03) << 6);
@@ -1572,7 +1572,7 @@ READ8_HANDLER (megatech_sms_ioport_dc_r)
READ8_HANDLER (megatech_sms_ioport_dd_r)
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
/* 2009-05 FP: would it be worth to give separate inputs to SMS? SMS has only 2 keys A,B (which are B,C on megadrive) */
/* bit 2: TL-B; bit 3: TR-B; bit 4: RESET; bit 5: unused; bit 6: TH-A; bit 7: TH-B*/
return ((machine.root_device().ioport("PAD2")->read() & 0x3c) >> 2) | 0x10;
@@ -1602,24 +1602,24 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
logerror("bank w %02x %02x\n", offset, data);
if ((data & 0x08) && smsgg_backupram)
{
- space->install_legacy_readwrite_handler(0x8000, 0x9fff, FUNC(smsgg_backupram_r), FUNC(smsgg_backupram_w));
+ space.install_legacy_readwrite_handler(0x8000, 0x9fff, FUNC(smsgg_backupram_r), FUNC(smsgg_backupram_w));
}
else
{
- space->install_rom(0x0000, 0xbfff, sms_rom);
- space->unmap_write(0x0000, 0xbfff);
+ space.install_rom(0x0000, 0xbfff, sms_rom);
+ space.unmap_write(0x0000, 0xbfff);
}
//printf("bank ram??\n");
break;
case 1:
- memcpy(sms_rom+0x0000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x0000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
break;
case 2:
- memcpy(sms_rom+0x4000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x4000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
break;
case 3:
- memcpy(sms_rom+0x8000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x8000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
break;
}
@@ -1628,19 +1628,19 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
static WRITE8_HANDLER( codemasters_rom_bank_0000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x0000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x0000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
}
static WRITE8_HANDLER( codemasters_rom_bank_4000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x4000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x4000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
}
static WRITE8_HANDLER( codemasters_rom_bank_8000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x8000, space->machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x8000, space.machine().root_device().memregion("maincpu")->base()+bank*0x4000, 0x4000);
}
diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c
index 4b37dd666a2..550bcdd1e15 100644
--- a/src/mame/machine/segas32.c
+++ b/src/mame/machine/segas32.c
@@ -207,17 +207,17 @@ WRITE16_MEMBER(segas32_state::brival_protection_w)
void darkedge_fd1149_vblank(device_t *device)
{
- address_space *space = device->memory().space(AS_PROGRAM);
+ address_space &space = *device->memory().space(AS_PROGRAM);
- space->write_word(0x20f072, 0);
- space->write_word(0x20f082, 0);
+ space.write_word(0x20f072, 0);
+ space.write_word(0x20f082, 0);
- if( space->read_byte(0x20a12c) != 0 )
+ if( space.read_byte(0x20a12c) != 0 )
{
- space->write_byte(0x20a12c, space->read_byte(0x20a12c)-1 );
+ space.write_byte(0x20a12c, space.read_byte(0x20a12c)-1 );
- if( space->read_byte(0x20a12c) == 0 )
- space->write_byte(0x20a12e, 1);
+ if( space.read_byte(0x20a12c) == 0 )
+ space.write_byte(0x20a12e, 1);
}
}
@@ -243,13 +243,13 @@ READ16_MEMBER(segas32_state::darkedge_protection_r)
void f1lap_fd1149_vblank(device_t *device)
{
- address_space *space = device->memory().space(AS_PROGRAM);
+ address_space &space = *device->memory().space(AS_PROGRAM);
- space->write_byte(0x20F7C6, 0);
+ space.write_byte(0x20F7C6, 0);
// needed to start a game
- UINT8 val = space->read_byte(0x20EE81);
- if (val == 0xff) space->write_byte(0x20EE81,0);
+ UINT8 val = space.read_byte(0x20EE81);
+ if (val == 0xff) space.write_byte(0x20EE81,0);
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index 2c7131bdfaf..c4f8befad94 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -1607,7 +1607,7 @@ static UINT16 seibu_vregs[0x50/2];
static WRITE16_HANDLER( seibu_common_video_regs_w )
{
- legionna_state *state = space->machine().driver_data<legionna_state>();
+ legionna_state *state = space.machine().driver_data<legionna_state>();
COMBINE_DATA(&seibu_vregs[offset]);
switch(offset)
@@ -1749,14 +1749,14 @@ inline void get_ram(running_machine &machine)
READ16_HANDLER( copdxbl_0_r )
{
- get_ram(space->machine());
+ get_ram(space.machine());
UINT16 retvalue = cop_mcu_ram[offset];
switch(offset)
{
default:
{
- logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", space->device().safe_pc(), retvalue, offset*2);
+ logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", space.device().safe_pc(), retvalue, offset*2);
return retvalue;
}
@@ -1765,25 +1765,25 @@ READ16_HANDLER( copdxbl_0_r )
//case (0x5b4/2):
// return cop_mcu_ram[offset];
- case (0x700/2): return space->machine().root_device().ioport("DSW1")->read();
- case (0x704/2): return space->machine().root_device().ioport("PLAYERS12")->read();
- case (0x708/2): return space->machine().root_device().ioport("PLAYERS34")->read();
- case (0x70c/2): return space->machine().root_device().ioport("SYSTEM")->read();
- case (0x71c/2): return space->machine().root_device().ioport("DSW2")->read();
+ case (0x700/2): return space.machine().root_device().ioport("DSW1")->read();
+ case (0x704/2): return space.machine().root_device().ioport("PLAYERS12")->read();
+ case (0x708/2): return space.machine().root_device().ioport("PLAYERS34")->read();
+ case (0x70c/2): return space.machine().root_device().ioport("SYSTEM")->read();
+ case (0x71c/2): return space.machine().root_device().ioport("DSW2")->read();
}
}
WRITE16_HANDLER( copdxbl_0_w )
{
- legionna_state *state = space->machine().driver_data<legionna_state>();
- get_ram(space->machine());
+ legionna_state *state = space.machine().driver_data<legionna_state>();
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
switch(offset)
{
default:
{
- logerror("%06x: COPX unhandled write data %04x at offset %04x\n", space->device().safe_pc(), data, offset*2);
+ logerror("%06x: COPX unhandled write data %04x at offset %04x\n", space.device().safe_pc(), data, offset*2);
break;
}
@@ -1799,8 +1799,8 @@ WRITE16_HANDLER( copdxbl_0_w )
case (0x740/2):
{
- state->soundlatch_byte_w(*space, 0, data & 0xff);
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE );
+ state->soundlatch_byte_w(space, 0, data & 0xff);
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE );
break;
}
}
@@ -1908,7 +1908,7 @@ static UINT8 cop_calculate_collsion_detection(running_machine &machine)
static READ16_HANDLER( generic_cop_r )
{
UINT16 retvalue;
- get_ram(space->machine());
+ get_ram(space.machine());
retvalue = cop_mcu_ram[offset];
@@ -1952,7 +1952,7 @@ static READ16_HANDLER( generic_cop_r )
case 0x1a2/2:
case 0x1a4/2:
case 0x1a6/2:
- return space->machine().firstcpu->total_cycles() % (cop_rng_max_value+1);
+ return space.machine().firstcpu->total_cycles() % (cop_rng_max_value+1);
case 0x1b0/2:
return cop_status;
@@ -1964,7 +1964,7 @@ static READ16_HANDLER( generic_cop_r )
return cop_angle;
default:
- seibu_cop_log("%06x: COPX unhandled read returning %04x from offset %04x\n", space->device().safe_pc(), retvalue, offset*2);
+ seibu_cop_log("%06x: COPX unhandled read returning %04x from offset %04x\n", space.device().safe_pc(), retvalue, offset*2);
return retvalue;
}
}
@@ -1978,12 +1978,12 @@ static UINT32 cop_sprite_dma_param;
static WRITE16_HANDLER( generic_cop_w )
{
UINT32 temp32;
- get_ram(space->machine());
+ get_ram(space.machine());
switch (offset)
{
default:
- seibu_cop_log("%06x: COPX unhandled write data %04x at offset %04x\n", space->device().safe_pc(), data, offset*2);
+ seibu_cop_log("%06x: COPX unhandled write data %04x at offset %04x\n", space.device().safe_pc(), data, offset*2);
break;
/* Sprite DMA */
@@ -2051,8 +2051,8 @@ static WRITE16_HANDLER( generic_cop_w )
break;
/* Command tables for 0x500 / 0x502 commands */
- case (0x032/2): { copd2_set_tabledata(space->machine(), data); break; }
- case (0x034/2): { copd2_set_tableoffset(space->machine(), data); break; }
+ case (0x032/2): { copd2_set_tabledata(space.machine(), data); break; }
+ case (0x034/2): { copd2_set_tableoffset(space.machine(), data); break; }
case (0x038/2): { cop_438 = data; break; }
case (0x03a/2): { cop_43a = data; break; }
case (0x03c/2): { cop_43c = data; break; }
@@ -2090,28 +2090,28 @@ static WRITE16_HANDLER( generic_cop_w )
case (0x078/2): /* DMA source address */
{
cop_dma_src[cop_dma_trigger] = data; // << 6 to get actual address
- //seibu_cop_log("%06x: COPX set layer clear address to %04x (actual %08x)\n", space->device().safe_pc(), data, data<<6);
+ //seibu_cop_log("%06x: COPX set layer clear address to %04x (actual %08x)\n", space.device().safe_pc(), data, data<<6);
break;
}
case (0x07a/2): /* DMA length */
{
cop_dma_size[cop_dma_trigger] = data;
- //seibu_cop_log("%06x: COPX set layer clear length to %04x (actual %08x)\n", space->device().safe_pc(), data, data<<5);
+ //seibu_cop_log("%06x: COPX set layer clear length to %04x (actual %08x)\n", space.device().safe_pc(), data, data<<5);
break;
}
case (0x07c/2): /* DMA destination */
{
cop_dma_dst[cop_dma_trigger] = data;
- //seibu_cop_log("%06x: COPX set layer clear value to %04x (actual %08x)\n", space->device().safe_pc(), data, data<<6);
+ //seibu_cop_log("%06x: COPX set layer clear value to %04x (actual %08x)\n", space.device().safe_pc(), data, data<<6);
break;
}
case (0x07e/2): /* DMA parameter */
{
cop_dma_trigger = data;
- //seibu_cop_log("%06x: COPX set layer clear trigger? to %04x\n", space->device().safe_pc(), data);
+ //seibu_cop_log("%06x: COPX set layer clear trigger? to %04x\n", space.device().safe_pc(), data);
if (data>=0x1ff)
{
seibu_cop_log("invalid DMA trigger!, >0x1ff\n");
@@ -2161,7 +2161,7 @@ static WRITE16_HANDLER( generic_cop_w )
int command;
#if LOG_CMDS
- seibu_cop_log("%06x: COPX execute table macro command %04x %04x | regs %08x %08x %08x %08x %08x\n", space->device().safe_pc(), data, cop_mcu_ram[offset], cop_register[0], cop_register[1], cop_register[2], cop_register[3], cop_register[4]);
+ seibu_cop_log("%06x: COPX execute table macro command %04x %04x | regs %08x %08x %08x %08x %08x\n", space.device().safe_pc(), data, cop_mcu_ram[offset], cop_register[0], cop_register[1], cop_register[2], cop_register[3], cop_register[4]);
#endif
command = -1;
@@ -2230,7 +2230,7 @@ static WRITE16_HANDLER( generic_cop_w )
/* TODO: 0x1c operation? */
- space->write_dword(cop_register[0] + 0x04 + offs, space->read_dword(cop_register[0] + 0x04 + offs) + space->read_dword(cop_register[0] + 0x10 + offs));
+ space.write_dword(cop_register[0] + 0x04 + offs, space.read_dword(cop_register[0] + 0x04 + offs) + space.read_dword(cop_register[0] + 0x10 + offs));
return;
}
@@ -2245,7 +2245,7 @@ static WRITE16_HANDLER( generic_cop_w )
/* add 0x10 + offs */
/* write 0x10 + offs */
- space->write_dword(cop_register[0] + 0x10 + offs, space->read_dword(cop_register[0] + 0x10 + offs) + space->read_dword(cop_register[0] + 0x28 + offs));
+ space.write_dword(cop_register[0] + 0x10 + offs, space.read_dword(cop_register[0] + 0x10 + offs) + space.read_dword(cop_register[0] + 0x28 + offs));
return;
}
@@ -2263,9 +2263,9 @@ static WRITE16_HANDLER( generic_cop_w )
*/
if(COP_CMD(0xb9a,0xb88,0x888,0x000,0x000,0x000,0x000,0x000,7,0xfdfb))
{
- int raw_angle = (space->read_word(cop_register[0]+(0x34^2)) & 0xff);
+ int raw_angle = (space.read_word(cop_register[0]+(0x34^2)) & 0xff);
double angle = raw_angle * M_PI / 128;
- double amp = (65536 >> 5)*(space->read_word(cop_register[0]+(0x36^2)) & 0xff);
+ double amp = (65536 >> 5)*(space.read_word(cop_register[0]+(0x36^2)) & 0xff);
int res;
/* TODO: up direction, why? */
@@ -2274,7 +2274,7 @@ static WRITE16_HANDLER( generic_cop_w )
res = int(amp*sin(angle)) << cop_scale;
- space->write_dword(cop_register[0] + 0x10, res);
+ space.write_dword(cop_register[0] + 0x10, res);
return;
}
@@ -2292,9 +2292,9 @@ static WRITE16_HANDLER( generic_cop_w )
*/
if(COP_CMD(0xb9a,0xb8a,0x88a,0x000,0x000,0x000,0x000,0x000,7,0xfdfb))
{
- int raw_angle = (space->read_word(cop_register[0]+(0x34^2)) & 0xff);
+ int raw_angle = (space.read_word(cop_register[0]+(0x34^2)) & 0xff);
double angle = raw_angle * M_PI / 128;
- double amp = (65536 >> 5)*(space->read_word(cop_register[0]+(0x36^2)) & 0xff);
+ double amp = (65536 >> 5)*(space.read_word(cop_register[0]+(0x36^2)) & 0xff);
int res;
/* TODO: left direction, why? */
@@ -2303,15 +2303,15 @@ static WRITE16_HANDLER( generic_cop_w )
res = int(amp*cos(angle)) << cop_scale;
- space->write_dword(cop_register[0] + 20, res);
+ space.write_dword(cop_register[0] + 20, res);
return;
}
/* 0x130e / 0x138e */
if(COP_CMD(0x984,0xaa4,0xd82,0xaa2,0x39b,0xb9a,0xb9a,0xa9a,5,0xbf7f))
{
- int dy = space->read_dword(cop_register[1]+4) - space->read_dword(cop_register[0]+4);
- int dx = space->read_dword(cop_register[1]+8) - space->read_dword(cop_register[0]+8);
+ int dy = space.read_dword(cop_register[1]+4) - space.read_dword(cop_register[0]+4);
+ int dx = space.read_dword(cop_register[1]+8) - space.read_dword(cop_register[0]+8);
cop_status = 7;
if(!dx) {
@@ -2326,7 +2326,7 @@ static WRITE16_HANDLER( generic_cop_w )
//printf("%d %d %f %04x\n",dx,dy,atan(double(dy)/double(dx)) * 128 / M_PI,cop_angle);
if(cop_mcu_ram[offset] & 0x80)
- space->write_word(cop_register[0]+(0x34^2), cop_angle);
+ space.write_word(cop_register[0]+(0x34^2), cop_angle);
return;
}
@@ -2334,8 +2334,8 @@ static WRITE16_HANDLER( generic_cop_w )
//(heatbrl) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a
if(COP_CMD(0x984,0xaa4,0xd82,0xaa2,0x39b,0xb9a,0xb9a,0xb9a,5,0xbf7f))
{
- int dy = space->read_dword(cop_register[1]+4) - space->read_dword(cop_register[0]+4);
- int dx = space->read_dword(cop_register[1]+8) - space->read_dword(cop_register[0]+8);
+ int dy = space.read_dword(cop_register[1]+4) - space.read_dword(cop_register[0]+4);
+ int dx = space.read_dword(cop_register[1]+8) - space.read_dword(cop_register[0]+8);
cop_status = 7;
if(!dx) {
@@ -2351,7 +2351,7 @@ static WRITE16_HANDLER( generic_cop_w )
r1 = dx;
if(cop_mcu_ram[offset] & 0x80)
- space->write_word(cop_register[0]+(0x34^2), cop_angle);
+ space.write_word(cop_register[0]+(0x34^2), cop_angle);
return;
}
@@ -2373,7 +2373,7 @@ static WRITE16_HANDLER( generic_cop_w )
cop_dist = sqrt((double)(dx*dx+dy*dy));
if(cop_mcu_ram[offset] & 0x80)
- space->write_word(cop_register[0]+(0x38^2), cop_dist);
+ space.write_word(cop_register[0]+(0x38^2), cop_dist);
return;
}
@@ -2391,7 +2391,7 @@ static WRITE16_HANDLER( generic_cop_w )
/* TODO: this is WRONG! */
if(COP_CMD(0xf9a,0xb9a,0xb9c,0xb9c,0xb9c,0x29c,0x000,0x000,5,0xfcdd))
{
- int div = space->read_word(cop_register[0]+(0x36^2));
+ int div = space.read_word(cop_register[0]+(0x36^2));
int res;
if(!div)
@@ -2400,64 +2400,64 @@ static WRITE16_HANDLER( generic_cop_w )
div = 1;
}
- res = space->read_word(cop_register[0]+(0x38^2)) / div;
+ res = space.read_word(cop_register[0]+(0x38^2)) / div;
res <<= cop_scale + 2; /* TODO: check this */
- space->write_word(cop_register[0]+(0x38^2), res);
+ space.write_word(cop_register[0]+(0x38^2), res);
return;
}
/*
collision detection:
- int dy_0 = space->read_dword(cop_register[0]+4);
- int dx_0 = space->read_dword(cop_register[0]+8);
- int dy_1 = space->read_dword(cop_register[1]+4);
- int dx_1 = space->read_dword(cop_register[1]+8);
- int hitbox_param1 = space->read_dword(cop_register[2]);
- int hitbox_param2 = space->read_dword(cop_register[3]);
+ int dy_0 = space.read_dword(cop_register[0]+4);
+ int dx_0 = space.read_dword(cop_register[0]+8);
+ int dy_1 = space.read_dword(cop_register[1]+4);
+ int dx_1 = space.read_dword(cop_register[1]+8);
+ int hitbox_param1 = space.read_dword(cop_register[2]);
+ int hitbox_param2 = space.read_dword(cop_register[3]);
TODO: we are ignoring the u1 / u2 params for now
*/
if(COP_CMD(0xb80,0xb82,0xb84,0xb86,0x000,0x000,0x000,0x000,u1,u2))
{
- cop_collision_info[0].y = (space->read_dword(cop_register[0]+4));
- cop_collision_info[0].x = (space->read_dword(cop_register[0]+8));
+ cop_collision_info[0].y = (space.read_dword(cop_register[0]+4));
+ cop_collision_info[0].x = (space.read_dword(cop_register[0]+8));
return;
}
//(heatbrl) | 9 | ffff | b080 | b40 bc0 bc2
if(COP_CMD(0xb40,0xbc0,0xbc2,0x000,0x000,0x000,0x000,0x000,u1,u2))
{
- cop_collision_info[0].hitbox = space->read_word(cop_register[2]);
- cop_collision_info[0].hitbox_y = space->read_word((cop_register[2]&0xffff0000)|(cop_collision_info[0].hitbox));
- cop_collision_info[0].hitbox_x = space->read_word(((cop_register[2]&0xffff0000)|(cop_collision_info[0].hitbox))+2);
+ cop_collision_info[0].hitbox = space.read_word(cop_register[2]);
+ cop_collision_info[0].hitbox_y = space.read_word((cop_register[2]&0xffff0000)|(cop_collision_info[0].hitbox));
+ cop_collision_info[0].hitbox_x = space.read_word(((cop_register[2]&0xffff0000)|(cop_collision_info[0].hitbox))+2);
/* do the math */
cop_take_hit_box_params(0);
- cop_hit_status = cop_calculate_collsion_detection(space->machine());
+ cop_hit_status = cop_calculate_collsion_detection(space.machine());
return;
}
if(COP_CMD(0xba0,0xba2,0xba4,0xba6,0x000,0x000,0x000,0x000,u1,u2))
{
- cop_collision_info[1].y = (space->read_dword(cop_register[1]+4));
- cop_collision_info[1].x = (space->read_dword(cop_register[1]+8));
+ cop_collision_info[1].y = (space.read_dword(cop_register[1]+4));
+ cop_collision_info[1].x = (space.read_dword(cop_register[1]+8));
return;
}
//(heatbrl) | 6 | ffff | b880 | b60 be0 be2
if(COP_CMD(0xb60,0xbe0,0xbe2,0x000,0x000,0x000,0x000,0x000,u1,u2))
{
- cop_collision_info[1].hitbox = space->read_word(cop_register[3]);
- cop_collision_info[1].hitbox_y = space->read_word((cop_register[3]&0xffff0000)|(cop_collision_info[1].hitbox));
- cop_collision_info[1].hitbox_x = space->read_word(((cop_register[3]&0xffff0000)|(cop_collision_info[1].hitbox))+2);
+ cop_collision_info[1].hitbox = space.read_word(cop_register[3]);
+ cop_collision_info[1].hitbox_y = space.read_word((cop_register[3]&0xffff0000)|(cop_collision_info[1].hitbox));
+ cop_collision_info[1].hitbox_x = space.read_word(((cop_register[3]&0xffff0000)|(cop_collision_info[1].hitbox))+2);
/* do the math */
cop_take_hit_box_params(1);
- cop_hit_status = cop_calculate_collsion_detection(space->machine());
+ cop_hit_status = cop_calculate_collsion_detection(space.machine());
return;
}
@@ -2470,19 +2470,19 @@ static WRITE16_HANDLER( generic_cop_w )
offs = (offset & 3) * 4;
/* TODO: I really suspect that following two are actually taken from the 0xa180 macro command then internally loaded */
- abs_x = space->read_word(cop_register[0] + 8) - cop_sprite_dma_abs_x;
- abs_y = space->read_word(cop_register[0] + 4) - cop_sprite_dma_abs_y;
- rel_xy = space->read_word(cop_sprite_dma_src + 4 + offs);
+ abs_x = space.read_word(cop_register[0] + 8) - cop_sprite_dma_abs_x;
+ abs_y = space.read_word(cop_register[0] + 4) - cop_sprite_dma_abs_y;
+ rel_xy = space.read_word(cop_sprite_dma_src + 4 + offs);
//if(rel_xy & 0x0706)
// printf("sprite rel_xy = %04x\n",rel_xy);
if(rel_xy & 1)
- space->write_word(cop_register[4] + offs + 4,0xc0 + abs_x - (rel_xy & 0xf8));
+ space.write_word(cop_register[4] + offs + 4,0xc0 + abs_x - (rel_xy & 0xf8));
else
- space->write_word(cop_register[4] + offs + 4,(((rel_xy & 0x78) + (abs_x) - ((rel_xy & 0x80) ? 0x80 : 0))));
+ space.write_word(cop_register[4] + offs + 4,(((rel_xy & 0x78) + (abs_x) - ((rel_xy & 0x80) ? 0x80 : 0))));
- space->write_word(cop_register[4] + offs + 6,(((rel_xy & 0x7800) >> 8) + (abs_y) - ((rel_xy & 0x8000) ? 0x80 : 0)));
+ space.write_word(cop_register[4] + offs + 6,(((rel_xy & 0x7800) >> 8) + (abs_y) - ((rel_xy & 0x8000) ? 0x80 : 0)));
return;
}
@@ -2493,8 +2493,8 @@ static WRITE16_HANDLER( generic_cop_w )
offs = (offset & 3) * 4;
- space->write_word(cop_register[4] + offs + 0,space->read_word(cop_sprite_dma_src + offs) + (cop_sprite_dma_param & 0x3f));
- //space->write_word(cop_register[4] + offs + 2,space->read_word(cop_sprite_dma_src+2 + offs));
+ space.write_word(cop_register[4] + offs + 0,space.read_word(cop_sprite_dma_src + offs) + (cop_sprite_dma_param & 0x3f));
+ //space.write_word(cop_register[4] + offs + 2,space.read_word(cop_sprite_dma_src+2 + offs));
return;
}
@@ -2518,13 +2518,13 @@ static WRITE16_HANDLER( generic_cop_w )
offs = (offset & 3) * 4;
- div = space->read_word(cop_register[4] + offs) + 1;
-// offs_val = space->read_word(cop_register[3] + offs);
+ div = space.read_word(cop_register[4] + offs) + 1;
+// offs_val = space.read_word(cop_register[3] + offs);
//420 / 180 = 500 : 400 = 30 / 50 = 98 / 18
if(div == 0) { div = 1; }
- space->write_word((cop_register[6] + offs + 4), ((space->read_word(cop_register[5] + offs + 4)) / div));
+ space.write_word((cop_register[6] + offs + 4), ((space.read_word(cop_register[5] + offs + 4)) / div));
return;
}
@@ -2539,8 +2539,8 @@ static WRITE16_HANDLER( generic_cop_w )
/* 0 [1] */
/* 0xc [1] */
- cur_angle = space->read_byte(cop_register[1] + (0xc ^ 3));
- space->write_byte(cop_register[1] + (0^3),space->read_byte(cop_register[1] + (0^3)) & 0xfb); //correct?
+ cur_angle = space.read_byte(cop_register[1] + (0xc ^ 3));
+ space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) & 0xfb); //correct?
if(cur_angle >= cop_angle_compare)
{
@@ -2548,7 +2548,7 @@ static WRITE16_HANDLER( generic_cop_w )
if(cur_angle <= cop_angle_compare)
{
cur_angle = cop_angle_compare;
- space->write_byte(cop_register[1] + (0^3),space->read_byte(cop_register[1] + (0^3)) | 2);
+ space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) | 2);
}
}
else if(cur_angle <= cop_angle_compare)
@@ -2557,11 +2557,11 @@ static WRITE16_HANDLER( generic_cop_w )
if(cur_angle >= cop_angle_compare)
{
cur_angle = cop_angle_compare;
- space->write_byte(cop_register[1] + (0^3),space->read_byte(cop_register[1] + (0^3)) | 2);
+ space.write_byte(cop_register[1] + (0^3),space.read_byte(cop_register[1] + (0^3)) | 2);
}
}
- space->write_byte(cop_register[1] + (0xc ^ 3),cur_angle);
+ space.write_byte(cop_register[1] + (0xc ^ 3),cur_angle);
return;
}
@@ -2572,8 +2572,8 @@ static WRITE16_HANDLER( generic_cop_w )
{
INT8 cur_angle;
- cur_angle = space->read_byte(cop_register[0] + (0x34 ^ 3));
- //space->write_byte(cop_register[0] + (0^3),space->read_byte(cop_register[0] + (0^3)) & 0xfb); //correct?
+ cur_angle = space.read_byte(cop_register[0] + (0x34 ^ 3));
+ //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) & 0xfb); //correct?
if(cur_angle >= cop_angle_compare)
{
@@ -2582,7 +2582,7 @@ static WRITE16_HANDLER( generic_cop_w )
if(cur_angle <= cop_angle_compare)
{
cur_angle = cop_angle_compare;
- //space->write_byte(cop_register[0] + (0^3),space->read_byte(cop_register[0] + (0^3)) | 2);
+ //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) | 2);
}
}
else if(cur_angle <= cop_angle_compare)
@@ -2592,11 +2592,11 @@ static WRITE16_HANDLER( generic_cop_w )
if(cur_angle >= cop_angle_compare)
{
cur_angle = cop_angle_compare;
- //space->write_byte(cop_register[0] + (0^3),space->read_byte(cop_register[0] + (0^3)) | 2);
+ //space.write_byte(cop_register[0] + (0^3),space.read_byte(cop_register[0] + (0^3)) | 2);
}
}
- space->write_byte(cop_register[0] + (0x34 ^ 3),cur_angle);
+ space.write_byte(cop_register[0] + (0x34 ^ 3),cur_angle);
return;
}
@@ -2607,7 +2607,7 @@ static WRITE16_HANDLER( generic_cop_w )
/* DMA go register */
case (0x2fc/2):
{
- //seibu_cop_log("%06x: COPX execute current layer clear??? %04x\n", space->device().safe_pc(), data);
+ //seibu_cop_log("%06x: COPX execute current layer clear??? %04x\n", space.device().safe_pc(), data);
if (cop_dma_trigger >= 0x80 && cop_dma_trigger <= 0x87)
{
@@ -2642,30 +2642,30 @@ static WRITE16_HANDLER( generic_cop_w )
if(pal_brightness_mode == 5)
{
- bt = ((space->read_word(src + (cop_dma_fade_table * 0x400))) & 0x7c00) >> 5;
+ bt = ((space.read_word(src + (cop_dma_fade_table * 0x400))) & 0x7c00) >> 5;
bt = fade_table(bt|(pal_brightness_val ^ 0));
- b = ((space->read_word(src)) & 0x7c00) >> 5;
+ b = ((space.read_word(src)) & 0x7c00) >> 5;
b = fade_table(b|(pal_brightness_val ^ 0x1f));
pal_val = ((b + bt) & 0x1f) << 10;
- gt = ((space->read_word(src + (cop_dma_fade_table * 0x400))) & 0x03e0);
+ gt = ((space.read_word(src + (cop_dma_fade_table * 0x400))) & 0x03e0);
gt = fade_table(gt|(pal_brightness_val ^ 0));
- g = ((space->read_word(src)) & 0x03e0);
+ g = ((space.read_word(src)) & 0x03e0);
g = fade_table(g|(pal_brightness_val ^ 0x1f));
pal_val |= ((g + gt) & 0x1f) << 5;
- rt = ((space->read_word(src + (cop_dma_fade_table * 0x400))) & 0x001f) << 5;
+ rt = ((space.read_word(src + (cop_dma_fade_table * 0x400))) & 0x001f) << 5;
rt = fade_table(rt|(pal_brightness_val ^ 0));
- r = ((space->read_word(src)) & 0x001f) << 5;
+ r = ((space.read_word(src)) & 0x001f) << 5;
r = fade_table(r|(pal_brightness_val ^ 0x1f));
pal_val |= ((r + rt) & 0x1f);
}
else if(pal_brightness_mode == 4) //Denjin Makai
{
- bt =(space->read_word(src + (cop_dma_fade_table * 0x400)) & 0x7c00) >> 10;
- b = (space->read_word(src) & 0x7c00) >> 10;
- gt =(space->read_word(src + (cop_dma_fade_table * 0x400)) & 0x03e0) >> 5;
- g = (space->read_word(src) & 0x03e0) >> 5;
- rt =(space->read_word(src + (cop_dma_fade_table * 0x400)) & 0x001f) >> 0;
- r = (space->read_word(src) & 0x001f) >> 0;
+ bt =(space.read_word(src + (cop_dma_fade_table * 0x400)) & 0x7c00) >> 10;
+ b = (space.read_word(src) & 0x7c00) >> 10;
+ gt =(space.read_word(src + (cop_dma_fade_table * 0x400)) & 0x03e0) >> 5;
+ g = (space.read_word(src) & 0x03e0) >> 5;
+ rt =(space.read_word(src + (cop_dma_fade_table * 0x400)) & 0x001f) >> 0;
+ r = (space.read_word(src) & 0x001f) >> 0;
if(pal_brightness_val == 0x10)
pal_val = bt << 10 | gt << 5 | rt << 0;
@@ -2687,10 +2687,10 @@ static WRITE16_HANDLER( generic_cop_w )
else
{
printf("Warning: palette DMA used with mode %02x!\n",pal_brightness_mode);
- pal_val = space->read_word(src);
+ pal_val = space.read_word(src);
}
- space->write_word(dst, pal_val);
+ space.write_word(dst, pal_val);
src+=2;
dst+=2;
}
@@ -2709,7 +2709,7 @@ static WRITE16_HANDLER( generic_cop_w )
for(i = 0;i < size;i++)
{
- space->write_word(dst, space->read_word(src));
+ space.write_word(dst, space.read_word(src));
src+=2;
dst+=2;
}
@@ -2732,7 +2732,7 @@ static WRITE16_HANDLER( generic_cop_w )
for (i=address;i<address+length;i+=4)
{
- space->write_dword(i, fill_val);
+ space.write_dword(i, fill_val);
}
return;
@@ -2752,7 +2752,7 @@ static WRITE16_HANDLER( generic_cop_w )
for (i=address;i<address+length;i+=4)
{
- space->write_dword(i, fill_val);
+ space.write_dword(i, fill_val);
}
return;
@@ -2790,11 +2790,11 @@ static WRITE16_HANDLER( generic_cop_w )
{
for(j=i-2;j<sort_size;j+=2)
{
- addri = cop_sort_ram_addr+space->read_word(cop_sort_lookup+i);
- addrj = cop_sort_ram_addr+space->read_word(cop_sort_lookup+j);
+ addri = cop_sort_ram_addr+space.read_word(cop_sort_lookup+i);
+ addrj = cop_sort_ram_addr+space.read_word(cop_sort_lookup+j);
- vali = space->read_word(addri);
- valj = space->read_word(addrj);
+ vali = space.read_word(addri);
+ valj = space.read_word(addrj);
//printf("%08x %08x %04x %04x\n",addri,addrj,vali,valj);
@@ -2809,9 +2809,9 @@ static WRITE16_HANDLER( generic_cop_w )
{
UINT16 xch_val;
- xch_val = space->read_word(cop_sort_lookup+i);
- space->write_word(cop_sort_lookup+i,space->read_word(cop_sort_lookup+j));
- space->write_word(cop_sort_lookup+j,xch_val);
+ xch_val = space.read_word(cop_sort_lookup+i);
+ space.write_word(cop_sort_lookup+i,space.read_word(cop_sort_lookup+j));
+ space.write_word(cop_sort_lookup+j,xch_val);
}
}
}
@@ -2836,7 +2836,7 @@ READ16_HANDLER( heatbrl_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2844,13 +2844,13 @@ READ16_HANDLER( heatbrl_mcu_r )
WRITE16_HANDLER( heatbrl_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
/* external pin register, used for banking */
if(offset == 0x070/2)
{
- heatbrl_setgfxbank(space->machine(), cop_mcu_ram[offset]);
+ heatbrl_setgfxbank(space.machine(), cop_mcu_ram[offset]);
return;
}
@@ -2887,12 +2887,12 @@ READ16_HANDLER( cupsoc_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x35c/2)
{
- return space->machine().root_device().ioport("DSW2")->read();
+ return space.machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2900,7 +2900,7 @@ READ16_HANDLER( cupsoc_mcu_r )
WRITE16_HANDLER( cupsoc_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
if(offset == 0x280/2) //irq ack / sprite buffering?
@@ -2930,12 +2930,12 @@ READ16_HANDLER( cupsocs_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x31c/2)
{
- return space->machine().root_device().ioport("DSW2")->read();
+ return space.machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2943,7 +2943,7 @@ READ16_HANDLER( cupsocs_mcu_r )
WRITE16_HANDLER( cupsocs_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
if(offset == 0x280/2) //irq ack / sprite buffering?
@@ -2983,7 +2983,7 @@ READ16_HANDLER( godzilla_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2991,12 +2991,12 @@ READ16_HANDLER( godzilla_mcu_r )
WRITE16_HANDLER( godzilla_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
if(offset == 0x070/2)
{
- denjinmk_setgfxbank(space->machine(), cop_mcu_ram[offset]);
+ denjinmk_setgfxbank(space.machine(), cop_mcu_ram[offset]);
return;
}
@@ -3031,12 +3031,12 @@ READ16_HANDLER( denjinmk_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x35c/2)
{
- return space->machine().root_device().ioport("DSW2")->read();
+ return space.machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -3044,7 +3044,7 @@ READ16_HANDLER( denjinmk_mcu_r )
WRITE16_HANDLER( denjinmk_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
if(offset == 0x280/2) //irq ack / sprite buffering?
@@ -3052,7 +3052,7 @@ WRITE16_HANDLER( denjinmk_mcu_w )
if(offset == 0x070/2)
{
- denjinmk_setgfxbank(space->machine(), cop_mcu_ram[offset]);
+ denjinmk_setgfxbank(space.machine(), cop_mcu_ram[offset]);
return;
}
@@ -3084,12 +3084,12 @@ READ16_HANDLER( grainbow_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x35c/2)
{
- return space->machine().root_device().ioport("DSW2")->read();
+ return space.machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -3098,7 +3098,7 @@ READ16_HANDLER( grainbow_mcu_r )
WRITE16_HANDLER( grainbow_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
if(offset == 0x280/2) //irq ack / sprite buffering?
@@ -3133,7 +3133,7 @@ READ16_HANDLER( legionna_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "UNK", "SYSTEM" };
- return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
+ return space.machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -3141,7 +3141,7 @@ READ16_HANDLER( legionna_mcu_r )
WRITE16_HANDLER( legionna_mcu_w )
{
- get_ram(space->machine());
+ get_ram(space.machine());
COMBINE_DATA(&cop_mcu_ram[offset]);
if(offset == 0x070/2) //external pin: puts bit 13 high, delay, reads 0x748, writes bit 13 low
diff --git a/src/mame/machine/slapstic.c b/src/mame/machine/slapstic.c
index d97e34cc00a..c8d89620db0 100644
--- a/src/mame/machine/slapstic.c
+++ b/src/mame/machine/slapstic.c
@@ -864,7 +864,7 @@ int slapstic_bank(void)
*
*************************************/
-static int alt2_kludge(address_space *space, offs_t offset)
+static int alt2_kludge(address_space &space, offs_t offset)
{
/* Of the 3 alternate addresses, only the middle one needs to actually hit
in the slapstic region; the first and third ones can be anywhere in the
@@ -876,15 +876,15 @@ static int alt2_kludge(address_space *space, offs_t offset)
if (access_68k)
{
/* first verify that the prefetched PC matches the first alternate */
- if (MATCHES_MASK_VALUE(space->device().safe_pc() >> 1, slapstic.alt1))
+ if (MATCHES_MASK_VALUE(space.device().safe_pc() >> 1, slapstic.alt1))
{
/* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */
- UINT16 opcode = space->direct().read_decrypted_word(space->device().safe_pcbase() & 0xffffff);
+ UINT16 opcode = space.direct().read_decrypted_word(space.device().safe_pcbase() & 0xffffff);
if ((opcode & 0xf1f8) == 0x3090 || (opcode & 0xf1f8) == 0xb148)
{
/* fetch the value of the register for the second operand, and see */
/* if it matches the third alternate */
- UINT32 regval = space->device().state().state_int(M68K_A0 + ((opcode >> 9) & 7)) >> 1;
+ UINT32 regval = space.device().state().state_int(M68K_A0 + ((opcode >> 9) & 7)) >> 1;
if (MATCHES_MASK_VALUE(regval, slapstic.alt3))
{
alt_bank = (regval >> slapstic.altshift) & 3;
@@ -911,7 +911,7 @@ static int alt2_kludge(address_space *space, offs_t offset)
*
*************************************/
-int slapstic_tweak(address_space *space, offs_t offset)
+int slapstic_tweak(address_space &space, offs_t offset)
{
/* reset is universal */
if (offset == 0x0000)
@@ -1121,7 +1121,7 @@ int slapstic_tweak(address_space *space, offs_t offset)
/* log this access */
if (LOG_SLAPSTIC)
- slapstic_log(space->machine(), offset);
+ slapstic_log(space.machine(), offset);
/* return the active bank */
return current_bank;
diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c
index 23edbc5a370..b60ffb469a0 100644
--- a/src/mame/machine/slikshot.c
+++ b/src/mame/machine/slikshot.c
@@ -411,7 +411,7 @@ static void compute_sensors(running_machine &machine)
READ8_HANDLER( slikz80_port_r )
{
- itech8_state *state = space->machine().driver_data<itech8_state>();
+ itech8_state *state = space.machine().driver_data<itech8_state>();
int result = 0;
/* if we have nothing, return 0x03 */
@@ -442,7 +442,7 @@ READ8_HANDLER( slikz80_port_r )
WRITE8_HANDLER( slikz80_port_w )
{
- itech8_state *state = space->machine().driver_data<itech8_state>();
+ itech8_state *state = space.machine().driver_data<itech8_state>();
state->m_z80_port_val = data;
state->m_z80_clear_to_send = 0;
}
@@ -457,7 +457,7 @@ WRITE8_HANDLER( slikz80_port_w )
READ8_HANDLER( slikshot_z80_r )
{
- itech8_state *state = space->machine().driver_data<itech8_state>();
+ itech8_state *state = space.machine().driver_data<itech8_state>();
/* allow the Z80 to send us stuff now */
state->m_z80_clear_to_send = 1;
return state->m_z80_port_val;
@@ -473,7 +473,7 @@ READ8_HANDLER( slikshot_z80_r )
READ8_HANDLER( slikshot_z80_control_r )
{
- itech8_state *state = space->machine().driver_data<itech8_state>();
+ itech8_state *state = space.machine().driver_data<itech8_state>();
return state->m_z80_ctrl;
}
@@ -513,7 +513,7 @@ static TIMER_CALLBACK( delayed_z80_control_w )
WRITE8_HANDLER( slikshot_z80_control_w )
{
- space->machine().scheduler().synchronize(FUNC(delayed_z80_control_w), data);
+ space.machine().scheduler().synchronize(FUNC(delayed_z80_control_w), data);
}
diff --git a/src/mame/machine/smpc.c b/src/mame/machine/smpc.c
index 5014eb11348..ee9944d719c 100644
--- a/src/mame/machine/smpc.c
+++ b/src/mame/machine/smpc.c
@@ -627,57 +627,57 @@ static void smpc_nmi_set(running_machine &machine,UINT8 cmd)
*
*******************************************/
-static void smpc_comreg_exec(address_space *space, UINT8 data, UINT8 is_stv)
+static void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
switch (data)
{
case 0x00:
if(LOG_SMPC) printf ("SMPC: Master ON\n");
- smpc_master_on(space->machine());
+ smpc_master_on(space.machine());
break;
//case 0x01: Master OFF?
case 0x02:
case 0x03:
if(LOG_SMPC) printf ("SMPC: Slave %s\n",(data & 1) ? "off" : "on");
- space->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_slave_enable),data & 1);
+ space.machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_slave_enable),data & 1);
break;
case 0x06:
case 0x07:
if(LOG_SMPC) printf ("SMPC: Sound %s\n",(data & 1) ? "off" : "on");
if(!is_stv)
- space->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_sound_enable),data & 1);
+ space.machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_sound_enable),data & 1);
break;
/*CD (SH-1) ON/OFF */
//case 0x08:
//case 0x09:
case 0x0d:
if(LOG_SMPC) printf ("SMPC: System Reset\n");
- smpc_system_reset(space->machine());
+ smpc_system_reset(space.machine());
break;
case 0x0e:
case 0x0f:
- if(LOG_SMPC) printf ("SMPC: Change Clock to %s (%d %d)\n",data & 1 ? "320" : "352",space->machine().primary_screen->hpos(),space->machine().primary_screen->vpos());
+ if(LOG_SMPC) printf ("SMPC: Change Clock to %s (%d %d)\n",data & 1 ? "320" : "352",space.machine().primary_screen->hpos(),space.machine().primary_screen->vpos());
/* on ST-V timing of this is pretty fussy, you get 2 credits at start-up otherwise
sokyugurentai threshold is 74 lines
shanhigw threshold is 90 lines
I assume that it needs ~100 lines, so 6666,(6) usecs. Obviously needs HW tests ... */
- space->machine().scheduler().timer_set(attotime::from_usec(6666), FUNC(smpc_change_clock),data & 1);
+ space.machine().scheduler().timer_set(attotime::from_usec(6666), FUNC(smpc_change_clock),data & 1);
break;
/*"Interrupt Back"*/
case 0x10:
if(0)
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
- printf ("SMPC: Status Acquire %02x %02x %02x %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],state->m_smpc.IREG[2],space->machine().primary_screen->vpos());
+ saturn_state *state = space.machine().driver_data<saturn_state>();
+ printf ("SMPC: Status Acquire %02x %02x %02x %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],state->m_smpc.IREG[2],space.machine().primary_screen->vpos());
}
if(is_stv)
- space->machine().scheduler().timer_set(attotime::from_usec(700), FUNC(stv_smpc_intback),0); //TODO: variable time
+ space.machine().scheduler().timer_set(attotime::from_usec(700), FUNC(stv_smpc_intback),0); //TODO: variable time
else
{
int timing;
@@ -692,31 +692,31 @@ static void smpc_comreg_exec(address_space *space, UINT8 data, UINT8 is_stv)
/* TODO: check if IREG[2] is setted to 0xf0 */
- if(LOG_PAD_CMD) printf("INTBACK %02x %02x %d %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],space->machine().primary_screen->vpos(),(int)space->machine().primary_screen->frame_number());
- space->machine().scheduler().timer_set(attotime::from_usec(timing), FUNC(saturn_smpc_intback),0); //TODO: is variable time correct?
+ if(LOG_PAD_CMD) printf("INTBACK %02x %02x %d %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],space.machine().primary_screen->vpos(),(int)space.machine().primary_screen->frame_number());
+ space.machine().scheduler().timer_set(attotime::from_usec(timing), FUNC(saturn_smpc_intback),0); //TODO: is variable time correct?
}
break;
/* RTC write*/
case 0x16:
if(LOG_SMPC) printf("SMPC: RTC write\n");
- smpc_rtc_write(space->machine());
+ smpc_rtc_write(space.machine());
break;
/* SMPC memory setting*/
case 0x17:
if(LOG_SMPC) printf ("SMPC: memory setting\n");
- smpc_memory_setting(space->machine());
+ smpc_memory_setting(space.machine());
break;
case 0x18:
if(LOG_SMPC) printf ("SMPC: NMI request\n");
- smpc_nmi_req(space->machine());
+ smpc_nmi_req(space.machine());
break;
case 0x19:
case 0x1a:
if(LOG_SMPC) printf ("SMPC: NMI %sable\n",data & 1 ? "Dis" : "En");
- smpc_nmi_set(space->machine(),data & 1);
+ smpc_nmi_set(space.machine(),data & 1);
break;
default:
- printf ("cpu '%s' (PC=%08X) SMPC: undocumented Command %02x\n", space->device().tag(), space->device().safe_pc(), data);
+ printf ("cpu '%s' (PC=%08X) SMPC: undocumented Command %02x\n", space.device().tag(), space.device().safe_pc(), data);
}
}
@@ -728,7 +728,7 @@ static void smpc_comreg_exec(address_space *space, UINT8 data, UINT8 is_stv)
READ8_HANDLER( stv_SMPC_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
int return_data = 0;
if(!(offset & 1))
@@ -747,14 +747,14 @@ READ8_HANDLER( stv_SMPC_r )
return_data = state->ioport("DSW1")->read();
if (offset == 0x77)//PDR2 read
- return_data = (0xfe | space->machine().device<eeprom_device>("eeprom")->read_bit());
+ return_data = (0xfe | space.machine().device<eeprom_device>("eeprom")->read_bit());
return return_data;
}
WRITE8_HANDLER( stv_SMPC_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
if (!(offset & 1)) // avoid writing to even bytes
return;
@@ -789,13 +789,13 @@ WRITE8_HANDLER( stv_SMPC_w )
---- -x-- EEPROM CS line
---- --xx A-Bus bank bits
*/
- eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
+ eeprom_device *eeprom = space.machine().device<eeprom_device>("eeprom");
eeprom->set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
eeprom->write_bit(data & 0x10);
eeprom->set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
state->m_stv_multi_bank = data & 3;
- stv_select_game(space->machine(), state->m_stv_multi_bank);
+ stv_select_game(space.machine(), state->m_stv_multi_bank);
state->m_smpc.PDR1 = (data & 0x60);
}
@@ -809,7 +809,7 @@ WRITE8_HANDLER( stv_SMPC_w )
//popmessage("PDR2 = %02x",state->m_smpc_ram[0x77]);
if(LOG_SMPC) printf("SMPC: M68k %s\n",(data & 0x10) ? "off" : "on");
- //space->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_sound_enable),(state->m_smpc_ram[0x77] & 0x10) >> 4);
+ //space.machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_sound_enable),(state->m_smpc_ram[0x77] & 0x10) >> 4);
state->m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
state->m_en_68k = ((data & 0x10) >> 4) ^ 1;
@@ -843,7 +843,7 @@ WRITE8_HANDLER( stv_SMPC_w )
READ8_HANDLER( saturn_SMPC_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT8 return_data = 0;
if (!(offset & 1)) // avoid reading to even bytes (TODO: is it 0s or 1s?)
@@ -866,7 +866,7 @@ READ8_HANDLER( saturn_SMPC_r )
const int shift_bit[4] = { 4, 12, 8, 0 };
const char *const padnames[] = { "JOY1", "JOY2" };
- if(space->machine().root_device().ioport("INPUT_TYPE")->read() && !(space->debugger_access()))
+ if(space.machine().root_device().ioport("INPUT_TYPE")->read() && !(space.debugger_access()))
{
popmessage("Warning: read with SH-2 direct mode with a non-pad device");
return 0;
@@ -879,11 +879,11 @@ READ8_HANDLER( saturn_SMPC_r )
if (LOG_SMPC) logerror("SMPC: SH-2 direct mode, returning data for phase %d\n", hshake);
- return_data = 0x80 | 0x10 | ((space->machine().root_device().ioport(padnames[offset == 0x77])->read()>>shift_bit[hshake]) & 0xf);
+ return_data = 0x80 | 0x10 | ((space.machine().root_device().ioport(padnames[offset == 0x77])->read()>>shift_bit[hshake]) & 0xf);
}
}
- if (LOG_SMPC) logerror ("cpu %s (PC=%08X) SMPC: Read from Byte Offset %02x (%d) Returns %02x\n", space->device().tag(), space->device().safe_pc(), offset, offset>>1, return_data);
+ if (LOG_SMPC) logerror ("cpu %s (PC=%08X) SMPC: Read from Byte Offset %02x (%d) Returns %02x\n", space.device().tag(), space.device().safe_pc(), offset, offset>>1, return_data);
return return_data;
@@ -891,7 +891,7 @@ READ8_HANDLER( saturn_SMPC_r )
WRITE8_HANDLER( saturn_SMPC_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
if (LOG_SMPC) logerror ("8-bit SMPC Write to Offset %02x (reg %d) with Data %02x\n", offset, offset>>1, data);
@@ -914,7 +914,7 @@ WRITE8_HANDLER( saturn_SMPC_w )
else if(data & 0x80)
{
if(LOG_PAD_CMD) printf("SMPC: CONTINUE request\n");
- space->machine().scheduler().timer_set(attotime::from_usec(700), FUNC(intback_peripheral),0); /* TODO: is timing correct? */
+ space.machine().scheduler().timer_set(attotime::from_usec(700), FUNC(intback_peripheral),0); /* TODO: is timing correct? */
state->m_smpc.OREG[31] = 0x10;
state->m_smpc.SF = 0x01; //TODO: set hand-shake flag?
}
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 1c02d9a4ccd..5b713845c0a 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -31,9 +31,9 @@
/* -- Globals -- */
UINT8 *snes_ram = NULL; /* 65816 ram */
-static void snes_dma(address_space *space, UINT8 channels);
-static void snes_hdma_init(address_space *space);
-static void snes_hdma(address_space *space);
+static void snes_dma(address_space &space, UINT8 channels);
+static void snes_hdma_init(address_space &space);
+static void snes_hdma(address_space &space);
static READ8_HANDLER(snes_io_dma_r);
static WRITE8_HANDLER(snes_io_dma_w);
@@ -135,12 +135,12 @@ static TIMER_CALLBACK( snes_reset_oam_address )
{
snes_state *state = machine.driver_data<snes_state>();
// make sure we're in the 65816's context since we're messing with the OAM and stuff
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
if (!(snes_ppu.screen_disabled)) //Reset OAM address, byuu says it happens at H=10
{
- space->write_byte(OAMADDL, snes_ppu.oam.saved_address_low); /* Reset oam address */
- space->write_byte(OAMADDH, snes_ppu.oam.saved_address_high);
+ space.write_byte(OAMADDL, snes_ppu.oam.saved_address_low); /* Reset oam address */
+ space.write_byte(OAMADDH, snes_ppu.oam.saved_address_high);
snes_ppu.oam.first_sprite = snes_ppu.oam.priority_rotation ? (snes_ppu.oam.address >> 1) & 127 : 0;
}
}
@@ -148,7 +148,7 @@ static TIMER_CALLBACK( snes_reset_oam_address )
static TIMER_CALLBACK( snes_reset_hdma )
{
snes_state *state = machine.driver_data<snes_state>();
- address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &cpu0space = *state->m_maincpu->space(AS_PROGRAM);
snes_hdma_init(cpu0space);
}
@@ -233,7 +233,7 @@ static TIMER_CALLBACK( snes_scanline_tick )
// hdma reset happens at scanline 0, H=~6
if (snes_ppu.beam.current_vert == 0)
{
- address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &cpu0space = *state->m_maincpu->space(AS_PROGRAM);
snes_hdma_init(cpu0space);
}
@@ -257,7 +257,7 @@ static TIMER_CALLBACK( snes_scanline_tick )
static TIMER_CALLBACK( snes_hblank_tick )
{
snes_state *state = machine.driver_data<snes_state>();
- address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &cpu0space = *state->m_maincpu->space(AS_PROGRAM);
int nextscan;
snes_ppu.beam.current_vert = machine.primary_screen->vpos();
@@ -308,7 +308,7 @@ READ8_HANDLER( snes_open_bus_r )
return 0xff;
recurse = 1;
- result = space->read_byte(space->device().safe_pc() - 1); //LAST opcode that's fetched on the bus
+ result = space.read_byte(space.device().safe_pc() - 1); //LAST opcode that's fetched on the bus
recurse = 0;
return result;
}
@@ -316,7 +316,7 @@ READ8_HANDLER( snes_open_bus_r )
/* read & write to DMA addresses are defined separately, to be called by snessdd1 handlers */
static READ8_HANDLER( snes_io_dma_r )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
switch (offset)
{
@@ -364,7 +364,7 @@ static READ8_HANDLER( snes_io_dma_r )
static WRITE8_HANDLER( snes_io_dma_w )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
switch (offset)
{
@@ -430,7 +430,7 @@ static WRITE8_HANDLER( snes_io_dma_w )
*/
READ8_HANDLER( snes_r_io )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0;
// PPU accesses are from 2100 to 213f
@@ -442,7 +442,7 @@ READ8_HANDLER( snes_r_io )
// APU is mirrored from 2140 to 217f
if (offset >= APU00 && offset < WMDATA)
{
- return spc_port_out(state->m_spc700, *space, offset & 0x3);
+ return spc_port_out(state->m_spc700, space, offset & 0x3);
}
if (state->m_has_addon_chip == HAS_SUPERFX && state->m_superfx != NULL)
@@ -488,21 +488,21 @@ READ8_HANDLER( snes_r_io )
switch (offset)
{
case WMDATA: /* Data to read from WRAM */
- value = space->read_byte(0x7e0000 + state->m_wram_address++);
+ value = space.read_byte(0x7e0000 + state->m_wram_address++);
state->m_wram_address &= 0x1ffff;
return value;
case OLDJOY1: /* Data for old NES controllers (JOYSER1) */
if (snes_ram[offset] & 0x1)
return 0 | (snes_open_bus_r(space, 0) & 0xfc); //correct?
- value = state->m_oldjoy1_read(space->machine());
+ value = state->m_oldjoy1_read(space.machine());
return (value & 0x03) | (snes_open_bus_r(space, 0) & 0xfc); //correct?
case OLDJOY2: /* Data for old NES controllers (JOYSER2) */
if (snes_ram[OLDJOY1] & 0x1)
return 0 | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
- value = state->m_oldjoy2_read(space->machine());
+ value = state->m_oldjoy2_read(space.machine());
return value | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
case RDNMI: /* NMI flag by v-blank and version number */
@@ -516,7 +516,7 @@ READ8_HANDLER( snes_r_io )
return value;
case HVBJOY: /* H/V blank and joypad controller enable */
// electronics test says hcounter 272 is start of hblank, which is beampos 363
-// if (space->machine().primary_screen->hpos() >= 363) snes_ram[offset] |= 0x40;
+// if (space.machine().primary_screen->hpos() >= 363) snes_ram[offset] |= 0x40;
// else snes_ram[offset] &= ~0x40;
return (snes_ram[offset] & 0xc1) | (snes_open_bus_r(space, 0) & 0x3e);
case RDIO: /* Programmable I/O port - echos back what's written to WRIO */
@@ -565,14 +565,14 @@ READ8_HANDLER( snes_r_io )
case 0x4100: /* NSS Dip-Switches */
{
if (state->m_is_nss)
- return space->machine().root_device().ioport("DSW")->read();
+ return space.machine().root_device().ioport("DSW")->read();
return snes_open_bus_r(space, 0);
}
// case 0x4101: //PC: a104 - a10e - a12a //only nss_actr (DSW actually reads in word units ...)
default:
-// mame_printf_debug("snes_r: offset = %x pc = %x\n",offset,space->device().safe_pc());
+// mame_printf_debug("snes_r: offset = %x pc = %x\n",offset,space.device().safe_pc());
// Added break; after commenting above line. If uncommenting, drop the break;
break;
}
@@ -592,7 +592,7 @@ READ8_HANDLER( snes_r_io )
*/
WRITE8_HANDLER( snes_w_io )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
// PPU accesses are from 2100 to 213f
if (offset >= INIDISP && offset < APU00)
@@ -605,8 +605,8 @@ WRITE8_HANDLER( snes_w_io )
if (offset >= APU00 && offset < WMDATA)
{
// printf("816: %02x to APU @ %d (PC=%06x)\n", data, offset & 3,space->device().safe_pc());
- spc_port_in(state->m_spc700, *space, offset & 0x3, data);
- space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ spc_port_in(state->m_spc700, space, offset & 0x3, data);
+ space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
return;
}
@@ -622,7 +622,7 @@ WRITE8_HANDLER( snes_w_io )
{
if (offset == 0x2800 || offset == 0x2801)
{
- srtc_write(space->machine(), offset, data);
+ srtc_write(space.machine(), offset, data);
return;
}
}
@@ -644,7 +644,7 @@ WRITE8_HANDLER( snes_w_io )
UINT16 limit = (state->m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
if (offset >= 0x4800 && offset <= limit)
{
- spc7110_mmio_write(space->machine(), (UINT32)offset, data);
+ spc7110_mmio_write(space.machine(), (UINT32)offset, data);
return;
}
}
@@ -659,7 +659,7 @@ WRITE8_HANDLER( snes_w_io )
switch (offset)
{
case WMDATA: /* Data to write to WRAM */
- space->write_byte(0x7e0000 + state->m_wram_address++, data );
+ space.write_byte(0x7e0000 + state->m_wram_address++, data );
state->m_wram_address &= 0x1ffff;
return;
case WMADDL: /* Address to read/write to wram (low) */
@@ -698,7 +698,7 @@ WRITE8_HANDLER( snes_w_io )
if (!(snes_ram[WRIO] & 0x80) && (data & 0x80))
{
// external latch
- snes_latch_counters(space->machine());
+ snes_latch_counters(space.machine());
}
break;
case HTIMEL: /* H-Count timer settings (low) */
@@ -723,7 +723,7 @@ WRITE8_HANDLER( snes_w_io )
break;
case HDMAEN: /* HDMA channel designation */
if (data) //if a HDMA is enabled, data is inited at the next scanline
- space->machine().scheduler().timer_set(space->machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 1), FUNC(snes_reset_hdma));
+ space.machine().scheduler().timer_set(space.machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 1), FUNC(snes_reset_hdma));
break;
case TIMEUP: // IRQ Flag is cleared on both read and write
state->m_maincpu->set_input_line(G65816_LINE_IRQ, CLEAR_LINE );
@@ -840,12 +840,12 @@ address | | | | | | |
/* 0x000000 - 0x2fffff */
READ8_HANDLER( snes_r_bank1 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
if (address < 0x2000) /* Mirror of Low RAM */
- value = space->read_byte(0x7e0000 + address);
+ value = space.read_byte(0x7e0000 + address);
else if (address < 0x6000) /* I/O */
{
if (state->m_cart[0].mode == SNES_MODE_BSX && address >= 0x5000)
@@ -875,7 +875,7 @@ READ8_HANDLER( snes_r_bank1 )
}
else
{
- logerror("(PC=%06x) snes_r_bank1: Unmapped external chip read: %04x\n",space->device().safe_pc(),address);
+ logerror("(PC=%06x) snes_r_bank1: Unmapped external chip read: %04x\n",space.device().safe_pc(),address);
value = snes_open_bus_r(space, 0); /* Reserved */
}
}
@@ -894,12 +894,12 @@ READ8_HANDLER( snes_r_bank1 )
/* 0x300000 - 0x3fffff */
READ8_HANDLER( snes_r_bank2 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
if (address < 0x2000) /* Mirror of Low RAM */
- value = space->read_byte(0x7e0000 + address);
+ value = space.read_byte(0x7e0000 + address);
else if (address < 0x6000) /* I/O */
{
if (state->m_cart[0].mode == SNES_MODE_BSX && address >= 0x5000)
@@ -934,7 +934,7 @@ READ8_HANDLER( snes_r_bank2 )
}
else
{
- logerror( "(PC=%06x) snes_r_bank2: Unmapped external chip read: %04x\n",space->device().safe_pc(),address );
+ logerror( "(PC=%06x) snes_r_bank2: Unmapped external chip read: %04x\n",space.device().safe_pc(),address );
value = snes_open_bus_r(space, 0);
}
}
@@ -956,7 +956,7 @@ READ8_HANDLER( snes_r_bank2 )
/* 0x400000 - 0x5fffff */
READ8_HANDLER( snes_r_bank3 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
@@ -994,7 +994,7 @@ READ8_HANDLER( snes_r_bank3 )
/* 0x600000 - 0x6fffff */
READ8_HANDLER( snes_r_bank4 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
@@ -1025,7 +1025,7 @@ READ8_HANDLER( snes_r_bank4 )
value = (address >= 0x4000) ? dsp_get_sr() : dsp_get_dr();
else
{
- logerror("(PC=%06x) snes_r_bank4: Unmapped external chip read: %04x\n",space->device().safe_pc(),address);
+ logerror("(PC=%06x) snes_r_bank4: Unmapped external chip read: %04x\n",space.device().safe_pc(),address);
value = snes_open_bus_r(space, 0); /* Reserved */
}
}
@@ -1038,7 +1038,7 @@ READ8_HANDLER( snes_r_bank4 )
/* 0x700000 - 0x7dffff */
READ8_HANDLER( snes_r_bank5 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value;
UINT16 address = offset & 0xffff;
@@ -1058,7 +1058,7 @@ READ8_HANDLER( snes_r_bank5 )
}
else
{
- logerror("(PC=%06x) snes_r_bank5: Unmapped external chip read: %04x\n",space->device().safe_pc(),address);
+ logerror("(PC=%06x) snes_r_bank5: Unmapped external chip read: %04x\n",space.device().safe_pc(),address);
value = snes_open_bus_r(space, 0); /* Reserved */
}
}
@@ -1071,22 +1071,22 @@ READ8_HANDLER( snes_r_bank5 )
/* 0x800000 - 0xbfffff */
READ8_HANDLER( snes_r_bank6 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0;
UINT16 address = offset & 0xffff;
if (state->m_has_addon_chip == HAS_SUPERFX)
- value = space->read_byte(offset);
+ value = space.read_byte(offset);
else if (address < 0x8000)
{
if (state->m_cart[0].mode != SNES_MODE_25)
- value = space->read_byte(offset);
+ value = space.read_byte(offset);
else if ((state->m_has_addon_chip == HAS_CX4) && (address >= 0x6000))
value = CX4_read(address - 0x6000);
else /* Mode 25 has SRAM not mirrored from lower banks */
{
if (address < 0x6000)
- value = space->read_byte(offset);
+ value = space.read_byte(offset);
else if ((offset >= 0x300000) && (state->m_cart[0].sram > 0))
{
int mask = (state->m_cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */
@@ -1094,7 +1094,7 @@ READ8_HANDLER( snes_r_bank6 )
}
else /* Area 0x6000-0x8000 with offset < 0x300000 is reserved */
{
- logerror("(PC=%06x) snes_r_bank6: Unmapped external chip read: %04x\n",space->device().safe_pc(),address);
+ logerror("(PC=%06x) snes_r_bank6: Unmapped external chip read: %04x\n",space.device().safe_pc(),address);
value = snes_open_bus_r(space, 0);
}
}
@@ -1116,7 +1116,7 @@ READ8_HANDLER( snes_r_bank6 )
/* 0xc00000 - 0xffffff */
READ8_HANDLER( snes_r_bank7 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value = 0;
UINT16 address = offset & 0xffff;
@@ -1147,7 +1147,7 @@ READ8_HANDLER( snes_r_bank7 )
else if ((state->m_has_addon_chip == HAS_SPC7110 || state->m_has_addon_chip == HAS_SPC7110_RTC) && offset >= 0x100000)
value = spc7110_bank7_read(space, offset);
else if (state->m_has_addon_chip == HAS_SDD1)
- value = sdd1_read(space->machine(), offset);
+ value = sdd1_read(space.machine(), offset);
else if (state->m_has_addon_chip == HAS_ST010 || state->m_has_addon_chip == HAS_ST011)
{
if (offset >= 0x280000 && offset < 0x300000 && address < 0x1000)
@@ -1162,7 +1162,7 @@ READ8_HANDLER( snes_r_bank7 )
else if ((state->m_cart[0].mode & 5) && !(state->m_has_addon_chip == HAS_SUPERFX)) /* Mode 20 & 22 */
{
if (address < 0x8000)
- value = space->read_byte(0x400000 + offset);
+ value = space.read_byte(0x400000 + offset);
else
value = snes_ram[0xc00000 + offset];
}
@@ -1176,11 +1176,11 @@ READ8_HANDLER( snes_r_bank7 )
/* 0x000000 - 0x2fffff */
WRITE8_HANDLER( snes_w_bank1 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (address < 0x2000) /* Mirror of Low RAM */
- space->write_byte(0x7e0000 + address, data);
+ space.write_byte(0x7e0000 + address, data);
else if (address < 0x6000) /* I/O */
{
if (state->m_cart[0].mode == SNES_MODE_BSX && address >= 0x5000)
@@ -1197,7 +1197,7 @@ WRITE8_HANDLER( snes_w_bank1 )
else if ((state->m_cart[0].mode == SNES_MODE_21) && (state->m_has_addon_chip == HAS_DSP1) && (offset < 0x100000))
dsp_set_dr(data);
else if (state->m_has_addon_chip == HAS_CX4)
- CX4_write(space->machine(), address - 0x6000, data);
+ CX4_write(space.machine(), address - 0x6000, data);
else if (state->m_has_addon_chip == HAS_SPC7110 || state->m_has_addon_chip == HAS_SPC7110_RTC)
{
if (offset < 0x10000)
@@ -1221,17 +1221,17 @@ WRITE8_HANDLER( snes_w_bank1 )
else
dsp_set_sr(data);
else
- logerror( "(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset );
+ logerror( "(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset );
}
/* 0x300000 - 0x3fffff */
WRITE8_HANDLER( snes_w_bank2 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (address < 0x2000) /* Mirror of Low RAM */
- space->write_byte(0x7e0000 + address, data);
+ space.write_byte(0x7e0000 + address, data);
else if (address < 0x6000) /* I/O */
{
if (state->m_cart[0].mode == SNES_MODE_BSX && address >= 0x5000)
@@ -1246,7 +1246,7 @@ WRITE8_HANDLER( snes_w_bank2 )
else if (state->m_has_addon_chip == HAS_OBC1)
obc1_write(space, offset, data);
else if (state->m_has_addon_chip == HAS_CX4)
- CX4_write(space->machine(), address - 0x6000, data);
+ CX4_write(space.machine(), address - 0x6000, data);
else if (state->m_has_addon_chip == HAS_SPC7110 || state->m_has_addon_chip == HAS_SPC7110_RTC)
{
if (offset < 0x10000)
@@ -1278,13 +1278,13 @@ WRITE8_HANDLER( snes_w_bank2 )
else
dsp_set_sr(data);
else
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0x300000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0x300000);
}
/* 0x600000 - 0x6fffff */
WRITE8_HANDLER( snes_w_bank4 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->m_has_addon_chip == HAS_SUPERFX)
@@ -1307,20 +1307,20 @@ WRITE8_HANDLER( snes_w_bank4 )
else if (state->m_cart[0].mode & 5) /* Mode 20 & 22 */
{
if (address >= 0x8000)
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0x600000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0x600000);
else if (state->m_has_addon_chip == HAS_DSP1)
dsp_set_dr(data);
else
logerror("snes_w_bank4: Attempt to write to reserved address: %X = %02x\n", offset + 0x600000, data);
}
else if (state->m_cart[0].mode & 0x0a)
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0x600000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0x600000);
}
/* 0x700000 - 0x7dffff */
WRITE8_HANDLER( snes_w_bank5 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->m_has_addon_chip == HAS_SUPERFX)
@@ -1336,28 +1336,28 @@ WRITE8_HANDLER( snes_w_bank5 )
logerror("snes_w_bank5: Attempt to write to reserved address: %X = %02x\n", offset + 0x700000, data);
}
else if (state->m_cart[0].mode & 0x0a)
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0x700000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0x700000);
}
/* 0x800000 - 0xbfffff */
WRITE8_HANDLER( snes_w_bank6 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->m_has_addon_chip == HAS_SUPERFX)
- space->write_byte(offset, data);
+ space.write_byte(offset, data);
else if (address < 0x8000)
{
if ((state->m_has_addon_chip == HAS_CX4) && (address >= 0x6000))
- CX4_write(space->machine(), address - 0x6000, data);
+ CX4_write(space.machine(), address - 0x6000, data);
else if (state->m_cart[0].mode != SNES_MODE_25)
- space->write_byte(offset, data);
+ space.write_byte(offset, data);
else /* Mode 25 has SRAM not mirrored from lower banks */
{
if (address < 0x6000)
- space->write_byte(offset, data);
+ space.write_byte(offset, data);
else if ((offset >= 0x300000) && (state->m_cart[0].sram > 0))
{
int mask = (state->m_cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */
@@ -1387,14 +1387,14 @@ WRITE8_HANDLER( snes_w_bank6 )
else
dsp_set_sr(data);
else
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0x800000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0x800000);
}
/* 0xc00000 - 0xffffff */
WRITE8_HANDLER( snes_w_bank7 )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->m_has_addon_chip == HAS_SUPERFX)
@@ -1405,7 +1405,7 @@ WRITE8_HANDLER( snes_w_bank7 )
snes_ram[0xe00000 + offset] = data; // SFX RAM
}
else
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0xc00000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0xc00000);
}
else if (state->m_has_addon_chip == HAS_ST010 || state->m_has_addon_chip == HAS_ST011)
{
@@ -1434,10 +1434,10 @@ WRITE8_HANDLER( snes_w_bank7 )
snes_w_bank4(space, offset - 0x200000, data);
}
else
- logerror("(PC=%06x) snes_w_bank7: Attempt to write to ROM address: %X = %02x\n",space->device().safe_pc(),offset + 0xc00000, data);
+ logerror("(PC=%06x) snes_w_bank7: Attempt to write to ROM address: %X = %02x\n",space.device().safe_pc(),offset + 0xc00000, data);
}
else if (state->m_cart[0].mode & 0x0a)
- logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space->device().safe_pc(),offset + 0xc00000);
+ logerror("(PC=%06x) Attempt to write to ROM address: %X\n",space.device().safe_pc(),offset + 0xc00000);
}
@@ -1816,7 +1816,7 @@ MACHINE_RESET( snes )
/* for mame we use an init, maybe we will need more for the different games */
DRIVER_INIT_MEMBER(snes_state,snes)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT16 total_blocks, read_blocks;
UINT8 *rom;
@@ -1881,7 +1881,7 @@ DRIVER_INIT_MEMBER(snes_state,snes)
DRIVER_INIT_MEMBER(snes_state,snes_hirom)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT16 total_blocks, read_blocks;
UINT8 *rom;
@@ -1955,17 +1955,17 @@ INLINE int dma_abus_valid( UINT32 address )
return 1;
}
-INLINE UINT8 snes_abus_read( address_space *space, UINT32 abus )
+INLINE UINT8 snes_abus_read( address_space &space, UINT32 abus )
{
if (!dma_abus_valid(abus))
return 0;
- return space->read_byte(abus);
+ return space.read_byte(abus);
}
-INLINE void snes_dma_transfer( address_space *space, UINT8 dma, UINT32 abus, UINT16 bbus )
+INLINE void snes_dma_transfer( address_space &space, UINT8 dma, UINT32 abus, UINT16 bbus )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
if (state->m_dma_channel[dma].dmap & 0x80) /* PPU->CPU */
{
@@ -1973,7 +1973,7 @@ INLINE void snes_dma_transfer( address_space *space, UINT8 dma, UINT32 abus, UIN
{
//illegal WRAM->WRAM transfer (bus conflict)
//no read occurs; write does occur
- space->write_byte(abus, 0x00);
+ space.write_byte(abus, 0x00);
return;
}
else
@@ -1981,7 +1981,7 @@ INLINE void snes_dma_transfer( address_space *space, UINT8 dma, UINT32 abus, UIN
if (!dma_abus_valid(abus))
return;
- space->write_byte(abus, space->read_byte(bbus));
+ space.write_byte(abus, space.read_byte(bbus));
return;
}
}
@@ -1996,7 +1996,7 @@ INLINE void snes_dma_transfer( address_space *space, UINT8 dma, UINT32 abus, UIN
}
else
{
- space->write_byte(bbus, snes_abus_read(space, abus));
+ space.write_byte(bbus, snes_abus_read(space, abus));
return;
}
}
@@ -2031,10 +2031,10 @@ INLINE int is_last_active_channel( running_machine &machine, int dma )
return 1;
}
-static void snes_hdma_update( address_space *space, int dma )
+static void snes_hdma_update( address_space &space, int dma )
{
- snes_state *state = space->machine().driver_data<snes_state>();
- UINT32 abus = snes_get_hdma_addr(space->machine(), dma);
+ snes_state *state = space.machine().driver_data<snes_state>();
+ UINT32 abus = snes_get_hdma_addr(space.machine(), dma);
state->m_dma_channel[dma].hdma_line_counter = snes_abus_read(space, abus);
@@ -2044,13 +2044,13 @@ static void snes_hdma_update( address_space *space, int dma )
one byte for Address, and use the $00 for the low byte. So Address ends up incremented one less than
otherwise expected */
- abus = snes_get_hdma_addr(space->machine(), dma);
+ abus = snes_get_hdma_addr(space.machine(), dma);
state->m_dma_channel[dma].trans_size = snes_abus_read(space, abus) << 8;
- if (state->m_dma_channel[dma].hdma_line_counter || !is_last_active_channel(space->machine(), dma))
+ if (state->m_dma_channel[dma].hdma_line_counter || !is_last_active_channel(space.machine(), dma))
{
// we enter here if we have more transfers to be done or if there are other active channels after this one
- abus = snes_get_hdma_addr(space->machine(), dma);
+ abus = snes_get_hdma_addr(space.machine(), dma);
state->m_dma_channel[dma].trans_size >>= 8;
state->m_dma_channel[dma].trans_size |= snes_abus_read(space, abus) << 8;
}
@@ -2062,9 +2062,9 @@ static void snes_hdma_update( address_space *space, int dma )
state->m_dma_channel[dma].do_transfer = 1;
}
-static void snes_hdma_init( address_space *space )
+static void snes_hdma_init( address_space &space )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
int i;
state->m_hdmaen = snes_ram[HDMAEN];
@@ -2078,9 +2078,9 @@ static void snes_hdma_init( address_space *space )
}
}
-static void snes_hdma( address_space *space )
+static void snes_hdma( address_space &space )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT16 bbus;
UINT32 abus;
int i;
@@ -2162,9 +2162,9 @@ static void snes_hdma( address_space *space )
}
}
-static void snes_dma( address_space *space, UINT8 channels )
+static void snes_dma( address_space &space, UINT8 channels )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
int i;
INT8 increment;
UINT16 bbus;
diff --git a/src/mame/machine/snes7110.c b/src/mame/machine/snes7110.c
index 1b30c51d28c..5af110e7826 100644
--- a/src/mame/machine/snes7110.c
+++ b/src/mame/machine/snes7110.c
@@ -769,7 +769,7 @@ static UINT32 SPC7110Decomp_morton_4x8(SPC7110Decomp *thisptr, UINT32 data)
}
static void spc7110_mmio_write(running_machine &machine, UINT32 addr, UINT8 data);
-static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr);
+static UINT8 spc7110_mmio_read(address_space &space, UINT32 addr);
static void spc7110_update_time(running_machine &machine, UINT8 offset);
enum RTC_State
@@ -1068,9 +1068,9 @@ static void spc7110_update_time(running_machine &machine, UINT8 offset)
}
}
-static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr)
+static UINT8 spc7110_mmio_read(address_space &space, UINT32 addr)
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
UINT8 *ROM = machine.root_device().memregion("cart")->base();
addr &= 0xffff;
@@ -1641,9 +1641,9 @@ static void spc7110_mmio_write(running_machine &machine, UINT32 addr, UINT8 data
}
}
-static UINT8 spc7110_bank7_read(address_space *space, UINT32 offset)
+static UINT8 spc7110_bank7_read(address_space &space, UINT32 offset)
{
- UINT8 *ROM = space->machine().root_device().memregion("cart")->base();
+ UINT8 *ROM = space.machine().root_device().memregion("cart")->base();
UINT32 addr = offset & 0x0fffff;
switch (offset & 0xf00000)
diff --git a/src/mame/machine/snesbsx.c b/src/mame/machine/snesbsx.c
index 900a2c6c991..affd8eed404 100644
--- a/src/mame/machine/snesbsx.c
+++ b/src/mame/machine/snesbsx.c
@@ -48,7 +48,7 @@ static snes_bsx_state bsx_state;
static void bsx_update_memory_map(void)
{
bsx_state.ram_source = BIT(bsx_state.cart_regs[0x01], 7) ? SNES_BSX_PRAM : SNES_BSX_FLASH;
-// UINT8 *RAM = (bsx_state.cart_regs[0x01] & 0x80) == 0x00 ? space->machine().root_device().memregion("flash")->base() : bsx_state.pram;
+// UINT8 *RAM = (bsx_state.cart_regs[0x01] & 0x80) == 0x00 ? space.machine().root_device().memregion("flash")->base() : bsx_state.pram;
logerror("BSX: updated memory map, current RAM: %d", bsx_state.ram_source);
if (!BIT(bsx_state.cart_regs[0x02], 7))
@@ -149,7 +149,7 @@ static void bsx_init( running_machine &machine )
#ifdef UNUSED_FUNCTION
static READ8_HANDLER( bsx_flash_read )
{
- UINT8 *FLASH = space->machine().root_device().memregion("flash")->base();
+ UINT8 *FLASH = space.machine().root_device().memregion("flash")->base();
if (offset == 0x0002)
{
diff --git a/src/mame/machine/snescx4.c b/src/mame/machine/snescx4.c
index 93686a4a657..7d648d04719 100644
--- a/src/mame/machine/snescx4.c
+++ b/src/mame/machine/snescx4.c
@@ -108,10 +108,10 @@ static void CX4_transfer_data(running_machine &machine)
count = (cx4.reg[0x43]) | (cx4.reg[0x44] << 8);
dest = (cx4.reg[0x45]) | (cx4.reg[0x46] << 8);
- address_space *space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
+ address_space &space = *machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for(i=0;i<count;i++)
{
- CX4_write(machine, dest++, space->read_byte(src++));
+ CX4_write(machine, dest++, space.read_byte(src++));
}
}
diff --git a/src/mame/machine/snesrtc.c b/src/mame/machine/snesrtc.c
index 4e1ac3c9e64..78a2b2c3db8 100644
--- a/src/mame/machine/snesrtc.c
+++ b/src/mame/machine/snesrtc.c
@@ -109,7 +109,7 @@ static UINT8 srtc_weekday( UINT32 year, UINT32 month, UINT32 day )
return (sum + 1) % 7; // 1900-01-01 was a Monday
}
-static UINT8 srtc_read( address_space *space, UINT16 addr )
+static UINT8 srtc_read( address_space &space, UINT16 addr )
{
addr &= 0xffff;
@@ -122,7 +122,7 @@ static UINT8 srtc_read( address_space *space, UINT16 addr )
if (rtc_state.index < 0)
{
- srtc_update_time(space->machine());
+ srtc_update_time(space.machine());
rtc_state.index++;
return 0x0f;
}
diff --git a/src/mame/machine/snessdd1.c b/src/mame/machine/snessdd1.c
index e2e07f19583..064c0563fe8 100644
--- a/src/mame/machine/snessdd1.c
+++ b/src/mame/machine/snessdd1.c
@@ -581,7 +581,7 @@ static void sdd1_init(running_machine& machine)
snes_sdd1.buffer.ready = 0;
}
-static UINT8 sdd1_mmio_read(address_space *space, UINT32 addr)
+static UINT8 sdd1_mmio_read(address_space &space, UINT32 addr)
{
addr &= 0xffff;
@@ -605,7 +605,7 @@ static UINT8 sdd1_mmio_read(address_space *space, UINT32 addr)
return snes_open_bus_r(space, 0);
}
-static void sdd1_mmio_write(address_space *space, UINT32 addr, UINT8 data)
+static void sdd1_mmio_write(address_space &space, UINT32 addr, UINT8 data)
{
addr &= 0xffff;
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index cc3107bee33..d6ff05a453b 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -38,12 +38,12 @@ Encryption PAL 16R4 on CPU board
DRIVER_INIT_MEMBER(stfight_state,empcity)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
int A;
m_decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- space->set_decrypted_region(0x0000, 0x7fff, m_decrypt);
+ space.set_decrypted_region(0x0000, 0x7fff, m_decrypt);
for (A = 0;A < 0x8000;A++)
{
@@ -82,7 +82,7 @@ DRIVER_INIT_MEMBER(stfight_state,stfight)
void stfight_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_adpcm_data_offs = m_adpcm_data_end = 0;
m_toggle = 0;
m_fm_data = 0;
@@ -93,7 +93,7 @@ void stfight_state::machine_reset()
m_coin_mech_query = 0;
// initialise rom bank
- stfight_bank_w(*space, 0, 0 );
+ stfight_bank_w(space, 0, 0 );
}
// It's entirely possible that this bank is never switched out
diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c
index 679f4c6b8bc..5bd36023b54 100644
--- a/src/mame/machine/stvcd.c
+++ b/src/mame/machine/stvcd.c
@@ -1935,7 +1935,7 @@ WRITE32_HANDLER( stvcd_w )
case 0x90022:
case 0x90024:
case 0x90026:
- cd_writeWord(space->machine(), offset, data>>16);
+ cd_writeWord(space.machine(), offset, data>>16);
break;
default:
diff --git a/src/mame/machine/stvprot.c b/src/mame/machine/stvprot.c
index b4f9d828164..8ebc833cc6e 100644
--- a/src/mame/machine/stvprot.c
+++ b/src/mame/machine/stvprot.c
@@ -114,15 +114,15 @@ static UINT8 char_offset; //helper to jump the decoding of the NULL chars.
static READ32_HANDLER( twcup98_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
+ UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
if(offset == 3)
{
- logerror("A-Bus control protection read at %06x with data = %08x\n",space->device().safe_pc(),a_bus[3]);
+ logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
#ifdef MAME_DEBUG
- popmessage("Prot read at %06x with data = %08x",space->device().safe_pc(),a_bus[3]);
+ popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
#endif
switch(a_bus[3])
{
@@ -141,7 +141,7 @@ static READ32_HANDLER( twcup98_prot_r )
static WRITE32_HANDLER ( twcup98_prot_w )
{
COMBINE_DATA(&a_bus[offset]);
- logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space->device().safe_pc(),offset,data);
+ logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
if(offset == 3)
{
logerror("MAIN : %08x DATA : %08x\n",a_bus[3],a_bus[2]);
@@ -173,15 +173,15 @@ void install_twcup98_protection(running_machine &machine)
static READ32_HANDLER( sss_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
+ UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
if(offset == 3)
{
- logerror("A-Bus control protection read at %06x with data = %08x\n",space->device().safe_pc(),a_bus[3]);
+ logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
#ifdef MAME_DEBUG
- popmessage("Prot read at %06x with data = %08x",space->device().safe_pc(),a_bus[3]);
+ popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
#endif
switch(a_bus[3])
{
@@ -208,7 +208,7 @@ static READ32_HANDLER( sss_prot_r )
static WRITE32_HANDLER ( sss_prot_w )
{
COMBINE_DATA(&a_bus[offset]);
- logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space->device().safe_pc(),offset,data);
+ logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
if(offset == 3)
{
//logerror("MAIN : %08x DATA : %08x\n",a_bus[3],a_bus[2]);
@@ -238,15 +238,15 @@ void install_sss_protection(running_machine &machine)
static READ32_HANDLER( rsgun_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
+ UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
if(offset == 3)
{
- logerror("A-Bus control protection read at %06x with data = %08x\n",space->device().safe_pc(),a_bus[3]);
+ logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
#ifdef MAME_DEBUG
- popmessage("Prot read at %06x with data = %08x",space->device().safe_pc(),a_bus[3]);
+ popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
#endif
switch(a_bus[3])
{
@@ -278,7 +278,7 @@ static READ32_HANDLER( rsgun_prot_r )
static WRITE32_HANDLER ( rsgun_prot_w )
{
COMBINE_DATA(&a_bus[offset]);
- logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space->device().safe_pc(),offset,data);
+ logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
if(offset == 3)
{
//logerror("MAIN : %08x DATA : %08x\n",a_bus[3],a_bus[2]);
@@ -313,15 +313,15 @@ void install_rsgun_protection(running_machine &machine)
static READ32_HANDLER( elandore_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
+ UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
if(offset == 3)
{
- logerror("A-Bus control protection read at %06x with data = %08x\n",space->device().safe_pc(),a_bus[3]);
+ logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
#ifdef MAME_DEBUG
- popmessage("Prot read at %06x with data = %08x",space->device().safe_pc(),a_bus[3]);
+ popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
#endif
switch(a_bus[3])
{
@@ -349,7 +349,7 @@ static READ32_HANDLER( elandore_prot_r )
static WRITE32_HANDLER ( elandore_prot_w )
{
COMBINE_DATA(&a_bus[offset]);
- logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space->device().safe_pc(),offset,data);
+ logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
if(offset == 3)
{
/* a bus value 2 seed is used too here. */
@@ -420,15 +420,15 @@ static const UINT32 vector_prot[] = { 0x0603B1B2,0x234 };
static READ32_HANDLER( ffreveng_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine().root_device().memregion("abus")->base();
+ UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
if(offset == 3)
{
- logerror("A-Bus control protection read at %06x with data = %08x\n",space->device().safe_pc(),a_bus[3]);
+ logerror("A-Bus control protection read at %06x with data = %08x\n",space.device().safe_pc(),a_bus[3]);
#ifdef MAME_DEBUG
- popmessage("Prot read at %06x with data = %08x",space->device().safe_pc(),a_bus[3]);
+ popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),a_bus[3]);
#endif
switch(a_bus[3])
{
@@ -455,7 +455,7 @@ static READ32_HANDLER( ffreveng_prot_r )
static WRITE32_HANDLER ( ffreveng_prot_w )
{
COMBINE_DATA(&a_bus[offset]);
- logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space->device().safe_pc(),offset,data);
+ logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data);
if(offset == 3)
{
//logerror("MAIN : %08x DATA : %08x\n",a_bus[3],a_bus[2]);
@@ -485,11 +485,11 @@ static READ32_HANDLER(astrass_prot_r)
if ( offset == 3 && ctrl_index != -1 )
{
UINT32 data = 0;
- UINT32 *prot_data = (UINT32 *)space->machine().root_device().memregion("user2")->base();
+ UINT32 *prot_data = (UINT32 *)space.machine().root_device().memregion("user2")->base();
data = prot_data[ctrl_index++];
- if ( ctrl_index >= space->machine().root_device().memregion("user2")->bytes()/4 )
+ if ( ctrl_index >= space.machine().root_device().memregion("user2")->bytes()/4 )
{
ctrl_index = -1;
}
@@ -533,7 +533,7 @@ static READ32_HANDLER( decathlt_prot_r )
{
// the offsets written to the protection device definitely only refer to 2 of the roms
// it's a fair assumption to say that only those 2 are connected to the protection device
- UINT8 *ROM = (UINT8 *)space->machine().root_device().memregion("abus")->base()+0x1000000;
+ UINT8 *ROM = (UINT8 *)space.machine().root_device().memregion("abus")->base()+0x1000000;
if (offset==2)
{
@@ -554,7 +554,7 @@ static READ32_HANDLER( decathlt_prot_r )
}
else
{
- logerror("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n",space->device().safe_pc(), offset, mem_mask, decathlt_protregs[0], decathlt_protregs[1], decathlt_protregs[2], decathlt_protregs[3]);
+ logerror("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n",space.device().safe_pc(), offset, mem_mask, decathlt_protregs[0], decathlt_protregs[1], decathlt_protregs[2], decathlt_protregs[3]);
}
return decathlt_protregs[offset];
diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c
index 9eb50ad9e09..e8527c4faee 100644
--- a/src/mame/machine/tait8741.c
+++ b/src/mame/machine/tait8741.c
@@ -122,7 +122,7 @@ void TAITO8741_reset(int num)
}
/* 8741 update */
-static void taito8741_update(address_space *space, int num)
+static void taito8741_update(address_space &space, int num)
{
I8741 *st,*sst;
int next = num;
@@ -177,7 +177,7 @@ static void taito8741_update(address_space *space, int num)
else
{ /* port select */
st->parallelselect = data & 0x07;
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0);
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0);
}
}
}
@@ -188,7 +188,7 @@ static void taito8741_update(address_space *space, int num)
case -1: /* no command data */
break;
case 0x00: /* read from parallel port */
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0 );
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0 );
break;
case 0x01: /* read receive buffer 0 */
case 0x02: /* read receive buffer 1 */
@@ -201,10 +201,10 @@ static void taito8741_update(address_space *space, int num)
taito8741_hostdata_w(st,st->rxd[data-1]);
break;
case 0x08: /* latch received serial data */
- st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0;
+ st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0;
if( sst )
{
- space->machine().scheduler().synchronize(FUNC(taito8741_serial_tx), num);
+ space.machine().scheduler().synchronize(FUNC(taito8741_serial_tx), num);
st->serial_out = 0;
st->status |= 0x04;
st->phase = CMD_08;
@@ -273,21 +273,21 @@ int TAITO8741_start(const struct TAITO8741interface *taito8741intf)
}
/* read status port */
-static int I8741_status_r(address_space *space, int num)
+static int I8741_status_r(address_space &space, int num)
{
I8741 *st = &taito8741[num];
taito8741_update(space, num);
- LOG(("%s:8741-%d ST Read %02x\n",space->machine().describe_context(),num,st->status));
+ LOG(("%s:8741-%d ST Read %02x\n",space.machine().describe_context(),num,st->status));
return st->status;
}
/* read data port */
-static int I8741_data_r(address_space *space, int num)
+static int I8741_data_r(address_space &space, int num)
{
I8741 *st = &taito8741[num];
int ret = st->toData;
st->status &= 0xfe;
- LOG(("%s:8741-%d DATA Read %02x\n",space->machine().describe_context(),num,ret));
+ LOG(("%s:8741-%d DATA Read %02x\n",space.machine().describe_context(),num,ret));
/* update chip */
taito8741_update(space, num);
@@ -295,17 +295,17 @@ static int I8741_data_r(address_space *space, int num)
switch( st->mode )
{
case TAITO8741_PORT: /* parallel data */
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0);
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? space.machine().root_device().ioport(st->portName)->read() : 0);
break;
}
return ret;
}
/* Write data port */
-static void I8741_data_w(address_space *space, int num, int data)
+static void I8741_data_w(address_space &space, int num, int data)
{
I8741 *st = &taito8741[num];
- LOG(("%s:8741-%d DATA Write %02x\n",space->machine().describe_context(),num,data));
+ LOG(("%s:8741-%d DATA Write %02x\n",space.machine().describe_context(),num,data));
st->fromData = data;
st->status |= 0x02;
/* update chip */
@@ -313,10 +313,10 @@ static void I8741_data_w(address_space *space, int num, int data)
}
/* Write command port */
-static void I8741_command_w(address_space *space, int num, int data)
+static void I8741_command_w(address_space &space, int num, int data)
{
I8741 *st = &taito8741[num];
- LOG(("%s:8741-%d CMD Write %02x\n",space->machine().describe_context(),num,data));
+ LOG(("%s:8741-%d CMD Write %02x\n",space.machine().describe_context(),num,data));
st->fromCmd = data;
st->status |= 0x04;
/* update chip */
@@ -444,13 +444,13 @@ static void josvolly_8741_do(running_machine &machine, int num)
}
}
-static void josvolly_8741_w(address_space *space, int num, int offset, int data)
+static void josvolly_8741_w(address_space &space, int num, int offset, int data)
{
JV8741 *mcu = &i8741[num];
if(offset==1)
{
- LOG(("%s:8741[%d] CW %02X\n", space->machine().describe_context(), num, data));
+ LOG(("%s:8741[%d] CW %02X\n", space.machine().describe_context(), num, data));
/* read pointer */
mcu->cmd = data;
@@ -472,7 +472,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
break;
case 2:
#if 1
- mcu->rxd = space->machine().root_device().ioport("DSW2")->read();
+ mcu->rxd = space.machine().root_device().ioport("DSW2")->read();
mcu->sts |= 0x01; /* RD ready */
#endif
break;
@@ -488,7 +488,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
else
{
/* data */
- LOG(("%s:8741[%d] DW %02X\n", space->machine().describe_context(), num, data));
+ LOG(("%s:8741[%d] DW %02X\n", space.machine().describe_context(), num, data));
mcu->txd = data ^ 0x40; /* parity reverce ? */
mcu->sts |= 0x02; /* TXD busy */
@@ -498,16 +498,16 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
{
if(josvolly_nmi_enable)
{
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
josvolly_nmi_enable = 0;
}
}
#endif
}
- josvolly_8741_do(space->machine(), num);
+ josvolly_8741_do(space.machine(), num);
}
-static INT8 josvolly_8741_r(address_space *space,int num,int offset)
+static INT8 josvolly_8741_r(address_space &space,int num,int offset)
{
JV8741 *mcu = &i8741[num];
int ret;
@@ -515,16 +515,16 @@ static INT8 josvolly_8741_r(address_space *space,int num,int offset)
if(offset==1)
{
if(mcu->rst)
- mcu->rxd = space->machine().root_device().ioport(mcu->initReadPort)->read(); /* port in */
+ mcu->rxd = space.machine().root_device().ioport(mcu->initReadPort)->read(); /* port in */
ret = mcu->sts;
- LOG(("%s:8741[%d] SR %02X\n",space->machine().describe_context(),num,ret));
+ LOG(("%s:8741[%d] SR %02X\n",space.machine().describe_context(),num,ret));
}
else
{
/* clear status port */
mcu->sts &= ~0x01; /* RD ready */
ret = mcu->rxd;
- LOG(("%s:8741[%d] DR %02X\n",space->machine().describe_context(),num,ret));
+ LOG(("%s:8741[%d] DR %02X\n",space.machine().describe_context(),num,ret));
mcu->rst = 0;
}
return ret;
diff --git a/src/mame/machine/taitoio.c b/src/mame/machine/taitoio.c
index 7b7b70c99c8..aa0481a8004 100644
--- a/src/mame/machine/taitoio.c
+++ b/src/mame/machine/taitoio.c
@@ -112,7 +112,7 @@ READ8_DEVICE_HANDLER( tc0220ioc_r )
return tc0220ioc->read_7(0);
default:
-//logerror("PC %06x: warning - read TC0220IOC address %02x\n",space->device().safe_pc(),offset);
+//logerror("PC %06x: warning - read TC0220IOC address %02x\n",space.device().safe_pc(),offset);
return 0xff;
}
}
@@ -137,12 +137,12 @@ WRITE8_DEVICE_HANDLER( tc0220ioc_w )
coin_counter_w(device->machine(), 1, data & 0x08);
//if (data & 0xf0)
-//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",space.device().safe_pc(),data,offset);
break;
default:
-//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
@@ -268,7 +268,7 @@ READ8_DEVICE_HANDLER( tc0510nio_r )
return tc0510nio->read_7(0);
default:
-//logerror("PC %06x: warning - read TC0510NIO address %02x\n",space->device().safe_pc(),offset);
+//logerror("PC %06x: warning - read TC0510NIO address %02x\n",space.device().safe_pc(),offset);
return 0xff;
}
}
@@ -293,7 +293,7 @@ WRITE8_DEVICE_HANDLER( tc0510nio_w )
break;
default:
-//logerror("PC %06x: warning - write %02x to TC0510NIO address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %02x to TC0510NIO address %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
@@ -310,7 +310,7 @@ WRITE16_DEVICE_HANDLER( tc0510nio_halfword_w )
else
{
/* driftout writes the coin counters here - bug? */
-//logerror("CPU #0 PC %06x: warning - write to MSB of TC0510NIO address %02x\n",space->device().safe_pc(),offset);
+//logerror("CPU #0 PC %06x: warning - write to MSB of TC0510NIO address %02x\n",space.device().safe_pc(),offset);
tc0510nio_w(device, space, offset, (data >> 8) & 0xff);
}
}
@@ -418,7 +418,7 @@ READ8_DEVICE_HANDLER( tc0640fio_r )
return tc0640fio->read_7(0);
default:
-//logerror("PC %06x: warning - read TC0640FIO address %02x\n",space->device().safe_pc(),offset);
+//logerror("PC %06x: warning - read TC0640FIO address %02x\n",space.device().safe_pc(),offset);
return 0xff;
}
}
@@ -443,7 +443,7 @@ WRITE8_DEVICE_HANDLER( tc0640fio_w )
break;
default:
-//logerror("PC %06x: warning - write %02x to TC0640FIO address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %02x to TC0640FIO address %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
@@ -460,7 +460,7 @@ WRITE16_DEVICE_HANDLER( tc0640fio_halfword_w )
else
{
tc0640fio_w(device, space, offset, (data >> 8) & 0xff);
-//logerror("CPU #0 PC %06x: warning - write to MSB of TC0640FIO address %02x\n",space->device().safe_pc(),offset);
+//logerror("CPU #0 PC %06x: warning - write to MSB of TC0640FIO address %02x\n",space.device().safe_pc(),offset);
}
}
@@ -476,7 +476,7 @@ WRITE16_DEVICE_HANDLER( tc0640fio_halfword_byteswap_w )
else
{
tc0640fio_w(device, space, offset, data & 0xff);
-//logerror("CPU #0 PC %06x: warning - write to LSB of TC0640FIO address %02x\n",space->device().safe_pc(),offset);
+//logerror("CPU #0 PC %06x: warning - write to LSB of TC0640FIO address %02x\n",space.device().safe_pc(),offset);
}
}
diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c
index 88db39bb684..ed522407e91 100644
--- a/src/mame/machine/taitosj.c
+++ b/src/mame/machine/taitosj.c
@@ -36,10 +36,10 @@ void taitosj_state::machine_start()
void taitosj_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* set the default ROM bank (many games only have one bank and */
/* never write to the bank selector register) */
- taitosj_bankswitch_w(*space, 0, 0);
+ taitosj_bankswitch_w(space, 0, 0);
m_zaccept = 1;
diff --git a/src/mame/machine/theglobp.c b/src/mame/machine/theglobp.c
index 0e308dabee3..d5f7ff72fb7 100644
--- a/src/mame/machine/theglobp.c
+++ b/src/mame/machine/theglobp.c
@@ -206,7 +206,7 @@ static void theglobp_decrypt_rom_B(running_machine &machine)
READ8_HANDLER( theglobp_decrypt_rom )
{
- pacman_state *state = space->machine().driver_data<pacman_state>();
+ pacman_state *state = space.machine().driver_data<pacman_state>();
if (offset & 0x01)
{
state->m_counter = (state->m_counter - 1) & 0x0F;
diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c
index e90a3875f56..4a969de6d3d 100644
--- a/src/mame/machine/twincobr.c
+++ b/src/mame/machine/twincobr.c
@@ -260,31 +260,31 @@ WRITE16_MEMBER(twincobr_state::twincobr_sharedram_w)
}
-static void toaplan0_coin_dsp_w(address_space *space, int offset, int data)
+static void toaplan0_coin_dsp_w(address_space &space, int offset, int data)
{
- twincobr_state *state = space->machine().driver_data<twincobr_state>();
+ twincobr_state *state = space.machine().driver_data<twincobr_state>();
if (data > 1)
- LOG(("%s:Writing %08x to %08x.\n",space->machine().describe_context(),data,toaplan_port_type[state->m_toaplan_main_cpu] - offset));
+ LOG(("%s:Writing %08x to %08x.\n",space.machine().describe_context(),data,toaplan_port_type[state->m_toaplan_main_cpu] - offset));
switch (data) {
- case 0x08: coin_counter_w(space->machine(), 0,0); break;
- case 0x09: coin_counter_w(space->machine(), 0,1); break;
- case 0x0a: coin_counter_w(space->machine(), 1,0); break;
- case 0x0b: coin_counter_w(space->machine(), 1,1); break;
- case 0x0c: coin_lockout_w(space->machine(), 0,1); break;
- case 0x0d: coin_lockout_w(space->machine(), 0,0); break;
- case 0x0e: coin_lockout_w(space->machine(), 1,1); break;
- case 0x0f: coin_lockout_w(space->machine(), 1,0); break;
+ case 0x08: coin_counter_w(space.machine(), 0,0); break;
+ case 0x09: coin_counter_w(space.machine(), 0,1); break;
+ case 0x0a: coin_counter_w(space.machine(), 1,0); break;
+ case 0x0b: coin_counter_w(space.machine(), 1,1); break;
+ case 0x0c: coin_lockout_w(space.machine(), 0,1); break;
+ case 0x0d: coin_lockout_w(space.machine(), 0,0); break;
+ case 0x0e: coin_lockout_w(space.machine(), 1,1); break;
+ case 0x0f: coin_lockout_w(space.machine(), 1,0); break;
/****** The following apply to Flying Shark/Wardner only ******/
case 0x00: /* This means assert the INT line to the DSP */
LOG(("Turning DSP on and main CPU off\n"));
- space->machine().device("dsp")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
- space->machine().device("dsp")->execute().set_input_line(0, ASSERT_LINE); /* TMS32010 INT */
- space->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+ space.machine().device("dsp")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
+ space.machine().device("dsp")->execute().set_input_line(0, ASSERT_LINE); /* TMS32010 INT */
+ space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
break;
case 0x01: /* This means inhibit the INT line to the DSP */
LOG(("Turning DSP off\n"));
- space->machine().device("dsp")->execute().set_input_line(0, CLEAR_LINE); /* TMS32010 INT */
- space->machine().device("dsp")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+ space.machine().device("dsp")->execute().set_input_line(0, CLEAR_LINE); /* TMS32010 INT */
+ space.machine().device("dsp")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
break;
}
}
@@ -294,18 +294,18 @@ WRITE16_MEMBER(twincobr_state::fshark_coin_dsp_w)
{
if (ACCESSING_BITS_0_7)
{
- toaplan0_coin_dsp_w(&space, offset, data & 0xff);
+ toaplan0_coin_dsp_w(space, offset, data & 0xff);
}
}
WRITE8_MEMBER(twincobr_state::twincobr_coin_w)
{
- toaplan0_coin_dsp_w(&space, offset, data);
+ toaplan0_coin_dsp_w(space, offset, data);
}
WRITE8_MEMBER(twincobr_state::wardner_coin_dsp_w)
{
- toaplan0_coin_dsp_w(&space, offset, data);
+ toaplan0_coin_dsp_w(space, offset, data);
}
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 7bef4419221..84777718d25 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -456,8 +456,8 @@ TIMER_DEVICE_CALLBACK( williams2_endscreen_callback )
static void williams2_postload(running_machine &machine)
{
williams_state *state = machine.driver_data<williams_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- state->williams2_bank_select_w(*space, 0, state->m_vram_bank);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ state->williams2_bank_select_w(space, 0, state->m_vram_bank);
}
@@ -475,10 +475,10 @@ MACHINE_START_MEMBER(williams_state,williams2)
MACHINE_RESET_MEMBER(williams_state,williams2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* make sure our banking is reset */
- williams2_bank_select_w(*space, 0, 0);
+ williams2_bank_select_w(space, 0, 0);
/* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
timer_device *scan_timer = machine().device<timer_device>("scan_timer");
@@ -759,8 +759,8 @@ WRITE8_MEMBER(williams_state::williams2_7segment_w)
static void defender_postload(running_machine &machine)
{
williams_state *state = machine.driver_data<williams_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- state->defender_bank_select_w(*space, 0, state->m_vram_bank);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ state->defender_bank_select_w(space, 0, state->m_vram_bank);
}
@@ -777,11 +777,11 @@ MACHINE_START_MEMBER(williams_state,defender)
MACHINE_RESET_MEMBER(williams_state,defender)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
MACHINE_RESET_CALL_MEMBER(williams_common);
- defender_bank_select_w(*space, 0, 0);
+ defender_bank_select_w(space, 0, 0);
}
@@ -800,7 +800,7 @@ WRITE8_MEMBER(williams_state::defender_bank_select_w)
{
/* page 0 is I/O &space */
case 0:
- defender_install_io_space(&space);
+ defender_install_io_space(space);
break;
/* pages 1-9 map to ROM banks */
diff --git a/src/mame/machine/wrally.c b/src/mame/machine/wrally.c
index 5361bffb224..038007e6aa2 100644
--- a/src/mame/machine/wrally.c
+++ b/src/mame/machine/wrally.c
@@ -20,7 +20,7 @@
WRITE16_MEMBER(wrally_state::wrally_vram_w)
{
- data = gaelco_decrypt(&space, offset, data, 0x1f, 0x522a);
+ data = gaelco_decrypt(space, offset, data, 0x1f, 0x522a);
COMBINE_DATA(&m_videoram[offset]);
m_pant[(offset & 0x1fff) >> 12]->mark_tile_dirty(((offset << 1) & 0x1fff) >> 2);
diff --git a/src/mame/machine/xevious.c b/src/mame/machine/xevious.c
index 9b1b5bd563b..8723bb5b989 100644
--- a/src/mame/machine/xevious.c
+++ b/src/mame/machine/xevious.c
@@ -63,7 +63,7 @@ TIMER_DEVICE_CALLBACK( battles_nmi_generate )
READ8_HANDLER( battles_customio0_r )
{
- logerror("CPU0 %04x: custom I/O Read = %02x\n",space->device().safe_pc(),battles_customio_command);
+ logerror("CPU0 %04x: custom I/O Read = %02x\n",space.device().safe_pc(),battles_customio_command);
return battles_customio_command;
}
@@ -71,7 +71,7 @@ READ8_HANDLER( battles_customio3_r )
{
int return_data;
- if( space->device().safe_pc() == 0xAE ){
+ if( space.device().safe_pc() == 0xAE ){
/* CPU4 0xAA - 0xB9 : waiting for MB8851 ? */
return_data = ( (battles_customio_command & 0x10) << 3)
| 0x00
@@ -81,7 +81,7 @@ READ8_HANDLER( battles_customio3_r )
| 0x60
| (battles_customio_prev_command & 0x0f);
}
- logerror("CPU3 %04x: custom I/O Read = %02x\n",space->device().safe_pc(),return_data);
+ logerror("CPU3 %04x: custom I/O Read = %02x\n",space.device().safe_pc(),return_data);
return return_data;
}
@@ -89,9 +89,9 @@ READ8_HANDLER( battles_customio3_r )
WRITE8_HANDLER( battles_customio0_w )
{
- timer_device *timer = space->machine().device<timer_device>("battles_nmi");
+ timer_device *timer = space.machine().device<timer_device>("battles_nmi");
- logerror("CPU0 %04x: custom I/O Write = %02x\n",space->device().safe_pc(),data);
+ logerror("CPU0 %04x: custom I/O Write = %02x\n",space.device().safe_pc(),data);
battles_customio_command = data;
battles_customio_command_count = 0;
@@ -108,7 +108,7 @@ WRITE8_HANDLER( battles_customio0_w )
WRITE8_HANDLER( battles_customio3_w )
{
- logerror("CPU3 %04x: custom I/O Write = %02x\n",space->device().safe_pc(),data);
+ logerror("CPU3 %04x: custom I/O Write = %02x\n",space.device().safe_pc(),data);
battles_customio_command = data;
}
@@ -117,47 +117,47 @@ WRITE8_HANDLER( battles_customio3_w )
READ8_HANDLER( battles_customio_data0_r )
{
- logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",space->device().safe_pc(),offset,battles_customio_data);
+ logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,battles_customio_data);
return battles_customio_data;
}
READ8_HANDLER( battles_customio_data3_r )
{
- logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",space->device().safe_pc(),offset,battles_customio_data);
+ logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,battles_customio_data);
return battles_customio_data;
}
WRITE8_HANDLER( battles_customio_data0_w )
{
- logerror("CPU0 %04x: custom I/O parameter %02x Write = %02x\n",space->device().safe_pc(),offset,data);
+ logerror("CPU0 %04x: custom I/O parameter %02x Write = %02x\n",space.device().safe_pc(),offset,data);
battles_customio_data = data;
}
WRITE8_HANDLER( battles_customio_data3_w )
{
- logerror("CPU3 %04x: custom I/O parameter %02x Write = %02x\n",space->device().safe_pc(),offset,data);
+ logerror("CPU3 %04x: custom I/O parameter %02x Write = %02x\n",space.device().safe_pc(),offset,data);
battles_customio_data = data;
}
WRITE8_HANDLER( battles_CPU4_coin_w )
{
- set_led_status(space->machine(), 0,data & 0x02); // Start 1
- set_led_status(space->machine(), 1,data & 0x01); // Start 2
+ set_led_status(space.machine(), 0,data & 0x02); // Start 1
+ set_led_status(space.machine(), 1,data & 0x01); // Start 2
- coin_counter_w(space->machine(), 0,data & 0x20);
- coin_counter_w(space->machine(), 1,data & 0x10);
- coin_lockout_global_w(space->machine(), ~data & 0x04);
+ coin_counter_w(space.machine(), 0,data & 0x20);
+ coin_counter_w(space.machine(), 1,data & 0x10);
+ coin_lockout_global_w(space.machine(), ~data & 0x04);
}
WRITE8_HANDLER( battles_noise_sound_w )
{
- logerror("CPU3 %04x: 50%02x Write = %02x\n",space->device().safe_pc(),offset,data);
+ logerror("CPU3 %04x: 50%02x Write = %02x\n",space.device().safe_pc(),offset,data);
if( (battles_sound_played == 0) && (data == 0xFF) ){
- samples_device *samples = space->machine().device<samples_device>("samples");
+ samples_device *samples = space.machine().device<samples_device>("samples");
if( customio[0] == 0x40 ){
samples->start(0, 0);
}
@@ -174,10 +174,10 @@ READ8_HANDLER( battles_input_port_r )
switch ( offset )
{
default:
- case 0: return ~BITSWAP8(space->machine().root_device().ioport("IN0H")->read(),7,6,5,4,2,3,1,0);
- case 1: return ~space->machine().root_device().ioport("IN1L")->read();
- case 2: return ~space->machine().root_device().ioport("IN1H")->read();
- case 3: return ~space->machine().root_device().ioport("IN0L")->read();
+ case 0: return ~BITSWAP8(space.machine().root_device().ioport("IN0H")->read(),7,6,5,4,2,3,1,0);
+ case 1: return ~space.machine().root_device().ioport("IN1L")->read();
+ case 2: return ~space.machine().root_device().ioport("IN1H")->read();
+ case 3: return ~space.machine().root_device().ioport("IN0L")->read();
}
}
diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c
index 307d666043d..c992c2d6a52 100644
--- a/src/mame/video/amiga.c
+++ b/src/mame/video/amiga.c
@@ -206,7 +206,7 @@ int amiga_copper_execute_next(running_machine &machine, int xpos)
{
if (LOG_COPPER)
logerror("%02X.%02X: Write to %s = %04x\n", state->m_last_scanline, xpos / 2, amiga_custom_names[state->m_copper_pending_offset & 0xff], state->m_copper_pending_data);
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), state->m_copper_pending_offset, state->m_copper_pending_data, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), state->m_copper_pending_offset, state->m_copper_pending_data, 0xffff);
state->m_copper_pending_offset = 0;
}
@@ -262,7 +262,7 @@ int amiga_copper_execute_next(running_machine &machine, int xpos)
{
if (LOG_COPPER)
logerror("%02X.%02X: Write to %s = %04x\n", state->m_last_scanline, xpos / 2, amiga_custom_names[word0 & 0xff], word1);
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), word0, word1, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), word0, word1, 0xffff);
}
else // additional 2 cycles needed for non-Agnus registers
{
diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c
index 3a3dccae922..d8fe3d6f8a0 100644
--- a/src/mame/video/antic.c
+++ b/src/mame/video/antic.c
@@ -90,7 +90,7 @@ READ8_HANDLER ( atari_antic_r )
data = antic.r.antic09;
break;
case 10: /* WSYNC read */
- space->machine().device("maincpu")->execute().spin_until_trigger(TRIGGER_HSYNC);
+ space.machine().device("maincpu")->execute().spin_until_trigger(TRIGGER_HSYNC);
antic.w.wsync = 1;
data = antic.r.antic0a;
break;
@@ -200,7 +200,7 @@ WRITE8_HANDLER ( atari_antic_w )
break;
case 10: /* WSYNC write */
LOG(("ANTIC 0A write WSYNC $%02X\n", data));
- space->machine().device("maincpu")->execute().spin_until_trigger(TRIGGER_HSYNC);
+ space.machine().device("maincpu")->execute().spin_until_trigger(TRIGGER_HSYNC);
antic.w.wsync = 1;
break;
case 11:
diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c
index 7ce0e542056..976b098cdb8 100644
--- a/src/mame/video/artmagic.c
+++ b/src/mame/video/artmagic.c
@@ -57,18 +57,18 @@ void artmagic_state::video_start()
*
*************************************/
-void artmagic_to_shiftreg(address_space *space, offs_t address, UINT16 *data)
+void artmagic_to_shiftreg(address_space &space, offs_t address, UINT16 *data)
{
- artmagic_state *state = space->machine().driver_data<artmagic_state>();
+ artmagic_state *state = space.machine().driver_data<artmagic_state>();
UINT16 *vram = address_to_vram(state, &address);
if (vram)
memcpy(data, &vram[address], TOBYTE(0x2000));
}
-void artmagic_from_shiftreg(address_space *space, offs_t address, UINT16 *data)
+void artmagic_from_shiftreg(address_space &space, offs_t address, UINT16 *data)
{
- artmagic_state *state = space->machine().driver_data<artmagic_state>();
+ artmagic_state *state = space.machine().driver_data<artmagic_state>();
UINT16 *vram = address_to_vram(state, &address);
if (vram)
memcpy(&vram[address], data, TOBYTE(0x2000));
diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c
index 980f3e270ea..ebc04986ce9 100644
--- a/src/mame/video/astrocde.c
+++ b/src/mame/video/astrocde.c
@@ -740,9 +740,9 @@ INLINE void increment_dest(astrocde_state *state, UINT8 curwidth)
}
-static void execute_blit(address_space *space)
+static void execute_blit(address_space &space)
{
- astrocde_state *state = space->machine().driver_data<astrocde_state>();
+ astrocde_state *state = space.machine().driver_data<astrocde_state>();
/*
state->m_pattern_source = counter set U7/U16/U25/U34
state->m_pattern_dest = counter set U9/U18/U30/U39
@@ -795,7 +795,7 @@ static void execute_blit(address_space *space)
if (curwidth == 0 && (state->m_pattern_mode & 0x08) != 0)
busdata = 0;
else
- busdata = space->read_byte(busaddr);
+ busdata = space.read_byte(busaddr);
/* increment the appropriate address */
if ((state->m_pattern_mode & 0x01) == 0)
@@ -807,7 +807,7 @@ static void execute_blit(address_space *space)
/* address is selected between source/dest based on mode.d0 */
busaddr = ((state->m_pattern_mode & 0x01) != 0) ? state->m_pattern_source : state->m_pattern_dest;
- space->write_byte(busaddr, busdata);
+ space.write_byte(busaddr, busdata);
/* increment the appropriate address */
if ((state->m_pattern_mode & 0x01) == 0)
@@ -833,7 +833,7 @@ static void execute_blit(address_space *space)
} while (state->m_pattern_height-- != 0);
/* count cycles we ran the bus */
- space->device().execute().adjust_icount(-cycles);
+ space.device().execute().adjust_icount(-cycles);
}
@@ -868,7 +868,7 @@ WRITE8_MEMBER(astrocde_state::astrocade_pattern_board_w)
case 6: /* height of blit and initiator */
m_pattern_height = data;
- execute_blit(space.device().memory().space(AS_PROGRAM));
+ execute_blit(*space.device().memory().space(AS_PROGRAM));
break;
}
}
diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c
index c00a6dbe933..91010e7116c 100644
--- a/src/mame/video/atari.c
+++ b/src/mame/video/atari.c
@@ -1174,7 +1174,7 @@ static TIMER_CALLBACK( antic_steal_cycles )
*****************************************************************************/
static TIMER_CALLBACK( antic_scanline_render )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
VIDEO *video = antic.video[antic.scanline];
LOG((" @cycle #%3d render mode $%X lines to go #%d\n", cycle(machine), (antic.cmd & 0x0f), antic.modelines));
@@ -1244,7 +1244,7 @@ INLINE void LMS(running_machine &machine, int new_cmd)
**************************************************************/
if( new_cmd & ANTIC_LMS )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int addr = RDANTIC(space);
antic.doffs = (antic.doffs + 1) & DOFFS;
addr += 256 * RDANTIC(space);
@@ -1269,7 +1269,7 @@ INLINE void LMS(running_machine &machine, int new_cmd)
*****************************************************************************/
static void antic_scanline_dma(running_machine &machine, int param)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
LOG((" @cycle #%3d DMA fetch\n", cycle(machine)));
if (antic.scanline == VBL_END)
antic.r.nmist &= ~VBL_NMI;
diff --git a/src/mame/video/atarig1.c b/src/mame/video/atarig1.c
index 28ed4dc0d1d..40feff0426a 100644
--- a/src/mame/video/atarig1.c
+++ b/src/mame/video/atarig1.c
@@ -78,9 +78,9 @@ VIDEO_START_MEMBER(atarig1_state,atarig1)
WRITE16_HANDLER( atarig1_mo_control_w )
{
- atarig1_state *state = space->machine().driver_data<atarig1_state>();
+ atarig1_state *state = space.machine().driver_data<atarig1_state>();
- logerror("MOCONT = %d (scan = %d)\n", data, space->machine().primary_screen->vpos());
+ logerror("MOCONT = %d (scan = %d)\n", data, space.machine().primary_screen->vpos());
/* set the control value */
COMBINE_DATA(&state->m_current_control);
diff --git a/src/mame/video/atarig42.c b/src/mame/video/atarig42.c
index 2c7a57b51d9..2d4d757e9e1 100644
--- a/src/mame/video/atarig42.c
+++ b/src/mame/video/atarig42.c
@@ -99,9 +99,9 @@ VIDEO_START_MEMBER(atarig42_state,atarig42)
WRITE16_HANDLER( atarig42_mo_control_w )
{
- atarig42_state *state = space->machine().driver_data<atarig42_state>();
+ atarig42_state *state = space.machine().driver_data<atarig42_state>();
- logerror("MOCONT = %d (scan = %d)\n", data, space->machine().primary_screen->vpos());
+ logerror("MOCONT = %d (scan = %d)\n", data, space.machine().primary_screen->vpos());
/* set the control value */
COMBINE_DATA(&state->m_current_control);
diff --git a/src/mame/video/atarigx2.c b/src/mame/video/atarigx2.c
index 124b0e71e64..3c1064b4b2a 100644
--- a/src/mame/video/atarigx2.c
+++ b/src/mame/video/atarigx2.c
@@ -99,9 +99,9 @@ VIDEO_START_MEMBER(atarigx2_state,atarigx2)
WRITE16_HANDLER( atarigx2_mo_control_w )
{
- atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
+ atarigx2_state *state = space.machine().driver_data<atarigx2_state>();
- logerror("MOCONT = %d (scan = %d)\n", data, space->machine().primary_screen->vpos());
+ logerror("MOCONT = %d (scan = %d)\n", data, space.machine().primary_screen->vpos());
/* set the control value */
COMBINE_DATA(&state->m_current_control);
diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c
index a4c8ea38604..725eaf0a689 100644
--- a/src/mame/video/atarisy1.c
+++ b/src/mame/video/atarisy1.c
@@ -211,10 +211,10 @@ VIDEO_START_MEMBER(atarisy1_state,atarisy1)
WRITE16_HANDLER( atarisy1_bankselect_w )
{
- atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ atarisy1_state *state = space.machine().driver_data<atarisy1_state>();
UINT16 oldselect = *state->m_bankselect;
UINT16 newselect = oldselect, diff;
- int scanline = space->machine().primary_screen->vpos();
+ int scanline = space.machine().primary_screen->vpos();
/* update memory */
COMBINE_DATA(&newselect);
@@ -223,17 +223,17 @@ WRITE16_HANDLER( atarisy1_bankselect_w )
/* sound CPU reset */
if (diff & 0x0080)
{
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
- if (!(newselect & 0x0080)) atarigen_sound_reset(space->machine());
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
+ if (!(newselect & 0x0080)) atarigen_sound_reset(space.machine());
}
/* if MO or playfield banks change, force a partial update */
if (diff & 0x003c)
- space->machine().primary_screen->update_partial(scanline);
+ space.machine().primary_screen->update_partial(scanline);
/* motion object bank select */
atarimo_set_bank(0, (newselect >> 3) & 7);
- update_timers(space->machine(), scanline);
+ update_timers(space.machine(), scanline);
/* playfield bank select */
if (diff & 0x0004)
@@ -256,14 +256,14 @@ WRITE16_HANDLER( atarisy1_bankselect_w )
WRITE16_HANDLER( atarisy1_priority_w )
{
- atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ atarisy1_state *state = space.machine().driver_data<atarisy1_state>();
UINT16 oldpens = state->m_playfield_priority_pens;
UINT16 newpens = oldpens;
/* force a partial update in case this changes mid-screen */
COMBINE_DATA(&newpens);
if (oldpens != newpens)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
state->m_playfield_priority_pens = newpens;
}
@@ -277,14 +277,14 @@ WRITE16_HANDLER( atarisy1_priority_w )
WRITE16_HANDLER( atarisy1_xscroll_w )
{
- atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ atarisy1_state *state = space.machine().driver_data<atarisy1_state>();
UINT16 oldscroll = *state->m_xscroll;
UINT16 newscroll = oldscroll;
/* force a partial update in case this changes mid-screen */
COMBINE_DATA(&newscroll);
if (oldscroll != newscroll)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* set the new scroll value */
state->m_playfield_tilemap->set_scrollx(0, newscroll);
@@ -310,26 +310,26 @@ TIMER_DEVICE_CALLBACK( atarisy1_reset_yscroll_callback )
WRITE16_HANDLER( atarisy1_yscroll_w )
{
- atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ atarisy1_state *state = space.machine().driver_data<atarisy1_state>();
UINT16 oldscroll = *state->m_yscroll;
UINT16 newscroll = oldscroll;
- int scanline = space->machine().primary_screen->vpos();
+ int scanline = space.machine().primary_screen->vpos();
int adjusted_scroll;
/* force a partial update in case this changes mid-screen */
COMBINE_DATA(&newscroll);
- space->machine().primary_screen->update_partial(scanline);
+ space.machine().primary_screen->update_partial(scanline);
/* because this latches a new value into the scroll base,
we need to adjust for the scanline */
adjusted_scroll = newscroll;
- if (scanline <= space->machine().primary_screen->visible_area().max_y)
+ if (scanline <= space.machine().primary_screen->visible_area().max_y)
adjusted_scroll -= (scanline + 1);
state->m_playfield_tilemap->set_scrolly(0, adjusted_scroll);
/* but since we've adjusted it, we must reset it to the normal value
once we hit scanline 0 again */
- state->m_yscroll_reset_timer->adjust(space->machine().primary_screen->time_until_pos(0), newscroll);
+ state->m_yscroll_reset_timer->adjust(space.machine().primary_screen->time_until_pos(0), newscroll);
/* update the data */
*state->m_yscroll = newscroll;
@@ -359,7 +359,7 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
{
/* if the timer is in the active bank, update the display list */
atarimo_0_spriteram_w(space, offset, data, 0xffff);
- update_timers(space->machine(), space->machine().primary_screen->vpos());
+ update_timers(space.machine(), space.machine().primary_screen->vpos());
}
/* if we're about to modify data in the active sprite bank, make sure the video is up-to-date */
@@ -367,7 +367,7 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
/* renders the next scanline's sprites to the line buffers, but Road Runner still glitches */
/* without the extra +1 */
else
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() + 2);
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos() + 2);
}
/* let the MO handler do the basic work */
@@ -384,7 +384,7 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback )
{
- address_space *space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
/* clear the state */
atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
@@ -417,7 +417,7 @@ TIMER_DEVICE_CALLBACK( atarisy1_int3_callback )
READ16_HANDLER( atarisy1_int3state_r )
{
- atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
+ atarigen_state *atarigen = space.machine().driver_data<atarigen_state>();
return atarigen->m_scanline_int_state ? 0x0080 : 0x0000;
}
@@ -432,7 +432,7 @@ READ16_HANDLER( atarisy1_int3state_r )
static void update_timers(running_machine &machine, int scanline)
{
atarisy1_state *state = machine.driver_data<atarisy1_state>();
- address_space *space = NULL;
+ address_space &space = state->generic_space();
UINT16 mem_mask = 0xffff;
int offset = atarimo_get_bank(0) * 64 * 4;
int link = 0, best = scanline, found = 0;
diff --git a/src/mame/video/atarisy2.c b/src/mame/video/atarisy2.c
index 2ebdedb2368..2baead1cf85 100644
--- a/src/mame/video/atarisy2.c
+++ b/src/mame/video/atarisy2.c
@@ -126,14 +126,14 @@ VIDEO_START_MEMBER(atarisy2_state,atarisy2)
WRITE16_HANDLER( atarisy2_xscroll_w )
{
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
UINT16 oldscroll = *state->m_xscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* update the playfield scrolling - hscroll is clocked on the following scanline */
state->m_playfield_tilemap->set_scrollx(0, newscroll >> 6);
@@ -159,20 +159,20 @@ static TIMER_CALLBACK( reset_yscroll_callback )
WRITE16_HANDLER( atarisy2_yscroll_w )
{
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
UINT16 oldscroll = *state->m_yscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* if bit 4 is zero, the scroll value is clocked in right away */
if (!(newscroll & 0x10))
- state->m_playfield_tilemap->set_scrolly(0, (newscroll >> 6) - space->machine().primary_screen->vpos());
+ state->m_playfield_tilemap->set_scrolly(0, (newscroll >> 6) - space.machine().primary_screen->vpos());
else
- state->m_yscroll_reset_timer->adjust(space->machine().primary_screen->time_until_pos(0), newscroll >> 6);
+ state->m_yscroll_reset_timer->adjust(space.machine().primary_screen->time_until_pos(0), newscroll >> 6);
/* update the playfield banking */
if (state->m_playfield_tile_bank[1] != (newscroll & 0x0f) * 0x400)
@@ -210,7 +210,7 @@ WRITE16_HANDLER( atarisy2_paletteram_w )
int newword, inten, red, green, blue;
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
newword = state->m_generic_paletteram_16[offset];
@@ -218,7 +218,7 @@ WRITE16_HANDLER( atarisy2_paletteram_w )
red = (color_table[(newword >> 12) & 15] * inten) >> 4;
green = (color_table[(newword >> 8) & 15] * inten) >> 4;
blue = (color_table[(newword >> 4) & 15] * inten) >> 4;
- palette_set_color(space->machine(), offset, MAKE_RGB(red, green, blue));
+ palette_set_color(space.machine(), offset, MAKE_RGB(red, green, blue));
}
@@ -231,7 +231,7 @@ WRITE16_HANDLER( atarisy2_paletteram_w )
READ16_HANDLER( atarisy2_slapstic_r )
{
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
int result = state->m_slapstic_base[offset];
slapstic_tweak(space, offset);
@@ -243,7 +243,7 @@ READ16_HANDLER( atarisy2_slapstic_r )
WRITE16_HANDLER( atarisy2_slapstic_w )
{
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
slapstic_tweak(space, offset);
@@ -261,7 +261,7 @@ WRITE16_HANDLER( atarisy2_slapstic_w )
READ16_HANDLER( atarisy2_videoram_r )
{
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
int offs = offset | state->m_videobank;
if (offs >= 0xc00 && offs < 0x1000)
{
@@ -274,7 +274,7 @@ READ16_HANDLER( atarisy2_videoram_r )
WRITE16_HANDLER( atarisy2_videoram_w )
{
- atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ atarisy2_state *state = space.machine().driver_data<atarisy2_state>();
int offs = offset | state->m_videobank;
/* alpharam? */
@@ -289,7 +289,7 @@ WRITE16_HANDLER( atarisy2_videoram_w )
{
/* force an update if the link of object 0 is about to change */
if (offs == 0x0c03)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
atarimo_0_spriteram_w(space, offs - 0x0c00, data, mem_mask);
}
diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
index ede6285255b..46c7bb2d23e 100644
--- a/src/mame/video/avgdvg.c
+++ b/src/mame/video/avgdvg.c
@@ -1258,7 +1258,7 @@ WRITE8_HANDLER( avgdvg_go_w )
*/
vector_clear_list();
}
- vg_flush(space->machine());
+ vg_flush(space.machine());
vg_set_halt(0);
vg_run_timer->adjust(attotime::zero);
@@ -1289,7 +1289,7 @@ WRITE16_HANDLER( avgdvg_reset_word_w )
MACHINE_RESET( avgdvg )
{
- avgdvg_reset_w (machine.device("maincpu")->memory().space(AS_PROGRAM),0,0);
+ avgdvg_reset_w (*machine.device("maincpu")->memory().space(AS_PROGRAM),0,0);
}
diff --git a/src/mame/video/badlands.c b/src/mame/video/badlands.c
index 2f04918ef75..6edfa50e3d2 100644
--- a/src/mame/video/badlands.c
+++ b/src/mame/video/badlands.c
@@ -91,11 +91,11 @@ VIDEO_START_MEMBER(badlands_state,badlands)
WRITE16_HANDLER( badlands_pf_bank_w )
{
- badlands_state *state = space->machine().driver_data<badlands_state>();
+ badlands_state *state = space.machine().driver_data<badlands_state>();
if (ACCESSING_BITS_0_7)
if (state->m_playfield_tile_bank != (data & 1))
{
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
state->m_playfield_tile_bank = data & 1;
state->m_playfield_tilemap->mark_all_dirty();
}
diff --git a/src/mame/video/baraduke.c b/src/mame/video/baraduke.c
index a69cee19283..a4641603fbc 100644
--- a/src/mame/video/baraduke.c
+++ b/src/mame/video/baraduke.c
@@ -158,9 +158,9 @@ WRITE8_MEMBER(baraduke_state::baraduke_textram_w)
}
-static void scroll_w(address_space *space, int layer, int offset, int data)
+static void scroll_w(address_space &space, int layer, int offset, int data)
{
- baraduke_state *state = space->machine().driver_data<baraduke_state>();
+ baraduke_state *state = space.machine().driver_data<baraduke_state>();
switch (offset)
{
case 0: /* high scroll x */
@@ -177,11 +177,11 @@ static void scroll_w(address_space *space, int layer, int offset, int data)
WRITE8_MEMBER(baraduke_state::baraduke_scroll0_w)
{
- scroll_w(&space, 0, offset, data);
+ scroll_w(space, 0, offset, data);
}
WRITE8_MEMBER(baraduke_state::baraduke_scroll1_w)
{
- scroll_w(&space, 1, offset, data);
+ scroll_w(space, 1, offset, data);
}
diff --git a/src/mame/video/bfm_adr2.c b/src/mame/video/bfm_adr2.c
index e4e2febb1a3..028ff43505f 100644
--- a/src/mame/video/bfm_adr2.c
+++ b/src/mame/video/bfm_adr2.c
@@ -280,7 +280,7 @@ static WRITE8_HANDLER( screen_ram_w )
r = ((data & 0x18)>>3) * 85; // 00011000b = 0x18
g = ((data & 0x06)>>1) * 85; // 00000110b = 0x06
b = ((data & 0x01) ) * 255;
- palette_set_color(space->machine(), pal, MAKE_RGB(r,g,b));
+ palette_set_color(space.machine(), pal, MAKE_RGB(r,g,b));
}
if ( adder2_screen_page_reg & SL_ACCESS )
@@ -314,7 +314,7 @@ static WRITE8_HANDLER( normal_ram_w )
static WRITE8_HANDLER( adder2_rom_page_w )
{
- space->machine().root_device().membank("bank2")->set_entry(data&0x03);
+ space.machine().root_device().membank("bank2")->set_entry(data&0x03);
}
///////////////////////////////////////////////////////////////////////////
diff --git a/src/mame/video/bfm_dm01.c b/src/mame/video/bfm_dm01.c
index 4750f91b01a..61c28da3d2d 100644
--- a/src/mame/video/bfm_dm01.c
+++ b/src/mame/video/bfm_dm01.c
@@ -119,7 +119,7 @@ static WRITE8_HANDLER( control_w )
if ( data & 8 ) dm01.busy = 0;
else dm01.busy = 1;
- dm01.intf->busy_func(space->machine(),dm01.busy);
+ dm01.intf->busy_func(space.machine(),dm01.busy);
}
}
@@ -209,7 +209,7 @@ static READ8_HANDLER( unknown_r )
static WRITE8_HANDLER( unknown_w )
{
- space->machine().device("matrix")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE ); //?
+ space.machine().device("matrix")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE ); //?
}
///////////////////////////////////////////////////////////////////////////
diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c
index 0586dfadae8..fcaf790ce22 100644
--- a/src/mame/video/blstroid.c
+++ b/src/mame/video/blstroid.c
@@ -89,7 +89,7 @@ VIDEO_START_MEMBER(blstroid_state,blstroid)
static TIMER_CALLBACK( irq_off )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* clear the interrupt */
atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c
index e4657df0a41..605a727c33b 100644
--- a/src/mame/video/bosco.c
+++ b/src/mame/video/bosco.c
@@ -155,7 +155,7 @@ VIDEO_START_MEMBER(bosco_state,bosco)
WRITE8_HANDLER( bosco_videoram_w )
{
- bosco_state *state = space->machine().driver_data<bosco_state>();
+ bosco_state *state = space.machine().driver_data<bosco_state>();
state->m_videoram[offset] = data;
if (offset & 0x400)
@@ -166,14 +166,14 @@ WRITE8_HANDLER( bosco_videoram_w )
WRITE8_HANDLER( bosco_scrollx_w )
{
- bosco_state *state = space->machine().driver_data<bosco_state>();
+ bosco_state *state = space.machine().driver_data<bosco_state>();
state->m_bg_tilemap->set_scrollx(0,data);
}
WRITE8_HANDLER( bosco_scrolly_w )
{
- bosco_state *state = space->machine().driver_data<bosco_state>();
+ bosco_state *state = space.machine().driver_data<bosco_state>();
state->m_bg_tilemap->set_scrolly(0,data);
}
diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c
index 65d933cbe1b..065ff09074c 100644
--- a/src/mame/video/btoads.c
+++ b/src/mame/video/btoads.c
@@ -257,7 +257,7 @@ void btoads_state::render_sprite_row(UINT16 *sprite_source, UINT32 address)
*
*************************************/
-void btoads_state::to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void btoads_state::to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
address &= ~0x40000000;
@@ -284,7 +284,7 @@ void btoads_state::to_shiftreg(address_space *space, UINT32 address, UINT16 *shi
}
-void btoads_state::from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void btoads_state::from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
address &= ~0x40000000;
diff --git a/src/mame/video/capbowl.c b/src/mame/video/capbowl.c
index aa3bc93d0b7..f98f59c97d6 100644
--- a/src/mame/video/capbowl.c
+++ b/src/mame/video/capbowl.c
@@ -63,7 +63,7 @@ WRITE8_MEMBER(capbowl_state::capbowl_tms34061_w)
col ^= 2;
/* Row address (RA0-RA8) is not dependent on the offset */
- tms34061_w(&space, col, *m_rowaddress, func, data);
+ tms34061_w(space, col, *m_rowaddress, func, data);
}
@@ -78,7 +78,7 @@ READ8_MEMBER(capbowl_state::capbowl_tms34061_r)
col ^= 2;
/* Row address (RA0-RA8) is not dependent on the offset */
- return tms34061_r(&space, col, *m_rowaddress, func);
+ return tms34061_r(space, col, *m_rowaddress, func);
}
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index 333a2f93f70..ed3ccdaee3b 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -295,9 +295,9 @@ TILE_GET_INFO_MEMBER(cave_state::sailormn_get_tile_info_2)
}
-INLINE void vram_w( address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask, int GFX )
+INLINE void vram_w( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask, int GFX )
{
- cave_state *state = space->machine().driver_data<cave_state>();
+ cave_state *state = space.machine().driver_data<cave_state>();
UINT16 *VRAM = state->m_vram[GFX];
tilemap_t *TILEMAP = state->m_tilemap[GFX];
@@ -323,9 +323,9 @@ INLINE void vram_w( address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED
and 408000-407fff both go to the 8x8 tilemap ram. Use this function
in this cases. Note that the get_tile_info function looks in the
4000-7fff range for tiles, so we have to write the data there. */
-INLINE void vram_8x8_w( address_space *space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask, int GFX )
+INLINE void vram_8x8_w( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask, int GFX )
{
- cave_state *state = space->machine().driver_data<cave_state>();
+ cave_state *state = space.machine().driver_data<cave_state>();
UINT16 *VRAM = state->m_vram[GFX];
tilemap_t *TILEMAP = state->m_tilemap[GFX];
@@ -344,15 +344,15 @@ TILE_GET_INFO_MEMBER(cave_state::get_tile_info_1){ get_tile_info(machine(), tile
TILE_GET_INFO_MEMBER(cave_state::get_tile_info_2){ get_tile_info(machine(), tileinfo, tile_index, 2); }
TILE_GET_INFO_MEMBER(cave_state::get_tile_info_3){ get_tile_info(machine(), tileinfo, tile_index, 3); }
-WRITE16_MEMBER(cave_state::cave_vram_0_w){ vram_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(cave_state::cave_vram_1_w){ vram_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(cave_state::cave_vram_2_w){ vram_w(&space, offset, data, mem_mask, 2); }
-WRITE16_MEMBER(cave_state::cave_vram_3_w){ vram_w(&space, offset, data, mem_mask, 3); }
+WRITE16_MEMBER(cave_state::cave_vram_0_w){ vram_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(cave_state::cave_vram_1_w){ vram_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(cave_state::cave_vram_2_w){ vram_w(space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(cave_state::cave_vram_3_w){ vram_w(space, offset, data, mem_mask, 3); }
-WRITE16_MEMBER(cave_state::cave_vram_0_8x8_w){ vram_8x8_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(cave_state::cave_vram_1_8x8_w){ vram_8x8_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(cave_state::cave_vram_2_8x8_w){ vram_8x8_w(&space, offset, data, mem_mask, 2); }
-WRITE16_MEMBER(cave_state::cave_vram_3_8x8_w){ vram_8x8_w(&space, offset, data, mem_mask, 3); }
+WRITE16_MEMBER(cave_state::cave_vram_0_8x8_w){ vram_8x8_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(cave_state::cave_vram_1_8x8_w){ vram_8x8_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(cave_state::cave_vram_2_8x8_w){ vram_8x8_w(space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(cave_state::cave_vram_3_8x8_w){ vram_8x8_w(space, offset, data, mem_mask, 3); }
/***************************************************************************
diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c
index 5033cc0bf17..9fac86ab3a8 100644
--- a/src/mame/video/cischeat.c
+++ b/src/mame/video/cischeat.c
@@ -129,9 +129,9 @@ static void prepare_shadows(cischeat_state *state)
#define TILES_PER_PAGE_Y (0x20)
#define TILES_PER_PAGE (TILES_PER_PAGE_X * TILES_PER_PAGE_Y)
-INLINE void scrollram_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
+INLINE void scrollram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
{
- cischeat_state *state = space->machine().driver_data<cischeat_state>();
+ cischeat_state *state = space.machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->m_scrollram[which][offset]);
if (offset < 0x40000/2 && state->m_tmap[which])
{
@@ -149,9 +149,9 @@ INLINE void scrollram_w(address_space *space, offs_t offset, UINT16 data, UINT16
}
}
-WRITE16_MEMBER(cischeat_state::cischeat_scrollram_0_w){ scrollram_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(cischeat_state::cischeat_scrollram_1_w){ scrollram_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(cischeat_state::cischeat_scrollram_2_w){ scrollram_w(&space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(cischeat_state::cischeat_scrollram_0_w){ scrollram_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(cischeat_state::cischeat_scrollram_1_w){ scrollram_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(cischeat_state::cischeat_scrollram_2_w){ scrollram_w(space, offset, data, mem_mask, 2); }
TILEMAP_MAPPER_MEMBER(cischeat_state::cischeat_scan_8x8)
{
@@ -1423,13 +1423,13 @@ if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input(
if (msk != 0) state->m_active_layers &= msk;
#if 1
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
popmessage("Cmd: %04X Pos:%04X Lim:%04X Inp:%04X",
state->m_scudhamm_motor_command,
- state->scudhamm_motor_pos_r(*space,0,0xffff),
- state->scudhamm_motor_status_r(*space,0,0xffff),
- state->scudhamm_analog_r(*space,0,0xffff) );
+ state->scudhamm_motor_pos_r(space,0,0xffff),
+ state->scudhamm_motor_status_r(space,0,0xffff),
+ state->scudhamm_analog_r(space,0,0xffff) );
}
#endif
diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c
index aa4d9688f8b..36c4f23928b 100644
--- a/src/mame/video/combatsc.c
+++ b/src/mame/video/combatsc.c
@@ -508,10 +508,10 @@ byte #4:
static void bootleg_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
gfx_element *gfx = machine.gfx[circuit + 2];
- int limit = circuit ? (space->read_byte(0xc2) * 256 + space->read_byte(0xc3)) : (space->read_byte(0xc0) * 256 + space->read_byte(0xc1));
+ int limit = circuit ? (space.read_byte(0xc2) * 256 + space.read_byte(0xc3)) : (space.read_byte(0xc0) * 256 + space.read_byte(0xc1));
const UINT8 *finish;
source += 0x1000;
diff --git a/src/mame/video/cyberbal.c b/src/mame/video/cyberbal.c
index e7be8e54fba..02b2c8168d4 100644
--- a/src/mame/video/cyberbal.c
+++ b/src/mame/video/cyberbal.c
@@ -223,28 +223,28 @@ INLINE void set_palette_entry(running_machine &machine, int entry, UINT16 value)
WRITE16_HANDLER( cyberbal_paletteram_0_w )
{
- cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
COMBINE_DATA(&state->m_paletteram_0[offset]);
- set_palette_entry(space->machine(), offset, state->m_paletteram_0[offset]);
+ set_palette_entry(space.machine(), offset, state->m_paletteram_0[offset]);
}
READ16_HANDLER( cyberbal_paletteram_0_r )
{
- cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
return state->m_paletteram_0[offset];
}
WRITE16_HANDLER( cyberbal_paletteram_1_w )
{
- cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
COMBINE_DATA(&state->m_paletteram_1[offset]);
- set_palette_entry(space->machine(), offset + 0x800, state->m_paletteram_1[offset]);
+ set_palette_entry(space.machine(), offset + 0x800, state->m_paletteram_1[offset]);
}
READ16_HANDLER( cyberbal_paletteram_1_r )
{
- cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ cyberbal_state *state = space.machine().driver_data<cyberbal_state>();
return state->m_paletteram_1[offset];
}
diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c
index 2aba2cf3f88..9181e476aec 100644
--- a/src/mame/video/dc.c
+++ b/src/mame/video/dc.c
@@ -129,7 +129,7 @@ static UINT32 dilated0[15][1024];
static UINT32 dilated1[15][1024];
static int dilatechose[64];
static float wbuffer[480][640];
-static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,int y);
+static void pvr_accumulationbuffer_to_framebuffer(address_space &space, int x,int y);
// the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer
// our implementation is not currently tile based, and thus the accumulation buffer is screen sized
@@ -981,7 +981,7 @@ INLINE int decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
READ64_HANDLER( pvr_ta_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
@@ -993,19 +993,19 @@ READ64_HANDLER( pvr_ta_r )
{
UINT8 fieldnum,vsync,hsync,blank;
- fieldnum = (space->machine().primary_screen->frame_number() & 1) ? 1 : 0;
+ fieldnum = (space.machine().primary_screen->frame_number() & 1) ? 1 : 0;
- vsync = space->machine().primary_screen->vblank() ? 1 : 0;
+ vsync = space.machine().primary_screen->vblank() ? 1 : 0;
if(spg_vsync_pol) { vsync^=1; }
- hsync = space->machine().primary_screen->hblank() ? 1 : 0;
+ hsync = space.machine().primary_screen->hblank() ? 1 : 0;
if(spg_hsync_pol) { hsync^=1; }
/* FIXME: following is just a wild guess */
- blank = (space->machine().primary_screen->vblank() | space->machine().primary_screen->hblank()) ? 0 : 1;
+ blank = (space.machine().primary_screen->vblank() | space.machine().primary_screen->hblank()) ? 0 : 1;
if(spg_blank_pol) { blank^=1; }
- state->pvrta_regs[reg] = (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (space->machine().primary_screen->vpos() & 0x3ff);
+ state->pvrta_regs[reg] = (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (space.machine().primary_screen->vpos() & 0x3ff);
break;
}
case SPG_TRIGGER_POS:
@@ -1017,14 +1017,14 @@ READ64_HANDLER( pvr_ta_r )
#if DEBUG_PVRTA_REGS
if (reg != 0x43)
- mame_printf_verbose("PVRTA: [%08x] read %x @ %x (reg %x), mask %" I64FMT "x (PC=%x)\n", 0x5f8000+reg*4, state->pvrta_regs[reg], offset, reg, mem_mask, space->device().safe_pc());
+ mame_printf_verbose("PVRTA: [%08x] read %x @ %x (reg %x), mask %" I64FMT "x (PC=%x)\n", 0x5f8000+reg*4, state->pvrta_regs[reg], offset, reg, mem_mask, space.device().safe_pc());
#endif
return (UINT64)state->pvrta_regs[reg] << shift;
}
WRITE64_HANDLER( pvr_ta_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat;
@@ -1099,7 +1099,7 @@ WRITE64_HANDLER( pvr_ta_w )
// we've got a request to draw, so, draw to the accumulation buffer!
// this should really be done for each tile!
- render_to_accumulation_buffer(space->machine(),*fake_accumulationbuffer_bitmap,clip);
+ render_to_accumulation_buffer(space.machine(),*fake_accumulationbuffer_bitmap,clip);
state->endofrender_timer_isp->adjust(attotime::from_usec(4000) ); // hack, make sure render takes some amount of time
@@ -1118,15 +1118,15 @@ WRITE64_HANDLER( pvr_ta_w )
{
UINT32 st[6];
- st[0]=space->read_dword((0x05000000+offsetra));
- st[1]=space->read_dword((0x05000004+offsetra)); // Opaque List Pointer
- st[2]=space->read_dword((0x05000008+offsetra)); // Opaque Modifier Volume List Pointer
- st[3]=space->read_dword((0x0500000c+offsetra)); // Translucent List Pointer
- st[4]=space->read_dword((0x05000010+offsetra)); // Translucent Modifier Volume List Pointer
+ st[0]=space.read_dword((0x05000000+offsetra));
+ st[1]=space.read_dword((0x05000004+offsetra)); // Opaque List Pointer
+ st[2]=space.read_dword((0x05000008+offsetra)); // Opaque Modifier Volume List Pointer
+ st[3]=space.read_dword((0x0500000c+offsetra)); // Translucent List Pointer
+ st[4]=space.read_dword((0x05000010+offsetra)); // Translucent Modifier Volume List Pointer
if (sizera == 6)
{
- st[5] = space->read_dword((0x05000014+offsetra)); // Punch Through List Pointer
+ st[5] = space.read_dword((0x05000014+offsetra)); // Punch Through List Pointer
offsetra+=0x18;
}
else
@@ -1241,7 +1241,7 @@ WRITE64_HANDLER( pvr_ta_w )
// hack, this interrupt is generated after transfering a set amount of data
//state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV;
- //dc_update_interrupt_status(space->machine());
+ //dc_update_interrupt_status(space.machine());
break;
case TA_YUV_TEX_CTRL:
@@ -1253,8 +1253,8 @@ WRITE64_HANDLER( pvr_ta_w )
state->vbin_timer->adjust(attotime::never);
state->vbout_timer->adjust(attotime::never);
- state->vbin_timer->adjust(space->machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
- state->vbout_timer->adjust(space->machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
+ state->vbin_timer->adjust(space.machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
+ state->vbout_timer->adjust(space.machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
break;
/* TODO: timer adjust for SPG_HBLANK_INT too */
case TA_LIST_CONT:
@@ -1273,7 +1273,7 @@ WRITE64_HANDLER( pvr_ta_w )
case VO_STARTX:
case VO_STARTY:
{
- rectangle visarea = space->machine().primary_screen->visible_area();
+ rectangle visarea = space.machine().primary_screen->visible_area();
/* FIXME: right visible area calculations aren't known yet*/
visarea.min_x = 0;
visarea.max_x = ((spg_hbstart - spg_hbend - vo_horz_start_pos) <= 0x180 ? 320 : 640) - 1;
@@ -1281,7 +1281,7 @@ WRITE64_HANDLER( pvr_ta_w )
visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1;
- space->machine().primary_screen->configure(spg_hbstart, spg_vbstart, visarea, space->machine().primary_screen->frame_period().attoseconds );
+ space.machine().primary_screen->configure(spg_hbstart, spg_vbstart, visarea, space.machine().primary_screen->frame_period().attoseconds );
}
break;
}
@@ -1628,7 +1628,7 @@ static void process_ta_fifo(running_machine& machine)
WRITE64_HANDLER( ta_fifo_poly_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
if (mem_mask == U64(0xffffffffffffffff)) // 64 bit
{
@@ -1648,13 +1648,13 @@ WRITE64_HANDLER( ta_fifo_poly_w )
// if the command is complete, process it
if (state_ta.tafifo_pos == 0)
- process_ta_fifo(space->machine());
+ process_ta_fifo(space.machine());
}
WRITE64_HANDLER( ta_fifo_yuv_w )
{
- //dc_state *state = space->machine().driver_data<dc_state>();
+ //dc_state *state = space.machine().driver_data<dc_state>();
// int reg;
// UINT64 shift;
@@ -1975,7 +1975,7 @@ static void render_tri(running_machine &machine, bitmap_rgb32 &bitmap, texinfo *
static void render_to_accumulation_buffer(running_machine &machine,bitmap_rgb32 &bitmap,const rectangle &cliprect)
{
dc_state *state = machine.driver_data<dc_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int cs,rs,ns;
UINT32 c;
#if 0
@@ -1992,7 +1992,7 @@ static void render_to_accumulation_buffer(running_machine &machine,bitmap_rgb32
rs=state_ta.renderselect;
c=state->pvrta_regs[ISP_BACKGND_T];
- c=space->read_dword(0x05000000+((c&0xfffff8)>>1)+(3+3)*4);
+ c=space.read_dword(0x05000000+((c&0xfffff8)>>1)+(3+3)*4);
bitmap.fill(c, cliprect);
@@ -2045,9 +2045,9 @@ static void render_to_accumulation_buffer(running_machine &machine,bitmap_rgb32
*/
-static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,int y)
+static void pvr_accumulationbuffer_to_framebuffer(address_space &space, int x,int y)
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
// the accumulation buffer is always 8888
//
@@ -2083,7 +2083,7 @@ static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,in
((((data & 0x0000f800) >> 11)) << 5) |
((((data & 0x00f80000) >> 19)) << 10);
- space->write_word(realwriteoffs+xcnt*2, newdat);
+ space.write_word(realwriteoffs+xcnt*2, newdat);
}
}
}
@@ -2107,7 +2107,7 @@ static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,in
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
- space->write_word(realwriteoffs+xcnt*2, newdat);
+ space.write_word(realwriteoffs+xcnt*2, newdat);
}
}
}
@@ -2135,7 +2135,7 @@ static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,in
((((data & 0x00f80000) >> 19)) << 10);
// alpha?
- space->write_word(realwriteoffs+xcnt*2, newdat);
+ space.write_word(realwriteoffs+xcnt*2, newdat);
}
}
}
@@ -2159,7 +2159,7 @@ static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,in
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
- space->write_word(realwriteoffs+xcnt*2, newdat);
+ space.write_word(realwriteoffs+xcnt*2, newdat);
}
}
}
@@ -2186,7 +2186,7 @@ static void pvr_accumulationbuffer_to_framebuffer(address_space *space, int x,in
((((data & 0x0000fc00) >> 10)) << 5) |
((((data & 0x00f80000) >> 19)) << 11);
- space->write_word(realwriteoffs+xcnt*2, newdat);
+ space.write_word(realwriteoffs+xcnt*2, newdat);
}
}
}
@@ -2741,7 +2741,7 @@ READ32_HANDLER( elan_regs_r )
case 0x78/4: // IRQ MASK
return 0;
default:
- printf("%08x %08x\n",space->device().safe_pc(),offset*4);
+ printf("%08x %08x\n",space.device().safe_pc(),offset*4);
break;
}
@@ -2753,7 +2753,7 @@ WRITE32_HANDLER( elan_regs_w )
switch(offset)
{
default:
- printf("%08x %08x %08x W\n",space->device().safe_pc(),offset*4,data);
+ printf("%08x %08x %08x W\n",space.device().safe_pc(),offset*4,data);
break;
}
}
diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c
index 13aa5d654c7..4260ee270ce 100644
--- a/src/mame/video/decocass.c
+++ b/src/mame/video/decocass.c
@@ -177,30 +177,30 @@ WRITE8_HANDLER( decocass_paletteram_w )
* (ME/ input on 1st paletteram, inverter -> ME/ on 2nd)
*/
offset = (offset & 31) ^ 16;
- colortable_palette_set_color(space->machine().colortable, offset, MAKE_RGB(pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)));
+ colortable_palette_set_color(space.machine().colortable, offset, MAKE_RGB(pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)));
}
WRITE8_HANDLER( decocass_charram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_charram[offset] = data;
/* dirty sprite */
- space->machine().gfx[1]->mark_dirty((offset >> 5) & 255);
+ space.machine().gfx[1]->mark_dirty((offset >> 5) & 255);
/* dirty char */
- space->machine().gfx[0]->mark_dirty((offset >> 3) & 1023);
+ space.machine().gfx[0]->mark_dirty((offset >> 3) & 1023);
}
WRITE8_HANDLER( decocass_fgvideoram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_fgvideoram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset);
}
WRITE8_HANDLER( decocass_colorram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_colorram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset);
}
@@ -216,49 +216,49 @@ static void mark_bg_tile_dirty( running_machine &machine, offs_t offset )
WRITE8_HANDLER( decocass_tileram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_tileram[offset] = data;
/* dirty tile (64 bytes per tile) */
- space->machine().gfx[2]->mark_dirty((offset / 64) & 15);
+ space.machine().gfx[2]->mark_dirty((offset / 64) & 15);
/* first 1KB of tile RAM is shared with tilemap RAM */
if (offset < state->m_bgvideoram_size)
- mark_bg_tile_dirty(space->machine(), offset);
+ mark_bg_tile_dirty(space.machine(), offset);
}
WRITE8_HANDLER( decocass_objectram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_objectram[offset] = data;
/* dirty the object */
- space->machine().gfx[3]->mark_dirty(0);
- space->machine().gfx[3]->mark_dirty(1);
+ space.machine().gfx[3]->mark_dirty(0);
+ space.machine().gfx[3]->mark_dirty(1);
}
WRITE8_HANDLER( decocass_bgvideoram_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
state->m_bgvideoram[offset] = data;
- mark_bg_tile_dirty(space->machine(), offset);
+ mark_bg_tile_dirty(space.machine(), offset);
}
/* The watchdog is a 4bit counter counting down every frame */
WRITE8_HANDLER( decocass_watchdog_count_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
LOG(1,("decocass_watchdog_count_w: $%02x\n", data));
state->m_watchdog_count = data & 0x0f;
}
WRITE8_HANDLER( decocass_watchdog_flip_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
LOG(1,("decocass_watchdog_flip_w: $%02x\n", data));
state->m_watchdog_flip = data;
}
WRITE8_HANDLER( decocass_color_missiles_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
LOG(1,("decocass_color_missiles_w: $%02x\n", data));
/* only bits D0-D2 and D4-D6 are connected to
* the color RAM demux:
@@ -280,7 +280,7 @@ WRITE8_HANDLER( decocass_color_missiles_w )
*/
WRITE8_HANDLER( decocass_mode_set_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_mode_set)
return;
LOG(1,("decocass_mode_set_w: $%02x (%s%s%s%s%s%s%s%s)\n", data,
@@ -298,7 +298,7 @@ WRITE8_HANDLER( decocass_mode_set_w )
WRITE8_HANDLER( decocass_color_center_bot_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_color_center_bot)
return;
LOG(1,("decocass_color_center_bot_w: $%02x (color:%d, center_bot:%d)\n", data, data & 3, data >> 4));
@@ -325,7 +325,7 @@ WRITE8_HANDLER( decocass_color_center_bot_w )
WRITE8_HANDLER( decocass_back_h_shift_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_back_h_shift)
return;
LOG(1,("decocass_back_h_shift_w: $%02x\n", data));
@@ -334,7 +334,7 @@ WRITE8_HANDLER( decocass_back_h_shift_w )
WRITE8_HANDLER( decocass_back_vl_shift_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_back_vl_shift)
return;
LOG(1,("decocass_back_vl_shift_w: $%02x\n", data));
@@ -343,7 +343,7 @@ WRITE8_HANDLER( decocass_back_vl_shift_w )
WRITE8_HANDLER( decocass_back_vr_shift_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_back_vr_shift)
return;
LOG(1,("decocass_back_vr_shift_w: $%02x\n", data));
@@ -352,7 +352,7 @@ WRITE8_HANDLER( decocass_back_vr_shift_w )
WRITE8_HANDLER( decocass_part_h_shift_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_part_v_shift )
return;
LOG(1,("decocass_part_h_shift_w: $%02x\n", data));
@@ -361,7 +361,7 @@ WRITE8_HANDLER( decocass_part_h_shift_w )
WRITE8_HANDLER( decocass_part_v_shift_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_part_v_shift )
return;
LOG(1,("decocass_part_v_shift_w: $%02x\n", data));
@@ -370,7 +370,7 @@ WRITE8_HANDLER( decocass_part_v_shift_w )
WRITE8_HANDLER( decocass_center_h_shift_space_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
if (data == state->m_center_h_shift_space)
return;
LOG(1,("decocass_center_h_shift_space_w: $%02x\n", data));
@@ -379,7 +379,7 @@ WRITE8_HANDLER( decocass_center_h_shift_space_w )
WRITE8_HANDLER( decocass_center_v_shift_w )
{
- decocass_state *state = space->machine().driver_data<decocass_state>();
+ decocass_state *state = space.machine().driver_data<decocass_state>();
LOG(1,("decocass_center_v_shift_w: $%02x\n", data));
state->m_center_v_shift = data;
}
diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c
index 45b33ab5d4c..2422666a6f3 100644
--- a/src/mame/video/digdug.c
+++ b/src/mame/video/digdug.c
@@ -165,7 +165,7 @@ VIDEO_START_MEMBER(digdug_state,digdug)
WRITE8_HANDLER( digdug_videoram_w )
{
- digdug_state *state = space->machine().driver_data<digdug_state>();
+ digdug_state *state = space.machine().driver_data<digdug_state>();
state->m_videoram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
@@ -173,7 +173,7 @@ WRITE8_HANDLER( digdug_videoram_w )
WRITE8_HANDLER( digdug_PORT_w )
{
- digdug_state *state = space->machine().driver_data<digdug_state>();
+ digdug_state *state = space.machine().driver_data<digdug_state>();
switch (offset)
{
diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c
index c208164e135..12c5758a47b 100644
--- a/src/mame/video/dogfgt.c
+++ b/src/mame/video/dogfgt.c
@@ -216,13 +216,13 @@ SCREEN_UPDATE_IND16( dogfgt )
if (state->m_lastflip != state->flip_screen() || state->m_lastpixcolor != state->m_pixcolor)
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
state->m_lastflip = state->flip_screen();
state->m_lastpixcolor = state->m_pixcolor;
for (offs = 0; offs < BITMAPRAM_SIZE; offs++)
- state->internal_bitmapram_w(*space, offs, state->m_bitmapram[offs]);
+ state->internal_bitmapram_w(space, offs, state->m_bitmapram[offs]);
}
diff --git a/src/mame/video/exterm.c b/src/mame/video/exterm.c
index 9bb3e31c3e2..204bc11364e 100644
--- a/src/mame/video/exterm.c
+++ b/src/mame/video/exterm.c
@@ -32,30 +32,30 @@ void exterm_state::palette_init()
*
*************************************/
-void exterm_to_shiftreg_master(address_space *space, UINT32 address, UINT16 *shiftreg)
+void exterm_to_shiftreg_master(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine().driver_data<exterm_state>();
+ exterm_state *state = space.machine().driver_data<exterm_state>();
memcpy(shiftreg, &state->m_master_videoram[TOWORD(address)], 256 * sizeof(UINT16));
}
-void exterm_from_shiftreg_master(address_space *space, UINT32 address, UINT16 *shiftreg)
+void exterm_from_shiftreg_master(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine().driver_data<exterm_state>();
+ exterm_state *state = space.machine().driver_data<exterm_state>();
memcpy(&state->m_master_videoram[TOWORD(address)], shiftreg, 256 * sizeof(UINT16));
}
-void exterm_to_shiftreg_slave(address_space *space, UINT32 address, UINT16 *shiftreg)
+void exterm_to_shiftreg_slave(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine().driver_data<exterm_state>();
+ exterm_state *state = space.machine().driver_data<exterm_state>();
memcpy(shiftreg, &state->m_slave_videoram[TOWORD(address)], 256 * 2 * sizeof(UINT8));
}
-void exterm_from_shiftreg_slave(address_space *space, UINT32 address, UINT16 *shiftreg)
+void exterm_from_shiftreg_slave(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine().driver_data<exterm_state>();
+ exterm_state *state = space.machine().driver_data<exterm_state>();
memcpy(&state->m_slave_videoram[TOWORD(address)], shiftreg, 256 * 2 * sizeof(UINT8));
}
diff --git a/src/mame/video/fastfred.c b/src/mame/video/fastfred.c
index 5ea45171e92..8e7a53242e3 100644
--- a/src/mame/video/fastfred.c
+++ b/src/mame/video/fastfred.c
@@ -115,7 +115,7 @@ VIDEO_START_MEMBER(fastfred_state,fastfred)
WRITE8_HANDLER( fastfred_videoram_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
state->m_videoram[offset] = data;
state->m_bg_tilemap->mark_tile_dirty(offset);
}
@@ -123,7 +123,7 @@ WRITE8_HANDLER( fastfred_videoram_w )
WRITE8_HANDLER( fastfred_attributes_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
if (state->m_attributesram[offset] != data)
{
if (offset & 0x01)
@@ -147,7 +147,7 @@ WRITE8_HANDLER( fastfred_attributes_w )
WRITE8_HANDLER( fastfred_charbank1_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
UINT16 new_data = (state->m_charbank & 0x0200) | ((data & 0x01) << 8);
if (new_data != state->m_charbank)
@@ -160,7 +160,7 @@ WRITE8_HANDLER( fastfred_charbank1_w )
WRITE8_HANDLER( fastfred_charbank2_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
UINT16 new_data = (state->m_charbank & 0x0100) | ((data & 0x01) << 9);
if (new_data != state->m_charbank)
@@ -174,7 +174,7 @@ WRITE8_HANDLER( fastfred_charbank2_w )
WRITE8_HANDLER( fastfred_colorbank1_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
UINT8 new_data = (state->m_colorbank & 0x10) | ((data & 0x01) << 3);
if (new_data != state->m_colorbank)
@@ -187,7 +187,7 @@ WRITE8_HANDLER( fastfred_colorbank1_w )
WRITE8_HANDLER( fastfred_colorbank2_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
UINT8 new_data = (state->m_colorbank & 0x08) | ((data & 0x01) << 4);
if (new_data != state->m_colorbank)
@@ -202,7 +202,7 @@ WRITE8_HANDLER( fastfred_colorbank2_w )
WRITE8_HANDLER( fastfred_flip_screen_x_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
if (state->flip_screen_x() != (data & 0x01))
{
state->flip_screen_x_set(data & 0x01);
@@ -213,7 +213,7 @@ WRITE8_HANDLER( fastfred_flip_screen_x_w )
WRITE8_HANDLER( fastfred_flip_screen_y_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
if (state->flip_screen_y() != (data & 0x01))
{
state->flip_screen_y_set(data & 0x01);
@@ -329,14 +329,14 @@ TILE_GET_INFO_MEMBER(fastfred_state::imago_get_tile_info_web)
WRITE8_HANDLER( imago_fg_videoram_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
state->m_imago_fg_videoram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset);
}
WRITE8_HANDLER( imago_charbank_w )
{
- fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ fastfred_state *state = space.machine().driver_data<fastfred_state>();
if( state->m_charbank != data )
{
state->m_charbank = data;
diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c
index 88a036e9e97..f704e516558 100644
--- a/src/mame/video/fuukifg2.c
+++ b/src/mame/video/fuukifg2.c
@@ -57,17 +57,17 @@ TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_1){ get_tile_info(machine(), t
TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_2){ get_tile_info(machine(), tileinfo, tile_index, 2); }
TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_3){ get_tile_info(machine(), tileinfo, tile_index, 3); }
-INLINE void fuuki16_vram_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int _N_)
+INLINE void fuuki16_vram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int _N_)
{
- fuuki16_state *state = space->machine().driver_data<fuuki16_state>();
+ fuuki16_state *state = space.machine().driver_data<fuuki16_state>();
COMBINE_DATA(&state->m_vram[_N_][offset]);
state->m_tilemap[_N_]->mark_tile_dirty(offset / 2);
}
-WRITE16_MEMBER(fuuki16_state::fuuki16_vram_0_w){ fuuki16_vram_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(fuuki16_state::fuuki16_vram_1_w){ fuuki16_vram_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(fuuki16_state::fuuki16_vram_2_w){ fuuki16_vram_w(&space, offset, data, mem_mask, 2); }
-WRITE16_MEMBER(fuuki16_state::fuuki16_vram_3_w){ fuuki16_vram_w(&space, offset, data, mem_mask, 3); }
+WRITE16_MEMBER(fuuki16_state::fuuki16_vram_0_w){ fuuki16_vram_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(fuuki16_state::fuuki16_vram_1_w){ fuuki16_vram_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(fuuki16_state::fuuki16_vram_2_w){ fuuki16_vram_w(space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(fuuki16_state::fuuki16_vram_3_w){ fuuki16_vram_w(space, offset, data, mem_mask, 3); }
/***************************************************************************
diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c
index 49502c2282a..8996e0f0207 100644
--- a/src/mame/video/fuukifg3.c
+++ b/src/mame/video/fuukifg3.c
@@ -70,17 +70,17 @@ INLINE void get_tile_info4bpp(running_machine &machine, tile_data &tileinfo, til
TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_2){ get_tile_info4bpp(machine(), tileinfo, tile_index, 2); }
TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_3){ get_tile_info4bpp(machine(), tileinfo, tile_index, 3); }
-INLINE void fuuki32_vram_w(address_space *space, offs_t offset, UINT32 data, UINT32 mem_mask, int _N_)
+INLINE void fuuki32_vram_w(address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask, int _N_)
{
- fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
+ fuuki32_state *state = space.machine().driver_data<fuuki32_state>();
COMBINE_DATA(&state->m_vram[_N_][offset]);
state->m_tilemap[_N_]->mark_tile_dirty(offset);
}
-WRITE32_MEMBER(fuuki32_state::fuuki32_vram_0_w){ fuuki32_vram_w(&space, offset, data, mem_mask, 0); }
-WRITE32_MEMBER(fuuki32_state::fuuki32_vram_1_w){ fuuki32_vram_w(&space, offset, data, mem_mask, 1); }
-WRITE32_MEMBER(fuuki32_state::fuuki32_vram_2_w){ fuuki32_vram_w(&space, offset, data, mem_mask, 2); }
-WRITE32_MEMBER(fuuki32_state::fuuki32_vram_3_w){ fuuki32_vram_w(&space, offset, data, mem_mask, 3); }
+WRITE32_MEMBER(fuuki32_state::fuuki32_vram_0_w){ fuuki32_vram_w(space, offset, data, mem_mask, 0); }
+WRITE32_MEMBER(fuuki32_state::fuuki32_vram_1_w){ fuuki32_vram_w(space, offset, data, mem_mask, 1); }
+WRITE32_MEMBER(fuuki32_state::fuuki32_vram_2_w){ fuuki32_vram_w(space, offset, data, mem_mask, 2); }
+WRITE32_MEMBER(fuuki32_state::fuuki32_vram_3_w){ fuuki32_vram_w(space, offset, data, mem_mask, 3); }
/***************************************************************************
diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c
index 9a1b4119f0a..c2d2ea9910e 100644
--- a/src/mame/video/galpani2.c
+++ b/src/mame/video/galpani2.c
@@ -25,14 +25,14 @@
#ifdef UNUSED_DEFINITION
-INLINE UINT16 galpani2_bg8_regs_r(address_space *space, offs_t offset, int n)
+INLINE UINT16 galpani2_bg8_regs_r(address_space &space, offs_t offset, int n)
{
- galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ galpani2_state *state = space.machine().driver_data<galpani2_state>();
switch (offset * 2)
{
- case 0x16: return space->machine().rand() & 1;
+ case 0x16: return space.machine().rand() & 1;
default:
- logerror("CPU #0 PC %06X : Warning, bg8 #%d screen reg %04X read\n",space->cpu->safe_pc(),_n_,offset*2);
+ logerror("CPU #0 PC %06X : Warning, bg8 #%d screen reg %04X read\n",space.cpu->safe_pc(),_n_,offset*2);
}
return state->m_bg8_regs[_n_][offset];
}
@@ -44,9 +44,9 @@ INLINE UINT16 galpani2_bg8_regs_r(address_space *space, offs_t offset, int n)
c04 0003 flip, 0300 flip?
c1c/e 01ff scroll, 3000 ?
*/
-INLINE void galpani2_bg8_regs_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int _n_)
+INLINE void galpani2_bg8_regs_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int _n_)
{
- galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ galpani2_state *state = space.machine().driver_data<galpani2_state>();
COMBINE_DATA(&state->m_bg8_regs[_n_][offset]);
}
@@ -57,9 +57,9 @@ WRITE16_HANDLER( galpani2_bg8_regs_0_w ) { galpani2_bg8_regs_w(space, offset, da
WRITE16_HANDLER( galpani2_bg8_regs_1_w ) { galpani2_bg8_regs_w(space, offset, data, mem_mask, 1); }
#endif
-INLINE void galpani2_bg8_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int _n_)
+INLINE void galpani2_bg8_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int _n_)
{
- galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ galpani2_state *state = space.machine().driver_data<galpani2_state>();
int x,y,pen;
UINT16 newword = COMBINE_DATA(&state->m_bg8[_n_][offset]);
pen = newword & 0xff;
@@ -71,11 +71,11 @@ INLINE void galpani2_bg8_w(address_space *space, offs_t offset, UINT16 data, UIN
WRITE16_HANDLER( galpani2_bg8_0_w ) { galpani2_bg8_w(space, offset, data, mem_mask, 0); }
WRITE16_HANDLER( galpani2_bg8_1_w ) { galpani2_bg8_w(space, offset, data, mem_mask, 1); }
-INLINE void galpani2_palette_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int _n_)
+INLINE void galpani2_palette_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int _n_)
{
- galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ galpani2_state *state = space.machine().driver_data<galpani2_state>();
UINT16 newword = COMBINE_DATA(&state->m_palette[_n_][offset]);
- palette_set_color_rgb( space->machine(), offset + 0x4000 + _n_ * 0x100, pal5bit(newword >> 5), pal5bit(newword >> 10), pal5bit(newword >> 0) );
+ palette_set_color_rgb( space.machine(), offset + 0x4000 + _n_ * 0x100, pal5bit(newword >> 5), pal5bit(newword >> 10), pal5bit(newword >> 0) );
}
WRITE16_HANDLER( galpani2_palette_0_w ) { galpani2_palette_w(space, offset, data, mem_mask, 0); }
@@ -93,7 +93,7 @@ WRITE16_HANDLER( galpani2_palette_1_w ) { galpani2_palette_w(space, offset, data
/* 8 horizontal pages of 256x256 pixels? */
WRITE16_HANDLER( galpani2_bg15_w )
{
- galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ galpani2_state *state = space.machine().driver_data<galpani2_state>();
UINT16 newword = COMBINE_DATA(&state->m_bg15[offset]);
int x = (offset % 256) + (offset / (256*256)) * 256 ;
diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c
index 1dfbdb23448..145a93f1b02 100644
--- a/src/mame/video/galpanic.c
+++ b/src/mame/video/galpanic.c
@@ -24,7 +24,7 @@ PALETTE_INIT_MEMBER(galpanic_state,galpanic)
WRITE16_HANDLER( galpanic_bgvideoram_w )
{
- galpanic_state *state = space->machine().driver_data<galpanic_state>();
+ galpanic_state *state = space.machine().driver_data<galpanic_state>();
int sx,sy;
@@ -38,10 +38,10 @@ WRITE16_HANDLER( galpanic_bgvideoram_w )
WRITE16_HANDLER( galpanic_paletteram_w )
{
- galpanic_state *state = space->machine().driver_data<galpanic_state>();
+ galpanic_state *state = space.machine().driver_data<galpanic_state>();
data = COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
/* bit 0 seems to be a transparency flag for the front bitmap */
- palette_set_color_rgb(space->machine(),offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
+ palette_set_color_rgb(space.machine(),offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
}
diff --git a/src/mame/video/gauntlet.c b/src/mame/video/gauntlet.c
index 77c82a2fe8c..718a09836a4 100644
--- a/src/mame/video/gauntlet.c
+++ b/src/mame/video/gauntlet.c
@@ -118,14 +118,14 @@ VIDEO_START_MEMBER(gauntlet_state,gauntlet)
WRITE16_HANDLER( gauntlet_xscroll_w )
{
- gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
+ gauntlet_state *state = space.machine().driver_data<gauntlet_state>();
UINT16 oldxscroll = *state->m_xscroll;
COMBINE_DATA(state->m_xscroll);
/* if something changed, force a partial update */
if (*state->m_xscroll != oldxscroll)
{
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* adjust the scrolls */
state->m_playfield_tilemap->set_scrollx(0, *state->m_xscroll);
@@ -143,14 +143,14 @@ WRITE16_HANDLER( gauntlet_xscroll_w )
WRITE16_HANDLER( gauntlet_yscroll_w )
{
- gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
+ gauntlet_state *state = space.machine().driver_data<gauntlet_state>();
UINT16 oldyscroll = *state->m_yscroll;
COMBINE_DATA(state->m_yscroll);
/* if something changed, force a partial update */
if (*state->m_yscroll != oldyscroll)
{
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* if the bank changed, mark all tiles dirty */
if (state->m_playfield_tile_bank != (*state->m_yscroll & 3))
diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c
index ed98995dc19..f731e4e2e20 100644
--- a/src/mame/video/gtia.c
+++ b/src/mame/video/gtia.c
@@ -157,7 +157,7 @@ static int is_ntsc(running_machine &machine)
static void gtia_reset(running_machine &machine)
{
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* reset the GTIA read/write/helper registers */
for (i = 0; i < 32; i++)
diff --git a/src/mame/video/gtia.h b/src/mame/video/gtia.h
index eecd9a94996..6e3a879df61 100644
--- a/src/mame/video/gtia.h
+++ b/src/mame/video/gtia.h
@@ -15,8 +15,8 @@
struct gtia_interface
{
- UINT8 (*console_read)(address_space *space);
- void (*console_write)(address_space *space, UINT8 data);
+ UINT8 (*console_read)(address_space &space);
+ void (*console_write)(address_space &space, UINT8 data);
};
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index b3e8c5f1fd2..22df8fed96a 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -168,7 +168,7 @@ static void K001006_w(int chip, int offset, UINT32 data, UINT32 mem_mask)
READ32_HANDLER(K001006_0_r)
{
- return K001006_r(space->machine(), 0, offset, mem_mask);
+ return K001006_r(space.machine(), 0, offset, mem_mask);
}
WRITE32_HANDLER(K001006_0_w)
@@ -178,7 +178,7 @@ WRITE32_HANDLER(K001006_0_w)
READ32_HANDLER(K001006_1_r)
{
- return K001006_r(space->machine(), 1, offset, mem_mask);
+ return K001006_r(space.machine(), 1, offset, mem_mask);
}
WRITE32_HANDLER(K001006_1_w)
@@ -357,19 +357,19 @@ READ32_HANDLER( K001005_r )
{
if (K001005_fifo_read_ptr < 0x3ff)
{
- //space->machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, CLEAR_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE);
+ //space.machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, CLEAR_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, CLEAR_LINE);
}
else
{
- //space->machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
+ //space.machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, ASSERT_LINE);
}
}
else
{
- //space->machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
+ //space.machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, ASSERT_LINE);
}
K001005_fifo_read_ptr++;
@@ -394,7 +394,7 @@ READ32_HANDLER( K001005_r )
}
default:
- mame_printf_debug("K001005_r: %08X, %08X at %08X\n", offset, mem_mask, space->device().safe_pc());
+ mame_printf_debug("K001005_r: %08X, %08X at %08X\n", offset, mem_mask, space.device().safe_pc());
break;
}
return 0;
@@ -410,22 +410,22 @@ WRITE32_HANDLER( K001005_w )
{
if (K001005_fifo_write_ptr < 0x400)
{
- //space->machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
+ //space.machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, ASSERT_LINE);
}
else
{
- //space->machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, CLEAR_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE);
+ //space.machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, CLEAR_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, CLEAR_LINE);
}
}
else
{
- //space->machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
+ //space.machine().device("dsp")->execute().set_input_line(SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space.machine().device("dsp"), 1, ASSERT_LINE);
}
- // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, space->device().safe_pc());
+ // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, space.device().safe_pc());
K001005_fifo[K001005_fifo_write_ptr] = data;
K001005_fifo_write_ptr++;
K001005_fifo_write_ptr &= 0x7ff;
@@ -433,7 +433,7 @@ WRITE32_HANDLER( K001005_w )
// process the current vertex data if a sync command is being sent (usually means the global registers are being changed)
if (data == 0x80000000)
{
- render_polygons(space->machine());
+ render_polygons(space.machine());
K001005_3d_fifo_ptr = 0;
}
@@ -450,16 +450,16 @@ WRITE32_HANDLER( K001005_w )
#endif
// !!! HACK to get past the FIFO B test (GTI Club & Thunder Hurricane) !!!
- if (space->device().safe_pc() == 0x201ee)
+ if (space.device().safe_pc() == 0x201ee)
{
// This is used to make the SHARC timeout
- space->device().execute().spin_until_trigger(10000);
+ space.device().execute().spin_until_trigger(10000);
}
// !!! HACK to get past the FIFO B test (Winding Heat & Midnight Run) !!!
- if (space->device().safe_pc() == 0x201e6)
+ if (space.device().safe_pc() == 0x201e6)
{
// This is used to make the SHARC timeout
- space->device().execute().spin_until_trigger(10000);
+ space.device().execute().spin_until_trigger(10000);
}
break;
@@ -514,7 +514,7 @@ WRITE32_HANDLER( K001005_w )
if (data == 2 && K001005_3d_fifo_ptr > 0)
{
- render_polygons(space->machine());
+ render_polygons(space.machine());
poly_wait(poly, "render_polygons");
#if LOG_POLY_FIFO
@@ -524,7 +524,7 @@ WRITE32_HANDLER( K001005_w )
#endif
K001005_3d_fifo_ptr = 0;
- K001005_swap_buffers(space->machine());
+ K001005_swap_buffers(space.machine());
}
break;
@@ -549,7 +549,7 @@ WRITE32_HANDLER( K001005_w )
break;
default:
- //mame_printf_debug("K001005_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space->device().safe_pc());
+ //mame_printf_debug("K001005_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
break;
}
diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c
index 124509f6a67..36487dd2ec4 100644
--- a/src/mame/video/harddriv.c
+++ b/src/mame/video/harddriv.c
@@ -95,9 +95,9 @@ VIDEO_START_MEMBER(harddriv_state,harddriv)
*
*************************************/
-void hdgsp_write_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void hdgsp_write_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* access to the 1bpp/2bpp area */
if (address >= 0x02000000 && address <= 0x020fffff)
@@ -123,9 +123,9 @@ void hdgsp_write_to_shiftreg(address_space *space, UINT32 address, UINT16 *shift
}
-void hdgsp_read_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void hdgsp_read_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
if (!state->m_shiftreg_enable)
return;
@@ -178,14 +178,14 @@ static void update_palette_bank(running_machine &machine, int newbank)
READ16_HANDLER( hdgsp_control_lo_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_gsp_control_lo[offset];
}
WRITE16_HANDLER( hdgsp_control_lo_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int oldword = state->m_gsp_control_lo[offset];
int newword;
@@ -206,14 +206,14 @@ WRITE16_HANDLER( hdgsp_control_lo_w )
READ16_HANDLER( hdgsp_control_hi_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
return state->m_gsp_control_hi[offset];
}
WRITE16_HANDLER( hdgsp_control_hi_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
int val = (offset >> 3) & 1;
int oldword = state->m_gsp_control_hi[offset];
@@ -230,21 +230,21 @@ WRITE16_HANDLER( hdgsp_control_hi_w )
case 0x01:
data = data & (15 >> state->m_gsp_multisync);
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1);
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos() - 1);
state->m_gfx_finescroll = data;
break;
case 0x02:
- update_palette_bank(space->machine(), (state->m_gfx_palettebank & ~1) | val);
+ update_palette_bank(space.machine(), (state->m_gfx_palettebank & ~1) | val);
break;
case 0x03:
- update_palette_bank(space->machine(), (state->m_gfx_palettebank & ~2) | (val << 1));
+ update_palette_bank(space.machine(), (state->m_gfx_palettebank & ~2) | (val << 1));
break;
case 0x04:
- if (space->machine().total_colors() >= 256 * 8)
- update_palette_bank(space->machine(), (state->m_gfx_palettebank & ~4) | (val << 2));
+ if (space.machine().total_colors() >= 256 * 8)
+ update_palette_bank(space.machine(), (state->m_gfx_palettebank & ~4) | (val << 2));
break;
case 0x07:
@@ -274,7 +274,7 @@ READ16_HANDLER( hdgsp_vram_2bpp_r )
WRITE16_HANDLER( hdgsp_vram_1bpp_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT32 *dest = (UINT32 *)&state->m_gsp_vram[offset * 16];
UINT32 *mask = &state->m_mask_table[data * 4];
UINT32 color = state->m_gsp_control_lo[0] & 0xff;
@@ -303,7 +303,7 @@ WRITE16_HANDLER( hdgsp_vram_1bpp_w )
WRITE16_HANDLER( hdgsp_vram_2bpp_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
UINT32 *dest = (UINT32 *)&state->m_gsp_vram[offset * 8];
UINT32 *mask = &state->m_mask_table[data * 2];
UINT32 color = state->m_gsp_control_lo[0];
@@ -340,7 +340,7 @@ INLINE void gsp_palette_change(running_machine &machine, int offset)
READ16_HANDLER( hdgsp_paletteram_lo_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
@@ -352,14 +352,14 @@ READ16_HANDLER( hdgsp_paletteram_lo_r )
WRITE16_HANDLER( hdgsp_paletteram_lo_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
offset = state->m_gfx_palettebank * 0x100 + (offset & 0xff);
COMBINE_DATA(&state->m_gsp_paletteram_lo[offset]);
- gsp_palette_change(space->machine(), offset);
+ gsp_palette_change(space.machine(), offset);
}
@@ -372,7 +372,7 @@ WRITE16_HANDLER( hdgsp_paletteram_lo_w )
READ16_HANDLER( hdgsp_paletteram_hi_r )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
@@ -384,14 +384,14 @@ READ16_HANDLER( hdgsp_paletteram_hi_r )
WRITE16_HANDLER( hdgsp_paletteram_hi_w )
{
- harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ harddriv_state *state = space.machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
offset = state->m_gfx_palettebank * 0x100 + (offset & 0xff);
COMBINE_DATA(&state->m_gsp_paletteram_hi[offset]);
- gsp_palette_change(space->machine(), offset);
+ gsp_palette_change(space.machine(), offset);
}
diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c
index 5360ce91fc2..835f32b2458 100644
--- a/src/mame/video/hng64.c
+++ b/src/mame/video/hng64.c
@@ -1447,8 +1447,8 @@ SCREEN_UPDATE_RGB32( hng64 )
// but it could be useful
if ( screen.machine().input().code_pressed_once(KEYCODE_L) )
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->write_byte(0x2f27c8, 0x2);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.write_byte(0x2f27c8, 0x2);
}
#endif
diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c
index 4487b70633d..486248881cd 100644
--- a/src/mame/video/homedata.c
+++ b/src/mame/video/homedata.c
@@ -32,9 +32,9 @@
***************************************************************************/
-static void mrokumei_handleblit( address_space *space, int rom_base )
+static void mrokumei_handleblit( address_space &space, int rom_base )
{
- homedata_state *state = space->machine().driver_data<homedata_state>();
+ homedata_state *state = space.machine().driver_data<homedata_state>();
int i;
int dest_param;
int source_addr;
@@ -99,7 +99,7 @@ static void mrokumei_handleblit( address_space *space, int rom_base )
} /* i!=0 */
if (data) /* 00 is a nop */
- state->mrokumei_videoram_w(*space, base_addr + dest_addr, data);
+ state->mrokumei_videoram_w(space, base_addr + dest_addr, data);
if (state->m_vreg[1] & 0x80) /* flip screen */
{
@@ -119,9 +119,9 @@ finish:
state->m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
-static void reikaids_handleblit( address_space *space, int rom_base )
+static void reikaids_handleblit( address_space &space, int rom_base )
{
- homedata_state *state = space->machine().driver_data<homedata_state>();
+ homedata_state *state = space.machine().driver_data<homedata_state>();
int i;
UINT16 dest_param;
int flipx;
@@ -202,7 +202,7 @@ static void reikaids_handleblit( address_space *space, int rom_base )
addr ^= 0x007c;
}
- state->reikaids_videoram_w(*space, addr, dat);
+ state->reikaids_videoram_w(space, addr, dat);
}
}
@@ -217,9 +217,9 @@ finish:
state->m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
-static void pteacher_handleblit( address_space *space, int rom_base )
+static void pteacher_handleblit( address_space &space, int rom_base )
{
- homedata_state *state = space->machine().driver_data<homedata_state>();
+ homedata_state *state = space.machine().driver_data<homedata_state>();
int i;
int dest_param;
int source_addr;
@@ -289,7 +289,7 @@ static void pteacher_handleblit( address_space *space, int rom_base )
if ((addr & 0x2080) == 0)
{
addr = ((addr & 0xc000) >> 2) | ((addr & 0x1f00) >> 1) | (addr & 0x7f);
- state->mrokumei_videoram_w(*space, addr, data);
+ state->mrokumei_videoram_w(space, addr, data);
}
}
@@ -777,7 +777,7 @@ WRITE8_MEMBER(homedata_state::pteacher_blitter_bank_w)
WRITE8_MEMBER(homedata_state::mrokumei_blitter_start_w)
{
if (data & 0x80)
- mrokumei_handleblit(&space, ((m_blitter_bank & 0x04) >> 2) * 0x10000);
+ mrokumei_handleblit(space, ((m_blitter_bank & 0x04) >> 2) * 0x10000);
/* bit 0 = bank switch; used by hourouki to access the
optional service mode ROM (not available in current dump) */
@@ -785,12 +785,12 @@ WRITE8_MEMBER(homedata_state::mrokumei_blitter_start_w)
WRITE8_MEMBER(homedata_state::reikaids_blitter_start_w)
{
- reikaids_handleblit(&space, (m_blitter_bank & 3) * 0x10000);
+ reikaids_handleblit(space, (m_blitter_bank & 3) * 0x10000);
}
WRITE8_MEMBER(homedata_state::pteacher_blitter_start_w)
{
- pteacher_handleblit(&space, (m_blitter_bank >> 5) * 0x10000 & (machine().root_device().memregion("user1")->bytes() - 1));
+ pteacher_handleblit(space, (m_blitter_bank >> 5) * 0x10000 & (machine().root_device().memregion("user1")->bytes() - 1));
}
diff --git a/src/mame/video/hyhoo.c b/src/mame/video/hyhoo.c
index e2cad5ce3ef..4d5df4f88cf 100644
--- a/src/mame/video/hyhoo.c
+++ b/src/mame/video/hyhoo.c
@@ -19,9 +19,9 @@ WRITE8_MEMBER(hyhoo_state::hyhoo_blitter_w)
switch (offset)
{
case 0x00: m_blitter_src_addr = (m_blitter_src_addr & 0xff00) | data;
- nb1413m3_gfxradr_l_w(&space, 0, data); break;
+ nb1413m3_gfxradr_l_w(space, 0, data); break;
case 0x01: m_blitter_src_addr = (m_blitter_src_addr & 0x00ff) | (data << 8);
- nb1413m3_gfxradr_h_w(&space, 0, data); break;
+ nb1413m3_gfxradr_h_w(space, 0, data); break;
case 0x02: m_blitter_destx = data; break;
case 0x03: m_blitter_desty = data; break;
case 0x04: m_blitter_sizex = data; break;
@@ -44,7 +44,7 @@ WRITE8_MEMBER(hyhoo_state::hyhoo_romsel_w)
int gfxlen = memregion("gfx1")->bytes();
m_gfxrom = (((data & 0xc0) >> 4) + (data & 0x03));
m_highcolorflag = data;
- nb1413m3_gfxrombank_w(&space, 0, data);
+ nb1413m3_gfxrombank_w(space, 0, data);
if ((0x20000 * m_gfxrom) > (gfxlen - 1))
{
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 4cffebbcbbf..d58f24ab1dc 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -280,9 +280,9 @@ INLINE void consume_rle(itech8_state *state, int count)
*
*************************************/
-static void perform_blit(address_space *space)
+static void perform_blit(address_space &space)
{
- itech8_state *state = space->machine().driver_data<itech8_state>();
+ itech8_state *state = space.machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->m_tms_state;
UINT8 *blitter_data = state->m_blitter_data;
offs_t addr = state->m_tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8);
@@ -303,7 +303,7 @@ static void perform_blit(address_space *space)
/* debugging */
if (FULL_LOGGING)
logerror("Blit: scan=%d src=%06x @ (%05x) for %dx%d ... flags=%02x\n",
- space->machine().primary_screen->vpos(),
+ space.machine().primary_screen->vpos(),
(state->m_grom_bank << 16) | (BLITTER_ADDRHI << 8) | BLITTER_ADDRLO,
tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8),
BLITTER_WIDTH, BLITTER_HEIGHT, BLITTER_FLAGS);
@@ -498,7 +498,7 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
}
/* perform the blit */
- perform_blit(&space);
+ perform_blit(space);
m_blit_in_progress = 1;
/* set a timer to go off when we're done */
@@ -528,7 +528,7 @@ WRITE8_MEMBER(itech8_state::itech8_tms34061_w)
col ^= 2;
/* Row address (RA0-RA8) is not dependent on the offset */
- tms34061_w(&space, col, 0xff, func, data);
+ tms34061_w(space, col, 0xff, func, data);
}
@@ -543,7 +543,7 @@ READ8_MEMBER(itech8_state::itech8_tms34061_r)
col ^= 2;
/* Row address (RA0-RA8) is not dependent on the offset */
- return tms34061_r(&space, col, 0xff, func);
+ return tms34061_r(space, col, 0xff, func);
}
diff --git a/src/mame/video/jpmimpct.c b/src/mame/video/jpmimpct.c
index 1901c13288c..cf8e19ff691 100644
--- a/src/mame/video/jpmimpct.c
+++ b/src/mame/video/jpmimpct.c
@@ -86,15 +86,15 @@ READ16_MEMBER(jpmimpct_state::jpmimpct_bt477_r)
*
*************************************/
-void jpmimpct_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void jpmimpct_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space.machine().driver_data<jpmimpct_state>();
memcpy(shiftreg, &state->m_vram[TOWORD(address)], 512 * sizeof(UINT16));
}
-void jpmimpct_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void jpmimpct_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space.machine().driver_data<jpmimpct_state>();
memcpy(&state->m_vram[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
}
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c
index dd7646cc6d5..4e6e27628f0 100644
--- a/src/mame/video/konamiic.c
+++ b/src/mame/video/konamiic.c
@@ -1400,9 +1400,9 @@ WRITE32_HANDLER( K053247_long_w )
// in this window, +0 = 32 bits from one set of ROMs, and +8 = 32 bits from another set
READ16_HANDLER( K055673_rom_word_r ) // 5bpp
{
- UINT8 *ROM8 = (UINT8 *)space->machine().root_device().memregion(K053247_memory_region)->base();
- UINT16 *ROM = (UINT16 *)space->machine().root_device().memregion(K053247_memory_region)->base();
- int size4 = (space->machine().root_device().memregion(K053247_memory_region)->bytes()/(1024*1024))/5;
+ UINT8 *ROM8 = (UINT8 *)space.machine().root_device().memregion(K053247_memory_region)->base();
+ UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion(K053247_memory_region)->base();
+ int size4 = (space.machine().root_device().memregion(K053247_memory_region)->bytes()/(1024*1024))/5;
int romofs;
size4 *= 4*1024*1024; // get offset to 5th bit
@@ -1438,7 +1438,7 @@ READ16_HANDLER( K055673_rom_word_r ) // 5bpp
READ16_HANDLER( K055673_GX6bpp_rom_word_r )
{
- UINT16 *ROM = (UINT16 *)space->machine().root_device().memregion(K053247_memory_region)->base();
+ UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion(K053247_memory_region)->base();
int romofs;
romofs = K053246_regs[6]<<16 | K053246_regs[7]<<8 | K053246_regs[4];
@@ -1463,7 +1463,7 @@ READ16_HANDLER( K055673_GX6bpp_rom_word_r )
case 7:
return ROM[romofs+2];
default:
- LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, space->device().safe_pc()));
+ LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, space.device().safe_pc()));
break;
}
@@ -1666,7 +1666,7 @@ static UINT8 K054000_ram[0x20];
static WRITE8_HANDLER( K054000_w )
{
-//logerror("%04x: write %02x to 054000 address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("%04x: write %02x to 054000 address %02x\n",space.device().safe_pc(),data,offset);
K054000_ram[offset] = data;
}
@@ -1676,7 +1676,7 @@ static READ8_HANDLER( K054000_r )
int Acx,Acy,Aax,Aay;
int Bcx,Bcy,Bax,Bay;
-//logerror("%04x: read 054000 address %02x\n",space->device().safe_pc(),offset);
+//logerror("%04x: read 054000 address %02x\n",space.device().safe_pc(),offset);
if (offset != 0x18) return 0;
@@ -2249,23 +2249,23 @@ READ32_HANDLER( K056832_5bpp_rom_long_r )
{
if (mem_mask == 0xff000000)
{
- return K056832_rom_read_b(space->machine(), offset*4, 4, 5, 0)<<24;
+ return K056832_rom_read_b(space.machine(), offset*4, 4, 5, 0)<<24;
}
else if (mem_mask == 0x00ff0000)
{
- return K056832_rom_read_b(space->machine(), offset*4+1, 4, 5, 0)<<16;
+ return K056832_rom_read_b(space.machine(), offset*4+1, 4, 5, 0)<<16;
}
else if (mem_mask == 0x0000ff00)
{
- return K056832_rom_read_b(space->machine(), offset*4+2, 4, 5, 0)<<8;
+ return K056832_rom_read_b(space.machine(), offset*4+2, 4, 5, 0)<<8;
}
else if (mem_mask == 0x000000ff)
{
- return K056832_rom_read_b(space->machine(), offset*4+3, 4, 5, 1);
+ return K056832_rom_read_b(space.machine(), offset*4+3, 4, 5, 1);
}
else
{
- LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space->device().safe_pc(), mem_mask));
+ LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space.device().safe_pc(), mem_mask));
}
return 0;
}
@@ -2274,23 +2274,23 @@ READ32_HANDLER( K056832_6bpp_rom_long_r )
{
if (mem_mask == 0xff000000)
{
- return K056832_rom_read_b(space->machine(), offset*4, 4, 6, 0)<<24;
+ return K056832_rom_read_b(space.machine(), offset*4, 4, 6, 0)<<24;
}
else if (mem_mask == 0x00ff0000)
{
- return K056832_rom_read_b(space->machine(), offset*4+1, 4, 6, 0)<<16;
+ return K056832_rom_read_b(space.machine(), offset*4+1, 4, 6, 0)<<16;
}
else if (mem_mask == 0x0000ff00)
{
- return K056832_rom_read_b(space->machine(), offset*4+2, 4, 6, 0)<<8;
+ return K056832_rom_read_b(space.machine(), offset*4+2, 4, 6, 0)<<8;
}
else if (mem_mask == 0x000000ff)
{
- return K056832_rom_read_b(space->machine(), offset*4+3, 4, 6, 0);
+ return K056832_rom_read_b(space.machine(), offset*4+3, 4, 6, 0);
}
else
{
- LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space->device().safe_pc(), mem_mask));
+ LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space.device().safe_pc(), mem_mask));
}
return 0;
}
@@ -2305,7 +2305,7 @@ READ16_HANDLER( K056832_mw_rom_word_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine().root_device().memregion(K056832_memory_region)->base();
+ K056832_rombase = space.machine().root_device().memregion(K056832_memory_region)->base();
}
if (K056832_regsb[2] & 0x8)
diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c
index 281d94a770d..f3f3c5deecf 100644
--- a/src/mame/video/konicdev.c
+++ b/src/mame/video/konicdev.c
@@ -2295,7 +2295,7 @@ READ8_DEVICE_HANDLER( k052109_r )
else if (offset >= 0x3a00 && offset < 0x3c00)
{ /* B x scroll */ }
// else
-//logerror("%04x: read from unknown 052109 address %04x\n",space->device().safe_pc(),offset);
+//logerror("%04x: read from unknown 052109 address %04x\n",space.device().safe_pc(),offset);
}
return k052109->ram[offset];
@@ -2319,7 +2319,7 @@ READ8_DEVICE_HANDLER( k052109_r )
addr = (code << 5) + (offset & 0x1f);
addr &= device->machine().root_device().memregion(k052109->memory_region)->bytes() - 1;
-// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n", space->device().safe_pc(), offset, k052109->romsubbank, bank, addr);
+// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n", space.device().safe_pc(), offset, k052109->romsubbank, bank, addr);
return device->machine().root_device().memregion(k052109->memory_region)->base()[addr];
}
@@ -2350,13 +2350,13 @@ WRITE8_DEVICE_HANDLER( k052109_w )
if (k052109->scrollctrl != data)
{
//popmessage("scrollcontrol = %02x", data);
-//logerror("%04x: rowscrollcontrol = %02x\n", space->device().safe_pc(), data);
+//logerror("%04x: rowscrollcontrol = %02x\n", space.device().safe_pc(), data);
k052109->scrollctrl = data;
}
}
else if (offset == 0x1d00)
{
-//logerror("%04x: 052109 register 1d00 = %02x\n", space->device().safe_pc(), data);
+//logerror("%04x: 052109 register 1d00 = %02x\n", space.device().safe_pc(), data);
/* bit 2 = irq enable */
/* the custom chip can also generate NMI and FIRQ, for use with a 6809 */
k052109->irq_enabled = data & 0x04;
@@ -2389,12 +2389,12 @@ WRITE8_DEVICE_HANDLER( k052109_w )
}
else if (offset == 0x1e00 || offset == 0x3e00) // Surprise Attack uses offset 0x3e00
{
-//logerror("%04x: 052109 register 1e00 = %02x\n",space->device().safe_pc(),data);
+//logerror("%04x: 052109 register 1e00 = %02x\n",space.device().safe_pc(),data);
k052109->romsubbank = data;
}
else if (offset == 0x1e80)
{
-//if ((data & 0xfe)) logerror("%04x: 052109 register 1e80 = %02x\n",space->device().safe_pc(),data);
+//if ((data & 0xfe)) logerror("%04x: 052109 register 1e80 = %02x\n",space.device().safe_pc(),data);
k052109->tilemap[0]->set_flip((data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
k052109->tilemap[1]->set_flip((data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
k052109->tilemap[2]->set_flip((data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
@@ -2449,7 +2449,7 @@ WRITE8_DEVICE_HANDLER( k052109_w )
k052109->charrombank_2[3] = (data >> 4) & 0x0f;
}
// else
-// logerror("%04x: write %02x to unknown 052109 address %04x\n",space->device().safe_pc(),data,offset);
+// logerror("%04x: write %02x to unknown 052109 address %04x\n",space.device().safe_pc(),data,offset);
}
}
@@ -4538,7 +4538,7 @@ READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r )
case 7:
return ROM[romofs + 2];
default:
-// LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, space->device().safe_pc()));
+// LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, space.device().safe_pc()));
break;
}
@@ -4555,12 +4555,12 @@ READ8_DEVICE_HANDLER( k053246_r )
addr = (k053246->kx46_regs[6] << 17) | (k053246->kx46_regs[7] << 9) | (k053246->kx46_regs[4] << 1) | ((offset & 1) ^ 1);
addr &= device->machine().root_device().memregion(k053246->memory_region)->bytes() - 1;
// if (VERBOSE)
-// popmessage("%04x: offset %02x addr %06x", space->device().safe_pc(), offset, addr);
+// popmessage("%04x: offset %02x addr %06x", space.device().safe_pc(), offset, addr);
return device->machine().root_device().memregion(k053246->memory_region)->base()[addr];
}
else
{
-// LOG(("%04x: read from unknown 053246 address %x\n", space->device().safe_pc(), offset));
+// LOG(("%04x: read from unknown 053246 address %x\n", space.device().safe_pc(), offset));
return 0;
}
}
@@ -6167,7 +6167,7 @@ WRITE8_DEVICE_HANDLER( k054000_w )
{
k054000_state *k054000 = k054000_get_safe_token(device);
- //logerror("%04x: write %02x to 054000 address %02x\n",space->device().safe_pc(),data,offset);
+ //logerror("%04x: write %02x to 054000 address %02x\n",space.device().safe_pc(),data,offset);
k054000->regs[offset] = data;
}
@@ -6177,7 +6177,7 @@ READ8_DEVICE_HANDLER( k054000_r )
int Acx, Acy, Aax, Aay;
int Bcx, Bcy, Bax, Bay;
- //logerror("%04x: read 054000 address %02x\n", space->device().safe_pc(), offset);
+ //logerror("%04x: read 054000 address %02x\n", space.device().safe_pc(), offset);
if (offset != 0x18)
return 0;
@@ -6313,7 +6313,7 @@ INLINE k051733_state *k051733_get_safe_token( device_t *device )
WRITE8_DEVICE_HANDLER( k051733_w )
{
k051733_state *k051733= k051733_get_safe_token(device);
- //logerror("%04x: write %02x to 051733 address %02x\n", space->device().safe_pc(), data, offset);
+ //logerror("%04x: write %02x to 051733 address %02x\n", space.device().safe_pc(), data, offset);
k051733->ram[offset] = data;
}
@@ -6843,7 +6843,7 @@ READ16_DEVICE_HANDLER( k056832_5bpp_rom_word_r )
return k056832_rom_read_b(device, offset * 2 + 1, 4, 5, 0)<<16;
else
{
- //LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space->device().safe_pc(), mem_mask));
+ //LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space.device().safe_pc(), mem_mask));
}
return 0;
}
@@ -6860,7 +6860,7 @@ READ32_DEVICE_HANDLER( k056832_5bpp_rom_long_r )
return k056832_rom_read_b(device, offset * 4 + 3, 4, 5, 1);
else
{
- //LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space->device().safe_pc(), mem_mask));
+ //LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space.device().safe_pc(), mem_mask));
}
return 0;
}
@@ -6877,7 +6877,7 @@ READ32_DEVICE_HANDLER( k056832_6bpp_rom_long_r )
return k056832_rom_read_b(device, offset * 4 + 3, 4, 6, 0);
else
{
- //LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space->device().safe_pc(), mem_mask));
+ //LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", space.device().safe_pc(), mem_mask));
}
return 0;
}
@@ -9368,7 +9368,7 @@ READ32_DEVICE_HANDLER( k001005_r )
}
default:
- //mame_printf_debug("k001005->r: %08X, %08X at %08X\n", offset, mem_mask, space->device().safe_pc());
+ //mame_printf_debug("k001005->r: %08X, %08X at %08X\n", offset, mem_mask, space.device().safe_pc());
break;
}
return 0;
@@ -9401,7 +9401,7 @@ WRITE32_DEVICE_HANDLER( k001005_w )
sharc_set_flag_input(k001005->dsp, 1, ASSERT_LINE);
}
- // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, space->device().safe_pc());
+ // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, space.device().safe_pc());
k001005->fifo[k001005->fifo_write_ptr] = data;
k001005->fifo_write_ptr++;
k001005->fifo_write_ptr &= 0x7ff;
@@ -9465,7 +9465,7 @@ WRITE32_DEVICE_HANDLER( k001005_w )
break;
default:
- //mame_printf_debug("k001005->w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space->device().safe_pc());
+ //mame_printf_debug("k001005->w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
break;
}
@@ -10478,7 +10478,7 @@ WRITE32_DEVICE_HANDLER( k001604_reg_w )
if (offset != 0x08 && offset != 0x09 && offset != 0x0a /*&& offset != 0x17 && offset != 0x18*/)
{
- //printf("K001604_reg_w (%d), %02X, %08X, %08X at %08X\n", chip, offset, data, mem_mask, space->device().safe_pc());
+ //printf("K001604_reg_w (%d), %02X, %08X, %08X at %08X\n", chip, offset, data, mem_mask, space.device().safe_pc());
}
}
diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c
index a5f3db38699..9dd2336843d 100644
--- a/src/mame/video/leland.c
+++ b/src/mame/video/leland.c
@@ -131,9 +131,9 @@ WRITE8_DEVICE_HANDLER( leland_gfx_port_w )
*
*************************************/
-static void leland_video_addr_w(address_space *space, int offset, int data, int num)
+static void leland_video_addr_w(address_space &space, int offset, int data, int num)
{
- leland_state *drvstate = space->machine().driver_data<leland_state>();
+ leland_state *drvstate = space.machine().driver_data<leland_state>();
struct vram_state_data *state = drvstate->m_vram_state + num;
if (!offset)
@@ -150,9 +150,9 @@ static void leland_video_addr_w(address_space *space, int offset, int data, int
*
*************************************/
-static int leland_vram_port_r(address_space *space, int offset, int num)
+static int leland_vram_port_r(address_space &space, int offset, int num)
{
- leland_state *drvstate = space->machine().driver_data<leland_state>();
+ leland_state *drvstate = space.machine().driver_data<leland_state>();
struct vram_state_data *state = drvstate->m_vram_state + num;
int addr = state->m_addr;
int inc = (offset >> 2) & 2;
@@ -178,14 +178,14 @@ static int leland_vram_port_r(address_space *space, int offset, int num)
default:
logerror("%s: Warning: Unknown video port %02x read (address=%04x)\n",
- space->machine().describe_context(), offset, addr);
+ space.machine().describe_context(), offset, addr);
ret = 0;
break;
}
state->m_addr = addr;
if (LOG_COMM && addr >= 0xf000)
- logerror("%s:%s comm read %04X = %02X\n", space->machine().describe_context(), num ? "slave" : "master", addr, ret);
+ logerror("%s:%s comm read %04X = %02X\n", space.machine().describe_context(), num ? "slave" : "master", addr, ret);
return ret;
}
@@ -198,9 +198,9 @@ static int leland_vram_port_r(address_space *space, int offset, int num)
*
*************************************/
-static void leland_vram_port_w(address_space *space, int offset, int data, int num)
+static void leland_vram_port_w(address_space &space, int offset, int data, int num)
{
- leland_state *drvstate = space->machine().driver_data<leland_state>();
+ leland_state *drvstate = space.machine().driver_data<leland_state>();
UINT8 *video_ram = drvstate->m_video_ram;
struct vram_state_data *state = drvstate->m_vram_state + num;
int addr = state->m_addr;
@@ -209,12 +209,12 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n
/* don't fully understand why this is needed. Isn't the
video RAM just one big RAM? */
- int scanline = space->machine().primary_screen->vpos();
+ int scanline = space.machine().primary_screen->vpos();
if (scanline > 0)
- space->machine().primary_screen->update_partial(scanline - 1);
+ space.machine().primary_screen->update_partial(scanline - 1);
if (LOG_COMM && addr >= 0xf000)
- logerror("%s:%s comm write %04X = %02X\n", space->machine().describe_context(), num ? "slave" : "master", addr, data);
+ logerror("%s:%s comm write %04X = %02X\n", space.machine().describe_context(), num ? "slave" : "master", addr, data);
/* based on the low 3 bits of the offset, update the destination */
switch (offset & 7)
@@ -266,7 +266,7 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n
default:
logerror("%s:Warning: Unknown video port write (address=%04x value=%02x)\n",
- space->machine().describe_context(), offset, addr);
+ space.machine().describe_context(), offset, addr);
break;
}
@@ -284,13 +284,13 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n
WRITE8_MEMBER(leland_state::leland_master_video_addr_w)
{
- leland_video_addr_w(&space, offset, data, 0);
+ leland_video_addr_w(space, offset, data, 0);
}
static TIMER_CALLBACK( leland_delayed_mvram_w )
{
- address_space *space = machine.device("master")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("master")->memory().space(AS_PROGRAM);
int num = (param >> 16) & 1;
int offset = (param >> 8) & 0xff;
@@ -307,7 +307,7 @@ WRITE8_MEMBER(leland_state::leland_mvram_port_w)
READ8_MEMBER(leland_state::leland_mvram_port_r)
{
- return leland_vram_port_r(&space, offset, 0);
+ return leland_vram_port_r(space, offset, 0);
}
@@ -320,19 +320,19 @@ READ8_MEMBER(leland_state::leland_mvram_port_r)
WRITE8_MEMBER(leland_state::leland_slave_video_addr_w)
{
- leland_video_addr_w(&space, offset, data, 1);
+ leland_video_addr_w(space, offset, data, 1);
}
WRITE8_MEMBER(leland_state::leland_svram_port_w)
{
- leland_vram_port_w(&space, offset, data, 1);
+ leland_vram_port_w(space, offset, data, 1);
}
READ8_MEMBER(leland_state::leland_svram_port_r)
{
- return leland_vram_port_r(&space, offset, 1);
+ return leland_vram_port_r(space, offset, 1);
}
@@ -353,7 +353,7 @@ WRITE8_MEMBER(leland_state::ataxx_mvram_port_w)
WRITE8_MEMBER(leland_state::ataxx_svram_port_w)
{
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
- leland_vram_port_w(&space, offset, data, 1);
+ leland_vram_port_w(space, offset, data, 1);
}
@@ -367,14 +367,14 @@ WRITE8_MEMBER(leland_state::ataxx_svram_port_w)
READ8_MEMBER(leland_state::ataxx_mvram_port_r)
{
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
- return leland_vram_port_r(&space, offset, 0);
+ return leland_vram_port_r(space, offset, 0);
}
READ8_MEMBER(leland_state::ataxx_svram_port_r)
{
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
- return leland_vram_port_r(&space, offset, 1);
+ return leland_vram_port_r(space, offset, 1);
}
diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c
index 9c2e6697d55..8c77ac898d9 100644
--- a/src/mame/video/lordgun.c
+++ b/src/mame/video/lordgun.c
@@ -75,17 +75,17 @@ TILE_GET_INFO_MEMBER(lordgun_state::get_tile_info_1){ get_tile_info(machine(), t
TILE_GET_INFO_MEMBER(lordgun_state::get_tile_info_2){ get_tile_info(machine(), tileinfo, tile_index, 2); }
TILE_GET_INFO_MEMBER(lordgun_state::get_tile_info_3){ get_tile_info(machine(), tileinfo, tile_index, 3); }
-INLINE void lordgun_vram_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int _N_)
+INLINE void lordgun_vram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int _N_)
{
- lordgun_state *state = space->machine().driver_data<lordgun_state>();
+ lordgun_state *state = space.machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->m_vram[_N_][offset]);
state->m_tilemap[_N_]->mark_tile_dirty(offset/2);
}
-WRITE16_MEMBER(lordgun_state::lordgun_vram_0_w){ lordgun_vram_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(lordgun_state::lordgun_vram_1_w){ lordgun_vram_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(lordgun_state::lordgun_vram_2_w){ lordgun_vram_w(&space, offset, data, mem_mask, 2); }
-WRITE16_MEMBER(lordgun_state::lordgun_vram_3_w){ lordgun_vram_w(&space, offset, data, mem_mask, 3); }
+WRITE16_MEMBER(lordgun_state::lordgun_vram_0_w){ lordgun_vram_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(lordgun_state::lordgun_vram_1_w){ lordgun_vram_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(lordgun_state::lordgun_vram_2_w){ lordgun_vram_w(space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(lordgun_state::lordgun_vram_3_w){ lordgun_vram_w(space, offset, data, mem_mask, 3); }
/***************************************************************************
diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c
index 892f0d46f39..0775ea593b9 100644
--- a/src/mame/video/mcd212.c
+++ b/src/mame/video/mcd212.c
@@ -1353,7 +1353,7 @@ static void mcd212_draw_scanline(mcd212_regs_t *mcd212, int y)
READ16_HANDLER( mcd212_r )
{
- cdi_state *state = space->machine().driver_data<cdi_state>();
+ cdi_state *state = space.machine().driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->m_mcd212_regs;
UINT8 channel = 1 - (offset / 8);
@@ -1363,7 +1363,7 @@ READ16_HANDLER( mcd212_r )
case 0x10/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine(), 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, mcd212->channel[1 - (offset / 8)].csrr, mem_mask);
+ verboselog(space.machine(), 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, mcd212->channel[1 - (offset / 8)].csrr, mem_mask);
if(channel == 0)
{
return mcd212->channel[0].csrr;
@@ -1376,38 +1376,38 @@ READ16_HANDLER( mcd212_r )
mcd212->channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2);
if(interrupt1)
{
- space->machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (interrupt1 - 1), CLEAR_LINE);
+ space.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (interrupt1 - 1), CLEAR_LINE);
}
//if(interrupt2)
//{
- // space->machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (interrupt2 - 1), CLEAR_LINE);
+ // space.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_1 + (interrupt2 - 1), CLEAR_LINE);
//}
return old_csr;
}
}
else
{
- verboselog(space->machine(), 2, "mcd212_r: Unknown Register %d: %04x\n", channel + 1, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_r: Unknown Register %d: %04x\n", channel + 1, mem_mask);
}
break;
case 0x02/2:
case 0x12/2:
- verboselog(space->machine(), 2, "mcd212_r: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcr, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_r: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcr, mem_mask);
return mcd212->channel[1 - (offset / 8)].dcr;
case 0x04/2:
case 0x14/2:
- verboselog(space->machine(), 2, "mcd212_r: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].vsr, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_r: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].vsr, mem_mask);
return mcd212->channel[1 - (offset / 8)].vsr;
case 0x08/2:
case 0x18/2:
- verboselog(space->machine(), 2, "mcd212_r: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].ddr, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_r: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].ddr, mem_mask);
return mcd212->channel[1 - (offset / 8)].ddr;
case 0x0a/2:
case 0x1a/2:
- verboselog(space->machine(), 2, "mcd212_r: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcp, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_r: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcp, mem_mask);
return mcd212->channel[1 - (offset / 8)].dcp;
default:
- verboselog(space->machine(), 2, "mcd212_r: Unknown Register %d & %04x\n", (1 - (offset / 8)) + 1, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_r: Unknown Register %d & %04x\n", (1 - (offset / 8)) + 1, mem_mask);
break;
}
@@ -1416,40 +1416,40 @@ READ16_HANDLER( mcd212_r )
WRITE16_HANDLER( mcd212_w )
{
- cdi_state *state = space->machine().driver_data<cdi_state>();
+ cdi_state *state = space.machine().driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->m_mcd212_regs;
switch(offset)
{
case 0x00/2:
case 0x10/2:
- verboselog(space->machine(), 2, "mcd212_w: Status Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_w: Status Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].csrw);
- mcd212_update_visible_area(space->machine());
+ mcd212_update_visible_area(space.machine());
break;
case 0x02/2:
case 0x12/2:
- verboselog(space->machine(), 2, "mcd212_w: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_w: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].dcr);
- mcd212_update_visible_area(space->machine());
+ mcd212_update_visible_area(space.machine());
break;
case 0x04/2:
case 0x14/2:
- verboselog(space->machine(), 2, "mcd212_w: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_w: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].vsr);
break;
case 0x08/2:
case 0x18/2:
- verboselog(space->machine(), 2, "mcd212_w: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_w: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].ddr);
break;
case 0x0a/2:
case 0x1a/2:
- verboselog(space->machine(), 2, "mcd212_w: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_w: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].dcp);
break;
default:
- verboselog(space->machine(), 2, "mcd212_w: Unknown Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space.machine(), 2, "mcd212_w: Unknown Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
break;
}
}
diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c
index a8c8d47c7dc..d3e46b01adb 100644
--- a/src/mame/video/megasys1.c
+++ b/src/mame/video/megasys1.c
@@ -290,9 +290,9 @@ VIDEO_START_MEMBER(megasys1_state,megasys1)
#define TILES_PER_PAGE_Y (0x20)
#define TILES_PER_PAGE (TILES_PER_PAGE_X * TILES_PER_PAGE_Y)
-INLINE void scrollram_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
+INLINE void scrollram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
{
- megasys1_state *state = space->machine().driver_data<megasys1_state>();
+ megasys1_state *state = space.machine().driver_data<megasys1_state>();
COMBINE_DATA(&state->m_scrollram[which][offset]);
if (offset < 0x40000/2 && state->m_tmap[which])
{
@@ -310,9 +310,9 @@ INLINE void scrollram_w(address_space *space, offs_t offset, UINT16 data, UINT16
}
}
-WRITE16_MEMBER(megasys1_state::megasys1_scrollram_0_w){ scrollram_w(&space, offset, data, mem_mask, 0); }
-WRITE16_MEMBER(megasys1_state::megasys1_scrollram_1_w){ scrollram_w(&space, offset, data, mem_mask, 1); }
-WRITE16_MEMBER(megasys1_state::megasys1_scrollram_2_w){ scrollram_w(&space, offset, data, mem_mask, 2); }
+WRITE16_MEMBER(megasys1_state::megasys1_scrollram_0_w){ scrollram_w(space, offset, data, mem_mask, 0); }
+WRITE16_MEMBER(megasys1_state::megasys1_scrollram_1_w){ scrollram_w(space, offset, data, mem_mask, 1); }
+WRITE16_MEMBER(megasys1_state::megasys1_scrollram_2_w){ scrollram_w(space, offset, data, mem_mask, 2); }
diff --git a/src/mame/video/midtunit.c b/src/mame/video/midtunit.c
index a79537bedc8..3e347f60243 100644
--- a/src/mame/video/midtunit.c
+++ b/src/mame/video/midtunit.c
@@ -223,13 +223,13 @@ READ16_MEMBER(midtunit_state::midtunit_vram_color_r)
*
*************************************/
-void midtunit_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void midtunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
memcpy(shiftreg, &local_videoram[address >> 3], 2 * 512 * sizeof(UINT16));
}
-void midtunit_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void midtunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
memcpy(&local_videoram[address >> 3], shiftreg, 2 * 512 * sizeof(UINT16));
}
diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c
index 09898758bf9..2feef260dea 100644
--- a/src/mame/video/midyunit.c
+++ b/src/mame/video/midyunit.c
@@ -171,16 +171,16 @@ READ16_MEMBER(midyunit_state::midyunit_vram_r)
*
*************************************/
-void midyunit_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void midyunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- midyunit_state *state = space->machine().driver_data<midyunit_state>();
+ midyunit_state *state = space.machine().driver_data<midyunit_state>();
memcpy(shiftreg, &state->m_local_videoram[address >> 3], 2 * 512 * sizeof(UINT16));
}
-void midyunit_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
+void midyunit_from_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg)
{
- midyunit_state *state = space->machine().driver_data<midyunit_state>();
+ midyunit_state *state = space.machine().driver_data<midyunit_state>();
memcpy(&state->m_local_videoram[address >> 3], shiftreg, 2 * 512 * sizeof(UINT16));
}
diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c
index e08768524b5..769bf5a5a96 100644
--- a/src/mame/video/midzeus2.c
+++ b/src/mame/video/midzeus2.c
@@ -419,7 +419,7 @@ if (screen.machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmes
READ32_HANDLER( zeus2_r )
{
int logit = (offset != 0x00 && offset != 0x01 && offset != 0x54 && offset != 0x48 && offset != 0x49 && offset != 0x58 && offset != 0x59 && offset != 0x5a);
- midzeus_state *state = space->machine().driver_data<midzeus_state>();
+ midzeus_state *state = space.machine().driver_data<midzeus_state>();
UINT32 result = state->m_zeusbase[offset];
#if TRACK_REG_USAGE
@@ -427,7 +427,7 @@ READ32_HANDLER( zeus2_r )
#endif
if (logit)
- logerror("%06X:zeus2_r(%02X)\n", space->device().safe_pc(), offset);
+ logerror("%06X:zeus2_r(%02X)\n", space.device().safe_pc(), offset);
switch (offset)
{
@@ -440,7 +440,7 @@ READ32_HANDLER( zeus2_r )
/* bits $00080000 is tested in a loop until 0 */
/* bit $00000004 is tested for toggling; probably VBLANK */
result = 0x00;
- if (space->machine().primary_screen->vblank())
+ if (space.machine().primary_screen->vblank())
result |= 0x04;
break;
@@ -451,7 +451,7 @@ READ32_HANDLER( zeus2_r )
case 0x54:
/* both upper 16 bits and lower 16 bits seem to be used as vertical counters */
- result = (space->machine().primary_screen->vpos() << 16) | space->machine().primary_screen->vpos();
+ result = (space.machine().primary_screen->vpos() << 16) | space.machine().primary_screen->vpos();
break;
}
@@ -473,8 +473,8 @@ WRITE32_HANDLER( zeus2_w )
offset != 0x40 && offset != 0x41 && offset != 0x48 && offset != 0x49 && offset != 0x4e &&
offset != 0x50 && offset != 0x51 && offset != 0x57 && offset != 0x58 && offset != 0x59 && offset != 0x5a && offset != 0x5e);
if (logit)
- logerror("%06X:zeus2_w", space->device().safe_pc());
- zeus_register32_w(space->machine(), offset, data, logit);
+ logerror("%06X:zeus2_w", space.device().safe_pc());
+ zeus_register32_w(space.machine(), offset, data, logit);
}
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index 38e0c4abbd3..a5d5b1122d4 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -772,68 +772,68 @@ void real3d_display_list_end(running_machine &machine)
//state->m_real3d_display_list = 1;
}
-void real3d_display_list1_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
+void real3d_display_list1_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine().driver_data<model3_state>();
+ model3_state *state = space.machine().driver_data<model3_state>();
int i;
int d = (dst & 0xffffff) / 4;
for(i=0; i < length; i+=4) {
UINT32 w;
if (byteswap) {
- w = BYTE_REVERSE32(space->read_dword(src));
+ w = BYTE_REVERSE32(space.read_dword(src));
} else {
- w = space->read_dword(src);
+ w = space.read_dword(src);
}
state->m_display_list_ram[d++] = w;
src += 4;
}
}
-void real3d_display_list2_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
+void real3d_display_list2_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine().driver_data<model3_state>();
+ model3_state *state = space.machine().driver_data<model3_state>();
int i;
int d = (dst & 0xffffff) / 4;
for(i=0; i < length; i+=4) {
UINT32 w;
if (byteswap) {
- w = BYTE_REVERSE32(space->read_dword(src));
+ w = BYTE_REVERSE32(space.read_dword(src));
} else {
- w = space->read_dword(src);
+ w = space.read_dword(src);
}
state->m_culling_ram[d++] = w;
src += 4;
}
}
-void real3d_vrom_texture_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
+void real3d_vrom_texture_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine().driver_data<model3_state>();
+ model3_state *state = space.machine().driver_data<model3_state>();
if((dst & 0xff) == 0) {
UINT32 address, header;
if (byteswap) {
- address = BYTE_REVERSE32(space->read_dword((src+0)));
- header = BYTE_REVERSE32(space->read_dword((src+4)));
+ address = BYTE_REVERSE32(space.read_dword((src+0)));
+ header = BYTE_REVERSE32(space.read_dword((src+4)));
} else {
- address = space->read_dword((src+0));
- header = space->read_dword((src+4));
+ address = space.read_dword((src+0));
+ header = space.read_dword((src+4));
}
- real3d_upload_texture(space->machine(), header, (UINT32*)&state->m_vrom[address]);
+ real3d_upload_texture(space.machine(), header, (UINT32*)&state->m_vrom[address]);
}
}
-void real3d_texture_fifo_dma(address_space *space, UINT32 src, int length, int byteswap)
+void real3d_texture_fifo_dma(address_space &space, UINT32 src, int length, int byteswap)
{
- model3_state *state = space->machine().driver_data<model3_state>();
+ model3_state *state = space.machine().driver_data<model3_state>();
int i;
for(i=0; i < length; i+=4) {
UINT32 w;
if (byteswap) {
- w = BYTE_REVERSE32(space->read_dword(src));
+ w = BYTE_REVERSE32(space.read_dword(src));
} else {
- w = space->read_dword(src);
+ w = space.read_dword(src);
}
state->m_texture_fifo[state->m_texture_fifo_pos] = w;
state->m_texture_fifo_pos++;
@@ -841,17 +841,17 @@ void real3d_texture_fifo_dma(address_space *space, UINT32 src, int length, int b
}
}
-void real3d_polygon_ram_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
+void real3d_polygon_ram_dma(address_space &space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine().driver_data<model3_state>();
+ model3_state *state = space.machine().driver_data<model3_state>();
int i;
int d = (dst & 0xffffff) / 4;
for(i=0; i < length; i+=4) {
UINT32 w;
if (byteswap) {
- w = BYTE_REVERSE32(space->read_dword(src));
+ w = BYTE_REVERSE32(space.read_dword(src));
} else {
- w = space->read_dword(src);
+ w = space.read_dword(src);
}
state->m_polygon_ram[d++] = w;
src += 4;
diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c
index 096e0bdd7f9..cacd9636b63 100644
--- a/src/mame/video/namcos1.c
+++ b/src/mame/video/namcos1.c
@@ -171,13 +171,13 @@ void namcos1_state::video_start()
READ8_HANDLER( namcos1_videoram_r )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
return state->m_videoram[offset];
}
WRITE8_HANDLER( namcos1_videoram_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
state->m_videoram[offset] = data;
if (offset < 0x7000)
{ /* background 0-3 */
@@ -197,7 +197,7 @@ WRITE8_HANDLER( namcos1_videoram_w )
WRITE8_HANDLER( namcos1_paletteram_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
if (state->m_paletteram[offset] == data)
return;
@@ -212,7 +212,7 @@ WRITE8_HANDLER( namcos1_paletteram_w )
r = state->m_paletteram[offset];
g = state->m_paletteram[offset + 0x0800];
b = state->m_paletteram[offset + 0x1000];
- palette_set_color(space->machine(),color,MAKE_RGB(r,g,b));
+ palette_set_color(space.machine(),color,MAKE_RGB(r,g,b));
}
else
{
@@ -235,7 +235,7 @@ WRITE8_HANDLER( namcos1_paletteram_w )
READ8_HANDLER( namcos1_spriteram_r )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
/* 0000-07ff work ram */
/* 0800-0fff sprite ram */
if (offset < 0x1000)
@@ -247,7 +247,7 @@ READ8_HANDLER( namcos1_spriteram_r )
WRITE8_HANDLER( namcos1_spriteram_w )
{
- namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ namcos1_state *state = space.machine().driver_data<namcos1_state>();
/* 0000-07ff work ram */
/* 0800-0fff sprite ram */
if (offset < 0x1000)
diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c
index a0e5ae438d7..2b47aabecce 100644
--- a/src/mame/video/namcos2.c
+++ b/src/mame/video/namcos2.c
@@ -288,9 +288,9 @@ WRITE16_MEMBER( namcos2_state::rozram_word_w )
{
COMBINE_DATA(&m_rozram[offset]);
m_tilemap_roz->mark_tile_dirty(offset);
-// if( space->machine().input().code_pressed(KEYCODE_Q) )
+// if( space.machine().input().code_pressed(KEYCODE_Q) )
// {
-// debugger_break(space->machine());
+// debugger_break(space.machine());
// }
}
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 7d8b1b98210..1362c7a4945 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -47,7 +47,7 @@
#define ALLOW_MEMDUMP 0
#if ALLOW_MEMDUMP
-static void Dump( address_space *space, FILE *f, unsigned addr1, unsigned addr2, const char *name )
+static void Dump( address_space &space, FILE *f, unsigned addr1, unsigned addr2, const char *name )
{
unsigned addr;
fprintf( f, "%s:\n", name );
@@ -58,7 +58,7 @@ static void Dump( address_space *space, FILE *f, unsigned addr1, unsigned addr2,
int i;
for( i=0; i<16; i++ )
{
- data[i] = space->read_byte(addr+i );
+ data[i] = space.read_byte(addr+i );
if( data[i] )
{
bHasNonZero = 1;
@@ -2814,7 +2814,7 @@ SCREEN_UPDATE_RGB32( namcos22s )
FILE *f = fopen( "dump.txt", "wb" );
if( f )
{
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
if (1) // czram
{
@@ -2879,7 +2879,7 @@ SCREEN_UPDATE_RGB32( namcos22 )
FILE *f = fopen( "dump.txt", "wb" );
if( f )
{
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
//Dump(space, f,0x90000000, 0x90000003, "led?" );
Dump(space, f,0x90010000, 0x90017fff, "cz_ram");
diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c
index a606ace215b..a822984ed0b 100644
--- a/src/mame/video/namcos86.c
+++ b/src/mame/video/namcos86.c
@@ -187,9 +187,9 @@ WRITE8_MEMBER(namcos86_state::rthunder_tilebank_select_w)
}
}
-static void scroll_w(address_space *space, int offset, int data, int layer)
+static void scroll_w(address_space &space, int offset, int data, int layer)
{
- namcos86_state *state = space->machine().driver_data<namcos86_state>();
+ namcos86_state *state = space.machine().driver_data<namcos86_state>();
switch (offset)
{
case 0:
@@ -206,19 +206,19 @@ static void scroll_w(address_space *space, int offset, int data, int layer)
WRITE8_MEMBER(namcos86_state::rthunder_scroll0_w)
{
- scroll_w(&space,offset,data,0);
+ scroll_w(space,offset,data,0);
}
WRITE8_MEMBER(namcos86_state::rthunder_scroll1_w)
{
- scroll_w(&space,offset,data,1);
+ scroll_w(space,offset,data,1);
}
WRITE8_MEMBER(namcos86_state::rthunder_scroll2_w)
{
- scroll_w(&space,offset,data,2);
+ scroll_w(space,offset,data,2);
}
WRITE8_MEMBER(namcos86_state::rthunder_scroll3_w)
{
- scroll_w(&space,offset,data,3);
+ scroll_w(space,offset,data,3);
}
WRITE8_MEMBER(namcos86_state::rthunder_backcolor_w)
diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c
index 054f02b9ea0..8b667bb8709 100644
--- a/src/mame/video/nbmj8688.c
+++ b/src/mame/video/nbmj8688.c
@@ -594,15 +594,15 @@ Hitachi HD61830B LCD controller.
******************************************************************************/
-static void nbmj8688_HD61830B_instr_w(address_space *space,int offset,int data,int chip)
+static void nbmj8688_HD61830B_instr_w(address_space &space,int offset,int data,int chip)
{
- nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space.machine().driver_data<nbmj8688_state>();
state->m_HD61830B_instr[chip] = data;
}
-static void nbmj8688_HD61830B_data_w(address_space *space,int offset,int data,int chip)
+static void nbmj8688_HD61830B_data_w(address_space &space,int offset,int data,int chip)
{
- nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space.machine().driver_data<nbmj8688_state>();
switch (state->m_HD61830B_instr[chip])
{
case 0x0a: // set cursor address (low order)
@@ -622,34 +622,34 @@ logerror("HD61830B unsupported instruction %02x %02x\n",state->m_HD61830B_instr[
WRITE8_MEMBER(nbmj8688_state::nbmj8688_HD61830B_0_instr_w)
{
- nbmj8688_HD61830B_instr_w(&space,offset,data,0);
+ nbmj8688_HD61830B_instr_w(space,offset,data,0);
}
WRITE8_MEMBER(nbmj8688_state::nbmj8688_HD61830B_1_instr_w)
{
- nbmj8688_HD61830B_instr_w(&space,offset,data,1);
+ nbmj8688_HD61830B_instr_w(space,offset,data,1);
}
WRITE8_MEMBER(nbmj8688_state::nbmj8688_HD61830B_both_instr_w)
{
- nbmj8688_HD61830B_instr_w(&space,offset,data,0);
- nbmj8688_HD61830B_instr_w(&space,offset,data,1);
+ nbmj8688_HD61830B_instr_w(space,offset,data,0);
+ nbmj8688_HD61830B_instr_w(space,offset,data,1);
}
WRITE8_MEMBER(nbmj8688_state::nbmj8688_HD61830B_0_data_w)
{
- nbmj8688_HD61830B_data_w(&space,offset,data,0);
+ nbmj8688_HD61830B_data_w(space,offset,data,0);
}
WRITE8_MEMBER(nbmj8688_state::nbmj8688_HD61830B_1_data_w)
{
- nbmj8688_HD61830B_data_w(&space,offset,data,1);
+ nbmj8688_HD61830B_data_w(space,offset,data,1);
}
WRITE8_MEMBER(nbmj8688_state::nbmj8688_HD61830B_both_data_w)
{
- nbmj8688_HD61830B_data_w(&space,offset,data,0);
- nbmj8688_HD61830B_data_w(&space,offset,data,1);
+ nbmj8688_HD61830B_data_w(space,offset,data,0);
+ nbmj8688_HD61830B_data_w(space,offset,data,1);
}
diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c
index 28b8472216d..f4058442c40 100644
--- a/src/mame/video/nbmj9195.c
+++ b/src/mame/video/nbmj9195.c
@@ -68,9 +68,9 @@ WRITE8_MEMBER(nbmj9195_state::nbmj9195_nb22090_palette_w)
******************************************************************************/
-static int nbmj9195_blitter_r(address_space *space, int offset, int vram)
+static int nbmj9195_blitter_r(address_space &space, int offset, int vram)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
int ret;
UINT8 *GFXROM = state->memregion("gfx1")->base();
@@ -84,9 +84,9 @@ static int nbmj9195_blitter_r(address_space *space, int offset, int vram)
return ret;
}
-static void nbmj9195_blitter_w(address_space *space, int offset, int data, int vram)
+static void nbmj9195_blitter_w(address_space &space, int offset, int data, int vram)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
int new_line;
switch (offset)
@@ -99,11 +99,11 @@ static void nbmj9195_blitter_w(address_space *space, int offset, int data, int v
// if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)");
state->m_flipscreen[vram] = (data & 0x40) ? 0 : 1;
state->m_dispflag[vram] = (data & 0x80) ? 1 : 0;
- nbmj9195_vramflip(space->machine(), vram);
+ nbmj9195_vramflip(space.machine(), vram);
break;
case 0x01: state->m_scrollx[vram] = (state->m_scrollx[vram] & 0x0100) | data; break;
case 0x02: state->m_scrollx[vram] = (state->m_scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100);
- new_line = space->machine().primary_screen->vpos();
+ new_line = space.machine().primary_screen->vpos();
if (state->m_flipscreen[vram])
{
for ( ; state->m_scanline[vram] < new_line; state->m_scanline[vram]++)
@@ -126,27 +126,27 @@ static void nbmj9195_blitter_w(address_space *space, int offset, int data, int v
case 0x0b: state->m_blitter_destx[vram] = (state->m_blitter_destx[vram] & 0x00ff) | (data << 8); break;
case 0x0c: state->m_blitter_desty[vram] = (state->m_blitter_desty[vram] & 0xff00) | data; break;
case 0x0d: state->m_blitter_desty[vram] = (state->m_blitter_desty[vram] & 0x00ff) | (data << 8);
- nbmj9195_gfxdraw(space->machine(), vram);
+ nbmj9195_gfxdraw(space.machine(), vram);
break;
default: break;
}
}
-void nbmj9195_clutsel_w(address_space *space, int data)
+void nbmj9195_clutsel_w(address_space &space, int data)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
state->m_clutsel = data;
}
-static void nbmj9195_clut_w(address_space *space, int offset, int data, int vram)
+static void nbmj9195_clut_w(address_space &space, int offset, int data, int vram)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
state->m_clut[vram][((state->m_clutsel & 0xff) * 0x10) + (offset & 0x0f)] = data;
}
-void nbmj9195_gfxflag2_w(address_space *space, int data)
+void nbmj9195_gfxflag2_w(address_space &space, int data)
{
- nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space.machine().driver_data<nbmj9195_state>();
state->m_gfxflag2 = data;
}
@@ -371,14 +371,14 @@ static void nbmj9195_gfxdraw(running_machine &machine, int vram)
******************************************************************************/
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_blitter_0_w){ nbmj9195_blitter_w(&space, offset, data, 0); }
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_blitter_1_w){ nbmj9195_blitter_w(&space, offset, data, 1); }
+WRITE8_MEMBER(nbmj9195_state::nbmj9195_blitter_0_w){ nbmj9195_blitter_w(space, offset, data, 0); }
+WRITE8_MEMBER(nbmj9195_state::nbmj9195_blitter_1_w){ nbmj9195_blitter_w(space, offset, data, 1); }
-READ8_MEMBER(nbmj9195_state::nbmj9195_blitter_0_r){ return nbmj9195_blitter_r(&space, offset, 0); }
-READ8_MEMBER(nbmj9195_state::nbmj9195_blitter_1_r){ return nbmj9195_blitter_r(&space, offset, 1); }
+READ8_MEMBER(nbmj9195_state::nbmj9195_blitter_0_r){ return nbmj9195_blitter_r(space, offset, 0); }
+READ8_MEMBER(nbmj9195_state::nbmj9195_blitter_1_r){ return nbmj9195_blitter_r(space, offset, 1); }
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_0_w){ nbmj9195_clut_w(&space, offset, data, 0); }
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_1_w){ nbmj9195_clut_w(&space, offset, data, 1); }
+WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_0_w){ nbmj9195_clut_w(space, offset, data, 0); }
+WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_1_w){ nbmj9195_clut_w(space, offset, data, 1); }
/******************************************************************************
diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c
index 8a49ec95adf..e236b4d88b9 100644
--- a/src/mame/video/neogeo.c
+++ b/src/mame/video/neogeo.c
@@ -829,8 +829,8 @@ WRITE16_MEMBER(neogeo_state::neogeo_video_register_w)
case 0x01: set_videoram_data(machine(), data); break;
case 0x02: set_videoram_modulo(machine(), data); break;
case 0x03: set_video_control(machine(), data); break;
- case 0x04: neogeo_set_display_counter_msb(&space, data); break;
- case 0x05: neogeo_set_display_counter_lsb(&space, data); break;
+ case 0x04: neogeo_set_display_counter_msb(space, data); break;
+ case 0x05: neogeo_set_display_counter_lsb(space, data); break;
case 0x06: neogeo_acknowledge_interrupt(machine(), data); break;
case 0x07: break; /* unknown, see get_video_control */
}
diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c
index 2a5d1bb0f3d..6e87d1204f1 100644
--- a/src/mame/video/ojankohs.c
+++ b/src/mame/video/ojankohs.c
@@ -184,9 +184,9 @@ TILE_GET_INFO_MEMBER(ojankohs_state::ojankoy_get_tile_info)
******************************************************************************/
-void ojankoc_flipscreen( address_space *space, int data )
+void ojankoc_flipscreen( address_space &space, int data )
{
- ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
+ ojankohs_state *state = space.machine().driver_data<ojankohs_state>();
int x, y;
UINT8 color1, color2;
@@ -201,13 +201,13 @@ void ojankoc_flipscreen( address_space *space, int data )
{
color1 = state->m_videoram[0x0000 + ((y * 256) + x)];
color2 = state->m_videoram[0x3fff - ((y * 256) + x)];
- state->ojankoc_videoram_w(*space, 0x0000 + ((y * 256) + x), color2);
- state->ojankoc_videoram_w(*space, 0x3fff - ((y * 256) + x), color1);
+ state->ojankoc_videoram_w(space, 0x0000 + ((y * 256) + x), color2);
+ state->ojankoc_videoram_w(space, 0x3fff - ((y * 256) + x), color1);
color1 = state->m_videoram[0x4000 + ((y * 256) + x)];
color2 = state->m_videoram[0x7fff - ((y * 256) + x)];
- state->ojankoc_videoram_w(*space, 0x4000 + ((y * 256) + x), color2);
- state->ojankoc_videoram_w(*space, 0x7fff - ((y * 256) + x), color1);
+ state->ojankoc_videoram_w(space, 0x4000 + ((y * 256) + x), color2);
+ state->ojankoc_videoram_w(space, 0x7fff - ((y * 256) + x), color1);
}
}
@@ -309,12 +309,12 @@ SCREEN_UPDATE_IND16( ojankoc )
if (state->m_screen_refresh)
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
/* redraw bitmap */
for (offs = 0; offs < 0x8000; offs++)
{
- state->ojankoc_videoram_w(*space, offs, state->m_videoram[offs]);
+ state->ojankoc_videoram_w(space, offs, state->m_videoram[offs]);
}
state->m_screen_refresh = 0;
}
diff --git a/src/mame/video/pastelg.c b/src/mame/video/pastelg.c
index 45082caea6b..b26ea5a0838 100644
--- a/src/mame/video/pastelg.c
+++ b/src/mame/video/pastelg.c
@@ -57,9 +57,9 @@ WRITE8_MEMBER(pastelg_state::pastelg_clut_w)
******************************************************************************/
-int pastelg_blitter_src_addr_r(address_space *space)
+int pastelg_blitter_src_addr_r(address_space &space)
{
- pastelg_state *state = space->machine().driver_data<pastelg_state>();
+ pastelg_state *state = space.machine().driver_data<pastelg_state>();
return state->m_blitter_src_addr;
}
@@ -111,7 +111,7 @@ WRITE8_MEMBER(pastelg_state::pastelg_romsel_w)
int gfxlen = memregion("gfx1")->bytes();
m_gfxrom = ((data & 0xc0) >> 6);
m_palbank = ((data & 0x10) >> 4);
- nb1413m3_sndrombank1_w(&space, 0, data);
+ nb1413m3_sndrombank1_w(space, 0, data);
if ((m_gfxrom << 16) > (gfxlen - 1))
{
diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c
index e6ed97664ec..d81bf8cf600 100644
--- a/src/mame/video/popeye.c
+++ b/src/mame/video/popeye.c
@@ -277,12 +277,12 @@ static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, cons
{
popeye_state *state = machine.driver_data<popeye_state>();
int offs;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_lastflip != state->flip_screen())
{
for (offs = 0;offs < popeye_bitmapram_size;offs++)
- state->popeye_bitmap_w(*space,offs,state->m_bitmapram[offs]);
+ state->popeye_bitmap_w(space,offs,state->m_bitmapram[offs]);
state->m_lastflip = state->flip_screen();
}
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index 5c22d2ad8d1..f9ac115746d 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -1271,19 +1271,19 @@ WRITE8_MEMBER( ppu2c0x_device::write )
*
*************************************/
-void ppu2c0x_device::spriteram_dma( address_space *space, const UINT8 page )
+void ppu2c0x_device::spriteram_dma( address_space &space, const UINT8 page )
{
int i;
int address = page << 8;
for (i = 0; i < SPRITERAM_SIZE; i++)
{
- UINT8 spriteData = space->read_byte(address + i);
- space->write_byte(0x2004, spriteData);
+ UINT8 spriteData = space.read_byte(address + i);
+ space.write_byte(0x2004, spriteData);
}
// should last 513 CPU cycles.
- space->device().execute().adjust_icount(-513);
+ space.device().execute().adjust_icount(-513);
}
/*************************************
diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h
index 392fa48bccc..ae00f035959 100644
--- a/src/mame/video/ppu2c0x.h
+++ b/src/mame/video/ppu2c0x.h
@@ -168,7 +168,7 @@ public:
void render_scanline();
void update_scanline();
- void spriteram_dma(address_space *space, const UINT8 page );
+ void spriteram_dma(address_space &space, const UINT8 page );
void render( bitmap_ind16 &bitmap, int flipx, int flipy, int sx, int sy );
int get_pixel( int x, int y );
diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c
index e3018794b8b..a91af14fa61 100644
--- a/src/mame/video/redclash.c
+++ b/src/mame/video/redclash.c
@@ -102,7 +102,7 @@ PALETTE_INIT_MEMBER(ladybug_state,redclash)
WRITE8_HANDLER( redclash_videoram_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
state->m_videoram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset);
@@ -110,18 +110,18 @@ WRITE8_HANDLER( redclash_videoram_w )
WRITE8_HANDLER( redclash_gfxbank_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
if (state->m_gfxbank != (data & 0x01))
{
state->m_gfxbank = data & 0x01;
- space->machine().tilemap().mark_all_dirty();
+ space.machine().tilemap().mark_all_dirty();
}
}
WRITE8_HANDLER( redclash_flipscreen_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
state->flip_screen_set(data & 0x01);
}
@@ -141,31 +141,31 @@ star_speed:
*/
WRITE8_HANDLER( redclash_star0_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
state->m_star_speed = (state->m_star_speed & ~1) | ((data & 1) << 0);
- redclash_set_stars_speed(space->machine(), state->m_star_speed);
+ redclash_set_stars_speed(space.machine(), state->m_star_speed);
}
WRITE8_HANDLER( redclash_star1_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
state->m_star_speed = (state->m_star_speed & ~2) | ((data & 1) << 1);
- redclash_set_stars_speed(space->machine(), state->m_star_speed);
+ redclash_set_stars_speed(space.machine(), state->m_star_speed);
}
WRITE8_HANDLER( redclash_star2_w )
{
- ladybug_state *state = space->machine().driver_data<ladybug_state>();
+ ladybug_state *state = space.machine().driver_data<ladybug_state>();
state->m_star_speed = (state->m_star_speed & ~4) | ((data & 1) << 2);
- redclash_set_stars_speed(space->machine(), state->m_star_speed);
+ redclash_set_stars_speed(space.machine(), state->m_star_speed);
}
WRITE8_HANDLER( redclash_star_reset_w )
{
- redclash_set_stars_enable(space->machine(), 1);
+ redclash_set_stars_enable(space.machine(), 1);
}
TILE_GET_INFO_MEMBER(ladybug_state::get_fg_tile_info)
diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c
index 4ba1a1fa6f8..3d57f3087a4 100644
--- a/src/mame/video/segaic16.c
+++ b/src/mame/video/segaic16.c
@@ -1264,7 +1264,7 @@ WRITE16_HANDLER( segaic16_textram_0_w )
{
/* certain ranges need immediate updates */
if (offset >= 0xe80/2)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
COMBINE_DATA(&segaic16_textram_0[offset]);
bg_tilemap[0].textmap->mark_tile_dirty(offset);
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index 0d6e9cd4a25..1842dd2e898 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -370,9 +370,9 @@ INLINE void update_color(running_machine &machine, int offset, UINT16 data)
}
-INLINE UINT16 common_paletteram_r(address_space *space, int which, offs_t offset)
+INLINE UINT16 common_paletteram_r(address_space &space, int which, offs_t offset)
{
- segas32_state *state = space->machine().driver_data<segas32_state>();
+ segas32_state *state = space.machine().driver_data<segas32_state>();
int convert;
/* the lower half of palette RAM is formatted xBBBBBGGGGGRRRRR */
@@ -389,9 +389,9 @@ INLINE UINT16 common_paletteram_r(address_space *space, int which, offs_t offset
}
-static void common_paletteram_w(address_space *space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
+static void common_paletteram_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- segas32_state *state = space->machine().driver_data<segas32_state>();
+ segas32_state *state = space.machine().driver_data<segas32_state>();
UINT16 value;
int convert;
@@ -408,7 +408,7 @@ static void common_paletteram_w(address_space *space, int which, offs_t offset,
COMBINE_DATA(&value);
if (convert) value = xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(value);
state->m_system32_paletteram[which][offset] = value;
- update_color(space->machine(), 0x4000*which + offset, value);
+ update_color(space.machine(), 0x4000*which + offset, value);
/* if blending is enabled, writes go to both halves of palette RAM */
if (state->m_mixer_control[which][0x4e/2] & 0x0880)
@@ -421,7 +421,7 @@ static void common_paletteram_w(address_space *space, int which, offs_t offset,
COMBINE_DATA(&value);
if (convert) value = xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(value);
state->m_system32_paletteram[which][offset] = value;
- update_color(space->machine(), 0x4000*which + offset, value);
+ update_color(space.machine(), 0x4000*which + offset, value);
}
}
@@ -435,45 +435,45 @@ static void common_paletteram_w(address_space *space, int which, offs_t offset,
READ16_MEMBER(segas32_state::system32_paletteram_r)
{
- return common_paletteram_r(&space, 0, offset);
+ return common_paletteram_r(space, 0, offset);
}
WRITE16_MEMBER(segas32_state::system32_paletteram_w)
{
- common_paletteram_w(&space, 0, offset, data, mem_mask);
+ common_paletteram_w(space, 0, offset, data, mem_mask);
}
READ32_MEMBER(segas32_state::multi32_paletteram_0_r)
{
- return common_paletteram_r(&space, 0, offset*2+0) |
- (common_paletteram_r(&space, 0, offset*2+1) << 16);
+ return common_paletteram_r(space, 0, offset*2+0) |
+ (common_paletteram_r(space, 0, offset*2+1) << 16);
}
WRITE32_MEMBER(segas32_state::multi32_paletteram_0_w)
{
if (ACCESSING_BITS_0_15)
- common_paletteram_w(&space, 0, offset*2+0, data, mem_mask);
+ common_paletteram_w(space, 0, offset*2+0, data, mem_mask);
if (ACCESSING_BITS_16_31)
- common_paletteram_w(&space, 0, offset*2+1, data >> 16, mem_mask >> 16);
+ common_paletteram_w(space, 0, offset*2+1, data >> 16, mem_mask >> 16);
}
READ32_MEMBER(segas32_state::multi32_paletteram_1_r)
{
- return common_paletteram_r(&space, 1, offset*2+0) |
- (common_paletteram_r(&space, 1, offset*2+1) << 16);
+ return common_paletteram_r(space, 1, offset*2+0) |
+ (common_paletteram_r(space, 1, offset*2+1) << 16);
}
WRITE32_MEMBER(segas32_state::multi32_paletteram_1_w)
{
if (ACCESSING_BITS_0_15)
- common_paletteram_w(&space, 1, offset*2+0, data, mem_mask);
+ common_paletteram_w(space, 1, offset*2+0, data, mem_mask);
if (ACCESSING_BITS_16_31)
- common_paletteram_w(&space, 1, offset*2+1, data >> 16, mem_mask >> 16);
+ common_paletteram_w(space, 1, offset*2+1, data >> 16, mem_mask >> 16);
}
diff --git a/src/mame/video/simpsons.c b/src/mame/video/simpsons.c
index e5818fdc73d..3fb0fa71e1e 100644
--- a/src/mame/video/simpsons.c
+++ b/src/mame/video/simpsons.c
@@ -93,21 +93,21 @@ WRITE8_MEMBER(simpsons_state::simpsons_k053247_w)
void simpsons_video_banking( running_machine &machine, int bank )
{
simpsons_state *state = machine.driver_data<simpsons_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (bank & 1)
{
- space->install_read_bank(0x0000, 0x0fff, "bank5");
- space->install_write_handler(0x0000, 0x0fff, write8_delegate(FUNC(simpsons_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state));
+ space.install_read_bank(0x0000, 0x0fff, "bank5");
+ space.install_write_handler(0x0000, 0x0fff, write8_delegate(FUNC(simpsons_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state));
state->membank("bank5")->set_base(state->m_generic_paletteram_8);
}
else
- space->install_legacy_readwrite_handler(*state->m_k052109, 0x0000, 0x0fff, FUNC(k052109_r), FUNC(k052109_w));
+ space.install_legacy_readwrite_handler(*state->m_k052109, 0x0000, 0x0fff, FUNC(k052109_r), FUNC(k052109_w));
if (bank & 2)
- space->install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k053247_r),state), write8_delegate(FUNC(simpsons_state::simpsons_k053247_w),state));
+ space.install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k053247_r),state), write8_delegate(FUNC(simpsons_state::simpsons_k053247_w),state));
else
- space->install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k052109_r),state), write8_delegate(FUNC(simpsons_state::simpsons_k052109_w),state));
+ space.install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k052109_r),state), write8_delegate(FUNC(simpsons_state::simpsons_k052109_w),state));
}
diff --git a/src/mame/video/skullxbo.c b/src/mame/video/skullxbo.c
index 96c8650ca26..e20521e172c 100644
--- a/src/mame/video/skullxbo.c
+++ b/src/mame/video/skullxbo.c
@@ -103,7 +103,7 @@ VIDEO_START_MEMBER(skullxbo_state,skullxbo)
WRITE16_HANDLER( skullxbo_xscroll_w )
{
- skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
+ skullxbo_state *state = space.machine().driver_data<skullxbo_state>();
/* combine data */
UINT16 oldscroll = *state->m_xscroll;
@@ -112,7 +112,7 @@ WRITE16_HANDLER( skullxbo_xscroll_w )
/* if something changed, force an update */
if (oldscroll != newscroll)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* adjust the actual scrolls */
state->m_playfield_tilemap->set_scrollx(0, 2 * (newscroll >> 7));
@@ -125,10 +125,10 @@ WRITE16_HANDLER( skullxbo_xscroll_w )
WRITE16_HANDLER( skullxbo_yscroll_w )
{
- skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
+ skullxbo_state *state = space.machine().driver_data<skullxbo_state>();
/* combine data */
- int scanline = space->machine().primary_screen->vpos();
+ int scanline = space.machine().primary_screen->vpos();
UINT16 oldscroll = *state->m_yscroll;
UINT16 newscroll = oldscroll;
UINT16 effscroll;
@@ -136,10 +136,10 @@ WRITE16_HANDLER( skullxbo_yscroll_w )
/* if something changed, force an update */
if (oldscroll != newscroll)
- space->machine().primary_screen->update_partial(scanline);
+ space.machine().primary_screen->update_partial(scanline);
/* adjust the effective scroll for the current scanline */
- if (scanline > space->machine().primary_screen->visible_area().max_y)
+ if (scanline > space.machine().primary_screen->visible_area().max_y)
scanline = 0;
effscroll = (newscroll >> 7) - scanline;
@@ -161,7 +161,7 @@ WRITE16_HANDLER( skullxbo_yscroll_w )
WRITE16_HANDLER( skullxbo_mobmsb_w )
{
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
atarimo_set_bank(0, (offset >> 9) & 1);
}
@@ -175,7 +175,7 @@ WRITE16_HANDLER( skullxbo_mobmsb_w )
WRITE16_HANDLER( skullxbo_playfieldlatch_w )
{
- skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
+ skullxbo_state *state = space.machine().driver_data<skullxbo_state>();
atarigen_set_playfield_latch(state, data);
}
diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c
index 9844c7d3733..3e93c27c780 100644
--- a/src/mame/video/skydiver.c
+++ b/src/mame/video/skydiver.c
@@ -11,21 +11,21 @@
void skydiver_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset all latches */
- skydiver_start_lamp_1_w(*space, 0, 0);
- skydiver_start_lamp_2_w(*space, 0, 0);
- skydiver_lamp_s_w(*space, 0, 0);
- skydiver_lamp_k_w(*space, 0, 0);
- skydiver_lamp_y_w(*space, 0, 0);
- skydiver_lamp_d_w(*space, 0, 0);
+ skydiver_start_lamp_1_w(space, 0, 0);
+ skydiver_start_lamp_2_w(space, 0, 0);
+ skydiver_lamp_s_w(space, 0, 0);
+ skydiver_lamp_k_w(space, 0, 0);
+ skydiver_lamp_y_w(space, 0, 0);
+ skydiver_lamp_d_w(space, 0, 0);
output_set_value("lampi", 0);
output_set_value("lampv", 0);
output_set_value("lampe", 0);
output_set_value("lampr", 0);
- skydiver_width_w(*space, 0, 0);
- skydiver_coin_lockout_w(*space, 0, 0);
+ skydiver_width_w(space, 0, 0);
+ skydiver_coin_lockout_w(space, 0, 0);
}
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c
index a8fd963b742..74795b7205a 100644
--- a/src/mame/video/snes.c
+++ b/src/mame/video/snes.c
@@ -1929,7 +1929,7 @@ WRITE8_MEMBER( snes_state::snes_vram_write )
if (h <= 4)
m_snes_vram[offset] = data;
else if (h == 6)
- m_snes_vram[offset] = snes_open_bus_r(&space, 0);
+ m_snes_vram[offset] = snes_open_bus_r(space, 0);
else
{
//printf("%d %d VRAM write, CHECK!\n",h,v);
@@ -2047,8 +2047,8 @@ READ8_MEMBER( snes_state::snes_cgram_read )
#if 0
if (!snes_ppu.screen_disabled)
{
- UINT16 v = space->machine().primary_screen->vpos();
- UINT16 h = space->machine().primary_screen->hpos();
+ UINT16 v = space.machine().primary_screen->vpos();
+ UINT16 h = space.machine().primary_screen->hpos();
if (v < snes_ppu.beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff;
@@ -2075,8 +2075,8 @@ WRITE8_MEMBER( snes_state::snes_cgram_write )
// writes to the cgram address
if (!snes_ppu.screen_disabled)
{
- UINT16 v = space->machine().primary_screen->vpos();
- UINT16 h = space->machine().primary_screen->hpos();
+ UINT16 v = space.machine().primary_screen->vpos();
+ UINT16 h = space.machine().primary_screen->hpos();
if (v < snes_ppu.beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff;
@@ -2093,7 +2093,7 @@ WRITE8_MEMBER( snes_state::snes_cgram_write )
READ8_HANDLER( snes_ppu_read )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
UINT8 value;
switch (offset)
@@ -2140,10 +2140,10 @@ READ8_HANDLER( snes_ppu_read )
return snes_ppu.ppu1_open_bus;
}
case SLHV: /* Software latch for H/V counter */
- snes_latch_counters(space->machine());
+ snes_latch_counters(space.machine());
return snes_open_bus_r(space, 0); /* Return value is meaningless */
case ROAMDATA: /* Read data from OAM (DR) */
- snes_ppu.ppu1_open_bus = state->snes_oam_read(*space, snes_ppu.oam.address);
+ snes_ppu.ppu1_open_bus = state->snes_oam_read(space, snes_ppu.oam.address);
snes_ram[OAMDATA] = (snes_ram[OAMDATA] + 1) % 2;
if (!snes_ram[OAMDATA])
{
@@ -2154,13 +2154,13 @@ READ8_HANDLER( snes_ppu_read )
return snes_ppu.ppu1_open_bus;
case RVMDATAL: /* Read data from VRAM (low) */
{
- UINT32 addr = snes_get_vram_address(space->machine());
+ UINT32 addr = snes_get_vram_address(space.machine());
snes_ppu.ppu1_open_bus = state->m_vram_read_buffer & 0xff;
if (!state->m_vram_fgr_high)
{
- state->m_vram_read_buffer = state->snes_vram_read(*space, addr);
- state->m_vram_read_buffer |= (state->snes_vram_read(*space, addr + 1) << 8);
+ state->m_vram_read_buffer = state->snes_vram_read(space, addr);
+ state->m_vram_read_buffer |= (state->snes_vram_read(space, addr + 1) << 8);
state->m_vmadd = (state->m_vmadd + state->m_vram_fgr_increment) & 0xffff;
}
@@ -2169,13 +2169,13 @@ READ8_HANDLER( snes_ppu_read )
}
case RVMDATAH: /* Read data from VRAM (high) */
{
- UINT32 addr = snes_get_vram_address(space->machine());
+ UINT32 addr = snes_get_vram_address(space.machine());
snes_ppu.ppu1_open_bus = (state->m_vram_read_buffer >> 8) & 0xff;
if (state->m_vram_fgr_high)
{
- state->m_vram_read_buffer = state->snes_vram_read(*space, addr);
- state->m_vram_read_buffer |= (state->snes_vram_read(*space, addr + 1) << 8);
+ state->m_vram_read_buffer = state->snes_vram_read(space, addr);
+ state->m_vram_read_buffer |= (state->snes_vram_read(space, addr + 1) << 8);
state->m_vmadd = (state->m_vmadd + state->m_vram_fgr_increment) & 0xffff;
}
@@ -2184,11 +2184,11 @@ READ8_HANDLER( snes_ppu_read )
}
case RCGDATA: /* Read data from CGRAM */
if (!(state->m_cgram_address & 0x01))
- snes_ppu.ppu2_open_bus = state->snes_cgram_read(*space, state->m_cgram_address);
+ snes_ppu.ppu2_open_bus = state->snes_cgram_read(space, state->m_cgram_address);
else
{
snes_ppu.ppu2_open_bus &= 0x80;
- snes_ppu.ppu2_open_bus |= state->snes_cgram_read(*space, state->m_cgram_address) & 0x7f;
+ snes_ppu.ppu2_open_bus |= state->snes_cgram_read(space, state->m_cgram_address) & 0x7f;
}
state->m_cgram_address = (state->m_cgram_address + 1) % (SNES_CGRAM_SIZE - 2);
@@ -2242,15 +2242,15 @@ READ8_HANDLER( snes_ppu_read )
WRITE8_HANDLER( snes_ppu_write )
{
- snes_state *state = space->machine().driver_data<snes_state>();
+ snes_state *state = space.machine().driver_data<snes_state>();
switch (offset)
{
case INIDISP: /* Initial settings for screen */
if ((snes_ppu.screen_disabled & 0x80) && (!(data & 0x80))) //a 1->0 force blank transition causes a reset OAM address
{
- space->write_byte(OAMADDL, snes_ppu.oam.saved_address_low);
- space->write_byte(OAMADDH, snes_ppu.oam.saved_address_high);
+ space.write_byte(OAMADDL, snes_ppu.oam.saved_address_low);
+ space.write_byte(OAMADDH, snes_ppu.oam.saved_address_high);
snes_ppu.oam.first_sprite = snes_ppu.oam.priority_rotation ? (snes_ppu.oam.address >> 1) & 127 : 0;
}
snes_ppu.screen_disabled = data & 0x80;
@@ -2276,7 +2276,7 @@ WRITE8_HANDLER( snes_ppu_write )
break;
case OAMDATA: /* Data for OAM write (DW) */
if (snes_ppu.oam.address >= 0x100)
- state->snes_oam_write(*space, snes_ppu.oam.address, data);
+ state->snes_oam_write(space, snes_ppu.oam.address, data);
else
{
if (!snes_ram[OAMDATA])
@@ -2286,9 +2286,9 @@ WRITE8_HANDLER( snes_ppu_write )
// in this case, we not only write data to the upper byte of the word,
// but also snes_ppu.oam.write_latch to the lower byte (recall that
// snes_ram[OAMDATA] is used to select high/low byte)
- state->snes_oam_write(*space, snes_ppu.oam.address, data);
+ state->snes_oam_write(space, snes_ppu.oam.address, data);
snes_ram[OAMDATA] = 0;
- state->snes_oam_write(*space, snes_ppu.oam.address, snes_ppu.oam.write_latch);
+ state->snes_oam_write(space, snes_ppu.oam.address, snes_ppu.oam.write_latch);
snes_ram[OAMDATA] = 1;
}
}
@@ -2302,7 +2302,7 @@ WRITE8_HANDLER( snes_ppu_write )
return;
case BGMODE: /* BG mode and character size settings */
snes_ppu.mode = data & 0x07;
- snes_dynamic_res_change(space->machine());
+ snes_dynamic_res_change(space.machine());
snes_ppu.bg3_priority_bit = BIT(data, 3);
snes_ppu.layer[SNES_BG1].tile_size = BIT(data, 4);
snes_ppu.layer[SNES_BG2].tile_size = BIT(data, 5);
@@ -2404,24 +2404,24 @@ WRITE8_HANDLER( snes_ppu_write )
{
UINT32 addr;
state->m_vmadd = (state->m_vmadd & 0xff00) | (data << 0);
- addr = snes_get_vram_address(space->machine());
- state->m_vram_read_buffer = state->snes_vram_read(*space, addr);
- state->m_vram_read_buffer |= (state->snes_vram_read(*space, addr + 1) << 8);
+ addr = snes_get_vram_address(space.machine());
+ state->m_vram_read_buffer = state->snes_vram_read(space, addr);
+ state->m_vram_read_buffer |= (state->snes_vram_read(space, addr + 1) << 8);
}
break;
case VMADDH: /* Address for VRAM read/write (high) */
{
UINT32 addr;
state->m_vmadd = (state->m_vmadd & 0x00ff) | (data << 8);
- addr = snes_get_vram_address(space->machine());
- state->m_vram_read_buffer = state->snes_vram_read(*space, addr);
- state->m_vram_read_buffer |= (state->snes_vram_read(*space, addr + 1) << 8);
+ addr = snes_get_vram_address(space.machine());
+ state->m_vram_read_buffer = state->snes_vram_read(space, addr);
+ state->m_vram_read_buffer |= (state->snes_vram_read(space, addr + 1) << 8);
}
break;
case VMDATAL: /* 2118: Data for VRAM write (low) */
{
- UINT32 addr = snes_get_vram_address(space->machine());
- state->snes_vram_write(*space, addr, data);
+ UINT32 addr = snes_get_vram_address(space.machine());
+ state->snes_vram_write(space, addr, data);
if (!state->m_vram_fgr_high)
state->m_vmadd = (state->m_vmadd + state->m_vram_fgr_increment) & 0xffff;
@@ -2429,8 +2429,8 @@ WRITE8_HANDLER( snes_ppu_write )
return;
case VMDATAH: /* 2119: Data for VRAM write (high) */
{
- UINT32 addr = snes_get_vram_address(space->machine());
- state->snes_vram_write(*space, addr + 1, data);
+ UINT32 addr = snes_get_vram_address(space.machine());
+ state->snes_vram_write(space, addr + 1, data);
if (state->m_vram_fgr_high)
state->m_vmadd = (state->m_vmadd + state->m_vram_fgr_increment) & 0xffff;
@@ -2471,7 +2471,7 @@ WRITE8_HANDLER( snes_ppu_write )
state->m_cgram_address = data << 1;
break;
case CGDATA: /* Data for colour RAM */
- state->snes_cgram_write(*space, state->m_cgram_address, data);
+ state->snes_cgram_write(space, state->m_cgram_address, data);
state->m_cgram_address = (state->m_cgram_address + 1) % (SNES_CGRAM_SIZE - 2);
break;
case W12SEL: /* Window mask settings for BG1-2 */
@@ -2633,7 +2633,7 @@ WRITE8_HANDLER( snes_ppu_write )
snes_ppu.beam.last_visible_line = (data & 0x04) ? 240 : 225;
snes_ppu.pseudo_hires = BIT(data, 3);
snes_ppu.mode7.extbg = BIT(data, 6);
- snes_dynamic_res_change(space->machine());
+ snes_dynamic_res_change(space.machine());
#ifdef SNES_DBG_REG_W
if ((data & 0x8) != (snes_ram[SETINI] & 0x8))
mame_printf_debug( "Pseudo 512 mode: %s\n", (data & 0x8) ? "on" : "off" );
diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c
index 54ac991d630..a7356d9cf83 100644
--- a/src/mame/video/stvvdp1.c
+++ b/src/mame/video/stvvdp1.c
@@ -166,9 +166,9 @@ static void stv_vdp1_process_list(running_machine &machine);
READ16_HANDLER( saturn_vdp1_regs_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
- //logerror ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space->device().tag(), space->device().safe_pc(), offset);
+ //logerror ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space.device().tag(), space.device().safe_pc(), offset);
switch(offset)
{
@@ -194,7 +194,7 @@ READ16_HANDLER( saturn_vdp1_regs_r )
return modr;
default:
- printf ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space->device().tag(), space->device().safe_pc(), offset*2);
+ printf ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space.device().tag(), space.device().safe_pc(), offset*2);
break;
}
@@ -288,25 +288,25 @@ static void stv_set_framebuffer_config( running_machine &machine )
WRITE16_HANDLER( saturn_vdp1_regs_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
COMBINE_DATA(&state->m_vdp1_regs[offset]);
switch(offset)
{
case 0x00/2:
- stv_set_framebuffer_config(space->machine());
+ stv_set_framebuffer_config(space.machine());
if ( VDP1_LOG ) logerror( "VDP1: Access to register TVMR = %1X\n", STV_VDP1_TVMR );
break;
case 0x02/2:
- stv_set_framebuffer_config(space->machine());
+ stv_set_framebuffer_config(space.machine());
if ( VDP1_LOG ) logerror( "VDP1: Access to register FBCR = %1X\n", STV_VDP1_FBCR );
state->m_vdp1.fbcr_accessed = 1;
break;
case 0x04/2:
if ( VDP1_LOG ) logerror( "VDP1: Access to register PTMR = %1X\n", STV_VDP1_PTM );
if ( STV_VDP1_PTMR == 1 )
- stv_vdp1_process_list( space->machine() );
+ stv_vdp1_process_list( space.machine() );
break;
case 0x06/2:
@@ -332,21 +332,21 @@ WRITE16_HANDLER( saturn_vdp1_regs_w )
READ32_HANDLER ( saturn_vdp1_vram_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
return state->m_vdp1_vram[offset];
}
WRITE32_HANDLER ( saturn_vdp1_vram_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT8 *vdp1 = state->m_vdp1.gfx_decode;
COMBINE_DATA (&state->m_vdp1_vram[offset]);
// if (((offset * 4) > 0xdf) && ((offset * 4) < 0x140))
// {
-// logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space->device().tag(), space->device().safe_pc(), offset*4, data, mem_mask);
+// logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space.device().tag(), space.device().safe_pc(), offset*4, data, mem_mask);
// }
data = state->m_vdp1_vram[offset];
@@ -359,7 +359,7 @@ WRITE32_HANDLER ( saturn_vdp1_vram_w )
WRITE32_HANDLER ( saturn_vdp1_framebuffer0_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
//popmessage ("STV VDP1 Framebuffer 0 WRITE offset %08x data %08x",offset, data);
if ( STV_VDP1_TVM & 1 )
{
@@ -402,7 +402,7 @@ WRITE32_HANDLER ( saturn_vdp1_framebuffer0_w )
READ32_HANDLER ( saturn_vdp1_framebuffer0_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT32 result = 0;
//popmessage ("STV VDP1 Framebuffer 0 READ offset %08x",offset);
if ( STV_VDP1_TVM & 1 )
diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c
index 7c32bd6d64f..7f02561d88e 100644
--- a/src/mame/video/stvvdp2.c
+++ b/src/mame/video/stvvdp2.c
@@ -5361,7 +5361,7 @@ static void stv_vdp2_draw_back(running_machine &machine, bitmap_rgb32 &bitmap, c
WRITE32_HANDLER ( saturn_vdp2_vram_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
UINT8* gfxdata = state->m_vdp2.gfx_decode;
COMBINE_DATA(&state->m_vdp2_vram[offset]);
@@ -5373,16 +5373,16 @@ WRITE32_HANDLER ( saturn_vdp2_vram_w )
gfxdata[offset*4+2] = (data & 0x0000ff00) >> 8;
gfxdata[offset*4+3] = (data & 0x000000ff) >> 0;
- space->machine().gfx[0]->mark_dirty(offset/8);
- space->machine().gfx[1]->mark_dirty(offset/8);
- space->machine().gfx[2]->mark_dirty(offset/8);
- space->machine().gfx[3]->mark_dirty(offset/8);
+ space.machine().gfx[0]->mark_dirty(offset/8);
+ space.machine().gfx[1]->mark_dirty(offset/8);
+ space.machine().gfx[2]->mark_dirty(offset/8);
+ space.machine().gfx[3]->mark_dirty(offset/8);
/* 8-bit tiles overlap, so this affects the previous one as well */
if (offset/8 != 0)
{
- space->machine().gfx[2]->mark_dirty(offset/8 - 1);
- space->machine().gfx[3]->mark_dirty(offset/8 - 1);
+ space.machine().gfx[2]->mark_dirty(offset/8 - 1);
+ space.machine().gfx[3]->mark_dirty(offset/8 - 1);
}
if ( stv_rbg_cache_data.watch_vdp2_vram_writes )
@@ -5418,7 +5418,7 @@ WRITE32_HANDLER ( saturn_vdp2_vram_w )
READ16_HANDLER ( saturn_vdp2_regs_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
switch(offset)
{
@@ -5428,10 +5428,10 @@ READ16_HANDLER ( saturn_vdp2_regs_r )
if(!STV_VDP2_EXLTEN)
{
/* TODO: handle various h/v settings. */
- if(!space->debugger_access())
+ if(!space.debugger_access())
{
- state->m_vdp2.h_count = space->machine().primary_screen->hpos() & 0x3ff;
- state->m_vdp2.v_count = space->machine().primary_screen->vpos() & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
+ state->m_vdp2.h_count = space.machine().primary_screen->hpos() & 0x3ff;
+ state->m_vdp2.v_count = space.machine().primary_screen->vpos() & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
/* latch flag */
state->m_vdp2.exltfg |= 1;
}
@@ -5445,9 +5445,9 @@ READ16_HANDLER ( saturn_vdp2_regs_r )
/*VBLANK HBLANK ODD PAL */
state->m_vdp2_regs[offset] = (state->m_vdp2.exltfg<<9) |
(state->m_vdp2.exsyfg<<8) |
- (get_vblank(space->machine()) << 3) |
- (get_hblank(space->machine()) << 2) |
- (get_odd_bit(space->machine()) << 1) |
+ (get_vblank(space.machine()) << 3) |
+ (get_hblank(space.machine()) << 2) |
+ (get_odd_bit(space.machine()) << 1) |
(state->m_vdp2.pal << 0);
/* vblank bit is always 1 if DISP bit is disabled */
@@ -5455,7 +5455,7 @@ READ16_HANDLER ( saturn_vdp2_regs_r )
state->m_vdp2_regs[offset] |= 1 << 3;
/* HV latches clears if this register is read */
- if(!space->debugger_access())
+ if(!space.debugger_access())
{
state->m_vdp2.exltfg &= ~1;
state->m_vdp2.exsyfg &= ~1;
@@ -5467,7 +5467,7 @@ READ16_HANDLER ( saturn_vdp2_regs_r )
state->m_vdp2_regs[offset] = (STV_VDP2_VRAMSZ << 15) |
((0 << 0) & 0xf); // VDP2 version
- if(!space->debugger_access())
+ if(!space.debugger_access())
printf("Warning: VDP2 version read\n");
break;
}
@@ -5487,7 +5487,7 @@ READ16_HANDLER ( saturn_vdp2_regs_r )
}
default:
- //if(!space->debugger_access())
+ //if(!space.debugger_access())
// printf("VDP2: read from register %08x %08x\n",offset*4,mem_mask);
break;
}
@@ -5497,7 +5497,7 @@ READ16_HANDLER ( saturn_vdp2_regs_r )
READ32_HANDLER ( saturn_vdp2_cram_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
offset &= (0xfff) >> (2);
@@ -5507,14 +5507,14 @@ READ32_HANDLER ( saturn_vdp2_cram_r )
READ32_HANDLER ( saturn_vdp2_vram_r )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
return state->m_vdp2_vram[offset];
}
WRITE32_HANDLER ( saturn_vdp2_cram_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
int r,g,b;
UINT8 cmode0;
@@ -5534,8 +5534,8 @@ WRITE32_HANDLER ( saturn_vdp2_cram_w )
b = ((state->m_vdp2_cram[offset] & 0x00ff0000) >> 16);
g = ((state->m_vdp2_cram[offset] & 0x0000ff00) >> 8);
r = ((state->m_vdp2_cram[offset] & 0x000000ff) >> 0);
- palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
- palette_set_color(space->machine(),offset^0x400,MAKE_RGB(r,g,b));
+ palette_set_color(space.machine(),offset,MAKE_RGB(r,g,b));
+ palette_set_color(space.machine(),offset^0x400,MAKE_RGB(r,g,b));
}
break;
/*Mode 0*/
@@ -5547,16 +5547,16 @@ WRITE32_HANDLER ( saturn_vdp2_cram_w )
b = ((state->m_vdp2_cram[offset] & 0x00007c00) >> 10);
g = ((state->m_vdp2_cram[offset] & 0x000003e0) >> 5);
r = ((state->m_vdp2_cram[offset] & 0x0000001f) >> 0);
- palette_set_color_rgb(space->machine(),(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space.machine(),(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
if(cmode0)
- palette_set_color_rgb(space->machine(),((offset*2)+1)^0x400,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space.machine(),((offset*2)+1)^0x400,pal5bit(r),pal5bit(g),pal5bit(b));
b = ((state->m_vdp2_cram[offset] & 0x7c000000) >> 26);
g = ((state->m_vdp2_cram[offset] & 0x03e00000) >> 21);
r = ((state->m_vdp2_cram[offset] & 0x001f0000) >> 16);
- palette_set_color_rgb(space->machine(),offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space.machine(),offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
if(cmode0)
- palette_set_color_rgb(space->machine(),(offset*2)^0x400,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space.machine(),(offset*2)^0x400,pal5bit(r),pal5bit(g),pal5bit(b));
}
break;
}
@@ -5623,25 +5623,25 @@ static void refresh_palette_data(running_machine &machine)
WRITE16_HANDLER ( saturn_vdp2_regs_w )
{
- saturn_state *state = space->machine().driver_data<saturn_state>();
+ saturn_state *state = space.machine().driver_data<saturn_state>();
COMBINE_DATA(&state->m_vdp2_regs[offset]);
if(state->m_vdp2.old_crmd != STV_VDP2_CRMD)
{
state->m_vdp2.old_crmd = STV_VDP2_CRMD;
- refresh_palette_data(space->machine());
+ refresh_palette_data(space.machine());
}
if(state->m_vdp2.old_tvmd != STV_VDP2_TVMD)
{
state->m_vdp2.old_tvmd = STV_VDP2_TVMD;
- stv_vdp2_dynamic_res_change(space->machine());
+ stv_vdp2_dynamic_res_change(space.machine());
}
if(STV_VDP2_VRAMSZ)
printf("VDP2 sets up 8 Mbit VRAM!\n");
#if NEW_VIDEO_CODE
- saturn_vdp2_assign_variables(space->machine(),offset,state->m_vdp2_regs[offset]);
+ saturn_vdp2_assign_variables(space.machine(),offset,state->m_vdp2_regs[offset]);
#endif
}
diff --git a/src/mame/video/taito_b.c b/src/mame/video/taito_b.c
index a053ae0fca5..81b8298ef13 100644
--- a/src/mame/video/taito_b.c
+++ b/src/mame/video/taito_b.c
@@ -27,10 +27,10 @@ static void hitice_clear_pixel_bitmap( running_machine &machine )
{
int i;
taitob_state *state = machine.driver_data<taitob_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
for (i = 0; i < 0x40000; i++)
- state->hitice_pixelram_w(*space, i, 0, 0xffff);
+ state->hitice_pixelram_w(space, i, 0, 0xffff);
}
WRITE16_MEMBER(taitob_state::realpunc_video_ctrl_w)
diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c
index 8d8daca6f6e..8d0a01e23fe 100644
--- a/src/mame/video/taitoic.c
+++ b/src/mame/video/taitoic.c
@@ -4839,7 +4839,7 @@ READ16_DEVICE_HANDLER( tc0110pcr_word_r )
return tc0110pcr->ram[tc0110pcr->addr];
default:
-//logerror("PC %06x: warning - read TC0110PCR address %02x\n",space->device().safe_pc(),offset);
+//logerror("PC %06x: warning - read TC0110PCR address %02x\n",space.device().safe_pc(),offset);
return 0xff;
}
}
@@ -4863,7 +4863,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_word_w )
break;
default:
-//logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
@@ -4886,7 +4886,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w )
break;
default:
-//logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
@@ -4911,7 +4911,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w )
break;
default:
-//logerror("PC %06x: warning - write %04x to TC0110PCR offset %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %04x to TC0110PCR offset %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
@@ -4936,7 +4936,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w )
break;
default:
-//logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",space->device().safe_pc(),data,offset);
+//logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",space.device().safe_pc(),data,offset);
break;
}
}
diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c
index 3fc181d50a1..da48e79c377 100644
--- a/src/mame/video/toaplan1.c
+++ b/src/mame/video/toaplan1.c
@@ -286,17 +286,17 @@ static void toaplan1_set_scrolls(running_machine &machine)
static void rallybik_flipscreen(running_machine &machine)
{
toaplan1_state *state = machine.driver_data<toaplan1_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- state->rallybik_bcu_flipscreen_w(*space, 0, state->m_bcu_flipscreen, 0xffff);
+ state->rallybik_bcu_flipscreen_w(space, 0, state->m_bcu_flipscreen, 0xffff);
}
static void toaplan1_flipscreen(running_machine &machine)
{
toaplan1_state *state = machine.driver_data<toaplan1_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- state->toaplan1_bcu_flipscreen_w(*space, 0, state->m_bcu_flipscreen, 0xffff);
+ state->toaplan1_bcu_flipscreen_w(space, 0, state->m_bcu_flipscreen, 0xffff);
}
static void register_common(running_machine &machine)
diff --git a/src/mame/video/toobin.c b/src/mame/video/toobin.c
index 55eb06527cc..74708b13404 100644
--- a/src/mame/video/toobin.c
+++ b/src/mame/video/toobin.c
@@ -109,7 +109,7 @@ VIDEO_START_MEMBER(toobin_state,toobin)
WRITE16_HANDLER( toobin_paletteram_w )
{
- toobin_state *state = space->machine().driver_data<toobin_state>();
+ toobin_state *state = space.machine().driver_data<toobin_state>();
int newword;
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
@@ -124,18 +124,18 @@ WRITE16_HANDLER( toobin_paletteram_w )
if (green) green += 38;
if (blue) blue += 38;
- palette_set_color(space->machine(), offset & 0x3ff, MAKE_RGB(red, green, blue));
+ palette_set_color(space.machine(), offset & 0x3ff, MAKE_RGB(red, green, blue));
if (!(newword & 0x8000))
- palette_set_pen_contrast(space->machine(), offset & 0x3ff, state->m_brightness);
+ palette_set_pen_contrast(space.machine(), offset & 0x3ff, state->m_brightness);
else
- palette_set_pen_contrast(space->machine(), offset & 0x3ff, 1.0);
+ palette_set_pen_contrast(space.machine(), offset & 0x3ff, 1.0);
}
}
WRITE16_HANDLER( toobin_intensity_w )
{
- toobin_state *state = space->machine().driver_data<toobin_state>();
+ toobin_state *state = space.machine().driver_data<toobin_state>();
int i;
if (ACCESSING_BITS_0_7)
@@ -144,7 +144,7 @@ WRITE16_HANDLER( toobin_intensity_w )
for (i = 0; i < 0x400; i++)
if (!(state->m_generic_paletteram_16[i] & 0x8000))
- palette_set_pen_contrast(space->machine(), i, state->m_brightness);
+ palette_set_pen_contrast(space.machine(), i, state->m_brightness);
}
}
@@ -158,14 +158,14 @@ WRITE16_HANDLER( toobin_intensity_w )
WRITE16_HANDLER( toobin_xscroll_w )
{
- toobin_state *state = space->machine().driver_data<toobin_state>();
+ toobin_state *state = space.machine().driver_data<toobin_state>();
UINT16 oldscroll = *state->m_xscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* update the playfield scrolling - hscroll is clocked on the following scanline */
state->m_playfield_tilemap->set_scrollx(0, newscroll >> 6);
@@ -178,14 +178,14 @@ WRITE16_HANDLER( toobin_xscroll_w )
WRITE16_HANDLER( toobin_yscroll_w )
{
- toobin_state *state = space->machine().driver_data<toobin_state>();
+ toobin_state *state = space.machine().driver_data<toobin_state>();
UINT16 oldscroll = *state->m_yscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* if bit 4 is zero, the scroll value is clocked in right away */
state->m_playfield_tilemap->set_scrolly(0, newscroll >> 6);
@@ -211,7 +211,7 @@ WRITE16_HANDLER( toobin_slip_w )
/* if the SLIP is changing, force a partial update first */
if (oldslip != newslip)
- space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
/* update the data */
atarimo_0_slipram_w(space, offset, data, mem_mask);
diff --git a/src/mame/video/vdc.c b/src/mame/video/vdc.c
index 39eaf7eb332..5b7ca4af9b4 100644
--- a/src/mame/video/vdc.c
+++ b/src/mame/video/vdc.c
@@ -622,10 +622,10 @@ static UINT8 vdc_r( running_machine &machine, int which, offs_t offset )
return (temp);
}
-WRITE8_HANDLER( vdc_0_w ) { vdc_w( space->machine(), 0, offset, data ); }
-WRITE8_HANDLER( vdc_1_w ) { vdc_w( space->machine(), 1, offset, data ); }
-READ8_HANDLER( vdc_0_r ) { return vdc_r( space->machine(), 0, offset ); }
-READ8_HANDLER( vdc_1_r ) { return vdc_r( space->machine(), 1, offset ); }
+WRITE8_HANDLER( vdc_0_w ) { vdc_w( space.machine(), 0, offset, data ); }
+WRITE8_HANDLER( vdc_1_w ) { vdc_w( space.machine(), 1, offset, data ); }
+READ8_HANDLER( vdc_0_r ) { return vdc_r( space.machine(), 0, offset ); }
+READ8_HANDLER( vdc_1_r ) { return vdc_r( space.machine(), 1, offset ); }
PALETTE_INIT( vce )
{
@@ -1185,7 +1185,7 @@ READ8_HANDLER( vpc_r )
static void vpc_init( running_machine &machine )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
vpc_w( space, 0, 0x11 );
vpc_w( space, 1, 0x11 );
vpc.window1.w = 0;
diff --git a/src/mame/video/vindictr.c b/src/mame/video/vindictr.c
index 0d63f15f341..33dc1b99e69 100644
--- a/src/mame/video/vindictr.c
+++ b/src/mame/video/vindictr.c
@@ -112,7 +112,7 @@ WRITE16_HANDLER( vindictr_paletteram_w )
int c;
/* first blend the data */
- vindictr_state *state = space->machine().driver_data<vindictr_state>();
+ vindictr_state *state = space.machine().driver_data<vindictr_state>();
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
data = state->m_generic_paletteram_16[offset];
@@ -124,7 +124,7 @@ WRITE16_HANDLER( vindictr_paletteram_w )
int g = ((data >> 4) & 15) * i;
int b = ((data >> 0) & 15) * i;
- palette_set_color(space->machine(),offset + c*2048,MAKE_RGB(r,g,b));
+ palette_set_color(space.machine(),offset + c*2048,MAKE_RGB(r,g,b));
}
}
diff --git a/src/mame/video/vrender0.c b/src/mame/video/vrender0.c
index e0445dfabb3..7df7ec692c4 100644
--- a/src/mame/video/vrender0.c
+++ b/src/mame/video/vrender0.c
@@ -396,13 +396,13 @@ static const _DrawTemplate DrawTile[]=
TILENAME(16,1,2),
};
-#define Packet(i) space->read_word(PacketPtr + 2 * i)
+#define Packet(i) space.read_word(PacketPtr + 2 * i)
//Returns TRUE if the operation was a flip (sync or async)
int vrender0_ProcessPacket(device_t *device, UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE)
{
vr0video_state *vr0 = get_safe_token(device);
- address_space *space = vr0->cpu->memory().space(AS_PROGRAM);
+ address_space &space = *vr0->cpu->memory().space(AS_PROGRAM);
UINT32 Dx = Packet(1) & 0x3ff;
UINT32 Dy = Packet(2) & 0x1ff;
UINT32 Endx = Packet(3) & 0x3ff;
diff --git a/src/mame/video/williams.c b/src/mame/video/williams.c
index 44abff7fe49..1aec3a74466 100644
--- a/src/mame/video/williams.c
+++ b/src/mame/video/williams.c
@@ -106,7 +106,7 @@
static void blitter_init(running_machine &machine, int blitter_config, const UINT8 *remap_prom);
static void create_palette_lookup(running_machine &machine);
-static int blitter_core(address_space *space, int sstart, int dstart, int w, int h, int data);
+static int blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data);
@@ -531,7 +531,7 @@ WRITE8_MEMBER(williams_state::williams_blitter_w)
if (h == 255) h = 256;
/* do the actual blit */
- accesses = blitter_core(&space, sstart, dstart, w, h, data);
+ accesses = blitter_core(space, sstart, dstart, w, h, data);
/* based on the number of memory accesses needed to do the blit, compute how long the blit will take */
/* this is just a guess */
@@ -562,11 +562,11 @@ WRITE8_MEMBER(williams_state::williams2_blit_window_enable_w)
*
*************************************/
-INLINE void blit_pixel(address_space *space, int offset, int srcdata, int data, int mask, int solid)
+INLINE void blit_pixel(address_space &space, int offset, int srcdata, int data, int mask, int solid)
{
- williams_state *state = space->machine().driver_data<williams_state>();
+ williams_state *state = space.machine().driver_data<williams_state>();
/* always read from video RAM regardless of the bank setting */
- int pix = (offset < 0xc000) ? state->m_videoram[offset] : space->read_byte(offset);
+ int pix = (offset < 0xc000) ? state->m_videoram[offset] : space.read_byte(offset);
/* handle transparency */
if (data & 0x08)
@@ -586,13 +586,13 @@ INLINE void blit_pixel(address_space *space, int offset, int srcdata, int data,
/* note that we have to allow blits to non-video RAM (e.g. tileram) because those */
/* are not blocked by the window enable */
if (!state->m_blitter_window_enable || offset < state->m_blitter_clip_address || offset >= 0xc000)
- space->write_byte(offset, pix);
+ space.write_byte(offset, pix);
}
-static int blitter_core(address_space *space, int sstart, int dstart, int w, int h, int data)
+static int blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data)
{
- williams_state *state = space->machine().driver_data<williams_state>();
+ williams_state *state = space.machine().driver_data<williams_state>();
int source, sxadv, syadv;
int dest, dxadv, dyadv;
int i, j, solid;
@@ -627,7 +627,7 @@ static int blitter_core(address_space *space, int sstart, int dstart, int w, int
/* loop over the width */
for (j = w; j > 0; j--)
{
- blit_pixel(space, dest, state->m_blitter_remap[space->read_byte(source)], data, keepmask, solid);
+ blit_pixel(space, dest, state->m_blitter_remap[space.read_byte(source)], data, keepmask, solid);
accesses += 2;
/* advance */
@@ -661,7 +661,7 @@ static int blitter_core(address_space *space, int sstart, int dstart, int w, int
dest = dstart & 0xffff;
/* left edge case */
- pixdata = state->m_blitter_remap[space->read_byte(source)];
+ pixdata = state->m_blitter_remap[space.read_byte(source)];
blit_pixel(space, dest, (pixdata >> 4) & 0x0f, data, keepmask | 0xf0, solid);
accesses += 2;
@@ -671,7 +671,7 @@ static int blitter_core(address_space *space, int sstart, int dstart, int w, int
/* loop over the width */
for (j = w - 1; j > 0; j--)
{
- pixdata = (pixdata << 8) | state->m_blitter_remap[space->read_byte(source)];
+ pixdata = (pixdata << 8) | state->m_blitter_remap[space.read_byte(source)];
blit_pixel(space, dest, (pixdata >> 4) & 0xff, data, keepmask, solid);
accesses += 2;
diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c
index 67c8a9d70c3..facbd62a49b 100644
--- a/src/mame/video/xevious.c
+++ b/src/mame/video/xevious.c
@@ -240,7 +240,7 @@ VIDEO_START_MEMBER(xevious_state,xevious)
WRITE8_HANDLER( xevious_fg_videoram_w )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
state->m_xevious_fg_videoram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset);
@@ -248,7 +248,7 @@ WRITE8_HANDLER( xevious_fg_videoram_w )
WRITE8_HANDLER( xevious_fg_colorram_w )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
state->m_xevious_fg_colorram[offset] = data;
state->m_fg_tilemap->mark_tile_dirty(offset);
@@ -256,7 +256,7 @@ WRITE8_HANDLER( xevious_fg_colorram_w )
WRITE8_HANDLER( xevious_bg_videoram_w )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
state->m_xevious_bg_videoram[offset] = data;
state->m_bg_tilemap->mark_tile_dirty(offset);
@@ -264,7 +264,7 @@ WRITE8_HANDLER( xevious_bg_videoram_w )
WRITE8_HANDLER( xevious_bg_colorram_w )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
state->m_xevious_bg_colorram[offset] = data;
state->m_bg_tilemap->mark_tile_dirty(offset);
@@ -272,7 +272,7 @@ WRITE8_HANDLER( xevious_bg_colorram_w )
WRITE8_HANDLER( xevious_vh_latch_w )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
int reg;
int scroll = data + ((offset&0x01)<<8); /* A0 -> D8 */
@@ -306,14 +306,14 @@ WRITE8_HANDLER( xevious_vh_latch_w )
/* emulation for schematic 9B */
WRITE8_HANDLER( xevious_bs_w )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
state->m_xevious_bs[offset & 1] = data;
}
READ8_HANDLER( xevious_bb_r )
{
- xevious_state *state = space->machine().driver_data<xevious_state>();
+ xevious_state *state = space.machine().driver_data<xevious_state>();
UINT8 *rom2a = state->memregion("gfx4")->base();
UINT8 *rom2b = rom2a+0x1000;
diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c
index 5536d82a102..63828b52171 100644
--- a/src/mame/video/ygv608.c
+++ b/src/mame/video/ygv608.c
@@ -1211,7 +1211,7 @@ WRITE16_HANDLER( ygv608_w )
if (++p3_state == 3)
{
p3_state = 0;
- palette_set_color_rgb(space->machine(),ygv608.regs.s.cc,
+ palette_set_color_rgb(space.machine(),ygv608.regs.s.cc,
pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][0]),
pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][1]),
pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][2]) );
@@ -1228,7 +1228,7 @@ WRITE16_HANDLER( ygv608_w )
#endif
SetPreShortcuts (regNum, data);
ygv608.regs.b[regNum] = data;
- SetPostShortcuts (space->machine(), regNum);
+ SetPostShortcuts (space.machine(), regNum);
if (ygv608.ports.s.p5 & p5_rwai)
{
regNum ++;
@@ -1255,9 +1255,9 @@ WRITE16_HANDLER( ygv608_w )
case 0x07: /* P#7 - system control port */
ygv608.ports.b[7] = data;
if (ygv608.ports.b[7] & 0x3e)
- HandleRomTransfers(space->machine());
+ HandleRomTransfers(space.machine());
if (ygv608.ports.b[7] & 0x01)
- HandleYGV608Reset(space->machine());
+ HandleYGV608Reset(space.machine());
break;
default:
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index eb611cfda71..df6e38e3528 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -1142,12 +1142,12 @@ DIRECT_UPDATE_MEMBER(a2600_state::modeFE_opbase_handler)
static void modeFE_switch(running_machine &machine,UINT16 offset, UINT8 data)
{
a2600_state *state = machine.driver_data<a2600_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Retrieve last byte read by the cpu (for this mapping scheme this
should be the last byte that was on the data bus
*/
state->m_FETimer = 1;
- state->m_FE_old_opbase_handler = space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeFE_opbase_handler), state));
+ state->m_FE_old_opbase_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeFE_opbase_handler), state));
}
READ8_MEMBER(a2600_state::modeFE_switch_r)
@@ -1732,7 +1732,7 @@ static void set_controller( running_machine &machine, const char *controller, un
void a2600_state::machine_reset()
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int chip = 0xFF;
static const unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto
@@ -1911,7 +1911,7 @@ void a2600_state::machine_reset()
if (m_banking_mode == modeDC)
{
- space->install_read_handler(0x1fec, 0x1fec, read8_delegate(FUNC(a2600_state::current_bank_r),this));
+ space.install_read_handler(0x1fec, 0x1fec, read8_delegate(FUNC(a2600_state::current_bank_r),this));
}
/* set up bank switch registers */
@@ -1919,89 +1919,89 @@ void a2600_state::machine_reset()
switch (m_banking_mode)
{
case modeF8:
- space->install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
- space->install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
+ space.install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
+ space.install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
break;
case modeFA:
- space->install_write_handler(0x1ff8, 0x1ffa, write8_delegate(FUNC(a2600_state::modeFA_switch_w),this));
- space->install_read_handler(0x1ff8, 0x1ffa, read8_delegate(FUNC(a2600_state::modeFA_switch_r),this));
+ space.install_write_handler(0x1ff8, 0x1ffa, write8_delegate(FUNC(a2600_state::modeFA_switch_w),this));
+ space.install_read_handler(0x1ff8, 0x1ffa, read8_delegate(FUNC(a2600_state::modeFA_switch_r),this));
break;
case modeF6:
- space->install_write_handler(0x1ff6, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF6_switch_w),this));
- space->install_read_handler(0x1ff6, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF6_switch_r),this));
- space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeF6_opbase), this));
+ space.install_write_handler(0x1ff6, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF6_switch_w),this));
+ space.install_read_handler(0x1ff6, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF6_switch_r),this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeF6_opbase), this));
break;
case modeF4:
- space->install_write_handler(0x1ff4, 0x1ffb, write8_delegate(FUNC(a2600_state::modeF4_switch_w),this));
- space->install_read_handler(0x1ff4, 0x1ffb, read8_delegate(FUNC(a2600_state::modeF4_switch_r),this));
+ space.install_write_handler(0x1ff4, 0x1ffb, write8_delegate(FUNC(a2600_state::modeF4_switch_w),this));
+ space.install_read_handler(0x1ff4, 0x1ffb, read8_delegate(FUNC(a2600_state::modeF4_switch_r),this));
break;
case modeE0:
- space->install_write_handler(0x1fe0, 0x1ff8, write8_delegate(FUNC(a2600_state::modeE0_switch_w),this));
- space->install_read_handler(0x1fe0, 0x1ff8, read8_delegate(FUNC(a2600_state::modeE0_switch_r),this));
+ space.install_write_handler(0x1fe0, 0x1ff8, write8_delegate(FUNC(a2600_state::modeE0_switch_w),this));
+ space.install_read_handler(0x1fe0, 0x1ff8, read8_delegate(FUNC(a2600_state::modeE0_switch_r),this));
break;
case mode3F:
- space->install_write_handler(0x00, 0x3f, write8_delegate(FUNC(a2600_state::mode3F_switch_w),this));
+ space.install_write_handler(0x00, 0x3f, write8_delegate(FUNC(a2600_state::mode3F_switch_w),this));
break;
case modeUA:
- space->install_write_handler(0x200, 0x27f, write8_delegate(FUNC(a2600_state::modeUA_switch_w),this));
- space->install_read_handler(0x200, 0x27f, read8_delegate(FUNC(a2600_state::modeUA_switch_r),this));
+ space.install_write_handler(0x200, 0x27f, write8_delegate(FUNC(a2600_state::modeUA_switch_w),this));
+ space.install_read_handler(0x200, 0x27f, read8_delegate(FUNC(a2600_state::modeUA_switch_r),this));
break;
case modeE7:
- space->install_write_handler(0x1fe0, 0x1fe7, write8_delegate(FUNC(a2600_state::modeE7_switch_w),this));
- space->install_read_handler(0x1fe0, 0x1fe7, read8_delegate(FUNC(a2600_state::modeE7_switch_r),this));
- space->install_write_handler(0x1fe8, 0x1feb, write8_delegate(FUNC(a2600_state::modeE7_RAM_switch_w),this));
- space->install_read_handler(0x1fe8, 0x1feb, read8_delegate(FUNC(a2600_state::modeE7_RAM_switch_r),this));
- space->install_readwrite_bank(0x1800, 0x18ff, "bank9");
+ space.install_write_handler(0x1fe0, 0x1fe7, write8_delegate(FUNC(a2600_state::modeE7_switch_w),this));
+ space.install_read_handler(0x1fe0, 0x1fe7, read8_delegate(FUNC(a2600_state::modeE7_switch_r),this));
+ space.install_write_handler(0x1fe8, 0x1feb, write8_delegate(FUNC(a2600_state::modeE7_RAM_switch_w),this));
+ space.install_read_handler(0x1fe8, 0x1feb, read8_delegate(FUNC(a2600_state::modeE7_RAM_switch_r),this));
+ space.install_readwrite_bank(0x1800, 0x18ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base() + 4 * 256 );
break;
case modeDC:
- space->install_write_handler(0x1ff0, 0x1ff0, write8_delegate(FUNC(a2600_state::modeDC_switch_w),this));
- space->install_read_handler(0x1ff0, 0x1ff0, read8_delegate(FUNC(a2600_state::modeDC_switch_r),this));
+ space.install_write_handler(0x1ff0, 0x1ff0, write8_delegate(FUNC(a2600_state::modeDC_switch_w),this));
+ space.install_read_handler(0x1ff0, 0x1ff0, read8_delegate(FUNC(a2600_state::modeDC_switch_r),this));
break;
case modeFE:
- space->install_write_handler(0x01fe, 0x01fe, write8_delegate(FUNC(a2600_state::modeFE_switch_w),this));
- space->install_read_handler(0x01fe, 0x01fe, read8_delegate(FUNC(a2600_state::modeFE_switch_r),this));
+ space.install_write_handler(0x01fe, 0x01fe, write8_delegate(FUNC(a2600_state::modeFE_switch_w),this));
+ space.install_read_handler(0x01fe, 0x01fe, read8_delegate(FUNC(a2600_state::modeFE_switch_r),this));
break;
case mode3E:
- space->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(a2600_state::mode3E_RAM_switch_w),this));
- space->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(a2600_state::mode3E_switch_w),this));
- space->install_write_handler(0x1400, 0x15ff, write8_delegate(FUNC(a2600_state::mode3E_RAM_w),this));
+ space.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(a2600_state::mode3E_RAM_switch_w),this));
+ space.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(a2600_state::mode3E_switch_w),this));
+ space.install_write_handler(0x1400, 0x15ff, write8_delegate(FUNC(a2600_state::mode3E_RAM_w),this));
break;
case modeSS:
- space->install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(a2600_state::modeSS_r),this));
+ space.install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(a2600_state::modeSS_r),this));
m_bank_base[1] = m_extra_RAM->base() + 2 * 0x800;
m_bank_base[2] = CART_MEMBER;
membank("bank1")->set_base(m_bank_base[1] );
membank("bank2")->set_base(m_bank_base[2] );
m_modeSS_write_enabled = 0;
m_modeSS_byte_started = 0;
- space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeSS_opbase), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeSS_opbase), this));
/* The Supercharger has no motor control so just enable it */
machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MOTOR_DISABLED );
break;
case modeFV:
- space->install_write_handler(0x1fd0, 0x1fd0, write8_delegate(FUNC(a2600_state::modeFV_switch_w),this));
- space->install_read_handler(0x1fd0, 0x1fd0, read8_delegate(FUNC(a2600_state::modeFV_switch_r),this));
+ space.install_write_handler(0x1fd0, 0x1fd0, write8_delegate(FUNC(a2600_state::modeFV_switch_w),this));
+ space.install_read_handler(0x1fd0, 0x1fd0, read8_delegate(FUNC(a2600_state::modeFV_switch_r),this));
break;
case modeDPC:
- space->install_read_handler(0x1000, 0x103f, read8_delegate(FUNC(a2600_state::modeDPC_r),this));
- space->install_write_handler(0x1040, 0x107f, write8_delegate(FUNC(a2600_state::modeDPC_w),this));
- space->install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
- space->install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
- space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeDPC_opbase_handler), this));
+ space.install_read_handler(0x1000, 0x103f, read8_delegate(FUNC(a2600_state::modeDPC_r),this));
+ space.install_write_handler(0x1040, 0x107f, write8_delegate(FUNC(a2600_state::modeDPC_w),this));
+ space.install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
+ space.install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeDPC_opbase_handler), this));
{
int data_fetcher;
for( data_fetcher = 0; data_fetcher < 8; data_fetcher++ )
@@ -2020,8 +2020,8 @@ void a2600_state::machine_reset()
break;
case modeJVP:
- space->install_read_handler(0x0FA0, 0x0FC0, read8_delegate(FUNC(a2600_state::modeJVP_switch_r),this));
- space->install_write_handler(0x0FA0, 0x0FC0, write8_delegate(FUNC(a2600_state::modeJVP_switch_w),this));
+ space.install_read_handler(0x0FA0, 0x0FC0, read8_delegate(FUNC(a2600_state::modeJVP_switch_r),this));
+ space.install_write_handler(0x0FA0, 0x0FC0, write8_delegate(FUNC(a2600_state::modeJVP_switch_w),this));
break;
}
@@ -2029,24 +2029,24 @@ void a2600_state::machine_reset()
if (m_banking_mode == modeFA)
{
- space->install_write_bank(0x1000, 0x10ff, "bank9");
- space->install_read_bank(0x1100, 0x11ff, "bank9");
+ space.install_write_bank(0x1000, 0x10ff, "bank9");
+ space.install_read_bank(0x1100, 0x11ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base());
}
if (m_banking_mode == modeCV)
{
- space->install_write_bank(0x1400, 0x17ff, "bank9");
- space->install_read_bank(0x1000, 0x13ff, "bank9");
+ space.install_write_bank(0x1400, 0x17ff, "bank9");
+ space.install_read_bank(0x1000, 0x13ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base());
}
if (chip)
{
- space->install_write_bank(0x1000, 0x107f, "bank9");
- space->install_read_bank(0x1080, 0x10ff, "bank9");
+ space.install_write_bank(0x1000, 0x107f, "bank9");
+ space.install_read_bank(0x1080, 0x10ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base());
}
diff --git a/src/mess/drivers/a5105.c b/src/mess/drivers/a5105.c
index 2455bd937fe..a3436071fd4 100644
--- a/src/mess/drivers/a5105.c
+++ b/src/mess/drivers/a5105.c
@@ -454,8 +454,8 @@ INPUT_PORTS_END
void a5105_state::machine_reset()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- a5105_ab_w(*space, 0, 9); // turn motor off
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ a5105_ab_w(space, 0, 9); // turn motor off
beep_set_frequency(m_beep, 500);
m_ram_base = (UINT8*)machine().device<ram_device>(RAM_TAG)->pointer();
diff --git a/src/mess/drivers/amiga.c b/src/mess/drivers/amiga.c
index eca358cdbce..3f689dd2867 100644
--- a/src/mess/drivers/amiga.c
+++ b/src/mess/drivers/amiga.c
@@ -58,15 +58,15 @@ static DECLARE_WRITE8_DEVICE_HANDLER( amiga_cia_0_portA_w );
static READ16_HANDLER( amiga_clock_r )
{
- msm6242_device *rtc = space->machine().device<msm6242_device>("rtc");
- return rtc->read(*space,offset / 2);
+ msm6242_device *rtc = space.machine().device<msm6242_device>("rtc");
+ return rtc->read(space,offset / 2);
}
static WRITE16_HANDLER( amiga_clock_w )
{
- msm6242_device *rtc = space->machine().device<msm6242_device>("rtc");
- rtc->write(*space,offset / 2, data);
+ msm6242_device *rtc = space.machine().device<msm6242_device>("rtc");
+ rtc->write(space,offset / 2, data);
}
diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c
index ba8fdfad0d0..acae1e12d0a 100644
--- a/src/mess/drivers/apexc.c
+++ b/src/mess/drivers/apexc.c
@@ -397,7 +397,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( apexc_interrupt )
{
apexc_state *state = device->machine().driver_data<apexc_state>();
- address_space* space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT32 edit_keys;
int control_keys;
@@ -478,11 +478,11 @@ static INTERRUPT_GEN( apexc_interrupt )
if (control_keys & panel_write) {
/* write memory */
- space->write_dword(device->state().state_int(APEXC_ML_FULL)<<2, state->m_panel_data_reg);
+ space.write_dword(device->state().state_int(APEXC_ML_FULL)<<2, state->m_panel_data_reg);
}
else {
/* read memory */
- state->m_panel_data_reg = space->read_dword(device->state().state_int(APEXC_ML_FULL)<<2);
+ state->m_panel_data_reg = space.read_dword(device->state().state_int(APEXC_ML_FULL)<<2);
}
}
diff --git a/src/mess/drivers/apollo.c b/src/mess/drivers/apollo.c
index 8c34df4d8c6..fcd8887207a 100644
--- a/src/mess/drivers/apollo.c
+++ b/src/mess/drivers/apollo.c
@@ -483,7 +483,7 @@ WRITE32_MEMBER(apollo_state::ram_with_parity_w){
// no more than 192 read/write handlers may be used
// see table_assign_handler in memory.c
if (parity_error_handler_install_counter < 40) {
- //memory_install_read32_handler(&space, ram_base_address+offset*4, ram_base_address+offset*4+3, 0xffffffff, 0, ram_with_parity_r);
+ //memory_install_read32_handler(space, ram_base_address+offset*4, ram_base_address+offset*4+3, 0xffffffff, 0, ram_with_parity_r);
space.install_read_handler(ram_base_address+offset*4, ram_base_address+offset*4+3, 0xffffffff,0,read32_delegate(FUNC(apollo_state::ram_with_parity_r),this));
parity_error_handler_is_installed = 1;
parity_error_handler_install_counter++;
@@ -495,7 +495,7 @@ WRITE32_MEMBER(apollo_state::ram_with_parity_w){
// uninstall not supported, reinstall previous read handler instead
- // memory_install_rom(&space, ram_base_address, ram_end_address, 0xffffffff, 0, messram_ptr.v);
+ // memory_install_rom(space, ram_base_address, ram_end_address, 0xffffffff, 0, messram_ptr.v);
space.install_rom(ram_base_address,ram_end_address,0xffffffff,0,&m_messram_ptr[0]);
parity_error_handler_is_installed = 0;
diff --git a/src/mess/drivers/aquarius.c b/src/mess/drivers/aquarius.c
index e11db47d247..a92000c1088 100644
--- a/src/mess/drivers/aquarius.c
+++ b/src/mess/drivers/aquarius.c
@@ -216,9 +216,9 @@ DRIVER_INIT_MEMBER(aquarius_state,aquarius)
/* install expansion memory if available */
if (machine().device<ram_device>(RAM_TAG)->size() > 0x1000)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_readwrite_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 0x1000 - 1, "bank1");
+ space.install_readwrite_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 0x1000 - 1, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
}
}
diff --git a/src/mess/drivers/astrocde.c b/src/mess/drivers/astrocde.c
index ebd5886f6c2..8ff035f8e75 100644
--- a/src/mess/drivers/astrocde.c
+++ b/src/mess/drivers/astrocde.c
@@ -14,7 +14,7 @@
#include "machine/ram.h"
MACHINE_RESET( astrocde );
-void get_ram_expansion_settings(address_space *space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end);
+void get_ram_expansion_settings(address_space &space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end);
/*************************************
*
@@ -90,7 +90,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( set_write_protect ) // run when RAM expansion write protect switch is changed
{
int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0;
- address_space *space = field.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *field.machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *expram = field.machine().device<ram_device>("ram_tag")->pointer();
get_ram_expansion_settings(space, ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference
@@ -99,13 +99,13 @@ static INPUT_CHANGED( set_write_protect ) // run when RAM expansion write prote
{
if (write_protect_on == 0) // write protect off, so install memory normally
{
- space->install_ram(expansion_ram_start, expansion_ram_end, expram);
+ space.install_ram(expansion_ram_start, expansion_ram_end, expram);
if (shadow_ram_end > expansion_ram_end)
- space->install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
+ space.install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
}
else // write protect on, so make memory read only
{
- space->nop_write(expansion_ram_start, expansion_ram_end);
+ space.nop_write(expansion_ram_start, expansion_ram_end);
}
}
}
@@ -310,9 +310,9 @@ DRIVER_INIT_MEMBER(astrocde_state,astrocde)
MACHINE_RESET( astrocde )
{
int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *expram = machine.device<ram_device>("ram_tag")->pointer();
- space->unmap_readwrite(0x5000, 0xffff); // unmap any previously installed expansion RAM
+ space.unmap_readwrite(0x5000, 0xffff); // unmap any previously installed expansion RAM
get_ram_expansion_settings(space, ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference
@@ -320,27 +320,27 @@ MACHINE_RESET( astrocde )
{
if (write_protect_on == 0) // write protect off, so install memory normally
{
- space->install_ram(expansion_ram_start, expansion_ram_end, expram);
+ space.install_ram(expansion_ram_start, expansion_ram_end, expram);
if (shadow_ram_end > expansion_ram_end)
- space->install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
+ space.install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
}
else // write protect on, so make memory read only
{
- space->nop_write(expansion_ram_start, expansion_ram_end);
+ space.nop_write(expansion_ram_start, expansion_ram_end);
}
}
}
-void get_ram_expansion_settings(address_space *space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end)
+void get_ram_expansion_settings(address_space &space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end)
{
- if (space->machine().root_device().ioport("PROTECT")->read() == 0x01)
+ if (space.machine().root_device().ioport("PROTECT")->read() == 0x01)
write_protect_on = 1;
else
write_protect_on = 0;
ram_expansion_installed = 1;
- switch(space->machine().root_device().ioport("CFG")->read()) // check RAM expansion configuration and set address ranges
+ switch(space.machine().root_device().ioport("CFG")->read()) // check RAM expansion configuration and set address ranges
{
case 0x00: // No RAM Expansion
ram_expansion_installed = 0;
diff --git a/src/mess/drivers/atm.c b/src/mess/drivers/atm.c
index ac02807ad09..86144ec6a1f 100644
--- a/src/mess/drivers/atm.c
+++ b/src/mess/drivers/atm.c
@@ -120,17 +120,17 @@ ADDRESS_MAP_END
MACHINE_RESET_MEMBER(atm_state,atm)
{
UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
device_t *beta = machine().device(BETA_DISK_TAG);
- space->install_read_bank(0x0000, 0x3fff, "bank1");
- space->unmap_write(0x0000, 0x3fff);
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
+ space.unmap_write(0x0000, 0x3fff);
if (beta->started()) {
betadisk_enable(beta);
betadisk_clear_status(beta);
}
- space->set_direct_update_handler(direct_update_delegate(FUNC(atm_state::atm_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(atm_state::atm_direct), this));
memset(messram,0,128*1024);
diff --git a/src/mess/drivers/avigo.c b/src/mess/drivers/avigo.c
index 3af8c4203fd..5919a279c5f 100644
--- a/src/mess/drivers/avigo.c
+++ b/src/mess/drivers/avigo.c
@@ -158,7 +158,7 @@ static RP5C01_INTERFACE( rtc_intf )
void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
{
- address_space* space = m_maincpu->space(AS_PROGRAM);
+ address_space& space = *m_maincpu->space(AS_PROGRAM);
int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000);
char bank_tag[6];
@@ -167,14 +167,14 @@ void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
switch (chip_select)
{
case 0x06: // videoram
- space->install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, read8_delegate(FUNC(avigo_state::vid_memory_r), this), write8_delegate(FUNC(avigo_state::vid_memory_w), this));
+ space.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, read8_delegate(FUNC(avigo_state::vid_memory_r), this), write8_delegate(FUNC(avigo_state::vid_memory_w), this));
active_flash = -1;
break;
case 0x01: // banked RAM
sprintf(bank_tag,"bank%d", bank);
membank(bank_tag)->set_base(m_ram_base + (((bank == 1 ? m_bank1_l : m_bank2_l) & 0x07)<<14));
- space->install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag);
+ space.install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag);
active_flash = -1;
break;
@@ -185,9 +185,9 @@ void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
if (active_flash < 0) // to avoid useless calls to install_readwrite_handler that cause slowdowns
{
if (bank == 1)
- space->install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(avigo_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x4000_write_handler), this));
+ space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(avigo_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x4000_write_handler), this));
else
- space->install_readwrite_handler(0x8000, 0xbfff, read8_delegate(FUNC(avigo_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x8000_write_handler), this));
+ space.install_readwrite_handler(0x8000, 0xbfff, read8_delegate(FUNC(avigo_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x8000_write_handler), this));
}
switch (chip_select)
@@ -201,7 +201,7 @@ void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
default:
logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff);
- space->unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
+ space.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
active_flash = -1;
break;
}
diff --git a/src/mess/drivers/b16.c b/src/mess/drivers/b16.c
index 46393e82179..057d2e0b50e 100644
--- a/src/mess/drivers/b16.c
+++ b/src/mess/drivers/b16.c
@@ -262,8 +262,8 @@ static const mc6845_interface mc6845_intf =
NULL /* update address callback */
};
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( b16_dma8237_interface )
{
diff --git a/src/mess/drivers/basic52.c b/src/mess/drivers/basic52.c
index b1c41d91425..69afbce87fe 100644
--- a/src/mess/drivers/basic52.c
+++ b/src/mess/drivers/basic52.c
@@ -80,8 +80,8 @@ INPUT_PORTS_END
static void to_term(device_t *device, int data )
{
basic52_state *state = device->machine().driver_data<basic52_state>();
- address_space *space = device->memory().space(AS_PROGRAM);
- state->m_terminal->write(*space, 0, data);
+ address_space &space = *device->memory().space(AS_PROGRAM);
+ state->m_terminal->write(space, 0, data);
}
static int from_term(device_t *device)
diff --git a/src/mess/drivers/bebox.c b/src/mess/drivers/bebox.c
index c49b49b843e..b8e80d6e417 100644
--- a/src/mess/drivers/bebox.c
+++ b/src/mess/drivers/bebox.c
@@ -37,8 +37,8 @@
#include "formats/pc_dsk.h"
#include "machine/ram.h"
-static READ8_HANDLER(at_dma8237_1_r) { return i8237_r(space->machine().device("dma8237_2"), *space, offset / 2); }
-static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space->machine().device("dma8237_2"), *space, offset / 2, data); }
+static READ8_HANDLER(at_dma8237_1_r) { return i8237_r(space.machine().device("dma8237_2"), space, offset / 2); }
+static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space.machine().device("dma8237_2"), space, offset / 2, data); }
static ADDRESS_MAP_START( bebox_mem, AS_PROGRAM, 64, bebox_state )
AM_RANGE(0x7FFFF0F0, 0x7FFFF0F7) AM_READWRITE_LEGACY(bebox_cpu0_imask_r, bebox_cpu0_imask_w )
@@ -76,15 +76,15 @@ ADDRESS_MAP_END
static READ64_HANDLER(bb_slave_64be_r)
{
- pci_bus_device *device = space->machine().device<pci_bus_device>("pcibus");
+ pci_bus_device *device = space.machine().device<pci_bus_device>("pcibus");
// 2e94 is the real address, 2e84 is where the PC appears to be under full DRC
- if ((space->device().safe_pc() == 0xfff02e94) || (space->device().safe_pc() == 0xfff02e84))
+ if ((space.device().safe_pc() == 0xfff02e94) || (space.device().safe_pc() == 0xfff02e84))
{
return 0x108000ff; // indicate slave CPU
}
- return device->read_64be(*space, offset, mem_mask);
+ return device->read_64be(space, offset, mem_mask);
}
static ADDRESS_MAP_START( bebox_slave_mem, AS_PROGRAM, 64, bebox_state )
diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c
index 93254c450a0..378d1c0f55b 100644
--- a/src/mess/drivers/bigbord2.c
+++ b/src/mess/drivers/bigbord2.c
@@ -207,8 +207,8 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
/* Z80 DMA */
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
@@ -415,11 +415,11 @@ static TIMER_DEVICE_CALLBACK( ctc_tick )
WRITE_LINE_MEMBER( bigbord2_state::frame )
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
static UINT8 framecnt;
framecnt++;
- if ((space->read_byte(0xf13d) == 0x4d) & (framecnt > 3))
+ if ((space.read_byte(0xf13d) == 0x4d) & (framecnt > 3))
{
framecnt = 0;
// simulate interrupt by saving current pc on
@@ -427,9 +427,9 @@ WRITE_LINE_MEMBER( bigbord2_state::frame )
UINT16 spreg = m_maincpu->state_int(Z80_SP);
UINT16 pcreg = m_maincpu->state_int(Z80_PC);
spreg--;
- space->write_byte(spreg, pcreg >> 8);
+ space.write_byte(spreg, pcreg >> 8);
spreg--;
- space->write_byte(spreg, pcreg);
+ space.write_byte(spreg, pcreg);
m_maincpu->set_state_int(Z80_SP, spreg);
m_maincpu->set_state_int(Z80_PC, 0xF18E);
}
diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c
index 8ebc48d6c6b..951ab4ce1d2 100644
--- a/src/mess/drivers/bullet.c
+++ b/src/mess/drivers/bullet.c
@@ -798,8 +798,8 @@ WRITE8_MEMBER( bullet_state::dma_mreq_w )
}
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index cdfae00fffb..fed387cc73b 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -969,7 +969,7 @@ static const mc6845_interface vdc_intf =
READ8_MEMBER( c128_state::sid_potx_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
@@ -984,7 +984,7 @@ READ8_MEMBER( c128_state::sid_potx_r )
READ8_MEMBER( c128_state::sid_poty_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c
index 476dba7c07c..883fe2a3121 100644
--- a/src/mess/drivers/c64.c
+++ b/src/mess/drivers/c64.c
@@ -428,7 +428,7 @@ static MOS6567_INTERFACE( vic_intf )
READ8_MEMBER( c64_state::sid_potx_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
@@ -443,7 +443,7 @@ READ8_MEMBER( c64_state::sid_potx_r )
READ8_MEMBER( c64_state::sid_poty_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
diff --git a/src/mess/drivers/cd2650.c b/src/mess/drivers/cd2650.c
index 9726e0c9db3..74932bc9922 100644
--- a/src/mess/drivers/cd2650.c
+++ b/src/mess/drivers/cd2650.c
@@ -166,7 +166,7 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
QUICKLOAD_LOAD( cd2650 )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x440;
int exec_addr;
@@ -226,7 +226,7 @@ QUICKLOAD_LOAD( cd2650 )
read_ = quick_length;
for (i = quick_addr; i < read_; i++)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
read_ = 0x1780;
if (quick_length < 0x1780)
@@ -234,11 +234,11 @@ QUICKLOAD_LOAD( cd2650 )
if (quick_length > 0x157f)
for (i = 0x1580; i < read_; i++)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
if (quick_length > 0x17ff)
for (i = 0x1800; i < quick_length; i++)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr);
diff --git a/src/mess/drivers/d6800.c b/src/mess/drivers/d6800.c
index 80de332730c..46b5434bf3a 100644
--- a/src/mess/drivers/d6800.c
+++ b/src/mess/drivers/d6800.c
@@ -319,7 +319,7 @@ static const cassette_interface d6800_cassette_interface =
static QUICKLOAD_LOAD( d6800 )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x0200;
int exec_addr = 0xc000;
@@ -346,7 +346,7 @@ static QUICKLOAD_LOAD( d6800 )
for (i = 0; i < quick_length; i++)
if ((quick_addr + i) < 0x800)
- space->write_byte(i + quick_addr, quick_data[i]);
+ space.write_byte(i + quick_addr, quick_data[i]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length,quick_addr,quick_addr+quick_length,exec_addr);
diff --git a/src/mess/drivers/dc.c b/src/mess/drivers/dc.c
index df4f12b30f0..f8e4b6a34ad 100644
--- a/src/mess/drivers/dc.c
+++ b/src/mess/drivers/dc.c
@@ -42,20 +42,20 @@ extern WRITE64_HANDLER( dc_mess_g1_ctrl_w );
static READ64_HANDLER( dcus_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0ba52a)
- space->device().execute().spin_until_time(attotime::from_usec(2500));
- // device_spinuntil_int(&space->device());
+ if (space.device().safe_pc()==0xc0ba52a)
+ space.device().execute().spin_until_time(attotime::from_usec(2500));
+ // device_spinuntil_int(&space.device());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2303b0/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2303b0/8];
}
static READ64_HANDLER( dcjp_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0bac62)
- space->device().execute().spin_until_time(attotime::from_usec(2500));
- // device_spinuntil_int(&space->device());
+ if (space.device().safe_pc()==0xc0bac62)
+ space.device().execute().spin_until_time(attotime::from_usec(2500));
+ // device_spinuntil_int(&space.device());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2302f8/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2302f8/8];
}
DRIVER_INIT_MEMBER(dc_state,dc)
@@ -110,14 +110,14 @@ static WRITE64_HANDLER( dc_pdtra_w )
static READ64_HANDLER( dc_arm_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
return *((UINT64 *)state->dc_sound_ram.target()+offset);
}
static WRITE64_HANDLER( dc_arm_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
COMBINE_DATA((UINT64 *)state->dc_sound_ram.target() + offset);
}
@@ -126,7 +126,7 @@ static WRITE64_HANDLER( dc_arm_w )
// SB_LMMODE0
static WRITE64_HANDLER( ta_texture_directpath0_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int mode = state->pvrctrl_regs[SB_LMMODE0]&1;
if (mode&1)
@@ -143,7 +143,7 @@ static WRITE64_HANDLER( dc_arm_w )
// SB_LMMODE1
static WRITE64_HANDLER( ta_texture_directpath1_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int mode = state->pvrctrl_regs[SB_LMMODE1]&1;
if (mode&1)
diff --git a/src/mess/drivers/dmv.c b/src/mess/drivers/dmv.c
index ebce5851c1c..8909acec968 100644
--- a/src/mess/drivers/dmv.c
+++ b/src/mess/drivers/dmv.c
@@ -277,8 +277,8 @@ WRITE_LINE_MEMBER( dmv_state::dma_hrq_changed )
i8237_hlda_w(m_dmac, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( dmv_dma8237_config )
{
diff --git a/src/mess/drivers/enterp.c b/src/mess/drivers/enterp.c
index 0ea84d1f692..1ff333dced3 100644
--- a/src/mess/drivers/enterp.c
+++ b/src/mess/drivers/enterp.c
@@ -31,9 +31,9 @@
MEMORY / I/O
***************************************************************************/
-static void enterprise_update_memory_page(address_space *space, offs_t page, int index)
+static void enterprise_update_memory_page(address_space &space, offs_t page, int index)
{
- ep_state *state = space->machine().driver_data<ep_state>();
+ ep_state *state = space.machine().driver_data<ep_state>();
int start = (page - 1) * 0x4000;
int end = (page - 1) * 0x4000 + 0x3fff;
char page_num[10];
@@ -45,24 +45,24 @@ static void enterprise_update_memory_page(address_space *space, offs_t page, int
case 0x01:
case 0x02:
case 0x03:
- space->install_read_bank(start, end, page_num);
- space->nop_write(start, end);
- state->membank(page_num)->set_base(space->machine().root_device().memregion("exos")->base() + (index * 0x4000));
+ space.install_read_bank(start, end, page_num);
+ space.nop_write(start, end);
+ state->membank(page_num)->set_base(space.machine().root_device().memregion("exos")->base() + (index * 0x4000));
break;
case 0x04:
case 0x05:
case 0x06:
case 0x07:
- space->install_read_bank(start, end, page_num);
- space->nop_write(start, end);
- state->membank(page_num)->set_base(space->machine().root_device().memregion("cartridges")->base() + ((index - 0x04) * 0x4000));
+ space.install_read_bank(start, end, page_num);
+ space.nop_write(start, end);
+ state->membank(page_num)->set_base(space.machine().root_device().memregion("cartridges")->base() + ((index - 0x04) * 0x4000));
break;
case 0x20:
case 0x21:
- space->install_read_bank(start, end, page_num);
- space->nop_write(start, end);
+ space.install_read_bank(start, end, page_num);
+ space.nop_write(start, end);
state->membank(page_num)->set_base(state->memregion("exdos")->base() + ((index - 0x20) * 0x4000));
break;
@@ -71,14 +71,14 @@ static void enterprise_update_memory_page(address_space *space, offs_t page, int
case 0xfa:
case 0xfb:
/* additional 64k ram */
- if (space->machine().device<ram_device>(RAM_TAG)->size() == 128*1024)
+ if (space.machine().device<ram_device>(RAM_TAG)->size() == 128*1024)
{
- space->install_readwrite_bank(start, end, page_num);
- state->membank(page_num)->set_base(space->machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xf4) * 0x4000);
+ space.install_readwrite_bank(start, end, page_num);
+ state->membank(page_num)->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xf4) * 0x4000);
}
else
{
- space->unmap_readwrite(start, end);
+ space.unmap_readwrite(start, end);
}
break;
@@ -87,12 +87,12 @@ static void enterprise_update_memory_page(address_space *space, offs_t page, int
case 0xfe:
case 0xff:
/* basic 64k ram */
- space->install_readwrite_bank(start, end, page_num);
- state->membank(page_num)->set_base(space->machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xfc) * 0x4000);
+ space.install_readwrite_bank(start, end, page_num);
+ state->membank(page_num)->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xfc) * 0x4000);
break;
default:
- space->unmap_readwrite(start, end);
+ space.unmap_readwrite(start, end);
}
}
@@ -108,7 +108,7 @@ static WRITE8_DEVICE_HANDLER( enterprise_dave_reg_write )
case 0x11:
case 0x12:
case 0x13:
- enterprise_update_memory_page(device->machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
+ enterprise_update_memory_page(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
break;
case 0x15:
diff --git a/src/mess/drivers/esq5505.c b/src/mess/drivers/esq5505.c
index 85d1be5843d..ab829cd17ff 100644
--- a/src/mess/drivers/esq5505.c
+++ b/src/mess/drivers/esq5505.c
@@ -136,7 +136,7 @@ void esq5505_state::machine_reset()
READ16_MEMBER(esq5505_state::es5510_dsp_r)
{
-// logerror("%06x: DSP read offset %04x (data is %04x)\n",space->device().safe_pc(),offset,es5510_dsp_ram[offset]);
+// logerror("%06x: DSP read offset %04x (data is %04x)\n",space.device().safe_pc(),offset,es5510_dsp_ram[offset]);
switch(offset)
{
diff --git a/src/mess/drivers/fk1.c b/src/mess/drivers/fk1.c
index 4596a9762f3..0a3bea99b50 100644
--- a/src/mess/drivers/fk1.c
+++ b/src/mess/drivers/fk1.c
@@ -423,10 +423,10 @@ static TIMER_DEVICE_CALLBACK( vsync_callback )
void fk1_state::machine_reset()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); // ROM
membank("bank2")->set_base(ram + 0x10000); // VRAM
membank("bank3")->set_base(ram + 0x8000);
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 97417e01124..792d5d6252c 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -53,7 +53,7 @@
#include "includes/fm7.h"
-static void fm7_mmr_refresh(address_space*);
+static void fm7_mmr_refresh(address_space&);
@@ -352,7 +352,7 @@ READ8_MEMBER(fm7_state::fm7_rom_en_r)
membank("bank1")->set_base(RAM+0x38000);
}
else
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("BASIC ROM enabled\n");
return 0x00;
}
@@ -368,7 +368,7 @@ WRITE8_MEMBER(fm7_state::fm7_rom_en_w)
membank("bank1")->set_base(RAM+0x8000);
}
else
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("BASIC ROM disabled\n");
}
@@ -383,12 +383,12 @@ WRITE8_MEMBER(fm7_state::fm7_init_en_w)
if(data & 0x02)
{
m_init_rom_en = 0;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
}
else
{
m_init_rom_en = 1;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
}
}
@@ -985,9 +985,9 @@ READ8_MEMBER(fm7_state::fm7_mmr_r)
return 0xff;
}
-static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
+static void fm7_update_bank(address_space & space, int bank, UINT8 physical)
{
- fm7_state *state = space->machine().driver_data<fm7_state>();
+ fm7_state *state = space.machine().driver_data<fm7_state>();
UINT8* RAM = state->memregion("maincpu")->base();
UINT16 size = 0xfff;
char bank_name[10];
@@ -1002,40 +1002,40 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
switch(physical)
{
case 0x10:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram0_r),state),write8_delegate(FUNC(fm7_state::fm7_vram0_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram0_r),state),write8_delegate(FUNC(fm7_state::fm7_vram0_w),state));
break;
case 0x11:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram1_r),state),write8_delegate(FUNC(fm7_state::fm7_vram1_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram1_r),state),write8_delegate(FUNC(fm7_state::fm7_vram1_w),state));
break;
case 0x12:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram2_r),state),write8_delegate(FUNC(fm7_state::fm7_vram2_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram2_r),state),write8_delegate(FUNC(fm7_state::fm7_vram2_w),state));
break;
case 0x13:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram3_r),state),write8_delegate(FUNC(fm7_state::fm7_vram3_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram3_r),state),write8_delegate(FUNC(fm7_state::fm7_vram3_w),state));
break;
case 0x14:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram4_r),state),write8_delegate(FUNC(fm7_state::fm7_vram4_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram4_r),state),write8_delegate(FUNC(fm7_state::fm7_vram4_w),state));
break;
case 0x15:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram5_r),state),write8_delegate(FUNC(fm7_state::fm7_vram5_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram5_r),state),write8_delegate(FUNC(fm7_state::fm7_vram5_w),state));
break;
case 0x16:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram6_r),state),write8_delegate(FUNC(fm7_state::fm7_vram6_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram6_r),state),write8_delegate(FUNC(fm7_state::fm7_vram6_w),state));
break;
case 0x17:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram7_r),state),write8_delegate(FUNC(fm7_state::fm7_vram7_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram7_r),state),write8_delegate(FUNC(fm7_state::fm7_vram7_w),state));
break;
case 0x18:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram8_r),state),write8_delegate(FUNC(fm7_state::fm7_vram8_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram8_r),state),write8_delegate(FUNC(fm7_state::fm7_vram8_w),state));
break;
case 0x19:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram9_r),state),write8_delegate(FUNC(fm7_state::fm7_vram9_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram9_r),state),write8_delegate(FUNC(fm7_state::fm7_vram9_w),state));
break;
case 0x1a:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramA_r),state),write8_delegate(FUNC(fm7_state::fm7_vramA_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramA_r),state),write8_delegate(FUNC(fm7_state::fm7_vramA_w),state));
break;
case 0x1b:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramB_r),state),write8_delegate(FUNC(fm7_state::fm7_vramB_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramB_r),state),write8_delegate(FUNC(fm7_state::fm7_vramB_w),state));
break;
}
// state->membank(bank+1)->set_base(RAM+(physical<<12)-0x10000);
@@ -1043,21 +1043,21 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
}
if(physical == 0x1c)
{
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_console_ram_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_console_ram_banked_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_console_ram_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_console_ram_banked_w),state));
return;
}
if(physical == 0x1d)
{
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_w),state));
return;
}
if(physical == 0x35)
{
if(state->m_init_rom_en && (state->m_type == SYS_FM11 || state->m_type == SYS_FM16))
{
- RAM = space->machine().root_device().memregion("init")->base();
- space->install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space->nop_write(bank*0x1000,(bank*0x1000)+size);
+ RAM = space.machine().root_device().memregion("init")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
state->membank(bank_name)->set_base(RAM+(physical<<12)-0x35000);
return;
}
@@ -1066,9 +1066,9 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
{
if(state->m_init_rom_en && (state->m_type != SYS_FM11 && state->m_type != SYS_FM16))
{
- RAM = space->machine().root_device().memregion("init")->base();
- space->install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space->nop_write(bank*0x1000,(bank*0x1000)+size);
+ RAM = space.machine().root_device().memregion("init")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
state->membank(bank_name)->set_base(RAM+(physical<<12)-0x36000);
return;
}
@@ -1077,20 +1077,20 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
{
if(state->m_basic_rom_en && (state->m_type != SYS_FM11 && state->m_type != SYS_FM16))
{
- RAM = space->machine().root_device().memregion("fbasic")->base();
- space->install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space->nop_write(bank*0x1000,(bank*0x1000)+size);
+ RAM = space.machine().root_device().memregion("fbasic")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
state->membank(bank_name)->set_base(RAM+(physical<<12)-0x38000);
return;
}
}
- space->install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
state->membank(bank_name)->set_base(RAM+(physical<<12));
}
-static void fm7_mmr_refresh(address_space* space)
+static void fm7_mmr_refresh(address_space& space)
{
- fm7_state *state = space->machine().driver_data<fm7_state>();
+ fm7_state *state = space.machine().driver_data<fm7_state>();
int x;
UINT16 window_addr;
UINT8* RAM = state->memregion("maincpu")->base();
@@ -1115,7 +1115,7 @@ static void fm7_mmr_refresh(address_space* space)
window_addr = ((state->m_mmr.window_offset << 8) + 0x7c00) & 0xffff;
// if(window_addr < 0xfc00)
{
- space->install_readwrite_bank(0x7c00,0x7fff,"bank24");
+ space.install_readwrite_bank(0x7c00,0x7fff,"bank24");
state->membank("bank24")->set_base(RAM+window_addr);
}
}
@@ -1127,7 +1127,7 @@ WRITE8_MEMBER(fm7_state::fm7_mmr_w)
{
m_mmr.bank_addr[m_mmr.segment][offset] = data;
if(m_mmr.enabled)
- fm7_update_bank(&space,offset,data);
+ fm7_update_bank(space,offset,data);
logerror("MMR: Segment %i, bank %i, set to 0x%02x\n",m_mmr.segment,offset,data);
return;
}
@@ -1135,18 +1135,18 @@ WRITE8_MEMBER(fm7_state::fm7_mmr_w)
{
case 0x10:
m_mmr.segment = data & 0x07;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("MMR: Active segment set to %i\n",m_mmr.segment);
break;
case 0x12:
m_mmr.window_offset = data;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("MMR: Window offset set to %02x\n",data);
break;
case 0x13:
m_mmr.mode = data;
m_mmr.enabled = data & 0x80;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("MMR: Mode register set to %02x\n",data);
break;
}
@@ -1963,7 +1963,7 @@ void fm7_state::machine_reset()
}
if(m_type == SYS_FM77AV || m_type == SYS_FM77AV40EX || m_type == SYS_FM11)
{
- fm7_mmr_refresh(machine().device("maincpu")->memory().space(AS_PROGRAM));
+ fm7_mmr_refresh(*machine().device("maincpu")->memory().space(AS_PROGRAM));
}
if(m_type == SYS_FM11)
{
diff --git a/src/mess/drivers/fmtowns.c b/src/mess/drivers/fmtowns.c
index 5a49987ea5b..50b8ac3a95e 100644
--- a/src/mess/drivers/fmtowns.c
+++ b/src/mess/drivers/fmtowns.c
@@ -270,7 +270,7 @@ WRITE8_MEMBER(towns_state::towns_system_w)
switch(offset)
{
case 0x00: // bit 7 = NMI vector protect, bit 6 = power off, bit 0 = software reset, bit 3 = A20 line?
-// space->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_A20,(data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+// space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_A20,(data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
logerror("SYS: port 0x20 write %02x\n",data);
break;
case 0x02:
diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c
index e1eb3d56932..037a3d49e72 100644
--- a/src/mess/drivers/gba.c
+++ b/src/mess/drivers/gba.c
@@ -154,7 +154,7 @@ static void dma_exec(running_machine &machine, FPTR ch)
int ctrl;
int srcadd, dstadd;
UINT32 src, dst;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
gba_state *state = machine.driver_data<gba_state>();
src = state->m_dma_src[ch];
@@ -207,7 +207,7 @@ static void dma_exec(running_machine &machine, FPTR ch)
dst &= 0xfffffffc;
// 32-bit
- space->write_dword(dst, space->read_dword(src));
+ space.write_dword(dst, space.read_dword(src));
switch (dstadd)
{
case 0: // increment
@@ -242,7 +242,7 @@ static void dma_exec(running_machine &machine, FPTR ch)
dst &= 0xfffffffe;
// 16-bit
- space->write_word(dst, space->read_word(src));
+ space.write_word(dst, space.read_word(src));
switch (dstadd)
{
case 0: // increment
diff --git a/src/mess/drivers/gp32.c b/src/mess/drivers/gp32.c
index cf308f86a21..2928f382ecd 100644
--- a/src/mess/drivers/gp32.c
+++ b/src/mess/drivers/gp32.c
@@ -708,7 +708,7 @@ static void s3c240x_dma_trigger( running_machine &machine, int dma)
gp32_state *state = machine.driver_data<gp32_state>();
UINT32 *regs = &state->m_s3c240x_dma_regs[dma<<3];
UINT32 curr_tc, curr_src, curr_dst;
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM);
int dsz, inc_src, inc_dst, servmode;
static const UINT32 ch_int[] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 };
verboselog( machine, 5, "DMA %d trigger\n", dma);
@@ -725,9 +725,9 @@ static void s3c240x_dma_trigger( running_machine &machine, int dma)
curr_tc--;
switch (dsz)
{
- case 0 : space->write_byte( curr_dst, space->read_byte( curr_src)); break;
- case 1 : space->write_word( curr_dst, space->read_word( curr_src)); break;
- case 2 : space->write_dword( curr_dst, space->read_dword( curr_src)); break;
+ case 0 : space.write_byte( curr_dst, space.read_byte( curr_src)); break;
+ case 1 : space.write_word( curr_dst, space.read_word( curr_src)); break;
+ case 2 : space.write_dword( curr_dst, space.read_dword( curr_src)); break;
}
if (inc_src == 0) curr_src += (1 << dsz);
if (inc_dst == 0) curr_dst += (1 << dsz);
diff --git a/src/mess/drivers/homelab.c b/src/mess/drivers/homelab.c
index 08a336db52e..5e2824e2f02 100644
--- a/src/mess/drivers/homelab.c
+++ b/src/mess/drivers/homelab.c
@@ -646,7 +646,7 @@ static const mea8000_interface brailab4_speech_intf = { "speech", DEVCB_NULL };
static QUICKLOAD_LOAD(homelab)
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i=0;
UINT8 ch;
UINT16 quick_addr;
@@ -730,7 +730,7 @@ static QUICKLOAD_LOAD(homelab)
image.message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
return IMAGE_INIT_FAIL;
}
- space->write_byte(j, ch);
+ space.write_byte(j, ch);
}
return IMAGE_INIT_PASS;
diff --git a/src/mess/drivers/indiana.c b/src/mess/drivers/indiana.c
index 155eb4daf18..ce37cee85b1 100644
--- a/src/mess/drivers/indiana.c
+++ b/src/mess/drivers/indiana.c
@@ -84,7 +84,7 @@ READ8_HANDLER( indiana_vga_setting )
DRIVER_INIT_MEMBER(indiana_state,indiana)
{
pc_vga_init(machine(), indiana_vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f7a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f600000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f7a0000, *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f600000);
}
/* ROM definition */
diff --git a/src/mess/drivers/instruct.c b/src/mess/drivers/instruct.c
index d717eb1fd50..631695458c0 100644
--- a/src/mess/drivers/instruct.c
+++ b/src/mess/drivers/instruct.c
@@ -218,7 +218,7 @@ void instruct_state::machine_reset()
QUICKLOAD_LOAD( instruct )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x0100;
int exec_addr;
@@ -275,7 +275,7 @@ QUICKLOAD_LOAD( instruct )
for (i = quick_addr; i < quick_length; i++)
{
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
}
/* display a message about the loaded quickload */
diff --git a/src/mess/drivers/ip22.c b/src/mess/drivers/ip22.c
index 317c5952c58..13cd538907b 100644
--- a/src/mess/drivers/ip22.c
+++ b/src/mess/drivers/ip22.c
@@ -270,9 +270,9 @@ READ32_MEMBER(ip22_state::hpc3_pbus6_r)
//verboselog(( machine, 2, "Serial 2 Command Transfer Read, 0x1fbd9838: %02x\n", 0x04 );
return 0x00000004;
case 0x40/4:
- return kbdc8042_8_r(&space, 0);
+ return kbdc8042_8_r(space, 0);
case 0x44/4:
- return kbdc8042_8_r(&space, 4);
+ return kbdc8042_8_r(space, 4);
case 0x58/4:
return 0x20; // chip rev 1, board rev 0, "Guinness" (Indy) => 0x01 for "Full House" (Indigo2)
case 0x80/4:
@@ -355,10 +355,10 @@ WRITE32_MEMBER(ip22_state::hpc3_pbus6_w)
}
break;
case 0x40/4:
- kbdc8042_8_w(&space, 0, data);
+ kbdc8042_8_w(space, 0, data);
break;
case 0x44/4:
- kbdc8042_8_w(&space, 4, data);
+ kbdc8042_8_w(space, 4, data);
break;
case 0x80/4:
case 0x84/4:
@@ -895,14 +895,14 @@ WRITE32_MEMBER(ip22_state::rtc_w)
WRITE32_MEMBER(ip22_state::ip22_write_ram)
{
// if banks 2 or 3 are enabled, do nothing, we don't support that much memory
- if (sgi_mc_r(&space, 0xc8/4, 0xffffffff) & 0x10001000)
+ if (sgi_mc_r(space, 0xc8/4, 0xffffffff) & 0x10001000)
{
// a random perturbation so the memory test fails
data ^= 0xffffffff;
}
// if banks 0 or 1 have 2 membanks, also kill it, we only want 128 MB
- if (sgi_mc_r(&space, 0xc0/4, 0xffffffff) & 0x40004000)
+ if (sgi_mc_r(space, 0xc0/4, 0xffffffff) & 0x40004000)
{
// a random perturbation so the memory test fails
data ^= 0xffffffff;
@@ -1239,14 +1239,14 @@ void ip22_state::machine_reset()
mips3drc_set_options(machine().device("maincpu"), MIPS3DRC_COMPATIBLE_OPTIONS | MIPS3DRC_CHECK_OVERFLOWS);
}
-static void dump_chain(address_space *space, UINT32 ch_base)
+static void dump_chain(address_space &space, UINT32 ch_base)
{
- printf("node: %08x %08x %08x (len = %x)\n", space->read_dword(ch_base), space->read_dword(ch_base+4), space->read_dword(ch_base+8), space->read_dword(ch_base+4) & 0x3fff);
+ printf("node: %08x %08x %08x (len = %x)\n", space.read_dword(ch_base), space.read_dword(ch_base+4), space.read_dword(ch_base+8), space.read_dword(ch_base+4) & 0x3fff);
- if ((space->read_dword(ch_base+8) != 0) && !(space->read_dword(ch_base+4) & 0x80000000))
+ if ((space.read_dword(ch_base+8) != 0) && !(space.read_dword(ch_base+4) & 0x80000000))
{
- dump_chain(space, space->read_dword(ch_base+8));
+ dump_chain(space, space.read_dword(ch_base+8));
}
}
@@ -1260,7 +1260,7 @@ static void dump_chain(address_space *space, UINT32 ch_base)
static void scsi_irq(running_machine &machine, int state)
{
ip22_state *drvstate = machine.driver_data<ip22_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state)
{
@@ -1281,7 +1281,7 @@ static void scsi_irq(running_machine &machine, int state)
words = drvstate->m_wd33c93->get_dma_count();
words /= 4;
- wptr = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
+ wptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
drvstate->m_HPC3.nSCSI0Descriptor += words*4;
dptr = 0;
@@ -1296,7 +1296,7 @@ static void scsi_irq(running_machine &machine, int state)
while (words)
{
- tmpword = space->read_dword(wptr);
+ tmpword = space.read_dword(wptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{
@@ -1332,7 +1332,7 @@ static void scsi_irq(running_machine &machine, int state)
while (twords)
{
- tmpword = space->read_dword(wptr);
+ tmpword = space.read_dword(wptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{
@@ -1364,8 +1364,8 @@ static void scsi_irq(running_machine &machine, int state)
drvstate->m_wd33c93->clear_dma();
#if 0
UINT32 dptr, tmpword;
- UINT32 bc = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor + 4);
- UINT32 rptr = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
+ UINT32 bc = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor + 4);
+ UINT32 rptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
int length = bc & 0x3fff;
int xie = (bc & 0x20000000) ? 1 : 0;
int eox = (bc & 0x80000000) ? 1 : 0;
@@ -1380,7 +1380,7 @@ static void scsi_irq(running_machine &machine, int state)
dptr = 0;
while (length > 0)
{
- tmpword = space->read_dword(rptr);
+ tmpword = space.read_dword(rptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{
drvstate->m_dma_buffer[dptr+3] = (tmpword>>24)&0xff;
@@ -1401,7 +1401,7 @@ static void scsi_irq(running_machine &machine, int state)
length -= 4;
}
- length = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor+4) & 0x3fff;
+ length = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor+4) & 0x3fff;
drvstate->m_wd33c93->write_data(length, drvstate->m_dma_buffer);
// clear DMA on the controller too
@@ -1423,7 +1423,7 @@ static void scsi_irq(running_machine &machine, int state)
words = drvstate->m_wd33c93->get_dma_count();
words /= 4;
- wptr = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
+ wptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
sptr = 0;
// mame_printf_info("DMA from device: %d words @ %x\n", words, wptr);
@@ -1446,7 +1446,7 @@ static void scsi_irq(running_machine &machine, int state)
tmpword = drvstate->m_dma_buffer[sptr]<<24 | drvstate->m_dma_buffer[sptr+1]<<16 | drvstate->m_dma_buffer[sptr+2]<<8 | drvstate->m_dma_buffer[sptr+3];
}
- space->write_dword(wptr, tmpword);
+ space.write_dword(wptr, tmpword);
wptr += 4;
sptr += 4;
words--;
@@ -1470,7 +1470,7 @@ static void scsi_irq(running_machine &machine, int state)
{
tmpword = drvstate->m_dma_buffer[sptr]<<24 | drvstate->m_dma_buffer[sptr+1]<<16 | drvstate->m_dma_buffer[sptr+2]<<8 | drvstate->m_dma_buffer[sptr+3];
}
- space->write_dword(wptr, tmpword);
+ space.write_dword(wptr, tmpword);
wptr += 4;
sptr += 4;
diff --git a/src/mess/drivers/itt3030.c b/src/mess/drivers/itt3030.c
index 5c017fed519..eb15a7a334c 100644
--- a/src/mess/drivers/itt3030.c
+++ b/src/mess/drivers/itt3030.c
@@ -57,13 +57,13 @@ READ8_MEMBER(itt3030_state::unk2_r)
UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(int y = 0; y < 24; y++ )
{
for(int x = 0; x < 80; x++ )
{
- UINT8 code = space->read_byte(0x3000 + x + y*128);
+ UINT8 code = space.read_byte(0x3000 + x + y*128);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, x*8,y*16);
}
}
diff --git a/src/mess/drivers/lynx.c b/src/mess/drivers/lynx.c
index 7936bc4ef7c..4ab33d7fd58 100644
--- a/src/mess/drivers/lynx.c
+++ b/src/mess/drivers/lynx.c
@@ -138,7 +138,7 @@ ROM_END
static QUICKLOAD_LOAD( lynx )
{
device_t *cpu = image.device().machine().device("maincpu");
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *data = NULL;
UINT8 *rom = image.device().machine().root_device().memregion("maincpu")->base();
UINT8 header[10]; // 80 08 dw Start dw Len B S 9 3
@@ -165,14 +165,14 @@ static QUICKLOAD_LOAD( lynx )
}
for (i = 0; i < length; i++)
- space->write_byte(start + i, data[i]);
+ space.write_byte(start + i, data[i]);
free(data);
rom[0x1fc] = start & 0xff;
rom[0x1fd] = start >> 8;
- space->write_byte(0x1fc, start & 0xff);
- space->write_byte(0x1fd, start >> 8);
+ space.write_byte(0x1fc, start & 0xff);
+ space.write_byte(0x1fd, start >> 8);
cpu->state().set_pc(start);
diff --git a/src/mess/drivers/mc10.c b/src/mess/drivers/mc10.c
index 105e016b829..a4a449f8968 100644
--- a/src/mess/drivers/mc10.c
+++ b/src/mess/drivers/mc10.c
@@ -236,7 +236,7 @@ static TIMER_DEVICE_CALLBACK( alice32_scanline )
DRIVER_INIT_MEMBER(mc10_state,mc10)
{
- address_space *prg = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &prg = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* initialize keyboard strobe */
m_keyboard_strobe = 0x00;
@@ -254,7 +254,7 @@ DRIVER_INIT_MEMBER(mc10_state,mc10)
else if (m_ram_size == 24*1024)
membank("bank2")->set_base(m_ram_base + 0x2000);
else if (m_ram_size != 32*1024) //ensure that is not alice90
- prg->nop_readwrite(0x5000, 0x8fff);
+ prg.nop_readwrite(0x5000, 0x8fff);
/* register for state saving */
state_save_register_global(machine(), m_keyboard_strobe);
diff --git a/src/mess/drivers/megadriv.c b/src/mess/drivers/megadriv.c
index 132185ecf51..c07214c3643 100644
--- a/src/mess/drivers/megadriv.c
+++ b/src/mess/drivers/megadriv.c
@@ -27,14 +27,14 @@ static TIMER_CALLBACK( mess_io_timeout_timer_callback )
/* J-Cart controller port */
WRITE16_HANDLER( jcart_ctrl_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_jcart_io_data[0] = (data & 1) << 6;
state->m_jcart_io_data[1] = (data & 1) << 6;
}
READ16_HANDLER( jcart_ctrl_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
UINT16 retdata = 0;
UINT8 joy[2];
@@ -709,7 +709,7 @@ static UINT16 pico_read_penpos(running_machine &machine, int pen)
static READ16_HANDLER( pico_68k_io_read )
{
- pico_state *state = space->machine().driver_data<pico_state>();
+ pico_state *state = space.machine().driver_data<pico_state>();
UINT8 retdata = 0;
switch (offset)
@@ -733,16 +733,16 @@ static READ16_HANDLER( pico_68k_io_read )
0x2f8 - 0x3f3 (storyware)
*/
case 2:
- retdata = pico_read_penpos(space->machine(), PICO_PENX) >> 8;
+ retdata = pico_read_penpos(space.machine(), PICO_PENX) >> 8;
break;
case 3:
- retdata = pico_read_penpos(space->machine(), PICO_PENX) & 0x00ff;
+ retdata = pico_read_penpos(space.machine(), PICO_PENX) & 0x00ff;
break;
case 4:
- retdata = pico_read_penpos(space->machine(), PICO_PENY) >> 8;
+ retdata = pico_read_penpos(space.machine(), PICO_PENY) >> 8;
break;
case 5:
- retdata = pico_read_penpos(space->machine(), PICO_PENY) & 0x00ff;
+ retdata = pico_read_penpos(space.machine(), PICO_PENY) & 0x00ff;
break;
case 6:
/* Page register :
diff --git a/src/mess/drivers/mikromik.c b/src/mess/drivers/mikromik.c
index 7c5caadcbad..bd2b548530b 100644
--- a/src/mess/drivers/mikromik.c
+++ b/src/mess/drivers/mikromik.c
@@ -537,8 +537,8 @@ WRITE_LINE_MEMBER( mm1_state::dack3_w )
}
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( dmac_intf )
{
diff --git a/src/mess/drivers/mmodular.c b/src/mess/drivers/mmodular.c
index c3cbda6d5db..1875be98310 100644
--- a/src/mess/drivers/mmodular.c
+++ b/src/mess/drivers/mmodular.c
@@ -644,7 +644,7 @@ WRITE8_MEMBER(polgar_state::academy_write_board)
latch_data = data;
// logerror("acad_write_latch %02x\n",data);
- if (data != 0xff) mboard_write_board_8(&space,0, data);
+ if (data != 0xff) mboard_write_board_8(space,0, data);
}
WRITE8_MEMBER(polgar_state::milano_write_board)
@@ -754,7 +754,7 @@ READ8_MEMBER(polgar_state::read_keys_board_monteciv)
UINT8 data = 0;
if (monteciv_select[0] == 0xff && monteciv_select[1] == 0xff) {
- data = mboard_read_board_8(&space,0);
+ data = mboard_read_board_8(space,0);
} else {
if (monteciv_select[0] == 0x0) {
data = ioport("BUTTONS_MONTE2")->read();
@@ -792,14 +792,14 @@ READ8_MEMBER(polgar_state::read_keys_board_academy)
data = ioport("BUTTONS_ACAD")->read();
} else {
// if (latch_data & 0x7f) {
- data = mboard_read_board_8(&space,0);
+ data = mboard_read_board_8(space,0);
// data = milano_read_board(space,0);
// logerror("ReadingBoard %02x\n",latch_data);
// line = get_first_cleared_bit(latch_data);
// tmp = machine.root_device().ioport(board_lines[line])->read();
-// mboard_write_board_8(&space,0, latch_data);
-// data = mboard_read_board_8(&space,0);
+// mboard_write_board_8(space,0, latch_data);
+// data = mboard_read_board_8(space,0);
// logerror("BoardRead Port Offset = %d data %02x Latch %02x\n", offset,data,latch_data);
// printf ("BoardRead Port Offset = %d data %02x Latch %02x\n", offset,data,latch_data);
// } else {
@@ -885,10 +885,10 @@ WRITE16_MEMBER(polgar_state::write_LCD_data)
}
-static void write_IOenable(unsigned char data,address_space *space) {
+static void write_IOenable(unsigned char data,address_space &space) {
- hd44780_device * hd44780 = space->machine().device<hd44780_device>("hd44780");
- device_t *speaker = space->machine().device("beep");
+ hd44780_device * hd44780 = space.machine().device<hd44780_device>("hd44780");
+ device_t *speaker = space.machine().device("beep");
if (BIT(data,5) && BIT(data,4)) {
if (BIT(data,1)) {
@@ -899,15 +899,15 @@ static void write_IOenable(unsigned char data,address_space *space) {
// MAME core does not appear to have this opcode timed right.
// This also allows 'fake' clocks to test ELO at impossibly high speeds on real hardware
// The original programmer says RAM is 2x as fast as the ROM on the 030 machines, maybe waitstates can be put in MAME core someday
-// cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(50));
+// cpu_spinuntil_time(space.cpu, ATTOTIME_IN_USEC(50));
if (BIT(data,0)) {
logerror("Write LCD_DATA [%02x] [%c]\n",lcd32_char,lcd32_char);
// printf("Write LCD_DATA [%02x] [%c]\n",lcd32_char,lcd32_char);
- hd44780->data_write(*space, 128, lcd32_char);
+ hd44780->data_write(space, 128, lcd32_char);
} else {
logerror("Write LCD_CTRL [%02x] [%c]\n",lcd32_char,lcd32_char);
// printf("Write LCD_CTRL [%02x] [%c]\n",lcd32_char,lcd32_char);
- hd44780->control_write(*space, 128, lcd32_char);
+ hd44780->control_write(space, 128, lcd32_char);
}
}
@@ -920,12 +920,12 @@ static void write_IOenable(unsigned char data,address_space *space) {
WRITE32_MEMBER(polgar_state::write_IOenables_32){
- write_IOenable(data>>24,&space);
+ write_IOenable(data>>24,space);
}
WRITE16_MEMBER(polgar_state::write_IOenables)
{
- write_IOenable(data>>8,&space);
+ write_IOenable(data>>8,space);
}
/* Unknown read/write */
diff --git a/src/mess/drivers/nanos.c b/src/mess/drivers/nanos.c
index e48e525e578..74c7c831ca4 100644
--- a/src/mess/drivers/nanos.c
+++ b/src/mess/drivers/nanos.c
@@ -439,17 +439,17 @@ void nanos_state::machine_start()
void nanos_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_bank(0x0000, 0x0fff, "bank3");
- space->install_write_bank(0x1000, 0xffff, "bank2");
+ space.install_write_bank(0x0000, 0x0fff, "bank3");
+ space.install_write_bank(0x1000, 0xffff, "bank2");
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x1000);
membank("bank3")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
- floppy_mon_w(floppy_get_device(space->machine(), 0), CLEAR_LINE);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1,1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), CLEAR_LINE);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1,1);
}
static Z80PIO_INTERFACE( nanos_z80pio_intf )
diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c
index 12774c3d066..b0a870e3e7b 100644
--- a/src/mess/drivers/nc.c
+++ b/src/mess/drivers/nc.c
@@ -321,7 +321,7 @@ static const char *const nc_bankhandler_w[]={
static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
{
nc_state *state = machine.driver_data<nc_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int mem_type;
int mem_bank;
char bank1[10];
@@ -332,7 +332,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
mem_type = (state->m_memory_config[bank]>>6) & 0x03;
mem_bank = state->m_memory_config[bank] & 0x03f;
- space->install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_r[bank]);
+ space.install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_r[bank]);
switch (mem_type)
{
@@ -348,7 +348,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
state->membank(bank1)->set_base(addr);
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
LOG(("BANK %d: ROM %d\n",bank,mem_bank));
}
break;
@@ -365,7 +365,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
state->membank(bank1)->set_base(addr);
state->membank(bank5)->set_base(addr);
- space->install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
+ space.install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
LOG(("BANK %d: RAM\n",bank));
}
break;
@@ -389,12 +389,12 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
/* yes */
state->membank(bank5)->set_base(addr);
- space->install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
+ space.install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
}
else
{
/* no */
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
}
LOG(("BANK %d: CARD-RAM\n",bank));
@@ -402,7 +402,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
else
{
/* if no card connected, then writes fail */
- space->nop_readwrite((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.nop_readwrite((bank * 0x4000), (bank * 0x4000) + 0x3fff);
}
}
break;
diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c
index 634e42f15fb..92cdd77d19c 100644
--- a/src/mess/drivers/nes.c
+++ b/src/mess/drivers/nes.c
@@ -38,7 +38,7 @@ static WRITE8_DEVICE_HANDLER( psg_4017_w )
WRITE8_MEMBER(nes_state::nes_vh_sprite_dma_w)
{
- m_ppu->spriteram_dma(&space, data);
+ m_ppu->spriteram_dma(space, data);
}
static ADDRESS_MAP_START( nes_map, AS_PROGRAM, 8, nes_state )
diff --git a/src/mess/drivers/next.c b/src/mess/drivers/next.c
index bab9ff5c841..540b4fec45e 100644
--- a/src/mess/drivers/next.c
+++ b/src/mess/drivers/next.c
@@ -304,7 +304,7 @@ void next_state::dma_drq_w(int slot, bool state)
dma_slot &ds = dma_slots[slot];
ds.drq = state;
if(state && (ds.state & DMA_ENABLE)) {
- address_space *space = maincpu->space(AS_PROGRAM);
+ address_space &space = *maincpu->space(AS_PROGRAM);
if(ds.state & DMA_READ) {
while(ds.drq) {
dma_check_update(slot);
@@ -317,7 +317,7 @@ void next_state::dma_drq_w(int slot, bool state)
logerror("DMA: bus error on read slot %d\n", slot);
return;
}
- space->write_byte(ds.current++, val);
+ space.write_byte(ds.current++, val);
dma_check_end(slot, eof);
if(!(ds.state & DMA_ENABLE))
return;
@@ -325,7 +325,7 @@ void next_state::dma_drq_w(int slot, bool state)
} else {
while(ds.drq) {
dma_check_update(slot);
- UINT8 val = space->read_byte(ds.current++);
+ UINT8 val = space.read_byte(ds.current++);
bool eof = ds.current == (ds.limit & 0x7fffffff) && (ds.limit & 0x80000000);
bool err;
dma_write(slot, val, eof, err);
diff --git a/src/mess/drivers/ng_aes.c b/src/mess/drivers/ng_aes.c
index 0a845af96bc..ee73bd7dc61 100644
--- a/src/mess/drivers/ng_aes.c
+++ b/src/mess/drivers/ng_aes.c
@@ -603,7 +603,7 @@ WRITE16_MEMBER(ng_aes_state::main_cpu_bank_select_w)
bank_address = 0x100000;
}
- neogeo_set_main_cpu_bank_address(&space, bank_address);
+ neogeo_set_main_cpu_bank_address(space, bank_address);
}
}
@@ -611,7 +611,7 @@ WRITE16_MEMBER(ng_aes_state::main_cpu_bank_select_w)
static void main_cpu_banking_init( running_machine &machine )
{
ng_aes_state *state = machine.driver_data<ng_aes_state>();
- address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &mainspace = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* create vector banks */
state->membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base());
@@ -642,21 +642,21 @@ static void set_audio_cpu_banking( running_machine &machine )
}
-static void audio_cpu_bank_select( address_space *space, int region, UINT8 bank )
+static void audio_cpu_bank_select( address_space &space, int region, UINT8 bank )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", space->device().safe_pc(), region, bank);
+ if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", space.device().safe_pc(), region, bank);
state->m_audio_cpu_banks[region] = bank;
- set_audio_cpu_banking(space->machine());
+ set_audio_cpu_banking(space.machine());
}
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_f000_f7ff_r)
{
- audio_cpu_bank_select(&space, 0, offset >> 8);
+ audio_cpu_bank_select(space, 0, offset >> 8);
return 0;
}
@@ -664,7 +664,7 @@ READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_f000_f7ff_r)
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_e000_efff_r)
{
- audio_cpu_bank_select(&space, 1, offset >> 8);
+ audio_cpu_bank_select(space, 1, offset >> 8);
return 0;
}
@@ -672,7 +672,7 @@ READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_e000_efff_r)
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_c000_dfff_r)
{
- audio_cpu_bank_select(&space, 2, offset >> 8);
+ audio_cpu_bank_select(space, 2, offset >> 8);
return 0;
}
@@ -680,15 +680,15 @@ READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_c000_dfff_r)
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_8000_bfff_r)
{
- audio_cpu_bank_select(&space, 3, offset >> 8);
+ audio_cpu_bank_select(space, 3, offset >> 8);
return 0;
}
-static void _set_audio_cpu_rom_source( address_space *space )
+static void _set_audio_cpu_rom_source( address_space &space )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
/* if (!state->memregion("audiobios")->base()) */
state->m_audio_cpu_rom_source = 1;
@@ -700,16 +700,16 @@ static void _set_audio_cpu_rom_source( address_space *space )
{
state->m_audio_cpu_rom_source_last = state->m_audio_cpu_rom_source;
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space->device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
+ if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space.device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
}
}
-static void set_audio_cpu_rom_source( address_space *space, UINT8 data )
+static void set_audio_cpu_rom_source( address_space &space, UINT8 data )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
state->m_audio_cpu_rom_source = data;
_set_audio_cpu_rom_source(space);
@@ -752,7 +752,7 @@ static void audio_cpu_banking_init( running_machine &machine )
set_audio_cpu_banking(machine);
state->m_audio_cpu_rom_source_last = 0;
- set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
+ set_audio_cpu_rom_source(*machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
}
@@ -774,7 +774,7 @@ WRITE16_MEMBER(ng_aes_state::system_control_w)
default:
case 0x00: neogeo_set_screen_dark(machine(), bit); break;
case 0x01: set_main_cpu_vector_table_source(machine(), bit);
- set_audio_cpu_rom_source(&space, bit); /* this is a guess */
+ set_audio_cpu_rom_source(space, bit); /* this is a guess */
break;
case 0x05: neogeo_set_fixed_layer_source(machine(), bit); break;
// case 0x06: set_save_ram_unlock(machine(), bit); break;
@@ -836,9 +836,9 @@ WRITE16_MEMBER(ng_aes_state::system_control_w)
*
*/
-static void neocd_do_dma(address_space* space)
+static void neocd_do_dma(address_space& space)
{
- ng_aes_state *state = space->machine().driver_data<ng_aes_state>();
+ ng_aes_state *state = space.machine().driver_data<ng_aes_state>();
// TODO: Proper DMA timing and control
int count;
// UINT16 word;
@@ -848,28 +848,28 @@ static void neocd_do_dma(address_space* space)
case 0xffdd:
for(count=0;count<state->m_neocd_ctrl.word_count;count++)
{
- //word = space->read_word(state->m_neocd_ctrl.addr_source);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*2),state->m_neocd_ctrl.fill_word);
+ //word = space.read_word(state->m_neocd_ctrl.addr_source);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*2),state->m_neocd_ctrl.fill_word);
}
logerror("CTRL: DMA word-fill transfer of %i bytes\n",count*2);
break;
case 0xfef5:
for(count=0;count<state->m_neocd_ctrl.word_count;count++)
{
- //word = space->read_word(state->m_neocd_ctrl.addr_source);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*4),(state->m_neocd_ctrl.addr_source+(count*4)) >> 16);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*4)+2,(state->m_neocd_ctrl.addr_source+(count*4)) & 0xffff);
+ //word = space.read_word(state->m_neocd_ctrl.addr_source);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*4),(state->m_neocd_ctrl.addr_source+(count*4)) >> 16);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*4)+2,(state->m_neocd_ctrl.addr_source+(count*4)) & 0xffff);
}
logerror("CTRL: DMA mode 2 transfer of %i bytes\n",count*4);
break;
case 0xcffd:
for(count=0;count<state->m_neocd_ctrl.word_count;count++)
{
- //word = space->read_word(state->m_neocd_ctrl.addr_source);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8),((state->m_neocd_ctrl.addr_source+(count*8)) >> 24) | 0xff00);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8)+2,((state->m_neocd_ctrl.addr_source+(count*8)) >> 16) | 0xff00);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8)+4,((state->m_neocd_ctrl.addr_source+(count*8)) >> 8) | 0xff00);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8)+6,(state->m_neocd_ctrl.addr_source+(count*8)) | 0xff00);
+ //word = space.read_word(state->m_neocd_ctrl.addr_source);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8),((state->m_neocd_ctrl.addr_source+(count*8)) >> 24) | 0xff00);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8)+2,((state->m_neocd_ctrl.addr_source+(count*8)) >> 16) | 0xff00);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8)+4,((state->m_neocd_ctrl.addr_source+(count*8)) >> 8) | 0xff00);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8)+6,(state->m_neocd_ctrl.addr_source+(count*8)) | 0xff00);
}
logerror("CTRL: DMA mode 3 transfer of %i bytes\n",count*8);
break;
@@ -929,7 +929,7 @@ WRITE16_MEMBER(ng_aes_state::neocd_control_w)
{
case 0x60/2: // Start DMA transfer
if((data & 0xff) == 0x40)
- neocd_do_dma(&space);
+ neocd_do_dma(space);
break;
case 0x64/2: // source address, high word
m_neocd_ctrl.addr_source = (m_neocd_ctrl.addr_source & 0x0000ffff) | (data << 16);
@@ -1148,7 +1148,7 @@ static void aes_postload(neogeo_state *state)
_set_main_cpu_bank_address(state->machine());
_set_main_cpu_vector_table_source(state->machine());
set_audio_cpu_banking(state->machine());
- _set_audio_cpu_rom_source(state->machine().device("maincpu")->memory().space(AS_PROGRAM));
+ _set_audio_cpu_rom_source(*state->machine().device("maincpu")->memory().space(AS_PROGRAM));
}
static void common_machine_start(running_machine &machine)
@@ -1253,11 +1253,11 @@ MACHINE_START_MEMBER(ng_aes_state,neocd)
MACHINE_RESET_MEMBER(ng_aes_state,neogeo)
{
offs_t offs;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset system control registers */
for (offs = 0; offs < 8; offs++)
- system_control_w(*space, offs, 0, 0x00ff);
+ system_control_w(space, offs, 0, 0x00ff);
machine().device("maincpu")->reset();
diff --git a/src/mess/drivers/p8k.c b/src/mess/drivers/p8k.c
index 0d86b5da22e..334979209d5 100644
--- a/src/mess/drivers/p8k.c
+++ b/src/mess/drivers/p8k.c
@@ -219,8 +219,8 @@ static WRITE_LINE_DEVICE_HANDLER( p8k_dma_irq_w )
p8k_daisy_interrupt(device, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( p8k_dma_intf )
{
diff --git a/src/mess/drivers/palm.c b/src/mess/drivers/palm.c
index 3dbba60a9e2..5277161c09b 100644
--- a/src/mess/drivers/palm.c
+++ b/src/mess/drivers/palm.c
@@ -120,9 +120,9 @@ static void palm_spim_exchange( device_t *device )
void palm_state::machine_start()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_bank (0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
- space->install_write_bank(0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_read_bank (0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
+ space.install_write_bank(0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
save_item(NAME(m_port_f_latch));
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index aaf3baca474..f9a5aff1e94 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -2068,7 +2068,7 @@ static TIMER_DEVICE_CALLBACK(cassette_callback)
static TIMER_DEVICE_CALLBACK(keyboard_callback)
{
pc6001_state *state = timer.machine().driver_data<pc6001_state>();
- address_space *space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
@@ -2078,7 +2078,7 @@ static TIMER_DEVICE_CALLBACK(keyboard_callback)
{
if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3))
{
- state->m_cur_keycode = check_keyboard_press(space->machine());
+ state->m_cur_keycode = check_keyboard_press(space.machine());
if(IRQ_LOG) printf("KEY IRQ 0x02\n");
state->m_irq_vector = 0x02;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
@@ -2089,7 +2089,7 @@ static TIMER_DEVICE_CALLBACK(keyboard_callback)
#if 0
else /* joypad polling */
{
- state->m_cur_keycode = check_joy_press(space->machine());
+ state->m_cur_keycode = check_joy_press(space.machine());
if(state->m_cur_keycode)
{
state->m_irq_vector = 0x16;
diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c
index a5cedb3e992..81fda63c94c 100644
--- a/src/mess/drivers/pc88va.c
+++ b/src/mess/drivers/pc88va.c
@@ -650,10 +650,10 @@ WRITE8_MEMBER(pc88va_state::idp_command_w)
static void tsp_sprite_enable(running_machine &machine, UINT32 spr_offset, UINT8 sw_bit)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->write_word(spr_offset, space->read_word(spr_offset) & ~0x200);
- space->write_word(spr_offset, space->read_word(spr_offset) | (sw_bit & 0x200));
+ space.write_word(spr_offset, space.read_word(spr_offset) & ~0x200);
+ space.write_word(spr_offset, space.read_word(spr_offset) | (sw_bit & 0x200));
}
/* TODO: very preliminary, needs something showable first */
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index b980971437e..3e0981299f7 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -2611,7 +2611,7 @@ static INTERRUPT_GEN(pc9801_vrtc_irq)
{
pc9801_state *state = device->machine().driver_data<pc9801_state>();
#if 0
- address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
static UINT8 test;
if(device->machine().input().code_pressed_once(JOYCODE_BUTTON1))
@@ -2620,7 +2620,7 @@ static INTERRUPT_GEN(pc9801_vrtc_irq)
if(test)
{
popmessage("Go hack go");
- space->write_word(0x55e,space->machine().rand());
+ space.write_word(0x55e,space.machine().rand());
}
#endif
diff --git a/src/mess/drivers/pce220.c b/src/mess/drivers/pce220.c
index 5b44ea70474..06066980191 100644
--- a/src/mess/drivers/pce220.c
+++ b/src/mess/drivers/pce220.c
@@ -873,8 +873,8 @@ void pcg850v_state::machine_start()
void pce220_state::machine_reset()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.unmap_write(0x0000, 0x3fff);
// install the boot code into the first bank
membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + 0x0000);
diff --git a/src/mess/drivers/pcw.c b/src/mess/drivers/pcw.c
index 8fb83df40f4..d1f91ccf999 100644
--- a/src/mess/drivers/pcw.c
+++ b/src/mess/drivers/pcw.c
@@ -234,7 +234,7 @@ READ8_MEMBER(pcw_state::pcw_keyboard_data_r)
static void pcw_update_read_memory_block(running_machine &machine, int block, int bank)
{
pcw_state *state = machine.driver_data<pcw_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
char block_name[10];
sprintf(block_name,"bank%d",block+1);
@@ -243,14 +243,14 @@ static void pcw_update_read_memory_block(running_machine &machine, int block, in
{
/* when upper 16 bytes are accessed use keyboard read
handler */
- space->install_read_handler(
+ space.install_read_handler(
block * 0x04000 + 0x3ff0, block * 0x04000 + 0x3fff, read8_delegate(FUNC(pcw_state::pcw_keyboard_data_r),state));
// LOG(("MEM: read block %i -> bank %i\n",block,bank));
}
else
{
/* restore bank handler across entire block */
- space->install_read_bank(block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff,block_name);
+ space.install_read_bank(block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff,block_name);
// LOG(("MEM: read block %i -> bank %i\n",block,bank));
}
state->membank(block_name)->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + ((bank * 0x4000) % machine.device<ram_device>(RAM_TAG)->size()));
diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c
index 2e386866607..93e024c5965 100644
--- a/src/mess/drivers/pcw16.c
+++ b/src/mess/drivers/pcw16.c
@@ -209,43 +209,43 @@ static int pcw16_flash1_bank_handler_r(running_machine &machine, int bank, int o
/* flash 0 */
static READ8_HANDLER(pcw16_flash0_bank_handler0_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),0, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),0, offset);
}
static READ8_HANDLER(pcw16_flash0_bank_handler1_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),1, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),1, offset);
}
static READ8_HANDLER(pcw16_flash0_bank_handler2_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),2, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),2, offset);
}
static READ8_HANDLER(pcw16_flash0_bank_handler3_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),3, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),3, offset);
}
/* flash 1 */
static READ8_HANDLER(pcw16_flash1_bank_handler0_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),0, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),0, offset);
}
static READ8_HANDLER(pcw16_flash1_bank_handler1_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),1, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),1, offset);
}
static READ8_HANDLER(pcw16_flash1_bank_handler2_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),2, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),2, offset);
}
static READ8_HANDLER(pcw16_flash1_bank_handler3_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),3, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),3, offset);
}
static const struct { read8_space_func func; const char *name; } pcw16_flash0_bank_handlers_r[4] =
@@ -289,46 +289,46 @@ static void pcw16_flash1_bank_handler_w(running_machine &machine, int bank, int
/* flash 0 */
static WRITE8_HANDLER(pcw16_flash0_bank_handler0_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),0, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),0, offset, data);
}
static WRITE8_HANDLER(pcw16_flash0_bank_handler1_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),1, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),1, offset, data);
}
static WRITE8_HANDLER(pcw16_flash0_bank_handler2_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),2, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),2, offset, data);
}
static WRITE8_HANDLER(pcw16_flash0_bank_handler3_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),3, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),3, offset, data);
}
/* flash 1 */
static WRITE8_HANDLER(pcw16_flash1_bank_handler0_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),0, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),0, offset, data);
}
static WRITE8_HANDLER(pcw16_flash1_bank_handler1_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),1, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),1, offset, data);
}
static WRITE8_HANDLER(pcw16_flash1_bank_handler2_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),2, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),2, offset, data);
}
static WRITE8_HANDLER(pcw16_flash1_bank_handler3_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),3, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),3, offset, data);
}
static const struct { write8_space_func func; const char *name; } pcw16_flash0_bank_handlers_w[4] =
@@ -369,36 +369,36 @@ READ8_MEMBER(pcw16_state::pcw16_no_mem_r)
/*
static void pcw16_set_bank_handlers(running_machine &machine, int bank, PCW16_RAM_TYPE type)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
pcw16_state *state = machine.driver_data<pcw16_state>();
switch (type) {
case PCW16_MEM_ROM:
// rom
- space->install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
break;
case PCW16_MEM_FLASH_1:
// sram
- space->install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_r[bank].func, pcw16_flash0_bank_handlers_r[bank].name);
- space->install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_w[bank].func, pcw16_flash0_bank_handlers_w[bank].name);
+ space.install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_r[bank].func, pcw16_flash0_bank_handlers_r[bank].name);
+ space.install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_w[bank].func, pcw16_flash0_bank_handlers_w[bank].name);
break;
case PCW16_MEM_FLASH_2:
- space->install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_r[bank].func, pcw16_flash1_bank_handlers_r[bank].name);
- space->install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_w[bank].func, pcw16_flash1_bank_handlers_w[bank].name);
+ space.install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_r[bank].func, pcw16_flash1_bank_handlers_r[bank].name);
+ space.install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_w[bank].func, pcw16_flash1_bank_handlers_w[bank].name);
break;
case PCW16_MEM_NONE:
- space->install_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, read8_delegate(FUNC(pcw16_state::pcw16_no_mem_r),state));
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.install_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, read8_delegate(FUNC(pcw16_state::pcw16_no_mem_r),state));
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
break;
default:
case PCW16_MEM_DRAM:
// dram
- space->install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
- space->install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_write_handler_dram[bank]);
+ space.install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
+ space.install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_write_handler_dram[bank]);
break;
}
@@ -1254,36 +1254,36 @@ WRITE8_MEMBER(pcw16_state::pcw16_system_control_w)
/* write to Super I/O chip. FDC Data Rate. */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_datarate_w)
{
- pc_fdc_w(&space, PC_FDC_DATA_RATE_REGISTER,data);
+ pc_fdc_w(space, PC_FDC_DATA_RATE_REGISTER,data);
}
/* write to Super I/O chip. FDC Digital output register */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_digital_output_register_w)
{
- pc_fdc_w(&space, PC_FDC_DIGITAL_OUTPUT_REGISTER, data);
+ pc_fdc_w(space, PC_FDC_DIGITAL_OUTPUT_REGISTER, data);
}
/* write to Super I/O chip. FDC Data Register */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_data_w)
{
- pc_fdc_w(&space, PC_FDC_DATA_REGISTER, data);
+ pc_fdc_w(space, PC_FDC_DATA_REGISTER, data);
}
/* write to Super I/O chip. FDC Data Register */
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_data_r)
{
- return pc_fdc_r(&space, PC_FDC_DATA_REGISTER);
+ return pc_fdc_r(space, PC_FDC_DATA_REGISTER);
}
/* write to Super I/O chip. FDC Main Status Register */
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_main_status_register_r)
{
- return pc_fdc_r(&space, PC_FDC_MAIN_STATUS_REGISTER);
+ return pc_fdc_r(space, PC_FDC_MAIN_STATUS_REGISTER);
}
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_digital_input_register_r)
{
- return pc_fdc_r(&space, PC_FDC_DIGITIAL_INPUT_REGISTER);
+ return pc_fdc_r(space, PC_FDC_DIGITIAL_INPUT_REGISTER);
}
static void pcw16_fdc_interrupt(running_machine &machine, int state)
diff --git a/src/mess/drivers/pentagon.c b/src/mess/drivers/pentagon.c
index a447a6a5ba8..735a25ce818 100644
--- a/src/mess/drivers/pentagon.c
+++ b/src/mess/drivers/pentagon.c
@@ -112,16 +112,16 @@ MACHINE_RESET_MEMBER(pentagon_state,pentagon)
{
UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer();
device_t *beta = machine().device(BETA_DISK_TAG);
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_bank(0x0000, 0x3fff, "bank1");
- space->unmap_write(0x0000, 0x3fff);
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
+ space.unmap_write(0x0000, 0x3fff);
if (beta->started()) {
betadisk_enable(beta);
betadisk_clear_status(beta);
}
- space->set_direct_update_handler(direct_update_delegate(FUNC(pentagon_state::pentagon_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(pentagon_state::pentagon_direct), this));
memset(messram,0,128*1024);
diff --git a/src/mess/drivers/pipbug.c b/src/mess/drivers/pipbug.c
index 0e1d2d812df..b95737a8e1d 100644
--- a/src/mess/drivers/pipbug.c
+++ b/src/mess/drivers/pipbug.c
@@ -92,7 +92,7 @@ static const serial_terminal_interface terminal_intf =
QUICKLOAD_LOAD( pipbug )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x0440;
int exec_addr;
@@ -149,7 +149,7 @@ QUICKLOAD_LOAD( pipbug )
for (i = quick_addr; i < quick_length; i++)
{
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
}
/* display a message about the loaded quickload */
diff --git a/src/mess/drivers/psion.c b/src/mess/drivers/psion.c
index 625fe511852..693a8aee108 100644
--- a/src/mess/drivers/psion.c
+++ b/src/mess/drivers/psion.c
@@ -101,7 +101,7 @@ WRITE8_MEMBER( psion_state::hd63701_int_reg_w )
break;
}
- m6801_io_w(&space, offset, data);
+ m6801_io_w(space, offset, data);
}
READ8_MEMBER( psion_state::hd63701_int_reg_r )
@@ -112,7 +112,7 @@ READ8_MEMBER( psion_state::hd63701_int_reg_r )
/* datapack i/o data bus */
return (m_pack1->data_r() | m_pack2->data_r()) & (~m_port2_ddr);
case 0x14:
- return (m6801_io_r(&space, offset)&0x7f) | (m_stby_pwr<<7);
+ return (m6801_io_r(space, offset)&0x7f) | (m_stby_pwr<<7);
case 0x15:
/*
x--- ---- ON key active high
@@ -125,9 +125,9 @@ READ8_MEMBER( psion_state::hd63701_int_reg_r )
/* datapack control lines */
return (m_pack1->control_r() | (m_pack2->control_r() & 0x8f)) | ((m_pack2->control_r() & 0x10)<<1);
case 0x08:
- m6801_io_w(&space, offset, m_tcsr_value);
+ m6801_io_w(space, offset, m_tcsr_value);
default:
- return m6801_io_r(&space, offset);
+ return m6801_io_r(space, offset);
}
}
diff --git a/src/mess/drivers/psx.c b/src/mess/drivers/psx.c
index 3c642b1dd44..b01134e0c83 100644
--- a/src/mess/drivers/psx.c
+++ b/src/mess/drivers/psx.c
@@ -455,7 +455,7 @@ DIRECT_UPDATE_MEMBER(psx1_state::psx_setopbase)
static QUICKLOAD_LOAD( psx_exe_load )
{
psx1_state *state = image.device().machine().driver_data<psx1_state>();
- address_space *space = image.device().machine().device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *image.device().machine().device( "maincpu")->memory().space( AS_PROGRAM );
state->m_exe_size = 0;
state->m_exe_buffer = (UINT8*)malloc( quickload_size );
@@ -470,7 +470,7 @@ static QUICKLOAD_LOAD( psx_exe_load )
return IMAGE_INIT_FAIL;
}
state->m_exe_size = quickload_size;
- space->set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_setopbase), state));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_setopbase), state));
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c
index a13afeec735..da8e4f36183 100644
--- a/src/mess/drivers/px4.c
+++ b/src/mess/drivers/px4.c
@@ -497,36 +497,36 @@ READ8_MEMBER(px4_state::px4_str_r)
}
/* helper function to map rom capsules */
-static void install_rom_capsule(address_space *space, int size, const char *region)
+static void install_rom_capsule(address_space &space, int size, const char *region)
{
- px4_state *state = space->machine().driver_data<px4_state>();
+ px4_state *state = space.machine().driver_data<px4_state>();
/* ram, part 1 */
- space->install_readwrite_bank(0x0000, 0xdfff - size, "bank1");
+ space.install_readwrite_bank(0x0000, 0xdfff - size, "bank1");
state->membank("bank1")->set_base(state->m_ram->pointer());
/* actual rom data, part 1 */
- space->install_read_bank(0xe000 - size, 0xffff - size, "bank2");
- space->nop_write(0xe000 - size, 0xffff - size);
- state->membank("bank2")->set_base(space->machine().root_device().memregion(region)->base() + (size - 0x2000));
+ space.install_read_bank(0xe000 - size, 0xffff - size, "bank2");
+ space.nop_write(0xe000 - size, 0xffff - size);
+ state->membank("bank2")->set_base(space.machine().root_device().memregion(region)->base() + (size - 0x2000));
/* rom data, part 2 */
if (size != 0x2000)
{
- space->install_read_bank(0x10000 - size, 0xdfff, "bank3");
- space->nop_write(0x10000 - size, 0xdfff);
+ space.install_read_bank(0x10000 - size, 0xdfff, "bank3");
+ space.nop_write(0x10000 - size, 0xdfff);
state->membank("bank3")->set_base(state->memregion(region)->base());
}
/* ram, continued */
- space->install_readwrite_bank(0xe000, 0xffff, "bank4");
+ space.install_readwrite_bank(0xe000, 0xffff, "bank4");
state->membank("bank4")->set_base(state->m_ram->pointer() + 0xe000);
}
/* bank register */
WRITE8_MEMBER(px4_state::px4_bankr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
if (VERBOSE)
logerror("%s: px4_bankr_w (0x%02x)\n", machine().describe_context(), data);
@@ -538,16 +538,16 @@ WRITE8_MEMBER(px4_state::px4_bankr_w)
{
case 0x00:
/* system bank */
- space_program->install_read_bank(0x0000, 0x7fff, "bank1");
- space_program->nop_write(0x0000, 0x7fff);
+ space_program.install_read_bank(0x0000, 0x7fff, "bank1");
+ space_program.nop_write(0x0000, 0x7fff);
membank("bank1")->set_base(machine().root_device().memregion("os")->base());
- space_program->install_readwrite_bank(0x8000, 0xffff, "bank2");
+ space_program.install_readwrite_bank(0x8000, 0xffff, "bank2");
membank("bank2")->set_base(m_ram->pointer() + 0x8000);
break;
case 0x04:
/* memory */
- space_program->install_readwrite_bank(0x0000, 0xffff, "bank1");
+ space_program.install_readwrite_bank(0x0000, 0xffff, "bank1");
membank("bank1")->set_base(m_ram->pointer());
break;
diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c
index bc5a70683b8..388cd8e819a 100644
--- a/src/mess/drivers/qx10.c
+++ b/src/mess/drivers/qx10.c
@@ -377,8 +377,8 @@ WRITE_LINE_MEMBER( qx10_state::tc_w )
Channel 2: GDC
Channel 3: Option slots
*/
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( qx10_dma8237_1_interface )
{
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index d6972c1250a..8b9a0ea596c 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -167,7 +167,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_lmpr_r)
WRITE8_MEMBER(samcoupe_state::samcoupe_lmpr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_lmpr = data;
samcoupe_update_memory(space_program);
@@ -180,7 +180,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_hmpr_r)
WRITE8_MEMBER(samcoupe_state::samcoupe_hmpr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_hmpr = data;
samcoupe_update_memory(space_program);
@@ -193,7 +193,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_vmpr_r)
WRITE8_MEMBER(samcoupe_state::samcoupe_vmpr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_vmpr = data;
samcoupe_update_memory(space_program);
diff --git a/src/mess/drivers/sc2.c b/src/mess/drivers/sc2.c
index 81256de167e..8af42a73ed1 100644
--- a/src/mess/drivers/sc2.c
+++ b/src/mess/drivers/sc2.c
@@ -41,7 +41,7 @@ public:
READ8_MEMBER( sc2_state::sc2_beep )
{
- //if (!space->debugger_access())
+ //if (!space.debugger_access())
{
m_beep_state = ~m_beep_state;
diff --git a/src/mess/drivers/scorpion.c b/src/mess/drivers/scorpion.c
index 185f76edafa..050a207dc6e 100644
--- a/src/mess/drivers/scorpion.c
+++ b/src/mess/drivers/scorpion.c
@@ -326,15 +326,15 @@ MACHINE_RESET_MEMBER(scorpion_state,scorpion)
{
UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer();
device_t *beta = machine().device(BETA_DISK_TAG);
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_ram_0000 = NULL;
- space->install_read_bank(0x0000, 0x3fff, "bank1");
- space->install_write_handler(0x0000, 0x3fff, write8_delegate(FUNC(scorpion_state::scorpion_0000_w),this));
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_handler(0x0000, 0x3fff, write8_delegate(FUNC(scorpion_state::scorpion_0000_w),this));
betadisk_disable(beta);
betadisk_clear_status(beta);
- space->set_direct_update_handler(direct_update_delegate(FUNC(scorpion_state::scorpion_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(scorpion_state::scorpion_direct), this));
memset(messram,0,256*1024);
diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c
index d6a4d0c6362..31b50d730dd 100644
--- a/src/mess/drivers/spc1000.c
+++ b/src/mess/drivers/spc1000.c
@@ -224,15 +224,15 @@ INPUT_PORTS_END
void spc1000_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem = memregion("maincpu")->base();
UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
- space->install_read_bank(0x0000, 0x7fff, "bank1");
- space->install_read_bank(0x8000, 0xffff, "bank3");
+ space.install_read_bank(0x0000, 0x7fff, "bank1");
+ space.install_read_bank(0x8000, 0xffff, "bank3");
- space->install_write_bank(0x0000, 0x7fff, "bank2");
- space->install_write_bank(0x8000, 0xffff, "bank4");
+ space.install_write_bank(0x0000, 0x7fff, "bank2");
+ space.install_write_bank(0x8000, 0xffff, "bank4");
membank("bank1")->set_base(mem);
membank("bank2")->set_base(ram);
diff --git a/src/mess/drivers/spec128.c b/src/mess/drivers/spec128.c
index 32c9f54e1a5..1286a22a2d1 100644
--- a/src/mess/drivers/spec128.c
+++ b/src/mess/drivers/spec128.c
@@ -171,7 +171,7 @@ static const ay8910_interface spectrum_ay_interface =
static WRITE8_HANDLER(spectrum_128_port_7ffd_w)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
/* D0-D2: RAM page located at 0x0c000-0x0ffff */
/* D3 - Screen select (screen 0 in ram page 5, screen 1 in ram page 7 */
@@ -186,7 +186,7 @@ static WRITE8_HANDLER(spectrum_128_port_7ffd_w)
state->m_port_7ffd_data = data;
/* update memory */
- spectrum_128_update_memory(space->machine());
+ spectrum_128_update_memory(space.machine());
}
void spectrum_128_update_memory(running_machine &machine)
@@ -228,8 +228,8 @@ void spectrum_128_update_memory(running_machine &machine)
static READ8_HANDLER ( spectrum_128_ula_r )
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
- int vpos = space->machine().primary_screen->vpos();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
+ int vpos = space.machine().primary_screen->vpos();
return vpos<193 ? state->m_screen_location[0x1800|(vpos&0xf8)<<2]:0xff;
}
diff --git a/src/mess/drivers/specpls3.c b/src/mess/drivers/specpls3.c
index 4c49bfce559..b89a5408b13 100644
--- a/src/mess/drivers/specpls3.c
+++ b/src/mess/drivers/specpls3.c
@@ -183,35 +183,35 @@ static const int spectrum_plus3_memory_selections[]=
static WRITE8_HANDLER(spectrum_plus3_port_3ffd_w)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==1)
- upd765_data_w(space->machine().device("upd765"), *space, 0,data);
+ upd765_data_w(space.machine().device("upd765"), space, 0,data);
}
static READ8_HANDLER(spectrum_plus3_port_3ffd_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==0)
return 0xff;
else
- return upd765_data_r(space->machine().device("upd765"), *space, 0);
+ return upd765_data_r(space.machine().device("upd765"), space, 0);
}
static READ8_HANDLER(spectrum_plus3_port_2ffd_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==0)
return 0xff;
else
- return upd765_status_r(space->machine().device("upd765"), *space, 0);
+ return upd765_status_r(space.machine().device("upd765"), space, 0);
}
void spectrum_plus3_update_memory(running_machine &machine)
{
spectrum_state *state = machine.driver_data<spectrum_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_port_7ffd_data & 8)
@@ -258,7 +258,7 @@ void spectrum_plus3_update_memory(running_machine &machine)
ChosenROM = machine.root_device().memregion("maincpu")->base() + 0x010000 + (ROMSelection << 14);
state->membank("bank1")->set_base(ChosenROM);
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
logerror("rom switch: %02x\n", ROMSelection);
}
@@ -277,7 +277,7 @@ void spectrum_plus3_update_memory(running_machine &machine)
ram_data = messram + (memory_selection[0] << 14);
state->membank("bank1")->set_base(ram_data);
/* allow writes to 0x0000-0x03fff */
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
ram_data = messram + (memory_selection[1] << 14);
state->membank("bank2")->set_base(ram_data);
@@ -301,7 +301,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_7ffd_w)
/* D4 - ROM select - which rom paged into 0x0000-0x03fff */
/* D5 - Disable paging */
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
/* disable paging? */
if (state->m_port_7ffd_data & 0x20)
@@ -311,7 +311,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_7ffd_w)
state->m_port_7ffd_data = data;
/* update memory */
- spectrum_plus3_update_memory(space->machine());
+ spectrum_plus3_update_memory(space.machine());
}
static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w)
@@ -321,12 +321,12 @@ static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w)
/* D3 - Disk motor on/off */
/* D4 - parallel port strobe */
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
- floppy_mon_w(floppy_get_device(space->machine(), 0), !BIT(data, 3));
- floppy_mon_w(floppy_get_device(space->machine(), 1), !BIT(data, 3));
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1, 1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 1), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), !BIT(data, 3));
+ floppy_mon_w(floppy_get_device(space.machine(), 1), !BIT(data, 3));
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), 1, 1);
state->m_port_1ffd_data = data;
@@ -334,7 +334,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w)
if ((state->m_port_7ffd_data & 0x20)==0)
{
/* no */
- spectrum_plus3_update_memory(space->machine());
+ spectrum_plus3_update_memory(space.machine());
}
}
diff --git a/src/mess/drivers/spectrum.c b/src/mess/drivers/spectrum.c
index 779841271fd..93c8971c9d4 100644
--- a/src/mess/drivers/spectrum.c
+++ b/src/mess/drivers/spectrum.c
@@ -620,22 +620,22 @@ INPUT_PORTS_END
DRIVER_INIT_MEMBER(spectrum_state,spectrum)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
switch (machine().device<ram_device>(RAM_TAG)->size())
{
case 48*1024:
- space->install_ram(0x8000, 0xffff, NULL); // Fall through
+ space.install_ram(0x8000, 0xffff, NULL); // Fall through
case 16*1024:
- space->install_ram(0x5b00, 0x7fff, NULL);
+ space.install_ram(0x5b00, 0x7fff, NULL);
}
}
MACHINE_RESET_MEMBER(spectrum_state,spectrum)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(spectrum_state::spectrum_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(spectrum_state::spectrum_direct), this));
m_port_7ffd_data = -1;
m_port_1ffd_data = -1;
diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c
index fe6e75cab64..d9758ba0eb4 100644
--- a/src/mess/drivers/super6.c
+++ b/src/mess/drivers/super6.c
@@ -396,8 +396,8 @@ static Z80DART_INTERFACE( dart_intf )
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/drivers/timex.c b/src/mess/drivers/timex.c
index a0a15ceffd6..d9673f0b8eb 100644
--- a/src/mess/drivers/timex.c
+++ b/src/mess/drivers/timex.c
@@ -171,22 +171,22 @@ static const ay8910_interface spectrum_ay_interface =
static READ8_HANDLER(ts2068_port_f4_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
return state->m_port_f4_data;
}
static WRITE8_HANDLER(ts2068_port_f4_w)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
state->m_port_f4_data = data;
- ts2068_update_memory(space->machine());
+ ts2068_update_memory(space.machine());
}
static READ8_HANDLER(ts2068_port_ff_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
return state->m_port_ff_data;
}
@@ -199,10 +199,10 @@ static WRITE8_HANDLER(ts2068_port_ff_w)
Bit 6 17ms Interrupt Inhibit
Bit 7 Cartridge (0) / EXROM (1) select
*/
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
state->m_port_ff_data = data;
- ts2068_update_memory(space->machine());
+ ts2068_update_memory(space.machine());
logerror("Port %04x write %02x\n", offset, data);
}
@@ -228,7 +228,7 @@ void ts2068_update_memory(running_machine &machine)
{
spectrum_state *state = machine.driver_data<spectrum_state>();
UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
unsigned char *ChosenROM, *ExROM;
const timex_cart_t *timex_cart = timex_cart_data();
int timex_cart_type = timex_cart->type;
@@ -241,8 +241,8 @@ void ts2068_update_memory(running_machine &machine)
{
if (state->m_port_ff_data & 0x80)
{
- space->install_read_bank(0x0000, 0x1fff, "bank1");
- space->unmap_write(0x0000, 0x1fff);
+ space.install_read_bank(0x0000, 0x1fff, "bank1");
+ space.unmap_write(0x0000, 0x1fff);
state->membank("bank1")->set_base(ExROM);
logerror("0000-1fff EXROM\n");
}
@@ -251,18 +251,18 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank1")->set_base(DOCK);
- space->install_read_bank(0x0000, 0x1fff, "bank1");
+ space.install_read_bank(0x0000, 0x1fff, "bank1");
if (timex_cart_chunks&0x01)
- space->install_write_bank(0x0000, 0x1fff, "bank9");
+ space.install_write_bank(0x0000, 0x1fff, "bank9");
else
- space->unmap_write(0x0000, 0x1fff);
+ space.unmap_write(0x0000, 0x1fff);
}
else
{
- space->nop_read(0x0000, 0x1fff);
- space->unmap_write(0x0000, 0x1fff);
+ space.nop_read(0x0000, 0x1fff);
+ space.unmap_write(0x0000, 0x1fff);
}
logerror("0000-1fff Cartridge\n");
}
@@ -271,8 +271,8 @@ void ts2068_update_memory(running_machine &machine)
{
ChosenROM = machine.root_device().memregion("maincpu")->base() + 0x010000;
state->membank("bank1")->set_base(ChosenROM);
- space->install_read_bank(0x0000, 0x1fff, "bank1");
- space->unmap_write(0x0000, 0x1fff);
+ space.install_read_bank(0x0000, 0x1fff, "bank1");
+ space.unmap_write(0x0000, 0x1fff);
logerror("0000-1fff HOME\n");
}
@@ -281,8 +281,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank2")->set_base(ExROM);
- space->install_read_bank(0x2000, 0x3fff, "bank2");
- space->unmap_write(0x2000, 0x3fff);
+ space.install_read_bank(0x2000, 0x3fff, "bank2");
+ space.unmap_write(0x2000, 0x3fff);
logerror("2000-3fff EXROM\n");
}
else
@@ -290,17 +290,17 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank2")->set_base(DOCK+0x2000);
- space->install_read_bank(0x2000, 0x3fff, "bank2");
+ space.install_read_bank(0x2000, 0x3fff, "bank2");
if (timex_cart_chunks&0x02)
- space->install_write_bank(0x2000, 0x3fff, "bank10");
+ space.install_write_bank(0x2000, 0x3fff, "bank10");
else
- space->unmap_write(0x2000, 0x3fff);
+ space.unmap_write(0x2000, 0x3fff);
}
else
{
- space->nop_read(0x2000, 0x3fff);
- space->unmap_write(0x2000, 0x3fff);
+ space.nop_read(0x2000, 0x3fff);
+ space.unmap_write(0x2000, 0x3fff);
}
logerror("2000-3fff Cartridge\n");
}
@@ -309,8 +309,8 @@ void ts2068_update_memory(running_machine &machine)
{
ChosenROM = machine.root_device().memregion("maincpu")->base() + 0x012000;
state->membank("bank2")->set_base(ChosenROM);
- space->install_read_bank(0x2000, 0x3fff, "bank2");
- space->unmap_write(0x2000, 0x3fff);
+ space.install_read_bank(0x2000, 0x3fff, "bank2");
+ space.unmap_write(0x2000, 0x3fff);
logerror("2000-3fff HOME\n");
}
@@ -319,8 +319,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank3")->set_base(ExROM);
- space->install_read_bank(0x4000, 0x5fff, "bank3");
- space->unmap_write(0x4000, 0x5fff);
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
+ space.unmap_write(0x4000, 0x5fff);
logerror("4000-5fff EXROM\n");
}
else
@@ -328,16 +328,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank3")->set_base(DOCK+0x4000);
- space->install_read_bank(0x4000, 0x5fff, "bank3");
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
if (timex_cart_chunks&0x04)
- space->install_write_bank(0x4000, 0x5fff, "bank11");
+ space.install_write_bank(0x4000, 0x5fff, "bank11");
else
- space->unmap_write(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
}
else
{
- space->nop_read(0x4000, 0x5fff);
- space->unmap_write(0x4000, 0x5fff);
+ space.nop_read(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
}
logerror("4000-5fff Cartridge\n");
}
@@ -346,8 +346,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank3")->set_base(messram);
state->membank("bank11")->set_base(messram);
- space->install_read_bank(0x4000, 0x5fff, "bank3");
- space->install_write_bank(0x4000, 0x5fff, "bank11");
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
+ space.install_write_bank(0x4000, 0x5fff, "bank11");
logerror("4000-5fff RAM\n");
}
@@ -356,8 +356,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank4")->set_base(ExROM);
- space->install_read_bank(0x6000, 0x7fff, "bank4");
- space->unmap_write(0x6000, 0x7fff);
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
+ space.unmap_write(0x6000, 0x7fff);
logerror("6000-7fff EXROM\n");
}
else
@@ -365,16 +365,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank4")->set_base(DOCK+0x6000);
- space->install_read_bank(0x6000, 0x7fff, "bank4");
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
if (timex_cart_chunks&0x08)
- space->install_write_bank(0x6000, 0x7fff, "bank12");
+ space.install_write_bank(0x6000, 0x7fff, "bank12");
else
- space->unmap_write(0x6000, 0x7fff);
+ space.unmap_write(0x6000, 0x7fff);
}
else
{
- space->nop_read(0x6000, 0x7fff);
- space->unmap_write(0x6000, 0x7fff);
+ space.nop_read(0x6000, 0x7fff);
+ space.unmap_write(0x6000, 0x7fff);
}
logerror("6000-7fff Cartridge\n");
}
@@ -383,8 +383,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank4")->set_base(messram + 0x2000);
state->membank("bank12")->set_base(messram + 0x2000);
- space->install_read_bank(0x6000, 0x7fff, "bank4");
- space->install_write_bank(0x6000, 0x7fff, "bank12");
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
+ space.install_write_bank(0x6000, 0x7fff, "bank12");
logerror("6000-7fff RAM\n");
}
@@ -393,8 +393,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank5")->set_base(ExROM);
- space->install_read_bank(0x8000, 0x9fff, "bank5");
- space->unmap_write(0x8000, 0x9fff);
+ space.install_read_bank(0x8000, 0x9fff, "bank5");
+ space.unmap_write(0x8000, 0x9fff);
logerror("8000-9fff EXROM\n");
}
else
@@ -402,16 +402,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank5")->set_base(DOCK+0x8000);
- space->install_read_bank(0x8000, 0x9fff,"bank5");
+ space.install_read_bank(0x8000, 0x9fff,"bank5");
if (timex_cart_chunks&0x10)
- space->install_write_bank(0x8000, 0x9fff,"bank13");
+ space.install_write_bank(0x8000, 0x9fff,"bank13");
else
- space->unmap_write(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
}
else
{
- space->nop_read(0x8000, 0x9fff);
- space->unmap_write(0x8000, 0x9fff);
+ space.nop_read(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
}
logerror("8000-9fff Cartridge\n");
}
@@ -420,8 +420,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank5")->set_base(messram + 0x4000);
state->membank("bank13")->set_base(messram + 0x4000);
- space->install_read_bank(0x8000, 0x9fff,"bank5");
- space->install_write_bank(0x8000, 0x9fff,"bank13");
+ space.install_read_bank(0x8000, 0x9fff,"bank5");
+ space.install_write_bank(0x8000, 0x9fff,"bank13");
logerror("8000-9fff RAM\n");
}
@@ -430,8 +430,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank6")->set_base(ExROM);
- space->install_read_bank(0xa000, 0xbfff, "bank6");
- space->unmap_write(0xa000, 0xbfff);
+ space.install_read_bank(0xa000, 0xbfff, "bank6");
+ space.unmap_write(0xa000, 0xbfff);
logerror("a000-bfff EXROM\n");
}
else
@@ -439,17 +439,17 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank6")->set_base(DOCK+0xa000);
- space->install_read_bank(0xa000, 0xbfff, "bank6");
+ space.install_read_bank(0xa000, 0xbfff, "bank6");
if (timex_cart_chunks&0x20)
- space->install_write_bank(0xa000, 0xbfff, "bank14");
+ space.install_write_bank(0xa000, 0xbfff, "bank14");
else
- space->unmap_write(0xa000, 0xbfff);
+ space.unmap_write(0xa000, 0xbfff);
}
else
{
- space->nop_read(0xa000, 0xbfff);
- space->unmap_write(0xa000, 0xbfff);
+ space.nop_read(0xa000, 0xbfff);
+ space.unmap_write(0xa000, 0xbfff);
}
logerror("a000-bfff Cartridge\n");
}
@@ -458,8 +458,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank6")->set_base(messram + 0x6000);
state->membank("bank14")->set_base(messram + 0x6000);
- space->install_read_bank(0xa000, 0xbfff, "bank6");
- space->install_write_bank(0xa000, 0xbfff, "bank14");
+ space.install_read_bank(0xa000, 0xbfff, "bank6");
+ space.install_write_bank(0xa000, 0xbfff, "bank14");
logerror("a000-bfff RAM\n");
}
@@ -468,8 +468,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank7")->set_base(ExROM);
- space->install_read_bank(0xc000, 0xdfff, "bank7");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank7");
+ space.unmap_write(0xc000, 0xdfff);
logerror("c000-dfff EXROM\n");
}
else
@@ -477,16 +477,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank7")->set_base(DOCK+0xc000);
- space->install_read_bank(0xc000, 0xdfff, "bank7");
+ space.install_read_bank(0xc000, 0xdfff, "bank7");
if (timex_cart_chunks&0x40)
- space->install_write_bank(0xc000, 0xdfff, "bank15");
+ space.install_write_bank(0xc000, 0xdfff, "bank15");
else
- space->unmap_write(0xc000, 0xdfff);
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
- space->nop_read(0xc000, 0xdfff);
- space->unmap_write(0xc000, 0xdfff);
+ space.nop_read(0xc000, 0xdfff);
+ space.unmap_write(0xc000, 0xdfff);
}
logerror("c000-dfff Cartridge\n");
}
@@ -495,8 +495,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank7")->set_base(messram + 0x8000);
state->membank("bank15")->set_base(messram + 0x8000);
- space->install_read_bank(0xc000, 0xdfff, "bank7");
- space->install_write_bank(0xc000, 0xdfff, "bank15");
+ space.install_read_bank(0xc000, 0xdfff, "bank7");
+ space.install_write_bank(0xc000, 0xdfff, "bank15");
logerror("c000-dfff RAM\n");
}
@@ -505,8 +505,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank8")->set_base(ExROM);
- space->install_read_bank(0xe000, 0xffff, "bank8");
- space->unmap_write(0xe000, 0xffff);
+ space.install_read_bank(0xe000, 0xffff, "bank8");
+ space.unmap_write(0xe000, 0xffff);
logerror("e000-ffff EXROM\n");
}
else
@@ -514,16 +514,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank8")->set_base(DOCK+0xe000);
- space->install_read_bank(0xe000, 0xffff, "bank8");
+ space.install_read_bank(0xe000, 0xffff, "bank8");
if (timex_cart_chunks&0x80)
- space->install_write_bank(0xe000, 0xffff, "bank16");
+ space.install_write_bank(0xe000, 0xffff, "bank16");
else
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0xe000, 0xffff);
}
else
{
- space->nop_read(0xe000, 0xffff);
- space->unmap_write(0xe000, 0xffff);
+ space.nop_read(0xe000, 0xffff);
+ space.unmap_write(0xe000, 0xffff);
}
logerror("e000-ffff Cartridge\n");
}
@@ -532,8 +532,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank8")->set_base(messram + 0xa000);
state->membank("bank16")->set_base(messram + 0xa000);
- space->install_read_bank(0xe000, 0xffff, "bank8");
- space->install_write_bank(0xe000, 0xffff, "bank16");
+ space.install_read_bank(0xe000, 0xffff, "bank8");
+ space.install_write_bank(0xe000, 0xffff, "bank16");
logerror("e000-ffff RAM\n");
}
}
@@ -578,7 +578,7 @@ MACHINE_RESET_MEMBER(spectrum_state,ts2068)
static WRITE8_HANDLER( tc2048_port_ff_w )
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
state->m_port_ff_data = data;
logerror("Port %04x write %02x\n", offset, data);
diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c
index fa1a930e8ff..8906665c52c 100644
--- a/src/mess/drivers/trs80m2.c
+++ b/src/mess/drivers/trs80m2.c
@@ -694,8 +694,8 @@ static TRS80M2_KEYBOARD_INTERFACE( kb_intf )
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c
index d408f9e88d0..fb55f278e5a 100644
--- a/src/mess/drivers/tvc.c
+++ b/src/mess/drivers/tvc.c
@@ -18,21 +18,21 @@
#define TVC_INSTALL_ROM_BANK(_bank,_tag,_start,_end) \
if (m_bank_type[_bank] != TVC_ROM_BANK) \
{ \
- space->install_read_bank(_start, _end, _tag); \
- space->unmap_write(_start, _end); \
+ space.install_read_bank(_start, _end, _tag); \
+ space.unmap_write(_start, _end); \
m_bank_type[_bank] = TVC_ROM_BANK; \
} \
#define TVC_INSTALL_RAM_BANK(_bank,_tag,_start,_end) \
if (m_bank_type[_bank] != TVC_RAM_BANK) \
{ \
- space->install_readwrite_bank(_start, _end, _tag); \
+ space.install_readwrite_bank(_start, _end, _tag); \
m_bank_type[_bank] = TVC_RAM_BANK; \
} \
void tvc_state::tvc_set_mem_page(UINT8 data)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
switch(data & 0x18)
{
case 0x00 : // system ROM selected
@@ -56,7 +56,7 @@ void tvc_state::tvc_set_mem_page(UINT8 data)
}
else
{
- space->unmap_readwrite(0x0000, 0x3fff);
+ space.unmap_readwrite(0x0000, 0x3fff);
m_bank_type[0] = -1;
}
break;
@@ -76,7 +76,7 @@ void tvc_state::tvc_set_mem_page(UINT8 data)
}
else
{
- space->unmap_readwrite(0x8000, 0xbfff);
+ space.unmap_readwrite(0x8000, 0xbfff);
m_bank_type[2] = -1;
}
}
@@ -99,14 +99,14 @@ void tvc_state::tvc_set_mem_page(UINT8 data)
}
else
{
- space->unmap_readwrite(0xc000, 0xffff);
+ space.unmap_readwrite(0xc000, 0xffff);
m_bank_type[3] = -1;
}
break;
case 0xc0 : // External ROM selected
TVC_INSTALL_ROM_BANK(3, "bank4", 0xc000, 0xffff);
membank("bank4")->set_base(memregion("ext")->base());
- space->install_readwrite_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(tvc_state::tvc_expansion_r), this), write8_delegate(FUNC(tvc_state::tvc_expansion_w), this), 0);
+ space.install_readwrite_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(tvc_state::tvc_expansion_r), this), write8_delegate(FUNC(tvc_state::tvc_expansion_w), this), 0);
m_bank_type[3] = -1;
break;
}
diff --git a/src/mess/drivers/vc4000.c b/src/mess/drivers/vc4000.c
index c54c92e766f..8989b621ddc 100644
--- a/src/mess/drivers/vc4000.c
+++ b/src/mess/drivers/vc4000.c
@@ -530,7 +530,7 @@ ROM_END
QUICKLOAD_LOAD(vc4000)
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x08c0;
int exec_addr;
@@ -567,12 +567,12 @@ QUICKLOAD_LOAD(vc4000)
quick_addr = quick_data[1] * 256 + quick_data[2];
exec_addr = quick_data[3] * 256 + quick_data[4];
- space->write_byte(0x08be, quick_data[3]);
- space->write_byte(0x08bf, quick_data[4]);
+ space.write_byte(0x08be, quick_data[3]);
+ space.write_byte(0x08bf, quick_data[4]);
for (i = 0; i < quick_length - 5; i++)
if ((quick_addr + i) < 0x1600)
- space->write_byte(i + quick_addr, quick_data[i+5]);
+ space.write_byte(i + quick_addr, quick_data[i+5]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length-5,quick_addr,quick_addr+quick_length-5,exec_addr);
@@ -617,7 +617,7 @@ QUICKLOAD_LOAD(vc4000)
for (i = quick_addr; i < quick_length; i++)
if (i < 0x1600)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr);
diff --git a/src/mess/drivers/vidbrain.c b/src/mess/drivers/vidbrain.c
index bad5ffe29d3..7f9d4a7c5c3 100644
--- a/src/mess/drivers/vidbrain.c
+++ b/src/mess/drivers/vidbrain.c
@@ -449,7 +449,7 @@ WRITE_LINE_MEMBER( vidbrain_state::hblank_w )
}
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
static UV201_INTERFACE( uv_intf )
{
diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c
index 04fc81554aa..d8cc78ad3f6 100644
--- a/src/mess/drivers/vii.c
+++ b/src/mess/drivers/vii.c
@@ -215,7 +215,7 @@ static void vii_set_pixel(vii_state *state, UINT32 offset, UINT16 rgb)
static void vii_blit(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile)
{
vii_state *state = machine.driver_data<vii_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT);
UINT32 w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT);
@@ -247,7 +247,7 @@ static void vii_blit(running_machine &machine, bitmap_rgb32 &bitmap, const recta
bits <<= nc;
if(nbits < nc)
{
- UINT16 b = space->read_word((m++ & 0x3fffff) << 1);
+ UINT16 b = space.read_word((m++ & 0x3fffff) << 1);
b = (b << 8) | (b >> 8);
bits |= b << (nc - nbits);
nbits += 16;
@@ -291,7 +291,7 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
UINT32 tilemap = regs[4];
UINT32 palette_map = regs[5];
UINT32 h, w, hn, wn;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if(!(ctrl & PAGE_ENABLE_MASK))
{
@@ -313,7 +313,7 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
{
for(x0 = 0; x0 < wn; x0++)
{
- UINT16 tile = space->read_word((tilemap + x0 + wn * y0) << 1);
+ UINT16 tile = space.read_word((tilemap + x0 + wn * y0) << 1);
UINT16 palette = 0;
UINT32 xx, yy;
@@ -322,7 +322,7 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
continue;
}
- palette = space->read_word((palette_map + (x0 + wn * y0) / 2) << 1);
+ palette = space.read_word((palette_map + (x0 + wn * y0) / 2) << 1);
if(x0 & 1)
{
palette >>= 8;
@@ -353,16 +353,16 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
static void vii_blit_sprite(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 base_addr)
{
vii_state *state = machine.driver_data<vii_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 tile, attr;
INT16 x, y;
UINT32 h, w;
UINT32 bitmap_addr = 0x40 * state->m_video_regs[0x22];
- tile = space->read_word((base_addr + 0) << 1);
- x = space->read_word((base_addr + 1) << 1);
- y = space->read_word((base_addr + 2) << 1);
- attr = space->read_word((base_addr + 3) << 1);
+ tile = space.read_word((base_addr + 0) << 1);
+ x = space.read_word((base_addr + 1) << 1);
+ y = space.read_word((base_addr + 2) << 1);
+ attr = space.read_word((base_addr + 3) << 1);
if(!tile)
{
@@ -404,7 +404,7 @@ static void vii_blit_sprites(running_machine &machine, bitmap_rgb32 &bitmap, con
for(n = 0; n < 256; n++)
{
- //if(space->read_word((0x2c00 + 4*n) << 1))
+ //if(space.read_word((0x2c00 + 4*n) << 1))
{
vii_blit_sprite(machine, bitmap, cliprect, depth, 0x2c00 + 4*n);
}
diff --git a/src/mess/drivers/vt520.c b/src/mess/drivers/vt520.c
index a5077d99ead..09083b37bf4 100644
--- a/src/mess/drivers/vt520.c
+++ b/src/mess/drivers/vt520.c
@@ -52,9 +52,9 @@ INPUT_PORTS_END
void vt520_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- space->unmap_write(0x0000, 0xffff);
+ space.unmap_write(0x0000, 0xffff);
membank("bank1")->set_base(rom + 0x70000);
}
diff --git a/src/mess/drivers/vtech1.c b/src/mess/drivers/vtech1.c
index c05af7292c4..b9583cd2895 100644
--- a/src/mess/drivers/vtech1.c
+++ b/src/mess/drivers/vtech1.c
@@ -209,7 +209,7 @@ public:
static SNAPSHOT_LOAD( vtech1 )
{
vtech1_state *vtech1 = image.device().machine().driver_data<vtech1_state>();
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 i, header[24];
UINT16 start, end, size;
char pgmname[18];
@@ -241,20 +241,20 @@ static SNAPSHOT_LOAD( vtech1 )
switch (header[21])
{
case VZ_BASIC: /* 0xF0 */
- space->write_byte(0x78a4, start % 256); /* start of basic program */
- space->write_byte(0x78a5, start / 256);
- space->write_byte(0x78f9, end % 256); /* end of basic program */
- space->write_byte(0x78fa, end / 256);
- space->write_byte(0x78fb, end % 256); /* start variable table */
- space->write_byte(0x78fc, end / 256);
- space->write_byte(0x78fd, end % 256); /* start free mem, end variable table */
- space->write_byte(0x78fe, end / 256);
+ space.write_byte(0x78a4, start % 256); /* start of basic program */
+ space.write_byte(0x78a5, start / 256);
+ space.write_byte(0x78f9, end % 256); /* end of basic program */
+ space.write_byte(0x78fa, end / 256);
+ space.write_byte(0x78fb, end % 256); /* start variable table */
+ space.write_byte(0x78fc, end / 256);
+ space.write_byte(0x78fd, end % 256); /* start free mem, end variable table */
+ space.write_byte(0x78fe, end / 256);
image.message(" %s (B)\nsize=%04X : start=%04X : end=%04X",pgmname,size,start,end);
break;
case VZ_MCODE: /* 0xF1 */
- space->write_byte(0x788e, start % 256); /* usr subroutine address */
- space->write_byte(0x788f, start / 256);
+ space.write_byte(0x788e, start % 256); /* usr subroutine address */
+ space.write_byte(0x788f, start / 256);
image.message(" %s (M)\nsize=%04X : start=%04X : end=%04X",pgmname,size,start,end);
image.device().machine().device("maincpu")->state().set_pc(start); /* start program */
break;
diff --git a/src/mess/drivers/x07.c b/src/mess/drivers/x07.c
index 8423f9b76d1..f3eff9f3b41 100644
--- a/src/mess/drivers/x07.c
+++ b/src/mess/drivers/x07.c
@@ -1042,7 +1042,7 @@ static DEVICE_IMAGE_LOAD( x07_card )
{
running_machine &machine = image.device().machine();
x07_state *state = machine.driver_data<x07_state>();
- address_space *space = state->m_maincpu->space( AS_PROGRAM );
+ address_space &space = *state->m_maincpu->space( AS_PROGRAM );
UINT16 ram_size = state->m_ram->size();
if (image.software_entry() == NULL)
@@ -1050,8 +1050,8 @@ static DEVICE_IMAGE_LOAD( x07_card )
UINT8 *rom = machine.memory().region_alloc( "card", image.length(), 1, ENDIANNESS_LITTLE )->base();
image.fread(rom, image.length());
- space->install_ram(ram_size, ram_size + 0xfff);
- space->install_rom(0x6000, 0x7fff, rom);
+ space.install_ram(ram_size, ram_size + 0xfff);
+ space.install_rom(0x6000, 0x7fff, rom);
}
else
{
@@ -1061,8 +1061,8 @@ static DEVICE_IMAGE_LOAD( x07_card )
{
// 0x4000 - 0x4fff 4KB RAM
// 0x6000 - 0x7fff 8KB ROM
- space->install_ram(ram_size, ram_size + 0xfff);
- space->install_rom(0x6000, 0x7fff, image.get_software_region("rom"));
+ space.install_ram(ram_size, ram_size + 0xfff);
+ space.install_rom(0x6000, 0x7fff, image.get_software_region("rom"));
}
else
{
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index 7d30350b316..29f2adc8340 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -1631,7 +1631,7 @@ READ8_MEMBER( x1_state::x1_io_r )
else if(offset >= 0x4000 && offset <= 0xffff) { return m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)]; }
else
{
- //logerror("(PC=%06x) Read i/o address %04x\n",space->device().safe_pc(),offset);
+ //logerror("(PC=%06x) Read i/o address %04x\n",space.device().safe_pc(),offset);
}
return 0xff;
}
@@ -1674,7 +1674,7 @@ WRITE8_MEMBER( x1_state::x1_io_w )
else if(offset >= 0x4000 && offset <= 0xffff) { m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)] = data; }
else
{
- //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space->device().safe_pc(),data,offset);
+ //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space.device().safe_pc(),data,offset);
}
}
@@ -1721,7 +1721,7 @@ READ8_MEMBER( x1_state::x1turbo_io_r )
else if(offset >= 0x4000 && offset <= 0xffff) { return m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)]; }
else
{
- //logerror("(PC=%06x) Read i/o address %04x\n",space->device().safe_pc(),offset);
+ //logerror("(PC=%06x) Read i/o address %04x\n",space.device().safe_pc(),offset);
}
return 0xff;
}
@@ -1777,7 +1777,7 @@ WRITE8_MEMBER( x1_state::x1turbo_io_w )
else if(offset >= 0x4000 && offset <= 0xffff) { m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)] = data; }
else
{
- //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space->device().safe_pc(),data,offset);
+ //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space.device().safe_pc(),data,offset);
}
}
@@ -1916,8 +1916,8 @@ static const mc6845_interface mc6845_intf =
NULL /* update address callback */
};
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( x1_dma )
{
@@ -1938,7 +1938,7 @@ static Z80DMA_INTERFACE( x1_dma )
static INPUT_CHANGED( ipl_reset )
{
- //address_space *space = field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ //address_space &space = *field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
x1_state *state = field.machine().driver_data<x1_state>();
state->m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
@@ -2407,7 +2407,7 @@ static IRQ_CALLBACK(x1_irq_callback)
TIMER_DEVICE_CALLBACK(x1_keyboard_callback)
{
x1_state *state = timer.machine().driver_data<x1_state>();
- address_space *space = timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ address_space &space = *timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
@@ -2422,7 +2422,7 @@ TIMER_DEVICE_CALLBACK(x1_keyboard_callback)
if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3) || (key4 != state->m_old_key4) || (f_key != state->m_old_fkey))
{
// generate keyboard IRQ
- state->x1_sub_io_w(*space,0,0xe6);
+ state->x1_sub_io_w(space,0,0xe6);
state->m_irq_vector = state->m_key_irq_vector;
state->m_key_irq_flag = 1;
timer.machine().device("x1_cpu")->execute().set_input_line(0,ASSERT_LINE);
diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c
index 35e62a8bca9..11c2bd7fdf2 100644
--- a/src/mess/drivers/x1twin.c
+++ b/src/mess/drivers/x1twin.c
@@ -107,7 +107,7 @@ static const mc6845_interface mc6845_intf =
static INPUT_CHANGED( ipl_reset )
{
- //address_space *space = field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ //address_space &space = *field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
x1twin_state *state = field.machine().driver_data<x1twin_state>();
state->m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c
index 2050166a61a..d3921946fdf 100644
--- a/src/mess/drivers/x68k.c
+++ b/src/mess/drivers/x68k.c
@@ -346,14 +346,14 @@ static TIMER_CALLBACK( x68k_led_callback )
// 4 channel DMA controller (Hitachi HD63450)
static WRITE16_HANDLER( x68k_dmac_w )
{
- device_t* device = space->machine().device("hd63450");
- hd63450_w(device, *space, offset, data, mem_mask);
+ device_t* device = space.machine().device("hd63450");
+ hd63450_w(device, space, offset, data, mem_mask);
}
static READ16_HANDLER( x68k_dmac_r )
{
- device_t* device = space->machine().device("hd63450");
- return hd63450_r(device, *space, offset, mem_mask);
+ device_t* device = space.machine().device("hd63450");
+ return hd63450_r(device, space, offset, mem_mask);
}
static void x68k_keyboard_ctrl_w(x68k_state *state, int data)
@@ -583,18 +583,18 @@ static int x68k_read_mouse(running_machine &machine)
*/
static READ16_HANDLER( x68k_scc_r )
{
- scc8530_t *scc = space->machine().device<scc8530_t>("scc");
+ scc8530_t *scc = space.machine().device<scc8530_t>("scc");
offset %= 4;
switch(offset)
{
case 0:
- return scc->reg_r(*space, 0);
+ return scc->reg_r(space, 0);
case 1:
- return x68k_read_mouse(space->machine());
+ return x68k_read_mouse(space.machine());
case 2:
- return scc->reg_r(*space, 1);
+ return scc->reg_r(space, 1);
case 3:
- return scc->reg_r(*space, 3);
+ return scc->reg_r(space, 3);
default:
return 0xff;
}
@@ -602,14 +602,14 @@ static READ16_HANDLER( x68k_scc_r )
static WRITE16_HANDLER( x68k_scc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
- scc8530_t *scc = space->machine().device<scc8530_t>("scc");
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ scc8530_t *scc = space.machine().device<scc8530_t>("scc");
offset %= 4;
switch(offset)
{
case 0:
- scc->reg_w(*space, 0,(UINT8)data);
+ scc->reg_w(space, 0,(UINT8)data);
if((scc->get_reg_b(5) & 0x02) != state->m_scc_prev)
{
if(scc->get_reg_b(5) & 0x02) // Request to Send
@@ -622,13 +622,13 @@ static WRITE16_HANDLER( x68k_scc_w )
}
break;
case 1:
- scc->reg_w(*space, 2,(UINT8)data);
+ scc->reg_w(space, 2,(UINT8)data);
break;
case 2:
- scc->reg_w(*space, 1,(UINT8)data);
+ scc->reg_w(space, 1,(UINT8)data);
break;
case 3:
- scc->reg_w(*space, 3,(UINT8)data);
+ scc->reg_w(space, 3,(UINT8)data);
break;
}
state->m_scc_prev = scc->get_reg_b(5) & 0x02;
@@ -967,14 +967,14 @@ static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
// NEC uPD72065 at 0xe94000
static WRITE16_HANDLER( x68k_fdc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
- device_t *fdc = space->machine().device("upd72065");
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ device_t *fdc = space.machine().device("upd72065");
unsigned int drive, x;
switch(offset)
{
case 0x00:
case 0x01:
- upd765_data_w(fdc, *space, 0,data);
+ upd765_data_w(fdc, space, 0,data);
break;
case 0x02: // drive option signal control
x = data & 0x0f;
@@ -989,8 +989,8 @@ static WRITE16_HANDLER( x68k_fdc_w )
output_set_indexed_value("eject_drv",drive,(data & 0x40) ? 1 : 0);
if(data & 0x20) // ejects disk
{
- (dynamic_cast<device_image_interface *>(floppy_get_device(space->machine(), drive)))->unload();
- floppy_mon_w(floppy_get_device(space->machine(), drive), ASSERT_LINE);
+ (dynamic_cast<device_image_interface *>(floppy_get_device(space.machine(), drive)))->unload();
+ floppy_mon_w(floppy_get_device(space.machine(), drive), ASSERT_LINE);
}
}
}
@@ -1001,14 +1001,14 @@ static WRITE16_HANDLER( x68k_fdc_w )
case 0x03:
state->m_fdc.media_density[data & 0x03] = data & 0x10;
state->m_fdc.motor[data & 0x03] = data & 0x80;
- floppy_mon_w(floppy_get_device(space->machine(), data & 0x03), !BIT(data, 7));
+ floppy_mon_w(floppy_get_device(space.machine(), data & 0x03), !BIT(data, 7));
if(data & 0x80)
{
for(drive=0;drive<4;drive++) // enable motor for this drive
{
if(drive == (data & 0x03))
{
- floppy_mon_w(floppy_get_device(space->machine(), drive), CLEAR_LINE);
+ floppy_mon_w(floppy_get_device(space.machine(), drive), CLEAR_LINE);
output_set_indexed_value("access_drv",drive,0);
}
else
@@ -1019,14 +1019,14 @@ static WRITE16_HANDLER( x68k_fdc_w )
{
for(drive=0;drive<4;drive++)
{
- floppy_mon_w(floppy_get_device(space->machine(), drive), ASSERT_LINE);
+ floppy_mon_w(floppy_get_device(space.machine(), drive), ASSERT_LINE);
output_set_indexed_value("access_drv",drive,1);
}
}
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0),1,1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 1),1,1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 2),1,1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 3),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 2),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 3),1,1);
#if 0
for(drive=0;drive<4;drive++)
{
@@ -1039,24 +1039,24 @@ static WRITE16_HANDLER( x68k_fdc_w )
logerror("FDC: Drive #%i: Drive selection set to %02x\n",data & 0x03,data);
break;
default:
-// logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",space->device().safe_pc(),data,offset);
+// logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",space.device().safe_pc(),data,offset);
break;
}
}
static READ16_HANDLER( x68k_fdc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
unsigned int ret;
int x;
- device_t *fdc = space->machine().device("upd72065");
+ device_t *fdc = space.machine().device("upd72065");
switch(offset)
{
case 0x00:
- return upd765_status_r(fdc, *space, 0);
+ return upd765_status_r(fdc, space, 0);
case 0x01:
- return upd765_data_r(fdc, *space, 0);
+ return upd765_data_r(fdc, space, 0);
case 0x02:
ret = 0x00;
for(x=0;x<4;x++)
@@ -1126,7 +1126,7 @@ static WRITE16_HANDLER( x68k_fm_w )
{
case 0x00:
case 0x01:
- ym2151_w(space->machine().device("ym2151"), *space, offset, data);
+ ym2151_w(space.machine().device("ym2151"), space, offset, data);
break;
}
}
@@ -1134,7 +1134,7 @@ static WRITE16_HANDLER( x68k_fm_w )
static READ16_HANDLER( x68k_fm_r )
{
if(offset == 0x01)
- return ym2151_r(space->machine().device("ym2151"), *space, 1);
+ return ym2151_r(space.machine().device("ym2151"), space, 1);
return 0xffff;
}
@@ -1172,7 +1172,7 @@ static WRITE8_DEVICE_HANDLER( x68k_ct_w )
*/
static WRITE16_HANDLER( x68k_ioc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
switch(offset)
{
case 0x00:
@@ -1205,7 +1205,7 @@ static WRITE16_HANDLER( x68k_ioc_w )
static READ16_HANDLER( x68k_ioc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
switch(offset)
{
case 0x00:
@@ -1238,7 +1238,7 @@ static READ16_HANDLER( x68k_ioc_r )
*/
static WRITE16_HANDLER( x68k_sysport_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
switch(offset)
{
case 0x00:
@@ -1255,14 +1255,14 @@ static WRITE16_HANDLER( x68k_sysport_w )
state->m_sysport.sram_writeprotect = data;
break;
default:
-// logerror("SYS: [%08x] Wrote %04x to invalid or unimplemented system port %04x\n",space->device().safe_pc(),data,offset);
+// logerror("SYS: [%08x] Wrote %04x to invalid or unimplemented system port %04x\n",space.device().safe_pc(),data,offset);
break;
}
}
static READ16_HANDLER( x68k_sysport_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
int ret = 0;
switch(offset)
{
@@ -1284,7 +1284,7 @@ static READ16_HANDLER( x68k_sysport_r )
#ifdef UNUSED_FUNCTION
static READ16_HANDLER( x68k_mfp_r )
{
- device_t *x68k_mfp = space->machine().device(MC68901_TAG);
+ device_t *x68k_mfp = space.machine().device(MC68901_TAG);
return mc68901_register_r(x68k_mfp, offset);
}
@@ -1292,11 +1292,11 @@ static READ16_HANDLER( x68k_mfp_r )
static READ16_HANDLER( x68k_mfp_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
// Initial settings indicate that IRQs are generated for FM (YM2151), Receive buffer error or full,
// MFP Timer C, and the power switch
-// logerror("MFP: [%08x] Reading offset %i\n",space->device().safe_pc(),offset);
+// logerror("MFP: [%08x] Reading offset %i\n",space.device().safe_pc(),offset);
switch(offset)
{
#if 0
@@ -1310,7 +1310,7 @@ static READ16_HANDLER( x68k_mfp_r )
// ret |= 0x08; // FM IRQ signal
if(machine.primary_screen->hpos() > state->m_crtc.width - 32)
ret |= 0x80; // Hsync signal
-// logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",space->device().safe_pc(),offset,ret);
+// logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",space.device().safe_pc(),offset,ret);
return ret; // bit 5 is always 1
case 3:
return state->m_mfp.iera;
@@ -1350,14 +1350,14 @@ static READ16_HANDLER( x68k_mfp_r )
case 23:
return x68k_keyboard_pop_scancode(state);
default:
- if (ACCESSING_BITS_0_7) return state->m_mfpdev->read(*space, offset);
+ if (ACCESSING_BITS_0_7) return state->m_mfpdev->read(space, offset);
}
return 0xffff;
}
static WRITE16_HANDLER( x68k_mfp_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* For the Interrupt registers, the bits are set out as such:
Reg A - bit 7: GPIP7 (HSync)
@@ -1477,11 +1477,11 @@ static WRITE16_HANDLER( x68k_mfp_w )
// Keyboard control command.
state->m_mfp.usart.send_buffer = data;
x68k_keyboard_ctrl_w(state, data);
-// logerror("MFP: [%08x] USART Sent data %04x\n",space->device().safe_pc(),data);
+// logerror("MFP: [%08x] USART Sent data %04x\n",space.device().safe_pc(),data);
}
break;
default:
- if (ACCESSING_BITS_0_7) state->m_mfpdev->write(*space, offset, data & 0xff);
+ if (ACCESSING_BITS_0_7) state->m_mfpdev->write(space, offset, data & 0xff);
return;
}
}
@@ -1489,28 +1489,28 @@ static WRITE16_HANDLER( x68k_mfp_w )
static WRITE16_HANDLER( x68k_ppi_w )
{
- i8255_device *ppi = space->machine().device<i8255_device>("ppi8255");
- ppi->write(*space,offset & 0x03,data);
+ i8255_device *ppi = space.machine().device<i8255_device>("ppi8255");
+ ppi->write(space,offset & 0x03,data);
}
static READ16_HANDLER( x68k_ppi_r )
{
- i8255_device *ppi = space->machine().device<i8255_device>("ppi8255");
- return ppi->read(*space,offset & 0x03);
+ i8255_device *ppi = space.machine().device<i8255_device>("ppi8255");
+ return ppi->read(space,offset & 0x03);
}
static READ16_HANDLER( x68k_rtc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
- return state->m_rtc->read(*space, offset);
+ return state->m_rtc->read(space, offset);
}
static WRITE16_HANDLER( x68k_rtc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
- state->m_rtc->write(*space, offset, data);
+ state->m_rtc->write(space, offset, data);
}
static WRITE_LINE_DEVICE_HANDLER( x68k_rtc_alarm_irq )
@@ -1540,7 +1540,7 @@ static WRITE_LINE_DEVICE_HANDLER( x68k_rtc_alarm_irq )
static WRITE16_HANDLER( x68k_sram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(state->m_sysport.sram_writeprotect == 0x31)
{
@@ -1550,12 +1550,12 @@ static WRITE16_HANDLER( x68k_sram_w )
static READ16_HANDLER( x68k_sram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
// HACKS!
// if(offset == 0x5a/2) // 0x5a should be 0 if no SASI HDs are present.
// return 0x0000;
if(offset == 0x08/2)
- return space->machine().device<ram_device>(RAM_TAG)->size() >> 16; // RAM size
+ return space.machine().device<ram_device>(RAM_TAG)->size() >> 16; // RAM size
#if 0
if(offset == 0x46/2)
return 0x0024;
@@ -1569,9 +1569,9 @@ static READ16_HANDLER( x68k_sram_r )
static READ32_HANDLER( x68k_sram32_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(offset == 0x08/4)
- return (space->machine().device<ram_device>(RAM_TAG)->size() & 0xffff0000); // RAM size
+ return (space.machine().device<ram_device>(RAM_TAG)->size() & 0xffff0000); // RAM size
#if 0
if(offset == 0x46/2)
return 0x0024;
@@ -1585,7 +1585,7 @@ static READ32_HANDLER( x68k_sram32_r )
static WRITE32_HANDLER( x68k_sram32_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(state->m_sysport.sram_writeprotect == 0x31)
{
COMBINE_DATA(state->m_nvram32 + offset);
@@ -1594,13 +1594,13 @@ static WRITE32_HANDLER( x68k_sram32_w )
static WRITE16_HANDLER( x68k_vid_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
int val;
if(offset < 0x100) // Graphic layer palette
{
COMBINE_DATA(state->m_video.gfx_pal+offset);
val = state->m_video.gfx_pal[offset];
- palette_set_color_rgb(space->machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
+ palette_set_color_rgb(space.machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
return;
}
@@ -1608,7 +1608,7 @@ static WRITE16_HANDLER( x68k_vid_w )
{
COMBINE_DATA(state->m_video.text_pal+(offset-0x100));
val = state->m_video.text_pal[offset-0x100];
- palette_set_color_rgb(space->machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
+ palette_set_color_rgb(space.machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
return;
}
@@ -1649,7 +1649,7 @@ static WRITE16_HANDLER( x68k_vid_w )
static READ16_HANDLER( x68k_vid_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(offset < 0x100)
return state->m_video.gfx_pal[offset];
@@ -1709,77 +1709,77 @@ static TIMER_CALLBACK(x68k_bus_error)
static READ16_HANDLER( x68k_rom0_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location contains the address of some expansion device ROM, if no ROM exists,
then access causes a bus error */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
}
return 0xff;
}
static WRITE16_HANDLER( x68k_rom0_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location contains the address of some expansion device ROM, if no ROM exists,
then access causes a bus error */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
}
}
static READ16_HANDLER( x68k_emptyram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location is unused RAM, access here causes a bus error
Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
}
return 0xff;
}
static WRITE16_HANDLER( x68k_emptyram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location is unused RAM, access here causes a bus error
Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
}
}
static READ16_HANDLER( x68k_exp_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* These are expansion devices, if not present, they cause a bus error */
if(state->ioport("options")->read() & 0x02)
{
@@ -1788,7 +1788,7 @@ static READ16_HANDLER( x68k_exp_r )
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
// machine.device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
}
return 0xffff;
@@ -1796,7 +1796,7 @@ static READ16_HANDLER( x68k_exp_r )
static WRITE16_HANDLER( x68k_exp_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* These are expansion devices, if not present, they cause a bus error */
if(state->ioport("options")->read() & 0x02)
{
@@ -1805,7 +1805,7 @@ static WRITE16_HANDLER( x68k_exp_w )
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
// machine.device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
}
}
@@ -2622,21 +2622,21 @@ MACHINE_RESET_MEMBER(x68k_state,x68000)
MACHINE_START_MEMBER(x68k_state,x68000)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Install RAM handlers */
m_spriteram = (UINT16*)(*memregion("user1"));
- space->install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_r));
- space->install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_w));
- space->install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
+ space.install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_r));
+ space.install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_w));
+ space.install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
- space->install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_r));
- space->install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_w));
+ space.install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_r));
+ space.install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_w));
membank("bank2")->set_base(m_gvram16); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_r));
- space->install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_w));
+ space.install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_r));
+ space.install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_w));
membank("bank3")->set_base(m_tvram16); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_r));
- space->install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_w));
+ space.install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_r));
+ space.install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_w));
membank("bank4")->set_base(m_nvram16); // so that code in SRAM is executable, there is an option for booting from SRAM
// start keyboard timer
@@ -2652,21 +2652,21 @@ MACHINE_START_MEMBER(x68k_state,x68000)
MACHINE_START_MEMBER(x68k_state,x68030)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Install RAM handlers */
m_spriteram = (UINT16*)(*memregion("user1"));
- space->install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_r),0xffffffff);
- space->install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_w),0xffffffff);
- space->install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
+ space.install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_r),0xffffffff);
+ space.install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_w),0xffffffff);
+ space.install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
- space->install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_r));
- space->install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_w));
+ space.install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_r));
+ space.install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_w));
membank("bank2")->set_base(m_gvram32); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_r));
- space->install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_w));
+ space.install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_r));
+ space.install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_w));
membank("bank3")->set_base(m_tvram32); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_r));
- space->install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_w));
+ space.install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_r));
+ space.install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_w));
membank("bank4")->set_base(m_nvram32); // so that code in SRAM is executable, there is an option for booting from SRAM
// start keyboard timer
diff --git a/src/mess/formats/ace_ace.c b/src/mess/formats/ace_ace.c
index 50270920112..e89e680f5cb 100644
--- a/src/mess/formats/ace_ace.c
+++ b/src/mess/formats/ace_ace.c
@@ -27,7 +27,7 @@ SNAPSHOT_LOAD( ace )
{
cpu_device *cpu = image.device().machine().firstcpu;
UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base();
- address_space *space = cpu->space(AS_PROGRAM);
+ address_space &space = *cpu->space(AS_PROGRAM);
unsigned char ace_repeat, ace_byte, loop;
int done=0, ace_index=0x2000;
@@ -108,7 +108,7 @@ SNAPSHOT_LOAD( ace )
/* Copy data to the address space */
for (ace_index = 0x2000; ace_index < 0x8000; ace_index++)
- space->write_byte(ace_index, RAM[ace_index]);
+ space.write_byte(ace_index, RAM[ace_index]);
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/formats/cbm_snqk.c b/src/mess/formats/cbm_snqk.c
index 76ad3cfe76c..a71d52ce45a 100644
--- a/src/mess/formats/cbm_snqk.c
+++ b/src/mess/formats/cbm_snqk.c
@@ -30,7 +30,7 @@ static int general_cbm_loadsnap( device_image_interface &image, const char *file
UINT32 bytesread;
UINT16 address = 0;
int i;
- address_space *space = image.device().machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *image.device().machine().firstcpu->space(AS_PROGRAM);
if (!file_type)
goto error;
@@ -79,7 +79,7 @@ static int general_cbm_loadsnap( device_image_interface &image, const char *file
goto error;
for (i = 0; i < snapshot_size; i++)
- space->write_byte(address + i + offset, data[i]);
+ space.write_byte(address + i + offset, data[i]);
cbm_sethiaddress(image.device().machine(), address + snapshot_size);
free(data);
@@ -93,14 +93,14 @@ error:
static void cbm_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
-
- space->write_byte(0x31, hiaddress & 0xff);
- space->write_byte(0x2f, hiaddress & 0xff);
- space->write_byte(0x2d, hiaddress & 0xff);
- space->write_byte(0x32, hiaddress >> 8);
- space->write_byte(0x30, hiaddress >> 8);
- space->write_byte(0x2e, hiaddress >> 8);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
+
+ space.write_byte(0x31, hiaddress & 0xff);
+ space.write_byte(0x2f, hiaddress & 0xff);
+ space.write_byte(0x2d, hiaddress & 0xff);
+ space.write_byte(0x32, hiaddress >> 8);
+ space.write_byte(0x30, hiaddress >> 8);
+ space.write_byte(0x2e, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_c16 )
@@ -120,14 +120,14 @@ QUICKLOAD_LOAD( cbm_vc20 )
static void cbm_pet_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
-
- space->write_byte(0x2e, hiaddress & 0xff);
- space->write_byte(0x2c, hiaddress & 0xff);
- space->write_byte(0x2a, hiaddress & 0xff);
- space->write_byte(0x2f, hiaddress >> 8);
- space->write_byte(0x2d, hiaddress >> 8);
- space->write_byte(0x2b, hiaddress >> 8);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
+
+ space.write_byte(0x2e, hiaddress & 0xff);
+ space.write_byte(0x2c, hiaddress & 0xff);
+ space.write_byte(0x2a, hiaddress & 0xff);
+ space.write_byte(0x2f, hiaddress >> 8);
+ space.write_byte(0x2d, hiaddress >> 8);
+ space.write_byte(0x2b, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_pet )
@@ -137,14 +137,14 @@ QUICKLOAD_LOAD( cbm_pet )
static void cbm_pet1_quick_sethiaddress(running_machine &machine, UINT16 hiaddress)
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
-
- space->write_byte(0x80, hiaddress & 0xff);
- space->write_byte(0x7e, hiaddress & 0xff);
- space->write_byte(0x7c, hiaddress & 0xff);
- space->write_byte(0x81, hiaddress >> 8);
- space->write_byte(0x7f, hiaddress >> 8);
- space->write_byte(0x7d, hiaddress >> 8);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
+
+ space.write_byte(0x80, hiaddress & 0xff);
+ space.write_byte(0x7e, hiaddress & 0xff);
+ space.write_byte(0x7c, hiaddress & 0xff);
+ space.write_byte(0x81, hiaddress >> 8);
+ space.write_byte(0x7f, hiaddress >> 8);
+ space.write_byte(0x7d, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_pet1 )
@@ -154,10 +154,10 @@ QUICKLOAD_LOAD( cbm_pet1 )
static void cbmb_quick_sethiaddress(running_machine &machine, UINT16 hiaddress)
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
- space->write_byte(0xf0046, hiaddress & 0xff);
- space->write_byte(0xf0047, hiaddress >> 8);
+ space.write_byte(0xf0046, hiaddress & 0xff);
+ space.write_byte(0xf0047, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbmb )
@@ -172,10 +172,10 @@ QUICKLOAD_LOAD( p500 )
static void cbm_c65_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
- space->write_byte(0x82, hiaddress & 0xff);
- space->write_byte(0x83, hiaddress >> 8);
+ space.write_byte(0x82, hiaddress & 0xff);
+ space.write_byte(0x83, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_c65 )
diff --git a/src/mess/formats/m65_snqk.c b/src/mess/formats/m65_snqk.c
index 8c2dcac0cd4..7103ec24a70 100644
--- a/src/mess/formats/m65_snqk.c
+++ b/src/mess/formats/m65_snqk.c
@@ -219,7 +219,7 @@ static void microtan_snapshot_copy(running_machine &machine, UINT8 *snapshot_buf
{
microtan_state *state = machine.driver_data<microtan_state>();
UINT8 *RAM = state->memregion("maincpu")->base();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
via6522_device *via_1 = machine.device<via6522_device>("via6522_1");
device_t *ay8910 = machine.device("ay8910.1");
@@ -278,21 +278,21 @@ static void microtan_snapshot_copy(running_machine &machine, UINT8 *snapshot_buf
/* first set of VIA6522 registers */
for (i = 0; i < 16; i++ )
- via_0->write(*space, i, snapshot_buff[base++]);
+ via_0->write(space, i, snapshot_buff[base++]);
/* second set of VIA6522 registers */
for (i = 0; i < 16; i++ )
- via_1->write(*space, i, snapshot_buff[base++]);
+ via_1->write(space, i, snapshot_buff[base++]);
/* microtan IO bff0-bfff */
for (i = 0; i < 16; i++ )
{
RAM[0xbff0+i] = snapshot_buff[base++];
if (i < 4)
- state->microtan_bffx_w(*space, i, RAM[0xbff0+i]);
+ state->microtan_bffx_w(space, i, RAM[0xbff0+i]);
}
- state->microtan_sound_w(*space, 0, snapshot_buff[base++]);
+ state->microtan_sound_w(space, 0, snapshot_buff[base++]);
state->m_chunky_graphics = snapshot_buff[base++];
/* first set of AY8910 registers */
diff --git a/src/mess/formats/spec_snqk.c b/src/mess/formats/spec_snqk.c
index a80f10eb866..3368cfb638c 100644
--- a/src/mess/formats/spec_snqk.c
+++ b/src/mess/formats/spec_snqk.c
@@ -320,7 +320,7 @@ void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
UINT16 start, size, data, status;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (snapsize == SP_NEW_SIZE_16K || snapsize == SP_NEW_SIZE_48K)
{
@@ -415,7 +415,7 @@ void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", size, start);
for (i = 0; i < size; i++)
- space->write_byte(start + i, snapdata[SP_OFFSET + SP_NEW_HDR + i]);
+ space.write_byte(start + i, snapdata[SP_OFFSET + SP_NEW_HDR + i]);
/* Set border color */
data = snapdata[SP_OFFSET + 34] & 0x07;
@@ -520,7 +520,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data, addr;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if ((snapsize != SNA48_SIZE) && (state->m_port_7ffd_data == -1))
{
@@ -606,7 +606,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
/* Get PC from stack */
addr = cpu->state().state_int(Z80_SP);
@@ -616,12 +616,12 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
else
logerror("Fetching PC from the stack at SP:%04X\n", addr);
- data = (space->read_byte(addr + 1) << 8) | space->read_byte(addr + 0);
+ data = (space.read_byte(addr + 1) << 8) | space.read_byte(addr + 0);
LOAD_REG(cpu, Z80_PC, data);
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
#endif
addr += 2;
@@ -651,7 +651,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
logerror("Loading bank 2 from offset:0401B\n");
logerror("Loading bank %d from offset:0801B\n", snapdata[SNA128_OFFSET + 2] & 0x07);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
bank_offset = SNA48_SIZE + SNA128_HDR;
for (i = 0; i < 8; i++)
@@ -663,7 +663,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
state->m_port_7ffd_data += i;
spectrum_update_paging(machine);
for (j = 0; j < SPECTRUM_BANK; j++)
- space->write_byte(j + 3*SPECTRUM_BANK, snapdata[bank_offset + j]);
+ space.write_byte(j + 3*SPECTRUM_BANK, snapdata[bank_offset + j]);
bank_offset += SPECTRUM_BANK;
}
}
@@ -739,7 +739,7 @@ void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[ACH_OFFSET + 0] << 8) | snapdata[ACH_OFFSET + 4];
LOAD_REG(cpu, Z80_AF, data);
@@ -804,7 +804,7 @@ void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[ACH_HDR + SPECTRUM_BANK + i]);
+ space.write_byte(BASE_RAM + i, snapdata[ACH_HDR + SPECTRUM_BANK + i]);
/* Set border color */
data = snapdata[ACH_OFFSET + 156] & 0x07;
@@ -872,7 +872,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 addr, data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = snapdata[PRG_OFFSET + 0];
if (data != 0x05)
@@ -915,7 +915,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[PRG_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[PRG_HDR + i]);
addr = (snapdata[PRG_OFFSET + 241] << 8) | snapdata[PRG_OFFSET + 240];
if (addr < BASE_RAM || addr > 4*SPECTRUM_BANK - 6)
@@ -923,7 +923,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
else
logerror("Fetching registers IFF1/2, R, AF and PC from the stack at SP:%04X\n", addr);
- data = space->read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
+ data = space.read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
LOAD_REG(cpu, Z80_IFF1, BIT(data, 2));
LOAD_REG(cpu, Z80_IFF2, BIT(data, 2));
@@ -931,22 +931,22 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr);
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
- data = space->read_byte(addr + 1);
+ data = space.read_byte(addr + 1);
LOAD_REG(cpu, Z80_R, data);
- data = (space->read_byte(addr + 3) << 8) | space->read_byte(addr + 2);
+ data = (space.read_byte(addr + 3) << 8) | space.read_byte(addr + 2);
LOAD_REG(cpu, Z80_AF, data);
- data = (space->read_byte(addr + 5) << 8) | space->read_byte(addr + 4);
+ data = (space.read_byte(addr + 5) << 8) | space.read_byte(addr + 4);
LOAD_REG(cpu, Z80_PC, data);
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
- space->write_byte(addr + 2, 0);
- space->write_byte(addr + 3, 0);
- space->write_byte(addr + 4, 0);
- space->write_byte(addr + 5, 0);
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 2, 0);
+ space.write_byte(addr + 3, 0);
+ space.write_byte(addr + 4, 0);
+ space.write_byte(addr + 5, 0);
#endif
addr += 6;
@@ -954,7 +954,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
cpu->state().set_state_int(Z80_SP, addr);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1042,7 +1042,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
UINT16 addr = 0, data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[PLUSD_OFFSET + 15] << 8) | snapdata[PLUSD_OFFSET + 14];
LOAD_REG(cpu, Z80_BC, data);
@@ -1085,7 +1085,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[PLUSD48_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[PLUSD48_HDR + i]);
}
else
{
@@ -1111,7 +1111,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
};
logerror("Loading bank %d from offset:%05X\n", i, PLUSD128_HDR + i*SPECTRUM_BANK);
for (j = 0; j < SPECTRUM_BANK; j++)
- space->write_byte(j + addr, snapdata[j + PLUSD128_HDR + i*SPECTRUM_BANK]);
+ space.write_byte(j + addr, snapdata[j + PLUSD128_HDR + i*SPECTRUM_BANK]);
}
state->m_port_7ffd_data = snapdata[PLUSD_OFFSET + 22];
logerror ("Port 7FFD:%02X\n", state->m_port_7ffd_data);
@@ -1125,7 +1125,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
else
logerror("Fetching registers IFF1/2, R, AF and PC from the stack at SP:%04X\n", addr);
- data = space->read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
+ data = space.read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
LOAD_REG(cpu, Z80_IFF1, BIT(data, 2));
LOAD_REG(cpu, Z80_IFF2, BIT(data, 2));
@@ -1133,22 +1133,22 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr);
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
- data = space->read_byte(addr + 1);
+ data = space.read_byte(addr + 1);
LOAD_REG(cpu, Z80_R, data);
- data = (space->read_byte(addr + 3) << 8) | space->read_byte(addr + 2);
+ data = (space.read_byte(addr + 3) << 8) | space.read_byte(addr + 2);
LOAD_REG(cpu, Z80_AF, data);
- data = (space->read_byte(addr + 5) << 8) | space->read_byte(addr + 4);
+ data = (space.read_byte(addr + 5) << 8) | space.read_byte(addr + 4);
LOAD_REG(cpu, Z80_PC, data);
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
- space->write_byte(addr + 2, 0);
- space->write_byte(addr + 3, 0);
- space->write_byte(addr + 4, 0);
- space->write_byte(addr + 5, 0);
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 2, 0);
+ space.write_byte(addr + 3, 0);
+ space.write_byte(addr + 4, 0);
+ space.write_byte(addr + 5, 0);
#endif
addr += 6;
@@ -1156,7 +1156,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
cpu->state().set_state_int(Z80_SP, addr);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1210,7 +1210,7 @@ void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SEM_OFFSET + 1] << 8) | snapdata[SEM_OFFSET + 0];
LOAD_REG(cpu, Z80_AF, data);
@@ -1273,10 +1273,10 @@ void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SEM_SIGNATURE + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SEM_SIGNATURE + i]);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1329,7 +1329,7 @@ void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SIT_OFFSET + 7] << 8) | snapdata[SIT_OFFSET + 6];
LOAD_REG(cpu, Z80_AF, data);
@@ -1392,7 +1392,7 @@ void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
logerror("Skipping the 16K ROM dump at offset:%04X\n", SIT_OFFSET + 28);
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SIT_HDR + SPECTRUM_BANK + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SIT_HDR + SPECTRUM_BANK + i]);
/* Set border color */
data = snapdata[SIT_OFFSET + 27] & 0x07;
@@ -1459,7 +1459,7 @@ void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
UINT16 data, mode;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
logerror("Skipping last 132 bytes of the 16K ROM dump at offset:0000\n");
@@ -1536,10 +1536,10 @@ void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[132 + i]);
+ space.write_byte(BASE_RAM + i, snapdata[132 + i]);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1591,7 +1591,7 @@ void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SNP_OFFSET + 1] << 8) | snapdata[SNP_OFFSET + 0];
LOAD_REG(cpu, Z80_AF, data);
@@ -1654,7 +1654,7 @@ void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[i]);
+ space.write_byte(BASE_RAM + i, snapdata[i]);
/* Set border color */
data = snapdata[SNP_OFFSET + 2] & 0x07;
@@ -1768,7 +1768,7 @@ static void spectrum_snx_decompress_block(running_machine &machine, UINT8 *sourc
{
UINT8 counthi, countlo, compress, fill;
UINT16 block = 0, count, i, j, numbytes;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
i = SNX_HDR - 1;
numbytes = 0;
@@ -1798,7 +1798,7 @@ static void spectrum_snx_decompress_block(running_machine &machine, UINT8 *sourc
fill = source[++i];
logerror("Dest:%04X Filler:%02X\n", BASE_RAM + numbytes, fill);
for(j = 0; j < count; j++)
- space->write_byte(BASE_RAM + numbytes + j, fill);
+ space.write_byte(BASE_RAM + numbytes + j, fill);
numbytes += count;
}
else
@@ -1806,7 +1806,7 @@ static void spectrum_snx_decompress_block(running_machine &machine, UINT8 *sourc
logerror("Dest:%04X\n", BASE_RAM + numbytes);
j = 0;
while (j < count)
- space->write_byte(BASE_RAM + numbytes + j++, source[++i]);
+ space.write_byte(BASE_RAM + numbytes + j++, source[++i]);
numbytes += count;
}
}
@@ -1818,7 +1818,7 @@ void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data, addr;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SNX_OFFSET + 4] << 8) | snapdata[SNX_OFFSET + 5];
if (data != 0x25)
@@ -1893,11 +1893,11 @@ void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
else
logerror("Fetching PC from the stack at SP:%04X\n", addr);
- LOAD_REG(cpu, Z80_PC, (space->read_byte(addr + 1) << 8) | space->read_byte(addr + 0));
+ LOAD_REG(cpu, Z80_PC, (space.read_byte(addr + 1) << 8) | space.read_byte(addr + 0));
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
#endif
addr += 2;
@@ -1972,7 +1972,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 addr, data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_port_7ffd_data == -1)
{
@@ -2063,7 +2063,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
};
logerror("Loading bank %d from offset:%05X\n", banks[i], FRZ_HDR + i*SPECTRUM_BANK);
for (j = 0; j < SPECTRUM_BANK; j++)
- space->write_byte(j + addr, snapdata[j + FRZ_HDR + i*SPECTRUM_BANK]);
+ space.write_byte(j + addr, snapdata[j + FRZ_HDR + i*SPECTRUM_BANK]);
}
state->m_port_7ffd_data = snapdata[FRZ_OFFSET + 1];
logerror ("Port 7FFD:%02X\n", state->m_port_7ffd_data);
@@ -2071,7 +2071,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
spectrum_update_paging(machine);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -2083,7 +2083,7 @@ static void spectrum_z80_decompress_block(running_machine &machine,UINT8 *source
{
UINT8 ch;
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
do
{
@@ -2115,14 +2115,14 @@ static void spectrum_z80_decompress_block(running_machine &machine,UINT8 *source
for (i = 0; i < count; i++)
{
- space->write_byte(dest, data);
+ space.write_byte(dest, data);
dest++;
}
}
else
{
/* single 0x0ed */
- space->write_byte(dest, ch);
+ space.write_byte(dest, ch);
dest++;
source++;
size--;
@@ -2131,7 +2131,7 @@ static void spectrum_z80_decompress_block(running_machine &machine,UINT8 *source
else
{
/* not 0x0ed */
- space->write_byte(dest, ch);
+ space.write_byte(dest, ch);
dest++;
source++;
size--;
@@ -2194,7 +2194,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
int i;
UINT8 lo, hi, data;
SPECTRUM_Z80_SNAPSHOT_TYPE z80_type;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
z80_type = spectrum_identify_z80(snapdata, snapsize);
@@ -2331,7 +2331,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
{
logerror("Not compressed\n"); /* not compressed */
for (i = 0; i < 49152; i++)
- space->write_byte(i + 16384, snapdata[30 + i]);
+ space.write_byte(i + 16384, snapdata[30 + i]);
}
else
{
@@ -2412,7 +2412,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* not compressed */
for (i = 0; i < 16384; i++)
- space->write_byte(i + Dest, pSource[i]);
+ space.write_byte(i + Dest, pSource[i]);
}
else
{
@@ -2520,10 +2520,10 @@ error:
void spectrum_setup_scr(running_machine &machine, UINT8 *quickdata, UINT32 quicksize)
{
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
for (i = 0; i < quicksize; i++)
- space->write_byte(i + BASE_RAM, quickdata[i]);
+ space.write_byte(i + BASE_RAM, quickdata[i]);
log_quickload(quicksize == SCR_SIZE ? "SCREEN$" : "SCREEN$ (Mono)", BASE_RAM, quicksize, 0, EXEC_NA);
}
@@ -2560,16 +2560,16 @@ void spectrum_setup_raw(running_machine &machine, UINT8 *quickdata, UINT32 quick
UINT8 data;
UINT16 start, len;
spectrum_state *state = machine.driver_data<spectrum_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
start = (quickdata[RAW_OFFSET + 4] << 8) | quickdata[RAW_OFFSET + 3];
len = (quickdata[RAW_OFFSET + 2] << 8) | quickdata[RAW_OFFSET + 1];
for (i = 0; i < len; i++)
- space->write_byte(i + start, quickdata[i + RAW_HDR]);
+ space.write_byte(i + start, quickdata[i + RAW_HDR]);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
diff --git a/src/mess/formats/z80bin.c b/src/mess/formats/z80bin.c
index 363fdaad98d..bbce778f05b 100644
--- a/src/mess/formats/z80bin.c
+++ b/src/mess/formats/z80bin.c
@@ -122,18 +122,18 @@ QUICKLOAD_LOAD( mbee_z80bin )
autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
device_t *cpu = image.device().machine().device("maincpu");
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->write_word(0xa6, execute_address); /* fix the EXEC command */
+ space.write_word(0xa6, execute_address); /* fix the EXEC command */
if (autorun)
{
- space->write_word(0xa2, execute_address); /* fix warm-start vector to get around some copy-protections */
+ space.write_word(0xa2, execute_address); /* fix warm-start vector to get around some copy-protections */
cpu->state().set_pc(execute_address);
}
else
{
- space->write_word(0xa2, 0x8517);
+ space.write_word(0xa2, 0x8517);
}
}
@@ -158,9 +158,9 @@ QUICKLOAD_LOAD( sorcerer )
/* check to see if autorun is on (I hate how this works) */
autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
- if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (space->read_byte(0xdffa) != 0xc3))
+ if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (space.read_byte(0xdffa) != 0xc3))
return IMAGE_INIT_FAIL; /* can't run a program if the cartridge isn't in */
/* Since Exidy Basic is by Microsoft, it needs some preprocessing before it can be run.
@@ -182,17 +182,17 @@ QUICKLOAD_LOAD( sorcerer )
};
for (i = 0; i < ARRAY_LENGTH(data); i++)
- space->write_byte(0xf01f + i, data[i]);
+ space.write_byte(0xf01f + i, data[i]);
if (!autorun)
- space->write_word(0xf028,0xc3dd);
+ space.write_word(0xf028,0xc3dd);
/* tell BASIC where program ends */
- space->write_byte(0x1b7, end_address & 0xff);
- space->write_byte(0x1b8, (end_address >> 8) & 0xff);
+ space.write_byte(0x1b7, end_address & 0xff);
+ space.write_byte(0x1b8, (end_address >> 8) & 0xff);
if ((execute_address != 0xc858) && autorun)
- space->write_word(0xf028, execute_address);
+ space.write_word(0xf028, execute_address);
image.device().machine().device("maincpu")->state().set_pc(0xf01f);
}
diff --git a/src/mess/includes/samcoupe.h b/src/mess/includes/samcoupe.h
index 9954ee10b01..1992772f7f5 100644
--- a/src/mess/includes/samcoupe.h
+++ b/src/mess/includes/samcoupe.h
@@ -92,7 +92,7 @@ void samcoupe_irq(device_t *device, UINT8 src);
/*----------- defined in machine/samcoupe.c -----------*/
-void samcoupe_update_memory(address_space *space);
+void samcoupe_update_memory(address_space &space);
UINT8 samcoupe_mouse_r(running_machine &machine);
diff --git a/src/mess/machine/990_hd.c b/src/mess/machine/990_hd.c
index 495829c28d0..2afbe6c0977 100644
--- a/src/mess/machine/990_hd.c
+++ b/src/mess/machine/990_hd.c
@@ -1025,11 +1025,11 @@ WRITE16_HANDLER(ti990_hdc_w)
hdc.w[offset] = (hdc.w[offset] & ((~w_mask[offset]) | mem_mask)) | (data & w_mask[offset] & ~mem_mask);
if ((offset == 0) || (offset == 7))
- update_interrupt(space->machine());
+ update_interrupt(space.machine());
if ((offset == 7) && (old_data & w7_idle) && ! (data & w7_idle))
{ /* idle has been cleared: start command execution */
- execute_command(space->machine());
+ execute_command(space.machine());
}
}
}
diff --git a/src/mess/machine/a7800.c b/src/mess/machine/a7800.c
index 0263a1bdf5f..3f34c96d9be 100644
--- a/src/mess/machine/a7800.c
+++ b/src/mess/machine/a7800.c
@@ -72,7 +72,7 @@ const riot6532_interface a7800_r6532_interface =
static void a7800_driver_init(running_machine &machine, int ispal, int lines)
{
a7800_state *state = machine.driver_data<a7800_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
state->m_ROM = state->memregion("maincpu")->base();
state->m_ispal = ispal;
state->m_lines = lines;
@@ -85,9 +85,9 @@ static void a7800_driver_init(running_machine &machine, int ispal, int lines)
state->membank("bank7")->set_base(&state->m_ROM[0x2000]); /* MAINRAM */
/* Brutal hack put in as a consequence of new memory system; fix this */
- space->install_readwrite_bank(0x0480, 0x04FF,"bank10");
+ space.install_readwrite_bank(0x0480, 0x04FF,"bank10");
state->membank("bank10")->set_base(state->m_ROM + 0x0480);
- space->install_readwrite_bank(0x1800, 0x27FF, "bank11");
+ space.install_readwrite_bank(0x1800, 0x27FF, "bank11");
state->membank("bank11")->set_base(state->m_ROM + 0x1800);
}
@@ -107,7 +107,7 @@ DRIVER_INIT_MEMBER(a7800_state,a7800_pal)
void a7800_state::machine_reset()
{
UINT8 *memory;
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_ctrl_lock = 0;
m_ctrl_reg = 0;
@@ -124,7 +124,7 @@ void a7800_state::machine_reset()
if (m_cart_type & 0x01)
{
pokey_device *pokey = machine().device<pokey_device>("pokey");
- space->install_readwrite_handler(0x4000, 0x7FFF, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
+ space.install_readwrite_handler(0x4000, 0x7FFF, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
}
}
diff --git a/src/mess/machine/aim65.c b/src/mess/machine/aim65.c
index 823d0c9bf41..81dd1298767 100644
--- a/src/mess/machine/aim65.c
+++ b/src/mess/machine/aim65.c
@@ -141,10 +141,10 @@ WRITE8_MEMBER( aim65_state::aim65_riot_a_w )
void aim65_state::machine_start()
{
ram_device *ram = machine().device<ram_device>(RAM_TAG);
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Init RAM */
- space->install_ram(0x0000, ram->size() - 1, ram->pointer());
+ space.install_ram(0x0000, ram->size() - 1, ram->pointer());
m_pb_save = 0;
}
diff --git a/src/mess/machine/amigacd.c b/src/mess/machine/amigacd.c
index cfdb28bbca6..071692296d0 100644
--- a/src/mess/machine/amigacd.c
+++ b/src/mess/machine/amigacd.c
@@ -82,7 +82,7 @@ static void check_interrupts( running_machine &machine )
return;
/* otherwise, generate the IRQ */
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
static TIMER_CALLBACK(dmac_dma_proc)
@@ -131,7 +131,7 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x20:
{
UINT8 v = dmac_data.istr;
- LOG(( "DMAC: PC=%08x - ISTR Read(%04x)\n", space->device().safe_pc(), dmac_data.istr ));
+ LOG(( "DMAC: PC=%08x - ISTR Read(%04x)\n", space.device().safe_pc(), dmac_data.istr ));
dmac_data.istr &= ~0x0f;
return v;
@@ -140,35 +140,35 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x21:
{
- LOG(( "DMAC: PC=%08x - CNTR Read(%04x)\n", space->device().safe_pc(), dmac_data.cntr ));
+ LOG(( "DMAC: PC=%08x - CNTR Read(%04x)\n", space.device().safe_pc(), dmac_data.cntr ));
return dmac_data.cntr;
}
break;
case 0x40: /* wtc hi */
{
- LOG(( "DMAC: PC=%08x - WTC HI Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - WTC HI Read\n", space.device().safe_pc() ));
return (dmac_data.wtc >> 16);
}
break;
case 0x41: /* wtc lo */
{
- LOG(( "DMAC: PC=%08x - WTC LO Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - WTC LO Read\n", space.device().safe_pc() ));
return dmac_data.wtc;
}
break;
case 0x42: /* acr hi */
{
- LOG(( "DMAC: PC=%08x - ACR HI Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - ACR HI Read\n", space.device().safe_pc() ));
return (dmac_data.acr >> 16);
}
break;
case 0x43: /* acr lo */
{
- LOG(( "DMAC: PC=%08x - ACR LO Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - ACR LO Read\n", space.device().safe_pc() ));
return dmac_data.acr;
}
break;
@@ -176,15 +176,15 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x48: /* wd33c93 SCSI expansion */
case 0x49:
{
- LOG(( "DMAC: PC=%08x - WD33C93 Read(%d)\n", space->device().safe_pc(), offset & 1 ));
+ LOG(( "DMAC: PC=%08x - WD33C93 Read(%d)\n", space.device().safe_pc(), offset & 1 ));
return 0x00; /* Not available without SCSI expansion */
}
break;
case 0x50:
{
- LOG(( "DMAC: PC=%08x - CDROM RESP Read\n", space->device().safe_pc() ));
- return matsucd_response_r(space->machine());
+ LOG(( "DMAC: PC=%08x - CDROM RESP Read\n", space.device().safe_pc() ));
+ return matsucd_response_r(space.machine());
}
break;
@@ -192,7 +192,7 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x52:
case 0x53:
{
- LOG(( "DMAC: PC=%08x - XT IO Read(%d)\n", space->device().safe_pc(), (offset & 3)-1 ));
+ LOG(( "DMAC: PC=%08x - XT IO Read(%d)\n", space.device().safe_pc(), (offset & 3)-1 ));
return 0xff;
}
break;
@@ -214,42 +214,42 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x66:
case 0x67:
{
- device_t *tpi = space->machine().device("tpi6525");
- LOG(( "DMAC: PC=%08x - TPI6525 Read(%d)\n", space->device().safe_pc(), (offset - 0x58) ));
- return tpi6525_r(tpi, *space, offset - 0x58);
+ device_t *tpi = space.machine().device("tpi6525");
+ LOG(( "DMAC: PC=%08x - TPI6525 Read(%d)\n", space.device().safe_pc(), (offset - 0x58) ));
+ return tpi6525_r(tpi, space, offset - 0x58);
}
break;
case 0x70: /* DMA start strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->adjust(attotime::from_msec( CD_SECTOR_TIME ));
}
break;
case 0x71: /* DMA stop strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->reset( );
}
break;
case 0x72: /* Clear IRQ strobe */
{
- LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space.device().safe_pc() ));
dmac_data.istr &= ~ISTR_INT_P;
}
break;
case 0x74: /* Flush strobe */
{
- LOG(( "DMAC: PC=%08x - Flush Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - Flush Strobe\n", space.device().safe_pc() ));
dmac_data.istr |= ISTR_FE_FLG;
}
break;
default:
- logerror( "DMAC-READ: PC=%08x, offset = %02x\n", space->device().safe_pc(), offset );
+ logerror( "DMAC-READ: PC=%08x, offset = %02x\n", space.device().safe_pc(), offset );
break;
}
@@ -264,15 +264,15 @@ static WRITE16_HANDLER( amiga_dmac_w )
{
case 0x21: /* control write */
{
- LOG(( "DMAC: PC=%08x - CNTR Write(%04x)\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - CNTR Write(%04x)\n", space.device().safe_pc(), data ));
dmac_data.cntr = data;
- check_interrupts(space->machine());
+ check_interrupts(space.machine());
}
break;
case 0x40: /* wtc hi */
{
- LOG(( "DMAC: PC=%08x - WTC HI Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - WTC HI Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.wtc &= 0x0000ffff;
dmac_data.wtc |= ((UINT32)data) << 16;
}
@@ -280,7 +280,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x41: /* wtc lo */
{
- LOG(( "DMAC: PC=%08x - WTC LO Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - WTC LO Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.wtc &= 0xffff0000;
dmac_data.wtc |= data;
}
@@ -288,7 +288,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x42: /* acr hi */
{
- LOG(( "DMAC: PC=%08x - ACR HI Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - ACR HI Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.acr &= 0x0000ffff;
dmac_data.acr |= ((UINT32)data) << 16;
}
@@ -296,7 +296,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x43: /* acr lo */
{
- LOG(( "DMAC: PC=%08x - ACR LO Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - ACR LO Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.acr &= 0xffff0000;
dmac_data.acr |= data;
}
@@ -304,7 +304,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x47: /* dawr */
{
- LOG(( "DMAC: PC=%08x - DAWR Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - DAWR Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.dawr = data;
}
break;
@@ -312,15 +312,15 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x48: /* wd33c93 SCSI expansion */
case 0x49:
{
- LOG(( "DMAC: PC=%08x - WD33C93 Write(%d) - data = %04x\n", space->device().safe_pc(), offset & 1, data ));
+ LOG(( "DMAC: PC=%08x - WD33C93 Write(%d) - data = %04x\n", space.device().safe_pc(), offset & 1, data ));
/* Not available without SCSI expansion */
}
break;
case 0x50:
{
- LOG(( "DMAC: PC=%08x - CDROM CMD Write - data = %04x\n", space->device().safe_pc(), data ));
- matsucd_command_w(space->machine(), data );
+ LOG(( "DMAC: PC=%08x - CDROM CMD Write - data = %04x\n", space.device().safe_pc(), data ));
+ matsucd_command_w(space.machine(), data );
}
break;
@@ -341,42 +341,42 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x66:
case 0x67:
{
- device_t *tpi = space->machine().device("tpi6525");
- LOG(( "DMAC: PC=%08x - TPI6525 Write(%d) - data = %04x\n", space->device().safe_pc(), (offset - 0x58), data ));
- tpi6525_w(tpi, *space, offset - 0x58, data);
+ device_t *tpi = space.machine().device("tpi6525");
+ LOG(( "DMAC: PC=%08x - TPI6525 Write(%d) - data = %04x\n", space.device().safe_pc(), (offset - 0x58), data ));
+ tpi6525_w(tpi, space, offset - 0x58, data);
}
break;
case 0x70: /* DMA start strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->adjust(attotime::from_msec( CD_SECTOR_TIME ));
}
break;
case 0x71: /* DMA stop strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->reset( );
}
break;
case 0x72: /* Clear IRQ strobe */
{
- LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space.device().safe_pc() ));
dmac_data.istr &= ~ISTR_INT_P;
}
break;
case 0x74: /* Flush Strobe */
{
- LOG(( "DMAC: PC=%08x - Flush Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - Flush Strobe\n", space.device().safe_pc() ));
dmac_data.istr |= ISTR_FE_FLG;
}
break;
default:
- logerror( "DMAC-WRITE: PC=%08x, offset = %02x, data = %04x\n", space->device().safe_pc(), offset, data );
+ logerror( "DMAC-WRITE: PC=%08x, offset = %02x, data = %04x\n", space.device().safe_pc(), offset, data );
break;
}
}
@@ -389,15 +389,15 @@ static WRITE16_HANDLER( amiga_dmac_w )
static void dmac_install(running_machine &machine, offs_t base)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->install_legacy_read_handler(base, base + 0xFFFF, FUNC(amiga_dmac_r));
- space->install_legacy_write_handler(base, base + 0xFFFF, FUNC(amiga_dmac_w));
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_legacy_read_handler(base, base + 0xFFFF, FUNC(amiga_dmac_r));
+ space.install_legacy_write_handler(base, base + 0xFFFF, FUNC(amiga_dmac_w));
}
static void dmac_uninstall(running_machine &machine, offs_t base)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_readwrite(base, base + 0xFFFF);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space.unmap_readwrite(base, base + 0xFFFF);
}
static const amiga_autoconfig_device dmac_device =
@@ -457,7 +457,7 @@ static TIMER_CALLBACK(tp6525_delayed_irq)
if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 )
{
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
else
{
@@ -474,7 +474,7 @@ static void amigacd_tpi6525_irq_trampoline(device_t *device, int level)
{
if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 )
{
- amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
else
{
diff --git a/src/mess/machine/amigacrt.c b/src/mess/machine/amigacrt.c
index cccaa5f24b5..55bf8e90cf2 100644
--- a/src/mess/machine/amigacrt.c
+++ b/src/mess/machine/amigacrt.c
@@ -112,8 +112,8 @@ static void amiga_ar1_nmi( running_machine &machine )
static WRITE16_HANDLER( amiga_ar1_chipmem_w )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
- int pc = space->device().safe_pc();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
+ int pc = space.device().safe_pc();
/* see if we're inside the AR1 rom */
if ( ((pc >> 16) & 0xff ) != 0xf0 )
@@ -124,7 +124,7 @@ static WRITE16_HANDLER( amiga_ar1_chipmem_w )
{
/* trigger an NMI or spurious irq */
amigacrt.ar1_spurious = (offset == 0x60/2) ? 0 : 1;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(28), FUNC(amiga_ar1_delayed_nmi));
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(28), FUNC(amiga_ar1_delayed_nmi));
}
}
@@ -192,11 +192,11 @@ static void amiga_ar23_freeze( running_machine &machine );
static READ16_HANDLER( amiga_ar23_cia_r )
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
if ( ACCESSING_BITS_0_7 && offset == 2048 && pc >= 0x40 && pc < 0x120 )
{
- amiga_ar23_freeze(space->machine());
+ amiga_ar23_freeze(space.machine());
}
return amiga_cia_r( space, offset, mem_mask );
@@ -206,11 +206,11 @@ static WRITE16_HANDLER( amiga_ar23_mode_w )
{
if ( data & 2 )
{
- space->install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_ar23_cia_r));
+ space.install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_ar23_cia_r));
}
else
{
- space->install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_cia_r));
+ space.install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_cia_r));
}
amigacrt.ar23_mode = (data&0x3);
@@ -221,7 +221,7 @@ static WRITE16_HANDLER( amiga_ar23_mode_w )
static READ16_HANDLER( amiga_ar23_mode_r )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
UINT16 *mem = (UINT16 *)(*state->memregion( "user2" ));
if ( ACCESSING_BITS_0_7 )
@@ -241,7 +241,7 @@ static READ16_HANDLER( amiga_ar23_mode_r )
}
/* overlay disabled, map RAM on 0x000000 */
- space->install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1");
+ space.install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1");
}
}
@@ -250,11 +250,11 @@ static READ16_HANDLER( amiga_ar23_mode_r )
static WRITE16_HANDLER( amiga_ar23_chipmem_w )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
if ( offset == (0x08/2) )
{
if ( amigacrt.ar23_mode & 1 )
- amiga_ar23_freeze(space->machine());
+ amiga_ar23_freeze(space.machine());
}
(*state->m_chip_ram_w)(state, offset * 2, data );
@@ -299,7 +299,7 @@ static void amiga_ar23_nmi( running_machine &machine )
#if 0
static WRITE16_HANDLER( amiga_ar23_custom_w )
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
/* see if we're inside the AR2 rom */
if ( ((pc >> 16) & 0xfe ) != 0x40 )
@@ -320,7 +320,7 @@ static READ16_HANDLER( amiga_ar23_custom_r )
{
UINT16 data = amiga_custom_r( offset, mem_mask );
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
/* see if we're inside the AR2 rom */
if ( ((pc >> 16) & 0xfe ) != 0x40 )
diff --git a/src/mess/machine/amstr_pc.c b/src/mess/machine/amstr_pc.c
index 38aefd9b2cc..27a04dad0f7 100644
--- a/src/mess/machine/amstr_pc.c
+++ b/src/mess/machine/amstr_pc.c
@@ -153,8 +153,8 @@ WRITE8_HANDLER( pc1640_port60_w )
pc1640.port61=data;
if (data==0x30) pc1640.port62=(pc1640.port65&0x10)>>4;
else if (data==0x34) pc1640.port62=pc1640.port65&0xf;
- pit8253_gate2_w(space->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( space->machine(), data & 0x02 );
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
pc_keyb_set_clock(data&0x40);
break;
case 4:
@@ -191,7 +191,7 @@ READ8_HANDLER( pc1640_port60_r )
case 2:
data = pc1640.port62;
- if (pit8253_get_output(space->machine().device("pit8253"), 2))
+ if (pit8253_get_output(space.machine().device("pit8253"), 2))
data |= 0x20;
break;
}
@@ -200,26 +200,26 @@ READ8_HANDLER( pc1640_port60_r )
READ8_HANDLER( pc200_port378_r )
{
- device_t *lpt = space->machine().device("lpt_1");
- UINT8 data = pc_lpt_r(lpt, *space, offset);
+ device_t *lpt = space.machine().device("lpt_1");
+ UINT8 data = pc_lpt_r(lpt, space, offset);
if (offset == 1)
- data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
+ data = (data & ~7) | (space.machine().root_device().ioport("DSW0")->read() & 7);
if (offset == 2)
- data = (data & ~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xc0);
+ data = (data & ~0xe0) | (space.machine().root_device().ioport("DSW0")->read() & 0xc0);
return data;
}
READ8_HANDLER( pc200_port278_r )
{
- device_t *lpt = space->machine().device("lpt_2");
- UINT8 data = pc_lpt_r(lpt, *space, offset);
+ device_t *lpt = space.machine().device("lpt_2");
+ UINT8 data = pc_lpt_r(lpt, space, offset);
if (offset == 1)
- data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
+ data = (data & ~7) | (space.machine().root_device().ioport("DSW0")->read() & 7);
if (offset == 2)
- data = (data & ~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xc0);
+ data = (data & ~0xe0) | (space.machine().root_device().ioport("DSW0")->read() & 0xc0);
return data;
}
@@ -227,23 +227,23 @@ READ8_HANDLER( pc200_port278_r )
READ8_HANDLER( pc1640_port378_r )
{
- device_t *lpt = space->machine().device("lpt_1");
- UINT8 data = pc_lpt_r(lpt, *space, offset);
+ device_t *lpt = space.machine().device("lpt_1");
+ UINT8 data = pc_lpt_r(lpt, space, offset);
if (offset == 1)
- data=(data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
+ data=(data & ~7) | (space.machine().root_device().ioport("DSW0")->read() & 7);
if (offset == 2)
{
switch (pc1640.dipstate)
{
case 0:
- data = (data&~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xe0);
+ data = (data&~0xe0) | (space.machine().root_device().ioport("DSW0")->read() & 0xe0);
break;
case 1:
- data = (data&~0xe0) | ((space->machine().root_device().ioport("DSW0")->read() & 0xe000)>>8);
+ data = (data&~0xe0) | ((space.machine().root_device().ioport("DSW0")->read() & 0xe000)>>8);
break;
case 2:
- data = (data&~0xe0) | ((space->machine().root_device().ioport("DSW0")->read() & 0xe00)>>4);
+ data = (data&~0xe0) | ((space.machine().root_device().ioport("DSW0")->read() & 0xe00)>>4);
break;
}
@@ -254,7 +254,7 @@ READ8_HANDLER( pc1640_port378_r )
READ8_HANDLER( pc1640_port3d0_r )
{
if (offset==0xa) pc1640.dipstate=0;
- return space->read_byte(0x3d0+offset);
+ return space.read_byte(0x3d0+offset);
}
READ8_HANDLER( pc1640_port4278_r )
@@ -273,22 +273,22 @@ READ8_HANDLER( pc1640_port278_r )
READ8_HANDLER( pc1640_mouse_x_r )
{
- return pc1640.mouse.x - space->machine().root_device().ioport("pc_mouse_x")->read();
+ return pc1640.mouse.x - space.machine().root_device().ioport("pc_mouse_x")->read();
}
READ8_HANDLER( pc1640_mouse_y_r )
{
- return pc1640.mouse.y - space->machine().root_device().ioport("pc_mouse_y")->read();
+ return pc1640.mouse.y - space.machine().root_device().ioport("pc_mouse_y")->read();
}
WRITE8_HANDLER( pc1640_mouse_x_w )
{
- pc1640.mouse.x = data + space->machine().root_device().ioport("pc_mouse_x")->read();
+ pc1640.mouse.x = data + space.machine().root_device().ioport("pc_mouse_x")->read();
}
WRITE8_HANDLER( pc1640_mouse_y_w )
{
- pc1640.mouse.y = data + space->machine().root_device().ioport("pc_mouse_y")->read();
+ pc1640.mouse.y = data + space.machine().root_device().ioport("pc_mouse_y")->read();
}
INPUT_PORTS_START( amstrad_keyboard )
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index c32af3c9cad..f682f042217 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -1196,21 +1196,21 @@ static void amstrad_setLowerRom(running_machine &machine)
}
else // CPC+/GX4000
{
- //address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ //address_space &space = *state->m_maincpu->space(AS_PROGRAM);
/* if ( state->m_asic.enabled && ( state->m_asic.rmr2 & 0x18 ) == 0x18 )
{
- space->install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),state));
- space->install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),state));
- space->install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),state));
- space->install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),state));
+ space.install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),state));
+ space.install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),state));
+ space.install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),state));
+ space.install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),state));
}
else
{
- space->install_read_bank(0x4000, 0x5fff, "bank3");
- space->install_read_bank(0x6000, 0x7fff, "bank4");
- space->install_write_bank(0x4000, 0x5fff, "bank11");
- space->install_write_bank(0x6000, 0x7fff, "bank12");
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
+ space.install_write_bank(0x4000, 0x5fff, "bank11");
+ space.install_write_bank(0x6000, 0x7fff, "bank12");
}
*/
if(state->m_AmstradCPC_RamBanks[0] != NULL)
diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c
index 8f37bd314e6..5172a1571a8 100644
--- a/src/mess/machine/apollo.c
+++ b/src/mess/machine/apollo.c
@@ -826,20 +826,20 @@ WRITE8_DEVICE_HANDLER(apollo_ptm_w) {
***************************************************************************/
static DEVICE_RESET( apollo_rtc ) {
- address_space *space = device->machine().device(MAINCPU)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU)->memory().space(AS_PROGRAM);
apollo_state *state = device->machine().driver_data<apollo_state>();
- UINT8 year = state->apollo_rtc_r(*space, 9);
+ UINT8 year = state->apollo_rtc_r(space, 9);
// change year according to configuration settings
if (year < 20 && apollo_config(APOLLO_CONF_DATE_1990))
{
year+=80;
- state->apollo_rtc_w(*space, 9, year);
+ state->apollo_rtc_w(space, 9, year);
}
else if (year >= 80 && !apollo_config(APOLLO_CONF_DATE_1990))
{
year -=80;
- state->apollo_rtc_w(*space, 9, year);
+ state->apollo_rtc_w(space, 9, year);
}
//SLOG1(("reset apollo_rtc year=%d", year));
@@ -872,13 +872,13 @@ READ8_MEMBER(apollo_state::apollo_rtc_r)
static TIMER_CALLBACK( apollo_rtc_timer )
{
apollo_state *state = machine.driver_data<apollo_state>();
- address_space *space = machine.device(MAINCPU)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(MAINCPU)->memory().space(AS_PROGRAM);
// FIXME: reading register 0x0c will clear all interrupt flags
- if ((state->apollo_rtc_r(*space, 0x0c) & 0x80))
+ if ((state->apollo_rtc_r(space, 0x0c) & 0x80))
{
//SLOG2(("apollo_rtc_timer - set_irq_line %d", APOLLO_IRQ_RTC));
- apollo_pic_set_irq_line(&space->device(), APOLLO_IRQ_RTC, 1);
+ apollo_pic_set_irq_line(&space.device(), APOLLO_IRQ_RTC, 1);
}
}
@@ -1343,11 +1343,11 @@ static DEVICE_RESET( apollo_fdc ) {
WRITE8_MEMBER(apollo_state::apollo_fdc_w){
SLOG1(("writing FDC upd765 at offset %X = %02x", offset, data));
- pc_fdc_w(&space, offset, data);
+ pc_fdc_w(space, offset, data);
}
READ8_MEMBER(apollo_state::apollo_fdc_r){
- UINT8 data = pc_fdc_r(&space, offset);
+ UINT8 data = pc_fdc_r(space, offset);
SLOG1(("reading FDC upd765 at offset %X = %02x", offset, data));
return data;
}
diff --git a/src/mess/machine/apple1.c b/src/mess/machine/apple1.c
index a444a672423..afc78e1dbd7 100644
--- a/src/mess/machine/apple1.c
+++ b/src/mess/machine/apple1.c
@@ -143,9 +143,9 @@ static const UINT8 apple1_control_keymap[] =
DRIVER_INIT_MEMBER(apple1_state,apple1)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Set up the handlers for MESS's dynamically-sized RAM. */
- space->install_readwrite_bank(0x0000, machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ space.install_readwrite_bank(0x0000, machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
/* Poll the keyboard input ports periodically. These include both
diff --git a/src/mess/machine/apple2.c b/src/mess/machine/apple2.c
index b9cec454571..53f07a16e4d 100644
--- a/src/mess/machine/apple2.c
+++ b/src/mess/machine/apple2.c
@@ -59,7 +59,7 @@ void apple2_setup_memory(running_machine &machine, const apple2_memmap_config *c
void apple2_update_memory(running_machine &machine)
{
apple2_state *state = machine.driver_data<apple2_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int i, bank;
char rbank[10], wbank[10];
int full_update = 0;
@@ -166,15 +166,15 @@ void apple2_update_memory(running_machine &machine)
/* install the actual handlers */
if (begin <= end_r) {
if (rh) {
- space->install_read_handler(begin, end_r, *rh);
+ space.install_read_handler(begin, end_r, *rh);
} else {
- space->install_read_bank(begin, end_r, rbank);
+ space.install_read_bank(begin, end_r, rbank);
}
}
/* did we 'go past the end?' */
if (end_r < state->m_mem_config.memmap[i].end)
- space->nop_read(end_r + 1, state->m_mem_config.memmap[i].end);
+ space.nop_read(end_r + 1, state->m_mem_config.memmap[i].end);
/* set the memory bank */
if (rbase)
@@ -254,19 +254,19 @@ void apple2_update_memory(running_machine &machine)
/* install the actual handlers */
if (begin <= end_w) {
if (wh) {
- space->install_write_handler(begin, end_w, *wh);
+ space.install_write_handler(begin, end_w, *wh);
} else {
if (wh_nop) {
- space->nop_write(begin, end_w);
+ space.nop_write(begin, end_w);
} else {
- space->install_write_bank(begin, end_w, wbank);
+ space.install_write_bank(begin, end_w, wbank);
}
}
}
/* did we 'go past the end?' */
if (end_w < state->m_mem_config.memmap[i].end)
- space->nop_write(end_w + 1, state->m_mem_config.memmap[i].end);
+ space.nop_write(end_w + 1, state->m_mem_config.memmap[i].end);
/* set the memory bank */
if (wbase)
diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c
index 87e2edff1c9..3fc4c0dd472 100644
--- a/src/mess/machine/apple2gs.c
+++ b/src/mess/machine/apple2gs.c
@@ -801,7 +801,7 @@ static TIMER_CALLBACK(apple2gs_scanline_tick)
static READ8_HANDLER( gssnd_r )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
UINT8 ret = 0;
switch (offset)
@@ -819,7 +819,7 @@ static READ8_HANDLER( gssnd_r )
}
else
{
- state->m_sndglu_dummy_read = state->m_es5503->read(*space, state->m_sndglu_addr);
+ state->m_sndglu_dummy_read = state->m_es5503->read(space, state->m_sndglu_addr);
}
if (state->m_sndglu_ctrl & 0x20) // auto-increment
@@ -842,7 +842,7 @@ static READ8_HANDLER( gssnd_r )
static WRITE8_HANDLER( gssnd_w )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
switch (offset)
{
case 0: // control
@@ -855,12 +855,12 @@ static WRITE8_HANDLER( gssnd_w )
case 1: // data write
if (state->m_sndglu_ctrl & 0x40) // docram access
{
- UINT8 *docram = space->machine().root_device().memregion("es5503")->base();
+ UINT8 *docram = space.machine().root_device().memregion("es5503")->base();
docram[state->m_sndglu_addr] = data;
}
else
{
- state->m_es5503->write(*space, state->m_sndglu_addr, data);
+ state->m_es5503->write(space, state->m_sndglu_addr, data);
}
if (state->m_sndglu_ctrl & 0x20) // auto-increment
@@ -1013,7 +1013,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r )
case 0x3D: /* C03D - SOUNDDATA */
case 0x3E: /* C03E - SOUNDADRL */
case 0x3F: /* C03F - SOUNDADRH */
- result = gssnd_r(&space, offset & 0x03);
+ result = gssnd_r(space, offset & 0x03);
break;
case 0x41: /* C041 - INTEN */
@@ -1174,7 +1174,7 @@ WRITE8_MEMBER( apple2gs_state::apple2gs_c0xx_w )
case 0x3D: /* C03D - SOUNDDATA */
case 0x3E: /* C03E - SOUNDADRL */
case 0x3F: /* C03F - SOUNDADRH */
- gssnd_w(&space, offset & 0x03, data);
+ gssnd_w(space, offset & 0x03, data);
break;
case 0x41: /* C041 - INTEN */
@@ -1747,19 +1747,19 @@ DIRECT_UPDATE_MEMBER(apple2gs_state::apple2gs_opbase)
-static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0x00C000); }
-static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0x01C000); }
-static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0xE0C000); }
-static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0xE1C000); }
+static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0x00C000); }
+static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0x01C000); }
+static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0xE0C000); }
+static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0xE1C000); }
-static WRITE8_HANDLER( apple2gs_00Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0x00C000, data); }
-static WRITE8_HANDLER( apple2gs_01Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0x01C000, data); }
-static WRITE8_HANDLER( apple2gs_E0Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0xE0C000, data); }
-static WRITE8_HANDLER( apple2gs_E1Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0xE1C000, data); }
+static WRITE8_HANDLER( apple2gs_00Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0x00C000, data); }
+static WRITE8_HANDLER( apple2gs_01Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0x01C000, data); }
+static WRITE8_HANDLER( apple2gs_E0Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0xE0C000, data); }
+static WRITE8_HANDLER( apple2gs_E1Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0xE1C000, data); }
static WRITE8_HANDLER( apple2gs_Exxxxx_w )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
state->m_slowmem[offset] = data;
}
@@ -1770,14 +1770,14 @@ static WRITE8_HANDLER( apple2gs_E12xxx_w ) { apple2gs_Exxxxx_w(space, offset + 0
static WRITE8_HANDLER( apple2gs_slowmem_w )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
state->m_slowmem[offset] = data;
if ((offset >= 0x19e00) && (offset < 0x19fff))
{
int color = (offset - 0x19e00) >> 1;
- palette_set_color_rgb(space->machine(), color + 16,
+ palette_set_color_rgb(space.machine(), color + 16,
((state->m_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17,
((state->m_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17,
((state->m_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17);
@@ -1788,7 +1788,7 @@ static WRITE8_HANDLER( apple2gs_slowmem_w )
// which doesn't drive the bus results in reading back the bank number.
static READ8_HANDLER(apple2gs_bank_echo_r)
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
return state->m_echo_bank + (offset>>16);
}
@@ -1796,7 +1796,7 @@ static READ8_HANDLER(apple2gs_bank_echo_r)
static void apple2gs_setup_memory(running_machine &machine)
{
apple2gs_state *state = machine.driver_data<apple2gs_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
offs_t begin, end;
apple2_memmap_config cfg;
@@ -1812,10 +1812,10 @@ static void apple2gs_setup_memory(running_machine &machine)
int ramsize = machine.device<ram_device>(RAM_TAG)->size();
// ROM 03 hardware: the quoted "1 MB" for a base machine doesn't include banks e0/e1, so map accordingly
- space->install_readwrite_bank(0x010000, ramsize - 1, "bank1");
+ space.install_readwrite_bank(0x010000, ramsize - 1, "bank1");
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x010000);
- space->install_legacy_read_handler( ramsize, 0xdfffff, FUNC(apple2gs_bank_echo_r));
+ space.install_legacy_read_handler( ramsize, 0xdfffff, FUNC(apple2gs_bank_echo_r));
state->m_echo_bank = (ramsize >> 16);
}
else
@@ -1823,44 +1823,44 @@ static void apple2gs_setup_memory(running_machine &machine)
int ramsize = machine.device<ram_device>(RAM_TAG)->size()-0x30000;
// ROM 00/01 hardware: the quoted "256K" for a base machine *does* include banks e0/e1.
- space->install_readwrite_bank(0x010000, ramsize - 1 + 0x10000, "bank1");
+ space.install_readwrite_bank(0x010000, ramsize - 1 + 0x10000, "bank1");
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x010000);
- space->install_legacy_read_handler( ramsize + 0x10000, 0xdfffff, FUNC(apple2gs_bank_echo_r));
+ space.install_legacy_read_handler( ramsize + 0x10000, 0xdfffff, FUNC(apple2gs_bank_echo_r));
state->m_echo_bank = (ramsize+0x10000) >> 16;
}
/* install hi memory */
- space->install_read_bank(0xe00000, 0xe1ffff, "bank2");
- space->install_legacy_write_handler(0xe00000, 0xe1ffff, FUNC(apple2gs_slowmem_w));
- space->install_legacy_write_handler(0xe00400, 0xe007ff, FUNC(apple2gs_E004xx_w));
- space->install_legacy_write_handler(0xe02000, 0xe03fff, FUNC(apple2gs_E02xxx_w));
- space->install_legacy_write_handler(0xe10400, 0xe107ff, FUNC(apple2gs_E104xx_w));
- space->install_legacy_write_handler(0xe12000, 0xe13fff, FUNC(apple2gs_E12xxx_w));
+ space.install_read_bank(0xe00000, 0xe1ffff, "bank2");
+ space.install_legacy_write_handler(0xe00000, 0xe1ffff, FUNC(apple2gs_slowmem_w));
+ space.install_legacy_write_handler(0xe00400, 0xe007ff, FUNC(apple2gs_E004xx_w));
+ space.install_legacy_write_handler(0xe02000, 0xe03fff, FUNC(apple2gs_E02xxx_w));
+ space.install_legacy_write_handler(0xe10400, 0xe107ff, FUNC(apple2gs_E104xx_w));
+ space.install_legacy_write_handler(0xe12000, 0xe13fff, FUNC(apple2gs_E12xxx_w));
state->membank("bank2")->set_base(state->m_slowmem);
/* install alternate ROM bank */
begin = 0x1000000 - machine.root_device().memregion("maincpu")->bytes();
end = 0xffffff;
- space->install_read_bank(begin, end, "bank3");
+ space.install_read_bank(begin, end, "bank3");
state->membank("bank3")->set_base(machine.root_device().memregion("maincpu")->base());
/* install new xxC000-xxCFFF handlers */
- space->install_legacy_read_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_r));
- space->install_legacy_write_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_w));
- space->install_legacy_read_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_r));
- space->install_legacy_write_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_w));
- space->install_legacy_read_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_r));
- space->install_legacy_write_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_w));
- space->install_legacy_read_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_r));
- space->install_legacy_write_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_w));
- space->set_direct_update_handler(direct_update_delegate(FUNC(apple2gs_state::apple2gs_opbase), state));
+ space.install_legacy_read_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_r));
+ space.install_legacy_write_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_w));
+ space.install_legacy_read_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_r));
+ space.install_legacy_write_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_w));
+ space.install_legacy_read_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_r));
+ space.install_legacy_write_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_w));
+ space.install_legacy_read_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_r));
+ space.install_legacy_write_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_w));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(apple2gs_state::apple2gs_opbase), state));
/* install aux memory writes (for shadowing) */
- space->install_write_handler(0x010400, 0x0107FF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux0400_w), state));
- space->install_write_handler(0x012000, 0x013FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux2000_w), state));
- space->install_write_handler(0x014000, 0x019FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux4000_w), state));
+ space.install_write_handler(0x010400, 0x0107FF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux0400_w), state));
+ space.install_write_handler(0x012000, 0x013FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux2000_w), state));
+ space.install_write_handler(0x014000, 0x019FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux4000_w), state));
/* setup the Apple II memory system */
memset(&cfg, 0, sizeof(cfg));
@@ -1879,7 +1879,7 @@ static void apple2gs_setup_memory(running_machine &machine)
static READ8_HANDLER( apple2gs_read_vector )
{
- return space->read_byte(offset | 0xFF0000);
+ return space.read_byte(offset | 0xFF0000);
}
MACHINE_RESET_MEMBER(apple2gs_state,apple2gs)
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index 0f249e1b5f1..4eb3919e703 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -327,7 +327,7 @@ static void apple3_update_memory(running_machine &machine)
apple3_state *state = machine.driver_data<apple3_state>();
UINT16 bank;
UINT8 page;
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (LOG_MEMORY)
{
@@ -374,71 +374,71 @@ static void apple3_update_memory(running_machine &machine)
/* install bank 8 (C000-CFFF) */
if (state->m_via_0_a & 0x40)
{
- space->install_read_handler(0xC000, 0xC0FF, read8_delegate(FUNC(apple3_state::apple3_c0xx_r),state));
- space->install_write_handler(0xC000, 0xC0FF, write8_delegate(FUNC(apple3_state::apple3_c0xx_w),state));
+ space.install_read_handler(0xC000, 0xC0FF, read8_delegate(FUNC(apple3_state::apple3_c0xx_r),state));
+ space.install_write_handler(0xC000, 0xC0FF, write8_delegate(FUNC(apple3_state::apple3_c0xx_w),state));
}
else
{
- space->install_read_bank(0xC000, 0xC0FF, "bank8");
+ space.install_read_bank(0xC000, 0xC0FF, "bank8");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC000, 0xC0FF);
+ space.unmap_write(0xC000, 0xC0FF);
else
- space->install_write_bank(0xC000, 0xC0FF, "bank8");
+ space.install_write_bank(0xC000, 0xC0FF, "bank8");
apple3_setbank(machine,"bank8", ~0, 0x4000);
}
/* install bank 9 (C100-C4FF) */
if (state->m_via_0_a & 0x40)
{
- space->nop_readwrite(0xC100, 0xC4FF);
+ space.nop_readwrite(0xC100, 0xC4FF);
}
else
{
- space->install_read_bank(0xC100, 0xC4FF, "bank9");
+ space.install_read_bank(0xC100, 0xC4FF, "bank9");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC100, 0xC4FF);
+ space.unmap_write(0xC100, 0xC4FF);
else
- space->install_write_bank(0xC100, 0xC4FF, "bank9");
+ space.install_write_bank(0xC100, 0xC4FF, "bank9");
apple3_setbank(machine,"bank9", ~0, 0x4100);
}
/* install bank 10 (C500-C7FF) */
- space->install_read_bank(0xC500, 0xC7FF, "bank10");
+ space.install_read_bank(0xC500, 0xC7FF, "bank10");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC500, 0xC7FF);
+ space.unmap_write(0xC500, 0xC7FF);
else
- space->install_write_bank(0xC500, 0xC7FF, "bank10");
+ space.install_write_bank(0xC500, 0xC7FF, "bank10");
apple3_setbank(machine,"bank10", ~0, 0x4500);
/* install bank 11 (C800-CFFF) */
if (state->m_via_0_a & 0x40)
{
- space->nop_readwrite(0xC800, 0xCFFF);
+ space.nop_readwrite(0xC800, 0xCFFF);
}
else
{
- space->install_read_bank(0xC800, 0xCFFF, "bank11");
+ space.install_read_bank(0xC800, 0xCFFF, "bank11");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC800, 0xCFFF);
+ space.unmap_write(0xC800, 0xCFFF);
else
- space->install_write_bank(0xC800, 0xCFFF, "bank11");
+ space.install_write_bank(0xC800, 0xCFFF, "bank11");
apple3_setbank(machine,"bank11", ~0, 0x4800);
}
/* install bank 6 (D000-EFFF) */
- space->install_read_bank(0xD000, 0xEFFF, "bank6");
+ space.install_read_bank(0xD000, 0xEFFF, "bank6");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xD000, 0xEFFF);
+ space.unmap_write(0xD000, 0xEFFF);
else
- space->install_write_bank(0xD000, 0xEFFF, "bank6");
+ space.install_write_bank(0xD000, 0xEFFF, "bank6");
apple3_setbank(machine,"bank6", ~0, 0x5000);
/* install bank 7 (F000-FFFF) */
- space->install_read_bank(0xF000, 0xFFFF, "bank7");
+ space.install_read_bank(0xF000, 0xFFFF, "bank7");
if (state->m_via_0_a & 0x09)
- space->unmap_write(0xF000, 0xFFFF);
+ space.unmap_write(0xF000, 0xFFFF);
else
- space->install_write_bank(0xF000, 0xFFFF, "bank7");
+ space.install_write_bank(0xF000, 0xFFFF, "bank7");
if (state->m_via_0_a & 0x01)
state->membank("bank7")->set_base(machine.root_device().memregion("maincpu")->base());
else
@@ -446,11 +446,11 @@ static void apple3_update_memory(running_machine &machine)
/* reinstall VIA handlers */
{
- via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
- via6522_device *via_1 = space->machine().device<via6522_device>("via6522_1");
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ via6522_device *via_1 = space.machine().device<via6522_device>("via6522_1");
- space->install_readwrite_handler(0xFFD0, 0xFFDF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_0), write8_delegate(FUNC(via6522_device::write),via_0));
- space->install_readwrite_handler(0xFFE0, 0xFFEF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_1), write8_delegate(FUNC(via6522_device::write),via_1));
+ space.install_readwrite_handler(0xFFD0, 0xFFDF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_0), write8_delegate(FUNC(via6522_device::write),via_0));
+ space.install_readwrite_handler(0xFFE0, 0xFFEF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_1), write8_delegate(FUNC(via6522_device::write),via_1));
}
}
diff --git a/src/mess/machine/at.c b/src/mess/machine/at.c
index a4da925c3b7..1ad1e1f938b 100644
--- a/src/mess/machine/at.c
+++ b/src/mess/machine/at.c
@@ -316,7 +316,7 @@ WRITE8_MEMBER( at_state::at_portb_w )
static void init_at_common(running_machine &machine)
{
at_state *state = machine.driver_data<at_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
// The CS4031 chipset does this itself
if (machine.device("cs4031") == NULL)
@@ -327,8 +327,8 @@ static void init_at_common(running_machine &machine)
if (machine.device<ram_device>(RAM_TAG)->size() > 0x0a0000)
{
offs_t ram_limit = 0x100000 + machine.device<ram_device>(RAM_TAG)->size() - 0x0a0000;
- space->install_read_bank(0x100000, ram_limit - 1, "bank1");
- space->install_write_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_read_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_write_bank(0x100000, ram_limit - 1, "bank1");
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0xa0000);
}
}
diff --git a/src/mess/machine/ataricrt.c b/src/mess/machine/ataricrt.c
index 01992420a4b..7f3fe7c9f5e 100644
--- a/src/mess/machine/ataricrt.c
+++ b/src/mess/machine/ataricrt.c
@@ -172,7 +172,7 @@ static WRITE8_HANDLER( x32_bank_w )
{
// printf("written %x\n", data);
int bank = data & 0x03;
- space->machine().root_device().membank("8000")->set_base(space->machine().root_device().memregion("lslot")->base() + bank * 0x2000);
+ space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + bank * 0x2000);
}
static WRITE8_HANDLER( w64_bank_w )
@@ -180,9 +180,9 @@ static WRITE8_HANDLER( w64_bank_w )
// printf("write to %x\n", offset);
if (offset < 8)
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + offset * 0x2000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + offset * 0x2000);
else
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base());
// FIXME: writes to 0x8-0xf should disable the cart
}
@@ -192,9 +192,9 @@ static WRITE8_HANDLER( ex64_bank_w )
// printf("write to %x\n", offset);
if (offset < 8)
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000);
else
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base());
// FIXME: writes to 0x8-0xf should disable the cart
}
@@ -202,14 +202,14 @@ static WRITE8_HANDLER( bbsb_bankl_w )
{
// printf("write to %x\n", 0x8000 + offset);
if (offset >= 0xff6 && offset <= 0xff9)
- space->machine().root_device().membank("8000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000);
+ space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000);
}
static WRITE8_HANDLER( bbsb_bankh_w )
{
// printf("write to %x\n", 0x9000 + offset);
if (offset >= 0xff6 && offset <= 0xff9)
- space->machine().root_device().membank("9000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000);
+ space.machine().root_device().membank("9000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000);
}
static WRITE8_HANDLER( oss_034m_w )
@@ -218,28 +218,28 @@ static WRITE8_HANDLER( oss_034m_w )
{
case 0:
case 1:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base());
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 2:
case 6:
// docs says this should put 0xff in the 0xa000 bank -> let's point to the end of the cart
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x4000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 3:
case 7:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x1000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 4:
case 5:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x2000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
default:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xa000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xb000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000);
break;
}
}
@@ -249,20 +249,20 @@ static WRITE8_HANDLER( oss_m091_w )
switch (offset & 0x09)
{
case 0:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x1000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
case 1:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
case 8:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xa000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xb000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000);
break;
case 9:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x2000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
}
}
@@ -284,14 +284,14 @@ static WRITE8_HANDLER( bbsb_bankh_w )
static READ8_HANDLER( bbsb_bankl_r )
{
// return data from the selected bank (0,1,2,3)
- UINT8 *mem = space->machine().root_device().memregion("lslot")->base();
+ UINT8 *mem = space.machine().root_device().memregion("lslot")->base();
return &mem[0x0000 + bbsb_bankl * 0x1000];
}
static READ8_HANDLER( bbsb_bankh_r )
{
// return data from the selected bank (4,5,6,7)
- UINT8 *mem = space->machine().root_device().memregion("lslot")->base();
+ UINT8 *mem = space.machine().root_device().memregion("lslot")->base();
return &mem[0x4000 + bbsb_bankh * 0x1000];
}
#endif
@@ -658,19 +658,19 @@ static UINT8 xegs_cart = 0;
static WRITE8_HANDLER( xegs_bankswitch )
{
- UINT8 *cart = space->machine().root_device().memregion("user1")->base();
+ UINT8 *cart = space.machine().root_device().memregion("user1")->base();
data &= xegs_banks - 1;
- space->machine().root_device().membank("bank0")->set_base(cart + data * 0x2000);
+ space.machine().root_device().membank("bank0")->set_base(cart + data * 0x2000);
}
MACHINE_START( xegs )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *cart = space->machine().root_device().memregion("user1")->base();
- UINT8 *cpu = space->machine().root_device().memregion("maincpu")->base();
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *cart = space.machine().root_device().memregion("user1")->base();
+ UINT8 *cpu = space.machine().root_device().memregion("maincpu")->base();
atari_machine_start(machine);
- space->install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch));
+ space.install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch));
if (xegs_cart)
{
diff --git a/src/mess/machine/b2m.c b/src/mess/machine/b2m.c
index 61db41b0606..4af961ebacf 100644
--- a/src/mess/machine/b2m.c
+++ b/src/mess/machine/b2m.c
@@ -44,20 +44,20 @@ static void b2m_set_bank(running_machine &machine,int bank)
{
UINT8 *rom;
b2m_state *state = machine.driver_data<b2m_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
- space->install_write_bank(0x0000, 0x27ff, "bank1");
- space->install_write_bank(0x2800, 0x2fff, "bank2");
- space->install_write_bank(0x3000, 0x6fff, "bank3");
- space->install_write_bank(0x7000, 0xdfff, "bank4");
- space->install_write_bank(0xe000, 0xffff, "bank5");
+ space.install_write_bank(0x0000, 0x27ff, "bank1");
+ space.install_write_bank(0x2800, 0x2fff, "bank2");
+ space.install_write_bank(0x3000, 0x6fff, "bank3");
+ space.install_write_bank(0x7000, 0xdfff, "bank4");
+ space.install_write_bank(0xe000, 0xffff, "bank5");
rom = state->memregion("maincpu")->base();
switch(bank) {
case 0 :
case 1 :
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x2800);
@@ -67,8 +67,8 @@ static void b2m_set_bank(running_machine &machine,int bank)
break;
#if 0
case 1 :
- space->unmap_write(0x3000, 0x6fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x3000, 0x6fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x2800);
@@ -78,42 +78,42 @@ static void b2m_set_bank(running_machine &machine,int bank)
break;
#endif
case 2 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x10000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
break;
case 3 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x14000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
break;
case 4 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x18000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
break;
case 5 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x1c000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
@@ -127,11 +127,11 @@ static void b2m_set_bank(running_machine &machine,int bank)
state->membank("bank5")->set_base(ram + 0xe000);
break;
case 7 :
- space->unmap_write(0x0000, 0x27ff);
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0x3000, 0x6fff);
- space->unmap_write(0x7000, 0xdfff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x0000, 0x27ff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0x3000, 0x6fff);
+ space.unmap_write(0x7000, 0xdfff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(rom + 0x10000);
state->membank("bank2")->set_base(rom + 0x10000);
diff --git a/src/mess/machine/bebox.c b/src/mess/machine/bebox.c
index 817fcf39e0d..b8fb66d5954 100644
--- a/src/mess/machine/bebox.c
+++ b/src/mess/machine/bebox.c
@@ -142,25 +142,25 @@ static void bebox_mbreg32_w(UINT32 *target, UINT64 data, UINT64 mem_mask)
READ64_HANDLER( bebox_cpu0_imask_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
return ((UINT64) state->m_cpu_imask[0]) << 32;
}
READ64_HANDLER( bebox_cpu1_imask_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
return ((UINT64) state->m_cpu_imask[1]) << 32;
}
READ64_HANDLER( bebox_interrupt_sources_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
return ((UINT64) state->m_interrupts) << 32;
}
WRITE64_HANDLER( bebox_cpu0_imask_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT32 old_imask = state->m_cpu_imask[0];
bebox_mbreg32_w(&state->m_cpu_imask[0], data, mem_mask);
@@ -170,15 +170,15 @@ WRITE64_HANDLER( bebox_cpu0_imask_w )
if (LOG_CPUIMASK)
{
logerror("BeBox CPU #0 pc=0x%08X imask=0x%08x\n",
- (unsigned) space->device().safe_pc( ), state->m_cpu_imask[0]);
+ (unsigned) space.device().safe_pc( ), state->m_cpu_imask[0]);
}
- bebox_update_interrupts(space->machine());
+ bebox_update_interrupts(space.machine());
}
}
WRITE64_HANDLER( bebox_cpu1_imask_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT32 old_imask = state->m_cpu_imask[1];
bebox_mbreg32_w(&state->m_cpu_imask[1], data, mem_mask);
@@ -188,20 +188,20 @@ WRITE64_HANDLER( bebox_cpu1_imask_w )
if (LOG_CPUIMASK)
{
logerror("BeBox CPU #1 pc=0x%08X imask=0x%08x\n",
- (unsigned) space->device() .safe_pc( ), state->m_cpu_imask[1]);
+ (unsigned) space.device() .safe_pc( ), state->m_cpu_imask[1]);
}
- bebox_update_interrupts(space->machine());
+ bebox_update_interrupts(space.machine());
}
}
READ64_HANDLER( bebox_crossproc_interrupts_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT32 result;
result = state->m_crossproc_interrupts;
/* return a different result depending on which CPU is accessing this handler */
- if (space != space->machine().device("ppc1")->memory().space(AS_PROGRAM))
+ if (&space != space.machine().device("ppc1")->memory().space(AS_PROGRAM))
result |= 0x02000000;
else
result &= ~0x02000000;
@@ -211,7 +211,7 @@ READ64_HANDLER( bebox_crossproc_interrupts_r )
WRITE64_HANDLER( bebox_crossproc_interrupts_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
static const struct
{
UINT32 mask;
@@ -249,7 +249,7 @@ WRITE64_HANDLER( bebox_crossproc_interrupts_w )
*/
}
- space->machine().device(cputags[crossproc_map[i].cpunum])->execute().set_input_line(crossproc_map[i].inputline, line);
+ space.machine().device(cputags[crossproc_map[i].cpunum])->execute().set_input_line(crossproc_map[i].inputline, line);
}
}
}
@@ -260,7 +260,7 @@ WRITE64_HANDLER( bebox_processor_resets_w )
if (b & 0x20)
{
- space->machine().device("ppc2")->execute().set_input_line(INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ space.machine().device("ppc2")->execute().set_input_line(INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
}
@@ -453,10 +453,10 @@ static const struct pc_fdc_interface bebox_fdc_interface =
READ64_HANDLER( bebox_interrupt_ack_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
int result;
result = pic8259_acknowledge( state->m_devices.pic8259_master );
- bebox_set_irq_bit(space->machine(), 5, 0); /* HACK */
+ bebox_set_irq_bit(space.machine(), 5, 0); /* HACK */
return ((UINT64) result) << 56;
}
@@ -514,8 +514,8 @@ static device_t *ide_device(running_machine &machine)
return machine.device("ide");
}
-READ8_HANDLER( bebox_800001F0_r ) { return ide_controller_r(ide_device(space->machine()), offset + 0x1F0, 1); }
-WRITE8_HANDLER( bebox_800001F0_w ) { ide_controller_w(ide_device(space->machine()), offset + 0x1F0, 1, data); }
+READ8_HANDLER( bebox_800001F0_r ) { return ide_controller_r(ide_device(space.machine()), offset + 0x1F0, 1); }
+WRITE8_HANDLER( bebox_800001F0_w ) { ide_controller_w(ide_device(space.machine()), offset + 0x1F0, 1, data); }
READ64_HANDLER( bebox_800003F0_r )
{
@@ -524,13 +524,13 @@ READ64_HANDLER( bebox_800003F0_r )
if (((mem_mask >> 8) & 0xFF) == 0)
{
result &= ~(0xFF << 8);
- result |= ide_controller_r(ide_device(space->machine()), 0x3F6, 1) << 8;
+ result |= ide_controller_r(ide_device(space.machine()), 0x3F6, 1) << 8;
}
if (((mem_mask >> 0) & 0xFF) == 0)
{
result &= ~(0xFF << 0);
- result |= ide_controller_r(ide_device(space->machine()), 0x3F7, 1) << 0;
+ result |= ide_controller_r(ide_device(space.machine()), 0x3F7, 1) << 0;
}
return result;
}
@@ -541,10 +541,10 @@ WRITE64_HANDLER( bebox_800003F0_w )
write64be_with_write8_handler(pc_fdc_w, space, offset, data, mem_mask | 0xFFFF);
if (((mem_mask >> 8) & 0xFF) == 0)
- ide_controller_w(ide_device(space->machine()), 0x3F6, 1, (data >> 8) & 0xFF);
+ ide_controller_w(ide_device(space.machine()), 0x3F6, 1, (data >> 8) & 0xFF);
if (((mem_mask >> 0) & 0xFF) == 0)
- ide_controller_w(ide_device(space->machine()), 0x3F7, 1, (data >> 0) & 0xFF);
+ ide_controller_w(ide_device(space.machine()), 0x3F7, 1, (data >> 0) & 0xFF);
}
@@ -588,7 +588,7 @@ static WRITE64_HANDLER( bebox_video_w )
READ8_HANDLER(bebox_page_r)
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT8 data = state->m_at_pages[offset % 0x10];
switch(offset % 8)
@@ -612,7 +612,7 @@ READ8_HANDLER(bebox_page_r)
WRITE8_HANDLER(bebox_page_w)
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
state->m_at_pages[offset % 0x10] = data;
switch(offset % 8)
@@ -639,7 +639,7 @@ WRITE8_HANDLER(bebox_page_w)
WRITE8_HANDLER(bebox_80000480_w)
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
switch(offset % 8)
{
case 1:
@@ -679,19 +679,19 @@ static WRITE_LINE_DEVICE_HANDLER( bebox_dma_hrq_changed )
static READ8_HANDLER( bebox_dma_read_byte )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16)
& 0x7FFF0000;
- return space->read_byte(page_offset + offset);
+ return space.read_byte(page_offset + offset);
}
static WRITE8_HANDLER( bebox_dma_write_byte )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16)
& 0x7FFF0000;
- space->write_byte(page_offset + offset, data);
+ space.write_byte(page_offset + offset, data);
}
@@ -789,7 +789,7 @@ const struct pit8253_config bebox_pit8254_config =
READ8_HANDLER( bebox_flash_r )
{
- fujitsu_29f016a_device *flash = space->machine().device<fujitsu_29f016a_device>("flash");
+ fujitsu_29f016a_device *flash = space.machine().device<fujitsu_29f016a_device>("flash");
offset = (offset & ~7) | (7 - (offset & 7));
return flash->read(offset);
}
@@ -797,7 +797,7 @@ READ8_HANDLER( bebox_flash_r )
WRITE8_HANDLER( bebox_flash_w )
{
- fujitsu_29f016a_device *flash = space->machine().device<fujitsu_29f016a_device>("flash");
+ fujitsu_29f016a_device *flash = space.machine().device<fujitsu_29f016a_device>("flash");
offset = (offset & ~7) | (7 - (offset & 7));
flash->write(offset, data);
}
@@ -840,7 +840,7 @@ static const struct kbdc8042_interface bebox_8042_interface =
static READ64_HANDLER( scsi53c810_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
int reg = offset*8;
UINT64 r = 0;
if (!(mem_mask & U64(0xff00000000000000))) {
@@ -874,7 +874,7 @@ static READ64_HANDLER( scsi53c810_r )
static WRITE64_HANDLER( scsi53c810_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
int reg = offset*8;
if (!(mem_mask & U64(0xff00000000000000))) {
state->m_lsi53c810->lsi53c810_reg_w(reg+0, data >> 56);
@@ -955,11 +955,11 @@ void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, i
/* brutal ugly hack; at some point the PCI code should be handling this stuff */
if (state->m_scsi53c810_data[5] != 0xFFFFFFF0)
{
- address_space *space = device->machine().device("ppc1")->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device("ppc1")->memory().space(AS_PROGRAM);
addr = (state->m_scsi53c810_data[5] | 0xC0000000) & ~0xFF;
- space->install_legacy_read_handler(addr, addr + 0xFF, FUNC(scsi53c810_r));
- space->install_legacy_write_handler(addr, addr + 0xFF, FUNC(scsi53c810_w));
+ space.install_legacy_read_handler(addr, addr + 0xFF, FUNC(scsi53c810_r));
+ space.install_legacy_write_handler(addr, addr + 0xFF, FUNC(scsi53c810_w));
}
}
break;
diff --git a/src/mess/machine/c64.c b/src/mess/machine/c64.c
index c47cdafc0e6..f5c501111f9 100644
--- a/src/mess/machine/c64.c
+++ b/src/mess/machine/c64.c
@@ -238,7 +238,7 @@ const mos6526_interface c64_pal_cia1 =
WRITE8_HANDLER( c64_roml_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
state->m_memory[offset + 0x8000] = data;
@@ -248,37 +248,37 @@ WRITE8_HANDLER( c64_roml_w )
WRITE8_HANDLER( c64_write_io )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
- sid6581_device *sid = space->machine().device<sid6581_device>("sid6581");
- device_t *vic2 = space->machine().device("vic2");
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
+ sid6581_device *sid = space.machine().device<sid6581_device>("sid6581");
+ device_t *vic2 = space.machine().device("vic2");
state->m_io_mirror[offset] = data;
if (offset < 0x400)
- vic2_port_w(vic2, *space, offset & 0x3ff, data);
+ vic2_port_w(vic2, space, offset & 0x3ff, data);
else if (offset < 0x800)
- sid->write(*space, offset & 0x3ff, data);
+ sid->write(space, offset & 0x3ff, data);
else if (offset < 0xc00)
state->m_colorram[offset & 0x3ff] = data | 0xf0;
else if (offset < 0xd00)
- mos6526_w(cia_0, *space, offset, data);
+ mos6526_w(cia_0, space, offset, data);
else if (offset < 0xe00)
{
if (state->m_cia1_on)
- mos6526_w(cia_1, *space, offset, data);
+ mos6526_w(cia_1, space, offset, data);
else
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
}
else if (offset < 0xf00)
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 1 */
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 1 */
else
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 2 */
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 2 */
}
WRITE8_HANDLER( c64_ioarea_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
if (state->m_io_enabled)
c64_write_io(space, offset, data);
else
@@ -287,17 +287,17 @@ WRITE8_HANDLER( c64_ioarea_w )
READ8_HANDLER( c64_read_io )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
- sid6581_device *sid = space->machine().device<sid6581_device>("sid6581");
- device_t *vic2 = space->machine().device("vic2");
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
+ sid6581_device *sid = space.machine().device<sid6581_device>("sid6581");
+ device_t *vic2 = space.machine().device("vic2");
if (offset < 0x400)
- return vic2_port_r(vic2, *space, offset & 0x3ff);
+ return vic2_port_r(vic2, space, offset & 0x3ff);
else if (offset < 0x800)
- return sid->read(*space, offset & 0x3ff);
+ return sid->read(space, offset & 0x3ff);
else if (offset < 0xc00)
return state->m_colorram[offset & 0x3ff];
@@ -305,24 +305,24 @@ READ8_HANDLER( c64_read_io )
else if (offset < 0xd00)
{
if (offset & 1)
- cia_set_port_mask_value(cia_0, 1, space->machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
+ cia_set_port_mask_value(cia_0, 1, space.machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
else
cia_set_port_mask_value(cia_0, 0, state->ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
- return mos6526_r(cia_0, *space, offset);
+ return mos6526_r(cia_0, space, offset);
}
else if (state->m_cia1_on && (offset < 0xe00))
- return mos6526_r(cia_1, *space, offset);
+ return mos6526_r(cia_1, space, offset);
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
return 0xff;
}
READ8_HANDLER( c64_ioarea_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
return state->m_io_enabled ? c64_read_io(space, offset) : state->m_io_ram_r_ptr[offset];
}
@@ -727,13 +727,13 @@ int c64_paddle_read( device_t *device, address_space &space, int which )
READ8_HANDLER( c64_colorram_read )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
return state->m_colorram[offset & 0x3ff];
}
WRITE8_HANDLER( c64_colorram_write )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
state->m_colorram[offset & 0x3ff] = data | 0xf0;
}
@@ -1377,7 +1377,7 @@ static WRITE8_HANDLER( hugo_bank_w )
int bank = ((data >> 3) & 0x0e) | BIT(data, 7);
- map_cartridge_roml(space->machine(), bank * 0x2000);
+ map_cartridge_roml(space.machine(), bank * 0x2000);
}
static void load_hugo_cartridge(device_image_interface &image)
@@ -1407,7 +1407,7 @@ static void load_hugo_cartridge(device_image_interface &image)
static WRITE8_HANDLER( easy_calc_result_bank_w )
{
- map_cartridge_romh(space->machine(), 0x2000 + (!offset * 0x2000));
+ map_cartridge_romh(space.machine(), 0x2000 + (!offset * 0x2000));
}
static void load_easy_calc_result_cartridge(device_image_interface &image)
@@ -1454,7 +1454,7 @@ static WRITE8_HANDLER( pagefox_bank_w )
*/
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 *cart = state->memregion("user1")->base();
if (data == 0xff)
@@ -1486,12 +1486,12 @@ static WRITE8_HANDLER( pagefox_bank_w )
{
state->m_roml = state->m_c64_roml;
- map_cartridge_roml(space->machine(), address);
- map_cartridge_romh(space->machine(), address + 0x2000);
+ map_cartridge_roml(space.machine(), address);
+ map_cartridge_romh(space.machine(), address + 0x2000);
}
}
- c64_bankswitch(space->machine(), 0);
+ c64_bankswitch(space.machine(), 0);
}
static void load_pagefox_cartridge(device_image_interface &image)
@@ -1506,7 +1506,7 @@ static void load_pagefox_cartridge(device_image_interface &image)
static WRITE8_HANDLER( multiscreen_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 *cart = state->memregion("user1")->base();
int bank = data & 0x0f;
offs_t address = bank * 0x4000;
@@ -1517,7 +1517,7 @@ static WRITE8_HANDLER( multiscreen_bank_w )
state->m_roml = cart + address;
state->m_roml_writable = 1;
- map_cartridge_romh(space->machine(), 0x2000);
+ map_cartridge_romh(space.machine(), 0x2000);
}
else
{
@@ -1525,11 +1525,11 @@ static WRITE8_HANDLER( multiscreen_bank_w )
state->m_roml = state->m_c64_roml;
state->m_roml_writable = 0;
- map_cartridge_roml(space->machine(), address);
- map_cartridge_romh(space->machine(), address + 0x2000);
+ map_cartridge_roml(space.machine(), address);
+ map_cartridge_romh(space.machine(), address + 0x2000);
}
- c64_bankswitch(space->machine(), 0);
+ c64_bankswitch(space.machine(), 0);
}
static void load_multiscreen_cartridge(device_image_interface &image)
@@ -1545,7 +1545,7 @@ static void load_multiscreen_cartridge(device_image_interface &image)
static WRITE8_HANDLER( simons_basic_bank_w )
{
- set_game_line(space->machine(), !BIT(data, 0));
+ set_game_line(space.machine(), !BIT(data, 0));
}
static void load_simons_basic_cartridge(device_image_interface &image)
@@ -1561,14 +1561,14 @@ static void load_simons_basic_cartridge(device_image_interface &image)
static READ8_HANDLER( super_explode_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
return state->m_roml[0x1f00 | offset];
}
static WRITE8_HANDLER( super_explode_bank_w )
{
- map_cartridge_roml(space->machine(), BIT(data, 7) * 0x2000);
+ map_cartridge_roml(space.machine(), BIT(data, 7) * 0x2000);
}
static void load_super_explode_cartridge(device_image_interface &image)
@@ -1577,8 +1577,8 @@ static void load_super_explode_cartridge(device_image_interface &image)
map_cartridge_roml(image.device().machine(), 0x0000);
- address_space *space = image.device().machine().firstcpu->space(AS_PROGRAM);
- space->install_legacy_read_handler(0xdf00, 0xdfff, FUNC(super_explode_r));
+ address_space &space = *image.device().machine().firstcpu->space(AS_PROGRAM);
+ space.install_legacy_read_handler(0xdf00, 0xdfff, FUNC(super_explode_r));
install_io2_handler(super_explode_bank_w);
}
@@ -1700,7 +1700,7 @@ static DEVICE_IMAGE_LOAD( max_cart )
static WRITE8_HANDLER( fc3_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 3
// working:
// not working:
@@ -1730,7 +1730,7 @@ static WRITE8_HANDLER( fc3_bank_w )
static WRITE8_HANDLER( ocean1_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 5
// working: Double Dragon, Ghostbusters, Terminator 2
// not working: Pang, Robocop 2, Toki
@@ -1765,7 +1765,7 @@ static WRITE8_HANDLER( ocean1_bank_w )
static WRITE8_HANDLER( funplay_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 7
// working:
// not working:
@@ -1795,7 +1795,7 @@ static WRITE8_HANDLER( funplay_bank_w )
static WRITE8_HANDLER( supergames_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 8
// working:
// not working:
@@ -1834,7 +1834,7 @@ static WRITE8_HANDLER( supergames_bank_w )
static WRITE8_HANDLER( c64gs_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 15
// working:
// not working: The Last Ninja Remix
@@ -1858,7 +1858,7 @@ static WRITE8_HANDLER( c64gs_bank_w )
static READ8_HANDLER( dinamic_bank_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 17
// working: Satan
// not working:
@@ -1883,7 +1883,7 @@ static READ8_HANDLER( dinamic_bank_r )
static READ8_HANDLER( zaxxon_bank_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 18
// working:
// not working:
@@ -1906,7 +1906,7 @@ static READ8_HANDLER( zaxxon_bank_r )
static WRITE8_HANDLER( domark_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 19
// working:
// not working:
@@ -1929,7 +1929,7 @@ static WRITE8_HANDLER( domark_bank_w )
static WRITE8_HANDLER( comal80_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 21
// working: Comal 80
// not working:
@@ -1959,7 +1959,7 @@ static WRITE8_HANDLER( comal80_bank_w )
static void setup_c64_custom_mappers(running_machine &machine)
{
legacy_c64_state *state = machine.driver_data<legacy_c64_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
switch (state->m_cart.mapper)
{
@@ -1968,20 +1968,20 @@ static void setup_c64_custom_mappers(running_machine &machine)
case KCS_PC: /* Type # 2 not working */
break;
case FINAL_CART_III: /* Type # 3 not working - 4 16k banks, loaded at 0x8000, banks chosen by writing to 0xdfff */
- space->install_legacy_write_handler( 0xdfff, 0xdfff, FUNC(fc3_bank_w) );
+ space.install_legacy_write_handler( 0xdfff, 0xdfff, FUNC(fc3_bank_w) );
break;
case SIMONS_BASIC: /* Type # 4 not working */
break;
case OCEAN_1: /* Type # 5 - up to 64 8k banks, loaded at 0x8000 or 0xa000, banks chosen by writing to 0xde00 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(ocean1_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(ocean1_bank_w) );
break;
case EXPERT: /* Type # 6 not working */
break;
case FUN_PLAY: /* Type # 7 - 16 8k banks, loaded at 0x8000, banks chosen by writing to 0xde00 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(funplay_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(funplay_bank_w) );
break;
case SUPER_GAMES: /* Type # 8 not working */
- space->install_legacy_write_handler( 0xdf00, 0xdf00, FUNC(supergames_bank_w) );
+ space.install_legacy_write_handler( 0xdf00, 0xdf00, FUNC(supergames_bank_w) );
break;
case ATOMIC_POWER: /* Type # 9 not working */
break;
@@ -1996,21 +1996,21 @@ static void setup_c64_custom_mappers(running_machine &machine)
case MAGIC_FORMEL: /* Type # 14 not working */
break;
case C64GS: /* Type # 15 - up to 64 8k banks, loaded at 0x8000, banks chosen by writing to 0xde00 + bank */
- space->install_legacy_write_handler( 0xde00, 0xdeff, FUNC(c64gs_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xdeff, FUNC(c64gs_bank_w) );
break;
case DINAMIC: /* Type # 17 - 16 8k banks, loaded at 0x8000, banks chosen by reading to 0xde00 + bank */
- space->install_legacy_read_handler( 0xde00, 0xdeff, FUNC(dinamic_bank_r) );
+ space.install_legacy_read_handler( 0xde00, 0xdeff, FUNC(dinamic_bank_r) );
break;
case ZAXXON: /* Type # 18 */
- space->install_legacy_read_handler( 0x8000, 0x9fff, FUNC(zaxxon_bank_r) );
+ space.install_legacy_read_handler( 0x8000, 0x9fff, FUNC(zaxxon_bank_r) );
break;
case DOMARK: /* Type # 19 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(domark_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(domark_bank_w) );
break;
case SUPER_SNAP_5: /* Type # 20 not working */
break;
case COMAL_80: /* Type # 21 - 4 16k banks, loaded at 0x8000, banks chosen by writing to 0xde00 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(comal80_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(comal80_bank_w) );
break;
case GENERIC_CRT: /* Type # 0 - single bank, no bankswitch, loaded at start with correct size and place */
default:
diff --git a/src/mess/machine/c65.c b/src/mess/machine/c65.c
index 8e8a76f9eac..c2aab1fd340 100644
--- a/src/mess/machine/c65.c
+++ b/src/mess/machine/c65.c
@@ -219,22 +219,22 @@ const mos6526_interface c65_cia1 =
/* dma controller and bankswitch hardware ?*/
static READ8_HANDLER( c65_read_mem )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
UINT8 result;
if (offset <= 0x0ffff)
result = state->m_memory[offset];
else
- result = space->read_byte(offset);
+ result = space.read_byte(offset);
return result;
}
static WRITE8_HANDLER( c65_write_mem )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
if (offset <= 0x0ffff)
state->m_memory[offset] = data;
else
- space->write_byte(offset, data);
+ space.write_byte(offset, data);
}
/* dma chip at 0xd700
@@ -268,7 +268,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
PAIR pair, src, dst, len;
UINT8 cmd, fill;
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch (offset & 3)
{
@@ -299,7 +299,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
case 0:
if (src.d == 0x3ffff) state->m_dump_dma = 1;
if (state->m_dump_dma)
- DBG_LOG(space->machine(), 1,"dma copy job",
+ DBG_LOG(space.machine(), 1,"dma copy job",
("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
len.w.l, src.d, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1) ) );
@@ -333,7 +333,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
}
break;
case 3:
- DBG_LOG(space->machine(), 3,"dma fill job",
+ DBG_LOG(space.machine(), 3,"dma fill job",
("len:%.4x value:%.2x dst:%.6x sub:%.2x modrm:%.2x\n",
len.w.l, fill, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1)));
@@ -341,7 +341,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
c65_write_mem(space, dst.d++, fill);
break;
case 0x30:
- DBG_LOG(space->machine(), 1,"dma copy down",
+ DBG_LOG(space.machine(), 1,"dma copy down",
("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
len.w.l, src.d, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1) ) );
@@ -349,14 +349,14 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
c65_write_mem(space, dst.d--,c65_read_mem(space, src.d--));
break;
default:
- DBG_LOG(space->machine(), 1,"dma job",
+ DBG_LOG(space.machine(), 1,"dma job",
("cmd:%.2x len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
cmd,len.w.l, src.d, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1)));
}
break;
default:
- DBG_LOG(space->machine(), 1, "dma chip write", ("%.3x %.2x\n", offset, value));
+ DBG_LOG(space.machine(), 1, "dma chip write", ("%.3x %.2x\n", offset, value));
break;
}
}
@@ -615,48 +615,48 @@ static int c65_fdc_r( running_machine &machine, int offset )
static READ8_HANDLER( c65_ram_expansion_r )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
UINT8 data = 0xff;
- if (space->machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
+ if (space.machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
data = state->m_expansion_ram.reg;
return data;
}
static WRITE8_HANDLER( c65_ram_expansion_w )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
offs_t expansion_ram_begin;
offs_t expansion_ram_end;
- if (space->machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
+ if (space.machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
{
state->m_expansion_ram.reg = data;
expansion_ram_begin = 0x80000;
- expansion_ram_end = 0x80000 + (space->machine().device<ram_device>(RAM_TAG)->size() - 128*1024) - 1;
+ expansion_ram_end = 0x80000 + (space.machine().device<ram_device>(RAM_TAG)->size() - 128*1024) - 1;
if (data == 0x00) {
- space->install_readwrite_bank(expansion_ram_begin, expansion_ram_end,"bank16");
- state->membank("bank16")->set_base(space->machine().device<ram_device>(RAM_TAG)->pointer() + 128*1024);
+ space.install_readwrite_bank(expansion_ram_begin, expansion_ram_end,"bank16");
+ state->membank("bank16")->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer() + 128*1024);
} else {
- space->nop_readwrite(expansion_ram_begin, expansion_ram_end);
+ space.nop_readwrite(expansion_ram_begin, expansion_ram_end);
}
}
}
static WRITE8_HANDLER( c65_write_io )
{
- sid6581_device *sid_0 = space->machine().device<sid6581_device>("sid_r");
- sid6581_device *sid_1 = space->machine().device<sid6581_device>("sid_l");
- device_t *vic3 = space->machine().device("vic3");
+ sid6581_device *sid_0 = space.machine().device<sid6581_device>("sid_r");
+ sid6581_device *sid_1 = space.machine().device<sid6581_device>("sid_l");
+ device_t *vic3 = space.machine().device("vic3");
switch (offset & 0xf00)
{
case 0x000:
if (offset < 0x80)
- vic3_port_w(vic3, *space, offset & 0x7f, data);
+ vic3_port_w(vic3, space, offset & 0x7f, data);
else if (offset < 0xa0)
- c65_fdc_w(space->machine(), offset&0x1f,data);
+ c65_fdc_w(space.machine(), offset&0x1f,data);
else
{
c65_ram_expansion_w(space, offset&0x1f, data);
@@ -666,61 +666,61 @@ static WRITE8_HANDLER( c65_write_io )
case 0x100:
case 0x200:
case 0x300:
- vic3_palette_w(vic3, *space, offset - 0x100, data);
+ vic3_palette_w(vic3, space, offset - 0x100, data);
break;
case 0x400:
if (offset<0x420) /* maybe 0x20 */
- sid_0->write(*space, offset & 0x3f, data);
+ sid_0->write(space, offset & 0x3f, data);
else if (offset<0x440)
- sid_1->write(*space, offset & 0x3f, data);
+ sid_1->write(space, offset & 0x3f, data);
else
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
break;
case 0x500:
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
break;
case 0x600:
- c65_6511_port_w(space->machine(), offset&0xff,data);
+ c65_6511_port_w(space.machine(), offset&0xff,data);
break;
case 0x700:
- c65_dma_port_w(space->machine(), offset&0xff, data);
+ c65_dma_port_w(space.machine(), offset&0xff, data);
break;
}
}
static WRITE8_HANDLER( c65_write_io_dc00 )
{
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
switch (offset & 0xf00)
{
case 0x000:
- mos6526_w(cia_0, *space, offset, data);
+ mos6526_w(cia_0, space, offset, data);
break;
case 0x100:
- mos6526_w(cia_1, *space, offset, data);
+ mos6526_w(cia_1, space, offset, data);
break;
case 0x200:
case 0x300:
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset+0xc00, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset+0xc00, data));
break;
}
}
static READ8_HANDLER( c65_read_io )
{
- sid6581_device *sid_0 = space->machine().device<sid6581_device>("sid_r");
- sid6581_device *sid_1 = space->machine().device<sid6581_device>("sid_l");
- device_t *vic3 = space->machine().device("vic3");
+ sid6581_device *sid_0 = space.machine().device<sid6581_device>("sid_r");
+ sid6581_device *sid_1 = space.machine().device<sid6581_device>("sid_l");
+ device_t *vic3 = space.machine().device("vic3");
switch (offset & 0xf00)
{
case 0x000:
if (offset < 0x80)
- return vic3_port_r(vic3, *space, offset & 0x7f);
+ return vic3_port_r(vic3, space, offset & 0x7f);
if (offset < 0xa0)
- return c65_fdc_r(space->machine(), offset&0x1f);
+ return c65_fdc_r(space.machine(), offset&0x1f);
else
{
return c65_ram_expansion_r(space, offset&0x1f);
@@ -731,40 +731,40 @@ static READ8_HANDLER( c65_read_io )
case 0x200:
case 0x300:
/* read only !? */
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
break;
case 0x400:
if (offset < 0x420)
- return sid_0->read(*space, offset & 0x3f);
+ return sid_0->read(space, offset & 0x3f);
if (offset < 0x440)
- return sid_1->read(*space, offset & 0x3f);
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ return sid_1->read(space, offset & 0x3f);
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
break;
case 0x500:
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
break;
case 0x600:
- return c65_6511_port_r(space->machine(), offset&0xff);
+ return c65_6511_port_r(space.machine(), offset&0xff);
case 0x700:
- return c65_dma_port_r(space->machine(), offset&0xff);
+ return c65_dma_port_r(space.machine(), offset&0xff);
}
return 0xff;
}
static READ8_HANDLER( c65_read_io_dc00 )
{
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
switch (offset & 0x300)
{
case 0x000:
- return mos6526_r(cia_0, *space, offset);
+ return mos6526_r(cia_0, space, offset);
case 0x100:
- return mos6526_r(cia_1, *space, offset);
+ return mos6526_r(cia_1, space, offset);
case 0x200:
case 0x300:
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset+0xc00));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset+0xc00));
break;
}
return 0xff;
diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c
index fa651d64d23..a4e2712a9f4 100644
--- a/src/mess/machine/cgenie.c
+++ b/src/mess/machine/cgenie.c
@@ -19,8 +19,8 @@
#include "machine/ram.h"
#define AYWriteReg(chip,port,value) \
- ay8910_address_w(ay8910, *space, 0,port); \
- ay8910_data_w(ay8910, *space, 0,value)
+ ay8910_address_w(ay8910, space, 0,port); \
+ ay8910_data_w(ay8910, space, 0,value)
#define TAPE_HEADER "Colour Genie - Virtual Tape File"
@@ -47,7 +47,7 @@ static TIMER_CALLBACK( handle_cassette_input )
void cgenie_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
device_t *ay8910 = machine().device("ay8910");
UINT8 *ROM = memregion("maincpu")->base();
@@ -84,21 +84,21 @@ void cgenie_state::machine_reset()
{
if ( machine().root_device().ioport("DSW0")->read() & 0x80 )
{
- space->install_read_bank(0xc000, 0xdfff, "bank10");
- space->nop_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank10");
+ space.nop_write(0xc000, 0xdfff);
membank("bank10")->set_base(&ROM[0x0c000]);
logerror("cgenie DOS enabled\n");
memcpy(&ROM[0x0c000],&ROM[0x10000], 0x2000);
}
else
{
- space->nop_readwrite(0xc000, 0xdfff);
+ space.nop_readwrite(0xc000, 0xdfff);
logerror("cgenie DOS disabled (no floppy image given)\n");
}
}
else
{
- space->nop_readwrite(0xc000, 0xdfff);
+ space.nop_readwrite(0xc000, 0xdfff);
logerror("cgenie DOS disabled\n");
memset(&machine().root_device().memregion("maincpu")->base()[0x0c000], 0x00, 0x2000);
}
@@ -106,14 +106,14 @@ void cgenie_state::machine_reset()
/* copy EXT ROM, if enabled or wipe out that memory area */
if( machine().root_device().ioport("DSW0")->read() & 0x20 )
{
- space->install_rom(0xe000, 0xefff, 0); // mess 0135u3 need to check
+ space.install_rom(0xe000, 0xefff, 0); // mess 0135u3 need to check
logerror("cgenie EXT enabled\n");
memcpy(&machine().root_device().memregion("maincpu")->base()[0x0e000],
&machine().root_device().memregion("maincpu")->base()[0x12000], 0x1000);
}
else
{
- space->nop_readwrite(0xe000, 0xefff);
+ space.nop_readwrite(0xe000, 0xefff);
logerror("cgenie EXT disabled\n");
memset(&machine().root_device().memregion("maincpu")->base()[0x0e000], 0x00, 0x1000);
}
@@ -124,7 +124,7 @@ void cgenie_state::machine_reset()
void cgenie_state::machine_start()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *gfx = memregion("gfx2")->base();
int i;
@@ -147,8 +147,8 @@ void cgenie_state::machine_start()
memset(gfx + i * 8, i, 8);
/* set up RAM */
- space->install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
- space->install_legacy_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, FUNC(cgenie_videoram_w));
+ space.install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ space.install_legacy_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, FUNC(cgenie_videoram_w));
m_videoram = machine().device<ram_device>(RAM_TAG)->pointer();
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
machine().scheduler().timer_pulse(attotime::from_hz(11025), FUNC(handle_cassette_input));
@@ -173,10 +173,10 @@ void cgenie_state::machine_start()
WRITE8_HANDLER( cgenie_port_ff_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
int port_ff_changed = state->m_port_ff ^ data;
- space->machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? -1.0 : 1.0 );
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? -1.0 : 1.0 );
/* background bits changed ? */
if( port_ff_changed & FF_BGD )
@@ -224,7 +224,7 @@ WRITE8_HANDLER( cgenie_port_ff_w )
b = 15;
}
}
- palette_set_color_rgb(space->machine(), 0, r, g, b);
+ palette_set_color_rgb(space.machine(), 0, r, g, b);
}
/* character mode changed ? */
@@ -237,7 +237,7 @@ WRITE8_HANDLER( cgenie_port_ff_w )
/* graphics mode changed ? */
if( port_ff_changed & FF_FGR )
{
- cgenie_mode_select(space->machine(), data & FF_FGR);
+ cgenie_mode_select(space.machine(), data & FF_FGR);
}
state->m_port_ff = data;
@@ -246,7 +246,7 @@ WRITE8_HANDLER( cgenie_port_ff_w )
READ8_HANDLER( cgenie_port_ff_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
UINT8 data = state->m_port_ff & ~0x01;
data |= state->m_cass_bit;
@@ -268,25 +268,25 @@ int cgenie_port_xx_r( int offset )
READ8_HANDLER( cgenie_psg_port_a_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_psg_a_inp;
}
READ8_HANDLER( cgenie_psg_port_b_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
if( state->m_psg_a_out < 0xd0 )
{
/* comparator value */
state->m_psg_b_inp = 0x00;
- if( space->machine().root_device().ioport("JOY0")->read() > state->m_psg_a_out )
+ if( space.machine().root_device().ioport("JOY0")->read() > state->m_psg_a_out )
state->m_psg_b_inp |= 0x80;
- if( space->machine().root_device().ioport("JOY1")->read() > state->m_psg_a_out )
+ if( space.machine().root_device().ioport("JOY1")->read() > state->m_psg_a_out )
state->m_psg_b_inp |= 0x40;
- if( space->machine().root_device().ioport("JOY2")->read() > state->m_psg_a_out )
+ if( space.machine().root_device().ioport("JOY2")->read() > state->m_psg_a_out )
state->m_psg_b_inp |= 0x20;
if( state->ioport("JOY3")->read() > state->m_psg_a_out )
@@ -298,113 +298,113 @@ READ8_HANDLER( cgenie_psg_port_b_r )
state->m_psg_b_inp = 0xFF;
if( !(state->m_psg_a_out & 0x01) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP0")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP0")->read();
if( !(state->m_psg_a_out & 0x02) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP1")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP1")->read();
if( !(state->m_psg_a_out & 0x04) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP2")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP2")->read();
if( !(state->m_psg_a_out & 0x08) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP3")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP3")->read();
if( !(state->m_psg_a_out & 0x10) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP4")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP4")->read();
if( !(state->m_psg_a_out & 0x20) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP5")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP5")->read();
}
return state->m_psg_b_inp;
}
WRITE8_HANDLER( cgenie_psg_port_a_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_psg_a_out = data;
}
WRITE8_HANDLER( cgenie_psg_port_b_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_psg_b_out = data;
}
READ8_HANDLER( cgenie_status_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0 */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0;
- return wd17xx_status_r(fdc, *space, offset);
+ return wd17xx_status_r(fdc, space, offset);
}
READ8_HANDLER( cgenie_track_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
- return wd17xx_track_r(fdc, *space, offset);
+ return wd17xx_track_r(fdc, space, offset);
}
READ8_HANDLER( cgenie_sector_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
- return wd17xx_sector_r(fdc, *space, offset);
+ return wd17xx_sector_r(fdc, space, offset);
}
READ8_HANDLER(cgenie_data_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
- return wd17xx_data_r(fdc, *space, offset);
+ return wd17xx_data_r(fdc, space, offset);
}
WRITE8_HANDLER( cgenie_command_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return immediately */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_command_w(fdc, *space, offset, data);
+ wd17xx_command_w(fdc, space, offset, data);
}
WRITE8_HANDLER( cgenie_track_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_track_w(fdc, *space, offset, data);
+ wd17xx_track_w(fdc, space, offset, data);
}
WRITE8_HANDLER( cgenie_sector_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_sector_w(fdc, *space, offset, data);
+ wd17xx_sector_w(fdc, space, offset, data);
}
WRITE8_HANDLER( cgenie_data_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_data_w(fdc, *space, offset, data);
+ wd17xx_data_w(fdc, space, offset, data);
}
READ8_HANDLER( cgenie_irq_status_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
int result = state->m_irq_status;
state->m_irq_status &= ~(IRQ_TIMER | IRQ_FDC);
@@ -452,8 +452,8 @@ const wd17xx_interface cgenie_wd17xx_interface =
WRITE8_HANDLER( cgenie_motor_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
- device_t *fdc = space->machine().device("wd179x");
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
+ device_t *fdc = space.machine().device("wd179x");
UINT8 drive = 255;
logerror("cgenie motor_w $%02X\n", data);
@@ -488,28 +488,28 @@ WRITE8_HANDLER( cgenie_motor_w )
int result = 0;
if( offset & 0x01 )
- result |= space->machine().root_device().ioport("ROW0")->read();
+ result |= space.machine().root_device().ioport("ROW0")->read();
if( offset & 0x02 )
- result |= space->machine().root_device().ioport("ROW1")->read();
+ result |= space.machine().root_device().ioport("ROW1")->read();
if( offset & 0x04 )
- result |= space->machine().root_device().ioport("ROW2")->read();
+ result |= space.machine().root_device().ioport("ROW2")->read();
if( offset & 0x08 )
- result |= space->machine().root_device().ioport("ROW3")->read();
+ result |= space.machine().root_device().ioport("ROW3")->read();
if( offset & 0x10 )
- result |= space->machine().root_device().ioport("ROW4")->read();
+ result |= space.machine().root_device().ioport("ROW4")->read();
if( offset & 0x20 )
- result |= space->machine().root_device().ioport("ROW5")->read();
+ result |= space.machine().root_device().ioport("ROW5")->read();
if( offset & 0x40 )
- result |= space->machine().root_device().ioport("ROW6")->read();
+ result |= space.machine().root_device().ioport("ROW6")->read();
if( offset & 0x80 )
- result |= space->machine().root_device().ioport("ROW7")->read();
+ result |= space.machine().root_device().ioport("ROW7")->read();
return result;
}
@@ -527,7 +527,7 @@ int cgenie_videoram_r( running_machine &machine, int offset )
WRITE8_HANDLER( cgenie_videoram_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
UINT8 *videoram = state->m_videoram;
/* write to video RAM */
if( data == videoram[offset] )
@@ -537,13 +537,13 @@ WRITE8_HANDLER( cgenie_videoram_w )
READ8_HANDLER( cgenie_colorram_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_colorram[offset] | 0xf0;
}
WRITE8_HANDLER( cgenie_colorram_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
/* only bits 0 to 3 */
data &= 15;
/* nothing changed ? */
@@ -553,18 +553,18 @@ WRITE8_HANDLER( cgenie_colorram_w )
/* set new value */
state->m_colorram[offset] = data;
/* make offset relative to video frame buffer offset */
- offset = (offset + (cgenie_get_register(space->machine(), 12) << 8) + cgenie_get_register(space->machine(), 13)) & 0x3ff;
+ offset = (offset + (cgenie_get_register(space.machine(), 12) << 8) + cgenie_get_register(space.machine(), 13)) & 0x3ff;
}
READ8_HANDLER( cgenie_fontram_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_fontram[offset];
}
WRITE8_HANDLER( cgenie_fontram_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
UINT8 *dp;
if( data == state->m_fontram[offset] )
@@ -574,7 +574,7 @@ WRITE8_HANDLER( cgenie_fontram_w )
state->m_fontram[offset] = data;
/* convert eight pixels */
- dp = const_cast<UINT8 *>(space->machine().gfx[0]->get_data(256 + offset/8) + (offset % 8) * space->machine().gfx[0]->width());
+ dp = const_cast<UINT8 *>(space.machine().gfx[0]->get_data(256 + offset/8) + (offset % 8) * space.machine().gfx[0]->width());
dp[0] = (data & 0x80) ? 1 : 0;
dp[1] = (data & 0x40) ? 1 : 0;
dp[2] = (data & 0x20) ? 1 : 0;
@@ -599,7 +599,7 @@ INTERRUPT_GEN( cgenie_frame_interrupt )
state->m_tv_mode = state->ioport("DSW0")->read() & 0x10;
/* force setting of background color */
state->m_port_ff ^= FF_BGD0;
- cgenie_port_ff_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_port_ff ^ FF_BGD0);
+ cgenie_port_ff_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_port_ff ^ FF_BGD0);
}
}
diff --git a/src/mess/machine/comx_clm.c b/src/mess/machine/comx_clm.c
index 41ddcb834b9..4dd001b91ec 100644
--- a/src/mess/machine/comx_clm.c
+++ b/src/mess/machine/comx_clm.c
@@ -251,7 +251,7 @@ void comx_clm_device::comx_ds_w(int state)
UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
{
- address_space *space = machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine().firstcpu->space(AS_PROGRAM);
UINT8 data = 0xff;
@@ -265,7 +265,7 @@ UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
}
else if (offset == 0xd801)
{
- data = m_crtc->register_r(*space, 0);
+ data = m_crtc->register_r(space, 0);
}
return data;
@@ -278,7 +278,7 @@ UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
void comx_clm_device::comx_mwr_w(offs_t offset, UINT8 data)
{
- address_space *space = machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine().firstcpu->space(AS_PROGRAM);
if (offset >= 0xd000 && offset < 0xd800)
{
@@ -286,10 +286,10 @@ void comx_clm_device::comx_mwr_w(offs_t offset, UINT8 data)
}
else if (offset == 0xd800)
{
- m_crtc->address_w(*space, 0, data);
+ m_crtc->address_w(space, 0, data);
}
else if (offset == 0xd801)
{
- m_crtc->register_w(*space, 0, data);
+ m_crtc->register_w(space, 0, data);
}
}
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index 21fa573bb55..49634356280 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -276,7 +276,7 @@ READ16_MEMBER(concept_state::concept_io_r)
{
int slot = ((offset >> 4) & 7) - 1;
if (m_expansion_slots[slot].reg_read)
- return m_expansion_slots[slot].reg_read(&space, offset & 0xf);
+ return m_expansion_slots[slot].reg_read(space, offset & 0xf);
}
break;
@@ -299,7 +299,7 @@ READ16_MEMBER(concept_state::concept_io_r)
int slot = ((offset >> 8) & 7) - 1;
LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", slot, offset << 1));
if (m_expansion_slots[slot].rom_read)
- return m_expansion_slots[slot].rom_read(&space, offset & 0xff);
+ return m_expansion_slots[slot].rom_read(space, offset & 0xff);
}
break;
@@ -418,7 +418,7 @@ WRITE16_MEMBER(concept_state::concept_io_w)
LOG(("concept_io_w: Slot I/O register written for slot %d at address 0x03%4.4x, data: 0x%4.4x\n",
slot, offset << 1, data));
if (m_expansion_slots[slot].reg_write)
- m_expansion_slots[slot].reg_write(&space, offset & 0xf, data);
+ m_expansion_slots[slot].reg_write(space, offset & 0xf, data);
}
break;
@@ -441,7 +441,7 @@ WRITE16_MEMBER(concept_state::concept_io_w)
int slot = ((offset >> 8) & 7) - 1;
LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", slot, offset << 1, data));
if (m_expansion_slots[slot].rom_write)
- m_expansion_slots[slot].rom_write(&space, offset & 0xff, data);
+ m_expansion_slots[slot].rom_write(space, offset & 0xff, data);
}
break;
@@ -589,8 +589,8 @@ const wd17xx_interface concept_wd17xx_interface =
static READ8_HANDLER(concept_fdc_reg_r)
{
- concept_state *state = space->machine().driver_data<concept_state>();
- device_t *fdc = space->machine().device("wd179x");
+ concept_state *state = space.machine().driver_data<concept_state>();
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
case 0:
@@ -599,19 +599,19 @@ static READ8_HANDLER(concept_fdc_reg_r)
case 8:
/* FDC STATUS REG */
- return wd17xx_status_r(fdc, *space, offset);
+ return wd17xx_status_r(fdc, space, offset);
case 9:
/* FDC TRACK REG */
- return wd17xx_track_r(fdc, *space, offset);
+ return wd17xx_track_r(fdc, space, offset);
case 10:
/* FDC SECTOR REG */
- return wd17xx_sector_r(fdc, *space, offset);
+ return wd17xx_sector_r(fdc, space, offset);
case 11:
/* FDC DATA REG */
- return wd17xx_data_r(fdc, *space, offset);
+ return wd17xx_data_r(fdc, space, offset);
}
return 0;
@@ -619,9 +619,9 @@ static READ8_HANDLER(concept_fdc_reg_r)
static WRITE8_HANDLER(concept_fdc_reg_w)
{
- concept_state *state = space->machine().driver_data<concept_state>();
+ concept_state *state = space.machine().driver_data<concept_state>();
int current_drive;
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
case 0:
@@ -635,27 +635,27 @@ static WRITE8_HANDLER(concept_fdc_reg_w)
// floppy_drive_set_motor_state(floppy_get_device(machine, current_drive), (data & LC_MOTOROF_mask) == 0 ? 1 : 0);
/*flp_8in = (data & LC_FLP8IN_mask) != 0;*/
wd17xx_dden_w(fdc, BIT(data, 7));
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), current_drive), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), current_drive), 1, 0);
break;
case 8:
/* FDC COMMAMD REG */
- wd17xx_command_w(fdc, *space, offset, data);
+ wd17xx_command_w(fdc, space, offset, data);
break;
case 9:
/* FDC TRACK REG */
- wd17xx_track_w(fdc, *space, offset, data);
+ wd17xx_track_w(fdc, space, offset, data);
break;
case 10:
/* FDC SECTOR REG */
- wd17xx_sector_w(fdc, *space, offset, data);
+ wd17xx_sector_w(fdc, space, offset, data);
break;
case 11:
/* FDC DATA REG */
- wd17xx_data_w(fdc, *space, offset, data);
+ wd17xx_data_w(fdc, space, offset, data);
break;
}
}
diff --git a/src/mess/machine/corvushd.c b/src/mess/machine/corvushd.c
index 13c0b8818f2..d29a3097808 100644
--- a/src/mess/machine/corvushd.c
+++ b/src/mess/machine/corvushd.c
@@ -1622,14 +1622,14 @@ READ8_HANDLER ( corvus_hdc_data_r ) {
c->xmit_bytes = 0; // We don't have anything more to say
c->recv_bytes = 0; // No active commands
- space->machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_HTC_MODE);
+ space.machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_HTC_MODE);
// c->status &= ~(CONTROLLER_DIRECTION | CONTROLLER_BUSY); // Put us in Idle, Host-to-Controller mode
} else {
//
// Not finished with this packet. Insert an interbyte delay and then let the host continue
//
- space->machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
+ space.machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
}
return result;
@@ -1692,7 +1692,7 @@ WRITE8_HANDLER ( corvus_hdc_data_w ) {
// to the user with us Ready for more data and in Host-to-Controller mode.
//
if(c->offset == c->recv_bytes) { // We've received enough data to process
- corvus_process_command_packet(space->machine(), c->invalid_command_flag);
+ corvus_process_command_packet(space.machine(), c->invalid_command_flag);
} else {
//
// Reset the four-second timer since we received some data
@@ -1703,6 +1703,6 @@ WRITE8_HANDLER ( corvus_hdc_data_w ) {
// Make the controller busy for a few microseconds while the command is processed
//
c->status |= CONTROLLER_BUSY;
- space->machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
+ space.machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
}
}
diff --git a/src/mess/machine/cpc_ssa1.c b/src/mess/machine/cpc_ssa1.c
index d8f3e5d71db..59586d1a407 100644
--- a/src/mess/machine/cpc_ssa1.c
+++ b/src/mess/machine/cpc_ssa1.c
@@ -187,28 +187,28 @@ cpc_dkspeech_device::cpc_dkspeech_device(const machine_config &mconfig, const ch
void cpc_ssa1_device::device_start()
{
device_t* cpu = machine().device("maincpu");
- address_space* space = cpu->memory().space(AS_IO);
+ address_space& space = *cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
m_rom = memregion("sp0256")->base();
// m_sp0256_device = subdevice("sp0256");
- space->install_readwrite_handler(0xfaee,0xfaee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
- space->install_readwrite_handler(0xfbee,0xfbee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
+ space.install_readwrite_handler(0xfaee,0xfaee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
+ space.install_readwrite_handler(0xfbee,0xfbee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
}
void cpc_dkspeech_device::device_start()
{
device_t* cpu = machine().device("maincpu");
- address_space* space = cpu->memory().space(AS_IO);
+ address_space& space = *cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
m_rom = memregion("sp0256")->base();
// m_sp0256_device = subdevice("sp0256");
- space->install_readwrite_handler(0xfbfe,0xfbfe,0,0,read8_delegate(FUNC(cpc_dkspeech_device::dkspeech_r),this),write8_delegate(FUNC(cpc_dkspeech_device::dkspeech_w),this));
+ space.install_readwrite_handler(0xfbfe,0xfbfe,0,0,read8_delegate(FUNC(cpc_dkspeech_device::dkspeech_r),this),write8_delegate(FUNC(cpc_dkspeech_device::dkspeech_w),this));
}
//-------------------------------------------------
diff --git a/src/mess/machine/dccons.c b/src/mess/machine/dccons.c
index 3d672c6ee84..4a3ebf2231d 100644
--- a/src/mess/machine/dccons.c
+++ b/src/mess/machine/dccons.c
@@ -147,7 +147,7 @@ static TIMER_CALLBACK( atapi_xfer_end )
static READ32_HANDLER( atapi_r )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
int reg, data;
if (mem_mask == 0x0000ffff) // word-wide command read
@@ -261,7 +261,7 @@ static READ32_HANDLER( atapi_r )
}
#endif
- mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, space->device().safe_pc());
+ mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, space.device().safe_pc());
}
// printf( "atapi_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
@@ -270,7 +270,7 @@ static READ32_HANDLER( atapi_r )
static WRITE32_HANDLER( atapi_w )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
int reg;
// printf( "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
@@ -369,7 +369,7 @@ static WRITE32_HANDLER( atapi_w )
case 0x45: // PLAY
atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY;
- atapi_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime(ATAPI_CYCLES_PER_SECTOR ) );
+ atapi_timer->adjust( downcast<cpu_device *>(&space.device())->cycles_to_attotime(ATAPI_CYCLES_PER_SECTOR ) );
break;
}
@@ -420,11 +420,11 @@ static WRITE32_HANDLER( atapi_w )
}
#endif
atapi_regs[reg] = data;
-// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, space->device().safe_pc());
+// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, space.device().safe_pc());
if (reg == ATAPI_REG_CMDSTATUS)
{
- printf("ATAPI command %x issued! (PC=%x)\n", data, space->device().safe_pc());
+ printf("ATAPI command %x issued! (PC=%x)\n", data, space.device().safe_pc());
switch (data)
{
@@ -491,7 +491,7 @@ static WRITE32_HANDLER( atapi_w )
atapi_regs[ATAPI_REG_COUNTLOW] = 0;
atapi_regs[ATAPI_REG_COUNTHIGH] = 2;
- gdrom_raise_irq(space->machine());
+ gdrom_raise_irq(space.machine());
break;
case 0xef: // SET FEATURES
@@ -512,7 +512,7 @@ static WRITE32_HANDLER( atapi_w )
atapi_data_ptr = 0;
atapi_data_len = 0;
- gdrom_raise_irq(space->machine());
+ gdrom_raise_irq(space.machine());
break;
default:
@@ -603,7 +603,7 @@ READ64_HANDLER( dc_mess_gdrom_r )
off=offset << 1;
}
-// printf("gdrom_r: @ %x (off %x), mask %llx (PC %x)\n", offset, off, mem_mask, space->device().safe_pc());
+// printf("gdrom_r: @ %x (off %x), mask %llx (PC %x)\n", offset, off, mem_mask, space.device().safe_pc());
if (offset == 3)
{
@@ -632,7 +632,7 @@ WRITE64_HANDLER( dc_mess_gdrom_w )
off=offset << 1;
}
-// printf("GDROM: [%08x=%x]write %llx to %x, mask %llx (PC %x)\n", 0x5f7000+off*4, dat, data, offset, mem_mask, space->device().safe_pc());
+// printf("GDROM: [%08x=%x]write %llx to %x, mask %llx (PC %x)\n", 0x5f7000+off*4, dat, data, offset, mem_mask, space.device().safe_pc());
if (off >= 0x20)
{
@@ -667,23 +667,23 @@ INLINE int decode_reg32_64(running_machine &machine, UINT32 offset, UINT64 mem_m
READ64_HANDLER( dc_mess_g1_ctrl_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
mame_printf_verbose("G1CTRL: Unmapped read %08x\n", 0x5f7400+reg*4);
return (UINT64)state->g1bus_regs[reg] << shift;
}
WRITE64_HANDLER( dc_mess_g1_ctrl_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat; //, old
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
// old = state->g1bus_regs[reg];
@@ -701,7 +701,7 @@ WRITE64_HANDLER( dc_mess_g1_ctrl_w )
}
atapi_xferbase = state->g1bus_regs[SB_GDSTAR];
- atapi_timer->adjust(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))));
+ atapi_timer->adjust(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))));
}
break;
}
diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c
index 4ab54b510bc..983c9b999bd 100644
--- a/src/mess/machine/dgn_beta.c
+++ b/src/mess/machine/dgn_beta.c
@@ -366,7 +366,7 @@ static void SetDefaultTask(running_machine &machine)
// Return the value of a page register
READ8_HANDLER( dgn_beta_page_r )
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
return state->m_PageRegs[state->m_PIATaskReg][offset].value;
}
@@ -376,16 +376,16 @@ READ8_HANDLER( dgn_beta_page_r )
WRITE8_HANDLER( dgn_beta_page_w )
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
state->m_PageRegs[state->m_PIATaskReg][offset].value=data;
LOG_PAGE_WRITE(("PageRegWrite : task=$%X offset=$%X value=$%X\n",state->m_PIATaskReg,offset,data));
if (state->m_EnableMapRegs)
{
- UpdateBanks(space->machine(), offset,offset);
+ UpdateBanks(space.machine(), offset,offset);
if (offset==15)
- UpdateBanks(space->machine(), offset+1,offset+1);
+ UpdateBanks(space.machine(), offset+1,offset+1);
}
}
@@ -399,87 +399,87 @@ static void dgn_beta_bank_memory(running_machine &machine, int offset, int data,
static WRITE8_HANDLER( dgnbeta_ram_b0_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,0);
+ dgn_beta_bank_memory(space.machine(),offset,data,0);
}
static WRITE8_HANDLER( dgnbeta_ram_b1_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,1);
+ dgn_beta_bank_memory(space.machine(),offset,data,1);
}
static WRITE8_HANDLER( dgnbeta_ram_b2_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,2);
+ dgn_beta_bank_memory(space.machine(),offset,data,2);
}
static WRITE8_HANDLER( dgnbeta_ram_b3_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,3);
+ dgn_beta_bank_memory(space.machine(),offset,data,3);
}
static WRITE8_HANDLER( dgnbeta_ram_b4_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,4);
+ dgn_beta_bank_memory(space.machine(),offset,data,4);
}
static WRITE8_HANDLER( dgnbeta_ram_b5_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,5);
+ dgn_beta_bank_memory(space.machine(),offset,data,5);
}
static WRITE8_HANDLER( dgnbeta_ram_b6_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,6);
+ dgn_beta_bank_memory(space.machine(),offset,data,6);
}
static WRITE8_HANDLER( dgnbeta_ram_b7_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,7);
+ dgn_beta_bank_memory(space.machine(),offset,data,7);
}
static WRITE8_HANDLER( dgnbeta_ram_b8_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,8);
+ dgn_beta_bank_memory(space.machine(),offset,data,8);
}
static WRITE8_HANDLER( dgnbeta_ram_b9_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,9);
+ dgn_beta_bank_memory(space.machine(),offset,data,9);
}
static WRITE8_HANDLER( dgnbeta_ram_bA_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,10);
+ dgn_beta_bank_memory(space.machine(),offset,data,10);
}
static WRITE8_HANDLER( dgnbeta_ram_bB_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,11);
+ dgn_beta_bank_memory(space.machine(),offset,data,11);
}
static WRITE8_HANDLER( dgnbeta_ram_bC_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,12);
+ dgn_beta_bank_memory(space.machine(),offset,data,12);
}
static WRITE8_HANDLER( dgnbeta_ram_bD_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,13);
+ dgn_beta_bank_memory(space.machine(),offset,data,13);
}
static WRITE8_HANDLER( dgnbeta_ram_bE_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,14);
+ dgn_beta_bank_memory(space.machine(),offset,data,14);
}
static WRITE8_HANDLER( dgnbeta_ram_bF_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,15);
+ dgn_beta_bank_memory(space.machine(),offset,data,15);
}
static WRITE8_HANDLER( dgnbeta_ram_bG_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,16);
+ dgn_beta_bank_memory(space.machine(),offset,data,16);
}
/*
@@ -934,22 +934,22 @@ const wd17xx_interface dgnbeta_wd17xx_interface =
READ8_HANDLER(dgnbeta_wd2797_r)
{
int result = 0;
- device_t *fdc = space->machine().device(FDC_TAG);
+ device_t *fdc = space.machine().device(FDC_TAG);
switch(offset & 0x03)
{
case 0:
- result = wd17xx_status_r(fdc, *space, 0);
+ result = wd17xx_status_r(fdc, space, 0);
LOG_DISK(("Disk status=%2.2X\n",result));
break;
case 1:
- result = wd17xx_track_r(fdc, *space, 0);
+ result = wd17xx_track_r(fdc, space, 0);
break;
case 2:
- result = wd17xx_sector_r(fdc, *space, 0);
+ result = wd17xx_sector_r(fdc, space, 0);
break;
case 3:
- result = wd17xx_data_r(fdc, *space, 0);
+ result = wd17xx_data_r(fdc, space, 0);
break;
default:
break;
@@ -960,8 +960,8 @@ READ8_HANDLER(dgnbeta_wd2797_r)
WRITE8_HANDLER(dgnbeta_wd2797_w)
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
- device_t *fdc = space->machine().device(FDC_TAG);
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
+ device_t *fdc = space.machine().device(FDC_TAG);
state->m_wd2797_written=1;
@@ -972,16 +972,16 @@ WRITE8_HANDLER(dgnbeta_wd2797_w)
/* But only for Type 3/4 commands */
if(data & 0x80)
wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0);
- wd17xx_command_w(fdc, *space, 0, data);
+ wd17xx_command_w(fdc, space, 0, data);
break;
case 1:
- wd17xx_track_w(fdc, *space, 0, data);
+ wd17xx_track_w(fdc, space, 0, data);
break;
case 2:
- wd17xx_sector_w(fdc, *space, 0, data);
+ wd17xx_sector_w(fdc, space, 0, data);
break;
case 3:
- wd17xx_data_w(fdc, *space, 0, data);
+ wd17xx_data_w(fdc, space, 0, data);
break;
};
}
diff --git a/src/mess/machine/europc.c b/src/mess/machine/europc.c
index afe31335093..0eef5b92566 100644
--- a/src/mess/machine/europc.c
+++ b/src/mess/machine/europc.c
@@ -114,15 +114,15 @@ WRITE8_HANDLER ( europc_jim_w )
}
// mode= data&0x10?AGA_COLOR:AGA_MONO;
// mode= data&0x10?AGA_COLOR:AGA_OFF;
- pc_aga_set_mode(space->machine(), europc_jim.mode);
+ pc_aga_set_mode(space.machine(), europc_jim.mode);
if (data & 0x80) europc_jim.state = 0;
break;
case 4:
switch(data & 0xc0)
{
- case 0x00: space->machine().device("maincpu")->set_clock_scale(1.0 / 2); break;
- case 0x40: space->machine().device("maincpu")->set_clock_scale(3.0 / 4); break;
- default: space->machine().device("maincpu")->set_clock_scale(1); break;
+ case 0x00: space.machine().device("maincpu")->set_clock_scale(1.0 / 2); break;
+ case 0x40: space.machine().device("maincpu")->set_clock_scale(3.0 / 4); break;
+ default: space.machine().device("maincpu")->set_clock_scale(1); break;
}
break;
case 0xa:
@@ -178,8 +178,8 @@ WRITE8_HANDLER( europc_pio_w )
europc_pio.port61=data;
// if (data == 0x30) pc1640.port62 = (pc1640.port65 & 0x10) >> 4;
// else if (data == 0x34) pc1640.port62 = pc1640.port65 & 0xf;
- pit8253_gate2_w(space->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata(space->machine(), BIT(data, 1));
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata(space.machine(), BIT(data, 1));
pc_keyb_set_clock(BIT(data, 6));
break;
}
@@ -201,7 +201,7 @@ WRITE8_HANDLER( europc_pio_w )
data = europc_pio.port61;
break;
case 2:
- if (pit8253_get_output(space->machine().device("pit8253"), 2))
+ if (pit8253_get_output(space.machine().device("pit8253"), 2))
data |= 0x20;
break;
}
diff --git a/src/mess/machine/galaxy.c b/src/mess/machine/galaxy.c
index f9e76756319..937985f41c7 100644
--- a/src/mess/machine/galaxy.c
+++ b/src/mess/machine/galaxy.c
@@ -155,13 +155,13 @@ SNAPSHOT_LOAD( galaxy )
DRIVER_INIT_MEMBER(galaxy_state,galaxy)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_readwrite_bank( 0x2800, 0x2800 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_readwrite_bank( 0x2800, 0x2800 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
if (machine().device<ram_device>(RAM_TAG)->size() < (6 + 48) * 1024)
{
- space->nop_readwrite( 0x2800 + machine().device<ram_device>(RAM_TAG)->size(), 0xffff);
+ space.nop_readwrite( 0x2800 + machine().device<ram_device>(RAM_TAG)->size(), 0xffff);
}
}
@@ -171,15 +171,15 @@ DRIVER_INIT_MEMBER(galaxy_state,galaxy)
MACHINE_RESET_MEMBER(galaxy_state,galaxy)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* ROM 2 enable/disable */
if (machine().root_device().ioport("ROM2")->read()) {
- space->install_read_bank(0x1000, 0x1fff, "bank10");
+ space.install_read_bank(0x1000, 0x1fff, "bank10");
} else {
- space->nop_read(0x1000, 0x1fff);
+ space.nop_read(0x1000, 0x1fff);
}
- space->nop_write(0x1000, 0x1fff);
+ space.nop_write(0x1000, 0x1fff);
if (machine().root_device().ioport("ROM2")->read())
membank("bank10")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1000);
@@ -196,7 +196,7 @@ DRIVER_INIT_MEMBER(galaxy_state,galaxyp)
MACHINE_RESET_MEMBER(galaxy_state,galaxyp)
{
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(galaxy_irq_callback);
@@ -205,8 +205,8 @@ MACHINE_RESET_MEMBER(galaxy_state,galaxyp)
ROM[0x03fa] = 0x00;
ROM[0x03fb] = 0xe0;
- space->install_read_bank(0xe000, 0xefff, "bank11");
- space->nop_write(0xe000, 0xefff);
+ space.install_read_bank(0xe000, 0xefff, "bank11");
+ space.nop_write(0xe000, 0xefff);
membank("bank11")->set_base(memregion("maincpu")->base() + 0xe000);
m_interrupts_enabled = TRUE;
}
diff --git a/src/mess/machine/gb.c b/src/mess/machine/gb.c
index 9d23997a3e0..2c4b9fa4a56 100644
--- a/src/mess/machine/gb.c
+++ b/src/mess/machine/gb.c
@@ -154,7 +154,7 @@ static void gb_rom8_6000( running_machine &machine, UINT8 *addr )
static void gb_init(running_machine &machine)
{
gb_state *state = machine.driver_data<gb_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
/* Initialize the memory banks */
state->m_MBC1Mode = 0;
@@ -182,63 +182,63 @@ static void gb_init(running_machine &machine)
case MBC_NONE:
break;
case MBC_MMM01:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_0000_w),state) );
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_2000_w),state));
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_4000_w),state));
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_6000_w),state));
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_0000_w),state) );
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_2000_w),state));
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_4000_w),state));
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_6000_w),state));
break;
case MBC_MBC1:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1),state) );
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1),state) );
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1),state) );
break;
case MBC_MBC2:
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc2),state) );
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc2),state) );
break;
case MBC_MBC3:
case MBC_HUC1: /* Possibly wrong */
case MBC_HUC3: /* Possibly wrong */
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc3),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc3),state) );
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc3),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc3),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc3),state) );
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc3),state) );
break;
case MBC_MBC5:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc5),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc5),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc5),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc5),state) );
break;
case MBC_MBC6:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc6),state) );
- space->install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_1),state) );
- space->install_write_handler( 0x3000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_2),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc6),state) );
+ space.install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_1),state) );
+ space.install_write_handler( 0x3000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_2),state) );
break;
case MBC_MBC7:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
- space->install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc7),state) );
- space->install_write_handler( 0x3000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_unknown_mbc7),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
+ space.install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc7),state) );
+ space.install_write_handler( 0x3000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_unknown_mbc7),state) );
break;
case MBC_TAMA5:
- space->install_write_handler( 0xA000, 0xBFFF, write8_delegate(FUNC(gb_state::gb_ram_tama5),state) );
+ space.install_write_handler( 0xA000, 0xBFFF, write8_delegate(FUNC(gb_state::gb_ram_tama5),state) );
break;
case MBC_WISDOM:
- space->install_write_handler( 0x0000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_wisdom),state) );
+ space.install_write_handler( 0x0000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_wisdom),state) );
break;
case MBC_MBC1_KOR:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1_kor),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1_kor),state) );
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1_kor),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1_kor),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1_kor),state) );
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1_kor),state) );
break;
case MBC_MEGADUCK:
- space->install_write_handler( 0x0001, 0x0001, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type1),state) );
- space->install_write_handler( 0xB000, 0xB000, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type2),state) );
+ space.install_write_handler( 0x0001, 0x0001, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type1),state) );
+ space.install_write_handler( 0xB000, 0xB000, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type2),state) );
break;
}
- gb_sound_w(space->machine().device("custom"), *space, 0x16, 0x00 ); /* Initialize sound hardware */
+ gb_sound_w(space.machine().device("custom"), space, 0x16, 0x00 ); /* Initialize sound hardware */
state->m_divcount = 0;
state->m_triggering_irq = 0;
diff --git a/src/mess/machine/hd63450.c b/src/mess/machine/hd63450.c
index 26c1f1df0ee..0e4c5c35b25 100644
--- a/src/mess/machine/hd63450.c
+++ b/src/mess/machine/hd63450.c
@@ -237,7 +237,7 @@ void hd63450_write(device_t* device, int offset, int data, UINT16 mem_mask)
static void dma_transfer_start(device_t* device, int channel, int dir)
{
- address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
hd63450_t* dmac = get_safe_token(device);
dmac->in_progress[channel] = 1;
dmac->reg[channel].csr &= ~0xe0;
@@ -245,9 +245,9 @@ static void dma_transfer_start(device_t* device, int channel, int dir)
dmac->reg[channel].csr &= ~0x30; // Reset Error and Normal termination bits
if((dmac->reg[channel].ocr & 0x0c) != 0x00) // Array chain or Link array chain
{
- dmac->reg[channel].mar = space->read_word(dmac->reg[channel].bar) << 16;
- dmac->reg[channel].mar |= space->read_word(dmac->reg[channel].bar+2);
- dmac->reg[channel].mtc = space->read_word(dmac->reg[channel].bar+4);
+ dmac->reg[channel].mar = space.read_word(dmac->reg[channel].bar) << 16;
+ dmac->reg[channel].mar |= space.read_word(dmac->reg[channel].bar+2);
+ dmac->reg[channel].mtc = space.read_word(dmac->reg[channel].bar+4);
if(dmac->reg[channel].btc > 0)
dmac->reg[channel].btc--;
}
@@ -314,7 +314,7 @@ static void dma_transfer_continue(device_t* device, int channel)
void hd63450_single_transfer(device_t* device, int x)
{
- address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
int data;
int datasize = 1;
hd63450_t* dmac = get_safe_token(device);
@@ -328,7 +328,7 @@ void hd63450_single_transfer(device_t* device, int x)
data = dmac->intf->dma_read[x](device->machine(),dmac->reg[x].mar);
if(data == -1)
return; // not ready to receive data
- space->write_byte(dmac->reg[x].mar,data);
+ space.write_byte(dmac->reg[x].mar,data);
datasize = 1;
}
else
@@ -336,25 +336,25 @@ void hd63450_single_transfer(device_t* device, int x)
switch(dmac->reg[x].ocr & 0x30) // operation size
{
case 0x00: // 8 bit
- data = space->read_byte(dmac->reg[x].dar); // read from device address
- space->write_byte(dmac->reg[x].mar, data); // write to memory address
+ data = space.read_byte(dmac->reg[x].dar); // read from device address
+ space.write_byte(dmac->reg[x].mar, data); // write to memory address
datasize = 1;
break;
case 0x10: // 16 bit
- data = space->read_word(dmac->reg[x].dar); // read from device address
- space->write_word(dmac->reg[x].mar, data); // write to memory address
+ data = space.read_word(dmac->reg[x].dar); // read from device address
+ space.write_word(dmac->reg[x].mar, data); // write to memory address
datasize = 2;
break;
case 0x20: // 32 bit
- data = space->read_word(dmac->reg[x].dar) << 16; // read from device address
- data |= space->read_word(dmac->reg[x].dar+2);
- space->write_word(dmac->reg[x].mar, (data & 0xffff0000) >> 16); // write to memory address
- space->write_word(dmac->reg[x].mar+2, data & 0x0000ffff);
+ data = space.read_word(dmac->reg[x].dar) << 16; // read from device address
+ data |= space.read_word(dmac->reg[x].dar+2);
+ space.write_word(dmac->reg[x].mar, (data & 0xffff0000) >> 16); // write to memory address
+ space.write_word(dmac->reg[x].mar+2, data & 0x0000ffff);
datasize = 4;
break;
case 0x30: // 8 bit packed (?)
- data = space->read_byte(dmac->reg[x].dar); // read from device address
- space->write_byte(dmac->reg[x].mar, data); // write to memory address
+ data = space.read_byte(dmac->reg[x].dar); // read from device address
+ space.write_byte(dmac->reg[x].mar, data); // write to memory address
datasize = 1;
break;
}
@@ -365,7 +365,7 @@ void hd63450_single_transfer(device_t* device, int x)
{
if(dmac->intf->dma_write[x])
{
- data = space->read_byte(dmac->reg[x].mar);
+ data = space.read_byte(dmac->reg[x].mar);
dmac->intf->dma_write[x](device->machine(), dmac->reg[x].mar,data);
datasize = 1;
}
@@ -374,25 +374,25 @@ void hd63450_single_transfer(device_t* device, int x)
switch(dmac->reg[x].ocr & 0x30) // operation size
{
case 0x00: // 8 bit
- data = space->read_byte(dmac->reg[x].mar); // read from memory address
- space->write_byte(dmac->reg[x].dar, data); // write to device address
+ data = space.read_byte(dmac->reg[x].mar); // read from memory address
+ space.write_byte(dmac->reg[x].dar, data); // write to device address
datasize = 1;
break;
case 0x10: // 16 bit
- data = space->read_word(dmac->reg[x].mar); // read from memory address
- space->write_word(dmac->reg[x].dar, data); // write to device address
+ data = space.read_word(dmac->reg[x].mar); // read from memory address
+ space.write_word(dmac->reg[x].dar, data); // write to device address
datasize = 2;
break;
case 0x20: // 32 bit
- data = space->read_word(dmac->reg[x].mar) << 16; // read from memory address
- data |= space->read_word(dmac->reg[x].mar+2); // read from memory address
- space->write_word(dmac->reg[x].dar, (data & 0xffff0000) >> 16); // write to device address
- space->write_word(dmac->reg[x].dar+2, data & 0x0000ffff); // write to device address
+ data = space.read_word(dmac->reg[x].mar) << 16; // read from memory address
+ data |= space.read_word(dmac->reg[x].mar+2); // read from memory address
+ space.write_word(dmac->reg[x].dar, (data & 0xffff0000) >> 16); // write to device address
+ space.write_word(dmac->reg[x].dar+2, data & 0x0000ffff); // write to device address
datasize = 4;
break;
case 0x30: // 8 bit packed (?)
- data = space->read_byte(dmac->reg[x].mar); // read from memory address
- space->write_byte(dmac->reg[x].dar, data); // write to device address
+ data = space.read_byte(dmac->reg[x].mar); // read from memory address
+ space.write_byte(dmac->reg[x].dar, data); // write to device address
datasize = 1;
break;
}
@@ -424,9 +424,9 @@ void hd63450_single_transfer(device_t* device, int x)
{
dmac->reg[x].btc--;
dmac->reg[x].bar+=6;
- dmac->reg[x].mar = space->read_word(dmac->reg[x].bar) << 16;
- dmac->reg[x].mar |= space->read_word(dmac->reg[x].bar+2);
- dmac->reg[x].mtc = space->read_word(dmac->reg[x].bar+4);
+ dmac->reg[x].mar = space.read_word(dmac->reg[x].bar) << 16;
+ dmac->reg[x].mar |= space.read_word(dmac->reg[x].bar+2);
+ dmac->reg[x].mtc = space.read_word(dmac->reg[x].bar+4);
return;
}
dmac->timer[x]->adjust(attotime::zero);
diff --git a/src/mess/machine/hec2hrp.c b/src/mess/machine/hec2hrp.c
index 979259380de..e9c589de947 100644
--- a/src/mess/machine/hec2hrp.c
+++ b/src/mess/machine/hec2hrp.c
@@ -55,7 +55,7 @@
#endif
static void Mise_A_Jour_Etat(running_machine &machine, int Adresse, int Value );
-static void Update_Sound(address_space *space, UINT8 data);
+static void Update_Sound(address_space &space, UINT8 data);
static cassette_image_device *cassette_device_image(running_machine &machine);
@@ -115,7 +115,7 @@ void hector_minidisc_init(running_machine &machine)
/* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
floppy_mon_w(floppy_get_device(machine, 0), 0); // Moteur floppy A:
- //floppy_mon_w(floppy_get_device(space->machine(), 1), BIT(data, 7)); // Moteur floppy B:, not implanted on the real machine
+ //floppy_mon_w(floppy_get_device(space.machine(), 1), BIT(data, 7)); // Moteur floppy B:, not implanted on the real machine
//Set the drive ready !
floppy_drive_set_ready_state(floppy_get_device(machine, 0), FLOPPY_DRIVE_READY, 0);// Disc 0 ready !
@@ -307,12 +307,12 @@ READ8_MEMBER(hec2hrp_state::hector_keyboard_r)
WRITE8_MEMBER(hec2hrp_state::hector_sn_2000_w)
{
Mise_A_Jour_Etat(machine(), 0x2000+ offset, data);
- Update_Sound(&space, data);
+ Update_Sound(space, data);
}
WRITE8_MEMBER(hec2hrp_state::hector_sn_2800_w)
{
Mise_A_Jour_Etat(machine(), 0x2800+ offset, data);
- Update_Sound(&space, data);
+ Update_Sound(space, data);
}
READ8_MEMBER(hec2hrp_state::hector_cassette_r)
{
@@ -364,7 +364,7 @@ WRITE8_MEMBER(hec2hrp_state::hector_sn_3000_w)
{
/* Update sn76477 only when necessary!*/
Mise_A_Jour_Etat( machine(), 0x3000, data & 7 );
- Update_Sound(&space, data & 7);
+ Update_Sound(space, data & 7);
}
m_oldstate3000 = data & 7;
}
@@ -790,11 +790,11 @@ static void Init_Value_SN76477_Hector(running_machine &machine)
state->m_ValMixer = 0;
}
-static void Update_Sound(address_space *space, UINT8 data)
+static void Update_Sound(address_space &space, UINT8 data)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* keep device*/
- device_t *sn76477 = space->machine().device("sn76477");
+ device_t *sn76477 = space.machine().device("sn76477");
/* MIXER*/
sn76477_mixer_a_w(sn76477, ((state->m_ValMixer & 0x04)==4) ? 1 : 0);
diff --git a/src/mess/machine/hecdisk2.c b/src/mess/machine/hecdisk2.c
index bf6a97b32d5..aaf28a31bb1 100644
--- a/src/mess/machine/hecdisk2.c
+++ b/src/mess/machine/hecdisk2.c
@@ -165,14 +165,14 @@ void hector_disc2_reset(running_machine &machine)
/*****************************************************************************/
READ8_HANDLER( hector_disc2_io00_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Switch Disc 2 to RAM to let full RAM acces */
state->membank("bank3")->set_entry(DISCII_BANK_RAM);
return 0;
}
WRITE8_HANDLER( hector_disc2_io00_port_w)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Switch Disc 2 to RAM to let full RAM acces */
state->membank("bank3")->set_entry(DISCII_BANK_RAM);
}
@@ -187,7 +187,7 @@ WRITE8_HANDLER( hector_disc2_io20_port_w)
}
READ8_HANDLER( hector_disc2_io30_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
return state->m_hector_disc2_data_r_ready;
}
WRITE8_HANDLER( hector_disc2_io30_port_w)
@@ -197,7 +197,7 @@ WRITE8_HANDLER( hector_disc2_io30_port_w)
READ8_HANDLER( hector_disc2_io40_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Read data send by Hector, by Disc2*/
state->m_hector_disc2_data_r_ready = 0x00; /* Clear memory info read ready*/
return state->m_hector_disc2_data_read; /* send the data !*/
@@ -205,27 +205,27 @@ READ8_HANDLER( hector_disc2_io40_port_r)
WRITE8_HANDLER( hector_disc2_io40_port_w) /* Write data send by Disc2, to Hector*/
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
state->m_hector_disc2_data_write = data; /* Memorization data*/
state->m_hector_disc2_data_w_ready = 0x80; /* Memorization data write ready in D7*/
}
READ8_HANDLER( hector_disc2_io50_port_r) /*Read memory info write ready*/
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
return state->m_hector_disc2_data_w_ready;
}
WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
- device_t *fdc = space->machine().device("upd765");
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
+ device_t *fdc = space.machine().device("upd765");
/* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
- floppy_mon_w(floppy_get_device(space->machine(), 0), BIT(data, 0)); // Moteur floppy A:
- floppy_mon_w(floppy_get_device(space->machine(), 1), BIT(data, 1)); // Moteur floppy B:
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), FLOPPY_DRIVE_READY,!BIT(data, 0));
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 1), FLOPPY_DRIVE_READY,!BIT(data, 1));
+ floppy_mon_w(floppy_get_device(space.machine(), 0), BIT(data, 0)); // Moteur floppy A:
+ floppy_mon_w(floppy_get_device(space.machine(), 1), BIT(data, 1)); // Moteur floppy B:
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), FLOPPY_DRIVE_READY,!BIT(data, 0));
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), FLOPPY_DRIVE_READY,!BIT(data, 1));
/* Write bit TC uPD765 on D4 of port I/O 50 */
upd765_tc_w(fdc, BIT(data, 4)); // Seems not used...
@@ -236,7 +236,7 @@ WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
/* if RNMI is OK, try to lauch an NMI*/
if (state->m_hector_disc2_RNMI)
- valid_interrupt(space->machine());
+ valid_interrupt(space.machine());
}
//Here we must take the exchange with uPD against AM_DEVREADWRITE
@@ -245,10 +245,10 @@ WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
// AM_RANGE(0x061,0x061) AM_DEVREADWRITE("upd765",upd765_data_r,upd765_data_w)
READ8_HANDLER( hector_disc2_io61_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
UINT8 data;
- device_t *fdc = space->machine().device("upd765");
- data = upd765_data_r(fdc,*space, 0); //Get the result
+ device_t *fdc = space.machine().device("upd765");
+ data = upd765_data_r(fdc,space, 0); //Get the result
// if ST0 == 0x28 (drive A:) or 0x29 (drive B:) => add 0x40
// and correct the ST1 and ST2 (patch)
@@ -280,7 +280,7 @@ READ8_HANDLER( hector_disc2_io61_port_r)
}
WRITE8_HANDLER( hector_disc2_io61_port_w)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Data useful to patch the RESULT in case of write command */
state->m_hector_cmd[9]=state->m_hector_cmd[8]; //hector_cmd_8 = Cde number when state->m_hector_nb_cde = 9
state->m_hector_cmd[8]=state->m_hector_cmd[7]; //hector_cmd_7 = Drive
@@ -308,20 +308,20 @@ WRITE8_HANDLER( hector_disc2_io61_port_w)
state->m_print=0;
#endif
- device_t *fdc = space->machine().device("upd765");
- upd765_data_w(fdc,*space, 0, data);
+ device_t *fdc = space.machine().device("upd765");
+ upd765_data_w(fdc,space, 0, data);
}
// AM_RANGE(0x070,0x07f) AM_DEVREADWRITE("upd765",upd765_dack_r,upd765_dack_w)
READ8_HANDLER( hector_disc2_io70_port_r) // Gestion du DMA
{
UINT8 data;
- device_t *fdc = space->machine().device("upd765");
- data = upd765_dack_r(fdc,*space, 0);
+ device_t *fdc = space.machine().device("upd765");
+ data = upd765_dack_r(fdc,space, 0);
return data;
}
WRITE8_HANDLER( hector_disc2_io70_port_w)
{
- device_t *fdc = space->machine().device("upd765");
- upd765_dack_w(fdc,*space, 0, data);
+ device_t *fdc = space.machine().device("upd765");
+ upd765_dack_w(fdc,space, 0, data);
}
diff --git a/src/mess/machine/hp48.c b/src/mess/machine/hp48.c
index 4851167b17d..2b728f305e8 100644
--- a/src/mess/machine/hp48.c
+++ b/src/mess/machine/hp48.c
@@ -368,9 +368,9 @@ static void hp48_update_annunciators(hp48_state *state)
static WRITE8_HANDLER ( hp48_io_w )
{
- hp48_state *state = space->machine().driver_data<hp48_state>();
+ hp48_state *state = space.machine().driver_data<hp48_state>();
LOG(( "%05x %f hp48_io_w: off=%02x data=%x\n",
- space->device().safe_pcbase(), space->machine().time().as_double(), offset, data ));
+ space.device().safe_pcbase(), space.machine().time().as_double(), offset, data ));
switch( offset )
{
@@ -413,14 +413,14 @@ static WRITE8_HANDLER ( hp48_io_w )
/* cards */
case 0x0e:
- LOG(( "%05x: card control write %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card control write %02x\n", space.device().safe_pcbase(), data ));
/* bit 0: software interrupt */
if ( data & 1 )
{
LOG(( "%f hp48_io_w: software interrupt requested\n",
- space->machine().time().as_double() ));
- hp48_pulse_irq( space->machine(), SATURN_IRQ_LINE );
+ space.machine().time().as_double() ));
+ hp48_pulse_irq( space.machine(), SATURN_IRQ_LINE );
data &= ~1;
}
@@ -432,7 +432,7 @@ static WRITE8_HANDLER ( hp48_io_w )
break;
case 0x0f:
- LOG(( "%05x: card info write %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card info write %02x\n", space.device().safe_pcbase(), data ));
state->m_io[0x0f] = data;
break;
@@ -447,7 +447,7 @@ static WRITE8_HANDLER ( hp48_io_w )
case 0x17:
/* second nibble of sent data */
state->m_io[offset] = data;
- hp48_rs232_send_byte(space->machine());
+ hp48_rs232_send_byte(space.machine());
break;
/* XXX not implemented:
@@ -483,7 +483,7 @@ static WRITE8_HANDLER ( hp48_io_w )
static READ8_HANDLER ( hp48_io_r )
{
- hp48_state *state = space->machine().driver_data<hp48_state>();
+ hp48_state *state = space.machine().driver_data<hp48_state>();
UINT8 data = 0;
switch( offset )
@@ -517,7 +517,7 @@ static READ8_HANDLER ( hp48_io_r )
case 0x29:
{
int last_line = HP48_IO_8(0x28) & 0x3f; /* last line of main bitmap before menu */
- int cur_line = space->machine().primary_screen->vpos();
+ int cur_line = space.machine().primary_screen->vpos();
if ( last_line <= 1 ) last_line = 0x3f;
data = ( cur_line >= 0 && cur_line <= last_line ) ? last_line - cur_line : 0;
if ( offset == 0x29 )
@@ -548,8 +548,8 @@ static READ8_HANDLER ( hp48_io_r )
{
/* second nibble of received data */
- //device_image_interface *xmodem = dynamic_cast<device_image_interface *>(space->machine().device("rs232_x"));
- //device_image_interface *kermit = dynamic_cast<device_image_interface *>(space->machine().device("rs232_k"));
+ //device_image_interface *xmodem = dynamic_cast<device_image_interface *>(space.machine().device("rs232_x"));
+ //device_image_interface *kermit = dynamic_cast<device_image_interface *>(space.machine().device("rs232_k"));
state->m_io[0x11] &= ~1; /* clear byte received */
data = state->m_io[offset];
@@ -563,7 +563,7 @@ static READ8_HANDLER ( hp48_io_r )
/* cards */
case 0x0e: /* detection */
data = state->m_io[0x0e];
- LOG(( "%05x: card control read %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card control read %02x\n", space.device().safe_pcbase(), data ));
break;
case 0x0f: /* card info */
data = 0;
@@ -581,7 +581,7 @@ static READ8_HANDLER ( hp48_io_r )
if ( state->m_port_size[0] && state->m_port_write[0] ) data |= 4;
if ( state->m_port_size[1] && state->m_port_write[1] ) data |= 8;
}
- LOG(( "%05x: card info read %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card info read %02x\n", space.device().safe_pcbase(), data ));
break;
@@ -589,7 +589,7 @@ static READ8_HANDLER ( hp48_io_r )
}
LOG(( "%05x %f hp48_io_r: off=%02x data=%x\n",
- space->device().safe_pcbase(), space->machine().time().as_double(), offset, data ));
+ space.device().safe_pcbase(), space.machine().time().as_double(), offset, data ));
return data;
}
@@ -598,12 +598,12 @@ static READ8_HANDLER ( hp48_io_r )
static READ8_HANDLER ( hp48_bank_r )
{
- hp48_state *state = space->machine().driver_data<hp48_state>();
+ hp48_state *state = space.machine().driver_data<hp48_state>();
/* bit 0: ignored, bits 2-5: bank number, bit 6: enable */
offset &= 0x7e;
if ( state->m_bank_switch != offset )
{
- LOG(( "%05x %f hp48_bank_r: off=%03x\n", space->device().safe_pcbase(), space->machine().time().as_double(), offset ));
+ LOG(( "%05x %f hp48_bank_r: off=%03x\n", space.device().safe_pcbase(), space.machine().time().as_double(), offset ));
state->m_bank_switch = offset;
hp48_apply_modules(state);
}
@@ -709,7 +709,7 @@ static void hp48_apply_modules(hp48_state *state)
{
int i;
int nce2_enable = 1;
- address_space* space = state->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *state->machine().device("maincpu")->memory().space(AS_PROGRAM);
state->m_io_addr = 0x100000;
@@ -772,23 +772,23 @@ static void hp48_apply_modules(hp48_state *state)
}
if (state->m_modules[i].data)
- space->install_read_bank( base, end, 0, mirror, bank );
+ space.install_read_bank( base, end, 0, mirror, bank );
else
{
if (state->m_modules[i].read != NULL)
- space->install_legacy_read_handler( base, end, 0, mirror, state->m_modules[i].read, state->m_modules[i].read_name);
+ space.install_legacy_read_handler( base, end, 0, mirror, state->m_modules[i].read, state->m_modules[i].read_name);
}
if (state->m_modules[i].isnop)
- space->nop_write(base, end, 0, mirror);
+ space.nop_write(base, end, 0, mirror);
else
{
if (state->m_modules[i].data)
- space->install_write_bank( base, end, 0, mirror, bank );
+ space.install_write_bank( base, end, 0, mirror, bank );
else
{
if (state->m_modules[i].write != NULL)
- space->install_legacy_write_handler( base, end, 0, mirror, state->m_modules[i].write, state->m_modules[i].write_name );
+ space.install_legacy_write_handler( base, end, 0, mirror, state->m_modules[i].write, state->m_modules[i].write_name );
}
}
diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c
index ef3726f1a0e..a9bccab0fba 100644
--- a/src/mess/machine/intv.c
+++ b/src/mess/machine/intv.c
@@ -697,7 +697,7 @@ INTERRUPT_GEN( intv_interrupt )
}
/* hand 0 == left, 1 == right, 2 == ECS hand controller 1, 3 == ECS hand controller 2 */
-UINT8 intv_control_r(address_space *space, int hand)
+UINT8 intv_control_r(address_space &space, int hand)
{
static const char* const keypad_name[] = { "KEYPAD1", "KEYPAD2", "KEYPAD3", "KEYPAD4" };
static const UINT8 keypad_table[] =
@@ -728,7 +728,7 @@ UINT8 intv_control_r(address_space *space, int hand)
UINT8 rv = 0xFF;
/* keypad */
- x = space->machine().root_device().ioport(keypad_name[hand])->read();
+ x = space.machine().root_device().ioport(keypad_name[hand])->read();
for (y = 0; y < 16; y++)
{
if (x & (1 << y))
@@ -737,12 +737,12 @@ UINT8 intv_control_r(address_space *space, int hand)
}
}
- switch ((space->machine().root_device().ioport("OPTIONS")->read() >> hand) & 1)
+ switch ((space.machine().root_device().ioport("OPTIONS")->read() >> hand) & 1)
{
case 0: /* disc == digital */
default:
- x = space->machine().root_device().ioport(disc_name[hand])->read();
+ x = space.machine().root_device().ioport(disc_name[hand])->read();
for (y = 0; y < 16; y++)
{
if (x & (1 << y))
@@ -754,8 +754,8 @@ UINT8 intv_control_r(address_space *space, int hand)
case 1: /* disc == _fake_ analog */
- x = space->machine().root_device().ioport(discx_name[hand])->read();
- y = space->machine().root_device().ioport(discy_name[hand])->read();
+ x = space.machine().root_device().ioport(discx_name[hand])->read();
+ y = space.machine().root_device().ioport(discy_name[hand])->read();
rv &= discyx_table[y / 32][x / 32];
}
@@ -764,18 +764,18 @@ UINT8 intv_control_r(address_space *space, int hand)
READ8_MEMBER( intv_state::intv_left_control_r )
{
- return intv_control_r(&space, 0);
+ return intv_control_r(space, 0);
}
READ8_MEMBER( intv_state::intv_right_control_r )
{
- return intv_control_r(&space, 1);
+ return intv_control_r(space, 1);
}
READ8_MEMBER( intv_state::intv_ecs_porta_r )
{
if (ioport("ECS_CNTRLSEL")->read() == 0)
- return intv_control_r(&space, 2);
+ return intv_control_r(space, 2);
else
return 0xff; // not sure what to return here, maybe it should be last output?
}
@@ -786,7 +786,7 @@ READ8_MEMBER( intv_state::intv_ecs_portb_r )
{
case 0x00: // hand controller
{
- return intv_control_r(&space, 3);
+ return intv_control_r(space, 3);
}
case 0x01: // synthesizer keyboard
{
diff --git a/src/mess/machine/iq151_staper.c b/src/mess/machine/iq151_staper.c
index 2c072c531eb..a43b5015f6a 100644
--- a/src/mess/machine/iq151_staper.c
+++ b/src/mess/machine/iq151_staper.c
@@ -93,10 +93,10 @@ void iq151_staper_device::device_timer(emu_timer &timer, device_timer_id id, int
void iq151_staper_device::io_read(offs_t offset, UINT8 &data)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
if (offset >= 0xf8 && offset < 0xfc)
- data = m_ppi->read(*space, offset & 0x03);
+ data = m_ppi->read(space, offset & 0x03);
}
//-------------------------------------------------
@@ -105,10 +105,10 @@ void iq151_staper_device::io_read(offs_t offset, UINT8 &data)
void iq151_staper_device::io_write(offs_t offset, UINT8 data)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
if (offset >= 0xf8 && offset < 0xfc)
- m_ppi->write(*space, offset & 0x03, data);
+ m_ppi->write(space, offset & 0x03, data);
}
diff --git a/src/mess/machine/isa.c b/src/mess/machine/isa.c
index 1fa0f0a6efd..a6613ccc81c 100644
--- a/src/mess/machine/isa.c
+++ b/src/mess/machine/isa.c
@@ -327,15 +327,15 @@ void isa8_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t m
void isa8_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->install_readwrite_bank(start, end, mask, mirror, tag );
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.install_readwrite_bank(start, end, mask, mirror, tag );
machine().root_device().membank(tag)->set_base(data);
}
void isa8_device::unmap_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->unmap_readwrite(start, end, mask, mirror);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.unmap_readwrite(start, end, mask, mirror);
}
void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, const char *region)
@@ -346,25 +346,25 @@ void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t ma
UINT8 *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000;
memcpy(dest,src, end - start + 1);
} else {
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->install_read_bank(start, end, mask, mirror, tag);
- space->unmap_write(start, end, mask, mirror);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.install_read_bank(start, end, mask, mirror, tag);
+ space.unmap_write(start, end, mask, mirror);
machine().root_device().membank(tag)->set_base(machine().root_device().memregion(dev->subtag(tempstring, region))->base());
}
}
void isa8_device::unmap_rom(offs_t start, offs_t end, offs_t mask, offs_t mirror)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->unmap_read(start, end, mask, mirror);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.unmap_read(start, end, mask, mirror);
}
bool isa8_device::is_option_rom_space_available(offs_t start, int size)
{
m_maincpu = machine().device<cpu_device>(m_cputag);
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
for(int i = 0; i < size; i += 4096) // 4KB granularity should be enough
- if(space->get_read_ptr(start + i)) return false;
+ if(space.get_read_ptr(start + i)) return false;
return true;
}
diff --git a/src/mess/machine/kaypro.c b/src/mess/machine/kaypro.c
index a4345ec83cf..6a27798195a 100644
--- a/src/mess/machine/kaypro.c
+++ b/src/mess/machine/kaypro.c
@@ -327,8 +327,8 @@ MACHINE_RESET_MEMBER(kaypro_state,kayproii)
MACHINE_RESET_MEMBER(kaypro_state,kaypro2x)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- kaypro2x_system_port_w(*space, 0, 0x80);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ kaypro2x_system_port_w(space, 0, 0x80);
MACHINE_RESET_CALL_MEMBER(kay_kbd);
}
@@ -346,7 +346,7 @@ MACHINE_RESET_MEMBER(kaypro_state,kaypro2x)
QUICKLOAD_LOAD( kayproii )
{
kaypro_state *state = image.device().machine().driver_data<kaypro_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = state->memregion("rambank")->base();
UINT16 i;
UINT8 data;
@@ -359,7 +359,7 @@ QUICKLOAD_LOAD( kayproii )
RAM[i+0x100] = data;
}
- state->common_pio_system_w(*space, 0, state->m_system_port & 0x7f); // switch TPA in
+ state->common_pio_system_w(space, 0, state->m_system_port & 0x7f); // switch TPA in
RAM[0x80]=0; // clear out command tail
RAM[0x81]=0;
state->m_maincpu->set_pc(0x100); // start program
@@ -369,7 +369,7 @@ QUICKLOAD_LOAD( kayproii )
QUICKLOAD_LOAD( kaypro2x )
{
kaypro_state *state = image.device().machine().driver_data<kaypro_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = state->memregion("rambank")->base();
UINT16 i;
UINT8 data;
@@ -381,7 +381,7 @@ QUICKLOAD_LOAD( kaypro2x )
RAM[i+0x100] = data;
}
- state->kaypro2x_system_port_w(*space, 0, state->m_system_port & 0x7f);
+ state->kaypro2x_system_port_w(space, 0, state->m_system_port & 0x7f);
RAM[0x80]=0;
RAM[0x81]=0;
state->m_maincpu->set_pc(0x100);
diff --git a/src/mess/machine/kc.c b/src/mess/machine/kc.c
index a9ca5981cac..918e915e8f7 100644
--- a/src/mess/machine/kc.c
+++ b/src/mess/machine/kc.c
@@ -61,10 +61,10 @@ QUICKLOAD_LOAD(kc)
datasize = image.length() - 128;
}
- address_space *space = state->m_maincpu->space( AS_PROGRAM );
+ address_space &space = *state->m_maincpu->space( AS_PROGRAM );
for (i=0; i<datasize; i++)
- space->write_byte((addr+i) & 0xffff, data[i+128]);
+ space.write_byte((addr+i) & 0xffff, data[i+128]);
if (execution_address != 0 && header->number_addresses >= 3 )
{
@@ -290,7 +290,7 @@ void kc_state::cassette_set_motor(int motor_state)
/* update status of memory area 0x0000-0x03fff */
void kc_state::update_0x00000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
/* access ram? */
if (m_pio_data[0] & (1<<1))
@@ -298,7 +298,7 @@ void kc_state::update_0x00000()
LOG(("ram0 enabled\n"));
/* yes; set address of bank */
- space->install_read_bank(0x0000, 0x3fff, "bank1");
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
membank("bank1")->set_base(m_ram_base);
/* write protect ram? */
@@ -308,34 +308,34 @@ void kc_state::update_0x00000()
LOG(("ram0 write protected\n"));
/* ram is enabled and write protected */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
}
else
{
LOG(("ram0 write enabled\n"));
/* ram is enabled and write enabled */
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
}
}
else
{
LOG(("Module at 0x0000\n"));
- space->install_read_handler (0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_read), this), 0);
- space->install_write_handler(0x0000, 0x3fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_write), this), 0);
+ space.install_read_handler (0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_read), this), 0);
+ space.install_write_handler(0x0000, 0x3fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_write), this), 0);
}
}
/* update status of memory area 0x4000-0x07fff */
void kc_state::update_0x04000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
LOG(("Module at 0x4000\n"));
- space->install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
- space->install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
+ space.install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
+ space.install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
}
@@ -343,7 +343,7 @@ void kc_state::update_0x04000()
/* update memory address 0x0c000-0x0e000 */
void kc_state::update_0x0c000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if ((m_pio_data[0] & (1<<7)) && memregion("basic")->base() != NULL)
{
@@ -351,22 +351,22 @@ void kc_state::update_0x0c000()
LOG(("BASIC rom 0x0c000\n"));
membank("bank4")->set_base(memregion("basic")->base());
- space->install_read_bank(0xc000, 0xdfff, "bank4");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank4");
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
LOG(("Module at 0x0c000\n"));
- space->install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
- space->install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
+ space.install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
+ space.install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
}
}
/* update memory address 0x0e000-0x0ffff */
void kc_state::update_0x0e000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_pio_data[0] & (1<<0))
{
@@ -374,15 +374,15 @@ void kc_state::update_0x0e000()
LOG(("CAOS rom 0x0e000\n"));
/* read will access the rom */
membank("bank5")->set_base(memregion("caos")->base() + 0x2000);
- space->install_read_bank(0xe000, 0xffff, "bank5");
- space->unmap_write(0xe000, 0xffff);
+ space.install_read_bank(0xe000, 0xffff, "bank5");
+ space.unmap_write(0xe000, 0xffff);
}
else
{
LOG(("Module at 0x0e000\n"));
- space->install_read_handler (0xe000, 0xffff, 0, 0, read8_delegate(FUNC(kc_state::expansion_e000_r), this), 0);
- space->install_write_handler(0xe000, 0xffff, 0, 0, write8_delegate(FUNC(kc_state::expansion_e000_w), this), 0);
+ space.install_read_handler (0xe000, 0xffff, 0, 0, read8_delegate(FUNC(kc_state::expansion_e000_r), this), 0);
+ space.install_write_handler(0xe000, 0xffff, 0, 0, write8_delegate(FUNC(kc_state::expansion_e000_w), this), 0);
}
}
@@ -390,7 +390,7 @@ void kc_state::update_0x0e000()
/* update status of memory area 0x08000-0x0ffff */
void kc_state::update_0x08000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_pio_data[0] & (1<<2))
{
@@ -398,14 +398,14 @@ void kc_state::update_0x08000()
LOG(("IRM enabled\n"));
membank("bank3")->set_base(m_video_ram);
- space->install_readwrite_bank(0x8000, 0xbfff, "bank3");
+ space.install_readwrite_bank(0x8000, 0xbfff, "bank3");
}
else
{
LOG(("Module at 0x8000!\n"));
- space->install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
- space->install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
+ space.install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
+ space.install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
}
}
@@ -413,7 +413,7 @@ void kc_state::update_0x08000()
/* update status of memory area 0x4000-0x07fff */
void kc85_4_state::update_0x04000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
/* access ram? */
if (m_port_86_data & (1<<0))
@@ -421,7 +421,7 @@ void kc85_4_state::update_0x04000()
LOG(("RAM4 enabled\n"));
/* yes */
- space->install_read_bank(0x4000, 0x7fff, "bank2");
+ space.install_read_bank(0x4000, 0x7fff, "bank2");
/* set address of bank */
membank("bank2")->set_base(m_ram_base + 0x4000);
@@ -432,22 +432,22 @@ void kc85_4_state::update_0x04000()
LOG(("ram4 write protected\n"));
/* ram is enabled and write protected */
- space->nop_write(0x4000, 0x7fff);
+ space.nop_write(0x4000, 0x7fff);
}
else
{
LOG(("ram4 write enabled\n"));
/* ram is enabled and write enabled */
- space->install_write_bank(0x4000, 0x7fff, "bank2");
+ space.install_write_bank(0x4000, 0x7fff, "bank2");
}
}
else
{
LOG(("Module at 0x4000\n"));
- space->install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
- space->install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
+ space.install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
+ space.install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
}
}
@@ -455,7 +455,7 @@ void kc85_4_state::update_0x04000()
/* update memory address 0x0c000-0x0e000 */
void kc85_4_state::update_0x0c000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_port_86_data & (1<<7))
{
@@ -463,8 +463,8 @@ void kc85_4_state::update_0x0c000()
LOG(("CAOS rom 0x0c000\n"));
membank("bank4")->set_base(memregion("caos")->base());
- space->install_read_bank(0xc000, 0xdfff, "bank4");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank4");
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
@@ -476,22 +476,22 @@ void kc85_4_state::update_0x0c000()
int bank = memregion("basic")->bytes() == 0x8000 ? (m_port_86_data>>5) & 0x03 : 0;
membank("bank4")->set_base(memregion("basic")->base() + (bank << 13));
- space->install_read_bank(0xc000, 0xdfff, "bank4");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank4");
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
LOG(("Module at 0x0c000\n"));
- space->install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
- space->install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
+ space.install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
+ space.install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
}
}
}
void kc85_4_state::update_0x08000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_pio_data[0] & (1<<2))
{
@@ -501,10 +501,10 @@ void kc85_4_state::update_0x08000()
UINT8* ram_page = m_video_ram + ((BIT(m_port_84_data, 2)<<15) | (BIT(m_port_84_data, 1)<<14));
membank("bank3")->set_base(ram_page);
- space->install_readwrite_bank(0x8000, 0xa7ff, "bank3");
+ space.install_readwrite_bank(0x8000, 0xa7ff, "bank3");
membank("bank6")->set_base(m_video_ram + 0x2800);
- space->install_readwrite_bank(0xa800, 0xbfff, "bank6");
+ space.install_readwrite_bank(0xa800, 0xbfff, "bank6");
}
else if (m_pio_data[1] & (1<<5))
{
@@ -530,8 +530,8 @@ void kc85_4_state::update_0x08000()
membank("bank3")->set_base(mem_ptr);
membank("bank6")->set_base(mem_ptr + 0x2800);
- space->install_read_bank(0x8000, 0xa7ff, "bank3");
- space->install_read_bank(0xa800, 0xbfff, "bank6");
+ space.install_read_bank(0x8000, 0xa7ff, "bank3");
+ space.install_read_bank(0xa800, 0xbfff, "bank6");
/* write protect RAM8 ? */
if ((m_pio_data[1] & (1<<6)) == 0)
@@ -539,24 +539,24 @@ void kc85_4_state::update_0x08000()
/* ram8 is enabled and write protected */
LOG(("RAM8 write protected\n"));
- space->nop_write(0x8000, 0xa7ff);
- space->nop_write(0xa800, 0xbfff);
+ space.nop_write(0x8000, 0xa7ff);
+ space.nop_write(0xa800, 0xbfff);
}
else
{
LOG(("RAM8 write enabled\n"));
/* ram8 is enabled and write enabled */
- space->install_write_bank(0x8000, 0xa7ff, "bank3");
- space->install_write_bank(0xa800, 0xbfff, "bank6");
+ space.install_write_bank(0x8000, 0xa7ff, "bank3");
+ space.install_write_bank(0xa800, 0xbfff, "bank6");
}
}
else
{
LOG(("Module at 0x8000\n"));
- space->install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
- space->install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
+ space.install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
+ space.install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
}
}
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index f7f7982ca60..f993ee07d86 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -237,13 +237,13 @@ INLINE void COPS_send_data_if_possible(running_machine &machine)
{
lisa_state *state = machine.driver_data<lisa_state>();
via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if ((! state->m_hold_COPS_data) && state->m_fifo_size && (! state->m_COPS_Ready))
{
// printf("COPsim: sending %02x to VIA\n", state->m_fifo_data[state->m_fifo_head]);
- via_0->write_porta(*space, 0, state->m_fifo_data[state->m_fifo_head]); /* output data */
+ via_0->write_porta(space, 0, state->m_fifo_data[state->m_fifo_head]); /* output data */
if (state->m_fifo_head == state->m_mouse_data_offset)
state->m_mouse_data_offset = -1; /* we just phased out the mouse data in buffer */
state->m_fifo_head = (state->m_fifo_head+1) & 0x7;
@@ -427,7 +427,7 @@ static TIMER_CALLBACK(read_COPS_command)
lisa_state *state = machine.driver_data<lisa_state>();
int command;
via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
state->m_COPS_Ready = 0;
@@ -435,7 +435,7 @@ static TIMER_CALLBACK(read_COPS_command)
COPS_send_data_if_possible(machine);
/* some pull-ups allow the COPS to read 1s when the VIA port is not set as output */
- command = (state->m_COPS_command | (~ via_0->read(*space, VIA_DDRA))) & 0xff;
+ command = (state->m_COPS_command | (~ via_0->read(space, VIA_DDRA))) & 0xff;
// printf("Dropping Ready, command = %02x\n", command);
diff --git a/src/mess/machine/llc.c b/src/mess/machine/llc.c
index 3c39837c2d2..8125a708562 100644
--- a/src/mess/machine/llc.c
+++ b/src/mess/machine/llc.c
@@ -152,18 +152,18 @@ DRIVER_INIT_MEMBER(llc_state,llc2)
MACHINE_RESET_MEMBER(llc_state,llc2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
- space->unmap_write(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x4000);
- space->unmap_write(0x6000, 0xbfff);
+ space.unmap_write(0x6000, 0xbfff);
membank("bank3")->set_base(machine().root_device().memregion("maincpu")->base() + 0x6000);
- space->install_write_bank(0xc000, 0xffff, "bank4");
+ space.install_write_bank(0xc000, 0xffff, "bank4");
membank("bank4")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xc000);
}
diff --git a/src/mess/machine/lux21046.c b/src/mess/machine/lux21046.c
index de30bb01ce6..081b3331d8c 100644
--- a/src/mess/machine/lux21046.c
+++ b/src/mess/machine/lux21046.c
@@ -223,8 +223,8 @@ WRITE_LINE_MEMBER( luxor_55_21046_device::dma_int_w )
m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_fdc_irq | m_dma_irq);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/machine/lviv.c b/src/mess/machine/lviv.c
index 3e481f5fbe8..24360aa8a61 100644
--- a/src/mess/machine/lviv.c
+++ b/src/mess/machine/lviv.c
@@ -232,19 +232,19 @@ I8255A_INTERFACE( lviv_ppi8255_interface_1 )
void lviv_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem;
- space->set_direct_update_handler(direct_update_delegate(FUNC(lviv_state::lviv_directoverride), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(lviv_state::lviv_directoverride), this));
m_video_ram = machine().device<ram_device>(RAM_TAG)->pointer() + 0xc000;
m_startup_mem_map = 1;
- space->unmap_write(0x0000, 0x3fff);
- space->unmap_write(0x4000, 0x7fff);
- space->unmap_write(0x8000, 0xbfff);
- space->unmap_write(0xC000, 0xffff);
+ space.unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x4000, 0x7fff);
+ space.unmap_write(0x8000, 0xbfff);
+ space.unmap_write(0xC000, 0xffff);
mem = memregion("maincpu")->base();
membank("bank1")->set_base(mem + 0x010000);
diff --git a/src/mess/machine/lynx.c b/src/mess/machine/lynx.c
index 6b75baf37bb..9e5b26590b7 100644
--- a/src/mess/machine/lynx.c
+++ b/src/mess/machine/lynx.c
@@ -1655,7 +1655,7 @@ static TIMER_CALLBACK(lynx_uart_timer)
static READ8_HANDLER(lynx_uart_r)
{
- lynx_state *state = space->machine().driver_data<lynx_state>();
+ lynx_state *state = space.machine().driver_data<lynx_state>();
UINT8 value = 0x00;
switch (offset)
{
@@ -1769,7 +1769,7 @@ READ8_MEMBER(lynx_state::mikey_read)
case 0x8c:
case 0x8d:
- value = lynx_uart_r(&space, offset);
+ value = lynx_uart_r(space, offset);
break;
default:
diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c
index 9a90bd8d79f..b0264c8d0c1 100644
--- a/src/mess/machine/mac.c
+++ b/src/mess/machine/mac.c
@@ -212,7 +212,7 @@ static void mac_install_memory(running_machine &machine, offs_t memory_begin, of
offs_t memory_size, void *memory_data, int is_rom, const char *bank)
{
mac_state *state = machine.driver_data<mac_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
offs_t memory_mask;
memory_size = MIN(memory_size, (memory_end + 1 - memory_begin));
@@ -220,12 +220,12 @@ static void mac_install_memory(running_machine &machine, offs_t memory_begin, of
if (!is_rom)
{
- space->install_readwrite_bank(memory_begin, memory_end, memory_mask, 0, bank);
+ space.install_readwrite_bank(memory_begin, memory_end, memory_mask, 0, bank);
}
else
{
- space->unmap_write(memory_begin, memory_end, memory_mask, 0);
- space->install_read_bank(memory_begin, memory_end, memory_mask, 0, bank);
+ space.unmap_write(memory_begin, memory_end, memory_mask, 0);
+ space.install_read_bank(memory_begin, memory_end, memory_mask, 0, bank);
}
state->membank(bank)->set_base(memory_data);
@@ -410,12 +410,12 @@ void mac_state::v8_resize()
}
else
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT32 onboard_amt, simm_amt, simm_size;
static const UINT32 simm_sizes[4] = { 0, 2*1024*1024, 4*1024*1024, 8*1024*1024 };
// force unmap of entire RAM region
- space->unmap_write(0, 0x9fffff, 0x9fffff, 0);
+ space.unmap_write(0, 0x9fffff, 0x9fffff, 0);
// LC and Classic II have 2 MB built-in, all other V8-style machines have 4 MB
// we reserve the first 2 or 4 MB of mess_ram for the onboard,
@@ -501,14 +501,14 @@ void mac_state::set_memory_overlay(int overlay)
}
else if ((m_model == MODEL_MAC_PORTABLE) || (m_model == MODEL_MAC_PB100) || (m_model == MODEL_MAC_IIVX) || (m_model == MODEL_MAC_IIFX))
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x000000, 0x9fffff, 0x9fffff, 0);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.unmap_write(0x000000, 0x9fffff, 0x9fffff, 0);
mac_install_memory(machine(), 0x000000, memory_size-1, memory_size, memory_data, is_rom, "bank1");
}
else if ((m_model == MODEL_MAC_PB140) || (m_model == MODEL_MAC_PB160) || ((m_model >= MODEL_MAC_PBDUO_210) && (m_model <= MODEL_MAC_PBDUO_270c)))
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x000000, 0xffffff, 0xffffff, 0);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.unmap_write(0x000000, 0xffffff, 0xffffff, 0);
mac_install_memory(machine(), 0x000000, memory_size-1, memory_size, memory_data, is_rom, "bank1");
}
else if ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30))
@@ -1049,7 +1049,7 @@ WRITE16_MEMBER ( mac_state::macii_scsi_w )
{
int reg = (offset>>3) & 0xf;
-// logerror("macplus_scsi_w: data %x offset %x mask %x (PC=%x)\n", data, offset, mem_mask, space->device().safe_pc());
+// logerror("macplus_scsi_w: data %x offset %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
if ((reg == 0) && (offset == 0x100))
{
@@ -1814,7 +1814,7 @@ void mac_state::machine_reset()
if (m_model >= MODEL_MAC_POWERMAC_6100 && m_model <= MODEL_MAC_POWERMAC_8100)
{
- m_awacs->set_dma_base(m_maincpu->space(AS_PROGRAM), 0x10000, 0x12000);
+ m_awacs->set_dma_base(*m_maincpu->space(AS_PROGRAM), 0x10000, 0x12000);
}
// start 60.15 Hz timer for most systems
diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c
index 0918ad7e8b4..9e7b7858ed7 100644
--- a/src/mess/machine/mbc55x.c
+++ b/src/mess/machine/mbc55x.c
@@ -339,7 +339,7 @@ WRITE8_MEMBER(mbc55x_state::mbc55x_kb_usart_w)
static void set_ram_size(running_machine &machine)
{
mbc55x_state *state = machine.driver_data<mbc55x_state>();
- address_space *space = machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
int ramsize = state->m_ram->size();
int nobanks = ramsize / RAM_BANK_SIZE;
char bank[10];
@@ -363,21 +363,21 @@ static void set_ram_size(running_machine &machine)
if(bankno<nobanks)
{
state->membank(bank)->set_base(map_base);
- space->install_readwrite_bank(bank_base, bank_base+(RAM_BANK_SIZE-1), bank);
+ space.install_readwrite_bank(bank_base, bank_base+(RAM_BANK_SIZE-1), bank);
logerror("Mapping bank %d at %05X to RAM\n",bankno,bank_base);
}
else
{
- space->nop_readwrite(bank_base, bank_base+(RAM_BANK_SIZE-1));
+ space.nop_readwrite(bank_base, bank_base+(RAM_BANK_SIZE-1));
logerror("Mapping bank %d at %05X to NOP\n",bankno,bank_base);
}
}
// Graphics red and blue plane memory mapping, green is in main memory
state->membank(RED_PLANE_TAG)->set_base(&state->m_video_mem[RED_PLANE_OFFSET]);
- space->install_readwrite_bank(RED_PLANE_MEMBASE, RED_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), RED_PLANE_TAG);
+ space.install_readwrite_bank(RED_PLANE_MEMBASE, RED_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), RED_PLANE_TAG);
state->membank(BLUE_PLANE_TAG)->set_base(&state->m_video_mem[BLUE_PLANE_OFFSET]);
- space->install_readwrite_bank(BLUE_PLANE_MEMBASE, BLUE_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), BLUE_PLANE_TAG);
+ space.install_readwrite_bank(BLUE_PLANE_MEMBASE, BLUE_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), BLUE_PLANE_TAG);
}
DRIVER_INIT_MEMBER(mbc55x_state,mbc55x)
@@ -434,10 +434,10 @@ static void mbc55x_debug(running_machine &machine, int ref, int params, const ch
static int instruction_hook(device_t &device, offs_t curpc)
{
mbc55x_state *state = device.machine().driver_data<mbc55x_state>();
- address_space *space = device.memory().space(AS_PROGRAM);
+ address_space &space = *device.memory().space(AS_PROGRAM);
UINT8 *addr_ptr;
- addr_ptr = (UINT8*)space->get_read_ptr(curpc);
+ addr_ptr = (UINT8*)space.get_read_ptr(curpc);
if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD))
{
diff --git a/src/mess/machine/mbee.c b/src/mess/machine/mbee.c
index 8154c98e6da..f3d3f6dbd9e 100644
--- a/src/mess/machine/mbee.c
+++ b/src/mess/machine/mbee.c
@@ -565,14 +565,14 @@ INTERRUPT_GEN( mbee_interrupt )
#if 0
mbee_state *state = device->machine().driver_data<mbee_state>();
- //address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ //address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* The printer status connects to the pio ASTB pin, and the printer changing to not
busy should signal an interrupt routine at B61C, (next line) but this doesn't work.
The line below does what the interrupt should be doing. */
/* But it would break any program loaded to that area of memory, such as CP/M programs */
//state->m_z80pio->strobe_a(centronics_busy_r(state->m_printer)); /* signal int when not busy (L->H) */
- //space->write_byte(0x109, centronics_busy_r(state->m_printer));
+ //space.write_byte(0x109, centronics_busy_r(state->m_printer));
/* once per frame, pulse the PIO B bit 7 - it is in the schematic as an option,
@@ -754,7 +754,7 @@ QUICKLOAD_LOAD( mbee )
{
mbee_state *state = image.device().machine().driver_data<mbee_state>();
device_t *cpu = image.device().machine().device("maincpu");
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT16 i, j;
UINT8 data, sw = image.device().machine().root_device().ioport("CONFIG")->read() & 1; /* reading the dipswitch: 1 = autorun */
@@ -772,7 +772,7 @@ QUICKLOAD_LOAD( mbee )
}
if ((j < state->m_size) || (j > 0xefff))
- space->write_byte(j, data);
+ space.write_byte(j, data);
else
{
image.message("Not enough memory in this microbee");
@@ -782,11 +782,11 @@ QUICKLOAD_LOAD( mbee )
if (sw)
{
- space->write_word(0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */
+ space.write_word(0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */
cpu->state().set_pc(0x801e);
}
else
- space->write_word(0xa2,0x8517);
+ space.write_word(0xa2,0x8517);
}
else if (!mame_stricmp(image.filetype(), "com"))
{
@@ -802,7 +802,7 @@ QUICKLOAD_LOAD( mbee )
}
if ((j < state->m_size) || (j > 0xefff))
- space->write_byte(j, data);
+ space.write_byte(j, data);
else
{
image.message("Not enough memory in this microbee");
diff --git a/src/mess/machine/mboard.c b/src/mess/machine/mboard.c
index d17e36af32c..00923fcf058 100644
--- a/src/mess/machine/mboard.c
+++ b/src/mess/machine/mboard.c
@@ -196,15 +196,15 @@ READ32_HANDLER( mboard_read_board_32 )
WRITE8_HANDLER( mboard_write_board_8 )
{
- write_board(space->machine(),data);
+ write_board(space.machine(),data);
logerror("Write Board Port Data = %02x\n",data);
}
WRITE16_HANDLER( mboard_write_board_16 )
{
- if (data & 0xff) write_board(space->machine(),data);
+ if (data & 0xff) write_board(space.machine(),data);
logerror("write board 16 %08x\n",data);
- write_board(space->machine(),data>>8);
+ write_board(space.machine(),data>>8);
}
WRITE32_HANDLER( mboard_write_board_32 )
@@ -212,20 +212,20 @@ WRITE32_HANDLER( mboard_write_board_32 )
// data |= data << 24;
//printf("write board %08x %08x\n",offset,data);
logerror("write board 32 o: %08x d: %08x\n",offset,data);
- if (offset) write_board(space->machine(),data);
- else write_board(space->machine(),data>>24);
+ if (offset) write_board(space.machine(),data);
+ else write_board(space.machine(),data>>24);
}
WRITE8_HANDLER( mboard_write_LED_8 )
{
write_LED(data);
- space->device().execute().spin_until_time(attotime::from_usec(7));
+ space.device().execute().spin_until_time(attotime::from_usec(7));
}
WRITE16_HANDLER( mboard_write_LED_16 )
{
write_LED(data >> 8);
- space->device().execute().spin_until_time(attotime::from_usec(9));
+ space.device().execute().spin_until_time(attotime::from_usec(9));
}
WRITE32_HANDLER( mboard_write_LED_32 )
@@ -235,7 +235,7 @@ WRITE32_HANDLER( mboard_write_LED_32 )
if (offset) write_LED(data);
else write_LED(data >> 24);
logerror("write LED 32 o: %08x d: %08x\n",offset,data);
-// space->device().execute().spin_until_time(ATTOTIME_IN_USEC(20));
+// space.device().execute().spin_until_time(ATTOTIME_IN_USEC(20));
}
diff --git a/src/mess/machine/microtan.c b/src/mess/machine/microtan.c
index ba608562cee..4d2c7927e47 100644
--- a/src/mess/machine/microtan.c
+++ b/src/mess/machine/microtan.c
@@ -515,7 +515,7 @@ DRIVER_INIT_MEMBER(microtan_state,microtan)
{
UINT8 *dst = memregion("gfx2")->base();
int i;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
for (i = 0; i < 256; i++)
{
@@ -556,14 +556,14 @@ DRIVER_INIT_MEMBER(microtan_state,microtan)
switch (read_dsw(machine()) & 3)
{
case 0: // 1K only :)
- space->nop_readwrite(0x0400, 0xbbff);
+ space.nop_readwrite(0x0400, 0xbbff);
break;
case 1: // +7K TANEX
- space->install_ram(0x0400, 0x1fff,NULL);
- space->nop_readwrite(0x2000, 0xbbff);
+ space.install_ram(0x0400, 0x1fff,NULL);
+ space.nop_readwrite(0x2000, 0xbbff);
break;
default: // +7K TANEX + 40K TANRAM
- space->install_ram(0x0400, 0xbbff, NULL);
+ space.install_ram(0x0400, 0xbbff, NULL);
break;
}
diff --git a/src/mess/machine/mpc105.c b/src/mess/machine/mpc105.c
index f0b46acf50b..9e2b2e2f327 100644
--- a/src/mess/machine/mpc105.c
+++ b/src/mess/machine/mpc105.c
@@ -94,11 +94,11 @@ void mpc105_device::update_memory()
if (m_bank_base > 0)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
/* first clear everything out */
- space->nop_read(0x00000000, 0x3FFFFFFF);
- space->nop_read(0x00000000, 0x3FFFFFFF);
+ space.nop_read(0x00000000, 0x3FFFFFFF);
+ space.nop_read(0x00000000, 0x3FFFFFFF);
}
for (bank = 0; bank < MPC105_MEMORYBANK_COUNT; bank++)
diff --git a/src/mess/machine/msx_slot.c b/src/mess/machine/msx_slot.c
index dac30951d8f..96f818c0a8b 100644
--- a/src/mess/machine/msx_slot.c
+++ b/src/mess/machine/msx_slot.c
@@ -353,13 +353,13 @@ static READ8_HANDLER (konami_scc_bank5)
{
if ((offset & 0xff) >= 0xe0)
{
- return k051649_test_r (space->machine().device("k051649"), *space, offset & 0xff);
+ return k051649_test_r (space.machine().device("k051649"), space, offset & 0xff);
}
return 0xff;
}
else
{
- return k051649_waveform_r (space->machine().device("k051649"), *space, offset & 0x7f);
+ return k051649_waveform_r (space.machine().device("k051649"), space, offset & 0x7f);
}
}
@@ -1234,14 +1234,14 @@ MSX_SLOT_RESET(diskrom)
static READ8_HANDLER (msx_diskrom_page1_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
- case 0: return wd17xx_status_r (fdc, *space, 0);
- case 1: return wd17xx_track_r (fdc, *space, 0);
- case 2: return wd17xx_sector_r (fdc, *space, 0);
- case 3: return wd17xx_data_r (fdc, *space, 0);
+ case 0: return wd17xx_status_r (fdc, space, 0);
+ case 1: return wd17xx_track_r (fdc, space, 0);
+ case 2: return wd17xx_sector_r (fdc, space, 0);
+ case 3: return wd17xx_data_r (fdc, space, 0);
case 7: return state->m_dsk_stat;
default:
return state->m_state[1]->m_mem[offset + 0x3ff8];
@@ -1250,20 +1250,20 @@ static READ8_HANDLER (msx_diskrom_page1_r)
static READ8_HANDLER (msx_diskrom_page2_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
if (offset >= 0x7f8)
{
switch (offset)
{
case 0x7f8:
- return wd17xx_status_r (fdc, *space, 0);
+ return wd17xx_status_r (fdc, space, 0);
case 0x7f9:
- return wd17xx_track_r (fdc, *space, 0);
+ return wd17xx_track_r (fdc, space, 0);
case 0x7fa:
- return wd17xx_sector_r (fdc, *space, 0);
+ return wd17xx_sector_r (fdc, space, 0);
case 0x7fb:
- return wd17xx_data_r (fdc, *space, 0);
+ return wd17xx_data_r (fdc, space, 0);
case 0x7ff:
return state->m_dsk_stat;
default:
@@ -1363,14 +1363,14 @@ MSX_SLOT_RESET(diskrom2)
static READ8_HANDLER (msx_diskrom2_page1_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
- case 0: return wd17xx_status_r(fdc, *space, 0);
- case 1: return wd17xx_track_r(fdc, *space, 0);
- case 2: return wd17xx_sector_r(fdc, *space, 0);
- case 3: return wd17xx_data_r(fdc, *space, 0);
+ case 0: return wd17xx_status_r(fdc, space, 0);
+ case 1: return wd17xx_track_r(fdc, space, 0);
+ case 2: return wd17xx_sector_r(fdc, space, 0);
+ case 3: return wd17xx_data_r(fdc, space, 0);
case 4: return state->m_dsk_stat;
default:
return state->m_state[1]->m_mem[offset + 0x3ff8];
@@ -1379,20 +1379,20 @@ static READ8_HANDLER (msx_diskrom2_page1_r)
static READ8_HANDLER (msx_diskrom2_page2_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
if (offset >= 0x7b8)
{
switch (offset)
{
case 0x7b8:
- return wd17xx_status_r (fdc, *space, 0);
+ return wd17xx_status_r (fdc, space, 0);
case 0x7b9:
- return wd17xx_track_r (fdc, *space, 0);
+ return wd17xx_track_r (fdc, space, 0);
case 0x7ba:
- return wd17xx_sector_r (fdc, *space, 0);
+ return wd17xx_sector_r (fdc, space, 0);
case 0x7bb:
- return wd17xx_data_r (fdc, *space, 0);
+ return wd17xx_data_r (fdc, space, 0);
case 0x7bc:
return state->m_dsk_stat;
default:
@@ -2184,7 +2184,7 @@ MSX_SLOT_RESET(soundcartridge)
static READ8_HANDLER (soundcartridge_scc)
{
- msx_state *state = space->machine().driver_data<msx_state>();
+ msx_state *state = space.machine().driver_data<msx_state>();
int reg;
@@ -2198,7 +2198,7 @@ static READ8_HANDLER (soundcartridge_scc)
if (reg < 0x80)
{
- return k051649_waveform_r (space->machine().device("k051649"), *space, reg);
+ return k051649_waveform_r (space.machine().device("k051649"), space, reg);
}
else if (reg < 0xa0)
{
@@ -2207,11 +2207,11 @@ static READ8_HANDLER (soundcartridge_scc)
else if (reg < 0xc0)
{
/* read wave 5 */
- return k051649_waveform_r (space->machine().device("k051649"), *space, 0x80 + (reg & 0x1f));
+ return k051649_waveform_r (space.machine().device("k051649"), space, 0x80 + (reg & 0x1f));
}
else if (reg < 0xe0)
{
- return k051649_test_r (space->machine().device("k051649"), *space, reg);
+ return k051649_test_r (space.machine().device("k051649"), space, reg);
}
return 0xff;
@@ -2219,7 +2219,7 @@ static READ8_HANDLER (soundcartridge_scc)
static READ8_HANDLER (soundcartridge_sccp)
{
- msx_state *state = space->machine().driver_data<msx_state>();
+ msx_state *state = space.machine().driver_data<msx_state>();
int reg;
if (offset >= 0x7e0)
@@ -2232,11 +2232,11 @@ static READ8_HANDLER (soundcartridge_sccp)
if (reg < 0xa0)
{
- return k052539_waveform_r (space->machine().device("k051649"), *space, reg);
+ return k052539_waveform_r (space.machine().device("k051649"), space, reg);
}
else if (reg >= 0xc0 && reg < 0xe0)
{
- return k051649_test_r (space->machine().device("k051649"), *space, reg);
+ return k051649_test_r (space.machine().device("k051649"), space, reg);
}
return 0xff;
diff --git a/src/mess/machine/mz700.c b/src/mess/machine/mz700.c
index 4b3dfa1a6f9..e47ca57cfcb 100644
--- a/src/mess/machine/mz700.c
+++ b/src/mess/machine/mz700.c
@@ -627,7 +627,7 @@ WRITE8_MEMBER(mz_state::mz800_display_mode_w)
// {
// logerror("mz800_display_mode_w: switching mode to %s\n", (BIT(data, 3) ? "mz700" : "mz800"));
// m_mz700_mode = BIT(data, 3);
-// mz700_bank_4_w(machine().device("maincpu")->memory().&space(AS_PROGRAM), 0, 0);
+// mz700_bank_4_w(*machine().device("maincpu")->memory().&space(AS_PROGRAM), 0, 0);
// }
}
diff --git a/src/mess/machine/nes.c b/src/mess/machine/nes.c
index 73e3eedba4f..5bbe950cf07 100644
--- a/src/mess/machine/nes.c
+++ b/src/mess/machine/nes.c
@@ -36,7 +36,7 @@ static void fds_irq(device_t *device, int scanline, int vblank, int blanked);
static void init_nes_core( running_machine &machine )
{
nes_state *state = machine.driver_data<nes_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
static const char *const bank_names[] = { "bank1", "bank2", "bank3", "bank4" };
int prg_banks = (state->m_prg_chunks == 1) ? (2 * 2) : (state->m_prg_chunks * 2);
int i;
@@ -46,7 +46,7 @@ static void init_nes_core( running_machine &machine )
// other pointers got set in the loading routine
/* Brutal hack put in as a consequence of the new memory system; we really need to fix the NES code */
- space->install_readwrite_bank(0x0000, 0x07ff, 0, 0x1800, "bank10");
+ space.install_readwrite_bank(0x0000, 0x07ff, 0, 0x1800, "bank10");
machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(nes_chr_r), FUNC(nes_chr_w));
machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nes_nt_r), FUNC(nes_nt_w));
@@ -68,12 +68,12 @@ static void init_nes_core( running_machine &machine )
if (state->m_fds_ram == NULL)
state->m_fds_ram = auto_alloc_array(machine, UINT8, 0x8000);
- space->install_read_handler(0x4030, 0x403f, read8_delegate(FUNC(nes_state::nes_fds_r),state));
- space->install_read_bank(0x6000, 0xdfff, "bank2");
- space->install_read_bank(0xe000, 0xffff, "bank1");
+ space.install_read_handler(0x4030, 0x403f, read8_delegate(FUNC(nes_state::nes_fds_r),state));
+ space.install_read_bank(0x6000, 0xdfff, "bank2");
+ space.install_read_bank(0xe000, 0xffff, "bank1");
- space->install_write_handler(0x4020, 0x402f, write8_delegate(FUNC(nes_state::nes_fds_w),state));
- space->install_write_bank(0x6000, 0xdfff, "bank2");
+ space.install_write_handler(0x4020, 0x402f, write8_delegate(FUNC(nes_state::nes_fds_w),state));
+ space.install_write_bank(0x6000, 0xdfff, "bank2");
state->membank("bank1")->set_base(&state->m_rom[0xe000]);
state->membank("bank2")->set_base(state->m_fds_ram);
@@ -84,11 +84,11 @@ static void init_nes_core( running_machine &machine )
pcb_handlers_setup(machine);
/* Set up the memory handlers for the mapper */
- space->install_read_bank(0x8000, 0x9fff, "bank1");
- space->install_read_bank(0xa000, 0xbfff, "bank2");
- space->install_read_bank(0xc000, 0xdfff, "bank3");
- space->install_read_bank(0xe000, 0xffff, "bank4");
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_read_bank(0x8000, 0x9fff, "bank1");
+ space.install_read_bank(0xa000, 0xbfff, "bank2");
+ space.install_read_bank(0xc000, 0xdfff, "bank3");
+ space.install_read_bank(0xe000, 0xffff, "bank4");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
/* configure banks 1-4 */
for (i = 0; i < 4; i++)
@@ -161,35 +161,35 @@ static void init_nes_core( running_machine &machine )
// there are still some quirk about writes to bank5... I hope to fix them soon. (mappers 34,45,52,246 have both mid_w and WRAM-->check)
if (state->m_mmc_write_mid)
- space->install_legacy_write_handler(0x6000, 0x7fff, state->m_mmc_write_mid,state->m_mmc_write_mid_name);
+ space.install_legacy_write_handler(0x6000, 0x7fff, state->m_mmc_write_mid,state->m_mmc_write_mid_name);
if (state->m_mmc_write)
- space->install_legacy_write_handler(0x8000, 0xffff, state->m_mmc_write, state->m_mmc_write_name);
+ space.install_legacy_write_handler(0x8000, 0xffff, state->m_mmc_write, state->m_mmc_write_name);
// In fact, we also allow single pcbs to overwrite the bank read handlers defined above,
// because some pcbs (mainly pirate ones) require protection values to be read instead of
// the expected ROM banks: these handlers, though, must take care of the ROM access as well
if (state->m_mmc_read_mid)
- space->install_legacy_read_handler(0x6000, 0x7fff, state->m_mmc_read_mid,state->m_mmc_read_mid_name);
+ space.install_legacy_read_handler(0x6000, 0x7fff, state->m_mmc_read_mid,state->m_mmc_read_mid_name);
if (state->m_mmc_read)
- space->install_legacy_read_handler(0x8000, 0xffff, state->m_mmc_read,state->m_mmc_read_name);
+ space.install_legacy_read_handler(0x8000, 0xffff, state->m_mmc_read,state->m_mmc_read_name);
// install additional handlers
if (state->m_pcb_id == BTL_SMB2B || state->m_mapper == 50)
{
- space->install_legacy_write_handler(0x4020, 0x403f, FUNC(smb2jb_extra_w));
- space->install_legacy_write_handler(0x40a0, 0x40bf, FUNC(smb2jb_extra_w));
+ space.install_legacy_write_handler(0x4020, 0x403f, FUNC(smb2jb_extra_w));
+ space.install_legacy_write_handler(0x40a0, 0x40bf, FUNC(smb2jb_extra_w));
}
if (state->m_pcb_id == KAISER_KS7017)
{
- space->install_legacy_read_handler(0x4030, 0x4030, FUNC(ks7017_extra_r));
- space->install_legacy_write_handler(0x4020, 0x40ff, FUNC(ks7017_extra_w));
+ space.install_legacy_read_handler(0x4030, 0x4030, FUNC(ks7017_extra_r));
+ space.install_legacy_write_handler(0x4020, 0x40ff, FUNC(ks7017_extra_w));
}
if (state->m_pcb_id == UNL_603_5052)
{
- space->install_legacy_read_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_r));
- space->install_legacy_write_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_w));
+ space.install_legacy_read_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_r));
+ space.install_legacy_write_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_w));
}
if (state->m_pcb_id == WAIXING_SH2)
diff --git a/src/mess/machine/nes_ines.c b/src/mess/machine/nes_ines.c
index 547b9203895..e791df460c7 100644
--- a/src/mess/machine/nes_ines.c
+++ b/src/mess/machine/nes_ines.c
@@ -47,17 +47,17 @@ static void ffe_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( mapper6_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mapper6_l_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x1fe:
state->m_mmc_latch1 = data & 0x80;
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
break;
case 0x1ff:
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x401:
@@ -75,19 +75,19 @@ static WRITE8_HANDLER( mapper6_l_w )
static WRITE8_HANDLER( mapper6_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mapper6_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_mmc_latch1) // when in "FFE mode" we are forced to use CHRRAM/EXRAM bank?
{
- prg16_89ab(space->machine(), data >> 2);
- // chr8(space->machine(), data & 0x03, ???);
+ prg16_89ab(space.machine(), data >> 2);
+ // chr8(space.machine(), data & 0x03, ???);
// due to lack of info on the exact behavior, we simply act as if mmc_latch1=1
if (state->m_mmc_chr_source == CHRROM)
- chr8(space->machine(), data & 0x03, CHRROM);
+ chr8(space.machine(), data & 0x03, CHRROM);
}
else if (state->m_mmc_chr_source == CHRROM) // otherwise, we can use CHRROM (when present)
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -105,8 +105,8 @@ static WRITE8_HANDLER( mapper8_w )
{
LOG_MMC(("mapper8_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data & 0x07, CHRROM);
- prg16_89ab(space->machine(), data >> 3);
+ chr8(space.machine(), data & 0x07, CHRROM);
+ prg16_89ab(space.machine(), data >> 3);
}
/*************************************************************
@@ -123,16 +123,16 @@ static WRITE8_HANDLER( mapper8_w )
static WRITE8_HANDLER( mapper17_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mapper17_l_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x1fe:
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
break;
case 0x1ff:
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x401:
@@ -147,16 +147,16 @@ static WRITE8_HANDLER( mapper17_l_w )
break;
case 0x404:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x405:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x406:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x407:
- prg8_ef(space->machine(), data);
+ prg8_ef(space.machine(), data);
break;
case 0x410:
@@ -167,7 +167,7 @@ static WRITE8_HANDLER( mapper17_l_w )
case 0x415:
case 0x416:
case 0x417:
- chr1_x(space->machine(), offset & 7, data, CHRROM);
+ chr1_x(space.machine(), offset & 7, data, CHRROM);
break;
}
}
diff --git a/src/mess/machine/nes_mmc.c b/src/mess/machine/nes_mmc.c
index 68955202724..8a068ecfef4 100644
--- a/src/mess/machine/nes_mmc.c
+++ b/src/mess/machine/nes_mmc.c
@@ -167,7 +167,7 @@ static WRITE8_HANDLER( mapper17_l_w );
WRITE8_HANDLER( nes_chr_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = offset >> 10;
if (state->m_chr_map[bank].source == CHRRAM)
@@ -178,7 +178,7 @@ WRITE8_HANDLER( nes_chr_w )
READ8_HANDLER( nes_chr_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = offset >> 10;
// a few CNROM boards contained copy protection schemes through
@@ -193,7 +193,7 @@ READ8_HANDLER( nes_chr_r )
WRITE8_HANDLER( nes_nt_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int page = ((offset & 0xc00) >> 10);
if (state->m_nt_page[page].writable == 0)
@@ -204,7 +204,7 @@ WRITE8_HANDLER( nes_nt_w )
READ8_HANDLER( nes_nt_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int page = ((offset & 0xc00) >> 10);
if (state->m_nt_page[page].source == MMC5FILL)
@@ -219,7 +219,7 @@ READ8_HANDLER( nes_nt_r )
WRITE8_HANDLER( nes_low_mapper_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
if (state->m_mmc_write_low)
(*state->m_mmc_write_low)(space, offset, data);
@@ -229,7 +229,7 @@ WRITE8_HANDLER( nes_low_mapper_w )
READ8_HANDLER( nes_low_mapper_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
if (state->m_mmc_read_low)
return (*state->m_mmc_read_low)(space, offset);
diff --git a/src/mess/machine/nes_pcb.c b/src/mess/machine/nes_pcb.c
index c5e486f3938..7b8a66c65b0 100644
--- a/src/mess/machine/nes_pcb.c
+++ b/src/mess/machine/nes_pcb.c
@@ -718,7 +718,7 @@ static WRITE8_HANDLER( uxrom_w )
{
LOG_MMC(("uxrom_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -741,7 +741,7 @@ static WRITE8_HANDLER( uxrom_cc_w )
{
LOG_MMC(("uxrom_cc_w, offset: %04x, data: %02x\n", offset, data));
- prg16_cdef(space->machine(), data);
+ prg16_cdef(space.machine(), data);
}
/*************************************************************
@@ -764,7 +764,7 @@ static WRITE8_HANDLER( un1rom_w )
{
LOG_MMC(("un1rom_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), data >> 2);
+ prg16_89ab(space.machine(), data >> 2);
}
/*************************************************************
@@ -793,12 +793,12 @@ static WRITE8_HANDLER( un1rom_w )
static WRITE8_HANDLER( cnrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cnrom_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_ce_mask)
{
- chr8(space->machine(), data & ~state->m_ce_mask, CHRROM);
+ chr8(space.machine(), data & ~state->m_ce_mask, CHRROM);
if ((data & state->m_ce_mask) == state->m_ce_state)
state->m_chr_open_bus = 0;
@@ -806,7 +806,7 @@ static WRITE8_HANDLER( cnrom_w )
state->m_chr_open_bus = 1;
}
else
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -849,7 +849,7 @@ static WRITE8_HANDLER( bandai_pt554_m_w )
static WRITE8_HANDLER( cprom_w )
{
LOG_MMC(("cprom_w, offset: %04x, data: %02x\n", offset, data));
- chr4_4(space->machine(), data, CHRRAM);
+ chr4_4(space.machine(), data, CHRRAM);
}
/*************************************************************
@@ -872,8 +872,8 @@ static WRITE8_HANDLER( axrom_w )
{
LOG_MMC(("axrom_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- prg32(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -894,7 +894,7 @@ static WRITE8_HANDLER( bxrom_w )
/* Deadly Towers is really a BxROM game - the demo screens look wrong using mapper 7. */
LOG_MMC(("bxrom_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -913,8 +913,8 @@ static WRITE8_HANDLER( gxrom_w )
{
LOG_MMC(("gxrom_w, offset %04x, data: %02x\n", offset, data));
- prg32(space->machine(), (data & 0xf0) >> 4);
- chr8(space->machine(), data & 0x0f, CHRROM);
+ prg32(space.machine(), (data & 0xf0) >> 4);
+ chr8(space.machine(), data & 0x0f, CHRROM);
}
/*************************************************************
@@ -933,9 +933,9 @@ static TIMER_CALLBACK( mmc1_resync_callback )
}
-static void mmc1_set_wram( address_space *space, int board )
+static void mmc1_set_wram( address_space &space, int board )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
nes_state *state = machine.driver_data<nes_state>();
UINT8 bank = BIT(state->m_mmc_reg[0], 4) ? BIT(state->m_mmc_reg[1], 4) : BIT(state->m_mmc_reg[1], 3);
@@ -943,10 +943,10 @@ static void mmc1_set_wram( address_space *space, int board )
{
case STD_SXROM: // here also reads are disabled!
if (!BIT(state->m_mmc_reg[3], 4))
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_readwrite(0x6000, 0x7fff);
+ space.unmap_readwrite(0x6000, 0x7fff);
break;
}
case STD_SXROM_A: // ignore WRAM enable bit
@@ -957,10 +957,10 @@ static void mmc1_set_wram( address_space *space, int board )
break;
case STD_SOROM: // there are 2 WRAM banks only and battery is bank 2 for the cart (hence, we invert bank, because we have battery first)
if (!BIT(state->m_mmc_reg[3], 4))
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_readwrite(0x6000, 0x7fff);
+ space.unmap_readwrite(0x6000, 0x7fff);
break;
}
case STD_SOROM_A: // ignore WRAM enable bit
@@ -1005,9 +1005,9 @@ static void mmc1_set_prg( running_machine &machine )
}
}
-static void mmc1_set_prg_wram( address_space *space, int board )
+static void mmc1_set_prg_wram( address_space &space, int board )
{
- mmc1_set_prg(space->machine());
+ mmc1_set_prg(space.machine());
mmc1_set_wram(space, board);
}
@@ -1025,9 +1025,9 @@ static void mmc1_set_chr( running_machine &machine )
chr8(machine, (state->m_mmc_reg[1] & 0x1f) >> 1, state->m_mmc_chr_source);
}
-static void common_sxrom_write_handler( address_space *space, offs_t offset, UINT8 data, int board )
+static void common_sxrom_write_handler( address_space &space, offs_t offset, UINT8 data, int board )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
nes_state *state = machine.driver_data<nes_state>();
/* Note that there is only one latch and shift counter, shared amongst the 4 regs */
/* Space Shuttle will not work if they have independent variables. */
@@ -1044,7 +1044,7 @@ static void common_sxrom_write_handler( address_space *space, offs_t offset, UIN
else
{
state->m_mmc1_reg_write_enable = 0;
- space->machine().scheduler().synchronize(FUNC(mmc1_resync_callback));
+ space.machine().scheduler().synchronize(FUNC(mmc1_resync_callback));
}
if (data & 0x80)
@@ -1103,7 +1103,7 @@ static void common_sxrom_write_handler( address_space *space, offs_t offset, UIN
static WRITE8_HANDLER( sxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sxrom_w, offset: %04x, data: %02x\n", offset, data));
common_sxrom_write_handler(space, offset, data, state->m_pcb_id);
@@ -1152,35 +1152,35 @@ static void mmc2_latch( device_t *device, offs_t offset )
static WRITE8_HANDLER( pxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("pxrom_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x2000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x3000:
state->m_mmc_reg[0] = data;
if (state->m_mmc_latch1 == 0xfd)
- chr4_0(space->machine(), state->m_mmc_reg[0], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_reg[0], CHRROM);
break;
case 0x4000:
state->m_mmc_reg[1] = data;
if (state->m_mmc_latch1 == 0xfe)
- chr4_0(space->machine(), state->m_mmc_reg[1], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_reg[1], CHRROM);
break;
case 0x5000:
state->m_mmc_reg[2] = data;
if (state->m_mmc_latch2 == 0xfd)
- chr4_4(space->machine(), state->m_mmc_reg[2], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_reg[2], CHRROM);
break;
case 0x6000:
state->m_mmc_reg[3] = data;
if (state->m_mmc_latch2 == 0xfe)
- chr4_4(space->machine(), state->m_mmc_reg[3], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_reg[3], CHRROM);
break;
case 0x7000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
default:
LOG_MMC(("MMC2 uncaught w: %04x:%02x\n", offset, data));
@@ -1206,7 +1206,7 @@ static WRITE8_HANDLER( fxrom_w )
switch (offset & 0x7000)
{
case 0x2000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
pxrom_w(space, offset, data);
@@ -1222,9 +1222,9 @@ static WRITE8_HANDLER( fxrom_w )
*************************************************************/
-static void mmc3_set_wram( address_space *space )
+static void mmc3_set_wram( address_space &space )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
nes_state *state = machine.driver_data<nes_state>();
// skip this function if we are emulating a MMC3 clone with mid writes
@@ -1232,18 +1232,18 @@ static void mmc3_set_wram( address_space *space )
return;
if (BIT(state->m_mmc3_wram_protect, 7))
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_readwrite(0x6000, 0x7fff);
+ space.unmap_readwrite(0x6000, 0x7fff);
return;
}
if (!BIT(state->m_mmc3_wram_protect, 6))
- space->install_write_bank(0x6000, 0x7fff, "bank5");
+ space.install_write_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_write(0x6000, 0x7fff);
+ space.unmap_write(0x6000, 0x7fff);
return;
}
}
@@ -1299,7 +1299,7 @@ static void mmc3_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( txrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
LOG_MMC(("txrom_w, offset: %04x, data: %02x\n", offset, data));
@@ -1312,11 +1312,11 @@ static WRITE8_HANDLER( txrom_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -1326,18 +1326,18 @@ static WRITE8_HANDLER( txrom_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2001:
@@ -1377,7 +1377,7 @@ static WRITE8_HANDLER( txrom_w )
static WRITE8_HANDLER( hkrom_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 write_hi, write_lo;
LOG_MMC(("hkrom_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -1397,7 +1397,7 @@ static WRITE8_HANDLER( hkrom_m_w )
static READ8_HANDLER( hkrom_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("hkrom_m_r, offset: %04x\n", offset));
if (offset < 0x1000)
@@ -1418,7 +1418,7 @@ static READ8_HANDLER( hkrom_m_r )
static WRITE8_HANDLER( hkrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc6_helper;
LOG_MMC(("hkrom_w, offset: %04x, data: %02x\n", offset, data));
@@ -1433,11 +1433,11 @@ static WRITE8_HANDLER( hkrom_w )
/* Has PRG Mode changed? */
if (BIT(mmc6_helper, 6))
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (BIT(mmc6_helper, 7))
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x2001:
@@ -1546,7 +1546,7 @@ static void tqrom_set_chr( running_machine &machine )
static WRITE8_HANDLER( tqrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
LOG_MMC(("tqrom_w, offset: %04x, data: %02x\n", offset, data));
@@ -1558,11 +1558,11 @@ static WRITE8_HANDLER( tqrom_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- tqrom_set_chr(space->machine());
+ tqrom_set_chr(space.machine());
break;
case 0x0001: /* $8001 */
cmd = state->m_mmc3_latch & 0x07;
@@ -1571,12 +1571,12 @@ static WRITE8_HANDLER( tqrom_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- tqrom_set_chr(space->machine());
+ tqrom_set_chr(space.machine());
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
@@ -1598,7 +1598,7 @@ static WRITE8_HANDLER( tqrom_w )
static WRITE8_HANDLER( zz_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper = data & 0x07;
LOG_MMC(("zz_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -1606,8 +1606,8 @@ static WRITE8_HANDLER( zz_m_w )
state->m_mmc_prg_mask = (mmc_helper << 1) | 0x07;
state->m_mmc_chr_base = BIT(mmc_helper, 2) << 7;
state->m_mmc_chr_mask = 0x7f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
/*************************************************************
@@ -1621,15 +1621,15 @@ static WRITE8_HANDLER( zz_m_w )
static WRITE8_HANDLER( qj_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("qj_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_prg_base = BIT(data, 0) << 4;
state->m_mmc_prg_mask = 0x0f;
state->m_mmc_chr_base = BIT(data, 0) << 7;
state->m_mmc_chr_mask = 0x7f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
/*************************************************************
@@ -1858,7 +1858,7 @@ static void mmc5_ppu_mirror( running_machine &machine, int page, int src )
static READ8_HANDLER( exrom_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int retVal;
/* $5c00 - $5fff: extended videoram attributes */
@@ -1895,13 +1895,13 @@ static READ8_HANDLER( exrom_l_r )
static WRITE8_HANDLER( exrom_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
// LOG_MMC(("Mapper 5 write, offset: %04x, data: %02x\n", offset + 0x4100, data));
/* Send $5000-$5015 to the sound chip */
if ((offset >= 0xf00) && (offset <= 0xf15))
{
- nes_psg_w(state->m_sound, *space, offset & 0x1f, data);
+ nes_psg_w(state->m_sound, space, offset & 0x1f, data);
return;
}
@@ -1917,7 +1917,7 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x1000: /* $5100 */
state->m_mmc5_prg_mode = data & 0x03;
- // mmc5_update_prg(space->machine());
+ // mmc5_update_prg(space.machine());
LOG_MMC(("MMC5 rom bank mode: %02x\n", data));
break;
@@ -1945,17 +1945,17 @@ static WRITE8_HANDLER( exrom_l_w )
case 0x1004: /* $5104 - Extra VRAM (EXRAM) control */
state->m_mmc5_vram_control = data & 0x03;
// update render
- mmc5_update_render_mode(space->machine());
+ mmc5_update_render_mode(space.machine());
LOG_MMC(("MMC5 exram control: %02x\n", data));
break;
case 0x1005: /* $5105 */
- mmc5_ppu_mirror(space->machine(), 0, data & 0x03);
- mmc5_ppu_mirror(space->machine(), 1, (data & 0x0c) >> 2);
- mmc5_ppu_mirror(space->machine(), 2, (data & 0x30) >> 4);
- mmc5_ppu_mirror(space->machine(), 3, (data & 0xc0) >> 6);
+ mmc5_ppu_mirror(space.machine(), 0, data & 0x03);
+ mmc5_ppu_mirror(space.machine(), 1, (data & 0x0c) >> 2);
+ mmc5_ppu_mirror(space.machine(), 2, (data & 0x30) >> 4);
+ mmc5_ppu_mirror(space.machine(), 3, (data & 0xc0) >> 6);
// update render
- mmc5_update_render_mode(space->machine());
+ mmc5_update_render_mode(space.machine());
break;
/* tile data for MMC5 flood-fill NT mode */
@@ -1979,9 +1979,9 @@ static WRITE8_HANDLER( exrom_l_w )
LOG_MMC(("MMC5 mid RAM bank select: %02x\n", data & 0x07));
// FIXME: a few Koei games have both WRAM & BWRAM but here we don't support this (yet)
if (state->m_battery)
- wram_bank(space->machine(), data, NES_BATTERY);
+ wram_bank(space.machine(), data, NES_BATTERY);
else
- wram_bank(space->machine(), data, NES_WRAM);
+ wram_bank(space.machine(), data, NES_WRAM);
break;
@@ -1990,7 +1990,7 @@ static WRITE8_HANDLER( exrom_l_w )
case 0x1016: /* $5116 */
case 0x1017: /* $5117 */
state->m_mmc5_prg_regs[offset & 3] = data;
- mmc5_update_prg(space->machine());
+ mmc5_update_prg(space.machine());
break;
#if 0
@@ -2009,7 +2009,7 @@ static WRITE8_HANDLER( exrom_l_w )
state->m_mmc5_vrom_regA[offset & 0x07] = data;
state->m_mmc5_last_chr_a = 1;
if (state->m_ppu->get_current_scanline() == 240 || !state->m_ppu->is_sprite_8x16())
- mmc5_update_chr_a(space->machine());
+ mmc5_update_chr_a(space.machine());
}
break;
@@ -2022,7 +2022,7 @@ static WRITE8_HANDLER( exrom_l_w )
state->m_mmc5_vrom_regB[offset & 0x03] = data;
state->m_mmc5_last_chr_a = 0;
if (state->m_ppu->get_current_scanline() == 240 || !state->m_ppu->is_sprite_8x16())
- mmc5_update_chr_b(space->machine());
+ mmc5_update_chr_b(space.machine());
break;
case 0x1030: /* $5130 */
@@ -2044,7 +2044,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[0] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_0(space->machine(), state->m_MMC5_vrom_bank[0], CHRROM);
+ chr1_0(space.machine(), state->m_MMC5_vrom_bank[0], CHRROM);
// state->m_nes_vram_sprite[0] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[0] = 4;
// vrom_page_a = 1;
@@ -2058,13 +2058,13 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x02:
/* 2k switch */
- chr2_0(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_0(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[1] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_1(space->machine(), state->m_MMC5_vrom_bank[1], CHRROM);
+ chr1_1(space.machine(), state->m_MMC5_vrom_bank[1], CHRROM);
// state->m_nes_vram_sprite[1] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[1] = 5;
// vrom_page_a = 1;
@@ -2080,7 +2080,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[2] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_2(space->machine(), state->m_MMC5_vrom_bank[2], CHRROM);
+ chr1_2(space.machine(), state->m_MMC5_vrom_bank[2], CHRROM);
// state->m_nes_vram_sprite[2] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[2] = 6;
// vrom_page_a = 1;
@@ -2093,17 +2093,17 @@ static WRITE8_HANDLER( exrom_l_w )
switch (state->m_mmc5_chr_mode)
{
case 0x01:
- chr4_0(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
break;
case 0x02:
/* 2k switch */
- chr2_2(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_2(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[3] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_3(space->machine(), state->m_MMC5_vrom_bank[3], CHRROM);
+ chr1_3(space.machine(), state->m_MMC5_vrom_bank[3], CHRROM);
// state->m_nes_vram_sprite[3] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[3] = 7;
// vrom_page_a = 1;
@@ -2119,7 +2119,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[4] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_4(space->machine(), state->m_MMC5_vrom_bank[4], CHRROM);
+ chr1_4(space.machine(), state->m_MMC5_vrom_bank[4], CHRROM);
// state->m_nes_vram_sprite[4] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[0] = 0;
// vrom_page_a = 0;
@@ -2133,13 +2133,13 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x02:
/* 2k switch */
- chr2_4(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_4(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[5] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_5(space->machine(), state->m_MMC5_vrom_bank[5], CHRROM);
+ chr1_5(space.machine(), state->m_MMC5_vrom_bank[5], CHRROM);
// state->m_nes_vram_sprite[5] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[1] = 1;
// vrom_page_a = 0;
@@ -2155,7 +2155,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[6] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_6(space->machine(), state->m_MMC5_vrom_bank[6], CHRROM);
+ chr1_6(space.machine(), state->m_MMC5_vrom_bank[6], CHRROM);
// state->m_nes_vram_sprite[6] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[2] = 2;
// vrom_page_a = 0;
@@ -2169,21 +2169,21 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x00:
/* 8k switch */
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
break;
case 0x01:
/* 4k switch */
- chr4_4(space->machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
case 0x02:
/* 2k switch */
- chr2_6(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_6(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[7] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_7(space->machine(), state->m_MMC5_vrom_bank[7], CHRROM);
+ chr1_7(space.machine(), state->m_MMC5_vrom_bank[7], CHRROM);
// state->m_nes_vram_sprite[7] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[3] = 3;
// vrom_page_a = 0;
@@ -2201,7 +2201,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[0]] = data * 64;
// nes_vram[0 + (vrom_page_a*4)] = data * 64;
// nes_vram[0] = data * 64;
- chr1_4(space->machine(), state->m_MMC5_vrom_bank[8], CHRROM);
+ chr1_4(space.machine(), state->m_MMC5_vrom_bank[8], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2217,8 +2217,8 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x02:
/* 2k switch */
- chr2_0(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
- chr2_4(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_0(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_4(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
@@ -2226,7 +2226,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[1]] = data * 64;
// nes_vram[1 + (vrom_page_a*4)] = data * 64;
// nes_vram[1] = data * 64;
- chr1_5(space->machine(), state->m_MMC5_vrom_bank[9], CHRROM);
+ chr1_5(space.machine(), state->m_MMC5_vrom_bank[9], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2246,7 +2246,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[2]] = data * 64;
// nes_vram[2 + (vrom_page_a*4)] = data * 64;
// nes_vram[2] = data * 64;
- chr1_6(space->machine(), state->m_MMC5_vrom_bank[10], CHRROM);
+ chr1_6(space.machine(), state->m_MMC5_vrom_bank[10], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2263,18 +2263,18 @@ static WRITE8_HANDLER( exrom_l_w )
case 0x00:
/* 8k switch */
/* switches in first half of an 8K bank!) */
- chr4_0(space->machine(), data << 1, CHRROM);
- chr4_4(space->machine(), data << 1, CHRROM);
+ chr4_0(space.machine(), data << 1, CHRROM);
+ chr4_4(space.machine(), data << 1, CHRROM);
break;
case 0x01:
/* 4k switch */
- chr4_0(space->machine(), data, CHRROM);
- chr4_4(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
case 0x02:
/* 2k switch */
- chr2_2(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
- chr2_6(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_2(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_6(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
@@ -2282,7 +2282,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[3]] = data * 64;
// nes_vram[3 + (vrom_page_a*4)] = data * 64;
// nes_vram[3] = data * 64;
- chr1_7(space->machine(), state->m_MMC5_vrom_bank[11], CHRROM);
+ chr1_7(space.machine(), state->m_MMC5_vrom_bank[11], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2397,38 +2397,38 @@ static void ntbrom_mirror( running_machine &machine, int mirror, int mirr0, int
static WRITE8_HANDLER( ntbrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ntbrom_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x1000:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x2000:
- chr2_4(space->machine(), data, CHRROM);
+ chr2_4(space.machine(), data, CHRROM);
break;
case 0x3000:
- chr2_6(space->machine(), data, CHRROM);
+ chr2_6(space.machine(), data, CHRROM);
break;
case 0x4000:
state->m_mmc_latch1 = data & 0x7f;
- ntbrom_mirror(space->machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
+ ntbrom_mirror(space.machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
break;
case 0x5000:
state->m_mmc_latch2 = data & 0x7f;
- ntbrom_mirror(space->machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
+ ntbrom_mirror(space.machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
break;
case 0x6000:
state->m_mmc_reg[0] = data & 0x13;
- ntbrom_mirror(space->machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
+ ntbrom_mirror(space.machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
break;
case 0x7000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
LOG_MMC(("ntbrom_w uncaught write, offset: %04x, data: %02x\n", offset, data));
@@ -2476,7 +2476,7 @@ static void jxrom_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( jxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("jxrom_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x6000)
@@ -2489,41 +2489,41 @@ static WRITE8_HANDLER( jxrom_w )
switch (state->m_mmc_latch1)
{
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
- chr1_x(space->machine(), state->m_mmc_latch1, data, CHRROM);
+ chr1_x(space.machine(), state->m_mmc_latch1, data, CHRROM);
break;
case 8:
if (!(data & 0x40))
{
// is PRG ROM
- space->unmap_write(0x6000, 0x7fff);
- prg8_67(space->machine(), data & 0x3f);
+ space.unmap_write(0x6000, 0x7fff);
+ prg8_67(space.machine(), data & 0x3f);
}
else if (data & 0x80)
{
// is PRG RAM
- space->install_write_bank(0x6000, 0x7fff, "bank5");
+ space.install_write_bank(0x6000, 0x7fff, "bank5");
state->m_prg_bank[4] = state->m_battery_bank5_start + (data & 0x3f);
state->membank("bank5")->set_entry(state->m_prg_bank[4]);
}
break;
case 9:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0a:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0b:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0c:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x0d:
@@ -2569,7 +2569,7 @@ static WRITE8_HANDLER( jxrom_w )
static WRITE8_HANDLER( dxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("dxrom_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x2000)
@@ -2580,14 +2580,14 @@ static WRITE8_HANDLER( dxrom_w )
case 1:
switch (state->m_mmc_latch1 & 0x07)
{
- case 0: chr2_0(space->machine(), data >> 1, CHRROM); break;
- case 1: chr2_2(space->machine(), data >> 1, CHRROM); break;
- case 2: chr1_4(space->machine(), data | 0x40, CHRROM); break;
- case 3: chr1_5(space->machine(), data | 0x40, CHRROM); break;
- case 4: chr1_6(space->machine(), data | 0x40, CHRROM); break;
- case 5: chr1_7(space->machine(), data | 0x40, CHRROM); break;
- case 6: prg8_89(space->machine(), data); break;
- case 7: prg8_ab(space->machine(), data); break;
+ case 0: chr2_0(space.machine(), data >> 1, CHRROM); break;
+ case 1: chr2_2(space.machine(), data >> 1, CHRROM); break;
+ case 2: chr1_4(space.machine(), data | 0x40, CHRROM); break;
+ case 3: chr1_5(space.machine(), data | 0x40, CHRROM); break;
+ case 4: chr1_6(space.machine(), data | 0x40, CHRROM); break;
+ case 5: chr1_7(space.machine(), data | 0x40, CHRROM); break;
+ case 6: prg8_89(space.machine(), data); break;
+ case 7: prg8_ab(space.machine(), data); break;
}
break;
case 0:
@@ -2616,7 +2616,7 @@ static WRITE8_HANDLER( namcot3453_w )
// additional mirroring control when writing to even addresses
if (!(offset & 1))
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
dxrom_w(space, offset, data);
}
@@ -2635,14 +2635,14 @@ static WRITE8_HANDLER( namcot3453_w )
static WRITE8_HANDLER( namcot3446_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot3446_w, offset: %04x, data: %02x\n", offset, data));
// NEStopia does not have this!
if (offset >= 0x2000)
{
if (!(offset & 1))
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
return;
}
@@ -2651,12 +2651,12 @@ static WRITE8_HANDLER( namcot3446_w )
case 1:
switch (state->m_mmc_latch1 & 0x07)
{
- case 2: chr2_0(space->machine(), data, CHRROM); break;
- case 3: chr2_2(space->machine(), data, CHRROM); break;
- case 4: chr2_4(space->machine(), data, CHRROM); break;
- case 5: chr2_6(space->machine(), data, CHRROM); break;
- case 6: BIT(state->m_mmc_latch1, 6) ? prg8_cd(space->machine(), data) : prg8_89(space->machine(), data); break;
- case 7: prg8_ab(space->machine(), data); break;
+ case 2: chr2_0(space.machine(), data, CHRROM); break;
+ case 3: chr2_2(space.machine(), data, CHRROM); break;
+ case 4: chr2_4(space.machine(), data, CHRROM); break;
+ case 5: chr2_6(space.machine(), data, CHRROM); break;
+ case 6: BIT(state->m_mmc_latch1, 6) ? prg8_cd(space.machine(), data) : prg8_89(space.machine(), data); break;
+ case 7: prg8_ab(space.machine(), data); break;
}
break;
case 0:
@@ -2680,7 +2680,7 @@ static WRITE8_HANDLER( namcot3446_w )
static WRITE8_HANDLER( namcot3425_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mode;
LOG_MMC(("namcot3425_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x2000)
@@ -2692,26 +2692,26 @@ static WRITE8_HANDLER( namcot3425_w )
mode = state->m_mmc_latch1 & 0x07;
switch (mode)
{
- case 0: chr2_0(space->machine(), data >> 1, CHRROM); break;
- case 1: chr2_2(space->machine(), data >> 1, CHRROM); break;
+ case 0: chr2_0(space.machine(), data >> 1, CHRROM); break;
+ case 1: chr2_2(space.machine(), data >> 1, CHRROM); break;
case 2:
case 3:
case 4:
case 5:
- chr1_x(space->machine(), 2 + mode, data, CHRROM);
+ chr1_x(space.machine(), 2 + mode, data, CHRROM);
state->m_mmc_reg[mode - 2] = BIT(data, 5);
if (!BIT(state->m_mmc_latch1, 7))
{
- set_nt_page(space->machine(), 0, CIRAM, state->m_mmc_reg[0], 1);
- set_nt_page(space->machine(), 1, CIRAM, state->m_mmc_reg[1], 1);
- set_nt_page(space->machine(), 2, CIRAM, state->m_mmc_reg[2], 1);
- set_nt_page(space->machine(), 3, CIRAM, state->m_mmc_reg[3], 1);
+ set_nt_page(space.machine(), 0, CIRAM, state->m_mmc_reg[0], 1);
+ set_nt_page(space.machine(), 1, CIRAM, state->m_mmc_reg[1], 1);
+ set_nt_page(space.machine(), 2, CIRAM, state->m_mmc_reg[2], 1);
+ set_nt_page(space.machine(), 3, CIRAM, state->m_mmc_reg[3], 1);
}
else
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
break;
- case 6: prg8_89(space->machine(), data); break;
- case 7: prg8_ab(space->machine(), data); break;
+ case 6: prg8_89(space.machine(), data); break;
+ case 7: prg8_ab(space.machine(), data); break;
}
break;
case 0:
@@ -2734,11 +2734,11 @@ static WRITE8_HANDLER( namcot3425_w )
static WRITE8_HANDLER( dis_74x377_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("dis_74x377_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data >> 4, state->m_mmc_chr_source);
- prg32(space->machine(), data & 0x0f);
+ chr8(space.machine(), data >> 4, state->m_mmc_chr_source);
+ prg32(space.machine(), data & 0x0f);
}
/*************************************************************
@@ -2753,7 +2753,7 @@ static WRITE8_HANDLER( dis_74x139x74_m_w )
{
LOG_MMC(("dis_74x139x74_m_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), ((data & 0x02) >> 1) | ((data & 0x01) << 1), CHRROM);
+ chr8(space.machine(), ((data & 0x02) >> 1) | ((data & 0x01) << 1), CHRROM);
}
/*************************************************************
@@ -2770,8 +2770,8 @@ static WRITE8_HANDLER( dis_74x161x138_m_w )
{
LOG_MMC(("dis_74x161x138_m_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data >> 2, CHRROM);
- prg32(space->machine(), data);
+ chr8(space.machine(), data >> 2, CHRROM);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -2788,13 +2788,13 @@ static WRITE8_HANDLER( dis_74x161x138_m_w )
static WRITE8_HANDLER( dis_74x161x161x32_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("dis_74x161x161x32_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_hard_mirroring) // there are two 'variants' depending on hardwired or mapper ctrl mirroring
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- chr8(space->machine(), data, CHRROM);
- prg16_89ab(space->machine(), data >> 4);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ chr8(space.machine(), data, CHRROM);
+ prg16_89ab(space.machine(), data >> 4);
}
/*************************************************************
@@ -2842,25 +2842,25 @@ static void bandai_lz_irq( device_t *device, int scanline, int vblank, int blank
static WRITE8_HANDLER( lz93d50_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("lz93d50_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x000f)
{
case 0: case 1: case 2: case 3:
case 4: case 5: case 6: case 7:
- chr1_x(space->machine(), offset & 0x07, data, state->m_mmc_chr_source);
+ chr1_x(space.machine(), offset & 0x07, data, state->m_mmc_chr_source);
break;
case 8:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
case 9:
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x0a:
@@ -2880,7 +2880,7 @@ static WRITE8_HANDLER( lz93d50_w )
static WRITE8_HANDLER( lz93d50_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("lz93d50_m_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_battery && !state->m_wram)
@@ -2906,7 +2906,7 @@ static void fjump2_set_prg( running_machine &machine )
static WRITE8_HANDLER( fjump2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fjump2_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x000f)
@@ -2914,11 +2914,11 @@ static WRITE8_HANDLER( fjump2_w )
case 0: case 1: case 2: case 3:
case 4: case 5: case 6: case 7:
state->m_mmc_reg[offset & 0x000f] = data;
- fjump2_set_prg(space->machine());
+ fjump2_set_prg(space.machine());
break;
case 8:
state->m_mmc_latch1 = (data & 0x0f);
- fjump2_set_prg(space->machine());
+ fjump2_set_prg(space.machine());
break;
default:
lz93d50_m_w(space, offset & 0x0f, data);
@@ -2942,7 +2942,7 @@ static WRITE8_HANDLER( bandai_ks_w )
{
LOG_MMC(("bandai_ks_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), data ^ 0x08);
+ prg16_89ab(space.machine(), data ^ 0x08);
}
/*************************************************************
@@ -2960,16 +2960,16 @@ static WRITE8_HANDLER( bandai_ks_w )
static WRITE8_HANDLER( bandai_ok_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("mapper96_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
state->m_mmc_latch1 = data;
mmc_helper = (state->m_mmc_latch1 & 0x03) | (data & 0x04);
- chr4_0(space->machine(), mmc_helper, CHRRAM);
- chr4_4(space->machine(), 0x03 | (data & 0x04), CHRRAM);
+ chr4_0(space.machine(), mmc_helper, CHRRAM);
+ chr4_4(space.machine(), 0x03 | (data & 0x04), CHRRAM);
}
/*************************************************************
@@ -2986,8 +2986,8 @@ static WRITE8_HANDLER( lrog017_w )
{
LOG_MMC(("lrog017_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
- chr2_0(space->machine(), (data >> 4), CHRROM);
+ prg32(space.machine(), data);
+ chr2_0(space.machine(), (data >> 4), CHRROM);
}
/*************************************************************
@@ -3002,9 +3002,9 @@ static WRITE8_HANDLER( irem_hd_w )
{
LOG_MMC(("irem_hd_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
- chr8(space->machine(), data >> 4, CHRROM);
- prg16_89ab(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ chr8(space.machine(), data >> 4, CHRROM);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -3025,8 +3025,8 @@ static WRITE8_HANDLER( tam_s1_w )
if (offset < 0x4000)
{
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
- prg16_cdef(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ prg16_cdef(space.machine(), data);
}
}
@@ -3042,25 +3042,25 @@ static WRITE8_HANDLER( tam_s1_w )
static WRITE8_HANDLER( g101_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("g101_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
// NEStopia here differs a little bit
- state->m_mmc_latch1 ? prg8_cd(space->machine(), data) : prg8_89(space->machine(), data);
+ state->m_mmc_latch1 ? prg8_cd(space.machine(), data) : prg8_89(space.machine(), data);
break;
case 0x1000:
state->m_mmc_latch1 = BIT(data, 1);
if (!state->m_hard_mirroring) // there are two 'variants' depending on hardwired or mapper ctrl mirroring
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
}
}
@@ -3098,17 +3098,17 @@ static void h3001_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( h3001_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("h3001_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x7fff)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1001:
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x1003:
@@ -3128,16 +3128,16 @@ static WRITE8_HANDLER( h3001_w )
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000: case 0x3001: case 0x3002: case 0x3003:
case 0x3004: case 0x3005: case 0x3006: case 0x3007:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x4000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
default:
@@ -3211,7 +3211,7 @@ static void ss88006_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( ss88006_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("mapper18_w, offset: %04x, data: %02x\n", offset, data));
@@ -3219,27 +3219,27 @@ static WRITE8_HANDLER( ss88006_w )
{
case 0x0000:
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0xf0) | (data & 0x0f);
- prg8_89(space->machine(), state->m_mmc_prg_bank[0]);
+ prg8_89(space.machine(), state->m_mmc_prg_bank[0]);
break;
case 0x0001:
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0x0f) | (data << 4);
- prg8_89(space->machine(), state->m_mmc_prg_bank[0]);
+ prg8_89(space.machine(), state->m_mmc_prg_bank[0]);
break;
case 0x0002:
state->m_mmc_prg_bank[1] = (state->m_mmc_prg_bank[1] & 0xf0) | (data & 0x0f);
- prg8_ab(space->machine(), state->m_mmc_prg_bank[1]);
+ prg8_ab(space.machine(), state->m_mmc_prg_bank[1]);
break;
case 0x0003:
state->m_mmc_prg_bank[1] = (state->m_mmc_prg_bank[1] & 0x0f) | (data << 4);
- prg8_ab(space->machine(), state->m_mmc_prg_bank[1]);
+ prg8_ab(space.machine(), state->m_mmc_prg_bank[1]);
break;
case 0x1000:
state->m_mmc_prg_bank[2] = (state->m_mmc_prg_bank[2] & 0xf0) | (data & 0x0f);
- prg8_cd(space->machine(), state->m_mmc_prg_bank[2]);
+ prg8_cd(space.machine(), state->m_mmc_prg_bank[2]);
break;
case 0x1001:
state->m_mmc_prg_bank[2] = (state->m_mmc_prg_bank[2] & 0x0f) | (data << 4);
- prg8_cd(space->machine(), state->m_mmc_prg_bank[2]);
+ prg8_cd(space.machine(), state->m_mmc_prg_bank[2]);
break;
/* $9002, 3 (1002, 3) uncaught = Jaleco Baseball writes 0 */
@@ -3255,7 +3255,7 @@ static WRITE8_HANDLER( ss88006_w )
else
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x6000:
@@ -3282,10 +3282,10 @@ static WRITE8_HANDLER( ss88006_w )
case 0x7002:
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
@@ -3310,8 +3310,8 @@ static WRITE8_HANDLER( ss88006_w )
static WRITE8_HANDLER( jf11_m_w )
{
LOG_MMC(("jf11_m_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data, CHRROM);
- prg32(space->machine(), data >> 4);
+ chr8(space.machine(), data, CHRROM);
+ prg32(space.machine(), data >> 4);
}
/*************************************************************
@@ -3334,8 +3334,8 @@ static WRITE8_HANDLER( jf13_m_w )
if (offset == 0)
{
- prg32(space->machine(), (data >> 4) & 0x03);
- chr8(space->machine(), ((data >> 4) & 0x04) | (data & 0x03), CHRROM);
+ prg32(space.machine(), (data >> 4) & 0x03);
+ chr8(space.machine(), ((data >> 4) & 0x04) | (data & 0x03), CHRROM);
}
if (offset == 0x1000)
@@ -3361,9 +3361,9 @@ static WRITE8_HANDLER( jf16_w )
{
LOG_MMC(("jf16_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- chr8(space->machine(), data >> 4, CHRROM);
- prg16_89ab(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ chr8(space.machine(), data >> 4, CHRROM);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -3386,9 +3386,9 @@ static WRITE8_HANDLER( jf17_w )
LOG_MMC(("jf17_w, offset: %04x, data: %02x\n", offset, data));
if (BIT(data, 7))
- prg16_89ab(space->machine(), data & 0x0f);
+ prg16_89ab(space.machine(), data & 0x0f);
if (BIT(data, 6))
- chr8(space->machine(), data & 0x0f, CHRROM);
+ chr8(space.machine(), data & 0x0f, CHRROM);
if (BIT(data, 5) && !BIT(data,4))
LOG_MMC(("Jaleco JF-17 sound write, data: %02x\n", data & 0x1f));
}
@@ -3412,9 +3412,9 @@ static WRITE8_HANDLER( jf19_w )
LOG_MMC(("jf19_w, offset: %04x, data: %02x\n", offset, data));
if (BIT(data, 7))
- prg16_cdef(space->machine(), data & 0x0f);
+ prg16_cdef(space.machine(), data & 0x0f);
if (BIT(data, 6))
- chr8(space->machine(), data & 0x0f, CHRROM);
+ chr8(space.machine(), data & 0x0f, CHRROM);
if (BIT(data, 5) && !BIT(data,4))
LOG_MMC(("Jaleco JF-19 sound write, data: %02x\n", data & 0x1f));
}
@@ -3433,34 +3433,34 @@ static WRITE8_HANDLER( jf19_w )
static WRITE8_HANDLER( konami_vrc1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("konami_vrc1_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1000:
- set_nt_mirroring(space->machine(), (data & 0x01) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (data & 0x01) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & 0x0f) | ((data & 0x02) << 3);
state->m_mmc_vrom_bank[1] = (state->m_mmc_vrom_bank[1] & 0x0f) | ((data & 0x04) << 2);
- chr4_0(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
- chr4_4(space->machine(), state->m_mmc_vrom_bank[1], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_vrom_bank[1], CHRROM);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x4000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x6000:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & 0x10) | (data & 0x0f);
- chr4_0(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x7000:
state->m_mmc_vrom_bank[1] = (state->m_mmc_vrom_bank[1] & 0x10) | (data & 0x0f);
- chr4_4(space->machine(), state->m_mmc_vrom_bank[1], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_vrom_bank[1], CHRROM);
break;
}
}
@@ -3475,7 +3475,7 @@ static WRITE8_HANDLER( konami_vrc1_w )
static WRITE8_HANDLER( konami_vrc2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank, shift, mask;
UINT32 shifted_offs = (offset & 0x7000)
| ((offset << (9 - state->m_vrc_ls_prg_a)) & 0x200)
@@ -3483,19 +3483,19 @@ static WRITE8_HANDLER( konami_vrc2_w )
LOG_MMC(("konami_vrc2_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x1000)
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
else if (offset < 0x2000)
{
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
}
else if (offset < 0x3000)
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
else if (offset < 0x7000)
{
bank = ((shifted_offs & 0x7000) - 0x3000) / 0x0800 + BIT(shifted_offs, 9);
@@ -3503,7 +3503,7 @@ static WRITE8_HANDLER( konami_vrc2_w )
mask = (0xf0 >> shift);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & mask)
| (((data >> state->m_vrc_ls_chr) & 0x0f) << shift);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
}
else
logerror("konami_vrc2_w uncaught write, addr: %04x value: %02x\n", offset + 0x8000, data);
@@ -3524,7 +3524,7 @@ static WRITE8_HANDLER( konami_vrc2_w )
static WRITE8_HANDLER( konami_vrc3_w )
{
LOG_MMC(("konami_vrc3_w, offset: %04x, data: %02x\n", offset, data));
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
switch (offset & 0x7000)
{
@@ -3546,7 +3546,7 @@ static WRITE8_HANDLER( konami_vrc3_w )
state->m_IRQ_count |= (data & 0x0f) << 4;
break;
case 0x7000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
logerror("konami_vrc3_w uncaught write, offset %04x, data: %02x\n", offset, data);
@@ -3591,7 +3591,7 @@ static void konami_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( konami_vrc4_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank, shift, mask;
UINT32 shifted_offs = (offset & 0x7000)
| ((offset << (9 - state->m_vrc_ls_prg_a)) & 0x200)
@@ -3601,10 +3601,10 @@ static WRITE8_HANDLER( konami_vrc4_w )
if (offset < 0x1000)
{
state->m_mmc_prg_bank[0] = data;
- vrc4_set_prg(space->machine());
+ vrc4_set_prg(space.machine());
}
else if (offset >= 0x2000 && offset < 0x3000)
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
else
{
switch (shifted_offs & 0x7300)
@@ -3613,16 +3613,16 @@ static WRITE8_HANDLER( konami_vrc4_w )
case 0x1100:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x1200:
case 0x1300:
state->m_mmc_latch1 = data & 0x02;
- vrc4_set_prg(space->machine());
+ vrc4_set_prg(space.machine());
break;
case 0x3000:
case 0x3100:
@@ -3644,7 +3644,7 @@ static WRITE8_HANDLER( konami_vrc4_w )
shift = BIT(shifted_offs, 8) * 4;
mask = (0xf0 >> shift);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & mask) | ((data & 0x0f) << shift);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x7000:
state->m_IRQ_count_latch = (state->m_IRQ_count_latch & 0xf0) | (data & 0x0f);
@@ -3680,7 +3680,7 @@ static WRITE8_HANDLER( konami_vrc4_w )
static WRITE8_HANDLER( konami_vrc6_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
UINT32 shifted_offs = (offset & 0x7000)
| ((offset << (9 - state->m_vrc_ls_prg_a)) & 0x200)
@@ -3688,9 +3688,9 @@ static WRITE8_HANDLER( konami_vrc6_w )
LOG_MMC(("konami_vrc6_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x1000)
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
else if (offset >= 0x4000 && offset < 0x5000)
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
else
{
switch (shifted_offs & 0x7300)
@@ -3709,10 +3709,10 @@ static WRITE8_HANDLER( konami_vrc6_w )
case 0x3300:
switch (data & 0x0c)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x04: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x08: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x0c: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x04: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x08: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x0c: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x5000:
@@ -3724,7 +3724,7 @@ static WRITE8_HANDLER( konami_vrc6_w )
case 0x6200:
case 0x6300:
bank = ((shifted_offs & 0x7000) - 0x5000) / 0x0400 + ((shifted_offs & 0x0300) >> 8);
- chr1_x(space->machine(), bank, data, CHRROM);
+ chr1_x(space.machine(), bank, data, CHRROM);
break;
case 0x7000:
state->m_IRQ_count_latch = data;
@@ -3760,23 +3760,23 @@ static WRITE8_HANDLER( konami_vrc6_w )
static WRITE8_HANDLER( konami_vrc7_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("konami_vrc7_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7018)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0008:
case 0x0010:
case 0x0018:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x1000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
/* TODO: there are sound regs in here */
@@ -3798,16 +3798,16 @@ static WRITE8_HANDLER( konami_vrc7_w )
case 0x5010:
case 0x5018:
bank = ((offset & 0x7000) - 0x2000) / 0x0800 + ((offset & 0x0018) ? 1 : 0);
- chr1_x(space->machine(), bank, data, state->m_mmc_chr_source);
+ chr1_x(space.machine(), bank, data, state->m_mmc_chr_source);
break;
case 0x6000:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x6008: case 0x6010: case 0x6018:
@@ -3864,7 +3864,7 @@ static void namcot_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( namcot163_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot163_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -3885,7 +3885,7 @@ static WRITE8_HANDLER( namcot163_l_w )
static READ8_HANDLER( namcot163_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot163_l_r, offset: %04x\n", offset));
offset += 0x100;
@@ -3912,7 +3912,7 @@ static void namcot163_set_mirror( running_machine &machine, UINT8 page, UINT8 da
static WRITE8_HANDLER( namcot163_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot163_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7800)
{
@@ -3920,29 +3920,29 @@ static WRITE8_HANDLER( namcot163_w )
case 0x1000: case 0x1800:
case 0x2000: case 0x2800:
case 0x3000: case 0x3800:
- chr1_x(space->machine(), offset / 0x800, data, CHRROM);
+ chr1_x(space.machine(), offset / 0x800, data, CHRROM);
break;
case 0x4000:
- namcot163_set_mirror(space->machine(), 0, data);
+ namcot163_set_mirror(space.machine(), 0, data);
break;
case 0x4800:
- namcot163_set_mirror(space->machine(), 1, data);
+ namcot163_set_mirror(space.machine(), 1, data);
break;
case 0x5000:
- namcot163_set_mirror(space->machine(), 2, data);
+ namcot163_set_mirror(space.machine(), 2, data);
break;
case 0x5800:
- namcot163_set_mirror(space->machine(), 3, data);
+ namcot163_set_mirror(space.machine(), 3, data);
break;
case 0x6000:
- prg8_89(space->machine(), data & 0x3f);
+ prg8_89(space.machine(), data & 0x3f);
break;
case 0x6800:
state->m_mmc_latch1 = data & 0xc0; // this should enable High CHRRAM, but we still have to properly implement it!
- prg8_ab(space->machine(), data & 0x3f);
+ prg8_ab(space.machine(), data & 0x3f);
break;
case 0x7000:
- prg8_cd(space->machine(), data & 0x3f);
+ prg8_cd(space.machine(), data & 0x3f);
break;
case 0x7800:
LOG_MMC(("Namcot-163 sound address write, data: %02x\n", data));
@@ -3964,16 +3964,16 @@ static WRITE8_HANDLER( namcot163_w )
static WRITE8_HANDLER( sunsoft1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sunsoft1_m_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_chr_chunks)
{
- chr4_0(space->machine(), data & 0x0f, CHRROM);
- chr4_4(space->machine(), data >> 4, CHRROM);
+ chr4_0(space.machine(), data & 0x0f, CHRROM);
+ chr4_4(space.machine(), data >> 4, CHRROM);
}
else
- prg16_89ab(space->machine(), data & 0x0f);
+ prg16_89ab(space.machine(), data & 0x0f);
}
/*************************************************************
@@ -3989,16 +3989,16 @@ static WRITE8_HANDLER( sunsoft1_m_w )
static WRITE8_HANDLER( sunsoft2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 sunsoft_helper = (data & 0x07) | ((data & 0x80) ? 0x08 : 0x00);
LOG_MMC(("sunsoft2_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_hard_mirroring) // there are two 'variants' depending on hardwired or mapper ctrl mirroring
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
if (state->m_chr_chunks)
- chr8(space->machine(), sunsoft_helper, CHRROM);
+ chr8(space.machine(), sunsoft_helper, CHRROM);
- prg16_89ab(space->machine(), data >> 4);
+ prg16_89ab(space.machine(), data >> 4);
}
/*************************************************************
@@ -4036,22 +4036,22 @@ static void sunsoft3_irq( device_t *device, int scanline, int vblank, int blanke
static WRITE8_HANDLER( sunsoft3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sunsoft3_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x7800)
{
case 0x0800:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x1800:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x2800:
- chr2_4(space->machine(), data, CHRROM);
+ chr2_4(space.machine(), data, CHRROM);
break;
case 0x3800:
- chr2_6(space->machine(), data, CHRROM);
+ chr2_6(space.machine(), data, CHRROM);
break;
case 0x4000:
case 0x4800:
@@ -4068,14 +4068,14 @@ static WRITE8_HANDLER( sunsoft3_w )
case 0x6800:
switch (data & 3)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x7800:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
LOG_MMC(("sunsoft3_w uncaught write, offset: %04x, data: %02x\n", offset, data));
@@ -4104,29 +4104,29 @@ static WRITE8_HANDLER( tc0190fmc_w )
switch (offset & 0x7003)
{
case 0x0000:
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg8_89(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x0003:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x2000:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 0x2001:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 0x2002:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
case 0x2003:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
}
}
@@ -4152,13 +4152,13 @@ static WRITE8_HANDLER( tc0190fmc_w )
static WRITE8_HANDLER( tc0190fmc_p16_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("tc0190fmc_p16_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7003)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
case 0x0002:
@@ -4182,7 +4182,7 @@ static WRITE8_HANDLER( tc0190fmc_p16_w )
state->m_IRQ_enable = 0;
break;
case 0x6000:
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -4203,32 +4203,32 @@ static WRITE8_HANDLER( tc0190fmc_p16_w )
static WRITE8_HANDLER( x1005_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("x1005_m_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x1ef0:
- chr2_0(space->machine(), (data & 0x7f) >> 1, CHRROM);
+ chr2_0(space.machine(), (data & 0x7f) >> 1, CHRROM);
break;
case 0x1ef1:
- chr2_2(space->machine(), (data & 0x7f) >> 1, CHRROM);
+ chr2_2(space.machine(), (data & 0x7f) >> 1, CHRROM);
break;
case 0x1ef2:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 0x1ef3:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 0x1ef4:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
case 0x1ef5:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
case 0x1ef6:
case 0x1ef7:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
break;
case 0x1ef8:
case 0x1ef9:
@@ -4236,15 +4236,15 @@ static WRITE8_HANDLER( x1005_m_w )
break;
case 0x1efa:
case 0x1efb:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1efc:
case 0x1efd:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x1efe:
case 0x1eff:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
default:
logerror("mapper80_m_w uncaught addr: %04x, value: %02x\n", offset + 0x6000, data);
@@ -4259,7 +4259,7 @@ static WRITE8_HANDLER( x1005_m_w )
static READ8_HANDLER( x1005_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("x1005a_m_r, offset: %04x\n", offset));
if (offset >= 0x1f00 && state->m_mapper_ram != NULL && state->m_mmc_latch1 == 0xa3)
@@ -4281,12 +4281,12 @@ static WRITE8_HANDLER( x1005a_m_w )
switch (offset)
{
case 0x1ef0:
- set_nt_page(space->machine(), 0, CIRAM, (data & 0x80) ? 1 : 0, 1);
- set_nt_page(space->machine(), 1, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 0, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 1, CIRAM, (data & 0x80) ? 1 : 0, 1);
break;
case 0x1ef1:
- set_nt_page(space->machine(), 2, CIRAM, (data & 0x80) ? 1 : 0, 1);
- set_nt_page(space->machine(), 3, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 2, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 3, CIRAM, (data & 0x80) ? 1 : 0, 1);
break;
}
@@ -4330,7 +4330,7 @@ static void x1017_set_chr( running_machine &machine )
static WRITE8_HANDLER( x1017_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 reg = offset & 0x07;
LOG_MMC(("x1017_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -4341,7 +4341,7 @@ static WRITE8_HANDLER( x1017_m_w )
if (state->m_mmc_vrom_bank[reg] != data)
{
state->m_mmc_vrom_bank[reg] = data;
- x1017_set_chr(space->machine());
+ x1017_set_chr(space.machine());
}
break;
case 0x1ef2:
@@ -4351,13 +4351,13 @@ static WRITE8_HANDLER( x1017_m_w )
if (state->m_mmc_vrom_bank[reg] != data)
{
state->m_mmc_vrom_bank[reg] = data;
- x1017_set_chr(space->machine());
+ x1017_set_chr(space.machine());
}
break;
case 0x1ef6:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
state->m_mmc_latch1 = ((data & 0x02) << 1);
- x1017_set_chr(space->machine());
+ x1017_set_chr(space.machine());
break;
case 0x1ef7:
case 0x1ef8:
@@ -4365,13 +4365,13 @@ static WRITE8_HANDLER( x1017_m_w )
state->m_mmc_reg[(offset & 0x0f) - 7] = data;
break;
case 0x1efa:
- prg8_89(space->machine(), data >> 2);
+ prg8_89(space.machine(), data >> 2);
break;
case 0x1efb:
- prg8_ab(space->machine(), data >> 2);
+ prg8_ab(space.machine(), data >> 2);
break;
case 0x1efc:
- prg8_cd(space->machine(), data >> 2);
+ prg8_cd(space.machine(), data >> 2);
break;
default:
logerror("x1017_m_w uncaught write, addr: %04x, value: %02x\n", offset + 0x6000, data);
@@ -4381,7 +4381,7 @@ static WRITE8_HANDLER( x1017_m_w )
static READ8_HANDLER( x1017_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("x1017_m_r, offset: %04x\n", offset));
// 2+2+1 KB of Internal RAM can be independently enabled/disabled!
@@ -4418,10 +4418,10 @@ static WRITE8_HANDLER( agci_50282_w )
LOG_MMC(("agci_50282_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x8000;
- data |= (space->read_byte(offset) & 1);
+ data |= (space.read_byte(offset) & 1);
- chr8(space->machine(), data >> 4, CHRROM);
- prg32(space->machine(), data);
+ chr8(space.machine(), data >> 4, CHRROM);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -4439,13 +4439,13 @@ static WRITE8_HANDLER( nina01_m_w )
switch (offset)
{
case 0x1ffd:
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
break;
case 0x1ffe:
- chr4_0(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
break;
case 0x1fff:
- chr4_4(space->machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
}
}
@@ -4469,8 +4469,8 @@ static WRITE8_HANDLER( nina06_l_w )
if (!(offset & 0x0100))
{
- prg32(space->machine(), data >> 3);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 3);
+ chr8(space.machine(), data, CHRROM);
}
}
@@ -4488,20 +4488,20 @@ static WRITE8_HANDLER( ae_act52_w )
UINT8 pmode;
LOG_MMC(("ae_act52_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
cbank = (data & 0x03) | ((offset & 0x0f) << 2);
- chr8(space->machine(), cbank, CHRROM);
+ chr8(space.machine(), cbank, CHRROM);
pmode = offset & 0x20;
pbank = (offset & 0x1fc0) >> 6;
if (pmode)
{
- prg16_89ab(space->machine(), pbank);
- prg16_cdef(space->machine(), pbank);
+ prg16_89ab(space.machine(), pbank);
+ prg16_cdef(space.machine(), pbank);
}
else
- prg32(space->machine(), pbank >> 1);
+ prg32(space.machine(), pbank >> 1);
}
@@ -4528,12 +4528,12 @@ static WRITE8_HANDLER( cne_decathl_w )
return;
if (offset < 0x00a5)
{
- prg32(space->machine(), (offset - 0x0065) & 0x03);
+ prg32(space.machine(), (offset - 0x0065) & 0x03);
return;
}
if (offset < 0x00e5)
{
- chr8(space->machine(), (offset - 0x00a5) & 0x07, CHRROM);
+ chr8(space.machine(), (offset - 0x00a5) & 0x07, CHRROM);
}
}
@@ -4556,7 +4556,7 @@ static WRITE8_HANDLER( cne_decathl_w )
static WRITE8_HANDLER( cne_fsb_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cne_fsb_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x0800)
@@ -4564,28 +4564,28 @@ static WRITE8_HANDLER( cne_fsb_m_w )
switch (offset & 0x0007)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0003:
- prg8_ef(space->machine(), data);
+ prg8_ef(space.machine(), data);
break;
case 0x0004:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x0005:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x0006:
- chr2_4(space->machine(), data, CHRROM);
+ chr2_4(space.machine(), data, CHRROM);
break;
case 0x0007:
- chr2_6(space->machine(), data, CHRROM);
+ chr2_6(space.machine(), data, CHRROM);
break;
}
}
@@ -4614,8 +4614,8 @@ static WRITE8_HANDLER( cne_shlz_l_w )
{
LOG_MMC(("cne_shlz_l_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 4);
- chr8(space->machine(), data & 0x0f, CHRROM);
+ prg32(space.machine(), data >> 4);
+ chr8(space.machine(), data & 0x0f, CHRROM);
}
/*************************************************************
@@ -4632,21 +4632,21 @@ static WRITE8_HANDLER( cne_shlz_l_w )
static WRITE8_HANDLER( caltron6in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("caltron6in1_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_latch1 = offset & 0xff;
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg32(space->machine(), offset & 0x07);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg32(space.machine(), offset & 0x07);
}
static WRITE8_HANDLER( caltron6in1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("caltron6in1_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_mmc_latch1 & 0x04)
- chr8(space->machine(), ((state->m_mmc_latch1 & 0x18) >> 1) | (data & 0x03), CHRROM);
+ chr8(space.machine(), ((state->m_mmc_latch1 & 0x18) >> 1) | (data & 0x03), CHRROM);
}
/*************************************************************
@@ -4668,7 +4668,7 @@ static WRITE8_HANDLER( caltron6in1_w )
static WRITE8_HANDLER( bf9093_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bf9093_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
@@ -4676,13 +4676,13 @@ static WRITE8_HANDLER( bf9093_w )
case 0x0000:
case 0x1000:
if (!state->m_hard_mirroring)
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
break;
case 0x4000:
case 0x5000:
case 0x6000:
case 0x7000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
}
}
@@ -4714,7 +4714,7 @@ static void bf9096_set_prg( running_machine &machine )
static WRITE8_HANDLER( bf9096_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bf9096_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x2000)
@@ -4722,7 +4722,7 @@ static WRITE8_HANDLER( bf9096_w )
else
state->m_mmc_latch2 = data;
- bf9096_set_prg(space->machine());
+ bf9096_set_prg(space.machine());
}
/*************************************************************
@@ -4739,7 +4739,7 @@ static WRITE8_HANDLER( bf9096_w )
static WRITE8_HANDLER( golden5_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("golden5_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x4000)
@@ -4747,15 +4747,15 @@ static WRITE8_HANDLER( golden5_w )
if (data & 0x08)
{
state->m_mmc_prg_bank[0] = ((data & 0x07) << 4) | (state->m_mmc_prg_bank[0] & 0x0f);
- prg16_89ab(space->machine(), state->m_mmc_prg_bank[0]);
- prg16_cdef(space->machine(), ((data & 0x07) << 4) | 0x0f);
+ prg16_89ab(space.machine(), state->m_mmc_prg_bank[0]);
+ prg16_cdef(space.machine(), ((data & 0x07) << 4) | 0x0f);
}
}
else
{
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0x70) | (data & 0x0f);
- prg16_89ab(space->machine(), state->m_mmc_prg_bank[0]);
+ prg16_89ab(space.machine(), state->m_mmc_prg_bank[0]);
}
}
@@ -4774,7 +4774,7 @@ static WRITE8_HANDLER( golden5_w )
static WRITE8_HANDLER( cony_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x1000 && offset < 0x1103) // from 0x5100-0x51ff
@@ -4783,7 +4783,7 @@ static WRITE8_HANDLER( cony_l_w )
static READ8_HANDLER( cony_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_r, offset: %04x\n", offset));
if (offset == 0x0f00) // 0x5000
@@ -4833,7 +4833,7 @@ static void cony_set_chr( running_machine &machine )
static WRITE8_HANDLER( cony_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
@@ -4844,24 +4844,24 @@ static WRITE8_HANDLER( cony_w )
case 0x30ff:
case 0x31ff:
state->m_mapper83_reg[8] = data;
- cony_set_prg(space->machine());
- cony_set_chr(space->machine());
+ cony_set_prg(space.machine());
+ cony_set_chr(space.machine());
break;
case 0x0100:
state->m_mmc_reg[0] = data & 0x80;
switch (data & 0x03)
{
case 0:
- set_nt_mirroring(space->machine(), PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_VERT);
break;
case 1:
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
break;
case 2:
- set_nt_mirroring(space->machine(), PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_LOW);
break;
case 3:
- set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH);
break;
}
break;
@@ -4873,13 +4873,13 @@ static WRITE8_HANDLER( cony_w )
state->m_IRQ_count = (data << 8) | (state->m_IRQ_count & 0xff);
break;
case 0x0300:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0301:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0302:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0312:
case 0x0313:
@@ -4891,11 +4891,11 @@ static WRITE8_HANDLER( cony_w )
case 0x0316:
case 0x0317:
state->m_mapper83_reg[offset - 0x0310] = data;
- cony_set_chr(space->machine());
+ cony_set_chr(space.machine());
break;
case 0x0318:
state->m_mapper83_reg[9] = data;
- cony_set_prg(space->machine());
+ cony_set_prg(space.machine());
break;
}
}
@@ -4915,7 +4915,7 @@ static WRITE8_HANDLER( cony_w )
static WRITE8_HANDLER( yoko_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x1300) // from 0x5400
@@ -4924,7 +4924,7 @@ static WRITE8_HANDLER( yoko_l_w )
static READ8_HANDLER( yoko_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_r, offset: %04x\n", offset));
if (offset >= 0x0f00 && offset < 0x1300) // 0x5000
@@ -4968,22 +4968,22 @@ static void yoko_set_chr( running_machine &machine )
static WRITE8_HANDLER( yoko_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("yoko_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x0c17)
{
case 0x0000:
state->m_mmc_reg[1] = data;
- yoko_set_prg(space->machine());
+ yoko_set_prg(space.machine());
break;
case 0x400:
state->m_mmc_reg[0] = data;
if (data & 1)
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
else
- set_nt_mirroring(space->machine(), PPU_MIRROR_VERT);
- yoko_set_prg(space->machine());
+ set_nt_mirroring(space.machine(), PPU_MIRROR_VERT);
+ yoko_set_prg(space.machine());
break;
case 0x0800:
state->m_IRQ_count = (state->m_IRQ_count & 0xff00) | data;
@@ -4996,14 +4996,14 @@ static WRITE8_HANDLER( yoko_w )
case 0x0c01:
case 0x0c02:
state->m_mapper83_reg[offset & 3] = data;
- yoko_set_prg(space->machine());
+ yoko_set_prg(space.machine());
break;
case 0x0c10:
case 0x0c11:
case 0x0c16:
case 0x0c17:
state->m_mapper83_reg[4 + (offset & 3)] = data;
- yoko_set_chr(space->machine());
+ yoko_set_chr(space.machine());
break;
}
}
@@ -5024,7 +5024,7 @@ static WRITE8_HANDLER( dreamtech_l_w )
offset += 0x100;
if (offset == 0x1020) /* 0x5020 */
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -5042,16 +5042,16 @@ static WRITE8_HANDLER( dreamtech_l_w )
static WRITE8_HANDLER( fukutake_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fukutake_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset >= 0x200 && offset < 0x400)
{
if (offset & 1)
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
else
- wram_bank(space->machine(), data >> 6, NES_WRAM);
+ wram_bank(space.machine(), data >> 6, NES_WRAM);
}
else if (offset >= 0x400 && offset < 0xf00)
state->m_mapper_ram[offset - 0x400] = data;
@@ -5059,7 +5059,7 @@ static WRITE8_HANDLER( fukutake_l_w )
static READ8_HANDLER( fukutake_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fukutake_l_r offset: %04x\n", offset));
offset += 0x100;
@@ -5106,22 +5106,22 @@ static void futuremedia_irq( device_t *device, int scanline, int vblank, int bla
static WRITE8_HANDLER( futuremedia_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("futuremedia_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0003:
- prg8_ef(space->machine(), data);
+ prg8_ef(space.machine(), data);
break;
case 0x2000:
case 0x2001:
@@ -5131,11 +5131,11 @@ static WRITE8_HANDLER( futuremedia_w )
case 0x2005:
case 0x2006:
case 0x2007:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x5000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4001:
@@ -5169,7 +5169,7 @@ static WRITE8_HANDLER( futuremedia_w )
static WRITE8_HANDLER( gouder_sf4_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[256] =
{
0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x49,0x19,0x09,0x59,0x49,0x19,0x09,
@@ -5197,12 +5197,12 @@ static WRITE8_HANDLER( gouder_sf4_l_w )
else if (!(offset < 0xf00))
state->m_mmc_reg[4] = data;
else if (!(offset < 0x700))
- prg32(space->machine(), ((data >> 3) & 0x02) | (data & 0x01));
+ prg32(space.machine(), ((data >> 3) & 0x02) | (data & 0x01));
}
static READ8_HANDLER( gouder_sf4_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("gouder_sf4_l_r, offset: %04x\n", offset));
if (!(offset < 0x1700))
@@ -5238,8 +5238,8 @@ static WRITE8_HANDLER( henggedianzi_w )
{
LOG_MMC(("henggedianzi_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg32(space.machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -5263,14 +5263,14 @@ static WRITE8_HANDLER( heng_xjzb_l_w )
offset += 0x4100;
if (offset & 0x5000)
- prg32(space->machine(), data >> 1);
+ prg32(space.machine(), data >> 1);
}
static WRITE8_HANDLER( heng_xjzb_w )
{
LOG_MMC(("heng_xjzb_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -5295,9 +5295,9 @@ static WRITE8_HANDLER( hes6in1_l_w )
if (!(offset & 0x100))
{
- prg32(space->machine(), (data & 0x38) >> 3);
- chr8(space->machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ prg32(space.machine(), (data & 0x38) >> 3);
+ chr8(space.machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
}
@@ -5307,8 +5307,8 @@ static WRITE8_HANDLER( hes_l_w )
if (!(offset & 0x100))
{
- prg32(space->machine(), (data & 0x38) >> 3);
- chr8(space->machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
+ prg32(space.machine(), (data & 0x38) >> 3);
+ chr8(space.machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
}
}
@@ -5326,13 +5326,13 @@ static WRITE8_HANDLER( hes_l_w )
static WRITE8_HANDLER( hosenkan_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("hosenkan_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7003)
{
case 0x0001:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
state->m_mmc_latch1 = data;
@@ -5341,28 +5341,28 @@ static WRITE8_HANDLER( hosenkan_w )
switch (state->m_mmc_latch1)
{
case 0:
- chr2_0(space->machine(), data >> 1, CHRROM);
+ chr2_0(space.machine(), data >> 1, CHRROM);
break;
case 1:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 2:
- chr2_2(space->machine(), data >> 1, CHRROM);
+ chr2_2(space.machine(), data >> 1, CHRROM);
break;
case 3:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
case 4:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 5:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 6:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 7:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
}
break;
@@ -5401,10 +5401,10 @@ static WRITE8_HANDLER( ks7058_w )
switch (offset & 0x7080)
{
case 0x7000:
- chr4_0(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
break;
case 0x7080:
- chr4_4(space->machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
}
}
@@ -5423,11 +5423,11 @@ static WRITE8_HANDLER( ks7058_w )
static WRITE8_HANDLER( ks7022_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7022_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0)
- set_nt_mirroring(space->machine(), BIT(data, 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (offset == 0x2000)
state->m_mmc_latch1 = data & 0x0f;
@@ -5435,17 +5435,17 @@ static WRITE8_HANDLER( ks7022_w )
static READ8_HANDLER( ks7022_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7022_r, offset: %04x\n", offset));
if (offset == 0x7ffc)
{
- chr8(space->machine(), state->m_mmc_latch1, CHRROM);
- prg16_89ab(space->machine(), state->m_mmc_latch1);
- prg16_cdef(space->machine(), state->m_mmc_latch1);
+ chr8(space.machine(), state->m_mmc_latch1, CHRROM);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
+ prg16_cdef(space.machine(), state->m_mmc_latch1);
}
- return mmc_hi_access_rom(space->machine(), offset);
+ return mmc_hi_access_rom(space.machine(), offset);
}
/*************************************************************
@@ -5489,7 +5489,7 @@ static void ks7032_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( ks7032_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7032_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
@@ -5514,7 +5514,7 @@ static WRITE8_HANDLER( ks7032_w )
break;
case 0x7000:
state->m_mmc_reg[state->m_mmc_latch1] = data;
- ks7032_prg_update(space->machine());
+ ks7032_prg_update(space.machine());
break;
}
}
@@ -5534,7 +5534,7 @@ static WRITE8_HANDLER( ks7032_w )
static WRITE8_HANDLER( ks202_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks202_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
@@ -5559,14 +5559,14 @@ static WRITE8_HANDLER( ks202_w )
break;
case 0x7000:
state->m_mmc_reg[state->m_mmc_latch1] = data;
- ks7032_prg_update(space->machine());
+ ks7032_prg_update(space.machine());
switch (offset & 0xc00)
{
case 0x800:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
break;
case 0xc00:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
}
break;
@@ -5604,7 +5604,7 @@ static void mmc_fds_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( ks7017_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7022_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -5613,12 +5613,12 @@ static WRITE8_HANDLER( ks7017_l_w )
state->m_mmc_latch1 = ((offset >> 2) & 0x03) | ((offset >> 4) & 0x04);
if (offset >= 0x1000 && offset < 0x1100)
- prg16_89ab(space->machine(), state->m_mmc_latch1);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
}
WRITE8_HANDLER( ks7017_extra_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7017_extra_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x20;
@@ -5630,12 +5630,12 @@ WRITE8_HANDLER( ks7017_extra_w )
state->m_IRQ_count = (state->m_IRQ_count & 0x00ff) | (data << 8);
if (offset == 0x0025) /* 0x4025 */
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
READ8_HANDLER( ks7017_extra_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7017_extra_r, offset: %04x\n", offset));
state->m_IRQ_status &= ~0x01;
@@ -5659,7 +5659,7 @@ READ8_HANDLER( ks7017_extra_r )
static WRITE8_HANDLER( kay_pp_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kay_pp_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -5683,7 +5683,7 @@ static WRITE8_HANDLER( kay_pp_l_w )
static READ8_HANDLER( kay_pp_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kay_pp_l_r, offset: %04x\n", offset));
offset += 0x100;
@@ -5763,30 +5763,30 @@ static void kay_pp_chr_cb( running_machine &machine, int start, int bank, int so
static WRITE8_HANDLER( kay_pp_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kay_pp_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6003)
{
case 0x0000:
txrom_w(space, offset, data);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x0001:
state->m_mmc_reg[6] = (BIT(data, 0) << 5) | (BIT(data, 1) << 4) | (BIT(data, 2) << 3)
| (BIT(data, 3) << 2) | (BIT(data, 4) << 1) | BIT(data, 5);
if (!state->m_mmc_reg[7])
- kay_pp_update_regs(space->machine());
+ kay_pp_update_regs(space.machine());
txrom_w(space, offset, data);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x0003:
state->m_mmc_reg[5] = data;
- kay_pp_update_regs(space->machine());
+ kay_pp_update_regs(space.machine());
txrom_w(space, 0x0000, data);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
default:
@@ -5821,18 +5821,18 @@ static void kasing_prg_cb( running_machine &machine, int start, int bank )
static WRITE8_HANDLER( kasing_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kasing_m_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x01)
{
case 0x00:
state->m_mmc_reg[0] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x01:
state->m_mmc_chr_base = (data & 0x01) ? 0x100 : 0x000;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
}
}
@@ -5856,8 +5856,8 @@ static WRITE8_HANDLER( magics_md_w )
{
LOG_MMC(("magics_md_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 1);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 1);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -5895,7 +5895,7 @@ static void nanjing_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( nanjing_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("nanjing_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -5906,7 +5906,7 @@ static WRITE8_HANDLER( nanjing_l_w )
if (offset == 0x1100) // 0x5100
{
if (data == 6)
- prg32(space->machine(), 3);
+ prg32(space.machine(), 3);
return;
}
@@ -5925,19 +5925,19 @@ static WRITE8_HANDLER( nanjing_l_w )
case 0x200:
state->m_mmc_reg[BIT(offset, 9)] = data;
if (!BIT(state->m_mmc_reg[0], 7) && state->m_ppu->get_current_scanline() <= 127)
- chr8(space->machine(), 0, CHRRAM);
+ chr8(space.machine(), 0, CHRRAM);
break;
case 0x300:
state->m_mmc_latch1 = data;
break;
}
- prg32(space->machine(), (state->m_mmc_reg[0] & 0x0f) | ((state->m_mmc_reg[1] & 0x0f) << 4));
+ prg32(space.machine(), (state->m_mmc_reg[0] & 0x0f) | ((state->m_mmc_reg[1] & 0x0f) << 4));
}
static READ8_HANDLER( nanjing_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 value = 0;
LOG_MMC(("nanjing_l_r, offset: %04x\n", offset));
@@ -6003,7 +6003,7 @@ static WRITE8_HANDLER( nitra_w )
static WRITE8_HANDLER( ntdec_asder_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ntdec_asder_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
@@ -6015,37 +6015,37 @@ static WRITE8_HANDLER( ntdec_asder_w )
switch (state->m_mmc_latch1)
{
case 0:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 1:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 2:
data &= 0xfe;
- chr1_0(space->machine(), data, CHRROM);
- chr1_1(space->machine(), data + 1, CHRROM);
+ chr1_0(space.machine(), data, CHRROM);
+ chr1_1(space.machine(), data + 1, CHRROM);
break;
case 3:
data &= 0xfe;
- chr1_2(space->machine(), data, CHRROM);
- chr1_3(space->machine(), data + 1, CHRROM);
+ chr1_2(space.machine(), data, CHRROM);
+ chr1_3(space.machine(), data + 1, CHRROM);
break;
case 4:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 5:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 6:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
case 7:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
}
break;
case 0x6000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -6072,16 +6072,16 @@ static WRITE8_HANDLER( ntdec_fh_m_w )
switch (offset & 0x03)
{
case 0:
- chr4_0(space->machine(), data >> 2, CHRROM);
+ chr4_0(space.machine(), data >> 2, CHRROM);
break;
case 1:
- chr2_4(space->machine(), data >> 1, CHRROM);
+ chr2_4(space.machine(), data >> 1, CHRROM);
break;
case 2:
- chr2_6(space->machine(), data >> 1 , CHRROM);
+ chr2_6(space.machine(), data >> 1 , CHRROM);
break;
case 3:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
}
}
@@ -6103,7 +6103,7 @@ static WRITE8_HANDLER( ntdec_fh_m_w )
static WRITE8_HANDLER( daou306_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("daou306_w, offset: %04x, data: %02x\n", offset, data));
int reg = BIT(offset, 2) ? 8 : 0;
@@ -6112,51 +6112,51 @@ static WRITE8_HANDLER( daou306_w )
case 0x4000:
case 0x4004:
state->m_mmc_reg[reg + 0] = data;
- chr1_0(space->machine(), state->m_mmc_reg[0] | (state->m_mmc_reg[8] << 8), CHRROM);
+ chr1_0(space.machine(), state->m_mmc_reg[0] | (state->m_mmc_reg[8] << 8), CHRROM);
break;
case 0x4001:
case 0x4005:
state->m_mmc_reg[reg + 1] = data;
- chr1_1(space->machine(), state->m_mmc_reg[1] | (state->m_mmc_reg[9] << 8), CHRROM);
+ chr1_1(space.machine(), state->m_mmc_reg[1] | (state->m_mmc_reg[9] << 8), CHRROM);
break;
case 0x4002:
case 0x4006:
state->m_mmc_reg[reg + 2] = data;
- chr1_2(space->machine(), state->m_mmc_reg[2] | (state->m_mmc_reg[10] << 8), CHRROM);
+ chr1_2(space.machine(), state->m_mmc_reg[2] | (state->m_mmc_reg[10] << 8), CHRROM);
break;
case 0x4003:
case 0x4007:
state->m_mmc_reg[reg + 3] = data;
- chr1_3(space->machine(), state->m_mmc_reg[3] | (state->m_mmc_reg[11] << 8), CHRROM);
+ chr1_3(space.machine(), state->m_mmc_reg[3] | (state->m_mmc_reg[11] << 8), CHRROM);
break;
case 0x4008:
case 0x400c:
state->m_mmc_reg[reg + 4] = data;
- chr1_4(space->machine(), state->m_mmc_reg[4] | (state->m_mmc_reg[12] << 8), CHRROM);
+ chr1_4(space.machine(), state->m_mmc_reg[4] | (state->m_mmc_reg[12] << 8), CHRROM);
break;
case 0x4009:
case 0x400d:
state->m_mmc_reg[reg + 5] = data;
- chr1_5(space->machine(), state->m_mmc_reg[5] | (state->m_mmc_reg[13] << 8), CHRROM);
+ chr1_5(space.machine(), state->m_mmc_reg[5] | (state->m_mmc_reg[13] << 8), CHRROM);
break;
case 0x400a:
case 0x400e:
state->m_mmc_reg[reg + 6] = data;
- chr1_6(space->machine(), state->m_mmc_reg[6] | (state->m_mmc_reg[14] << 8), CHRROM);
+ chr1_6(space.machine(), state->m_mmc_reg[6] | (state->m_mmc_reg[14] << 8), CHRROM);
break;
case 0x400b:
case 0x400f:
state->m_mmc_reg[reg + 7] = data;
- chr1_7(space->machine(), state->m_mmc_reg[7] | (state->m_mmc_reg[15] << 8), CHRROM);
+ chr1_7(space.machine(), state->m_mmc_reg[7] | (state->m_mmc_reg[15] << 8), CHRROM);
break;
case 0x4010:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
case 0x4014:
if (data & 1)
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
else
- set_nt_mirroring(space->machine(), PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_VERT);
break;
}
}
@@ -6178,11 +6178,11 @@ static WRITE8_HANDLER( daou306_w )
static WRITE8_HANDLER( gs2015_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("gs2015_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset);
- chr8(space->machine(), offset >> 1, state->m_mmc_chr_source);
+ prg32(space.machine(), offset);
+ chr8(space.machine(), offset >> 1, state->m_mmc_chr_source);
}
/*************************************************************
@@ -6211,15 +6211,15 @@ static WRITE8_HANDLER( rcm_tf_w )
{
case 0x00:
case 0x30:
- prg32(space->machine(), offset & 0x0f);
+ prg32(space.machine(), offset & 0x0f);
break;
case 0x10:
case 0x20:
- prg16_89ab(space->machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
- prg16_cdef(space->machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
+ prg16_89ab(space.machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
+ prg16_cdef(space.machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
break;
}
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -6238,11 +6238,11 @@ static WRITE8_HANDLER( rcm_tf_w )
static WRITE8_HANDLER( rex_dbz_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("rex_dbz_l_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[0] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
/* we would need to use this read handler in 0x6000-0x7fff as well */
@@ -6330,18 +6330,18 @@ static void rex_sl1632_set_chr( running_machine &machine, UINT8 chr, int chr_bas
static WRITE8_HANDLER( rex_sl1632_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map14_helper1, map14_helper2, mmc_helper, cmd;
LOG_MMC(("rex_sl1632_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0x2131)
{
state->m_mmc_reg[0] = data;
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
if (!(state->m_mmc_reg[0] & 0x02))
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
if (state->m_mmc_reg[0] & 0x02)
@@ -6354,11 +6354,11 @@ static WRITE8_HANDLER( rex_sl1632_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -6368,22 +6368,22 @@ static WRITE8_HANDLER( rex_sl1632_w )
case 0: case 1: // these have to be changed due to the different way rex_sl1632_set_chr works (it handles 1k banks)!
state->m_mmc_vrom_bank[2 * cmd] = data;
state->m_mmc_vrom_bank[2 * cmd + 1] = data;
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd + 2] = data;
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
break;
default:
@@ -6397,7 +6397,7 @@ static WRITE8_HANDLER( rex_sl1632_w )
offset = ((offset & 0x02) | (offset >> 10)) >> 1;
map14_helper2 = ((offset + 2) & 0x07) + 4; // '+4' because first 4 state->m_mmc_extra_banks are for PRG!
state->m_mmc_extra_bank[map14_helper2] = (state->m_mmc_extra_bank[map14_helper2] & (0xf0 >> map14_helper1)) | ((data & 0x0f) << map14_helper1);
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
else
{
@@ -6406,12 +6406,12 @@ static WRITE8_HANDLER( rex_sl1632_w )
case 0x0000:
case 0x2000:
state->m_mmc_extra_bank[offset >> 13] = data;
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x1000:
state->m_mmc_reg[1] = data;
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -6431,24 +6431,24 @@ static WRITE8_HANDLER( rex_sl1632_w )
static WRITE8_HANDLER( rumblestation_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("rumblestation_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0x01) | ((data & 0x0f) << 1);
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & 0x07) | ((data & 0xf0) >> 1);
- prg32(space->machine(), state->m_mmc_prg_bank[0]);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ prg32(space.machine(), state->m_mmc_prg_bank[0]);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
}
static WRITE8_HANDLER( rumblestation_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("rumblestation_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & ~0x01) | (data & 0x01);
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x07) | ((data & 0x70) >> 4);
- prg32(space->machine(), state->m_mmc_prg_bank[0]);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ prg32(space.machine(), state->m_mmc_prg_bank[0]);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
}
/*************************************************************
@@ -6487,7 +6487,7 @@ static void sachen_set_mirror( running_machine &machine, UINT8 nt ) // used by m
static WRITE8_HANDLER( sachen_74x374_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sachen_74x374_l_w, offset: %04x, data: %02x\n", offset, data));
/* write happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6501,22 +6501,22 @@ static WRITE8_HANDLER( sachen_74x374_l_w )
{
case 0x02:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x08) | ((data << 3) & 0x08);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
- prg32(space->machine(), data & 0x01);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ prg32(space.machine(), data & 0x01);
break;
case 0x04:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x04) | ((data << 2) & 0x04);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x05:
- prg32(space->machine(), data & 0x07);
+ prg32(space.machine(), data & 0x07);
break;
case 0x06:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x03) | ((data << 0) & 0x03);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x07:
- sachen_set_mirror(space->machine(), (data >> 1) & 0x03);
+ sachen_set_mirror(space.machine(), (data >> 1) & 0x03);
break;
default:
break;
@@ -6527,7 +6527,7 @@ static WRITE8_HANDLER( sachen_74x374_l_w )
static READ8_HANDLER( sachen_74x374_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sachen_74x374_l_r, offset: %04x", offset));
/* read happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6539,7 +6539,7 @@ static READ8_HANDLER( sachen_74x374_l_r )
static WRITE8_HANDLER( sachen_74x374a_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sachen_74x374a_l_w, offset: %04x, data: %02x\n", offset, data));
/* write happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6552,26 +6552,26 @@ static WRITE8_HANDLER( sachen_74x374a_l_w )
switch (state->m_mmc_latch1 & 0x07)
{
case 0x00:
- prg32(space->machine(), 0);
- chr8(space->machine(), 3, CHRROM);
+ prg32(space.machine(), 0);
+ chr8(space.machine(), 3, CHRROM);
break;
case 0x02:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x08) | ((data << 3) & 0x08);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x04:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x01) | ((data << 0) & 0x01);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x05:
- prg32(space->machine(), data & 0x01);
+ prg32(space.machine(), data & 0x01);
break;
case 0x06:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x06) | ((data << 1) & 0x06);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x07:
- sachen_set_mirror(space->machine(), BIT(data, 0));
+ sachen_set_mirror(space.machine(), BIT(data, 0));
break;
default:
break;
@@ -6588,9 +6588,9 @@ static WRITE8_HANDLER( sachen_74x374a_l_w )
*************************************************************/
-static void common_s8259_write_handler( address_space *space, offs_t offset, UINT8 data, int board )
+static void common_s8259_write_handler( address_space &space, offs_t offset, UINT8 data, int board )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank_helper1, bank_helper2, shift, add1, add2, add3;
/* write happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6605,20 +6605,20 @@ static void common_s8259_write_handler( address_space *space, offs_t offset, UIN
switch (state->m_mmc_latch1)
{
case 0x05:
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
break;
case 0x07:
- sachen_set_mirror(space->machine(), BIT(data, 0) ? 0 : (data >> 1) & 0x03);
+ sachen_set_mirror(space.machine(), BIT(data, 0) ? 0 : (data >> 1) & 0x03);
break;
default:
if (board == SACHEN_8259D)
{
if (state->m_mmc_chr_source == CHRROM)
{
- chr1_0(space->machine(), (state->m_sachen_reg[0] & 0x07), CHRROM);
- chr1_1(space->machine(), (state->m_sachen_reg[1] & 0x07) | (state->m_sachen_reg[4] << 4 & 0x10), CHRROM);
- chr1_2(space->machine(), (state->m_sachen_reg[2] & 0x07) | (state->m_sachen_reg[4] << 3 & 0x10), CHRROM);
- chr1_3(space->machine(), (state->m_sachen_reg[3] & 0x07) | (state->m_sachen_reg[4] << 2 & 0x10) | (state->m_sachen_reg[6] << 3 & 0x08), CHRROM);
+ chr1_0(space.machine(), (state->m_sachen_reg[0] & 0x07), CHRROM);
+ chr1_1(space.machine(), (state->m_sachen_reg[1] & 0x07) | (state->m_sachen_reg[4] << 4 & 0x10), CHRROM);
+ chr1_2(space.machine(), (state->m_sachen_reg[2] & 0x07) | (state->m_sachen_reg[4] << 3 & 0x10), CHRROM);
+ chr1_3(space.machine(), (state->m_sachen_reg[3] & 0x07) | (state->m_sachen_reg[4] << 2 & 0x10) | (state->m_sachen_reg[6] << 3 & 0x08), CHRROM);
}
}
else
@@ -6632,10 +6632,10 @@ static void common_s8259_write_handler( address_space *space, offs_t offset, UIN
if (state->m_mmc_chr_source == CHRROM)
{
- chr2_0(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 0] & 0x07) | bank_helper2) << shift, CHRROM);
- chr2_2(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 1] & 0x07) | bank_helper2) << shift | add1, CHRROM);
- chr2_4(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 2] & 0x07) | bank_helper2) << shift | add2, CHRROM);
- chr2_6(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 3] & 0x07) | bank_helper2) << shift | add3, CHRROM);
+ chr2_0(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 0] & 0x07) | bank_helper2) << shift, CHRROM);
+ chr2_2(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 1] & 0x07) | bank_helper2) << shift | add1, CHRROM);
+ chr2_4(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 2] & 0x07) | bank_helper2) << shift | add2, CHRROM);
+ chr2_6(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 3] & 0x07) | bank_helper2) << shift | add3, CHRROM);
}
}
break;
@@ -6646,7 +6646,7 @@ static void common_s8259_write_handler( address_space *space, offs_t offset, UIN
static WRITE8_HANDLER( s8259_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("s8259_w, type: %d, offset: %04x, data: %02x\n", state->m_pcb_id, offset, data));
common_s8259_write_handler(space, offset, data, state->m_pcb_id);
@@ -6654,7 +6654,7 @@ static WRITE8_HANDLER( s8259_l_w )
static WRITE8_HANDLER( s8259_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("s8259_w, type: %d, offset: %04x, data: %02x\n", state->m_pcb_id, offset, data));
common_s8259_write_handler(space, (offset + 0x100) & 0xfff, data, state->m_pcb_id);
@@ -6675,10 +6675,10 @@ static WRITE8_HANDLER( s8259_m_w )
static WRITE8_HANDLER( sa009_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sa009_l_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data, state->m_mmc_chr_source);
+ chr8(space.machine(), data, state->m_mmc_chr_source);
}
/*************************************************************
@@ -6697,7 +6697,7 @@ static WRITE8_HANDLER( sa0036_w )
{
LOG_MMC(("sa0036_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data >> 7, CHRROM);
+ chr8(space.machine(), data >> 7, CHRROM);
}
/*************************************************************
@@ -6716,8 +6716,8 @@ static WRITE8_HANDLER( sa0037_w )
{
LOG_MMC(("sa0037_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 3);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 3);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -6738,7 +6738,7 @@ static WRITE8_HANDLER( sa72007_l_w )
/* only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
if (!(offset & 0x100))
- chr8(space->machine(), data >> 7, CHRROM);
+ chr8(space.machine(), data >> 7, CHRROM);
}
/*************************************************************
@@ -6757,8 +6757,8 @@ static WRITE8_HANDLER( sa72008_l_w )
{
LOG_MMC(("sa72008_l_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 2);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 2);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -6802,8 +6802,8 @@ static WRITE8_HANDLER( tcu01_l_w )
if ((offset & 0x103) == 0x002)
{
- prg32(space->machine(), ((data >> 6) & 0x02) | ((data >> 2) & 0x01));
- chr8(space->machine(), data >> 3, CHRROM);
+ prg32(space.machine(), ((data >> 6) & 0x02) | ((data >> 2) & 0x01));
+ chr8(space.machine(), data >> 3, CHRROM);
}
}
@@ -6835,19 +6835,19 @@ static WRITE8_HANDLER( tcu01_w )
static WRITE8_HANDLER( tcu02_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("tcu02_l_w, offset: %04x, data: %02x\n", offset, data));
if ((offset & 0x103) == 0x002)
{
state->m_mmc_latch1 = (data & 0x30) | ((data + 3) & 0x0f);
- chr8(space->machine(), state->m_mmc_latch1, CHRROM);
+ chr8(space.machine(), state->m_mmc_latch1, CHRROM);
}
}
static READ8_HANDLER( tcu02_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("tcu02_l_r, offset: %04x\n", offset));
if ((offset & 0x103) == 0x000)
@@ -6867,7 +6867,7 @@ static READ8_HANDLER( tcu02_l_r )
static WRITE8_HANDLER( subor0_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 subor_helper1, subor_helper2;
LOG_MMC(("subor0_w, offset: %04x, data: %02x\n", offset, data));
@@ -6892,8 +6892,8 @@ static WRITE8_HANDLER( subor0_w )
subor_helper2 = 0x20;
}
- prg16_89ab(space->machine(), subor_helper1);
- prg16_cdef(space->machine(), subor_helper2);
+ prg16_89ab(space.machine(), subor_helper1);
+ prg16_cdef(space.machine(), subor_helper2);
}
/*************************************************************
@@ -6906,7 +6906,7 @@ static WRITE8_HANDLER( subor0_w )
static WRITE8_HANDLER( subor1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 subor_helper1, subor_helper2;
LOG_MMC(("subor1_w, offset: %04x, data: %02x\n", offset, data));
@@ -6931,8 +6931,8 @@ static WRITE8_HANDLER( subor1_w )
subor_helper2 = 0x07;
}
- prg16_89ab(space->machine(), subor_helper1);
- prg16_cdef(space->machine(), subor_helper2);
+ prg16_89ab(space.machine(), subor_helper1);
+ prg16_cdef(space.machine(), subor_helper2);
}
/*************************************************************
@@ -6990,56 +6990,56 @@ static void sgame_boog_set_prg( running_machine &machine )
static WRITE8_HANDLER( sgame_boog_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sgame_boog_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset == 0x1000)
{
state->m_mmc_reg[0] = data;
- sgame_boog_set_prg(space->machine());
+ sgame_boog_set_prg(space.machine());
}
else if (offset == 0x1001)
{
state->m_mmc_reg[1] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
else if (offset == 0x1007)
{
state->m_mmc3_latch = 0;
state->m_mmc_reg[2] = data;
- sgame_boog_set_prg(space->machine());
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ sgame_boog_set_prg(space.machine());
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
static WRITE8_HANDLER( sgame_boog_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sgame_boog_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0x0000)
{
state->m_mmc_reg[0] = data;
- sgame_boog_set_prg(space->machine());
+ sgame_boog_set_prg(space.machine());
}
else if (offset == 0x0001)
{
state->m_mmc_reg[1] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
else if (offset == 0x0007)
{
state->m_mmc3_latch = 0;
state->m_mmc_reg[2] = data;
- sgame_boog_set_prg(space->machine());
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ sgame_boog_set_prg(space.machine());
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
static WRITE8_HANDLER( sgame_boog_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[8] = {0,2,5,3,6,1,7,4};
LOG_MMC(("sgame_boog_w, offset: %04x, data: %02x\n", offset, data));
@@ -7076,7 +7076,7 @@ static WRITE8_HANDLER( sgame_boog_w )
if (!state->m_mmc_reg[2])
txrom_w(space, 0x4000, data);
else
- set_nt_mirroring(space->machine(), ((data >> 7) | data) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), ((data >> 7) | data) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4001:
@@ -7118,24 +7118,24 @@ static WRITE8_HANDLER( sgame_boog_w )
static WRITE8_HANDLER( sgame_lion_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sgame_lion_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_map114_reg = data;
if (state->m_map114_reg & 0x80)
{
- prg16_89ab(space->machine(), data & 0x1f);
- prg16_cdef(space->machine(), data & 0x1f);
+ prg16_89ab(space.machine(), data & 0x1f);
+ prg16_cdef(space.machine(), data & 0x1f);
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
static WRITE8_HANDLER( sgame_lion_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4};
LOG_MMC(("sgame_lion_w, offset: %04x, data: %02x\n", offset, data));
@@ -7144,7 +7144,7 @@ static WRITE8_HANDLER( sgame_lion_w )
switch (offset & 0x6000)
{
case 0x0000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
state->m_map114_reg_enabled = 1;
@@ -7190,8 +7190,8 @@ static WRITE8_HANDLER( tengen_800008_w )
{
LOG_MMC(("tengen_800008_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 3);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 3);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -7302,7 +7302,7 @@ static void tengen_800032_set_chr( running_machine &machine )
static WRITE8_HANDLER( tengen_800032_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map64_helper, cmd;
LOG_MMC(("tengen_800032_w, offset: %04x, data: %02x\n", offset, data));
@@ -7314,11 +7314,11 @@ static WRITE8_HANDLER( tengen_800032_w )
/* Has PRG Mode changed? */
if (map64_helper & 0x40)
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
/* Has CHR Mode changed? */
if (map64_helper & 0xa0)
- tengen_800032_set_chr(space->machine());
+ tengen_800032_set_chr(space.machine());
break;
case 0x0001:
@@ -7329,25 +7329,25 @@ static WRITE8_HANDLER( tengen_800032_w )
case 2: case 3:
case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- tengen_800032_set_chr(space->machine());
+ tengen_800032_set_chr(space.machine());
break;
case 6: case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
case 8: case 9:
state->m_mmc_vrom_bank[cmd - 2] = data;
- tengen_800032_set_chr(space->machine());
+ tengen_800032_set_chr(space.machine());
break;
case 0x0f:
state->m_mmc_prg_bank[2] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4000:
@@ -7399,7 +7399,7 @@ static void tengen_800037_set_mirror( running_machine &machine )
static WRITE8_HANDLER( tengen_800037_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map158_helper, cmd;
LOG_MMC(("tengen_800037_w, offset: %04x, data: %02x\n", offset, data));
@@ -7411,13 +7411,13 @@ static WRITE8_HANDLER( tengen_800037_w )
/* Has PRG Mode changed? */
if (map158_helper & 0x40)
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
/* Has CHR Mode changed? */
if (map158_helper & 0xa0)
{
- tengen_800032_set_chr(space->machine());
- tengen_800037_set_mirror(space->machine());
+ tengen_800032_set_chr(space.machine());
+ tengen_800037_set_mirror(space.machine());
}
break;
@@ -7429,21 +7429,21 @@ static WRITE8_HANDLER( tengen_800037_w )
case 2: case 3:
case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- tengen_800032_set_chr(space->machine());
- tengen_800037_set_mirror(space->machine());
+ tengen_800032_set_chr(space.machine());
+ tengen_800037_set_mirror(space.machine());
break;
case 6: case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
case 8: case 9:
state->m_mmc_vrom_bank[cmd - 2] = data;
- tengen_800032_set_chr(space->machine());
- tengen_800037_set_mirror(space->machine());
+ tengen_800032_set_chr(space.machine());
+ tengen_800037_set_mirror(space.machine());
break;
case 0x0f:
state->m_mmc_prg_bank[2] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
}
break;
@@ -7475,7 +7475,7 @@ static WRITE8_HANDLER( tengen_800037_w )
static WRITE8_HANDLER( txc_22211_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211_l_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 4)
@@ -7484,7 +7484,7 @@ static WRITE8_HANDLER( txc_22211_l_w )
static READ8_HANDLER( txc_22211_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211_l_r, offset: %04x\n", offset));
if (offset == 0x0000)
@@ -7495,11 +7495,11 @@ static READ8_HANDLER( txc_22211_l_r )
static WRITE8_HANDLER( txc_22211_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), state->m_txc_reg[2] >> 2);
- chr8(space->machine(), state->m_txc_reg[2], CHRROM);
+ prg32(space.machine(), state->m_txc_reg[2] >> 2);
+ chr8(space.machine(), state->m_txc_reg[2], CHRROM);
}
/*************************************************************
@@ -7519,11 +7519,11 @@ static WRITE8_HANDLER( txc_22211_w )
static WRITE8_HANDLER( txc_22211b_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211b_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), state->m_txc_reg[2] >> 2);
- chr8(space->machine(), (((data ^ state->m_txc_reg[2]) >> 3) & 0x02) | (((data ^ state->m_txc_reg[2]) >> 5) & 0x01), CHRROM);
+ prg32(space.machine(), state->m_txc_reg[2] >> 2);
+ chr8(space.machine(), (((data ^ state->m_txc_reg[2]) >> 3) & 0x02) | (((data ^ state->m_txc_reg[2]) >> 5) & 0x01), CHRROM);
}
/*************************************************************
@@ -7543,7 +7543,7 @@ static WRITE8_HANDLER( txc_22211b_w )
static READ8_HANDLER( txc_22211c_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211c_l_r, offset: %04x\n", offset));
if (offset == 0x0000)
@@ -7570,7 +7570,7 @@ static WRITE8_HANDLER( txc_tw_l_w )
{
LOG_MMC(("txctw_l_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), (data >> 4) | data);
+ prg32(space.machine(), (data >> 4) | data);
}
static WRITE8_HANDLER( txc_tw_m_w )
@@ -7606,8 +7606,8 @@ static WRITE8_HANDLER( txc_strikewolf_w )
if ((offset >= 0x400) && (offset < 0x7fff))
{
- prg32(space->machine(), data >> 4);
- chr8(space->machine(), data & 0x0f, CHRROM);
+ prg32(space.machine(), data >> 4);
+ chr8(space.machine(), data & 0x0f, CHRROM);
}
}
@@ -7636,7 +7636,7 @@ static WRITE8_HANDLER( txc_mxmdhtwo_w )
{
LOG_MMC(("txc_mxmdhtwo_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -7698,7 +7698,7 @@ static WRITE8_HANDLER( waixing_a_w )
switch (offset & 0x6001)
{
case 0x2000:
- waixing_set_mirror(space->machine(), data); //maybe data & 0x03?
+ waixing_set_mirror(space.machine(), data); //maybe data & 0x03?
break;
case 0x2001:
@@ -7815,7 +7815,7 @@ static void waixing_e_chr_cb( running_machine &machine, int start, int bank, int
static WRITE8_HANDLER( waixing_f_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 cmd;
LOG_MMC(("waixing_f_w, offset: %04x, data: %02x\n", offset, data));
@@ -7826,7 +7826,7 @@ static WRITE8_HANDLER( waixing_f_w )
if (cmd >= 6)
{
state->m_mmc_prg_bank[cmd - 6] = data & ((data > 0x3f) ? 0x4f : 0x3f);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else
waixing_a_w(space, offset, data);
@@ -7876,7 +7876,7 @@ static void waixing_g_set_chr( running_machine &machine, int chr_base, int chr_m
static WRITE8_HANDLER( waixing_g_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 MMC3_helper, cmd;
LOG_MMC(("waixing_g_w, offset: %04x, data: %02x\n", offset, data));
@@ -7888,11 +7888,11 @@ static WRITE8_HANDLER( waixing_g_w )
/* Has PRG Mode changed? */
if (MMC3_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (MMC3_helper & 0x80)
- waixing_g_set_chr(space->machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ waixing_g_set_chr(space.machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -7902,18 +7902,18 @@ static WRITE8_HANDLER( waixing_g_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- waixing_g_set_chr(space->machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ waixing_g_set_chr(space.machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
case 8:
case 9:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x0a: case 0x0b:
state->m_mmc_vrom_bank[cmd - 4] = data;
- waixing_g_set_chr(space->machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ waixing_g_set_chr(space.machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
}
break;
@@ -7947,7 +7947,7 @@ static void waixing_h_chr_cb( running_machine &machine, int start, int bank, int
static WRITE8_HANDLER( waixing_h_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 cmd;
LOG_MMC(("waixing_h_w, offset: %04x, data: %02x\n", offset, data));
@@ -7960,7 +7960,7 @@ static WRITE8_HANDLER( waixing_h_w )
case 0: // in this case we set prg_base in addition to state->m_mmc_vrom_bank!
state->m_mmc_prg_base = (data << 5) & 0x40;
state->m_mmc_prg_mask = 0x3f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
txrom_w(space, offset, data);
default:
txrom_w(space, offset, data);
@@ -7993,17 +7993,17 @@ static WRITE8_HANDLER( waixing_h_w )
static WRITE8_HANDLER( waixing_sgz_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, bank;
LOG_MMC(("waixing_sgz_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000:
case 0x4000:
@@ -8015,7 +8015,7 @@ static WRITE8_HANDLER( waixing_sgz_w )
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x0f) << 4);
else
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x7000:
switch (offset & 0x0c)
@@ -8056,17 +8056,17 @@ static WRITE8_HANDLER( waixing_sgz_w )
static WRITE8_HANDLER( waixing_sgzlz_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("waixing_sgzlz_l_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x700:
- set_nt_mirroring(space->machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x701:
state->m_mmc_latch1 = (state->m_mmc_latch1 & 0x0c) | ((data >> 1) & 0x03);
- prg32(space->machine(), state->m_mmc_latch1);
+ prg32(space.machine(), state->m_mmc_latch1);
break;
case 0x702:
state->m_mmc_latch1 = (state->m_mmc_latch1 & 0x03) | ((data << 2) & 0x0c);
@@ -8089,7 +8089,7 @@ static WRITE8_HANDLER( waixing_sgzlz_l_w )
static WRITE8_HANDLER( waixing_ffv_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("waixing_ffv_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100; /* the checks work better on addresses */
@@ -8104,15 +8104,15 @@ static WRITE8_HANDLER( waixing_ffv_l_w )
case 0x20:
case 0x40:
case 0x60:
- prg16_89ab(space->machine(), mmc_helper | ((state->m_mmc_reg[0] >> 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
- prg16_cdef(space->machine(), mmc_helper & 0x1f);
+ prg16_89ab(space.machine(), mmc_helper | ((state->m_mmc_reg[0] >> 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
+ prg16_cdef(space.machine(), mmc_helper & 0x1f);
break;
case 0x50:
- prg32(space->machine(), (mmc_helper >> 1) | (state->m_mmc_reg[0] & 0x0f));
+ prg32(space.machine(), (mmc_helper >> 1) | (state->m_mmc_reg[0] & 0x0f));
break;
case 0x70:
- prg16_89ab(space->machine(), mmc_helper | ((state->m_mmc_reg[0] << 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
- prg16_cdef(space->machine(), mmc_helper & 0x1f);
+ prg16_89ab(space.machine(), mmc_helper | ((state->m_mmc_reg[0] << 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
+ prg16_cdef(space.machine(), mmc_helper & 0x1f);
break;
}
}
@@ -8141,14 +8141,14 @@ static WRITE8_HANDLER( waixing_zs_w )
{
LOG_MMC(("waixing_zs_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset >> 3);
+ prg32(space.machine(), offset >> 3);
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
}
@@ -8171,7 +8171,7 @@ static WRITE8_HANDLER( waixing_dq8_w )
{
LOG_MMC(("waixing_dq8_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset >> 3);
+ prg32(space.machine(), offset >> 3);
}
@@ -8194,36 +8194,36 @@ static WRITE8_HANDLER( waixing_ps2_w )
LOG_MMC(("waixing_ps2_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
switch (offset & 0x0fff)
{
case 0x000:
- prg8_89(space->machine(), (map15_helper + 0) ^ map15_flip);
- prg8_ab(space->machine(), (map15_helper + 1) ^ map15_flip);
- prg8_cd(space->machine(), (map15_helper + 2) ^ map15_flip);
- prg8_ef(space->machine(), (map15_helper + 3) ^ map15_flip);
+ prg8_89(space.machine(), (map15_helper + 0) ^ map15_flip);
+ prg8_ab(space.machine(), (map15_helper + 1) ^ map15_flip);
+ prg8_cd(space.machine(), (map15_helper + 2) ^ map15_flip);
+ prg8_ef(space.machine(), (map15_helper + 3) ^ map15_flip);
break;
case 0x001:
map15_helper |= map15_flip;
- prg8_89(space->machine(), map15_helper);
- prg8_ab(space->machine(), map15_helper + 1);
- prg8_cd(space->machine(), map15_helper + 1);
- prg8_ef(space->machine(), map15_helper + 1);
+ prg8_89(space.machine(), map15_helper);
+ prg8_ab(space.machine(), map15_helper + 1);
+ prg8_cd(space.machine(), map15_helper + 1);
+ prg8_ef(space.machine(), map15_helper + 1);
break;
case 0x002:
map15_helper |= map15_flip;
- prg8_89(space->machine(), map15_helper);
- prg8_ab(space->machine(), map15_helper);
- prg8_cd(space->machine(), map15_helper);
- prg8_ef(space->machine(), map15_helper);
+ prg8_89(space.machine(), map15_helper);
+ prg8_ab(space.machine(), map15_helper);
+ prg8_cd(space.machine(), map15_helper);
+ prg8_ef(space.machine(), map15_helper);
break;
case 0x003:
map15_helper |= map15_flip;
- prg8_89(space->machine(), map15_helper);
- prg8_ab(space->machine(), map15_helper + 1);
- prg8_cd(space->machine(), map15_helper);
- prg8_ef(space->machine(), map15_helper + 1);
+ prg8_89(space.machine(), map15_helper);
+ prg8_ab(space.machine(), map15_helper + 1);
+ prg8_cd(space.machine(), map15_helper);
+ prg8_ef(space.machine(), map15_helper + 1);
break;
}
}
@@ -8266,7 +8266,7 @@ static void waixing_sec_chr_cb( running_machine &machine, int start, int bank, i
static WRITE8_HANDLER( waixing_sec_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("waixing_sec_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -8274,8 +8274,8 @@ static WRITE8_HANDLER( waixing_sec_l_w )
if (offset == 0x1000)
{
state->m_mmc_reg[0] = data & 0x02;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -8303,7 +8303,7 @@ static void waixing_sh2_chr_cb( running_machine &machine, int start, int bank, i
READ8_HANDLER( waixing_sh2_chr_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = offset >> 10;
UINT8 val = state->m_chr_map[bank].access[offset & 0x3ff]; // this would be usual return value
int chr_helper;
@@ -8317,9 +8317,9 @@ READ8_HANDLER( waixing_sh2_chr_r )
state->m_mmc_reg[offset >> 12] = chr_helper;
if (offset & 0x1000)
- chr4_4(space->machine(), state->m_mmc_reg[1], state->m_mmc_reg[1] ? CHRRAM : CHRROM);
+ chr4_4(space.machine(), state->m_mmc_reg[1], state->m_mmc_reg[1] ? CHRRAM : CHRROM);
else
- chr4_0(space->machine(), state->m_mmc_reg[0], state->m_mmc_reg[0] ? CHRRAM : CHRROM);
+ chr4_0(space.machine(), state->m_mmc_reg[0], state->m_mmc_reg[0] ? CHRRAM : CHRROM);
return val;
}
@@ -8354,7 +8354,7 @@ static void unl_8237_chr_cb( running_machine &machine, int start, int bank, int
static WRITE8_HANDLER( unl_8237_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_8237_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -8364,27 +8364,27 @@ static WRITE8_HANDLER( unl_8237_l_w )
if (state->m_mmc_reg[0] & 0x80)
{
if (state->m_mmc_reg[0] & 0x20)
- prg32(space->machine(), (state->m_mmc_reg[0] & 0x0f) >> 1);
+ prg32(space.machine(), (state->m_mmc_reg[0] & 0x0f) >> 1);
else
{
- prg16_89ab(space->machine(), state->m_mmc_reg[0] & 0x1f);
- prg16_cdef(space->machine(), state->m_mmc_reg[0] & 0x1f);
+ prg16_89ab(space.machine(), state->m_mmc_reg[0] & 0x1f);
+ prg16_cdef(space.machine(), state->m_mmc_reg[0] & 0x1f);
}
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset == 0x1001)
{
state->m_mmc_reg[1] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
static WRITE8_HANDLER( unl_8237_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[8] = {0, 2, 6, 1, 7, 3, 4, 5};
LOG_MMC(("unl_8237_w offset: %04x, data: %02x\n", offset, data));
@@ -8392,7 +8392,7 @@ static WRITE8_HANDLER( unl_8237_w )
{
case 0x0000:
case 0x1000:
- set_nt_mirroring(space->machine(), (data | (data >> 7)) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (data | (data >> 7)) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
@@ -8441,7 +8441,7 @@ static void unl_ax5705_set_prg( running_machine &machine )
static WRITE8_HANDLER( unl_ax5705_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("unl_ax5705_w offset: %04x, data: %02x\n", offset, data));
@@ -8449,14 +8449,14 @@ static WRITE8_HANDLER( unl_ax5705_w )
{
case 0x0000:
state->m_mmc_prg_bank[0] = (data & 0x05) | ((data & 0x08) >> 2) | ((data & 0x02) << 2);
- unl_ax5705_set_prg(space->machine());
+ unl_ax5705_set_prg(space.machine());
break;
case 0x0008:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
state->m_mmc_prg_bank[1] = (data & 0x05) | ((data & 0x08) >> 2) | ((data & 0x02) << 2);
- unl_ax5705_set_prg(space->machine());
+ unl_ax5705_set_prg(space.machine());
break;
/* CHR banks 0, 1, 4, 5 */
case 0x2008:
@@ -8465,7 +8465,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x400a:
bank = ((offset & 0x4000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x2009:
case 0x200b:
@@ -8473,7 +8473,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x400b:
bank = ((offset & 0x4000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x04) << 3) | ((data & 0x02) << 5) | ((data & 0x09) << 4);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
/* CHR banks 2, 3, 6, 7 */
case 0x4000:
@@ -8482,7 +8482,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x6002:
bank = 2 + ((offset & 0x2000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x4001:
case 0x4003:
@@ -8490,7 +8490,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x6003:
bank = 2 + ((offset & 0x2000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x04) << 3) | ((data & 0x02) << 5) | ((data & 0x09) << 4);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
}
}
@@ -8509,8 +8509,8 @@ static WRITE8_HANDLER( unl_cc21_w )
{
LOG_MMC(("unl_cc21_w offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 1) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- chr8(space->machine(), (offset & 0x01), CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 1) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ chr8(space.machine(), (offset & 0x01), CHRROM);
}
/*************************************************************
@@ -8605,7 +8605,7 @@ static WRITE8_HANDLER( ks7057_w )
static WRITE8_HANDLER( unl_t230_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("unl_t230_w offset: %04x, data: %02x\n", offset, data));
@@ -8614,7 +8614,7 @@ static WRITE8_HANDLER( unl_t230_w )
case 0x0000:
break;
case 0x2000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
// the part below works like VRC-2. how was the original board wired up?
@@ -8625,10 +8625,10 @@ static WRITE8_HANDLER( unl_t230_w )
case 0x100c:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
@@ -8654,7 +8654,7 @@ static WRITE8_HANDLER( unl_t230_w )
else
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], state->m_mmc_chr_source);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], state->m_mmc_chr_source);
break;
case 0x7000:
state->m_IRQ_count_latch &= ~0x0f;
@@ -8714,7 +8714,7 @@ static void kof96_chr_cb( running_machine &machine, int start, int bank, int sou
static WRITE8_HANDLER( kof96_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 new_bank;
LOG_MMC(("kof96_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -8728,15 +8728,15 @@ static WRITE8_HANDLER( kof96_l_w )
new_bank = (state->m_mmc_reg[0] & 0x1f);
if (state->m_mmc_reg[0] & 0x20)
- prg32(space->machine(), new_bank >> 2);
+ prg32(space.machine(), new_bank >> 2);
else
{
- prg16_89ab(space->machine(), new_bank);
- prg16_cdef(space->machine(), new_bank);
+ prg16_89ab(space.machine(), new_bank);
+ prg16_cdef(space.machine(), new_bank);
}
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset >= 0x1000)
@@ -8760,13 +8760,13 @@ static WRITE8_HANDLER( kof96_l_w )
if (!state->m_mmc_reg[3] && offset > 0x1000)
{
state->m_mmc_reg[3] = 1;
- space->write_byte(0x4017, 0x40);
+ space.write_byte(0x4017, 0x40);
}
}
static READ8_HANDLER( kof96_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kof96_l_r, offset: %04x\n", offset));
offset += 0x100;
@@ -8778,7 +8778,7 @@ static READ8_HANDLER( kof96_l_r )
static WRITE8_HANDLER( kof96_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kof96_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6003)
@@ -8800,9 +8800,9 @@ static WRITE8_HANDLER( kof96_w )
state->m_mmc_reg[2] = 0;
if (data == 0x28)
- prg8_cd(space->machine(), 0x17);
+ prg8_cd(space.machine(), 0x17);
else if (data == 0x2a)
- prg8_ab(space->machine(), 0x0f);
+ prg8_ab(space.machine(), 0x0f);
break;
default:
@@ -8829,7 +8829,7 @@ static WRITE8_HANDLER( kof96_w )
static WRITE8_HANDLER( mk2_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mk2_m_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x1000)
@@ -8837,17 +8837,17 @@ static WRITE8_HANDLER( mk2_m_w )
case 0x0000:
switch (offset & 0x03)
{
- case 0x00: chr2_0(space->machine(), data, CHRROM); break;
- case 0x01: chr2_2(space->machine(), data, CHRROM); break;
- case 0x02: chr2_4(space->machine(), data, CHRROM); break;
- case 0x03: chr2_6(space->machine(), data, CHRROM); break;
+ case 0x00: chr2_0(space.machine(), data, CHRROM); break;
+ case 0x01: chr2_2(space.machine(), data, CHRROM); break;
+ case 0x02: chr2_4(space.machine(), data, CHRROM); break;
+ case 0x03: chr2_6(space.machine(), data, CHRROM); break;
}
break;
case 0x1000:
switch (offset & 0x03)
{
- case 0x00: prg8_89(space->machine(), data); break;
- case 0x01: prg8_ab(space->machine(), data); break;
+ case 0x00: prg8_89(space.machine(), data); break;
+ case 0x01: prg8_ab(space.machine(), data); break;
case 0x02: state->m_IRQ_enable = 0; state->m_IRQ_count = 0; break;
case 0x03: state->m_IRQ_enable = 1; state->m_IRQ_count = 7; break;
}
@@ -8885,18 +8885,18 @@ static void n625092_set_prg( running_machine &machine, UINT8 reg1, UINT8 reg2 )
static WRITE8_HANDLER( n625092_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("n625092_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x4000)
{
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
offset = (offset >> 1) & 0xff;
if (state->m_mmc_latch1 != offset)
{
state->m_mmc_latch1 = offset;
- n625092_set_prg(space->machine(), state->m_mmc_latch1, state->m_mmc_latch2);
+ n625092_set_prg(space.machine(), state->m_mmc_latch1, state->m_mmc_latch2);
}
}
else
@@ -8906,7 +8906,7 @@ static WRITE8_HANDLER( n625092_w )
if (state->m_mmc_latch2 != offset)
{
state->m_mmc_latch2 = offset;
- n625092_set_prg(space->machine(), state->m_mmc_latch1, state->m_mmc_latch2);
+ n625092_set_prg(space.machine(), state->m_mmc_latch1, state->m_mmc_latch2);
}
}
}
@@ -8943,20 +8943,20 @@ static void sc127_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( sc127_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sc127_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
// state->m_mmc_prg_bank[offset & 0x02] = data;
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x1000:
case 0x1001:
@@ -8967,7 +8967,7 @@ static WRITE8_HANDLER( sc127_w )
case 0x1006:
case 0x1007:
// state->m_mmc_vrom_bank[offset & 0x07] = data;
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x4002:
state->m_IRQ_enable = 0;
@@ -8979,7 +8979,7 @@ static WRITE8_HANDLER( sc127_w )
state->m_IRQ_count = data;
break;
case 0x5001:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -8999,12 +8999,12 @@ static WRITE8_HANDLER( sc127_w )
static WRITE8_HANDLER( smb2j_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = (((offset >> 8) & 0x03) * 0x20) + (offset & 0x1f);
LOG_MMC(("smb2j_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (offset & 0x0800)
{
@@ -9018,7 +9018,7 @@ static WRITE8_HANDLER( smb2j_w )
else
{
LOG_MMC(("smb2j_w, selecting upper 16KB bank of #%02x\n", bank));
- prg16_cdef(space->machine(), 2 * bank + 1);
+ prg16_cdef(space.machine(), 2 * bank + 1);
}
}
else
@@ -9031,7 +9031,7 @@ static WRITE8_HANDLER( smb2j_w )
else
{
LOG_MMC(("smb2j_w, selecting lower 16KB bank of #%02x\n", bank));
- prg16_89ab(space->machine(), 2 * bank);
+ prg16_89ab(space.machine(), 2 * bank);
}
}
}
@@ -9047,7 +9047,7 @@ static WRITE8_HANDLER( smb2j_w )
else
{
LOG_MMC(("smb2j_w, selecting 32KB bank #%02x\n", bank));
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
}
}
}
@@ -9087,7 +9087,7 @@ static void smb2jb_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( smb2jb_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 prg;
LOG_MMC(("smb2jb_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -9096,7 +9096,7 @@ static WRITE8_HANDLER( smb2jb_l_w )
{
case 0x020:
prg = (data & 0x08) | ((data & 0x06) >> 1) | ((data & 0x01) << 2);
- prg8_cd(space->machine(), prg);
+ prg8_cd(space.machine(), prg);
break;
case 0x120:
state->m_IRQ_enable = data & 0x01;
@@ -9111,7 +9111,7 @@ WRITE8_HANDLER( smb2jb_extra_w )
LOG_MMC(("smb2jb_extra_w, offset: %04x, data: %02x\n", offset, data));
prg = (data & 0x08) | ((data & 0x06) >> 1) | ((data & 0x01) << 2);
- prg8_cd(space->machine(), prg);
+ prg8_cd(space.machine(), prg);
}
/*************************************************************
@@ -9136,7 +9136,7 @@ static void unl_sf3_set_chr( running_machine &machine, UINT8 chr_source, int chr
static WRITE8_HANDLER( unl_sf3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
LOG_MMC(("unl_sf3_w, offset: %04x, data: %02x\n", offset, data));
@@ -9148,11 +9148,11 @@ static WRITE8_HANDLER( unl_sf3_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- unl_sf3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ unl_sf3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -9161,12 +9161,12 @@ static WRITE8_HANDLER( unl_sf3_w )
{
case 0: case 2: case 4:
state->m_mmc_vrom_bank[cmd >> 1] = data;
- unl_sf3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ unl_sf3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
@@ -9199,10 +9199,10 @@ static WRITE8_HANDLER( unl_xzy_l_w )
switch (offset)
{
case 0x1ef1: /* 0x5ff1 */
- prg32(space->machine(), data >> 1);
+ prg32(space.machine(), data >> 1);
break;
case 0x1ef2: /* 0x5ff2 */
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
break;
}
}
@@ -9225,13 +9225,13 @@ static void racmate_update_banks( running_machine &machine )
static WRITE8_HANDLER( unl_racmate_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_racmate_w offset: %04x, data: %02x\n", offset, data));
if (offset == 0x3000)
{
state->m_mmc_latch1 = data;
- racmate_update_banks(space->machine());
+ racmate_update_banks(space.machine());
}
}
@@ -9250,7 +9250,7 @@ static WRITE8_HANDLER( unl_racmate_w )
static WRITE8_HANDLER( unl_fs304_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_fs304_l_w, offset: %04x, data: %02x\n", offset, data));
int bank;
offset += 0x100;
@@ -9259,8 +9259,8 @@ static WRITE8_HANDLER( unl_fs304_l_w )
{
state->m_mmc_reg[(offset >> 8) & 3] = data;
bank = ((state->m_mmc_reg[2] & 0x0f) << 4) | BIT(state->m_mmc_reg[1], 1) | (state->m_mmc_reg[0] & 0x0e);
- prg32(space->machine(), bank);
- chr8(space->machine(), 0, CHRRAM);
+ prg32(space.machine(), bank);
+ chr8(space.machine(), 0, CHRRAM);
}
}
@@ -9308,7 +9308,7 @@ static WRITE8_HANDLER( btl_smb11_w )
// is the code fine for ai senshi nicol?!?
static WRITE8_HANDLER( btl_mariobaby_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_mariobaby_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x7000)
@@ -9316,10 +9316,10 @@ static WRITE8_HANDLER( btl_mariobaby_w )
switch (offset & 0x03)
{
case 0x00:
- prg8_67(space->machine(), data);
+ prg8_67(space.machine(), data);
break;
case 0x01:
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x02:
/* Check if IRQ is being enabled */
@@ -9369,7 +9369,7 @@ static void btl_smb2a_irq( device_t *device, int scanline, int vblank, int blank
static WRITE8_HANDLER( btl_smb2a_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_smb2a_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6000)
@@ -9382,7 +9382,7 @@ static WRITE8_HANDLER( btl_smb2a_w )
state->m_IRQ_enable = 1;
break;
case 0x6000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
}
}
@@ -9402,7 +9402,7 @@ static WRITE8_HANDLER( btl_smb2a_w )
static WRITE8_HANDLER( whirl2706_w )
{
LOG_MMC(("whirl2706_w, offset: %04x, data: %02x\n", offset, data));
- prg8_67(space->machine(), data);
+ prg8_67(space.machine(), data);
}
/*************************************************************
@@ -9423,7 +9423,7 @@ static WRITE8_HANDLER( btl_tobi_l_w )
offset += 0x100;
if ((offset & 0x43c0) == 0x41c0)
- prg8_67(space->machine(), data & 0x07);
+ prg8_67(space.machine(), data & 0x07);
}
/*************************************************************
@@ -9456,36 +9456,36 @@ static void btl_smb3_irq( device_t *device, int scanline, int vblank, int blanke
static WRITE8_HANDLER( btl_smb3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_smb3_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x0f)
{
case 0x00:
case 0x02:
- chr1_x(space->machine(), offset & 0x07, data & 0xfe, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data & 0xfe, CHRROM);
break;
case 0x01:
case 0x03:
- chr1_x(space->machine(), offset & 0x07, data | 0x01, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data | 0x01, CHRROM);
break;
case 0x04: case 0x05:
case 0x06: case 0x07:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x08:
- prg8_89(space->machine(), data | 0x10);
+ prg8_89(space.machine(), data | 0x10);
break;
case 0x09:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0a:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0b:
- prg8_ef(space->machine(), data | 0x10);
+ prg8_ef(space.machine(), data | 0x10);
break;
case 0x0c:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x0d:
state->m_IRQ_count = 0;
@@ -9531,20 +9531,20 @@ static void btl_dn_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( btl_dn_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("btl_dn_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7003)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000:
case 0x3002:
@@ -9555,7 +9555,7 @@ static WRITE8_HANDLER( btl_dn_w )
case 0x6000:
case 0x6002:
bank = ((offset & 0x7000) - 0x3000) / 0x0800 + ((offset & 0x0002) >> 3);
- chr1_x(space->machine(), bank, data, CHRROM);
+ chr1_x(space.machine(), bank, data, CHRROM);
break;
case 0x7000:
state->m_IRQ_count = data;
@@ -9577,7 +9577,7 @@ static WRITE8_HANDLER( btl_dn_w )
static WRITE8_HANDLER( btl_pika_y2k_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_pika_y2k_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6001)
@@ -9597,7 +9597,7 @@ static WRITE8_HANDLER( btl_pika_y2k_w )
// strange WRAM usage: it is protected at start, and gets unprotected after the first write to 0xa000
static WRITE8_HANDLER( btl_pika_y2k_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_pika_y2k_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_wram[offset] = data;
@@ -9605,7 +9605,7 @@ static WRITE8_HANDLER( btl_pika_y2k_m_w )
static READ8_HANDLER( btl_pika_y2k_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_pika_y2k_m_r, offset: %04x\n", offset));
return state->m_wram[offset] ^ (state->m_mmc_latch2 & state->m_mmc_reg[0]);
@@ -9716,7 +9716,7 @@ static void fk23c_set_chr( running_machine &machine )
static WRITE8_HANDLER( fk23c_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fk23c_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -9726,15 +9726,15 @@ static WRITE8_HANDLER( fk23c_l_w )
{
state->m_mmc_reg[offset & 0x03] = data;
- fk23c_set_prg(space->machine());
- fk23c_set_chr(space->machine());
+ fk23c_set_prg(space.machine());
+ fk23c_set_chr(space.machine());
}
}
}
static WRITE8_HANDLER( fk23c_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fk23c_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_mmc_reg[0] & 0x40)
@@ -9744,7 +9744,7 @@ static WRITE8_HANDLER( fk23c_w )
else
{
state->m_mmc_cmd1 = data & 0x03;
- fk23c_set_chr(space->machine());
+ fk23c_set_chr(space.machine());
}
}
else
@@ -9755,15 +9755,15 @@ static WRITE8_HANDLER( fk23c_w )
if ((state->m_mmc_reg[3] & 0x02) && (state->m_mmc3_latch & 0x08))
{
state->m_mmc_reg[4 | (state->m_mmc3_latch & 0x03)] = data;
- fk23c_set_prg(space->machine());
- fk23c_set_chr(space->machine());
+ fk23c_set_prg(space.machine());
+ fk23c_set_chr(space.machine());
}
else
txrom_w(space, offset, data);
break;
case 0x2000:
- set_nt_mirroring(space->machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
default:
@@ -9806,7 +9806,7 @@ static void bmc_64in1nr_set_prg( running_machine &machine )
static WRITE8_HANDLER( bmc_64in1nr_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_64in1nr_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -9817,17 +9817,17 @@ static WRITE8_HANDLER( bmc_64in1nr_l_w )
case 0x1002:
case 0x1003:
state->m_mmc_reg[offset & 0x03] = data;
- bmc_64in1nr_set_prg(space->machine());
- chr8(space->machine(), ((state->m_mmc_reg[0] >> 1) & 0x03) | (state->m_mmc_reg[2] << 2), CHRROM);
+ bmc_64in1nr_set_prg(space.machine());
+ chr8(space.machine(), ((state->m_mmc_reg[0] >> 1) & 0x03) | (state->m_mmc_reg[2] << 2), CHRROM);
break;
}
if (offset == 0x1000) /* reg[0] also sets mirroring */
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
static WRITE8_HANDLER( bmc_64in1nr_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_64in1nr_w offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[3] = data; // reg[3] is currently unused?!?
@@ -9847,11 +9847,11 @@ static WRITE8_HANDLER( bmc_190in1_w )
{
LOG_MMC(("bmc_190in1_w offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
offset >>= 2;
- prg16_89ab(space->machine(), offset);
- prg16_cdef(space->machine(), offset);
- chr8(space->machine(), offset, CHRROM);
+ prg16_89ab(space.machine(), offset);
+ prg16_cdef(space.machine(), offset);
+ chr8(space.machine(), offset, CHRROM);
}
/*************************************************************
@@ -9870,16 +9870,16 @@ static WRITE8_HANDLER( bmc_a65as_w )
LOG_MMC(("bmc_a65as_w offset: %04x, data: %02x\n", offset, data));
if (data & 0x80)
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
else
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (data & 0x40)
- prg32(space->machine(), data >> 1);
+ prg32(space.machine(), data >> 1);
else
{
- prg16_89ab(space->machine(), helper | (data & 0x07));
- prg16_cdef(space->machine(), helper | 0x07);
+ prg16_89ab(space.machine(), helper | (data & 0x07));
+ prg16_cdef(space.machine(), helper | 0x07);
}
}
@@ -9898,7 +9898,7 @@ static WRITE8_HANDLER( bmc_gs2004_w )
{
LOG_MMC(("bmc_gs2004_w offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -9917,9 +9917,9 @@ static WRITE8_HANDLER( bmc_gs2013_w )
LOG_MMC(("bmc_gs2013_w offset: %04x, data: %02x\n", offset, data));
if (data & 0x08)
- prg32(space->machine(), data & 0x09);
+ prg32(space.machine(), data & 0x09);
else
- prg32(space->machine(), data & 0x07);
+ prg32(space.machine(), data & 0x07);
}
/*************************************************************
@@ -9954,27 +9954,27 @@ static void bmc_s24in1sc03_chr_cb( running_machine &machine, int start, int bank
static WRITE8_HANDLER( bmc_s24in1sc03_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_s24in1sc03_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset == 0x1ff0)
{
state->m_mmc_reg[0] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset == 0x1ff1)
{
state->m_mmc_reg[1] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset == 0x1ff2)
{
state->m_mmc_reg[2] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -9990,23 +9990,23 @@ static WRITE8_HANDLER( bmc_s24in1sc03_l_w )
static WRITE8_HANDLER( bmc_t262_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("bmc_t262_w offset: %04x, data: %02x\n", offset, data));
if (state->m_mmc_latch2 || offset == 0)
{
state->m_mmc_latch1 = (state->m_mmc_latch1 & 0x38) | (data & 0x07);
- prg16_89ab(space->machine(), state->m_mmc_latch1);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
}
else
{
state->m_mmc_latch2 = 1;
- set_nt_mirroring(space->machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
mmc_helper = ((offset >> 3) & 0x20) | ((offset >> 2) & 0x18);
state->m_mmc_latch1 = mmc_helper | (state->m_mmc_latch1 & 0x07);
- prg16_89ab(space->machine(), state->m_mmc_latch1);
- prg16_cdef(space->machine(), mmc_helper | 0x07);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
+ prg16_cdef(space.machine(), mmc_helper | 0x07);
}
}
@@ -10023,7 +10023,7 @@ static WRITE8_HANDLER( bmc_t262_w )
static WRITE8_HANDLER( bmc_ws_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("bmc_ws_m_w offset: %04x, data: %02x\n", offset, data));
@@ -10035,16 +10035,16 @@ static WRITE8_HANDLER( bmc_ws_m_w )
if (!state->m_mmc_latch1)
{
state->m_mmc_latch1 = data & 0x20;
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
mmc_helper = (~data & 0x08) >> 3;
- prg16_89ab(space->machine(), data & ~mmc_helper);
- prg16_cdef(space->machine(), data | mmc_helper);
+ prg16_89ab(space.machine(), data & ~mmc_helper);
+ prg16_cdef(space.machine(), data | mmc_helper);
}
break;
case 1:
if (!state->m_mmc_latch1)
{
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
}
break;
}
@@ -10072,16 +10072,16 @@ static WRITE8_HANDLER( novel1_w )
{
LOG_MMC(("novel1_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset & 0x03);
- chr8(space->machine(), offset & 0x07, CHRROM);
+ prg32(space.machine(), offset & 0x03);
+ chr8(space.machine(), offset & 0x07, CHRROM);
}
static WRITE8_HANDLER( novel2_w )
{
LOG_MMC(("novel2_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset >> 1);
- chr8(space->machine(), offset >> 3, CHRROM);
+ prg32(space.machine(), offset >> 1);
+ chr8(space.machine(), offset >> 3, CHRROM);
}
/*************************************************************
@@ -10099,7 +10099,7 @@ static WRITE8_HANDLER( novel2_w )
static WRITE8_HANDLER( bmc_gka_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_gka_w, offset: %04x, data: %02x\n", offset, data));
if (offset & 0x0800)
@@ -10108,16 +10108,16 @@ static WRITE8_HANDLER( bmc_gka_w )
state->m_mmc_latch1 = data;
if (state->m_mmc_latch2 & 0x80)
- prg32(space->machine(), 2 | (state->m_mmc_latch2 >> 6));
+ prg32(space.machine(), 2 | (state->m_mmc_latch2 >> 6));
else
{
- prg16_89ab(space->machine(), (state->m_mmc_latch2 >> 5) & 0x03);
- prg16_cdef(space->machine(), (state->m_mmc_latch2 >> 5) & 0x03);
+ prg16_89ab(space.machine(), (state->m_mmc_latch2 >> 5) & 0x03);
+ prg16_cdef(space.machine(), (state->m_mmc_latch2 >> 5) & 0x03);
}
- set_nt_mirroring(space->machine(), (state->m_mmc_latch2 & 0x08) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (state->m_mmc_latch2 & 0x08) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), (state->m_mmc_latch1 & 0x03) | (state->m_mmc_latch2 & 0x07) | ((state->m_mmc_latch2 & 0x10) >> 1), CHRROM);
+ chr8(space.machine(), (state->m_mmc_latch1 & 0x03) | (state->m_mmc_latch2 & 0x07) | ((state->m_mmc_latch2 & 0x10) >> 1), CHRROM);
}
@@ -10137,7 +10137,7 @@ static WRITE8_HANDLER( bmc_gka_w )
static WRITE8_HANDLER( sng32_w )
{
LOG_MMC(("sng32_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -10155,14 +10155,14 @@ static WRITE8_HANDLER( sng32_w )
static WRITE8_HANDLER( bmc_gkb_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank = (offset & 0x40) ? 0 : 1;
LOG_MMC(("bmc_gkb_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset & ~bank);
- prg16_cdef(space->machine(), offset | bank);
- chr8(space->machine(), offset >> 3, state->m_mmc_chr_source);
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg16_89ab(space.machine(), offset & ~bank);
+ prg16_cdef(space.machine(), offset | bank);
+ chr8(space.machine(), offset >> 3, state->m_mmc_chr_source);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10182,19 +10182,19 @@ static WRITE8_HANDLER( bmc_super700in1_w )
{
LOG_MMC(("bmc_super700in1_w, offset :%04x, data: %02x\n", offset, data));
- chr8(space->machine(), ((offset & 0x1f) << 2) | (data & 0x03), CHRROM);
+ chr8(space.machine(), ((offset & 0x1f) << 2) | (data & 0x03), CHRROM);
if (offset & 0x20)
{
- prg16_89ab(space->machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
- prg16_cdef(space->machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
+ prg16_89ab(space.machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
+ prg16_cdef(space.machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
}
else
{
- prg32(space->machine(), ((offset & 0x40) | ((offset >> 8) & 0x3f)) >> 1);
+ prg32(space.machine(), ((offset & 0x40) | ((offset >> 8) & 0x3f)) >> 1);
}
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10214,11 +10214,11 @@ static WRITE8_HANDLER( bmc_36in1_w )
{
LOG_MMC(("bmc_36in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset & 0x07);
- prg16_cdef(space->machine(), offset & 0x07);
- chr8(space->machine(), offset & 0x07, CHRROM);
+ prg16_89ab(space.machine(), offset & 0x07);
+ prg16_cdef(space.machine(), offset & 0x07);
+ chr8(space.machine(), offset & 0x07, CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10238,8 +10238,8 @@ static WRITE8_HANDLER( bmc_21in1_w )
{
LOG_MMC(("bmc_21in1_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset & 0x03);
- chr8(space->machine(), offset & 0x03, CHRROM);
+ prg32(space.machine(), offset & 0x03);
+ chr8(space.machine(), offset & 0x03, CHRROM);
}
/*************************************************************
@@ -10261,11 +10261,11 @@ static WRITE8_HANDLER( bmc_150in1_w )
LOG_MMC(("bmc_150in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank + (((bank & 0x06) == 0x06) ? 1 : 0));
- chr8(space->machine(), bank, CHRROM);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank + (((bank & 0x06) == 0x06) ? 1 : 0));
+ chr8(space.machine(), bank, CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10285,9 +10285,9 @@ static WRITE8_HANDLER( bmc_35in1_w )
{
LOG_MMC(("bmc_35in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), (data >> 2) & 0x03);
- prg16_cdef(space->machine(), (data >> 2) & 0x03);
- chr8(space->machine(), data & 0x03, CHRROM);
+ prg16_89ab(space.machine(), (data >> 2) & 0x03);
+ prg16_cdef(space.machine(), (data >> 2) & 0x03);
+ chr8(space.machine(), data & 0x03, CHRROM);
}
/*************************************************************
@@ -10309,11 +10309,11 @@ static WRITE8_HANDLER( bmc_64in1_w )
LOG_MMC(("bmc_64in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset & ~bank);
- prg16_cdef(space->machine(), offset | bank);
- chr8(space->machine(), offset & ~bank, CHRROM);
+ prg16_89ab(space.machine(), offset & ~bank);
+ prg16_cdef(space.machine(), offset | bank);
+ chr8(space.machine(), offset & ~bank, CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10331,7 +10331,7 @@ static WRITE8_HANDLER( bmc_64in1_w )
static WRITE8_HANDLER( bmc_15in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_15in1_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset & 0x0800)
@@ -10340,8 +10340,8 @@ static WRITE8_HANDLER( bmc_15in1_m_w )
state->m_mmc_prg_mask = (data & 0x02) ? 0x0f : 0x1f;
state->m_mmc_chr_base = (data & 0x03) << 7;
state->m_mmc_chr_mask = (data & 0x02) ? 0x7f : 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -10362,16 +10362,16 @@ static WRITE8_HANDLER( bmc_hik300_w )
{
LOG_MMC(("bmc_hik300_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), offset, CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ chr8(space.machine(), offset, CHRROM);
if (offset < 0x4000)
{
- prg16_89ab(space->machine(), offset);
- prg16_cdef(space->machine(), offset);
+ prg16_89ab(space.machine(), offset);
+ prg16_cdef(space.machine(), offset);
}
else
- prg32(space->machine(), offset >> 1);
+ prg32(space.machine(), offset >> 1);
}
/*************************************************************
@@ -10391,9 +10391,9 @@ static WRITE8_HANDLER( supergun20in1_w )
{
LOG_MMC(("supergun20in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset >> 2);
- prg16_cdef(space->machine(), offset >> 2);
- chr8(space->machine(), offset, CHRROM);
+ prg16_89ab(space.machine(), offset >> 2);
+ prg16_cdef(space.machine(), offset >> 2);
+ chr8(space.machine(), offset, CHRROM);
}
/*************************************************************
@@ -10417,8 +10417,8 @@ static WRITE8_HANDLER( bmc_72in1_w )
LOG_MMC(("bmc_72in1_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), offset, CHRROM);
- set_nt_mirroring(space->machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ chr8(space.machine(), offset, CHRROM);
+ set_nt_mirroring(space.machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
hi_bank = offset & 0x40;
size_16 = offset & 0x1000;
@@ -10429,11 +10429,11 @@ static WRITE8_HANDLER( bmc_72in1_w )
if (hi_bank)
bank ++;
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
}
/*************************************************************
@@ -10452,7 +10452,7 @@ static WRITE8_HANDLER( bmc_72in1_w )
// does this work for super42in1 as well?!?
static WRITE8_HANDLER( bmc_76in1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int hi_bank;
int size_16;
int bank;
@@ -10464,7 +10464,7 @@ static WRITE8_HANDLER( bmc_76in1_w )
else
state->m_mmc_latch1 = data;
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_latch1, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_latch1, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
hi_bank = state->m_mmc_latch1 & 0x01;
size_16 = state->m_mmc_latch1 & 0x20;
@@ -10476,11 +10476,11 @@ static WRITE8_HANDLER( bmc_76in1_w )
if (hi_bank)
bank ++;
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
}
/*************************************************************
@@ -10513,21 +10513,21 @@ static WRITE8_HANDLER( bmc_1200in1_w )
if (hi_bank)
bank ++;
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
if (!(offset & 0x80))
{
if (offset & 0x200)
- prg16_cdef(space->machine(), ((bank << 1) & 0x38) + 7);
+ prg16_cdef(space.machine(), ((bank << 1) & 0x38) + 7);
else
- prg16_cdef(space->machine(), ((bank << 1) & 0x38));
+ prg16_cdef(space.machine(), ((bank << 1) & 0x38));
}
- set_nt_mirroring(space->machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10547,18 +10547,18 @@ static WRITE8_HANDLER( bmc_31in1_w )
{
LOG_MMC(("bmc_31in1_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), offset, CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ chr8(space.machine(), offset, CHRROM);
if ((offset & 0x1e) == 0)
{
- prg16_89ab(space->machine(), 0);
- prg16_89ab(space->machine(), 1);
+ prg16_89ab(space.machine(), 0);
+ prg16_89ab(space.machine(), 1);
}
else
{
- prg16_89ab(space->machine(), offset & 0x1f);
- prg16_89ab(space->machine(), offset & 0x1f);
+ prg16_89ab(space.machine(), offset & 0x1f);
+ prg16_89ab(space.machine(), offset & 0x1f);
}
}
@@ -10582,21 +10582,21 @@ static WRITE8_HANDLER( bmc_22g_w )
if (1) // this should flip at reset
{
- prg16_89ab(space->machine(), data & 0x07);
+ prg16_89ab(space.machine(), data & 0x07);
}
else
{
if (data & 0x20)
{
- prg16_89ab(space->machine(), (data & 0x1f) + 8);
- prg16_cdef(space->machine(), (data & 0x1f) + 8);
+ prg16_89ab(space.machine(), (data & 0x1f) + 8);
+ prg16_cdef(space.machine(), (data & 0x1f) + 8);
}
else
{
- prg16_89ab(space->machine(), (data & 0x1f) + 8);
- prg16_cdef(space->machine(), (data & 0x1f) + 9);
+ prg16_89ab(space.machine(), (data & 0x1f) + 8);
+ prg16_cdef(space.machine(), (data & 0x1f) + 9);
}
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
}
@@ -10617,10 +10617,10 @@ static WRITE8_HANDLER( bmc_20in1_w )
{
LOG_MMC(("bmc_20in1_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg16_89ab(space->machine(), (offset & 0x1e));
- prg16_cdef(space->machine(), (offset & 0x1e) | ((offset & 0x20) ? 1 : 0));
+ prg16_89ab(space.machine(), (offset & 0x1e));
+ prg16_cdef(space.machine(), (offset & 0x1e) | ((offset & 0x20) ? 1 : 0));
}
/*************************************************************
@@ -10643,10 +10643,10 @@ static WRITE8_HANDLER( bmc_110in1_w )
LOG_MMC(("bmc_110in1_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg16_89ab(space->machine(), map255_helper1 & ~map255_helper2);
- prg16_cdef(space->machine(), map255_helper1 | map255_helper2);
- chr8(space->machine(), ((offset >> 8) & 0x40) | (offset & 0x3f), CHRROM);
+ set_nt_mirroring(space.machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg16_89ab(space.machine(), map255_helper1 & ~map255_helper2);
+ prg16_cdef(space.machine(), map255_helper1 | map255_helper2);
+ chr8(space.machine(), ((offset >> 8) & 0x40) | (offset & 0x3f), CHRROM);
}
/*************************************************************
@@ -10664,7 +10664,7 @@ static WRITE8_HANDLER( bmc_110in1_w )
static WRITE8_HANDLER( bmc_sbig7_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 page;
LOG_MMC(("bmc_sbig7_w, offset: %04x, data: %02x\n", offset, data));
@@ -10679,8 +10679,8 @@ static WRITE8_HANDLER( bmc_sbig7_w )
state->m_mmc_prg_mask = (page > 5) ? 0x1f : 0x0f;
state->m_mmc_chr_base = page << 7;
state->m_mmc_chr_mask = (page > 5) ? 0xff : 0x7f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
default:
@@ -10704,7 +10704,7 @@ static WRITE8_HANDLER( bmc_sbig7_w )
static WRITE8_HANDLER( bmc_hik8_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_hik8_m_w, offset: %04x, data: %02x\n", offset, data));
/* This bit is the "register lock". Once register are locked, writes go to WRAM
@@ -10731,8 +10731,8 @@ static WRITE8_HANDLER( bmc_hik8_m_w )
else
state->m_mmc_chr_mask = 0xff; // i.e. we use the vrom_bank with no masking
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
}
@@ -10752,7 +10752,7 @@ static WRITE8_HANDLER( bmc_hik8_m_w )
static WRITE8_HANDLER( bmc_hik4in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_hik4in1_m_w, offset: %04x, data: %02x\n", offset, data));
/* mid writes only work when WRAM is enabled. not sure if I should
@@ -10764,14 +10764,14 @@ static WRITE8_HANDLER( bmc_hik4in1_m_w )
{
state->m_mmc_prg_base = (data & 0xc0) >> 2;
state->m_mmc_prg_mask = 0x0f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else
- prg32(space->machine(), (data & 0x30) >> 4);
+ prg32(space.machine(), (data & 0x30) >> 4);
state->m_mmc_chr_base = (data & 0xc0) << 1;
state->m_mmc_chr_mask = 0x7f;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -10806,17 +10806,17 @@ static void bmc_ball11_set_banks( running_machine &machine )
static WRITE8_HANDLER( bmc_ball11_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_ball11_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[0] = ((data >> 1) & 0x01) | ((data >> 3) & 0x02);
- bmc_ball11_set_banks(space->machine());
+ bmc_ball11_set_banks(space.machine());
}
static WRITE8_HANDLER( bmc_ball11_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_ball11_w, offset: %04x, data: %02x\n", offset, data));
@@ -10828,7 +10828,7 @@ static WRITE8_HANDLER( bmc_ball11_w )
case 0x2000:
case 0x6000:
state->m_mmc_reg[1] = data & 0x0f;
- bmc_ball11_set_banks(space->machine());
+ bmc_ball11_set_banks(space.machine());
break;
}
}
@@ -10850,7 +10850,7 @@ static WRITE8_HANDLER( bmc_ball11_w )
static WRITE8_HANDLER( bmc_mario7in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map52_helper1, map52_helper2;
LOG_MMC(("bmc_mario7in1_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -10866,8 +10866,8 @@ static WRITE8_HANDLER( bmc_mario7in1_m_w )
state->m_mmc_prg_mask = map52_helper1 ? 0x0f : 0x1f;
state->m_mmc_chr_base = ((data & 0x20) << 4) | ((data & 0x04) << 6) | (map52_helper2 ? ((data & 0x10) << 3) : 0);
state->m_mmc_chr_mask = map52_helper2 ? 0x7f : 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
state->m_map52_reg_written = 1;
}
@@ -10893,7 +10893,7 @@ static WRITE8_HANDLER( bmc_mario7in1_m_w )
static WRITE8_HANDLER( bmc_gold7in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map52_helper1, map52_helper2;
LOG_MMC(("bmc_gold7in1_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -10906,8 +10906,8 @@ static WRITE8_HANDLER( bmc_gold7in1_m_w )
state->m_mmc_prg_mask = map52_helper1 ? 0x0f : 0x1f;
state->m_mmc_chr_base = ((data & 0x20) << 3) | ((data & 0x04) << 7) | (map52_helper2 ? ((data & 0x10) << 3) : 0);
state->m_mmc_chr_mask = map52_helper2 ? 0x7f : 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
state->m_map52_reg_written = BIT(data, 7); // mc_2hikg & mc_s3nt3 write here multiple time
}
@@ -10963,7 +10963,7 @@ static void bmc_gc6in1_set_chr( running_machine &machine, UINT8 chr )
static WRITE8_HANDLER( bmc_gc6in1_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("bmc_gc6in1_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -10974,16 +10974,16 @@ static WRITE8_HANDLER( bmc_gc6in1_l_w )
if (data & 0x80)
{
bank = (data & 0x0f) | ((state->m_mmc_reg[1] & 0x03) << 4);
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else if (offset == 0x1001)
{
state->m_mmc_reg[1] = data;
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else if (offset == 0x1007)
{
@@ -10993,7 +10993,7 @@ static WRITE8_HANDLER( bmc_gc6in1_l_w )
static WRITE8_HANDLER( bmc_gc6in1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
static const UINT8 conv_table[8] = {0, 6, 3, 7, 5, 2, 4, 1};
LOG_MMC(("bmc_gc6in1_w, offset: %04x, data: %02x\n", offset, data));
@@ -11008,11 +11008,11 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
break;
case 0x0001:
@@ -11022,12 +11022,12 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
@@ -11052,11 +11052,11 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
state->m_mmc_reg[3] = 1;
break;
@@ -11071,12 +11071,12 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
}
@@ -11084,7 +11084,7 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
case 0x2001:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
default:
@@ -11111,7 +11111,7 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
static WRITE8_HANDLER( bmc_family4646_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_family4646_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0x01)
@@ -11120,8 +11120,8 @@ static WRITE8_HANDLER( bmc_family4646_m_w )
state->m_mmc_prg_mask = 0x1f;
state->m_mmc_chr_base = (data & 0x20) << 3;
state->m_mmc_chr_mask = 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -11133,34 +11133,34 @@ static WRITE8_HANDLER( bmc_family4646_m_w )
static WRITE8_HANDLER( bmc_vt5201_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_vt5201_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_latch1 = BIT(offset, 8);
// not sure about this mirroring bit!!
// without it TN 95 in 1 has glitches in Lunar Ball; with it TN 95 in 1 has glitches in Galaxian!
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (BIT(offset, 7))
{
- prg16_89ab(space->machine(), (offset >> 4) & 0x07);
- prg16_cdef(space->machine(), (offset >> 4) & 0x07);
+ prg16_89ab(space.machine(), (offset >> 4) & 0x07);
+ prg16_cdef(space.machine(), (offset >> 4) & 0x07);
}
else
- prg32(space->machine(), (offset >> 5) & 0x03);
- chr8(space->machine(), offset, CHRROM);
+ prg32(space.machine(), (offset >> 5) & 0x03);
+ chr8(space.machine(), offset, CHRROM);
}
static READ8_HANDLER( bmc_vt5201_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_vt5201_r, offset: %04x\n", offset));
// state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
if (state->m_mmc_latch1)
return state->m_mmc_dipsetting; // cart mode, depending on the Dip Switches (always zero atm, given we have no way to add cart-based DIPs)
else
- return mmc_hi_access_rom(space->machine(), offset);
+ return mmc_hi_access_rom(space.machine(), offset);
}
/*************************************************************
@@ -11187,7 +11187,7 @@ static void bmc_bs5_update_banks( running_machine &machine )
static WRITE8_HANDLER( bmc_bs5_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bs5_helper = (offset & 0xc00) >> 10;
LOG_MMC(("bmc_bs5_w, offset: %04x, data: %02x\n", offset, data));
// state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
@@ -11202,7 +11202,7 @@ static WRITE8_HANDLER( bmc_bs5_w )
state->m_mmc_prg_bank[bs5_helper] = offset & 0x0f;
break;
}
- bmc_bs5_update_banks(space->machine());
+ bmc_bs5_update_banks(space.machine());
}
/*************************************************************
@@ -11220,15 +11220,15 @@ static WRITE8_HANDLER( bmc_810544_w )
if (!BIT(offset, 6))
{
- prg16_89ab(space->machine(), (bank << 1) | BIT(offset, 5));
- prg16_cdef(space->machine(), (bank << 1) | BIT(offset, 5));
+ prg16_89ab(space.machine(), (bank << 1) | BIT(offset, 5));
+ prg16_cdef(space.machine(), (bank << 1) | BIT(offset, 5));
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
- set_nt_mirroring(space->machine(), BIT(offset, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(offset, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), offset & 0x0f, CHRROM);
+ chr8(space.machine(), offset & 0x0f, CHRROM);
}
/*************************************************************
@@ -11247,15 +11247,15 @@ static WRITE8_HANDLER( bmc_ntd03_w )
if (BIT(offset, 7))
{
- prg16_89ab(space->machine(), pbank | BIT(offset, 6));
- prg16_cdef(space->machine(), pbank | BIT(offset, 6));
+ prg16_89ab(space.machine(), pbank | BIT(offset, 6));
+ prg16_cdef(space.machine(), pbank | BIT(offset, 6));
}
else
- prg32(space->machine(), pbank >> 1);
+ prg32(space.machine(), pbank >> 1);
- set_nt_mirroring(space->machine(), BIT(offset, 10) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(offset, 10) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), cbank, CHRROM);
+ chr8(space.machine(), cbank, CHRROM);
}
/*************************************************************
@@ -11288,7 +11288,7 @@ static void bmc_gb63_update( running_machine &machine )
static WRITE8_HANDLER( bmc_gb63_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_gb63_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[offset & 1] = data;
@@ -11298,14 +11298,14 @@ static WRITE8_HANDLER( bmc_gb63_w )
static READ8_HANDLER( bmc_gb63_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_gb63_r, offset: %04x\n", offset));
// state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
if (state->m_mmc_latch1 == 1)
return 0xff; // open bus
else
- return mmc_hi_access_rom(space->machine(), offset);
+ return mmc_hi_access_rom(space.machine(), offset);
}
/*************************************************************
@@ -11318,8 +11318,8 @@ static WRITE8_HANDLER( edu2k_w )
{
LOG_MMC(("edu2k_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data & 0x1f);
- wram_bank(space->machine(), (data & 0xc0) >> 6, NES_WRAM);
+ prg32(space.machine(), data & 0x1f);
+ wram_bank(space.machine(), (data & 0xc0) >> 6, NES_WRAM);
}
/*************************************************************
@@ -11338,7 +11338,7 @@ static void h2288_prg_cb( running_machine &machine, int start, int bank )
static WRITE8_HANDLER( h2288_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("h2288_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -11349,11 +11349,11 @@ static WRITE8_HANDLER( h2288_l_w )
{
UINT8 helper1 = (state->m_mmc_reg[0] & 0x05) | ((state->m_mmc_reg[0] >> 2) & 0x0a);
UINT8 helper2 = BIT(state->m_mmc_reg[0], 1);
- prg16_89ab(space->machine(), helper1 & ~helper2);
- prg16_cdef(space->machine(), helper1 | helper2);
+ prg16_89ab(space.machine(), helper1 & ~helper2);
+ prg16_cdef(space.machine(), helper1 | helper2);
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
}
@@ -11444,7 +11444,7 @@ static void shjy3_update( running_machine &machine )
static WRITE8_HANDLER( shjy3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, shift;
LOG_MMC(("shjy3_w, offset: %04x, data: %02x\n", offset, data));
@@ -11472,10 +11472,10 @@ static WRITE8_HANDLER( shjy3_w )
case 0x1400:
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x7000:
@@ -11491,7 +11491,7 @@ static WRITE8_HANDLER( shjy3_w )
break;
}
}
- shjy3_update(space->machine());
+ shjy3_update(space.machine());
}
/*************************************************************
@@ -11506,7 +11506,7 @@ static WRITE8_HANDLER( shjy3_w )
WRITE8_HANDLER( unl_6035052_extra_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_6035052_extra_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_latch1 = data & 0x03;
if (state->m_mmc_latch1 == 1)
@@ -11515,7 +11515,7 @@ WRITE8_HANDLER( unl_6035052_extra_w )
READ8_HANDLER( unl_6035052_extra_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_6035052_extra_r, offset: %04x\n", offset));
return state->m_mmc_latch1;
}
@@ -11572,7 +11572,7 @@ INLINE void pjoy84_set_base_mask( running_machine &machine )
static WRITE8_HANDLER( pjoy84_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("pjoy84_m_w offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x03)
@@ -11584,12 +11584,12 @@ static WRITE8_HANDLER( pjoy84_m_w )
case 0x01:
case 0x02:
state->m_mmc_reg[offset & 0x03] = data;
- pjoy84_set_base_mask(space->machine());
+ pjoy84_set_base_mask(space.machine());
if (state->m_mmc_reg[3] & 0x10)
- chr8(space->machine(), (state->m_mmc_chr_base >> 3) | (state->m_mmc_reg[2] & 0x0f), state->m_mmc_chr_source);
+ chr8(space.machine(), (state->m_mmc_chr_base >> 3) | (state->m_mmc_reg[2] & 0x0f), state->m_mmc_chr_source);
else
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
}
@@ -11652,7 +11652,7 @@ static void someri_mmc1_set_chr( running_machine &machine )
static WRITE8_HANDLER( someri_mmc1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
assert(state->m_mmc_cmd1 == 2);
@@ -11662,7 +11662,7 @@ static WRITE8_HANDLER( someri_mmc1_w )
state->m_mmc1_latch = 0;
state->m_mmc_reg[0] |= 0x0c;
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_prg(space.machine());
return;
}
@@ -11682,26 +11682,26 @@ static WRITE8_HANDLER( someri_mmc1_w )
state->m_mmc_reg[0] = state->m_mmc1_latch;
switch (state->m_mmc_reg[0] & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
}
- someri_mmc1_set_chr(space->machine());
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_chr(space.machine());
+ someri_mmc1_set_prg(space.machine());
break;
case 0x2000:
state->m_mmc_reg[1] = state->m_mmc1_latch;
- someri_mmc1_set_chr(space->machine());
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_chr(space.machine());
+ someri_mmc1_set_prg(space.machine());
break;
case 0x4000:
state->m_mmc_reg[2] = state->m_mmc1_latch;
- someri_mmc1_set_chr(space->machine());
+ someri_mmc1_set_chr(space.machine());
break;
case 0x6000:
state->m_mmc_reg[3] = state->m_mmc1_latch;
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_prg(space.machine());
break;
}
@@ -11712,7 +11712,7 @@ static WRITE8_HANDLER( someri_mmc1_w )
// MMC3 Mode emulation
static WRITE8_HANDLER( someri_mmc3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
assert(state->m_mmc_cmd1 == 1);
@@ -11723,10 +11723,10 @@ static WRITE8_HANDLER( someri_mmc3_w )
state->m_mmc3_latch = data;
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
if (mmc_helper & 0x80)
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -11736,18 +11736,18 @@ static WRITE8_HANDLER( someri_mmc3_w )
case 0: case 1:
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2001: break;
case 0x4000: state->m_IRQ_count_latch = data; break;
@@ -11760,7 +11760,7 @@ static WRITE8_HANDLER( someri_mmc3_w )
// VRC2 Mode emulation
static WRITE8_HANDLER( someri_vrc2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank, shift;
assert(state->m_mmc_cmd1 == 0);
@@ -11768,22 +11768,22 @@ static WRITE8_HANDLER( someri_vrc2_w )
if (offset < 0x1000)
{
state->m_mmc_prg_bank[4] = data;
- prg8_89(space->machine(), state->m_mmc_prg_bank[4]);
+ prg8_89(space.machine(), state->m_mmc_prg_bank[4]);
}
else if (offset < 0x2000)
{
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
}
else if (offset < 0x3000)
{
state->m_mmc_prg_bank[5] = data;
- prg8_ab(space->machine(), state->m_mmc_prg_bank[5]);
+ prg8_ab(space.machine(), state->m_mmc_prg_bank[5]);
}
else if (offset < 0x7000)
{
@@ -11791,13 +11791,13 @@ static WRITE8_HANDLER( someri_vrc2_w )
shift = BIT(offset, 2) * 4;
data = (data & 0x0f) << shift;
state->m_mmc_vrom_bank[6 + bank] = data | state->m_mmc_chr_base;
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[6 + bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[6 + bank], CHRROM);
}
}
static WRITE8_HANDLER( someri_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("someri_w mode %d, offset: %04x, data: %02x\n", state->m_mmc_cmd1, offset, data));
switch (state->m_mmc_cmd1)
@@ -11834,7 +11834,7 @@ static void someri_mode_update( running_machine &machine )
static WRITE8_HANDLER( someri_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("someri_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -11844,7 +11844,7 @@ static WRITE8_HANDLER( someri_l_w )
state->m_mmc_chr_base = ((state->m_mmc_cmd1 & 0x04) << 6);
if (state->m_mmc_cmd1 != 1)
state->m_IRQ_enable = 0;
- someri_mode_update(space->machine());
+ someri_mode_update(space.machine());
}
}
@@ -11859,7 +11859,7 @@ static WRITE8_HANDLER( someri_l_w )
static WRITE8_HANDLER( fujiya_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fujiya_m_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x6000;
@@ -11869,7 +11869,7 @@ static WRITE8_HANDLER( fujiya_m_w )
static READ8_HANDLER( fujiya_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fujiya_m_r, offset: %04x\n", offset));
offset += 0x6000;
diff --git a/src/mess/machine/northbridge.c b/src/mess/machine/northbridge.c
index 15bcd161d7b..ecca90f816c 100644
--- a/src/mess/machine/northbridge.c
+++ b/src/mess/machine/northbridge.c
@@ -24,15 +24,15 @@ northbridge_device::northbridge_device(const machine_config &mconfig, device_typ
void northbridge_device::device_start()
{
- address_space* space = machine().device(":maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device(":maincpu")->memory().space(AS_PROGRAM);
machine().root_device().membank("bank10")->set_base(m_ram->pointer());
if (m_ram->size() > 0x0a0000)
{
offs_t ram_limit = 0x100000 + m_ram->size() - 0x0a0000;
- space->install_read_bank(0x100000, ram_limit - 1, "bank1");
- space->install_write_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_read_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_write_bank(0x100000, ram_limit - 1, "bank1");
machine().root_device().membank("bank1")->set_base(m_ram->pointer() + 0xa0000);
}
}
diff --git a/src/mess/machine/nubus.c b/src/mess/machine/nubus.c
index 031559570c6..c72e69ec588 100644
--- a/src/mess/machine/nubus.c
+++ b/src/mess/machine/nubus.c
@@ -233,8 +233,8 @@ void nubus_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mi
{
// printf("install_bank: %s @ %x->%x mask %x mirror %x\n", tag, start, end, mask, mirror);
m_maincpu = machine().device<cpu_device>(m_cputag);
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->install_readwrite_bank(start, end, mask, mirror, tag );
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.install_readwrite_bank(start, end, mask, mirror, tag );
machine().root_device().membank(tag)->set_base(data);
}
diff --git a/src/mess/machine/oric.c b/src/mess/machine/oric.c
index 4016fa0784c..21417fb1bba 100644
--- a/src/mess/machine/oric.c
+++ b/src/mess/machine/oric.c
@@ -427,17 +427,17 @@ static void oric_install_apple2_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
device_t *fdc = machine.device("fdc");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_is_telestrat)
return;
- space->install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
- space->install_read_bank(0x0320, 0x03ff, "bank4");
+ space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
+ space.install_read_bank(0x0320, 0x03ff, "bank4");
- space->install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
+ space.install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
state->membank("bank4")->set_base( state->memregion("maincpu")->base() + 0x014000 + 0x020);
}
@@ -446,7 +446,7 @@ static void oric_enable_memory(running_machine &machine, int low, int high, int
{
oric_state *state = machine.driver_data<oric_state>();
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_is_telestrat)
return;
@@ -455,33 +455,33 @@ static void oric_enable_memory(running_machine &machine, int low, int high, int
switch(i) {
case 1:
if (rd) {
- space->install_read_bank(0xc000, 0xdfff, "bank1");
+ space.install_read_bank(0xc000, 0xdfff, "bank1");
} else {
- space->nop_read(0xc000, 0xdfff);
+ space.nop_read(0xc000, 0xdfff);
}
if (wr) {
- space->install_write_bank(0xc000, 0xdfff, "bank5");
+ space.install_write_bank(0xc000, 0xdfff, "bank5");
} else {
- space->unmap_write(0xc000, 0xdfff);
+ space.unmap_write(0xc000, 0xdfff);
}
break;
case 2:
if (rd) {
- space->install_read_bank(0xe000, 0xf7ff, "bank2");
+ space.install_read_bank(0xe000, 0xf7ff, "bank2");
} else {
- space->nop_read(0xe000, 0xf7ff);
+ space.nop_read(0xe000, 0xf7ff);
}
if (wr) {
- space->install_write_bank(0xe000, 0xf7ff, "bank6");
+ space.install_write_bank(0xe000, 0xf7ff, "bank6");
} else {
- space->unmap_write(0xe000, 0xf7ff);
+ space.unmap_write(0xe000, 0xf7ff);
}
break;
case 3:
if (rd) {
- space->install_read_bank(0xf800, 0xffff, "bank3");
+ space.install_read_bank(0xf800, 0xffff, "bank3");
} else {
- space->nop_read(0xf800, 0xffff);
+ space.nop_read(0xf800, 0xffff);
}
break;
}
@@ -551,17 +551,17 @@ static void oric_install_apple2_v2_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
device_t *fdc = machine.device("fdc");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
- space->install_read_bank(0x0320, 0x03ff, "bank4");
+ space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
+ space.install_read_bank(0x0320, 0x03ff, "bank4");
- space->install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
- space->install_write_handler(0x0380, 0x0383, write8_delegate(FUNC(oric_state::apple2_v2_interface_w),state));
+ space.install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
+ space.install_write_handler(0x0380, 0x0383, write8_delegate(FUNC(oric_state::apple2_v2_interface_w),state));
- state->apple2_v2_interface_w(*space, 0, 0);
+ state->apple2_v2_interface_w(space, 0, 0);
}
/********************/
@@ -755,16 +755,16 @@ WRITE8_MEMBER(oric_state::oric_jasmin_w)
static void oric_install_jasmin_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* romdis */
state->m_port_3fb_w = 1;
oric_jasmin_set_mem_0x0c000(machine);
- space->install_read_handler(0x0300, 0x03ef, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_read_handler(0x03f0, 0x03ff, read8_delegate(FUNC(oric_state::oric_jasmin_r),state));
+ space.install_read_handler(0x0300, 0x03ef, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_read_handler(0x03f0, 0x03ff, read8_delegate(FUNC(oric_state::oric_jasmin_r),state));
- space->install_write_handler(0x0300, 0x03ef, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_write_handler(0x03f0, 0x03ff, write8_delegate(FUNC(oric_state::oric_jasmin_w),state));
+ space.install_write_handler(0x0300, 0x03ef, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_write_handler(0x03f0, 0x03ff, write8_delegate(FUNC(oric_state::oric_jasmin_w),state));
}
/*********************************/
@@ -978,15 +978,15 @@ WRITE8_MEMBER(oric_state::oric_microdisc_w)
static void oric_install_microdisc_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_read_handler(0x0310, 0x031f, read8_delegate(FUNC(oric_state::oric_microdisc_r),state));
- space->install_read_handler(0x0320, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_read_handler(0x0310, 0x031f, read8_delegate(FUNC(oric_state::oric_microdisc_r),state));
+ space.install_read_handler(0x0320, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_write_handler(0x0310, 0x031f, write8_delegate(FUNC(oric_state::oric_microdisc_w),state));
- space->install_write_handler(0x0320, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_write_handler(0x0310, 0x031f, write8_delegate(FUNC(oric_state::oric_microdisc_w),state));
+ space.install_write_handler(0x0320, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),state));
/* disable os rom, enable microdisc rom */
/* 0x0c000-0x0dfff will be ram, 0x0e000-0x0ffff will be microdisc rom */
@@ -1064,7 +1064,7 @@ void oric_state::machine_start()
void oric_state::machine_reset()
{
int disc_interface_id = machine().root_device().ioport("FLOPPY")->read() & 0x07;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
if (m_is_telestrat)
return;
@@ -1095,8 +1095,8 @@ void oric_state::machine_reset()
}
else
{
- space->install_read_handler(0x0300, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),this));
- space->install_write_handler(0x0300, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),this));
+ space.install_read_handler(0x0300, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),this));
+ space.install_write_handler(0x0300, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),this));
}
}
break;
@@ -1246,7 +1246,7 @@ CB2
static void telestrat_refresh_mem(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
telestrat_mem_block *mem_block = &state->m_telestrat_blocks[state->m_telestrat_bank_selection];
@@ -1256,23 +1256,23 @@ static void telestrat_refresh_mem(running_machine &machine)
{
state->membank("bank1")->set_base(mem_block->ptr);
state->membank("bank2")->set_base(mem_block->ptr);
- space->install_read_bank(0xc000, 0xffff, "bank1");
- space->install_write_bank(0xc000, 0xffff, "bank2");
+ space.install_read_bank(0xc000, 0xffff, "bank1");
+ space.install_write_bank(0xc000, 0xffff, "bank2");
}
break;
case TELESTRAT_MEM_BLOCK_ROM:
{
state->membank("bank1")->set_base(mem_block->ptr);
- space->install_read_bank(0xc000, 0xffff, "bank1");
- space->nop_write(0xc000, 0xffff);
+ space.install_read_bank(0xc000, 0xffff, "bank1");
+ space.nop_write(0xc000, 0xffff);
}
break;
default:
case TELESTRAT_MEM_BLOCK_UNDEFINED:
{
- space->nop_readwrite(0xc000, 0xffff);
+ space.nop_readwrite(0xc000, 0xffff);
}
break;
}
diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c
index d2100d061f6..e1f8665a9b8 100644
--- a/src/mess/machine/orion.c
+++ b/src/mess/machine/orion.c
@@ -268,12 +268,12 @@ static void orionz80_switch_bank(running_machine &machine)
orion_state *state = machine.driver_data<orion_state>();
UINT8 bank_select;
UINT8 segment_select;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
bank_select = (state->m_orionz80_dispatcher & 0x0c) >> 2;
segment_select = state->m_orionz80_dispatcher & 0x03;
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
if ((state->m_orionz80_dispatcher & 0x80)==0)
{ // dispatcher on
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x10000 * bank_select + segment_select * 0x4000 );
@@ -287,19 +287,19 @@ static void orionz80_switch_bank(running_machine &machine)
if ((state->m_orionz80_dispatcher & 0x20) == 0)
{
- space->install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
- space->install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
- space->install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),state));
- space->install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
- space->install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
- space->install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),state));
-
- space->install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
- space->install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),state));
- space->unmap_write(0xfc00, 0xfeff);
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
+ space.install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
+ space.install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
+ space.install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),state));
+ space.install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
+ space.install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
+ space.install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),state));
+
+ space.install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
+ space.install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),state));
+ space.unmap_write(0xfc00, 0xfeff);
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
state->membank("bank3")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0xf000);
state->membank("bank5")->set_base(machine.root_device().memregion("maincpu")->base() + 0xf800);
@@ -328,25 +328,25 @@ WRITE8_MEMBER(orion_state::orionz80_dispatcher_w)
MACHINE_RESET_MEMBER(orion_state,orionz80)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
- space->install_write_bank(0x4000, 0xefff, "bank2");
- space->install_write_bank(0xf000, 0xf3ff, "bank3");
+ space.unmap_write(0x0000, 0x3fff);
+ space.install_write_bank(0x4000, 0xefff, "bank2");
+ space.install_write_bank(0xf000, 0xf3ff, "bank3");
- space->install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),this));
- space->install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),this));
- space->install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),this));
- space->install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),this));
- space->install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),this));
- space->install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),this));
+ space.install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),this));
+ space.install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),this));
+ space.install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),this));
+ space.install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),this));
+ space.install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),this));
+ space.install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),this));
- space->install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),this));
- space->install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),this));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),this));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),this));
- space->unmap_write(0xfc00, 0xfeff);
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),this));
+ space.install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),this));
+ space.install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),this));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),this));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),this));
+ space.unmap_write(0xfc00, 0xfeff);
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),this));
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0xf800);
@@ -413,7 +413,7 @@ WRITE8_MEMBER(orion_state::orionz80_io_w)
static void orionpro_bank_switch(running_machine &machine)
{
orion_state *state = machine.driver_data<orion_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int page = state->m_orionpro_page & 7; // we have only 8 pages
int is128 = (state->m_orionpro_dispatcher & 0x80) ? 1 : 0;
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
@@ -422,14 +422,14 @@ static void orionpro_bank_switch(running_machine &machine)
{
page = state->m_orionpro_128_page & 7;
}
- space->install_write_bank(0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x2000, 0x3fff, "bank2");
- space->install_write_bank(0x4000, 0x7fff, "bank3");
- space->install_write_bank(0x8000, 0xbfff, "bank4");
- space->install_write_bank(0xc000, 0xefff, "bank5");
- space->install_write_bank(0xf000, 0xf3ff, "bank6");
- space->install_write_bank(0xf400, 0xf7ff, "bank7");
- space->install_write_bank(0xf800, 0xffff, "bank8");
+ space.install_write_bank(0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x2000, 0x3fff, "bank2");
+ space.install_write_bank(0x4000, 0x7fff, "bank3");
+ space.install_write_bank(0x8000, 0xbfff, "bank4");
+ space.install_write_bank(0xc000, 0xefff, "bank5");
+ space.install_write_bank(0xf000, 0xf3ff, "bank6");
+ space.install_write_bank(0xf400, 0xf7ff, "bank7");
+ space.install_write_bank(0xf800, 0xffff, "bank8");
if ((state->m_orionpro_dispatcher & 0x01)==0x00)
@@ -444,12 +444,12 @@ static void orionpro_bank_switch(running_machine &machine)
}
if ((state->m_orionpro_dispatcher & 0x10)==0x10)
{ // ROM1 enabled
- space->unmap_write(0x0000, 0x1fff);
+ space.unmap_write(0x0000, 0x1fff);
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x20000);
}
if ((state->m_orionpro_dispatcher & 0x08)==0x08)
{ // ROM2 enabled
- space->unmap_write(0x2000, 0x3fff);
+ space.unmap_write(0x2000, 0x3fff);
state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x22000 + (state->m_orionpro_rom2_segment & 7) * 0x2000);
}
@@ -477,20 +477,20 @@ static void orionpro_bank_switch(running_machine &machine)
{
state->membank("bank6")->set_base(ram + 0x10000 * 0 + 0xf000);
- space->install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
- space->install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
- space->unmap_write(0xf600, 0xf6ff);
- space->install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orion128_floppy_w),state));
- space->install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
- space->install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
- space->unmap_read(0xf600, 0xf6ff);
- space->install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orion128_floppy_r),state));
-
- space->install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
- space->install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionpro_memory_page_w),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
- space->unmap_write(0xfb00, 0xfeff);
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
+ space.install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
+ space.install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
+ space.unmap_write(0xf600, 0xf6ff);
+ space.install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orion128_floppy_w),state));
+ space.install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
+ space.install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
+ space.unmap_read(0xf600, 0xf6ff);
+ space.install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orion128_floppy_r),state));
+
+ space.install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
+ space.install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionpro_memory_page_w),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
+ space.unmap_write(0xfb00, 0xfeff);
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
state->membank("bank8")->set_base(ram + 0x10000 * 0 + 0xf800);
diff --git a/src/mess/machine/osborne1.c b/src/mess/machine/osborne1.c
index d67d9a11ba8..5809a2815fc 100644
--- a/src/mess/machine/osborne1.c
+++ b/src/mess/machine/osborne1.c
@@ -426,9 +426,9 @@ static void osborne1_load_proc(device_image_interface &image)
void osborne1_state::machine_reset()
{
int drive;
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Initialize memory configuration */
- osborne1_bankswitch_w( *space, 0x00, 0 );
+ osborne1_bankswitch_w( space, 0x00, 0 );
m_pia_0_irq_state = FALSE;
m_pia_1_irq_state = FALSE;
@@ -441,7 +441,7 @@ void osborne1_state::machine_reset()
for(drive=0;drive<2;drive++)
floppy_install_load_proc(floppy_get_device(machine(), drive), osborne1_load_proc);
- space->set_direct_update_handler(direct_update_delegate(FUNC(osborne1_state::osborne1_opbase), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(osborne1_state::osborne1_opbase), this));
}
@@ -524,9 +524,9 @@ int osborne1_daisy_device::z80daisy_irq_ack()
osborne1_state *state = machine().driver_data<osborne1_state>();
/* Enable ROM and I/O when IRQ is acknowledged */
UINT8 old_bankswitch = state->m_bankswitch;
- address_space* space = device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *device().machine().device("maincpu")->memory().space(AS_PROGRAM);
- state->osborne1_bankswitch_w( *space, 0, 0 );
+ state->osborne1_bankswitch_w( space, 0, 0 );
state->m_bankswitch = old_bankswitch;
state->m_in_irq_handler = 1;
return 0xF8;
diff --git a/src/mess/machine/partner.c b/src/mess/machine/partner.c
index a9d5b4d8066..19c5b09aca6 100644
--- a/src/mess/machine/partner.c
+++ b/src/mess/machine/partner.c
@@ -125,12 +125,12 @@ WRITE8_MEMBER(partner_state::partner_floppy_w){
static void partner_iomap_bank(running_machine &machine,UINT8 *rom)
{
partner_state *state = machine.driver_data<partner_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch(state->m_win_mem_page) {
case 2 :
// FDD
- space->install_write_handler(0xdc00, 0xddff, write8_delegate(FUNC(partner_state::partner_floppy_w),state));
- space->install_read_handler (0xdc00, 0xddff, read8_delegate(FUNC(partner_state::partner_floppy_r),state));
+ space.install_write_handler(0xdc00, 0xddff, write8_delegate(FUNC(partner_state::partner_floppy_w),state));
+ space.install_read_handler (0xdc00, 0xddff, read8_delegate(FUNC(partner_state::partner_floppy_r),state));
break;
case 4 :
// Timer
@@ -143,28 +143,28 @@ static void partner_iomap_bank(running_machine &machine,UINT8 *rom)
static void partner_bank_switch(running_machine &machine)
{
partner_state *state = machine.driver_data<partner_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = state->memregion("maincpu")->base();
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
- space->install_write_bank(0x0000, 0x07ff, "bank1");
- space->install_write_bank(0x0800, 0x3fff, "bank2");
- space->install_write_bank(0x4000, 0x5fff, "bank3");
- space->install_write_bank(0x6000, 0x7fff, "bank4");
- space->install_write_bank(0x8000, 0x9fff, "bank5");
- space->install_write_bank(0xa000, 0xb7ff, "bank6");
- space->install_write_bank(0xb800, 0xbfff, "bank7");
- space->install_write_bank(0xc000, 0xc7ff, "bank8");
- space->install_write_bank(0xc800, 0xcfff, "bank9");
- space->install_write_bank(0xd000, 0xd7ff, "bank10");
- space->unmap_write(0xdc00, 0xddff);
- space->install_read_bank (0xdc00, 0xddff, "bank11");
- space->unmap_write(0xe000, 0xe7ff);
- space->unmap_write(0xe800, 0xffff);
+ space.install_write_bank(0x0000, 0x07ff, "bank1");
+ space.install_write_bank(0x0800, 0x3fff, "bank2");
+ space.install_write_bank(0x4000, 0x5fff, "bank3");
+ space.install_write_bank(0x6000, 0x7fff, "bank4");
+ space.install_write_bank(0x8000, 0x9fff, "bank5");
+ space.install_write_bank(0xa000, 0xb7ff, "bank6");
+ space.install_write_bank(0xb800, 0xbfff, "bank7");
+ space.install_write_bank(0xc000, 0xc7ff, "bank8");
+ space.install_write_bank(0xc800, 0xcfff, "bank9");
+ space.install_write_bank(0xd000, 0xd7ff, "bank10");
+ space.unmap_write(0xdc00, 0xddff);
+ space.install_read_bank (0xdc00, 0xddff, "bank11");
+ space.unmap_write(0xe000, 0xe7ff);
+ space.unmap_write(0xe800, 0xffff);
// BANK 1 (0x0000 - 0x07ff)
if (state->m_mem_page==0) {
- space->unmap_write(0x0000, 0x07ff);
+ space.unmap_write(0x0000, 0x07ff);
state->membank("bank1")->set_base(rom + 0x10000);
} else {
if (state->m_mem_page==7) {
@@ -187,7 +187,7 @@ static void partner_bank_switch(running_machine &machine)
} else {
if (state->m_mem_page==10) {
//window 1
- space->unmap_write(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
partner_window_1(machine, 3, 0, rom);
} else {
state->membank("bank3")->set_base(ram + 0x4000);
@@ -206,13 +206,13 @@ static void partner_bank_switch(running_machine &machine)
case 5:
case 10:
//window 2
- space->unmap_write(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
partner_window_2(machine, 5, 0, rom);
break;
case 8:
case 9:
//window 1
- space->unmap_write(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
partner_window_1(machine, 5, 0, rom);
break;
case 7:
@@ -228,13 +228,13 @@ static void partner_bank_switch(running_machine &machine)
case 5:
case 10:
//window 2
- space->unmap_write(0xa000, 0xb7ff);
+ space.unmap_write(0xa000, 0xb7ff);
partner_window_2(machine, 6, 0, rom);
break;
case 6:
case 8:
//BASIC
- space->unmap_write(0xa000, 0xb7ff);
+ space.unmap_write(0xa000, 0xb7ff);
state->membank("bank6")->set_base(rom + 0x12000); // BASIC
break;
case 7:
@@ -251,13 +251,13 @@ static void partner_bank_switch(running_machine &machine)
case 5:
case 10:
//window 2
- space->unmap_write(0xb800, 0xbfff);
+ space.unmap_write(0xb800, 0xbfff);
partner_window_2(machine, 7, 0x1800, rom);
break;
case 6:
case 8:
//BASIC
- space->unmap_write(0xb800, 0xbfff);
+ space.unmap_write(0xb800, 0xbfff);
state->membank("bank7")->set_base(rom + 0x13800); // BASIC
break;
case 7:
@@ -275,7 +275,7 @@ static void partner_bank_switch(running_machine &machine)
break;
case 8:
case 10:
- space->unmap_write(0xc000, 0xc7ff);
+ space.unmap_write(0xc000, 0xc7ff);
state->membank("bank8")->set_base(rom + 0x10000);
break;
default:
@@ -291,11 +291,11 @@ static void partner_bank_switch(running_machine &machine)
case 8:
case 9:
// window 2
- space->unmap_write(0xc800, 0xcfff);
+ space.unmap_write(0xc800, 0xcfff);
partner_window_2(machine, 9, 0, rom);
break;
case 10:
- space->unmap_write(0xc800, 0xcfff);
+ space.unmap_write(0xc800, 0xcfff);
state->membank("bank9")->set_base(rom + 0x10800);
break;
default:
@@ -311,7 +311,7 @@ static void partner_bank_switch(running_machine &machine)
case 8:
case 9:
// window 2
- space->unmap_write(0xd000, 0xd7ff);
+ space.unmap_write(0xd000, 0xd7ff);
partner_window_2(machine, 10, 0x0800, rom);
break;
default:
@@ -366,8 +366,8 @@ static WRITE_LINE_DEVICE_HANDLER( hrq_w )
i8257_hlda_w(device, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
I8257_INTERFACE( partner_dma )
{
diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c
index c3a2e8968d0..c48578eeb0e 100644
--- a/src/mess/machine/pc.c
+++ b/src/mess/machine/pc.c
@@ -1405,7 +1405,7 @@ DRIVER_INIT_MEMBER(pc_state,mc1502)
mess_init_pc_common(machine(), 0, NULL, pc_set_irq_line);
}
-static READ8_HANDLER( input_port_0_r ) { return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return space.machine().root_device().ioport("IN0")->read(); }
DRIVER_INIT_MEMBER(pc_state,pc1640)
{
@@ -1422,7 +1422,7 @@ DRIVER_INIT_MEMBER(pc_state,pc_vga)
mess_init_pc_common(machine(), PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
pc_vga_init(machine(), ::input_port_0_r, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
static IRQ_CALLBACK(pc_irq_callback)
diff --git a/src/mess/machine/pc1350.c b/src/mess/machine/pc1350.c
index 4d75ad63d73..c322cf5a111 100644
--- a/src/mess/machine/pc1350.c
+++ b/src/mess/machine/pc1350.c
@@ -99,32 +99,32 @@ static TIMER_CALLBACK(pc1350_power_up)
MACHINE_START( pc1350 )
{
pc1350_state *state = machine.driver_data<pc1350_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
state->m_power = 1;
machine.scheduler().timer_set(attotime::from_seconds(1), FUNC(pc1350_power_up));
- space->install_readwrite_bank(0x6000, 0x6fff, "bank1");
+ space.install_readwrite_bank(0x6000, 0x6fff, "bank1");
state->membank("bank1")->set_base(&machine.device<ram_device>(RAM_TAG)->pointer()[0x0000]);
if (machine.device<ram_device>(RAM_TAG)->size() >= 0x3000)
{
- space->install_readwrite_bank(0x4000, 0x5fff, "bank2");
+ space.install_readwrite_bank(0x4000, 0x5fff, "bank2");
state->membank("bank2")->set_base(&machine.device<ram_device>(RAM_TAG)->pointer()[0x1000]);
}
else
{
- space->nop_readwrite(0x4000, 0x5fff);
+ space.nop_readwrite(0x4000, 0x5fff);
}
if (machine.device<ram_device>(RAM_TAG)->size() >= 0x5000)
{
- space->install_readwrite_bank(0x2000, 0x3fff, "bank3");
+ space.install_readwrite_bank(0x2000, 0x3fff, "bank3");
state->membank("bank3")->set_base(&machine.device<ram_device>(RAM_TAG)->pointer()[0x3000]);
}
else
{
- space->nop_readwrite(0x2000, 0x3fff);
+ space.nop_readwrite(0x2000, 0x3fff);
}
device_t *main_cpu = machine.device("maincpu");
diff --git a/src/mess/machine/pc1403.c b/src/mess/machine/pc1403.c
index 1f1642c5f93..0411bb50f66 100644
--- a/src/mess/machine/pc1403.c
+++ b/src/mess/machine/pc1403.c
@@ -19,7 +19,7 @@
WRITE8_HANDLER(pc1403_asic_write)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
state->m_asic[offset>>9]=data;
switch( (offset>>9) ){
case 0/*0x3800*/:
@@ -39,7 +39,7 @@ WRITE8_HANDLER(pc1403_asic_write)
READ8_HANDLER(pc1403_asic_read)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
UINT8 data=state->m_asic[offset>>9];
switch( (offset>>9) ){
case 0: case 1: case 2:
diff --git a/src/mess/machine/pc_fdc.c b/src/mess/machine/pc_fdc.c
index 8d2055d0161..80feb880aec 100644
--- a/src/mess/machine/pc_fdc.c
+++ b/src/mess/machine/pc_fdc.c
@@ -275,10 +275,10 @@ static WRITE8_HANDLER( pc_fdc_dor_w )
int selected_drive;
int floppy_count;
- floppy_count = floppy_get_count(space->machine());
+ floppy_count = floppy_get_count(space.machine());
if (floppy_count > (fdc->digital_output_register & 0x03))
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), fdc->digital_output_register & 0x03), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), fdc->digital_output_register & 0x03), 1, 0);
fdc->digital_output_register = data;
@@ -286,34 +286,34 @@ static WRITE8_HANDLER( pc_fdc_dor_w )
/* set floppy drive motor state */
if (floppy_count > 0)
- floppy_mon_w(floppy_get_device(space->machine(), 0), !BIT(data, 4));
+ floppy_mon_w(floppy_get_device(space.machine(), 0), !BIT(data, 4));
if (floppy_count > 1)
- floppy_mon_w(floppy_get_device(space->machine(), 1), !BIT(data, 5));
+ floppy_mon_w(floppy_get_device(space.machine(), 1), !BIT(data, 5));
if (floppy_count > 2)
- floppy_mon_w(floppy_get_device(space->machine(), 2), !BIT(data, 6));
+ floppy_mon_w(floppy_get_device(space.machine(), 2), !BIT(data, 6));
if (floppy_count > 3)
- floppy_mon_w(floppy_get_device(space->machine(), 3), !BIT(data, 7));
+ floppy_mon_w(floppy_get_device(space.machine(), 3), !BIT(data, 7));
if ((data>>4) & (1<<selected_drive))
{
if (floppy_count > selected_drive)
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), selected_drive), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), selected_drive), 1, 0);
}
/* changing the DMA enable bit, will affect the terminal count state
from reaching the fdc - if dma is enabled this will send it through
otherwise it will be ignored */
- pc_fdc_set_tc_state(space->machine(), fdc->tc_state);
+ pc_fdc_set_tc_state(space.machine(), fdc->tc_state);
/* changing the DMA enable bit, will affect the dma drq state
from reaching us - if dma is enabled this will send it through
otherwise it will be ignored */
- pc_fdc_hw_dma_drq(pc_get_device(space->machine()), fdc->dma_state);
+ pc_fdc_hw_dma_drq(pc_get_device(space.machine()), fdc->dma_state);
/* changing the DMA enable bit, will affect the irq state
from reaching us - if dma is enabled this will send it through
otherwise it will be ignored */
- pc_fdc_hw_interrupt(pc_get_device(space->machine()), fdc->int_state);
+ pc_fdc_hw_interrupt(pc_get_device(space.machine()), fdc->int_state);
/* reset? */
if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_FDC_ENABLED)==0)
@@ -336,17 +336,17 @@ static WRITE8_HANDLER( pc_fdc_dor_w )
what is not yet clear is if this is a result of the drives ready state
changing...
*/
- upd765_ready_w(pc_get_device(space->machine()),1);
+ upd765_ready_w(pc_get_device(space.machine()),1);
/* set FDC at reset */
- upd765_reset_w(pc_get_device(space->machine()), 1);
+ upd765_reset_w(pc_get_device(space.machine()), 1);
}
else
{
- pc_fdc_set_tc_state(space->machine(), 0);
+ pc_fdc_set_tc_state(space.machine(), 0);
/* release reset on fdc */
- upd765_reset_w(pc_get_device(space->machine()), 0);
+ upd765_reset_w(pc_get_device(space.machine()), 0);
}
}
@@ -381,16 +381,16 @@ static WRITE8_HANDLER( pcjr_fdc_dor_w )
{
int floppy_count;
- floppy_count = floppy_get_count(space->machine());
+ floppy_count = floppy_get_count(space.machine());
/* set floppy drive motor state */
if (floppy_count > 0)
- floppy_mon_w(floppy_get_device(space->machine(), 0), BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
if ( data & 0x01 )
{
if ( floppy_count )
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 0);
}
/* Is the watchdog timer disabled */
@@ -399,7 +399,7 @@ static WRITE8_HANDLER( pcjr_fdc_dor_w )
fdc->watchdog->adjust( attotime::never );
if ( fdc->fdc_interface.pc_fdc_interrupt )
{
- fdc->fdc_interface.pc_fdc_interrupt(space->machine(), 0 );
+ fdc->fdc_interface.pc_fdc_interrupt(space.machine(), 0 );
}
} else {
/* Check for 1->0 watchdog trigger */
@@ -431,17 +431,17 @@ static WRITE8_HANDLER( pcjr_fdc_dor_w )
what is not yet clear is if this is a result of the drives ready state
changing...
*/
- upd765_ready_w(pc_get_device(space->machine()),1);
+ upd765_ready_w(pc_get_device(space.machine()),1);
/* set FDC at reset */
- upd765_reset_w(pc_get_device(space->machine()), 1);
+ upd765_reset_w(pc_get_device(space.machine()), 1);
}
else
{
- pc_fdc_set_tc_state(space->machine(), 0);
+ pc_fdc_set_tc_state(space.machine(), 0);
/* release reset on fdc */
- upd765_reset_w(pc_get_device(space->machine()), 0);
+ upd765_reset_w(pc_get_device(space.machine()), 0);
}
logerror("pcjr_fdc_dor_w: changing dor from %02x to %02x\n", fdc->digital_output_register, data);
@@ -498,22 +498,22 @@ READ8_HANDLER ( pc_fdc_r )
case 3: /* tape drive select? */
break;
case 4:
- data = upd765_status_r(pc_get_device(space->machine()), *space, 0);
+ data = upd765_status_r(pc_get_device(space.machine()), space, 0);
break;
case 5:
- data = upd765_data_r(pc_get_device(space->machine()), *space, offset);
+ data = upd765_data_r(pc_get_device(space.machine()), space, offset);
break;
case 6: /* FDC reserved */
break;
case 7:
- device_t *dev = floppy_get_device(space->machine(), fdc->digital_output_register & 0x03);
+ device_t *dev = floppy_get_device(space.machine(), fdc->digital_output_register & 0x03);
data = fdc->digital_input_register;
if(dev) data |= (!floppy_dskchg_r(dev)<<7);
break;
}
if (LOG_FDC)
- logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) space->machine().firstcpu->pc(), offset, data);
+ logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
return data;
}
@@ -522,9 +522,9 @@ READ8_HANDLER ( pc_fdc_r )
WRITE8_HANDLER ( pc_fdc_w )
{
if (LOG_FDC)
- logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space->machine().firstcpu->pc(), offset, data);
+ logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
- pc_fdc_check_data_rate(space->machine()); // check every time a command may start
+ pc_fdc_check_data_rate(space.machine()); // check every time a command may start
switch(offset)
{
case 0: /* n/a */
@@ -537,10 +537,10 @@ WRITE8_HANDLER ( pc_fdc_w )
/* tape drive select? */
break;
case 4:
- pc_fdc_data_rate_w(space->machine(), data);
+ pc_fdc_data_rate_w(space.machine(), data);
break;
case 5:
- upd765_data_w(pc_get_device(space->machine()), *space, 0, data);
+ upd765_data_w(pc_get_device(space.machine()), space, 0, data);
break;
case 6:
/* FDC reserved */
@@ -555,7 +555,7 @@ WRITE8_HANDLER ( pc_fdc_w )
* 1 0 250 kbps
* 1 1 1000 kbps
*/
- pc_fdc_data_rate_w(space->machine(), data & 3);
+ pc_fdc_data_rate_w(space.machine(), data & 3);
break;
}
}
@@ -563,7 +563,7 @@ WRITE8_HANDLER ( pc_fdc_w )
WRITE8_HANDLER ( pcjr_fdc_w )
{
if (LOG_FDC)
- logerror("pcjr_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space->machine().firstcpu->pc(), offset, data);
+ logerror("pcjr_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
switch(offset)
{
diff --git a/src/mess/machine/pc_joy.c b/src/mess/machine/pc_joy.c
index 5ed975cb067..ccb84871670 100644
--- a/src/mess/machine/pc_joy.c
+++ b/src/mess/machine/pc_joy.c
@@ -17,8 +17,8 @@ READ8_HANDLER ( pc_JOY_r )
{
UINT8 data = 0xf;
int delta;
- attotime new_time = space->machine().time();
- ioport_port *joystick_port = space->machine().root_device().ioport("pc_joy");
+ attotime new_time = space.machine().time();
+ ioport_port *joystick_port = space.machine().root_device().ioport("pc_joy");
delta = ((new_time - JOY_time) * 256 * 1000).seconds;
if (joystick_port != NULL)
@@ -32,10 +32,10 @@ READ8_HANDLER ( pc_JOY_r )
//}
//else
{
- if (space->machine().root_device().ioport("pc_joy_1")->read() < delta) data &= ~0x01;
- if (space->machine().root_device().ioport("pc_joy_2")->read() < delta) data &= ~0x02;
- if (space->machine().root_device().ioport("pc_joy_3")->read() < delta) data &= ~0x04;
- if (space->machine().root_device().ioport("pc_joy_4")->read() < delta) data &= ~0x08;
+ if (space.machine().root_device().ioport("pc_joy_1")->read() < delta) data &= ~0x01;
+ if (space.machine().root_device().ioport("pc_joy_2")->read() < delta) data &= ~0x02;
+ if (space.machine().root_device().ioport("pc_joy_3")->read() < delta) data &= ~0x04;
+ if (space.machine().root_device().ioport("pc_joy_4")->read() < delta) data &= ~0x08;
}
}
else
@@ -50,7 +50,7 @@ READ8_HANDLER ( pc_JOY_r )
WRITE8_HANDLER ( pc_JOY_w )
{
- JOY_time = space->machine().time();
+ JOY_time = space.machine().time();
}
INPUT_PORTS_START( pc_joystick_none )
diff --git a/src/mess/machine/pc_joy.h b/src/mess/machine/pc_joy.h
index b3951ff1c59..28f9bf88d29 100644
--- a/src/mess/machine/pc_joy.h
+++ b/src/mess/machine/pc_joy.h
@@ -26,8 +26,8 @@ public:
pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ioport_constructor device_input_ports() const;
- DECLARE_READ8_MEMBER(joy_port_r) { return pc_JOY_r(&space, offset); }
- DECLARE_WRITE8_MEMBER(joy_port_w) { pc_JOY_w(&space, offset, data); }
+ DECLARE_READ8_MEMBER(joy_port_r) { return pc_JOY_r(space, offset); }
+ DECLARE_WRITE8_MEMBER(joy_port_w) { pc_JOY_w(space, offset, data); }
protected:
virtual void device_start() {}
};
diff --git a/src/mess/machine/pecom.c b/src/mess/machine/pecom.c
index 6fac0a4b32c..43505223283 100644
--- a/src/mess/machine/pecom.c
+++ b/src/mess/machine/pecom.c
@@ -27,15 +27,15 @@ void pecom_state::machine_start()
void pecom_state::machine_reset()
{
UINT8 *rom = machine().root_device().memregion(CDP1802_TAG)->base();
- address_space *space = machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
- space->install_write_bank(0x4000, 0x7fff, "bank2");
- space->unmap_write(0xf000, 0xf7ff);
- space->unmap_write(0xf800, 0xffff);
- space->install_read_bank (0xf000, 0xf7ff, "bank3");
- space->install_read_bank (0xf800, 0xffff, "bank4");
+ space.unmap_write(0x0000, 0x3fff);
+ space.install_write_bank(0x4000, 0x7fff, "bank2");
+ space.unmap_write(0xf000, 0xf7ff);
+ space.unmap_write(0xf800, 0xffff);
+ space.install_read_bank (0xf000, 0xf7ff, "bank3");
+ space.install_read_bank (0xf800, 0xffff, "bank4");
membank("bank1")->set_base(rom + 0x8000);
membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x4000);
membank("bank3")->set_base(rom + 0xf000);
diff --git a/src/mess/machine/pet.c b/src/mess/machine/pet.c
index b4c2284278a..7e98c66d549 100644
--- a/src/mess/machine/pet.c
+++ b/src/mess/machine/pet.c
@@ -405,44 +405,44 @@ const via6522_interface pet_via =
static WRITE8_HANDLER( cbm8096_io_w )
{
- via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
- pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1");
- mc6845_device *mc6845 = space->machine().device<mc6845_device>("crtc");
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ pia6821_device *pia_0 = space.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = space.machine().device<pia6821_device>("pia_1");
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>("crtc");
if (offset < 0x10) ;
- else if (offset < 0x14) pia_0->write(*space, offset & 3, data);
+ else if (offset < 0x14) pia_0->write(space, offset & 3, data);
else if (offset < 0x20) ;
- else if (offset < 0x24) pia_1->write(*space, offset & 3, data);
+ else if (offset < 0x24) pia_1->write(space, offset & 3, data);
else if (offset < 0x40) ;
- else if (offset < 0x50) via_0->write(*space, offset & 0xf, data);
+ else if (offset < 0x50) via_0->write(space, offset & 0xf, data);
else if (offset < 0x80) ;
- else if (offset == 0x80) mc6845->address_w(*space, 0, data);
- else if (offset == 0x81) mc6845->register_w(*space, 0, data);
+ else if (offset == 0x80) mc6845->address_w(space, 0, data);
+ else if (offset == 0x81) mc6845->register_w(space, 0, data);
}
static READ8_HANDLER( cbm8096_io_r )
{
- via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
- pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1");
- mc6845_device *mc6845 = space->machine().device<mc6845_device>("crtc");
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ pia6821_device *pia_0 = space.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = space.machine().device<pia6821_device>("pia_1");
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>("crtc");
int data = 0xff;
if (offset < 0x10) ;
- else if (offset < 0x14) data = pia_0->read(*space, offset & 3);
+ else if (offset < 0x14) data = pia_0->read(space, offset & 3);
else if (offset < 0x20) ;
- else if (offset < 0x24) data = pia_1->read(*space, offset & 3);
+ else if (offset < 0x24) data = pia_1->read(space, offset & 3);
else if (offset < 0x40) ;
- else if (offset < 0x50) data = via_0->read(*space, offset & 0xf);
+ else if (offset < 0x50) data = via_0->read(space, offset & 0xf);
else if (offset < 0x80) ;
- else if (offset == 0x81) data = mc6845->register_r(*space, 0);
+ else if (offset == 0x81) data = mc6845->register_r(space, 0);
return data;
}
static WRITE8_HANDLER( pet80_bank1_w )
{
- pet_state *state = space->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
state->m_pet80_bank1_base[offset] = data;
}
@@ -459,56 +459,56 @@ static WRITE8_HANDLER( pet80_bank1_w )
*/
WRITE8_HANDLER( cbm8096_w )
{
- pet_state *state = space->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
if (data & 0x80)
{
if (data & 0x40)
{
- space->install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
- space->install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
+ space.install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
+ space.install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
}
else
{
- space->install_read_bank(0xe800, 0xefff, "bank7");
+ space.install_read_bank(0xe800, 0xefff, "bank7");
if (!(data & 2))
- space->install_write_bank(0xe800, 0xefff, "bank7");
+ space.install_write_bank(0xe800, 0xefff, "bank7");
else
- space->nop_write(0xe800, 0xefff);
+ space.nop_write(0xe800, 0xefff);
}
if ((data & 2) == 0) {
- space->install_write_bank(0xc000, 0xe7ff, "bank6");
- space->install_write_bank(0xf000, 0xffef, "bank8");
- space->install_write_bank(0xfff1, 0xffff, "bank9");
+ space.install_write_bank(0xc000, 0xe7ff, "bank6");
+ space.install_write_bank(0xf000, 0xffef, "bank8");
+ space.install_write_bank(0xfff1, 0xffff, "bank9");
} else {
- space->nop_write(0xc000, 0xe7ff);
- space->nop_write(0xf000, 0xffef);
- space->nop_write(0xfff1, 0xffff);
+ space.nop_write(0xc000, 0xe7ff);
+ space.nop_write(0xf000, 0xffef);
+ space.nop_write(0xfff1, 0xffff);
}
if (data & 0x20)
{
state->m_pet80_bank1_base = state->m_memory + 0x8000;
state->membank("bank1")->set_base(state->m_pet80_bank1_base);
- space->install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
+ space.install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
}
else
{
if (!(data & 1))
- space->install_write_bank(0x8000, 0x8fff, "bank1");
+ space.install_write_bank(0x8000, 0x8fff, "bank1");
else
- space->nop_write(0x8000, 0x8fff);
+ space.nop_write(0x8000, 0x8fff);
}
if ((data & 1) == 0 ){
- space->install_write_bank(0x9000, 0x9fff, "bank2");
- space->install_write_bank(0xa000, 0xafff, "bank3");
- space->install_write_bank(0xb000, 0xbfff, "bank4");
+ space.install_write_bank(0x9000, 0x9fff, "bank2");
+ space.install_write_bank(0xa000, 0xafff, "bank3");
+ space.install_write_bank(0xb000, 0xbfff, "bank4");
} else {
- space->nop_write(0x9000, 0x9fff);
- space->nop_write(0xa000, 0xafff);
- space->nop_write(0xb000, 0xbfff);
+ space.nop_write(0x9000, 0x9fff);
+ space.nop_write(0xa000, 0xafff);
+ space.nop_write(0xb000, 0xbfff);
}
if (data & 4)
@@ -559,28 +559,28 @@ WRITE8_HANDLER( cbm8096_w )
{
state->m_pet80_bank1_base = state->m_memory + 0x8000;
state->membank("bank1")->set_base(state->m_pet80_bank1_base );
- space->install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
+ space.install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
state->membank("bank2")->set_base(state->m_memory + 0x9000);
- space->unmap_write(0x9000, 0x9fff);
+ space.unmap_write(0x9000, 0x9fff);
state->membank("bank3")->set_base(state->m_memory + 0xa000);
- space->unmap_write(0xa000, 0xafff);
+ space.unmap_write(0xa000, 0xafff);
state->membank("bank4")->set_base(state->m_memory + 0xb000);
- space->unmap_write(0xb000, 0xbfff);
+ space.unmap_write(0xb000, 0xbfff);
state->membank("bank6")->set_base(state->m_memory + 0xc000);
- space->unmap_write(0xc000, 0xe7ff);
+ space.unmap_write(0xc000, 0xe7ff);
- space->install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
- space->install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
+ space.install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
+ space.install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
state->membank("bank8")->set_base(state->m_memory + 0xf000);
- space->unmap_write(0xf000, 0xffef);
+ space.unmap_write(0xf000, 0xffef);
state->membank("bank9")->set_base(state->m_memory + 0xfff1);
- space->unmap_write(0xfff1, 0xffff);
+ space.unmap_write(0xfff1, 0xffff);
}
}
@@ -591,7 +591,7 @@ READ8_HANDLER( superpet_r )
WRITE8_HANDLER( superpet_w )
{
- pet_state *state = space->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
switch (offset)
{
case 0:
@@ -749,7 +749,7 @@ void pet_state::machine_reset()
{
machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xfff0, 0xfff0);
}
- cbm8096_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
+ cbm8096_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
}
//removed cbm_drive_0_config (machine().root_device().ioport("CFG")->read() & 2 ? IEEE : 0, 8);
diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c
index 31140974e4f..97f24d1a25e 100644
--- a/src/mess/machine/pk8020.c
+++ b/src/mess/machine/pk8020.c
@@ -231,7 +231,7 @@ WRITE8_MEMBER(pk8020_state::devices_w)
static void pk8020_set_bank(running_machine &machine,UINT8 data)
{
pk8020_state *state = machine.driver_data<pk8020_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem = state->memregion("maincpu")->base();
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
@@ -239,60 +239,60 @@ static void pk8020_set_bank(running_machine &machine,UINT8 data)
case 0x00 :
{
// ROM
- space->install_read_bank (0x0000, 0x37ff, "bank1");
- space->install_write_bank(0x0000, 0x37ff, "bank2");
+ space.install_read_bank (0x0000, 0x37ff, "bank1");
+ space.install_write_bank(0x0000, 0x37ff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// Keyboard
- space->install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0x3800, 0x39ff, "bank3");
+ space.install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0x3800, 0x39ff, "bank3");
state->membank("bank3")->set_base(ram + 0x3800);
// System reg
- space->install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
// RAM
- space->install_read_bank (0x4000, 0xffff, "bank4");
- space->install_write_bank(0x4000, 0xffff, "bank5");
+ space.install_read_bank (0x4000, 0xffff, "bank4");
+ space.install_write_bank(0x4000, 0xffff, "bank5");
state->membank("bank4")->set_base(ram + 0x4000);
state->membank("bank5")->set_base(ram + 0x4000);
}
break;
case 0x01 : {
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xffff, "bank3");
- space->install_write_bank(0x2000, 0xffff, "bank4");
+ space.install_read_bank (0x2000, 0xffff, "bank3");
+ space.install_write_bank(0x2000, 0xffff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
}
break;
case 0x02 : {
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xffff, "bank3");
- space->install_write_bank(0x4000, 0xffff, "bank4");
+ space.install_read_bank (0x4000, 0xffff, "bank3");
+ space.install_write_bank(0x4000, 0xffff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
}
break;
case 0x03 : {
// RAM
- space->install_read_bank (0x0000, 0xffff, "bank1");
- space->install_write_bank(0x0000, 0xffff, "bank2");
+ space.install_read_bank (0x0000, 0xffff, "bank1");
+ space.install_write_bank(0x0000, 0xffff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
}
@@ -301,545 +301,545 @@ static void pk8020_set_bank(running_machine &machine,UINT8 data)
case 0x05 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xf7ff, "bank3");
- space->install_write_bank(0x2000, 0xf7ff, "bank4");
+ space.install_read_bank (0x2000, 0xf7ff, "bank3");
+ space.install_write_bank(0x2000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x06 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xf7ff, "bank3");
- space->install_write_bank(0x4000, 0xf7ff, "bank4");
+ space.install_read_bank (0x4000, 0xf7ff, "bank3");
+ space.install_write_bank(0x4000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x07 :
{
// RAM
- space->install_read_bank (0x0000, 0xf7ff, "bank1");
- space->install_write_bank(0x0000, 0xf7ff, "bank2");
+ space.install_read_bank (0x0000, 0xf7ff, "bank1");
+ space.install_write_bank(0x0000, 0xf7ff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank3");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank3");
state->membank("bank3")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x08 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// Keyboard
- space->install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0x3800, 0x39ff, "bank3");
+ space.install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0x3800, 0x39ff, "bank3");
state->membank("bank3")->set_base(ram + 0x3800);
// System reg
- space->install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
// RAM
- space->install_read_bank (0x4000, 0xbfff, "bank4");
- space->install_write_bank(0x4000, 0xbfff, "bank5");
+ space.install_read_bank (0x4000, 0xbfff, "bank4");
+ space.install_write_bank(0x4000, 0xbfff, "bank5");
state->membank("bank4")->set_base(ram + 0x4000);
state->membank("bank5")->set_base(ram + 0x4000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x09 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xbfff, "bank3");
- space->install_write_bank(0x2000, 0xbfff, "bank4");
+ space.install_read_bank (0x2000, 0xbfff, "bank3");
+ space.install_write_bank(0x2000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x0A :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xbfff, "bank3");
- space->install_write_bank(0x4000, 0xbfff, "bank4");
+ space.install_read_bank (0x4000, 0xbfff, "bank3");
+ space.install_write_bank(0x4000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x0B :
{
// RAM
- space->install_read_bank (0x0000, 0xbfff, "bank1");
- space->install_write_bank(0x0000, 0xbfff, "bank2");
+ space.install_read_bank (0x0000, 0xbfff, "bank1");
+ space.install_write_bank(0x0000, 0xbfff, "bank2");
state->membank("bank1")->set_base(ram + 0x0000);
state->membank("bank2")->set_base(ram + 0x0000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x0C :
case 0x0D :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0x3fff, "bank3");
- space->install_write_bank(0x2000, 0x3fff, "bank4");
+ space.install_read_bank (0x2000, 0x3fff, "bank3");
+ space.install_write_bank(0x2000, 0x3fff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Video RAM
- space->install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
// RAM
- space->install_read_bank (0x8000, 0xfdff, "bank5");
- space->install_write_bank(0x8000, 0xfdff, "bank6");
+ space.install_read_bank (0x8000, 0xfdff, "bank5");
+ space.install_write_bank(0x8000, 0xfdff, "bank6");
state->membank("bank5")->set_base(ram + 0x8000);
state->membank("bank6")->set_base(ram + 0x8000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x0E :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// Video RAM
- space->install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
// RAM
- space->install_read_bank (0x8000, 0xfdff, "bank5");
- space->install_write_bank(0x8000, 0xfdff, "bank6");
+ space.install_read_bank (0x8000, 0xfdff, "bank5");
+ space.install_write_bank(0x8000, 0xfdff, "bank6");
state->membank("bank5")->set_base(ram + 0x8000);
state->membank("bank6")->set_base(ram + 0x8000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x0F :
{
// RAM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(ram + 0x0000);
state->membank("bank2")->set_base(ram + 0x0000);
// Video RAM
- space->install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
// RAM
- space->install_read_bank (0x8000, 0xfdff, "bank3");
- space->install_write_bank(0x8000, 0xfdff, "bank4");
+ space.install_read_bank (0x8000, 0xfdff, "bank3");
+ space.install_write_bank(0x8000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x8000);
state->membank("bank4")->set_base(ram + 0x8000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x10 :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xf7ff, "bank3");
- space->install_write_bank(0x6000, 0xf7ff, "bank4");
+ space.install_read_bank (0x6000, 0xf7ff, "bank3");
+ space.install_write_bank(0x6000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x11 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xf7ff, "bank3");
- space->install_write_bank(0x2000, 0xf7ff, "bank4");
+ space.install_read_bank (0x2000, 0xf7ff, "bank3");
+ space.install_write_bank(0x2000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x12 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xf7ff, "bank3");
- space->install_write_bank(0x4000, 0xf7ff, "bank4");
+ space.install_read_bank (0x4000, 0xf7ff, "bank3");
+ space.install_write_bank(0x4000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x13 :
{
// RAM
- space->install_read_bank (0x0000, 0xf7ff, "bank1");
- space->install_write_bank(0x0000, 0xf7ff, "bank2");
+ space.install_read_bank (0x0000, 0xf7ff, "bank1");
+ space.install_write_bank(0x0000, 0xf7ff, "bank2");
state->membank("bank1")->set_base(ram + 0x0000);
state->membank("bank2")->set_base(ram + 0x0000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank3");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank3");
state->membank("bank3")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x14 :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xfdff, "bank3");
- space->install_write_bank(0x6000, 0xfdff, "bank4");
+ space.install_read_bank (0x6000, 0xfdff, "bank3");
+ space.install_write_bank(0x6000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x15 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xfdff, "bank3");
- space->install_write_bank(0x2000, 0xfdff, "bank4");
+ space.install_read_bank (0x2000, 0xfdff, "bank3");
+ space.install_write_bank(0x2000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x16 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xfdff, "bank3");
- space->install_write_bank(0x4000, 0xfdff, "bank4");
+ space.install_read_bank (0x4000, 0xfdff, "bank3");
+ space.install_write_bank(0x4000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x17 :
{
// RAM
- space->install_read_bank (0x0000, 0xfdff, "bank1");
- space->install_write_bank(0x0000, 0xfdff, "bank2");
+ space.install_read_bank (0x0000, 0xfdff, "bank1");
+ space.install_write_bank(0x0000, 0xfdff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x18 :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xbeff, "bank3");
- space->install_write_bank(0x6000, 0xbeff, "bank4");
+ space.install_read_bank (0x6000, 0xbeff, "bank3");
+ space.install_write_bank(0x6000, 0xbeff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x19 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xbeff, "bank3");
- space->install_write_bank(0x2000, 0xbeff, "bank4");
+ space.install_read_bank (0x2000, 0xbeff, "bank3");
+ space.install_write_bank(0x2000, 0xbeff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1A :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xbeff, "bank3");
- space->install_write_bank(0x4000, 0xbeff, "bank4");
+ space.install_read_bank (0x4000, 0xbeff, "bank3");
+ space.install_write_bank(0x4000, 0xbeff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1B :
{
// RAM
- space->install_read_bank (0x0000, 0xbeff, "bank1");
- space->install_write_bank(0x0000, 0xbeff, "bank2");
+ space.install_read_bank (0x0000, 0xbeff, "bank1");
+ space.install_write_bank(0x0000, 0xbeff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1C :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xbfff, "bank3");
- space->install_write_bank(0x6000, 0xbfff, "bank4");
+ space.install_read_bank (0x6000, 0xbfff, "bank3");
+ space.install_write_bank(0x6000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1D :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xbfff, "bank3");
- space->install_write_bank(0x2000, 0xbfff, "bank4");
+ space.install_read_bank (0x2000, 0xbfff, "bank3");
+ space.install_write_bank(0x2000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1E :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xbfff, "bank3");
- space->install_write_bank(0x4000, 0xbfff, "bank4");
+ space.install_read_bank (0x4000, 0xbfff, "bank3");
+ space.install_write_bank(0x4000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1F :
{
// RAM
- space->install_read_bank (0x0000, 0xbfff, "bank1");
- space->install_write_bank(0x0000, 0xbfff, "bank2");
+ space.install_read_bank (0x0000, 0xbfff, "bank1");
+ space.install_write_bank(0x0000, 0xbfff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
diff --git a/src/mess/machine/pmd85.c b/src/mess/machine/pmd85.c
index 7367082e900..457bfae527a 100644
--- a/src/mess/machine/pmd85.c
+++ b/src/mess/machine/pmd85.c
@@ -28,20 +28,20 @@ enum {PMD85_1, PMD85_2, PMD85_2A, PMD85_2B, PMD85_3, ALFA, MATO, C2717};
static void pmd851_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x0fff);
- space->nop_write(0x1000, 0x1fff);
- space->unmap_write(0x2000, 0x2fff);
- space->nop_write(0x3000, 0x3fff);
+ space.unmap_write(0x0000, 0x0fff);
+ space.nop_write(0x1000, 0x1fff);
+ space.unmap_write(0x2000, 0x2fff);
+ space.nop_write(0x3000, 0x3fff);
- space->nop_read(0x1000, 0x1fff);
- space->nop_read(0x3000, 0x3fff);
+ space.nop_read(0x1000, 0x1fff);
+ space.nop_read(0x3000, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank3")->set_base(mem + 0x010000);
@@ -53,14 +53,14 @@ static void pmd851_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x0fff, "bank1");
- space->install_write_bank(0x1000, 0x1fff, "bank2");
- space->install_write_bank(0x2000, 0x2fff, "bank3");
- space->install_write_bank(0x3000, 0x3fff, "bank4");
- space->install_write_bank(0x4000, 0x7fff, "bank5");
+ space.install_write_bank(0x0000, 0x0fff, "bank1");
+ space.install_write_bank(0x1000, 0x1fff, "bank2");
+ space.install_write_bank(0x2000, 0x2fff, "bank3");
+ space.install_write_bank(0x3000, 0x3fff, "bank4");
+ space.install_write_bank(0x4000, 0x7fff, "bank5");
- space->install_read_bank(0x1000, 0x1fff, "bank2");
- space->install_read_bank(0x3000, 0x3fff, "bank4");
+ space.install_read_bank(0x1000, 0x1fff, "bank2");
+ space.install_read_bank(0x3000, 0x3fff, "bank4");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x1000);
@@ -73,15 +73,15 @@ static void pmd851_update_memory(running_machine &machine)
static void pmd852a_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x0fff);
- space->unmap_write(0x2000, 0x2fff);
+ space.unmap_write(0x0000, 0x0fff);
+ space.unmap_write(0x2000, 0x2fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(ram + 0x9000);
@@ -97,8 +97,8 @@ static void pmd852a_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x0fff, "bank1");
- space->install_write_bank(0x2000, 0x2fff, "bank3");
+ space.install_write_bank(0x0000, 0x0fff, "bank1");
+ space.install_write_bank(0x2000, 0x2fff, "bank3");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x1000);
@@ -149,16 +149,16 @@ static void pmd853_update_memory(running_machine &machine)
static void alfa_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x0fff);
- space->unmap_write(0x1000, 0x33ff);
- space->nop_write(0x3400, 0x3fff);
+ space.unmap_write(0x0000, 0x0fff);
+ space.unmap_write(0x1000, 0x33ff);
+ space.nop_write(0x3400, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(mem + 0x011000);
@@ -169,9 +169,9 @@ static void alfa_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x0fff, "bank1");
- space->install_write_bank(0x1000, 0x33ff, "bank2");
- space->install_write_bank(0x3400, 0x3fff, "bank3");
+ space.install_write_bank(0x0000, 0x0fff, "bank1");
+ space.install_write_bank(0x1000, 0x33ff, "bank2");
+ space.install_write_bank(0x3400, 0x3fff, "bank3");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x1000);
@@ -183,14 +183,14 @@ static void alfa_update_memory(running_machine &machine)
static void mato_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(ram + 0xc000);
@@ -199,7 +199,7 @@ static void mato_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x4000);
@@ -209,13 +209,13 @@ static void mato_update_memory(running_machine &machine)
static void c2717_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem = state->memregion("maincpu")->base();
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(ram + 0x4000);
@@ -224,7 +224,7 @@ static void c2717_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x4000);
}
diff --git a/src/mess/machine/pokemini.c b/src/mess/machine/pokemini.c
index f9010140ef8..c50f105904a 100644
--- a/src/mess/machine/pokemini.c
+++ b/src/mess/machine/pokemini.c
@@ -395,7 +395,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
static const int timer_to_cycles_fast[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
static const int timer_to_cycles_slow[8] = { 128, 256, 512, 1024, 2048, 4096, 8192, 16384 };
- //logerror( "%0X: Write to hardware address: %02X, %02X\n", space->device() .safe_pc( ), offset, data );
+ //logerror( "%0X: Write to hardware address: %02X, %02X\n", space.device() .safe_pc( ), offset, data );
switch( offset )
{
@@ -1416,7 +1416,7 @@ DEVICE_IMAGE_LOAD( pokemini_cart )
static TIMER_CALLBACK( pokemini_prc_counter_callback )
{
pokemini_state *state = machine.driver_data<pokemini_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
state->m_prc.count++;
/* Check for overflow */
@@ -1440,7 +1440,7 @@ static TIMER_CALLBACK( pokemini_prc_counter_callback )
UINT8 tile = state->m_p_ram[ 0x360 + ( y * state->m_prc.map_size_x ) + x ];
int i;
for( i = 0; i < 8; i++ ) {
- state->m_p_ram[ ( y * 96 ) + ( x * 8 ) + i ] = space->read_byte( state->m_prc.bg_tiles + ( tile * 8 ) + i );
+ state->m_p_ram[ ( y * 96 ) + ( x * 8 ) + i ] = space.read_byte( state->m_prc.bg_tiles + ( tile * 8 ) + i );
}
}
}
@@ -1471,8 +1471,8 @@ static TIMER_CALLBACK( pokemini_prc_counter_callback )
int rel_x = ( spr_flag & 0x01 ) ? 15 - i : i;
UINT32 s = spr_base + ( ( rel_x & 0x08 ) << 2 ) + ( rel_x & 0x07 );
- mask = ~ ( space->read_byte( s ) | ( space->read_byte( s + 8 ) << 8 ) );
- gfx = space->read_byte( s + 16 ) | ( space->read_byte( s + 24 ) << 8 );
+ mask = ~ ( space.read_byte( s ) | ( space.read_byte( s + 8 ) << 8 ) );
+ gfx = space.read_byte( s + 16 ) | ( space.read_byte( s + 24 ) << 8 );
/* Are the colors inverted? */
if ( spr_flag & 0x04 )
diff --git a/src/mess/machine/poly88.c b/src/mess/machine/poly88.c
index 2174bb7ee31..30533997c0d 100644
--- a/src/mess/machine/poly88.c
+++ b/src/mess/machine/poly88.c
@@ -258,7 +258,7 @@ WRITE8_MEMBER(poly88_state::poly88_intr_w)
SNAPSHOT_LOAD( poly88 )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8* data= auto_alloc_array(image.device().machine(), UINT8, snapshot_size);
UINT16 recordNum;
UINT16 recordLen;
@@ -290,7 +290,7 @@ SNAPSHOT_LOAD( poly88 )
switch(recordType) {
case 0 :
/* 00 Absolute */
- memcpy(space->get_read_ptr(address ), data + pos ,recordLen);
+ memcpy(space.get_read_ptr(address ), data + pos ,recordLen);
break;
case 1 :
/* 01 Comment */
diff --git a/src/mess/machine/pp01.c b/src/mess/machine/pp01.c
index c6e98560f84..c34f91aecf4 100644
--- a/src/mess/machine/pp01.c
+++ b/src/mess/machine/pp01.c
@@ -85,7 +85,7 @@ static void pp01_set_memory(running_machine &machine,UINT8 block, UINT8 data)
{
pp01_state *state = machine.driver_data<pp01_state>();
UINT8 *mem = state->memregion("maincpu")->base();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 startaddr = block*0x1000;
UINT16 endaddr = ((block+1)*0x1000)-1;
UINT8 blocknum = block + 1;
@@ -93,40 +93,40 @@ static void pp01_set_memory(running_machine &machine,UINT8 block, UINT8 data)
sprintf(bank,"bank%d",blocknum);
if (data>=0xE0 && data<=0xEF) {
// This is RAM
- space->install_read_bank (startaddr, endaddr, bank);
+ space.install_read_bank (startaddr, endaddr, bank);
switch(data) {
case 0xe6 :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_1_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_1_w),state));
break;
case 0xe7 :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_2_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_2_w),state));
break;
case 0xea :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_1_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_1_w),state));
break;
case 0xeb :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_2_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_2_w),state));
break;
case 0xee :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_1_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_1_w),state));
break;
case 0xef :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_2_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_2_w),state));
break;
default :
- space->install_write_bank(startaddr, endaddr, bank);
+ space.install_write_bank(startaddr, endaddr, bank);
break;
}
state->membank(bank)->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + (data & 0x0F)* 0x1000);
} else if (data>=0xF8) {
- space->install_read_bank (startaddr, endaddr, bank);
- space->unmap_write(startaddr, endaddr);
+ space.install_read_bank (startaddr, endaddr, bank);
+ space.unmap_write(startaddr, endaddr);
state->membank(bank)->set_base(mem + ((data & 0x0F)-8)* 0x1000+0x10000);
} else {
logerror("%02x %02x\n",block,data);
- space->unmap_readwrite (startaddr, endaddr);
+ space.unmap_readwrite (startaddr, endaddr);
}
}
diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c
index 275a4570cab..f30cd7011c5 100644
--- a/src/mess/machine/primo.c
+++ b/src/mess/machine/primo.c
@@ -47,23 +47,23 @@ INTERRUPT_GEN( primo_vblank_interrupt )
static void primo_update_memory(running_machine &machine)
{
primo_state *state = machine.driver_data<primo_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch (state->m_port_FD & 0x03)
{
case 0x00: /* Original ROM */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()+0x10000);
break;
case 0x01: /* EPROM extension 1 */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()+0x14000);
break;
case 0x02: /* RAM */
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
break;
case 0x03: /* EPROM extension 2 */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(state->memregion("maincpu")->base()+0x18000);
break;
}
diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c
index 21f57829315..01b7e70d555 100644
--- a/src/mess/machine/radio86.c
+++ b/src/mess/machine/radio86.c
@@ -140,8 +140,8 @@ static WRITE_LINE_DEVICE_HANDLER( hrq_w )
i8257_hlda_w(device, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
I8257_INTERFACE( radio86_dma )
{
diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c
index e3ff3805861..b406b89c9b7 100644
--- a/src/mess/machine/rmnimbus.c
+++ b/src/mess/machine/rmnimbus.c
@@ -1346,10 +1346,10 @@ static void nimbus_debug(running_machine &machine, int ref, int params, const ch
static int instruction_hook(device_t &device, offs_t curpc)
{
rmnimbus_state *state = device.machine().driver_data<rmnimbus_state>();
- address_space *space = device.memory().space(AS_PROGRAM);
+ address_space &space = *device.memory().space(AS_PROGRAM);
UINT8 *addr_ptr;
- addr_ptr = (UINT8*)space->get_read_ptr(curpc);
+ addr_ptr = (UINT8*)space.get_read_ptr(curpc);
if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD))
{
@@ -1713,19 +1713,19 @@ static void decode_subbios(device_t *device,offs_t pc, UINT8 raw_flag)
}
}
-static void *get_dssi_ptr(address_space *space, UINT16 ds, UINT16 si)
+static void *get_dssi_ptr(address_space &space, UINT16 ds, UINT16 si)
{
int addr;
addr=((ds<<4)+si);
// OUTPUT_SEGOFS("DS:SI",ds,si);
- return space->get_read_ptr(addr);
+ return space.get_read_ptr(addr);
}
static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *params;
int count;
@@ -1743,7 +1743,7 @@ static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 ra
static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *addr_ptr;
t_area_params *area_params;
@@ -1755,7 +1755,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT
if (!raw_flag)
OUTPUT_SEGOFS("SegBrush:OfsBrush",area_params->seg_brush,area_params->ofs_brush);
- brush=(t_nimbus_brush *)space->get_read_ptr(LINEAR_ADDR(area_params->seg_brush,area_params->ofs_brush));
+ brush=(t_nimbus_brush *)space.get_read_ptr(LINEAR_ADDR(area_params->seg_brush,area_params->ofs_brush));
if(raw_flag)
{
@@ -1776,7 +1776,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT
OUTPUT_SEGOFS("SegData:OfsData",area_params->seg_data,area_params->ofs_data);
}
- addr_ptr = (UINT16 *)space->get_read_ptr(LINEAR_ADDR(area_params->seg_data,area_params->ofs_data));
+ addr_ptr = (UINT16 *)space.get_read_ptr(LINEAR_ADDR(area_params->seg_data,area_params->ofs_data));
for(cocount=0; cocount < area_params->count; cocount++)
{
if(raw_flag)
@@ -1796,7 +1796,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT
static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT8 *char_ptr;
t_plot_string_params *plot_string_params;
@@ -1812,7 +1812,7 @@ static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UIN
logerror("x=%d, y=%d, length=%d\n",plot_string_params->x,plot_string_params->y,plot_string_params->length);
- char_ptr=(UINT8*)space->get_read_ptr(LINEAR_ADDR(plot_string_params->seg_data,plot_string_params->ofs_data));
+ char_ptr=(UINT8*)space.get_read_ptr(LINEAR_ADDR(plot_string_params->seg_data,plot_string_params->ofs_data));
if (plot_string_params->length==0xFFFF)
logerror("%s",char_ptr);
@@ -1825,7 +1825,7 @@ static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UIN
static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *new_colours;
int colour;
new_colours=(UINT16 *)get_dssi_ptr(space,ds,si);
@@ -1842,7 +1842,7 @@ static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UI
static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *params;
params=(UINT16 *)get_dssi_ptr(space,ds,si);
@@ -1856,7 +1856,7 @@ static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UIN
static void decode_dssi_f_rw_sectors(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *params;
int param_no;
@@ -1992,7 +1992,7 @@ static const nimbus_blocks ramblocks[] =
static void nimbus_bank_memory(running_machine &machine)
{
rmnimbus_state *state = machine.driver_data<rmnimbus_state>();
- address_space *space = machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
int ramsize = machine.device<ram_device>(RAM_TAG)->size();
int ramblock = 0;
int blockno;
@@ -2049,12 +2049,12 @@ static void nimbus_bank_memory(running_machine &machine)
map_base=(ramsel==0x07) ? map_blocks[map_blockno] : &map_blocks[map_blockno][block_ofs*1024];
state->membank(bank)->set_base(map_base);
- space->install_readwrite_bank(memmap[blockno].start, memmap[blockno].end, bank);
+ space.install_readwrite_bank(memmap[blockno].start, memmap[blockno].end, bank);
//if(LOG_RAM) logerror(", base=%X\n",(int)map_base);
}
else
{
- space->nop_readwrite(memmap[blockno].start, memmap[blockno].end);
+ space.nop_readwrite(memmap[blockno].start, memmap[blockno].end);
if(LOG_RAM) logerror("NOP\n");
}
}
diff --git a/src/mess/machine/s3c44b0.c b/src/mess/machine/s3c44b0.c
index a23d564936f..c27f92e5170 100644
--- a/src/mess/machine/s3c44b0.c
+++ b/src/mess/machine/s3c44b0.c
@@ -2001,10 +2001,10 @@ SCREEN_UPDATE_RGB32( s3c44b0 )
DEVICE_START( s3c44b0 )
{
running_machine &machine = device->machine();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM);
s3c44b0_t *s3c44b0 = get_token( device);
s3c44b0->iface = (const s3c44b0_interface *)device->static_config();
- s3c44b0->space = space;
+ s3c44b0->space = &space;
s3c44b0->cpu = downcast<cpu_device *>(device->machine().device( "maincpu"));
for (int i = 0; i < 6; i++) s3c44b0->pwm.timer[i] = machine.scheduler().timer_alloc(FUNC(s3c44b0_pwm_timer_exp), (void*)device);
for (int i = 0; i < 2; i++) s3c44b0->uart[i].timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_uart_timer_exp), (void*)device);
@@ -2016,23 +2016,23 @@ DEVICE_START( s3c44b0 )
s3c44b0->adc.timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_adc_timer_exp), (void*)device);
s3c44b0->iic.timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_iic_timer_exp), (void*)device);
s3c44b0->iis.timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_iis_timer_exp), (void*)device);
- space->install_legacy_readwrite_handler( *device, 0x01c00000, 0x01c0000b, 0, 0, FUNC(s3c44b0_cpuwrap_r), FUNC(s3c44b0_cpuwrap_w));
- space->install_legacy_readwrite_handler( *device, 0x01d00000, 0x01d0002b, 0, 0, FUNC(s3c44b0_uart_0_r), FUNC(s3c44b0_uart_0_w));
- space->install_legacy_readwrite_handler( *device, 0x01d04000, 0x01d0402b, 0, 0, FUNC(s3c44b0_uart_1_r), FUNC(s3c44b0_uart_1_w));
- space->install_legacy_readwrite_handler( *device, 0x01d14000, 0x01d14013, 0, 0, FUNC(s3c44b0_sio_r), FUNC(s3c44b0_sio_w));
- space->install_legacy_readwrite_handler( *device, 0x01d18000, 0x01d18013, 0, 0, FUNC(s3c44b0_iis_r), FUNC(s3c44b0_iis_w));
- space->install_legacy_readwrite_handler( *device, 0x01d20000, 0x01d20057, 0, 0, FUNC(s3c44b0_gpio_r), FUNC(s3c44b0_gpio_w));
- space->install_legacy_readwrite_handler( *device, 0x01d30000, 0x01d3000b, 0, 0, FUNC(s3c44b0_wdt_r), FUNC(s3c44b0_wdt_w));
- space->install_legacy_readwrite_handler( *device, 0x01d40000, 0x01d4000b, 0, 0, FUNC(s3c44b0_adc_r), FUNC(s3c44b0_adc_w));
- space->install_legacy_readwrite_handler( *device, 0x01d50000, 0x01d5004f, 0, 0, FUNC(s3c44b0_pwm_r), FUNC(s3c44b0_pwm_w));
- space->install_legacy_readwrite_handler( *device, 0x01d60000, 0x01d6000f, 0, 0, FUNC(s3c44b0_iic_r), FUNC(s3c44b0_iic_w));
- space->install_legacy_readwrite_handler( *device, 0x01d80000, 0x01d8000f, 0, 0, FUNC(s3c44b0_clkpow_r), FUNC(s3c44b0_clkpow_w));
- space->install_legacy_readwrite_handler( *device, 0x01e00000, 0x01e0003f, 0, 0, FUNC(s3c44b0_irq_r), FUNC(s3c44b0_irq_w));
- space->install_legacy_readwrite_handler( *device, 0x01e80000, 0x01e8001b, 0, 0, FUNC(s3c44b0_zdma_0_r), FUNC(s3c44b0_zdma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x01e80020, 0x01e8003b, 0, 0, FUNC(s3c44b0_zdma_1_r), FUNC(s3c44b0_zdma_1_w));
- space->install_legacy_readwrite_handler( *device, 0x01f00000, 0x01f00047, 0, 0, FUNC(s3c44b0_lcd_r), FUNC(s3c44b0_lcd_w));
- space->install_legacy_readwrite_handler( *device, 0x01f80000, 0x01f8001b, 0, 0, FUNC(s3c44b0_bdma_0_r), FUNC(s3c44b0_bdma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x01f80020, 0x01f8003b, 0, 0, FUNC(s3c44b0_bdma_1_r), FUNC(s3c44b0_bdma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x01c00000, 0x01c0000b, 0, 0, FUNC(s3c44b0_cpuwrap_r), FUNC(s3c44b0_cpuwrap_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d00000, 0x01d0002b, 0, 0, FUNC(s3c44b0_uart_0_r), FUNC(s3c44b0_uart_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d04000, 0x01d0402b, 0, 0, FUNC(s3c44b0_uart_1_r), FUNC(s3c44b0_uart_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d14000, 0x01d14013, 0, 0, FUNC(s3c44b0_sio_r), FUNC(s3c44b0_sio_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d18000, 0x01d18013, 0, 0, FUNC(s3c44b0_iis_r), FUNC(s3c44b0_iis_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d20000, 0x01d20057, 0, 0, FUNC(s3c44b0_gpio_r), FUNC(s3c44b0_gpio_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d30000, 0x01d3000b, 0, 0, FUNC(s3c44b0_wdt_r), FUNC(s3c44b0_wdt_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d40000, 0x01d4000b, 0, 0, FUNC(s3c44b0_adc_r), FUNC(s3c44b0_adc_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d50000, 0x01d5004f, 0, 0, FUNC(s3c44b0_pwm_r), FUNC(s3c44b0_pwm_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d60000, 0x01d6000f, 0, 0, FUNC(s3c44b0_iic_r), FUNC(s3c44b0_iic_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d80000, 0x01d8000f, 0, 0, FUNC(s3c44b0_clkpow_r), FUNC(s3c44b0_clkpow_w));
+ space.install_legacy_readwrite_handler( *device, 0x01e00000, 0x01e0003f, 0, 0, FUNC(s3c44b0_irq_r), FUNC(s3c44b0_irq_w));
+ space.install_legacy_readwrite_handler( *device, 0x01e80000, 0x01e8001b, 0, 0, FUNC(s3c44b0_zdma_0_r), FUNC(s3c44b0_zdma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x01e80020, 0x01e8003b, 0, 0, FUNC(s3c44b0_zdma_1_r), FUNC(s3c44b0_zdma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x01f00000, 0x01f00047, 0, 0, FUNC(s3c44b0_lcd_r), FUNC(s3c44b0_lcd_w));
+ space.install_legacy_readwrite_handler( *device, 0x01f80000, 0x01f8001b, 0, 0, FUNC(s3c44b0_bdma_0_r), FUNC(s3c44b0_bdma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x01f80020, 0x01f8003b, 0, 0, FUNC(s3c44b0_bdma_1_r), FUNC(s3c44b0_bdma_1_w));
}
const device_type S3C44B0 = &device_creator<s3c44b0_device>;
diff --git a/src/mess/machine/samcoupe.c b/src/mess/machine/samcoupe.c
index bedd0fef7ec..49fd966fa43 100644
--- a/src/mess/machine/samcoupe.c
+++ b/src/mess/machine/samcoupe.c
@@ -22,42 +22,42 @@
MEMORY BANKING
***************************************************************************/
-static void samcoupe_update_bank(address_space *space, int bank_num, UINT8 *memory, int is_readonly)
+static void samcoupe_update_bank(address_space &space, int bank_num, UINT8 *memory, int is_readonly)
{
char bank[10];
sprintf(bank,"bank%d",bank_num);
- samcoupe_state *state = space->machine().driver_data<samcoupe_state>();
+ samcoupe_state *state = space.machine().driver_data<samcoupe_state>();
if (memory)
{
state->membank(bank)->set_base(memory);
- space->install_read_bank (((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
+ space.install_read_bank (((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
if (is_readonly) {
- space->unmap_write(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
+ space.unmap_write(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
} else {
- space->install_write_bank(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
+ space.install_write_bank(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
}
} else {
- space->nop_readwrite(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
+ space.nop_readwrite(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
}
}
-static void samcoupe_install_ext_mem(address_space *space)
+static void samcoupe_install_ext_mem(address_space &space)
{
- samcoupe_state *state = space->machine().driver_data<samcoupe_state>();
+ samcoupe_state *state = space.machine().driver_data<samcoupe_state>();
UINT8 *mem;
/* bank 3 */
- if (state->m_lext >> 6 < space->machine().device<ram_device>(RAM_TAG)->size() >> 20)
- mem = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(space->machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_lext >> 6) * 0x100000 + (state->m_lext & 0x3f) * 0x4000];
+ if (state->m_lext >> 6 < space.machine().device<ram_device>(RAM_TAG)->size() >> 20)
+ mem = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(space.machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_lext >> 6) * 0x100000 + (state->m_lext & 0x3f) * 0x4000];
else
mem = NULL;
samcoupe_update_bank(space, 3, mem, FALSE);
/* bank 4 */
- if (state->m_hext >> 6 < space->machine().device<ram_device>(RAM_TAG)->size() >> 20)
- mem = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(space->machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_hext >> 6) * 0x100000 + (state->m_hext & 0x3f) * 0x4000];
+ if (state->m_hext >> 6 < space.machine().device<ram_device>(RAM_TAG)->size() >> 20)
+ mem = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(space.machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_hext >> 6) * 0x100000 + (state->m_hext & 0x3f) * 0x4000];
else
mem = NULL;
@@ -65,10 +65,10 @@ static void samcoupe_install_ext_mem(address_space *space)
}
-void samcoupe_update_memory(address_space *space)
+void samcoupe_update_memory(address_space &space)
{
- samcoupe_state *state = space->machine().driver_data<samcoupe_state>();
- const int PAGE_MASK = ((space->machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) / 0x4000) - 1;
+ samcoupe_state *state = space.machine().driver_data<samcoupe_state>();
+ const int PAGE_MASK = ((space.machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) / 0x4000) - 1;
UINT8 *rom = state->memregion("maincpu")->base();
UINT8 *memory;
int is_readonly;
@@ -77,7 +77,7 @@ void samcoupe_update_memory(address_space *space)
if (state->m_lmpr & LMPR_RAM0) /* Is ram paged in at bank 1 */
{
if ((state->m_lmpr & 0x1F) <= PAGE_MASK)
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_lmpr & PAGE_MASK) * 0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_lmpr & PAGE_MASK) * 0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
is_readonly = FALSE;
@@ -92,7 +92,7 @@ void samcoupe_update_memory(address_space *space)
/* BANK2 */
if (((state->m_lmpr + 1) & 0x1f) <= PAGE_MASK)
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_lmpr + 1) & PAGE_MASK) * 0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_lmpr + 1) & PAGE_MASK) * 0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
samcoupe_update_bank(space, 2, memory, FALSE);
@@ -106,7 +106,7 @@ void samcoupe_update_memory(address_space *space)
{
/* BANK3 */
if ((state->m_hmpr & 0x1F) <= PAGE_MASK )
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_hmpr & PAGE_MASK)*0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_hmpr & PAGE_MASK)*0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
samcoupe_update_bank(space, 3, memory, FALSE);
@@ -121,7 +121,7 @@ void samcoupe_update_memory(address_space *space)
else
{
if (((state->m_hmpr + 1) & 0x1f) <= PAGE_MASK)
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_hmpr + 1) & PAGE_MASK) * 0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_hmpr + 1) & PAGE_MASK) * 0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
is_readonly = FALSE;
@@ -131,15 +131,15 @@ void samcoupe_update_memory(address_space *space)
/* video memory location */
if (state->m_vmpr & 0x40) /* if bit set in 2 bank screen mode */
- state->m_videoram = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1e) & PAGE_MASK) * 0x4000];
+ state->m_videoram = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1e) & PAGE_MASK) * 0x4000];
else
- state->m_videoram = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1f) & PAGE_MASK) * 0x4000];
+ state->m_videoram = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1f) & PAGE_MASK) * 0x4000];
}
WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
if (offset & 1)
m_hext = data;
@@ -160,17 +160,17 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w)
static READ8_DEVICE_HANDLER( samcoupe_rtc_r )
{
- address_space *spaceio = device->machine().device("maincpu")->memory().space(AS_IO);
+ address_space &spaceio = *device->machine().device("maincpu")->memory().space(AS_IO);
msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
- return rtc->read(*spaceio,offset >> 12);
+ return rtc->read(spaceio,offset >> 12);
}
static WRITE8_DEVICE_HANDLER( samcoupe_rtc_w )
{
- address_space *spaceio = device->machine().device("maincpu")->memory().space(AS_IO);
+ address_space &spaceio = *device->machine().device("maincpu")->memory().space(AS_IO);
msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
- rtc->write(*spaceio,offset >> 12, data);
+ rtc->write(spaceio,offset >> 12, data);
}
@@ -244,8 +244,8 @@ void samcoupe_state::machine_start()
void samcoupe_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- address_space *spaceio = machine().device("maincpu")->memory().space(AS_IO);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &spaceio = *machine().device("maincpu")->memory().space(AS_IO);
/* initialize state */
m_lmpr = 0x0f; /* ROM0 paged in, ROM1 paged out RAM Banks */
@@ -263,12 +263,12 @@ void samcoupe_state::machine_reset()
{
/* install RTC */
device_t *rtc = machine().device("sambus_clock");
- spaceio->install_legacy_readwrite_handler(*rtc, 0xef, 0xef, 0xffff, 0xff00, FUNC(samcoupe_rtc_r), FUNC(samcoupe_rtc_w));
+ spaceio.install_legacy_readwrite_handler(*rtc, 0xef, 0xef, 0xffff, 0xff00, FUNC(samcoupe_rtc_r), FUNC(samcoupe_rtc_w));
}
else
{
/* no RTC support */
- spaceio->unmap_readwrite(0xef, 0xef, 0xffff, 0xff00);
+ spaceio.unmap_readwrite(0xef, 0xef, 0xffff, 0xff00);
}
/* initialize memory */
diff --git a/src/mess/machine/sgi.c b/src/mess/machine/sgi.c
index bf4e9611a62..4f439ccb856 100644
--- a/src/mess/machine/sgi.c
+++ b/src/mess/machine/sgi.c
@@ -78,181 +78,181 @@ READ32_HANDLER( sgi_mc_r )
{
case 0x0000:
case 0x0004:
- //verboselog( space->machine(), 3, "CPU Control 0 Read: %08x (%08x)\n", pMC->nCPUControl0, mem_mask );
+ //verboselog( space.machine(), 3, "CPU Control 0 Read: %08x (%08x)\n", pMC->nCPUControl0, mem_mask );
return pMC->nCPUControl0;
case 0x0008:
case 0x000c:
- //verboselog( space->machine(), 2, "CPU Control 1 Read: %08x (%08x)\n", pMC->nCPUControl1, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Control 1 Read: %08x (%08x)\n", pMC->nCPUControl1, mem_mask );
return pMC->nCPUControl1;
case 0x0010:
case 0x0014:
- //verboselog( space->machine(), 2, "Watchdog Timer Read: %08x (%08x)\n", pMC->nWatchdog, mem_mask );
+ //verboselog( space.machine(), 2, "Watchdog Timer Read: %08x (%08x)\n", pMC->nWatchdog, mem_mask );
return pMC->nWatchdog;
case 0x0018:
case 0x001c:
- //verboselog( space->machine(), 2, "System ID Read: %08x (%08x)\n", pMC->nSysID, mem_mask );
+ //verboselog( space.machine(), 2, "System ID Read: %08x (%08x)\n", pMC->nSysID, mem_mask );
return pMC->nSysID;
case 0x0028:
case 0x002c:
- //verboselog( space->machine(), 2, "RPSS Divider Read: %08x (%08x)\n", pMC->nRPSSDiv, mem_mask );
+ //verboselog( space.machine(), 2, "RPSS Divider Read: %08x (%08x)\n", pMC->nRPSSDiv, mem_mask );
return pMC->nRPSSDiv;
case 0x0030:
case 0x0034:
- //verboselog( space->machine(), 2, "R4000 EEPROM Read\n" );
+ //verboselog( space.machine(), 2, "R4000 EEPROM Read\n" );
return 0;
case 0x0040:
case 0x0044:
- //verboselog( space->machine(), 2, "Refresh Count Preload Read: %08x (%08x)\n", pMC->nRefCntPreload, mem_mask );
+ //verboselog( space.machine(), 2, "Refresh Count Preload Read: %08x (%08x)\n", pMC->nRefCntPreload, mem_mask );
return pMC->nRefCntPreload;
case 0x0048:
case 0x004c:
- //verboselog( space->machine(), 2, "Refresh Count Read: %08x (%08x)\n", pMC->nRefCnt, mem_mask );
+ //verboselog( space.machine(), 2, "Refresh Count Read: %08x (%08x)\n", pMC->nRefCnt, mem_mask );
return pMC->nRefCnt;
case 0x0080:
case 0x0084:
- //verboselog( space->machine(), 2, "GIO64 Arbitration Param Read: %08x (%08x)\n", pMC->nGIO64ArbParam, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Arbitration Param Read: %08x (%08x)\n", pMC->nGIO64ArbParam, mem_mask );
return pMC->nGIO64ArbParam;
case 0x0088:
case 0x008c:
- //verboselog( space->machine(), 2, "Arbiter CPU Time Read: %08x (%08x)\n", pMC->nArbCPUTime, mem_mask );
+ //verboselog( space.machine(), 2, "Arbiter CPU Time Read: %08x (%08x)\n", pMC->nArbCPUTime, mem_mask );
return pMC->nArbCPUTime;
case 0x0098:
case 0x009c:
- //verboselog( space->machine(), 2, "Arbiter Long Burst Time Read: %08x (%08x)\n", pMC->nArbBurstTime, mem_mask );
+ //verboselog( space.machine(), 2, "Arbiter Long Burst Time Read: %08x (%08x)\n", pMC->nArbBurstTime, mem_mask );
return pMC->nArbBurstTime;
case 0x00c0:
case 0x00c4:
- //verboselog( space->machine(), 3, "Memory Configuration Register 0 Read: %08x (%08x)\n", pMC->nMemCfg0, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 0 Read: %08x (%08x)\n", pMC->nMemCfg0, mem_mask );
return pMC->nMemCfg0;
case 0x00c8:
case 0x00cc:
- //verboselog( space->machine(), 3, "Memory Configuration Register 1 Read: %08x (%08x)\n", pMC->nMemCfg1, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 1 Read: %08x (%08x)\n", pMC->nMemCfg1, mem_mask );
return pMC->nMemCfg1;
case 0x00d0:
case 0x00d4:
- //verboselog( space->machine(), 2, "CPU Memory Access Config Params Read: %08x (%08x)\n", pMC->nCPUMemAccCfg, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Memory Access Config Params Read: %08x (%08x)\n", pMC->nCPUMemAccCfg, mem_mask );
return pMC->nCPUMemAccCfg;
case 0x00d8:
case 0x00dc:
- //verboselog( space->machine(), 2, "GIO Memory Access Config Params Read: %08x (%08x)\n", pMC->nGIOMemAccCfg, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Memory Access Config Params Read: %08x (%08x)\n", pMC->nGIOMemAccCfg, mem_mask );
return pMC->nGIOMemAccCfg;
case 0x00e0:
case 0x00e4:
- //verboselog( space->machine(), 2, "CPU Error Address Read: %08x (%08x)\n", pMC->nCPUErrorAddr, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Error Address Read: %08x (%08x)\n", pMC->nCPUErrorAddr, mem_mask );
return pMC->nCPUErrorAddr;
case 0x00e8:
case 0x00ec:
- //verboselog( space->machine(), 2, "CPU Error Status Read: %08x (%08x)\n", pMC->nCPUErrorStatus, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Error Status Read: %08x (%08x)\n", pMC->nCPUErrorStatus, mem_mask );
return pMC->nCPUErrorStatus;
case 0x00f0:
case 0x00f4:
- //verboselog( space->machine(), 2, "GIO Error Address Read: %08x (%08x)\n", pMC->nGIOErrorAddr, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Error Address Read: %08x (%08x)\n", pMC->nGIOErrorAddr, mem_mask );
return pMC->nGIOErrorAddr;
case 0x00f8:
case 0x00fc:
- //verboselog( space->machine(), 2, "GIO Error Status Read: %08x (%08x)\n", pMC->nGIOErrorStatus, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Error Status Read: %08x (%08x)\n", pMC->nGIOErrorStatus, mem_mask );
return pMC->nGIOErrorStatus;
case 0x0100:
case 0x0104:
- //verboselog( space->machine(), 2, "System Semaphore Read: %08x (%08x)\n", pMC->nSysSemaphore, mem_mask );
+ //verboselog( space.machine(), 2, "System Semaphore Read: %08x (%08x)\n", pMC->nSysSemaphore, mem_mask );
return pMC->nSysSemaphore;
case 0x0108:
case 0x010c:
- //verboselog( space->machine(), 2, "GIO Lock Read: %08x (%08x)\n", pMC->nGIOLock, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Lock Read: %08x (%08x)\n", pMC->nGIOLock, mem_mask );
return pMC->nGIOLock;
case 0x0110:
case 0x0114:
- //verboselog( space->machine(), 2, "EISA Lock Read: %08x (%08x)\n", pMC->nEISALock, mem_mask );
+ //verboselog( space.machine(), 2, "EISA Lock Read: %08x (%08x)\n", pMC->nEISALock, mem_mask );
return pMC->nEISALock;
case 0x0150:
case 0x0154:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Mask Read: %08x (%08x)\n", pMC->nGIO64TransMask, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Mask Read: %08x (%08x)\n", pMC->nGIO64TransMask, mem_mask );
return pMC->nGIO64TransMask;
case 0x0158:
case 0x015c:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Substitution Bits Read: %08x (%08x)\n", pMC->nGIO64Subst, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Substitution Bits Read: %08x (%08x)\n", pMC->nGIO64Subst, mem_mask );
return pMC->nGIO64Subst;
case 0x0160:
case 0x0164:
- //verboselog( space->machine(), 2, "DMA Interrupt Cause: %08x (%08x)\n", pMC->nDMAIntrCause, mem_mask );
+ //verboselog( space.machine(), 2, "DMA Interrupt Cause: %08x (%08x)\n", pMC->nDMAIntrCause, mem_mask );
return pMC->nDMAIntrCause;
case 0x0168:
case 0x016c:
- //verboselog( space->machine(), 2, "DMA Control Read: %08x (%08x)\n", pMC->nDMAControl, mem_mask );
+ //verboselog( space.machine(), 2, "DMA Control Read: %08x (%08x)\n", pMC->nDMAControl, mem_mask );
return pMC->nDMAControl;
case 0x0180:
case 0x0184:
- //verboselog( space->machine(), 2, "DMA TLB Entry 0 High Read: %08x (%08x)\n", pMC->nDMATLBEntry0Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 0 High Read: %08x (%08x)\n", pMC->nDMATLBEntry0Hi, mem_mask );
return pMC->nDMATLBEntry0Hi;
case 0x0188:
case 0x018c:
- //verboselog( space->machine(), 2, "DMA TLB Entry 0 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry0Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 0 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry0Lo, mem_mask );
return pMC->nDMATLBEntry0Lo;
case 0x0190:
case 0x0194:
- //verboselog( space->machine(), 2, "DMA TLB Entry 1 High Read: %08x (%08x)\n", pMC->nDMATLBEntry1Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 1 High Read: %08x (%08x)\n", pMC->nDMATLBEntry1Hi, mem_mask );
return pMC->nDMATLBEntry1Hi;
case 0x0198:
case 0x019c:
- //verboselog( space->machine(), 2, "DMA TLB Entry 1 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry1Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 1 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry1Lo, mem_mask );
return pMC->nDMATLBEntry1Lo;
case 0x01a0:
case 0x01a4:
- //verboselog( space->machine(), 2, "DMA TLB Entry 2 High Read: %08x (%08x)\n", pMC->nDMATLBEntry2Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 2 High Read: %08x (%08x)\n", pMC->nDMATLBEntry2Hi, mem_mask );
return pMC->nDMATLBEntry2Hi;
case 0x01a8:
case 0x01ac:
- //verboselog( space->machine(), 2, "DMA TLB Entry 2 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry2Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 2 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry2Lo, mem_mask );
return pMC->nDMATLBEntry2Lo;
case 0x01b0:
case 0x01b4:
- //verboselog( space->machine(), 2, "DMA TLB Entry 3 High Read: %08x (%08x)\n", pMC->nDMATLBEntry3Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 3 High Read: %08x (%08x)\n", pMC->nDMATLBEntry3Hi, mem_mask );
return pMC->nDMATLBEntry3Hi;
case 0x01b8:
case 0x01bc:
- //verboselog( space->machine(), 2, "DMA TLB Entry 3 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry3Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 3 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry3Lo, mem_mask );
return pMC->nDMATLBEntry3Lo;
case 0x1000:
case 0x1004:
- //verboselog( space->machine(), 2, "RPSS 100ns Counter Read: %08x (%08x)\n", pMC->nRPSSCounter, mem_mask );
+ //verboselog( space.machine(), 2, "RPSS 100ns Counter Read: %08x (%08x)\n", pMC->nRPSSCounter, mem_mask );
return pMC->nRPSSCounter;
case 0x2000:
case 0x2004:
case 0x2008:
case 0x200c:
- //verboselog( space->machine(), 0, "DMA Memory Address Read: %08x (%08x)\n", pMC->nDMAMemAddr, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Memory Address Read: %08x (%08x)\n", pMC->nDMAMemAddr, mem_mask );
return pMC->nDMAMemAddr;
case 0x2010:
case 0x2014:
- //verboselog( space->machine(), 0, "DMA Line Count and Width Read: %08x (%08x)\n", pMC->nDMALineCntWidth, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Count and Width Read: %08x (%08x)\n", pMC->nDMALineCntWidth, mem_mask );
return pMC->nDMALineCntWidth;
case 0x2018:
case 0x201c:
- //verboselog( space->machine(), 0, "DMA Line Zoom and Stride Read: %08x (%08x)\n", pMC->nDMALineZoomStride, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Zoom and Stride Read: %08x (%08x)\n", pMC->nDMALineZoomStride, mem_mask );
return pMC->nDMALineZoomStride;
case 0x2020:
case 0x2024:
case 0x2028:
case 0x202c:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Read: %08x (%08x)\n", pMC->nDMAGIO64Addr, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Read: %08x (%08x)\n", pMC->nDMAGIO64Addr, mem_mask );
return pMC->nDMAGIO64Addr;
case 0x2030:
case 0x2034:
- //verboselog( space->machine(), 0, "DMA Mode Write: %08x (%08x)\n", pMC->nDMAMode, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Mode Write: %08x (%08x)\n", pMC->nDMAMode, mem_mask );
return pMC->nDMAMode;
case 0x2038:
case 0x203c:
- //verboselog( space->machine(), 0, "DMA Zoom Count Read: %08x (%08x)\n", pMC->nDMAZoomByteCnt, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Zoom Count Read: %08x (%08x)\n", pMC->nDMAZoomByteCnt, mem_mask );
return pMC->nDMAZoomByteCnt;
// case 0x2040:
// case 0x2044:
-// //verboselog( space->machine(), 2, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
+// //verboselog( space.machine(), 2, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
// Start DMA
// pMC->nDMARunning = 1;
// break;
case 0x2048:
case 0x204c:
- //verboselog( space->machine(), 0, "VDMA Running Read: %08x (%08x)\n", pMC->nDMARunning, mem_mask );
+ //verboselog( space.machine(), 0, "VDMA Running Read: %08x (%08x)\n", pMC->nDMARunning, mem_mask );
if( pMC->nDMARunning == 1 )
{
pMC->nDMARunning = 0;
@@ -263,7 +263,7 @@ READ32_HANDLER( sgi_mc_r )
return 0;
}
}
- //verboselog( space->machine(), 0, "Unmapped MC read: 0x%08x (%08x)\n", 0x1fa00000 + offset, mem_mask );
+ //verboselog( space.machine(), 0, "Unmapped MC read: 0x%08x (%08x)\n", 0x1fa00000 + offset, mem_mask );
return 0;
}
@@ -274,210 +274,210 @@ WRITE32_HANDLER( sgi_mc_w )
{
case 0x0000:
case 0x0004:
- //verboselog( space->machine(), 2, "CPU Control 0 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Control 0 Write: %08x (%08x)\n", data, mem_mask );
pMC->nCPUControl0 = data;
break;
case 0x0008:
case 0x000c:
- //verboselog( space->machine(), 2, "CPU Control 1 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Control 1 Write: %08x (%08x)\n", data, mem_mask );
pMC->nCPUControl1 = data;
break;
case 0x0010:
case 0x0014:
- //verboselog( space->machine(), 2, "Watchdog Timer Clear" );
+ //verboselog( space.machine(), 2, "Watchdog Timer Clear" );
pMC->nWatchdog = 0;
break;
case 0x0028:
case 0x002c:
- //verboselog( space->machine(), 2, "RPSS Divider Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "RPSS Divider Write: %08x (%08x)\n", data, mem_mask );
pMC->nRPSSDiv = data;
break;
case 0x0030:
case 0x0034:
- //verboselog( space->machine(), 2, "R4000 EEPROM Write\n" );
+ //verboselog( space.machine(), 2, "R4000 EEPROM Write\n" );
break;
case 0x0040:
case 0x0044:
- //verboselog( space->machine(), 2, "Refresh Count Preload Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "Refresh Count Preload Write: %08x (%08x)\n", data, mem_mask );
pMC->nRefCntPreload = data;
break;
case 0x0080:
case 0x0084:
- //verboselog( space->machine(), 2, "GIO64 Arbitration Param Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Arbitration Param Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIO64ArbParam = data;
break;
case 0x0088:
case 0x008c:
- //verboselog( space->machine(), 3, "Arbiter CPU Time Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Arbiter CPU Time Write: %08x (%08x)\n", data, mem_mask );
pMC->nArbCPUTime = data;
break;
case 0x0098:
case 0x009c:
- //verboselog( space->machine(), 3, "Arbiter Long Burst Time Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Arbiter Long Burst Time Write: %08x (%08x)\n", data, mem_mask );
pMC->nArbBurstTime = data;
break;
case 0x00c0:
case 0x00c4:
- //verboselog( space->machine(), 3, "Memory Configuration Register 0 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 0 Write: %08x (%08x)\n", data, mem_mask );
pMC->nMemCfg0 = data;
break;
case 0x00c8:
case 0x00cc:
- //verboselog( space->machine(), 3, "Memory Configuration Register 1 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 1 Write: %08x (%08x)\n", data, mem_mask );
pMC->nMemCfg1 = data;
break;
case 0x00d0:
case 0x00d4:
- //verboselog( space->machine(), 2, "CPU Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
pMC->nCPUMemAccCfg = data;
break;
case 0x00d8:
case 0x00dc:
- //verboselog( space->machine(), 2, "GIO Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIOMemAccCfg = data;
break;
case 0x00e8:
case 0x00ec:
- //verboselog( space->machine(), 2, "CPU Error Status Clear\n" );
+ //verboselog( space.machine(), 2, "CPU Error Status Clear\n" );
pMC->nCPUErrorStatus = 0;
break;
case 0x00f8:
case 0x00fc:
- //verboselog( space->machine(), 2, "GIO Error Status Clear\n" );
+ //verboselog( space.machine(), 2, "GIO Error Status Clear\n" );
pMC->nGIOErrorStatus = 0;
break;
case 0x0100:
case 0x0104:
- //verboselog( space->machine(), 2, "System Semaphore Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "System Semaphore Write: %08x (%08x)\n", data, mem_mask );
pMC->nSysSemaphore = data;
break;
case 0x0108:
case 0x010c:
- //verboselog( space->machine(), 2, "GIO Lock Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Lock Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIOLock = data;
break;
case 0x0110:
case 0x0114:
- //verboselog( space->machine(), 2, "EISA Lock Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "EISA Lock Write: %08x (%08x)\n", data, mem_mask );
pMC->nEISALock = data;
break;
case 0x0150:
case 0x0154:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Mask Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Mask Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIO64TransMask = data;
break;
case 0x0158:
case 0x015c:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Substitution Bits Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Substitution Bits Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIO64Subst = data;
break;
case 0x0160:
case 0x0164:
- //verboselog( space->machine(), 0, "DMA Interrupt Cause Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Interrupt Cause Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAIntrCause = data;
break;
case 0x0168:
case 0x016c:
- //verboselog( space->machine(), 0, "DMA Control Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Control Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAControl = data;
break;
case 0x0180:
case 0x0184:
- //verboselog( space->machine(), 0, "DMA TLB Entry 0 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 0 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry0Hi = data;
break;
case 0x0188:
case 0x018c:
- //verboselog( space->machine(), 0, "DMA TLB Entry 0 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 0 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry0Lo = data;
break;
case 0x0190:
case 0x0194:
- //verboselog( space->machine(), 0, "DMA TLB Entry 1 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 1 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry1Hi = data;
break;
case 0x0198:
case 0x019c:
- //verboselog( space->machine(), 0, "DMA TLB Entry 1 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 1 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry1Lo = data;
break;
case 0x01a0:
case 0x01a4:
- //verboselog( space->machine(), 0, "DMA TLB Entry 2 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 2 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry2Hi = data;
break;
case 0x01a8:
case 0x01ac:
- //verboselog( space->machine(), 0, "DMA TLB Entry 2 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 2 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry2Lo = data;
break;
case 0x01b0:
case 0x01b4:
- //verboselog( space->machine(), 0, "DMA TLB Entry 3 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 3 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry3Hi = data;
break;
case 0x01b8:
case 0x01bc:
- //verboselog( space->machine(), 0, "DMA TLB Entry 3 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 3 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry3Lo = data;
break;
case 0x2000:
case 0x2004:
- //verboselog( space->machine(), 0, "DMA Memory Address Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Memory Address Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAMemAddr = data;
break;
case 0x2008:
case 0x200c:
- //verboselog( space->machine(), 0, "DMA Memory Address + Default Params Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Memory Address + Default Params Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAMemAddr = data;
break;
case 0x2010:
case 0x2014:
- //verboselog( space->machine(), 0, "DMA Line Count and Width Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Count and Width Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMALineCntWidth = data;
break;
case 0x2018:
case 0x201c:
- //verboselog( space->machine(), 0, "DMA Line Zoom and Stride Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Zoom and Stride Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMALineZoomStride = data;
break;
case 0x2020:
case 0x2024:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAGIO64Addr = data;
break;
case 0x2028:
case 0x202c:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Write + Start DMA: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Write + Start DMA: %08x (%08x)\n", data, mem_mask );
pMC->nDMAGIO64Addr = data;
// Start DMA
pMC->nDMARunning = 1;
break;
case 0x2030:
case 0x2034:
- //verboselog( space->machine(), 0, "DMA Mode Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Mode Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAMode = data;
break;
case 0x2038:
case 0x203c:
- //verboselog( space->machine(), 0, "DMA Zoom Count + Byte Count Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Zoom Count + Byte Count Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAZoomByteCnt = data;
break;
case 0x2040:
case 0x2044:
- //verboselog( space->machine(), 0, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
// Start DMA
pMC->nDMARunning = 1;
break;
case 0x2070:
case 0x2074:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Write + Default Params Write + Start DMA: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Write + Default Params Write + Start DMA: %08x (%08x)\n", data, mem_mask );
pMC->nDMAGIO64Addr = data;
// Start DMA
pMC->nDMARunning = 1;
break;
default:
- //verboselog( space->machine(), 0, "Unmapped MC write: 0x%08x: %08x (%08x)\n", 0x1fa00000 + offset, data, mem_mask );
+ //verboselog( space.machine(), 0, "Unmapped MC write: 0x%08x: %08x (%08x)\n", 0x1fa00000 + offset, data, mem_mask );
break;
}
}
diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c
index 67081761ddc..5b71684f899 100644
--- a/src/mess/machine/sms.c
+++ b/src/mess/machine/sms.c
@@ -27,7 +27,7 @@
#define LGUN_X_INTERVAL 4
-static void setup_rom(address_space *space);
+static void setup_rom(address_space &space);
static TIMER_CALLBACK( rapid_fire_callback )
@@ -427,12 +427,12 @@ static UINT8 sms_vdp_hcount( running_machine &machine )
}
-static void sms_vdp_hcount_latch( address_space *space )
+static void sms_vdp_hcount_latch( address_space &space )
{
- sms_state *state = space->machine().driver_data<sms_state>();
- UINT8 value = sms_vdp_hcount(space->machine());
+ sms_state *state = space.machine().driver_data<sms_state>();
+ UINT8 value = sms_vdp_hcount(space.machine());
- state->m_vdp->hcount_latch_write(*space, 0, value);
+ state->m_vdp->hcount_latch_write(space, 0, value);
}
@@ -556,12 +556,12 @@ INPUT_CHANGED( lgun2_changed )
}
-static void sms_get_inputs( address_space *space )
+static void sms_get_inputs( address_space &space )
{
- sms_state *state = space->machine().driver_data<sms_state>();
+ sms_state *state = space.machine().driver_data<sms_state>();
UINT8 data = 0x00;
- UINT32 cpu_cycles = downcast<cpu_device *>(&space->device())->total_cycles();
- running_machine &machine = space->machine();
+ UINT32 cpu_cycles = downcast<cpu_device *>(&space.device())->total_cycles();
+ running_machine &machine = space.machine();
state->m_input_port0 = 0xff;
state->m_input_port1 = 0xff;
@@ -722,7 +722,7 @@ READ8_MEMBER(sms_state::sms_fm_detect_r)
}
else
{
- sms_get_inputs(&space);
+ sms_get_inputs(space);
return m_input_port0;
}
}
@@ -753,7 +753,7 @@ WRITE8_MEMBER(sms_state::sms_io_control_w)
if (hcount_latch)
{
- sms_vdp_hcount_latch(&space);
+ sms_vdp_hcount_latch(space);
}
m_ctrl_reg = data;
@@ -808,7 +808,7 @@ READ8_MEMBER(sms_state::sms_input_port_0_r)
}
else
{
- sms_get_inputs(&space);
+ sms_get_inputs(space);
return m_input_port0;
}
}
@@ -820,7 +820,7 @@ READ8_MEMBER(sms_state::sms_input_port_1_r)
if (m_bios_port & IO_CHIP)
return 0xff;
- sms_get_inputs(&space);
+ sms_get_inputs(space);
/* Reset Button */
m_input_port1 = (m_input_port1 & 0xef) | (ioport("RESET")->read_safe(0x01) & 0x01) << 4;
@@ -1228,7 +1228,7 @@ WRITE8_MEMBER(sms_state::sms_bios_w)
logerror("bios write %02x, pc: %04x\n", data, space.device().safe_pc());
- setup_rom(&space);
+ setup_rom(space);
}
@@ -1363,9 +1363,9 @@ static void sms_machine_stop( running_machine &machine )
}
-static void setup_rom( address_space *space )
+static void setup_rom( address_space &space )
{
- sms_state *state = space->machine().driver_data<sms_state>();
+ sms_state *state = space.machine().driver_data<sms_state>();
/* 1. set up bank pointers to point to nothing */
state->membank("bank1")->set_base(state->m_banking_none);
@@ -1950,56 +1950,56 @@ MACHINE_START_MEMBER(sms_state,sms)
MACHINE_RESET_MEMBER(sms_state,sms)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_ctrl_reg = 0xff;
if (m_has_fm)
m_fm_detect = 0x01;
- m_mapper_ram = (UINT8*)space->get_write_ptr(0xdffc);
+ m_mapper_ram = (UINT8*)space.get_write_ptr(0xdffc);
m_bios_port = 0;
if ( m_cartridge[m_current_cartridge].features & CF_CODEMASTERS_MAPPER )
{
/* Install special memory handlers */
- space->install_write_handler(0x0000, 0x0000, write8_delegate(FUNC(sms_state::sms_codemasters_page0_w),this));
- space->install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_codemasters_page1_w),this));
+ space.install_write_handler(0x0000, 0x0000, write8_delegate(FUNC(sms_state::sms_codemasters_page0_w),this));
+ space.install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_codemasters_page1_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_KOREAN_ZEMINA_MAPPER )
{
- space->install_write_handler(0x0000, 0x0003, write8_delegate(FUNC(sms_state::sms_korean_zemina_banksw_w),this));
+ space.install_write_handler(0x0000, 0x0003, write8_delegate(FUNC(sms_state::sms_korean_zemina_banksw_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_JANGGUN_MAPPER )
{
- space->install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_janggun_bank0_w),this));
- space->install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_janggun_bank1_w),this));
- space->install_write_handler(0x8000, 0x8000, write8_delegate(FUNC(sms_state::sms_janggun_bank2_w),this));
- space->install_write_handler(0xA000, 0xA000,write8_delegate(FUNC(sms_state::sms_janggun_bank3_w),this));
+ space.install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_janggun_bank0_w),this));
+ space.install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_janggun_bank1_w),this));
+ space.install_write_handler(0x8000, 0x8000, write8_delegate(FUNC(sms_state::sms_janggun_bank2_w),this));
+ space.install_write_handler(0xA000, 0xA000,write8_delegate(FUNC(sms_state::sms_janggun_bank3_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_4PAK_MAPPER )
{
- space->install_write_handler(0x3ffe, 0x3ffe, write8_delegate(FUNC(sms_state::sms_4pak_page0_w),this));
- space->install_write_handler(0x7fff, 0x7fff, write8_delegate(FUNC(sms_state::sms_4pak_page1_w),this));
- space->install_write_handler(0xbfff, 0xbfff, write8_delegate(FUNC(sms_state::sms_4pak_page2_w),this));
+ space.install_write_handler(0x3ffe, 0x3ffe, write8_delegate(FUNC(sms_state::sms_4pak_page0_w),this));
+ space.install_write_handler(0x7fff, 0x7fff, write8_delegate(FUNC(sms_state::sms_4pak_page1_w),this));
+ space.install_write_handler(0xbfff, 0xbfff, write8_delegate(FUNC(sms_state::sms_4pak_page2_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_TVDRAW )
{
- space->install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_tvdraw_axis_w),this));
- space->install_read_handler(0x8000, 0x8000, read8_delegate(FUNC(sms_state::sms_tvdraw_status_r),this));
- space->install_read_handler(0xa000, 0xa000, read8_delegate(FUNC(sms_state::sms_tvdraw_data_r),this));
- space->nop_write(0xa000, 0xa000);
+ space.install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_tvdraw_axis_w),this));
+ space.install_read_handler(0x8000, 0x8000, read8_delegate(FUNC(sms_state::sms_tvdraw_status_r),this));
+ space.install_read_handler(0xa000, 0xa000, read8_delegate(FUNC(sms_state::sms_tvdraw_data_r),this));
+ space.nop_write(0xa000, 0xa000);
m_cartridge[m_current_cartridge].m_tvdraw_data = 0;
}
if ( m_cartridge[m_current_cartridge].features & CF_93C46_EEPROM )
{
- space->install_write_handler(0x8000,0x8000, write8_delegate(FUNC(sms_state::sms_93c46_w),this));
- space->install_read_handler(0x8000,0x8000, read8_delegate(FUNC(sms_state::sms_93c46_r),this));
+ space.install_write_handler(0x8000,0x8000, write8_delegate(FUNC(sms_state::sms_93c46_w),this));
+ space.install_read_handler(0x8000,0x8000, read8_delegate(FUNC(sms_state::sms_93c46_r),this));
}
if (m_cartridge[m_current_cartridge].features & CF_GG_SMS_MODE)
@@ -2061,7 +2061,7 @@ WRITE8_MEMBER(sms_state::sms_store_cart_select_w)
setup_cart_banks(machine());
membank("bank10")->set_base(m_banking_cart[3] + 0x2000);
- setup_rom(&space);
+ setup_rom(space);
}
diff --git a/src/mess/machine/snescart.c b/src/mess/machine/snescart.c
index 124a3258687..109db62e314 100644
--- a/src/mess/machine/snescart.c
+++ b/src/mess/machine/snescart.c
@@ -504,7 +504,7 @@ static UINT32 snes_find_hilo_mode( device_image_interface &image, UINT8 *buffer,
static int snes_find_addon_chip( running_machine &machine )
{
snes_state *state = machine.driver_data<snes_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int supported_type = 1;
int dsp_prg_offset = 0;
@@ -686,7 +686,7 @@ static int snes_find_addon_chip( running_machine &machine )
static void snes_cart_log_info( running_machine &machine, int total_blocks, int supported )
{
snes_state *state = machine.driver_data<snes_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
char title[21], rom_id[4], company_id[2];
int i, company, has_ram = 0, has_sram = 0;
@@ -763,7 +763,7 @@ static DEVICE_IMAGE_LOAD( snes_cart )
int supported_type = 1;
running_machine &machine = image.device().machine();
snes_state *state = machine.driver_data<snes_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
int total_blocks, read_blocks, has_bsx_slot = 0, st_bios = 0;
UINT32 offset, int_header_offs;
UINT8 *ROM = state->memregion("cart")->base();
diff --git a/src/mess/machine/sorcerer.c b/src/mess/machine/sorcerer.c
index bef57d35603..697bf7548d1 100644
--- a/src/mess/machine/sorcerer.c
+++ b/src/mess/machine/sorcerer.c
@@ -306,7 +306,7 @@ SNAPSHOT_LOAD(sorcerer)
{
device_t *cpu = image.device().machine().device("maincpu");
UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base();
- address_space *space = cpu->memory().space(AS_PROGRAM);
+ address_space &space = *cpu->memory().space(AS_PROGRAM);
UINT8 header[28];
unsigned char s_byte;
@@ -325,7 +325,7 @@ SNAPSHOT_LOAD(sorcerer)
for (int i = 0; i < 0xc000; i++)
{
image.fread( &s_byte, 1);
- space->write_byte(i, s_byte);
+ space.write_byte(i, s_byte);
}
image.fread( RAM+0xc000, 0x4000);
@@ -360,20 +360,20 @@ void sorcerer_state::machine_start()
UINT16 endmem = 0xbfff;
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
/* configure RAM */
switch (m_ram->size())
{
case 8*1024:
- space->unmap_readwrite(0x2000, endmem);
+ space.unmap_readwrite(0x2000, endmem);
break;
case 16*1024:
- space->unmap_readwrite(0x4000, endmem);
+ space.unmap_readwrite(0x4000, endmem);
break;
case 32*1024:
- space->unmap_readwrite(0x8000, endmem);
+ space.unmap_readwrite(0x8000, endmem);
break;
}
}
@@ -387,27 +387,27 @@ MACHINE_START_MEMBER(sorcerer_state,sorcererd)
UINT16 endmem = 0xbbff;
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
/* configure RAM */
switch (m_ram->size())
{
case 8*1024:
- space->unmap_readwrite(0x2000, endmem);
+ space.unmap_readwrite(0x2000, endmem);
break;
case 16*1024:
- space->unmap_readwrite(0x4000, endmem);
+ space.unmap_readwrite(0x4000, endmem);
break;
case 32*1024:
- space->unmap_readwrite(0x8000, endmem);
+ space.unmap_readwrite(0x8000, endmem);
break;
}
}
void sorcerer_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Initialize cassette interface */
m_cass_data.output.length = 0;
@@ -416,7 +416,7 @@ void sorcerer_state::machine_reset()
m_cass_data.input.bit = 1;
m_fe = 0xff;
- sorcerer_fe_w(*space, 0, 0, 0xff);
+ sorcerer_fe_w(space, 0, 0, 0xff);
membank("boot")->set_entry(1);
machine().scheduler().timer_set(attotime::from_usec(10), FUNC(sorcerer_reset));
diff --git a/src/mess/machine/special.c b/src/mess/machine/special.c
index ae102dcfe06..2a32bafbe52 100644
--- a/src/mess/machine/special.c
+++ b/src/mess/machine/special.c
@@ -136,33 +136,33 @@ READ8_MEMBER( special_state::specimx_video_color_r )
void special_state::specimx_set_bank(offs_t i, UINT8 data)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
UINT8 *ram = m_ram->pointer();
- space->install_write_bank(0xc000, 0xffbf, "bank3");
- space->install_write_bank(0xffc0, 0xffdf, "bank4");
+ space.install_write_bank(0xc000, 0xffbf, "bank3");
+ space.install_write_bank(0xffc0, 0xffdf, "bank4");
membank("bank4")->set_base(ram + 0xffc0);
switch(i)
{
case 0 :
- space->install_write_bank(0x0000, 0x8fff, "bank1");
- space->install_write_handler(0x9000, 0xbfff, write8_delegate(FUNC(special_state::video_memory_w), this));
+ space.install_write_bank(0x0000, 0x8fff, "bank1");
+ space.install_write_handler(0x9000, 0xbfff, write8_delegate(FUNC(special_state::video_memory_w), this));
membank("bank1")->set_base(ram);
membank("bank2")->set_base(ram + 0x9000);
membank("bank3")->set_base(ram + 0xc000);
break;
case 1 :
- space->install_write_bank(0x0000, 0x8fff, "bank1");
- space->install_write_bank(0x9000, 0xbfff, "bank2");
+ space.install_write_bank(0x0000, 0x8fff, "bank1");
+ space.install_write_bank(0x9000, 0xbfff, "bank2");
membank("bank1")->set_base(ram + 0x10000);
membank("bank2")->set_base(ram + 0x19000);
membank("bank3")->set_base(ram + 0x1c000);
break;
case 2 :
- space->unmap_write(0x0000, 0x8fff);
- space->unmap_write(0x9000, 0xbfff);
+ space.unmap_write(0x0000, 0x8fff);
+ space.unmap_write(0x9000, 0xbfff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x19000);
@@ -273,14 +273,14 @@ void special_state::erik_set_bank()
UINT8 bank4 = (m_RR_register >> 6) & 3;
UINT8 *mem = memregion("maincpu")->base();
UINT8 *ram = m_ram->pointer();
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
- space->install_write_bank(0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x4000, 0x8fff, "bank2");
- space->install_write_bank(0x9000, 0xbfff, "bank3");
- space->install_write_bank(0xc000, 0xefff, "bank4");
- space->install_write_bank(0xf000, 0xf7ff, "bank5");
- space->install_write_bank(0xf800, 0xffff, "bank6");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x4000, 0x8fff, "bank2");
+ space.install_write_bank(0x9000, 0xbfff, "bank3");
+ space.install_write_bank(0xc000, 0xefff, "bank4");
+ space.install_write_bank(0xf000, 0xf7ff, "bank5");
+ space.install_write_bank(0xf800, 0xffff, "bank6");
switch(bank1)
{
@@ -290,7 +290,7 @@ void special_state::erik_set_bank()
membank("bank1")->set_base(ram + 0x10000*(bank1-1));
break;
case 0:
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(mem + 0x10000);
break;
}
@@ -302,7 +302,7 @@ void special_state::erik_set_bank()
membank("bank2")->set_base(ram + 0x10000*(bank2-1) + 0x4000);
break;
case 0:
- space->unmap_write(0x4000, 0x8fff);
+ space.unmap_write(0x4000, 0x8fff);
membank("bank2")->set_base(mem + 0x14000);
break;
}
@@ -314,7 +314,7 @@ void special_state::erik_set_bank()
membank("bank3")->set_base(ram + 0x10000*(bank3-1) + 0x9000);
break;
case 0:
- space->unmap_write(0x9000, 0xbfff);
+ space.unmap_write(0x9000, 0xbfff);
membank("bank3")->set_base(mem + 0x19000);
break;
}
@@ -328,11 +328,11 @@ void special_state::erik_set_bank()
membank("bank6")->set_base(ram + 0x10000*(bank4-1) + 0x0f800);
break;
case 0:
- space->unmap_write(0xc000, 0xefff);
+ space.unmap_write(0xc000, 0xefff);
membank("bank4")->set_base(mem + 0x1c000);
- space->unmap_write(0xf000, 0xf7ff);
- space->nop_read(0xf000, 0xf7ff);
- space->install_readwrite_handler(0xf800, 0xf803, 0, 0x7fc, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi));
+ space.unmap_write(0xf000, 0xf7ff);
+ space.nop_read(0xf000, 0xf7ff);
+ space.install_readwrite_handler(0xf800, 0xf803, 0, 0x7fc, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi));
break;
}
}
diff --git a/src/mess/machine/tandy1t.c b/src/mess/machine/tandy1t.c
index 526915f6eae..c003f4c5a20 100644
--- a/src/mess/machine/tandy1t.c
+++ b/src/mess/machine/tandy1t.c
@@ -165,9 +165,9 @@ static struct
WRITE8_HANDLER ( pc_t1t_p37x_w )
{
-// DBG_LOG(2,"T1T_p37x_w",("%.5x #%d $%02x\n", space->device().safe_pc( ),offset, data));
+// DBG_LOG(2,"T1T_p37x_w",("%.5x #%d $%02x\n", space.device().safe_pc( ),offset, data));
if (offset!=4)
- logerror("T1T_p37x_w %.5x #%d $%02x\n", space->device().safe_pc( ),offset, data);
+ logerror("T1T_p37x_w %.5x #%d $%02x\n", space.device().safe_pc( ),offset, data);
tandy.data[offset]=data;
switch( offset )
{
@@ -180,7 +180,7 @@ WRITE8_HANDLER ( pc_t1t_p37x_w )
READ8_HANDLER ( pc_t1t_p37x_r )
{
int data = tandy.data[offset];
-// DBG_LOG(1,"T1T_p37x_r",("%.5x #%d $%02x\n", space->device().safe_pc( ), offset, data));
+// DBG_LOG(1,"T1T_p37x_r",("%.5x #%d $%02x\n", space.device().safe_pc( ), offset, data));
return data;
}
@@ -203,8 +203,8 @@ WRITE8_HANDLER ( tandy1000_pio_w )
{
case 1:
tandy_ppi.portb = data;
- pit8253_gate2_w(space->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( space->machine(), data & 0x02 );
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
pc_keyb_set_clock(data&0x40);
if ( data & 0x80 )
{
@@ -214,9 +214,9 @@ WRITE8_HANDLER ( tandy1000_pio_w )
case 2:
tandy_ppi.portc = data;
if (data & 8)
- space->machine().device("maincpu")->set_clock_scale(1);
+ space.machine().device("maincpu")->set_clock_scale(1);
else
- space->machine().device("maincpu")->set_clock_scale(4.77/8);
+ space.machine().device("maincpu")->set_clock_scale(4.77/8);
break;
}
}
@@ -261,7 +261,7 @@ READ8_HANDLER( tandy1000_bank_r )
{
UINT8 data = 0xFF;
- logerror( "%s: tandy1000_bank_r: offset = %x\n", space->machine().describe_context(), offset );
+ logerror( "%s: tandy1000_bank_r: offset = %x\n", space.machine().describe_context(), offset );
switch( offset )
{
@@ -276,13 +276,13 @@ READ8_HANDLER( tandy1000_bank_r )
WRITE8_HANDLER( tandy1000_bank_w )
{
- logerror( "%s: tandy1000_bank_w: offset = %x, data = %02x\n", space->machine().describe_context(), offset, data );
+ logerror( "%s: tandy1000_bank_w: offset = %x, data = %02x\n", space.machine().describe_context(), offset, data );
switch( offset )
{
case 0x00: /* FFEA */
tandy.bios_bank = data;
- tandy1000_set_bios_bank(space->machine());
+ tandy1000_set_bios_bank(space.machine());
break;
}
}
diff --git a/src/mess/machine/tf20.c b/src/mess/machine/tf20.c
index b5f6086ca4a..d1cc7fe9a17 100644
--- a/src/mess/machine/tf20.c
+++ b/src/mess/machine/tf20.c
@@ -71,8 +71,8 @@ static TIMER_DEVICE_CALLBACK( serial_clock )
/* a read from this location disables the rom */
static READ8_HANDLER( tf20_rom_disable )
{
- tf20_state *tf20 = get_safe_token(space->device().owner());
- address_space *prg = space->device().memory().space(AS_PROGRAM);
+ tf20_state *tf20 = get_safe_token(space.device().owner());
+ address_space *prg = space.device().memory().space(AS_PROGRAM);
/* switch in ram */
prg->install_ram(0x0000, 0x7fff, tf20->ram->pointer());
@@ -82,9 +82,9 @@ static READ8_HANDLER( tf20_rom_disable )
static READ8_HANDLER( tf20_dip_r )
{
- logerror("%s: tf20_dip_r\n", space->machine().describe_context());
+ logerror("%s: tf20_dip_r\n", space.machine().describe_context());
- return space->machine().root_device().ioport("tf20_dip")->read();
+ return space.machine().root_device().ioport("tf20_dip")->read();
}
static TIMER_CALLBACK( tf20_upd765_tc_reset )
@@ -105,8 +105,8 @@ static READ8_DEVICE_HANDLER( tf20_upd765_tc_r )
static WRITE8_HANDLER( tf20_fdc_control_w )
{
- tf20_state *tf20 = get_safe_token(space->device().owner());
- logerror("%s: tf20_fdc_control_w %02x\n", space->machine().describe_context(), data);
+ tf20_state *tf20 = get_safe_token(space.device().owner());
+ logerror("%s: tf20_fdc_control_w %02x\n", space.machine().describe_context(), data);
/* bit 0, motor on signal */
floppy_mon_w(tf20->floppy_0, !BIT(data, 0));
diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c
index 7d885061da1..1d7dd4fe31f 100644
--- a/src/mess/machine/thomflop.c
+++ b/src/mess/machine/thomflop.c
@@ -273,14 +273,14 @@ static UINT8 to7_5p14_select;
static READ8_HANDLER ( to7_5p14_r )
{
- device_t *fdc = space->machine().device("wd2793");
+ device_t *fdc = space.machine().device("wd2793");
if ( offset < 4 )
- return wd17xx_r( fdc, *space, offset );
+ return wd17xx_r( fdc, space, offset );
else if ( offset == 8 )
return to7_5p14_select;
else
- logerror ( "%f $%04x to7_5p14_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x to7_5p14_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
@@ -288,9 +288,9 @@ static READ8_HANDLER ( to7_5p14_r )
static WRITE8_HANDLER( to7_5p14_w )
{
- device_t *fdc = space->machine().device("wd2793");
+ device_t *fdc = space.machine().device("wd2793");
if ( offset < 4 )
- wd17xx_w( fdc, *space, offset, data );
+ wd17xx_w( fdc, space, offset, data );
else if ( offset == 8 )
{
/* drive select */
@@ -304,7 +304,7 @@ static WRITE8_HANDLER( to7_5p14_w )
case 4: drive = 2; side = 0; break;
case 5: drive = 3; side = 1; break;
default:
- logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data );
+ logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data );
}
wd17xx_dden_w(fdc, BIT(data, 7));
@@ -313,17 +313,17 @@ static WRITE8_HANDLER( to7_5p14_w )
if ( drive != -1 )
{
- thom_floppy_active( space->machine(), 0 );
+ thom_floppy_active( space.machine(), 0 );
wd17xx_set_drive( fdc, drive );
wd17xx_set_side( fdc, side );
LOG(( "%f $%04x to7_5p14_w: $%02X set drive=%i side=%i density=%s\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(),
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(),
data, drive, side, (BIT(data, 7) ? "FM" : "MFM")));
}
}
else
logerror ( "%f $%04x to7_5p14_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
@@ -362,11 +362,11 @@ static UINT8 to7_5p14sd_select;
static READ8_HANDLER ( to7_5p14sd_r )
{
if ( offset < 8 )
- return mc6843_r( space->machine().device("mc6843"), *space, offset );
+ return mc6843_r( space.machine().device("mc6843"), space, offset );
else if ( offset >= 8 && offset <= 9 )
return to7_5p14sd_select;
else
- logerror ( "%f $%04x to7_5p14sd_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x to7_5p14sd_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
@@ -375,7 +375,7 @@ static READ8_HANDLER ( to7_5p14sd_r )
static WRITE8_HANDLER( to7_5p14sd_w )
{
if ( offset < 8 )
- mc6843_w( space->machine().device("mc6843"), *space, offset, data );
+ mc6843_w( space.machine().device("mc6843"), space, offset, data );
else if ( offset >= 8 && offset <= 9 )
{
/* drive select */
@@ -406,16 +406,16 @@ static WRITE8_HANDLER( to7_5p14sd_w )
if ( drive != -1 )
{
- thom_floppy_active( space->machine(), 0 );
- mc6843_set_drive( space->machine().device("mc6843"), drive );
- mc6843_set_side( space->machine().device("mc6843"), side );
+ thom_floppy_active( space.machine(), 0 );
+ mc6843_set_drive( space.machine().device("mc6843"), drive );
+ mc6843_set_side( space.machine().device("mc6843"), side );
LOG(( "%f $%04x to7_5p14sd_w: $%02X set drive=%i side=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data, drive, side ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data, drive, side ));
}
}
else
logerror ( "%f $%04x to7_5p14sd_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
static void to7_5p14_index_pulse_callback( device_t *controller,device_t *image, int state )
@@ -700,9 +700,9 @@ static READ8_HANDLER ( to7_qdd_r )
{
case 0: /* MC6852 status */
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_r: STAT=$%02X irq=%i pe=%i ovr=%i und=%i tr=%i rd=%i ncts=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), to7qdd->status,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), to7qdd->status,
to7qdd->status & QDD_S_IRQ ? 1 : 0,
to7qdd->status & QDD_S_PE ? 1 : 0,
to7qdd->status & QDD_S_OVR ? 1 : 0,
@@ -714,23 +714,23 @@ static READ8_HANDLER ( to7_qdd_r )
case 1: /* MC6852 data input => read byte from disk */
to7qdd->status &= ~(QDD_S_RDA | QDD_S_PE | QDD_S_OVR);
- to7_qdd_stat_update(space->machine());
- return to7_qdd_read_byte(space->machine());
+ to7_qdd_stat_update(space.machine());
+ return to7_qdd_read_byte(space.machine());
case 8: /* floppy status */
{
UINT8 data = 0;
- device_image_interface* img = dynamic_cast<device_image_interface *>(to7_qdd_image(space->machine()));
+ device_image_interface* img = dynamic_cast<device_image_interface *>(to7_qdd_image(space.machine()));
if ( ! img->exists() )
data |= 0x40; /* disk present */
if ( to7qdd->index_pulse )
data |= 0x80; /* disk start */
- VLOG(( "%f $%04x to7_qdd_r: STATUS8 $%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x to7_qdd_r: STATUS8 $%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
return data;
}
default:
- logerror ( "%f $%04x to7_qdd_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x to7_qdd_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -750,9 +750,9 @@ static WRITE8_HANDLER( to7_qdd_w )
to7qdd->status &= ~(QDD_S_TDRA | QDD_S_TUF);
to7qdd->ctrl1 = ( data & ~(QDD_C1_RRESET | QDD_C1_TRESET) ) |( data & (QDD_C1_RRESET | QDD_C1_TRESET) & to7qdd->ctrl1 );
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_w: CTRL1=$%02X reset=%c%c %s%sirq=%c%c\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
data & QDD_C1_RRESET ? 'r' : '-', data & QDD_C1_TRESET ? 't' : '-',
data & QDD_C1_STRIPSYNC ? "strip-sync " : "",
data & QDD_C1_CLRSYNC ? "clear-sync " : "",
@@ -774,9 +774,9 @@ static WRITE8_HANDLER( to7_qdd_w )
int bits, parity;
bits = bit[ (data >> 3) & 7 ];
parity = par[ (data >> 3) & 7 ];
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_w: CTRL2=$%02X bits=%i par=%s blen=%i under=%s%s\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
bits, parname[ parity ], data & QDD_C2_BLEN ? 1 : 2,
data & QDD_C2_TSYNC ? "sync" : "ff",
data & QDD_C2_EIE ? "irq-err" : "" ));
@@ -792,9 +792,9 @@ static WRITE8_HANDLER( to7_qdd_w )
to7qdd->status &= ~QDD_S_TUF;
if ( data & QDD_C3_CLRCTS )
to7qdd->status &= ~QDD_S_NCTS;
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_w: CTRL3=$%02X %s%ssync-len=%i sync-mode=%s\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
data & QDD_C3_CLRTUF ? "clr-tuf " : "",
data & QDD_C3_CLRCTS ? "clr-cts " : "",
data & QDD_C3_SYNCLEN ? 1 : 2,
@@ -802,11 +802,11 @@ static WRITE8_HANDLER( to7_qdd_w )
break;
case 2: /* MC6852 sync code => write byte to disk */
- to7_qdd_write_byte( space->machine(), data );
+ to7_qdd_write_byte( space.machine(), data );
break;
case 3: /* MC6852 data out => does not seem to be used */
- VLOG(( "%f $%04x to7_qdd_w: ignored WDATA=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x to7_qdd_w: ignored WDATA=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
}
@@ -814,16 +814,16 @@ static WRITE8_HANDLER( to7_qdd_w )
case 8: /* set drive */
to7qdd->drive = data;
- VLOG(( "%f $%04x to7_qdd_w: DRIVE=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x to7_qdd_w: DRIVE=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
case 12: /* motor pulse ? */
- thom_floppy_active( space->machine(), 0 );
- VLOG(( "%f $%04x to7_qdd_w: MOTOR=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ thom_floppy_active( space.machine(), 0 );
+ VLOG(( "%f $%04x to7_qdd_w: MOTOR=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
default:
- logerror ( "%f $%04x to7_qdd_w: invalid write offset %i (data=$%02X)\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror ( "%f $%04x to7_qdd_w: invalid write offset %i (data=$%02X)\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1264,13 +1264,13 @@ READ8_HANDLER ( thmfc_floppy_r )
case 0: /* STAT0 */
thmfc1->stat0 ^= THMFC1_STAT0_SYNCHRO | THMFC1_STAT0_BYTE_READY_POL;
- VLOG(( "%f $%04x thmfc_floppy_r: STAT0=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), thmfc1->stat0 ));
+ VLOG(( "%f $%04x thmfc_floppy_r: STAT0=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), thmfc1->stat0 ));
return thmfc1->stat0;
case 1: /* STAT1 */
{
UINT8 data = 0;
- device_image_interface * img = dynamic_cast<device_image_interface *>(thmfc_floppy_image(space->machine()));
+ device_image_interface * img = dynamic_cast<device_image_interface *>(thmfc_floppy_image(space.machine()));
int flags = floppy_drive_get_flag_state( &img->device(), -1 );
if ( thmfc_floppy_is_qdd(img) )
{
@@ -1296,16 +1296,16 @@ READ8_HANDLER ( thmfc_floppy_r )
data |= 0x10;
if (!floppy_wpt_r(&img->device()))
data |= 0x04;
- VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
return data;
}
case 3: /* RDATA */
if ( thmfc1->op == THMFC1_OP_READ_SECT || thmfc1->op == THMFC1_OP_READ_ADDR )
- return thmfc_floppy_read_byte(space->machine());
+ return thmfc_floppy_read_byte(space.machine());
else
- return thmfc_floppy_raw_read_byte(space->machine());
+ return thmfc_floppy_raw_read_byte(space.machine());
case 6:
return 0;
@@ -1314,12 +1314,12 @@ READ8_HANDLER ( thmfc_floppy_r )
{
/* undocumented => emulate TO7 QDD controller ? */
UINT8 data = thmfc1->ipl << 7;
- VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
return data;
}
default:
- logerror ( "%f $%04x thmfc_floppy_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x thmfc_floppy_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1333,11 +1333,11 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case 0: /* CMD0 */
{
int wsync = (data >> 4) & 1;
- int qdd = thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space->machine())));
+ int qdd = thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space.machine())));
chrn_id id;
thmfc1->formatting = (data >> 2) & 1;
LOG (( "%f $%04x thmfc_floppy_w: CMD0=$%02X dens=%s wsync=%i dsync=%i fmt=%i op=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
(BIT(data, 5) ? "FM" : "MFM"),
wsync, (data >> 3) & 1,
thmfc1->formatting, data & 3 ));
@@ -1356,7 +1356,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case THMFC1_OP_WRITE_SECT:
if ( qdd )
logerror( "thmfc_floppy_w: smart operation 1 not supported for QDD\n" );
- else if ( thmfc_floppy_find_sector( space->machine(), &id ) )
+ else if ( thmfc_floppy_find_sector( space.machine(), &id ) )
{
thmfc1->sector_id = id.data_id;
thmfc1->data_idx = 0;
@@ -1371,7 +1371,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case THMFC1_OP_READ_ADDR:
if ( qdd )
logerror( "thmfc_floppy_w: smart operation 2 not supported for QDD\n" );
- else if ( thmfc_floppy_find_sector( space->machine(), &id ) )
+ else if ( thmfc_floppy_find_sector( space.machine(), &id ) )
{
thmfc1->data_size =
thom_floppy_make_addr( id, thmfc1->data, thmfc1->sector_size );
@@ -1387,10 +1387,10 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case THMFC1_OP_READ_SECT:
if ( qdd )
logerror( "thmfc_floppy_w: smart operation 3 not supported for QDD\n" );
- else if ( thmfc_floppy_find_sector( space->machine(), &id ) )
+ else if ( thmfc_floppy_find_sector( space.machine(), &id ) )
{
thmfc1->data_size = thom_floppy_make_sector
- ( thmfc_floppy_image(space->machine()), id, thmfc1->data, thmfc1->sector_size );
+ ( thmfc_floppy_image(space.machine()), id, thmfc1->data, thmfc1->sector_size );
assert( thmfc1->data_size < sizeof( thmfc1->data ) );
thmfc1->data_finish = thmfc1->sector_size + 4;
thmfc1->data_idx = 1;
@@ -1404,7 +1404,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
/* synchronize to word, if needed (QDD only) */
if ( wsync && qdd ) {
if ( ! thmfc1->data_raw_size )
- thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(space->machine()), thmfc1->data );
+ thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(space.machine()), thmfc1->data );
while ( thmfc1->data_raw_idx < thmfc1->data_raw_size &&
thmfc1->data[ thmfc1->data_raw_idx ] != thmfc1->wsync )
{
@@ -1423,12 +1423,12 @@ WRITE8_HANDLER ( thmfc_floppy_w )
if ( thmfc1->sector_size > 256 )
{
logerror( "$%04x thmfc_floppy_w: sector size %i > 256 not handled\n",
- space->machine().device("maincpu")->safe_pcbase(), thmfc1->sector_size );
+ space.machine().device("maincpu")->safe_pcbase(), thmfc1->sector_size );
thmfc1->sector_size = 256;
}
LOG (( "%f $%04x thmfc_floppy_w: CMD1=$%02X sect-size=%i comp=%i head=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
thmfc1->sector_size, (data >> 1) & 7, thmfc1->side ));
break;
@@ -1439,7 +1439,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
int seek = 0, motor;
thmfc1->drive = data & 2;
- img = thmfc_floppy_image(space->machine());
+ img = thmfc_floppy_image(space.machine());
if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(img)))
{
motor = !(data & 0x40);
@@ -1451,13 +1451,13 @@ WRITE8_HANDLER ( thmfc_floppy_w )
seek = (data & 0x20) ? 1 : -1;
motor = (data >> 2) & 1;
thmfc1->drive |= 1 ^ ((data >> 6) & 1);
- img = thmfc_floppy_image(space->machine());
+ img = thmfc_floppy_image(space.machine());
}
- thom_floppy_active( space->machine(), 0 );
+ thom_floppy_active( space.machine(), 0 );
LOG (( "%f $%04x thmfc_floppy_w: CMD2=$%02X drv=%i step=%i motor=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
thmfc1->drive, seek, motor ));
if ( seek )
@@ -1478,17 +1478,17 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case 3: /* WDATA */
thmfc1->wsync = data;
- if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space->machine()))))
- thmfc_floppy_qdd_write_byte( space->machine(), data );
+ if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space.machine()))))
+ thmfc_floppy_qdd_write_byte( space.machine(), data );
else if ( thmfc1->op==THMFC1_OP_WRITE_SECT )
- thmfc_floppy_write_byte( space->machine(), data );
+ thmfc_floppy_write_byte( space.machine(), data );
else if ( thmfc1->formatting )
- thmfc_floppy_format_byte( space->machine(), data );
+ thmfc_floppy_format_byte( space.machine(), data );
else
{
/* TODO: implement other forms of raw track writing */
LOG (( "%f $%04x thmfc_floppy_w: ignored raw WDATA $%02X\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
}
break;
@@ -1496,32 +1496,32 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case 4: /* WCLK (unemulated) */
/* clock configuration: FF for data, 0A for synchro */
LOG (( "%f $%04x thmfc_floppy_w: WCLK=$%02X (%s)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
(data == 0xff) ? "data" : (data == 0x0A) ? "synchro" : "?" ));
break;
case 5: /* WSECT */
thmfc1->sector = data;
LOG (( "%f $%04x thmfc_floppy_w: WSECT=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
case 6: /* WTRCK */
thmfc1->track = data;
LOG (( "%f $%04x thmfc_floppy_w: WTRCK=%i (real=%i)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
- floppy_drive_get_current_track( thmfc_floppy_image(space->machine()) ) ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
+ floppy_drive_get_current_track( thmfc_floppy_image(space.machine()) ) ));
break;
case 7: /* WCELL */
/* precompensation (unemulated) */
LOG (( "%f $%04x thmfc_floppy_w: WCELL=$%02X\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
default:
logerror ( "%f $%04x thmfc_floppy_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1715,17 +1715,17 @@ static void to7_network_reset( running_machine &machine )
static READ8_HANDLER ( to7_network_r )
{
if ( offset < 4 )
- return mc6854_r( space->machine().device("mc6854"), *space, offset );
+ return mc6854_r( space.machine().device("mc6854"), space, offset );
if ( offset == 8 )
{
/* network ID of the computer */
- UINT8 id = space->machine().root_device().ioport("fconfig")->read() >> 3;
- VLOG(( "%f $%04x to7_network_r: read id $%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), id ));
+ UINT8 id = space.machine().root_device().ioport("fconfig")->read() >> 3;
+ VLOG(( "%f $%04x to7_network_r: read id $%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), id ));
return id;
}
- logerror( "%f $%04x to7_network_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "%f $%04x to7_network_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
@@ -1734,11 +1734,11 @@ static READ8_HANDLER ( to7_network_r )
static WRITE8_HANDLER ( to7_network_w )
{
if ( offset < 4 )
- mc6854_w( space->machine().device("mc6854"), *space, offset, data );
+ mc6854_w( space.machine().device("mc6854"), space, offset, data );
else
{
logerror( "%f $%04x to7_network_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1861,7 +1861,7 @@ WRITE8_HANDLER ( to7_floppy_w )
if ( offset == 8 )
{
to7_floppy_bank = 3 + (data & 3);
- space->machine().root_device().membank( THOM_FLOP_BANK )->set_entry( to7_floppy_bank );
+ space.machine().root_device().membank( THOM_FLOP_BANK )->set_entry( to7_floppy_bank );
VLOG (( "to7_floppy_w: set CD 90-351 ROM bank to %i\n", data & 3 ));
}
else
diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c
index e1d515deb25..66ed9eb393e 100644
--- a/src/mess/machine/thomson.c
+++ b/src/mess/machine/thomson.c
@@ -447,14 +447,14 @@ DEVICE_IMAGE_LOAD( to7_cartridge )
static void to7_update_cart_bank(running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int bank = 0;
if ( thom_cart_nb_banks )
{
bank = thom_cart_bank % thom_cart_nb_banks;
if ( bank != old_cart_bank && old_cart_bank < 0 )
{
- space->install_legacy_read_handler(0x0000, 0x0003, FUNC(to7_cartridge_r) );
+ space.install_legacy_read_handler(0x0000, 0x0003, FUNC(to7_cartridge_r) );
}
}
if ( bank != old_cart_bank )
@@ -481,7 +481,7 @@ WRITE8_HANDLER ( to7_cartridge_w )
return;
thom_cart_bank = offset & 3;
- to7_update_cart_bank(space->machine());
+ to7_update_cart_bank(space.machine());
}
@@ -489,12 +489,12 @@ WRITE8_HANDLER ( to7_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_HANDLER ( to7_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- to7_update_cart_bank(space->machine());
+ to7_update_cart_bank(space.machine());
}
return data;
}
@@ -939,22 +939,22 @@ const mea8000_interface to7_speech = { "speech", DEVCB_NULL };
READ8_HANDLER ( to7_modem_mea8000_r )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
{
return 0;
}
- if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
+ if ( space.machine().root_device().ioport("mconfig")->read() & 1 )
{
- device_t* device = space->machine().device("mea8000" );
- return mea8000_r( device, *space, offset );
+ device_t* device = space.machine().device("mea8000" );
+ return mea8000_r( device, space, offset );
}
else
{
- acia6850_device* acia = space->machine().device<acia6850_device>("acia6850" );
+ acia6850_device* acia = space.machine().device<acia6850_device>("acia6850" );
switch (offset) {
- case 0: return acia->status_read(*space, offset );
- case 1: return acia->data_read(*space, offset );
+ case 0: return acia->status_read(space, offset );
+ case 1: return acia->data_read(space, offset );
default: return 0;
}
}
@@ -964,17 +964,17 @@ READ8_HANDLER ( to7_modem_mea8000_r )
WRITE8_HANDLER ( to7_modem_mea8000_w )
{
- if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
+ if ( space.machine().root_device().ioport("mconfig")->read() & 1 )
{
- device_t* device = space->machine().device("mea8000" );
- mea8000_w( device, *space, offset, data );
+ device_t* device = space.machine().device("mea8000" );
+ mea8000_w( device, space, offset, data );
}
else
{
- acia6850_device* acia = space->machine().device<acia6850_device>("acia6850" );
+ acia6850_device* acia = space.machine().device<acia6850_device>("acia6850" );
switch (offset) {
- case 0: acia->control_write( *space, offset, data );
- case 1: acia->data_write( *space, offset, data );
+ case 0: acia->control_write( space, offset, data );
+ case 1: acia->data_write( space, offset, data );
}
}
}
@@ -1283,7 +1283,7 @@ READ8_HANDLER ( to7_midi_r )
/* bit 6: parity error (ignored) */
/* bit 7: interrupt */
LOG_MIDI(( "$%04x %f to7_midi_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, irq=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to7_midi_status,
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to7_midi_status,
(to7_midi_status & ACIA_6850_RDRF) ? 1 : 0,
(to7_midi_status & ACIA_6850_TDRE) ? 1 : 0,
(to7_midi_status & ACIA_6850_OVRN) ? 1 : 0,
@@ -1294,7 +1294,7 @@ READ8_HANDLER ( to7_midi_r )
case 1: /* get input data */
{
UINT8 data = chardev_in( to7_midi_chardev );
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to7_midi_status &= ~(ACIA_6850_irq | ACIA_6850_RDRF);
if ( to7_midi_overrun )
@@ -1303,8 +1303,8 @@ READ8_HANDLER ( to7_midi_r )
to7_midi_status &= ~ACIA_6850_OVRN;
to7_midi_overrun = 0;
LOG_MIDI(( "$%04x %f to7_midi_r: read data $%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
- to7_midi_update_irq( space->machine() );
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
+ to7_midi_update_irq( space.machine() );
}
return data;
}
@@ -1312,7 +1312,7 @@ READ8_HANDLER ( to7_midi_r )
default:
logerror( "$%04x to7_midi_r: invalid offset %i\n",
- space->machine().device("maincpu")->safe_pcbase(), offset );
+ space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1331,7 +1331,7 @@ WRITE8_HANDLER ( to7_midi_w )
if ( (data & 3) == 3 )
{
/* reset */
- LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
+ LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
to7_midi_overrun = 0;
to7_midi_status = 2;
to7_midi_intr = 0;
@@ -1348,7 +1348,7 @@ WRITE8_HANDLER ( to7_midi_w )
static const int stop[8] = { 2,2,1,1,2,1,1,1 };
static const char parity[8] = { 'e','o','e','o','-','-','e','o' };
LOG_MIDI(( "$%04x %f to7_midi_w: set control to $%02X (bits=%i, stop=%i, parity=%c, intr in=%i out=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
data,
bits[ (data >> 2) & 7 ],
stop[ (data >> 2) & 7 ],
@@ -1357,12 +1357,12 @@ WRITE8_HANDLER ( to7_midi_w )
(to7_midi_intr & 3) ? 1 : 0));
}
}
- to7_midi_update_irq( space->machine() );
+ to7_midi_update_irq( space.machine() );
break;
case 1: /* output data */
- LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
+ LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
if ( data == 0x55 )
/* cable-detect: shortcut */
chardev_fake_in( to7_midi_chardev, 0x55 );
@@ -1376,7 +1376,7 @@ WRITE8_HANDLER ( to7_midi_w )
default:
- logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1487,7 +1487,7 @@ MACHINE_RESET ( to7 )
MACHINE_START ( to7 )
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8* mem = machine.root_device().memregion("maincpu")->base();
UINT8* ram = machine.device<ram_device>(RAM_TAG)->pointer();
@@ -1515,8 +1515,8 @@ MACHINE_START ( to7 )
/* install 16 KB or 16 KB + 8 KB memory extensions */
/* BASIC instruction to see free memory: ?FRE(0) */
int extram = machine.device<ram_device>(RAM_TAG)->size() - 24*1024;
- space->install_write_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK);
- space->install_read_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK );
+ space.install_write_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK);
+ space.install_read_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK );
machine.root_device().membank( THOM_RAM_BANK )->configure_entry( 0, ram + 0x6000);
machine.root_device().membank( THOM_RAM_BANK )->set_entry( 0 );
}
@@ -1568,7 +1568,7 @@ static READ8_DEVICE_HANDLER ( to770_sys_porta_in )
static void to770_update_ram_bank(running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 portb = sys_pia->port_b_z_mask();
int bank;
@@ -1602,7 +1602,7 @@ static void to770_update_ram_bank(running_machine &machine)
{
/* RAM size is 48 KB only and unavailable bank
* requested */
- space->nop_readwrite(0xa000, 0xdfff);
+ space.nop_readwrite(0xa000, 0xdfff);
}
old_ram_bank = bank;
LOG_BANK(( "to770_update_ram_bank: RAM bank change %i\n", bank ));
@@ -1675,8 +1675,8 @@ const mc6846_interface to770_timer =
READ8_HANDLER ( to770_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
int count, inil, init, lt3;
count = to7_lightpen ? l.count : v.count;
inil = to7_lightpen ? l.inil : v.inil;
@@ -1690,7 +1690,7 @@ READ8_HANDLER ( to770_gatearray_r )
case 2: return (lt3 << 7) | (inil << 6);
case 3: return (init << 7);
default:
- logerror( "$%04x to770_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to770_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1907,8 +1907,8 @@ const pia6821_interface mo5_pia6821_sys =
READ8_HANDLER ( mo5_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), MO5_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), MO5_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
int count, inil, init, lt3;
count = to7_lightpen ? l.count : v.count;
inil = to7_lightpen ? l.inil : v.inil;
@@ -1921,7 +1921,7 @@ READ8_HANDLER ( mo5_gatearray_r )
case 2: return (lt3 << 7) | (inil << 6);
case 3: return (init << 7);
default:
- logerror( "$%04x mo5_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x mo5_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1992,7 +1992,7 @@ DEVICE_IMAGE_LOAD( mo5_cartridge )
static void mo5_update_cart_bank(running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int rom_is_ram = mo5_reg_cart & 4;
int bank = 0;
int bank_is_read_only = 0;
@@ -2006,8 +2006,8 @@ static void mo5_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff);
}
LOG_BANK(( "mo5_update_cart_bank: CART is cartridge bank %i (A7CB style)\n", bank ));
}
@@ -2022,12 +2022,12 @@ static void mo5_update_cart_bank(running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff );
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
}
LOG_BANK(( "mo5_update_cart_bank: CART is nanonetwork RAM bank %i (%s)\n",
mo5_reg_cart & 3,
@@ -2045,9 +2045,9 @@ static void mo5_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 0 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
- space->install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo5_cartridge_r) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
+ space.install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo5_cartridge_r) );
}
LOG_BANK(( "mo5_update_cart_bank: CART is cartridge bank %i\n", bank ));
}
@@ -2055,8 +2055,8 @@ static void mo5_update_cart_bank(running_machine &machine)
/* internal ROM */
if ( old_cart_bank != 0 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
LOG_BANK(( "mo5_update_cart_bank: CART is internal\n"));
}
}
@@ -2083,7 +2083,7 @@ WRITE8_HANDLER ( mo5_cartridge_w )
return;
thom_cart_bank = offset & 3;
- mo5_update_cart_bank(space->machine());
+ mo5_update_cart_bank(space.machine());
}
@@ -2091,12 +2091,12 @@ WRITE8_HANDLER ( mo5_cartridge_w )
/* read signal to bffc-bfff generates a bank switch */
READ8_HANDLER ( mo5_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + 0xbffc + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- mo5_update_cart_bank(space->machine());
+ mo5_update_cart_bank(space.machine());
}
return data;
}
@@ -2107,7 +2107,7 @@ READ8_HANDLER ( mo5_cartridge_r )
WRITE8_HANDLER ( mo5_ext_w )
{
mo5_reg_cart = data;
- mo5_update_cart_bank(space->machine());
+ mo5_update_cart_bank(space.machine());
}
@@ -2203,14 +2203,14 @@ MACHINE_START ( mo5 )
WRITE8_HANDLER ( to9_ieee_w )
{
- logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, offset );
+ logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data, offset );
}
READ8_HANDLER ( to9_ieee_r )
{
- logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset );
+ logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), offset );
return 0;
}
@@ -2226,8 +2226,8 @@ READ8_HANDLER ( to9_ieee_r )
READ8_HANDLER ( to9_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), TO9_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), TO9_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
int count, inil, init, lt3;
count = to7_lightpen ? l.count : v.count;
inil = to7_lightpen ? l.inil : v.inil;
@@ -2241,7 +2241,7 @@ READ8_HANDLER ( to9_gatearray_r )
case 2: return (lt3 << 7) | (inil << 6);
case 3: return (v.init << 7) | (init << 6); /* != TO7/70 */
default:
- logerror( "$%04x to9_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to9_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -2315,7 +2315,7 @@ READ8_HANDLER ( to9_vreg_r )
case 0: /* palette data */
{
UINT8 c = to9_palette_data[ to9_palette_idx ];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
@@ -2339,7 +2339,7 @@ READ8_HANDLER ( to9_vreg_r )
WRITE8_HANDLER ( to9_vreg_w )
{
- LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xe7da + offset, data ));
+ LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), offset, 0xe7da + offset, data ));
switch ( offset )
{
@@ -2351,7 +2351,7 @@ WRITE8_HANDLER ( to9_vreg_w )
idx = to9_palette_idx / 2;
color = to9_palette_data[ 2 * idx + 1 ];
color = to9_palette_data[ 2 * idx ] | (color << 8);
- thom_set_palette( space->machine(), idx ^ 8, color & 0x1fff );
+ thom_set_palette( space.machine(), idx ^ 8, color & 0x1fff );
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
@@ -2362,11 +2362,11 @@ WRITE8_HANDLER ( to9_vreg_w )
break;
case 2: /* video mode */
- to9_set_video_mode( space->machine(), data, 0 );
+ to9_set_video_mode( space.machine(), data, 0 );
break;
case 3: /* border color */
- thom_set_border_color( space->machine(), data & 15 );
+ thom_set_border_color( space.machine(), data & 15 );
break;
default:
@@ -2394,7 +2394,7 @@ static UINT8 to9_soft_bank;
static void to9_update_cart_bank(running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int bank = 0;
int slot = ( mc6846_get_output_port(machine.device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */
@@ -2407,7 +2407,7 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 4)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
LOG_BANK(( "to9_update_cart_bank: CART is BASIC bank %i\n", to9_soft_bank ));
}
@@ -2419,7 +2419,7 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 4)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
LOG_BANK(( "to9_update_cart_bank: CART is software 1 bank %i\n", to9_soft_bank ));
}
@@ -2431,7 +2431,7 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 4)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
LOG_BANK(( "to9_update_cart_bank: CART is software 2 bank %i\n", to9_soft_bank ));
}
@@ -2445,16 +2445,16 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to9_cartridge_w) );
- space->install_legacy_read_handler( 0x0000, 0x0003, FUNC(to9_cartridge_r) );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to9_cartridge_w) );
+ space.install_legacy_read_handler( 0x0000, 0x0003, FUNC(to9_cartridge_r) );
}
LOG_BANK(( "to9_update_cart_bank: CART is cartridge bank %i\n", thom_cart_bank ));
}
} else
if ( old_cart_bank != 0 )
{
- space->nop_read( 0x0000, 0x3fff);
+ space.nop_read( 0x0000, 0x3fff);
LOG_BANK(( "to9_update_cart_bank: CART is unmapped\n"));
}
break;
@@ -2478,7 +2478,7 @@ static void to9_update_cart_bank_postload(running_machine *machine)
/* write signal to 0000-1fff generates a bank switch */
WRITE8_HANDLER ( to9_cartridge_w )
{
- int slot = ( mc6846_get_output_port(space->machine().device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */
+ int slot = ( mc6846_get_output_port(space.machine().device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */
if ( offset >= 0x2000 )
return;
@@ -2487,7 +2487,7 @@ WRITE8_HANDLER ( to9_cartridge_w )
thom_cart_bank = offset & 3;
else
to9_soft_bank = offset & 3;
- to9_update_cart_bank(space->machine());
+ to9_update_cart_bank(space.machine());
}
@@ -2495,12 +2495,12 @@ WRITE8_HANDLER ( to9_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_HANDLER ( to9_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- to9_update_cart_bank(space->machine());
+ to9_update_cart_bank(space.machine());
}
return data;
}
@@ -2510,7 +2510,7 @@ READ8_HANDLER ( to9_cartridge_r )
static void to9_update_ram_bank (running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 port = mc6846_get_output_port(machine.device("mc6846"));
UINT8 portb = sys_pia->port_b_z_mask();
UINT8 disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */
@@ -2545,7 +2545,7 @@ static void to9_update_ram_bank (running_machine &machine)
}
else
{
- space->nop_readwrite( 0xa000, 0xdfff);
+ space.nop_readwrite( 0xa000, 0xdfff);
}
old_ram_bank = bank;
LOG_BANK(( "to9_update_ram_bank: bank %i selected (pia=$%02X disk=%i)\n", bank, portb & 0xf8, disk ));
@@ -2668,7 +2668,7 @@ READ8_HANDLER ( to9_kbd_r )
/* bit 7: interrupt */
LOG_KBD(( "$%04x %f to9_kbd_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, pe=%i, irq=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to9_kbd_status,
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to9_kbd_status,
(to9_kbd_status & ACIA_6850_RDRF) ? 1 : 0,
(to9_kbd_status & ACIA_6850_TDRE) ? 1 : 0,
(to9_kbd_status & ACIA_6850_OVRN) ? 1 : 0,
@@ -2677,7 +2677,7 @@ READ8_HANDLER ( to9_kbd_r )
return to9_kbd_status;
case 1: /* get input data */
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to9_kbd_status &= ~(ACIA_6850_irq | ACIA_6850_PE);
if ( to9_kbd_overrun )
@@ -2685,13 +2685,13 @@ READ8_HANDLER ( to9_kbd_r )
else
to9_kbd_status &= ~(ACIA_6850_OVRN | ACIA_6850_RDRF);
to9_kbd_overrun = 0;
- LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to9_kbd_in ));
- to9_kbd_update_irq(space->machine());
+ LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to9_kbd_in ));
+ to9_kbd_update_irq(space.machine());
}
return to9_kbd_in;
default:
- logerror( "$%04x to9_kbd_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to9_kbd_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -2713,7 +2713,7 @@ WRITE8_HANDLER ( to9_kbd_w )
to9_kbd_overrun = 0;
to9_kbd_status = ACIA_6850_TDRE;
to9_kbd_intr = 0;
- LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
+ LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
}
else
{
@@ -2727,19 +2727,19 @@ WRITE8_HANDLER ( to9_kbd_w )
to9_kbd_intr = data >> 5;
LOG_KBD(( "$%04x %f to9_kbd_w: set control to $%02X (parity=%i, intr in=%i out=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
data, to9_kbd_parity, to9_kbd_intr >> 2,
(to9_kbd_intr & 3) ? 1 : 0 ));
}
- to9_kbd_update_irq(space->machine());
+ to9_kbd_update_irq(space.machine());
break;
case 1: /* output data */
to9_kbd_status &= ~(ACIA_6850_irq | ACIA_6850_TDRE);
- to9_kbd_update_irq(space->machine());
+ to9_kbd_update_irq(space.machine());
/* TODO: 1 ms delay here ? */
to9_kbd_status |= ACIA_6850_TDRE; /* data transmit ready again */
- to9_kbd_update_irq(space->machine());
+ to9_kbd_update_irq(space.machine());
switch ( data )
{
@@ -2758,19 +2758,19 @@ WRITE8_HANDLER ( to9_kbd_w )
case 0xFE: to9_kbd_periph = 0; break;
default:
- logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data );
+ logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data );
}
- thom_set_caps_led( space->machine(), !to9_kbd_caps );
+ thom_set_caps_led( space.machine(), !to9_kbd_caps );
LOG(( "$%04x %f to9_kbd_w: kbd command %02X (caps=%i, pad=%i, periph=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data,
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data,
to9_kbd_caps, to9_kbd_pad, to9_kbd_periph ));
break;
default:
- logerror( "$%04x to9_kbd_w: invalid offset %i (data=$%02X) \n", space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror( "$%04x to9_kbd_w: invalid offset %i (data=$%02X) \n", space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -3573,7 +3573,7 @@ static void to8_update_floppy_bank_postload(running_machine *machine)
static void to8_update_ram_bank (running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 bank = 0;
if ( to8_reg_sys1 & 0x10 )
@@ -3617,8 +3617,8 @@ static void to8_update_ram_bank (running_machine &machine)
{
/* RAM size is 256 KB only and unavailable
* bank requested */
- space->nop_readwrite( 0xa000, 0xbfff);
- space->nop_readwrite( 0xc000, 0xdfff);
+ space.nop_readwrite( 0xa000, 0xbfff);
+ space.nop_readwrite( 0xc000, 0xdfff);
}
to8_data_vpage = bank;
old_ram_bank = bank;
@@ -3637,7 +3637,7 @@ static void to8_update_ram_bank_postload(running_machine *machine)
static void to8_update_cart_bank (running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int bank = 0;
int bank_is_read_only = 0;
@@ -3656,14 +3656,14 @@ static void to8_update_cart_bank (running_machine &machine)
{
if (old_cart_bank < 8 || old_cart_bank > 11)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
if ( bank_is_read_only )
{
- space->nop_write( 0x0000, 0x3fff);
+ space.nop_write( 0x0000, 0x3fff);
}
else
{
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
}
}
}
@@ -3673,12 +3673,12 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->nop_write( 0x0000, 0x3fff);
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.nop_write( 0x0000, 0x3fff);
}
else
{
- space->install_readwrite_bank( 0x0000, 0x3fff,THOM_CART_BANK);
+ space.install_readwrite_bank( 0x0000, 0x3fff,THOM_CART_BANK);
}
}
}
@@ -3687,7 +3687,7 @@ static void to8_update_cart_bank (running_machine &machine)
{
/* RAM size is 256 KB only and unavailable
* bank requested */
- space->nop_readwrite( 0x0000, 0x3fff);
+ space.nop_readwrite( 0x0000, 0x3fff);
}
LOG_BANK(( "to8_update_cart_bank: CART is RAM bank %i (%s)\n",
to8_cart_vpage,
@@ -3699,17 +3699,17 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->nop_write( 0x0000, 0x3fff);
+ space.nop_write( 0x0000, 0x3fff);
}
else
{
if (to8_cart_vpage < 4)
{
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
}
else
{
- space->install_readwrite_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_readwrite_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
}
LOG_BANK(( "to8_update_cart_bank: update CART bank %i write status to %s\n",
@@ -3729,8 +3729,8 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 4 || old_cart_bank > 7 )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
}
LOG_BANK(( "to8_update_cart_bank: CART is internal bank %i\n", to8_soft_bank ));
}
@@ -3745,9 +3745,9 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
- space->install_legacy_read_handler( 0x0000, 0x0003, FUNC(to8_cartridge_r) );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
+ space.install_legacy_read_handler( 0x0000, 0x0003, FUNC(to8_cartridge_r) );
}
LOG_BANK(( "to8_update_cart_bank: CART is external cartridge bank %i\n", bank ));
}
@@ -3756,7 +3756,7 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank != 0 )
{
- space->nop_read( 0x0000, 0x3fff);
+ space.nop_read( 0x0000, 0x3fff);
LOG_BANK(( "to8_update_cart_bank: CART is unmapped\n"));
}
}
@@ -3789,7 +3789,7 @@ WRITE8_HANDLER ( to8_cartridge_w )
else
thom_cart_bank = offset & 3;
- to8_update_cart_bank(space->machine());
+ to8_update_cart_bank(space.machine());
}
@@ -3797,12 +3797,12 @@ WRITE8_HANDLER ( to8_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_HANDLER ( to8_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- to8_update_cart_bank(space->machine());
+ to8_update_cart_bank(space.machine());
}
return data;
}
@@ -3833,7 +3833,7 @@ static void to8_floppy_reset( running_machine &machine )
READ8_HANDLER ( to8_floppy_r )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
return 0;
if ( (to8_reg_sys1 & 0x80) && THOM_FLOPPY_EXT )
@@ -3871,8 +3871,8 @@ WRITE8_HANDLER ( to8_floppy_w )
READ8_HANDLER ( to8_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), TO8_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), TO8_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
int count, inil, init, lt3;
UINT8 res;
count = to7_lightpen ? l.count : v.count;
@@ -3893,9 +3893,9 @@ READ8_HANDLER ( to8_gatearray_r )
case 1: /* ram register / lightpen register 2 */
if ( to7_lightpen )
{
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
- thom_firq_2( space->machine(), 0 );
+ thom_firq_2( space.machine(), 0 );
to8_lightpen_intr = 0;
}
res = count & 0xff;
@@ -3916,12 +3916,12 @@ READ8_HANDLER ( to8_gatearray_r )
break;
default:
- logerror( "$%04x to8_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to8_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
res = 0;
}
LOG_VIDEO(( "$%04x %f to8_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xe7e4 + offset, res, to7_lightpen ));
return res;
@@ -3932,7 +3932,7 @@ READ8_HANDLER ( to8_gatearray_r )
WRITE8_HANDLER ( to8_gatearray_w )
{
LOG_VIDEO(( "$%04x %f to8_gatearray_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xe7e4 + offset, data ));
switch ( offset )
@@ -3946,25 +3946,25 @@ WRITE8_HANDLER ( to8_gatearray_w )
if ( to8_reg_sys1 & 0x10 )
{
to8_reg_ram = data;
- to8_update_ram_bank(space->machine());
+ to8_update_ram_bank(space.machine());
}
break;
case 2: /* cartridge register */
to8_reg_cart = data;
- to8_update_cart_bank(space->machine());
+ to8_update_cart_bank(space.machine());
break;
case 3: /* system register 1 */
to8_reg_sys1 = data;
- to8_update_floppy_bank(space->machine());
- to8_update_ram_bank(space->machine());
- to8_update_cart_bank(space->machine());
+ to8_update_floppy_bank(space.machine());
+ to8_update_ram_bank(space.machine());
+ to8_update_cart_bank(space.machine());
break;
default:
logerror( "$%04x to8_gatearray_w: invalid offset %i (data=$%02X)\n",
- space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -3979,7 +3979,7 @@ READ8_HANDLER ( to8_vreg_r )
/* 0xe7dc from external floppy drive aliases the video gate-array */
if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) && ( to8_reg_sys1 & 0x80 ) )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
return 0;
if ( THOM_FLOPPY_EXT )
@@ -3994,7 +3994,7 @@ READ8_HANDLER ( to8_vreg_r )
case 0: /* palette data */
{
UINT8 c = to9_palette_data[ to9_palette_idx ];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
@@ -4019,7 +4019,7 @@ READ8_HANDLER ( to8_vreg_r )
WRITE8_HANDLER ( to8_vreg_w )
{
LOG_VIDEO(( "$%04x %f to8_vreg_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xe7da + offset, data ));
switch ( offset )
@@ -4032,7 +4032,7 @@ WRITE8_HANDLER ( to8_vreg_w )
idx = to9_palette_idx / 2;
color = to9_palette_data[ 2 * idx + 1 ];
color = to9_palette_data[ 2 * idx ] | (color << 8);
- thom_set_palette( space->machine(), idx, color & 0x1fff );
+ thom_set_palette( space.machine(), idx, color & 0x1fff );
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
break;
@@ -4042,7 +4042,7 @@ WRITE8_HANDLER ( to8_vreg_w )
break;
case 2: /* display register */
- to9_set_video_mode( space->machine(), data, 1 );
+ to9_set_video_mode( space.machine(), data, 1 );
break;
case 3: /* system register 2 */
@@ -4055,8 +4055,8 @@ WRITE8_HANDLER ( to8_vreg_w )
else
{
to8_reg_sys2 = data;
- thom_set_video_page( space->machine(), data >> 6 );
- thom_set_border_color( space->machine(), data & 15 );
+ thom_set_video_page( space.machine(), data >> 6 );
+ thom_set_border_color( space.machine(), data & 15 );
}
break;
@@ -4498,12 +4498,12 @@ static void mo6_update_ram_bank_postload(running_machine *machine)
static void mo6_update_cart_bank (running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int b = (sys_pia->a_output() >> 5) & 1;
int bank = 0;
int bank_is_read_only = 0;
- // space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ // space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
if ( ( ( to8_reg_sys1 & 0x40 ) && ( to8_reg_cart & 0x20 ) ) || ( ! ( to8_reg_sys1 & 0x40 ) && ( mo5_reg_cart & 4 ) ) )
{
@@ -4520,14 +4520,14 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if (old_cart_bank < 8 || old_cart_bank > 11)
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
if ( bank_is_read_only )
{
- space->nop_write( 0xb000, 0xefff);
+ space.nop_write( 0xb000, 0xefff);
}
else
{
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
}
}
}
@@ -4538,12 +4538,12 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.nop_write( 0xb000, 0xefff);
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff,THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff,THOM_CART_BANK);
}
}
}
@@ -4555,17 +4555,17 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->nop_write( 0xb000, 0xefff);
+ space.nop_write( 0xb000, 0xefff);
}
else
{
if (to8_cart_vpage < 4)
{
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK );
}
}
LOG_BANK(( "mo6_update_cart_bank: update CART bank %i write status to %s\n",
@@ -4582,8 +4582,8 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.nop_write( 0xb000, 0xefff);
}
LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i (A7CB style)\n", bank ));
}
@@ -4600,11 +4600,11 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff);
} else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
}
}
LOG_BANK(( "mo6_update_cart_bank: CART is RAM bank %i (MO5 compat.) (%s)\n",
@@ -4615,12 +4615,12 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff);
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
}
LOG_BANK(( "mo5_update_cart_bank: update CART bank %i write status to %s\n",
to8_cart_vpage,
@@ -4647,8 +4647,8 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 4 || old_cart_bank > 7 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
}
LOG_BANK(( "mo6_update_cart_bank: CART is internal ROM bank %i\n", b ));
}
@@ -4663,9 +4663,9 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
- space->install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo6_cartridge_r) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
+ space.install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo6_cartridge_r) );
}
LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i\n", bank ));
}
@@ -4674,7 +4674,7 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank != 0 )
{
- space->nop_read( 0xb000, 0xefff );
+ space.nop_read( 0xb000, 0xefff );
LOG_BANK(( "mo6_update_cart_bank: CART is unmapped\n"));
}
}
@@ -4704,7 +4704,7 @@ WRITE8_HANDLER ( mo6_cartridge_w )
return;
thom_cart_bank = offset & 3;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
}
@@ -4712,12 +4712,12 @@ WRITE8_HANDLER ( mo6_cartridge_w )
/* read signal generates a bank switch */
READ8_HANDLER ( mo6_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + 0xbffc + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
}
return data;
}
@@ -4728,7 +4728,7 @@ WRITE8_HANDLER ( mo6_ext_w )
{
/* MO5 network extension compatible */
mo5_reg_cart = data;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
}
@@ -4930,8 +4930,8 @@ const pia6821_interface mo6_pia6821_sys =
READ8_HANDLER ( mo6_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), MO6_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), MO6_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
int count, inil, init, lt3;
UINT8 res;
count = to7_lightpen ? l.count : v.count;
@@ -4952,9 +4952,9 @@ READ8_HANDLER ( mo6_gatearray_r )
case 1: /* ram register / lightpen register 2 */
if ( to7_lightpen )
{
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
- thom_firq_2( space->machine(), 0 );
+ thom_firq_2( space.machine(), 0 );
to8_lightpen_intr = 0;
}
res = count & 0xff;
@@ -4975,12 +4975,12 @@ READ8_HANDLER ( mo6_gatearray_r )
break;
default:
- logerror( "$%04x mo6_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x mo6_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
res = 0;
}
LOG_VIDEO(( "$%04x %f mo6_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xa7e4 + offset, res, to7_lightpen ));
return res;
@@ -4991,7 +4991,7 @@ READ8_HANDLER ( mo6_gatearray_r )
WRITE8_HANDLER ( mo6_gatearray_w )
{
LOG_VIDEO(( "$%04x %f mo6_gatearray_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xa7e4 + offset, data ));
switch ( offset )
@@ -5005,23 +5005,23 @@ WRITE8_HANDLER ( mo6_gatearray_w )
if ( to8_reg_sys1 & 0x10 )
{
to8_reg_ram = data;
- mo6_update_ram_bank(space->machine());
+ mo6_update_ram_bank(space.machine());
}
break;
case 2: /* cartridge register */
to8_reg_cart = data;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
break;
case 3: /* system register 1 */
to8_reg_sys1 = data;
- mo6_update_ram_bank(space->machine());
- mo6_update_cart_bank(space->machine());
+ mo6_update_ram_bank(space.machine());
+ mo6_update_cart_bank(space.machine());
break;
default:
- logerror( "$%04x mo6_gatearray_w: invalid offset %i (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror( "$%04x mo6_gatearray_w: invalid offset %i (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -5035,7 +5035,7 @@ READ8_HANDLER ( mo6_vreg_r )
/* 0xa7dc from external floppy drive aliases the video gate-array */
if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) )
{
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
return to7_floppy_r( space, 0xc );
}
@@ -5061,7 +5061,7 @@ READ8_HANDLER ( mo6_vreg_r )
WRITE8_HANDLER ( mo6_vreg_w )
{
LOG_VIDEO(( "$%04x %f mo6_vreg_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xa7da + offset, data ));
switch ( offset )
@@ -5076,7 +5076,7 @@ WRITE8_HANDLER ( mo6_vreg_w )
if ( ( to8_reg_sys1 & 0x80 ) && ( to8_reg_ram & 0x80 ) )
to7_floppy_w( space, 0xc, data );
else
- to9_set_video_mode( space->machine(), data, 2 );
+ to9_set_video_mode( space.machine(), data, 2 );
break;
case 3: /* system register 2 */
@@ -5086,9 +5086,9 @@ WRITE8_HANDLER ( mo6_vreg_w )
else
{
to8_reg_sys2 = data;
- thom_set_video_page( space->machine(), data >> 6 );
- thom_set_border_color( space->machine(), data & 15 );
- mo6_update_cart_bank(space->machine());
+ thom_set_video_page( space.machine(), data >> 6 );
+ thom_set_border_color( space.machine(), data & 15 );
+ mo6_update_cart_bank(space.machine());
}
break;
@@ -5213,13 +5213,13 @@ MACHINE_START ( mo6 )
READ8_HANDLER ( mo5nr_net_r )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
return 0;
if ( to7_controller_type )
return to7_floppy_r ( space, offset );
- logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset );
+ logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), offset );
return 0;
}
@@ -5232,7 +5232,7 @@ WRITE8_HANDLER ( mo5nr_net_w )
to7_floppy_w ( space, offset, data );
else
logerror( "$%04x %f mo5nr_net_w: write $%02X to reg %i\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, offset );
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data, offset );
}
@@ -5245,7 +5245,7 @@ WRITE8_HANDLER ( mo5nr_net_w )
READ8_HANDLER( mo5nr_prn_r )
{
- centronics_device *printer = space->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
UINT8 result = 0;
result |= !printer->busy_r() << 7;
@@ -5256,7 +5256,7 @@ READ8_HANDLER( mo5nr_prn_r )
WRITE8_HANDLER( mo5nr_prn_w )
{
- centronics_device *printer = space->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
/* TODO: understand other bits */
printer->strobe_w(BIT(data, 3));
diff --git a/src/mess/machine/ti85.c b/src/mess/machine/ti85.c
index 7147beff7aa..f065c7f8017 100644
--- a/src/mess/machine/ti85.c
+++ b/src/mess/machine/ti85.c
@@ -38,17 +38,17 @@ static TIMER_CALLBACK(ti85_timer_callback)
}
}
-inline void ti8x_update_bank(address_space *space, UINT8 bank, UINT8 *base, UINT8 page, bool is_ram)
+inline void ti8x_update_bank(address_space &space, UINT8 bank, UINT8 *base, UINT8 page, bool is_ram)
{
- ti85_state *state = space->machine().driver_data<ti85_state>();
+ ti85_state *state = space.machine().driver_data<ti85_state>();
static const char *const tag[] = {"bank1", "bank2", "bank3", "bank4"};
state->membank(tag[bank&3])->set_base(base + (0x4000 * page));
if (is_ram)
- space->install_write_bank(bank * 0x4000, bank * 0x4000 + 0x3fff, tag[bank&3]);
+ space.install_write_bank(bank * 0x4000, bank * 0x4000 + 0x3fff, tag[bank&3]);
else
- space->nop_write(bank * 0x4000, bank * 0x4000 + 0x3fff);
+ space.nop_write(bank * 0x4000, bank * 0x4000 + 0x3fff);
}
static void update_ti85_memory (running_machine &machine)
@@ -60,7 +60,7 @@ static void update_ti85_memory (running_machine &machine)
static void update_ti83p_memory (running_machine &machine)
{
ti85_state *state = machine.driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
if (state->m_ti8x_memory_page_1 & 0x40)
{
@@ -84,7 +84,7 @@ static void update_ti83p_memory (running_machine &machine)
static void update_ti86_memory (running_machine &machine)
{
ti85_state *state = machine.driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
if (state->m_ti8x_memory_page_1 & 0x40)
{
@@ -112,7 +112,7 @@ static void update_ti86_memory (running_machine &machine)
void ti85_state::machine_start()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_bios = memregion("bios")->base();
m_timer_interrupt_mask = 0;
@@ -133,8 +133,8 @@ void ti85_state::machine_start()
machine().scheduler().timer_pulse(attotime::from_hz(200), FUNC(ti85_timer_callback));
- space->unmap_write(0x0000, 0x3fff);
- space->unmap_write(0x4000, 0x7fff);
+ space.unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x4000, 0x7fff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios + 0x04000);
}
@@ -149,7 +149,7 @@ MACHINE_RESET_MEMBER(ti85_state,ti85)
MACHINE_START_MEMBER(ti85_state,ti83p)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_bios = memregion("bios")->base();
m_timer_interrupt_mask = 0;
@@ -171,9 +171,9 @@ MACHINE_START_MEMBER(ti85_state,ti83p)
m_ti8x_ram = auto_alloc_array(machine(), UINT8, 32*1024);
memset(m_ti8x_ram, 0, sizeof(UINT8)*32*1024);
- space->unmap_write(0x0000, 0x3fff);
- space->unmap_write(0x4000, 0x7fff);
- space->unmap_write(0x8000, 0xbfff);
+ space.unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x4000, 0x7fff);
+ space.unmap_write(0x8000, 0xbfff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios);
@@ -187,7 +187,7 @@ MACHINE_START_MEMBER(ti85_state,ti83p)
MACHINE_START_MEMBER(ti85_state,ti86)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_bios = memregion("bios")->base();
m_timer_interrupt_mask = 0;
@@ -209,7 +209,7 @@ MACHINE_START_MEMBER(ti85_state,ti86)
m_ti8x_ram = auto_alloc_array(machine(), UINT8, 128*1024);
memset(m_ti8x_ram, 0, sizeof(UINT8)*128*1024);
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios + 0x04000);
@@ -608,7 +608,7 @@ static void ti8x_snapshot_setup_registers (running_machine &machine, UINT8 * dat
static void ti85_setup_snapshot (running_machine &machine, UINT8 * data)
{
ti85_state *state = machine.driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
int i;
unsigned char lo,hi;
unsigned char * hdw = data + 0x8000 + 0x94;
@@ -617,7 +617,7 @@ static void ti85_setup_snapshot (running_machine &machine, UINT8 * data)
/* Memory dump */
for (i = 0; i < 0x8000; i++)
- space->write_byte(i + 0x8000, data[i+0x94]);
+ space.write_byte(i + 0x8000, data[i+0x94]);
state->m_keypad_mask = hdw[0x00]&0x7f;
diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c
index b420bea7fe2..01232da6a84 100644
--- a/src/mess/machine/trs80.c
+++ b/src/mess/machine/trs80.c
@@ -892,9 +892,9 @@ MACHINE_RESET_MEMBER(trs80_state,trs80m4)
MACHINE_RESET_MEMBER(trs80_state,lnw80)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_cassette_data = 0;
m_reg_load = 1;
- lnw80_fe_w(*space, 0, 0);
+ lnw80_fe_w(space, 0, 0);
}
diff --git a/src/mess/machine/upd71071.c b/src/mess/machine/upd71071.c
index e174ce846eb..4259cdee307 100644
--- a/src/mess/machine/upd71071.c
+++ b/src/mess/machine/upd71071.c
@@ -123,7 +123,7 @@ static TIMER_CALLBACK(dma_transfer_timer)
// single byte or word transfer
device_t* device = (device_t*)ptr;
upd71071_t* dmac = get_safe_token(device);
- address_space* space = device->machine().device(dmac->intf->cputag)->memory().space(AS_PROGRAM);
+ address_space& space = *device->machine().device(dmac->intf->cputag)->memory().space(AS_PROGRAM);
int channel = param;
UINT16 data = 0; // data to transfer
@@ -134,7 +134,7 @@ static TIMER_CALLBACK(dma_transfer_timer)
case 0x04: // I/O -> memory
if(dmac->intf->dma_read[channel])
data = dmac->intf->dma_read[channel](device->machine());
- space->write_byte(dmac->reg.address_current[channel],data & 0xff);
+ space.write_byte(dmac->reg.address_current[channel],data & 0xff);
if(dmac->reg.mode_control[channel] & 0x20) // Address direction
dmac->reg.address_current[channel]--;
else
@@ -152,7 +152,7 @@ static TIMER_CALLBACK(dma_transfer_timer)
dmac->reg.count_current[channel]--;
break;
case 0x08: // memory -> I/O
- data = space->read_byte(dmac->reg.address_current[channel]);
+ data = space.read_byte(dmac->reg.address_current[channel]);
if(dmac->intf->dma_read[channel])
dmac->intf->dma_write[channel](device->machine(),data);
if(dmac->reg.mode_control[channel] & 0x20) // Address direction
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index b313119afb0..394ae4d8b77 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -170,13 +170,13 @@ void vector06_state::machine_start()
void vector06_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(vector06_irq_callback);
- space->install_read_bank (0x0000, 0x7fff, "bank1");
- space->install_write_bank(0x0000, 0x7fff, "bank2");
- space->install_read_bank (0x8000, 0xffff, "bank3");
- space->install_write_bank(0x8000, 0xffff, "bank4");
+ space.install_read_bank (0x0000, 0x7fff, "bank1");
+ space.install_write_bank(0x0000, 0x7fff, "bank2");
+ space.install_read_bank (0x8000, 0xffff, "bank3");
+ space.install_write_bank(0x8000, 0xffff, "bank4");
membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000);
membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x0000);
diff --git a/src/mess/machine/vtech2.c b/src/mess/machine/vtech2.c
index d0758f8c67c..e06c146ad64 100644
--- a/src/mess/machine/vtech2.c
+++ b/src/mess/machine/vtech2.c
@@ -31,19 +31,19 @@ static const UINT8 laser_fdc_wrprot[2] = {0x80, 0x80};
static void mwa_bank(running_machine &machine, int bank, int offs, int data);
/* wrappers for bank #1 to #4 */
-static WRITE8_HANDLER ( mwa_bank1 ) { mwa_bank(space->machine(), 0,offset,data); }
-static WRITE8_HANDLER ( mwa_bank2 ) { mwa_bank(space->machine(), 1,offset,data); }
-static WRITE8_HANDLER ( mwa_bank3 ) { mwa_bank(space->machine(), 2,offset,data); }
-static WRITE8_HANDLER ( mwa_bank4 ) { mwa_bank(space->machine(), 3,offset,data); }
+static WRITE8_HANDLER ( mwa_bank1 ) { mwa_bank(space.machine(), 0,offset,data); }
+static WRITE8_HANDLER ( mwa_bank2 ) { mwa_bank(space.machine(), 1,offset,data); }
+static WRITE8_HANDLER ( mwa_bank3 ) { mwa_bank(space.machine(), 2,offset,data); }
+static WRITE8_HANDLER ( mwa_bank4 ) { mwa_bank(space.machine(), 3,offset,data); }
/* read from banked memory (handle memory mapped i/o) */
static int mra_bank(running_machine &machine, int bank, int offs);
/* wrappers for bank #1 to #4 */
-static READ8_HANDLER ( mra_bank1 ) { return mra_bank(space->machine(),0,offset); }
-static READ8_HANDLER ( mra_bank2 ) { return mra_bank(space->machine(),1,offset); }
-static READ8_HANDLER ( mra_bank3 ) { return mra_bank(space->machine(),2,offset); }
-static READ8_HANDLER ( mra_bank4 ) { return mra_bank(space->machine(),3,offset); }
+static READ8_HANDLER ( mra_bank1 ) { return mra_bank(space.machine(),0,offset); }
+static READ8_HANDLER ( mra_bank2 ) { return mra_bank(space.machine(),1,offset); }
+static READ8_HANDLER ( mra_bank3 ) { return mra_bank(space.machine(),2,offset); }
+static READ8_HANDLER ( mra_bank4 ) { return mra_bank(space.machine(),3,offset); }
/* read banked memory (handle memory mapped i/o) */
static const struct { read8_space_func func; const char *name; } mra_bank_soft[4] =
diff --git a/src/mess/machine/wswan.c b/src/mess/machine/wswan.c
index 9efc0c83209..2912d891507 100644
--- a/src/mess/machine/wswan.c
+++ b/src/mess/machine/wswan.c
@@ -223,7 +223,7 @@ MACHINE_START_MEMBER(wswan_state,wscolor)
void wswan_state::machine_reset()
{
- address_space *space = machine().device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine().device( "maincpu")->memory().space( AS_PROGRAM );
/* Intialize ports */
memcpy( m_ws_portram, ws_portram_init, 256 );
@@ -231,8 +231,8 @@ void wswan_state::machine_reset()
/* Initialize VDP */
memset( &m_vdp, 0, sizeof( m_vdp ) );
- m_vdp.vram = (UINT8*)space->get_read_ptr(0);
- m_vdp.palette_vram = (UINT8*)space->get_read_ptr(( m_system_type == TYPE_WSC ) ? 0xFE00 : 0 );
+ m_vdp.vram = (UINT8*)space.get_read_ptr(0);
+ m_vdp.palette_vram = (UINT8*)space.get_read_ptr(( m_system_type == TYPE_WSC ) ? 0xFE00 : 0 );
m_vdp.current_line = 145; /* Randomly chosen, beginning of VBlank period to give cart some time to boot up */
m_vdp.color_mode = 0;
m_vdp.colors_16 = 0;
@@ -1459,9 +1459,9 @@ static TIMER_CALLBACK(wswan_scanline_interrupt)
/* Handle Sound DMA */
if ( ( state->m_sound_dma.enable & 0x88 ) == 0x80 )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM );
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM );
/* TODO: Output sound DMA byte */
- state->wswan_port_w( *space, 0x89, space->read_byte(state->m_sound_dma.source ) );
+ state->wswan_port_w( space, 0x89, space.read_byte(state->m_sound_dma.source ) );
state->m_sound_dma.size--;
state->m_sound_dma.source = ( state->m_sound_dma.source + 1 ) & 0x0FFFFF;
if ( state->m_sound_dma.size == 0 )
diff --git a/src/mess/machine/x68k_neptunex.c b/src/mess/machine/x68k_neptunex.c
index 58fb3868162..f045b52b09c 100644
--- a/src/mess/machine/x68k_neptunex.c
+++ b/src/mess/machine/x68k_neptunex.c
@@ -47,14 +47,14 @@ void x68k_neptune_device::device_start()
device_t* cpu = machine().device("maincpu");
char mac[7];
UINT32 num = rand();
- address_space* space = cpu->memory().space(AS_PROGRAM);
+ address_space& space = *cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
memset(m_prom, 0x57, 16);
sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff);
mac[0] = 0; mac[1] = 0; // avoid gcc warning
memcpy(m_prom, mac, 6);
m_dp8390->set_mac(mac);
- space->install_readwrite_handler(0xece000,0xece3ff,read16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_r),this),write16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_w),this),0xffffffff);
+ space.install_readwrite_handler(0xece000,0xece3ff,read16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_r),this),write16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_w),this),0xffffffff);
}
void x68k_neptune_device::device_reset() {
diff --git a/src/mess/machine/x68k_scsiext.c b/src/mess/machine/x68k_scsiext.c
index b9e33e81c0e..4c207dd2906 100644
--- a/src/mess/machine/x68k_scsiext.c
+++ b/src/mess/machine/x68k_scsiext.c
@@ -68,13 +68,13 @@ void x68k_scsiext_device::device_start()
device_t* cpu = machine().device("maincpu");
UINT8* ROM;
astring temp;
- address_space* space = cpu->memory().space(AS_PROGRAM);
+ address_space& space = *cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
- space->install_read_bank(0xea0020,0xea1fff,0,0,"scsi_ext");
- space->unmap_write(0xea0020,0xea1fff,0,0);
+ space.install_read_bank(0xea0020,0xea1fff,0,0,"scsi_ext");
+ space.unmap_write(0xea0020,0xea1fff,0,0);
ROM = machine().root_device().memregion(subtag(temp,"scsiexrom"))->base();
machine().root_device().membank("scsi_ext")->set_base(ROM);
- space->install_readwrite_handler(0xea0000,0xea001f,0,0,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff);
+ space.install_readwrite_handler(0xea0000,0xea001f,0,0,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff);
}
void x68k_scsiext_device::device_reset()
diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c
index ff97265ea7b..47e7394119a 100644
--- a/src/mess/machine/z80ne.c
+++ b/src/mess/machine/z80ne.c
@@ -184,12 +184,12 @@ DIRECT_UPDATE_MEMBER(z80ne_state::z80ne_nmi_delay_count)
*/
DIRECT_UPDATE_MEMBER(z80ne_state::z80ne_reset_delay_count)
{
- address_space *space = machine().device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("z80ne")->memory().space(AS_PROGRAM);
/*
* TODO: when debugger is active, his memory access causes this callback
*
*/
- if(!space->debugger_access())
+ if(!space.debugger_access())
m_reset_delay_counter--;
if (!m_reset_delay_counter)
@@ -213,7 +213,7 @@ static void reset_lx388(running_machine &machine)
static void reset_lx382_banking(running_machine &machine)
{
z80ne_state *state = machine.driver_data<z80ne_state>();
- address_space *space = machine.device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("z80ne")->memory().space(AS_PROGRAM);
/* switch to ROM bank at address 0x0000 */
state->membank("bank1")->set_entry(1);
@@ -221,13 +221,13 @@ static void reset_lx382_banking(running_machine &machine)
/* after the first 3 bytes have been read from ROM, switch the RAM back in */
state->m_reset_delay_counter = 2;
- space->set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
}
static void reset_lx390_banking(running_machine &machine)
{
z80ne_state *state = machine.driver_data<z80ne_state>();
- address_space *space = machine.device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("z80ne")->memory().space(AS_PROGRAM);
state->m_reset_delay_counter = 0;
switch (machine.root_device().ioport("CONFIG")->read() & 0x07) {
@@ -240,7 +240,7 @@ static void reset_lx390_banking(running_machine &machine)
state->membank("bank4")->set_entry(0); /* RAM at 0xF000 */
/* after the first 3 bytes have been read from ROM, switch the RAM back in */
state->m_reset_delay_counter = 2;
- space->set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
break;
case 0x02: /* EP548 16k BASIC */
if (VERBOSE)
@@ -288,7 +288,7 @@ static void reset_lx390_banking(running_machine &machine)
MACHINE_RESET_MEMBER(z80ne_state,z80ne_base)
{
int i;
- address_space *space = machine().device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("z80ne")->memory().space(AS_PROGRAM);
LOG(("In MACHINE_RESET z80ne_base\n"));
@@ -336,7 +336,7 @@ MACHINE_RESET_MEMBER(z80ne_state,z80ne_base)
ay31015_set_transmitter_clock( m_ay31015, m_cass_data.speed * 16.0);
m_nmi_delay_counter = 0;
- lx385_ctrl_w(*space, 0, 0);
+ lx385_ctrl_w(space, 0, 0);
}
diff --git a/src/mess/machine/zx.c b/src/mess/machine/zx.c
index 1d26d10c68c..adb15f86cc8 100644
--- a/src/mess/machine/zx.c
+++ b/src/mess/machine/zx.c
@@ -13,9 +13,9 @@
#define DEBUG_ZX81_PORTS 1
#define DEBUG_ZX81_VSYNC 1
-#define LOG_ZX81_IOR(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space->machine().primary_screen->vpos(), _comment); } while (0)
-#define LOG_ZX81_IOW(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space->machine().primary_screen->vpos(), _comment); } while (0)
-#define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", space->machine().primary_screen->vpos()); } while (0)
+#define LOG_ZX81_IOR(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().primary_screen->vpos(), _comment); } while (0)
+#define LOG_ZX81_IOW(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().primary_screen->vpos(), _comment); } while (0)
+#define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", space.machine().primary_screen->vpos()); } while (0)
WRITE8_MEMBER(zx_state::zx_ram_w)
@@ -44,10 +44,10 @@ READ8_MEMBER( zx_state::zx_ram_r )
DRIVER_INIT_MEMBER(zx_state,zx)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
- space->install_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, write8_delegate(FUNC(zx_state::zx_ram_w),this));
+ space.install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ space.install_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, write8_delegate(FUNC(zx_state::zx_ram_w),this));
membank("bank1")->set_base(memregion("maincpu")->base() + 0x4000);
}
diff --git a/src/mess/video/a7800.c b/src/mess/video/a7800.c
index e78c5265918..0e05127d4cb 100644
--- a/src/mess/video/a7800.c
+++ b/src/mess/video/a7800.c
@@ -28,7 +28,7 @@
#define TRIGGER_HSYNC 64717
-#define READ_MEM(x) space->read_byte(x)
+#define READ_MEM(x) space.read_byte(x)
/********** Maria ***********/
@@ -86,7 +86,7 @@ void a7800_state::video_start()
static void maria_draw_scanline(running_machine &machine)
{
a7800_state *state = machine.driver_data<a7800_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
unsigned int graph_adr,data_addr;
int width,hpos,pal,mode,ind;
unsigned int dl;
@@ -321,7 +321,7 @@ TIMER_DEVICE_CALLBACK( a7800_interrupt )
a7800_state *state = timer.machine().driver_data<a7800_state>();
int frame_scanline;
UINT8 *ROM = timer.machine().root_device().memregion("maincpu")->base();
- address_space* space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
state->m_maria_scanline++;
diff --git a/src/mess/video/ac1.c b/src/mess/video/ac1.c
index a9566b833ee..728cc44cfd2 100644
--- a/src/mess/video/ac1.c
+++ b/src/mess/video/ac1.c
@@ -29,13 +29,13 @@ void ac1_state::video_start()
SCREEN_UPDATE_IND16( ac1 )
{
int x,y;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(y = 0; y < 16; y++ )
{
for(x = 0; x < 64; x++ )
{
- int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64);
+ int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, 63*6-x*6,15*8-y*8);
}
}
@@ -45,13 +45,13 @@ SCREEN_UPDATE_IND16( ac1 )
SCREEN_UPDATE_IND16( ac1_32 )
{
int x,y;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(y = 0; y < 32; y++ )
{
for(x = 0; x < 64; x++ )
{
- int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64);
+ int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, 63*6-x*6,31*8-y*8);
}
}
diff --git a/src/mess/video/apple3.c b/src/mess/video/apple3.c
index cfcea2b8c7b..8cc15336dea 100644
--- a/src/mess/video/apple3.c
+++ b/src/mess/video/apple3.c
@@ -40,7 +40,7 @@ static const UINT32 text_map[] =
void apple3_write_charmem(running_machine &machine)
{
apple3_state *state = machine.driver_data<apple3_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
static const UINT32 screen_hole_map[] =
{
0x478, 0x4f8, 0x578, 0x5f8, 0x678, 0x6f8, 0x778, 0x7f8
@@ -52,12 +52,12 @@ void apple3_write_charmem(running_machine &machine)
{
for (j = 0; j < 4; j++)
{
- addr = 0x7f & space->read_byte(screen_hole_map[i] + 0x400 + j + 0);
- val = space->read_byte(screen_hole_map[i] + j + 0);
+ addr = 0x7f & space.read_byte(screen_hole_map[i] + 0x400 + j + 0);
+ val = space.read_byte(screen_hole_map[i] + j + 0);
state->m_char_mem[((addr * 8) + ((i & 3) * 2) + 0) & 0x3ff] = val;
- addr = 0x7f & space->read_byte(screen_hole_map[i] + 0x400 + j + 4);
- val = space->read_byte(screen_hole_map[i] + j + 4);
+ addr = 0x7f & space.read_byte(screen_hole_map[i] + 0x400 + j + 4);
+ val = space.read_byte(screen_hole_map[i] + j + 4);
state->m_char_mem[((addr * 8) + ((i & 3) * 2) + 1) & 0x3ff] = val;
}
}
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
index 05ac2730f6c..e132ede0151 100644
--- a/src/mess/video/bbc.c
+++ b/src/mess/video/bbc.c
@@ -611,12 +611,12 @@ WRITE8_MEMBER(bbc_state::bbc_6845_w)
READ8_HANDLER (bbc_6845_r)
{
- mc6845_device *mc6845 = space->machine().device<mc6845_device>("mc6845");
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>("mc6845");
switch (offset&1)
{
- case 0: return mc6845->status_r(*space,0); break;
- case 1: return mc6845->register_r(*space,0); break;
+ case 0: return mc6845->status_r(space,0); break;
+ case 1: return mc6845->register_r(space,0); break;
}
return 0;
diff --git a/src/mess/video/cgenie.c b/src/mess/video/cgenie.c
index 689f00992bb..043d97a35a8 100644
--- a/src/mess/video/cgenie.c
+++ b/src/mess/video/cgenie.c
@@ -58,7 +58,7 @@ static void cgenie_offset_xy(cgenie_state *state)
***************************************************************************/
WRITE8_HANDLER ( cgenie_register_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
//int addr;
switch (state->m_crt.idx)
@@ -160,7 +160,7 @@ WRITE8_HANDLER ( cgenie_register_w )
***************************************************************************/
WRITE8_HANDLER ( cgenie_index_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_crt.idx = data & 15;
}
@@ -169,8 +169,8 @@ WRITE8_HANDLER ( cgenie_index_w )
***************************************************************************/
READ8_HANDLER ( cgenie_register_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
- return cgenie_get_register(space->machine(), state->m_crt.idx);
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
+ return cgenie_get_register(space.machine(), state->m_crt.idx);
}
/***************************************************************************
@@ -222,7 +222,7 @@ int cgenie_get_register(running_machine &machine, int indx)
***************************************************************************/
READ8_HANDLER ( cgenie_index_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_crt.idx;
}
diff --git a/src/mess/video/cirrus.c b/src/mess/video/cirrus.c
index b2e43c84069..16c4d71ba41 100644
--- a/src/mess/video/cirrus.c
+++ b/src/mess/video/cirrus.c
@@ -163,7 +163,7 @@ const struct pc_svga_interface cirrus_svga_interface =
void cirrus_device::device_start()
{
pc_vga_init(machine(), NULL, &cirrus_svga_interface);
- pc_vga_io_init(machine(), machine().device("ppc1")->memory().space(AS_PROGRAM), 0xC00A0000, machine().device("ppc1")->memory().space(AS_PROGRAM), 0x80000000);
+ pc_vga_io_init(machine(), *machine().device("ppc1")->memory().space(AS_PROGRAM), 0xC00A0000, *machine().device("ppc1")->memory().space(AS_PROGRAM), 0x80000000);
}
//-------------------------------------------------
diff --git a/src/mess/video/dai.c b/src/mess/video/dai.c
index 895138ab858..f173e60f121 100644
--- a/src/mess/video/dai.c
+++ b/src/mess/video/dai.c
@@ -58,7 +58,7 @@ void dai_state::video_start()
SCREEN_UPDATE_IND16( dai )
{
dai_state *state = screen.machine().driver_data<dai_state>();
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
int i, j, k, l;
UINT8* char_rom = state->memregion("gfx1")->base();
@@ -102,8 +102,8 @@ SCREEN_UPDATE_IND16( dai )
while (current_scan_line < dai_scan_lines)
{
- mode = space->read_byte(current_video_memory_address--);
- colour = space->read_byte(current_video_memory_address--);
+ mode = space.read_byte(current_video_memory_address--);
+ colour = space.read_byte(current_video_memory_address--);
line_repeat_count = mode & 0x0f;
horizontal_resolution = (mode & 0x30) >> 4;
display_mode = (mode & 0xc0) >> 6;
@@ -123,8 +123,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<11; i++)
{
@@ -143,8 +143,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -163,8 +163,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<22; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -182,8 +182,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -202,8 +202,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<44; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -220,8 +220,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -240,8 +240,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<66; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -258,8 +258,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -284,8 +284,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<11; i++)
{
@@ -304,8 +304,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -325,8 +325,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<22; i++)
{
@@ -345,8 +345,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -366,8 +366,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<44; i++)
{
@@ -385,8 +385,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -405,8 +405,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<66; i++)
{
@@ -424,8 +424,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -450,8 +450,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<11; i++)
{
@@ -470,8 +470,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -490,8 +490,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<22; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -509,8 +509,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -529,8 +529,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<44; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -547,8 +547,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -567,8 +567,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<66; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -585,8 +585,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -610,8 +610,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<11; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -629,8 +629,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -649,8 +649,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<22; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -668,8 +668,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -688,8 +688,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<44; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -706,8 +706,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -725,8 +725,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<66; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -743,8 +743,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
diff --git a/src/mess/video/dgn_beta.c b/src/mess/video/dgn_beta.c
index 3881af5e88c..747f6cacb94 100644
--- a/src/mess/video/dgn_beta.c
+++ b/src/mess/video/dgn_beta.c
@@ -298,6 +298,6 @@ void dgnbeta_vid_set_gctrl(running_machine &machine, int data)
/* Write handler for colour, pallate ram */
WRITE8_HANDLER(dgnbeta_colour_ram_w)
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
state->m_ColourRAM[offset]=data&0x0f; /* Colour ram 4 bit and write only to CPU */
}
diff --git a/src/mess/video/epnick.c b/src/mess/video/epnick.c
index 5bd81760def..0e50d3aeabc 100644
--- a/src/mess/video/epnick.c
+++ b/src/mess/video/epnick.c
@@ -968,7 +968,7 @@ READ8_HANDLER( nick_reg_r )
WRITE8_HANDLER( epnick_reg_w )
{
- ep_state *state = space->machine().driver_data<ep_state>();
+ ep_state *state = space.machine().driver_data<ep_state>();
NICK_STATE *nick = state->nick;
//mame_printf_info("Nick write %02x %02x\r\n",offset, data);
diff --git a/src/mess/video/galaxy.c b/src/mess/video/galaxy.c
index db652cecf24..08bae05ecd7 100644
--- a/src/mess/video/galaxy.c
+++ b/src/mess/video/galaxy.c
@@ -16,7 +16,7 @@
static TIMER_CALLBACK( gal_video )
{
galaxy_state *state = machine.driver_data<galaxy_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int y, x;
if (state->m_interrupts_enabled == TRUE)
{
@@ -39,7 +39,7 @@ static TIMER_CALLBACK( gal_video )
}
else
{
- state->m_code = space->read_byte(addr) & 0xbf;
+ state->m_code = space.read_byte(addr) & 0xbf;
state->m_code += (state->m_code & 0x80) >> 1;
state->m_code = gfx[(state->m_code & 0x7f) +(dat << 7 )] ^ 0xff;
state->m_first = 0;
@@ -68,7 +68,7 @@ static TIMER_CALLBACK( gal_video )
}
else
{
- state->m_code = space->read_byte(addr) ^ 0xff;
+ state->m_code = space.read_byte(addr) ^ 0xff;
state->m_first = 0;
}
y = state->m_gal_cnt / 48 - 2;
@@ -81,7 +81,7 @@ static TIMER_CALLBACK( gal_video )
}
if ((x / 8 >= 11) && (x / 8 < 44))
{
- state->m_code = space->read_byte(state->m_start_addr + y * 32 + (state->m_gal_cnt % 48) - 11) ^ 0xff;
+ state->m_code = space.read_byte(state->m_start_addr + y * 32 + (state->m_gal_cnt % 48) - 11) ^ 0xff;
}
else
{
diff --git a/src/mess/video/gb.c b/src/mess/video/gb.c
index dc036c7001d..7adbd2ef0e9 100644
--- a/src/mess/video/gb.c
+++ b/src/mess/video/gb.c
@@ -1222,7 +1222,7 @@ void gb_video_reset( running_machine &machine, int mode )
gb_state *state = machine.driver_data<gb_state>();
int i;
int vram_size = 0x2000;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
emu_timer *old_timer = state->m_lcd.lcd_timer;
memset( &state->m_lcd, 0, sizeof(state->m_lcd) );
@@ -1291,10 +1291,10 @@ void gb_video_reset( running_machine &machine, int mode )
machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(gb_video_init_vbl));
/* Initialize some video registers */
- state->gb_video_w( *space, 0x0, 0x91 ); /* LCDCONT */
- state->gb_video_w( *space, 0x7, 0xFC ); /* BGRDPAL */
- state->gb_video_w( *space, 0x8, 0xFC ); /* SPR0PAL */
- state->gb_video_w( *space, 0x9, 0xFC ); /* SPR1PAL */
+ state->gb_video_w( space, 0x0, 0x91 ); /* LCDCONT */
+ state->gb_video_w( space, 0x7, 0xFC ); /* BGRDPAL */
+ state->gb_video_w( space, 0x8, 0xFC ); /* SPR0PAL */
+ state->gb_video_w( space, 0x9, 0xFC ); /* SPR1PAL */
CURLINE = state->m_lcd.current_line = 0;
LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x05;
@@ -1332,14 +1332,14 @@ static void gbc_hdma(running_machine &machine, UINT16 length)
{
gb_state *state = machine.driver_data<gb_state>();
UINT16 src, dst;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
src = ((UINT16)HDMA1 << 8) | (HDMA2 & 0xF0);
dst = ((UINT16)(HDMA3 & 0x1F) << 8) | (HDMA4 & 0xF0);
dst |= 0x8000;
while( length > 0 )
{
- space->write_byte( dst++, space->read_byte( src++ ) );
+ space.write_byte( dst++, space.read_byte( src++ ) );
length--;
}
HDMA1 = src >> 8;
diff --git a/src/mess/video/gf4500.c b/src/mess/video/gf4500.c
index e85f4b7fc5d..23e833289f2 100644
--- a/src/mess/video/gf4500.c
+++ b/src/mess/video/gf4500.c
@@ -94,7 +94,7 @@ READ32_HANDLER( gf4500_r )
}
if ((offset < (GF4500_FRAMEBUF_OFFSET / 4)) || (offset >= ((GF4500_FRAMEBUF_OFFSET + (321 * 240 * 2)) / 4)))
{
- verboselog( space->machine(), 9, "(GFO) %08X -> %08X\n", 0x34000000 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(GFO) %08X -> %08X\n", 0x34000000 + (offset << 2), data);
}
return data;
}
@@ -104,7 +104,7 @@ WRITE32_HANDLER( gf4500_w )
COMBINE_DATA(&gf4500.data[offset]);
if ((offset < (GF4500_FRAMEBUF_OFFSET / 4)) || (offset >= ((GF4500_FRAMEBUF_OFFSET + (321 * 240 * 2)) / 4)))
{
- verboselog( space->machine(), 9, "(GFO) %08X <- %08X\n", 0x34000000 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(GFO) %08X <- %08X\n", 0x34000000 + (offset << 2), data);
}
switch (offset)
{
diff --git a/src/mess/video/hp48.c b/src/mess/video/hp48.c
index 9f1b406516d..bf932171ccf 100644
--- a/src/mess/video/hp48.c
+++ b/src/mess/video/hp48.c
@@ -123,14 +123,14 @@ void hp48_state::palette_init()
data >>= 1
#define draw_quart \
- UINT8 data = space->read_byte( addr ); \
+ UINT8 data = space.read_byte( addr ); \
draw_pixel; draw_pixel; draw_pixel; draw_pixel;
SCREEN_UPDATE_IND16 ( hp48 )
{
hp48_state *state = screen.machine().driver_data<hp48_state>();
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
int x, y, xp, i, addr;
int display = HP48_IO_4(0) >> 3; /* 1=on, 0=off */
int left_margin = HP48_IO_4(0) & 7; /* 0..7 pixels for main bitmap */
diff --git a/src/mess/video/intv.c b/src/mess/video/intv.c
index 44ab0f4292e..7c9ac63300d 100644
--- a/src/mess/video/intv.c
+++ b/src/mess/video/intv.c
@@ -729,7 +729,7 @@ void intv_stic_screenrefresh(running_machine &machine)
READ8_MEMBER( intv_state::intvkbd_tms9927_r )
{
- //intv_state *state = space->machine().driver_data<intv_state>();
+ //intv_state *state = space.machine().driver_data<intv_state>();
UINT8 rv;
switch (offset)
{
@@ -752,7 +752,7 @@ void intv_stic_screenrefresh(running_machine &machine)
WRITE8_MEMBER( intv_state::intvkbd_tms9927_w )
{
- //intv_state *state = space->machine().driver_data<intv_state>();
+ //intv_state *state = space.machine().driver_data<intv_state>();
switch (offset)
{
case 3:
diff --git a/src/mess/video/iq151_grafik.c b/src/mess/video/iq151_grafik.c
index 4d2853f2026..26f96ee1fc7 100644
--- a/src/mess/video/iq151_grafik.c
+++ b/src/mess/video/iq151_grafik.c
@@ -130,8 +130,8 @@ void iq151_grafik_device::io_read(offs_t offset, UINT8 &data)
{
if (offset >= 0xd0 && offset < 0xd4)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
- data = m_ppi8255->read(*space, offset & 3);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
+ data = m_ppi8255->read(space, offset & 3);
}
else if (offset == 0xd4)
{
@@ -150,8 +150,8 @@ void iq151_grafik_device::io_write(offs_t offset, UINT8 data)
{
if (offset >= 0xd0 && offset < 0xd4)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
- m_ppi8255->write(*space, offset & 3, data);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
+ m_ppi8255->write(space, offset & 3, data);
}
else if (offset == 0xd4)
{
diff --git a/src/mess/video/irisha.c b/src/mess/video/irisha.c
index a8d2b18f2c5..36129fcac03 100644
--- a/src/mess/video/irisha.c
+++ b/src/mess/video/irisha.c
@@ -20,15 +20,15 @@ SCREEN_UPDATE_IND16( irisha )
UINT8 code1; //, code2;
UINT8 col;
int y, x, b;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
// draw image
for (y = 0; y < 200; y++)
{
for (x = 0; x < 40; x++)
{
- code1 = space->read_byte(0xe000 + x + y * 40);
-// code2 = space->read_byte(0xc000 + x + y * 40);
+ code1 = space.read_byte(0xe000 + x + y * 40);
+// code2 = space.read_byte(0xc000 + x + y * 40);
for (b = 0; b < 8; b++)
{
col = ((code1 >> b) & 0x01);
diff --git a/src/mess/video/isa_cga.c b/src/mess/video/isa_cga.c
index 38394eaae77..24399eb247a 100644
--- a/src/mess/video/isa_cga.c
+++ b/src/mess/video/isa_cga.c
@@ -2013,9 +2013,9 @@ void isa8_cga_pc1512_device::device_start()
m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_pc1512_device::io_read), this ), write8_delegate( FUNC(isa8_cga_pc1512_device::io_write), this ) );
m_isa->install_bank(0xb8000, 0xbbfff, 0, 0, "bank1", m_vram);
- address_space *space = machine().firstcpu->space( AS_PROGRAM );
+ address_space &space = *machine().firstcpu->space( AS_PROGRAM );
- space->install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
+ space.install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
}
void isa8_cga_pc1512_device::device_reset()
diff --git a/src/mess/video/isa_svga_cirrus.c b/src/mess/video/isa_svga_cirrus.c
index 2a8c9636a33..da4d8bc5f4a 100644
--- a/src/mess/video/isa_svga_cirrus.c
+++ b/src/mess/video/isa_svga_cirrus.c
@@ -58,7 +58,7 @@ isa8_svga_cirrus_device::isa8_svga_cirrus_device(const machine_config &mconfig,
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa8_svga_cirrus_device::device_start()
{
diff --git a/src/mess/video/isa_svga_s3.c b/src/mess/video/isa_svga_s3.c
index 7a3c7888e7a..5e8f0166122 100644
--- a/src/mess/video/isa_svga_s3.c
+++ b/src/mess/video/isa_svga_s3.c
@@ -58,7 +58,7 @@ isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa16_svga_s3_device::device_start()
{
diff --git a/src/mess/video/isa_svga_tseng.c b/src/mess/video/isa_svga_tseng.c
index 151bab29839..863ac977e90 100644
--- a/src/mess/video/isa_svga_tseng.c
+++ b/src/mess/video/isa_svga_tseng.c
@@ -57,7 +57,7 @@ isa8_svga_et4k_device::isa8_svga_et4k_device(const machine_config &mconfig, cons
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa8_svga_et4k_device::device_start()
{
diff --git a/src/mess/video/isa_vga.c b/src/mess/video/isa_vga.c
index 4705cdb474d..765555bcec4 100644
--- a/src/mess/video/isa_vga.c
+++ b/src/mess/video/isa_vga.c
@@ -57,7 +57,7 @@ isa8_vga_device::isa8_vga_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa8_vga_device::device_start()
{
diff --git a/src/mess/video/isa_vga_ati.c b/src/mess/video/isa_vga_ati.c
index 5d02810c16b..67f5dff6de7 100644
--- a/src/mess/video/isa_vga_ati.c
+++ b/src/mess/video/isa_vga_ati.c
@@ -61,7 +61,7 @@ isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconf
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa16_vga_gfxultra_device::device_start()
{
diff --git a/src/mess/video/kramermc.c b/src/mess/video/kramermc.c
index f3f9ea13a17..da08a453071 100644
--- a/src/mess/video/kramermc.c
+++ b/src/mess/video/kramermc.c
@@ -30,13 +30,13 @@ void kramermc_state::video_start()
SCREEN_UPDATE_IND16( kramermc )
{
int x,y;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(y = 0; y < 16; y++ )
{
for(x = 0; x < 64; x++ )
{
- int code = space->read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
+ int code = space.read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, x*8,y*8);
}
}
diff --git a/src/mess/video/newport.c b/src/mess/video/newport.c
index 42fc6d2eb77..f37adb1832c 100644
--- a/src/mess/video/newport.c
+++ b/src/mess/video/newport.c
@@ -233,7 +233,7 @@ SCREEN_UPDATE_RGB32( newport )
static WRITE32_HANDLER( newport_cmap0_w )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -253,7 +253,7 @@ static WRITE32_HANDLER( newport_cmap0_w )
static READ32_HANDLER( newport_cmap0_r )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -271,7 +271,7 @@ static READ32_HANDLER( newport_cmap0_r )
static READ32_HANDLER( newport_cmap1_r )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -290,7 +290,7 @@ static READ32_HANDLER( newport_cmap1_r )
static READ32_HANDLER( newport_xmap0_r )
{
UINT8 nModeIdx;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -339,7 +339,7 @@ static READ32_HANDLER( newport_xmap0_r )
static WRITE32_HANDLER( newport_xmap0_w )
{
UINT8 n8BitVal = data & 0x000000ff;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -378,7 +378,7 @@ static WRITE32_HANDLER( newport_xmap0_w )
static READ32_HANDLER( newport_xmap1_r )
{
UINT8 nModeIdx;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -427,7 +427,7 @@ static READ32_HANDLER( newport_xmap1_r )
static WRITE32_HANDLER( newport_xmap1_w )
{
UINT8 n8BitVal = data & 0x000000ff;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -466,7 +466,7 @@ static WRITE32_HANDLER( newport_xmap1_w )
static READ32_HANDLER( newport_vc2_r )
{
UINT16 ret16;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -491,7 +491,7 @@ static READ32_HANDLER( newport_vc2_r )
static WRITE32_HANDLER( newport_vc2_w )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nXFerWidth )
{
@@ -608,7 +608,7 @@ static WRITE32_HANDLER( newport_vc2_w )
READ32_HANDLER( newport_rex3_r )
{
// UINT32 nTemp;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
// if( offset >= ( 0x0800 / 4 ) )
// {
@@ -984,7 +984,7 @@ static void DoREX3Command(running_machine &machine)
WRITE32_HANDLER( newport_rex3_w )
{
UINT32 nTemp=0;
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
if( offset & 0x00000200 )
{
diff --git a/src/mess/video/nubus_cb264.c b/src/mess/video/nubus_cb264.c
index 7f8a3037759..bcc75ac0785 100644
--- a/src/mess/video/nubus_cb264.c
+++ b/src/mess/video/nubus_cb264.c
@@ -247,7 +247,7 @@ WRITE32_MEMBER( nubus_cb264_device::cb264_w )
break;
default:
-// printf("cb264_w: %x to reg %x (mask %x PC %x)\n", data, offset*4, mem_mask, space->device().safe_pc());
+// printf("cb264_w: %x to reg %x (mask %x PC %x)\n", data, offset*4, mem_mask, space.device().safe_pc());
break;
}
}
diff --git a/src/mess/video/oric.c b/src/mess/video/oric.c
index fc4ba22ec74..f07136781d2 100644
--- a/src/mess/video/oric.c
+++ b/src/mess/video/oric.c
@@ -68,7 +68,7 @@ static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
oric_state *state = machine.driver_data<oric_state>();
/* attribute */
UINT8 attribute = c & 0x03f;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch ((attribute>>3) & 0x03)
{
@@ -115,7 +115,7 @@ static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
if (state->m_ram)
state->m_vh_state.char_base = state->m_ram + (offs_t)0x09800;
else
- state->m_vh_state.char_base = (UINT8 *)space->get_read_ptr(0x09800);
+ state->m_vh_state.char_base = (UINT8 *)space.get_read_ptr(0x09800);
}
else
{
@@ -124,7 +124,7 @@ static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
if (state->m_ram)
state->m_vh_state.char_base = state->m_ram + (offs_t)0x0b400;
else
- state->m_vh_state.char_base = (UINT8 *)space->get_read_ptr(0x0b400);
+ state->m_vh_state.char_base = (UINT8 *)space.get_read_ptr(0x0b400);
}
/* changing the mode also changes the position of the standard charset and alternative charset */
oric_refresh_charset(state);
diff --git a/src/mess/video/pc1251.c b/src/mess/video/pc1251.c
index fbec83e4f78..98cbb376592 100644
--- a/src/mess/video/pc1251.c
+++ b/src/mess/video/pc1251.c
@@ -97,7 +97,7 @@ static const POCKETC_FIGURE busy={
READ8_HANDLER(pc1251_lcd_read)
{
- pc1251_state *state = space->machine().driver_data<pc1251_state>();
+ pc1251_state *state = space.machine().driver_data<pc1251_state>();
int data;
data = state->m_reg[offset&0xff];
logerror("pc1251 read %.3x %.2x\n",offset,data);
@@ -106,7 +106,7 @@ static const POCKETC_FIGURE busy={
WRITE8_HANDLER(pc1251_lcd_write)
{
- pc1251_state *state = space->machine().driver_data<pc1251_state>();
+ pc1251_state *state = space.machine().driver_data<pc1251_state>();
logerror("pc1251 write %.3x %.2x\n",offset,data);
state->m_reg[offset&0xff] = data;
}
diff --git a/src/mess/video/pc1350.c b/src/mess/video/pc1350.c
index dae4669ee1f..d31b9035913 100644
--- a/src/mess/video/pc1350.c
+++ b/src/mess/video/pc1350.c
@@ -97,7 +97,7 @@ static const POCKETC_FIGURE busy={
READ8_HANDLER(pc1350_lcd_read)
{
- pc1350_state *state = space->machine().driver_data<pc1350_state>();
+ pc1350_state *state = space.machine().driver_data<pc1350_state>();
int data;
data = state->m_reg[offset&0xfff];
logerror("pc1350 read %.3x %.2x\n",offset,data);
@@ -106,7 +106,7 @@ static const POCKETC_FIGURE busy={
WRITE8_HANDLER(pc1350_lcd_write)
{
- pc1350_state *state = space->machine().driver_data<pc1350_state>();
+ pc1350_state *state = space.machine().driver_data<pc1350_state>();
logerror("pc1350 write %.3x %.2x\n",offset,data);
state->m_reg[offset&0xfff] = data;
}
diff --git a/src/mess/video/pc1401.c b/src/mess/video/pc1401.c
index 2c628bc7bd3..70ceb084649 100644
--- a/src/mess/video/pc1401.c
+++ b/src/mess/video/pc1401.c
@@ -19,14 +19,14 @@
READ8_HANDLER(pc1401_lcd_read)
{
- pc1401_state *state = space->machine().driver_data<pc1401_state>();
+ pc1401_state *state = space.machine().driver_data<pc1401_state>();
offset&=0xff;
return state->m_reg[offset];
}
WRITE8_HANDLER(pc1401_lcd_write)
{
- pc1401_state *state = space->machine().driver_data<pc1401_state>();
+ pc1401_state *state = space.machine().driver_data<pc1401_state>();
offset&=0xff;
state->m_reg[offset]=data;
}
diff --git a/src/mess/video/pc1403.c b/src/mess/video/pc1403.c
index 1bf67e46b62..bf844af9f6a 100644
--- a/src/mess/video/pc1403.c
+++ b/src/mess/video/pc1403.c
@@ -52,13 +52,13 @@ VIDEO_START( pc1403 )
READ8_HANDLER(pc1403_lcd_read)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
return state->m_reg[offset];
}
WRITE8_HANDLER(pc1403_lcd_write)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
state->m_reg[offset]=data;
}
diff --git a/src/mess/video/pc_aga.c b/src/mess/video/pc_aga.c
index 7d6dbef092a..5f8bda52964 100644
--- a/src/mess/video/pc_aga.c
+++ b/src/mess/video/pc_aga.c
@@ -12,7 +12,7 @@
#include "video/cgapal.h"
-#define CGA_MONITOR (space->machine().root_device().ioport("VIDEO")->read() & 0x1C)
+#define CGA_MONITOR (space.machine().root_device().ioport("VIDEO")->read() & 0x1C)
#define CGA_MONITOR_RGB 0x00 /* Colour RGB */
#define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */
#define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */
@@ -496,17 +496,17 @@ static READ8_HANDLER ( pc_aga_mda_r )
UINT8 data = 0xFF;
if ( aga.mode == AGA_MONO ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch( offset )
{
case 0: case 2: case 4: case 6:
/* return last written mc6845 address value here? */
break;
case 1: case 3: case 5: case 7:
- data = mc6845->register_r(*space, offset);
+ data = mc6845->register_r(space, offset);
break;
case 10:
- data = (space->machine().root_device().ioport("IN0")->read() & 0x80 ) | 0x08 | aga.mda_status;
+ data = (space.machine().root_device().ioport("IN0")->read() & 0x80 ) | 0x08 | aga.mda_status;
aga.mda_status ^= 0x01;
break;
/* 12, 13, 14 are the LPT1 ports */
@@ -518,14 +518,14 @@ static READ8_HANDLER ( pc_aga_mda_r )
static WRITE8_HANDLER ( pc_aga_mda_w )
{
if ( aga.mode == AGA_MONO ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch( offset )
{
case 0: case 2: case 4: case 6:
- mc6845->address_w( *space, offset, data );
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845->register_w( *space, offset, data );
+ mc6845->register_w( space, offset, data );
break;
case 8:
aga.mda_mode_control = data;
@@ -551,13 +551,13 @@ static READ8_HANDLER ( pc_aga_cga_r )
UINT8 data = 0xFF;
if ( aga.mode == AGA_COLOR ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch( offset ) {
case 0: case 2: case 4: case 6:
/* return last written mc6845 address value here? */
break;
case 1: case 3: case 5: case 7:
- data = mc6845->register_r( *space, offset);
+ data = mc6845->register_r( space, offset);
break;
case 10:
data = aga.vsync | ( ( data & 0x40 ) >> 4 ) | aga.hsync;
@@ -597,14 +597,14 @@ static void pc_aga_set_palette_luts(void) {
static WRITE8_HANDLER ( pc_aga_cga_w )
{
if ( aga.mode == AGA_COLOR ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch(offset) {
case 0: case 2: case 4: case 6:
- mc6845->address_w( *space, offset, data );
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845->register_w( *space, offset, data );
+ mc6845->register_w( space, offset, data );
break;
case 8:
aga.cga_mode_control = data;
@@ -689,19 +689,19 @@ void pc_aga_set_mode(running_machine &machine, AGA_MODE mode)
VIDEO_START( pc_aga )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
switch(buswidth)
{
case 8:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w) );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w) );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w) );
break;
case 16:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w), 0xffff );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w), 0xffff );
break;
@@ -720,19 +720,19 @@ VIDEO_START( pc_aga )
VIDEO_START( pc200 )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
switch(buswidth)
{
case 8:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w) );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w) );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w) );
break;
case 16:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w), 0xffff );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w), 0xffff );
break;
@@ -836,11 +836,11 @@ WRITE8_HANDLER( pc200_cga_w )
if ((pc200.porte & 7) != (data & 7))
{
if (data & 4)
- pc_aga_set_mode(space->machine(), AGA_OFF);
+ pc_aga_set_mode(space.machine(), AGA_OFF);
else if (data & 2)
- pc_aga_set_mode(space->machine(), AGA_MONO);
+ pc_aga_set_mode(space.machine(), AGA_MONO);
else
- pc_aga_set_mode(space->machine(), AGA_COLOR);
+ pc_aga_set_mode(space.machine(), AGA_COLOR);
}
pc200.porte = data;
break;
@@ -868,7 +868,7 @@ READ8_HANDLER ( pc200_cga_r )
case 0xe:
// 0x20 low cga
// 0x10 low special
- result = space->machine().root_device().ioport("DSW0")->read() & 0x38;
+ result = space.machine().root_device().ioport("DSW0")->read() & 0x38;
break;
default:
diff --git a/src/mess/video/pc_t1t.c b/src/mess/video/pc_t1t.c
index 79a16814dc2..c252c6962f7 100644
--- a/src/mess/video/pc_t1t.c
+++ b/src/mess/video/pc_t1t.c
@@ -771,12 +771,12 @@ WRITE8_HANDLER ( pc_T1T_w )
switch( offset )
{
case 0: case 2: case 4: case 6:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->address_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->register_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->register_w( space, offset, data );
break;
case 8:
pc_t1t_mode_control_w(data);
@@ -798,7 +798,7 @@ WRITE8_HANDLER ( pc_T1T_w )
pc_t1t_vga_data_w(data);
break;
case 15:
- pc_t1t_bank_w(space->machine(), data);
+ pc_t1t_bank_w(space.machine(), data);
break;
}
}
@@ -811,17 +811,17 @@ WRITE8_HANDLER( pc_pcjr_w )
switch( offset )
{
case 0: case 4:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->address_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->address_w( space, offset, data );
break;
case 1: case 5:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->register_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->register_w( space, offset, data );
break;
case 10:
if ( pcjr.address_data_ff & 0x01 )
{
- pc_pcjr_vga_data_w( space->machine(), data );
+ pc_pcjr_vga_data_w( space.machine(), data );
}
else
{
@@ -835,7 +835,7 @@ WRITE8_HANDLER( pc_pcjr_w )
case 12:
break;
case 15:
- pc_pcjr_bank_w(space->machine(), data);
+ pc_pcjr_bank_w(space.machine(), data);
break;
default:
@@ -856,8 +856,8 @@ WRITE8_HANDLER( pc_pcjr_w )
break;
case 1: case 3: case 5: case 7:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- data = mc6845->register_r( *space, offset );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ data = mc6845->register_r( space, offset );
break;
case 8:
@@ -922,7 +922,7 @@ static WRITE_LINE_DEVICE_HANDLER( pcjr_vsync_changed )
static VIDEO_START( pc_t1t )
{
int buswidth;
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
pcjr.chr_gen = machine.root_device().memregion("gfx1")->base();
@@ -934,12 +934,12 @@ static VIDEO_START( pc_t1t )
switch(buswidth)
{
case 8:
- space->install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w) );
+ space.install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w) );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_T1T_w) );
break;
case 16:
- space->install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w), 0xffff );
+ space.install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_T1T_w), 0xffff );
break;
diff --git a/src/mess/video/stic.c b/src/mess/video/stic.c
index 5d6bee63072..6c3985daf04 100644
--- a/src/mess/video/stic.c
+++ b/src/mess/video/stic.c
@@ -6,7 +6,7 @@
READ16_MEMBER( intv_state::intv_stic_r )
{
-// intv_state *state = space->machine().driver_data<intv_state>();
+// intv_state *state = space.machine().driver_data<intv_state>();
//logerror("%x = stic_r(%x)\n",0,offset);
if (m_bus_copy_mode || !m_stic_handshake)
{
@@ -75,7 +75,7 @@ READ16_MEMBER( intv_state::intv_stic_r )
WRITE16_MEMBER( intv_state::intv_stic_w )
{
- //intv_state *state = space->machine().driver_data<intv_state>();
+ //intv_state *state = space.machine().driver_data<intv_state>();
intv_sprite_type *s;
//logerror("stic_w(%x) = %x\n",offset,data);
diff --git a/src/mess/video/ti85.c b/src/mess/video/ti85.c
index 8b3335083f8..b569bfd19cf 100644
--- a/src/mess/video/ti85.c
+++ b/src/mess/video/ti85.c
@@ -150,7 +150,7 @@ void ti85_state::video_start()
SCREEN_UPDATE_IND16( ti85 )
{
ti85_state *state = screen.machine().driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
int x,y,b;
int brightnes;
int lcdmem;
@@ -170,7 +170,7 @@ SCREEN_UPDATE_IND16( ti85 )
for (y=0; y<state->m_ti_screen_y_size; y++)
for (x=0; x<state->m_ti_screen_x_size; x++)
- *(state->m_frames+(state->m_ti_number_of_frames-1)*state->m_ti_video_memory_size+y*state->m_ti_screen_x_size+x) = space->read_byte(lcdmem+y*state->m_ti_screen_x_size+x);
+ *(state->m_frames+(state->m_ti_number_of_frames-1)*state->m_ti_video_memory_size+y*state->m_ti_screen_x_size+x) = space.read_byte(lcdmem+y*state->m_ti_screen_x_size+x);
for (y=0; y<state->m_ti_screen_y_size; y++)
for (x=0; x<state->m_ti_screen_x_size; x++)
diff --git a/src/mess/video/x68k.c b/src/mess/video/x68k.c
index f03b8a6cb21..10f8cde887f 100644
--- a/src/mess/video/x68k.c
+++ b/src/mess/video/x68k.c
@@ -377,7 +377,7 @@ TIMER_CALLBACK(x68k_crtc_vblank_irq)
*/
WRITE16_HANDLER( x68k_crtc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
COMBINE_DATA(state->m_crtc.reg+offset);
switch(offset)
{
@@ -390,12 +390,12 @@ WRITE16_HANDLER( x68k_crtc_w )
case 6:
case 7:
case 8:
- x68k_crtc_refresh_mode(space->machine());
+ x68k_crtc_refresh_mode(space.machine());
break;
case 9: // CRTC raster IRQ (GPIP6)
{
attotime irq_time;
- irq_time = space->machine().primary_screen->time_until_pos((data) / state->m_crtc.vmultiple,2);
+ irq_time = space.machine().primary_screen->time_until_pos((data) / state->m_crtc.vmultiple,2);
if(irq_time.as_double() > 0)
state->m_raster_irq->adjust(irq_time, (data) / state->m_crtc.vmultiple);
@@ -442,14 +442,14 @@ WRITE16_HANDLER( x68k_crtc_w )
if(data & 0x0400)
state->m_crtc.interlace = 1;
}*/
- x68k_crtc_refresh_mode(space->machine());
+ x68k_crtc_refresh_mode(space.machine());
break;
case 576: // operation register
state->m_crtc.operation = data;
if(data & 0x08) // text screen raster copy
{
x68k_crtc_text_copy(state, (state->m_crtc.reg[22] & 0xff00) >> 8,(state->m_crtc.reg[22] & 0x00ff));
- space->machine().scheduler().timer_set(attotime::from_msec(1), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
+ space.machine().scheduler().timer_set(attotime::from_msec(1), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
}
if(data & 0x02) // high-speed graphic screen clear
{
@@ -457,16 +457,16 @@ WRITE16_HANDLER( x68k_crtc_w )
memset(state->m_gvram32,0,0x40000);
else
memset(state->m_gvram16,0,0x40000);
- space->machine().scheduler().timer_set(attotime::from_msec(10), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
+ space.machine().scheduler().timer_set(attotime::from_msec(10), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
}
break;
}
-// logerror("CRTC: [%08x] Wrote %04x to CRTC register %i\n",space->machine().device("maincpu")->safe_pc(),data,offset);
+// logerror("CRTC: [%08x] Wrote %04x to CRTC register %i\n",space.machine().device("maincpu")->safe_pc(),data,offset);
}
READ16_HANDLER( x68k_crtc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
#if 0
switch(offset)
{
@@ -478,7 +478,7 @@ READ16_HANDLER( x68k_crtc_r )
if(offset < 24)
{
-// logerror("CRTC: [%08x] Read %04x from CRTC register %i\n",space->machine().device("maincpu")->safe_pc(),state->m_crtc.reg[offset],offset);
+// logerror("CRTC: [%08x] Read %04x from CRTC register %i\n",space.machine().device("maincpu")->safe_pc(),state->m_crtc.reg[offset],offset);
switch(offset)
{
case 9:
@@ -507,7 +507,7 @@ READ16_HANDLER( x68k_crtc_r )
WRITE16_HANDLER( x68k_gvram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
UINT16* gvram;
// int xloc,yloc,pageoffset;
/*
@@ -580,7 +580,7 @@ WRITE16_HANDLER( x68k_gvram_w )
WRITE16_HANDLER( x68k_tvram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
UINT16* tvram;
UINT16 text_mask;
@@ -617,7 +617,7 @@ WRITE16_HANDLER( x68k_tvram_w )
READ16_HANDLER( x68k_gvram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
const UINT16* gvram;
UINT16 ret = 0;
@@ -665,7 +665,7 @@ READ16_HANDLER( x68k_gvram_r )
READ16_HANDLER( x68k_tvram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
const UINT16* tvram;
if(state->m_is_32bit)
@@ -726,7 +726,7 @@ WRITE32_HANDLER( x68k_gvram32_w )
WRITE16_HANDLER( x68k_spritereg_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
COMBINE_DATA(state->m_spritereg+offset);
switch(offset)
{
@@ -775,7 +775,7 @@ WRITE16_HANDLER( x68k_spritereg_w )
READ16_HANDLER( x68k_spritereg_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(offset >= 0x400 && offset < 0x404)
return state->m_spritereg[offset] & 0x3ff;
return state->m_spritereg[offset];
@@ -783,7 +783,7 @@ READ16_HANDLER( x68k_spritereg_r )
WRITE16_HANDLER( x68k_spriteram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
COMBINE_DATA(state->m_spriteram+offset);
state->m_video.tile8_dirty[offset / 16] = 1;
state->m_video.tile16_dirty[offset / 64] = 1;
@@ -808,7 +808,7 @@ WRITE16_HANDLER( x68k_spriteram_w )
READ16_HANDLER( x68k_spriteram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
return state->m_spriteram[offset];
}