summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Aaron Giles <aaron@aarongiles.com>2012-09-11 05:50:50 +0000
committerGravatarGravatar Aaron Giles <aaron@aarongiles.com>2012-09-11 05:50:50 +0000
commit8669a28810ab8b8c89017a8252626f121abd054a (patch) (github)
tree6071a3df9af94c1ab559cfab19faa71776d3110d
parente5bbf531533db76bdc34f102eec11494cdfda314 (diff)
downloadmame-8669a28810ab8b8c89017a8252626f121abd054a.tar.bz2
mame-8669a28810ab8b8c89017a8252626f121abd054a.zip
Add safe_pc() and safe_pcbase() methods to device_t.
Convert all cpu_get_pc() to safe_pc() and cpu_getpreviouspc() to safe_basepc(). Removed the old macros.
-rw-r--r--src/emu/cpu/m6502/opsce02.h2
-rw-r--r--src/emu/cpu/m6800/m6800.c8
-rw-r--r--src/emu/cpu/m68000/68307bus.c4
-rw-r--r--src/emu/cpu/m68000/68307ser.c4
-rw-r--r--src/emu/cpu/m68000/68307sim.c12
-rw-r--r--src/emu/cpu/m68000/68307tmu.c4
-rw-r--r--src/emu/cpu/m68000/68340dma.c4
-rw-r--r--src/emu/cpu/m68000/68340ser.c4
-rw-r--r--src/emu/cpu/m68000/68340sim.c12
-rw-r--r--src/emu/cpu/m68000/68340tmu.c4
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c8
-rw-r--r--src/emu/cpu/sh2/sh2comn.c2
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c2
-rw-r--r--src/emu/cpu/tms34010/34010gfx.c2
-rw-r--r--src/emu/cpu/tms34010/tms34010.c4
-rw-r--r--src/emu/debug/dvdisasm.c4
-rw-r--r--src/emu/devcpu.h3
-rw-r--r--src/emu/device.h2
-rw-r--r--src/emu/distate.c8
-rw-r--r--src/emu/distate.h28
-rw-r--r--src/emu/machine/53c810.c4
-rw-r--r--src/emu/machine/am53cf96.c10
-rw-r--r--src/emu/machine/k056230.c8
-rw-r--r--src/emu/machine/ldpr8210.c8
-rw-r--r--src/emu/machine/ldv1000.c2
-rw-r--r--src/emu/machine/ldvp931.c6
-rw-r--r--src/emu/machine/ncr539x.c6
-rw-r--r--src/emu/machine/tmp68301.c2
-rw-r--r--src/emu/machine/wd33c93.c8
-rw-r--r--src/emu/sound/nile.c4
-rw-r--r--src/emu/video/hd63484.c10
-rw-r--r--src/emu/video/pc_vga.c2
-rw-r--r--src/emu/video/voodoo.c2
-rw-r--r--src/mame/audio/beezer.c2
-rw-r--r--src/mame/audio/cage.c10
-rw-r--r--src/mame/audio/dcs.c14
-rw-r--r--src/mame/audio/exidy.c8
-rw-r--r--src/mame/audio/harddriv.c36
-rw-r--r--src/mame/audio/invinco.c2
-rw-r--r--src/mame/audio/jaguar.c8
-rw-r--r--src/mame/audio/leland.c152
-rw-r--r--src/mame/audio/mw8080bw.c2
-rw-r--r--src/mame/audio/segasnd.c12
-rw-r--r--src/mame/audio/seibu.c8
-rw-r--r--src/mame/audio/snes_snd.c4
-rw-r--r--src/mame/audio/taito_en.c4
-rw-r--r--src/mame/audio/taitosnd.c4
-rw-r--r--src/mame/drivers/1943.c2
-rw-r--r--src/mame/drivers/2mindril.c8
-rw-r--r--src/mame/drivers/39in1.c12
-rw-r--r--src/mame/drivers/8080bw.c4
-rw-r--r--src/mame/drivers/88games.c2
-rw-r--r--src/mame/drivers/acommand.c2
-rw-r--r--src/mame/drivers/aeroboto.c2
-rw-r--r--src/mame/drivers/albazg.c6
-rw-r--r--src/mame/drivers/aleck64.c4
-rw-r--r--src/mame/drivers/alpha68k.c10
-rw-r--r--src/mame/drivers/artmagic.c4
-rw-r--r--src/mame/drivers/astrafr.c16
-rw-r--r--src/mame/drivers/astrocorp.c6
-rw-r--r--src/mame/drivers/atarigt.c18
-rw-r--r--src/mame/drivers/atarigx2.c8
-rw-r--r--src/mame/drivers/backfire.c10
-rw-r--r--src/mame/drivers/bbusters.c2
-rw-r--r--src/mame/drivers/beathead.c4
-rw-r--r--src/mame/drivers/bfcobra.c8
-rw-r--r--src/mame/drivers/bfm_sc4h.c14
-rw-r--r--src/mame/drivers/bfm_swp.c4
-rw-r--r--src/mame/drivers/bigevglf.c2
-rw-r--r--src/mame/drivers/bionicc.c4
-rw-r--r--src/mame/drivers/bking.c2
-rw-r--r--src/mame/drivers/blockhl.c2
-rw-r--r--src/mame/drivers/bmcbowl.c4
-rw-r--r--src/mame/drivers/btime.c16
-rw-r--r--src/mame/drivers/cabaret.c2
-rw-r--r--src/mame/drivers/calchase.c4
-rw-r--r--src/mame/drivers/cave.c14
-rw-r--r--src/mame/drivers/cbasebal.c2
-rw-r--r--src/mame/drivers/cbuster.c4
-rw-r--r--src/mame/drivers/cd32.c14
-rw-r--r--src/mame/drivers/cdi.c2
-rw-r--r--src/mame/drivers/centiped.c2
-rw-r--r--src/mame/drivers/chaknpop.c2
-rw-r--r--src/mame/drivers/cninja.c10
-rw-r--r--src/mame/drivers/cntsteer.c2
-rw-r--r--src/mame/drivers/cobra.c8
-rw-r--r--src/mame/drivers/coolpool.c24
-rw-r--r--src/mame/drivers/cps1.c2
-rw-r--r--src/mame/drivers/crbaloon.c4
-rw-r--r--src/mame/drivers/crgolf.c2
-rw-r--r--src/mame/drivers/cvs.c6
-rw-r--r--src/mame/drivers/cyclemb.c12
-rw-r--r--src/mame/drivers/d9final.c2
-rw-r--r--src/mame/drivers/darius.c12
-rw-r--r--src/mame/drivers/dblewing.c8
-rw-r--r--src/mame/drivers/dcheese.c2
-rw-r--r--src/mame/drivers/ddenlovr.c72
-rw-r--r--src/mame/drivers/ddragon.c14
-rw-r--r--src/mame/drivers/ddragon3.c2
-rw-r--r--src/mame/drivers/dec0.c12
-rw-r--r--src/mame/drivers/deco32.c18
-rw-r--r--src/mame/drivers/deco_mlc.c10
-rw-r--r--src/mame/drivers/djmain.c6
-rw-r--r--src/mame/drivers/dkong.c12
-rw-r--r--src/mame/drivers/dorachan.c4
-rw-r--r--src/mame/drivers/dunhuang.c8
-rw-r--r--src/mame/drivers/dynax.c34
-rw-r--r--src/mame/drivers/enigma2.c4
-rw-r--r--src/mame/drivers/eolithsp.c6
-rw-r--r--src/mame/drivers/epos.c2
-rw-r--r--src/mame/drivers/esd16.c4
-rw-r--r--src/mame/drivers/esripsys.c2
-rw-r--r--src/mame/drivers/exerion.c2
-rw-r--r--src/mame/drivers/fantland.c6
-rw-r--r--src/mame/drivers/fastfred.c12
-rw-r--r--src/mame/drivers/firetrap.c6
-rw-r--r--src/mame/drivers/fitfight.c12
-rw-r--r--src/mame/drivers/flstory.c6
-rw-r--r--src/mame/drivers/fromanc2.c2
-rw-r--r--src/mame/drivers/fuukifg2.c2
-rw-r--r--src/mame/drivers/gaelco3d.c36
-rw-r--r--src/mame/drivers/gaiden.c8
-rw-r--r--src/mame/drivers/galastrm.c2
-rw-r--r--src/mame/drivers/galaxian.c6
-rw-r--r--src/mame/drivers/galaxold.c8
-rw-r--r--src/mame/drivers/gaplus.c2
-rw-r--r--src/mame/drivers/gbusters.c8
-rw-r--r--src/mame/drivers/gcpinbal.c4
-rw-r--r--src/mame/drivers/gei.c2
-rw-r--r--src/mame/drivers/ghosteo.c2
-rw-r--r--src/mame/drivers/gladiatr.c2
-rw-r--r--src/mame/drivers/glass.c4
-rw-r--r--src/mame/drivers/goal92.c2
-rw-r--r--src/mame/drivers/goindol.c8
-rw-r--r--src/mame/drivers/gradius3.c8
-rw-r--r--src/mame/drivers/gsword.c4
-rw-r--r--src/mame/drivers/gunbustr.c4
-rw-r--r--src/mame/drivers/halleys.c4
-rw-r--r--src/mame/drivers/hexion.c2
-rw-r--r--src/mame/drivers/hitpoker.c8
-rw-r--r--src/mame/drivers/hng64.c24
-rw-r--r--src/mame/drivers/homedata.c22
-rw-r--r--src/mame/drivers/hotblock.c6
-rw-r--r--src/mame/drivers/hyprduel.c8
-rw-r--r--src/mame/drivers/igs009.c8
-rw-r--r--src/mame/drivers/igs011.c44
-rw-r--r--src/mame/drivers/igs_m027.c2
-rw-r--r--src/mame/drivers/igspoker.c6
-rw-r--r--src/mame/drivers/itech32.c20
-rw-r--r--src/mame/drivers/jackie.c2
-rw-r--r--src/mame/drivers/jaguar.c10
-rw-r--r--src/mame/drivers/jalmah.c14
-rw-r--r--src/mame/drivers/jokrwild.c4
-rw-r--r--src/mame/drivers/kaneko16.c10
-rw-r--r--src/mame/drivers/kickgoal.c2
-rw-r--r--src/mame/drivers/kinst.c2
-rw-r--r--src/mame/drivers/koftball.c2
-rw-r--r--src/mame/drivers/konamigv.c4
-rw-r--r--src/mame/drivers/konamigx.c74
-rw-r--r--src/mame/drivers/konamim2.c12
-rw-r--r--src/mame/drivers/ksys573.c12
-rw-r--r--src/mame/drivers/ladybug.c2
-rw-r--r--src/mame/drivers/lastfght.c40
-rw-r--r--src/mame/drivers/lethal.c2
-rw-r--r--src/mame/drivers/liberate.c10
-rw-r--r--src/mame/drivers/littlerb.c10
-rw-r--r--src/mame/drivers/looping.c4
-rw-r--r--src/mame/drivers/lwings.c4
-rw-r--r--src/mame/drivers/m107.c2
-rw-r--r--src/mame/drivers/m92.c8
-rw-r--r--src/mame/drivers/macrossp.c10
-rw-r--r--src/mame/drivers/macs.c2
-rw-r--r--src/mame/drivers/mainevt.c4
-rw-r--r--src/mame/drivers/malzak.c2
-rw-r--r--src/mame/drivers/mcr.c6
-rw-r--r--src/mame/drivers/mcr3.c2
-rw-r--r--src/mame/drivers/mcr68.c2
-rw-r--r--src/mame/drivers/mediagx.c6
-rw-r--r--src/mame/drivers/megadrvb.c12
-rw-r--r--src/mame/drivers/megaplay.c2
-rw-r--r--src/mame/drivers/meritm.c2
-rw-r--r--src/mame/drivers/metro.c16
-rw-r--r--src/mame/drivers/midqslvr.c2
-rw-r--r--src/mame/drivers/midvunit.c12
-rw-r--r--src/mame/drivers/midzeus.c30
-rw-r--r--src/mame/drivers/missile.c6
-rw-r--r--src/mame/drivers/mitchell.c2
-rw-r--r--src/mame/drivers/mjkjidai.c4
-rw-r--r--src/mame/drivers/mjsister.c4
-rw-r--r--src/mame/drivers/model1.c22
-rw-r--r--src/mame/drivers/model2.c22
-rw-r--r--src/mame/drivers/model3.c12
-rw-r--r--src/mame/drivers/mole.c2
-rw-r--r--src/mame/drivers/monzagp.c6
-rw-r--r--src/mame/drivers/mosaic.c4
-rw-r--r--src/mame/drivers/mpu3.c4
-rw-r--r--src/mame/drivers/mpu4hw.c10
-rw-r--r--src/mame/drivers/mpu4vid.c14
-rw-r--r--src/mame/drivers/mpu5hw.c4
-rw-r--r--src/mame/drivers/mquake.c6
-rw-r--r--src/mame/drivers/msisaac.c4
-rw-r--r--src/mame/drivers/mw8080bw.c2
-rw-r--r--src/mame/drivers/mystwarr.c2
-rw-r--r--src/mame/drivers/namcona1.c4
-rw-r--r--src/mame/drivers/namconb1.c2
-rw-r--r--src/mame/drivers/namcos10.c8
-rw-r--r--src/mame/drivers/namcos11.c4
-rw-r--r--src/mame/drivers/namcos21.c14
-rw-r--r--src/mame/drivers/namcos22.c10
-rw-r--r--src/mame/drivers/namcos23.c38
-rw-r--r--src/mame/drivers/naughtyb.c8
-rw-r--r--src/mame/drivers/neogeo.c30
-rw-r--r--src/mame/drivers/neoprint.c14
-rw-r--r--src/mame/drivers/ninjaw.c2
-rw-r--r--src/mame/drivers/nmk16.c10
-rw-r--r--src/mame/drivers/nwk-tr.c12
-rw-r--r--src/mame/drivers/nyny.c2
-rw-r--r--src/mame/drivers/offtwall.c8
-rw-r--r--src/mame/drivers/ojankohs.c2
-rw-r--r--src/mame/drivers/opwolf.c8
-rw-r--r--src/mame/drivers/overdriv.c4
-rw-r--r--src/mame/drivers/pacman.c18
-rw-r--r--src/mame/drivers/pandoras.c2
-rw-r--r--src/mame/drivers/paradise.c2
-rw-r--r--src/mame/drivers/parodius.c6
-rw-r--r--src/mame/drivers/pasha2.c2
-rw-r--r--src/mame/drivers/pbaction.c2
-rw-r--r--src/mame/drivers/pcat_nit.c2
-rw-r--r--src/mame/drivers/pcxt.c4
-rw-r--r--src/mame/drivers/pgm.c12
-rw-r--r--src/mame/drivers/pirates.c4
-rw-r--r--src/mame/drivers/pktgaldx.c2
-rw-r--r--src/mame/drivers/playmark.c6
-rw-r--r--src/mame/drivers/pluto5.c4
-rw-r--r--src/mame/drivers/plygonet.c8
-rw-r--r--src/mame/drivers/pntnpuzl.c2
-rw-r--r--src/mame/drivers/polepos.c2
-rw-r--r--src/mame/drivers/policetr.c4
-rw-r--r--src/mame/drivers/ppmast93.c2
-rw-r--r--src/mame/drivers/psikyo.c10
-rw-r--r--src/mame/drivers/punchout.c6
-rw-r--r--src/mame/drivers/qdrmfgp.c2
-rw-r--r--src/mame/drivers/quizo.c2
-rw-r--r--src/mame/drivers/quizpun2.c2
-rw-r--r--src/mame/drivers/r2dtank.c10
-rw-r--r--src/mame/drivers/raiden.c2
-rw-r--r--src/mame/drivers/realbrk.c6
-rw-r--r--src/mame/drivers/rmhaihai.c6
-rw-r--r--src/mame/drivers/rollerg.c2
-rw-r--r--src/mame/drivers/roul.c2
-rw-r--r--src/mame/drivers/route16.c4
-rw-r--r--src/mame/drivers/royalmah.c20
-rw-r--r--src/mame/drivers/sandscrp.c2
-rw-r--r--src/mame/drivers/saturn.c18
-rw-r--r--src/mame/drivers/scramble.c2
-rw-r--r--src/mame/drivers/sderby.c4
-rw-r--r--src/mame/drivers/seattle.c38
-rw-r--r--src/mame/drivers/segac2.c4
-rw-r--r--src/mame/drivers/segag80r.c2
-rw-r--r--src/mame/drivers/segag80v.c4
-rw-r--r--src/mame/drivers/segald.c18
-rw-r--r--src/mame/drivers/segaorun.c12
-rw-r--r--src/mame/drivers/segas16b.c4
-rw-r--r--src/mame/drivers/segas18.c4
-rw-r--r--src/mame/drivers/segas24.c18
-rw-r--r--src/mame/drivers/segas32.c34
-rw-r--r--src/mame/drivers/seibuspi.c64
-rw-r--r--src/mame/drivers/seicross.c2
-rw-r--r--src/mame/drivers/seta.c22
-rw-r--r--src/mame/drivers/seta2.c2
-rw-r--r--src/mame/drivers/sf.c2
-rw-r--r--src/mame/drivers/shangha3.c4
-rw-r--r--src/mame/drivers/simpl156.c10
-rw-r--r--src/mame/drivers/slapfght.c16
-rw-r--r--src/mame/drivers/snesb.c2
-rw-r--r--src/mame/drivers/solomon.c6
-rw-r--r--src/mame/drivers/sothello.c2
-rw-r--r--src/mame/drivers/spaceg.c4
-rw-r--r--src/mame/drivers/spdodgeb.c4
-rw-r--r--src/mame/drivers/spoker.c8
-rw-r--r--src/mame/drivers/spy.c10
-rw-r--r--src/mame/drivers/srmp6.c4
-rw-r--r--src/mame/drivers/ssfindo.c16
-rw-r--r--src/mame/drivers/sshangha.c4
-rw-r--r--src/mame/drivers/ssv.c6
-rw-r--r--src/mame/drivers/stadhero.c4
-rw-r--r--src/mame/drivers/starwars.c2
-rw-r--r--src/mame/drivers/strnskil.c10
-rw-r--r--src/mame/drivers/stv.c8
-rw-r--r--src/mame/drivers/suna16.c16
-rw-r--r--src/mame/drivers/suna8.c52
-rw-r--r--src/mame/drivers/supbtime.c2
-rw-r--r--src/mame/drivers/superchs.c4
-rw-r--r--src/mame/drivers/superqix.c26
-rw-r--r--src/mame/drivers/suprgolf.c4
-rw-r--r--src/mame/drivers/suprnova.c32
-rw-r--r--src/mame/drivers/surpratk.c6
-rw-r--r--src/mame/drivers/system1.c14
-rw-r--r--src/mame/drivers/system16.c4
-rw-r--r--src/mame/drivers/taito_f2.c10
-rw-r--r--src/mame/drivers/taito_f3.c4
-rw-r--r--src/mame/drivers/taito_l.c26
-rw-r--r--src/mame/drivers/taito_o.c2
-rw-r--r--src/mame/drivers/taito_z.c14
-rw-r--r--src/mame/drivers/taitoair.c6
-rw-r--r--src/mame/drivers/taitojc.c12
-rw-r--r--src/mame/drivers/taitotz.c6
-rw-r--r--src/mame/drivers/tecmosys.c6
-rw-r--r--src/mame/drivers/tehkanwc.c2
-rw-r--r--src/mame/drivers/tetrisp2.c4
-rw-r--r--src/mame/drivers/thedeep.c4
-rw-r--r--src/mame/drivers/thunderx.c16
-rw-r--r--src/mame/drivers/tickee.c2
-rw-r--r--src/mame/drivers/tigeroad.c4
-rw-r--r--src/mame/drivers/tmaster.c8
-rw-r--r--src/mame/drivers/tmnt.c4
-rw-r--r--src/mame/drivers/toaplan2.c6
-rw-r--r--src/mame/drivers/tomcat.c4
-rw-r--r--src/mame/drivers/topspeed.c6
-rw-r--r--src/mame/drivers/trvmadns.c4
-rw-r--r--src/mame/drivers/tumbleb.c4
-rw-r--r--src/mame/drivers/twinkle.c6
-rw-r--r--src/mame/drivers/undrfire.c2
-rw-r--r--src/mame/drivers/vamphalf.c40
-rw-r--r--src/mame/drivers/vball.c4
-rw-r--r--src/mame/drivers/vegas.c54
-rw-r--r--src/mame/drivers/vendetta.c2
-rw-r--r--src/mame/drivers/viper.c26
-rw-r--r--src/mame/drivers/voyager.c2
-rw-r--r--src/mame/drivers/vsnes.c4
-rw-r--r--src/mame/drivers/wecleman.c2
-rw-r--r--src/mame/drivers/wgp.c8
-rw-r--r--src/mame/drivers/wheelfir.c2
-rw-r--r--src/mame/drivers/witch.c2
-rw-r--r--src/mame/drivers/xexex.c2
-rw-r--r--src/mame/drivers/xmen.c2
-rw-r--r--src/mame/drivers/xtheball.c2
-rw-r--r--src/mame/drivers/xyonix.c4
-rw-r--r--src/mame/drivers/yunsung8.c2
-rw-r--r--src/mame/drivers/zn.c6
-rw-r--r--src/mame/includes/megadriv.h4
-rw-r--r--src/mame/machine/3do.c28
-rw-r--r--src/mame/machine/ajax.c4
-rw-r--r--src/mame/machine/amiga.c10
-rw-r--r--src/mame/machine/archimds.c16
-rw-r--r--src/mame/machine/arkanoid.c114
-rw-r--r--src/mame/machine/asic65.c2
-rw-r--r--src/mame/machine/atarigen.c2
-rw-r--r--src/mame/machine/balsente.c4
-rw-r--r--src/mame/machine/bonzeadv.c6
-rw-r--r--src/mame/machine/btime.c6
-rw-r--r--src/mame/machine/bublbobl.c44
-rw-r--r--src/mame/machine/buggychl.c16
-rw-r--r--src/mame/machine/cchip.c2
-rw-r--r--src/mame/machine/cd32.c4
-rw-r--r--src/mame/machine/cdi070.c2
-rw-r--r--src/mame/machine/cdicdic.c2
-rw-r--r--src/mame/machine/cdislave.c2
-rw-r--r--src/mame/machine/chaknpop.c18
-rw-r--r--src/mame/machine/dc.c4
-rw-r--r--src/mame/machine/dec0.c10
-rw-r--r--src/mame/machine/decocass.c104
-rw-r--r--src/mame/machine/decoprot.c60
-rw-r--r--src/mame/machine/fddebug.c8
-rw-r--r--src/mame/machine/flstory.c18
-rw-r--r--src/mame/machine/gaelco2.c8
-rw-r--r--src/mame/machine/gaelcrpt.c2
-rw-r--r--src/mame/machine/galaxold.c12
-rw-r--r--src/mame/machine/harddriv.c34
-rw-r--r--src/mame/machine/kaneko_hit.c12
-rw-r--r--src/mame/machine/kaneko_toybox.c2
-rw-r--r--src/mame/machine/konamigx.c2
-rw-r--r--src/mame/machine/konppc.c4
-rw-r--r--src/mame/machine/leland.c44
-rw-r--r--src/mame/machine/lkage.c16
-rw-r--r--src/mame/machine/lsasquad.c24
-rw-r--r--src/mame/machine/m68kfmly.c20
-rw-r--r--src/mame/machine/maniach.c16
-rw-r--r--src/mame/machine/mcr.c2
-rw-r--r--src/mame/machine/mcr68.c10
-rw-r--r--src/mame/machine/md_cart.c38
-rw-r--r--src/mame/machine/mega32x.c2
-rw-r--r--src/mame/machine/megadriv.c42
-rw-r--r--src/mame/machine/megavdp.c4
-rw-r--r--src/mame/machine/mexico86.c18
-rw-r--r--src/mame/machine/midtunit.c24
-rw-r--r--src/mame/machine/midwayic.c8
-rw-r--r--src/mame/machine/midwunit.c14
-rw-r--r--src/mame/machine/midxunit.c18
-rw-r--r--src/mame/machine/midyunit.c16
-rw-r--r--src/mame/machine/model1.c14
-rw-r--r--src/mame/machine/n64.c34
-rw-r--r--src/mame/machine/namcoio.c4
-rw-r--r--src/mame/machine/namcond1.c2
-rw-r--r--src/mame/machine/namcos1.c32
-rw-r--r--src/mame/machine/namcos2.c2
-rw-r--r--src/mame/machine/naomi.c26
-rw-r--r--src/mame/machine/neoboot.c8
-rw-r--r--src/mame/machine/neoprot.c10
-rw-r--r--src/mame/machine/nmk004.c4
-rw-r--r--src/mame/machine/opwolf.c6
-rw-r--r--src/mame/machine/pgmprot1.c16
-rw-r--r--src/mame/machine/pgmprot2.c26
-rw-r--r--src/mame/machine/pgmprot3.c12
-rw-r--r--src/mame/machine/pgmprot4.c8
-rw-r--r--src/mame/machine/pgmprot6.c6
-rw-r--r--src/mame/machine/retofinv.c16
-rw-r--r--src/mame/machine/scramble.c12
-rw-r--r--src/mame/machine/segaic16.c2
-rw-r--r--src/mame/machine/segas32.c6
-rw-r--r--src/mame/machine/seicop.c24
-rw-r--r--src/mame/machine/slapfght.c162
-rw-r--r--src/mame/machine/slapstic.c4
-rw-r--r--src/mame/machine/smpc.c4
-rw-r--r--src/mame/machine/snes.c34
-rw-r--r--src/mame/machine/stvprot.c32
-rw-r--r--src/mame/machine/taitoio.c20
-rw-r--r--src/mame/machine/taitosj.c34
-rw-r--r--src/mame/machine/tatsumi.c40
-rw-r--r--src/mame/machine/tnzs.c28
-rw-r--r--src/mame/machine/toaplan1.c28
-rw-r--r--src/mame/machine/twincobr.c26
-rw-r--r--src/mame/machine/tx1.c2
-rw-r--r--src/mame/machine/volfied.c6
-rw-r--r--src/mame/machine/xevious.c20
-rw-r--r--src/mame/video/airbustr.c2
-rw-r--r--src/mame/video/battlera.c6
-rw-r--r--src/mame/video/beathead.c2
-rw-r--r--src/mame/video/bwing.c2
-rw-r--r--src/mame/video/capbowl.c4
-rw-r--r--src/mame/video/cischeat.c8
-rw-r--r--src/mame/video/cvs.c2
-rw-r--r--src/mame/video/dc.c6
-rw-r--r--src/mame/video/dcheese.c6
-rw-r--r--src/mame/video/dogfgt.c2
-rw-r--r--src/mame/video/dooyong.c2
-rw-r--r--src/mame/video/dynax.c2
-rw-r--r--src/mame/video/flstory.c4
-rw-r--r--src/mame/video/galivan.c2
-rw-r--r--src/mame/video/galpani2.c2
-rw-r--r--src/mame/video/ginganin.c2
-rw-r--r--src/mame/video/gticlub.c10
-rw-r--r--src/mame/video/hexion.c20
-rw-r--r--src/mame/video/homedata.c6
-rw-r--r--src/mame/video/itech8.c6
-rw-r--r--src/mame/video/jaguar.c8
-rw-r--r--src/mame/video/kaneko_grap2.c2
-rw-r--r--src/mame/video/kaneko_spr.c2
-rw-r--r--src/mame/video/konamiic.c10
-rw-r--r--src/mame/video/konicdev.c56
-rw-r--r--src/mame/video/lethalj.c2
-rw-r--r--src/mame/video/m107.c2
-rw-r--r--src/mame/video/m92.c4
-rw-r--r--src/mame/video/mcd212.c2
-rw-r--r--src/mame/video/megasys1.c4
-rw-r--r--src/mame/video/midvunit.c4
-rw-r--r--src/mame/video/midzeus.c10
-rw-r--r--src/mame/video/midzeus2.c4
-rw-r--r--src/mame/video/mitchell.c6
-rw-r--r--src/mame/video/mjkjidai.c2
-rw-r--r--src/mame/video/othldrby.c2
-rw-r--r--src/mame/video/policetr.c14
-rw-r--r--src/mame/video/scn2674.c16
-rw-r--r--src/mame/video/segag80r.c4
-rw-r--r--src/mame/video/seta.c2
-rw-r--r--src/mame/video/seta2.c10
-rw-r--r--src/mame/video/st0016.c2
-rw-r--r--src/mame/video/st0020.c10
-rw-r--r--src/mame/video/stvvdp1.c6
-rw-r--r--src/mame/video/suna16.c4
-rw-r--r--src/mame/video/taito_l.c6
-rw-r--r--src/mame/video/taitoic.c10
-rw-r--r--src/mame/video/tatsumi.c4
-rw-r--r--src/mame/video/victory.c38
-rw-r--r--src/mame/video/williams.c2
-rw-r--r--src/mess/audio/mea8000.c14
-rw-r--r--src/mess/devices/sonydriv.c6
-rw-r--r--src/mess/drivers/a2600.c24
-rw-r--r--src/mess/drivers/apollo.c4
-rw-r--r--src/mess/drivers/bebox.c2
-rw-r--r--src/mess/drivers/camplynx.c6
-rw-r--r--src/mess/drivers/craft.c2
-rw-r--r--src/mess/drivers/cxhumax.c2
-rw-r--r--src/mess/drivers/dc.c4
-rw-r--r--src/mess/drivers/esq1.c2
-rw-r--r--src/mess/drivers/esq5505.c6
-rw-r--r--src/mess/drivers/ex800.c46
-rw-r--r--src/mess/drivers/gba.c14
-rw-r--r--src/mess/drivers/gp2x.c4
-rw-r--r--src/mess/drivers/gp32.c76
-rw-r--r--src/mess/drivers/ip20.c6
-rw-r--r--src/mess/drivers/ip22.c8
-rw-r--r--src/mess/drivers/mac.c26
-rw-r--r--src/mess/drivers/nc.c6
-rw-r--r--src/mess/drivers/next.c36
-rw-r--r--src/mess/drivers/ng_aes.c22
-rw-r--r--src/mess/drivers/pasogo.c6
-rw-r--r--src/mess/drivers/pasopia7.c4
-rw-r--r--src/mess/drivers/pc8801.c2
-rw-r--r--src/mess/drivers/pc88va.c2
-rw-r--r--src/mess/drivers/pc9801.c2
-rw-r--r--src/mess/drivers/rainbow.c2
-rw-r--r--src/mess/drivers/rex6000.c2
-rw-r--r--src/mess/drivers/rvoice.c4
-rw-r--r--src/mess/drivers/scv.c2
-rw-r--r--src/mess/drivers/sgi_ip2.c2
-rw-r--r--src/mess/drivers/sgi_ip6.c2
-rw-r--r--src/mess/drivers/smc777.c10
-rw-r--r--src/mess/drivers/socrates.c2
-rw-r--r--src/mess/drivers/ssystem3.c2
-rw-r--r--src/mess/drivers/supracan.c2
-rw-r--r--src/mess/drivers/vboy.c2
-rw-r--r--src/mess/drivers/vii.c2
-rw-r--r--src/mess/drivers/vk100.c4
-rw-r--r--src/mess/drivers/x1.c8
-rw-r--r--src/mess/drivers/x68k.c10
-rw-r--r--src/mess/machine/3c505.c8
-rw-r--r--src/mess/machine/a2cffa.c2
-rw-r--r--src/mess/machine/a2memexp.c4
-rw-r--r--src/mess/machine/a2mockingboard.c6
-rw-r--r--src/mess/machine/a2scsi.c6
-rw-r--r--src/mess/machine/a2videoterm.c4
-rw-r--r--src/mess/machine/amigacd.c58
-rw-r--r--src/mess/machine/amigacrt.c10
-rw-r--r--src/mess/machine/apollo_kbd.c2
-rw-r--r--src/mess/machine/apple2.c4
-rw-r--r--src/mess/machine/bbc.c4
-rw-r--r--src/mess/machine/bebox.c4
-rw-r--r--src/mess/machine/c65.c4
-rw-r--r--src/mess/machine/coco.c4
-rw-r--r--src/mess/machine/compis.c132
-rw-r--r--src/mess/machine/cuda.c20
-rw-r--r--src/mess/machine/dccons.c10
-rw-r--r--src/mess/machine/dec_lk201.c14
-rw-r--r--src/mess/machine/dgn_beta.c2
-rw-r--r--src/mess/machine/egret.c6
-rw-r--r--src/mess/machine/gamecom.c2
-rw-r--r--src/mess/machine/gb.c38
-rw-r--r--src/mess/machine/hp48.c30
-rw-r--r--src/mess/machine/intv.c2
-rw-r--r--src/mess/machine/isa_hdc.c4
-rw-r--r--src/mess/machine/isa_ide_cd.c2
-rw-r--r--src/mess/machine/lisa.c14
-rw-r--r--src/mess/machine/mac.c30
-rw-r--r--src/mess/machine/macpci.c16
-rw-r--r--src/mess/machine/mb8795.c28
-rw-r--r--src/mess/machine/mc6843.c40
-rw-r--r--src/mess/machine/mc6846.c36
-rw-r--r--src/mess/machine/mc6854.c30
-rw-r--r--src/mess/machine/mface2.c2
-rw-r--r--src/mess/machine/mos6530.c4
-rw-r--r--src/mess/machine/ncr5380.c6
-rw-r--r--src/mess/machine/ncr5390.c18
-rw-r--r--src/mess/machine/nes.c4
-rw-r--r--src/mess/machine/nextmo.c36
-rw-r--r--src/mess/machine/nubus_asntmc3b.c4
-rw-r--r--src/mess/machine/omti8621.c2
-rw-r--r--src/mess/machine/oric.c4
-rw-r--r--src/mess/machine/pc.c2
-rw-r--r--src/mess/machine/pc1403.c2
-rw-r--r--src/mess/machine/pce.c4
-rw-r--r--src/mess/machine/pokemini.c14
-rw-r--r--src/mess/machine/psxcd.c4
-rw-r--r--src/mess/machine/rm380z.c12
-rw-r--r--src/mess/machine/rmnimbus.c164
-rw-r--r--src/mess/machine/sc499.c2
-rw-r--r--src/mess/machine/sgi.c2
-rw-r--r--src/mess/machine/sms.c4
-rw-r--r--src/mess/machine/sym1.c4
-rw-r--r--src/mess/machine/tandy1t.c6
-rw-r--r--src/mess/machine/thomflop.c92
-rw-r--r--src/mess/machine/thomson.c92
-rw-r--r--src/mess/machine/wswan.c6
-rw-r--r--src/mess/machine/z80ne.c2
-rw-r--r--src/mess/video/crtc_ega.c2
-rw-r--r--src/mess/video/gba.c2
-rw-r--r--src/mess/video/mac.c12
-rw-r--r--src/mess/video/newport.c2
-rw-r--r--src/mess/video/nubus_48gc.c2
-rw-r--r--src/mess/video/nubus_cb264.c4
-rw-r--r--src/mess/video/nubus_m2hires.c8
-rw-r--r--src/mess/video/nubus_spec8.c6
-rw-r--r--src/mess/video/nubus_specpdq.c22
-rw-r--r--src/mess/video/nubus_wsportrait.c2
-rw-r--r--src/mess/video/rm380z.c2
-rw-r--r--src/mess/video/rmnimbus.c4
-rw-r--r--src/mess/video/ssystem3.c2
-rw-r--r--src/mess/video/stic.c2
-rw-r--r--src/mess/video/x68k.c4
589 files changed, 3228 insertions, 3207 deletions
diff --git a/src/emu/cpu/m6502/opsce02.h b/src/emu/cpu/m6502/opsce02.h
index 64549135932..28f00a791fd 100644
--- a/src/emu/cpu/m6502/opsce02.h
+++ b/src/emu/cpu/m6502/opsce02.h
@@ -291,7 +291,7 @@
t1=RDOPARG(); \
t2=RDOPARG(); \
t3=RDOPARG(); \
- logerror("m65ce02 at pc:%.4x reserved op aug %.2x %.2x %.2x\n", cpu_get_pc(cpustate->device),t1,t2,t3);
+ logerror("m65ce02 at pc:%.4x reserved op aug %.2x %.2x %.2x\n", cpustate->device->safe_pc(),t1,t2,t3);
/* 65ce02 ******************************************************
* BBR Branch if bit is reset
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index e14fcb2761b..2ba284bae5c 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1601,7 +1601,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(),cpu_get_pc(&space->device()),offset);
+ logerror("M6801 '%s' PC %04x: warning - read from reserved internal register %02x\n",space->device().tag(),space->device().safe_pc(),offset);
}
return data;
@@ -1635,7 +1635,7 @@ 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(),cpu_get_pc(&space->device()));
+ 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;
@@ -1770,7 +1770,7 @@ 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(),cpu_get_pc(&space->device()),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:
@@ -1832,7 +1832,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(),cpu_get_pc(&space->device()),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 06a9e303136..bc6785916bd 100644
--- a/src/emu/cpu/m68000/68307bus.c
+++ b/src/emu/cpu/m68000/68307bus.c
@@ -14,7 +14,7 @@ READ8_HANDLER( m68307_internal_mbus_r )
if (mbus)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset)
@@ -61,7 +61,7 @@ WRITE8_HANDLER( m68307_internal_mbus_w )
if (mbus)
{
- int pc = cpu_get_pc(&space->device());
+ 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 7a8e1a1ca77..6ed1942115d 100644
--- a/src/emu/cpu/m68000/68307ser.c
+++ b/src/emu/cpu/m68000/68307ser.c
@@ -29,7 +29,7 @@ READ8_HANDLER( m68307_internal_serial_r )
else
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset)
{
@@ -97,7 +97,7 @@ WRITE8_HANDLER( m68307_internal_serial_w )
m68307_serial* serial = m68k->m68307SERIAL;
assert(serial != NULL);
- int pc = cpu_get_pc(&space->device());
+ 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 8698f2f2cec..2e922dabbe2 100644
--- a/src/emu/cpu/m68000/68307sim.c
+++ b/src/emu/cpu/m68000/68307sim.c
@@ -10,7 +10,7 @@ READ16_HANDLER( m68307_internal_sim_r )
m68307_sim* sim = m68k->m68307SIM;
assert(sim != NULL);
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
if (sim)
{
@@ -47,7 +47,7 @@ WRITE16_HANDLER( m68307_internal_sim_w )
m68307_sim* sim = m68k->m68307SIM;
assert(sim != NULL);
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
if (sim)
{
@@ -152,7 +152,7 @@ void m68307_sim::write_paddr(UINT16 data, UINT16 mem_mask)
UINT16 m68307_sim::read_padat(address_space *space, UINT16 mem_mask)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
if (m68k->m_m68307_porta_r)
@@ -179,7 +179,7 @@ UINT16 m68307_sim::read_padat(address_space *space, UINT16 mem_mask)
void m68307_sim::write_padat(address_space *space, UINT16 data, UINT16 mem_mask)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
COMBINE_DATA(&m_padat);
@@ -205,7 +205,7 @@ void m68307_sim::write_pbddr(UINT16 data, UINT16 mem_mask)
UINT16 m68307_sim::read_pbdat(address_space *space, UINT16 mem_mask)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
if (m68k->m_m68307_portb_r)
@@ -232,7 +232,7 @@ UINT16 m68307_sim::read_pbdat(address_space *space, UINT16 mem_mask)
void m68307_sim::write_pbdat(address_space *space, UINT16 data, UINT16 mem_mask)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
COMBINE_DATA(&m_pbdat);
diff --git a/src/emu/cpu/m68000/68307tmu.c b/src/emu/cpu/m68000/68307tmu.c
index 104a65c6738..d4ab8b894e6 100644
--- a/src/emu/cpu/m68000/68307tmu.c
+++ b/src/emu/cpu/m68000/68307tmu.c
@@ -12,7 +12,7 @@ READ16_HANDLER( m68307_internal_timer_r )
if (timer)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
int which = offset & 0x8;
switch (offset&0x7)
@@ -40,7 +40,7 @@ WRITE16_HANDLER( m68307_internal_timer_w )
if (timer)
{
- int pc = cpu_get_pc(&space->device());
+ 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 2d52f3473cc..567349b9745 100644
--- a/src/emu/cpu/m68000/68340dma.c
+++ b/src/emu/cpu/m68000/68340dma.c
@@ -12,7 +12,7 @@ READ32_HANDLER( m68340_internal_dma_r )
if (dma)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
logerror("%08x m68340_internal_dma_r %08x, (%08x)\n", pc, offset*4,mem_mask);
}
@@ -27,7 +27,7 @@ WRITE32_HANDLER( m68340_internal_dma_w )
if (dma)
{
- int pc = cpu_get_pc(&space->device());
+ 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 8009201729e..e438a92a22e 100644
--- a/src/emu/cpu/m68000/68340ser.c
+++ b/src/emu/cpu/m68000/68340ser.c
@@ -12,7 +12,7 @@ READ32_HANDLER( m68340_internal_serial_r )
if (serial)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
logerror("%08x m68340_internal_serial_r %08x, (%08x)\n", pc, offset*4,mem_mask);
}
@@ -27,7 +27,7 @@ WRITE32_HANDLER( m68340_internal_serial_w )
if (serial)
{
- int pc = cpu_get_pc(&space->device());
+ 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 4f8089142f8..25753696909 100644
--- a/src/emu/cpu/m68000/68340sim.c
+++ b/src/emu/cpu/m68000/68340sim.c
@@ -12,7 +12,7 @@ READ16_HANDLER( m68340_internal_sim_r )
if (sim)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset<<1)
{
@@ -63,7 +63,7 @@ READ8_HANDLER( m68340_internal_sim_ports_r )
if (sim)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset)
{
@@ -119,7 +119,7 @@ READ32_HANDLER( m68340_internal_sim_cs_r )
if (sim)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset<<2)
{
@@ -149,7 +149,7 @@ WRITE16_HANDLER( m68340_internal_sim_w )
if (sim)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset<<1)
{
@@ -199,7 +199,7 @@ WRITE8_HANDLER( m68340_internal_sim_ports_w )
if (sim)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
switch (offset)
{
@@ -252,7 +252,7 @@ WRITE32_HANDLER( m68340_internal_sim_cs_w )
if (sim)
{
- int pc = cpu_get_pc(&space->device());
+ 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 b68718fa47b..8a878a6a993 100644
--- a/src/emu/cpu/m68000/68340tmu.c
+++ b/src/emu/cpu/m68000/68340tmu.c
@@ -13,7 +13,7 @@ READ32_HANDLER( m68340_internal_timer_r )
if (timer)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
logerror("%08x m68340_internal_timer_r %08x, (%08x)\n", pc, offset*4,mem_mask);
}
@@ -28,7 +28,7 @@ WRITE32_HANDLER( m68340_internal_timer_w )
if (timer)
{
- int pc = cpu_get_pc(&space->device());
+ 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/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index a4b88ac4bda..d27872cd03e 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -2077,7 +2077,7 @@ static READ16_HANDLER( m68307_internal_base_r )
{
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
logerror("%08x m68307_internal_base_r %08x, (%04x)\n", pc, offset*2,mem_mask);
switch (offset<<1)
@@ -2096,7 +2096,7 @@ static WRITE16_HANDLER( m68307_internal_base_w )
{
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
- int pc = cpu_get_pc(&space->device());
+ 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;
@@ -2764,7 +2764,7 @@ CPU_GET_INFO( scc68070 )
static READ32_HANDLER( m68340_internal_base_r )
{
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
- int pc = cpu_get_pc(&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;
}
@@ -2773,7 +2773,7 @@ static WRITE32_HANDLER( m68340_internal_base_w )
{
m68ki_cpu_core *m68k = m68k_get_safe_token(&space->device());
- int pc = cpu_get_pc(&space->device());
+ 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/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index d67ceace009..21129b19e7c 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -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, cpu_get_pc(&space->device()));
+// 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 )
{
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index b2824e451eb..71033a66866 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -1967,7 +1967,7 @@ static CPU_EXECUTE( t90 )
break;
default:
- fatalerror("%04x: unimplemented opcode, op=%02x\n",cpu_get_pc(device),cpustate->op);
+ fatalerror("%04x: unimplemented opcode, op=%02x\n",device->safe_pc(),cpustate->op);
}
if ( cpustate->op != EI )
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c
index 39d02ad6d52..6afda3e2be6 100644
--- a/src/emu/cpu/tms34010/34010gfx.c
+++ b/src/emu/cpu/tms34010/34010gfx.c
@@ -84,7 +84,7 @@ static int apply_window(tms34010_state *tms, const char *inst_name,int srcbpp, U
int diff, cycles = 3;
if (WINDOW_CHECKING(tms) == 2)
- logerror("%08x: %s apply_window window mode %d not supported!\n", cpu_get_pc(tms->device), inst_name, WINDOW_CHECKING(tms));
+ logerror("%08x: %s apply_window window mode %d not supported!\n", tms->device->safe_pc(), inst_name, WINDOW_CHECKING(tms));
CLR_V(tms);
if (WINDOW_CHECKING(tms) == 1)
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 5f4eab8e87c..800ab90740a 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -1224,7 +1224,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
break;
case REG_PMASK:
- if (data) logerror("Plane masking not supported. PC=%08X\n", cpu_get_pc(&space->device()));
+ if (data) logerror("Plane masking not supported. PC=%08X\n", space->device().safe_pc());
break;
case REG_DPYCTL:
@@ -1375,7 +1375,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
case REG020_PMASKL:
case REG020_PMASKH:
- if (data) logerror("Plane masking not supported. PC=%08X\n", cpu_get_pc(&space->device()));
+ if (data) logerror("Plane masking not supported. PC=%08X\n", space->device().safe_pc());
break;
case REG020_DPYCTL:
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index a8041abc168..6cc43afb4c4 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -202,7 +202,7 @@ void debug_view_disasm::view_char(int chval)
case DCH_HOME: // set the active column to the PC
{
const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source);
- offs_t pc = source.m_space->address_to_byte(cpu_get_pc(&source.m_device)) & source.m_space->logbytemask();
+ offs_t pc = source.m_space->address_to_byte(source.m_device.safe_pc()) & source.m_space->logbytemask();
// figure out which row the pc is on
for (int curline = 0; curline < m_allocated.y; curline++)
@@ -468,7 +468,7 @@ void debug_view_disasm::view_update()
{
const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source);
- offs_t pc = cpu_get_pc(&source.m_device);
+ offs_t pc = source.m_device.safe_pc();
offs_t pcbyte = source.m_space->address_to_byte(pc) & source.m_space->logbytemask();
// update our context; if the expression is dirty, recompute
diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h
index 0eee7f3f862..1590fc4cbfb 100644
--- a/src/emu/devcpu.h
+++ b/src/emu/devcpu.h
@@ -294,9 +294,6 @@ const device_type name = &legacy_device_creator<basename##_device>
// CPU timing
#define cpu_get_reg(cpu, _reg) device_state(cpu)->state(_reg)
-#define cpu_get_previouspc(cpu) ((offs_t)device_state(cpu)->state(STATE_GENPCBASE))
-#define cpu_get_pc(cpu) ((offs_t)device_state(cpu)->state(STATE_GENPC))
-
#define cpu_set_reg(cpu, _reg, val) device_state(cpu)->set_state(_reg, val)
// helpers for using machine/cputag instead of cpu objects
diff --git a/src/emu/device.h b/src/emu/device.h
index ebbb1590a89..259ed93e750 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -230,6 +230,8 @@ public:
// debugging
device_debug *debug() const { return m_debug; }
+ offs_t safe_pc();
+ offs_t safe_pcbase();
void set_default_bios(UINT8 bios) { m_default_bios = bios; }
void set_system_bios(UINT8 bios) { m_system_bios = bios; }
diff --git a/src/emu/distate.c b/src/emu/distate.c
index 6a0621d3eac..c8745a33449 100644
--- a/src/emu/distate.c
+++ b/src/emu/distate.c
@@ -523,8 +523,8 @@ device_state_entry &device_state_interface::state_add(int index, const char *sym
m_state_list.append(*entry);
// set the fast entry if applicable
- if (index >= k_fast_state_min && index <= k_fast_state_max)
- m_fast_state[index - k_fast_state_min] = entry;
+ if (index >= FAST_STATE_MIN && index <= FAST_STATE_MAX)
+ m_fast_state[index - FAST_STATE_MIN] = entry;
return *entry;
}
@@ -595,8 +595,8 @@ void device_state_interface::interface_post_start()
const device_state_entry *device_state_interface::state_find_entry(int index)
{
// use fast lookup if possible
- if (index >= k_fast_state_min && index <= k_fast_state_max)
- return m_fast_state[index - k_fast_state_min];
+ if (index >= FAST_STATE_MIN && index <= FAST_STATE_MAX)
+ return m_fast_state[index - FAST_STATE_MIN];
// otherwise, scan the first
for (const device_state_entry *entry = m_state_list.first(); entry != NULL; entry = entry->m_next)
diff --git a/src/emu/distate.h b/src/emu/distate.h
index 66b756e566b..b64a10f1348 100644
--- a/src/emu/distate.h
+++ b/src/emu/distate.h
@@ -186,12 +186,12 @@ protected:
const device_state_entry *state_find_entry(int index);
// constants
- static const int k_fast_state_min = -4; // range for fast state
- static const int k_fast_state_max = 256; // lookups
+ static const int FAST_STATE_MIN = -4; // range for fast state
+ static const int FAST_STATE_MAX = 256; // lookups
// state
simple_list<device_state_entry> m_state_list; // head of state list
- device_state_entry * m_fast_state[k_fast_state_max + 1 - k_fast_state_min];
+ device_state_entry * m_fast_state[FAST_STATE_MAX + 1 - FAST_STATE_MIN];
// fast access to common entries
};
@@ -205,6 +205,28 @@ typedef device_interface_iterator<device_state_interface> state_interface_iterat
//**************************************************************************
//-------------------------------------------------
+// device_t::safe_pc - return the current PC
+// or 0 if no state object exists
+//-------------------------------------------------
+
+inline offs_t device_t::safe_pc()
+{
+ return (m_state != NULL) ? m_state->pc() : 0;
+}
+
+
+//-------------------------------------------------
+// device_t::safe_pcbase - return the current PC
+// base or 0 if no state object exists
+//-------------------------------------------------
+
+inline offs_t device_t::safe_pcbase()
+{
+ return (m_state != NULL) ? m_state->pcbase() : 0;
+}
+
+
+//-------------------------------------------------
// device_state - return a pointer to the device
// state interface for this device
//-------------------------------------------------
diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c
index feb9d499731..3a1434ff017 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, cpu_get_pc(&space->device()));
+// 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, cpu_get_pc(&space->device()));
+// 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/am53cf96.c b/src/emu/machine/am53cf96.c
index f0bd3582cac..fd7d94a9406 100644
--- a/src/emu/machine/am53cf96.c
+++ b/src/emu/machine/am53cf96.c
@@ -32,11 +32,11 @@ READ8_MEMBER( am53cf96_device::read )
if (offset == REG_FIFO)
{
-// mame_printf_debug("53cf96: read FIFO PC=%x\n", cpu_get_pc(&space.device()));
+// mame_printf_debug("53cf96: read FIFO PC=%x\n", space.device().safe_pc());
return 0;
}
-// logerror("53cf96: read reg %d = %x (PC=%x)\n", reg, rv>>shift, cpu_get_pc(&space.device()));
+// logerror("53cf96: read reg %d = %x (PC=%x)\n", reg, rv>>shift, space.device().safe_pc());
if (offset == REG_IRQSTATE)
{
@@ -55,7 +55,7 @@ void am53cf96_device::device_timer(emu_timer &timer, device_timer_id tid, int pa
WRITE8_MEMBER( am53cf96_device::write )
{
-// logerror("53cf96: w %x to reg %d (PC=%x)\n", data, offset, cpu_get_pc(&space.device()));
+// logerror("53cf96: w %x to reg %d (PC=%x)\n", data, offset, space.device().safe_pc());
// if writing to the target ID, cache it off for later
if (offset == REG_STATUS)
@@ -93,7 +93,7 @@ WRITE8_MEMBER( am53cf96_device::write )
case 2: // reset device
scsi_regs[REG_IRQSTATE] = 8; // indicate success
- logerror("53cf96: reset target ID = %d (PC = %x)\n", last_id, cpu_get_pc(&space.device()));
+ logerror("53cf96: reset target ID = %d (PC = %x)\n", last_id, space.device().safe_pc());
if (devices[last_id])
{
devices[last_id]->reset();
@@ -121,7 +121,7 @@ WRITE8_MEMBER( am53cf96_device::write )
scsi_regs[REG_INTSTATE] = 4;
}
- logerror("53cf96: command %x exec. target ID = %d (PC = %x)\n", fifo[1], last_id, cpu_get_pc(&space.device()));
+ logerror("53cf96: command %x exec. target ID = %d (PC = %x)\n", fifo[1], last_id, space.device().safe_pc());
if (devices[last_id])
{
int length;
diff --git a/src/emu/machine/k056230.c b/src/emu/machine/k056230.c
index 4a5ead590b0..e37662323aa 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, cpu_get_pc(&space->device()));
+// 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, cpu_get_pc(&space->device()));
+// 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, cpu_get_pc(&space->device()));
+ //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, cpu_get_pc(&space->device()));
+ //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/ldpr8210.c b/src/emu/machine/ldpr8210.c
index 82ddd80d78c..79f7f3cf366 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -544,7 +544,7 @@ READ8_MEMBER( pioneer_pr8210_device::i8049_pia_r )
break;
default:
- mame_printf_debug("%03X:Unknown PR-8210 PIA read from offset %02X\n", cpu_get_pc(&space.device()), offset);
+ mame_printf_debug("%03X:Unknown PR-8210 PIA read from offset %02X\n", space.device().safe_pc(), offset);
break;
}
return result;
@@ -616,7 +616,7 @@ WRITE8_MEMBER( pioneer_pr8210_device::i8049_pia_w )
// no other writes known
default:
- mame_printf_debug("%03X:Unknown PR-8210 PIA write to offset %02X = %02X\n", cpu_get_pc(&space.device()), offset, data);
+ mame_printf_debug("%03X:Unknown PR-8210 PIA write to offset %02X = %02X\n", space.device().safe_pc(), offset, data);
break;
}
}
@@ -1097,13 +1097,13 @@ WRITE8_MEMBER( simutrek_special_device::i8748_port2_w )
{
int direction = (data & 0x08) ? 1 : -1;
if (LOG_SIMUTREK)
- printf("%3d:JUMP TRG (Simutrek PC=%03X)\n", screen().vpos(), cpu_get_pc(&space.device()));
+ printf("%3d:JUMP TRG (Simutrek PC=%03X)\n", screen().vpos(), space.device().safe_pc());
advance_slider(direction);
}
// bit $04 controls who owns the JUMP TRG command
if (LOG_SIMUTREK && ((data ^ prev) & 0x04))
- printf("%3d:Simutrek ownership line = %d (Simutrek PC=%03X)\n", screen().vpos(), (data >> 2) & 1, cpu_get_pc(&space.device()));
+ printf("%3d:Simutrek ownership line = %d (Simutrek PC=%03X)\n", screen().vpos(), (data >> 2) & 1, space.device().safe_pc());
m_controlnext = (~data >> 2) & 1;
// bits $03 control something (status?)
diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c
index 14cf1ac7b49..1d7e270b6c2 100644
--- a/src/emu/machine/ldv1000.c
+++ b/src/emu/machine/ldv1000.c
@@ -469,7 +469,7 @@ READ8_MEMBER( pioneer_ldv1000_device::z80_controller_r )
WRITE8_MEMBER( pioneer_ldv1000_device::z80_controller_w )
{
if (LOG_STATUS_CHANGES && data != m_status)
- printf("%04X:CONTROLLER.W=%02X\n", cpu_get_pc(&space.device()), data);
+ printf("%04X:CONTROLLER.W=%02X\n", space.device().safe_pc(), data);
m_status = data;
}
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index 7adb45b6e75..f4b5fde8017 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -382,7 +382,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_output0_w )
if (LOG_PORTS && (m_i8049_out0 ^ data) & 0xff)
{
- printf("%03X:out0:", cpu_get_pc(&space.device()));
+ printf("%03X:out0:", space.device().safe_pc());
if ( (data & 0x80)) printf(" ???");
if ( (data & 0x40)) printf(" LED1");
if ( (data & 0x20)) printf(" LED2");
@@ -422,7 +422,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_output1_w )
if (LOG_PORTS && (m_i8049_out1 ^ data) & 0x08)
{
- mame_printf_debug("%03X:out1:", cpu_get_pc(&space.device()));
+ mame_printf_debug("%03X:out1:", space.device().safe_pc());
if (!(data & 0x08)) mame_printf_debug(" SMS");
mame_printf_debug("\n");
m_i8049_out1 = data;
@@ -570,7 +570,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_port1_w )
if (LOG_PORTS && (m_i8049_port1 ^ data) & 0x1f)
{
- printf("%03X:port1:", cpu_get_pc(&space.device()));
+ printf("%03X:port1:", space.device().safe_pc());
if (!(data & 0x10)) printf(" SPEED");
if (!(data & 0x08)) printf(" TIMENABLE");
if (!(data & 0x04)) printf(" REV");
diff --git a/src/emu/machine/ncr539x.c b/src/emu/machine/ncr539x.c
index d786eb6249a..d2288e33db2 100644
--- a/src/emu/machine/ncr539x.c
+++ b/src/emu/machine/ncr539x.c
@@ -346,7 +346,7 @@ READ8_MEMBER( ncr539x_device::read )
#if VERBOSE
#if VERBOSE_READS
- printf("539x: Read @ %s (%02x) (PC=%x) (status %02x irq_status %02x)\n", rdregs[offset], offset, cpu_get_pc(&space.device()), m_status, m_irq_status);
+ printf("539x: Read @ %s (%02x) (PC=%x) (status %02x irq_status %02x)\n", rdregs[offset], offset, space.device().safe_pc(), m_status, m_irq_status);
#endif
#endif
@@ -377,7 +377,7 @@ READ8_MEMBER( ncr539x_device::read )
update_fifo_internal_state(fifo_bytes);
#if VERBOSE
- printf("Read %02x from FIFO[%d], FIFO now contains %d bytes (PC=%x, m_buffer_remaining %x)\n", rv, m_fifo_ptr-1, fifo_bytes, cpu_get_pc(&space.device()), m_buffer_remaining);
+ printf("Read %02x from FIFO[%d], FIFO now contains %d bytes (PC=%x, m_buffer_remaining %x)\n", rv, m_fifo_ptr-1, fifo_bytes, space.device().safe_pc(), m_buffer_remaining);
#endif
if (fifo_bytes == 0)
@@ -484,7 +484,7 @@ READ8_MEMBER( ncr539x_device::read )
WRITE8_MEMBER( ncr539x_device::write )
{
#if VERBOSE
- if (offset != 2) printf("539x: Write %02x @ %s (%02x) (PC=%x)\n", data, wrregs[offset], offset, cpu_get_pc(&space.device()));
+ if (offset != 2) printf("539x: Write %02x @ %s (%02x) (PC=%x)\n", data, wrregs[offset], offset, space.device().safe_pc());
#endif
switch (offset)
diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c
index 369cf9949e5..49c48b3d572 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",cpu_get_pc(&space->device()),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 )
{
diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c
index 463a78960a4..d15b04abced 100644
--- a/src/emu/machine/wd33c93.c
+++ b/src/emu/machine/wd33c93.c
@@ -487,7 +487,7 @@ WRITE8_MEMBER(wd33c93_device::write)
case 1:
{
- LOG(( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", cpu_get_pc(&space.device()), sasr, data ));
+ LOG(( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", space.device().safe_pc(), sasr, data ));
/* update the register */
regs[sasr] = data;
@@ -495,7 +495,7 @@ WRITE8_MEMBER(wd33c93_device::write)
/* if we receive a command, schedule to process it */
if ( sasr == WD_COMMAND )
{
- LOG(( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", cpu_get_pc(&space.device()), data, getunit() ));
+ LOG(( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", space.device().safe_pc(), data, getunit() ));
/* signal we're processing it */
regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
@@ -646,7 +646,7 @@ READ8_MEMBER(wd33c93_device::read)
irq_callback(machine(), 0);
}
- LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", cpu_get_pc(&space.device()), regs[WD_SCSI_STATUS] ));
+ LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", space.device().safe_pc(), regs[WD_SCSI_STATUS] ));
}
else if ( sasr == WD_DATA )
{
@@ -715,7 +715,7 @@ READ8_MEMBER(wd33c93_device::read)
}
}
- LOG(( "WD33C93: PC=%08x - Data read (%02x)\n", cpu_get_pc(&space.device()), regs[WD_DATA] ));
+ LOG(( "WD33C93: PC=%08x - Data read (%02x)\n", space.device().safe_pc(), regs[WD_DATA] ));
/* get the register value */
ret = regs[sasr];
diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c
index 5214b05df38..1aef7546c85 100644
--- a/src/emu/sound/nile.c
+++ b/src/emu/sound/nile.c
@@ -78,7 +78,7 @@ WRITE16_DEVICE_HANDLER( nile_sndctrl_w )
COMBINE_DATA(&info->ctrl);
-// printf("CTRL: %04x -> %04x (PC=%x)\n", ctrl, info->ctrl, cpu_get_pc(&space->device()));
+// printf("CTRL: %04x -> %04x (PC=%x)\n", ctrl, info->ctrl, space->device().safe_pc());
ctrl^=info->ctrl;
}
@@ -133,7 +133,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, cpu_get_pc(&space->device()));
+ //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/video/hd63484.c b/src/emu/video/hd63484.c
index 79c2d810d8f..d1125086633 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -1468,8 +1468,8 @@ static void hd63484_command_w(device_t *device, UINT16 cmd)
READ16_DEVICE_HANDLER( hd63484_status_r )
{
-// if (cpu_get_pc(&space->device()) != 0xfced6 && cpu_get_pc(&space->device()) != 0xfe1d6)
-// logerror("%05x: HD63484 status read\n",cpu_get_pc(&space->device()));
+// 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) */
}
@@ -1496,7 +1496,7 @@ WRITE16_DEVICE_HANDLER( hd63484_data_w )
hd63484->regno += 2; /* autoincrement */
#if LOG_COMMANDS
-// logerror("PC %05x: HD63484 register %02x write %04x\n", cpu_get_pc(&space->device()), 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 */
@@ -1513,14 +1513,14 @@ READ16_DEVICE_HANDLER( hd63484_data_r )
else if (hd63484->regno == 0)
{
#if LOG_COMMANDS
-// logerror("%05x: HD63484 read FIFO\n", cpu_get_pc(&space->device()));
+// 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", cpu_get_pc(&space->device()), 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_vga.c b/src/emu/video/pc_vga.c
index 415ab10ef10..d07e232e5f8 100644
--- a/src/emu/video/pc_vga.c
+++ b/src/emu/video/pc_vga.c
@@ -1667,7 +1667,7 @@ READ8_HANDLER(vga_port_03d0_r)
data = vga_crtc_r(space, offset);
if(offset == 8)
{
- logerror("VGA: 0x3d8 read at %08x\n",cpu_get_pc(&space->device()));
+ 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
}
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index fbfe693dc88..3bccbc714b3 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -3866,7 +3866,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
/* don't log multiple identical status reads from the same address */
if (regnum == status)
{
- offs_t pc = cpu_get_pc(v->cpu);
+ offs_t pc = v->cpu->safe_pc();
if (pc == v->last_status_pc && result == v->last_status_value)
logit = FALSE;
v->last_status_pc = pc;
diff --git a/src/mame/audio/beezer.c b/src/mame/audio/beezer.c
index 0bc952d3bbc..21e30eeff94 100644
--- a/src/mame/audio/beezer.c
+++ b/src/mame/audio/beezer.c
@@ -499,7 +499,7 @@ READ8_DEVICE_HANDLER( beezer_sh6840_r )
return 0;
/* offset 1 reads the status register: bits 2 1 0 correspond to ints on channels 2,1,0, and bit 7 is an 'OR' of bits 2,1,0 */
case 1:
- logerror("%04X:beezer_sh6840_r - unexpected read, status register is TODO!\n", cpu_get_pc(state->m_maincpu));
+ logerror("%04X:beezer_sh6840_r - unexpected read, status register is TODO!\n", state->m_maincpu->safe_pc());
return 0;
/* offsets 2,4,6 read channel 0,1,2 MSBs and latch the LSB*/
case 2: case 4: case 6:
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index a466e9c1fc2..635014b4d7a 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -410,7 +410,7 @@ static READ32_HANDLER( tms32031_io_r )
}
if (LOG_32031_IOPORTS)
- logerror("CAGE:%06X:%s read -> %08X\n", cpu_get_pc(&space->device()), 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", cpu_get_pc(&space->device()), 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)
{
@@ -506,7 +506,7 @@ static READ32_HANDLER( cage_from_main_r )
{
cage_t *state = &cage;
if (LOG_COMM)
- logerror("%06X:CAGE read command = %04X\n", cpu_get_pc(&space->device()), 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());
device_set_input_line(state->cpu, TMS3203X_IRQ0, CLEAR_LINE);
@@ -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", cpu_get_pc(&space->device()), state->from_main);
+ logerror("%06X:CAGE ack command = %04X\n", space->device().safe_pc(), state->from_main);
}
}
@@ -528,7 +528,7 @@ static WRITE32_HANDLER( cage_to_main_w )
{
cage_t *state = &cage;
if (LOG_COMM)
- logerror("%06X:Data from CAGE = %04X\n", cpu_get_pc(&space->device()), data);
+ 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;
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index bd6326ba136..43959bf020d 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -1451,7 +1451,7 @@ WRITE32_HANDLER( dsio_idma_addr_w )
{
dsio_state &dsio = dcs.dsio;
if (LOG_DCS_TRANSFERS)
- logerror("%08X:IDMA_addr = %04X\n", cpu_get_pc(&space->device()), 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;
@@ -1461,7 +1461,7 @@ WRITE32_HANDLER( dsio_idma_addr_w )
WRITE32_HANDLER( dsio_idma_data_w )
{
dsio_state &dsio = dcs.dsio;
- UINT32 pc = cpu_get_pc(&space->device());
+ UINT32 pc = space->device().safe_pc();
if (ACCESSING_BITS_0_15)
{
if (LOG_DCS_TRANSFERS)
@@ -1487,7 +1487,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", cpu_get_pc(&space->device()), 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;
}
@@ -1622,7 +1622,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", cpu_get_pc(&space->device()), dcs.input_data);
+ logerror("%08X:input_latch_r(%04X)\n", space->device().safe_pc(), dcs.input_data);
return dcs.input_data;
}
@@ -1644,7 +1644,7 @@ 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", cpu_get_pc(&space->device()), data, IS_OUTPUT_EMPTY());
+ 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);
}
@@ -1698,7 +1698,7 @@ static TIMER_CALLBACK( output_control_delayed_w )
static WRITE16_HANDLER( output_control_w )
{
if (LOG_DCS_IO)
- logerror("%04X:output_control = %04X\n", cpu_get_pc(&space->device()), data);
+ logerror("%04X:output_control = %04X\n", space->device().safe_pc(), data);
space->machine().scheduler().synchronize(FUNC(output_control_delayed_w), data);
}
@@ -1884,7 +1884,7 @@ static WRITE16_HANDLER( adsp_control_w )
/* bit 9 forces a reset */
if (data & 0x0200)
{
- logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", cpu_get_pc(&space->device()));
+ logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", space->device().safe_pc());
device_set_input_line(dcs.cpu, INPUT_LINE_RESET, PULSE_LINE);
dcs_boot(space->machine());
dcs.control_regs[SYSCONTROL_REG] = 0;
diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c
index 1910126aede..7638b289ec4 100644
--- a/src/mame/audio/exidy.c
+++ b/src/mame/audio/exidy.c
@@ -686,7 +686,7 @@ READ8_DEVICE_HANDLER( exidy_sh6840_r )
return 0;
/* offset 1 reads the status register: bits 2 1 0 correspond to ints on channels 2,1,0, and bit 7 is an 'OR' of bits 2,1,0 */
case 1:
- logerror("%04X:exidy_sh6840_r - unexpected read, status register is TODO!\n", cpu_get_pc(state->m_maincpu));
+ logerror("%04X:exidy_sh6840_r - unexpected read, status register is TODO!\n", state->m_maincpu->safe_pc());
return 0;
/* offsets 2,4,6 read channel 0,1,2 MSBs and latch the LSB*/
case 2: case 4: case 6:
@@ -1043,7 +1043,7 @@ READ8_DEVICE_HANDLER( victory_sound_response_r )
exidy_sound_state *state = get_safe_token(device);
UINT8 ret = state->m_pia1->b_output();
- if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(state->m_maincpu), ret);
+ if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", state->m_maincpu->safe_pcbase(), ret);
state->m_pia1->cb1_w(0);
@@ -1056,7 +1056,7 @@ READ8_DEVICE_HANDLER( victory_sound_status_r )
exidy_sound_state *state = get_safe_token(device);
UINT8 ret = (state->m_pia1->ca1_r() << 7) | (state->m_pia1->cb1_r() << 6);
- if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(state->m_maincpu), ret);
+ if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", state->m_maincpu->safe_pcbase(), ret);
return ret;
}
@@ -1073,7 +1073,7 @@ WRITE8_DEVICE_HANDLER( victory_sound_command_w )
{
exidy_sound_state *state = get_safe_token(device);
- if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", cpu_get_previouspc(state->m_maincpu), data);
+ if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", state->m_maincpu->safe_pcbase(), data);
device->machine().scheduler().synchronize(FUNC(delayed_command_w), data, state->m_pia1);
}
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index 6deaef8c97f..dbfc3e27253 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -54,7 +54,7 @@ static void update_68k_interrupts(running_machine &machine)
READ16_MEMBER(harddriv_state::hd68k_snd_data_r)
{
m_soundflag = 0;
- logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(&space.device()), m_sounddata);
+ logerror("%06X:main read from sound=%04X\n", space.device().safe_pcbase(), m_sounddata);
return m_sounddata;
}
@@ -77,7 +77,7 @@ static TIMER_CALLBACK( delayed_68k_w )
WRITE16_MEMBER(harddriv_state::hd68k_snd_data_w)
{
machine().scheduler().synchronize(FUNC(delayed_68k_w), data);
- logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:main write to sound=%04X\n", space.device().safe_pcbase(), data);
}
@@ -87,7 +87,7 @@ WRITE16_MEMBER(harddriv_state::hd68k_snd_reset_w)
device_set_input_line(m_soundcpu, INPUT_LINE_RESET, CLEAR_LINE);
m_mainflag = m_soundflag = 0;
update_68k_interrupts(machine());
- logerror("%06X:Reset sound\n", cpu_get_previouspc(&space.device()));
+ logerror("%06X:Reset sound\n", space.device().safe_pcbase());
}
@@ -102,7 +102,7 @@ READ16_MEMBER(harddriv_state::hdsnd68k_data_r)
{
m_mainflag = 0;
update_68k_interrupts(machine());
- logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(&space.device()), m_maindata);
+ logerror("%06X:sound read from main=%04X\n", space.device().safe_pcbase(), m_maindata);
return m_maindata;
}
@@ -111,7 +111,7 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_data_w)
{
COMBINE_DATA(&m_sounddata);
m_soundflag = 1;
- logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:sound write to main=%04X\n", space.device().safe_pcbase(), data);
}
@@ -124,14 +124,14 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_data_w)
READ16_MEMBER(harddriv_state::hdsnd68k_switches_r)
{
- logerror("%06X:hdsnd68k_switches_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%06X:hdsnd68k_switches_r(%04X)\n", space.device().safe_pcbase(), offset);
return 0;
}
READ16_MEMBER(harddriv_state::hdsnd68k_320port_r)
{
- logerror("%06X:hdsnd68k_320port_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%06X:hdsnd68k_320port_r(%04X)\n", space.device().safe_pcbase(), offset);
return 0;
}
@@ -143,7 +143,7 @@ READ16_MEMBER(harddriv_state::hdsnd68k_status_r)
// D14 = 'Sound Flag'
// D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready)
- logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%06X:hdsnd68k_status_r(%04X)\n", space.device().safe_pcbase(), offset);
return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((ioport("IN0")->read() & 0x0020) << 8) | 0;
}
@@ -167,17 +167,17 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_latches_w)
{
case 0: /* SPWR - 5220 write strobe */
/* data == 0 means high, 1 means low */
- logerror("%06X:SPWR=%d\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:SPWR=%d\n", space.device().safe_pcbase(), data);
break;
case 1: /* SPRES - 5220 hard reset */
/* data == 0 means low, 1 means high */
- logerror("%06X:SPRES=%d\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:SPRES=%d\n", space.device().safe_pcbase(), data);
break;
case 2: /* SPRATE */
/* data == 0 means 8kHz, 1 means 10kHz */
- logerror("%06X:SPRATE=%d\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:SPRATE=%d\n", space.device().safe_pcbase(), data);
break;
case 3: /* CRAMEN */
@@ -186,7 +186,7 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_latches_w)
break;
case 4: /* RES320 */
- logerror("%06X:RES320=%d\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:RES320=%d\n", space.device().safe_pcbase(), data);
if (m_sounddsp != NULL)
device_set_input_line(m_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
break;
@@ -199,7 +199,7 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_latches_w)
WRITE16_MEMBER(harddriv_state::hdsnd68k_speech_w)
{
- logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", cpu_get_previouspc(&space.device()), offset, data);
+ logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", space.device().safe_pcbase(), offset, data);
}
@@ -249,7 +249,7 @@ READ16_MEMBER(harddriv_state::hdsnd68k_320com_r)
if (m_cramen)
return m_comram[offset & 0x1ff];
- logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", space.device().safe_pcbase(), offset);
return 0xffff;
}
@@ -260,7 +260,7 @@ WRITE16_MEMBER(harddriv_state::hdsnd68k_320com_w)
if (m_cramen)
COMBINE_DATA(&m_comram[offset & 0x1ff]);
else
- logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", cpu_get_previouspc(&space.device()), offset, data);
+ logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", space.device().safe_pcbase(), offset, data);
}
@@ -308,7 +308,7 @@ WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w )
WRITE16_MEMBER(harddriv_state::hdsnddsp_comport_w)
{
/* COM port TD0-7 */
- logerror("%06X:hdsnddsp_comport_w=%d\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:hdsnddsp_comport_w=%d\n", space.device().safe_pcbase(), data);
}
@@ -316,7 +316,7 @@ WRITE16_MEMBER(harddriv_state::hdsnddsp_mute_w)
{
/* mute DAC audio, D0=1 */
/* m_dacmute = data & 1; -- NOT STUFFED */
- logerror("%06X:mute DAC=%d\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%06X:mute DAC=%d\n", space.device().safe_pcbase(), data);
}
@@ -360,6 +360,6 @@ READ16_MEMBER(harddriv_state::hdsnddsp_comram_r)
READ16_MEMBER(harddriv_state::hdsnddsp_compare_r)
{
- logerror("%06X:hdsnddsp_compare_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%06X:hdsnddsp_compare_r(%04X)\n", space.device().safe_pcbase(), offset);
return 0;
}
diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c
index 92e48c849c5..fb7ea82ce31 100644
--- a/src/mame/audio/invinco.c
+++ b/src/mame/audio/invinco.c
@@ -108,6 +108,6 @@ WRITE8_HANDLER( invinco_audio_w )
}
#if 0
- logerror("Went LO: %02X %04X\n", bitsGoneLow, cpu_get_pc(&space->device()));
+ logerror("Went LO: %02X %04X\n", bitsGoneLow, space->device().safe_pc());
#endif
}
diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c
index 7739ae54cec..0c405cd908a 100644
--- a/src/mame/audio/jaguar.c
+++ b/src/mame/audio/jaguar.c
@@ -217,7 +217,7 @@ void jaguar_state::sound_start()
READ16_MEMBER( jaguar_state::jerry_regs_r )
{
if (offset != JINTCTRL && offset != JINTCTRL+2)
- logerror("%08X:jerry read register @ F10%03X\n", cpu_get_previouspc(&space.device()), offset * 2);
+ logerror("%08X:jerry read register @ F10%03X\n", space.device().safe_pcbase(), offset * 2);
switch (offset)
{
@@ -244,7 +244,7 @@ WRITE16_MEMBER( jaguar_state::jerry_regs_w )
}
if (offset != JINTCTRL && offset != JINTCTRL+2 && offset != ASICTRL)
- logerror("%08X:jerry write register @ F10%03X = %04X\n", cpu_get_previouspc(&space.device()), offset * 2, data);
+ logerror("%08X:jerry write register @ F10%03X = %04X\n", space.device().safe_pcbase(), offset * 2, data);
}
@@ -322,7 +322,7 @@ void jaguar_state::serial_update()
READ32_MEMBER( jaguar_state::serial_r )
{
- logerror("%08X:jaguar_serial_r(%X)\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%08X:jaguar_serial_r(%X)\n", space.device().safe_pcbase(), offset);
return 0;
}
@@ -358,7 +358,7 @@ WRITE32_MEMBER( jaguar_state::serial_w )
break;
default:
- logerror("%08X:jaguar_serial_w(%X,%X)\n", cpu_get_previouspc(&space.device()), offset, data);
+ logerror("%08X:jaguar_serial_w(%X,%X)\n", space.device().safe_pcbase(), offset, data);
break;
}
}
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index 6de4f5bf808..4486416d95a 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -1258,21 +1258,21 @@ static READ16_DEVICE_HANDLER( i80186_internal_port_r )
switch (offset)
{
case 0x22/2:
- logerror("%05X:ERROR - read from 80186 EOI\n", cpu_get_pc(state->m_i80186.cpu));
+ logerror("%05X:ERROR - read from 80186 EOI\n", state->m_i80186.cpu->safe_pc());
break;
case 0x24/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", state->m_i80186.cpu->safe_pc());
if (state->m_i80186.intr.poll_status & 0x8000)
int_callback(state->m_i80186.cpu, 0);
return state->m_i80186.intr.poll_status;
case 0x26/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.poll_status;
case 0x28/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", state->m_i80186.cpu->safe_pc());
temp = (state->m_i80186.intr.timer >> 3) & 0x01;
temp |= (state->m_i80186.intr.dma[0] >> 1) & 0x04;
temp |= (state->m_i80186.intr.dma[1] >> 0) & 0x08;
@@ -1283,56 +1283,56 @@ static READ16_DEVICE_HANDLER( i80186_internal_port_r )
return temp;
case 0x2a/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.priority_mask;
case 0x2c/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.in_service;
case 0x2e/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", state->m_i80186.cpu->safe_pc());
temp = state->m_i80186.intr.request & ~0x0001;
if (state->m_i80186.intr.status & 0x0007)
temp |= 1;
return temp;
case 0x30/2:
- if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.status;
case 0x32/2:
- if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.timer;
case 0x34/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.dma[0];
case 0x36/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.dma[1];
case 0x38/2:
- if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.ext[0];
case 0x3a/2:
- if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.ext[1];
case 0x3c/2:
- if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.ext[2];
case 0x3e/2:
- if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.intr.ext[3];
case 0x50/2:
case 0x58/2:
case 0x60/2:
- if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4);
+ if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4);
which = (offset - 0x50/2) / 4;
if (ACCESSING_BITS_0_7)
internal_timer_sync(state, which);
@@ -1341,87 +1341,87 @@ static READ16_DEVICE_HANDLER( i80186_internal_port_r )
case 0x52/2:
case 0x5a/2:
case 0x62/2:
- if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4);
+ if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4);
which = (offset - 0x50/2) / 4;
return state->m_i80186.timer[which].maxA;
case 0x54/2:
case 0x5c/2:
- logerror("%05X:read 80186 Timer %d max B\n", cpu_get_pc(state->m_i80186.cpu), (offset/2 - 0x50) / 4);
+ logerror("%05X:read 80186 Timer %d max B\n", state->m_i80186.cpu->safe_pc(), (offset/2 - 0x50) / 4);
which = (offset - 0x50/2) / 4;
return state->m_i80186.timer[which].maxB;
case 0x56/2:
case 0x5e/2:
case 0x66/2:
- if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4);
+ if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4);
which = (offset - 0x50/2) / 4;
return state->m_i80186.timer[which].control;
case 0xa0/2:
- if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.mem.upper;
case 0xa2/2:
- if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.mem.lower;
case 0xa4/2:
- if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.mem.peripheral;
case 0xa6/2:
- if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.mem.middle;
case 0xa8/2:
- if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", cpu_get_pc(state->m_i80186.cpu));
+ if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", state->m_i80186.cpu->safe_pc());
return state->m_i80186.mem.middle_size;
case 0xc0/2:
case 0xd0/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8);
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
return state->m_i80186.dma[which].source;
case 0xc2/2:
case 0xd2/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8);
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
return state->m_i80186.dma[which].source >> 16;
case 0xc4/2:
case 0xd4/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8);
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
return state->m_i80186.dma[which].dest;
case 0xc6/2:
case 0xd6/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8);
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
return state->m_i80186.dma[which].dest >> 16;
case 0xc8/2:
case 0xd8/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8);
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
return state->m_i80186.dma[which].count;
case 0xca/2:
case 0xda/2:
- if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8);
+ if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
return state->m_i80186.dma[which].control;
default:
- logerror("%05X:read 80186 port %02X\n", cpu_get_pc(state->m_i80186.cpu), offset*2);
+ logerror("%05X:read 80186 port %02X\n", state->m_i80186.cpu->safe_pc(), offset*2);
break;
}
return 0x00;
@@ -1449,21 +1449,21 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
switch (offset)
{
case 0x22/2:
- if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
handle_eoi(device, 0x8000);
update_interrupt_state(device);
break;
case 0x24/2:
- logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
break;
case 0x26/2:
- logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
break;
case 0x28/2:
- if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.timer = (state->m_i80186.intr.timer & ~0x08) | ((data << 3) & 0x08);
state->m_i80186.intr.dma[0] = (state->m_i80186.intr.dma[0] & ~0x08) | ((data << 1) & 0x08);
state->m_i80186.intr.dma[1] = (state->m_i80186.intr.dma[1] & ~0x08) | ((data << 0) & 0x08);
@@ -1475,69 +1475,69 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
break;
case 0x2a/2:
- if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.priority_mask = data & 0x0007;
update_interrupt_state(device);
break;
case 0x2c/2:
- if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.in_service = data & 0x00ff;
update_interrupt_state(device);
break;
case 0x2e/2:
- if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.request = (state->m_i80186.intr.request & ~0x00c0) | (data & 0x00c0);
update_interrupt_state(device);
break;
case 0x30/2:
- if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.status = (state->m_i80186.intr.status & ~0x8000) | (data & 0x8000);
state->m_i80186.intr.status = (state->m_i80186.intr.status & ~0x0007) | (data & 0x0007);
update_interrupt_state(device);
break;
case 0x32/2:
- if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.timer = data & 0x000f;
break;
case 0x34/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.dma[0] = data & 0x000f;
break;
case 0x36/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.dma[1] = data & 0x000f;
break;
case 0x38/2:
- if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.ext[0] = data & 0x007f;
break;
case 0x3a/2:
- if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.ext[1] = data & 0x007f;
break;
case 0x3c/2:
- if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.ext[2] = data & 0x001f;
break;
case 0x3e/2:
- if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.intr.ext[3] = data & 0x001f;
break;
case 0x50/2:
case 0x58/2:
case 0x60/2:
- if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4, data, mem_mask);
which = (offset - 0x50/2) / 4;
internal_timer_update(state, which, data, -1, -1, -1);
break;
@@ -1545,14 +1545,14 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0x52/2:
case 0x5a/2:
case 0x62/2:
- if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4, data, mem_mask);
which = (offset - 0x50/2) / 4;
internal_timer_update(state, which, -1, data, -1, -1);
break;
case 0x54/2:
case 0x5c/2:
- if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4, data, mem_mask);
which = (offset - 0x50/2) / 4;
internal_timer_update(state, which, -1, -1, data, -1);
break;
@@ -1560,33 +1560,33 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0x56/2:
case 0x5e/2:
case 0x66/2:
- if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0x50/2) / 4, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0x50/2) / 4, data, mem_mask);
which = (offset - 0x50/2) / 4;
internal_timer_update(state, which, -1, -1, -1, data);
break;
case 0xa0/2:
- if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.mem.upper = data | 0xc038;
break;
case 0xa2/2:
- if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.mem.lower = (data & 0x3fff) | 0x0038;
break;
case 0xa4/2:
- if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.mem.peripheral = data | 0x0038;
break;
case 0xa6/2:
- if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.mem.middle = data | 0x01f8;
break;
case 0xa8/2:
- if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
state->m_i80186.mem.middle_size = data | 0x8038;
temp = (state->m_i80186.mem.peripheral & 0xffc0) << 4;
@@ -1608,7 +1608,7 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0xc0/2:
case 0xd0/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
state->m_i80186.dma[which].source = (state->m_i80186.dma[which].source & ~0x0ffff) | (data & 0x0ffff);
@@ -1616,7 +1616,7 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0xc2/2:
case 0xd2/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
state->m_i80186.dma[which].source = (state->m_i80186.dma[which].source & ~0xf0000) | ((data << 16) & 0xf0000);
@@ -1624,7 +1624,7 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0xc4/2:
case 0xd4/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
state->m_i80186.dma[which].dest = (state->m_i80186.dma[which].dest & ~0x0ffff) | (data & 0x0ffff);
@@ -1632,7 +1632,7 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0xc6/2:
case 0xd6/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
state->m_i80186.dma[which].dest = (state->m_i80186.dma[which].dest & ~0xf0000) | ((data << 16) & 0xf0000);
@@ -1640,7 +1640,7 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0xc8/2:
case 0xd8/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
state->m_i80186.dma[which].count = data;
@@ -1648,14 +1648,14 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
case 0xca/2:
case 0xda/2:
- if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), (offset - 0xc0/2) / 8, data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), (offset - 0xc0/2) / 8, data, mem_mask);
which = (offset - 0xc0/2) / 8;
state->m_dma_stream->update();
update_dma_control(state, which, data);
break;
case 0xfe/2:
- if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), data, mem_mask);
+ if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), data, mem_mask);
/* we assume here there that this doesn't happen too often */
/* plus, we can't really remove the old memory range, so we also assume that it's */
@@ -1674,7 +1674,7 @@ static WRITE16_DEVICE_HANDLER( i80186_internal_port_w )
break;
default:
- logerror("%05X:80186 port %02X = %04X & %04X\n", cpu_get_pc(state->m_i80186.cpu), offset*2, data, mem_mask);
+ logerror("%05X:80186 port %02X = %04X & %04X\n", state->m_i80186.cpu->safe_pc(), offset*2, data, mem_mask);
break;
}
}
@@ -1830,7 +1830,7 @@ WRITE8_DEVICE_HANDLER( leland_80186_control_w )
if (LOG_COMM)
{
- logerror("%04X:80186 control = %02X", cpu_get_previouspc(state->m_i80186.cpu), data);
+ logerror("%04X:80186 control = %02X", state->m_i80186.cpu->safe_pcbase(), data);
if (!(data & 0x80)) logerror(" /RESET");
if (!(data & 0x40)) logerror(" ZNMI");
if (!(data & 0x20)) logerror(" INT0");
@@ -1902,7 +1902,7 @@ WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w )
WRITE8_DEVICE_HANDLER( leland_80186_command_hi_w )
{
leland_sound_state *state = get_safe_token(device);
- if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", cpu_get_previouspc(state->m_i80186.cpu), data);
+ if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", state->m_i80186.cpu->safe_pcbase(), data);
state->m_sound_command = (state->m_sound_command & 0x00ff) | (data << 8);
}
@@ -1910,7 +1910,7 @@ WRITE8_DEVICE_HANDLER( leland_80186_command_hi_w )
static READ16_DEVICE_HANDLER( main_to_sound_comm_r )
{
leland_sound_state *state = get_safe_token(device);
- if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", cpu_get_pc(state->m_i80186.cpu), state->m_sound_command);
+ if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", state->m_i80186.cpu->safe_pc(), state->m_sound_command);
return state->m_sound_command;
}
@@ -1953,7 +1953,7 @@ static TIMER_CALLBACK( delayed_response_r )
READ8_DEVICE_HANDLER( leland_80186_response_r )
{
leland_sound_state *state = get_safe_token(device);
- offs_t pc = cpu_get_previouspc(state->m_i80186.cpu);
+ offs_t pc = state->m_i80186.cpu->safe_pcbase();
if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, state->m_sound_response);
@@ -1966,7 +1966,7 @@ READ8_DEVICE_HANDLER( leland_80186_response_r )
static WRITE16_DEVICE_HANDLER( sound_to_main_comm_w )
{
leland_sound_state *state = get_safe_token(device);
- if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", cpu_get_pc(state->m_i80186.cpu), data);
+ if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", state->m_i80186.cpu->safe_pc(), data);
state->m_sound_response = data;
}
@@ -2015,7 +2015,7 @@ static WRITE16_DEVICE_HANDLER( dac_w )
/* set the new value */
d->value = (INT16)(UINT8)data - 0x80;
- if (LOG_DAC) logerror("%05X:DAC %d value = %02X\n", cpu_get_pc(state->m_i80186.cpu), offset, (UINT8)data);
+ if (LOG_DAC) logerror("%05X:DAC %d value = %02X\n", state->m_i80186.cpu->safe_pc(), offset, (UINT8)data);
/* if we haven't overflowed the buffer, add the value value to it */
if (count < DAC_BUFFER_SIZE - 1)
@@ -2038,7 +2038,7 @@ static WRITE16_DEVICE_HANDLER( dac_w )
if (ACCESSING_BITS_8_15)
{
d->volume = ((data >> 8) ^ 0x00) / DAC_VOLUME_SCALE;
- if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", cpu_get_pc(state->m_i80186.cpu), offset, data);
+ if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", state->m_i80186.cpu->safe_pc(), offset, data);
}
}
@@ -2071,7 +2071,7 @@ static WRITE16_DEVICE_HANDLER( redline_dac_w )
/* update the volume */
d->volume = (offset & 0xff) / DAC_VOLUME_SCALE;
- if (LOG_DAC) logerror("%05X:DAC %d value = %02X, volume = %02X\n", cpu_get_pc(state->m_i80186.cpu), which, data, (offset & 0x1fe) / 2);
+ if (LOG_DAC) logerror("%05X:DAC %d value = %02X, volume = %02X\n", state->m_i80186.cpu->safe_pc(), which, data, (offset & 0x1fe) / 2);
}
@@ -2088,7 +2088,7 @@ static WRITE16_DEVICE_HANDLER( dac_10bit_w )
/* set the new value */
d->value = (INT16)data16 - 0x200;
- if (LOG_DAC) logerror("%05X:DAC 10-bit value = %02X\n", cpu_get_pc(state->m_i80186.cpu), data16);
+ if (LOG_DAC) logerror("%05X:DAC 10-bit value = %02X\n", state->m_i80186.cpu->safe_pc(), data16);
/* if we haven't overflowed the buffer, add the value value to it */
if (count < DAC_BUFFER_SIZE - 1)
@@ -2164,7 +2164,7 @@ static WRITE16_DEVICE_HANDLER( ataxx_dac_control )
return;
}
}
- logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", cpu_get_pc(state->m_i80186.cpu), 5, offset, data);
+ logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", state->m_i80186.cpu->safe_pc(), 5, offset, data);
}
@@ -2211,11 +2211,11 @@ static READ16_DEVICE_HANDLER( peripheral_r )
if (state->m_is_redline)
return pit8254_r(device, offset | 0x80, mem_mask);
else
- logerror("%05X:Unexpected peripheral read %d/%02X\n", cpu_get_pc(state->m_i80186.cpu), select, offset*2);
+ logerror("%05X:Unexpected peripheral read %d/%02X\n", state->m_i80186.cpu->safe_pc(), select, offset*2);
break;
default:
- logerror("%05X:Unexpected peripheral read %d/%02X\n", cpu_get_pc(state->m_i80186.cpu), select, offset*2);
+ logerror("%05X:Unexpected peripheral read %d/%02X\n", state->m_i80186.cpu->safe_pc(), select, offset*2);
break;
}
return 0xffff;
@@ -2257,7 +2257,7 @@ static WRITE16_DEVICE_HANDLER( peripheral_w )
break;
default:
- logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", cpu_get_pc(state->m_i80186.cpu), select, offset, data);
+ logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", state->m_i80186.cpu->safe_pc(), select, offset, data);
break;
}
}
diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c
index 71cd369d69f..bc59822faff 100644
--- a/src/mame/audio/mw8080bw.c
+++ b/src/mame/audio/mw8080bw.c
@@ -259,7 +259,7 @@ WRITE8_MEMBER(mw8080bw_state::gunfight_audio_w)
break;
default:
- logerror("%04x: Unknown sh port write %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: Unknown sh port write %02x\n", space.device().safe_pc(), data);
break;
}
}
diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c
index 598160fcf7b..80a2624b7b9 100644
--- a/src/mame/audio/segasnd.c
+++ b/src/mame/audio/segasnd.c
@@ -465,7 +465,7 @@ READ8_DEVICE_HANDLER( sega_usb_status_r )
{
usb_state *usb = get_safe_token(device);
- LOG(("%04X:usb_data_r = %02X\n", cpu_get_pc(usb->maincpu), (usb->out_latch & 0x81) | (usb->in_latch & 0x7e)));
+ LOG(("%04X:usb_data_r = %02X\n", usb->maincpu->safe_pc(), (usb->out_latch & 0x81) | (usb->in_latch & 0x7e)));
device_adjust_icount(usb->maincpu, -200);
@@ -496,7 +496,7 @@ WRITE8_DEVICE_HANDLER( sega_usb_data_w )
{
usb_state *usb = get_safe_token(device);
- LOG(("%04X:usb_data_w = %02X\n", cpu_get_pc(usb->maincpu), data));
+ LOG(("%04X:usb_data_w = %02X\n", usb->maincpu->safe_pc(), data));
device->machine().scheduler().synchronize(FUNC(delayed_usb_data_w), data, usb);
/* boost the interleave so that sequences can be sent */
@@ -519,7 +519,7 @@ WRITE8_DEVICE_HANDLER( sega_usb_ram_w )
if (usb->in_latch & 0x80)
usb->program_ram[offset] = data;
else
- LOG(("%04X:sega_usb_ram_w(%03X) = %02X while /LOAD disabled\n", cpu_get_pc(usb->maincpu), offset, data));
+ LOG(("%04X:sega_usb_ram_w(%03X) = %02X while /LOAD disabled\n", usb->maincpu->safe_pc(), offset, data));
}
@@ -536,7 +536,7 @@ static READ8_DEVICE_HANDLER( usb_p1_r )
/* bits 0-6 are inputs and map to bits 0-6 of the input latch */
if ((usb->in_latch & 0x7f) != 0)
- LOG(("%03X: P1 read = %02X\n", cpu_get_pc(usb->maincpu), usb->in_latch & 0x7f));
+ LOG(("%03X: P1 read = %02X\n", usb->maincpu->safe_pc(), usb->in_latch & 0x7f));
return usb->in_latch & 0x7f;
}
@@ -547,7 +547,7 @@ static WRITE8_DEVICE_HANDLER( usb_p1_w )
/* bit 7 maps to bit 0 on the output latch */
usb->out_latch = (usb->out_latch & 0xfe) | (data >> 7);
- LOG(("%03X: P1 write = %02X\n", cpu_get_pc(usb->maincpu), data));
+ LOG(("%03X: P1 write = %02X\n", usb->maincpu->safe_pc(), data));
}
@@ -570,7 +570,7 @@ static WRITE8_DEVICE_HANDLER( usb_p2_w )
if ((old & 0x80) && !(data & 0x80))
usb->t1_clock = 0;
- LOG(("%03X: P2 write -> bank=%d ready=%d clock=%d\n", cpu_get_pc(usb->maincpu), data & 3, (data >> 6) & 1, (data >> 7) & 1));
+ LOG(("%03X: P2 write -> bank=%d ready=%d clock=%d\n", usb->maincpu->safe_pc(), data & 3, (data >> 6) & 1, (data >> 7) & 1));
}
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index e2b2ff21d9a..7c0c9d06712 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -383,7 +383,7 @@ static WRITE8_HANDLER( seibu_pending_w )
READ16_HANDLER( seibu_main_word_r )
{
- //logerror("%06x: seibu_main_word_r(%x)\n",cpu_get_pc(&space->device()),offset);
+ //logerror("%06x: seibu_main_word_r(%x)\n",space->device().safe_pc(),offset);
switch (offset)
{
case 2:
@@ -392,14 +392,14 @@ READ16_HANDLER( seibu_main_word_r )
case 5:
return main2sub_pending ? 1 : 0;
default:
- //logerror("%06x: seibu_main_word_r(%x)\n",cpu_get_pc(&space->device()),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",cpu_get_pc(&space->device()),offset,data);
+ //printf("%06x: seibu_main_word_w(%x,%02x)\n",space->device().safe_pc(),offset,data);
if (ACCESSING_BITS_0_7)
{
switch (offset)
@@ -418,7 +418,7 @@ WRITE16_HANDLER( seibu_main_word_w )
main2sub_pending = 1;
break;
default:
- //logerror("%06x: seibu_main_word_w(%x,%02x)\n",cpu_get_pc(&space->device()),offset,data);
+ //logerror("%06x: seibu_main_word_w(%x,%02x)\n",space->device().safe_pc(),offset,data);
break;
}
}
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index 81a51134281..1e66084dcc7 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -1124,7 +1124,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, cpu_get_pc(&space->device()));
+ // 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:
@@ -1193,7 +1193,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, cpu_get_pc(&space->device()));
+ // 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/taito_en.c b/src/mame/audio/taito_en.c
index c85b2d2d6eb..85cf9e64561 100644
--- a/src/mame/audio/taito_en.c
+++ b/src/mame/audio/taito_en.c
@@ -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",cpu_get_pc(&space->device()),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) {
@@ -128,7 +128,7 @@ static WRITE16_HANDLER( es5510_dsp_w )
UINT8 *snd_mem = (UINT8 *)space->machine().root_device().memregion("ensoniq.0")->base();
// if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0)
-// logerror("%06x: DSP write offset %04x %04x\n",cpu_get_pc(&space->device()),offset,data);
+// 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 6bbcf5c3ae5..abdc517ef77 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -110,7 +110,7 @@ WRITE8_DEVICE_HANDLER( tc0140syt_comm_w )
break;
case 0x04: // port status
- //logerror("taitosnd: Master issued control value %02x (PC = %08x) \n",data, cpu_get_pc(&space->device()) );
+ //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)
device_set_input_line(tc0140syt->slavecpu, INPUT_LINE_RESET, ASSERT_LINE);
@@ -241,7 +241,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],cpu_get_pc(&space->device()));
+ //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/drivers/1943.c b/src/mame/drivers/1943.c
index 8ba066db431..5cb603c12b1 100644
--- a/src/mame/drivers/1943.c
+++ b/src/mame/drivers/1943.c
@@ -44,7 +44,7 @@ READ8_MEMBER(_1943_state::c1943_protection_r)
*/
int data = cpu_get_reg(&space.device(), Z80_BC) >> 8;
-// logerror("protection read, PC: %04x Result:%02x\n", cpu_get_pc(&space.device()), data);
+// logerror("protection read, PC: %04x Result:%02x\n", space.device().safe_pc(), data);
return data;
}
diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c
index c310a03323b..f8432bbb161 100644
--- a/src/mame/drivers/2mindril.c
+++ b/src/mame/drivers/2mindril.c
@@ -69,7 +69,7 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
// if (offset * 2 == 0x4)
- /*popmessage("PC=%08x %04x %04x %04x %04x %04x %04x %04x %04x", cpu_get_pc(&space.device()), m_iodata[0/2], m_iodata[2/2], m_iodata[4/2], m_iodata[6/2],
+ /*popmessage("PC=%08x %04x %04x %04x %04x %04x %04x %04x %04x", space.device().safe_pc(), m_iodata[0/2], m_iodata[2/2], m_iodata[4/2], m_iodata[6/2],
m_iodata[8/2], m_iodata[0xa/2], m_iodata[0xc/2], m_iodata[0xe/2]);*/
switch(offset)
@@ -78,7 +78,7 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
case 0x2/2:
{
int arm_pwr = ioport("IN0")->read();//throw
- //popmessage("PC=%08x %02x",cpu_get_pc(&space.device()),arm_pwr);
+ //popmessage("PC=%08x %02x",space.device().safe_pc(),arm_pwr);
if(arm_pwr > 0xe0) return ~0x1800;
if(arm_pwr > 0xc0) return ~0x1400;
@@ -88,7 +88,7 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
}
case 0x4/2: return (m_defender_sensor) | (m_shutter_sensor);
case 0xe/2: return ioport("IN2")->read();//coins
-// default: printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(&space.device()), offset * 2, m_iodata[offset]);
+// default: printf("PC=%08x [%04x] -> %04x R\n", space.device().safe_pc(), offset * 2, m_iodata[offset]);
}
return 0xffff;
@@ -110,7 +110,7 @@ WRITE16_MEMBER(_2mindril_state::drill_io_w)
}
// if(data != 0 && offset != 8)
-// printf("PC=%08x [%04x] <- %04x W\n", cpu_get_pc(&space.device()), offset * 2, data);
+// printf("PC=%08x [%04x] <- %04x W\n", space.device().safe_pc(), offset * 2, data);
}
/*
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index 17d698de7a7..901f2cf6cc0 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -1370,13 +1370,13 @@ READ32_MEMBER(_39in1_state::unknown_r)
READ32_MEMBER(_39in1_state::cpld_r)
{
- //if (cpu_get_pc(&space.device()) != 0xe3af4) printf("CPLD read @ %x (PC %x state %d)\n", offset, cpu_get_pc(&space.device()), state);
+ //if (space.device().safe_pc() != 0xe3af4) printf("CPLD read @ %x (PC %x state %d)\n", offset, space.device().safe_pc(), state);
- if (cpu_get_pc(&space.device()) == 0x3f04)
+ if (space.device().safe_pc() == 0x3f04)
{
return 0xf0; // any non-zero value works here
}
- else if (cpu_get_pc(&space.device()) == 0xe3af4)
+ else if (space.device().safe_pc() == 0xe3af4)
{
return ioport("MCUIPT")->read();
}
@@ -1431,11 +1431,11 @@ WRITE32_MEMBER(_39in1_state::cpld_w)
m_seed = data<<16;
}
- if (cpu_get_pc(&space.device()) == 0x280c)
+ if (space.device().safe_pc() == 0x280c)
{
m_state = 1;
}
- if (cpu_get_pc(&space.device()) == 0x2874)
+ if (space.device().safe_pc() == 0x2874)
{
m_state = 2;
m_magic = space.read_byte(0xa02d4ff0);
@@ -1446,7 +1446,7 @@ WRITE32_MEMBER(_39in1_state::cpld_w)
#if 0
else
{
- printf("%08x: CPLD_W: %08x = %08x & %08x\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ printf("%08x: CPLD_W: %08x = %08x & %08x\n", space.device().safe_pc(), offset, data, mem_mask);
}
#endif
}
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 5e904e2ce24..52f4a811fa2 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -1731,12 +1731,12 @@ INPUT_PORTS_END
READ8_MEMBER(_8080bw_state::indianbt_r)
{
- switch(cpu_get_pc(&space.device()))
+ switch(space.device().safe_pc())
{
case 0x5fed: return 0x10;
case 0x5ffc: return 0;
}
- logerror("unknown port 0 read @ %x\n",cpu_get_pc(&space.device()));
+ logerror("unknown port 0 read @ %x\n",space.device().safe_pc());
return machine().rand();
}
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index 41f096389fe..f930f8f966f 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -269,7 +269,7 @@ static KONAMI_SETLINES_CALLBACK( k88games_banking )
UINT8 *RAM = state->memregion("maincpu")->base();
int offs;
- logerror("%04x: bank select %02x\n", cpu_get_pc(device), lines);
+ logerror("%04x: bank select %02x\n", device->safe_pc(), lines);
/* bits 0-2 select ROM bank for 0000-1fff */
/* bit 3: when 1, palette RAM at 1000-1fff */
diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c
index 595577ab3f6..5b74eff646e 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -305,7 +305,7 @@ WRITE16_MEMBER(acommand_state::ac_txscroll_w)
READ16_MEMBER(acommand_state::ac_devices_r)
{
- logerror("(PC=%06x) read at %04x\n",cpu_get_pc(&space.device()),offset*2);
+ logerror("(PC=%06x) read at %04x\n",space.device().safe_pc(),offset*2);
switch(offset)
{
diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c
index 8d49fce9699..e88f35fdab3 100644
--- a/src/mame/drivers/aeroboto.c
+++ b/src/mame/drivers/aeroboto.c
@@ -34,7 +34,7 @@ READ8_MEMBER(aeroboto_state::aeroboto_201_r)
/* serie of values to be returned from 3004, and display "PASS 201" if it is */
static const UINT8 res[4] = { 0xff, 0x9f, 0x1b, 0x03 };
- logerror("PC %04x: read 3004\n", cpu_get_pc(&space.device()));
+ logerror("PC %04x: read 3004\n", space.device().safe_pc());
return res[(m_count++) & 3];
}
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index 44620334c2c..20ed3544c06 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -134,13 +134,13 @@ WRITE8_MEMBER(albazg_state::yumefuda_cram_w)
/*Custom RAM (Thrash Protection)*/
READ8_MEMBER(albazg_state::custom_ram_r)
{
-// logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, cpu_get_pc(&space.device()));
+// logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, space.device().safe_pc());
return m_cus_ram[offset];// ^ 0x55;
}
WRITE8_MEMBER(albazg_state::custom_ram_w)
{
-// logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, cpu_get_pc(&space.device()));
+// logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, space.device().safe_pc());
if(m_prot_lock)
m_cus_ram[offset] = data;
}
@@ -148,7 +148,7 @@ WRITE8_MEMBER(albazg_state::custom_ram_w)
/*this might be used as NVRAM commands btw*/
WRITE8_MEMBER(albazg_state::prot_lock_w)
{
-// logerror("PC %04x Prot lock value written %02x\n", cpu_get_pc(&space.device()), data);
+// logerror("PC %04x Prot lock value written %02x\n", space.device().safe_pc(), data);
m_prot_lock = data;
}
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 74bd4874038..fdb9ac1e48e 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, cpu_get_pc(&space->device()));
+ 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());
}
}
@@ -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, cpu_get_pc(&space->device()));
+ 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/alpha68k.c b/src/mame/drivers/alpha68k.c
index f486ce6f025..ae8a2a05341 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -216,14 +216,14 @@ WRITE16_MEMBER(alpha68k_state::tnextspc_coin_counters_w)
WRITE16_MEMBER(alpha68k_state::tnextspc_unknown_w)
{
- logerror("tnextspc_unknown_w : PC = %04x - offset = %04x - data = %04x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("tnextspc_unknown_w : PC = %04x - offset = %04x - data = %04x\n", space.device().safe_pc(), offset, data);
if (offset == 0)
alpha68k_flipscreen_w(machine(), data & 0x100);
}
WRITE16_MEMBER(alpha68k_state::alpha_microcontroller_w)
{
- logerror("%04x: Alpha write trigger at %04x (%04x)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%04x: Alpha write trigger at %04x (%04x)\n", space.device().safe_pc(), offset, data);
/* 0x44 = coin clear signal to microcontroller? */
if (offset == 0x2d && ACCESSING_BITS_0_7)
alpha68k_flipscreen_w(machine(), data & 1);
@@ -404,7 +404,7 @@ READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r)
break;
}
- logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Alpha read trigger at %04x\n", space.device().safe_pc(), offset);
return 0; /* Values returned don't matter */
}
@@ -498,7 +498,7 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
break;
}
- logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Alpha read trigger at %04x\n", space.device().safe_pc(), offset);
return 0; /* Values returned don't matter */
}
@@ -643,7 +643,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
break;
}
- logerror("%04x: Alpha read trigger at %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Alpha read trigger at %04x\n", space.device().safe_pc(), offset);
return 0; /* Values returned don't matter */
}
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index bab7c06643f..e2a2f2d22e8 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -124,7 +124,7 @@ WRITE16_MEMBER(artmagic_state::control_w)
oki->set_bank_base((((data >> 4) & 1) * 0x40000) % oki->region()->bytes());
}
- logerror("%06X:control_w(%d) = %04X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:control_w(%d) = %04X\n", space.device().safe_pc(), offset, data);
}
@@ -145,7 +145,7 @@ static TIMER_CALLBACK( irq_off )
READ16_MEMBER(artmagic_state::ultennis_hack_r)
{
/* IRQ5 points to: jsr (a5); rte */
- UINT32 pc = cpu_get_pc(&space.device());
+ UINT32 pc = space.device().safe_pc();
if (pc == 0x18c2 || pc == 0x18e4)
{
m_hack_irq = 1;
diff --git a/src/mame/drivers/astrafr.c b/src/mame/drivers/astrafr.c
index 2ffcf92456f..6fe2205c0a5 100644
--- a/src/mame/drivers/astrafr.c
+++ b/src/mame/drivers/astrafr.c
@@ -53,7 +53,7 @@ public:
DECLARE_READ8_MEMBER( astra_fgpa_r )
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (offset==fgpa_first_read_addr)
{
@@ -68,7 +68,7 @@ public:
DECLARE_WRITE8_MEMBER( astra_fgpa_w )
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (offset==fgpa_rom_write_addr)
{
@@ -84,7 +84,7 @@ public:
/* 2nd copy for the 2nd board (assume same addresses for now */
DECLARE_READ8_MEMBER( astra_fgpa_slave_r )
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (offset==fgpa_first_read_addr)
{
@@ -99,7 +99,7 @@ public:
DECLARE_WRITE8_MEMBER( astra_fgpa_slave_w )
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (offset==fgpa_rom_write_addr)
{
@@ -126,7 +126,7 @@ public:
READ32_MEMBER(astrafr_state::astrafr_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
@@ -153,7 +153,7 @@ READ32_MEMBER(astrafr_state::astrafr_mem_r)
WRITE32_MEMBER(astrafr_state::astrafr_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int address = offset * 4;
int cs = m68340_get_cs(m_maincpu, address);
@@ -183,7 +183,7 @@ WRITE32_MEMBER(astrafr_state::astrafr_mem_w)
READ32_MEMBER(astrafr_state::astrafr_slave_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_slavecpu, offset * 4);
switch ( cs )
@@ -208,7 +208,7 @@ READ32_MEMBER(astrafr_state::astrafr_slave_mem_r)
WRITE32_MEMBER(astrafr_state::astrafr_slave_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int address = offset * 4;
int cs = m68340_get_cs(m_slavecpu, address);
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index dcd77699581..1c4b7965218 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", cpu_get_pc(&space->device()), 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", cpu_get_pc(&space->device()), data);
+// logerror("CPU #0 PC %06X: OKI bank %08X\n", space->device().safe_pc(), data);
}
}
@@ -274,7 +274,7 @@ WRITE16_MEMBER(astrocorp_state::astrocorp_screen_enable_w)
COMBINE_DATA(&m_screen_enable);
// popmessage("%04X",data);
if (m_screen_enable & (~1))
- logerror("CPU #0 PC %06X: screen enable = %04X\n", cpu_get_pc(&space.device()), m_screen_enable);
+ logerror("CPU #0 PC %06X: screen enable = %04X\n", space.device().safe_pc(), m_screen_enable);
}
READ16_MEMBER(astrocorp_state::astrocorp_unk_r)
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index e23660ff877..2ab86f5b2ae 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -283,7 +283,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", cpu_get_previouspc(&space->device()), 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);
@@ -299,7 +299,7 @@ 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)
{
atarigt_state *state = space->machine().driver_data<atarigt_state>();
- if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", cpu_get_previouspc(&space->device()), offset);
+ if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", space->device().safe_pcbase(), offset);
/* track accesses */
tmek_update_mode(state, offset);
@@ -368,7 +368,7 @@ static void primrage_protection_w(address_space *space, offs_t offset, UINT16 da
atarigt_state *state = space->machine().driver_data<atarigt_state>();
if (LOG_PROTECTION)
{
- UINT32 pc = cpu_get_previouspc(&space->device());
+ UINT32 pc = space->device().safe_pcbase();
switch (pc)
{
/* protection code from 20f90 - 21000 */
@@ -401,7 +401,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", cpu_get_previouspc(&space->device()), offset, data);
+ logerror("%06X:Unknown protection W@%06X = %04X\n", space->device().safe_pcbase(), offset, data);
break;
}
}
@@ -442,7 +442,7 @@ static void primrage_protection_r(address_space *space, offs_t offset, UINT16 *d
if (LOG_PROTECTION)
{
- UINT32 pc = cpu_get_previouspc(&space->device());
+ UINT32 pc = space->device().safe_pcbase();
UINT32 p1, p2, a6;
switch (pc)
{
@@ -505,7 +505,7 @@ if (LOG_PROTECTION)
/* catch anything else */
default:
- logerror("%06X:Unknown protection R@%06X\n", cpu_get_previouspc(&space->device()), offset);
+ logerror("%06X:Unknown protection R@%06X\n", space->device().safe_pcbase(), offset);
break;
}
}
@@ -1244,19 +1244,19 @@ ROM_END
WRITE32_MEMBER(atarigt_state::tmek_pf_w)
{
- offs_t pc = cpu_get_pc(&space.device());
+ offs_t pc = space.device().safe_pc();
/* protected version */
if (pc == 0x2EB3C || pc == 0x2EB48)
{
- logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(&space.device()), 0xd72000 + offset*4, data, mem_mask, (UINT32)cpu_get_reg(&space.device(), M68K_A4) - 2);
+ logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)cpu_get_reg(&space.device(), M68K_A4) - 2);
/* skip these writes to make more stuff visible */
return;
}
/* unprotected version */
if (pc == 0x25834 || pc == 0x25860)
- logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(&space.device()), 0xd72000 + offset*4, data, mem_mask, (UINT32)cpu_get_reg(&space.device(), M68K_A3) - 2);
+ logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)cpu_get_reg(&space.device(), M68K_A3) - 2);
atarigen_playfield32_w(&space, offset, data, mem_mask);
}
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index 5beecbda9d3..6f9c57942da 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -146,7 +146,7 @@ WRITE32_MEMBER(atarigx2_state::mo_command_w)
WRITE32_MEMBER(atarigx2_state::atarigx2_protection_w)
{
{
- int pc = cpu_get_previouspc(&space.device());
+ int pc = space.device().safe_pcbase();
// if (pc == 0x11cbe || pc == 0x11c30)
// logerror("%06X:Protection W@%04X = %04X (result to %06X)\n", pc, offset, data, cpu_get_reg(&space.device(), M68K_A2));
// else
@@ -1126,14 +1126,14 @@ READ32_MEMBER(atarigx2_state::atarigx2_protection_r)
result = machine().rand() << 16;
else
result = 0xffff << 16;
- logerror("%06X:Unhandled protection R@%04X = %04X\n", cpu_get_previouspc(&space.device()), offset, result);
+ logerror("%06X:Unhandled protection R@%04X = %04X\n", space.device().safe_pcbase(), offset, result);
}
}
if (ACCESSING_BITS_16_31)
- logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(&space.device()), offset * 4, result >> 16);
+ logerror("%06X:Protection R@%04X = %04X\n", space.device().safe_pcbase(), offset * 4, result >> 16);
else
- logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(&space.device()), offset * 4 + 2, result);
+ logerror("%06X:Protection R@%04X = %04X\n", space.device().safe_pcbase(), offset * 4 + 2, result);
return result;
}
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 1232587ee6f..8ee18b28898 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -189,7 +189,7 @@ READ32_MEMBER(backfire_state::backfire_eeprom_r)
READ32_MEMBER(backfire_state::backfire_control2_r)
{
-// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
+// logerror("%08x:Read eprom %08x (%08x)\n", space.device().safe_pc(), offset << 1, mem_mask);
return (m_eeprom->read_bit() << 24) | ioport("IN1")->read() | (ioport("IN1")->read() << 16);
}
@@ -197,7 +197,7 @@ READ32_MEMBER(backfire_state::backfire_control2_r)
READ32_MEMBER(backfire_state::backfire_control3_r)
{
-// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
+// logerror("%08x:Read eprom %08x (%08x)\n", space.device().safe_pc(), offset << 1, mem_mask);
return (m_eeprom->read_bit() << 24) | ioport("IN2")->read() | (ioport("IN2")->read() << 16);
}
#endif
@@ -699,10 +699,10 @@ static void descramble_sound( running_machine &machine )
READ32_MEMBER(backfire_state::backfire_speedup_r)
{
- //mame_printf_debug( "%08x\n",cpu_get_pc(&space.device()));
+ //mame_printf_debug( "%08x\n",space.device().safe_pc());
- if (cpu_get_pc(&space.device() )== 0xce44) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfire
- if (cpu_get_pc(&space.device()) == 0xcee4) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfirea
+ if (space.device() .safe_pc()== 0xce44) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfire
+ if (space.device().safe_pc() == 0xcee4) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfirea
return m_mainram[0x18/4];
}
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index 3bb8529741b..2a1cbca70f9 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -279,7 +279,7 @@ READ16_MEMBER(bbusters_state::control_3_r)
WRITE16_MEMBER(bbusters_state::gun_select_w)
{
- logerror("%08x: gun r\n",cpu_get_pc(&space.device()));
+ logerror("%08x: gun r\n",space.device().safe_pc());
device_set_input_line(&space.device(), 2, HOLD_LINE);
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 968dab0b658..1fcefe3c502 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -498,7 +498,7 @@ ROM_END
READ32_MEMBER( beathead_state::speedup_r )
{
int result = *m_speedup_data;
- if ((cpu_get_previouspc(&space.device()) & 0xfffff) == 0x006f0 && result == cpu_get_reg(&space.device(), ASAP_R3))
+ if ((space.device().safe_pcbase() & 0xfffff) == 0x006f0 && result == cpu_get_reg(&space.device(), ASAP_R3))
device_spin_until_interrupt(&space.device());
return result;
}
@@ -507,7 +507,7 @@ READ32_MEMBER( beathead_state::speedup_r )
READ32_MEMBER( beathead_state::movie_speedup_r )
{
int result = *m_movie_speedup_data;
- if ((cpu_get_previouspc(&space.device()) & 0xfffff) == 0x00a88 && (cpu_get_reg(&space.device(), ASAP_R28) & 0xfffff) == 0x397c0 &&
+ if ((space.device().safe_pcbase() & 0xfffff) == 0x00a88 && (cpu_get_reg(&space.device(), ASAP_R28) & 0xfffff) == 0x397c0 &&
m_movie_speedup_data[4] == cpu_get_reg(&space.device(), ASAP_R1))
{
UINT32 temp = (INT16)result + m_movie_speedup_data[4] * 262;
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index a1bf41219f0..f5526654017 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -779,7 +779,7 @@ READ8_MEMBER(bfcobra_state::ramdac_r)
}
default:
{
- mame_printf_debug("Unhandled RAMDAC read (PC:%.4x)\n", cpu_get_previouspc(&space.device()));
+ mame_printf_debug("Unhandled RAMDAC read (PC:%.4x)\n", space.device().safe_pcbase());
}
}
@@ -930,7 +930,7 @@ READ8_MEMBER(bfcobra_state::chipset_r)
}
default:
{
- mame_printf_debug("Flare One unknown read: 0x%.2x (PC:0x%.4x)\n", offset, cpu_get_previouspc(&space.device()));
+ mame_printf_debug("Flare One unknown read: 0x%.2x (PC:0x%.4x)\n", offset, space.device().safe_pcbase());
}
}
@@ -946,7 +946,7 @@ WRITE8_MEMBER(bfcobra_state::chipset_w)
case 0x03:
{
if (data > 0x3f)
- popmessage("%x: Unusual bank access (%x)\n", cpu_get_previouspc(&space.device()), data);
+ popmessage("%x: Unusual bank access (%x)\n", space.device().safe_pcbase(), data);
data &= 0x3f;
m_bank_data[offset] = data;
@@ -1020,7 +1020,7 @@ WRITE8_MEMBER(bfcobra_state::chipset_w)
}
default:
{
- mame_printf_debug("Flare One unknown write: 0x%.2x with 0x%.2x (PC:0x%.4x)\n", offset, data, cpu_get_previouspc(&space.device()));
+ mame_printf_debug("Flare One unknown write: 0x%.2x with 0x%.2x (PC:0x%.4x)\n", offset, data, space.device().safe_pcbase());
}
}
}
diff --git a/src/mame/drivers/bfm_sc4h.c b/src/mame/drivers/bfm_sc4h.c
index c048e5c1afa..d156a49bbbb 100644
--- a/src/mame/drivers/bfm_sc4h.c
+++ b/src/mame/drivers/bfm_sc4h.c
@@ -64,7 +64,7 @@ UINT8 read_input_matrix(running_machine &machine, int row)
READ16_MEMBER(sc4_state::sc4_cs1_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (offset<0x100000/2)
{
@@ -113,7 +113,7 @@ READ16_MEMBER(sc4_state::sc4_cs1_r)
READ16_MEMBER(sc4_state::sc4_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68307_get_cs(m_maincpu, offset * 2);
int base = 0, end = 0, base2 = 0, end2 = 0;
// if (!(debugger_access())) printf("cs is %d\n", cs);
@@ -269,7 +269,7 @@ WRITE8_MEMBER(sc4_state::mux_output2_w)
WRITE16_MEMBER(sc4_state::sc4_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68307_get_cs(m_maincpu, offset * 2);
int base = 0, end = 0, base2 = 0, end2 = 0;
@@ -395,7 +395,7 @@ ADDRESS_MAP_END
READ32_MEMBER(sc4_adder4_state::adder4_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_adder4cpu, offset * 4);
switch ( cs )
@@ -417,7 +417,7 @@ READ32_MEMBER(sc4_adder4_state::adder4_mem_r)
WRITE32_MEMBER(sc4_adder4_state::adder4_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_adder4cpu, offset * 4);
switch ( cs )
@@ -554,7 +554,7 @@ void bfm_sc4_68307_portb_w(address_space *space, bool dedicated, UINT16 data, UI
{
// if (dedicated == false)
{
- int pc = cpu_get_pc(&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);
@@ -567,7 +567,7 @@ void bfm_sc4_68307_portb_w(address_space *space, bool dedicated, UINT16 data, UI
}
UINT8 bfm_sc4_68307_porta_r(address_space *space, bool dedicated, UINT8 line_mask)
{
- int pc = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
logerror("%08x bfm_sc4_68307_porta_r\n", pc);
return space->machine().rand();
}
diff --git a/src/mame/drivers/bfm_swp.c b/src/mame/drivers/bfm_swp.c
index a306a1d14e2..f594b0bc49f 100644
--- a/src/mame/drivers/bfm_swp.c
+++ b/src/mame/drivers/bfm_swp.c
@@ -146,7 +146,7 @@ protected:
READ32_MEMBER(bfm_swp_state::bfm_swp_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
@@ -168,7 +168,7 @@ READ32_MEMBER(bfm_swp_state::bfm_swp_mem_r)
WRITE32_MEMBER(bfm_swp_state::bfm_swp_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index 04832f6255c..8e33313085b 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -81,7 +81,7 @@ static TIMER_CALLBACK( from_sound_latch_callback )
}
WRITE8_MEMBER(bigevglf_state::beg_fromsound_w)/* write to D800 sets bit 1 in status */
{
- machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(&space.device()) << 16) | data);
+ machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (space.device().safe_pc() << 16) | data);
}
READ8_MEMBER(bigevglf_state::beg_fromsound_r)
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index 52e3aea63b9..ff1fedcdbc6 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -73,14 +73,14 @@
WRITE16_MEMBER(bionicc_state::hacked_controls_w)
{
- logerror("%06x: hacked_controls_w %04x %02x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06x: hacked_controls_w %04x %02x\n", space.device().safe_pc(), offset, data);
COMBINE_DATA(&m_inp[offset]);
}
READ16_MEMBER(bionicc_state::hacked_controls_r)
{
- logerror("%06x: hacked_controls_r %04x %04x\n", cpu_get_pc(&space.device()), offset, m_inp[offset]);
+ logerror("%06x: hacked_controls_r %04x %04x\n", space.device().safe_pc(), offset, m_inp[offset]);
return m_inp[offset];
}
diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c
index 298a93bba7b..019af2e3a3a 100644
--- a/src/mame/drivers/bking.c
+++ b/src/mame/drivers/bking.c
@@ -196,7 +196,7 @@ READ8_MEMBER(bking_state::bking3_68705_port_c_r)
int port_c_in = 0;
if (main_sent) port_c_in |= 0x01;
if (!mcu_sent) port_c_in |= 0x02;
-//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(&space.device()),port_c_in);
+//logerror("%04x: 68705 port C read %02x\n",space.device().safe_pc(),port_c_in);
return port_c_in;
}
#endif
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index 0a2a49834f8..20d7997647e 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -335,7 +335,7 @@ static KONAMI_SETLINES_CALLBACK( blockhl_banking )
/* other bits unknown */
if ((lines & 0x84) != 0x80)
- logerror("%04x: setlines %02x\n", cpu_get_pc(device), lines);
+ logerror("%04x: setlines %02x\n", device->safe_pc(), lines);
}
diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c
index 40366f40783..495812cdc7b 100644
--- a/src/mame/drivers/bmcbowl.c
+++ b/src/mame/drivers/bmcbowl.c
@@ -203,7 +203,7 @@ READ16_MEMBER(bmcbowl_state::bmc_random_read)
READ16_MEMBER(bmcbowl_state::bmc_protection_r)
{
- switch(cpu_get_previouspc(&space.device()))
+ switch(space.device().safe_pcbase())
{
case 0xca68:
switch(cpu_get_reg(&space.device(), M68K_D2))
@@ -214,7 +214,7 @@ READ16_MEMBER(bmcbowl_state::bmc_protection_r)
}
break;
}
- logerror("Protection read @ %X\n",cpu_get_previouspc(&space.device()));
+ logerror("Protection read @ %X\n",space.device().safe_pcbase());
return machine().rand();
}
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 5ebbcd5827d..54af6f3cbb7 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -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 = cpu_get_pc(&space->device());
+ 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 = cpu_get_previouspc(&space->device());
+ 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];
@@ -240,7 +240,7 @@ WRITE8_MEMBER(btime_state::lnc_w)
else if (offset == 0x9000) { return; } /* AM_NOP */
else if (offset == 0x9002) { audio_command_w(space, 0, data); return; }
else if (offset >= 0xb000 && offset <= 0xb1ff) ;
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
m_rambase[offset] = data;
@@ -258,7 +258,7 @@ WRITE8_MEMBER(btime_state::mmonkey_w)
else if (offset == 0x9000) { return; } /* AM_NOP */
else if (offset == 0x9002) { audio_command_w(space, 0, data); return; }
else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(space, offset - 0xb000, data); return; }
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
m_rambase[offset] = data;
@@ -276,7 +276,7 @@ WRITE8_MEMBER(btime_state::btime_w)
else if (offset == 0x4002) btime_video_control_w(space, 0, data);
else if (offset == 0x4003) audio_command_w(space, 0, data);
else if (offset == 0x4004) bnj_scroll1_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
m_rambase[offset] = data;
@@ -295,7 +295,7 @@ WRITE8_MEMBER(btime_state::tisland_w)
else if (offset == 0x4004) bnj_scroll1_w(space, 0, data);
else if (offset == 0x4005) bnj_scroll2_w(space, 0, data);
// else if (offset == 0x8000) btime_video_control_w(space,0,data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
m_rambase[offset] = data;
@@ -313,7 +313,7 @@ WRITE8_MEMBER(btime_state::zoar_w)
else if (offset == 0x9804) bnj_scroll2_w(space, 0, data);
else if (offset == 0x9805) bnj_scroll1_w(space, 0, data);
else if (offset == 0x9806) audio_command_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
m_rambase[offset] = data;
@@ -327,7 +327,7 @@ WRITE8_MEMBER(btime_state::disco_w)
else if (offset >= 0x8000 && offset <= 0x881f) ;
else if (offset == 0x9a00) audio_command_w(space, 0, data);
else if (offset == 0x9c00) disco_video_control_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), cpu_get_pc(&space.device()), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space.device().tag(), space.device().safe_pc(), data, offset);
m_rambase[offset] = data;
diff --git a/src/mame/drivers/cabaret.c b/src/mame/drivers/cabaret.c
index 9e294ce7dca..cc30815d5c1 100644
--- a/src/mame/drivers/cabaret.c
+++ b/src/mame/drivers/cabaret.c
@@ -140,7 +140,7 @@ WRITE8_MEMBER(cabaret_state::cabaret_nmi_and_coins_w)
{
if ((m_nmi_enable ^ data) & (~0xdd))
{
- logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("PC %06X: nmi_and_coins = %02x\n",space.device().safe_pc(),data);
// popmessage("%02x",data);
}
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 89c3d8e2200..089169f7808 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -356,7 +356,7 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
#if 0
if ((state->m_mxtc_config_reg[0x63] & 0x50) | ( state->m_mxtc_config_reg[0x63] & 0xA0)) // Only DO if comes a change to disable ROM.
{
- if ( cpu_get_pc(busdevice->machine().device("maincpu"))==0xff74e) cpu_set_reg(busdevice->machine().device("maincpu"), STATE_GENPC, 0xff74d);
+ if ( busdevice->machine(->safe_pc().device("maincpu"))==0xff74e) cpu_set_reg(busdevice->machine().device("maincpu"), STATE_GENPC, 0xff74d);
}
#endif
@@ -961,7 +961,7 @@ MACHINE_CONFIG_END
READ32_MEMBER(calchase_state::calchase_idle_skip_r)
{
- if(cpu_get_pc(&space.device())==0x1406f48)
+ if(space.device().safe_pc()==0x1406f48)
device_spin_until_interrupt(m_maincpu);
return m_idle_skip_ram;
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 662b6aa3dac..818ea97ee92 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -263,7 +263,7 @@ READ16_MEMBER(cave_state::soundlatch_ack_r)
}
else
{
- logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n", cpu_get_pc(&space.device()));
+ logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n", space.device().safe_pc());
return 0xff;
}
}
@@ -276,7 +276,7 @@ WRITE8_MEMBER(cave_state::soundlatch_ack_w)
if (m_soundbuf_len < 32)
m_soundbuf_len++;
else
- logerror("CPU #1 - PC %04X: Sound Buffer 2 Overflow Error\n", cpu_get_pc(&space.device()));
+ logerror("CPU #1 - PC %04X: Sound Buffer 2 Overflow Error\n", space.device().safe_pc());
}
@@ -1051,7 +1051,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(cave_state::hotdogst_rombank_w)
{
if (data & ~0x0f)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", space.device().safe_pc(), data);
membank("bank2")->set_entry(data & 0x0f);
}
@@ -1088,7 +1088,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(cave_state::mazinger_rombank_w)
{
if (data & ~0x07)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", space.device().safe_pc(), data);
membank("bank2")->set_entry(data & 0x07);
}
@@ -1119,7 +1119,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(cave_state::metmqstr_rombank_w)
{
if (data & ~0x0f)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", space.device().safe_pc(), data);
membank("bank1")->set_entry(data & 0x0f);
}
@@ -1167,7 +1167,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(cave_state::pwrinst2_rombank_w)
{
if (data & ~0x07)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", space.device().safe_pc(), data);
membank("bank1")->set_entry(data & 0x07);
}
@@ -1209,7 +1209,7 @@ WRITE8_MEMBER(cave_state::mirror_ram_w)
WRITE8_MEMBER(cave_state::sailormn_rombank_w)
{
if (data & ~0x1f)
- logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #1 - PC %04X: Bank %02X\n", space.device().safe_pc(), data);
membank("bank1")->set_entry(data & 0x1f);
}
diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c
index 61acf8455ac..db2d6f37a3f 100644
--- a/src/mame/drivers/cbasebal.c
+++ b/src/mame/drivers/cbasebal.c
@@ -31,7 +31,7 @@ WRITE8_MEMBER(cbasebal_state::cbasebal_bankswitch_w)
{
/* bits 0-4 select ROM bank */
- //logerror("%04x: bankswitch %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: bankswitch %02x\n", space.device().safe_pc(), data);
membank("bank1")->set_entry(data & 0x1f);
/* bit 5 used but unknown */
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index c802b76eb6f..a82c30b9ddf 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -75,7 +75,7 @@ WRITE16_MEMBER(cbuster_state::twocrude_control_w)
break;
}
- logerror("Warning %04x- %02x written to control %02x\n", cpu_get_pc(&space.device()), data, offset);
+ logerror("Warning %04x- %02x written to control %02x\n", space.device().safe_pc(), data, offset);
}
READ16_MEMBER(cbuster_state::twocrude_control_r)
@@ -90,7 +90,7 @@ READ16_MEMBER(cbuster_state::twocrude_control_r)
return ioport("DSW")->read();
case 4: /* Protection */
- logerror("%04x : protection control read at 30c000 %d\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x : protection control read at 30c000 %d\n", space.device().safe_pc(), offset);
return m_prot;
case 6: /* Credits, VBL in byte 7 */
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index 7fe36844ebc..118ff1da28a 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -1236,7 +1236,7 @@ static void cndypuzl_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//(*state->m_chip_ram_w)(0x051c02, 0x0000);
@@ -1255,7 +1255,7 @@ static void haremchl_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//amiga_chip_ram_w8(state, 0x002907, 0x00);
@@ -1275,7 +1275,7 @@ static void lsrquiz_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//amiga_chip_ram_w8(state, 0x001e1b, 0x00);
@@ -1296,7 +1296,7 @@ static void lsrquiz2_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//amiga_chip_ram_w8(state, 0x046107, 0x00);
@@ -1316,7 +1316,7 @@ static void lasstixx_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//amiga_chip_ram_w8(state, 0x00281c, 0x00);
@@ -1336,7 +1336,7 @@ static void mgnumber_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//(*state->m_chip_ram_w)(0x04bfa0, 0x0000);
@@ -1355,7 +1355,7 @@ static void mgprem11_input_hack(running_machine &machine)
{
cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine.device("maincpu")) < state->m_chip_ram.bytes())
+ if (machine.device("maincpu")->safe_pc() < state->m_chip_ram.bytes())
{
//amiga_chip_ram_w8(state, 0x044f7e, 0x00);
diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c
index 2cb301ba69c..807a2aa3a5b 100644
--- a/src/mame/drivers/cdi.c
+++ b/src/mame/drivers/cdi.c
@@ -44,7 +44,7 @@ INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
+ logerror( "%08x: %s", machine.device("maincpu")->safe_pc(), buf );
}
}
#else
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 9dff8f1ed29..16ee897961b 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -612,7 +612,7 @@ WRITE8_MEMBER(centiped_state::mazeinv_input_select_w)
READ8_MEMBER(centiped_state::bullsdrt_data_port_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0033:
case 0x6b19:
diff --git a/src/mame/drivers/chaknpop.c b/src/mame/drivers/chaknpop.c
index cc41bfd4a05..c92901d384e 100644
--- a/src/mame/drivers/chaknpop.c
+++ b/src/mame/drivers/chaknpop.c
@@ -130,7 +130,7 @@ WRITE8_MEMBER(chaknpop_state::unknown_port_2_w)
WRITE8_MEMBER(chaknpop_state::coinlock_w)
{
- logerror("%04x: coin lock %sable\n", cpu_get_pc(&space.device()), data ? "dis" : "en");
+ logerror("%04x: coin lock %sable\n", space.device().safe_pc(), data ? "dis" : "en");
}
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 06a36aeb67c..a9a443f97b4 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -91,7 +91,7 @@ READ16_MEMBER(cninja_state::cninja_irq_r)
return 0;
}
- logerror("%08x: Unmapped IRQ read %d\n", cpu_get_pc(&space.device()), offset);
+ logerror("%08x: Unmapped IRQ read %d\n", space.device().safe_pc(), offset);
return 0;
}
@@ -106,7 +106,7 @@ WRITE16_MEMBER(cninja_state::cninja_irq_w)
0xc8: Raster IRQ turned on (68k IRQ level 4)
0xd8: Raster IRQ turned on (68k IRQ level 3)
*/
- logerror("%08x: IRQ write %d %08x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%08x: IRQ write %d %08x\n", space.device().safe_pc(), offset, data);
m_irq_mask = data & 0xff;
return;
@@ -123,7 +123,7 @@ WRITE16_MEMBER(cninja_state::cninja_irq_w)
return;
}
- logerror("%08x: Unmapped IRQ write %d %04x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%08x: Unmapped IRQ write %d %04x\n", space.device().safe_pc(), offset, data);
}
READ16_MEMBER(cninja_state::robocop2_prot_r)
@@ -137,10 +137,10 @@ READ16_MEMBER(cninja_state::robocop2_prot_r)
case 0x4e6: /* Dip switches */
return ioport("DSW")->read();
case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset);
return 0x84;
}
- logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset);
return 0;
}
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index f60b4ed1fc7..3e759e3bfda 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -472,7 +472,7 @@ WRITE8_MEMBER(cntsteer_state::cntsteer_sound_w)
WRITE8_MEMBER(cntsteer_state::zerotrgt_ctrl_w)
{
/*TODO: check this.*/
- logerror("CTRL: %04x: %04x: %04x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("CTRL: %04x: %04x: %04x\n", space.device().safe_pc(), offset, data);
// if (offset == 0) device_set_input_line(m_subcpu, INPUT_LINE_RESET, ASSERT_LINE);
// Wrong - bits 0 & 1 used on this
diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c
index 559db4a79c6..2ffe2d95e60 100644
--- a/src/mame/drivers/cobra.c
+++ b/src/mame/drivers/cobra.c
@@ -1052,7 +1052,7 @@ void cobra_fifo::push(const device_t *cpu, UINT64 data)
if (cpu != NULL)
{
// cpu has a name and a PC
- sprintf(accessor_location, "(%s) %08X", cpu->tag(), cpu_get_pc((device_t *)cpu));
+ sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc());
}
else
{
@@ -1072,7 +1072,7 @@ void cobra_fifo::push(const device_t *cpu, UINT64 data)
if (cpu != NULL)
{
// cpu has a name and a PC
- sprintf(accessor_location, "(%s) %08X", cpu->tag(), cpu_get_pc((device_t *)cpu));
+ sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc());
}
else
{
@@ -1129,7 +1129,7 @@ bool cobra_fifo::pop(const device_t *cpu, UINT64 *result)
if (cpu != NULL)
{
// cpu has a name and a PC
- sprintf(accessor_location, "(%s) %08X", cpu->tag(), cpu_get_pc((device_t *)cpu));
+ sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc());
}
else
{
@@ -1150,7 +1150,7 @@ bool cobra_fifo::pop(const device_t *cpu, UINT64 *result)
if (cpu != NULL)
{
// cpu has a name and a PC
- sprintf(accessor_location, "(%s) %08X", cpu->tag(), cpu_get_pc((device_t *)cpu));
+ sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc());
}
else
{
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index b4118527b66..9fb66ab4587 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -218,7 +218,7 @@ static TIMER_DEVICE_CALLBACK( amerdart_audio_int_gen )
WRITE16_MEMBER(coolpool_state::amerdart_misc_w)
{
- logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(&space.device()),data);
+ logerror("%08x:IOP_system_w %04x\n",space.device().safe_pc(),data);
coin_counter_w(machine(), 0, ~data & 0x0001);
coin_counter_w(machine(), 1, ~data & 0x0002);
@@ -250,7 +250,7 @@ READ16_MEMBER(coolpool_state::amerdart_dsp_bio_line_r)
READ16_MEMBER(coolpool_state::amerdart_iop_r)
{
-// logerror("%08x:IOP read %04x\n",cpu_get_pc(&space.device()),m_iop_answer);
+// logerror("%08x:IOP read %04x\n",space.device().safe_pc(),m_iop_answer);
cputag_set_input_line(machine(), "maincpu", 1, CLEAR_LINE);
return m_iop_answer;
@@ -259,7 +259,7 @@ READ16_MEMBER(coolpool_state::amerdart_iop_r)
WRITE16_MEMBER(coolpool_state::amerdart_iop_w)
{
-// logerror("%08x:IOP write %04x\n", cpu_get_pc(&space.device()), data);
+// logerror("%08x:IOP write %04x\n", space.device().safe_pc(), data);
COMBINE_DATA(&m_iop_cmd);
m_cmd_pending = 1;
}
@@ -267,7 +267,7 @@ WRITE16_MEMBER(coolpool_state::amerdart_iop_w)
READ16_MEMBER(coolpool_state::amerdart_dsp_cmd_r)
{
-// logerror("%08x:DSP cmd_r %04x\n", cpu_get_pc(&space.device()), m_iop_cmd);
+// logerror("%08x:DSP cmd_r %04x\n", space.device().safe_pc(), m_iop_cmd);
m_cmd_pending = 0;
return m_iop_cmd;
}
@@ -275,7 +275,7 @@ READ16_MEMBER(coolpool_state::amerdart_dsp_cmd_r)
WRITE16_MEMBER(coolpool_state::amerdart_dsp_answer_w)
{
-// logerror("%08x:DSP answer %04x\n", cpu_get_pc(&space.device()), data);
+// logerror("%08x:DSP answer %04x\n", space.device().safe_pc(), data);
m_iop_answer = data;
cputag_set_input_line(machine(), "maincpu", 1, ASSERT_LINE);
}
@@ -423,7 +423,7 @@ READ16_MEMBER(coolpool_state::amerdart_trackball_r)
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", cpu_get_pc(&space.device()), m_newx, m_newy, m_oldx, m_oldy, m_lastresult, m_result);
+// 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);
m_lastresult = m_result;
@@ -439,7 +439,7 @@ READ16_MEMBER(coolpool_state::amerdart_trackball_r)
WRITE16_MEMBER(coolpool_state::coolpool_misc_w)
{
- logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(&space.device()),data);
+ logerror("%08x:IOP_system_w %04x\n",space.device().safe_pc(),data);
coin_counter_w(machine(), 0, ~data & 0x0001);
coin_counter_w(machine(), 1, ~data & 0x0002);
@@ -471,7 +471,7 @@ static TIMER_CALLBACK( deferred_iop_w )
WRITE16_MEMBER(coolpool_state::coolpool_iop_w)
{
- logerror("%08x:IOP write %04x\n", cpu_get_pc(&space.device()), data);
+ logerror("%08x:IOP write %04x\n", space.device().safe_pc(), data);
machine().scheduler().synchronize(FUNC(deferred_iop_w), data);
}
@@ -479,7 +479,7 @@ WRITE16_MEMBER(coolpool_state::coolpool_iop_w)
READ16_MEMBER(coolpool_state::coolpool_iop_r)
{
- logerror("%08x:IOP read %04x\n",cpu_get_pc(&space.device()),m_iop_answer);
+ logerror("%08x:IOP read %04x\n",space.device().safe_pc(),m_iop_answer);
cputag_set_input_line(machine(), "maincpu", 1, CLEAR_LINE);
return m_iop_answer;
@@ -498,7 +498,7 @@ READ16_MEMBER(coolpool_state::dsp_cmd_r)
{
m_cmd_pending = 0;
- logerror("%08x:IOP cmd_r %04x\n", cpu_get_pc(&space.device()), m_iop_cmd);
+ logerror("%08x:IOP cmd_r %04x\n", space.device().safe_pc(), m_iop_cmd);
return m_iop_cmd;
}
@@ -506,7 +506,7 @@ READ16_MEMBER(coolpool_state::dsp_cmd_r)
WRITE16_MEMBER(coolpool_state::dsp_answer_w)
{
- logerror("%08x:IOP answer %04x\n", cpu_get_pc(&space.device()), data);
+ logerror("%08x:IOP answer %04x\n", space.device().safe_pc(), data);
m_iop_answer = data;
cputag_set_input_line(machine(), "maincpu", 1, ASSERT_LINE);
}
@@ -625,7 +625,7 @@ READ16_MEMBER(coolpool_state::coolpool_input_r)
}
}
-// logerror("%08X:read port 7 (X=%02X Y=%02X oldX=%02X oldY=%02X res=%04X)\n", cpu_get_pc(&space.device()),
+// logerror("%08X:read port 7 (X=%02X Y=%02X oldX=%02X oldY=%02X res=%04X)\n", space.device().safe_pc(),
// m_newx[1], m_newy[1], m_oldx[1], m_oldy[1], m_result);
m_lastresult = m_result;
return m_result;
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 1b53d4e9384..6b379ca8963 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -355,7 +355,7 @@ READ16_MEMBER(cps_state::qsound_rom_r)
return rom[offset] | 0xff00;
else
{
- popmessage("%06x: read sound ROM byte %04x", cpu_get_pc(&space.device()), offset);
+ popmessage("%06x: read sound ROM byte %04x", space.device().safe_pc(), offset);
return 0;
}
}
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index 30b0f6de0e0..6e384427a19 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -61,7 +61,7 @@ WRITE8_MEMBER(crbaloon_state::pc3092_w)
{
m_pc3092_data[offset] = data & 0x0f;
- if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", cpu_get_pc(&space.device()), offset, m_pc3092_data[offset]);
+ if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", space.device().safe_pc(), offset, m_pc3092_data[offset]);
pc3092_update(machine());
}
@@ -141,7 +141,7 @@ READ8_MEMBER(crbaloon_state::pc3259_r)
break;
}
- if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", cpu_get_pc(&space.device()), reg, ret);
+ if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", space.device().safe_pc(), reg, ret);
return ret | (ioport("DSW1")->read() & 0xf0);
}
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index 86ccf0e815f..23928de5bfa 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -138,7 +138,7 @@ WRITE8_MEMBER(crgolf_state::switch_input_select_w)
WRITE8_MEMBER(crgolf_state::unknown_w)
{
- logerror("%04X:unknown_w = %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("%04X:unknown_w = %02X\n", space.device().safe_pc(), data);
}
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 1f84a1f9aa6..065916a9384 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -267,7 +267,7 @@ READ8_MEMBER(cvs_state::cvs_input_r)
case 0x04: ret = ioport("IN3")->read(); break;
case 0x06: ret = ioport("DSW3")->read(); break;
case 0x07: ret = ioport("DSW2")->read(); break;
- default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", cpu_get_pc(&space.device()), offset & 0x0f); break;
+ default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", space.device().safe_pc(), offset & 0x0f); break;
}
return ret;
@@ -375,13 +375,13 @@ WRITE8_MEMBER(cvs_state::cvs_speech_rom_address_lo_w)
/* assuming that d0-d2 are cleared here */
m_speech_rom_bit_address = (m_speech_rom_bit_address & 0xf800) | (data << 3);
- LOG(("%04x : CVS: Speech Lo %02x Address = %04x\n", cpu_get_pc(&space.device()), data, m_speech_rom_bit_address >> 3));
+ LOG(("%04x : CVS: Speech Lo %02x Address = %04x\n", space.device().safe_pc(), data, m_speech_rom_bit_address >> 3));
}
WRITE8_MEMBER(cvs_state::cvs_speech_rom_address_hi_w)
{
m_speech_rom_bit_address = (m_speech_rom_bit_address & 0x07ff) | (data << 11);
- LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", cpu_get_pc(&space.device()), data, m_speech_rom_bit_address >> 3));
+ LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", space.device().safe_pc(), data, m_speech_rom_bit_address >> 3));
}
diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c
index ad9a2df2382..80e2c609d0b 100644
--- a/src/mame/drivers/cyclemb.c
+++ b/src/mame/drivers/cyclemb.c
@@ -419,7 +419,7 @@ READ8_MEMBER( cyclemb_state::skydest_i8741_0_r )
{
if(offset == 1) //status port
{
- //printf("STATUS PC=%04x\n",cpu_get_pc(m_maincpu));
+ //printf("STATUS PC=%04x\n",m_maincpu->safe_pc());
return 1;
}
@@ -427,14 +427,14 @@ READ8_MEMBER( cyclemb_state::skydest_i8741_0_r )
{
UINT8 i,pt;
- //printf("%04x\n",cpu_get_pc(m_maincpu));
+ //printf("%04x\n",m_maincpu->safe_pc());
/* TODO: internal state of this */
- if(cpu_get_pc(m_maincpu) == m_dsw_pc_hack)
+ if(m_maincpu->safe_pc() == m_dsw_pc_hack)
m_mcu[0].rxd = (ioport("DSW1")->read() & 0x1f) << 2;
else if(m_mcu[0].rst)
{
- //printf("READ PC=%04x\n",cpu_get_pc(m_maincpu));
+ //printf("READ PC=%04x\n",m_maincpu->safe_pc());
{
switch(m_mcu[0].state)
@@ -500,7 +500,7 @@ WRITE8_MEMBER( cyclemb_state::skydest_i8741_0_w )
{
if(offset == 1) //command port
{
- //printf("%02x CMD PC=%04x\n",data,cpu_get_pc(m_maincpu));
+ //printf("%02x CMD PC=%04x\n",data,m_maincpu->safe_pc());
switch(data)
{
case 0:
@@ -535,7 +535,7 @@ WRITE8_MEMBER( cyclemb_state::skydest_i8741_0_w )
}
else
{
- //printf("%02x DATA PC=%04x\n",data,cpu_get_pc(m_maincpu));
+ //printf("%02x DATA PC=%04x\n",data,m_maincpu->safe_pc());
m_mcu[0].txd = data;
diff --git a/src/mame/drivers/d9final.c b/src/mame/drivers/d9final.c
index c55b95687db..15a1579354d 100644
--- a/src/mame/drivers/d9final.c
+++ b/src/mame/drivers/d9final.c
@@ -102,7 +102,7 @@ WRITE8_MEMBER(d9final_state::d9final_bank_w)
/* game checks this after three attract cycles, otherwise coin inputs stop to work. */
READ8_MEMBER(d9final_state::prot_latch_r)
{
-// printf("PC=%06x\n",cpu_get_pc(&space.device()));
+// printf("PC=%06x\n",space.device().safe_pc());
return 0x04;
}
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index a47fc722431..1c96731031c 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -158,7 +158,7 @@ WRITE16_MEMBER(darius_state::cpua_ctrl_w)
parse_control(machine());
- logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #0 PC %06x: write %04x to cpu control\n", space.device().safe_pc(), data);
}
WRITE16_MEMBER(darius_state::darius_watchdog_w)
@@ -195,7 +195,7 @@ READ16_MEMBER(darius_state::darius_ioc_r)
return ioport("DSW")->read();
}
-logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(&space.device()),offset);
+logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",space.device().safe_pc(),offset);
return 0xff;
}
@@ -231,7 +231,7 @@ WRITE16_MEMBER(darius_state::darius_ioc_w)
return;
}
-logerror("CPU #0 PC %06x: warning - write unmapped ioc offset %06x with %04x\n",cpu_get_pc(&space.device()),offset,data);
+logerror("CPU #0 PC %06x: warning - write unmapped ioc offset %06x with %04x\n",space.device().safe_pc(),offset,data);
}
@@ -516,7 +516,7 @@ static const msm5205_interface msm5205_config =
READ8_MEMBER(darius_state::adpcm_command_read)
{
- /* logerror("read port 0: %02x PC=%4x\n",adpcm_command, cpu_get_pc(&space.device()) ); */
+ /* logerror("read port 0: %02x PC=%4x\n",adpcm_command, space.device().safe_pc() ); */
return m_adpcm_command;
}
@@ -534,13 +534,13 @@ WRITE8_MEMBER(darius_state::adpcm_nmi_disable)
{
m_nmi_enable = 0;
- /* logerror("write port 0: NMI DISABLE PC=%4x\n", data, cpu_get_pc(&space.device()) ); */
+ /* logerror("write port 0: NMI DISABLE PC=%4x\n", data, space.device().safe_pc() ); */
}
WRITE8_MEMBER(darius_state::adpcm_nmi_enable)
{
m_nmi_enable = 1;
- /* logerror("write port 1: NMI ENABLE PC=%4x\n", cpu_get_pc(&space.device()) ); */
+ /* logerror("write port 1: NMI ENABLE PC=%4x\n", space.device().safe_pc() ); */
}
WRITE8_MEMBER(darius_state::adpcm_data_w)
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index a0b9ac5be53..2258b6c55ec 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -172,7 +172,7 @@ READ16_MEMBER(dblewing_state::dblewing_prot_r)
case 0x532: return m_580_data;
}
-// printf("dblewing prot r %08x, %04x, %04x\n", cpu_get_pc(&space.device()), offset * 2, mem_mask);
+// printf("dblewing prot r %08x, %04x, %04x\n", space.device().safe_pc(), offset * 2, mem_mask);
if ((offset*2) == 0x0f8) return 0; // m_080_data;
if ((offset*2) == 0x104) return 0;
@@ -184,7 +184,7 @@ READ16_MEMBER(dblewing_state::dblewing_prot_r)
if ((offset*2) == 0x54a) return 0; // 3rd player 2nd boss
if ((offset*2) == 0x786) return 0;
- mame_printf_debug("dblewing prot r %08x, %04x, %04x\n", cpu_get_pc(&space.device()), offset * 2, mem_mask);
+ mame_printf_debug("dblewing prot r %08x, %04x, %04x\n", space.device().safe_pc(), offset * 2, mem_mask);
return 0;//machine().rand();
}
@@ -193,7 +193,7 @@ WRITE16_MEMBER(dblewing_state::dblewing_prot_w)
{
// if (offset * 2 != 0x380)
-// printf("dblewing prot w %08x, %04x, %04x %04x\n", cpu_get_pc(&space.device()), offset * 2, mem_mask, data);
+// printf("dblewing prot w %08x, %04x, %04x %04x\n", space.device().safe_pc(), offset * 2, mem_mask, data);
switch (offset * 2)
{
@@ -295,7 +295,7 @@ WRITE16_MEMBER(dblewing_state::dblewing_prot_w)
return; // p2 inputs select screen OK
}
-// printf("dblewing prot w %08x, %04x, %04x %04x\n", cpu_get_pc(&space.device()), offset * 2, mem_mask, data);
+// printf("dblewing prot w %08x, %04x, %04x %04x\n", space.device().safe_pc(), offset * 2, mem_mask, data);
if ((offset * 2) == 0x008) { m_008_data = data; return; }
if ((offset * 2) == 0x080) { m_080_data = data; return; } // p3 3rd boss?
diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c
index 1619c3d523b..3ccfe8b4a2a 100644
--- a/src/mame/drivers/dcheese.c
+++ b/src/mame/drivers/dcheese.c
@@ -183,7 +183,7 @@ WRITE8_MEMBER(dcheese_state::sound_control_w)
if ((diff & 0x40) && (data & 0x40))
m_bsmt->reset();
if (data != 0x40 && data != 0x60)
- logerror("%04X:sound_control_w = %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("%04X:sound_control_w = %02X\n", space.device().safe_pc(), data);
}
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index ed9fcc3e101..5a734c0cc49 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -824,7 +824,7 @@ g_profiler.start(PROFILER_VIDEO);
;
#ifdef MAME_DEBUG
popmessage("unknown blitter command %02x", data);
- logerror("%06x: unknown blitter command %02x\n", cpu_get_pc(&space->device()), data);
+ logerror("%06x: unknown blitter command %02x\n", space->device().safe_pc(), data);
#endif
}
@@ -843,7 +843,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
default:
- logerror("%06x: Blitter %d reg %02x = %02x\n", cpu_get_pc(&space->device()), 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;
}
}
@@ -1190,7 +1190,7 @@ g_profiler.start(PROFILER_VIDEO);
;
#ifdef MAME_DEBUG
popmessage("unknown blitter command %02x", data);
- logerror("%06x: unknown blitter command %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: unknown blitter command %02x\n", space.device().safe_pc(), data);
#endif
}
@@ -1199,7 +1199,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
default:
- logerror("%06x: Blitter 0 reg %02x = %02x\n", cpu_get_pc(&space.device()), m_ddenlovr_blit_latch, data);
+ logerror("%06x: Blitter 0 reg %02x = %02x\n", space.device().safe_pc(), m_ddenlovr_blit_latch, data);
break;
}
@@ -1244,7 +1244,7 @@ READ8_MEMBER(dynax_state::rongrong_gfxrom_r)
if (address >= size)
{
- logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", cpu_get_pc(&space.device()), address);
+ logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", space.device().safe_pc(), address);
address %= size;
}
@@ -1589,7 +1589,7 @@ WRITE16_MEMBER(dynax_state::ddenlovr_select2_16_w)
READ8_MEMBER(dynax_state::rongrong_input2_r)
{
-// logerror("%04x: input2_r offset %d select %x\n", cpu_get_pc(&space.device()), offset, m_input_sel);
+// logerror("%04x: input2_r offset %d select %x\n", space.device().safe_pc(), offset, m_input_sel);
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (m_input_sel)
{
@@ -1615,7 +1615,7 @@ static READ8_DEVICE_HANDLER( quiz365_input_r )
READ16_MEMBER(dynax_state::quiz365_input2_r)
{
-// logerror("%04x: input2_r offset %d select %x\n",cpu_get_pc(&space.device()), offset, m_input_sel);
+// logerror("%04x: input2_r offset %d select %x\n",space.device().safe_pc(), offset, m_input_sel);
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (m_input_sel)
{
@@ -1632,7 +1632,7 @@ WRITE8_MEMBER(dynax_state::rongrong_blitter_busy_w)
m_rongrong_blitter_busy_select = data;
if (data != 0x18)
- logerror("%04x: rongrong_blitter_busy_w data = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: rongrong_blitter_busy_w data = %02x\n", space.device().safe_pc(), data);
}
READ8_MEMBER(dynax_state::rongrong_blitter_busy_r)
@@ -1642,7 +1642,7 @@ READ8_MEMBER(dynax_state::rongrong_blitter_busy_r)
case 0x18: return 0; // bit 5 = blitter busy
default:
- logerror("%04x: rongrong_blitter_busy_r with select = %02x\n", cpu_get_pc(&space.device()), m_rongrong_blitter_busy_select);
+ logerror("%04x: rongrong_blitter_busy_r with select = %02x\n", space.device().safe_pc(), m_rongrong_blitter_busy_select);
}
return 0xff;
}
@@ -1969,7 +1969,7 @@ READ8_MEMBER(dynax_state::rongrong_input_r)
WRITE8_MEMBER(dynax_state::rongrong_select_w)
{
-//logerror("%04x: rongrong_select_w %02x\n",cpu_get_pc(&space.device()),data);
+//logerror("%04x: rongrong_select_w %02x\n",space.device().safe_pc(),data);
/* bits 0-4 = **both** ROM bank **AND** input select */
membank("bank1")->set_entry(data & 0x1f);
@@ -2238,7 +2238,7 @@ READ8_MEMBER(dynax_state::funkyfig_dsw_r)
if (!BIT(m_dsw_sel, 0)) return ioport("DSW1")->read();
if (!BIT(m_dsw_sel, 1)) return ioport("DSW2")->read();
if (!BIT(m_dsw_sel, 2)) return ioport("DSW3")->read();
- logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
+ logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", space.device().safe_pc(), m_dsw_sel);
return 0xff;
}
@@ -2249,7 +2249,7 @@ READ8_MEMBER(dynax_state::funkyfig_coin_r)
case 0x22: return ioport("IN2")->read();
case 0x23: return m_funkyfig_lockout;
}
- logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -2260,7 +2260,7 @@ READ8_MEMBER(dynax_state::funkyfig_key_r)
case 0x20: return ioport("IN0")->read();
case 0x21: return ioport("IN1")->read();
}
- logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -2273,13 +2273,13 @@ WRITE8_MEMBER(dynax_state::funkyfig_lockout_w)
coin_counter_w(machine(), 0, data & 0x01);
coin_lockout_w(machine(), 0, (~data) & 0x02);
if (data & ~0x03)
- logerror("%06x: warning, unknown bits written, lockout = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: warning, unknown bits written, lockout = %02x\n", space.device().safe_pc(), data);
break;
// case 0xef: 16 bytes on startup
default:
- logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", cpu_get_pc(&space.device()), m_input_sel, data);
+ logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", space.device().safe_pc(), m_input_sel, data);
}
}
@@ -2391,7 +2391,7 @@ READ8_MEMBER(dynax_state::hanakanz_gfxrom_r)
if (address >= size)
{
- logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", cpu_get_pc(&space.device()), address);
+ logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", space.device().safe_pc(), address);
address %= size;
}
@@ -2422,7 +2422,7 @@ WRITE8_MEMBER(dynax_state::hanakanz_coincounter_w)
coin_counter_w(machine(), 1, data & 2);
if (data & 0xf0)
- logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: warning, coin counter = %02x\n", space.device().safe_pc(), data);
#ifdef MAME_DEBUG
// popmessage("93 = %02x", data);
@@ -2620,7 +2620,7 @@ WRITE8_MEMBER(dynax_state::mjchuuka_coincounter_w)
coin_lockout_w(machine(), 0, (~data) & 0x08);
if (data & 0x74)
- logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: warning, coin counter = %02x\n", space.device().safe_pc(), data);
#ifdef MAME_DEBUG
// popmessage("40 = %02x",data);
@@ -2678,7 +2678,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(dynax_state::mjmyster_rambank_w)
{
membank("bank2")->set_entry(data & 0x07);
- //logerror("%04x: rambank = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: rambank = %02x\n", space.device().safe_pc(), data);
}
WRITE8_MEMBER(dynax_state::mjmyster_select2_w)
@@ -2699,7 +2699,7 @@ READ8_MEMBER(dynax_state::mjmyster_coins_r)
case 0x03: return 0xff;
}
- logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -2713,7 +2713,7 @@ READ8_MEMBER(dynax_state::mjmyster_keyb_r)
else if (BIT(m_keyb, 2)) ret = ioport("KEY2")->read();
else if (BIT(m_keyb, 3)) ret = ioport("KEY3")->read();
else if (BIT(m_keyb, 4)) ret = ioport("KEY4")->read();
- else logerror("%06x: warning, unknown bits read, keyb = %02x\n", cpu_get_pc(&space.device()), m_keyb);
+ else logerror("%06x: warning, unknown bits read, keyb = %02x\n", space.device().safe_pc(), m_keyb);
m_keyb <<= 1;
@@ -2727,7 +2727,7 @@ READ8_MEMBER(dynax_state::mjmyster_dsw_r)
if (!BIT(m_dsw_sel, 2)) return ioport("DSW2")->read();
if (!BIT(m_dsw_sel, 3)) return ioport("DSW1")->read();
if (!BIT(m_dsw_sel, 4)) return ioport("DSW5")->read();
- logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
+ logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", space.device().safe_pc(), m_dsw_sel);
return 0xff;
}
@@ -2745,7 +2745,7 @@ WRITE8_MEMBER(dynax_state::mjmyster_coincounter_w)
break;
default:
- logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", cpu_get_pc(&space.device()), m_input_sel, data);
+ logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", space.device().safe_pc(), m_input_sel, data);
}
}
@@ -2841,7 +2841,7 @@ READ8_MEMBER(dynax_state::hginga_coins_r)
case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
case 0x23: return m_coins;
}
- logerror("%04x: coins_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%04x: coins_r with select = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -2870,7 +2870,7 @@ WRITE8_MEMBER(dynax_state::hginga_coins_w)
m_coins = data;
break;
default:
- logerror("%04x: coins_w with select = %02x, data = %02x\n", cpu_get_pc(&space.device()), m_input_sel, data);
+ logerror("%04x: coins_w with select = %02x, data = %02x\n", space.device().safe_pc(), m_input_sel, data);
}
}
@@ -2892,7 +2892,7 @@ READ8_MEMBER(dynax_state::hginga_input_r)
case 0xa2:
return ioport(keynames1[m_keyb++])->read();
}
- logerror("%04x: input_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%04x: input_r with select = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -2985,7 +2985,7 @@ READ8_MEMBER(dynax_state::hgokou_input_r)
case 0x22: return hgokou_player_r(&space, 0);
case 0x23: return m_coins;
}
- logerror("%06x: warning, unknown bits read, dsw_sel = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
+ logerror("%06x: warning, unknown bits read, dsw_sel = %02x\n", space.device().safe_pc(), m_dsw_sel);
return 0xff;
}
@@ -3012,7 +3012,7 @@ WRITE8_MEMBER(dynax_state::hgokou_input_w)
case 0x2f: break; // ? written with 2f (hgokou)
default:
- logerror("%04x: input_w with select = %02x, data = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel, data);
+ logerror("%04x: input_w with select = %02x, data = %02x\n", space.device().safe_pc(), m_dsw_sel, data);
}
}
@@ -3088,7 +3088,7 @@ READ8_MEMBER(dynax_state::hgokbang_input_r)
m_input_sel |= 1;
return ret;
}
- logerror("%06x: warning, unknown bits read, dsw_sel = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
+ logerror("%06x: warning, unknown bits read, dsw_sel = %02x\n", space.device().safe_pc(), m_dsw_sel);
return 0xff;
}
@@ -3148,7 +3148,7 @@ READ8_MEMBER(dynax_state::hparadis_input_r)
case 0x80: return ioport(keynames0[m_keyb++])->read(); // P1 (Keys)
case 0x81: return ioport(keynames1[m_keyb++])->read(); // P2 (Keys)
}
- logerror("%06x: warning, unknown bits read, input_sel = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%06x: warning, unknown bits read, input_sel = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -3169,7 +3169,7 @@ WRITE8_MEMBER(dynax_state::hparadis_coin_w)
case 0x0c: coin_counter_w(machine(), 0, data & 1); break;
case 0x0d: break;
default:
- logerror("%04x: coins_w with select = %02x, data = %02x\n",cpu_get_pc(&space.device()), m_input_sel, data);
+ logerror("%04x: coins_w with select = %02x, data = %02x\n",space.device().safe_pc(), m_input_sel, data);
}
}
@@ -3220,7 +3220,7 @@ READ8_MEMBER(dynax_state::mjmywrld_coins_r)
case 0x83: return 0x00;
}
- logerror("%06x: warning, unknown bits read, input_sel = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%06x: warning, unknown bits read, input_sel = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -3400,7 +3400,7 @@ WRITE8_MEMBER(dynax_state::mjflove_coincounter_w)
if (data & 0xfe)
{
- logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: warning, coin counter = %02x\n", space.device().safe_pc(), data);
// popmessage("COIN = %02x", data);
}
}
@@ -3517,7 +3517,7 @@ WRITE8_MEMBER(dynax_state::sryudens_coincounter_w)
m_hopper = data & 0x04;
if (data & 0x68)
- logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: warning, coin counter = %02x\n", space.device().safe_pc(), data);
#ifdef MAME_DEBUG
// popmessage("COIN = %02x", data);
@@ -3527,7 +3527,7 @@ WRITE8_MEMBER(dynax_state::sryudens_coincounter_w)
WRITE8_MEMBER(dynax_state::sryudens_rambank_w)
{
membank("bank2")->set_entry(data & 0x0f);
- //logerror("%04x: rambank = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: rambank = %02x\n", space.device().safe_pc(), data);
}
static ADDRESS_MAP_START( sryudens_portmap, AS_IO, 8, dynax_state )
@@ -3577,7 +3577,7 @@ WRITE8_MEMBER(dynax_state::janshinp_coincounter_w)
coin_counter_w(machine(), 1, data & 2);
if (data & ~0x8b)
- logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: warning, coin counter = %02x\n", space.device().safe_pc(), data);
#ifdef MAME_DEBUG
// popmessage("COIN = %02x", data);
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index b9962856168..5810402d9cc 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -223,7 +223,7 @@ WRITE8_MEMBER(ddragon_state::toffy_bankswitch_w)
READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
{
- // logerror("BankRead %05x %08x\n",cpu_get_pc(&space.device()),offset);
+ // logerror("BankRead %05x %08x\n",space.device().safe_pc(),offset);
/* Horrible hack - the alternate TStrike set is mismatched against the MCU,
so just hack around the protection here. (The hacks are 'right' as I have
@@ -232,9 +232,9 @@ READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
if (!strcmp(machine().system().name, "tstrike"))
{
/* Static protection checks at boot-up */
- if (cpu_get_pc(&space.device()) == 0x9ace)
+ if (space.device().safe_pc() == 0x9ace)
return 0;
- if (cpu_get_pc(&space.device()) == 0x9ae4)
+ if (space.device().safe_pc() == 0x9ae4)
return 0x63;
/* Just return whatever the code is expecting */
@@ -251,7 +251,7 @@ READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
WRITE8_MEMBER(ddragon_state::darktowr_mcu_bank_w)
{
- logerror("BankWrite %05x %08x %08x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("BankWrite %05x %08x %08x\n", space.device().safe_pc(), offset, data);
if (offset == 0x1400 || offset == 0)
{
@@ -355,14 +355,14 @@ CUSTOM_INPUT_MEMBER(ddragon_state::sub_cpu_busy)
WRITE8_MEMBER(ddragon_state::darktowr_mcu_w)
{
- logerror("McuWrite %05x %08x %08x\n",cpu_get_pc(&space.device()), offset, data);
+ logerror("McuWrite %05x %08x %08x\n",space.device().safe_pc(), offset, data);
m_darktowr_mcu_ports[offset] = data;
}
READ8_MEMBER(ddragon_state::ddragon_hd63701_internal_registers_r)
{
- logerror("%04x: read %d\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: read %d\n", space.device().safe_pc(), offset);
return 0;
}
@@ -396,7 +396,7 @@ READ8_MEMBER(ddragon_state::ddragon_spriteram_r)
{
/* Double Dragon crash fix - see notes above */
- if (offset == 0x49 && cpu_get_pc(&space.device()) == 0x6261 && m_spriteram[offset] == 0x1f)
+ if (offset == 0x49 && space.device().safe_pc() == 0x6261 && m_spriteram[offset] == 0x1f)
return 0x1;
return m_spriteram[offset];
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index 5ba070d8e74..8839608dd3b 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -196,7 +196,7 @@ WRITE16_MEMBER(ddragon3_state::ddragon3_io_w)
break;
default:
- logerror("OUTPUT 1400[%02x] %08x, pc=%06x \n", offset, (unsigned)data, cpu_get_pc(&space.device()) );
+ logerror("OUTPUT 1400[%02x] %08x, pc=%06x \n", offset, (unsigned)data, space.device().safe_pc() );
break;
}
}
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index a89a68368ee..f9bf5bf45b7 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -200,7 +200,7 @@ WRITE16_MEMBER(dec0_state::dec0_control_w)
break;
case 0xa: /* Mix Psel(?). */
- logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+(offset<<1));
+ logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+(offset<<1));
break;
case 0xc: /* Cblk - coin blockout. Seems to be unused by the games */
@@ -208,11 +208,11 @@ WRITE16_MEMBER(dec0_state::dec0_control_w)
case 0xe: /* Reset Intel 8751? - not sure, all the games write here at startup */
dec0_i8751_reset(machine());
- logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+(offset<<1));
+ logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+(offset<<1));
break;
default:
- logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+(offset<<1));
+ logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+(offset<<1));
break;
}
}
@@ -238,7 +238,7 @@ WRITE16_MEMBER(dec0_automat_state::automat_control_w)
break;
case 0xa: /* Mix Psel(?). */
- logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+(offset<<1));
+ logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+(offset<<1));
break;
case 0xc: /* Cblk - coin blockout. Seems to be unused by the games */
@@ -246,7 +246,7 @@ WRITE16_MEMBER(dec0_automat_state::automat_control_w)
#endif
default:
- logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+(offset<<1));
+ logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+(offset<<1));
break;
}
}
@@ -358,7 +358,7 @@ READ16_MEMBER(dec0_state::slyspy_protection_r)
case 6: return 0x2;
}
- logerror("%04x, Unknown protection read at 30c000 %d\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x, Unknown protection read at 30c000 %d\n", space.device().safe_pc(), offset);
return 0;
}
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 54e8f304422..78ee8a39e36 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -314,7 +314,7 @@ READ32_MEMBER(deco32_state::deco32_irq_controller_r)
// return 0xffffff80 | vblank | (0x40); //test for lock load guns
}
- logerror("%08x: Unmapped IRQ read %08x (%08x)\n",cpu_get_pc(&space.device()),offset,mem_mask);
+ logerror("%08x: Unmapped IRQ read %08x (%08x)\n",space.device().safe_pc(),offset,mem_mask);
return 0xffffffff;
}
@@ -324,7 +324,7 @@ WRITE32_MEMBER(deco32_state::deco32_irq_controller_w)
switch (offset) {
case 0: /* IRQ enable - probably an irq mask, but only values used are 0xc8 and 0xca */
-// logerror("%08x: IRQ write %d %08x\n",cpu_get_pc(&space.device()),offset,data);
+// logerror("%08x: IRQ write %d %08x\n",space.device().safe_pc(),offset,data);
m_raster_enable=(data&0xff)==0xc8; /* 0xca seems to be off */
break;
@@ -364,7 +364,7 @@ READ32_MEMBER(deco32_state::captaven_prot_r)
case 0xed4: return ioport("IN2")->read(); /* Misc */
}
- logerror("%08x: Unmapped protection read %04x\n",cpu_get_pc(&space.device()),offset<<2);
+ logerror("%08x: Unmapped protection read %04x\n",space.device().safe_pc(),offset<<2);
return 0xffffffff;
}
@@ -405,13 +405,13 @@ WRITE32_MEMBER(deco32_state::fghthist_eeprom_w)
READ32_MEMBER(deco32_state::dragngun_service_r)
{
-// logerror("%08x:Read service\n",cpu_get_pc(&space.device()));
+// logerror("%08x:Read service\n",space.device().safe_pc());
return ioport("IN2")->read();
}
READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
{
-//logerror("%08x:Read gun %d\n",cpu_get_pc(&space.device()),offset);
+//logerror("%08x:Read gun %d\n",space.device().safe_pc(),offset);
//return ((machine().rand()%0xffff)<<16) | machine().rand()%0xffff;
if (offset) /* Mirror of player 1 and player 2 fire buttons */
return ioport("IN4")->read() | ((machine().rand()%0xff)<<16);
@@ -420,7 +420,7 @@ READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
READ32_MEMBER(deco32_state::dragngun_prot_r)
{
-// logerror("%08x:Read prot %08x (%08x)\n",cpu_get_pc(&space.device()),offset<<1,mem_mask);
+// logerror("%08x:Read prot %08x (%08x)\n",space.device().safe_pc(),offset<<1,mem_mask);
if (!m_strobe) m_strobe=8;
else m_strobe=0;
@@ -487,7 +487,7 @@ READ32_MEMBER(deco32_state::tattass_prot_r)
case 0x35a: return m_tattass_eprom_bit << 16;
}
- logerror("%08x:Read prot %08x (%08x)\n",cpu_get_pc(&space.device()),offset<<1,mem_mask);
+ logerror("%08x:Read prot %08x (%08x)\n",space.device().safe_pc(),offset<<1,mem_mask);
return 0xffffffff;
}
@@ -645,7 +645,7 @@ READ32_MEMBER(deco32_state::nslasher_prot_r)
case 0x35a: return (machine().device<eeprom_device>("eeprom")->read_bit()<< 16) | 0xffff; // Debug switch in low word??
}
- //logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(&space.device()),offset<<1,mem_mask);
+ //logerror("%08x: Read unmapped prot %08x (%08x)\n",space.device().safe_pc(),offset<<1,mem_mask);
return 0xffffffff;
}
@@ -666,7 +666,7 @@ WRITE32_MEMBER(deco32_state::nslasher_eeprom_w)
WRITE32_MEMBER(deco32_state::nslasher_prot_w)
{
- //logerror("%08x:write prot %08x (%08x) %08x\n",cpu_get_pc(&space.device()),offset<<1,mem_mask,data);
+ //logerror("%08x:write prot %08x (%08x) %08x\n",space.device().safe_pc(),offset<<1,mem_mask,data);
/* Only sound port of chip is used - no protection */
if (offset==0x700/4) {
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index 5df09cc8d63..1c24609e568 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -111,7 +111,7 @@ READ32_MEMBER(deco_mlc_state::test2_r)
{
// if (offset==0)
// return ioport("IN0")->read(); //0xffffffff;
-// logerror("%08x: Test2_r %d\n",cpu_get_pc(&space.device()),offset);
+// logerror("%08x: Test2_r %d\n",space.device().safe_pc(),offset);
return machine().rand(); //0xffffffff;
}
@@ -123,7 +123,7 @@ READ32_MEMBER(deco_mlc_state::test3_r)
*/
//if (offset==0)
// return machine().rand()|(machine().rand()<<16);
-// logerror("%08x: Test3_r %d\n",cpu_get_pc(&space.device()),offset);
+// logerror("%08x: Test3_r %d\n",space.device().safe_pc(),offset);
return 0xffffffff;
}
@@ -156,7 +156,7 @@ WRITE32_MEMBER(deco_mlc_state::avengrs_palette_w)
READ32_MEMBER(deco_mlc_state::decomlc_vbl_r)
{
m_vbl_i ^=0xffffffff;
-//logerror("vbl r %08x\n", cpu_get_pc(&space.device()));
+//logerror("vbl r %08x\n", space.device().safe_pc());
// Todo: Vblank probably in $10
return m_vbl_i;
}
@@ -241,7 +241,7 @@ READ32_MEMBER(deco_mlc_state::stadhr96_prot_146_r)
*/
offset<<=1;
- logerror("%08x: Read prot %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%08x: Read prot %04x\n", space.device().safe_pc(), offset);
if (offset==0x5c4)
return 0xaa55 << 16;
@@ -722,7 +722,7 @@ static void descramble_sound( running_machine &machine )
READ32_MEMBER(deco_mlc_state::avengrgs_speedup_r)
{
UINT32 a=m_mlc_ram[0x89a0/4];
- UINT32 p=cpu_get_pc(&space.device());
+ UINT32 p=space.device().safe_pc();
if ((p==0x3234 || p==0x32dc) && (a&1)) device_spin_until_interrupt(&space.device());
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index 263284bd579..b7bec7dd04e 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -375,17 +375,17 @@ WRITE32_MEMBER(djmain_state::light_ctrl_2_w)
WRITE32_MEMBER(djmain_state::unknown590000_w)
{
- //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", cpu_get_previouspc(&space.device()), offset, data, mem_mask);
+ //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", space.device().safe_pcbase(), offset, data, mem_mask);
}
WRITE32_MEMBER(djmain_state::unknown802000_w)
{
- //logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", cpu_get_previouspc(&space.device()), offset, data, mem_mask);
+ //logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", space.device().safe_pcbase(), offset, data, mem_mask);
}
WRITE32_MEMBER(djmain_state::unknownc02000_w)
{
- //logerror("%08X: unknown c02000 write %08X: %08X & %08X\n", cpu_get_previouspc(&space.device()), offset, data, mem_mask);
+ //logerror("%08X: unknown c02000 write %08X: %08X & %08X\n", space.device().safe_pcbase(), offset, data, mem_mask);
}
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index e79a63f24aa..f78eaa60227 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -642,7 +642,7 @@ READ8_MEMBER(dkong_state::epos_decrypt_rom)
WRITE8_MEMBER(dkong_state::s2650_data_w)
{
#if DEBUG_PROTECTION
- logerror("write : pc = %04x, loopback = %02x\n",cpu_get_pc(&space.device()), data);
+ logerror("write : pc = %04x, loopback = %02x\n",space.device().safe_pc(), data);
#endif
m_hunchloopback = data;
@@ -651,7 +651,7 @@ WRITE8_MEMBER(dkong_state::s2650_data_w)
WRITE8_MEMBER(dkong_state::s2650_fo_w)
{
#if DEBUG_PROTECTION
- logerror("write : pc = %04x, FO = %02x\n",cpu_get_pc(&space.device()), data);
+ logerror("write : pc = %04x, FO = %02x\n",space.device().safe_pc(), data);
#endif
m_main_fo = data;
@@ -663,7 +663,7 @@ WRITE8_MEMBER(dkong_state::s2650_fo_w)
READ8_MEMBER(dkong_state::s2650_port0_r)
{
#if DEBUG_PROTECTION
- logerror("port 0 : pc = %04x, loopback = %02x fo=%d\n",cpu_get_pc(&space.device()), m_hunchloopback, m_main_fo);
+ logerror("port 0 : pc = %04x, loopback = %02x fo=%d\n",space.device().safe_pc(), m_hunchloopback, m_main_fo);
#endif
switch (m_protect_type)
@@ -680,7 +680,7 @@ READ8_MEMBER(dkong_state::s2650_port0_r)
else
return m_hunchloopback--;
}
- fatalerror("Unhandled read from port 0 : pc = %4x\n",cpu_get_pc(&space.device()));
+ fatalerror("Unhandled read from port 0 : pc = %4x\n",space.device().safe_pc());
}
@@ -688,7 +688,7 @@ READ8_MEMBER(dkong_state::s2650_port1_r)
{
#if DEBUG_PROTECTION
- logerror("port 1 : pc = %04x, loopback = %02x fo=%d\n",cpu_get_pc(&space.device()), m_hunchloopback, m_main_fo);
+ logerror("port 1 : pc = %04x, loopback = %02x fo=%d\n",space.device().safe_pc(), m_hunchloopback, m_main_fo);
#endif
switch (m_protect_type)
@@ -702,7 +702,7 @@ READ8_MEMBER(dkong_state::s2650_port1_r)
else
return ++m_prot_cnt;
}
- fatalerror("Unhandled read from port 1 : pc = %4x\n",cpu_get_pc(&space.device()));
+ fatalerror("Unhandled read from port 1 : pc = %4x\n",space.device().safe_pc());
}
diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c
index 40b81e5ec89..70cd1c9844f 100644
--- a/src/mame/drivers/dorachan.c
+++ b/src/mame/drivers/dorachan.c
@@ -46,14 +46,14 @@ CUSTOM_INPUT_MEMBER(dorachan_state::dorachan_protection_r)
{
UINT8 ret = 0;
- switch (cpu_get_previouspc(m_main_cpu))
+ switch (m_main_cpu->safe_pcbase())
{
case 0x70ce: ret = 0xf2; break;
case 0x72a2: ret = 0xd5; break;
case 0x72b5: ret = 0xcb; break;
default:
- mame_printf_debug("unhandled $2400 read @ %x\n", cpu_get_previouspc(m_main_cpu));
+ mame_printf_debug("unhandled $2400 read @ %x\n", m_main_cpu->safe_pcbase());
break;
}
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index ea698f113aa..1611f749252 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -269,7 +269,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_clear_y_w)
WRITE8_MEMBER(dunhuang_state::dunhuang_horiz_clear_w)
{
int i;
-// logerror("%06x: horiz clear, y = %02x, data = %02d\n", cpu_get_pc(&space.device()), m_clear_y,data);
+// logerror("%06x: horiz clear, y = %02x, data = %02d\n", space.device().safe_pc(), m_clear_y,data);
for (i = 0; i < 0x40; i++)
{
int addr = m_clear_y * 0x40 + i;
@@ -285,7 +285,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_horiz_clear_w)
WRITE8_MEMBER(dunhuang_state::dunhuang_vert_clear_w)
{
int i;
-// logerror("%06x: vert clear, x = %02x, y = %02x, data = %02x\n", cpu_get_pc(&space.device()), m_pos_x,m_pos_y,data);
+// logerror("%06x: vert clear, x = %02x, y = %02x, data = %02x\n", space.device().safe_pc(), m_pos_x,m_pos_y,data);
for (i = 0; i < 0x08; i++)
{
int addr = (m_pos_x & 0x3f) + (i & 0x07) * 0x40;
@@ -343,7 +343,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_block_h_w)
int i,j, addr;
UINT8 *tile_addr;
-// logerror("%06x: block dst %x, src %x, xy %x %x, wh %x %x, clr %x\n", cpu_get_pc(&space.device()), m_block_dest, (m_block_addr_hi << 8) + m_block_addr_lo, m_block_x,m_block_y,m_block_w+1,m_block_h+1,m_block_c);
+// logerror("%06x: block dst %x, src %x, xy %x %x, wh %x %x, clr %x\n", space.device().safe_pc(), m_block_dest, (m_block_addr_hi << 8) + m_block_addr_lo, m_block_x,m_block_y,m_block_w+1,m_block_h+1,m_block_c);
m_block_h = data;
@@ -382,7 +382,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_block_h_w)
break;
default:
- popmessage("%06x: block dst=%x", cpu_get_pc(&space.device()), m_block_dest);
+ popmessage("%06x: block dst=%x", space.device().safe_pc(), m_block_dest);
}
}
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index e8ab1a90db9..35bf58ed207 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -279,7 +279,7 @@ WRITE8_MEMBER(dynax_state::hnoridur_rombank_w)
{
int bank_n = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x8000;
- //logerror("%04x: rom bank = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: rom bank = %02x\n", space.device().safe_pc(), data);
if (data < bank_n)
membank("bank1")->set_entry(data);
else
@@ -751,7 +751,7 @@ WRITE8_MEMBER(dynax_state::yarunara_rombank_w)
{
int bank_n = (machine().root_device().memregion("maincpu")->bytes() - 0x10000) / 0x8000;
- //logerror("%04x: rom bank = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: rom bank = %02x\n", space.device().safe_pc(), data);
if (data < bank_n)
membank("bank1")->set_entry(data);
else
@@ -779,7 +779,7 @@ WRITE8_MEMBER(dynax_state::yarunara_blit_romregion_w)
case 0x81: dynax_blit_romregion_w(space, 0, 3); return;
case 0x82: dynax_blit_romregion_w(space, 0, 4); return; // mjcomv1
}
- logerror("%04x: unmapped romregion=%02X\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: unmapped romregion=%02X\n", space.device().safe_pc(), data);
}
static ADDRESS_MAP_START( yarunara_io_map, AS_IO, 8, dynax_state )
@@ -1152,7 +1152,7 @@ WRITE8_MEMBER(dynax_state::htengoku_coin_w)
case 0xff: break; // CRT controller?
default:
- logerror("%04x: coins_w with select = %02x, data = %02x\n", cpu_get_pc(&space.device()), m_input_sel, data);
+ logerror("%04x: coins_w with select = %02x, data = %02x\n", space.device().safe_pc(), m_input_sel, data);
}
}
@@ -1167,7 +1167,7 @@ READ8_MEMBER(dynax_state::htengoku_input_r)
case 0x82: return ioport(keynames0[m_keyb++])->read();
case 0x0d: return 0xff; // unused
}
- logerror("%04x: input_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%04x: input_r with select = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -1181,7 +1181,7 @@ READ8_MEMBER(dynax_state::htengoku_coin_r)
case 0x02: return 0xbf | ((m_hopper && !(machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6)); // bit 7 = blitter busy, bit 6 = hopper
case 0x03: return m_coins;
}
- logerror("%04x: coin_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
+ logerror("%04x: coin_r with select = %02x\n", space.device().safe_pc(), m_input_sel);
return 0xff;
}
@@ -1200,7 +1200,7 @@ WRITE8_MEMBER(dynax_state::htengoku_blit_romregion_w)
case 0x81: dynax_blit_romregion_w(space, 0, 1); return;
case 0x00: dynax_blit_romregion_w(space, 0, 2); return;
}
- logerror("%04x: unmapped romregion=%02X\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: unmapped romregion=%02X\n", space.device().safe_pc(), data);
}
static ADDRESS_MAP_START( htengoku_io_map, AS_IO, 8, dynax_state )
@@ -1273,7 +1273,7 @@ WRITE8_MEMBER(dynax_state::tenkai_ip_w)
break;
return;
}
- logerror("%04x: unmapped ip_sel=%02x written with %02x\n", cpu_get_pc(&space.device()), m_input_sel, data);
+ logerror("%04x: unmapped ip_sel=%02x written with %02x\n", space.device().safe_pc(), m_input_sel, data);
}
READ8_MEMBER(dynax_state::tenkai_ip_r)
@@ -1291,7 +1291,7 @@ READ8_MEMBER(dynax_state::tenkai_ip_r)
return ioport("COINS")->read(); // coins
default:
- logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(&space.device()), m_input_sel, offset);
+ logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", space.device().safe_pc(), m_input_sel, offset);
return 0xff;
}
}
@@ -1306,17 +1306,17 @@ READ8_MEMBER(dynax_state::tenkai_ip_r)
// player 2
case 0x81:
if (m_keyb >= 5)
- logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(&space.device()), m_keyb);
+ logerror("%04x: unmapped keyb=%02x read\n", space.device().safe_pc(), m_keyb);
return 0xff;//ioport(keynames1[m_keyb++])->read();
// player 1
case 0x82:
if (m_keyb >= 5)
- logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(&space.device()), m_keyb);
+ logerror("%04x: unmapped keyb=%02x read\n", space.device().safe_pc(), m_keyb);
return ioport(keynames0[m_keyb++])->read();
default:
- logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(&space.device()), m_input_sel, offset);
+ logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", space.device().safe_pc(), m_input_sel, offset);
return 0xff;
}
}
@@ -1432,7 +1432,7 @@ READ8_MEMBER(dynax_state::tenkai_8000_r)
else if (m_rombank == 0x12)
return tenkai_palette_r(space, offset);
- logerror("%04x: unmapped offset %04X read with rombank=%02X\n", cpu_get_pc(&space.device()), offset, m_rombank);
+ logerror("%04x: unmapped offset %04X read with rombank=%02X\n", space.device().safe_pc(), offset, m_rombank);
return 0x00;
}
@@ -1452,7 +1452,7 @@ WRITE8_MEMBER(dynax_state::tenkai_8000_w)
return;
}
- logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n", cpu_get_pc(&space.device()), offset, data, m_rombank);
+ logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n", space.device().safe_pc(), offset, data, m_rombank);
}
static void tenkai_show_6c( running_machine &machine )
@@ -1481,7 +1481,7 @@ WRITE8_MEMBER(dynax_state::tenkai_blit_romregion_w)
case 0x83: dynax_blit_romregion_w(space, 0, 1); return;
case 0x80: dynax_blit_romregion_w(space, 0, 2); return;
}
- logerror("%04x: unmapped romregion=%02X\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: unmapped romregion=%02X\n", space.device().safe_pc(), data);
}
static ADDRESS_MAP_START( tenkai_map, AS_PROGRAM, 8, dynax_state )
@@ -1591,7 +1591,7 @@ READ8_MEMBER(dynax_state::gekisha_8000_r)
case 0x8067: return ioport("DSW2")->read();
}
- logerror("%04x: unmapped offset %04X read with rombank=%02X\n",cpu_get_pc(&space.device()), offset, m_rombank);
+ logerror("%04x: unmapped offset %04X read with rombank=%02X\n",space.device().safe_pc(), offset, m_rombank);
return 0x00;
}
@@ -1647,7 +1647,7 @@ WRITE8_MEMBER(dynax_state::gekisha_8000_w)
// break;
}
}
- logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n", cpu_get_pc(&space.device()), offset, data, m_rombank);
+ logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n", space.device().safe_pc(), offset, data, m_rombank);
}
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index c411033f120..b924b2f43d8 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -359,7 +359,7 @@ READ8_MEMBER(enigma2_state::dip_switch_r)
{
UINT8 ret = 0x00;
- if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, cpu_get_pc(&space.device()), m_protection_data);
+ if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, space.device().safe_pc(), m_protection_data);
switch (offset)
{
case 0x01:
@@ -372,7 +372,7 @@ READ8_MEMBER(enigma2_state::dip_switch_r)
break;
case 0x02:
- if (cpu_get_pc(&space.device()) == 0x07e5)
+ if (space.device().safe_pc() == 0x07e5)
ret = 0xaa;
else
ret = 0xf4;
diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c
index a7c16800649..4f5c23fefa6 100644
--- a/src/mame/drivers/eolithsp.c
+++ b/src/mame/drivers/eolithsp.c
@@ -21,12 +21,12 @@ static int eolith_scanline = 0;
void eolith_speedup_read(address_space *space)
{
/* for debug */
- //if ((cpu_get_pc(&space->device())!=eolith_speedup_address) && (eolith_vblank!=1) )
+ //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 = cpu_get_pc(&space->device());
+ int pc = space->device().safe_pc();
if ((pc==eolith_speedup_address) || (pc==eolith_speedup_address2))
{
@@ -117,7 +117,7 @@ CUSTOM_INPUT_MEMBER(eolith_state::eolith_speedup_getvblank)
// StealSee doesn't use interrupts, just the vblank
CUSTOM_INPUT_MEMBER(eolith_state::stealsee_speedup_getvblank)
{
- int pc = cpu_get_pc(m_maincpu);
+ int pc = m_maincpu->safe_pc();
if (pc==0x400081ec)
if(!eolith_vblank)
diff --git a/src/mame/drivers/epos.c b/src/mame/drivers/epos.c
index 452996432a4..5db961b8d33 100644
--- a/src/mame/drivers/epos.c
+++ b/src/mame/drivers/epos.c
@@ -42,7 +42,7 @@ WRITE8_MEMBER(epos_state::dealer_decrypt_rom)
else
m_counter = (m_counter - 1) & 0x03;
-// logerror("PC %08x: ctr=%04x\n",cpu_get_pc(&space.device()), m_counter);
+// logerror("PC %08x: ctr=%04x\n",space.device().safe_pc(), m_counter);
membank("bank1")->set_entry(m_counter);
diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c
index 7711f94b931..0c5a1dcfa77 100644
--- a/src/mame/drivers/esd16.c
+++ b/src/mame/drivers/esd16.c
@@ -107,7 +107,7 @@ READ16_MEMBER(esd16_state::esd_eeprom_r)
return ((m_eeprom->read_bit() & 0x01) << 15);
}
-// logerror("(0x%06x) unk EEPROM read: %04x\n", cpu_get_pc(&space.device()), mem_mask);
+// logerror("(0x%06x) unk EEPROM read: %04x\n", space.device().safe_pc(), mem_mask);
return 0;
}
@@ -116,7 +116,7 @@ WRITE16_MEMBER(esd16_state::esd_eeprom_w)
if (ACCESSING_BITS_8_15)
ioport("EEPROMOUT")->write(data, 0xffff);
-// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(&space.device()), data, mem_mask);
+// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", space.device().safe_pc(), data, mem_mask);
}
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index 07bf6b13983..893315be497 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -553,7 +553,7 @@ WRITE8_MEMBER(esripsys_state::tms5220_w)
/* Not used in later revisions */
WRITE8_MEMBER(esripsys_state::control_w)
{
- logerror("Sound control write: %.2x (PC:0x%.4x)\n", data, cpu_get_previouspc(&space.device()));
+ logerror("Sound control write: %.2x (PC:0x%.4x)\n", data, space.device().safe_pcbase());
}
diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c
index 44fff4bc403..7873185fba7 100644
--- a/src/mame/drivers/exerion.c
+++ b/src/mame/drivers/exerion.c
@@ -172,7 +172,7 @@ WRITE8_MEMBER(exerion_state::exerion_portb_w)
READ8_MEMBER(exerion_state::exerion_protection_r)
{
- if (cpu_get_pc(&space.device()) == 0x4143)
+ if (space.device().safe_pc() == 0x4143)
return memregion("maincpu")->base()[0x33c0 + (m_main_ram[0xd] << 2) + offset];
else
return m_main_ram[0x8 + offset];
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index e34cdc67f64..97128910c90 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -64,7 +64,7 @@ WRITE8_MEMBER(fantland_state::fantland_nmi_enable_w)
m_nmi_enable = data;
if ((m_nmi_enable != 0) && (m_nmi_enable != 8))
- logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", space.device().safe_pc(), data);
}
WRITE16_MEMBER(fantland_state::fantland_nmi_enable_16_w)
@@ -169,7 +169,7 @@ WRITE8_MEMBER(fantland_state::borntofi_nmi_enable_w)
// data & 0x31 changes when lightgun fires
if ((m_nmi_enable != 0) && (m_nmi_enable != 8))
- logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", space.device().safe_pc(), data);
// popmessage("%02X", data);
}
@@ -345,7 +345,7 @@ WRITE8_MEMBER(fantland_state::borntofi_msm5205_w)
{
case 0x00: borntofi_adpcm_stop(msm, voice); break;
case 0x03: borntofi_adpcm_start(msm, voice); break;
- default: logerror("CPU #0 PC = %04X: adpcm reg %d <- %02x\n", cpu_get_pc(&space.device()), reg, data);
+ default: logerror("CPU #0 PC = %04X: adpcm reg %d <- %02x\n", space.device().safe_pc(), reg, data);
}
}
else
diff --git a/src/mame/drivers/fastfred.c b/src/mame/drivers/fastfred.c
index 4b92d2be87e..178d99480f8 100644
--- a/src/mame/drivers/fastfred.c
+++ b/src/mame/drivers/fastfred.c
@@ -21,7 +21,7 @@
// to change if a different ROM set ever surfaces.
READ8_MEMBER(fastfred_state::fastfred_custom_io_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x03c0: return 0x9d;
case 0x03e6: return 0x9f;
@@ -47,14 +47,14 @@ READ8_MEMBER(fastfred_state::fastfred_custom_io_r)
case 0x7b58: return 0x20;
}
- logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, cpu_get_pc(&space.device()));
+ logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, space.device().safe_pc());
return 0x00;
}
READ8_MEMBER(fastfred_state::flyboy_custom1_io_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x049d: return 0xad; /* compare */
case 0x04b9: /* compare with 0x9e ??? When ??? */
@@ -75,14 +75,14 @@ READ8_MEMBER(fastfred_state::flyboy_custom1_io_r)
return 0x00;
}
- logerror("Uncaught custom I/O read %04X at %04X\n", 0xc085+offset, cpu_get_pc(&space.device()));
+ logerror("Uncaught custom I/O read %04X at %04X\n", 0xc085+offset, space.device().safe_pc());
return 0x00;
}
READ8_MEMBER(fastfred_state::flyboy_custom2_io_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0395: return 0xf7; /* $C900 compare */
case 0x03f5: /* $c8fd */
@@ -100,7 +100,7 @@ READ8_MEMBER(fastfred_state::flyboy_custom2_io_r)
return 0x00;
}
- logerror("Uncaught custom I/O read %04X at %04X\n", 0xc8fb+offset, cpu_get_pc(&space.device()));
+ logerror("Uncaught custom I/O read %04X at %04X\n", 0xc8fb+offset, space.device().safe_pc());
return 0x00;
}
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index ad1588caf72..5c90dbbd221 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -194,7 +194,7 @@ READ8_MEMBER(firetrap_state::firetrap_8751_bootleg_r)
UINT8 coin = 0;
UINT8 port = ioport("IN2")->read() & 0x70;
- if (cpu_get_pc(&space.device()) == 0x1188)
+ if (space.device().safe_pc() == 0x1188)
return ~m_coin_command_pending;
if (port != 0x70)
@@ -214,7 +214,7 @@ READ8_MEMBER(firetrap_state::firetrap_8751_bootleg_r)
READ8_MEMBER(firetrap_state::firetrap_8751_r)
{
- //logerror("PC:%04x read from 8751\n",cpu_get_pc(&space.device()));
+ //logerror("PC:%04x read from 8751\n",space.device().safe_pc());
return m_i8751_return;
}
@@ -293,7 +293,7 @@ WRITE8_MEMBER(firetrap_state::firetrap_8751_w)
else
{
m_i8751_return = 0xff;
- logerror("%04x: Unknown i8751 command %02x!\n",cpu_get_pc(&space.device()),data);
+ logerror("%04x: Unknown i8751 command %02x!\n",space.device().safe_pc(),data);
}
/* Signal main cpu task is complete */
diff --git a/src/mame/drivers/fitfight.c b/src/mame/drivers/fitfight.c
index cc462806e33..d194a502d4d 100644
--- a/src/mame/drivers/fitfight.c
+++ b/src/mame/drivers/fitfight.c
@@ -220,35 +220,35 @@ ADDRESS_MAP_END
READ8_MEMBER(fitfight_state::snd_porta_r)
{
- //mame_printf_debug("PA R @%x\n",cpu_get_pc(&space.device()));
+ //mame_printf_debug("PA R @%x\n",space.device().safe_pc());
return machine().rand();
}
READ8_MEMBER(fitfight_state::snd_portb_r)
{
- //mame_printf_debug("PB R @%x\n",cpu_get_pc(&space.device()));
+ //mame_printf_debug("PB R @%x\n",space.device().safe_pc());
return machine().rand();
}
READ8_MEMBER(fitfight_state::snd_portc_r)
{
- //mame_printf_debug("PC R @%x\n",cpu_get_pc(&space.device()));
+ //mame_printf_debug("PC R @%x\n",space.device().safe_pc());
return machine().rand();
}
WRITE8_MEMBER(fitfight_state::snd_porta_w)
{
- //mame_printf_debug("PA W %x @%x\n",data,cpu_get_pc(&space.device()));
+ //mame_printf_debug("PA W %x @%x\n",data,space.device().safe_pc());
}
WRITE8_MEMBER(fitfight_state::snd_portb_w)
{
- //mame_printf_debug("PB W %x @%x\n",data,cpu_get_pc(&space.device()));
+ //mame_printf_debug("PB W %x @%x\n",data,space.device().safe_pc());
}
WRITE8_MEMBER(fitfight_state::snd_portc_w)
{
- //mame_printf_debug("PC W %x @%x\n",data,cpu_get_pc(&space.device()));
+ //mame_printf_debug("PC W %x @%x\n",data,space.device().safe_pc());
}
static ADDRESS_MAP_START( snd_io, AS_IO, 8, fitfight_state )
diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c
index 3f591ac1f01..de45053e994 100644
--- a/src/mame/drivers/flstory.c
+++ b/src/mame/drivers/flstory.c
@@ -154,7 +154,7 @@ ADDRESS_MAP_END
READ8_MEMBER(flstory_state::rumba_mcu_r)
{
- //printf("PC=%04x R %02x\n",cpu_get_pc(&space.device()),m_mcu_cmd);
+ //printf("PC=%04x R %02x\n",space.device().safe_pc(),m_mcu_cmd);
if((m_mcu_cmd & 0xf0) == 0x00) // end packet cmd, value returned is meaningless (probably used for main <-> mcu comms syncronization)
return 0;
@@ -197,7 +197,7 @@ READ8_MEMBER(flstory_state::rumba_mcu_r)
return 0;
}
//case 0x42: return 0x06;
- //default: printf("PC=%04x R %02x\n",cpu_get_pc(&space.device()),m_mcu_cmd); break;
+ //default: printf("PC=%04x R %02x\n",space.device().safe_pc(),m_mcu_cmd); break;
}
return 0;
@@ -265,7 +265,7 @@ WRITE8_MEMBER(flstory_state::rumba_mcu_w)
*/
m_mcu_bb_res = data;
- //printf("PC=%04x W %02x -> %02x\n",cpu_get_pc(&space.device()),m_mcu_cmd,data);
+ //printf("PC=%04x W %02x -> %02x\n",space.device().safe_pc(),m_mcu_cmd,data);
break;
}
case 0xb4: // when the bird touches the top / bottom / left / right of the screen, for correct repositioning
diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c
index 0656e86e165..c1f71e4464b 100644
--- a/src/mame/drivers/fromanc2.c
+++ b/src/mame/drivers/fromanc2.c
@@ -63,7 +63,7 @@ READ16_MEMBER(fromanc2_state::fromanc2_keymatrix_r)
case 0x04: ret = ioport("KEY2")->read(); break;
case 0x08: ret = ioport("KEY3")->read(); break;
default: ret = 0xffff;
- logerror("PC:%08X unknown %02X\n", cpu_get_pc(&space.device()), m_portselect);
+ logerror("PC:%08X unknown %02X\n", space.device().safe_pc(), m_portselect);
break;
}
diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c
index 80ddfa7bfe3..58de68a833c 100644
--- a/src/mame/drivers/fuukifg2.c
+++ b/src/mame/drivers/fuukifg2.c
@@ -117,7 +117,7 @@ WRITE8_MEMBER(fuuki16_state::fuuki16_sound_rombank_w)
if (data <= 2)
membank("bank1")->set_entry(data);
else
- logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", space.device().safe_pc(), data);
}
WRITE8_MEMBER(fuuki16_state::fuuki16_oki_banking_w)
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index 1fccb82f4da..9c35818cdae 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -273,7 +273,7 @@ WRITE32_MEMBER(gaelco3d_state::irq_ack32_w)
else if (ACCESSING_BITS_0_7)
gaelco_serial_tr_w(machine().device("serial"), 0, data & 0x01);
else
- logerror("%06X:irq_ack_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:irq_ack_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
@@ -313,11 +313,11 @@ READ32_MEMBER(gaelco3d_state::eeprom_data32_r)
{
UINT8 data = gaelco_serial_data_r(machine().device("serial"),0);
if (LOG)
- logerror("%06X:read(%02X) = %08X & %08X\n", cpu_get_pc(machine().device("maincpu")), offset, data, mem_mask);
+ logerror("%06X:read(%02X) = %08X & %08X\n", machine().device("maincpu")->safe_pc(), offset, data, mem_mask);
return data | 0xffffff00;
}
else
- logerror("%06X:read(%02X) = mask %08X\n", cpu_get_pc(machine().device("maincpu")), offset, mem_mask);
+ logerror("%06X:read(%02X) = mask %08X\n", machine().device("maincpu")->safe_pc(), offset, mem_mask);
return 0xffffffff;
}
@@ -378,7 +378,7 @@ static TIMER_CALLBACK( delayed_sound_w )
WRITE16_MEMBER(gaelco3d_state::sound_data_w)
{
if (LOG)
- logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
if (ACCESSING_BITS_0_7)
machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
@@ -396,7 +396,7 @@ READ16_MEMBER(gaelco3d_state::sound_data_r)
READ16_MEMBER(gaelco3d_state::sound_status_r)
{
if (LOG)
- logerror("%06X:sound_status_r(%02X) = %02X\n", cpu_get_pc(&space.device()), offset, m_sound_status);
+ logerror("%06X:sound_status_r(%02X) = %02X\n", space.device().safe_pc(), offset, m_sound_status);
if (ACCESSING_BITS_0_7)
return m_sound_status;
return 0xffff;
@@ -441,7 +441,7 @@ WRITE16_MEMBER(gaelco3d_state::analog_port_clock_w)
else
{
if (LOG)
- logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
}
@@ -462,7 +462,7 @@ WRITE16_MEMBER(gaelco3d_state::analog_port_latch_w)
else
{
if (LOG)
- logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
}
@@ -477,7 +477,7 @@ WRITE16_MEMBER(gaelco3d_state::analog_port_latch_w)
READ32_MEMBER(gaelco3d_state::tms_m68k_ram_r)
{
-// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", cpu_get_pc(&space.device()), offset, !(offset & 1) ? ((INT32)m_m68k_ram_base[offset/2] >> 16) : (int)(INT16)m_m68k_ram_base[offset/2]);
+// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", space.device().safe_pc(), offset, !(offset & 1) ? ((INT32)m_m68k_ram_base[offset/2] >> 16) : (int)(INT16)m_m68k_ram_base[offset/2]);
return (INT32)(INT16)m_m68k_ram_base[offset ^ m_tms_offset_xor];
}
@@ -508,7 +508,7 @@ WRITE16_MEMBER(gaelco3d_state::tms_reset_w)
/* this is set to 0 while data is uploaded, then set to $ffff after it is done */
/* it does not ever appear to be touched after that */
if (LOG)
- logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
cputag_set_input_line(machine(), "tms", INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -518,7 +518,7 @@ WRITE16_MEMBER(gaelco3d_state::tms_irq_w)
/* this is written twice, 0,1, in quick succession */
/* done after uploading, and after modifying the comm area */
if (LOG)
- logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
if (ACCESSING_BITS_0_7)
cputag_set_input_line(machine(), "tms", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -527,7 +527,7 @@ WRITE16_MEMBER(gaelco3d_state::tms_irq_w)
WRITE16_MEMBER(gaelco3d_state::tms_control3_w)
{
if (LOG)
- logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
@@ -535,7 +535,7 @@ WRITE16_MEMBER(gaelco3d_state::tms_comm_w)
{
COMBINE_DATA(&m_tms_comm_base[offset ^ m_tms_offset_xor]);
if (LOG)
- logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
+ logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset*2, data, mem_mask);
}
@@ -739,27 +739,27 @@ WRITE32_MEMBER(gaelco3d_state::radikalb_lamp_w)
{
/* arbitrary data written */
if (ACCESSING_BITS_0_7)
- logerror("%06X:unknown_127_w = %02X\n", cpu_get_pc(&space.device()), data & 0xff);
+ logerror("%06X:unknown_127_w = %02X\n", space.device().safe_pc(), data & 0xff);
else
- logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
WRITE32_MEMBER(gaelco3d_state::unknown_137_w)
{
/* only written $00 or $ff */
if (ACCESSING_BITS_0_7)
- logerror("%06X:unknown_137_w = %02X\n", cpu_get_pc(&space.device()), data & 0xff);
+ logerror("%06X:unknown_137_w = %02X\n", space.device().safe_pc(), data & 0xff);
else
- logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
WRITE32_MEMBER(gaelco3d_state::unknown_13a_w)
{
/* only written $0000 or $0001 */
if (ACCESSING_BITS_0_15)
- logerror("%06X:unknown_13a_w = %04X\n", cpu_get_pc(&space.device()), data & 0xffff);
+ logerror("%06X:unknown_13a_w = %04X\n", space.device().safe_pc(), data & 0xffff);
else
- logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
}
diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c
index 91803a9b164..a7f7400c0c8 100644
--- a/src/mame/drivers/gaiden.c
+++ b/src/mame/drivers/gaiden.c
@@ -176,7 +176,7 @@ WRITE16_MEMBER(gaiden_state::wildfang_protection_w)
data >>= 8;
-// logerror("PC %06x: prot = %02x\n",cpu_get_pc(&space.device()),data);
+// logerror("PC %06x: prot = %02x\n",space.device().safe_pc(),data);
switch (data & 0xf0)
{
@@ -214,7 +214,7 @@ WRITE16_MEMBER(gaiden_state::wildfang_protection_w)
READ16_MEMBER(gaiden_state::wildfang_protection_r)
{
-// logerror("PC %06x: read prot %02x\n", cpu_get_pc(&space.device()), m_prot);
+// logerror("PC %06x: read prot %02x\n", space.device().safe_pc(), m_prot);
return m_prot;
}
@@ -337,7 +337,7 @@ WRITE16_MEMBER(gaiden_state::raiga_protection_w)
{
data >>= 8;
-// logerror("PC %06x: prot = %02x\n", cpu_get_pc(&space.device()), data);
+// logerror("PC %06x: prot = %02x\n", space.device().safe_pc(), data);
switch (data & 0xf0)
{
@@ -383,7 +383,7 @@ WRITE16_MEMBER(gaiden_state::raiga_protection_w)
READ16_MEMBER(gaiden_state::raiga_protection_r)
{
-// logerror("PC %06x: read prot %02x\n", cpu_get_pc(&space.device()), m_prot);
+// logerror("PC %06x: read prot %02x\n", space.device().safe_pc(), m_prot);
return m_prot;
}
diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c
index d2c4e1f9f62..c98ffcdb5c8 100644
--- a/src/mame/drivers/galastrm.c
+++ b/src/mame/drivers/galastrm.c
@@ -140,7 +140,7 @@ popmessage(t);
coin_counter_w(machine(), 1, data & 0x04000000);
m_coin_word = (data >> 16) &0xffff;
}
-//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(&device()),offset);
+//logerror("CPU #0 PC %06x: write input %06x\n",device->safe_pc(),offset);
}
}
}
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index d3c750330b1..fcc9e2040f8 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -1244,7 +1244,7 @@ READ8_MEMBER(galaxian_state::jumpbug_protection_r)
case 0x0235: return 0x02;
case 0x0311: return 0xff; /* not checked */
}
- logerror("Unknown protection read. Offset: %04X PC=%04X\n",0xb000+offset,cpu_get_pc(&space.device()));
+ logerror("Unknown protection read. Offset: %04X PC=%04X\n",0xb000+offset,space.device().safe_pc());
return 0xff;
}
@@ -1271,7 +1271,7 @@ static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen )
READ8_MEMBER(galaxian_state::checkmaj_protection_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0f15: return 0xf5;
case 0x0f8f: return 0x7c;
@@ -1280,7 +1280,7 @@ READ8_MEMBER(galaxian_state::checkmaj_protection_r)
case 0x10f1: return 0xaa;
case 0x1402: return 0xaa;
default:
- logerror("Unknown protection read. PC=%04X\n",cpu_get_pc(&space.device()));
+ logerror("Unknown protection read. PC=%04X\n",space.device().safe_pc());
}
return 0;
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index cc3b3cb650b..8943bbdf453 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -397,7 +397,7 @@ Stephh's notes (based on the games Z80 code and some tests) for other games :
/* Send sound data to the sound cpu and cause an nmi */
READ8_MEMBER(galaxold_state::drivfrcg_port0_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x002e:
case 0x0297:
@@ -895,7 +895,7 @@ ADDRESS_MAP_END
READ8_MEMBER(galaxold_state::hexpoola_data_port_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0022:
return 0;
@@ -916,7 +916,7 @@ ADDRESS_MAP_END
READ8_MEMBER(galaxold_state::bullsdrtg_data_port_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0083:
case 0x008c:
@@ -928,7 +928,7 @@ READ8_MEMBER(galaxold_state::bullsdrtg_data_port_r)
case 0x6b58:
return 1;
default:
- logerror("Reading data port at PC=%04X\n", cpu_get_pc(&space.device()));
+ logerror("Reading data port at PC=%04X\n", space.device().safe_pc());
break;
}
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index d49daf9a254..312dec26c8c 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -206,7 +206,7 @@ WRITE8_MEMBER(gaplus_state::gaplus_freset_w)
device_t *io56xx = machine().device("56xx");
int bit = !BIT(offset, 11);
- logerror("%04x: freset %d\n",cpu_get_pc(&space.device()), bit);
+ logerror("%04x: freset %d\n",space.device().safe_pc(), bit);
namcoio_set_reset_line(io58xx, bit ? CLEAR_LINE : ASSERT_LINE);
namcoio_set_reset_line(io56xx, bit ? CLEAR_LINE : ASSERT_LINE);
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index 004eb5128b8..94c0b02276f 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -56,7 +56,7 @@ WRITE8_MEMBER(gbusters_state::gbusters_1f98_w)
/* other bits unused/unknown */
if (data & 0xfe)
{
- //logerror("%04x: (1f98) write %02x\n",cpu_get_pc(&space.device()), data);
+ //logerror("%04x: (1f98) write %02x\n",space.device().safe_pc(), data);
//popmessage("$1f98 = %02x", data);
}
}
@@ -84,13 +84,13 @@ WRITE8_MEMBER(gbusters_state::gbusters_coin_counter_w)
sprintf(baf, "ccnt = %02x", data);
popmessage(baf);
#endif
- logerror("%04x: (ccount) write %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: (ccount) write %02x\n", space.device().safe_pc(), data);
}
}
WRITE8_MEMBER(gbusters_state::gbusters_unknown_w)
{
- logerror("%04x: write %02x to 0x1f9c\n",cpu_get_pc(&space.device()), data);
+ logerror("%04x: write %02x to 0x1f9c\n",space.device().safe_pc(), data);
{
char baf[40];
@@ -430,7 +430,7 @@ static KONAMI_SETLINES_CALLBACK( gbusters_banking )
if (lines & 0xf0)
{
- //logerror("%04x: (lines) write %02x\n",cpu_get_pc(device), lines);
+ //logerror("%04x: (lines) write %02x\n",device->safe_pc(), lines);
//popmessage("lines = %02x", lines);
}
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index c6dd77fcb8f..827bdf5bcec 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -101,7 +101,7 @@ READ16_MEMBER(gcpinbal_state::ioc_r)
}
-//logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(&space.device()),offset);
+//logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",space.device().safe_pc(),offset);
return m_ioc_ram[offset];
}
@@ -192,7 +192,7 @@ WRITE16_MEMBER(gcpinbal_state::ioc_w)
break;
default:
- logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n", space.device().safe_pc(), offset, data);
break;
}
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index 0f15d12109c..82a8449fe5d 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -260,7 +260,7 @@ WRITE8_MEMBER(gei_state::nmi_w)
READ8_MEMBER(gei_state::catchall)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (pc != 0x3c74 && pc != 0x0364 && pc != 0x036d) /* weed out spurious blit reads */
logerror("%04x: unmapped memory read from %04x\n",pc,offset);
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index 6356bf4e8af..893860e71ab 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -559,7 +559,7 @@ READ32_MEMBER(ghosteo_state::bballoon_speedup_r)
UINT32 ret = s3c2410_lcd_r(s3c2410, offset+0x10/4, mem_mask);
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
// these are vblank waits
if (pc == 0x3001c0e4 || pc == 0x3001c0d8)
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index 7bad1e29383..04eca081df1 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -995,7 +995,7 @@ DRIVER_INIT_MEMBER(gladiatr_state,gladiatr)
READ8_MEMBER(gladiatr_state::f6a3_r)
{
- if(cpu_get_previouspc(&space.device())==0x8e)
+ if(space.device().safe_pcbase()==0x8e)
m_nvram[0x6a3]=1;
return m_nvram[0x6a3];
diff --git a/src/mame/drivers/glass.c b/src/mame/drivers/glass.c
index 216b56f56f6..9b7e9dd5f3c 100644
--- a/src/mame/drivers/glass.c
+++ b/src/mame/drivers/glass.c
@@ -320,7 +320,7 @@ static void glass_ROM16_split_gfx( running_machine &machine, const char *src_reg
READ16_MEMBER( glass_state::glass_mainram_r )
{
UINT16 ret = m_mainram[offset];
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (offset == (0xfede96 - 0xfec000)>>1)
{
@@ -353,7 +353,7 @@ READ16_MEMBER( glass_state::glass_mainram_r )
WRITE16_MEMBER( glass_state::glass_mainram_w )
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
COMBINE_DATA(&m_mainram[offset]);
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index 786e25a983c..9ba47506ad4 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -40,7 +40,7 @@ READ16_MEMBER(goal92_state::goal92_inputs_r)
return ioport("DSW2")->read();
default:
- logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,cpu_get_pc(&space.device()));
+ logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,space.device().safe_pc());
}
return 0;
diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c
index b51d7b3e9a2..e00dd633d6d 100644
--- a/src/mame/drivers/goindol.c
+++ b/src/mame/drivers/goindol.c
@@ -52,7 +52,7 @@ READ8_MEMBER(goindol_state::prot_f422_r)
WRITE8_MEMBER(goindol_state::prot_fc44_w)
{
- logerror("%04x: prot_fc44_w(%02x)\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: prot_fc44_w(%02x)\n", space.device().safe_pc(), data);
m_ram[0x0419] = 0x5b;
m_ram[0x041a] = 0x3f;
m_ram[0x041b] = 0x6d;
@@ -61,21 +61,21 @@ WRITE8_MEMBER(goindol_state::prot_fc44_w)
WRITE8_MEMBER(goindol_state::prot_fd99_w)
{
- logerror("%04x: prot_fd99_w(%02x)\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: prot_fd99_w(%02x)\n", space.device().safe_pc(), data);
m_ram[0x0421] = 0x3f;
}
WRITE8_MEMBER(goindol_state::prot_fc66_w)
{
- logerror("%04x: prot_fc66_w(%02x)\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: prot_fc66_w(%02x)\n", space.device().safe_pc(), data);
m_ram[0x0423] = 0x06;
}
WRITE8_MEMBER(goindol_state::prot_fcb0_w)
{
- logerror("%04x: prot_fcb0_w(%02x)\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x: prot_fcb0_w(%02x)\n", space.device().safe_pc(), data);
m_ram[0x0425] = 0x06;
}
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index cb06b2786d7..0a59befd99c 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -41,7 +41,7 @@ WRITE16_MEMBER(gradius3_state::k052109_halfword_w)
/* is this a bug in the game or something else? */
if (!ACCESSING_BITS_0_7)
k052109_w(m_k052109, offset, (data >> 8) & 0xff);
-// logerror("%06x half %04x = %04x\n",cpu_get_pc(&space.device()),offset,data);
+// logerror("%06x half %04x = %04x\n",space.device().safe_pc(),offset,data);
}
READ16_MEMBER(gradius3_state::k051937_halfword_r)
@@ -88,7 +88,7 @@ WRITE16_MEMBER(gradius3_state::cpuA_ctrl_w)
m_irqAen = data & 0x20;
/* other bits unknown */
- //logerror("%06x: write %04x to c0000\n",cpu_get_pc(&space.device()),data);
+ //logerror("%06x: write %04x to c0000\n",space.device().safe_pc(),data);
}
}
@@ -124,11 +124,11 @@ WRITE16_MEMBER(gradius3_state::cpuB_irqtrigger_w)
if (m_irqBmask & 4)
{
- logerror("%04x trigger cpu B irq 4 %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("%04x trigger cpu B irq 4 %02x\n",space.device().safe_pc(),data);
device_set_input_line(m_subcpu, 4, HOLD_LINE);
}
else
- logerror("%04x MISSED cpu B irq 4 %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("%04x MISSED cpu B irq 4 %02x\n",space.device().safe_pc(),data);
}
WRITE16_MEMBER(gradius3_state::sound_command_w)
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 152548a3984..b7a65203284 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -197,7 +197,7 @@ static READ8_HANDLER( gsword_8741_2_r )
case 0x04: /* Player 2 Controller */
return space->machine().root_device().ioport("IN3")->read();
// default:
-// logerror("8741-2 unknown read %d PC=%04x\n",offset,cpu_get_pc(&space->device()));
+// logerror("8741-2 unknown read %d PC=%04x\n",offset,space->device().safe_pc());
}
/* unknown */
return 0;
@@ -215,7 +215,7 @@ static READ8_HANDLER( gsword_8741_3_r )
return space->machine().root_device().ioport("IN3")->read();
}
/* unknown */
-// logerror("8741-3 unknown read %d PC=%04x\n",offset,cpu_get_pc(&space->device()));
+// logerror("8741-3 unknown read %d PC=%04x\n",offset,space->device().safe_pc());
return 0;
}
diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c
index cd80a05699d..9845d958bb8 100644
--- a/src/mame/drivers/gunbustr.c
+++ b/src/mame/drivers/gunbustr.c
@@ -117,7 +117,7 @@ WRITE32_MEMBER(gunbustr_state::gunbustr_input_w)
coin_counter_w(machine(), 1, data & 0x04000000);
m_coin_word = (data >> 16) &0xffff;
}
- //logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(&device()),offset);
+ //logerror("CPU #0 PC %06x: write input %06x\n",device->safe_pc(),offset);
break;
}
}
@@ -434,7 +434,7 @@ ROM_END
READ32_MEMBER(gunbustr_state::main_cycle_r)
{
- if (cpu_get_pc(&space.device())==0x55a && (m_ram[0x3acc/4]&0xff000000)==0)
+ if (space.device().safe_pc()==0x55a && (m_ram[0x3acc/4]&0xff000000)==0)
device_spin_until_interrupt(&space.device());
return m_ram[0x3acc/4];
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index 1b24775543a..7e55bb91ce3 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -1019,7 +1019,7 @@ WRITE8_MEMBER(halleys_state::bgtile_w)
READ8_MEMBER(halleys_state::blitter_status_r)
{
- if (m_game_id==GAME_HALLEYS && cpu_get_pc(&space.device())==0x8017) return(0x55); // HACK: trick SRAM test on startup
+ if (m_game_id==GAME_HALLEYS && space.device().safe_pc()==0x8017) return(0x55); // HACK: trick SRAM test on startup
return(0);
}
@@ -1090,7 +1090,7 @@ READ8_MEMBER(halleys_state::collision_id_r)
UPDATE: re-implemented pixel collision to accompany the hack method.
*/
- if (m_game_id==GAME_HALLEYS && cpu_get_pc(&space.device())==m_collision_detection) // HACK: collision detection bypass
+ if (m_game_id==GAME_HALLEYS && space.device().safe_pc()==m_collision_detection) // HACK: collision detection bypass
{
if (m_collision_count) { m_collision_count--; return(m_collision_list[m_collision_count]); }
diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c
index 9fd32815146..66ef278d351 100644
--- a/src/mame/drivers/hexion.c
+++ b/src/mame/drivers/hexion.c
@@ -89,7 +89,7 @@ Notes:
WRITE8_MEMBER(hexion_state::coincntr_w)
{
-//logerror("%04x: coincntr_w %02x\n",cpu_get_pc(&space.device()),data);
+//logerror("%04x: coincntr_w %02x\n",space.device().safe_pc(),data);
/* bits 0/1 = coin counters */
coin_counter_w(machine(), 0,data & 0x01);
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index 353cbecec6b..d3daa8fc254 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -216,10 +216,10 @@ READ8_MEMBER(hitpoker_state::hitpoker_pic_r)
if(offset == 0)
{
- if(cpu_get_pc(&space.device()) == 0x3143 ||
- cpu_get_pc(&space.device()) == 0x314e ||
- cpu_get_pc(&space.device()) == 0x3164 ||
- cpu_get_pc(&space.device()) == 0x3179)
+ if(space.device().safe_pc() == 0x3143 ||
+ space.device().safe_pc() == 0x314e ||
+ space.device().safe_pc() == 0x3164 ||
+ space.device().safe_pc() == 0x3179)
return m_pic_data;
return (m_pic_data & 0x7f) | (m_pic_data & 0x40 ? 0x80 : 0x00);
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 518b9836ecf..9e6656274d3 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -476,21 +476,21 @@ READ32_MEMBER(hng64_state::hng64_random_read)
READ32_MEMBER(hng64_state::hng64_com_r)
{
- logerror("com read (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(&space.device()), (offset*4)+0xc0000000, mem_mask, m_com_ram[offset]);
+ logerror("com read (PC=%08x): %08x %08x = %08x\n", space.device().safe_pc(), (offset*4)+0xc0000000, mem_mask, m_com_ram[offset]);
return m_com_ram[offset];
}
WRITE32_MEMBER(hng64_state::hng64_com_w)
{
- logerror("com write (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(&space.device()), (offset*4)+0xc0000000, mem_mask, data);
+ logerror("com write (PC=%08x): %08x %08x = %08x\n", space.device().safe_pc(), (offset*4)+0xc0000000, mem_mask, data);
COMBINE_DATA(&m_com_ram[offset]);
}
WRITE32_MEMBER(hng64_state::hng64_com_share_w)
{
- logerror("commw (PC=%08x): %08x %08x %08x\n", cpu_get_pc(&space.device()), data, (offset*4)+0xc0001000, mem_mask);
+ logerror("commw (PC=%08x): %08x %08x %08x\n", space.device().safe_pc(), data, (offset*4)+0xc0001000, mem_mask);
if (offset == 0x0) COMBINE_DATA(&m_com_shared_a);
if (offset == 0x1) COMBINE_DATA(&m_com_shared_b);
@@ -498,7 +498,7 @@ WRITE32_MEMBER(hng64_state::hng64_com_share_w)
READ32_MEMBER(hng64_state::hng64_com_share_r)
{
- logerror("commr (PC=%08x): %08x %08x\n", cpu_get_pc(&space.device()), (offset*4)+0xc0001000, mem_mask);
+ logerror("commr (PC=%08x): %08x %08x\n", space.device().safe_pc(), (offset*4)+0xc0001000, mem_mask);
//if(offset == 0x0) return m_com_shared_a;
//if(offset == 0x1) return m_com_shared_b;
@@ -529,7 +529,7 @@ READ32_MEMBER(hng64_state::hng64_sysregs_r)
#if 0
if((offset*4) != 0x1084)
- printf("HNG64 port read (PC=%08x) 0x%08x\n", cpu_get_pc(&space.device()), offset*4);
+ printf("HNG64 port read (PC=%08x) 0x%08x\n", space.device().safe_pc(), offset*4);
#endif
rtc_addr = offset >> 1;
@@ -605,14 +605,14 @@ WRITE32_MEMBER(hng64_state::hng64_sysregs_w)
#if 0
if(((offset*4) & 0xff00) == 0x1100)
- printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], cpu_get_pc(&space.device()));
+ printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], space.device().safe_pc());
#endif
switch(offset*4)
{
case 0x1084: //MIPS->MCU latch port
m_mcu_en = (data & 0xff); //command-based, i.e. doesn't control halt line and such?
- //printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], cpu_get_pc(&space.device()));
+ //printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], space.device().safe_pc());
break;
//0x110c global irq mask?
/* irq ack */
@@ -624,7 +624,7 @@ WRITE32_MEMBER(hng64_state::hng64_sysregs_w)
hng64_do_dma(&space);
break;
//default:
- // printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], cpu_get_pc(&space.device()));
+ // printf("HNG64 writing to SYSTEM Registers 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, m_sysregs[offset], space.device().safe_pc());
}
}
@@ -751,7 +751,7 @@ READ32_MEMBER(hng64_state::racing_io_r)
READ32_MEMBER(hng64_state::hng64_dualport_r)
{
- //printf("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(&space.device()));
+ //printf("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], space.device().safe_pc());
/*
command table:
@@ -789,7 +789,7 @@ Beast Busters 2 outputs (all at offset == 0x1c):
WRITE32_MEMBER(hng64_state::hng64_dualport_w)
{
- //printf("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(&space.device()));
+ //printf("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], space.device().safe_pc());
COMBINE_DATA (&m_dualport[offset]);
}
@@ -862,8 +862,8 @@ WRITE32_MEMBER(hng64_state::dl_w)
#if 0
READ32_MEMBER(hng64_state::dl_r)
{
- //mame_printf_debug("dl R (%08x) : %x %x\n", cpu_get_pc(&space.device()), offset, hng64_dl[offset]);
- //usrintf_showmessage("dl R (%08x) : %x %x", cpu_get_pc(&space.device()), offset, hng64_dl[offset]);
+ //mame_printf_debug("dl R (%08x) : %x %x\n", space.device().safe_pc(), offset, hng64_dl[offset]);
+ //usrintf_showmessage("dl R (%08x) : %x %x", space.device().safe_pc(), offset, hng64_dl[offset]);
return hng64_dl[offset];
}
#endif
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index c2ef47f023b..f9889ce5958 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -309,7 +309,7 @@ WRITE8_MEMBER(homedata_state::mrokumei_sound_io_w)
m_dac->write_signed8(data);
break;
default:
- logerror("%04x: I/O write to port %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: I/O write to port %04x\n", space.device().safe_pc(), offset);
break;
}
}
@@ -352,7 +352,7 @@ WRITE8_MEMBER(homedata_state::reikaids_upd7807_portc_w)
1 \ ROM bank
0 /
*/
-// logerror("%04x: port C wr %02x (STATUS %d DATA %d)\n", cpu_get_pc(&space.device()), data, BIT(data, 2), BIT(data, 6));
+// logerror("%04x: port C wr %02x (STATUS %d DATA %d)\n", space.device().safe_pc(), data, BIT(data, 2), BIT(data, 6));
membank("bank2")->set_entry(data & 0x03);
@@ -379,21 +379,21 @@ READ8_MEMBER(homedata_state::reikaids_io_r)
m_vblank = 0;
- //logerror("%04x: io_r %02x\n", cpu_get_pc(&space.device()), res);
+ //logerror("%04x: io_r %02x\n", space.device().safe_pc(), res);
return res;
}
READ8_MEMBER(homedata_state::reikaids_snd_command_r)
{
- //logerror("%04x: sndmcd_r (%02x)\n", cpu_get_pc(&space.device()), m_snd_command);
+ //logerror("%04x: sndmcd_r (%02x)\n", space.device().safe_pc(), m_snd_command);
return m_snd_command;
}
WRITE8_MEMBER(homedata_state::reikaids_snd_command_w)
{
m_snd_command = data;
- //logerror("%04x: coprocessor_command_w %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: coprocessor_command_w %02x\n", space.device().safe_pc(), data);
}
@@ -407,13 +407,13 @@ WRITE8_MEMBER(homedata_state::reikaids_snd_command_w)
WRITE8_MEMBER(homedata_state::pteacher_snd_command_w)
{
- //logerror("%04x: snd_command_w %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%04x: snd_command_w %02x\n", space.device().safe_pc(), data);
m_from_cpu = data;
}
READ8_MEMBER(homedata_state::pteacher_snd_r)
{
- //logerror("%04x: pteacher_snd_r %02x\n",cpu_get_pc(&space.device()),to_cpu);
+ //logerror("%04x: pteacher_snd_r %02x\n",space.device().safe_pc(),to_cpu);
return m_to_cpu;
}
@@ -439,7 +439,7 @@ READ8_MEMBER(homedata_state::pteacher_keyboard_r)
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
int dips = ioport("DSW")->read();
- // logerror("%04x: keyboard_r with port A = %02x\n",cpu_get_pc(&space.device()),upd7807_porta);
+ // logerror("%04x: keyboard_r with port A = %02x\n",space.device().safe_pc(),upd7807_porta);
if (m_upd7807_porta & 0x80)
{
@@ -462,7 +462,7 @@ READ8_MEMBER(homedata_state::pteacher_upd7807_porta_r)
if (!BIT(m_upd7807_portc, 6))
m_upd7807_porta = m_from_cpu;
else
- logerror("%04x: read PA with PC *not* clear\n", cpu_get_pc(&space.device()));
+ logerror("%04x: read PA with PC *not* clear\n", space.device().safe_pc());
return m_upd7807_porta;
}
@@ -470,7 +470,7 @@ READ8_MEMBER(homedata_state::pteacher_upd7807_porta_r)
WRITE8_MEMBER(homedata_state::pteacher_snd_answer_w)
{
m_to_cpu = data;
- //logerror("%04x: to_cpu = %02x\n", cpu_get_pc(&space.device()), m_to_cpu);
+ //logerror("%04x: to_cpu = %02x\n", space.device().safe_pc(), m_to_cpu);
}
WRITE8_MEMBER(homedata_state::pteacher_upd7807_porta_w)
@@ -491,7 +491,7 @@ WRITE8_MEMBER(homedata_state::pteacher_upd7807_portc_w)
0 input (coin)
*/
- // logerror("%04x: port C wr %02x\n", cpu_get_pc(&space.device()), data);
+ // logerror("%04x: port C wr %02x\n", space.device().safe_pc(), data);
membank("bank2")->set_entry((data & 0x0c) >> 2);
diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c
index df68f480425..0d835f857ff 100644
--- a/src/mame/drivers/hotblock.c
+++ b/src/mame/drivers/hotblock.c
@@ -93,8 +93,8 @@ READ8_MEMBER(hotblock_state::hotblock_port4_r)
WRITE8_MEMBER(hotblock_state::hotblock_port4_w)
{
-// mame_printf_debug("port4_w: pc = %06x : data %04x\n", cpu_get_pc(&space.device()), data);
-// popmessage("port4_w: pc = %06x : data %04x", cpu_get_pc(&space.device()), data);
+// mame_printf_debug("port4_w: pc = %06x : data %04x\n", space.device().safe_pc(), data);
+// popmessage("port4_w: pc = %06x : data %04x", space.device().safe_pc(), data);
m_port4 = data;
}
@@ -103,7 +103,7 @@ WRITE8_MEMBER(hotblock_state::hotblock_port4_w)
WRITE8_MEMBER(hotblock_state::hotblock_port0_w)
{
-// popmessage("port4_w: pc = %06x : data %04x", cpu_get_pc(&space.device()), data);
+// popmessage("port4_w: pc = %06x : data %04x", space.device().safe_pc(), data);
m_port0 = data;
}
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index 81d27dad36c..4cc4266bce2 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -296,7 +296,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
int shift = (dst_offs & 0x80) ? 0 : 8;
UINT16 mask = (dst_offs & 0x80) ? 0x00ff : 0xff00;
-// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n", cpu_get_pc(&space.device()), tmap, src_offs, dst_offs);
+// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n", space.device().safe_pc(), tmap, src_offs, dst_offs);
dst_offs >>= 7 + 1;
switch (tmap)
@@ -306,7 +306,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
case 3:
break;
default:
- logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n", cpu_get_pc(&space.device()), tmap);
+ logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n", space.device().safe_pc(), tmap);
return;
}
@@ -316,7 +316,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
src_offs %= src_len;
b1 = blt_read(src, src_offs);
-// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n", cpu_get_pc(&space.device()), b1, src_offs);
+// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n", space.device().safe_pc(), b1, src_offs);
src_offs++;
count = ((~b1) & 0x3f) + 1;
@@ -400,7 +400,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w)
default:
- logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n", cpu_get_pc(&space.device()), b1, src_offs - 1);
+ logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n", space.device().safe_pc(), b1, src_offs - 1);
return;
}
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index 34f754322ca..3412638eb70 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -376,7 +376,7 @@ WRITE8_MEMBER(igs009_state::jingbell_nmi_and_coins_w)
{
if ((m_nmi_enable ^ data) & (~0xdd))
{
- logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("PC %06X: nmi_and_coins = %02x\n",space.device().safe_pc(),data);
// popmessage("%02x",data);
}
@@ -432,7 +432,7 @@ WRITE8_MEMBER(igs009_state::jingbell_magic_w)
default:
// popmessage("magic %x <- %04x",m_igs_magic[0],data);
- logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[0], data);
+ logerror("%06x: warning, writing to igs_magic %02x = %02x\n", space.device().safe_pc(), m_igs_magic[0], data);
}
}
@@ -446,11 +446,11 @@ READ8_MEMBER(igs009_state::jingbell_magic_r)
if ( !(m_igs_magic[1] & 0x04) ) return ioport("DSW3")->read();
if ( !(m_igs_magic[1] & 0x08) ) return ioport("DSW4")->read();
if ( !(m_igs_magic[1] & 0x10) ) return ioport("DSW5")->read();
- logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[1]);
+ logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", space.device().safe_pc(), m_igs_magic[1]);
break;
default:
- logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[0]);
+ logerror("%06x: warning, reading with igs_magic = %02x\n", space.device().safe_pc(), m_igs_magic[0]);
}
return 0;
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index 52d62a25c8a..801b54bf46b 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -223,10 +223,10 @@ WRITE16_MEMBER(igs011_state::igs011_priority_w)
{
COMBINE_DATA(&m_priority);
-// logerror("%06x: priority = %02x\n", cpu_get_pc(&space.device()), m_priority);
+// logerror("%06x: priority = %02x\n", space.device().safe_pc(), m_priority);
if (data & ~0x7)
- logerror("%06x: warning, unknown bits written to priority = %02x\n", cpu_get_pc(&space.device()), m_priority);
+ logerror("%06x: warning, unknown bits written to priority = %02x\n", space.device().safe_pc(), m_priority);
}
@@ -445,7 +445,7 @@ WRITE16_MEMBER(igs011_state::igs011_blit_flags_w)
COMBINE_DATA(&blitter.flags);
#if LOG_BLITTER
- logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, gfx %03x%04x, depth %02x, pen %02x, flags %03x\n", cpu_get_pc(&space.device()),
+ logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, gfx %03x%04x, depth %02x, pen %02x, flags %03x\n", space.device().safe_pc(),
blitter.x,blitter.y,blitter.w,blitter.h,blitter.gfx_hi,blitter.gfx_lo,blitter.depth,blitter.pen,blitter.flags);
#endif
@@ -1374,7 +1374,7 @@ WRITE16_MEMBER(igs011_state::drgnwrld_igs003_w)
coin_counter_w(machine(), 0,data & 2);
if (data & ~0x2)
- logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: warning, unknown bits written in coin counter = %02x\n", space.device().safe_pc(), data);
break;
@@ -1387,7 +1387,7 @@ WRITE16_MEMBER(igs011_state::drgnwrld_igs003_w)
default:
// popmessage("igs003 %x <- %04x",m_igs003_reg[0],data);
- logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0], data);
+ logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_igs003_reg[0], data);
}
}
READ16_MEMBER(igs011_state::drgnwrld_igs003_r)
@@ -1421,7 +1421,7 @@ READ16_MEMBER(igs011_state::drgnwrld_igs003_r)
case 0x34: return 0x32;
default:
- logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
+ logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_igs003_reg[0]);
}
return 0;
@@ -1441,7 +1441,7 @@ WRITE16_MEMBER(igs011_state::lhb_inputs_w)
}
if ( m_igs_input_sel & (~0xff) )
- logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", cpu_get_pc(&space.device()), m_igs_input_sel);
+ logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", space.device().safe_pc(), m_igs_input_sel);
// popmessage("sel2 %02x",m_igs_input_sel&~0x1f);
}
@@ -1458,7 +1458,7 @@ READ16_MEMBER(igs011_state::lhb_inputs_r)
if (~m_igs_input_sel & 0x08) return ioport("KEY3")->read();
if (~m_igs_input_sel & 0x10) return ioport("KEY4")->read();
- logerror("%06x: warning, reading with igs_input_sel = %02x\n", cpu_get_pc(&space.device()), m_igs_input_sel);
+ logerror("%06x: warning, reading with igs_input_sel = %02x\n", space.device().safe_pc(), m_igs_input_sel);
break;
}
return 0;
@@ -1486,7 +1486,7 @@ WRITE16_MEMBER(igs011_state::lhb2_igs003_w)
}
if ( m_igs_input_sel & ~0x7f )
- logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", cpu_get_pc(&space.device()), m_igs_input_sel);
+ logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", space.device().safe_pc(), m_igs_input_sel);
// popmessage("sel2 %02x",m_igs_input_sel&~0x1f);
break;
@@ -1501,13 +1501,13 @@ WRITE16_MEMBER(igs011_state::lhb2_igs003_w)
}
if ( m_lhb2_pen_hi & ~0xf )
- logerror("%06x: warning, unknown bits written in lhb2_pen_hi = %02x\n", cpu_get_pc(&space.device()), m_lhb2_pen_hi);
+ logerror("%06x: warning, unknown bits written in lhb2_pen_hi = %02x\n", space.device().safe_pc(), m_lhb2_pen_hi);
// popmessage("oki %02x",m_lhb2_pen_hi & 0x08);
break;
default:
- logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0], data);
+ logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_igs003_reg[0], data);
}
}
READ16_MEMBER(igs011_state::lhb2_igs003_r)
@@ -1522,7 +1522,7 @@ READ16_MEMBER(igs011_state::lhb2_igs003_r)
if (~m_igs_input_sel & 0x10) return ioport("KEY4")->read();
/* fall through */
default:
- logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
+ logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_igs003_reg[0]);
break;
// case 0x03:
@@ -1581,13 +1581,13 @@ WRITE16_MEMBER(igs011_state::wlcc_igs003_w)
}
if (data & ~0x33)
- logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: warning, unknown bits written in coin counter = %02x\n", space.device().safe_pc(), data);
// popmessage("coin %02x",data);
break;
default:
- logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0], data);
+ logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_igs003_reg[0], data);
}
}
READ16_MEMBER(igs011_state::wlcc_igs003_r)
@@ -1619,7 +1619,7 @@ READ16_MEMBER(igs011_state::wlcc_igs003_r)
case 0x34: return 0x32;
default:
- logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
+ logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_igs003_reg[0]);
}
return 0;
@@ -1647,13 +1647,13 @@ WRITE16_MEMBER(igs011_state::xymg_igs003_w)
}
if ( m_igs_input_sel & 0x40 )
- logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", cpu_get_pc(&space.device()), m_igs_input_sel);
+ logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", space.device().safe_pc(), m_igs_input_sel);
// popmessage("sel2 %02x",m_igs_input_sel&~0x1f);
break;
default:
- logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0], data);
+ logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_igs003_reg[0], data);
}
}
READ16_MEMBER(igs011_state::xymg_igs003_r)
@@ -1693,7 +1693,7 @@ READ16_MEMBER(igs011_state::xymg_igs003_r)
case 0x34: return 0x32;
default:
- logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
+ logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_igs003_reg[0]);
break;
}
@@ -1719,13 +1719,13 @@ WRITE16_MEMBER(igs011_state::vbowl_igs003_w)
}
if (data & ~0x3)
- logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: warning, unknown bits written in coin counter = %02x\n", space.device().safe_pc(), data);
break;
default:
// popmessage("igs003 %x <- %04x",m_igs003_reg[0],data);
- logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0], data);
+ logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_igs003_reg[0], data);
}
}
READ16_MEMBER(igs011_state::vbowl_igs003_r)
@@ -1761,7 +1761,7 @@ READ16_MEMBER(igs011_state::vbowl_igs003_r)
case 0x34: return 0x32;
default:
- logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
+ logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_igs003_reg[0]);
}
return 0;
@@ -2507,7 +2507,7 @@ WRITE16_MEMBER(igs011_state::vbowl_pen_hi_w)
}
if (data & ~0x7)
- logerror("%06x: warning, unknown bits written to pen_hi = %04x\n", cpu_get_pc(&space.device()), m_priority);
+ logerror("%06x: warning, unknown bits written to pen_hi = %04x\n", space.device().safe_pc(), m_priority);
}
WRITE16_MEMBER(igs011_state::vbowl_link_0_w){ }
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index 4aac900e9be..05cac89f2cf 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -80,7 +80,7 @@ WRITE32_MEMBER(igs_m027_state::igs_cg_videoram_w)
{
COMBINE_DATA(&m_igs_cg_videoram[offset]);
//if(data!=0)
- logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram[offset]);
+ logerror("PC(%08X) CG @%x = %x!\n",space.device().safe_pc(),offset ,m_igs_cg_videoram[offset]);
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index 2074543bfca..6a550ea9791 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -242,7 +242,7 @@ WRITE8_MEMBER(igspoker_state::igs_nmi_and_coins_w)
m_nmi_enable = data & 0x80; // nmi enable?
#ifdef VERBOSE
- logerror("PC %06X: NMI change %02x\n",cpu_get_pc(&space.device()),m_nmi_enable);
+ logerror("PC %06X: NMI change %02x\n",space.device().safe_pc(),m_nmi_enable);
#endif
m_out[0] = data;
@@ -294,7 +294,7 @@ WRITE8_MEMBER(igspoker_state::igs_lamps_w)
READ8_MEMBER(igspoker_state::custom_io_r)
{
#ifdef VERBOSE
- logerror("PC %06X: Protection read %02x\n",cpu_get_pc(&space.device()), (int) m_protection_res);
+ logerror("PC %06X: Protection read %02x\n",space.device().safe_pc(), (int) m_protection_res);
#endif
return m_protection_res;
}
@@ -302,7 +302,7 @@ READ8_MEMBER(igspoker_state::custom_io_r)
WRITE8_MEMBER(igspoker_state::custom_io_w)
{
#ifdef VERBOSE
- logerror("PC %06X: Protection write %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("PC %06X: Protection write %02x\n",space.device().safe_pc(),data);
#endif
switch (data)
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index 934c35f9b6a..4b48f012313 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -833,14 +833,14 @@ WRITE32_MEMBER(itech32_state::tms2_trigger_w)
READ32_MEMBER(itech32_state::drivedge_tms1_speedup_r)
{
- if (m_tms1_ram[0x382] == 0 && cpu_get_pc(&space.device()) == 0xee) START_TMS_SPINNING(0);
+ if (m_tms1_ram[0x382] == 0 && space.device().safe_pc() == 0xee) START_TMS_SPINNING(0);
return m_tms1_ram[0x382];
}
READ32_MEMBER(itech32_state::drivedge_tms2_speedup_r)
{
- if (m_tms2_ram[0x382] == 0 && cpu_get_pc(&space.device()) == 0x809808) START_TMS_SPINNING(1);
+ if (m_tms2_ram[0x382] == 0 && space.device().safe_pc() == 0x809808) START_TMS_SPINNING(1);
return m_tms2_ram[0x382];
}
@@ -929,10 +929,10 @@ ADDRESS_MAP_END
READ32_MEMBER(itech32_state::test1_r)
{
- if (ACCESSING_BITS_24_31 && !m_written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0x100 + offset*4+0);
- if (ACCESSING_BITS_16_23 && !m_written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0x100 + offset*4+1);
- if (ACCESSING_BITS_8_15 && !m_written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0x100 + offset*4+2);
- if (ACCESSING_BITS_0_7 && !m_written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0x100 + offset*4+3);
+ if (ACCESSING_BITS_24_31 && !m_written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+0);
+ if (ACCESSING_BITS_16_23 && !m_written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+1);
+ if (ACCESSING_BITS_8_15 && !m_written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+2);
+ if (ACCESSING_BITS_0_7 && !m_written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+3);
return ((UINT32 *)m_main_ram)[0x100/4 + offset];
}
@@ -947,10 +947,10 @@ WRITE32_MEMBER(itech32_state::test1_w)
READ32_MEMBER(itech32_state::test2_r)
{
- if (ACCESSING_BITS_24_31 && !m_written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0xc00 + offset*4+0);
- if (ACCESSING_BITS_16_23 && !m_written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0xc00 + offset*4+1);
- if (ACCESSING_BITS_8_15 && !m_written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0xc00 + offset*4+2);
- if (ACCESSING_BITS_0_7 && !m_written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(&space.device()), 0xc00 + offset*4+3);
+ if (ACCESSING_BITS_24_31 && !m_written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+0);
+ if (ACCESSING_BITS_16_23 && !m_written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+1);
+ if (ACCESSING_BITS_8_15 && !m_written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+2);
+ if (ACCESSING_BITS_0_7 && !m_written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+3);
return ((UINT32 *)m_main_ram)[0xc00/4 + offset];
}
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index 584e099eb98..d4016fc182e 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -350,7 +350,7 @@ READ8_MEMBER(jackie_state::expram_r)
UINT8 *rom = memregion("gfx3")->base();
offset += m_exp_bank * 0x8000;
-// logerror("PC %06X: %04x = %02x\n",cpu_get_pc(&space.device()),offset,rom[offset]);
+// logerror("PC %06X: %04x = %02x\n",space.device().safe_pc(),offset,rom[offset]);
return rom[offset];
}
diff --git a/src/mame/drivers/jaguar.c b/src/mame/drivers/jaguar.c
index 69786d4ee8e..6a1c059e6f9 100644
--- a/src/mame/drivers/jaguar.c
+++ b/src/mame/drivers/jaguar.c
@@ -558,7 +558,7 @@ READ32_MEMBER(jaguar_state::misc_control_r)
WRITE32_MEMBER(jaguar_state::misc_control_w)
{
- logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%08X:misc_control_w(%02X)\n", space.device().safe_pcbase(), data);
/* D7 = board reset (low)
D6 = audio must & reset (high)
@@ -751,7 +751,7 @@ WRITE32_MEMBER(jaguar_state::joystick_w)
WRITE32_MEMBER(jaguar_state::latch_w)
{
- logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(&space.device()), data);
+ logerror("%08X:latch_w(%X)\n", space.device().safe_pcbase(), data);
/* adjust banking */
if (memregion("romboard")->base())
@@ -795,7 +795,7 @@ WRITE32_MEMBER(jaguar_state::eeprom_data_w)
m_nvram[offset] = data & 0xff000000;
}
// else
-// logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(&space.device()));
+// logerror("%08X:error writing to disabled EEPROM\n", space.device().safe_pcbase());
m_eeprom_enable = false;
}
@@ -833,7 +833,7 @@ WRITE32_MEMBER(jaguar_state::gpu_jump_w)
{
/* update the data in memory */
COMBINE_DATA(m_gpu_jump_address);
- logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(&space.device()), *m_gpu_jump_address);
+ logerror("%08X:GPU jump address = %08X\n", space.device().safe_pcbase(), *m_gpu_jump_address);
/* if the GPU is suspended, release it now */
gpu_resume();
@@ -848,7 +848,7 @@ READ32_MEMBER(jaguar_state::gpu_jump_r)
{
/* if the current GPU command is just pointing back to the spin loop, and */
/* we're reading it from the spin loop, we can optimize */
- if (*m_gpu_jump_address == m_gpu_spin_pc && cpu_get_previouspc(&space.device()) == m_gpu_spin_pc)
+ if (*m_gpu_jump_address == m_gpu_spin_pc && space.device().safe_pcbase() == m_gpu_spin_pc)
{
#if ENABLE_SPEEDUP_HACKS
/* spin if we're allowed */
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 5ba936722d1..e57ccdfe132 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -972,7 +972,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okirom_w)
memcpy(&oki[0x20000], &oki[(m_oki_rom * 0x80000) + ((m_oki_bank+m_oki_za) * 0x20000) + 0x40000], 0x20000);
}
- //popmessage("PC=%06x %02x %02x %02x %08x",cpu_get_pc(&space.device()),m_oki_rom,m_oki_za,m_oki_bank,(m_oki_rom * 0x80000) + ((m_oki_bank+m_oki_za) * 0x20000) + 0x40000);
+ //popmessage("PC=%06x %02x %02x %02x %08x",space.device().safe_pc(),m_oki_rom,m_oki_za,m_oki_bank,(m_oki_rom * 0x80000) + ((m_oki_bank+m_oki_za) * 0x20000) + 0x40000);
}
WRITE16_MEMBER(jalmah_state::jalmah_okibank_w)
@@ -986,7 +986,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okibank_w)
memcpy(&oki[0x20000], &oki[(m_oki_rom * 0x80000) + ((m_oki_bank+m_oki_za) * 0x20000) + 0x40000], 0x20000);
}
- //popmessage("PC=%06x %02x %02x %02x %08x",cpu_get_pc(&space.device()),m_oki_rom,m_oki_za,m_oki_bank,(m_oki_rom * 0x80000) + ((m_oki_bank+m_oki_za) * 0x20000) + 0x40000);
+ //popmessage("PC=%06x %02x %02x %02x %08x",space.device().safe_pc(),m_oki_rom,m_oki_za,m_oki_bank,(m_oki_rom * 0x80000) + ((m_oki_bank+m_oki_za) * 0x20000) + 0x40000);
}
WRITE16_MEMBER(jalmah_state::jalmah_flip_screen_w)
@@ -1761,7 +1761,7 @@ READ16_MEMBER(jalmah_state::urashima_mcu_r)
res = resp[m_respcount++];
if (m_respcount >= sizeof(resp)/sizeof(resp[0])) m_respcount = 0;
-// logerror("%04x: mcu_r %02x\n",cpu_get_pc(&space.device()),res);
+// logerror("%04x: mcu_r %02x\n",space.device().safe_pc(),res);
return res;
}
@@ -1979,7 +1979,7 @@ READ16_MEMBER(jalmah_state::daireika_mcu_r)
res = resp[m_respcount++];
if (m_respcount >= sizeof(resp)/sizeof(resp[0])) m_respcount = 0;
-// logerror("%04x: mcu_r %02x\n",cpu_get_pc(&space.device()),res);
+// logerror("%04x: mcu_r %02x\n",space.device().safe_pc(),res);
return res;
}
@@ -2258,7 +2258,7 @@ READ16_MEMBER(jalmah_state::mjzoomin_mcu_r)
res = resp[m_respcount++];
if (m_respcount >= sizeof(resp)/sizeof(resp[0])) m_respcount = 0;
-// logerror("%04x: mcu_r %02x\n",cpu_get_pc(&space.device()),res);
+// logerror("%04x: mcu_r %02x\n",space.device().safe_pc(),res);
return res;
}
@@ -2395,7 +2395,7 @@ READ16_MEMBER(jalmah_state::kakumei_mcu_r)
res = resp[m_respcount++];
if (m_respcount >= sizeof(resp)/sizeof(resp[0])) m_respcount = 0;
-// popmessage("%04x: mcu_r %02x",cpu_get_pc(&space.device()),res);
+// popmessage("%04x: mcu_r %02x",space.device().safe_pc(),res);
return res;
}
@@ -2416,7 +2416,7 @@ READ16_MEMBER(jalmah_state::suchipi_mcu_r)
res = resp[m_respcount++];
if (m_respcount >= sizeof(resp)/sizeof(resp[0])) m_respcount = 0;
-// popmessage("%04x: mcu_r %02x",cpu_get_pc(&space.device()),res);
+// popmessage("%04x: mcu_r %02x",space.device().safe_pc(),res);
return res;
}
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index 28cd23f8e31..5f8d052a48b 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -184,10 +184,10 @@ static PALETTE_INIT( jokrwild )
READ8_MEMBER(jokrwild_state::rng_r)
{
- if(cpu_get_pc(&space.device()) == 0xab32)
+ if(space.device().safe_pc() == 0xab32)
return (offset == 0) ? 0x9e : 0x27;
- if(cpu_get_pc(&space.device()) == 0xab3a)
+ if(space.device().safe_pc() == 0xab3a)
return (offset == 2) ? 0x49 : 0x92;
return machine().rand() & 0xff;
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 80ed9a0cfec..4f01fd93b2d 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -337,7 +337,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",cpu_get_pc(&space->device()),data);
+// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",space->device().safe_pc(),data);
}
}
@@ -348,7 +348,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",cpu_get_pc(&space->device()),data);
+// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",space->device().safe_pc(),data);
}
}
@@ -478,7 +478,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",cpu_get_pc(&space->device()),data);
+// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",space->device().safe_pc(),data);
}
}
@@ -489,7 +489,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",cpu_get_pc(&space->device()),data);
+// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",space->device().safe_pc(),data);
}
}
@@ -552,7 +552,7 @@ READ16_MEMBER(kaneko16_gtmr_state::gtmr2_wheel_r)
case 0x0800: // 360' Wheel
return (ioport("WHEEL2")->read() << 8);
default:
- logerror("gtmr2_wheel_r : read at %06x with joystick\n", cpu_get_pc(&space.device()));
+ logerror("gtmr2_wheel_r : read at %06x with joystick\n", space.device().safe_pc());
return (~0);
}
}
diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c
index a9b2ee49f60..18c340282ef 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",cpu_get_previouspc(&space->device()),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/kinst.c b/src/mame/drivers/kinst.c
index e5ccd2d5f37..e873ecac5d0 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -362,7 +362,7 @@ READ32_MEMBER(kinst_state::kinst_control_r)
case 4: /* $a0 */
result = ioport(portnames[offset])->read();
- if (cpu_get_pc(&space.device()) == 0x802d428)
+ if (space.device().safe_pc() == 0x802d428)
device_spin_until_interrupt(&space.device());
break;
}
diff --git a/src/mame/drivers/koftball.c b/src/mame/drivers/koftball.c
index 6054135a528..9501a2de8e1 100644
--- a/src/mame/drivers/koftball.c
+++ b/src/mame/drivers/koftball.c
@@ -137,7 +137,7 @@ READ16_MEMBER(koftball_state::prot_r)
case 0x8000: return 0x0f0f;
}
- logerror("unk prot r %x %x\n",m_prot_data, cpu_get_previouspc(&space.device()));
+ logerror("unk prot r %x %x\n",m_prot_data, space.device().safe_pcbase());
return machine().rand();
}
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index f1ecd4ac25d..986ddab8ac2 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -585,7 +585,7 @@ WRITE32_MEMBER(konamigv_state::btcflash_w)
READ32_MEMBER(konamigv_state::btc_trackball_r)
{
-// mame_printf_debug( "r %08x %08x %08x\n", cpu_get_pc(&space.device()), offset, mem_mask );
+// mame_printf_debug( "r %08x %08x %08x\n", space.device().safe_pc(), offset, mem_mask );
if( offset == 1 && mem_mask == 0xffff0000 )
{
@@ -608,7 +608,7 @@ READ32_MEMBER(konamigv_state::btc_trackball_r)
WRITE32_MEMBER(konamigv_state::btc_trackball_w)
{
-// mame_printf_debug( "w %08x %08x %08x %08x\n", cpu_get_pc(&space.device()), offset, data, mem_mask );
+// mame_printf_debug( "w %08x %08x %08x %08x\n", space.device().safe_pc(), offset, data, mem_mask );
}
DRIVER_INIT_MEMBER(konamigv_state,btchamp)
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index c12d6c9deb7..d4496403f4d 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -482,7 +482,7 @@ WRITE32_MEMBER(konamigx_state::eeprom_w)
*/
konamigx_wrport1_1 = (data>>16)&0xff;
-// logerror("write %x to IRQ register (PC=%x)\n", konamigx_wrport1_1, cpu_get_pc(&space.device()));
+// logerror("write %x to IRQ register (PC=%x)\n", konamigx_wrport1_1, space.device().safe_pc());
// gx_syncen is to ensure each IRQ is trigger at least once after being enabled
if (konamigx_wrport1_1 & 0x80) gx_syncen |= konamigx_wrport1_1 & 0x1f;
@@ -546,7 +546,7 @@ READ32_MEMBER(konamigx_state::waitskip_r)
{
UINT32 data = gx_workram[waitskip.offs+offset];
- if (cpu_get_pc(&space.device()) == waitskip.pc && (data & mem_mask) == (waitskip.data & mem_mask))
+ if (space.device().safe_pc() == waitskip.pc && (data & mem_mask) == (waitskip.data & mem_mask))
{
device_spin_until_trigger(&space.device(), resume_trigger);
suspension_active = 1;
@@ -730,7 +730,7 @@ READ32_MEMBER(konamigx_state::sound020_r)
rv |= LSW<<8;
}
-// mame_printf_debug("Read 68k @ %x (PC=%x)\n", reg, cpu_get_pc(&space.device()));
+// mame_printf_debug("Read 68k @ %x (PC=%x)\n", reg, space.device().safe_pc());
// we clearly have some problem because some games require these hacks
// perhaps 68000/68020 timing is skewed?
@@ -740,43 +740,43 @@ READ32_MEMBER(konamigx_state::sound020_r)
if (reg == 0) rv |= 0xff00;
break;
case 2: // Winning Spike
- if (cpu_get_pc(&space.device()) == 0x2026fe) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x2026fe) rv = 0xc0c0c0c0;
break;
case 3: // Run'n Gun 2
- if (cpu_get_pc(&space.device()) == 0x24f0b6) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24f122) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24f0b6) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24f122) rv = 0xc0c0c0c0;
break;
case 4: // Rushing Heroes
- if (cpu_get_pc(&space.device()) == 0x20eda6) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x20eda6) rv = 0xc0c0c0c0;
break;
case 5: // Vs. Net Soccer ver. UAB
- if (cpu_get_pc(&space.device()) == 0x24c5d2) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24c63e) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24c5d2) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24c63e) rv = 0xc0c0c0c0;
break;
case 6: // Slam Dunk 2
- if (cpu_get_pc(&space.device()) == 0x24f1b0) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24f21c) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24f1b0) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24f21c) rv = 0xc0c0c0c0;
break;
case 7: // Vs. Net Soccer ver. AAA
- if (cpu_get_pc(&space.device()) == 0x24c6b6) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24c722) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24c6b6) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24c722) rv = 0xc0c0c0c0;
break;
case 8: // Vs. Net Soccer ver. EAD
- if (cpu_get_pc(&space.device()) == 0x24c416) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24c482) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24c416) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24c482) rv = 0xc0c0c0c0;
break;
case 9: // Vs. Net Soccer ver. EAB
- if (cpu_get_pc(&space.device()) == 0x24c400) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24c46c) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24c400) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24c46c) rv = 0xc0c0c0c0;
break;
case 10: // Vs. Net Soccer ver. JAB
- if (cpu_get_pc(&space.device()) == 0x24c584) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x24c5f0) rv = 0xc0c0c0c0;
+ if (space.device().safe_pc() == 0x24c584) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x24c5f0) rv = 0xc0c0c0c0;
break;
case 11: // Racin' Force
if (reg == 0)
{
- if (cpu_get_pc(&space.device()) == 0x0202190)
+ if (space.device().safe_pc() == 0x0202190)
rv |= 0x4000;
}
break;
@@ -784,33 +784,33 @@ READ32_MEMBER(konamigx_state::sound020_r)
case 12: // Open Golf / Golfing Greats 2
if (reg == 0)
{
- if ((cpu_get_pc(&space.device()) == 0x0245e80) || (cpu_get_pc(&space.device()) == 0x02459d6) || (cpu_get_pc(&space.device()) == 0x0245e40) )
+ if ((space.device().safe_pc() == 0x0245e80) || (space.device().safe_pc() == 0x02459d6) || (space.device().safe_pc() == 0x0245e40) )
rv |= 0x4000;
}
break;
case 13: // Soccer Superstars
- //if(cpu_get_pc(&space.device()) != 0x236dce && cpu_get_pc(&space.device()) != 0x236d8a && cpu_get_pc(&space.device()) != 0x236d8a)
- // printf("Read 68k @ %x (PC=%x)\n", reg, cpu_get_pc(&space.device()));
- if (cpu_get_pc(&space.device()) == 0x0236e04) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x0236e12) rv = 0xffffffff;
+ //if(space.device().safe_pc() != 0x236dce && space.device().safe_pc() != 0x236d8a && space.device().safe_pc() != 0x236d8a)
+ // printf("Read 68k @ %x (PC=%x)\n", reg, space.device().safe_pc());
+ if (space.device().safe_pc() == 0x0236e04) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x0236e12) rv = 0xffffffff;
break;
case 14: // Soccer Superstars ver. JAC
- //if(cpu_get_pc(&space.device()) != 0x2367b4)
- // printf("Read 68k @ %x (PC=%x)\n", reg, cpu_get_pc(&space.device()));
- if (cpu_get_pc(&space.device()) == 0x02367ea) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x02367f8) rv = 0xffffffff;
+ //if(space.device().safe_pc() != 0x2367b4)
+ // printf("Read 68k @ %x (PC=%x)\n", reg, space.device().safe_pc());
+ if (space.device().safe_pc() == 0x02367ea) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x02367f8) rv = 0xffffffff;
break;
case 15: // Soccer Superstars ver. JAA
- //if(cpu_get_pc(&space.device()) != 0x23670a)
- // printf("Read 68k @ %x (PC=%x)\n", reg, cpu_get_pc(&space.device()));
- if (cpu_get_pc(&space.device()) == 0x0236740) rv = 0xffffffff;
- if (cpu_get_pc(&space.device()) == 0x023674e) rv = 0xffffffff;
+ //if(space.device().safe_pc() != 0x23670a)
+ // printf("Read 68k @ %x (PC=%x)\n", reg, space.device().safe_pc());
+ if (space.device().safe_pc() == 0x0236740) rv = 0xffffffff;
+ if (space.device().safe_pc() == 0x023674e) rv = 0xffffffff;
break;
case 16: // Dragoon Might ver. JAA
{
UINT32 cur_pc;
- cur_pc = cpu_get_pc(&space.device());
+ cur_pc = space.device().safe_pc();
switch(cur_pc)
{
@@ -1114,20 +1114,20 @@ WRITE32_MEMBER(konamigx_state::type4_prot_w)
else if(last_prot_op == 0x515) // vsnetscr screen 1
{
int adr;
- //printf("GXT4: command %x %d (PC=%x)\n", last_prot_op, cc++, cpu_get_pc(&space.device()));
+ //printf("GXT4: command %x %d (PC=%x)\n", last_prot_op, cc++, space.device().safe_pc());
for (adr = 0; adr < 0x400; adr += 2)
space.write_word(0xc01c00+adr, space.read_word(0xc01800+adr));
}
else if(last_prot_op == 0x115d) // vsnetscr screen 2
{
int adr;
- //printf("GXT4: command %x %d (PC=%x)\n", last_prot_op, cc++, cpu_get_pc(&space.device()));
+ //printf("GXT4: command %x %d (PC=%x)\n", last_prot_op, cc++, space.device().safe_pc());
for (adr = 0; adr < 0x400; adr += 2)
space.write_word(0xc18c00+adr, space.read_word(0xc18800+adr));
}
else
{
- printf("GXT4: unknown protection command %x (PC=%x)\n", last_prot_op, cpu_get_pc(&space.device()));
+ printf("GXT4: unknown protection command %x (PC=%x)\n", last_prot_op, space.device().safe_pc());
}
if (konamigx_wrport1_1 & 0x10)
diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c
index df3139143d9..bb1bca71d1d 100644
--- a/src/mame/drivers/konamim2.c
+++ b/src/mame/drivers/konamim2.c
@@ -346,7 +346,7 @@ READ64_MEMBER(konamim2_state::unk3_r)
READ64_MEMBER(konamim2_state::unk4_r)
{
UINT64 r = 0;
-// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(&space.device()));
+// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), space.device().safe_pc());
if (ACCESSING_BITS_32_63)
{
@@ -363,13 +363,13 @@ READ64_MEMBER(konamim2_state::unk4_r)
WRITE64_MEMBER(konamim2_state::unk4_w)
{
// logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data),
-// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(&space.device()));
+// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), space.device().safe_pc());
if (ACCESSING_BITS_0_31)
{
if (data & 0x800000)
{
-// mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", device().tag(), cpu_get_pc(&space.device()));
+// mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", device().tag(), space.device().safe_pc());
cputag_set_input_line(machine(), "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
}
@@ -902,7 +902,7 @@ READ64_MEMBER(konamim2_state::cde_r)
default:
{
-// mame_printf_debug("cde_r: %08X at %08X\n", reg*4, cpu_get_pc(&space.device()));
+// mame_printf_debug("cde_r: %08X at %08X\n", reg*4, space.device().safe_pc());
break;
}
}
@@ -936,7 +936,7 @@ WRITE64_MEMBER(konamim2_state::cde_w)
{
case 0x028/4: // Command write
{
- //printf("cde_w: %08X, %08X at %08X\n", d, reg*4, cpu_get_pc(&space.device()));
+ //printf("cde_w: %08X, %08X at %08X\n", d, reg*4, space.device().safe_pc());
if (d == 0x0180)
{
@@ -1064,7 +1064,7 @@ WRITE64_MEMBER(konamim2_state::cde_w)
default:
{
-// mame_printf_debug("cde_w: %08X, %08X at %08X\n", d, reg*4, cpu_get_pc(&space.device()));
+// mame_printf_debug("cde_w: %08X, %08X at %08X\n", d, reg*4, space.device().safe_pc());
break;
}
}
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 482a3ab8460..41012f3fa36 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -873,7 +873,7 @@ READ32_MEMBER(ksys573_state::atapi_r)
break;
}
-// mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, cpu_get_pc(&space.device()));
+// mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, space.device().safe_pc());
data <<= shift;
}
@@ -1031,11 +1031,11 @@ WRITE32_MEMBER(ksys573_state::atapi_w)
}
atapi_regs[reg] = data;
-// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, cpu_get_pc(&space.device()));
+// 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)
{
-// mame_printf_debug("ATAPI command %x issued! (PC=%x)\n", data, cpu_get_pc(&space.device()));
+// mame_printf_debug("ATAPI command %x issued! (PC=%x)\n", data, space.device().safe_pc());
switch (data)
{
@@ -1246,7 +1246,7 @@ READ32_MEMBER(ksys573_state::flash_r)
if( m_flash_bank < 0 )
{
- mame_printf_debug( "%08x: flash_r( %08x, %08x ) no bank selected %08x\n", cpu_get_pc(&space.device()), offset, mem_mask, m_control );
+ mame_printf_debug( "%08x: flash_r( %08x, %08x ) no bank selected %08x\n", space.device().safe_pc(), offset, mem_mask, m_control );
data = 0xffffffff;
}
else
@@ -1284,7 +1284,7 @@ WRITE32_MEMBER(ksys573_state::flash_w)
if( m_flash_bank < 0 )
{
- mame_printf_debug( "%08x: flash_w( %08x, %08x, %08x ) no bank selected %08x\n", cpu_get_pc(&space.device()), offset, mem_mask, data, m_control );
+ mame_printf_debug( "%08x: flash_w( %08x, %08x, %08x ) no bank selected %08x\n", space.device().safe_pc(), offset, mem_mask, data, m_control );
}
else
{
@@ -2013,7 +2013,7 @@ READ32_MEMBER(ksys573_state::gx894pwbba_r)
}
verboselog( machine(), 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
-// printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", cpu_get_pc(&space.device()), offset, mem_mask, data );
+// printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", space.device().safe_pc(), offset, mem_mask, data );
return data;
}
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index 8f5ed2c3dee..c52c5d62503 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -119,7 +119,7 @@ WRITE8_MEMBER(ladybug_state::sraider_misc_w)
m_sraider_0x38 = data&0x3f;
break;
default:
- mame_printf_debug("(%04X) write to %02X\n", cpu_get_pc(&space.device()), offset);
+ mame_printf_debug("(%04X) write to %02X\n", space.device().safe_pc(), offset);
break;
}
}
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index 7f855fc8ddd..004d159cd8a 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -210,11 +210,11 @@ WRITE16_MEMBER(lastfght_state::lastfght_hi_w)
{
if (ACCESSING_BITS_8_15)
- logerror("%06x: 600000.b = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ logerror("%06x: 600000.b = %02x\n", space.device().safe_pc(), data >> 8);
if (ACCESSING_BITS_0_7)
{
m_hi = data << 8;
- //logerror("%06x: lastfght_hi = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%06x: lastfght_hi = %02x\n", space.device().safe_pc(), data);
}
}
@@ -223,11 +223,11 @@ WRITE16_MEMBER(lastfght_state::lastfght_x_w)
{
if (ACCESSING_BITS_8_15)
- logerror("%06x: 800008.b = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ logerror("%06x: 800008.b = %02x\n", space.device().safe_pc(), data >> 8);
if (ACCESSING_BITS_0_7)
{
m_x = m_hi | data;
- //logerror("%06x: lastfght_x = %02x\n", cpu_get_pc(&space.device()),data);
+ //logerror("%06x: lastfght_x = %02x\n", space.device().safe_pc(),data);
}
}
@@ -238,12 +238,12 @@ WRITE16_MEMBER(lastfght_state::lastfght_yw_w)
if (ACCESSING_BITS_8_15)
{
m_y = m_hi | (data >> 8);
- //logerror("%06x: lastfght_y = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ //logerror("%06x: lastfght_y = %02x\n", space.device().safe_pc(), data >> 8);
}
if (ACCESSING_BITS_0_7)
{
m_w = m_hi | data;
- //logerror("%06x: lastfght_w = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%06x: lastfght_w = %02x\n", space.device().safe_pc(), data);
}
}
@@ -254,10 +254,10 @@ WRITE16_MEMBER(lastfght_state::lastfght_h_w)
if (ACCESSING_BITS_8_15)
{
m_h = m_hi | (data >> 8);
- //logerror("%06x: lastfght_h = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ //logerror("%06x: lastfght_h = %02x\n", space.device().safe_pc(), data >> 8);
}
if (ACCESSING_BITS_0_7)
- logerror("%06x: 80000d.b = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: 80000d.b = %02x\n", space.device().safe_pc(), data);
}
// source delta x << 6, source x << 6
@@ -267,12 +267,12 @@ WRITE16_MEMBER(lastfght_state::lastfght_sx_w)
if (ACCESSING_BITS_8_15)
{
m_dsx = m_hi | (data >> 8);
- //logerror("%06x: lastfght_dsx = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ //logerror("%06x: lastfght_dsx = %02x\n", space.device().safe_pc(), data >> 8);
}
if (ACCESSING_BITS_0_7)
{
m_sx = m_hi | data;
- //logerror("%06x: lastfght_sx = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%06x: lastfght_sx = %02x\n", space.device().safe_pc(), data);
}
}
@@ -283,12 +283,12 @@ WRITE16_MEMBER(lastfght_state::lastfght_sy_w)
if (ACCESSING_BITS_8_15)
{
m_sy = m_hi | (data >> 8);
- //logerror("%06x: lastfght_sy = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ //logerror("%06x: lastfght_sy = %02x\n", space.device().safe_pc(), data >> 8);
}
if (ACCESSING_BITS_0_7)
{
m_sy1 = m_hi | data;
- //logerror("%06x: lastfght_sy1 = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%06x: lastfght_sy1 = %02x\n", space.device().safe_pc(), data);
}
}
@@ -299,12 +299,12 @@ WRITE16_MEMBER(lastfght_state::lastfght_sr_w)
if (ACCESSING_BITS_8_15)
{
m_sp = (m_hi >> 8) >> 4;
- //logerror("%06x: lastfght_sp = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ //logerror("%06x: lastfght_sp = %02x\n", space.device().safe_pc(), data >> 8);
}
if (ACCESSING_BITS_0_7)
{
m_sr = data;
- //logerror("%06x: lastfght_sr = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%06x: lastfght_sr = %02x\n", space.device().safe_pc(), data);
}
}
@@ -315,12 +315,12 @@ WRITE16_MEMBER(lastfght_state::lastfght_sd_w)
if (ACCESSING_BITS_8_15)
{
m_sx1 = m_hi | (data >> 8);
- //logerror("%06x: lastfght_sx1 = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ //logerror("%06x: lastfght_sx1 = %02x\n", space.device().safe_pc(), data >> 8);
}
if (ACCESSING_BITS_0_7)
{
m_dsy = m_hi | data;
- //logerror("%06x: lastfght_dsy = %02x\n", cpu_get_pc(&space.device()), data);
+ //logerror("%06x: lastfght_dsy = %02x\n", space.device().safe_pc(), data);
}
}
@@ -335,7 +335,7 @@ WRITE16_MEMBER(lastfght_state::lastfght_blit_w)
bitmap_ind16 &dest = m_bitmap[m_dest];
#if 0
- logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, sx %03x.%02x, sx1 %03x.%02x, dsx %03x.%02x, sy %03x.%02x, sy1 %03x.%02x, dsy %03x.%02x, sp %02x, sr %02x, data %02x\n", cpu_get_pc(&space.device()),
+ logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, sx %03x.%02x, sx1 %03x.%02x, dsx %03x.%02x, sy %03x.%02x, sy1 %03x.%02x, dsy %03x.%02x, sp %02x, sr %02x, data %02x\n", space.device().safe_pc(),
m_x, m_y, m_w + 1, m_h + 1,
m_sx >> 6, m_sx & 0x3f, m_sx1 >> 6, m_dsx & 0x3f, m_sx1 >> 6, m_sx1 & 0x3f,
m_sy >> 6, m_sy & 0x3f, m_sy1 >> 6, m_dsy & 0x3f, m_sy1 >> 6, m_sy1 & 0x3f,
@@ -359,7 +359,7 @@ WRITE16_MEMBER(lastfght_state::lastfght_blit_w)
}
}
if (ACCESSING_BITS_0_7)
- logerror("%06x: 600007.b = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: 600007.b = %02x\n", space.device().safe_pc(), data);
}
// toggle framebuffer
@@ -415,9 +415,9 @@ READ16_MEMBER(lastfght_state::lastfght_sound_r)
WRITE16_MEMBER(lastfght_state::lastfght_sound_w)
{
if (ACCESSING_BITS_8_15)
- logerror("%06x: sound_w msb = %02x\n", cpu_get_pc(&space.device()), data >> 8);
+ logerror("%06x: sound_w msb = %02x\n", space.device().safe_pc(), data >> 8);
if (ACCESSING_BITS_0_7)
- logerror("%06x: sound_w lsb = %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: sound_w lsb = %02x\n", space.device().safe_pc(), data);
}
/***************************************************************************
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index 78d46d83c14..11476703fe7 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -397,7 +397,7 @@ WRITE8_MEMBER(lethal_state::le_4800_w)
break;
default:
- logerror("Unknown LE 48xx register write: %x to %x (PC=%x)\n", data, offset, cpu_get_pc(&space.device()));
+ logerror("Unknown LE 48xx register write: %x to %x (PC=%x)\n", data, offset, space.device().safe_pc());
break;
}
}
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 17403f24ec3..6154f93f9b0 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -42,13 +42,13 @@ READ8_MEMBER(liberate_state::deco16_bank_r)
return m_spriteram[offset - 0x800];
if (offset < 0x2200)
{
- logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Unmapped bank read %04x\n", space.device().safe_pc(), offset);
return 0;
}
if (offset < 0x2800)
return m_scratchram[offset - 0x2200];
- logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Unmapped bank read %04x\n", space.device().safe_pc(), offset);
return 0;
}
@@ -60,7 +60,7 @@ READ8_MEMBER(liberate_state::deco16_io_r)
if (offset == 3) return ioport("DSW1")->read(); /* Dip 1 */
if (offset == 4) return ioport("DSW2")->read(); /* Dip 2 */
- logerror("%04x: Read input %d\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Read input %d\n", space.device().safe_pc(), offset);
return 0xff;
}
@@ -93,13 +93,13 @@ READ8_MEMBER(liberate_state::prosoccr_bank_r)
return m_spriteram[offset - 0xc00];
if (offset < 0x2200)
{
- logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Unmapped bank read %04x\n", space.device().safe_pc(), offset);
return 0;
}
if (offset < 0x2800)
return m_scratchram[offset - 0x2200];
- logerror("%04x: Unmapped bank read %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04x: Unmapped bank read %04x\n", space.device().safe_pc(), offset);
return 0;
}
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 73abea4d104..3ea530e765e 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -345,7 +345,7 @@ static void littlerb_recalc_address(running_machine &machine)
READ16_MEMBER(littlerb_state::littlerb_vdp_r)
{
- logerror("%06x littlerb_vdp_r offs %04x mask %04x (address %08x)\n", cpu_get_pc(&space.device()), offset, mem_mask, m_write_address);
+ logerror("%06x littlerb_vdp_r offs %04x mask %04x (address %08x)\n", space.device().safe_pc(), offset, mem_mask, m_write_address);
UINT16 res = 0;
switch (offset & 3)
@@ -378,7 +378,7 @@ WRITE16_MEMBER(littlerb_state::littlerb_vdp_w)
m_type2_writes = 0;
}
- if (LOG_VDP) logerror("%06x littlerb_vdp_w offs %04x data %04x mask %04x\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ if (LOG_VDP) logerror("%06x littlerb_vdp_w offs %04x data %04x mask %04x\n", space.device().safe_pc(), offset, data, mem_mask);
}
else
{
@@ -386,16 +386,16 @@ WRITE16_MEMBER(littlerb_state::littlerb_vdp_w)
{
if (m_type2_writes==0)
{
- if (LOG_VDP) logerror("data write started %06x %04x data %04x mask %04x\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ if (LOG_VDP) logerror("data write started %06x %04x data %04x mask %04x\n", space.device().safe_pc(), offset, data, mem_mask);
}
if (m_type2_writes==0) m_write_address_laststart = m_write_address;
m_write_address_lastend = m_write_address;
m_type2_writes++;
- m_lasttype2pc = cpu_get_pc(&space.device());
+ m_lasttype2pc = space.device().safe_pc();
}
else
{
- if (LOG_VDP) logerror("xxx %06x littlerb_vdp_w offs %04x data %04x mask %04x\n", cpu_get_pc(&space.device()), offset, data, mem_mask);
+ if (LOG_VDP) logerror("xxx %06x littlerb_vdp_w offs %04x data %04x mask %04x\n", space.device().safe_pc(), offset, data, mem_mask);
}
}
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index b2cf2211c8f..c6a72ed8aec 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -444,8 +444,8 @@ WRITE8_MEMBER(looping_state::ballon_enable_w)
WRITE8_MEMBER(looping_state::out_0_w){ mame_printf_debug("out0 = %02X\n", data); }
WRITE8_MEMBER(looping_state::out_2_w){ mame_printf_debug("out2 = %02X\n", data); }
-READ8_MEMBER(looping_state::adc_r){ mame_printf_debug("%04X:ADC read\n", cpu_get_pc(&space.device())); return 0xff; }
-WRITE8_MEMBER(looping_state::adc_w){ mame_printf_debug("%04X:ADC write = %02X\n", cpu_get_pc(&space.device()), data); }
+READ8_MEMBER(looping_state::adc_r){ mame_printf_debug("%04X:ADC read\n", space.device().safe_pc()); return 0xff; }
+WRITE8_MEMBER(looping_state::adc_w){ mame_printf_debug("%04X:ADC write = %02X\n", space.device().safe_pc(), data); }
WRITE8_MEMBER(looping_state::plr2_w)
{
diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c
index 69a280db855..53047211d13 100644
--- a/src/mame/drivers/lwings.c
+++ b/src/mame/drivers/lwings.c
@@ -106,7 +106,7 @@ static INTERRUPT_GEN( avengers_interrupt )
WRITE8_MEMBER(lwings_state::avengers_protection_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (pc == 0x2eeb)
{
@@ -238,7 +238,7 @@ READ8_MEMBER(lwings_state::avengers_protection_r)
int x, y;
int dx, dy, dist, dir;
- if (cpu_get_pc(&space.device()) == 0x7c7)
+ if (space.device().safe_pc() == 0x7c7)
{
/* palette data */
return avengers_fetch_paldata(machine());
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index 923cd0292ce..ba02507d841 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -85,7 +85,7 @@ WRITE16_MEMBER(m107_state::m107_bankswitch_w)
{
membank("bank1")->set_entry((data & 0x06) >> 1);
if (data & 0xf9)
- logerror("%05x: bankswitch %04x\n", cpu_get_pc(&space.device()), data);
+ logerror("%05x: bankswitch %04x\n", space.device().safe_pc(), data);
}
}
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index cad22372d10..f4a12b0966e 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -253,14 +253,14 @@ static TIMER_DEVICE_CALLBACK( m92_scanline_interrupt )
READ16_MEMBER(m92_state::m92_eeprom_r)
{
UINT8 *RAM = memregion("eeprom")->base();
-// logerror("%05x: EEPROM RE %04x\n",cpu_get_pc(&space.device()),offset);
+// logerror("%05x: EEPROM RE %04x\n",space.device().safe_pc(),offset);
return RAM[offset] | 0xff00;
}
WRITE16_MEMBER(m92_state::m92_eeprom_w)
{
UINT8 *RAM = memregion("eeprom")->base();
-// logerror("%05x: EEPROM WR %04x\n",cpu_get_pc(&space.device()),offset);
+// logerror("%05x: EEPROM WR %04x\n",space.device().safe_pc(),offset);
if (ACCESSING_BITS_0_7)
RAM[offset] = data;
}
@@ -283,7 +283,7 @@ WRITE16_MEMBER(m92_state::m92_bankswitch_w)
{
membank("bank1")->set_entry((data & 0x06) >> 1);
if (data & 0xf9)
- logerror("%05x: bankswitch %04x\n", cpu_get_pc(&space.device()), data);
+ logerror("%05x: bankswitch %04x\n", space.device().safe_pc(), data);
}
}
@@ -304,7 +304,7 @@ WRITE16_MEMBER(m92_state::m92_soundlatch_w)
READ16_MEMBER(m92_state::m92_sound_status_r)
{
-//logerror("%06x: read sound status\n",cpu_get_pc(&space.device()));
+//logerror("%06x: read sound status\n",space.device().safe_pc());
return m_sound_status;
}
diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c
index 9eca06cc656..14f014c1d2b 100644
--- a/src/mame/drivers/macrossp.c
+++ b/src/mame/drivers/macrossp.c
@@ -320,7 +320,7 @@ WRITE32_MEMBER(macrossp_state::paletteram32_macrossp_w)
READ32_MEMBER(macrossp_state::macrossp_soundstatus_r)
{
- // logerror("%08x read soundstatus\n", cpu_get_pc(&space.device()));
+ // logerror("%08x read soundstatus\n", space.device().safe_pc());
/* bit 1 is sound status */
/* bit 0 unknown - it is expected to toggle, vblank? */
@@ -335,7 +335,7 @@ WRITE32_MEMBER(macrossp_state::macrossp_soundcmd_w)
if (ACCESSING_BITS_16_31)
{
- //logerror("%08x write soundcmd %08x (%08x)\n",cpu_get_pc(&space.device()),data,mem_mask);
+ //logerror("%08x write soundcmd %08x (%08x)\n",space.device().safe_pc(),data,mem_mask);
soundlatch_word_w(space, 0, data >> 16, 0xffff);
m_sndpending = 1;
device_set_input_line(m_audiocpu, 2, HOLD_LINE);
@@ -347,7 +347,7 @@ WRITE32_MEMBER(macrossp_state::macrossp_soundcmd_w)
READ16_MEMBER(macrossp_state::macrossp_soundcmd_r)
{
- // logerror("%06x read soundcmd\n",cpu_get_pc(&space.device()));
+ // logerror("%06x read soundcmd\n",space.device().safe_pc());
m_sndpending = 0;
return soundlatch_word_r(space, offset, mem_mask);
}
@@ -770,7 +770,7 @@ PC :00018110 018110: beq 18104
*/
COMBINE_DATA(&m_mainram[0x10158 / 4]);
- if (cpu_get_pc(&space.device()) == 0x001810A) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc() == 0x001810A) device_spin_until_interrupt(&space.device());
}
#ifdef UNUSED_FUNCTION
@@ -778,7 +778,7 @@ WRITE32_MEMBER(macrossp_state::quizmoon_speedup_w)
{
COMBINE_DATA(&m_mainram[0x00020 / 4]);
- if (cpu_get_pc(&space.device()) == 0x1cc) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc() == 0x1cc) device_spin_until_interrupt(&space.device());
}
#endif
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index fbc6b0dedee..7fd8b8d7a4d 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -131,7 +131,7 @@ READ8_MEMBER(macs_state::macs_input_r)
case 5: return ioport("DSW3")->read();
case 6: return ioport("DSW4")->read();
case 7: return ioport("SYS1")->read();
- default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",cpu_get_pc(&space.device()),offset+0xc0);
+ default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",space.device().safe_pc(),offset+0xc0);
}
return 0xff;
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index aa0d8e10996..9da494c34a6 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -110,7 +110,7 @@ WRITE8_MEMBER(mainevt_state::mainevt_sh_bankswitch_w)
{
int bank_A, bank_B;
-//logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(&space.device()),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);
@@ -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",cpu_get_pc(&space->device()),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/malzak.c b/src/mame/drivers/malzak.c
index 92ce4a5271c..531cdf792a8 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -152,7 +152,7 @@ WRITE8_MEMBER(malzak_state::port40_w)
// Bits 1-3 are all set high upon death, until the game continues
// Bit 6 is used only in Malzak II, and is set high after checking
// the selected version
-// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(machine().device("maincpu")), data);
+// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", machine().device("maincpu")->safe_pc(), data);
membank("bank1")->set_entry((data & 0x40) >> 6);
}
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index 1b7a90fe749..fe229ac3e95 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -569,8 +569,8 @@ READ8_MEMBER(mcr_state::nflfoot_ip2_r)
nflfoot_serial_in_active = FALSE;
}
- if (cpu_get_pc(&space.device()) != 0x107)
- logerror("%04X:ip2_r = %02X\n", cpu_get_pc(&space.device()), val);
+ if (space.device().safe_pc() != 0x107)
+ logerror("%04X:ip2_r = %02X\n", space.device().safe_pc(), val);
return val;
}
@@ -580,7 +580,7 @@ WRITE8_MEMBER(mcr_state::nflfoot_op4_w)
z80sio_device *sio = machine().device<z80sio_device>("ipu_sio");
/* bit 7 = J3-7 on IPU board = /RXDA on SIO */
- logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(&space.device()), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1);
+ logerror("%04X:op4_w(%d%d%d)\n", space.device().safe_pc(), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1);
/* look for a non-zero start bit to go active */
if (!nflfoot_serial_out_active && (data & 0x80))
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index b3b63103917..4f3eca5a10c 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -460,7 +460,7 @@ READ8_MEMBER(mcr3_state::turbotag_kludge_r)
/* Unfortunately, the game refuses to start if any bad ROM is */
/* found; to work around this, we catch the checksum byte read */
/* and modify it to what we know we will be getting. */
- if (cpu_get_previouspc(&space.device()) == 0xb29)
+ if (space.device().safe_pcbase() == 0xb29)
return 0x82;
else
return 0x92;
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index cec7259e265..f1ff7258984 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -228,7 +228,7 @@ WRITE16_MEMBER(mcr68_state::pigskin_protection_w)
m_protection_data[3] = m_protection_data[4];
m_protection_data[4] = data & 0xff;
- logerror("%06X:protection_w=%02X\n", cpu_get_previouspc(&space.device()), data & 0xff);
+ logerror("%06X:protection_w=%02X\n", space.device().safe_pcbase(), data & 0xff);
}
}
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index de0f3ea30a8..3f9cbccd683 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -596,7 +596,7 @@ READ32_MEMBER(mediagx_state::parallel_port_r)
{
UINT8 nibble = m_parallel_latched;//(ioport(m_portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
- logerror("%08X:parallel_port_r()\n", cpu_get_pc(&space.device()));
+ logerror("%08X:parallel_port_r()\n", space.device().safe_pc());
#if 0
if (m_controls_data == 0x18)
{
@@ -645,7 +645,7 @@ WRITE32_MEMBER(mediagx_state::parallel_port_w)
7x..ff = advance pointer
*/
- logerror("%08X:", cpu_get_pc(&space.device()));
+ logerror("%08X:", space.device().safe_pc());
m_parallel_latched = (ioport(portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
//parallel_pointer++;
@@ -1266,7 +1266,7 @@ INLINE UINT32 generic_speedup(address_space *space, int idx)
{
mediagx_state *state = space->machine().driver_data<mediagx_state>();
- if (cpu_get_pc(&space->device()) == state->m_speedup_table[idx].pc)
+ if (space->device().safe_pc() == state->m_speedup_table[idx].pc)
{
state->m_speedup_hits[idx]++;
device_spin_until_interrupt(&space->device());
diff --git a/src/mame/drivers/megadrvb.c b/src/mame/drivers/megadrvb.c
index 2b2ac22bd67..2959ae7eb0b 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",cpu_get_pc(&space->device()),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 (cpu_get_pc(&space->device())==0x1b2a56)
+ 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 (cpu_get_pc(&space->device())==0x1b2a72) return 0x0000;
- if (cpu_get_pc(&space->device())==0x1b2d24) return (space->machine().root_device().ioport("MCU")->read() & 0x00f0) | 0x1200; // difficulty
- if (cpu_get_pc(&space->device())==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",cpu_get_pc(&space->device()));
+ logerror("aladbl_r : %06x\n",space->device().safe_pc());
return 0x0000;
}
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index 2bc97c0904a..6d83407f8b4 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -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", cpu_get_previouspc(&space->device()), 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;
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 30b50d48738..beb08cab351 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -472,7 +472,7 @@ static void meritm_switch_banks( running_machine &machine )
WRITE8_MEMBER(meritm_state::meritm_psd_a15_w)
{
m_psd_a15 = data;
- //logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, cpu_get_pc(&space.device()) );
+ //logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, space.device().safe_pc() );
meritm_switch_banks(machine());
};
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index c3c8b43b3c8..fb5fa2fe821 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -174,7 +174,7 @@ static IRQ_CALLBACK( metro_irq_callback )
WRITE16_MEMBER(metro_state::metro_irq_cause_w)
{
- //if (data & ~0x15) logerror("CPU #0 PC %06X : unknown bits of irqcause written: %04X\n", cpu_get_pc(&space.device()), data);
+ //if (data & ~0x15) logerror("CPU #0 PC %06X : unknown bits of irqcause written: %04X\n", space.device().safe_pc(), data);
if (ACCESSING_BITS_0_7)
{
@@ -477,14 +477,14 @@ WRITE16_MEMBER(metro_state::metro_coin_lockout_1word_w)
// coin_lockout_w(machine(), 0, data & 1);
// coin_lockout_w(machine(), 1, data & 2);
}
- if (data & ~3) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n", cpu_get_pc(&space.device()), data);
+ if (data & ~3) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n", space.device().safe_pc(), data);
}
WRITE16_MEMBER(metro_state::metro_coin_lockout_4words_w)
{
// coin_lockout_w(machine(), (offset >> 1) & 1, offset & 1);
- if (data & ~1) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n", cpu_get_pc(&space.device()), data);
+ if (data & ~1) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n", space.device().safe_pc(), data);
}
@@ -608,7 +608,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
int shift = (dst_offs & 0x80) ? 0 : 8;
UINT16 mask = (dst_offs & 0x80) ? 0x00ff : 0xff00;
-// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n", cpu_get_pc(&space.device()), tmap, src_offs, dst_offs);
+// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n", space.device().safe_pc(), tmap, src_offs, dst_offs);
dst_offs >>= 7 + 1;
switch (tmap)
@@ -618,7 +618,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
case 3:
break;
default:
- logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n", cpu_get_pc(&space.device()), tmap);
+ logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n", space.device().safe_pc(), tmap);
return;
}
@@ -628,7 +628,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
src_offs %= src_len;
b1 = blt_read(src, src_offs);
-// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n", cpu_get_pc(&space.device()), b1, src_offs);
+// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n", space.device().safe_pc(), b1, src_offs);
src_offs++;
count = ((~b1) & 0x3f) + 1;
@@ -704,7 +704,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w)
break;
default:
- logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n",cpu_get_pc(&space.device()),b1,src_offs-1);
+ logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n",space.device().safe_pc(),b1,src_offs-1);
return;
}
@@ -781,7 +781,7 @@ READ16_MEMBER(metro_state::balcube_dsw_r)
case 0x17FFE: return BIT(dsw2, 6) ? 0x40 : 0;
case 0x0FFFE: return BIT(dsw2, 7) ? 0x40 : 0;
}
- logerror("CPU #0 PC %06X : unknown dsw address read: %04X\n", cpu_get_pc(&space.device()), offset);
+ logerror("CPU #0 PC %06X : unknown dsw address read: %04X\n", space.device().safe_pc(), offset);
return 0xffff;
}
diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c
index 9bdc9f06a0b..55d1224ea55 100644
--- a/src/mame/drivers/midqslvr.c
+++ b/src/mame/drivers/midqslvr.c
@@ -273,7 +273,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", cpu_get_pc(&space->device()), function, reg);
+ printf("%08x PIIX4: read %d, %02X\n", space->device().safe_pc(), function, reg);
return state->m_piix4_config_reg[function][reg];
}
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index 873b0bc2868..31664f4be6a 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -253,13 +253,13 @@ READ32_MEMBER(midvunit_state::tms32031_control_r)
/* timer is clocked at 100ns */
int which = (offset >> 4) & 1;
INT32 result = (m_timer[which]->time_elapsed() * m_timer_rate).as_double();
-// logerror("%06X:tms32031_control_r(%02X) = %08X\n", cpu_get_pc(&space.device()), offset, result);
+// logerror("%06X:tms32031_control_r(%02X) = %08X\n", space.device().safe_pc(), offset, result);
return result;
}
/* log anything else except the memory control register */
if (offset != 0x64)
- logerror("%06X:tms32031_control_r(%02X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:tms32031_control_r(%02X)\n", space.device().safe_pc(), offset);
return m_tms32031_control[offset];
}
@@ -277,7 +277,7 @@ WRITE32_MEMBER(midvunit_state::tms32031_control_w)
else if (offset == 0x20 || offset == 0x30)
{
int which = (offset >> 4) & 1;
-// logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space.device()), offset, data);
+// logerror("%06X:tms32031_control_w(%02X) = %08X\n", space.device().safe_pc(), offset, data);
if (data & 0x40)
m_timer[which]->reset();
@@ -288,7 +288,7 @@ WRITE32_MEMBER(midvunit_state::tms32031_control_w)
m_timer_rate = 10000000.;
}
else
- logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:tms32031_control_w(%02X) = %08X\n", space.device().safe_pc(), offset, data);
}
@@ -409,7 +409,7 @@ READ32_MEMBER(midvunit_state::midvplus_misc_r)
}
if (offset != 0 && offset != 3)
- logerror("%06X:midvplus_misc_r(%d) = %08X\n", cpu_get_pc(&space.device()), offset, result);
+ logerror("%06X:midvplus_misc_r(%d) = %08X\n", space.device().safe_pc(), offset, result);
return result;
}
@@ -438,7 +438,7 @@ WRITE32_MEMBER(midvunit_state::midvplus_misc_w)
}
if (logit)
- logerror("%06X:midvplus_misc_w(%d) = %08X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:midvplus_misc_w(%d) = %08X\n", space.device().safe_pc(), offset, data);
}
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index e4f5bfa00b3..ccb55d40783 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -134,7 +134,7 @@ WRITE32_MEMBER(midzeus_state::cmos_w)
if (bitlatch[2] && !cmos_protected)
COMBINE_DATA(&m_nvram[offset]);
else
- logerror("%06X:timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", cpu_get_pc(&space.device()), bitlatch[2], cmos_protected);
+ logerror("%06X:timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", space.device().safe_pc(), bitlatch[2], cmos_protected);
cmos_protected = TRUE;
}
@@ -188,7 +188,7 @@ WRITE32_MEMBER(midzeus_state::zpram_w)
if (bitlatch[2])
COMBINE_DATA(&m_nvram[offset]);
else
- logerror("%06X:zpram_w with bitlatch[2] = %d\n", cpu_get_pc(&space.device()), bitlatch[2]);
+ logerror("%06X:zpram_w with bitlatch[2] = %d\n", space.device().safe_pc(), bitlatch[2]);
}
@@ -229,7 +229,7 @@ READ32_MEMBER(midzeus_state::bitlatches_r)
/* unknown purpose */
default:
- logerror("%06X:bitlatches_r(%X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:bitlatches_r(%X)\n", space.device().safe_pc(), offset);
break;
}
return ~0;
@@ -246,19 +246,19 @@ WRITE32_MEMBER(midzeus_state::bitlatches_w)
/* unknown purpose */
default:
if (oldval ^ data)
- logerror("%06X:bitlatches_w(%X) = %X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X\n", space.device().safe_pc(), offset, data);
break;
/* unknown purpose; crusnexo toggles this between 0 and 1 every 20 frames; thegrid writes 1 */
case 0:
if (data != 0 && data != 1)
- logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
break;
/* unknown purpose; mk4/invasn write 1 here at initialization; crusnexo/thegrid write 3 */
case 1:
if (data != 1 && data != 3)
- logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
break;
/* CMOS/ZPRAM extra enable latch; only low bit is used */
@@ -268,7 +268,7 @@ WRITE32_MEMBER(midzeus_state::bitlatches_w)
/* unknown purpose; invasn writes 2 here at startup */
case 4:
if (data != 2)
- logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
break;
/* ROM bank selection on Zeus 2 */
@@ -279,19 +279,19 @@ WRITE32_MEMBER(midzeus_state::bitlatches_w)
/* unknown purpose; crusnexo/thegrid write 1 at startup */
case 7:
if (data != 1)
- logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
break;
/* unknown purpose; crusnexo writes 4 at startup; thegrid writes 6 */
case 8:
if (data != 4 && data != 6)
- logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
break;
/* unknown purpose; thegrid writes 1 at startup */
case 9:
if (data != 1)
- logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
break;
}
}
@@ -357,7 +357,7 @@ WRITE32_MEMBER(midzeus_state::crusnexo_leds_w)
READ32_MEMBER(midzeus_state::linkram_r)
{
- logerror("%06X:unknown_8a000_r(%02X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:unknown_8a000_r(%02X)\n", space.device().safe_pc(), offset);
if (offset == 0)
return 0x30313042;
else if (offset == 0x3c)
@@ -367,7 +367,7 @@ READ32_MEMBER(midzeus_state::linkram_r)
WRITE32_MEMBER(midzeus_state::linkram_w)
{
- logerror("%06X:unknown_8a000_w(%02X) = %08X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:unknown_8a000_w(%02X) = %08X\n", space.device().safe_pc(), offset, data);
COMBINE_DATA(&linkram[offset]);
}
@@ -392,7 +392,7 @@ READ32_MEMBER(midzeus_state::tms32031_control_r)
/* log anything else except the memory control register */
if (offset != 0x64)
- logerror("%06X:tms32031_control_r(%02X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:tms32031_control_r(%02X)\n", space.device().safe_pc(), offset);
return tms32031_control[offset];
}
@@ -414,7 +414,7 @@ WRITE32_MEMBER(midzeus_state::tms32031_control_w)
timer[which]->adjust(attotime::never);
}
else
- logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%06X:tms32031_control_w(%02X) = %08X\n", space.device().safe_pc(), offset, data);
}
@@ -465,7 +465,7 @@ READ32_MEMBER(midzeus_state::analog_r)
{
static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" };
if (offset < 8 || offset > 11)
- logerror("%06X:analog_r(%X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:analog_r(%X)\n", space.device().safe_pc(), offset);
return ioport(tags[offset & 3])->read();
}
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index 1bd8a557705..d31b7d11c09 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -555,7 +555,7 @@ static MACHINE_RESET( missile )
INLINE int get_madsel(address_space *space)
{
missile_state *state = space->machine().driver_data<missile_state>();
- UINT16 pc = cpu_get_previouspc(&space->device());
+ 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)
@@ -766,7 +766,7 @@ WRITE8_MEMBER(missile_state::missile_w)
/* anything else */
else
- logerror("%04X:Unknown write to %04X = %02X\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%04X:Unknown write to %04X = %02X\n", space.device().safe_pc(), offset, data);
}
@@ -821,7 +821,7 @@ READ8_MEMBER(missile_state::missile_r)
/* anything else */
else
- logerror("%04X:Unknown read from %04X\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04X:Unknown read from %04X\n", space.device().safe_pc(), offset);
return result;
}
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index e8825829648..386d50ef7e7 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -280,7 +280,7 @@ WRITE8_MEMBER(mitchell_state::input_w)
{
case 0:
default:
- logerror("PC %04x: write %02x to port 01\n", cpu_get_pc(&space.device()), data);
+ logerror("PC %04x: write %02x to port 01\n", space.device().safe_pc(), data);
break;
case 1:
mahjong_input_select_w(space, offset, data);
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index bad7c32e8f4..0cbf5902b5f 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -164,7 +164,7 @@ READ8_MEMBER(mjkjidai_state::keyboard_r)
int res = 0x3f,i;
static const char *const keynames[] = { "PL2_1", "PL2_2", "PL2_3", "PL2_4", "PL2_5", "PL2_6", "PL1_1", "PL1_2", "PL1_3", "PL1_4", "PL1_5", "PL1_6" };
-// logerror("%04x: keyboard_r\n", cpu_get_pc(&space.device()));
+// logerror("%04x: keyboard_r\n", space.device().safe_pc());
for (i = 0; i < 12; i++)
{
@@ -189,7 +189,7 @@ READ8_MEMBER(mjkjidai_state::keyboard_r)
WRITE8_MEMBER(mjkjidai_state::keyboard_select_w)
{
-// logerror("%04x: keyboard_select %d = %02x\n",cpu_get_pc(&space.device()),offset,data);
+// logerror("%04x: keyboard_select %d = %02x\n",space.device().safe_pc(),offset,data);
switch (offset)
{
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index da4cfbfcbba..75c0cbf315d 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -218,7 +218,7 @@ WRITE8_MEMBER(mjsister_state::mjsister_banksel1_w)
case 0xf: m_vrambank = 1 ; break;
default:
- logerror("%04x p30_w:%02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x p30_w:%02x\n", space.device().safe_pc(), data);
}
if (tmp != m_colorbank)
@@ -239,7 +239,7 @@ WRITE8_MEMBER(mjsister_state::mjsister_banksel2_w)
case 0xd: m_rombank1 = 1; break;
default:
- logerror("%04x p31_w:%02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%04x p31_w:%02x\n", space.device().safe_pc(), data);
}
membank("bank1")->set_entry(m_rombank0 * 2 + m_rombank1);
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index 600f1b9f462..2cbf710fa49 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -797,7 +797,7 @@ WRITE16_MEMBER(model1_state::md1_w)
if(0 && offset)
return;
if(1 && m_dump)
- logerror("TGP: md1_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("TGP: md1_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc());
}
WRITE16_MEMBER(model1_state::md0_w)
@@ -806,7 +806,7 @@ WRITE16_MEMBER(model1_state::md0_w)
if(0 && offset)
return;
if(1 && m_dump)
- logerror("TGP: md0_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("TGP: md0_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc());
}
WRITE16_MEMBER(model1_state::p_w)
@@ -814,14 +814,14 @@ WRITE16_MEMBER(model1_state::p_w)
UINT16 old = m_generic_paletteram_16[offset];
paletteram_xBBBBBGGGGGRRRRR_word_w(space, offset, data, mem_mask);
if(0 && m_generic_paletteram_16[offset] != old)
- logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc());
}
WRITE16_MEMBER(model1_state::mr_w)
{
COMBINE_DATA(m_mr+offset);
if(0 && offset == 0x1138/2)
- logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x500000, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x500000, data, mem_mask, space.device().safe_pc());
}
WRITE16_MEMBER(model1_state::mr2_w)
@@ -829,23 +829,23 @@ WRITE16_MEMBER(model1_state::mr2_w)
COMBINE_DATA(m_mr2+offset);
#if 0
if(0 && offset == 0x6e8/2) {
- logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x400000, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x400000, data, mem_mask, space.device().safe_pc());
}
if(offset/2 == 0x3680/4)
- logerror("MW f80[r25], %04x%04x (%x)\n", m_mr2[0x3680/2+1], m_mr2[0x3680/2], cpu_get_pc(&space.device()));
+ logerror("MW f80[r25], %04x%04x (%x)\n", m_mr2[0x3680/2+1], m_mr2[0x3680/2], space.device().safe_pc());
if(offset/2 == 0x06ca/4)
- logerror("MW fca[r19], %04x%04x (%x)\n", m_mr2[0x06ca/2+1], m_mr2[0x06ca/2], cpu_get_pc(&space.device()));
+ logerror("MW fca[r19], %04x%04x (%x)\n", m_mr2[0x06ca/2+1], m_mr2[0x06ca/2], space.device().safe_pc());
if(offset/2 == 0x1eca/4)
- logerror("MW fca[r22], %04x%04x (%x)\n", m_mr2[0x1eca/2+1], m_mr2[0x1eca/2], cpu_get_pc(&space.device()));
+ logerror("MW fca[r22], %04x%04x (%x)\n", m_mr2[0x1eca/2+1], m_mr2[0x1eca/2], space.device().safe_pc());
#endif
// wingwar scene position, pc=e1ce -> d735
if(offset/2 == 0x1f08/4)
- logerror("MW 8[r10], %f (%x)\n", *(float *)(m_mr2+0x1f08/2), cpu_get_pc(&space.device()));
+ logerror("MW 8[r10], %f (%x)\n", *(float *)(m_mr2+0x1f08/2), space.device().safe_pc());
if(offset/2 == 0x1f0c/4)
- logerror("MW c[r10], %f (%x)\n", *(float *)(m_mr2+0x1f0c/2), cpu_get_pc(&space.device()));
+ logerror("MW c[r10], %f (%x)\n", *(float *)(m_mr2+0x1f0c/2), space.device().safe_pc());
if(offset/2 == 0x1f10/4)
- logerror("MW 10[r10], %f (%x)\n", *(float *)(m_mr2+0x1f10/2), cpu_get_pc(&space.device()));
+ logerror("MW 10[r10], %f (%x)\n", *(float *)(m_mr2+0x1f10/2), space.device().safe_pc());
}
READ16_MEMBER(model1_state::snd_68k_ready_r)
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index c1a593d4c37..806f6883c91 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -119,7 +119,7 @@ static int copro_fifoin_pop(device_t *device, UINT32 *result)
if (state->m_dsp_type == DSP_TYPE_TGP)
return 0;
- fatalerror("Copro FIFOIN underflow (at %08X)\n", cpu_get_pc(device));
+ fatalerror("Copro FIFOIN underflow (at %08X)\n", device->safe_pc());
return 0;
}
@@ -153,11 +153,11 @@ static void copro_fifoin_push(device_t *device, UINT32 data)
model2_state *state = device->machine().driver_data<model2_state>();
if (state->m_copro_fifoin_num == COPRO_FIFOIN_SIZE)
{
- fatalerror("Copro FIFOIN overflow (at %08X)\n", cpu_get_pc(device));
+ fatalerror("Copro FIFOIN overflow (at %08X)\n", device->safe_pc());
return;
}
- //mame_printf_debug("COPRO FIFOIN at %08X, %08X, %f\n", cpu_get_pc(device), data, *(float*)&data);
+ //mame_printf_debug("COPRO FIFOIN at %08X, %08X, %f\n", device->safe_pc(), data, *(float*)&data);
state->m_copro_fifoin_data[state->m_copro_fifoin_wpos++] = data;
if (state->m_copro_fifoin_wpos == COPRO_FIFOIN_SIZE)
@@ -225,7 +225,7 @@ static void copro_fifoout_push(device_t *device, UINT32 data)
//if (state->m_copro_fifoout_wpos == state->m_copro_fifoout_rpos)
if (state->m_copro_fifoout_num == COPRO_FIFOOUT_SIZE)
{
- fatalerror("Copro FIFOOUT overflow (at %08X)\n", cpu_get_pc(device));
+ fatalerror("Copro FIFOOUT overflow (at %08X)\n", device->safe_pc());
return;
}
@@ -666,7 +666,7 @@ WRITE32_MEMBER(model2_state::copro_fifo_w)
}
else
{
- //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
+ //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
if (m_dsp_type == DSP_TYPE_SHARC)
copro_fifoin_push(machine().device("dsp"), data);
else
@@ -777,7 +777,7 @@ WRITE32_MEMBER(model2_state::geo_sharc_fifo_w)
}
else
{
- //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
+ //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
}
}
@@ -843,7 +843,7 @@ READ32_MEMBER(model2_state::geo_r)
}
// fatalerror("geo_r: %08X, %08X\n", address, mem_mask);
- mame_printf_debug("geo_r: PC:%08x - %08X\n", cpu_get_pc(&space.device()), address);
+ mame_printf_debug("geo_r: PC:%08x - %08X\n", space.device().safe_pc(), address);
return 0;
}
@@ -1074,7 +1074,7 @@ READ32_MEMBER(model2_state::model2_prot_r)
else
return 0xfff0;
}
- else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, cpu_get_pc(&space.device()));
+ else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, space.device().safe_pc());
return retval;
}
@@ -1144,7 +1144,7 @@ WRITE32_MEMBER(model2_state::model2_prot_w)
strcpy((char *)m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00");
}
}
- else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
+ else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
}
@@ -1905,7 +1905,7 @@ static const scsp_interface scsp_config =
READ32_MEMBER(model2_state::copro_sharc_input_fifo_r)
{
UINT32 result = 0;
- //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(&space.device()));
+ //mame_printf_debug("SHARC FIFOIN pop at %08X\n", space.device().safe_pc());
copro_fifoin_pop(machine().device("dsp"), &result);
return result;
@@ -1924,7 +1924,7 @@ READ32_MEMBER(model2_state::copro_sharc_buffer_r)
WRITE32_MEMBER(model2_state::copro_sharc_buffer_w)
{
- //mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, cpu_get_pc(&space.device()), data, *(float*)&data);
+ //mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, space.device().safe_pc(), data, *(float*)&data);
m_bufferram[offset & 0x7fff] = data;
}
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 27428c4cee0..8ce01cda2fb 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1183,7 +1183,7 @@ static void real3d_dma_callback(running_machine &machine, UINT32 src, UINT32 dst
case 0x9c: /* Unknown */
break;
default:
- logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine.device("maincpu")));
+ logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, machine.device("maincpu")->safe_pc());
break;
}
}
@@ -1464,7 +1464,7 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w)
}
break;
default:
- //mame_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), cpu_get_pc(&space.device()));
+ //mame_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), space.device().safe_pc());
break;
}
}
@@ -1491,7 +1491,7 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w)
READ64_MEMBER(model3_state::model3_sys_r)
{
-// printf("model3_sys_r: mask %llx @ %x (PC %x)\n", mem_mask, offset, cpu_get_pc(&space.device()));
+// printf("model3_sys_r: mask %llx @ %x (PC %x)\n", mem_mask, offset, space.device().safe_pc());
switch (offset)
{
@@ -1516,7 +1516,7 @@ READ64_MEMBER(model3_state::model3_sys_r)
else logerror("m3_sys: Unk sys_r @ 0x10: mask = %x\n", (UINT32)mem_mask);
break;
case 0x18/8:
-// printf("read irq_state %x (PC %x)\n", m_irq_state, cpu_get_pc(&space.device()));
+// printf("read irq_state %x (PC %x)\n", m_irq_state, space.device().safe_pc());
return (UINT64)m_irq_state<<56 | 0xff000000;
}
@@ -1668,14 +1668,14 @@ WRITE8_MEMBER(model3_state::model3_sound_w)
READ64_MEMBER(model3_state::network_r)
{
- mame_printf_debug("network_r: %02X at %08X\n", offset, cpu_get_pc(&space.device()));
+ mame_printf_debug("network_r: %02X at %08X\n", offset, space.device().safe_pc());
return m_network_ram[offset];
}
WRITE64_MEMBER(model3_state::network_w)
{
COMBINE_DATA(m_network_ram + offset);
- mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), cpu_get_pc(&space.device()));
+ mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), space.device().safe_pc());
}
diff --git a/src/mame/drivers/mole.c b/src/mame/drivers/mole.c
index 5857f81a9bb..d244da1bd21 100644
--- a/src/mame/drivers/mole.c
+++ b/src/mame/drivers/mole.c
@@ -165,7 +165,7 @@ READ8_MEMBER(mole_state::mole_protection_r)
{
case 0x08: return 0xb0; /* random mole placement */
case 0x26:
- if (cpu_get_pc(&space.device()) == 0x53d7)
+ if (space.device().safe_pc() == 0x53d7)
{
return 0x06; /* bonus round */
}
diff --git a/src/mame/drivers/monzagp.c b/src/mame/drivers/monzagp.c
index 390e3d68c89..98ed2c7bf81 100644
--- a/src/mame/drivers/monzagp.c
+++ b/src/mame/drivers/monzagp.c
@@ -179,17 +179,17 @@ WRITE8_MEMBER(monzagp_state::port_w)
WRITE8_MEMBER(monzagp_state::port0_w)
{
-// printf("P0 %x = %x\n",cpu_get_pc(&space.device()),data);
+// printf("P0 %x = %x\n",space.device().safe_pc(),data);
}
WRITE8_MEMBER(monzagp_state::port1_w)
{
-// printf("P1 %x = %x\n",cpu_get_pc(&space.device()),data);
+// printf("P1 %x = %x\n",space.device().safe_pc(),data);
}
WRITE8_MEMBER(monzagp_state::port2_w)
{
-// printf("P2 %x = %x\n",cpu_get_pc(&space.device()),data);
+// printf("P2 %x = %x\n",space.device().safe_pc(),data);
m_coordy=data;
}
diff --git a/src/mame/drivers/mosaic.c b/src/mame/drivers/mosaic.c
index 4b5409d6031..dea7d832020 100644
--- a/src/mame/drivers/mosaic.c
+++ b/src/mame/drivers/mosaic.c
@@ -41,7 +41,7 @@ READ8_MEMBER(mosaic_state::protection_r)
{
int res = (m_prot_val >> 8) & 0xff;
- logerror("%06x: protection_r %02x\n", cpu_get_pc(&space.device()), res);
+ logerror("%06x: protection_r %02x\n", space.device().safe_pc(), res);
m_prot_val <<= 8;
@@ -51,7 +51,7 @@ READ8_MEMBER(mosaic_state::protection_r)
WRITE8_MEMBER(mosaic_state::gfire2_protection_w)
{
- logerror("%06x: protection_w %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: protection_w %02x\n", space.device().safe_pc(), data);
switch(data)
{
diff --git a/src/mame/drivers/mpu3.c b/src/mame/drivers/mpu3.c
index 4f0da829c11..8f23904564f 100644
--- a/src/mame/drivers/mpu3.c
+++ b/src/mame/drivers/mpu3.c
@@ -811,7 +811,7 @@ WRITE8_MEMBER(mpu3_state::characteriser_w)
int x;
int call=data;
if (!m_current_chr_table)
- fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device()));
+ fatalerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
if (offset == 0)
{
@@ -839,7 +839,7 @@ WRITE8_MEMBER(mpu3_state::characteriser_w)
READ8_MEMBER(mpu3_state::characteriser_r)
{
if (!m_current_chr_table)
- fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device()));
+ fatalerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
if (offset == 0)
{
diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c
index a844bf0c2d0..a6f2122d4ac 100644
--- a/src/mame/drivers/mpu4hw.c
+++ b/src/mame/drivers/mpu4hw.c
@@ -2075,10 +2075,10 @@ WRITE8_MEMBER(mpu4_state::characteriser_w)
{
int x;
int call=data;
- LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(&space.device()),offset,data));
+ LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", space.device().safe_pcbase(),offset,data));
if (!m_current_chr_table)
{
- logerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device()));
+ logerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
return;
}
@@ -2145,7 +2145,7 @@ READ8_MEMBER(mpu4_state::characteriser_r)
{
if (!m_current_chr_table)
{
- logerror("No Characteriser Table @ %04x", cpu_get_previouspc(&space.device()));
+ logerror("No Characteriser Table @ %04x", space.device().safe_pcbase());
/* a cheat ... many early games use a standard check */
int addr = cpu_get_reg(&space.device(), M6809_X);
@@ -2215,9 +2215,9 @@ WRITE8_MEMBER(mpu4_state::bwb_characteriser_w)
{
int x;
int call=data;
- LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", cpu_get_previouspc(&space.device()),offset,data));
+ LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", space.device().safe_pcbase(),offset,data));
if (!m_current_chr_table)
- fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device()));
+ fatalerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase());
if ((offset & 0x3f)== 0)//initialisation is always at 0x800
{
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index b0059e15f7b..fdb0ea768ac 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -1600,11 +1600,11 @@ static WRITE16_HANDLER( characteriser16_w )
mpu4_state *state = space->machine().driver_data<mpu4_state>();
int x;
int call=data;
- LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(&space->device()),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", cpu_get_previouspc(&space->device()));
+ logerror("No Characteriser Table @ %04x\n", space->device().safe_pcbase());
return;
}
@@ -1630,19 +1630,19 @@ 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", cpu_get_previouspc(&space->device()),offset,state->m_current_chr_table[state->m_prot_col].response));
+ 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", cpu_get_previouspc(&space->device()));
+ 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 (cpu_get_previouspc(&space->device())==0x283a)
+ if (space->device().safe_pcbase()==0x283a)
{
return 0x00;
}
@@ -1672,10 +1672,10 @@ static WRITE16_HANDLER( bwb_characteriser16_w )
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", cpu_get_previouspc(&space->device()),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", cpu_get_previouspc(&space->device()));
+ logerror("No Characteriser Table @ %04x\n", space->device().safe_pcbase());
return;
}
diff --git a/src/mame/drivers/mpu5hw.c b/src/mame/drivers/mpu5hw.c
index b1f7d6d4c1c..0f692b44b57 100644
--- a/src/mame/drivers/mpu5hw.c
+++ b/src/mame/drivers/mpu5hw.c
@@ -64,7 +64,7 @@ protected:
READ32_MEMBER(mpu5_state::mpu5_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
@@ -86,7 +86,7 @@ READ32_MEMBER(mpu5_state::mpu5_mem_r)
WRITE32_MEMBER(mpu5_state::mpu5_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index e1fbea21d52..05615d68038 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -100,7 +100,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( output_w )
{
if (ACCESSING_BITS_0_7)
- logerror("%06x:output_w(%x) = %02x\n", cpu_get_pc(&space->device()), offset, data);
+ logerror("%06x:output_w(%x) = %02x\n", space->device().safe_pc(), offset, data);
}
@@ -108,13 +108,13 @@ 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", cpu_get_pc(&space->device()), offset, mem_mask);
+ 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", cpu_get_pc(&space->device()), 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/msisaac.c b/src/mame/drivers/msisaac.c
index 7b81673328e..d348f964e2d 100644
--- a/src/mame/drivers/msisaac.c
+++ b/src/mame/drivers/msisaac.c
@@ -145,7 +145,7 @@ MCU simulation TODO:
return 0x45;
default:
- logerror("CPU#0 read from MCU pc=%4x, mcu_val=%2x\n", cpu_get_pc(&space.device()), m_mcu_val);
+ logerror("CPU#0 read from MCU pc=%4x, mcu_val=%2x\n", space.device().safe_pc(), m_mcu_val);
return m_mcu_val;
}
#endif
@@ -166,7 +166,7 @@ WRITE8_MEMBER(msisaac_state::msisaac_mcu_w)
buggychl_mcu_w(offset,data);
#else
//if(data != 0x0a && data != 0x42 && data != 0x02)
- // popmessage("PC = %04x %02x", cpu_get_pc(&space.device()), data);
+ // popmessage("PC = %04x %02x", space.device().safe_pc(), data);
m_mcu_val = data;
#endif
}
diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c
index 5fb2d8a7cf5..9a601f42514 100644
--- a/src/mame/drivers/mw8080bw.c
+++ b/src/mame/drivers/mw8080bw.c
@@ -2191,7 +2191,7 @@ WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w)
m_spcenctr_trench_width = data; /* - - - - - 1 1 1 */
else
- logerror("%04x: Unmapped I/O port write to %02x = %02x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("%04x: Unmapped I/O port write to %02x = %02x\n", space.device().safe_pc(), offset, data);
}
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index f84a91b7e4e..ce2b10700ae 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -235,7 +235,7 @@ WRITE16_MEMBER(mystwarr_state::K053247_scattered_word_w)
{
if (offset & 0x0078)
{
-// mame_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, cpu_get_pc(&space.device()));
+// mame_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, space.device().safe_pc());
COMBINE_DATA(m_spriteram+offset);
}
else
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index 8d4cbcb921b..4ed14f1739a 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -787,7 +787,7 @@ READ16_MEMBER(namcona1_state::na1mcu_shared_r)
#if 0
if (offset >= 0x70000/2)
{
- logerror("MD: %04x @ %x PC %x\n", ((data>>8)&0xff) | ((data<<8)&0xff00), offset*2, cpu_get_pc(&space.device()));
+ logerror("MD: %04x @ %x PC %x\n", ((data>>8)&0xff) | ((data<<8)&0xff00), offset*2, space.device().safe_pc());
}
#endif
@@ -844,7 +844,7 @@ WRITE8_MEMBER(namcona1_state::port4_w)
{
if ((data & 0x08) && !(m_mcu_port4 & 0x08))
{
- logerror("launching 68k, PC=%x\n", cpu_get_pc(&space.device()));
+ logerror("launching 68k, PC=%x\n", space.device().safe_pc());
// reset and launch the 68k
cputag_set_input_line(machine(), "maincpu", INPUT_LINE_RESET, CLEAR_LINE);
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index e196beb74bc..3a69cdadccc 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -741,7 +741,7 @@ READ32_MEMBER(namconb1_state::custom_key_r)
break; /* no protection? */
}
- logerror( "custom_key_r(%d); pc=%08x\n", offset, cpu_get_pc(&space.device()) );
+ logerror( "custom_key_r(%d); pc=%08x\n", offset, space.device().safe_pc() );
return 0;
} /* custom_key_r */
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index abeb70ec15b..9584711b6c5 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -421,25 +421,25 @@ READ32_MEMBER(namcos10_state::nand_status_r )
WRITE32_MEMBER(namcos10_state::nand_address1_w )
{
- logerror("nand_a1_w %08x (%08x)\n", data, cpu_get_pc(&space.device()));
+ logerror("nand_a1_w %08x (%08x)\n", data, space.device().safe_pc());
nand_address = ( nand_address & 0x00ffffff ) | ( ( data & 0xff ) << 24 );
}
WRITE32_MEMBER(namcos10_state::nand_address2_w )
{
- logerror("nand_a2_w %08x (%08x)\n", data, cpu_get_pc(&space.device()));
+ logerror("nand_a2_w %08x (%08x)\n", data, space.device().safe_pc());
nand_address = ( nand_address & 0xff00ffff ) | ( ( data & 0xff ) << 16 );
}
WRITE32_MEMBER(namcos10_state::nand_address3_w )
{
- logerror("nand_a3_w %08x (%08x)\n", data, cpu_get_pc(&space.device()));
+ logerror("nand_a3_w %08x (%08x)\n", data, space.device().safe_pc());
nand_address = ( nand_address & 0xffff00ff ) | ( ( data & 0xff ) << 8 );
}
WRITE32_MEMBER(namcos10_state::nand_address4_w )
{
- logerror("nand_a4_w %08x (%08x)\n", data, cpu_get_pc(&space.device()));
+ logerror("nand_a4_w %08x (%08x)\n", data, space.device().safe_pc());
nand_address = ( nand_address & 0xffffff00 ) | ( ( data & 0xff ) << 0 );
}
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index 689e12ce73f..5560efdc7b1 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -757,7 +757,7 @@ WRITE16_MEMBER(namcos11_state::c76_shared_w)
READ16_MEMBER(namcos11_state::c76_inputs_r)
{
-// logerror("'c76' Read port %d @ %06X\n", offset, cpu_get_pc(&space.device()));
+// logerror("'c76' Read port %d @ %06X\n", offset, space.device().safe_pc());
switch (offset)
{
@@ -855,7 +855,7 @@ ADDRESS_MAP_END
READ16_MEMBER(namcos11_state::c76_speedup_r)
{
- if ((cpu_get_pc(&space.device()) == 0xc153) && (!(m_su_83 & 0xff00)))
+ if ((space.device().safe_pc() == 0xc153) && (!(m_su_83 & 0xff00)))
{
device_spin_until_interrupt(&space.device());
}
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index 2db3ea01077..aa1202ae664 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -342,20 +342,20 @@ READ16_MEMBER(namcos21_state::dspcuskey_r)
UINT16 result = 0;
if( m_gametype == NAMCOS21_SOLVALOU )
{
- switch( cpu_get_pc(&space.device()) )
+ switch( space.device().safe_pc() )
{
case 0x805e: result = 0x0000; break;
case 0x805f: result = 0xfeba; break;
case 0x8067: result = 0xffff; break;
case 0x806e: result = 0x0145; break;
default:
- logerror( "unk cuskey_r; pc=0x%x\n", cpu_get_pc(&space.device()) );
+ logerror( "unk cuskey_r; pc=0x%x\n", space.device().safe_pc() );
break;
}
}
else if( m_gametype == NAMCOS21_CYBERSLED )
{
- switch( cpu_get_pc(&space.device()) )
+ switch( space.device().safe_pc() )
{
case 0x8061: result = 0xfe95; break;
case 0x8069: result = 0xffff; break;
@@ -366,7 +366,7 @@ READ16_MEMBER(namcos21_state::dspcuskey_r)
}
else if( m_gametype == NAMCOS21_AIRCOMBAT )
{
- switch( cpu_get_pc(&space.device()) )
+ switch( space.device().safe_pc() )
{
case 0x8062: result = 0xfeb9; break;
case 0x806a: result = 0xffff; break;
@@ -880,7 +880,7 @@ WRITE16_MEMBER(namcos21_state::slave_port3_w)
WRITE16_MEMBER(namcos21_state::slave_XF_output_w)
{
- if (ENABLE_LOGGING) logerror( "0x%x:slaveXF(%d)\n", cpu_get_pc(&space.device()), data );
+ if (ENABLE_LOGGING) logerror( "0x%x:slaveXF(%d)\n", space.device().safe_pc(), data );
} /* slave_XF_output_w */
READ16_MEMBER(namcos21_state::slave_portf_r)
@@ -935,7 +935,7 @@ WRITE16_MEMBER(namcos21_state::pointram_control_w)
#if 0
logerror( "dsp_control_w:'%s':%x[%x]:=%04x ",
cpu->tag,
- cpu_get_pc(cpu),
+ cpu->safe_pc(),
offset,
m_pointram_control );
@@ -1120,7 +1120,7 @@ WRITE16_MEMBER(namcos21_state::winrun_dspcomram_w)
READ16_MEMBER(namcos21_state::winrun_cuskey_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
switch( pc )
{
case 0x0064: /* winrun91 */
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index 5d631971291..638ed0e6bc1 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -1619,7 +1619,7 @@ WRITE16_MEMBER(namcos22_state::upload_code_to_slave_dsp_w)
break;
default:
- logerror( "%08x: master port#7: 0x%04x\n", cpu_get_previouspc(&space.device()), data );
+ logerror( "%08x: master port#7: 0x%04x\n", space.device().safe_pcbase(), data );
break;
}
break;
@@ -2378,7 +2378,7 @@ READ32_MEMBER(namcos22_state::namcos22_keycus_r)
// this chip is also used for reading random values in some games
// for example in timecris to determine where certain enemies will emerge
// but it is not yet understood how this works
-// printf("Hit keycus mask %x PC=%x\n", mem_mask, cpu_get_pc(&space.device()));
+// printf("Hit keycus mask %x PC=%x\n", mem_mask, space.device().safe_pc());
if (ACCESSING_BITS_0_15)
return m_keycus_id;
@@ -5409,7 +5409,7 @@ INPUT_PORTS_END /* Rave Racer */
// for MCU BIOS v1.41
READ16_MEMBER(namcos22_state::mcu141_speedup_r)
{
- if ((cpu_get_pc(&space.device()) == 0xc12d) && (!(m_su_82 & 0xff00)))
+ if ((space.device().safe_pc() == 0xc12d) && (!(m_su_82 & 0xff00)))
{
device_spin_until_interrupt(&space.device());
}
@@ -5425,7 +5425,7 @@ WRITE16_MEMBER(namcos22_state::mcu_speedup_w)
// for MCU BIOS v1.30
READ16_MEMBER(namcos22_state::mcu130_speedup_r)
{
- if ((cpu_get_pc(&space.device()) == 0xc12a) && (!(m_su_82 & 0xff00)))
+ if ((space.device().safe_pc() == 0xc12a) && (!(m_su_82 & 0xff00)))
{
device_spin_until_interrupt(&space.device());
}
@@ -5436,7 +5436,7 @@ READ16_MEMBER(namcos22_state::mcu130_speedup_r)
// for NSTX7702 v1.00 (C74)
READ16_MEMBER(namcos22_state::mcuc74_speedup_r)
{
- if (((cpu_get_pc(&space.device()) == 0xc0df) || (cpu_get_pc(&space.device()) == 0xc101)) && (!(m_su_82 & 0xff00)))
+ if (((space.device().safe_pc() == 0xc0df) || (space.device().safe_pc() == 0xc101)) && (!(m_su_82 & 0xff00)))
{
device_spin_until_interrupt(&space.device());
}
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index ffea2f079ba..59d2a533a14 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -1518,7 +1518,7 @@ READ16_MEMBER(namcos23_state::s23_c417_r)
case 0: return 0x8e | (machine().primary_screen->vblank() ? 0x0000 : 0x8000);
case 1: return c417.adr;
case 4:
- // logerror("c417_r %04x = %04x (%08x, %08x)\n", c417.adr, c417.ram[c417.adr], cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ // logerror("c417_r %04x = %04x (%08x, %08x)\n", c417.adr, c417.ram[c417.adr], space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return c417.ram[c417.adr];
case 5:
if(c417.pointrom_adr >= m_ptrom_limit)
@@ -1531,7 +1531,7 @@ READ16_MEMBER(namcos23_state::s23_c417_r)
}
- logerror("c417_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c417_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return 0;
}
@@ -1553,7 +1553,7 @@ WRITE16_MEMBER(namcos23_state::s23_c417_w)
c417.pointrom_adr = 0;
break;
case 4:
- // logerror("c417_w %04x = %04x (%08x, %08x)\n", c417.adr, data, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ // logerror("c417_w %04x = %04x (%08x, %08x)\n", c417.adr, data, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
COMBINE_DATA(c417.ram + c417.adr);
break;
case 7:
@@ -1561,7 +1561,7 @@ WRITE16_MEMBER(namcos23_state::s23_c417_w)
cputag_set_input_line(machine(), "maincpu", MIPS3_IRQ2, CLEAR_LINE);
break;
default:
- logerror("c417_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c417_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
break;
}
}
@@ -1570,7 +1570,7 @@ READ16_MEMBER(namcos23_state::s23_c412_ram_r)
{
c412_t &c412 = m_c412;
- // logerror("c412_ram_r %06x (%08x, %08x)\n", offset, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ // logerror("c412_ram_r %06x (%08x, %08x)\n", offset, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
if(offset < 0x100000)
return c412.sdram_a[offset & 0xfffff];
else if(offset < 0x200000)
@@ -1587,7 +1587,7 @@ WRITE16_MEMBER(namcos23_state::s23_c412_ram_w)
{
c412_t &c412 = m_c412;
- // logerror("c412_ram_w %06x = %04x (%08x, %08x)\n", offset, data, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ // logerror("c412_ram_w %06x = %04x (%08x, %08x)\n", offset, data, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
if(offset < 0x100000)
COMBINE_DATA(c412.sdram_a + (offset & 0xfffff));
else if(offset < 0x200000)
@@ -1611,7 +1611,7 @@ READ16_MEMBER(namcos23_state::s23_c412_r)
case 10: return s23_c412_ram_r(space, c412.adr, mem_mask);
}
- logerror("c412_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c412_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return 0;
}
@@ -1624,7 +1624,7 @@ WRITE16_MEMBER(namcos23_state::s23_c412_w)
case 9: c412.adr = ((data & mem_mask) << 16) | (c412.adr & (0xffffffff ^ (mem_mask << 16))); break;
case 10: s23_c412_ram_w(space, c412.adr, data, mem_mask); c412.adr += 2; break;
default:
- logerror("c412_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c412_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
break;
}
}
@@ -1633,7 +1633,7 @@ READ16_MEMBER(namcos23_state::s23_c421_ram_r)
{
c421_t &c421 = m_c421;
- // logerror("c421_ram_r %06x (%08x, %08x)\n", offset, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ // logerror("c421_ram_r %06x (%08x, %08x)\n", offset, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
if(offset < 0x40000)
return c421.dram_a[offset & 0x3ffff];
else if(offset < 0x80000)
@@ -1648,7 +1648,7 @@ WRITE16_MEMBER(namcos23_state::s23_c421_ram_w)
{
c421_t &c421 = m_c421;
- // logerror("c421_ram_w %06x = %04x (%08x, %08x)\n", offset, data, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ // logerror("c421_ram_w %06x = %04x (%08x, %08x)\n", offset, data, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
if(offset < 0x40000)
COMBINE_DATA(c421.dram_a + (offset & 0x3ffff));
else if(offset < 0x80000)
@@ -1667,7 +1667,7 @@ READ16_MEMBER(namcos23_state::s23_c421_r)
case 3: return c421.adr;
}
- logerror("c421_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c421_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return 0;
}
@@ -1680,7 +1680,7 @@ WRITE16_MEMBER(namcos23_state::s23_c421_w)
case 2: c421.adr = ((data & mem_mask) << 16) | (c421.adr & (0xffffffff ^ (mem_mask << 16))); break;
case 3: c421.adr = (data & mem_mask) | (c421.adr & (0xffffffff ^ mem_mask)); break;
default:
- logerror("c421_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c421_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
break;
}
}
@@ -1717,11 +1717,11 @@ WRITE16_MEMBER(namcos23_state::s23_ctl_w)
case 6: // gmen wars spams this heavily with 0 prior to starting the GMEN board test
if (data != 0)
- logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
break;
default:
- logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
}
}
@@ -1736,7 +1736,7 @@ READ16_MEMBER(namcos23_state::s23_ctl_r)
return res;
}
}
- logerror("ctl_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("ctl_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return 0xffff;
}
@@ -1780,7 +1780,7 @@ WRITE16_MEMBER(namcos23_state::s23_c361_w)
break;
default:
- logerror("c361_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c361_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
}
}
@@ -1790,7 +1790,7 @@ READ16_MEMBER(namcos23_state::s23_c361_r)
case 5: return machine().primary_screen->vpos()*2 | (machine().primary_screen->vblank() ? 1 : 0);
case 6: return machine().primary_screen->vblank();
}
- logerror("c361_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("c361_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return 0xffff;
}
@@ -2185,7 +2185,7 @@ READ32_MEMBER(namcos23_state::p3d_r)
case 0xa: return 1; // Busy flag
}
- logerror("p3d_r %02x @ %08x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("p3d_r %02x @ %08x (%08x, %08x)\n", offset, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
return 0;
}
@@ -2203,7 +2203,7 @@ WRITE32_MEMBER(namcos23_state::p3d_w)
m_c361.timer->adjust(attotime::never);
return;
}
- logerror("p3d_w %02x, %08x @ %08x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
+ logerror("p3d_w %02x, %08x @ %08x (%08x, %08x)\n", offset, data, mem_mask, space.device().safe_pc(), (unsigned int)cpu_get_reg(&space.device(), MIPS3_R31));
}
static void render_apply_transform(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, poly_vertex &pv)
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index 6112000d61e..961168afdb8 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -156,16 +156,16 @@ READ8_MEMBER(naughtyb_state::popflame_protection_r)/* Not used by bootleg/hack *
return seed00[m_prot_count] | seedxx;
#if 0
- if ( cpu_get_pc(&space.device()) == (0x26F2 + 0x03) )
+ if ( space.device().safe_pc() == (0x26F2 + 0x03) )
{
popflame_prot_count = 0;
return 0x01;
} /* Must not carry when rotated left */
- if ( cpu_get_pc(&space.device()) == (0x26F9 + 0x03) )
+ if ( space.device().safe_pc() == (0x26F9 + 0x03) )
return 0x80; /* Must carry when rotated left */
- if ( cpu_get_pc(&space.device()) == (0x270F + 0x03) )
+ if ( space.device().safe_pc() == (0x270F + 0x03) )
{
switch( popflame_prot_count++ )
{
@@ -175,7 +175,7 @@ READ8_MEMBER(naughtyb_state::popflame_protection_r)/* Not used by bootleg/hack *
case 3: return 0x38; /* x011 1xxx, matches 0x07 at $2693, stored in $400D */
}
}
- logerror("CPU #0 PC %06x: unmapped protection read\n", cpu_get_pc(&space.device()));
+ logerror("CPU #0 PC %06x: unmapped protection read\n", space.device().safe_pc());
return 0x00;
#endif
}
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 34fb3f86138..40bfe45b2ee 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -224,7 +224,7 @@ void neogeo_set_display_counter_msb( address_space *space, UINT16 data )
state->m_display_counter = (state->m_display_counter & 0x0000ffff) | ((UINT32)data << 16);
- if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(&space->device()), state->m_display_counter);
+ if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", space->device().safe_pc(), state->m_display_counter);
}
@@ -234,7 +234,7 @@ void neogeo_set_display_counter_lsb( address_space *space, UINT16 data )
state->m_display_counter = (state->m_display_counter & 0xffff0000) | data;
- if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(&space->device()), 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)
{
@@ -434,7 +434,7 @@ WRITE16_MEMBER(neogeo_state::io_control_w)
// case 0x33: break; // coui lockout
default:
- logerror("PC: %x Unmapped I/O control write. Offset: %x Data: %x\n", cpu_get_pc(&space.device()), offset, data);
+ logerror("PC: %x Unmapped I/O control write. Offset: %x Data: %x\n", space.device().safe_pc(), offset, data);
break;
}
}
@@ -460,7 +460,7 @@ READ16_MEMBER(neogeo_state::neogeo_unmapped_r)
else
{
m_recurse = 1;
- ret = space.read_word(cpu_get_pc(&space.device()));
+ ret = space.read_word(space.device().safe_pc());
m_recurse = 0;
}
@@ -583,7 +583,7 @@ WRITE16_MEMBER(neogeo_state::audio_command_w)
/* boost the interleave to let the audio CPU read the command */
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
- if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(&space.device()), data, mem_mask);
+ if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", space.device().safe_pc(), data, mem_mask);
}
}
@@ -592,7 +592,7 @@ READ8_MEMBER(neogeo_state::audio_command_r)
{
UINT8 ret = soundlatch_byte_r(space, 0);
- if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(&space.device()), ret);
+ if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", space.device().safe_pc(), ret);
/* this is a guess */
audio_cpu_clear_nmi_w(space, 0, 0);
@@ -604,7 +604,7 @@ READ8_MEMBER(neogeo_state::audio_command_r)
WRITE8_MEMBER(neogeo_state::audio_result_w)
{
- if (LOG_CPU_COMM && (m_audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(&space.device()), data);
+ if (LOG_CPU_COMM && (m_audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", space.device().safe_pc(), data);
m_audio_result = data;
}
@@ -614,7 +614,7 @@ CUSTOM_INPUT_MEMBER(neogeo_state::get_audio_result)
{
UINT32 ret = m_audio_result;
-// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(machine().device("maincpu")), ret);
+// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", machine().device("maincpu")->safe_pc(), ret);
return ret;
}
@@ -654,7 +654,7 @@ void neogeo_set_main_cpu_bank_address( address_space *space, UINT32 bank_address
{
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", cpu_get_pc(&space->device()), 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;
@@ -668,14 +668,14 @@ WRITE16_MEMBER(neogeo_state::main_cpu_bank_select_w)
UINT32 len = memregion("maincpu")->bytes();
if ((len <= 0x100000) && (data & 0x07))
- logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", cpu_get_pc(&space.device()), data);
+ logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", space.device().safe_pc(), data);
else
{
bank_address = ((data & 0x07) + 1) * 0x100000;
if (bank_address >= len)
{
- logerror("PC %06x: warning: bankswitch to empty bank %02x\n", cpu_get_pc(&space.device()), data);
+ logerror("PC %06x: warning: bankswitch to empty bank %02x\n", space.device().safe_pc(), data);
bank_address = 0x100000;
}
@@ -721,7 +721,7 @@ static void audio_cpu_bank_select( address_space *space, int region, UINT8 bank
{
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", cpu_get_pc(&space->device()), 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;
@@ -777,7 +777,7 @@ static void _set_audio_cpu_rom_source( address_space *space )
cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", cpu_get_pc(&space->device()), 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");
}
}
@@ -858,11 +858,11 @@ WRITE16_MEMBER(neogeo_state::system_control_w)
case 0x02: /* unknown - HC32 middle pin 1 */
case 0x03: /* unknown - uPD4990 pin ? */
case 0x04: /* unknown - HC32 middle pin 10 */
- logerror("PC: %x Unmapped system control write. Offset: %x Data: %x\n", cpu_get_pc(&space.device()), offset & 0x07, bit);
+ logerror("PC: %x Unmapped system control write. Offset: %x Data: %x\n", space.device().safe_pc(), offset & 0x07, bit);
break;
}
- if (LOG_VIDEO_SYSTEM && ((offset & 0x07) != 0x06)) logerror("PC: %x System control write. Offset: %x Data: %x\n", cpu_get_pc(&space.device()), offset & 0x07, bit);
+ if (LOG_VIDEO_SYSTEM && ((offset & 0x07) != 0x06)) logerror("PC: %x System control write. Offset: %x Data: %x\n", space.device().safe_pc(), offset & 0x07, bit);
}
}
diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c
index 0db3ac64b39..ebbe242137d 100644
--- a/src/mame/drivers/neoprint.c
+++ b/src/mame/drivers/neoprint.c
@@ -131,8 +131,8 @@ SCREEN_UPDATE_IND16(nprsp)
READ16_MEMBER(neoprint_state::neoprint_calendar_r)
{
- //if(cpu_get_pc(&space.device()) != 0x4b38 )//&& cpu_get_pc(&space.device()) != 0x5f86 && cpu_get_pc(&space.device()) != 0x5f90)
- // printf("%08x\n",cpu_get_pc(&space.device()));
+ //if(space.device().safe_pc() != 0x4b38 )//&& space.device().safe_pc() != 0x5f86 && space.device().safe_pc() != 0x5f90)
+ // printf("%08x\n",space.device().safe_pc());
return (upd4990a_databit_r(machine().device("upd4990a"), 0) << 15);
}
@@ -151,8 +151,8 @@ READ8_MEMBER(neoprint_state::neoprint_unk_r)
m_vblank = (machine().primary_screen->frame_number() & 0x1) ? 0x10 : 0x00;
- //if(cpu_get_pc(&space.device()) != 0x1504 && cpu_get_pc(&space.device()) != 0x5f86 && cpu_get_pc(&space.device()) != 0x5f90)
- // printf("%08x\n",cpu_get_pc(&space.device()));
+ //if(space.device().safe_pc() != 0x1504 && space.device().safe_pc() != 0x5f86 && space.device().safe_pc() != 0x5f90)
+ // printf("%08x\n",space.device().safe_pc());
return m_vblank| 4 | 3;
}
@@ -185,7 +185,7 @@ WRITE16_MEMBER(neoprint_state::audio_command_w)
/* boost the interleave to let the audio CPU read the command */
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
- //if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(&space.device()), data, mem_mask);
+ //if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", space.device().safe_pc(), data, mem_mask);
}
}
@@ -194,7 +194,7 @@ READ8_MEMBER(neoprint_state::audio_command_r)
{
UINT8 ret = soundlatch_byte_r(space, 0);
- //if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(&space.device()), ret);
+ //if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", space.device().safe_pc(), ret);
/* this is a guess */
audio_cpu_clear_nmi_w(space, 0, 0);
@@ -208,7 +208,7 @@ WRITE8_MEMBER(neoprint_state::audio_result_w)
{
- //if (LOG_CPU_COMM && (m_audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(&space.device()), data);
+ //if (LOG_CPU_COMM && (m_audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", space.device().safe_pc(), data);
m_audio_result = data;
}
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index f8fba72ca4e..77aec683fbd 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -344,7 +344,7 @@ WRITE16_MEMBER(ninjaw_state::cpua_ctrl_w)
parse_control(machine());
- logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(&space.device()), data);
+ logerror("CPU #0 PC %06x: write %04x to cpu control\n", space.device().safe_pc(), data);
}
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 22d42d7a6be..eb7990ca139 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -229,7 +229,7 @@ WRITE8_MEMBER(nmk16_state::ssmissin_soundbank_w)
WRITE16_MEMBER(nmk16_state::tharrier_mcu_control_w)
{
-// logerror("%04x: mcu_control_w %02x\n",cpu_get_pc(&space.device()),data);
+// logerror("%04x: mcu_control_w %02x\n",space.device().safe_pc(),data);
}
READ16_MEMBER(nmk16_state::tharrier_mcu_r)
@@ -245,8 +245,8 @@ READ16_MEMBER(nmk16_state::tharrier_mcu_r)
int res;
- if (cpu_get_pc(&space.device())==0x8aa) res = (m_mainram[0x9064/2])|0x20; /* Task Force Harrier */
- else if (cpu_get_pc(&space.device())==0x8ce) res = (m_mainram[0x9064/2])|0x60; /* Task Force Harrier */
+ if (space.device().safe_pc()==0x8aa) res = (m_mainram[0x9064/2])|0x20; /* Task Force Harrier */
+ else if (space.device().safe_pc()==0x8ce) res = (m_mainram[0x9064/2])|0x60; /* Task Force Harrier */
else
{
res = to_main[m_prot_count++];
@@ -4659,7 +4659,7 @@ WRITE16_MEMBER(nmk16_state::twinactn_flipscreen_w)
flip_screen_set(data & 1);
if (data & (~1))
- logerror("%06x: unknown flip screen bit written %04x\n", cpu_get_pc(&space.device()), data);
+ logerror("%06x: unknown flip screen bit written %04x\n", space.device().safe_pc(), data);
}
#endif
@@ -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", cpu_get_pc(&space->device()), 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/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index d90afe7e3ef..5bb9bafd452 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -394,7 +394,7 @@ READ32_MEMBER(nwktr_state::lanc1_r)
default:
{
- //printf("lanc1_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(&space.device()));
+ //printf("lanc1_r: %08X, %08X at %08X\n", offset, mem_mask, space.device().safe_pc());
return 0xffffffff;
}
}
@@ -402,7 +402,7 @@ READ32_MEMBER(nwktr_state::lanc1_r)
WRITE32_MEMBER(nwktr_state::lanc1_w)
{
- //printf("lanc1_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
+ //printf("lanc1_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
}
READ32_MEMBER(nwktr_state::lanc2_r)
@@ -430,7 +430,7 @@ READ32_MEMBER(nwktr_state::lanc2_r)
}
}
- //printf("lanc2_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(&space.device()));
+ //printf("lanc2_r: %08X, %08X at %08X\n", offset, mem_mask, space.device().safe_pc());
return r;
}
@@ -454,7 +454,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w)
m_fpga_uploaded = 1;
- //printf("lanc2_fpga_w: %02X at %08X\n", value, cpu_get_pc(&space.device()));
+ //printf("lanc2_fpga_w: %02X at %08X\n", value, space.device().safe_pc());
}
else if (ACCESSING_BITS_8_15)
{
@@ -473,7 +473,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w)
}
else
{
- //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
+ //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
}
}
if (offset == 4)
@@ -503,7 +503,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w)
}
}
- //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
+ //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc());
}
/*****************************************************************************/
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index 990555e3468..799116ea134 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -464,7 +464,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", cpu_get_pc(&space->device()), 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/offtwall.c b/src/mame/drivers/offtwall.c
index 393ed336558..a40baf374f8 100644
--- a/src/mame/drivers/offtwall.c
+++ b/src/mame/drivers/offtwall.c
@@ -163,11 +163,11 @@ READ16_MEMBER(offtwall_state::bankrom_r)
{
/* this is the banked ROM read */
- logerror("%06X: %04X\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%06X: %04X\n", space.device().safe_pcbase(), offset);
/* if the values are $3e000 or $3e002 are being read by code just below the
ROM bank area, we need to return the correct value to give the proper checksum */
- if ((offset == 0x3000 || offset == 0x3001) && cpu_get_previouspc(&space.device()) > 0x37000)
+ if ((offset == 0x3000 || offset == 0x3001) && space.device().safe_pcbase() > 0x37000)
{
UINT32 checksum = (space.read_word(0x3fd210) << 16) | space.read_word(0x3fd212);
UINT32 us = 0xaaaa5555 - checksum;
@@ -202,7 +202,7 @@ READ16_MEMBER(offtwall_state::bankrom_r)
READ16_MEMBER(offtwall_state::spritecache_count_r)
{
- int prevpc = cpu_get_previouspc(&space.device());
+ int prevpc = space.device().safe_pcbase();
/* if this read is coming from $99f8 or $9992, it's in the sprite copy loop */
if (prevpc == 0x99f8 || prevpc == 0x9992)
@@ -256,7 +256,7 @@ READ16_MEMBER(offtwall_state::spritecache_count_r)
READ16_MEMBER(offtwall_state::unknown_verify_r)
{
- int prevpc = cpu_get_previouspc(&space.device());
+ int prevpc = space.device().safe_pcbase();
if (prevpc < 0x5c5e || prevpc > 0xc432)
return m_unknown_verify_base[offset];
else
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index 593ea8f4b50..7f370f6bbd2 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -127,7 +127,7 @@ READ8_MEMBER(ojankohs_state::ojankohs_keymatrix_r)
ret &= ioport("KEY4")->read();
break;
default: ret = 0xff;
- logerror("PC:%04X unknown %02X\n", cpu_get_pc(&space.device()), m_portselect);
+ logerror("PC:%04X unknown %02X\n", space.device().safe_pc(), m_portselect);
break;
}
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index cb648b0987f..7d2d8df5caa 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -501,7 +501,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,cpu_get_pc(&space->device()) );
+// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,space->device().safe_pc() );
}
@@ -524,18 +524,18 @@ 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,cpu_get_pc(&space->device()) );
+// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,space->device().safe_pc() );
}
WRITE8_MEMBER(opwolf_state::opwolf_adpcm_d_w)
{
-// logerror("CPU #1 d00%i-data=%2x pc=%4x\n",offset,data,cpu_get_pc(&space.device()) );
+// logerror("CPU #1 d00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() );
}
WRITE8_MEMBER(opwolf_state::opwolf_adpcm_e_w)
{
-// logerror("CPU #1 e00%i-data=%2x pc=%4x\n",offset,data,cpu_get_pc(&space.device()) );
+// logerror("CPU #1 e00%i-data=%2x pc=%4x\n",offset,data,space.device().safe_pc() );
}
static ADDRESS_MAP_START( opwolf_sound_z80_map, AS_PROGRAM, 8, opwolf_state )
diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c
index f8f37fb36b4..2513f2710dd 100644
--- a/src/mame/drivers/overdriv.c
+++ b/src/mame/drivers/overdriv.c
@@ -64,7 +64,7 @@ static const eeprom_interface eeprom_intf =
WRITE16_MEMBER(overdriv_state::eeprom_w)
{
-//logerror("%06x: write %04x to eeprom_w\n",cpu_get_pc(&space.device()),data);
+//logerror("%06x: write %04x to eeprom_w\n",space.device().safe_pc(),data);
if (ACCESSING_BITS_0_7)
{
/* bit 0 is data */
@@ -109,7 +109,7 @@ WRITE16_MEMBER(overdriv_state::cpuA_ctrl_w)
coin_counter_w(machine(), 0, data & 0x10);
coin_counter_w(machine(), 1, data & 0x20);
-//logerror("%06x: write %04x to cpuA_ctrl_w\n",cpu_get_pc(&space.device()),data);
+//logerror("%06x: write %04x to cpuA_ctrl_w\n",space.device().safe_pc(),data);
}
}
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 56991765fbc..b56cd429d16 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -572,7 +572,7 @@ READ8_MEMBER(pacman_state::alibaba_mystery_2_r)
READ8_MEMBER(pacman_state::maketrax_special_port2_r)
{
int data = ioport("DSW1")->read();
- int pc = cpu_get_previouspc(&space.device());
+ int pc = space.device().safe_pcbase();
if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40;
@@ -592,7 +592,7 @@ READ8_MEMBER(pacman_state::maketrax_special_port2_r)
READ8_MEMBER(pacman_state::maketrax_special_port3_r)
{
- int pc = cpu_get_previouspc(&space.device());
+ int pc = space.device().safe_pcbase();
if (pc == 0x040e) return 0x20;
@@ -614,7 +614,7 @@ READ8_MEMBER(pacman_state::maketrax_special_port3_r)
READ8_MEMBER(pacman_state::korosuke_special_port2_r)
{
int data = ioport("DSW1")->read();
- int pc = cpu_get_previouspc(&space.device());
+ int pc = space.device().safe_pcbase();
if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40;
@@ -634,7 +634,7 @@ READ8_MEMBER(pacman_state::korosuke_special_port2_r)
READ8_MEMBER(pacman_state::korosuke_special_port3_r)
{
- int pc = cpu_get_previouspc(&space.device());
+ int pc = space.device().safe_pcbase();
if (pc == 0x0445) return 0x20;
@@ -710,7 +710,7 @@ WRITE8_MEMBER(pacman_state::porky_banking_w)
READ8_MEMBER(pacman_state::drivfrcp_port1_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0030:
case 0x0291:
@@ -722,7 +722,7 @@ READ8_MEMBER(pacman_state::drivfrcp_port1_r)
READ8_MEMBER(pacman_state::_8bpm_port1_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0030:
case 0x0466:
@@ -734,7 +734,7 @@ READ8_MEMBER(pacman_state::_8bpm_port1_r)
READ8_MEMBER(pacman_state::porky_port1_r)
{
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x0034:
return 0x01;
@@ -6125,7 +6125,7 @@ READ8_MEMBER(pacman_state::cannonbp_protection_r)
switch (offset)
{
default:
- logerror("CPU0 %04x: Unhandled protection read, offset %04x\n", cpu_get_pc(&space.device()), offset);
+ logerror("CPU0 %04x: Unhandled protection read, offset %04x\n", space.device().safe_pc(), offset);
return 0x00;
case 0x0000: // unknown
@@ -6148,7 +6148,7 @@ READ8_MEMBER(pacman_state::cannonbp_protection_r)
m_cannonb_bit_to_read = 7;
return 0x00;
case 0x0001: // affects the ball hitting the blocks as well as jump address after bonus round
- if (cpu_get_pc(&space.device()) == 0x2b97)
+ if (space.device().safe_pc() == 0x2b97)
return (BIT(0x46, m_cannonb_bit_to_read--) << 7);
else
return 0xff; /* value taken from the bootlegs */
diff --git a/src/mame/drivers/pandoras.c b/src/mame/drivers/pandoras.c
index af0d2695625..96b9c723968 100644
--- a/src/mame/drivers/pandoras.c
+++ b/src/mame/drivers/pandoras.c
@@ -82,7 +82,7 @@ WRITE8_MEMBER(pandoras_state::pandoras_int_control_w)
case 0x07: device_set_input_line(m_subcpu, INPUT_LINE_NMI, PULSE_LINE);
break;
- default: logerror("%04x: (irq_ctrl) write %02x to %02x\n",cpu_get_pc(&space.device()), data, offset);
+ default: logerror("%04x: (irq_ctrl) write %02x to %02x\n",space.device().safe_pc(), data, offset);
break;
}
}
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index 1aa6122af90..3f750289661 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -99,7 +99,7 @@ WRITE8_MEMBER(paradise_state::paradise_rombank_w)
if (bank >= bank_n)
{
- logerror("PC %04X - invalid rom bank %x\n", cpu_get_pc(&space.device()), bank);
+ logerror("PC %04X - invalid rom bank %x\n", space.device().safe_pc(), bank);
bank %= bank_n;
}
diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c
index 8bf231b1795..220e06b1053 100644
--- a/src/mame/drivers/parodius.c
+++ b/src/mame/drivers/parodius.c
@@ -76,7 +76,7 @@ WRITE8_MEMBER(parodius_state::parodius_videobank_w)
{
if (m_videobank & 0xf8)
- logerror("%04x: videobank = %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("%04x: videobank = %02x\n",space.device().safe_pc(),data);
/* bit 0 = select palette or work RAM at 0000-07ff */
/* bit 1 = select 052109 or 053245 at 2000-27ff */
@@ -88,7 +88,7 @@ WRITE8_MEMBER(parodius_state::parodius_3fc0_w)
{
if ((data & 0xf4) != 0x10)
- logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("%04x: 3fc0 = %02x\n",space.device().safe_pc(),data);
/* bit 0/1 = coin counters */
coin_counter_w(machine(), 0, data & 0x01);
@@ -427,7 +427,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( parodius_banking )
{
if (lines & 0xf0)
- logerror("%04x: setlines %02x\n", cpu_get_pc(device), lines);
+ logerror("%04x: setlines %02x\n", device->safe_pc(), lines);
device->machine().root_device().membank("bank1")->set_entry((lines & 0x0f) ^ 0x0f);
}
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index 5cbcea658fc..20aa3af6b48 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -476,7 +476,7 @@ ROM_END
READ16_MEMBER(pasha2_state::pasha2_speedup_r)
{
- if(cpu_get_pc(&space.device()) == 0x8302)
+ if(space.device().safe_pc() == 0x8302)
device_spin_until_interrupt(&space.device());
return m_wram[(0x95744 / 2) + offset];
diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c
index c3b51b834ee..944e5a7298f 100644
--- a/src/mame/drivers/pbaction.c
+++ b/src/mame/drivers/pbaction.c
@@ -472,7 +472,7 @@ READ8_MEMBER(pbaction_state::pbactio3_prot_kludge_r)
{
/* on startup, the game expect this location to NOT act as RAM */
- if (cpu_get_pc(&space.device()) == 0xab80)
+ if (space.device().safe_pc() == 0xab80)
return 0;
return m_work_ram[0];
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index 1febc80abb0..4316ae11d36 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -151,7 +151,7 @@ static const microtouch_serial_interface pcat_nit_microtouch_interface =
WRITE8_MEMBER(pcat_nit_state::pcat_nit_rombank_w)
{
- logerror( "rom bank #%02x at PC=%08X\n", data, cpu_get_pc(&space.device()) );
+ logerror( "rom bank #%02x at PC=%08X\n", data, space.device().safe_pc() );
if ( data & 0x40 )
{
// rom bank
diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c
index c5c748c4261..d504f1b2438 100644
--- a/src/mame/drivers/pcxt.c
+++ b/src/mame/drivers/pcxt.c
@@ -166,7 +166,7 @@ static SCREEN_UPDATE_RGB32( tetriskr )
READ8_MEMBER(pcxt_state::disk_iobank_r)
{
- //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(&space.device()));
+ //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,space.device().safe_pc());
//if(offset == 0) return ioport("DSW")->read();
if(offset == 1) return ioport("IN1")->read();
@@ -386,7 +386,7 @@ static I8255A_INTERFACE( ppi8255_1_intf )
READ8_MEMBER(pcxt_state::fdc765_status_r)
{
UINT8 tmp;
-// popmessage("Read FDC status @ PC=%05x",cpu_get_pc(&space.device()));
+// popmessage("Read FDC status @ PC=%05x",space.device().safe_pc());
tmp = m_status | 0x80;
m_clr_status++;
if(m_clr_status == 0x10)
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 5bfc6038eb8..7287e1503a7 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -224,7 +224,7 @@ READ16_MEMBER(pgm_state::z80_ram_r)
WRITE16_MEMBER(pgm_state::z80_ram_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
if (ACCESSING_BITS_8_15)
m_z80_mainram[offset * 2] = data >> 8;
@@ -233,14 +233,14 @@ WRITE16_MEMBER(pgm_state::z80_ram_w)
if (pc != 0xf12 && pc != 0xde2 && pc != 0x100c50 && pc != 0x100b20)
if (PGMLOGERROR)
- logerror("Z80: write %04x, %04x @ %04x (%06x)\n", offset * 2, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("Z80: write %04x, %04x @ %04x (%06x)\n", offset * 2, data, mem_mask, space.device().safe_pc());
}
WRITE16_MEMBER(pgm_state::z80_reset_w)
{
if (PGMLOGERROR)
- logerror("Z80: reset %04x @ %04x (%06x)\n", data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("Z80: reset %04x @ %04x (%06x)\n", data, mem_mask, space.device().safe_pc());
if (data == 0x5050)
{
@@ -266,7 +266,7 @@ WRITE16_MEMBER(pgm_state::z80_reset_w)
WRITE16_MEMBER(pgm_state::z80_ctrl_w)
{
if (PGMLOGERROR)
- logerror("Z80: ctrl %04x @ %04x (%06x)\n", data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("Z80: ctrl %04x @ %04x (%06x)\n", data, mem_mask, space.device().safe_pc());
}
WRITE16_MEMBER(pgm_state::m68k_l1_w)
@@ -275,7 +275,7 @@ WRITE16_MEMBER(pgm_state::m68k_l1_w)
if(ACCESSING_BITS_0_7)
{
if (PGMLOGERROR)
- logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, cpu_get_pc(&space.device()));
+ logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, space.device().safe_pc());
soundlatch_byte_w(space, 0, data);
device_set_input_line(m_soundcpu, INPUT_LINE_NMI, PULSE_LINE );
}
@@ -284,7 +284,7 @@ WRITE16_MEMBER(pgm_state::m68k_l1_w)
WRITE8_MEMBER(pgm_state::z80_l3_w)
{
if (PGMLOGERROR)
- logerror("SL 3 z80.w %02x (%04x)\n", data, cpu_get_pc(&space.device()));
+ logerror("SL 3 z80.w %02x (%04x)\n", data, space.device().safe_pc());
soundlatch3_byte_w(space, 0, data);
}
diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c
index 91034f00163..fa84f67e52d 100644
--- a/src/mame/drivers/pirates.c
+++ b/src/mame/drivers/pirates.c
@@ -123,7 +123,7 @@ WRITE16_MEMBER(pirates_state::pirates_out_w)
/* bit 7 used (function unknown) */
}
-// logerror("%06x: out_w %04x\n",cpu_get_pc(&space.device()),data);
+// logerror("%06x: out_w %04x\n",space.device().safe_pc(),data);
}
CUSTOM_INPUT_MEMBER(pirates_state::prot_r)
@@ -139,7 +139,7 @@ CUSTOM_INPUT_MEMBER(pirates_state::prot_r)
602e and 62a6 */
/* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */
- pc = cpu_get_pc(machine().device("main"));
+ pc = machine().device("main")->safe_pc();
if (pc == 0x6134)
{
bit = prot & 1;
diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c
index c1f7f6d29b3..a9b7bbd262b 100644
--- a/src/mame/drivers/pktgaldx.c
+++ b/src/mame/drivers/pktgaldx.c
@@ -104,7 +104,7 @@ READ16_MEMBER(pktgaldx_state::pckgaldx_unknown_r)
READ16_MEMBER(pktgaldx_state::pckgaldx_protection_r)
{
- logerror("pckgaldx_protection_r address %06x\n",cpu_get_pc(&space.device()));
+ logerror("pckgaldx_protection_r address %06x\n",space.device().safe_pc());
return -1;
}
diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c
index 59c951a8e2b..0f3338a0a1d 100644
--- a/src/mame/drivers/playmark.c
+++ b/src/mame/drivers/playmark.c
@@ -135,12 +135,12 @@ READ8_MEMBER(playmark_state::playmark_snd_command_r)
if ((m_oki_control & 0x38) == 0x30)
{
data = m_snd_command;
- // logerror("PC$%03x PortB reading %02x from the 68K\n", cpu_get_previouspc(&space.device()), data);
+ // logerror("PC$%03x PortB reading %02x from the 68K\n", space.device().safe_pcbase(), data);
}
else if ((m_oki_control & 0x38) == 0x28)
{
data = (m_oki->read(space, 0) & 0x0f);
- // logerror("PC$%03x PortB reading %02x from the OKI status port\n", cpu_get_previouspc(&space.device()), data);
+ // logerror("PC$%03x PortB reading %02x from the OKI status port\n", space.device().safe_pcbase(), data);
}
return data;
@@ -200,7 +200,7 @@ WRITE8_MEMBER(playmark_state::playmark_snd_control_w)
if ((data & 0x38) == 0x18)
{
- // logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",cpu_get_previouspc(&space.device()),playmark_oki_command,playmark_oki_control,playmark_snd_command);
+ // logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",space.device().safe_pcbase(),playmark_oki_command,playmark_oki_control,playmark_snd_command);
okim6295_device *oki = machine().device<okim6295_device>("oki");
oki->write(space, 0, m_oki_command);
}
diff --git a/src/mame/drivers/pluto5.c b/src/mame/drivers/pluto5.c
index 86b8500db2f..3aeba928ffc 100644
--- a/src/mame/drivers/pluto5.c
+++ b/src/mame/drivers/pluto5.c
@@ -202,7 +202,7 @@ public:
READ32_MEMBER(pluto5_state::pluto5_mem_r)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
@@ -220,7 +220,7 @@ READ32_MEMBER(pluto5_state::pluto5_mem_r)
WRITE32_MEMBER(pluto5_state::pluto5_mem_w)
{
- int pc = cpu_get_pc(&space.device());
+ int pc = space.device().safe_pc();
int cs = m68340_get_cs(m_maincpu, offset * 4);
switch ( cs )
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index d83dd6b6b2f..d79e6e4a22e 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -200,7 +200,7 @@ READ32_MEMBER(polygonet_state::dsp_host_interface_r)
if (mem_mask == 0x0000ff00) { value <<= 8; }
if (mem_mask == 0xff000000) { value <<= 24; }
- logerror("Dsp HI Read (host-side) %08x (HI %04x) = %08x (@%x)\n", mem_mask, hi_addr, value, cpu_get_pc(&space.device()));
+ logerror("Dsp HI Read (host-side) %08x (HI %04x) = %08x (@%x)\n", mem_mask, hi_addr, value, space.device().safe_pc());
return value;
}
@@ -214,13 +214,13 @@ WRITE32_MEMBER(polygonet_state::shared_ram_write)
{
logerror("68k WRITING %04x to shared ram %x (@%x)\n", (m_shared_ram[offset] & 0xffff0000) >> 16,
0xc000 + (offset<<1),
- cpu_get_pc(&space.device()));
+ space.device().safe_pc());
}
else if (mem_mask == 0x0000ffff)
{
logerror("68k WRITING %04x to shared ram %x (@%x)\n", (m_shared_ram[offset] & 0x0000ffff),
0xc000 +((offset<<1)+1),
- cpu_get_pc(&space.device()));
+ space.device().safe_pc());
}
else
{
@@ -229,7 +229,7 @@ WRITE32_MEMBER(polygonet_state::shared_ram_write)
0xc000 + (offset<<1),
0xc000 +((offset<<1)+1),
mem_mask,
- cpu_get_pc(&space.device()));
+ space.device().safe_pc());
}
/* write to the current dsp56k word */
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 56f37a8f389..630d2b02055 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -231,7 +231,7 @@ WRITE16_MEMBER(pntnpuzl_state::pntnpuzl_200000_w)
WRITE16_MEMBER(pntnpuzl_state::pntnpuzl_280018_w)
{
-// logerror("%04x: 280018: %04x\n",cpu_get_pc(&space.device()),data);
+// logerror("%04x: 280018: %04x\n",space.device().safe_pc(),data);
m_serial >>= 1;
if (data & 0x2000)
m_serial |= 0x400;
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index 40f0c18a9d3..dd9136072e7 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -259,7 +259,7 @@ READ16_MEMBER(polepos_state::polepos2_ic25_r)
m_last_result = (INT8)m_last_signed * (UINT8)m_last_unsigned;
}
-// logerror("%04X: read IC25 @ %04X = %02X\n", cpu_get_pc(&space.device()), offset, result);
+// logerror("%04X: read IC25 @ %04X = %02X\n", space.device().safe_pc(), offset, result);
return result | (result << 8);
}
diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c
index 8d395995847..2183101b89a 100644
--- a/src/mame/drivers/policetr.c
+++ b/src/mame/drivers/policetr.c
@@ -152,7 +152,7 @@ WRITE32_MEMBER(policetr_state::control_w)
/* log any unknown bits */
if (data & 0x4f1fffff)
- logerror("%08X: control_w = %08X & %08X\n", cpu_get_previouspc(&space.device()), data, mem_mask);
+ logerror("%08X: control_w = %08X & %08X\n", space.device().safe_pcbase(), data, mem_mask);
}
@@ -203,7 +203,7 @@ WRITE32_MEMBER(policetr_state::speedup_w)
COMBINE_DATA(m_speedup_data);
/* see if the PC matches */
- if ((cpu_get_previouspc(&space.device()) & 0x1fffffff) == m_speedup_pc)
+ if ((space.device().safe_pcbase() & 0x1fffffff) == m_speedup_pc)
{
UINT64 curr_cycles = machine().firstcpu->total_cycles();
diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c
index c7637094af6..1f5c3ef4581 100644
--- a/src/mame/drivers/ppmast93.c
+++ b/src/mame/drivers/ppmast93.c
@@ -218,7 +218,7 @@ WRITE8_MEMBER(ppmast93_state::ppmast_sound_w)
case 0:
case 1: ym2413_w(machine().device("ymsnd"),offset,data); break;
case 2: machine().device<dac_device>("dac")->write_unsigned8(data);break;
- default: logerror("%x %x - %x\n",offset,data,cpu_get_previouspc(&space.device()));
+ default: logerror("%x %x - %x\n",offset,data,space.device().safe_pcbase());
}
}
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index b747fbf3d8f..3461fc87298 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -127,7 +127,7 @@ READ32_MEMBER(psikyo_state::sngkace_input_r)
case 0x0: return ioport("P1_P2")->read();
case 0x1: return ioport("DSW")->read();
case 0x2: return ioport("COIN")->read();
- default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
+ default: logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset * 2);
return 0;
}
}
@@ -138,7 +138,7 @@ READ32_MEMBER(psikyo_state::gunbird_input_r)
{
case 0x0: return ioport("P1_P2")->read();
case 0x1: return ioport("DSW")->read();
- default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
+ default: logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset * 2);
return 0;
}
}
@@ -247,12 +247,12 @@ WRITE32_MEMBER(psikyo_state::s1945_mcu_w)
m_s1945_mcu_latching |= 4;
break;
default:
-// logerror("MCU: function %02x, direction %02x, latch1 %02x, latch2 %02x (%x)\n", data, m_s1945_mcu_direction, m_s1945_mcu_latch1, m_s1945_mcu_latch2, cpu_get_pc(&space.device()));
+// logerror("MCU: function %02x, direction %02x, latch1 %02x, latch2 %02x (%x)\n", data, m_s1945_mcu_direction, m_s1945_mcu_latch1, m_s1945_mcu_latch2, space.device().safe_pc());
break;
}
break;
default:
-// logerror("MCU.w %x, %02x (%x)\n", offset, data, cpu_get_pc(&space.device()));
+// logerror("MCU.w %x, %02x (%x)\n", offset, data, space.device().safe_pc());
;
}
}
@@ -291,7 +291,7 @@ READ32_MEMBER(psikyo_state::s1945_input_r)
case 0x0: return ioport("P1_P2")->read();
case 0x1: return (ioport("DSW")->read() & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
case 0x2: return s1945_mcu_r(space, offset - 1, mem_mask);
- default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
+ default: logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset * 2);
return 0;
}
}
diff --git a/src/mame/drivers/punchout.c b/src/mame/drivers/punchout.c
index c55d8e47ce4..7f1c398cec3 100644
--- a/src/mame/drivers/punchout.c
+++ b/src/mame/drivers/punchout.c
@@ -154,7 +154,7 @@ WRITE8_MEMBER(punchout_state::punchout_2a03_reset_w)
READ8_MEMBER(punchout_state::spunchout_rp5c01_r)
{
- logerror("%04x: prot_r %x\n", cpu_get_previouspc(&space.device()), offset);
+ logerror("%04x: prot_r %x\n", space.device().safe_pcbase(), offset);
if (offset <= 0x0c)
{
@@ -266,7 +266,7 @@ WRITE8_MEMBER(punchout_state::spunchout_rp5c01_w)
{
data &= 0x0f;
- logerror("%04x: prot_w %x = %02x\n",cpu_get_previouspc(&space.device()),offset,data);
+ logerror("%04x: prot_w %x = %02x\n",space.device().safe_pcbase(),offset,data);
if (offset <= 0x0c)
{
@@ -301,7 +301,7 @@ READ8_MEMBER(punchout_state::spunchout_exp_r)
/* PC = 0x0313 */
/* (ret or 0x10) -> (D7DF),(D7A0) - (D7DF),(D7A0) = 0d0h(ret nc) */
- if (cpu_get_previouspc(&space.device()) == 0x0313)
+ if (space.device().safe_pcbase() == 0x0313)
ret |= 0xc0;
return ret;
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index 1dbf28830a3..f17d46860e0 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -239,7 +239,7 @@ READ16_MEMBER(qdrmfgp_state::gp2_ide_std_r)
{
if (offset == 0x07)
{
- switch (cpu_get_previouspc(&space.device()))
+ switch (space.device().safe_pcbase())
{
case 0xdb4c:
if ((m_workram[0x5fa4/2] - cpu_get_reg(&space.device(), M68K_D0)) <= 0x10)
diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c
index e75a0517d43..2c87d921d2f 100644
--- a/src/mame/drivers/quizo.c
+++ b/src/mame/drivers/quizo.c
@@ -126,7 +126,7 @@ WRITE8_MEMBER(quizo_state::port60_w)
{
if(data>9)
{
- logerror("ROMBANK %x @ %x\n", data, cpu_get_pc(&space.device()));
+ logerror("ROMBANK %x @ %x\n", data, space.device().safe_pc());
data=0;
}
m_port60=data;
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index 4d24ad74841..d00f7a574b4 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -204,7 +204,7 @@ static void log_protection( address_space *space, const char *warning )
{
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", cpu_get_pc(&space->device()), 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,
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index 468cf6c3c0e..7c2c3f44e18 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -117,7 +117,7 @@ READ8_MEMBER(r2dtank_state::audio_command_r)
{
UINT8 ret = soundlatch_byte_r(space, 0);
-if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", cpu_get_pc(&space.device()), ret);
+if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", space.device().safe_pc(), ret);
return ret;
}
@@ -128,14 +128,14 @@ WRITE8_MEMBER(r2dtank_state::audio_command_w)
soundlatch_byte_w(space, 0, ~data);
cputag_set_input_line(machine(), "audiocpu", M6800_IRQ_LINE, HOLD_LINE);
-if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", cpu_get_pc(&space.device()), data^0xff);
+if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", space.device().safe_pc(), data^0xff);
}
READ8_MEMBER(r2dtank_state::audio_answer_r)
{
UINT8 ret = soundlatch2_byte_r(space, 0);
-if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", cpu_get_pc(&space.device()), ret);
+if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", space.device().safe_pc(), ret);
return ret;
}
@@ -144,13 +144,13 @@ if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", cpu_get_pc(
WRITE8_MEMBER(r2dtank_state::audio_answer_w)
{
/* HACK - prevents lock-up, but causes game to end some in-between sreens prematurely */
- if (cpu_get_pc(&space.device()) == 0xfb12)
+ if (space.device().safe_pc() == 0xfb12)
data = 0x00;
soundlatch2_byte_w(space, 0, data);
cputag_set_input_line(machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
-if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", cpu_get_pc(&space.device()), data);
+if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", space.device().safe_pc(), data);
}
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index d3adc97f878..f1a1593cefb 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -555,7 +555,7 @@ ROM_END
#ifdef SYNC_HACK
READ16_MEMBER(raiden_state::sub_cpu_spin_r)
{
- int pc=cpu_get_pc(&space.device());
+ int pc=space.device().safe_pc();
int ret=m_shared_ram[0x4];
// main set
diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c
index 3883110e84e..31ebefc18be 100644
--- a/src/mame/drivers/realbrk.c
+++ b/src/mame/drivers/realbrk.c
@@ -63,7 +63,7 @@ READ16_MEMBER(realbrk_state::realbrk_dsw_r)
((ioport("SW3")->read() & 0x0300) << 4) |
((ioport("SW4")->read() & 0x0300) << 6) ;
- logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",cpu_get_pc(&space.device()),m_dsw_select[0]);
+ logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",space.device().safe_pc(),m_dsw_select[0]);
return 0xffff;
}
@@ -123,7 +123,7 @@ READ16_MEMBER(realbrk_state::backup_ram_r)
{
/*TODO: understand the format & cmds of the backup-ram,maybe it's an
unemulated tmp68301 feature?*/
- if(cpu_get_previouspc(&space.device()) == 0x02c08e)
+ if(space.device().safe_pcbase() == 0x02c08e)
return 0xffff;
else
return m_backup_ram[offset];
@@ -134,7 +134,7 @@ READ16_MEMBER(realbrk_state::backup_ram_dx_r)
{
/*TODO: understand the format & cmds of the backup-ram,maybe it's an
unemulated tmp68301 feature?*/
- if(cpu_get_previouspc(&space.device()) == 0x02f046)
+ if(space.device().safe_pcbase() == 0x02f046)
return 0xffff;
else
return m_backup_ram[offset];
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index c3d3573f56d..af889d2bf96 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -103,8 +103,8 @@ READ8_MEMBER(rmhaihai_state::keyboard_r)
{
static const char *const keynames[] = { "KEY0", "KEY1" };
- logerror("%04x: keyboard_r\n",cpu_get_pc(&space.device()));
- switch(cpu_get_pc(&space.device()))
+ logerror("%04x: keyboard_r\n",space.device().safe_pc());
+ switch(space.device().safe_pc())
{
/* read keyboard */
case 0x0aba: // rmhaihai, rmhaisei
@@ -151,7 +151,7 @@ READ8_MEMBER(rmhaihai_state::keyboard_r)
WRITE8_MEMBER(rmhaihai_state::keyboard_w)
{
-logerror("%04x: keyboard_w %02x\n",cpu_get_pc(&space.device()),data);
+logerror("%04x: keyboard_w %02x\n",space.device().safe_pc(),data);
m_keyboard_cmd = data;
}
diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c
index 3c6b3524191..0d8b90ba129 100644
--- a/src/mame/drivers/rollerg.c
+++ b/src/mame/drivers/rollerg.c
@@ -24,7 +24,7 @@ static KONAMI_SETLINES_CALLBACK( rollerg_banking );
WRITE8_MEMBER(rollerg_state::rollerg_0010_w)
{
- logerror("%04x: write %02x to 0010\n",cpu_get_pc(&space.device()), data);
+ logerror("%04x: write %02x to 0010\n",space.device().safe_pc(), data);
/* bits 0/1 are coin counters */
coin_counter_w(machine(), 0, data & 0x01);
diff --git a/src/mame/drivers/roul.c b/src/mame/drivers/roul.c
index b046db14ca2..aedc6ca135c 100644
--- a/src/mame/drivers/roul.c
+++ b/src/mame/drivers/roul.c
@@ -120,7 +120,7 @@ bit 7 -> blitter ready
bit 6 -> ??? (after unknown blitter command : [80][80][08][02])
*/
// return 0x80; // blitter ready
-// logerror("Read unknown port $f5 at %04x\n",cpu_get_pc(&space.device()));
+// logerror("Read unknown port $f5 at %04x\n",space.device().safe_pc());
return machine().rand() & 0x00c0;
}
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index 87faf56069c..36b612220a3 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -941,9 +941,9 @@ ROM_END
READ8_MEMBER(route16_state::routex_prot_read)
{
- if (cpu_get_pc(&space.device()) == 0x2f) return 0xfb;
+ if (space.device().safe_pc() == 0x2f) return 0xfb;
- logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space.device().tag(), cpu_get_pc(&space.device()));
+ logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space.device().tag(), space.device().safe_pc());
return 0x00;
}
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index d8e31b1dd93..5a46941d914 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -395,7 +395,7 @@ WRITE8_MEMBER(royalmah_state::suzume_bank_w)
m_suzume_bank = data;
-logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
+logerror("%04x: bank %02x\n",space.device().safe_pc(),data);
/* bits 6, 4 and 3 used for something input related? */
@@ -430,7 +430,7 @@ WRITE8_MEMBER(royalmah_state::tontonb_bank_w)
UINT8 *rom = memregion("maincpu")->base();
int address;
-logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
+logerror("%04x: bank %02x\n",space.device().safe_pc(),data);
if (data == 0) return; // tontonb fix?
@@ -448,7 +448,7 @@ WRITE8_MEMBER(royalmah_state::dynax_bank_w)
UINT8 *rom = memregion("maincpu")->base();
int address;
-//logerror("%04x: bank %02x\n",cpu_get_pc(&space.device()),data);
+//logerror("%04x: bank %02x\n",space.device().safe_pc(),data);
m_dsw_select = data & 0x60;
@@ -896,7 +896,7 @@ READ8_MEMBER(royalmah_state::mjifb_rom_io_r)
case 0x9011: return ioport("SYSTEM")->read();
}
- logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04X: unmapped input read at %04X\n", space.device().safe_pc(), offset);
return 0xff;
}
@@ -925,7 +925,7 @@ WRITE8_MEMBER(royalmah_state::mjifb_rom_io_w)
return;
}
- logerror("%04X: unmapped input write at %04X = %02X\n", cpu_get_pc(&space.device()), offset,data);
+ logerror("%04X: unmapped input write at %04X = %02X\n", space.device().safe_pc(), offset,data);
}
WRITE8_MEMBER(royalmah_state::mjifb_videoram_w)
@@ -1005,7 +1005,7 @@ READ8_MEMBER(royalmah_state::mjdejavu_rom_io_r)
case 0x9011: return ioport("SYSTEM")->read();
}
- logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04X: unmapped input read at %04X\n", space.device().safe_pc(), offset);
return 0xff;
}
@@ -1031,7 +1031,7 @@ WRITE8_MEMBER(royalmah_state::mjdejavu_rom_io_w)
return;
}
- logerror("%04X: unmapped input write at %04X = %02X\n", cpu_get_pc(&space.device()), offset,data);
+ logerror("%04X: unmapped input write at %04X = %02X\n", space.device().safe_pc(), offset,data);
}
static ADDRESS_MAP_START( mjdejavu_map, AS_PROGRAM, 8, royalmah_state )
@@ -1123,7 +1123,7 @@ READ8_MEMBER(royalmah_state::cafetime_dsw_r)
case 0x03: return ioport("DSW4")->read();
case 0x04: return ioport("DSWTOP")->read();
}
- logerror("%04X: unmapped dsw read %02X\n", cpu_get_pc(&space.device()), m_dsw_select);
+ logerror("%04X: unmapped dsw read %02X\n", space.device().safe_pc(), m_dsw_select);
return 0xff;
}
@@ -1192,7 +1192,7 @@ READ8_MEMBER(royalmah_state::mjvegasa_rom_io_r)
return rtc->read(space, offset & 0xf);
}
- logerror("%04X: unmapped IO read at %04X\n", cpu_get_pc(&space.device()), offset);
+ logerror("%04X: unmapped IO read at %04X\n", space.device().safe_pc(), offset);
return 0xff;
}
@@ -1215,7 +1215,7 @@ WRITE8_MEMBER(royalmah_state::mjvegasa_rom_io_w)
return;
}
- logerror("%04X: unmapped IO write at %04X = %02X\n", cpu_get_pc(&space.device()), offset,data);
+ logerror("%04X: unmapped IO write at %04X = %02X\n", space.device().safe_pc(), offset,data);
}
WRITE8_MEMBER(royalmah_state::mjvegasa_coin_counter_w)
diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c
index 0872500ceea..a6b316be4b3 100644
--- a/src/mame/drivers/sandscrp.c
+++ b/src/mame/drivers/sandscrp.c
@@ -291,7 +291,7 @@ WRITE8_MEMBER(sandscrp_state::sandscrp_bankswitch_w)
UINT8 *RAM = memregion("maincpu")->base();
int bank = data & 0x07;
- if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(&space.device()),data);
+ if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",space.device().safe_pc(),data);
if (bank < 3) RAM = &RAM[0x4000 * bank];
else RAM = &RAM[0x4000 * (bank-3) + 0x10000];
diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c
index 66477fd0193..c4fe82c3d03 100644
--- a/src/mame/drivers/saturn.c
+++ b/src/mame/drivers/saturn.c
@@ -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",cpu_get_pc(&space->device()));
+ 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",cpu_get_pc(&space->device()));
+ 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",cpu_get_pc(&space->device()),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",cpu_get_pc(&space->device()),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",cpu_get_pc(&space->device()));
+ 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",cpu_get_pc(&space->device()),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;
}
@@ -393,7 +393,7 @@ static WRITE32_HANDLER( saturn_scu_w )
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",cpu_get_pc(&space->device()),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;
@@ -643,7 +643,7 @@ static WRITE32_HANDLER( minit_w )
{
saturn_state *state = space->machine().driver_data<saturn_state>();
- //logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->device().tag(), cpu_get_pc(&space->device()),data);
+ //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);
@@ -653,7 +653,7 @@ static WRITE32_HANDLER( sinit_w )
{
saturn_state *state = space->machine().driver_data<saturn_state>();
- //logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->device().tag(), cpu_get_pc(&space->device()),data);
+ //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);
}
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index c7e67373738..c598a5428e9 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -322,7 +322,7 @@ ADDRESS_MAP_END
READ8_MEMBER(scramble_state::hncholms_prot_r)
{
- if(cpu_get_pc(&space.device()) == 0x2b || cpu_get_pc(&space.device()) == 0xa27)
+ if(space.device().safe_pc() == 0x2b || space.device().safe_pc() == 0xa27)
return 1;
else
return 0;
diff --git a/src/mame/drivers/sderby.c b/src/mame/drivers/sderby.c
index 49562135889..b126a408dd3 100644
--- a/src/mame/drivers/sderby.c
+++ b/src/mame/drivers/sderby.c
@@ -82,7 +82,7 @@ READ16_MEMBER(sderby_state::sderby_input_r)
return 0xffff; // to avoid game to reset (needs more work)
}
- logerror("sderby_input_r : offset = %x - PC = %06x\n",offset*2,cpu_get_pc(&space.device()));
+ logerror("sderby_input_r : offset = %x - PC = %06x\n",offset*2,space.device().safe_pc());
return 0xffff;
}
@@ -126,7 +126,7 @@ READ16_MEMBER(sderby_state::roulette_input_r)
READ16_MEMBER(sderby_state::rprot_r)
{
- logerror("rprot_r : offset = %02x\n",cpu_get_pc(&space.device()));
+ logerror("rprot_r : offset = %02x\n",space.device().safe_pc());
/* This is the only mask I found that allow a normal play.
Using other values, the game hangs waiting for response,
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index c07136766b2..4c2c9a04636 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -818,7 +818,7 @@ 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", cpu_get_pc(&space->device()), reg, type, result);
+ logerror("%08X:PCI bridge read: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, result);
return result;
}
@@ -828,7 +828,7 @@ static void pci_bridge_w(address_space *space, UINT8 reg, UINT8 type, UINT32 dat
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", cpu_get_pc(&space->device()), reg, type, data);
+ logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, data);
}
@@ -856,7 +856,7 @@ 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", cpu_get_pc(&space->device()), reg, type, result);
+ logerror("%08X:PCI 3dfx read: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, result);
return result;
}
@@ -879,7 +879,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", cpu_get_pc(&space->device()), reg, type, data);
+ logerror("%08X:PCI 3dfx write: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, data);
}
@@ -907,7 +907,7 @@ 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", cpu_get_pc(&space->device()), reg, type, result);
+ logerror("%08X:PCI IDE read: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, result);
return result;
}
@@ -917,7 +917,7 @@ static void pci_ide_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
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", cpu_get_pc(&space->device()), reg, type, data);
+ logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", space->device().safe_pc(), reg, type, data);
}
@@ -1153,7 +1153,7 @@ READ32_MEMBER(seattle_state::galileo_r)
device_eat_cycles(&space.device(), 100);
if (LOG_TIMERS)
- logerror("%08X:hires_timer_r = %08X\n", cpu_get_pc(&space.device()), result);
+ logerror("%08X:hires_timer_r = %08X\n", space.device().safe_pc(), result);
break;
}
@@ -1186,7 +1186,7 @@ READ32_MEMBER(seattle_state::galileo_r)
else
{
result = ~0;
- logerror("%08X:PCIBus read: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(&space.device()), bus, unit, func, reg, type, result);
+ logerror("%08X:PCIBus read: bus %d unit %d func %d reg %d type %d = %08X\n", space.device().safe_pc(), bus, unit, func, reg, type, result);
}
break;
}
@@ -1196,11 +1196,11 @@ READ32_MEMBER(seattle_state::galileo_r)
case GREG_INT_MASK:
case GREG_TIMER_CONTROL:
// if (LOG_GALILEO)
-// logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(&space.device()), offset*4, result);
+// logerror("%08X:Galileo read from offset %03X = %08X\n", space.device().safe_pc(), offset*4, result);
break;
default:
- logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(&space.device()), offset*4, result);
+ logerror("%08X:Galileo read from offset %03X = %08X\n", space.device().safe_pc(), offset*4, result);
break;
}
@@ -1225,7 +1225,7 @@ WRITE32_MEMBER(seattle_state::galileo_w)
int which = offset % 4;
if (LOG_DMA)
- logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space.device()), offset*4, data, mem_mask);
+ logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
/* keep the read only activity bit */
galileo.reg[offset] &= ~0x4000;
@@ -1255,7 +1255,7 @@ WRITE32_MEMBER(seattle_state::galileo_w)
if (!timer->active)
timer->count = data;
if (LOG_TIMERS)
- logerror("%08X:timer/counter %d count = %08X [start=%08X]\n", cpu_get_pc(&space.device()), offset % 4, data, timer->count);
+ logerror("%08X:timer/counter %d count = %08X [start=%08X]\n", space.device().safe_pc(), offset % 4, data, timer->count);
break;
}
@@ -1264,7 +1264,7 @@ WRITE32_MEMBER(seattle_state::galileo_w)
int which, mask;
if (LOG_TIMERS)
- logerror("%08X:timer/counter control = %08X\n", cpu_get_pc(&space.device()), data);
+ logerror("%08X:timer/counter control = %08X\n", space.device().safe_pc(), data);
for (which = 0, mask = 0x01; which < 4; which++, mask <<= 2)
{
galileo_timer *timer = &galileo.timer[which];
@@ -1323,7 +1323,7 @@ WRITE32_MEMBER(seattle_state::galileo_w)
/* anything else, just log */
else
- logerror("%08X:PCIBus write: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(&space.device()), bus, unit, func, reg, type, data);
+ logerror("%08X:PCIBus write: bus %d unit %d func %d reg %d type %d = %08X\n", space.device().safe_pc(), bus, unit, func, reg, type, data);
break;
}
@@ -1334,11 +1334,11 @@ WRITE32_MEMBER(seattle_state::galileo_w)
case GREG_CONFIG_ADDRESS:
case GREG_INT_MASK:
if (LOG_GALILEO)
- logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space.device()), offset*4, data, mem_mask);
+ logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
break;
default:
- logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(&space.device()), offset*4, data, mem_mask);
+ logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
break;
}
}
@@ -1372,7 +1372,7 @@ WRITE32_MEMBER(seattle_state::seattle_voodoo_w)
/* spin until we send the magic trigger */
device_spin_until_trigger(&space.device(), 45678);
- if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo (already stalled)\n", cpu_get_pc(&space.device()));
+ if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo (already stalled)\n", space.device().safe_pc());
}
@@ -1392,7 +1392,7 @@ static void voodoo_stall(device_t *device, int stall)
}
else
{
- if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(device->machine().device("maincpu")));
+ if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", device->machine().device("maincpu")->safe_pc());
device_spin_until_trigger(device->machine().device("maincpu"), 45678);
}
}
@@ -1451,7 +1451,7 @@ WRITE32_MEMBER(seattle_state::analog_port_w)
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", cpu_get_pc(&space.device()), data);
+ logerror("%08X:Unexpected analog port select = %08X\n", space.device().safe_pc(), data);
m_pending_analog_read = ioport(portnames[data & 7])->read();
}
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 74a38cec962..5f9ea9ac781 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -497,7 +497,7 @@ static WRITE16_HANDLER( control_w )
static READ16_HANDLER( prot_r )
{
segac2_state *state = space->machine().driver_data<segac2_state>();
- if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", cpu_get_previouspc(&space->device()), state->m_prot_func ? state->m_prot_read_buf : 0xff);
+ 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;
}
@@ -523,7 +523,7 @@ 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", cpu_get_previouspc(&space->device()), 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)
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index da6e2213fe4..3015352fc18 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -171,7 +171,7 @@ static offs_t decrypt_offset(address_space *space, offs_t offset)
segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
- offs_t pc = cpu_get_previouspc(&space->device());
+ offs_t pc = space->device().safe_pcbase();
if ((UINT16)pc == 0xffff || space->read_byte(pc) != 0x32)
return offset;
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index cec3a3a602e..41818897f9d 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -190,7 +190,7 @@ static offs_t decrypt_offset(address_space *space, offs_t offset)
segag80v_state *state = space->machine().driver_data<segag80v_state>();
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
- offs_t pc = cpu_get_previouspc(&space->device());
+ offs_t pc = space->device().safe_pcbase();
if ((UINT16)pc == 0xffff || space->read_byte(pc) != 0x32)
return offset;
@@ -361,7 +361,7 @@ WRITE8_MEMBER(segag80v_state::unknown_w)
/* writing an 0x04 here enables interrupts */
/* some games write 0x00/0x01 here as well */
if (data != 0x00 && data != 0x01 && data != 0x04)
- mame_printf_debug("%04X:unknown_w = %02X\n", cpu_get_pc(&space.device()), data);
+ mame_printf_debug("%04X:unknown_w = %02X\n", space.device().safe_pc(), data);
}
diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c
index c0233f80e83..9820b7ef6ee 100644
--- a/src/mame/drivers/segald.c
+++ b/src/mame/drivers/segald.c
@@ -125,7 +125,7 @@ READ8_MEMBER(segald_state::astron_DISC_read)
if (m_nmi_enable)
m_ldv1000_input_latch = m_laserdisc->status_r();
- logerror("DISC read (0x%04x) @ 0x%04x [0x%x]\n", m_ldv1000_input_latch, offset, cpu_get_pc(&space.device()));
+ logerror("DISC read (0x%04x) @ 0x%04x [0x%x]\n", m_ldv1000_input_latch, offset, space.device().safe_pc());
return m_ldv1000_input_latch;
}
@@ -133,21 +133,21 @@ READ8_MEMBER(segald_state::astron_DISC_read)
READ8_MEMBER(segald_state::astron_OUT_read)
{
- logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", m_out_ram[offset], offset, cpu_get_pc(&space.device()));
+ logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", m_out_ram[offset], offset, space.device().safe_pc());
return m_out_ram[offset];
}
READ8_MEMBER(segald_state::astron_OBJ_read)
{
- logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", m_obj_ram[offset], offset, cpu_get_pc(&space.device()));
+ logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", m_obj_ram[offset], offset, space.device().safe_pc());
return m_obj_ram[offset];
}
READ8_MEMBER(segald_state::astron_COLOR_read)
{
- logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", m_color_ram[offset], offset, cpu_get_pc(&space.device()));
+ logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", m_color_ram[offset], offset, space.device().safe_pc());
return m_color_ram[offset];
}
@@ -156,7 +156,7 @@ READ8_MEMBER(segald_state::astron_COLOR_read)
WRITE8_MEMBER(segald_state::astron_DISC_write)
{
- logerror("DISC write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device()));
+ logerror("DISC write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, space.device().safe_pc());
m_ldv1000_output_latch = data;
@@ -167,7 +167,7 @@ WRITE8_MEMBER(segald_state::astron_DISC_write)
WRITE8_MEMBER(segald_state::astron_OUT_write)
{
- logerror("OUT write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device()));
+ logerror("OUT write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, space.device().safe_pc());
switch(offset)
{
@@ -205,7 +205,7 @@ WRITE8_MEMBER(segald_state::astron_OBJ_write)
{
m_obj_ram[offset] = data;
- logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device()));
+ logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, space.device().safe_pc());
}
WRITE8_MEMBER(segald_state::astron_COLOR_write)
@@ -228,14 +228,14 @@ WRITE8_MEMBER(segald_state::astron_COLOR_write)
a = (highBits & 0x80) ? 0 : 255;
palette_set_color(machine(), palIndex, MAKE_ARGB(a, r, g, b));
- logerror("COLOR write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device()));
+ logerror("COLOR write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, space.device().safe_pc());
}
WRITE8_MEMBER(segald_state::astron_FIX_write)
{
m_fix_ram[offset] = data;
- /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device())); */
+ /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, space.device().safe_pc()); */
}
WRITE8_MEMBER(segald_state::astron_io_bankswitch_w)
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index 6c078d78246..d6d27c5a51e 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -483,7 +483,7 @@ READ16_MEMBER( segaorun_state::misc_io_r )
{
if (!m_custom_io_r.isnull())
return m_custom_io_r(space, offset, mem_mask);
- logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
+ logerror("%06X:misc_io_r - unknown read access to address %04X\n", space.device().safe_pc(), offset * 2);
return open_bus_r(space, 0, mem_mask);
}
@@ -499,7 +499,7 @@ WRITE16_MEMBER( segaorun_state::misc_io_w )
m_custom_io_w(space, offset, data, mem_mask);
return;
}
- logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(&space.device()), offset * 2, data, mem_mask);
+ logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", space.device().safe_pc(), offset * 2, data, mem_mask);
}
@@ -656,7 +656,7 @@ READ16_MEMBER( segaorun_state::outrun_custom_io_r )
return watchdog_reset_r(space, 0);
}
- logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
+ logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", space.device().safe_pc(), offset * 2);
return open_bus_r(space, 0, mem_mask);
}
@@ -698,7 +698,7 @@ WRITE16_MEMBER( segaorun_state::outrun_custom_io_w )
m_sprites->draw_write(space, offset, data, mem_mask);
return;
}
- logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(&space.device()), offset * 2, data, mem_mask);
+ logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", space.device().safe_pc(), offset * 2, data, mem_mask);
}
@@ -727,7 +727,7 @@ READ16_MEMBER( segaorun_state::shangon_custom_io_r )
return ioport(ports[m_adc_select])->read_safe(0x0010);
}
}
- logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
+ logerror("%06X:misc_io_r - unknown read access to address %04X\n", space.device().safe_pc(), offset * 2);
return open_bus_r(space,0,mem_mask);
}
@@ -764,7 +764,7 @@ WRITE16_MEMBER( segaorun_state::shangon_custom_io_w )
// ADC trigger
return;
}
- logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(&space.device()), offset * 2, data, mem_mask);
+ logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", space.device().safe_pc(), offset * 2, data, mem_mask);
}
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index e2044870641..e28163cc728 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1124,7 +1124,7 @@ READ16_MEMBER( segas16b_state::standard_io_r )
case 0x2000/2:
return ioport((offset & 1) ? "DSW1" : "DSW2")->read();
}
- logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
+ logerror("%06X:standard_io_r - unknown read access to address %04X\n", space.device().safe_pc(), offset * 2);
return open_bus_r(space, 0, mem_mask);
}
@@ -1159,7 +1159,7 @@ WRITE16_MEMBER( segas16b_state::standard_io_w )
coin_counter_w(machine(), 0, data & 0x01);
return;
}
- logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(&space.device()), offset * 2, data, mem_mask);
+ logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", space.device().safe_pc(), offset * 2, data, mem_mask);
}
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index 4ac04112469..472b521d14b 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -341,7 +341,7 @@ READ16_MEMBER( segas18_state::misc_io_r )
}
if (!m_custom_io_r.isnull())
return m_custom_io_r(space, offset, mem_mask);
- logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space.device()), offset * 2);
+ logerror("%06X:misc_io_r - unknown read access to address %04X\n", space.device().safe_pc(), offset * 2);
return open_bus_r(space, 0, mem_mask);
}
@@ -375,7 +375,7 @@ WRITE16_MEMBER( segas18_state::misc_io_w )
m_custom_io_w(space, offset, data, mem_mask);
return;
}
- logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(&space.device()), offset * 2, data, mem_mask);
+ logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", space.device().safe_pc(), offset * 2, data, mem_mask);
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 98a2bda45a7..a1bd6dab928 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -669,13 +669,13 @@ READ16_MEMBER( segas24_state::hotrod3_ctrl_r )
READ16_MEMBER( segas24_state::iod_r )
{
- logerror("IO daughterboard read %02x (%x)\n", offset, cpu_get_pc(&space.device()));
+ logerror("IO daughterboard read %02x (%x)\n", offset, space.device().safe_pc());
return 0xffff;
}
WRITE16_MEMBER( segas24_state::iod_w )
{
- logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(&space.device()));
+ logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc());
}
@@ -783,7 +783,7 @@ WRITE16_MEMBER( segas24_state::mlatch_w )
int i;
UINT8 mxor = 0;
if(!mlatch_table) {
- logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space.device().tag(), cpu_get_pc(&space.device()));
+ logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space.device().tag(), space.device().safe_pc());
return;
}
@@ -794,9 +794,9 @@ WRITE16_MEMBER( segas24_state::mlatch_w )
if(mlatch & (1<<i))
mxor |= 1 << mlatch_table[i];
mlatch = data ^ mxor;
- logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space.device().tag(), cpu_get_pc(&space.device()));
+ logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space.device().tag(), space.device().safe_pc());
} else {
- logerror("Magic latch reset (%s:%x)\n", space.device().tag(), cpu_get_pc(&space.device()));
+ logerror("Magic latch reset (%s:%x)\n", space.device().tag(), space.device().safe_pc());
mlatch = 0x00;
}
}
@@ -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(), cpu_get_pc(&space->device()));
+ // 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) {
@@ -1049,7 +1049,7 @@ READ16_MEMBER ( segas24_state::sys16_io_r )
case 0xf:
return io_dir;
default:
- logerror("IO control read %02x (%s:%x)\n", offset, space.device().tag(), cpu_get_pc(&space.device()));
+ logerror("IO control read %02x (%s:%x)\n", offset, space.device().tag(), space.device().safe_pc());
return 0xff;
}
} else
@@ -1061,7 +1061,7 @@ WRITE16_MEMBER( segas24_state::sys16_io_w )
if(ACCESSING_BITS_0_7) {
if(offset < 8) {
if(!(io_dir & (1 << offset))) {
- logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, io_dir, data & 0xff, space.device().tag(), cpu_get_pc(&space.device()));
+ logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, io_dir, data & 0xff, space.device().tag(), space.device().safe_pc());
return;
}
(this->*io_w)(offset, data);
@@ -1075,7 +1075,7 @@ WRITE16_MEMBER( segas24_state::sys16_io_w )
io_dir = data;
break;
default:
- logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space.device().tag(), cpu_get_pc(&space.device()));
+ logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space.device().tag(), space.device().safe_pc());
}
}
}
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index c79d19ff4e7..ef65c4a84ed 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -452,7 +452,7 @@ static void int_control_w(address_space *space, int offset, UINT8 data)
segas32_state *state = space->machine().driver_data<segas32_state>();
int duration;
-// logerror("%06X:int_control_w(%X) = %02X\n", cpu_get_pc(&space->device()), offset, data);
+// logerror("%06X:int_control_w(%X) = %02X\n", space->device().safe_pc(), offset, data);
switch (offset)
{
case 0:
@@ -765,7 +765,7 @@ READ16_MEMBER(segas32_state::io_expansion_r)
if (!m_custom_io_r[0].isnull())
return (m_custom_io_r[0])(space, offset, mem_mask);
else
- logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:io_expansion_r(%X)\n", space.device().safe_pc(), offset);
return 0xffff;
}
@@ -779,7 +779,7 @@ WRITE16_MEMBER(segas32_state::io_expansion_w)
if (!m_custom_io_w[0].isnull())
(m_custom_io_w[0])(space, offset, data, mem_mask);
else
- logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space.device()), offset, data & 0xff);
+ logerror("%06X:io_expansion_w(%X) = %02X\n", space.device().safe_pc(), offset, data & 0xff);
}
@@ -789,7 +789,7 @@ READ32_MEMBER(segas32_state::io_expansion_0_r)
return (m_custom_io_r[0])(space, offset*2+0, mem_mask) |
((m_custom_io_r[0])(space, offset*2+1, mem_mask >> 16) << 16);
else
- logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:io_expansion_r(%X)\n", space.device().safe_pc(), offset);
return 0xffffffff;
}
@@ -808,7 +808,7 @@ WRITE32_MEMBER(segas32_state::io_expansion_0_w)
if (!m_custom_io_w[0].isnull())
(m_custom_io_w[0])(space, offset*2+0, data, mem_mask);
else
- logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space.device()), offset, data & 0xff);
+ logerror("%06X:io_expansion_w(%X) = %02X\n", space.device().safe_pc(), offset, data & 0xff);
}
if (ACCESSING_BITS_16_23)
@@ -816,7 +816,7 @@ WRITE32_MEMBER(segas32_state::io_expansion_0_w)
if (!m_custom_io_w[0].isnull())
(m_custom_io_w[0])(space, offset*2+1, data >> 16, mem_mask >> 16);
else
- logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space.device()), offset, data & 0xff);
+ logerror("%06X:io_expansion_w(%X) = %02X\n", space.device().safe_pc(), offset, data & 0xff);
}
}
@@ -827,7 +827,7 @@ READ32_MEMBER(segas32_state::io_expansion_1_r)
return (m_custom_io_r[1])(space, offset*2+0, mem_mask) |
((m_custom_io_r[1])(space, offset*2+1, mem_mask >> 16) << 16);
else
- logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(&space.device()), offset);
+ logerror("%06X:io_expansion_r(%X)\n", space.device().safe_pc(), offset);
return 0xffffffff;
}
@@ -840,14 +840,14 @@ WRITE32_MEMBER(segas32_state::io_expansion_1_w)
if (!m_custom_io_w[1].isnull())
(m_custom_io_w[1])(space, offset*2+0, data, mem_mask);
else
- logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space.device()), offset, data & 0xff);
+ logerror("%06X:io_expansion_w(%X) = %02X\n", space.device().safe_pc(), offset, data & 0xff);
}
if (ACCESSING_BITS_16_23)
{
if (!m_custom_io_w[1].isnull())
(m_custom_io_w[1])(space, offset*2+1, data >> 16, mem_mask >> 16);
else
- logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(&space.device()), offset, data & 0xff);
+ logerror("%06X:io_expansion_w(%X) = %02X\n", space.device().safe_pc(), offset, data & 0xff);
}
}
@@ -872,7 +872,7 @@ READ16_MEMBER(segas32_state::analog_custom_io_r)
m_analog_value[offset & 3] <<= 1;
return result;
}
- logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
+ logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", space.device().safe_pc(), offset*2, mem_mask);
return 0xffff;
}
@@ -889,7 +889,7 @@ WRITE16_MEMBER(segas32_state::analog_custom_io_w)
m_analog_value[offset & 3] = ioport(names[offset & 3])->read_safe(0);
return;
}
- logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
+ logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", space.device().safe_pc(), offset*2, data, mem_mask);
}
@@ -905,7 +905,7 @@ READ16_MEMBER(segas32_state::extra_custom_io_r)
return ioport(names[offset & 3])->read_safe(0xffff);
}
- logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
+ logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", space.device().safe_pc(), offset*2, mem_mask);
return 0xffff;
}
@@ -926,7 +926,7 @@ WRITE16_MEMBER(segas32_state::orunners_custom_io_w)
m_analog_bank = data & 1;
return;
}
- logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
+ logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", space.device().safe_pc(), offset*2, data, mem_mask);
}
@@ -945,7 +945,7 @@ READ16_MEMBER(segas32_state::sonic_custom_io_r)
return (UINT8)(ioport(names[offset/2])->read() - m_sonic_last[offset/2]);
}
- logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
+ logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", space.device().safe_pc(), offset*2, mem_mask);
return 0xffff;
}
@@ -964,7 +964,7 @@ WRITE16_MEMBER(segas32_state::sonic_custom_io_w)
return;
}
- logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
+ logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", space.device().safe_pc(), offset*2, data, mem_mask);
}
@@ -977,7 +977,7 @@ WRITE16_MEMBER(segas32_state::sonic_custom_io_w)
WRITE16_MEMBER(segas32_state::random_number_16_w)
{
-// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
+// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", space.device().safe_pc(), offset*2, data, mem_mask);
}
READ16_MEMBER(segas32_state::random_number_16_r)
@@ -987,7 +987,7 @@ READ16_MEMBER(segas32_state::random_number_16_r)
WRITE32_MEMBER(segas32_state::random_number_32_w)
{
-// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
+// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", space.device().safe_pc(), offset*2, data, mem_mask);
}
READ32_MEMBER(segas32_state::random_number_32_r)
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 0582b649846..c105e05ccd9 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -747,7 +747,7 @@ static UINT8 z80_fifoout_pop(address_space *space)
UINT8 r;
if (state->m_fifoout_wpos == state->m_fifoout_rpos)
{
- logerror("Sound FIFOOUT underflow at %08X\n", cpu_get_pc(&space->device()));
+ 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)
@@ -773,7 +773,7 @@ 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", cpu_get_pc(&space->device()));
+ fatalerror("Sound FIFOOUT overflow at %08X\n", space->device().safe_pc());
}
state->m_fifoout_read_request = 1;
@@ -785,7 +785,7 @@ static UINT8 z80_fifoin_pop(address_space *space)
UINT8 r;
if (state->m_fifoin_wpos == state->m_fifoin_rpos)
{
- fatalerror("Sound FIFOIN underflow at %08X\n", cpu_get_pc(&space->device()));
+ 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)
@@ -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", cpu_get_pc(&space->device()));
+ fatalerror("Sound FIFOIN overflow at %08X\n", space->device().safe_pc());
}
state->m_fifoin_read_request = 1;
@@ -1945,25 +1945,25 @@ MACHINE_CONFIG_END
READ32_MEMBER(seibuspi_state::senkyu_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x00305bb2) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x00305bb2) device_spin_until_interrupt(&space.device()); // idle
return m_spimainram[(0x0018cb4-0x800)/4];
}
READ32_MEMBER(seibuspi_state::senkyua_speedup_r)
{
- if (cpu_get_pc(&space.device())== 0x30582e) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()== 0x30582e) device_spin_until_interrupt(&space.device()); // idle
return m_spimainram[(0x0018c9c-0x800)/4];
}
READ32_MEMBER(seibuspi_state::batlball_speedup_r)
{
-// printf("cpu_get_pc(&space.device()) %06x\n", cpu_get_pc(&space.device()));
+// printf("space.device().safe_pc() %06x\n", space.device().safe_pc());
/* batlbalu */
- if (cpu_get_pc(&space.device())==0x00305996) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x00305996) device_spin_until_interrupt(&space.device()); // idle
/* batlball */
- if (cpu_get_pc(&space.device())==0x003058aa) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x003058aa) device_spin_until_interrupt(&space.device()); // idle
return m_spimainram[(0x0018db4-0x800)/4];
}
@@ -1971,21 +1971,21 @@ READ32_MEMBER(seibuspi_state::batlball_speedup_r)
READ32_MEMBER(seibuspi_state::rdft_speedup_r)
{
/* rdft */
- if (cpu_get_pc(&space.device())==0x0203f0a) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0203f0a) device_spin_until_interrupt(&space.device()); // idle
/* rdftau */
- if (cpu_get_pc(&space.device())==0x0203f16) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0203f16) device_spin_until_interrupt(&space.device()); // idle
/* rdftj */
- if (cpu_get_pc(&space.device())==0x0203f22) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0203f22) device_spin_until_interrupt(&space.device()); // idle
/* rdftdi */
- if (cpu_get_pc(&space.device())==0x0203f46) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0203f46) device_spin_until_interrupt(&space.device()); // idle
/* rdftu */
- if (cpu_get_pc(&space.device())==0x0203f3a) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0203f3a) device_spin_until_interrupt(&space.device()); // idle
-// mame_printf_debug("%08x\n",cpu_get_pc(&space.device()));
+// mame_printf_debug("%08x\n",space.device().safe_pc());
return m_spimainram[(0x00298d0-0x800)/4];
}
@@ -1993,15 +1993,15 @@ READ32_MEMBER(seibuspi_state::rdft_speedup_r)
READ32_MEMBER(seibuspi_state::viprp1_speedup_r)
{
/* viprp1 */
- if (cpu_get_pc(&space.device())==0x0202769) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0202769) device_spin_until_interrupt(&space.device()); // idle
/* viprp1s */
- if (cpu_get_pc(&space.device())==0x02027e9) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x02027e9) device_spin_until_interrupt(&space.device()); // idle
/* viprp1ot */
- if (cpu_get_pc(&space.device())==0x02026bd) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x02026bd) device_spin_until_interrupt(&space.device()); // idle
-// mame_printf_debug("%08x\n",cpu_get_pc(&space.device()));
+// mame_printf_debug("%08x\n",space.device().safe_pc());
return m_spimainram[(0x001e2e0-0x800)/4];
}
@@ -2009,8 +2009,8 @@ READ32_MEMBER(seibuspi_state::viprp1_speedup_r)
READ32_MEMBER(seibuspi_state::viprp1o_speedup_r)
{
/* viperp1o */
- if (cpu_get_pc(&space.device())==0x0201f99) device_spin_until_interrupt(&space.device()); // idle
-// mame_printf_debug("%08x\n",cpu_get_pc(&space.device()));
+ if (space.device().safe_pc()==0x0201f99) device_spin_until_interrupt(&space.device()); // idle
+// mame_printf_debug("%08x\n",space.device().safe_pc());
return m_spimainram[(0x001d49c-0x800)/4];
}
@@ -2018,8 +2018,8 @@ READ32_MEMBER(seibuspi_state::viprp1o_speedup_r)
// causes input problems?
READ32_MEMBER(seibuspi_state::ejanhs_speedup_r)
{
-// mame_printf_debug("%08x\n",cpu_get_pc(&space.device()));
- if (cpu_get_pc(&space.device())==0x03032c7) device_spin_until_interrupt(&space.device()); // idle
+// mame_printf_debug("%08x\n",space.device().safe_pc());
+ if (space.device().safe_pc()==0x03032c7) device_spin_until_interrupt(&space.device()); // idle
return m_spimainram[(0x002d224-0x800)/4];
}
#endif
@@ -2028,18 +2028,18 @@ READ32_MEMBER(seibuspi_state::rf2_speedup_r)
{
/* rdft22kc */
- if (cpu_get_pc(&space.device())==0x0203926) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0203926) device_spin_until_interrupt(&space.device()); // idle
/* rdft2, rdft2j */
- if (cpu_get_pc(&space.device())==0x0204372) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0204372) device_spin_until_interrupt(&space.device()); // idle
/* rdft2us */
- if (cpu_get_pc(&space.device())==0x020420e) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x020420e) device_spin_until_interrupt(&space.device()); // idle
/* rdft2a */
- if (cpu_get_pc(&space.device())==0x0204366) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0204366) device_spin_until_interrupt(&space.device()); // idle
-// mame_printf_debug("%08x\n",cpu_get_pc(&space.device()));
+// mame_printf_debug("%08x\n",space.device().safe_pc());
return m_spimainram[(0x0282AC-0x800)/4];
}
@@ -2047,10 +2047,10 @@ READ32_MEMBER(seibuspi_state::rf2_speedup_r)
READ32_MEMBER(seibuspi_state::rfjet_speedup_r)
{
/* rfjet, rfjetu, rfjeta */
- if (cpu_get_pc(&space.device())==0x0206082) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0206082) device_spin_until_interrupt(&space.device()); // idle
/* rfjetus */
- if (cpu_get_pc(&space.device())==0x0205b39)
+ if (space.device().safe_pc()==0x0205b39)
{
UINT32 r;
device_spin_until_interrupt(&space.device()); // idle
@@ -2060,9 +2060,9 @@ READ32_MEMBER(seibuspi_state::rfjet_speedup_r)
}
/* rfjetj */
- if (cpu_get_pc(&space.device())==0x0205f2e) device_spin_until_interrupt(&space.device()); // idle
+ if (space.device().safe_pc()==0x0205f2e) device_spin_until_interrupt(&space.device()); // idle
-// mame_printf_debug("%08x\n",cpu_get_pc(&space.device()));
+// mame_printf_debug("%08x\n",space.device().safe_pc());
return m_spimainram[(0x002894c-0x800)/4];
diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c
index 6157fb3cbaa..a5baf0056f0 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", cpu_get_pc(&space->device()), 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 075c06e1337..8ac8f1ec30f 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -1392,7 +1392,7 @@ static void uPD71054_update_timer( running_machine &machine, device_t *cpu, int
} else {
uPD71054->timer[no]->adjust( attotime::never, no);
logerror( "CPU #0 PC %06X: uPD71054 error, timer %d duration is 0\n",
- (cpu != NULL) ? cpu_get_pc(cpu) : -1, no );
+ (cpu != NULL) ? cpu->safe_pc() : -1, no );
}
}
@@ -1698,7 +1698,7 @@ READ16_MEMBER(seta_state::calibr50_ip_r)
case 0x16/2: return (dir2 >> 8); // upper 4 bits of p2 rotation
case 0x18/2: return 0xffff; // ? (value's read but not used)
default:
- logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset*2);
+ logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset*2);
return 0;
}
}
@@ -2510,7 +2510,7 @@ READ16_MEMBER(seta_state::krzybowl_input_r)
case 0xc/2: return dir2y & 0xff;
case 0xe/2: return dir2y >> 8;
default:
- logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset*2);
+ logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset*2);
return 0;
}
}
@@ -2675,7 +2675,7 @@ READ16_MEMBER(seta_state::kiwame_input_r)
case 0x08/2: return 0xffff;
default:
- logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset*2);
+ logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset*2);
return 0x0000;
}
}
@@ -2701,12 +2701,12 @@ ADDRESS_MAP_END
READ16_MEMBER(seta_state::thunderl_protection_r)
{
-// logerror("PC %06X - Protection Read\n", cpu_get_pc(&space.device()));
+// logerror("PC %06X - Protection Read\n", space.device().safe_pc());
return 0x00dd;
}
WRITE16_MEMBER(seta_state::thunderl_protection_w)
{
-// logerror("PC %06X - Protection Written: %04X <- %04X\n", cpu_get_pc(&space.device()), offset*2, data);
+// logerror("PC %06X - Protection Written: %04X <- %04X\n", space.device().safe_pc(), offset*2, data);
}
/* Similar to downtown etc. */
@@ -2872,14 +2872,14 @@ READ16_MEMBER(seta_state::pairlove_prot_r)
int retdata;
retdata = m_pairslove_protram[offset];
- //mame_printf_debug("pairs love protection? read %06x %04x %04x\n",cpu_get_pc(&space.device()), offset,retdata);
+ //mame_printf_debug("pairs love protection? read %06x %04x %04x\n",space.device().safe_pc(), offset,retdata);
m_pairslove_protram[offset] = m_pairslove_protram_old[offset];
return retdata;
}
WRITE16_MEMBER(seta_state::pairlove_prot_w)
{
- //mame_printf_debug("pairs love protection? write %06x %04x %04x\n",cpu_get_pc(&space.device()), offset,data);
+ //mame_printf_debug("pairs love protection? write %06x %04x %04x\n",space.device().safe_pc(), offset,data);
m_pairslove_protram_old[offset] = m_pairslove_protram[offset];
m_pairslove_protram[offset] = data;
}
@@ -2956,7 +2956,7 @@ READ16_MEMBER(seta_state::inttoote_key_r)
case 0x80: return ioport("BET4")->read();
}
- logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(&space.device()), *m_inttoote_key_select);
+ logerror("%06X: unknown read, select = %04x\n",space.device().safe_pc(), *m_inttoote_key_select);
return 0xffff;
}
@@ -10708,12 +10708,12 @@ READ16_MEMBER(seta_state::twineagl_200100_r)
{
// protection check at boot
- logerror("%04x: twineagl_200100_r %d\n",cpu_get_pc(&space.device()),offset);
+ logerror("%04x: twineagl_200100_r %d\n",space.device().safe_pc(),offset);
return m_twineagl_xram[offset];
}
WRITE16_MEMBER(seta_state::twineagl_200100_w)
{
- logerror("%04x: twineagl_200100_w %d = %02x\n",cpu_get_pc(&space.device()),offset,data);
+ logerror("%04x: twineagl_200100_w %d = %02x\n",space.device().safe_pc(),offset,data);
if (ACCESSING_BITS_0_7)
{
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 204ec4cb844..35a7c940cd4 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -124,7 +124,7 @@ WRITE16_MEMBER(seta2_state::seta2_sound_bank_w)
int banks = (machine().root_device().memregion( "x1snd" )->bytes() - 0x100000) / 0x20000;
if (data >= banks)
{
- logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 PC %06X: invalid sound bank %04X\n",space.device().safe_pc(),data);
data %= banks;
}
memcpy(ROM + offset * 0x20000, ROM + 0x100000 + data * 0x20000, 0x20000);
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 120f3dbf901..8613dfc1fb5 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -146,7 +146,7 @@ WRITE16_MEMBER(sf_state::protection_w)
}
default:
{
- logerror("Write protection at %06x (%04x)\n", cpu_get_pc(&space.device()), data & 0xffff);
+ logerror("Write protection at %06x (%04x)\n", space.device().safe_pc(), data & 0xffff);
logerror("*** Unknown protection %d\n", space.read_byte(0xffc684));
break;
}
diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c
index c80ee11811d..184125b488a 100644
--- a/src/mame/drivers/shangha3.c
+++ b/src/mame/drivers/shangha3.c
@@ -46,13 +46,13 @@ READ16_MEMBER(shangha3_state::shangha3_prot_r)
{
static const int result[] = { 0x0,0x1,0x3,0x7,0xf,0xe,0xc,0x8,0x0};
- logerror("PC %04x: read 20004e\n",cpu_get_pc(&space.device()));
+ logerror("PC %04x: read 20004e\n",space.device().safe_pc());
return result[m_prot_count++ % 9];
}
WRITE16_MEMBER(shangha3_state::shangha3_prot_w)
{
- logerror("PC %04x: write %02x to 20004e\n",cpu_get_pc(&space.device()),data);
+ logerror("PC %04x: write %02x to 20004e\n",space.device().safe_pc(),data);
}
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 509e374463f..819c7a21ab4 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -1054,7 +1054,7 @@ DRIVER_INIT_MEMBER(simpl156_state,simpl156)
/* Everything seems more stable if we run the CPU speed x4 and use Idle skips.. maybe it has an internal multipler? */
READ32_MEMBER(simpl156_state::joemacr_speedup_r)
{
- if (cpu_get_pc(&space.device()) == 0x284)
+ if (space.device().safe_pc() == 0x284)
device_spin_until_time(&space.device(), attotime::from_usec(400));
return m_systemram[0x18/4];
}
@@ -1068,7 +1068,7 @@ DRIVER_INIT_MEMBER(simpl156_state,joemacr)
READ32_MEMBER(simpl156_state::chainrec_speedup_r)
{
- if (cpu_get_pc(&space.device()) == 0x2d4)
+ if (space.device().safe_pc() == 0x2d4)
device_spin_until_time(&space.device(), attotime::from_usec(400));
return m_systemram[0x18/4];
}
@@ -1081,7 +1081,7 @@ DRIVER_INIT_MEMBER(simpl156_state,chainrec)
READ32_MEMBER(simpl156_state::prtytime_speedup_r)
{
- if (cpu_get_pc(&space.device()) == 0x4f0)
+ if (space.device().safe_pc() == 0x4f0)
device_spin_until_time(&space.device(), attotime::from_usec(400));
return m_systemram[0xae0/4];
}
@@ -1095,7 +1095,7 @@ DRIVER_INIT_MEMBER(simpl156_state,prtytime)
READ32_MEMBER(simpl156_state::charlien_speedup_r)
{
- if (cpu_get_pc(&space.device()) == 0xc8c8)
+ if (space.device().safe_pc() == 0xc8c8)
device_spin_until_time(&space.device(), attotime::from_usec(400));
return m_systemram[0x10/4];
}
@@ -1108,7 +1108,7 @@ DRIVER_INIT_MEMBER(simpl156_state,charlien)
READ32_MEMBER(simpl156_state::osman_speedup_r)
{
- if (cpu_get_pc(&space.device()) == 0x5974)
+ if (space.device().safe_pc() == 0x5974)
device_spin_until_time(&space.device(), attotime::from_usec(400));
return m_systemram[0x10/4];
}
diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c
index 7eea25bf4b6..297e5991990 100644
--- a/src/mame/drivers/slapfght.c
+++ b/src/mame/drivers/slapfght.c
@@ -1770,10 +1770,10 @@ READ8_MEMBER(slapfght_state::gtstarb1_port_0_read)
6D38: 20 F8 jr nz,$6D32
6D3A: 10 E0 djnz $6D1C
*/
- if (cpu_get_pc(&space.device()) == 0x6d1e) return 0;
- if (cpu_get_pc(&space.device()) == 0x6d24) return 6;
- if (cpu_get_pc(&space.device()) == 0x6d2c) return 2;
- if (cpu_get_pc(&space.device()) == 0x6d34) return 4;
+ if (space.device().safe_pc() == 0x6d1e) return 0;
+ if (space.device().safe_pc() == 0x6d24) return 6;
+ if (space.device().safe_pc() == 0x6d2c) return 2;
+ if (space.device().safe_pc() == 0x6d34) return 4;
/* The bootleg hangs in the "test mode" before diplaying (wrong) lives settings :
6AD4: DB 00 in a,($00)
@@ -1794,11 +1794,11 @@ READ8_MEMBER(slapfght_state::gtstarb1_port_0_read)
6AF7: 20 FA jr nz,$6AF3
This seems to be what used to be the MCU status.
*/
- if (cpu_get_pc(&space.device()) == 0x6ad6) return 2; /* bit 1 must be ON */
- if (cpu_get_pc(&space.device()) == 0x6ae4) return 2; /* bit 1 must be ON */
- if (cpu_get_pc(&space.device()) == 0x6af5) return 0; /* bit 2 must be OFF */
+ if (space.device().safe_pc() == 0x6ad6) return 2; /* bit 1 must be ON */
+ if (space.device().safe_pc() == 0x6ae4) return 2; /* bit 1 must be ON */
+ if (space.device().safe_pc() == 0x6af5) return 0; /* bit 2 must be OFF */
- logerror("Port Read PC=%04x\n",cpu_get_pc(&space.device()));
+ logerror("Port Read PC=%04x\n",space.device().safe_pc());
return 0;
}
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index 957a490bfa3..1b7ffc17dfb 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -206,7 +206,7 @@ READ8_MEMBER(snesb_state::sb2b_6a6xxx_r)
case 0xfb7: return 0x47;
}
- logerror("Unknown protection read read %x @ %x\n",offset, cpu_get_pc(&space.device()));
+ logerror("Unknown protection read read %x @ %x\n",offset, space.device().safe_pc());
return 0;
}
diff --git a/src/mame/drivers/solomon.c b/src/mame/drivers/solomon.c
index 10999e804f1..f1196391d86 100644
--- a/src/mame/drivers/solomon.c
+++ b/src/mame/drivers/solomon.c
@@ -23,17 +23,17 @@ WRITE8_MEMBER(solomon_state::solomon_sh_command_w)
READ8_MEMBER(solomon_state::solomon_0xe603_r)
{
- if (cpu_get_pc(&space.device()) == 0x161) // all the time .. return 0 to act as before for coin / startup etc.
+ if (space.device().safe_pc() == 0x161) // all the time .. return 0 to act as before for coin / startup etc.
{
return 0;
}
- else if (cpu_get_pc(&space.device()) == 0x4cf0) // stop it clearing the screen at certain scores
+ else if (space.device().safe_pc() == 0x4cf0) // stop it clearing the screen at certain scores
{
return (cpu_get_reg(&space.device(), Z80_BC) & 0x08);
}
else
{
- mame_printf_debug("unhandled solomon_0xe603_r %04x\n", cpu_get_pc(&space.device()));
+ mame_printf_debug("unhandled solomon_0xe603_r %04x\n", space.device().safe_pc());
return 0;
}
}
diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c
index ce79d97b5d4..165d45dc174 100644
--- a/src/mame/drivers/sothello.c
+++ b/src/mame/drivers/sothello.c
@@ -214,7 +214,7 @@ static void unlock_shared_ram(address_space *space)
}
else
{
- logerror("Sub cpu active! @%x\n",cpu_get_pc(&space->device()));
+ logerror("Sub cpu active! @%x\n",space->device().safe_pc());
}
}
diff --git a/src/mame/drivers/spaceg.c b/src/mame/drivers/spaceg.c
index e39e4d30855..ec1fab4f4fe 100644
--- a/src/mame/drivers/spaceg.c
+++ b/src/mame/drivers/spaceg.c
@@ -255,8 +255,8 @@ WRITE8_MEMBER(spaceg_state::zvideoram_w)
break;
default:
- logerror("mode = %02x pc = %04x\n", *m_io9401, cpu_get_pc(&space.device()));
- popmessage("mode = %02x pc = %04x\n", *m_io9401, cpu_get_pc(&space.device()));
+ logerror("mode = %02x pc = %04x\n", *m_io9401, space.device().safe_pc());
+ popmessage("mode = %02x pc = %04x\n", *m_io9401, space.device().safe_pc());
return;
}
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 8a6ade8b7fa..4871b26bb77 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -211,7 +211,7 @@ static void mcu63705_update_inputs(running_machine &machine)
READ8_MEMBER(spdodgeb_state::mcu63701_r)
{
-// logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",cpu_get_pc(&space.device()),offset);
+// logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",space.device().safe_pc(),offset);
if (m_mcu63701_command == 0) return 0x6a;
else switch (offset)
@@ -227,7 +227,7 @@ READ8_MEMBER(spdodgeb_state::mcu63701_r)
WRITE8_MEMBER(spdodgeb_state::mcu63701_w)
{
-// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",cpu_get_pc(&space.device()),data);
+// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",space.device().safe_pc(),data);
m_mcu63701_command = data;
mcu63705_update_inputs(machine());
}
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index 71cad3d4208..ca7519808c3 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -132,7 +132,7 @@ WRITE8_MEMBER(spoker_state::spoker_nmi_and_coins_w)
if ((data) & (0x22))
{
- logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("PC %06X: nmi_and_coins = %02x\n",space.device().safe_pc(),data);
// popmessage("%02x",data);
}
@@ -193,7 +193,7 @@ WRITE8_MEMBER(spoker_state::spoker_magic_w)
default:
// popmessage("magic %x <- %04x",igs_magic[0],data);
- logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[0], data);
+ logerror("%06x: warning, writing to igs_magic %02x = %02x\n", space.device().safe_pc(), m_igs_magic[0], data);
}
}
@@ -208,11 +208,11 @@ READ8_MEMBER(spoker_state::spoker_magic_r)
if ( !(m_igs_magic[1] & 0x04) ) return ioport("DSW3")->read();
if ( !(m_igs_magic[1] & 0x08) ) return ioport("DSW4")->read();
if ( !(m_igs_magic[1] & 0x10) ) return ioport("DSW5")->read();
- logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[1]);
+ logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", space.device().safe_pc(), m_igs_magic[1]);
break;
default:
- logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[0]);
+ logerror("%06x: warning, reading with igs_magic = %02x\n", space.device().safe_pc(), m_igs_magic[0]);
}
return 0;
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index dc01406670e..fe938570ccc 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -45,12 +45,12 @@ READ8_MEMBER(spy_state::spy_bankedram1_r)
{
if (m_pmcbank)
{
- //logerror("%04x read pmcram %04x\n", cpu_get_pc(&space.device()), offset);
+ //logerror("%04x read pmcram %04x\n", space.device().safe_pc(), offset);
return m_pmcram[offset];
}
else
{
- //logerror("%04x read pmc internal ram %04x\n", cpu_get_pc(&space.device()), offset);
+ //logerror("%04x read pmc internal ram %04x\n", space.device().safe_pc(), offset);
return 0;
}
}
@@ -69,11 +69,11 @@ WRITE8_MEMBER(spy_state::spy_bankedram1_w)
{
if (m_pmcbank)
{
- //logerror("%04x pmcram %04x = %02x\n", cpu_get_pc(&space.device()), offset, data);
+ //logerror("%04x pmcram %04x = %02x\n", space.device().safe_pc(), offset, data);
m_pmcram[offset] = data;
}
//else
- //logerror("%04x pmc internal ram %04x = %02x\n", cpu_get_pc(&space.device()), offset, data);
+ //logerror("%04x pmc internal ram %04x = %02x\n", space.device().safe_pc(), offset, data);
}
else
m_ram[offset] = data;
@@ -304,7 +304,7 @@ WRITE8_MEMBER(spy_state::spy_3f90_w)
/* bit 7 = PMC-BK */
m_pmcbank = (data & 0x80) >> 7;
-//logerror("%04x: 3f90_w %02x\n", cpu_get_pc(&space.device()), data);
+//logerror("%04x: 3f90_w %02x\n", space.device().safe_pc(), data);
/* bit 6 = PMC-START */
if ((data & 0x40) && !(m_old_3f90 & 0x40))
{
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index 4f3ebf866af..b57884c2fa0 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -361,7 +361,7 @@ WRITE16_MEMBER(srmp6_state::video_regs_w)
case 0x56/2: // written 8,9,8,9 successively
default:
- logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", cpu_get_previouspc(&space.device()), offset*2, data, mem_mask);
+ logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", space.device().safe_pcbase(), offset*2, data, mem_mask);
break;
}
COMBINE_DATA(&m_video_regs[offset]);
@@ -370,7 +370,7 @@ WRITE16_MEMBER(srmp6_state::video_regs_w)
READ16_MEMBER(srmp6_state::video_regs_r)
{
- logerror("video_regs_r (PC=%06X): %04x\n", cpu_get_previouspc(&space.device()), offset*2);
+ logerror("video_regs_r (PC=%06X): %04x\n", space.device().safe_pcbase(), offset*2);
return m_video_regs[offset];
}
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index 3d1452ecf54..a3dde6d692a 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -354,17 +354,17 @@ ssfindo_speedup_func ssfindo_speedup;
static void ssfindo_speedups(address_space* space)
{
- if (cpu_get_pc(&space->device())==0x2d6c8) // ssfindo
+ if (space->device().safe_pc()==0x2d6c8) // ssfindo
device_spin_until_time(&space->device(), attotime::from_usec(20));
- else if (cpu_get_pc(&space->device())==0x2d6bc) // ssfindo
+ else if (space->device().safe_pc()==0x2d6bc) // ssfindo
device_spin_until_time(&space->device(), attotime::from_usec(20));
}
static void ppcar_speedups(address_space* space)
{
- if (cpu_get_pc(&space->device())==0x000bc8) // ppcar
+ if (space->device().safe_pc()==0x000bc8) // ppcar
device_spin_until_time(&space->device(), attotime::from_usec(20));
- else if (cpu_get_pc(&space->device())==0x000bbc) // ppcar
+ else if (space->device().safe_pc()==0x000bbc) // ppcar
device_spin_until_time(&space->device(), attotime::from_usec(20));
}
@@ -378,7 +378,7 @@ READ32_MEMBER(ssfindo_state::PS7500_IO_r)
case IOLINES: //TODO: eeprom 24c01
#if 0
- mame_printf_debug("IOLINESR %i @%x\n", offset, cpu_get_pc(&space.device()));
+ mame_printf_debug("IOLINESR %i @%x\n", offset, space.device().safe_pc());
#endif
if(m_flashType == 1)
@@ -434,13 +434,13 @@ WRITE32_MEMBER(ssfindo_state::PS7500_IO_w)
if(data&0xc0)
m_adrLatch=0;
- if(cpu_get_pc(&space.device()) == 0xbac0 && m_flashType == 1)
+ if(space.device().safe_pc() == 0xbac0 && m_flashType == 1)
{
m_flashN=data&1;
}
#if 0
- logerror("IOLINESW %i = %x @%x\n",offset,data,cpu_get_pc(&space.device()));
+ logerror("IOLINESW %i = %x @%x\n",offset,data,space.device().safe_pc());
#endif
break;
@@ -520,7 +520,7 @@ WRITE32_MEMBER(ssfindo_state::io_w)
COMBINE_DATA(&temp);
#if 0
- logerror("[io_w] = %x @%x [latch=%x]\n",data,cpu_get_pc(&space.device()),m_adrLatch);
+ logerror("[io_w] = %x @%x [latch=%x]\n",data,space.device().safe_pc(),m_adrLatch);
#endif
if(m_adrLatch==1)
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 24bc3469a90..90dd901a101 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -64,7 +64,7 @@ WRITE16_MEMBER(sshangha_state::sshangha_protection16_w)
{
COMBINE_DATA(&m_prot_data[offset]);
- logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",cpu_get_pc(&space.device()),offset<<1,data);
+ logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",space.device().safe_pc(),offset<<1,data);
}
/* Protection/IO chip 146 */
@@ -82,7 +82,7 @@ READ16_MEMBER(sshangha_state::sshangha_protection16_r)
// Protection TODO
}
- logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(&space.device()),offset<<1);
+ logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",space.device().safe_pc(),offset<<1);
return m_prot_data[offset];
}
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 3302629ef05..d5d4c068d27 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -526,7 +526,7 @@ READ16_MEMBER(ssv_state::hypreact_input_r)
if (input_sel & 0x0002) return ioport("KEY1")->read();
if (input_sel & 0x0004) return ioport("KEY2")->read();
if (input_sel & 0x0008) return ioport("KEY3")->read();
- logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
+ logerror("CPU #0 PC %06X: unknown input read: %04X\n",space.device().safe_pc(),input_sel);
return 0xffff;
}
@@ -651,7 +651,7 @@ READ16_MEMBER(ssv_state::srmp4_input_r)
if (input_sel & 0x0004) return ioport("KEY1")->read();
if (input_sel & 0x0008) return ioport("KEY2")->read();
if (input_sel & 0x0010) return ioport("KEY3")->read();
- logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
+ logerror("CPU #0 PC %06X: unknown input read: %04X\n",space.device().safe_pc(),input_sel);
return 0xffff;
}
@@ -699,7 +699,7 @@ READ16_MEMBER(ssv_state::srmp7_input_r)
if (input_sel & 0x0004) return ioport("KEY1")->read();
if (input_sel & 0x0008) return ioport("KEY2")->read();
if (input_sel & 0x0010) return ioport("KEY3")->read();
- logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
+ logerror("CPU #0 PC %06X: unknown input read: %04X\n",space.device().safe_pc(),input_sel);
return 0xffff;
}
diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c
index edb223d09fd..4df67d5da18 100644
--- a/src/mame/drivers/stadhero.c
+++ b/src/mame/drivers/stadhero.c
@@ -34,7 +34,7 @@ READ16_MEMBER(stadhero_state::stadhero_control_r)
return ioport("DSW")->read();
}
- logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(&space.device()),0x30c000+offset);
+ logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",space.device().safe_pc(),0x30c000+offset);
return ~0;
}
@@ -49,7 +49,7 @@ WRITE16_MEMBER(stadhero_state::stadhero_control_w)
cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
default:
- logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(&space.device()),data,0x30c010+offset);
+ logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",space.device().safe_pc(),data,0x30c010+offset);
break;
}
}
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index 210268aceed..deb3014c409 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -125,7 +125,7 @@ DIRECT_UPDATE_MEMBER(starwars_state::esb_setdirect)
/* if we are in the slapstic region, process it */
if ((address & 0xe000) == 0x8000)
{
- offs_t pc = cpu_get_pc(&direct.space().device());
+ offs_t pc = direct.space().device().safe_pc();
/* filter out duplicates; we get these because the handler gets called for
multiple reasons:
diff --git a/src/mame/drivers/strnskil.c b/src/mame/drivers/strnskil.c
index a21348da9e1..671591ce750 100644
--- a/src/mame/drivers/strnskil.c
+++ b/src/mame/drivers/strnskil.c
@@ -38,7 +38,7 @@ READ8_MEMBER(strnskil_state::pettanp_protection_r)
{
int res;
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x6066: res = 0xa5; break;
case 0x60dc: res = 0x20; break; /* bits 0-3 unknown */
@@ -49,7 +49,7 @@ READ8_MEMBER(strnskil_state::pettanp_protection_r)
default: res = 0xff; break;
}
- logerror("%04x: protection_r -> %02x\n",cpu_get_pc(&space.device()),res);
+ logerror("%04x: protection_r -> %02x\n",space.device().safe_pc(),res);
return res;
}
@@ -57,7 +57,7 @@ READ8_MEMBER(strnskil_state::banbam_protection_r)
{
int res;
- switch (cpu_get_pc(&space.device()))
+ switch (space.device().safe_pc())
{
case 0x6094: res = 0xa5; break;
case 0x6118: res = 0x20; break; /* bits 0-3 unknown */
@@ -68,13 +68,13 @@ READ8_MEMBER(strnskil_state::banbam_protection_r)
default: res = 0xff; break;
}
- logerror("%04x: protection_r -> %02x\n",cpu_get_pc(&space.device()),res);
+ logerror("%04x: protection_r -> %02x\n",space.device().safe_pc(),res);
return res;
}
WRITE8_MEMBER(strnskil_state::protection_w)
{
- logerror("%04x: protection_w %02x\n",cpu_get_pc(&space.device()),data);
+ logerror("%04x: protection_w %02x\n",space.device().safe_pc(),data);
}
/****************************************************************************/
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 94363c5f5b7..f14331bef71 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -367,9 +367,9 @@ DRIVER_INIT_MEMBER(saturn_state,critcrsh)
READ32_MEMBER(saturn_state::magzun_hef_hack_r)
{
- if(cpu_get_pc(&space.device())==0x604bf20) return 0x00000001; //HWEF
+ if(space.device().safe_pc()==0x604bf20) return 0x00000001; //HWEF
- if(cpu_get_pc(&space.device())==0x604bfbe) return 0x00000002; //HREF
+ if(space.device().safe_pc()==0x604bfbe) return 0x00000002; //HREF
return m_workram_h[0x08e830/4];
}
@@ -377,7 +377,7 @@ READ32_MEMBER(saturn_state::magzun_hef_hack_r)
READ32_MEMBER(saturn_state::magzun_rx_hack_r)
{
- if(cpu_get_pc(&space.device())==0x604c006) return 0x40;
+ if(space.device().safe_pc()==0x604c006) return 0x40;
return m_workram_h[0x0ff3b4/4];
}
@@ -653,7 +653,7 @@ bp 6001d22 (60ffef0)
READ32_MEMBER(saturn_state::astrass_hack_r)
{
- if(cpu_get_pc(&space.device()) == 0x60011ba) return 0x00000000;
+ if(space.device().safe_pc() == 0x60011ba) return 0x00000000;
return m_workram_h[0x000770/4];
}
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index 12686643211..5bde3d7aa09 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -44,7 +44,7 @@ WRITE16_MEMBER(suna16_state::suna16_soundlatch_w)
{
soundlatch_byte_w(space, 0, data & 0xff );
}
- if (data & ~0xff) logerror("CPU#0 PC %06X - Sound latch unknown bits: %04X\n", cpu_get_pc(&space.device()), data);
+ if (data & ~0xff) logerror("CPU#0 PC %06X - Sound latch unknown bits: %04X\n", space.device().safe_pc(), data);
}
@@ -58,7 +58,7 @@ WRITE16_MEMBER(suna16_state::bssoccer_leds_w)
set_led_status(machine(), 3, data & 0x08);
coin_counter_w(machine(), 0, data & 0x10);
}
- if (data & ~0x1f) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(&space.device()), data);
+ if (data & ~0x1f) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", space.device().safe_pc(), data);
}
@@ -70,7 +70,7 @@ WRITE16_MEMBER(suna16_state::uballoon_leds_w)
set_led_status(machine(), 0, data & 0x02);
set_led_status(machine(), 1, data & 0x04);
}
- if (data & ~0x07) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(&space.device()), data);
+ if (data & ~0x07) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", space.device().safe_pc(), data);
}
@@ -80,7 +80,7 @@ WRITE16_MEMBER(suna16_state::bestbest_coin_w)
{
coin_counter_w(machine(), 0, data & 0x04);
}
- if (data & ~0x04) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(&space.device()), data);
+ if (data & ~0x04) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", space.device().safe_pc(), data);
}
@@ -161,7 +161,7 @@ WRITE16_MEMBER(suna16_state::bestbest_prot_w)
case 0x00: m_prot = m_prot ^ 0x0009; break;
case 0x08: m_prot = m_prot ^ 0x0002; break;
case 0x0c: m_prot = m_prot ^ 0x0003; break;
- //default: logerror("CPU#0 PC %06X - Unknown protection value: %04X\n", cpu_get_pc(&space.device()), data);
+ //default: logerror("CPU#0 PC %06X - Unknown protection value: %04X\n", space.device().safe_pc(), data);
}
}
}
@@ -262,7 +262,7 @@ WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w)
{
UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 7;
- if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
+ if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x1000]);
}
@@ -270,7 +270,7 @@ WRITE8_MEMBER(suna16_state::bssoccer_pcm_2_bankswitch_w)
{
UINT8 *RAM = memregion("pcm2")->base();
int bank = data & 7;
- if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
+ if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data);
membank("bank2")->set_base(&RAM[bank * 0x10000 + 0x1000]);
}
@@ -340,7 +340,7 @@ WRITE8_MEMBER(suna16_state::uballoon_pcm_1_bankswitch_w)
{
UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 1;
- if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
+ if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x400]);
}
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 532dea2bd95..8a7e9f5e39a 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -491,7 +491,7 @@ READ8_MEMBER(suna8_state::hardhead_ip_r)
case 2: return ioport("DSW1")->read();
case 3: return ioport("DSW2")->read();
default:
- logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n", cpu_get_pc(&space.device()), *m_hardhead_ip);
+ logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n", space.device().safe_pc(), *m_hardhead_ip);
return 0xff;
}
}
@@ -505,7 +505,7 @@ WRITE8_MEMBER(suna8_state::hardhead_bankswitch_w)
{
int bank = data & 0x0f;
- if (data & ~0xef) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0xef) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",space.device().safe_pc(),data);
membank("bank1")->set_entry(bank);
}
@@ -561,7 +561,7 @@ WRITE8_MEMBER(suna8_state::rranger_bankswitch_w)
int bank = data & 0x07;
if ((~data & 0x10) && (bank >= 4)) bank += 4;
- if (data & ~0xf7) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0xf7) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",space.device().safe_pc(),data);
membank("bank1")->set_entry(bank);
@@ -653,14 +653,14 @@ WRITE8_MEMBER(suna8_state::brickzn_multi_w)
{
m_palettebank = data & 0x01;
- logerror("CPU #0 - PC %04X: palettebank = %02X\n",cpu_get_pc(&space.device()),data);
- if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: palettebank = %02X\n",space.device().safe_pc(),data);
+ if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",space.device().safe_pc(),data);
}
else if ((m_protection_val & 0xfc) == 0x90)
{
soundlatch_byte_w(space, 0, data);
- logerror("CPU #0 - PC %04X: soundlatch = %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: soundlatch = %02X\n",space.device().safe_pc(),data);
}
else if ((m_protection_val & 0xfc) == 0x04)
{
@@ -668,8 +668,8 @@ WRITE8_MEMBER(suna8_state::brickzn_multi_w)
set_led_status(machine(), 1, data & 0x02);
coin_counter_w(machine(), 0, data & 0x04);
- logerror("CPU #0 - PC %04X: leds = %02X\n",cpu_get_pc(&space.device()),data);
- if (data & ~0x07) logerror("CPU #0 - PC %04X: unknown leds bits: %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: leds = %02X\n",space.device().safe_pc(),data);
+ if (data & ~0x07) logerror("CPU #0 - PC %04X: unknown leds bits: %02X\n",space.device().safe_pc(),data);
}
else if ((m_protection_val & 0xfc) == 0x9c)
{
@@ -678,18 +678,18 @@ WRITE8_MEMBER(suna8_state::brickzn_multi_w)
// To be done: run-time opcode decryption change. Done in driver_init for now.
- logerror("CPU #0 - PC %04X: op-decrypt = %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: op-decrypt = %02X\n",space.device().safe_pc(),data);
}
else if ((m_protection_val & 0xfc) == 0x80)
{
// disables rom banking?
// see code at 11b1:
- logerror("CPU #0 - PC %04X: rombank_disable = %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: rombank_disable = %02X\n",space.device().safe_pc(),data);
}
else
{
- logerror("CPU #0 - PC %04X: ignore = %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: ignore = %02X\n",space.device().safe_pc(),data);
}
}
@@ -705,8 +705,8 @@ WRITE8_MEMBER(suna8_state::brickzn_prot_w)
flip_screen_set(data & 0x01);
m_spritebank = (data >> 1) & 1;
- logerror("CPU #0 - PC %04X: protection_val = %02X\n",cpu_get_pc(&space.device()),data);
-// if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: protection_val = %02X\n",space.device().safe_pc(),data);
+// if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",space.device().safe_pc(),data);
}
/*
@@ -726,7 +726,7 @@ WRITE8_MEMBER(suna8_state::brickzn_prot2_w)
m_prot2_prev = m_prot2;
m_prot2 = data;
- logerror("CPU #0 - PC %04X: unknown = %02X\n",cpu_get_pc(&space.device()),data);
+ logerror("CPU #0 - PC %04X: unknown = %02X\n",space.device().safe_pc(),data);
}
/*
@@ -737,7 +737,7 @@ WRITE8_MEMBER(suna8_state::brickzn_rombank_w)
{
int bank = data & 0x0f;
- if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",space.device().safe_pc(),data);
membank("bank1")->set_entry(bank + (membank("bank1")->entry() & 0x10));
@@ -796,7 +796,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna8_state::hardhea2_nmi_w)
{
m_nmi_enable = data & 0x01;
-// if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",cpu_get_pc(&space.device()),data);
+// if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",space.device().safe_pc(),data);
}
/*
@@ -806,7 +806,7 @@ WRITE8_MEMBER(suna8_state::hardhea2_nmi_w)
WRITE8_MEMBER(suna8_state::hardhea2_flipscreen_w)
{
flip_screen_set(data & 0x01);
- if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",space.device().safe_pc(),data);
}
WRITE8_MEMBER(suna8_state::hardhea2_leds_w)
@@ -814,7 +814,7 @@ WRITE8_MEMBER(suna8_state::hardhea2_leds_w)
set_led_status(machine(), 0, data & 0x01);
set_led_status(machine(), 1, data & 0x02);
coin_counter_w(machine(), 0, data & 0x04);
- if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",space.device().safe_pc(),data);
}
/*
@@ -825,7 +825,7 @@ WRITE8_MEMBER(suna8_state::hardhea2_leds_w)
WRITE8_MEMBER(suna8_state::hardhea2_spritebank_w)
{
m_spritebank = (data >> 1) & 1;
- if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",space.device().safe_pc(),data);
}
/*
@@ -836,7 +836,7 @@ WRITE8_MEMBER(suna8_state::hardhea2_rombank_w)
{
int bank = data & 0x0f;
- if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",space.device().safe_pc(),data);
membank("bank1")->set_entry(bank);
@@ -911,7 +911,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna8_state::starfigh_spritebank_latch_w)
{
m_spritebank_latch = (data >> 2) & 1;
- if (data & ~0x04) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ if (data & ~0x04) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",space.device().safe_pc(),data);
}
WRITE8_MEMBER(suna8_state::starfigh_spritebank_w)
@@ -973,7 +973,7 @@ WRITE8_MEMBER(suna8_state::sparkman_cmd_prot_w)
case 0x81: m_trash_prot = 1; break;
case 0x99: m_trash_prot = 1; break;
case 0x54: m_spritebank = 1; break;
- default: logerror("CPU #0 - PC %04X: unknown protection command: %02X\n",cpu_get_pc(&space.device()),data);
+ default: logerror("CPU #0 - PC %04X: unknown protection command: %02X\n",space.device().safe_pc(),data);
}
}
@@ -990,14 +990,14 @@ WRITE8_MEMBER(suna8_state::suna8_wram_w)
WRITE8_MEMBER(suna8_state::sparkman_flipscreen_w)
{
flip_screen_set(data & 0x01);
- //if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(&space.device()),data);
+ //if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",space.device().safe_pc(),data);
}
WRITE8_MEMBER(suna8_state::sparkman_leds_w)
{
set_led_status(machine(), 0, data & 0x01);
set_led_status(machine(), 1, data & 0x02);
- //if (data & ~0x03) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",cpu_get_pc(&space.device()),data);
+ //if (data & ~0x03) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",space.device().safe_pc(),data);
}
WRITE8_MEMBER(suna8_state::sparkman_coin_counter_w)
@@ -1016,7 +1016,7 @@ WRITE8_MEMBER(suna8_state::sparkman_spritebank_w)
m_spritebank = 0;
else
m_spritebank = (data) & 1;
- //if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ //if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",space.device().safe_pc(),data);
}
/*
@@ -1027,7 +1027,7 @@ WRITE8_MEMBER(suna8_state::sparkman_rombank_w)
{
int bank = data & 0x0f;
- //if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(&space.device()),data);
+ //if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",space.device().safe_pc(),data);
membank("bank1")->set_entry(bank);
m_rombank = data;
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index 7d519742a0f..eda89b9f932 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -46,7 +46,7 @@ READ16_MEMBER(supbtime_state::supbtime_controls_r)
return 0;
}
- logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(&space.device()), offset);
+ logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", space.device().safe_pc(), offset);
return ~0;
}
diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c
index 83003efd3a6..88022675cd6 100644
--- a/src/mame/drivers/superchs.c
+++ b/src/mame/drivers/superchs.c
@@ -437,7 +437,7 @@ ROM_END
READ32_MEMBER(superchs_state::main_cycle_r)
{
- if (cpu_get_pc(&space.device())==0x702)
+ if (space.device().safe_pc()==0x702)
device_spin_until_interrupt(&space.device());
return m_ram[0];
@@ -445,7 +445,7 @@ READ32_MEMBER(superchs_state::main_cycle_r)
READ16_MEMBER(superchs_state::sub_cycle_r)
{
- if (cpu_get_pc(&space.device())==0x454)
+ if (space.device().safe_pc()==0x454)
device_spin_until_interrupt(&space.device());
return m_ram[2]&0xffff;
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index bab5735458c..17849da9b1a 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",cpu_get_pc(&space->device()));
+// 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",cpu_get_pc(&space->device()),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",cpu_get_pc(&space->device()),data);
+// logerror("%04x: sqix_z80_mcu_w %02x\n",space->device().safe_pc(),data);
m_portb = data;
}
@@ -234,7 +234,7 @@ WRITE8_MEMBER(superqix_state::bootleg_mcu_p1_w)
case 7:
if ((data & 1) == 0)
{
-// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(&space.device()),m_port3);
+// logerror("%04x: MCU -> Z80 %02x\n",space.device().safe_pc(),m_port3);
m_from_mcu = m_port3_latch;
m_from_mcu_pending = 1;
m_from_z80_pending = 0; // ????
@@ -260,7 +260,7 @@ READ8_MEMBER(superqix_state::bootleg_mcu_p3_r)
}
else if ((m_port1 & 0x40) == 0)
{
-// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(&space.device()),m_from_z80);
+// logerror("%04x: read Z80 command %02x\n",space.device().safe_pc(),m_from_z80);
m_from_z80_pending = 0;
return m_from_z80;
}
@@ -297,7 +297,7 @@ WRITE8_MEMBER(superqix_state::sqixu_mcu_p2_w)
// bit 7 = clock latch from port 3 to Z80
if ((m_port2 & 0x80) != 0 && (data & 0x80) == 0)
{
-// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(&space.device()),m_port3);
+// logerror("%04x: MCU -> Z80 %02x\n",space.device().safe_pc(),m_port3);
m_from_mcu = m_port3;
m_from_mcu_pending = 1;
m_from_z80_pending = 0; // ????
@@ -308,7 +308,7 @@ WRITE8_MEMBER(superqix_state::sqixu_mcu_p2_w)
READ8_MEMBER(superqix_state::sqixu_mcu_p3_r)
{
-// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(&space.device()),m_from_z80);
+// logerror("%04x: read Z80 command %02x\n",space.device().safe_pc(),m_from_z80);
m_from_z80_pending = 0;
return m_from_z80;
}
@@ -403,7 +403,7 @@ static TIMER_CALLBACK( delayed_mcu_z80_w )
READ8_MEMBER(superqix_state::hotsmash_68705_portA_r)
{
-// logerror("%04x: 68705 reads port A = %02x\n",cpu_get_pc(&space.device()),m_portA_in);
+// logerror("%04x: 68705 reads port A = %02x\n",space.device().safe_pc(),m_portA_in);
return m_portA_in;
}
@@ -438,7 +438,7 @@ WRITE8_MEMBER(superqix_state::hotsmash_68705_portC_w)
case 0x3: // command from Z80
m_portA_in = m_from_z80;
-// logerror("%04x: z80 reads command %02x\n",cpu_get_pc(&space.device()),m_from_z80);
+// logerror("%04x: z80 reads command %02x\n",space.device().safe_pc(),m_from_z80);
break;
case 0x4:
@@ -466,14 +466,14 @@ WRITE8_MEMBER(superqix_state::hotsmash_z80_mcu_w)
READ8_MEMBER(superqix_state::hotsmash_from_mcu_r)
{
-// logerror("%04x: z80 reads answer %02x\n",cpu_get_pc(&space.device()),m_from_mcu);
+// logerror("%04x: z80 reads answer %02x\n",space.device().safe_pc(),m_from_mcu);
m_from_mcu_pending = 0;
return m_from_mcu;
}
READ8_MEMBER(superqix_state::hotsmash_ay_port_a_r)
{
-// logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(&space->device()),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);
}
@@ -509,13 +509,13 @@ READ8_MEMBER(superqix_state::pbillian_from_mcu_r)
case 0x81: m_curr_player = 1; return 0;
}
-// logerror("408[%x] r at %x\n",m_from_z80,cpu_get_pc(&space.device()));
+// logerror("408[%x] r at %x\n",m_from_z80,space.device().safe_pc());
return 0;
}
READ8_MEMBER(superqix_state::pbillian_ay_port_a_r)
{
-// logerror("%04x: ay_port_a_r\n",cpu_get_pc(&space->device()));
+// 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/suprgolf.c b/src/mame/drivers/suprgolf.c
index 3b6c716b11a..52b32f6e344 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -269,7 +269,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,cpu_get_previouspc(&space->device()));
+// 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;
@@ -279,7 +279,7 @@ WRITE8_MEMBER(suprgolf_state::rom_bank_select_w)
WRITE8_MEMBER(suprgolf_state::rom2_bank_select_w)
{
UINT8 *region_base = memregion("user2")->base();
-// mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(&space.device()));
+// mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,space.device().safe_pcbase());
membank("bank1")->set_base(region_base + (data&0x0f) * 0x4000);
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index f61c94279d4..c00aed50763 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -642,7 +642,7 @@ WRITE32_MEMBER(skns_state::skns_io_w)
cputag_set_input_line(machine(), "maincpu",0xf,CLEAR_LINE);*/
/* idle skip for vblokbrk/sarukani, i can't find a better place to put it :-( but i think it works ok unless its making the game too fast */
- if (cpu_get_pc(&space.device())==0x04013B42)
+ if (space.device().safe_pc()==0x04013B42)
{
if (!strcmp(machine().system().name,"vblokbrk") ||
!strcmp(machine().system().name,"sarukani"))
@@ -867,7 +867,7 @@ READ32_MEMBER(skns_state::gutsn_speedup_r)
04022072: CMP/EQ R2,R3
04022074: BT $0402206C
*/
- if (cpu_get_pc(&space.device())==0x402206e)
+ if (space.device().safe_pc()==0x402206e)
{
if(m_main_ram[0x00078/4] == m_main_ram[0x0c780/4])
device_spin_until_interrupt(&space.device());
@@ -877,25 +877,25 @@ READ32_MEMBER(skns_state::gutsn_speedup_r)
READ32_MEMBER(skns_state::cyvern_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x402ebd2) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x402ebd2) device_spin_until_interrupt(&space.device());
return m_main_ram[0x4d3c8/4];
}
READ32_MEMBER(skns_state::puzzloopj_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x401dca0) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x401dca0) device_spin_until_interrupt(&space.device());
return m_main_ram[0x86714/4];
}
READ32_MEMBER(skns_state::puzzloopa_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x401d9d4) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x401d9d4) device_spin_until_interrupt(&space.device());
return m_main_ram[0x85bcc/4];
}
READ32_MEMBER(skns_state::puzzloopu_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x401dab0) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x401dab0) device_spin_until_interrupt(&space.device());
return m_main_ram[0x85cec/4];
}
@@ -908,61 +908,61 @@ READ32_MEMBER(skns_state::puzzloope_speedup_r)
0401DA18: BF $0401DA26
0401DA26: BRA $0401DA12
*/
- if (cpu_get_pc(&space.device())==0x401da14) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x401da14) device_spin_until_interrupt(&space.device());
return m_main_ram[0x81d38/4];
}
READ32_MEMBER(skns_state::senknow_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x4017dce) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x4017dce) device_spin_until_interrupt(&space.device());
return m_main_ram[0x0000dc/4];
}
READ32_MEMBER(skns_state::teljan_speedup_r)
{
- if (cpu_get_pc(&space.device())==0x401ba32) device_spin_until_interrupt(&space.device());
+ if (space.device().safe_pc()==0x401ba32) device_spin_until_interrupt(&space.device());
return m_main_ram[0x002fb4/4];
}
READ32_MEMBER(skns_state::jjparads_speedup_r)