summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-04-06 22:02:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-04-06 22:02:39 +0000
commit8a914b3d22703ab8570fd441b8ebc22c04d91a23 (patch)
tree984c9d9259f0a2f5c44adc11a492eb106f0cd8a7 /src
parentedb6e3de5a0610ff6e2166904a7f36e543956449 (diff)
Renamed input port functions:
readinputport -> input_port_read_indexed readinputportbytag -> input_port_read readinputportbytag_safe -> input_port_read_safe Added machine parameter to input port functions. Updated many drivers to accomplish this.
Diffstat (limited to 'src')
-rw-r--r--src/emu/inptport.c28
-rw-r--r--src/emu/inptport.h6
-rw-r--r--src/emu/machine/generic.c192
-rw-r--r--src/emu/sound/disc_inp.c2
-rw-r--r--src/mame/audio/8080bw.c16
-rw-r--r--src/mame/audio/atarijsa.c16
-rw-r--r--src/mame/audio/cyberbal.c4
-rw-r--r--src/mame/audio/harddriv.c2
-rw-r--r--src/mame/audio/mcr.c2
-rw-r--r--src/mame/audio/mw8080bw.c8
-rw-r--r--src/mame/drivers/88games.c8
-rw-r--r--src/mame/drivers/acefruit.c18
-rw-r--r--src/mame/drivers/actfancr.c20
-rw-r--r--src/mame/drivers/aladbl.c4
-rw-r--r--src/mame/drivers/aleck64.c4
-rw-r--r--src/mame/drivers/alg.c11
-rw-r--r--src/mame/drivers/alpha68k.c84
-rw-r--r--src/mame/drivers/amspdwy.c6
-rw-r--r--src/mame/drivers/angelkds.c6
-rw-r--r--src/mame/drivers/aquarium.c2
-rw-r--r--src/mame/drivers/arabian.c2
-rw-r--r--src/mame/drivers/arcadia.c5
-rw-r--r--src/mame/drivers/artmagic.c4
-rw-r--r--src/mame/drivers/astinvad.c4
-rw-r--r--src/mame/drivers/astrocde.c6
-rw-r--r--src/mame/drivers/astrof.c10
-rw-r--r--src/mame/drivers/atarig1.c6
-rw-r--r--src/mame/drivers/atarig42.c4
-rw-r--r--src/mame/drivers/atarigt.c12
-rw-r--r--src/mame/drivers/atarigx2.c10
-rw-r--r--src/mame/drivers/atarisy1.c22
-rw-r--r--src/mame/drivers/atarisy2.c10
-rw-r--r--src/mame/drivers/backfire.c8
-rw-r--r--src/mame/drivers/badlands.c8
-rw-r--r--src/mame/drivers/baraduke.c14
-rw-r--r--src/mame/drivers/batman.c2
-rw-r--r--src/mame/drivers/battlera.c10
-rw-r--r--src/mame/drivers/bbusters.c22
-rw-r--r--src/mame/drivers/beaminv.c2
-rw-r--r--src/mame/drivers/beathead.c8
-rw-r--r--src/mame/drivers/berzerk.c6
-rw-r--r--src/mame/drivers/bfcobra.c4
-rw-r--r--src/mame/drivers/bfm_sc2.c6
-rw-r--r--src/mame/drivers/bigevglf.c2
-rw-r--r--src/mame/drivers/bionicc.c6
-rw-r--r--src/mame/drivers/bishjan.c4
-rw-r--r--src/mame/drivers/bladestl.c2
-rw-r--r--src/mame/drivers/blktiger.c2
-rw-r--r--src/mame/drivers/blmbycar.c4
-rw-r--r--src/mame/drivers/blstroid.c2
-rw-r--r--src/mame/drivers/bnstars.c12
-rw-r--r--src/mame/drivers/boxer.c20
-rw-r--r--src/mame/drivers/btoads.c2
-rw-r--r--src/mame/drivers/bwidow.c4
-rw-r--r--src/mame/drivers/bwing.c14
-rw-r--r--src/mame/drivers/bzone.c8
-rw-r--r--src/mame/drivers/cabal.c10
-rw-r--r--src/mame/drivers/canyon.c6
-rw-r--r--src/mame/drivers/capbowl.c2
-rw-r--r--src/mame/drivers/cave.c14
-rw-r--r--src/mame/drivers/cbuster.c6
-rw-r--r--src/mame/drivers/ccastles.c2
-rw-r--r--src/mame/drivers/centiped.c20
-rw-r--r--src/mame/drivers/cham24.c4
-rw-r--r--src/mame/drivers/champbwl.c4
-rw-r--r--src/mame/drivers/changela.c12
-rw-r--r--src/mame/drivers/chinsan.c24
-rw-r--r--src/mame/drivers/chqflag.c4
-rw-r--r--src/mame/drivers/cidelsa.c2
-rw-r--r--src/mame/drivers/cinemat.c18
-rw-r--r--src/mame/drivers/cischeat.c10
-rw-r--r--src/mame/drivers/citycon.c2
-rw-r--r--src/mame/drivers/clayshoo.c20
-rw-r--r--src/mame/drivers/cliffhgr.c2
-rw-r--r--src/mame/drivers/cloud9.c2
-rw-r--r--src/mame/drivers/clshroad.c8
-rw-r--r--src/mame/drivers/cninja.c8
-rw-r--r--src/mame/drivers/cojag.c4
-rw-r--r--src/mame/drivers/combatsc.c2
-rw-r--r--src/mame/drivers/coolpool.c16
-rw-r--r--src/mame/drivers/cop01.c4
-rw-r--r--src/mame/drivers/copsnrob.c2
-rw-r--r--src/mame/drivers/cosmic.c4
-rw-r--r--src/mame/drivers/cps1.c18
-rw-r--r--src/mame/drivers/cps2.c4
-rw-r--r--src/mame/drivers/cps3.c4
-rw-r--r--src/mame/drivers/crbaloon.c4
-rw-r--r--src/mame/drivers/crgolf.c4
-rw-r--r--src/mame/drivers/crshrace.c2
-rw-r--r--src/mame/drivers/crystal.c8
-rw-r--r--src/mame/drivers/csk.c2
-rw-r--r--src/mame/drivers/cubocd32.c5
-rw-r--r--src/mame/drivers/cyberbal.c4
-rw-r--r--src/mame/drivers/cybertnk.c16
-rw-r--r--src/mame/drivers/darkhors.c6
-rw-r--r--src/mame/drivers/darkseal.c6
-rw-r--r--src/mame/drivers/dassault.c12
-rw-r--r--src/mame/drivers/dbz.c6
-rw-r--r--src/mame/drivers/dcheese.c4
-rw-r--r--src/mame/drivers/ddenlovr.c174
-rw-r--r--src/mame/drivers/deadang.c4
-rw-r--r--src/mame/drivers/dec8.c44
-rw-r--r--src/mame/drivers/deco156.c4
-rw-r--r--src/mame/drivers/deco32.c40
-rw-r--r--src/mame/drivers/deco_mlc.c4
-rw-r--r--src/mame/drivers/destroyr.c6
-rw-r--r--src/mame/drivers/djboy.c64
-rw-r--r--src/mame/drivers/djmain.c6
-rw-r--r--src/mame/drivers/dkong.c10
-rw-r--r--src/mame/drivers/dlair.c2
-rw-r--r--src/mame/drivers/dragrace.c10
-rw-r--r--src/mame/drivers/dreamwld.c4
-rw-r--r--src/mame/drivers/dribling.c6
-rw-r--r--src/mame/drivers/dunhuang.c22
-rw-r--r--src/mame/drivers/dynax.c62
-rw-r--r--src/mame/drivers/embargo.c10
-rw-r--r--src/mame/drivers/enigma2.c10
-rw-r--r--src/mame/drivers/eolith.c2
-rw-r--r--src/mame/drivers/eolith16.c2
-rw-r--r--src/mame/drivers/eprom.c4
-rw-r--r--src/mame/drivers/equites.c4
-rw-r--r--src/mame/drivers/ettrivia.c2
-rw-r--r--src/mame/drivers/exidy.c4
-rw-r--r--src/mame/drivers/exidy440.c4
-rw-r--r--src/mame/drivers/exprraid.c4
-rw-r--r--src/mame/drivers/exterm.c2
-rw-r--r--src/mame/drivers/fantland.c14
-rw-r--r--src/mame/drivers/fgoal.c8
-rw-r--r--src/mame/drivers/filetto.c2
-rw-r--r--src/mame/drivers/firebeat.c16
-rw-r--r--src/mame/drivers/firetrap.c8
-rw-r--r--src/mame/drivers/firetrk.c16
-rw-r--r--src/mame/drivers/flkatck.c6
-rw-r--r--src/mame/drivers/flstory.c2
-rw-r--r--src/mame/drivers/flyball.c10
-rw-r--r--src/mame/drivers/foodf.c4
-rw-r--r--src/mame/drivers/freekick.c4
-rw-r--r--src/mame/drivers/fromanc2.c12
-rw-r--r--src/mame/drivers/fromance.c10
-rw-r--r--src/mame/drivers/fuukifg3.c2
-rw-r--r--src/mame/drivers/gaelco2.c8
-rw-r--r--src/mame/drivers/gaelco3d.c16
-rw-r--r--src/mame/drivers/galaga.c20
-rw-r--r--src/mame/drivers/galaxian.c14
-rw-r--r--src/mame/drivers/galaxold.c6
-rw-r--r--src/mame/drivers/galpani3.c6
-rw-r--r--src/mame/drivers/gameplan.c2
-rw-r--r--src/mame/drivers/gaplus.c16
-rw-r--r--src/mame/drivers/gauntlet.c4
-rw-r--r--src/mame/drivers/genesis.c28
-rw-r--r--src/mame/drivers/gladiatr.c16
-rw-r--r--src/mame/drivers/goal92.c10
-rw-r--r--src/mame/drivers/gomoku.c2
-rw-r--r--src/mame/drivers/goodejan.c10
-rw-r--r--src/mame/drivers/gottlieb.c8
-rw-r--r--src/mame/drivers/grchamp.c2
-rw-r--r--src/mame/drivers/gridlee.c2
-rw-r--r--src/mame/drivers/gsword.c14
-rw-r--r--src/mame/drivers/gticlub.c30
-rw-r--r--src/mame/drivers/guab.c2
-rw-r--r--src/mame/drivers/gundealr.c6
-rw-r--r--src/mame/drivers/halleys.c6
-rw-r--r--src/mame/drivers/hanaawas.c6
-rw-r--r--src/mame/drivers/hitme.c14
-rw-r--r--src/mame/drivers/hnayayoi.c2
-rw-r--r--src/mame/drivers/hng64.c6
-rw-r--r--src/mame/drivers/homedata.c8
-rw-r--r--src/mame/drivers/homerun.c4
-rw-r--r--src/mame/drivers/hornet.c8
-rw-r--r--src/mame/drivers/hyperspt.c2
-rw-r--r--src/mame/drivers/igs_blit.c48
-rw-r--r--src/mame/drivers/imolagp.c2
-rw-r--r--src/mame/drivers/inufuku.c2
-rw-r--r--src/mame/drivers/itech32.c24
-rw-r--r--src/mame/drivers/itech8.c4
-rw-r--r--src/mame/drivers/jack.c6
-rw-r--r--src/mame/drivers/jackal.c2
-rw-r--r--src/mame/drivers/jalmah.c2
-rw-r--r--src/mame/drivers/jchan.c10
-rw-r--r--src/mame/drivers/jedi.c4
-rw-r--r--src/mame/drivers/jongkyo.c20
-rw-r--r--src/mame/drivers/jpmimpct.c16
-rw-r--r--src/mame/drivers/kaneko16.c24
-rw-r--r--src/mame/drivers/karnov.c14
-rw-r--r--src/mame/drivers/kinst.c6
-rw-r--r--src/mame/drivers/kinstb.c4
-rw-r--r--src/mame/drivers/klax.c2
-rw-r--r--src/mame/drivers/konamigv.c4
-rw-r--r--src/mame/drivers/konamigx.c18
-rw-r--r--src/mame/drivers/ksys573.c31
-rw-r--r--src/mame/drivers/ladybug.c8
-rw-r--r--src/mame/drivers/laserbat.c2
-rw-r--r--src/mame/drivers/lastfght.c6
-rw-r--r--src/mame/drivers/lemmings.c14
-rw-r--r--src/mame/drivers/lethal.c4
-rw-r--r--src/mame/drivers/lethalj.c2
-rw-r--r--src/mame/drivers/liberate.c12
-rw-r--r--src/mame/drivers/liberatr.c8
-rw-r--r--src/mame/drivers/limenko.c2
-rw-r--r--src/mame/drivers/lockon.c8
-rw-r--r--src/mame/drivers/lordgun.c6
-rw-r--r--src/mame/drivers/lvcards.c2
-rw-r--r--src/mame/drivers/m10.c12
-rw-r--r--src/mame/drivers/m72.c4
-rw-r--r--src/mame/drivers/macrossp.c4
-rw-r--r--src/mame/drivers/macs.c24
-rw-r--r--src/mame/drivers/malzak.c2
-rw-r--r--src/mame/drivers/mappy.c18
-rw-r--r--src/mame/drivers/marinedt.c2
-rw-r--r--src/mame/drivers/maxaflex.c2
-rw-r--r--src/mame/drivers/mayumi.c2
-rw-r--r--src/mame/drivers/mazerbla.c2
-rw-r--r--src/mame/drivers/mcatadv.c2
-rw-r--r--src/mame/drivers/mcr.c24
-rw-r--r--src/mame/drivers/mcr3.c24
-rw-r--r--src/mame/drivers/mcr68.c36
-rw-r--r--src/mame/drivers/mediagx.c10
-rw-r--r--src/mame/drivers/megadriv.c34
-rw-r--r--src/mame/drivers/megaplay.c12
-rw-r--r--src/mame/drivers/megasys1.c16
-rw-r--r--src/mame/drivers/megatech.c8
-rw-r--r--src/mame/drivers/meijinsn.c12
-rw-r--r--src/mame/drivers/meritm.c12
-rw-r--r--src/mame/drivers/metlclsh.c2
-rw-r--r--src/mame/drivers/metro.c20
-rw-r--r--src/mame/drivers/mgolf.c14
-rw-r--r--src/mame/drivers/micro3d.c2
-rw-r--r--src/mame/drivers/midas.c2
-rw-r--r--src/mame/drivers/midvunit.c8
-rw-r--r--src/mame/drivers/midzeus.c10
-rw-r--r--src/mame/drivers/mirage.c4
-rw-r--r--src/mame/drivers/missile.c10
-rw-r--r--src/mame/drivers/mitchell.c20
-rw-r--r--src/mame/drivers/mjkjidai.c4
-rw-r--r--src/mame/drivers/mjsister.c2
-rw-r--r--src/mame/drivers/model1.c4
-rw-r--r--src/mame/drivers/model2.c12
-rw-r--r--src/mame/drivers/model3.c28
-rw-r--r--src/mame/drivers/mpu4.c8
-rw-r--r--src/mame/drivers/mquake.c5
-rw-r--r--src/mame/drivers/mrflea.c8
-rw-r--r--src/mame/drivers/ms32.c40
-rw-r--r--src/mame/drivers/msisaac.c2
-rw-r--r--src/mame/drivers/mugsmash.c8
-rw-r--r--src/mame/drivers/multigam.c8
-rw-r--r--src/mame/drivers/mw8080bw.c76
-rw-r--r--src/mame/drivers/mystwarr.c20
-rw-r--r--src/mame/drivers/namcona1.c30
-rw-r--r--src/mame/drivers/namconb1.c8
-rw-r--r--src/mame/drivers/namcos1.c2
-rw-r--r--src/mame/drivers/namcos11.c22
-rw-r--r--src/mame/drivers/namcos12.c12
-rw-r--r--src/mame/drivers/namcos22.c104
-rw-r--r--src/mame/drivers/namcos86.c32
-rw-r--r--src/mame/drivers/naughtyb.c2
-rw-r--r--src/mame/drivers/nbmj9195.c72
-rw-r--r--src/mame/drivers/nemesis.c4
-rw-r--r--src/mame/drivers/neodrvr.c2
-rw-r--r--src/mame/drivers/neogeo.c10
-rw-r--r--src/mame/drivers/ninjakd2.c8
-rw-r--r--src/mame/drivers/niyanpai.c34
-rw-r--r--src/mame/drivers/nova2001.c2
-rw-r--r--src/mame/drivers/nwk-tr.c18
-rw-r--r--src/mame/drivers/nycaptor.c4
-rw-r--r--src/mame/drivers/offtwall.c2
-rw-r--r--src/mame/drivers/ojankohs.c48
-rw-r--r--src/mame/drivers/omegrace.c2
-rw-r--r--src/mame/drivers/oneshot.c2
-rw-r--r--src/mame/drivers/opwolf.c12
-rw-r--r--src/mame/drivers/othunder.c2
-rw-r--r--src/mame/drivers/pacland.c4
-rw-r--r--src/mame/drivers/pacman.c4
-rw-r--r--src/mame/drivers/peplus.c10
-rw-r--r--src/mame/drivers/pgm.c6
-rw-r--r--src/mame/drivers/plygonet.c2
-rw-r--r--src/mame/drivers/pntnpuzl.c16
-rw-r--r--src/mame/drivers/polepos.c18
-rw-r--r--src/mame/drivers/policetr.c6
-rw-r--r--src/mame/drivers/polyplay.c2
-rw-r--r--src/mame/drivers/poolshrk.c6
-rw-r--r--src/mame/drivers/popper.c16
-rw-r--r--src/mame/drivers/progolf.c2
-rw-r--r--src/mame/drivers/psikyo.c18
-rw-r--r--src/mame/drivers/psikyo4.c14
-rw-r--r--src/mame/drivers/psikyosh.c4
-rw-r--r--src/mame/drivers/quantum.c8
-rw-r--r--src/mame/drivers/rabbit.c4
-rw-r--r--src/mame/drivers/raiden2.c10
-rw-r--r--src/mame/drivers/rcasino.c2
-rw-r--r--src/mame/drivers/realbrk.c18
-rw-r--r--src/mame/drivers/redalert.c2
-rw-r--r--src/mame/drivers/redclash.c4
-rw-r--r--src/mame/drivers/relief.c2
-rw-r--r--src/mame/drivers/renegade.c2
-rw-r--r--src/mame/drivers/rmhaihai.c4
-rw-r--r--src/mame/drivers/rockola.c4
-rw-r--r--src/mame/drivers/rohga.c6
-rw-r--r--src/mame/drivers/route16.c8
-rw-r--r--src/mame/drivers/royalmah.c54
-rw-r--r--src/mame/drivers/rpunch.c2
-rw-r--r--src/mame/drivers/runaway.c6
-rw-r--r--src/mame/drivers/rungun.c14
-rw-r--r--src/mame/drivers/sbrkout.c16
-rw-r--r--src/mame/drivers/sderby.c8
-rw-r--r--src/mame/drivers/seattle.c22
-rw-r--r--src/mame/drivers/segac2.c4
-rw-r--r--src/mame/drivers/segae.c8
-rw-r--r--src/mame/drivers/segag80r.c22
-rw-r--r--src/mame/drivers/segag80v.c18
-rw-r--r--src/mame/drivers/segahang.c16
-rw-r--r--src/mame/drivers/segaorun.c8
-rw-r--r--src/mame/drivers/segas16a.c58
-rw-r--r--src/mame/drivers/segas16b.c56
-rw-r--r--src/mame/drivers/segas18.c42
-rw-r--r--src/mame/drivers/segas24.c58
-rw-r--r--src/mame/drivers/segas32.c26
-rw-r--r--src/mame/drivers/segaxbd.c14
-rw-r--r--src/mame/drivers/segaybd.c4
-rw-r--r--src/mame/drivers/seibuspi.c10
-rw-r--r--src/mame/drivers/seicross.c2
-rw-r--r--src/mame/drivers/sengokmj.c12
-rw-r--r--src/mame/drivers/seta.c72
-rw-r--r--src/mame/drivers/seta2.c18
-rw-r--r--src/mame/drivers/sgladiat.c2
-rw-r--r--src/mame/drivers/shadfrce.c8
-rw-r--r--src/mame/drivers/shootout.c2
-rw-r--r--src/mame/drivers/shuuz.c6
-rw-r--r--src/mame/drivers/sidearms.c2
-rw-r--r--src/mame/drivers/silkroad.c4
-rw-r--r--src/mame/drivers/simpl156.c4
-rw-r--r--src/mame/drivers/skullxbo.c2
-rw-r--r--src/mame/drivers/skyfox.c2
-rw-r--r--src/mame/drivers/skykid.c14
-rw-r--r--src/mame/drivers/skyraid.c6
-rw-r--r--src/mame/drivers/slapshot.c2
-rw-r--r--src/mame/drivers/snk.c8
-rw-r--r--src/mame/drivers/snk68.c18
-rw-r--r--src/mame/drivers/spdodgeb.c22
-rw-r--r--src/mame/drivers/speedatk.c4
-rw-r--r--src/mame/drivers/sprint2.c18
-rw-r--r--src/mame/drivers/sprint4.c28
-rw-r--r--src/mame/drivers/sprint8.c4
-rw-r--r--src/mame/drivers/srmp2.c8
-rw-r--r--src/mame/drivers/srmp6.c10
-rw-r--r--src/mame/drivers/ssf2md.c2
-rw-r--r--src/mame/drivers/sshangha.c12
-rw-r--r--src/mame/drivers/ssozumo.c2
-rw-r--r--src/mame/drivers/ssv.c38
-rw-r--r--src/mame/drivers/stactics.c8
-rw-r--r--src/mame/drivers/stadhero.c6
-rw-r--r--src/mame/drivers/starshp1.c12
-rw-r--r--src/mame/drivers/stlforce.c2
-rw-r--r--src/mame/drivers/stv.c48
-rw-r--r--src/mame/drivers/suna8.c8
-rw-r--r--src/mame/drivers/supbtime.c6
-rw-r--r--src/mame/drivers/superqix.c32
-rw-r--r--src/mame/drivers/suprnova.c6
-rw-r--r--src/mame/drivers/suprridr.c4
-rw-r--r--src/mame/drivers/system16.c38
-rw-r--r--src/mame/drivers/system18.c10
-rw-r--r--src/mame/drivers/tagteam.c2
-rw-r--r--src/mame/drivers/taito_f3.c14
-rw-r--r--src/mame/drivers/taito_h.c16
-rw-r--r--src/mame/drivers/taito_l.c12
-rw-r--r--src/mame/drivers/taito_x.c14
-rw-r--r--src/mame/drivers/taitoair.c12
-rw-r--r--src/mame/drivers/taitojc.c12
-rw-r--r--src/mame/drivers/taitosj.c6
-rw-r--r--src/mame/drivers/tankbatt.c8
-rw-r--r--src/mame/drivers/tatsumi.c4
-rw-r--r--src/mame/drivers/taxidrvr.c2
-rw-r--r--src/mame/drivers/tceptor.c8
-rw-r--r--src/mame/drivers/tehkanwc.c12
-rw-r--r--src/mame/drivers/tempest.c14
-rw-r--r--src/mame/drivers/terracre.c2
-rw-r--r--src/mame/drivers/tetrisp2.c4
-rw-r--r--src/mame/drivers/thedeep.c2
-rw-r--r--src/mame/drivers/thief.c8
-rw-r--r--src/mame/drivers/thunderj.c2
-rw-r--r--src/mame/drivers/tickee.c4
-rw-r--r--src/mame/drivers/tmaster.c20
-rw-r--r--src/mame/drivers/tnzs.c4
-rw-r--r--src/mame/drivers/toobin.c2
-rw-r--r--src/mame/drivers/topspeed.c4
-rw-r--r--src/mame/drivers/toratora.c2
-rw-r--r--src/mame/drivers/tourtabl.c2
-rw-r--r--src/mame/drivers/toypop.c22
-rw-r--r--src/mame/drivers/triplhnt.c10
-rw-r--r--src/mame/drivers/truco.c2
-rw-r--r--src/mame/drivers/tugboat.c10
-rw-r--r--src/mame/drivers/tumbleb.c8
-rw-r--r--src/mame/drivers/tumblep.c6
-rw-r--r--src/mame/drivers/tunhunt.c14
-rw-r--r--src/mame/drivers/turbo.c16
-rw-r--r--src/mame/drivers/twin16.c14
-rw-r--r--src/mame/drivers/tx1.c16
-rw-r--r--src/mame/drivers/uapce.c6
-rw-r--r--src/mame/drivers/ultratnk.c14
-rw-r--r--src/mame/drivers/ultrsprt.c6
-rw-r--r--src/mame/drivers/unico.c16
-rw-r--r--src/mame/drivers/upscope.c3
-rw-r--r--src/mame/drivers/vamphalf.c4
-rw-r--r--src/mame/drivers/vaportra.c6
-rw-r--r--src/mame/drivers/vegaeo.c2
-rw-r--r--src/mame/drivers/vegas.c2
-rw-r--r--src/mame/drivers/vendetta.c2
-rw-r--r--src/mame/drivers/vicdual.c6
-rw-r--r--src/mame/drivers/videopin.c8
-rw-r--r--src/mame/drivers/vindictr.c2
-rw-r--r--src/mame/drivers/vmetal.c16
-rw-r--r--src/mame/drivers/warpwarp.c10
-rw-r--r--src/mame/drivers/welltris.c2
-rw-r--r--src/mame/drivers/wgp.c6
-rw-r--r--src/mame/drivers/wheelfir.c4
-rw-r--r--src/mame/drivers/wink.c4
-rw-r--r--src/mame/drivers/wiping.c2
-rw-r--r--src/mame/drivers/witch.c10
-rw-r--r--src/mame/drivers/wolfpack.c6
-rw-r--r--src/mame/drivers/wwfsstar.c2
-rw-r--r--src/mame/drivers/wwfwfest.c16
-rw-r--r--src/mame/drivers/xain.c2
-rw-r--r--src/mame/drivers/xorworld.c2
-rw-r--r--src/mame/drivers/xtheball.c6
-rw-r--r--src/mame/drivers/xxmissio.c2
-rw-r--r--src/mame/drivers/xybots.c2
-rw-r--r--src/mame/drivers/xyonix.c20
-rw-r--r--src/mame/drivers/yumefuda.c14
-rw-r--r--src/mame/drivers/zaccaria.c2
-rw-r--r--src/mame/drivers/zaxxon.c2
-rw-r--r--src/mame/drivers/zerozone.c8
-rw-r--r--src/mame/drivers/zn.c4
-rw-r--r--src/mame/drivers/zr107.c14
-rw-r--r--src/mame/includes/8080bw.h2
-rw-r--r--src/mame/includes/amiga.h2
-rw-r--r--src/mame/includes/atari.h4
-rw-r--r--src/mame/includes/mw8080bw.h4
-rw-r--r--src/mame/includes/vicdual.h2
-rw-r--r--src/mame/machine/ajax.c8
-rw-r--r--src/mame/machine/amiga.c16
-rw-r--r--src/mame/machine/asteroid.c18
-rw-r--r--src/mame/machine/atari.c16
-rw-r--r--src/mame/machine/atarifb.c24
-rw-r--r--src/mame/machine/balsente.c20
-rw-r--r--src/mame/machine/bonzeadv.c8
-rw-r--r--src/mame/machine/bublbobl.c6
-rw-r--r--src/mame/machine/carpolo.c8
-rw-r--r--src/mame/machine/cchip.c6
-rw-r--r--src/mame/machine/dc.c10
-rw-r--r--src/mame/machine/dec0.c26
-rw-r--r--src/mame/machine/decocass.c2
-rw-r--r--src/mame/machine/decoprot.c66
-rw-r--r--src/mame/machine/gaelco2.c2
-rw-r--r--src/mame/machine/galaxold.c20
-rw-r--r--src/mame/machine/gaplus.c4
-rw-r--r--src/mame/machine/harddriv.c12
-rw-r--r--src/mame/machine/irobot.c4
-rw-r--r--src/mame/machine/kaneko16.c32
-rw-r--r--src/mame/machine/leland.c58
-rw-r--r--src/mame/machine/mcr.c4
-rw-r--r--src/mame/machine/mexico86.c12
-rw-r--r--src/mame/machine/mhavoc.c10
-rw-r--r--src/mame/machine/midtunit.c2
-rw-r--r--src/mame/machine/midwayic.c8
-rw-r--r--src/mame/machine/midwunit.c6
-rw-r--r--src/mame/machine/midyunit.c12
-rw-r--r--src/mame/machine/n64.c20
-rw-r--r--src/mame/machine/namcoio.c2
-rw-r--r--src/mame/machine/namcos1.c30
-rw-r--r--src/mame/machine/namcos2.c6
-rw-r--r--src/mame/machine/nb1413m3.c130
-rw-r--r--src/mame/machine/nitedrvr.c14
-rw-r--r--src/mame/machine/opwolf.c4
-rw-r--r--src/mame/machine/pcecommn.c2
-rw-r--r--src/mame/machine/pckeybrd.c3
-rw-r--r--src/mame/machine/pgmprot.c14
-rw-r--r--src/mame/machine/playch10.c12
-rw-r--r--src/mame/machine/qix.c8
-rw-r--r--src/mame/machine/rainbow.c8
-rw-r--r--src/mame/machine/scramble.c16
-rw-r--r--src/mame/machine/simpsons.c2
-rw-r--r--src/mame/machine/slikshot.c4
-rw-r--r--src/mame/machine/snes.c20
-rw-r--r--src/mame/machine/starwars.c6
-rw-r--r--src/mame/machine/stfight.c4
-rw-r--r--src/mame/machine/strtheat.c12
-rw-r--r--src/mame/machine/tatsumi.c4
-rw-r--r--src/mame/machine/tnzs.c20
-rw-r--r--src/mame/machine/vertigo.c6
-rw-r--r--src/mame/machine/volfied.c8
-rw-r--r--src/mame/machine/vsnes.c32
-rw-r--r--src/mame/machine/williams.c8
-rw-r--r--src/mame/machine/xevious.c8
-rw-r--r--src/mame/video/8080bw.c4
-rw-r--r--src/mame/video/aeroboto.c2
-rw-r--r--src/mame/video/amiga.c6
-rw-r--r--src/mame/video/astrocde.c24
-rw-r--r--src/mame/video/atari.c16
-rw-r--r--src/mame/video/bking.c4
-rw-r--r--src/mame/video/bwing.c2
-rw-r--r--src/mame/video/canyon.c2
-rw-r--r--src/mame/video/centiped.c4
-rw-r--r--src/mame/video/cinemat.c2
-rw-r--r--src/mame/video/cischeat.c60
-rw-r--r--src/mame/video/combatsc.c2
-rw-r--r--src/mame/video/dcheese.c4
-rw-r--r--src/mame/video/dkong.c2
-rw-r--r--src/mame/video/exidy.c8
-rw-r--r--src/mame/video/exidy440.c4
-rw-r--r--src/mame/video/fgoal.c2
-rw-r--r--src/mame/video/itech8.c2
-rw-r--r--src/mame/video/jaguar.c6
-rw-r--r--src/mame/video/lazercmd.c2
-rw-r--r--src/mame/video/lethal.c4
-rw-r--r--src/mame/video/lethalj.c4
-rw-r--r--src/mame/video/lordgun.c16
-rw-r--r--src/mame/video/m52.c2
-rw-r--r--src/mame/video/m57.c2
-rw-r--r--src/mame/video/m58.c2
-rw-r--r--src/mame/video/m62.c2
-rw-r--r--src/mame/video/m72.c4
-rw-r--r--src/mame/video/m92.c2
-rw-r--r--src/mame/video/madalien.c2
-rw-r--r--src/mame/video/mario.c2
-rw-r--r--src/mame/video/momoko.c2
-rw-r--r--src/mame/video/mystston.c2
-rw-r--r--src/mame/video/n8080.c4
-rw-r--r--src/mame/video/namcofl.c22
-rw-r--r--src/mame/video/namconb1.c16
-rw-r--r--src/mame/video/nmk16.c30
-rw-r--r--src/mame/video/oneshot.c14
-rw-r--r--src/mame/video/orbit.c2
-rw-r--r--src/mame/video/phoenix.c8
-rw-r--r--src/mame/video/polepos.c2
-rw-r--r--src/mame/video/policetr.c8
-rw-r--r--src/mame/video/prehisle.c10
-rw-r--r--src/mame/video/psikyo.c2
-rw-r--r--src/mame/video/snes.c12
-rw-r--r--src/mame/video/st0016.c2
-rw-r--r--src/mame/video/superqix.c4
-rw-r--r--src/mame/video/travrusa.c2
-rw-r--r--src/mame/video/turbo.c6
-rw-r--r--src/mame/video/vicdual.c2
-rw-r--r--src/mame/video/warpwarp.c2
543 files changed, 3087 insertions, 3080 deletions
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 5bfeb5f80e2..924511cbaf3 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -1034,7 +1034,7 @@ static void input_port_exit(running_machine *machine);
static void input_port_frame(running_machine *machine);
static void input_port_load(int config_type, xml_data_node *parentnode);
static void input_port_save(int config_type, xml_data_node *parentnode);
-static void update_digital_joysticks(void);
+static void update_digital_joysticks(running_machine *machine);
static void update_analog_port(int port);
static void autoselect_device(const input_port_entry *ipt, int type1, int type2, int type3, const char *option, const char *ananame);
@@ -2605,9 +2605,9 @@ int input_port_condition(const input_port_entry *in)
switch (in->condition.condition)
{
case PORTCOND_EQUALS:
- return ((readinputport(in->condition.portnum) & in->condition.mask) == in->condition.value);
+ return ((input_port_read_indexed(Machine, in->condition.portnum) & in->condition.mask) == in->condition.value);
case PORTCOND_NOTEQUALS:
- return ((readinputport(in->condition.portnum) & in->condition.mask) != in->condition.value);
+ return ((input_port_read_indexed(Machine, in->condition.portnum) & in->condition.mask) != in->condition.value);
}
return 1;
}
@@ -2771,7 +2771,7 @@ profiler_mark(PROFILER_INPUT);
update_analog_port(portnum);
/* update the digital joysticks first */
- update_digital_joysticks();
+ update_digital_joysticks(machine);
/* compute default values for all the ports */
input_port_update_defaults();
@@ -2884,7 +2884,7 @@ profiler_mark(PROFILER_INPUT);
{
input_port_entry *portentry = changed->portentry;
- UINT32 new_unmasked_value = readinputport(portnum);
+ UINT32 new_unmasked_value = input_port_read_indexed(machine, portnum);
UINT32 newval = (new_unmasked_value & portentry->mask) >> changed->shift;
UINT32 oldval = (portentry->changed_last_value & portentry->mask) >> changed->shift;
@@ -2918,7 +2918,7 @@ profiler_mark(PROFILER_END);
*
*************************************/
-static void update_digital_joysticks(void)
+static void update_digital_joysticks(running_machine *machine)
{
int player, joyindex;
@@ -2984,7 +2984,7 @@ static void update_digital_joysticks(void)
if ((info->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
(info->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
{
- if (mame_rand(Machine) & 1)
+ if (mame_rand(machine) & 1)
info->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
else
info->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
@@ -3279,7 +3279,7 @@ profiler_mark(PROFILER_END);
*
*************************************/
-UINT32 readinputport(int portnum)
+UINT32 input_port_read_indexed(running_machine *machine, int portnum)
{
input_port_info *portinfo = &port_info[portnum];
custom_port_info *custom;
@@ -3298,7 +3298,7 @@ UINT32 readinputport(int portnum)
/* replace the bits with bits from the custom routine */
input_port_entry *portentry = custom->portentry;
result &= ~portentry->mask;
- result |= ((*portentry->custom)(Machine, portentry->custom_param) << custom->shift) & portentry->mask;
+ result |= ((*portentry->custom)(machine, portentry->custom_param) << custom->shift) & portentry->mask;
}
/* handle VBLANK bits */
@@ -3308,18 +3308,18 @@ UINT32 readinputport(int portnum)
result = (result & ~portinfo->vblank) | (portinfo->defvalue & portinfo->vblank);
/* toggle VBLANK if we're in a VBLANK state */
- if (video_screen_get_vblank(Machine->primary_screen))
+ if (video_screen_get_vblank(machine->primary_screen))
result ^= portinfo->vblank;
}
return result;
}
-UINT32 readinputportbytag(const char *tag)
+UINT32 input_port_read(running_machine *machine, const char *tag)
{
int portnum = port_tag_to_index(tag);
if (portnum != -1)
- return readinputport(portnum);
+ return input_port_read_indexed(machine, portnum);
/* otherwise fail horribly */
fatalerror("Unable to locate input port '%s'", tag);
@@ -3327,11 +3327,11 @@ UINT32 readinputportbytag(const char *tag)
}
-UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue)
+UINT32 input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue)
{
int portnum = port_tag_to_index(tag);
if (portnum != -1)
- return readinputport(portnum);
+ return input_port_read_indexed(machine, portnum);
return defvalue;
}
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index f430c11fd1b..55ec2e642df 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -938,8 +938,8 @@ void input_port_update_defaults(void);
UINT32 get_crosshair_pos(int port_num, UINT8 player, UINT8 axis);
-UINT32 readinputport(int port);
-UINT32 readinputportbytag(const char *tag);
-UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue);
+UINT32 input_port_read_indexed(running_machine *machine, int port);
+UINT32 input_port_read(running_machine *machine, const char *tag);
+UINT32 input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue);
#endif /* __INPTPORT_H__ */
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 3b18c2397f3..c7a1e38b539 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -713,112 +713,112 @@ READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(machine); return 0xfffffff
8-bit read handlers
-------------------------------------------------*/
-READ8_HANDLER( input_port_0_r ) { return readinputport(0); }
-READ8_HANDLER( input_port_1_r ) { return readinputport(1); }
-READ8_HANDLER( input_port_2_r ) { return readinputport(2); }
-READ8_HANDLER( input_port_3_r ) { return readinputport(3); }
-READ8_HANDLER( input_port_4_r ) { return readinputport(4); }
-READ8_HANDLER( input_port_5_r ) { return readinputport(5); }
-READ8_HANDLER( input_port_6_r ) { return readinputport(6); }
-READ8_HANDLER( input_port_7_r ) { return readinputport(7); }
-READ8_HANDLER( input_port_8_r ) { return readinputport(8); }
-READ8_HANDLER( input_port_9_r ) { return readinputport(9); }
-READ8_HANDLER( input_port_10_r ) { return readinputport(10); }
-READ8_HANDLER( input_port_11_r ) { return readinputport(11); }
-READ8_HANDLER( input_port_12_r ) { return readinputport(12); }
-READ8_HANDLER( input_port_13_r ) { return readinputport(13); }
-READ8_HANDLER( input_port_14_r ) { return readinputport(14); }
-READ8_HANDLER( input_port_15_r ) { return readinputport(15); }
-READ8_HANDLER( input_port_16_r ) { return readinputport(16); }
-READ8_HANDLER( input_port_17_r ) { return readinputport(17); }
-READ8_HANDLER( input_port_18_r ) { return readinputport(18); }
-READ8_HANDLER( input_port_19_r ) { return readinputport(19); }
-READ8_HANDLER( input_port_20_r ) { return readinputport(20); }
-READ8_HANDLER( input_port_21_r ) { return readinputport(21); }
-READ8_HANDLER( input_port_22_r ) { return readinputport(22); }
-READ8_HANDLER( input_port_23_r ) { return readinputport(23); }
-READ8_HANDLER( input_port_24_r ) { return readinputport(24); }
-READ8_HANDLER( input_port_25_r ) { return readinputport(25); }
-READ8_HANDLER( input_port_26_r ) { return readinputport(26); }
-READ8_HANDLER( input_port_27_r ) { return readinputport(27); }
-READ8_HANDLER( input_port_28_r ) { return readinputport(28); }
-READ8_HANDLER( input_port_29_r ) { return readinputport(29); }
-READ8_HANDLER( input_port_30_r ) { return readinputport(30); }
-READ8_HANDLER( input_port_31_r ) { return readinputport(31); }
+READ8_HANDLER( input_port_0_r ) { return input_port_read_indexed(machine, 0); }
+READ8_HANDLER( input_port_1_r ) { return input_port_read_indexed(machine, 1); }
+READ8_HANDLER( input_port_2_r ) { return input_port_read_indexed(machine, 2); }
+READ8_HANDLER( input_port_3_r ) { return input_port_read_indexed(machine, 3); }
+READ8_HANDLER( input_port_4_r ) { return input_port_read_indexed(machine, 4); }
+READ8_HANDLER( input_port_5_r ) { return input_port_read_indexed(machine, 5); }
+READ8_HANDLER( input_port_6_r ) { return input_port_read_indexed(machine, 6); }
+READ8_HANDLER( input_port_7_r ) { return input_port_read_indexed(machine, 7); }
+READ8_HANDLER( input_port_8_r ) { return input_port_read_indexed(machine, 8); }
+READ8_HANDLER( input_port_9_r ) { return input_port_read_indexed(machine, 9); }
+READ8_HANDLER( input_port_10_r ) { return input_port_read_indexed(machine, 10); }
+READ8_HANDLER( input_port_11_r ) { return input_port_read_indexed(machine, 11); }
+READ8_HANDLER( input_port_12_r ) { return input_port_read_indexed(machine, 12); }
+READ8_HANDLER( input_port_13_r ) { return input_port_read_indexed(machine, 13); }
+READ8_HANDLER( input_port_14_r ) { return input_port_read_indexed(machine, 14); }
+READ8_HANDLER( input_port_15_r ) { return input_port_read_indexed(machine, 15); }
+READ8_HANDLER( input_port_16_r ) { return input_port_read_indexed(machine, 16); }
+READ8_HANDLER( input_port_17_r ) { return input_port_read_indexed(machine, 17); }
+READ8_HANDLER( input_port_18_r ) { return input_port_read_indexed(machine, 18); }
+READ8_HANDLER( input_port_19_r ) { return input_port_read_indexed(machine, 19); }
+READ8_HANDLER( input_port_20_r ) { return input_port_read_indexed(machine, 20); }
+READ8_HANDLER( input_port_21_r ) { return input_port_read_indexed(machine, 21); }
+READ8_HANDLER( input_port_22_r ) { return input_port_read_indexed(machine, 22); }
+READ8_HANDLER( input_port_23_r ) { return input_port_read_indexed(machine, 23); }
+READ8_HANDLER( input_port_24_r ) { return input_port_read_indexed(machine, 24); }
+READ8_HANDLER( input_port_25_r ) { return input_port_read_indexed(machine, 25); }
+READ8_HANDLER( input_port_26_r ) { return input_port_read_indexed(machine, 26); }
+READ8_HANDLER( input_port_27_r ) { return input_port_read_indexed(machine, 27); }
+READ8_HANDLER( input_port_28_r ) { return input_port_read_indexed(machine, 28); }
+READ8_HANDLER( input_port_29_r ) { return input_port_read_indexed(machine, 29); }
+READ8_HANDLER( input_port_30_r ) { return input_port_read_indexed(machine, 30); }
+READ8_HANDLER( input_port_31_r ) { return input_port_read_indexed(machine, 31); }
/*-------------------------------------------------
16-bit read handlers
-------------------------------------------------*/
-READ16_HANDLER( input_port_0_word_r ) { return readinputport(0); }
-READ16_HANDLER( input_port_1_word_r ) { return readinputport(1); }
-READ16_HANDLER( input_port_2_word_r ) { return readinputport(2); }
-READ16_HANDLER( input_port_3_word_r ) { return readinputport(3); }
-READ16_HANDLER( input_port_4_word_r ) { return readinputport(4); }
-READ16_HANDLER( input_port_5_word_r ) { return readinputport(5); }
-READ16_HANDLER( input_port_6_word_r ) { return readinputport(6); }
-READ16_HANDLER( input_port_7_word_r ) { return readinputport(7); }
-READ16_HANDLER( input_port_8_word_r ) { return readinputport(8); }
-READ16_HANDLER( input_port_9_word_r ) { return readinputport(9); }
-READ16_HANDLER( input_port_10_word_r ) { return readinputport(10); }
-READ16_HANDLER( input_port_11_word_r ) { return readinputport(11); }
-READ16_HANDLER( input_port_12_word_r ) { return readinputport(12); }
-READ16_HANDLER( input_port_13_word_r ) { return readinputport(13); }
-READ16_HANDLER( input_port_14_word_r ) { return readinputport(14); }
-READ16_HANDLER( input_port_15_word_r ) { return readinputport(15); }
-READ16_HANDLER( input_port_16_word_r ) { return readinputport(16); }
-READ16_HANDLER( input_port_17_word_r ) { return readinputport(17); }
-READ16_HANDLER( input_port_18_word_r ) { return readinputport(18); }
-READ16_HANDLER( input_port_19_word_r ) { return readinputport(19); }
-READ16_HANDLER( input_port_20_word_r ) { return readinputport(20); }
-READ16_HANDLER( input_port_21_word_r ) { return readinputport(21); }
-READ16_HANDLER( input_port_22_word_r ) { return readinputport(22); }
-READ16_HANDLER( input_port_23_word_r ) { return readinputport(23); }
-READ16_HANDLER( input_port_24_word_r ) { return readinputport(24); }
-READ16_HANDLER( input_port_25_word_r ) { return readinputport(25); }
-READ16_HANDLER( input_port_26_word_r ) { return readinputport(26); }
-READ16_HANDLER( input_port_27_word_r ) { return readinputport(27); }
-READ16_HANDLER( input_port_28_word_r ) { return readinputport(28); }
-READ16_HANDLER( input_port_29_word_r ) { return readinputport(29); }
-READ16_HANDLER( input_port_30_word_r ) { return readinputport(30); }
-READ16_HANDLER( input_port_31_word_r ) { return readinputport(31); }
+READ16_HANDLER( input_port_0_word_r ) { return input_port_read_indexed(machine, 0); }
+READ16_HANDLER( input_port_1_word_r ) { return input_port_read_indexed(machine, 1); }
+READ16_HANDLER( input_port_2_word_r ) { return input_port_read_indexed(machine, 2); }
+READ16_HANDLER( input_port_3_word_r ) { return input_port_read_indexed(machine, 3); }
+READ16_HANDLER( input_port_4_word_r ) { return input_port_read_indexed(machine, 4); }
+READ16_HANDLER( input_port_5_word_r ) { return input_port_read_indexed(machine, 5); }
+READ16_HANDLER( input_port_6_word_r ) { return input_port_read_indexed(machine, 6); }
+READ16_HANDLER( input_port_7_word_r ) { return input_port_read_indexed(machine, 7); }
+READ16_HANDLER( input_port_8_word_r ) { return input_port_read_indexed(machine, 8); }
+READ16_HANDLER( input_port_9_word_r ) { return input_port_read_indexed(machine, 9); }
+READ16_HANDLER( input_port_10_word_r ) { return input_port_read_indexed(machine, 10); }
+READ16_HANDLER( input_port_11_word_r ) { return input_port_read_indexed(machine, 11); }
+READ16_HANDLER( input_port_12_word_r ) { return input_port_read_indexed(machine, 12); }
+READ16_HANDLER( input_port_13_word_r ) { return input_port_read_indexed(machine, 13); }
+READ16_HANDLER( input_port_14_word_r ) { return input_port_read_indexed(machine, 14); }
+READ16_HANDLER( input_port_15_word_r ) { return input_port_read_indexed(machine, 15); }
+READ16_HANDLER( input_port_16_word_r ) { return input_port_read_indexed(machine, 16); }
+READ16_HANDLER( input_port_17_word_r ) { return input_port_read_indexed(machine, 17); }
+READ16_HANDLER( input_port_18_word_r ) { return input_port_read_indexed(machine, 18); }
+READ16_HANDLER( input_port_19_word_r ) { return input_port_read_indexed(machine, 19); }
+READ16_HANDLER( input_port_20_word_r ) { return input_port_read_indexed(machine, 20); }
+READ16_HANDLER( input_port_21_word_r ) { return input_port_read_indexed(machine, 21); }
+READ16_HANDLER( input_port_22_word_r ) { return input_port_read_indexed(machine, 22); }
+READ16_HANDLER( input_port_23_word_r ) { return input_port_read_indexed(machine, 23); }
+READ16_HANDLER( input_port_24_word_r ) { return input_port_read_indexed(machine, 24); }
+READ16_HANDLER( input_port_25_word_r ) { return input_port_read_indexed(machine, 25); }
+READ16_HANDLER( input_port_26_word_r ) { return input_port_read_indexed(machine, 26); }
+READ16_HANDLER( input_port_27_word_r ) { return input_port_read_indexed(machine, 27); }
+READ16_HANDLER( input_port_28_word_r ) { return input_port_read_indexed(machine, 28); }
+READ16_HANDLER( input_port_29_word_r ) { return input_port_read_indexed(machine, 29); }
+READ16_HANDLER( input_port_30_word_r ) { return input_port_read_indexed(machine, 30); }
+READ16_HANDLER( input_port_31_word_r ) { return input_port_read_indexed(machine, 31); }
/*-------------------------------------------------
32-bit read handlers
-------------------------------------------------*/
-READ32_HANDLER( input_port_0_dword_r ) { return readinputport(0); }
-READ32_HANDLER( input_port_1_dword_r ) { return readinputport(1); }
-READ32_HANDLER( input_port_2_dword_r ) { return readinputport(2); }
-READ32_HANDLER( input_port_3_dword_r ) { return readinputport(3); }
-READ32_HANDLER( input_port_4_dword_r ) { return readinputport(4); }
-READ32_HANDLER( input_port_5_dword_r ) { return readinputport(5); }
-READ32_HANDLER( input_port_6_dword_r ) { return readinputport(6); }
-READ32_HANDLER( input_port_7_dword_r ) { return readinputport(7); }
-READ32_HANDLER( input_port_8_dword_r ) { return readinputport(8); }
-READ32_HANDLER( input_port_9_dword_r ) { return readinputport(9); }
-READ32_HANDLER( input_port_10_dword_r ) { return readinputport(10); }
-READ32_HANDLER( input_port_11_dword_r ) { return readinputport(11); }
-READ32_HANDLER( input_port_12_dword_r ) { return readinputport(12); }
-READ32_HANDLER( input_port_13_dword_r ) { return readinputport(13); }
-READ32_HANDLER( input_port_14_dword_r ) { return readinputport(14); }
-READ32_HANDLER( input_port_15_dword_r ) { return readinputport(15); }
-READ32_HANDLER( input_port_16_dword_r ) { return readinputport(16); }
-READ32_HANDLER( input_port_17_dword_r ) { return readinputport(17); }
-READ32_HANDLER( input_port_18_dword_r ) { return readinputport(18); }
-READ32_HANDLER( input_port_19_dword_r ) { return readinputport(19); }
-READ32_HANDLER( input_port_20_dword_r ) { return readinputport(20); }
-READ32_HANDLER( input_port_21_dword_r ) { return readinputport(21); }
-READ32_HANDLER( input_port_22_dword_r ) { return readinputport(22); }
-READ32_HANDLER( input_port_23_dword_r ) { return readinputport(23); }
-READ32_HANDLER( input_port_24_dword_r ) { return readinputport(24); }
-READ32_HANDLER( input_port_25_dword_r ) { return readinputport(25); }
-READ32_HANDLER( input_port_26_dword_r ) { return readinputport(26); }
-READ32_HANDLER( input_port_27_dword_r ) { return readinputport(27); }
-READ32_HANDLER( input_port_28_dword_r ) { return readinputport(28); }
-READ32_HANDLER( input_port_29_dword_r ) { return readinputport(29); }
-READ32_HANDLER( input_port_30_dword_r ) { return readinputport(30); }
-READ32_HANDLER( input_port_31_dword_r ) { return readinputport(31); }
+READ32_HANDLER( input_port_0_dword_r ) { return input_port_read_indexed(machine, 0); }
+READ32_HANDLER( input_port_1_dword_r ) { return input_port_read_indexed(machine, 1); }
+READ32_HANDLER( input_port_2_dword_r ) { return input_port_read_indexed(machine, 2); }
+READ32_HANDLER( input_port_3_dword_r ) { return input_port_read_indexed(machine, 3); }
+READ32_HANDLER( input_port_4_dword_r ) { return input_port_read_indexed(machine, 4); }
+READ32_HANDLER( input_port_5_dword_r ) { return input_port_read_indexed(machine, 5); }
+READ32_HANDLER( input_port_6_dword_r ) { return input_port_read_indexed(machine, 6); }
+READ32_HANDLER( input_port_7_dword_r ) { return input_port_read_indexed(machine, 7); }
+READ32_HANDLER( input_port_8_dword_r ) { return input_port_read_indexed(machine, 8); }
+READ32_HANDLER( input_port_9_dword_r ) { return input_port_read_indexed(machine, 9); }
+READ32_HANDLER( input_port_10_dword_r ) { return input_port_read_indexed(machine, 10); }
+READ32_HANDLER( input_port_11_dword_r ) { return input_port_read_indexed(machine, 11); }
+READ32_HANDLER( input_port_12_dword_r ) { return input_port_read_indexed(machine, 12); }
+READ32_HANDLER( input_port_13_dword_r ) { return input_port_read_indexed(machine, 13); }
+READ32_HANDLER( input_port_14_dword_r ) { return input_port_read_indexed(machine, 14); }
+READ32_HANDLER( input_port_15_dword_r ) { return input_port_read_indexed(machine, 15); }
+READ32_HANDLER( input_port_16_dword_r ) { return input_port_read_indexed(machine, 16); }
+READ32_HANDLER( input_port_17_dword_r ) { return input_port_read_indexed(machine, 17); }
+READ32_HANDLER( input_port_18_dword_r ) { return input_port_read_indexed(machine, 18); }
+READ32_HANDLER( input_port_19_dword_r ) { return input_port_read_indexed(machine, 19); }
+READ32_HANDLER( input_port_20_dword_r ) { return input_port_read_indexed(machine, 20); }
+READ32_HANDLER( input_port_21_dword_r ) { return input_port_read_indexed(machine, 21); }
+READ32_HANDLER( input_port_22_dword_r ) { return input_port_read_indexed(machine, 22); }
+READ32_HANDLER( input_port_23_dword_r ) { return input_port_read_indexed(machine, 23); }
+READ32_HANDLER( input_port_24_dword_r ) { return input_port_read_indexed(machine, 24); }
+READ32_HANDLER( input_port_25_dword_r ) { return input_port_read_indexed(machine, 25); }
+READ32_HANDLER( input_port_26_dword_r ) { return input_port_read_indexed(machine, 26); }
+READ32_HANDLER( input_port_27_dword_r ) { return input_port_read_indexed(machine, 27); }
+READ32_HANDLER( input_port_28_dword_r ) { return input_port_read_indexed(machine, 28); }
+READ32_HANDLER( input_port_29_dword_r ) { return input_port_read_indexed(machine, 29); }
+READ32_HANDLER( input_port_30_dword_r ) { return input_port_read_indexed(machine, 30); }
+READ32_HANDLER( input_port_31_dword_r ) { return input_port_read_indexed(machine, 31); }
diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c
index 58f3573aac9..5b4c8d2035b 100644
--- a/src/emu/sound/disc_inp.c
+++ b/src/emu/sound/disc_inp.c
@@ -122,7 +122,7 @@ static void dss_adjustment_step(node_description *node)
if (DSS_ADJUSTMENT__ENABLE)
{
struct dss_adjustment_context *context = node->context;
- INT32 rawportval = readinputport(context->port);
+ INT32 rawportval = input_port_read_indexed(Machine, context->port);
/* only recompute if the value changed from last time */
if (rawportval != context->lastpval)
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index bdcad86fff7..058c365eb3e 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -60,7 +60,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
if (rising_bits & 0x08) sample_start_n(0, 4, 6, 0); /* FLEET */
if (rising_bits & 0x10) sample_start_n(0, 3, 7, 0); /* SAUCER HIT */
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data;
}
@@ -145,7 +145,7 @@ WRITE8_HANDLER( lrescue_sh_port_2_w )
if (rising_bits & 0x10) sample_start(3, 6, 0); /* Shooting Star and Rescue Ship sounds */
if (~data & 0x10 && port_2_last & 0x10) sample_stop (3); /* This makes the rescue ship sound beep on and off */
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data;
}
@@ -196,7 +196,7 @@ WRITE8_HANDLER( ballbomb_sh_port_2_w )
if (data & 0x04) sample_start(0, 4, 0); /* Plane is dropping new balloons at start of level */
if (rising_bits & 0x10) sample_start(2, 2, 0); /* Balloon hit and bomb drops */
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data;
}
@@ -623,7 +623,7 @@ WRITE8_HANDLER( polaris_sh_port_3_w )
coin_lockout_global_w(data & 0x04); /* SX8 */
- c8080bw_flip_screen_w(data & 0x20); /* SX11 */
+ c8080bw_flip_screen_w(machine, data & 0x20); /* SX11 */
/* 0x01 - SX6 - Plane Down */
discrete_sound_w(machine, POLARIS_SX6_EN, data & 0x01);
@@ -854,7 +854,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
schaser_background_control_w(data & 0x18);
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
}
@@ -998,7 +998,7 @@ WRITE8_HANDLER( lupin3_sh_port_2_w )
if (rising_bits & 0x08) sample_start(3, 0, 0); /* start intermission, end game */
//if (rising_bits & 0x10) sample_start(3, 9, 0); /* Dog barking */
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data;
}
@@ -1030,7 +1030,7 @@ WRITE8_HANDLER( schasrcv_sh_port_2_w )
sound_global_enable(data & 0x10);
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
}
@@ -1065,7 +1065,7 @@ WRITE8_HANDLER( yosakdon_sh_port_2_w )
if (rising_bits & 0x10) sample_start(2, 7, 0); /* Game Over */
- c8080bw_flip_screen_w(data & 0x20);
+ c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data;
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index c77904cf67b..34a45616caf 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -221,8 +221,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = readinputportbytag("JSAI");
- if (!(readinputport(test_port) & test_mask)) result ^= 0x80;
+ result = input_port_read(machine, "JSAI");
+ if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x80;
if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20;
if (!has_tms5220 || tms5220_ready_r()) result ^= 0x10;
@@ -348,8 +348,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = readinputportbytag("JSAII");
- if (!(readinputport(test_port) & test_mask)) result ^= 0x80;
+ result = input_port_read(machine, "JSAII");
+ if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x80;
if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -467,8 +467,8 @@ static READ8_HANDLER( jsa3_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = readinputportbytag("JSAIII");
- if (!(readinputport(test_port) & test_mask)) result ^= 0x90;
+ result = input_port_read(machine, "JSAIII");
+ if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x90;
if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -604,8 +604,8 @@ static READ8_HANDLER( jsa3s_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = readinputportbytag("JSAIII");
- if (!(readinputport(test_port) & test_mask)) result ^= 0x90;
+ result = input_port_read(machine, "JSAIII");
+ if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x90;
if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20;
break;
diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c
index 04fcafe72ef..fa8950f650d 100644
--- a/src/mame/audio/cyberbal.c
+++ b/src/mame/audio/cyberbal.c
@@ -41,8 +41,8 @@ void cyberbal_sound_reset(void)
READ8_HANDLER( cyberbal_special_port3_r )
{
- int temp = readinputport(3);
- if (!(readinputport(0) & 0x8000)) temp ^= 0x80;
+ int temp = input_port_read_indexed(machine, 3);
+ if (!(input_port_read_indexed(machine, 0) & 0x8000)) temp ^= 0x80;
if (atarigen_cpu_to_sound_ready) temp ^= 0x40;
if (atarigen_sound_to_cpu_ready) temp ^= 0x20;
return temp;
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index ea2096e46b9..501b64450a8 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -179,7 +179,7 @@ READ16_HANDLER( hdsnd68k_status_r )
// D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready)
logerror("%06X:hdsnd68k_status_r(%04X)\n", activecpu_get_previouspc(), offset);
- return (mainflag << 15) | (soundflag << 14) | 0x2000 | 0;//((readinputport(0) & 0x0020) << 8) | 0;
+ return (mainflag << 15) | (soundflag << 14) | 0x2000 | 0;//((input_port_read_indexed(machine, 0) & 0x0020) << 8) | 0;
}
diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c
index 248bee3048c..79fe9766c2f 100644
--- a/src/mame/audio/mcr.c
+++ b/src/mame/audio/mcr.c
@@ -414,7 +414,7 @@ void ssio_reset_w(int state)
READ8_HANDLER( ssio_input_port_r )
{
static const char *const port[] = { "SSIO.IP0", "SSIO.IP1", "SSIO.IP2", "SSIO.IP3", "SSIO.IP4" };
- UINT8 result = readinputportbytag_safe(port[offset], 0xff);
+ UINT8 result = input_port_read_safe(machine, port[offset], 0xff);
if (ssio_custom_input[offset])
result = (result & ~ssio_custom_input_mask[offset]) |
((*ssio_custom_input[offset])(machine, offset) & ssio_custom_input_mask[offset]);
diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c
index a8567fad329..d810abc929d 100644
--- a/src/mame/audio/mw8080bw.c
+++ b/src/mame/audio/mw8080bw.c
@@ -321,7 +321,7 @@ WRITE8_HANDLER( tornbase_audio_w )
/* if (data & 0x10) enable CHEER sound */
- if (tornbase_get_cabinet_type() == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
+ if (tornbase_get_cabinet_type(machine) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
{
/* if (data & 0x20) enable WHISTLE sound */
@@ -570,7 +570,7 @@ MACHINE_DRIVER_END
void maze_write_discrete(running_machine *machine, UINT8 maze_tone_timing_state)
{
/* controls need to be active low */
- int controls = ~readinputport(0) & 0xff;
+ int controls = ~input_port_read_indexed(machine, 0) & 0xff;
discrete_sound_w(machine, MAZE_TONE_TIMING, maze_tone_timing_state);
discrete_sound_w(machine, MAZE_P1_DATA, controls & 0x0f);
@@ -582,7 +582,7 @@ void maze_write_discrete(running_machine *machine, UINT8 maze_tone_timing_state)
/* A better option might be to update it at vblank or set a timer to do it. */
/* The only noticeable difference doing it here, is that the controls don't */
/* imediately start making tones if pressed right after the coin is inserted. */
- discrete_sound_w(machine, MAZE_COIN, (~readinputport(1) >> 3) & 0x01);
+ discrete_sound_w(machine, MAZE_COIN, (~input_port_read_indexed(machine, 1) >> 3) & 0x01);
}
@@ -3659,7 +3659,7 @@ WRITE8_HANDLER( invaders_audio_2_w )
discrete_sound_w(machine, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* the flip screen line is only connected on the cocktail PCB */
- if (invaders_is_cabinet_cocktail())
+ if (invaders_is_cabinet_cocktail(machine))
{
invaders_set_flip_screen((data >> 5) & 0x01);
}
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index 238575d686c..8ba9eb9b07c 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -78,9 +78,9 @@ static READ8_HANDLER( cheat1_r )
static int cheat = 0;
static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa };
- res = readinputportbytag("IN1");
+ res = input_port_read(machine, "IN1");
- if ((readinputportbytag("IN0") & 0x08) == 0)
+ if ((input_port_read(machine, "IN0") & 0x08) == 0)
{
res |= 0x55;
res &= bits[cheat];
@@ -96,9 +96,9 @@ static READ8_HANDLER( cheat2_r )
static int cheat = 0;
static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa };
- res = readinputportbytag("IN2");
+ res = input_port_read(machine, "IN2");
- if ((readinputportbytag("IN0") & 0x08) == 0)
+ if ((input_port_read(machine, "IN0") & 0x08) == 0)
{
res |= 0x55;
res &= bits[cheat];
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 8fce3b83285..ff0a0d0340f 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -146,9 +146,9 @@ static CUSTOM_INPUT( sidewndr_payout_r )
switch (bit_mask)
{
case 0x01:
- return ((readinputportbytag("PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((readinputportbytag("PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 1);
default:
logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -162,13 +162,13 @@ static CUSTOM_INPUT( starspnr_coinage_r )
switch (bit_mask)
{
case 0x01:
- return ((readinputportbytag("COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(machine, "COINAGE") & bit_mask) >> 0);
case 0x02:
- return ((readinputportbytag("COINAGE") & bit_mask) >> 1);
+ return ((input_port_read(machine, "COINAGE") & bit_mask) >> 1);
case 0x04:
- return ((readinputportbytag("COINAGE") & bit_mask) >> 2);
+ return ((input_port_read(machine, "COINAGE") & bit_mask) >> 2);
case 0x08:
- return ((readinputportbytag("COINAGE") & bit_mask) >> 3);
+ return ((input_port_read(machine, "COINAGE") & bit_mask) >> 3);
default:
logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -182,11 +182,11 @@ static CUSTOM_INPUT( starspnr_payout_r )
switch (bit_mask)
{
case 0x01:
- return ((readinputportbytag("PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((readinputportbytag("PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 1);
case 0x04:
- return ((readinputportbytag("PAYOUT") & bit_mask) >> 2);
+ return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 2);
default:
logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index 703d4525fa1..acde6aa3e18 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -48,16 +48,16 @@ static UINT8 *actfancr_ram;
static READ8_HANDLER( actfan_control_0_r )
{
- return readinputport(2); /* VBL */
+ return input_port_read_indexed(machine, 2); /* VBL */
}
static READ8_HANDLER( actfan_control_1_r )
{
switch (offset) {
- case 0: return readinputport(0); /* Player 1 */
- case 1: return readinputport(1); /* Player 2 */
- case 2: return readinputport(3); /* Dip 1 */
- case 3: return readinputport(4); /* Dip 2 */
+ case 0: return input_port_read_indexed(machine, 0); /* Player 1 */
+ case 1: return input_port_read_indexed(machine, 1); /* Player 2 */
+ case 2: return input_port_read_indexed(machine, 3); /* Dip 1 */
+ case 3: return input_port_read_indexed(machine, 4); /* Dip 2 */
}
return 0xff;
}
@@ -72,11 +72,11 @@ static WRITE8_HANDLER( triothep_control_select_w )
static READ8_HANDLER( triothep_control_r )
{
switch (trio_control_select) {
- case 0: return readinputportbytag("IN0"); /* Player 1 */
- case 1: return readinputportbytag("IN1"); /* Player 2 */
- case 2: return readinputportbytag("DSW1"); /* Dip 1 */
- case 3: return readinputportbytag("DSW2"); /* Dip 2 */
- case 4: return readinputportbytag("IN2"); /* VBL */
+ case 0: return input_port_read(machine, "IN0"); /* Player 1 */
+ case 1: return input_port_read(machine, "IN1"); /* Player 2 */
+ case 2: return input_port_read(machine, "DSW1"); /* Dip 1 */
+ case 3: return input_port_read(machine, "DSW2"); /* Dip 2 */
+ case 4: return input_port_read(machine, "IN2"); /* VBL */
}
return 0xff;
diff --git a/src/mame/drivers/aladbl.c b/src/mame/drivers/aladbl.c
index d1cf0681924..c3f2a426439 100644
--- a/src/mame/drivers/aladbl.c
+++ b/src/mame/drivers/aladbl.c
@@ -143,9 +143,9 @@ static WRITE16_HANDLER( aladbl_w )
static READ16_HANDLER( aladbl_r )
{
- if (activecpu_get_pc()==0x1b2a56) return (readinputportbytag("MCU") & 0xff0f); // coins
+ if (activecpu_get_pc()==0x1b2a56) return (input_port_read(machine, "MCU") & 0xff0f); // coins
if (activecpu_get_pc()==0x1b2a72) return 0x0000;
- if (activecpu_get_pc()==0x1b2d24) return (readinputportbytag("MCU") & 0x00f0) | 0x1200; // difficulty
+ if (activecpu_get_pc()==0x1b2d24) return (input_port_read(machine, "MCU") & 0x00f0) | 0x1200; // difficulty
if (activecpu_get_pc()==0x1b2d4e) return 0x0000;
logerror("aladbl_r : %06x\n",activecpu_get_pc());
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 1e2cf530604..b0df9708ef8 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -175,11 +175,11 @@ static READ32_HANDLER( aleck_dips_r )
{
if (offset == 0)
{
- return (readinputport(3));
+ return (input_port_read_indexed(machine, 3));
}
else if (offset == 1)
{
- return (readinputport(4));
+ return (input_port_read_indexed(machine, 4));
}
return 0;
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 3284f16dc9a..5fe9ec1886c 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -22,6 +22,7 @@
#include "driver.h"
#include "render.h"
+#include "deprecat.h"
#include "includes/amiga.h"
#include "machine/laserdsc.h"
@@ -50,8 +51,8 @@ static int get_lightgun_pos(const device_config *screen, int player, int *x, int
{
const rectangle *visarea = video_screen_get_visible_area(screen);
- int xpos = readinputportbytag_safe((player == 0) ? "GUN1X" : "GUN2X", -1);
- int ypos = readinputportbytag_safe((player == 0) ? "GUN1Y" : "GUN2Y", -1);
+ int xpos = input_port_read_safe(screen->machine, (player == 0) ? "GUN1X" : "GUN2X", -1);
+ int ypos = input_port_read_safe(screen->machine, (player == 0) ? "GUN1Y" : "GUN2Y", -1);
if (xpos == -1 || ypos == -1)
return FALSE;
@@ -251,14 +252,14 @@ static CUSTOM_INPUT( lightgun_pos_r )
static CUSTOM_INPUT( lightgun_trigger_r )
{
/* read the trigger control based on the input select */
- return (readinputportbytag("TRIGGERS") >> input_select) & 1;
+ return (input_port_read(machine, "TRIGGERS") >> input_select) & 1;
}
static CUSTOM_INPUT( lightgun_holster_r )
{
/* read the holster control based on the input select */
- return (readinputportbytag("TRIGGERS") >> (2 + input_select)) & 1;
+ return (input_port_read(machine, "TRIGGERS") >> (2 + input_select)) & 1;
}
@@ -287,7 +288,7 @@ static void alg_cia_0_porta_w(UINT8 data)
static UINT8 alg_cia_0_porta_r(void)
{
- return readinputportbytag("FIRE") | 0x3f;
+ return input_port_read(Machine, "FIRE") | 0x3f;
}
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index e18fc9c9f97..b3444e60f19 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -265,57 +265,57 @@ static WRITE16_HANDLER( alpha_microcontroller_w )
static READ16_HANDLER( kyros_dip_r )
{
- return readinputportbytag("IN1")<<8;
+ return input_port_read(machine, "IN1")<<8;
}
static READ16_HANDLER( control_1_r )
{
if (invert_controls)
- return ~(readinputportbytag("IN0") + (readinputportbytag("IN1") << 8));
+ return ~(input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
}
static READ16_HANDLER( control_2_r )
{
if (invert_controls)
- return ~(readinputportbytag("IN3") + ((~(1 << (readinputportbytag("IN5") * 12 / 256))) << 8));
+ return ~(input_port_read(machine, "IN3") + ((~(1 << (input_port_read(machine, "IN5") * 12 / 256))) << 8));
- return readinputportbytag("IN3") + /* Low byte of CN1 */
- ((~(1 << (readinputportbytag("IN5") * 12 / 256))) << 8);
+ return input_port_read(machine, "IN3") + /* Low byte of CN1 */
+ ((~(1 << (input_port_read(machine, "IN5") * 12 / 256))) << 8);
}
static READ16_HANDLER( control_2_V_r )
{
- return readinputportbytag("IN3");
+ return input_port_read(machine, "IN3");
}
static READ16_HANDLER( control_3_r )
{
if (invert_controls)
- return ~((( ~(1 << (readinputportbytag("IN6") * 12 / 256)) )<<8)&0xff00);
+ return ~((( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) )<<8)&0xff00);
- return (( ~(1 << (readinputportbytag("IN6") * 12 / 256)) )<<8)&0xff00;
+ return (( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) )<<8)&0xff00;
}
/* High 4 bits of CN1 & CN2 */
static READ16_HANDLER( control_4_r )
{
if (invert_controls)
- return ~(((( ~(1 << (readinputportbytag("IN6") * 12 / 256)) ) <<4)&0xf000)
- + ((( ~(1 << (readinputportbytag("IN5") * 12 / 256)) ) )&0x0f00));
+ return ~(((( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) ) <<4)&0xf000)
+ + ((( ~(1 << (input_port_read(machine, "IN5") * 12 / 256)) ) )&0x0f00));
- return ((( ~(1 << (readinputportbytag("IN6") * 12 / 256)) ) <<4)&0xf000)
- + ((( ~(1 << (readinputportbytag("IN5") * 12 / 256)) ) )&0x0f00);
+ return ((( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) ) <<4)&0xf000)
+ + ((( ~(1 << (input_port_read(machine, "IN5") * 12 / 256)) ) )&0x0f00);
}
static READ16_HANDLER( jongbou_inputs_r )
{
- UINT8 inp1 = readinputportbytag("IN3");
- UINT8 inp2 = readinputportbytag("IN4");
+ UINT8 inp1 = input_port_read(machine, "IN3");
+ UINT8 inp2 = input_port_read(machine, "IN4");
inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3);
inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3);
- return readinputportbytag("IN0") | inp1 | inp2 << 4;
+ return input_port_read(machine, "IN0") | inp1 | inp2 << 4;
}
/******************************************************************************/
@@ -381,14 +381,14 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
return 0;
case 0x29: /* Query microcontroller for coin insert */
trigstate++;
- if ((readinputportbytag("IN2")&0x3)==3) latch=0;
- if ((readinputportbytag("IN2")&0x1)==0 && !latch)
+ if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
+ if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x22] = (source&0xff00)|0x0;
latch=1;
- coinvalue = (~readinputportbytag("IN1")>>1) & 7;
+ coinvalue = (~input_port_read(machine, "IN1")>>1) & 7;
deposits1++;
if (deposits1 == coinage1[coinvalue][0])
{
@@ -398,13 +398,13 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
else
credits = 0;
}
- else if ((readinputportbytag("IN2")&0x2)==0 && !latch)
+ else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x22] = (source&0xff00)|0x0;
latch=1;
- coinvalue = (~readinputportbytag("IN1")>>1) & 7;
+ coinvalue = (~input_port_read(machine, "IN1")>>1) & 7;
deposits2++;
if (deposits2 == coinage2[coinvalue][0])
{
@@ -460,7 +460,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
switch (offset)
{
case 0: /* Dipswitch 2 */
- shared_ram[0] = (source&0xff00)|readinputportbytag("IN4");
+ shared_ram[0] = (source&0xff00)|input_port_read(machine, "IN4");
return 0;
case 0x22: /* Coin value */
@@ -468,8 +468,8 @@ static READ16_HANDLER( alpha_II_trigger_r )
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((readinputportbytag("IN2")&0x3)==3) latch=0;
- if ((readinputportbytag("IN2")&0x1)==0 && !latch)
+ if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
+ if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x22] = (source&0xff00)|0x0;
@@ -478,9 +478,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((coin_id&0xff) == 0x22)
{
if(!strcmp(machine->gamedrv->name, "btlfildb"))
- coinvalue = (readinputportbytag("IN4")>>0) & 7;
+ coinvalue = (input_port_read(machine, "IN4")>>0) & 7;
else
- coinvalue = (~readinputportbytag("IN4")>>0) & 7;
+ coinvalue = (~input_port_read(machine, "IN4")>>0) & 7;
deposits1++;
if (deposits1 == coinage1[coinvalue][0])
@@ -492,7 +492,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
credits = 0;
}
}
- else if ((readinputportbytag("IN2")&0x2)==0 && !latch)
+ else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x22] = (source&0xff00)|0x0;
@@ -501,9 +501,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((coin_id>>8) == 0x22)
{
if(!strcmp(machine->gamedrv->name, "btlfildb"))
- coinvalue = (readinputportbytag("IN4")>>0) & 7;
+ coinvalue = (input_port_read(machine, "IN4")>>0) & 7;
else
- coinvalue = (~readinputportbytag("IN4")>>0) & 7;
+ coinvalue = (~input_port_read(machine, "IN4")>>0) & 7;
deposits2++;
if (deposits2 == coinage2[coinvalue][0])
@@ -556,14 +556,14 @@ static READ16_HANDLER( alpha_V_trigger_r )
switch (offset)
{
case 0: /* Dipswitch 1 */
- shared_ram[0] = (source&0xff00)|readinputportbytag("IN4");
+ shared_ram[0] = (source&0xff00)|input_port_read(machine, "IN4");
return 0;
case 0x22: /* Coin value */
shared_ram[0x22] = (source&0xff00)|(credits&0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((readinputportbytag("IN2")&0x3)==3) latch=0;
- if ((readinputportbytag("IN2")&0x1)==0 && !latch)
+ if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
+ if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x22] = (source&0xff00)|0x0;
@@ -571,7 +571,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id&0xff) == 0x22)
{
- coinvalue = (~readinputportbytag("IN4")>>1) & 7;
+ coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits1++;
if (deposits1 == coinage1[coinvalue][0])
{
@@ -582,7 +582,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
credits = 0;
}
}
- else if ((readinputportbytag("IN2")&0x2)==0 && !latch)
+ else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x22] = (source&0xff00)|0x0;
@@ -590,7 +590,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id>>8) == 0x22)
{
- coinvalue = (~readinputportbytag("IN4")>>1) & 7;
+ coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits2++;
if (deposits2 == coinage2[coinvalue][0])
{
@@ -616,11 +616,11 @@ static READ16_HANDLER( alpha_V_trigger_r )
break;
case 0x1f00: /* Dipswitch 1 */
- shared_ram[0x1f00] = (source&0xff00)|readinputportbytag("IN4");
+ shared_ram[0x1f00] = (source&0xff00)|input_port_read(machine, "IN4");
return 0;
case 0x1f29: /* Query microcontroller for coin insert */
- if ((readinputportbytag("IN2")&0x3)==3) latch=0;
- if ((readinputportbytag("IN2")&0x1)==0 && !latch)
+ if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
+ if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{
shared_ram[0x1f29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x1f22] = (source&0xff00)|0x0;
@@ -628,7 +628,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id&0xff) == 0x22)
{
- coinvalue = (~readinputportbytag("IN4")>>1) & 7;
+ coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits1++;
if (deposits1 == coinage1[coinvalue][0])
{
@@ -639,7 +639,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
credits = 0;
}
}
- else if ((readinputportbytag("IN2")&0x2)==0 && !latch)
+ else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{
shared_ram[0x1f29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x1f22] = (source&0xff00)|0x0;
@@ -647,7 +647,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id>>8) == 0x22)
{
- coinvalue = (~readinputportbytag("IN4")>>1) & 7;
+ coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits2++;
if (deposits2 == coinage2[coinvalue][0])
{
@@ -668,7 +668,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
the microcontroller supplies it (it does for all the other games,
but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */
source=shared_ram[0x0163];
- shared_ram[0x0163] = (source&0x00ff)|(readinputportbytag("IN4")<<8);
+ shared_ram[0x0163] = (source&0x00ff)|(input_port_read(machine, "IN4")<<8);
return 0;
case 0x1ffe: /* Custom ID check */
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 8069ff6d00e..9b025378a4a 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -47,7 +47,7 @@ VIDEO_UPDATE( amspdwy );
static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
{ \
static UINT8 wheel_old, ret; \
- UINT8 wheel = readinputport(5 + _n_); \
+ UINT8 wheel = input_port_read_indexed(machine, 5 + _n_); \
if (wheel != wheel_old) \
{ \
wheel = (wheel & 0x7fff) - (wheel & 0x8000); \
@@ -55,7 +55,7 @@ static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
else ret = ((-wheel) & 0xf) | 0x10; \
wheel_old = wheel; \
} \
- return ret | readinputport(2 + _n_); \
+ return ret | input_port_read_indexed(machine, 2 + _n_); \
}
AMSPDWY_WHEEL_R( 0 )
AMSPDWY_WHEEL_R( 1 )
@@ -63,7 +63,7 @@ AMSPDWY_WHEEL_R( 1 )
static READ8_HANDLER( amspdwy_sound_r )
{
- return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | readinputport(4);
+ return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | input_port_read_indexed(machine, 4);
}
static WRITE8_HANDLER( amspdwy_sound_w )
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 23bd9c4d77c..e3e41cc9a87 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -181,16 +181,16 @@ these make the game a bit easier for testing purposes
static READ8_HANDLER( angelkds_input_r )
{
- int fake = readinputport(6+offset);
+ int fake = input_port_read_indexed(machine, 6+offset);
- return ((fake & 0x01) ? fake : readinputport(4+offset));
+ return ((fake & 0x01) ? fake : input_port_read_indexed(machine, 4+offset));
}
#else
static READ8_HANDLER( angelkds_input_r )
{
- return readinputport(4+offset);
+ return input_port_read_indexed(machine, 4+offset);
}
#endif
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index 6632a726841..efe10297c96 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -75,7 +75,7 @@ VIDEO_UPDATE(aquarium);
static MACHINE_RESET( aquarium )
{
UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1);
- int data = readinputportbytag("FAKE");
+ int data = input_port_read(machine, "FAKE");
/* Language : 0x0000 = Japanese - Other value = English */
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index 93b086096ff..882d353c0b7 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -148,7 +148,7 @@ static READ8_HANDLER( custom_cpu_r )
case 3:
case 4:
case 5:
- return readinputport(2 + offset);
+ return input_port_read_indexed(machine, 2 + offset);
/* busy flag; this is polled to check the custom CPU's readiness */
/* we just toggle it on and off until the main CPU gets the result */
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index 362ab94ef86..5d290eb6d4c 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -48,6 +48,7 @@
***************************************************************************/
#include "driver.h"
+#include "deprecat.h"
#include "sound/custom.h"
#include "includes/amiga.h"
@@ -93,7 +94,7 @@ static WRITE16_HANDLER( arcadia_multibios_change_game )
static UINT8 arcadia_cia_0_porta_r(void)
{
- return readinputportbytag("CIA0PORTA");
+ return input_port_read(Machine, "CIA0PORTA");
}
static void arcadia_cia_0_porta_w(UINT8 data)
@@ -133,7 +134,7 @@ static void arcadia_cia_0_porta_w(UINT8 data)
static UINT8 arcadia_cia_0_portb_r(void)
{
- return readinputportbytag("CIA0PORTB");
+ return input_port_read(Machine, "CIA0PORTB");
}
static void arcadia_cia_0_portb_w(UINT8 data)
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index 33c711c05b2..433027b0d39 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -148,7 +148,7 @@ static READ16_HANDLER( ultennis_hack_r )
hack_irq = 0;
update_irq_state(Machine);
}
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
@@ -378,7 +378,7 @@ static void stonebal_protection(running_machine *machine)
static READ16_HANDLER( special_port5_r )
{
- return readinputport(5) | prot_output_bit;
+ return input_port_read_indexed(machine, 5) | prot_output_bit;
}
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 9558cc671b7..641a435e623 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -272,7 +272,7 @@ static WRITE8_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) sample_start(5, SND_FLEET4, 0);
if (bits_gone_hi & 0x10) sample_start(4, SND_UFOHIT, 0);
- screen_flip = (readinputport(3) & data & 0x20) ? 0xff : 0x00;
+ screen_flip = (input_port_read_indexed(machine, 3) & data & 0x20) ? 0xff : 0x00;
}
@@ -303,7 +303,7 @@ static WRITE8_HANDLER( spaceint_sound2_w )
if (bits_gone_hi & 0x04) sample_start(3, SND_INVADERHIT, 0);
- screen_flip = (readinputport(3) & data & 0x80) ? 0xff : 0x00;
+ screen_flip = (input_port_read_indexed(machine, 3) & data & 0x80) ? 0xff : 0x00;
}
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index 86d16422808..b4fd0b6fe77 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -258,7 +258,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
static CUSTOM_INPUT( ebases_trackball_r )
{
static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
- return readinputportbytag(names[input_select]);
+ return input_port_read(machine, names[input_select]);
}
@@ -285,7 +285,7 @@ static READ8_HANDLER( spacezap_io_r )
{
coin_counter_w(0, (offset >> 8) & 1);
coin_counter_w(1, (offset >> 9) & 1);
- return readinputportbytag_safe("P3HANDLE", 0xff);
+ return input_port_read_safe(machine, "P3HANDLE", 0xff);
}
@@ -474,7 +474,7 @@ static READ8_HANDLER( demndrgn_io_r )
static CUSTOM_INPUT( demndragn_joystick_r )
{
static const char *const names[] = { "MOVEX", "MOVEY" };
- return readinputportbytag(names[input_select]);
+ return input_port_read(machine, names[input_select]);
}
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index c02a5c24e75..fb0aa157de1 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -123,7 +123,7 @@ static INPUT_CHANGED( service_coin_inserted )
static CUSTOM_INPUT( astrof_p1_controls_r )
{
- return readinputportbytag("P1");
+ return input_port_read(machine, "P1");
}
@@ -134,10 +134,10 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
/* on an upright cabinets, a single set of controls
is connected to both sets of pins on the edge
connector */
- if (readinputportbytag("CAB"))
- ret = readinputportbytag("P2");
+ if (input_port_read(machine, "CAB"))
+ ret = input_port_read(machine, "P2");
else
- ret = readinputportbytag("P1");
+ ret = input_port_read(machine, "P1");
return ret;
}
@@ -223,7 +223,7 @@ static WRITE8_HANDLER( tomahawk_videoram_w )
static WRITE8_HANDLER( video_control_1_w )
{
- flipscreen = ((data >> 0) & 0x01) & readinputportbytag("FLIP");
+ flipscreen = ((data >> 0) & 0x01) & input_port_read(machine, "FLIP");
/* this ties to the CLR pin of the shift registers */
screen_off = (data & 0x02) ? TRUE : FALSE;
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index 1d03819357d..d6ee10ca59d 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -110,7 +110,7 @@ static WRITE16_HANDLER( mo_command_w )
static READ16_HANDLER( special_port0_r )
{
- int temp = readinputport(0);
+ int temp = input_port_read_indexed(machine, 0);
if (atarigen_cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
@@ -127,11 +127,11 @@ static READ16_HANDLER( a2d_data_r )
{
/* Pit Fighter has no A2D, just another input port */
if (atarig1_pitfight)
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
/* otherwise, assume it's hydra */
if (which_input < 3)
- return readinputport(1 + which_input) << 8;
+ return input_port_read_indexed(machine, 1 + which_input) << 8;
return 0;
}
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index a946aa485c9..d08fb86b359 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -83,7 +83,7 @@ static MACHINE_RESET( atarig42 )
static READ16_HANDLER( special_port2_r )
{
- int temp = readinputport(2);
+ int temp = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -93,7 +93,7 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( a2d_select_w )
{
- analog_data = readinputport(4 + (offset != 0));
+ analog_data = input_port_read_indexed(machine, 4 + (offset != 0));
}
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index a99d386f224..0d584cecf13 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -106,13 +106,13 @@ static void cage_irq_callback(int reason)
static READ32_HANDLER( inputs_01_r )
{
- return (readinputportbytag("IN0") << 16) | readinputportbytag("IN1");
+ return (input_port_read(machine, "IN0") << 16) | input_port_read(machine, "IN1");
}
static READ32_HANDLER( special_port2_r )
{
- int temp = readinputportbytag("IN2");
+ int temp = input_port_read(machine, "IN2");
temp ^= 0x0001; /* /A2DRDY always high for now */
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
@@ -121,7 +121,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- int temp = readinputportbytag("IN3");
+ int temp = input_port_read(machine, "IN3");
if (atarigen_video_int_state) temp ^= 0x0001;
if (atarigen_scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp;
@@ -131,7 +131,7 @@ static READ32_HANDLER( special_port3_r )
#if (HACK_TMEK_CONTROLS)
INLINE void compute_fake_pots(int *pots)
{
- int fake = readinputportbytag("FAKE");
+ int fake = input_port_read(machine, "FAKE");
pots[0] = pots[1] = pots[2] = pots[3] = 0x80;
@@ -168,7 +168,7 @@ static READ32_HANDLER( analog_port0_r )
compute_fake_pots(pots);
return (pots[0] << 24) | (pots[3] << 8);
#else
- return (readinputportbytag("IN4") << 24) | (readinputportbytag("IN5") << 8);
+ return (input_port_read(machine, "IN4") << 24) | (input_port_read(machine, "IN5") << 8);
#endif
}
@@ -180,7 +180,7 @@ static READ32_HANDLER( analog_port1_r )
compute_fake_pots(pots);
return (pots[2] << 24) | (pots[1] << 8);
#else
- return (readinputportbytag("IN6") << 24) | (readinputportbytag("IN7") << 8);
+ return (input_port_read(machine, "IN6") << 24) | (input_port_read(machine, "IN7") << 8);
#endif
}
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index 9abde73e184..c7549be9f70 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -81,7 +81,7 @@ static MACHINE_RESET( atarigx2 )
static READ32_HANDLER( special_port2_r )
{
- int temp = readinputport(2);
+ int temp = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -91,7 +91,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- int temp = readinputport(3);
+ int temp = input_port_read_indexed(machine, 3);
return (temp << 16) | temp;
}
@@ -111,9 +111,9 @@ static READ32_HANDLER( a2d_data_r )
switch (offset)
{
case 0:
- return (readinputport(5) << 24) | (readinputport(6) << 8);
+ return (input_port_read_indexed(machine, 5) << 24) | (input_port_read_indexed(machine, 6) << 8);
case 1:
- return (readinputport(7) << 24) | (readinputport(8) << 8);
+ return (input_port_read_indexed(machine, 7) << 24) | (input_port_read_indexed(machine, 8) << 8);
}
return 0;
@@ -1169,7 +1169,7 @@ static READ32_HANDLER( atarigx2_protection_r )
static READ32_HANDLER( inputs_01_r )
{
- return (readinputport(0) << 16) | readinputport(1);
+ return (input_port_read_indexed(machine, 0) << 16) | input_port_read_indexed(machine, 1);
}
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 54e1d0137a4..5ddefb79bd2 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -214,15 +214,15 @@ static READ16_HANDLER( joystick_r )
/* digital joystick type */
if (joystick_type == 1)
- newval = (readinputport(0) & (0x80 >> offset)) ? 0xf0 : 0x00;
+ newval = (input_port_read_indexed(machine, 0) & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */
else if (joystick_type == 2)
- newval = readinputport(offset & 1);
+ newval = input_port_read_indexed(machine, offset & 1);
/* Road Blasters gas pedal */
else if (joystick_type == 3)
- newval = readinputport(1);
+ newval = input_port_read_indexed(machine, 1);
/* the A4 bit enables/disables joystick IRQs */
joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@@ -268,13 +268,13 @@ static READ16_HANDLER( trakball_r )
if (player == 0)
{
- posx = (INT8)readinputport(0);
- posy = (INT8)readinputport(1);
+ posx = (INT8)input_port_read_indexed(machine, 0);
+ posy = (INT8)input_port_read_indexed(machine, 1);
}
else
{
- posx = (INT8)readinputport(2);
- posy = (INT8)readinputport(3);
+ posx = (INT8)input_port_read_indexed(machine, 2);
+ posy = (INT8)input_port_read_indexed(machine, 3);
}
cur[player][0] = posx + posy;
@@ -286,7 +286,7 @@ static READ16_HANDLER( trakball_r )
/* Road Blasters steering wheel */
else if (trackball_type == 2)
- result = readinputport(0);
+ result = input_port_read_indexed(machine, 0);
return result;
}
@@ -301,7 +301,7 @@ static READ16_HANDLER( trakball_r )
static READ16_HANDLER( port4_r )
{
- int temp = readinputport(4);
+ int temp = input_port_read_indexed(machine, 4);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -316,11 +316,11 @@ static READ16_HANDLER( port4_r )
static READ8_HANDLER( switch_6502_r )
{
- int temp = readinputport(5);
+ int temp = input_port_read_indexed(machine, 5);
if (atarigen_cpu_to_sound_ready) temp ^= 0x08;
if (atarigen_sound_to_cpu_ready) temp ^= 0x10;
- if (!(readinputport(4) & 0x0040)) temp ^= 0x80;
+ if (!(input_port_read_indexed(machine, 4) & 0x0040)) temp ^= 0x80;
return temp;
}
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index a38ed16fc83..071e4333341 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -425,9 +425,9 @@ static WRITE16_HANDLER( adc_strobe_w )
static READ16_HANDLER( adc_r )
{
if (which_adc < pedal_count)
- return ~readinputport(3 + which_adc);
+ return ~input_port_read_indexed(machine, 3 + which_adc);
- return readinputport(3 + which_adc) | 0xff00;
+ return input_port_read_indexed(machine, 3 + which_adc) | 0xff00;
}
@@ -444,8 +444,8 @@ static READ8_HANDLER( leta_r )
static double last_angle;
static int rotations;
- int analogx = readinputport(7) - 128;
- int analogy = readinputport(8) - 128;
+ int analogx = input_port_read_indexed(machine, 7) - 128;
+ int analogy = input_port_read_indexed(machine, 8) - 128;
double angle;
/* if the joystick is centered, leave the rest of this alone */
@@ -481,7 +481,7 @@ static READ8_HANDLER( leta_r )
}
}
- return readinputport(7 + (offset & 3));
+ return input_port_read_indexed(machine, 7 + (offset & 3));
}
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 2f330287b0f..600afb8c588 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -231,20 +231,20 @@ static READ32_HANDLER(backfire_eeprom_r)
{
/* some kind of screen indicator? checked by backfira set before it will boot */
int backfire_screen = mame_rand(Machine)&1;
- return ((EEPROM_read_bit()<<24) | readinputport(0) | (readinputport(3)<<16)) ^ (backfire_screen << 26) ;
+ return ((EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 3)<<16)) ^ (backfire_screen << 26) ;
}
static READ32_HANDLER(backfire_control2_r)
{
// logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask);
- return (EEPROM_read_bit()<<24) | readinputport(1) | (readinputport(1)<<16);
+ return (EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 1)<<16);
}
#ifdef UNUSED_FUNCTION
static READ32_HANDLER(backfire_control3_r)
{
// logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask);
- return (EEPROM_read_bit()<<24) | readinputport(2) | (readinputport(2)<<16);
+ return (EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 2)<<16);
}
#endif
@@ -306,7 +306,7 @@ static WRITE32_HANDLER( backfire_pf4_data_w ) { data &=0x0000ffff; mem_mask &=0x
#ifdef UNUSED_FUNCTION
READ32_HANDLER( backfire_unknown_wheel_r )
{
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
}
READ32_HANDLER( backfire_wheel1_r )
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index dbe11e67733..53c7b92543c 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -139,7 +139,7 @@ static void scanline_update(const device_config *screen, int scanline)
/* sound IRQ is on 32V */
if (scanline & 32)
atarigen_6502_irq_ack_r(screen->machine, 0);
- else if (!(readinputport(0) & 0x40))
+ else if (!(input_port_read_indexed(screen->machine, 0) & 0x40))
atarigen_6502_irq_gen(screen->machine, 0);
}
@@ -240,8 +240,8 @@ static READ8_HANDLER( audio_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = readinputport(3);
- if (!(readinputport(0) & 0x0080)) result ^= 0x90;
+ result = input_port_read_indexed(machine, 3);
+ if (!(input_port_read_indexed(machine, 0) & 0x0080)) result ^= 0x90;
if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10;
@@ -633,7 +633,7 @@ static void scanline_update_bootleg(const device_config *screen, int scanline)
/* sound IRQ is on 32V */
// if (scanline & 32)
// atarigen_6502_irq_ack_r(screen->machine, 0);
-// else if (!(readinputport(0) & 0x40))
+// else if (!(input_port_read_indexed(machine, 0) & 0x40))
// atarigen_6502_irq_gen(screen->machine, 0);
}
diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c
index 8076fcf7ba9..b703fa2d692 100644
--- a/src/mame/drivers/baraduke.c
+++ b/src/mame/drivers/baraduke.c
@@ -144,19 +144,19 @@ static READ8_HANDLER( inputport_r )
switch (inputport_selected)
{
case 0x00: /* DSW A (bits 0-4) */
- return (readinputport(0) & 0xf8) >> 3; break;
+ return (input_port_read_indexed(machine, 0) & 0xf8) >> 3; break;
case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */
- return ((readinputport(0) & 0x07) << 2) | ((readinputport(1) & 0xc0) >> 6); break;
+ return ((input_port_read_indexed(machine, 0) & 0x07) << 2) | ((input_port_read_indexed(machine, 1) & 0xc0) >> 6); break;
case 0x02: /* DSW B (bits 2-6) */
- return (readinputport(1) & 0x3e) >> 1; break;
+ return (input_port_read_indexed(machine, 1) & 0x3e) >> 1; break;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
- return ((readinputport(1) & 0x01) << 4) | (readinputport(2) & 0x0f); break;
+ return ((input_port_read_indexed(machine, 1) & 0x01) << 4) | (input_port_read_indexed(machine, 2) & 0x0f); break;
case 0x04: /* coins, start */
- return readinputport(3); break;
+ return input_port_read_indexed(machine, 3); break;
case 0x05: /* 2P controls */
- return readinputport(5); break;
+ return input_port_read_indexed(machine, 5); break;
case 0x06: /* 1P controls */
- return readinputport(4); break;
+ return input_port_read_indexed(machine, 4); break;
default:
return 0xff;
}
diff --git a/src/mame/drivers/batman.c b/src/mame/drivers/batman.c
index 1d515d60762..85cb958ea32 100644
--- a/src/mame/drivers/batman.c
+++ b/src/mame/drivers/batman.c
@@ -97,7 +97,7 @@ static WRITE16_HANDLER( batman_atarivc_w )
static READ16_HANDLER( special_port2_r )
{
- int result = readinputport(2);
+ int result = input_port_read_indexed(machine, 2);
if (atarigen_sound_to_cpu_ready) result ^= 0x0010;
if (atarigen_cpu_to_sound_ready) result ^= 0x0020;
return result;
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index c780bcc6424..d57911b6a1a 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -62,11 +62,11 @@ static WRITE8_HANDLER( control_data_w )
static READ8_HANDLER( control_data_r )
{
switch (control_port_select) {
- case 0xfe: return readinputportbytag("IN0"); /* Player 1 */
- case 0xfd: return readinputportbytag("IN1"); /* Player 2 */
- case 0xfb: return readinputportbytag("IN2"); /* Coins */
- case 0xf7: return readinputportbytag("DSW2"); /* Dip 2 */
- case 0xef: return readinputportbytag("DSW1"); /* Dip 1 */
+ case 0xfe: return input_port_read(machine, "IN0"); /* Player 1 */
+ case 0xfd: return input_port_read(machine, "IN1"); /* Player 2 */
+ case 0xfb: return input_port_read(machine, "IN2"); /* Coins */
+ case 0xf7: return input_port_read(machine, "DSW2"); /* Dip 2 */
+ case 0xef: return input_port_read(machine, "DSW1"); /* Dip 1 */
}
return 0xff;
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index 8178fe9208e..1b9a5d82110 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -211,7 +211,7 @@ WRITE16_HANDLER( bbuster_video_w );
static MACHINE_RESET( bbusters )
{
UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1);
- int data = readinputportbytag("FAKE1") & 0x03;
+ int data = input_port_read(machine, "FAKE1") & 0x03;
/* Country/Version :
- 0x0000 : Japan?
@@ -230,7 +230,7 @@ static MACHINE_RESET( bbusters )
static MACHINE_RESET( mechatt )
{
UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1);
- int data = readinputportbytag("FAKE1") & 0x03;
+ int data = input_port_read(machine, "FAKE1") & 0x03;
/* Country :
- 0x0000 : Japan
@@ -260,7 +260,7 @@ static int gun_select;
static READ16_HANDLER( control_3_r )
{
- return readinputport(gun_select);
+ return input_port_read_indexed(machine, gun_select);
}
static WRITE16_HANDLER( gun_select_w )
@@ -272,12 +272,12 @@ static WRITE16_HANDLER( gun_select_w )
static READ16_HANDLER( kludge_r )
{
- bbuster_ram[0xa692/2]=readinputportbytag("IN5")<<1;
- bbuster_ram[0xa694/2]=readinputportbytag("IN6")<<1;
- bbuster_ram[0xa696/2]=readinputportbytag("IN7")<<1;
- bbuster_ram[0xa698/2]=readinputportbytag("IN8")<<1;
- bbuster_ram[0xa69a/2]=readinputportbytag("IN9")<<1;
- bbuster_ram[0xa69c/2]=readinputportbytag("IN10")<<1;
+ bbuster_ram[0xa692/2]=input_port_read(machine, "IN5")<<1;
+ bbuster_ram[0xa694/2]=input_port_read(machine, "IN6")<<1;
+ bbuster_ram[0xa696/2]=input_port_read(machine, "IN7")<<1;
+ bbuster_ram[0xa698/2]=input_port_read(machine, "IN8")<<1;
+ bbuster_ram[0xa69a/2]=input_port_read(machine, "IN9")<<1;
+ bbuster_ram[0xa69c/2]=input_port_read(machine, "IN10")<<1;
return 0;
}
@@ -292,8 +292,8 @@ static READ16_HANDLER( mechatt_gun_r )
int baseport=2,x,y;
if (offset) baseport=4; /* Player 2 */
- x=readinputport(baseport);
- y=readinputport(baseport+1);
+ x=input_port_read_indexed(machine, baseport);
+ y=input_port_read_indexed(machine, baseport+1);
/* Todo - does the hardware really clamp like this? */
x+=0x18;
diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c
index c809ea7306f..8daea8ec614 100644
--- a/src/mame/drivers/beaminv.c
+++ b/src/mame/drivers/beaminv.c
@@ -192,7 +192,7 @@ static WRITE8_HANDLER( controller_select_w )
static READ8_HANDLER( controller_r )
{
- return readinputportbytag((controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
+ return input_port_read(machine, (controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
}
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 3b23dd14575..f7cc0b4a1a1 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -270,19 +270,19 @@ static WRITE32_HANDLER( eeprom_enable_w )
static READ32_HANDLER( input_0_r )
{
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
static READ32_HANDLER( input_1_r )
{
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
static READ32_HANDLER( input_2_r )
{
- int result = readinputport(2);
+ int result = input_port_read_indexed(machine, 2);
if (atarigen_sound_to_cpu_ready) result ^= 0x10;
if (atarigen_cpu_to_sound_ready) result ^= 0x20;
return result;
@@ -291,7 +291,7 @@ static READ32_HANDLER( input_2_r )
static READ32_HANDLER( input_3_r )
{
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index ef48ab6c0b1..f96500f8dd9 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -383,7 +383,7 @@ static READ8_HANDLER( intercept_v256_r )
}
-static void get_pens(pen_t *pens)
+static void get_pens(running_machine *machine, pen_t *pens)
{
static const int resistances_wg[] = { 750, 0 };
static const int resistances_el[] = { 1.0 / ((1.0 / 750.0) + (1.0 / 360.0)), 0 };
@@ -391,7 +391,7 @@ static void get_pens(pen_t *pens)
int color;
double color_weights[2];
- if (readinputportbytag(MONITOR_TYPE_PORT_TAG) == 0)
+ if (input_port_read(machine, MONITOR_TYPE_PORT_TAG) == 0)
compute_resistor_weights(0, 0xff, -1.0,
2, resistances_wg, color_weights, 0, 270,
2, resistances_wg, color_weights, 0, 270,
@@ -423,7 +423,7 @@ static VIDEO_UPDATE( berzerk )
pen_t pens[NUM_PENS];
offs_t offs;
- get_pens(pens);
+ get_pens(screen->machine, pens);
for (offs = 0; offs < berzerk_videoram_size; offs++)
{
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index dd8105f83ee..faaf2cb5445 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -865,7 +865,7 @@ static READ8_HANDLER( chipset_r )
}
case 0x22:
{
- val = 0x40 | readinputportbytag("JOYSTICK");
+ val = 0x40 | input_port_read(machine, "JOYSTICK");
break;
}
default:
@@ -1409,7 +1409,7 @@ static WRITE8_HANDLER( latch_w )
/* Clock is low */
if (!(data & 0x08))
- mux_input = readinputport(input_strobe);
+ mux_input = input_port_read_indexed(machine, input_strobe);
}
break;
}
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index bcfafa019e4..0dfdd5f41c6 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -655,11 +655,11 @@ static READ8_HANDLER( mux_input_r )
t1 = input_override[offset]; // strobe 0-7 data 0-4
t2 = input_override[offset+idx]; // strobe 8-B data 0-4
- t1 = (sc2_Inputs[offset] & t1) | ( ( readinputport(offset+1) & ~t1) & 0x1F);
+ t1 = (sc2_Inputs[offset] & t1) | ( ( input_port_read_indexed(machine, offset+1) & ~t1) & 0x1F);
if (idx == 8)
- t2 = (sc2_Inputs[offset+8] & t2) | ( ( readinputport(offset+1+8) & ~t2) << 5);
+ t2 = (sc2_Inputs[offset+8] & t2) | ( ( input_port_read_indexed(machine, offset+1+8) & ~t2) << 5);
else
- t2 = (sc2_Inputs[offset+4] & t2) | ( ( ( readinputport(offset+1+4) & ~t2) << 2) & 0x60);
+ t2 = (sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read_indexed(machine, offset+1+4) & ~t2) << 2) & 0x60);
sc2_Inputs[offset] = (sc2_Inputs[offset] & ~0x1F) | t1;
sc2_Inputs[offset+idx] = (sc2_Inputs[offset+idx] & ~0x60) | t2;
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index 2c212715fa9..0ec53ecbe8d 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -377,7 +377,7 @@ static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
*/
bit5 ^= 0x20;
- return bigevglf_mcu_status_r(machine,0) | (readinputport(1) & 3) | bit5; /* bit 0 and bit 1 - coin inputs */
+ return bigevglf_mcu_status_r(machine,0) | (input_port_read_indexed(machine, 1) & 3) | bit5; /* bit 0 and bit 1 - coin inputs */
}
static ADDRESS_MAP_START( bigevglf_sub_readport, ADDRESS_SPACE_IO, 8 )
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index 5d5df667240..a5ffd81d19f 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -96,13 +96,13 @@ logerror("%06x: hacked_controls_r %04x %04x\n",activecpu_get_pc(),offset,bionicc
static WRITE16_HANDLER( bionicc_mpu_trigger_w )
{
- data = readinputport(0) >> 12;
+ data = input_port_read_indexed(machine, 0) >> 12;
bionicc_inp[0] = data ^ 0x0f;
- data = readinputport(3); /* player 2 controls */
+ data = input_port_read_indexed(machine, 3); /* player 2 controls */
bionicc_inp[1] = data ^ 0xff;
- data = readinputport(2); /* player 1 controls */
+ data = input_port_read_indexed(machine, 2); /* player 1 controls */
bionicc_inp[2] = data ^ 0xff;
}
diff --git a/src/mame/drivers/bishjan.c b/src/mame/drivers/bishjan.c
index 978d299a80d..18f8d1b685f 100644
--- a/src/mame/drivers/bishjan.c
+++ b/src/mame/drivers/bishjan.c
@@ -224,10 +224,10 @@ static READ16_HANDLER( bishjan_input_r )
for (i = 0; i < 5; i++)
if (bishjan_input & (1 << i))
- res = readinputport(4+i);
+ res = input_port_read_indexed(machine, 4+i);
return (res << 8) |
- readinputport(3) |
+ input_port_read_indexed(machine, 3) |
((bishjan_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0x00 : 0x04) // bit 2: hopper sensor
;
}
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index e767e9884bd..dca4f99044a 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -57,7 +57,7 @@ static READ8_HANDLER( trackball_r )
int curr,delta;
- curr = readinputport(5 + offset);
+ curr = input_port_read_indexed(machine, 5 + offset);
delta = (curr - last[offset]) & 0xff;
last[offset] = curr;
return (delta & 0x80) | (curr >> 1);
diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c
index 05ce9912a3e..3ef34c3d55a 100644
--- a/src/mame/drivers/blktiger.c
+++ b/src/mame/drivers/blktiger.c
@@ -54,7 +54,7 @@ static WRITE8_HANDLER( blktiger_bankswitch_w )
static WRITE8_HANDLER( blktiger_coinlockout_w )
{
- if (readinputportbytag("COIN_LOCKOUT") & 0x01)
+ if (input_port_read(machine, "COIN_LOCKOUT") & 0x01)
{
coin_lockout_w(0,~data & 0x01);
coin_lockout_w(1,~data & 0x02);
diff --git a/src/mame/drivers/blmbycar.c b/src/mame/drivers/blmbycar.c
index 3ea44f849bb..0ac5c29125d 100644
--- a/src/mame/drivers/blmbycar.c
+++ b/src/mame/drivers/blmbycar.c
@@ -77,7 +77,7 @@ static UINT8 pot_wheel = 0;
static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
{
if (ACCESSING_BITS_0_7)
- pot_wheel = ~readinputport(2) & 0xff;
+ pot_wheel = ~input_port_read_indexed(machine, 2) & 0xff;
}
static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
@@ -102,7 +102,7 @@ static READ16_HANDLER( blmbycar_pot_wheel_r )
static READ16_HANDLER( blmbycar_opt_wheel_r )
{
- return (~readinputport(2) & 0xff) << 8;
+ return (~input_port_read_indexed(machine, 2) & 0xff) << 8;
}
diff --git a/src/mame/drivers/blstroid.c b/src/mame/drivers/blstroid.c
index bfa318330ed..3da6e43a6fd 100644
--- a/src/mame/drivers/blstroid.c
+++ b/src/mame/drivers/blstroid.c
@@ -72,7 +72,7 @@ static MACHINE_RESET( blstroid )
static READ16_HANDLER( inputs_r )
{
- int temp = readinputport(2 + (offset & 1));
+ int temp = input_port_read_indexed(machine, 2 + (offset & 1));
if (atarigen_cpu_to_sound_ready) temp ^= 0x0040;
if (atarigen_get_hblank(machine->primary_screen)) temp ^= 0x0010;
return temp;
diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c
index fe35d77fc63..16fe305d0f9 100644
--- a/src/mame/drivers/bnstars.c
+++ b/src/mame/drivers/bnstars.c
@@ -1202,28 +1202,28 @@ static READ32_HANDLER( bnstars1_r )
return 0xffffffff;
case 0x0000:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x0080:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x2000:
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x2080:
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
}
static READ32_HANDLER( bnstars2_r )
{
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
}
static READ32_HANDLER( bnstars3_r )
{
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
}
static WRITE32_HANDLER( bnstars1_mahjong_select_w )
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index 6163941b88d..72a4d026913 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -45,12 +45,12 @@ static TIMER_CALLBACK( periodic_callback )
memset(mask, 0, sizeof mask);
- mask[readinputport(3)] |= 0x01;
- mask[readinputport(4)] |= 0x02;
- mask[readinputport(5)] |= 0x04;
- mask[readinputport(6)] |= 0x08;
- mask[readinputport(7)] |= 0x10;
- mask[readinputport(8)] |= 0x20;
+ mask[input_port_read_indexed(machine, 3)] |= 0x01;
+ mask[input_port_read_indexed(machine, 4)] |= 0x02;
+ mask[input_port_read_indexed(machine, 5)] |= 0x04;
+ mask[input_port_read_indexed(machine, 6)] |= 0x08;
+ mask[input_port_read_indexed(machine, 7)] |= 0x10;
+ mask[input_port_read_indexed(machine, 8)] |= 0x20;
for (i = 1; i < 256; i++)
if (mask[i] != 0)
@@ -88,9 +88,9 @@ static MACHINE_RESET( boxer )
static READ8_HANDLER( boxer_input_r )
{
- UINT8 val = readinputport(0);
+ UINT8 val = input_port_read_indexed(machine, 0);
- if (readinputport(9) < video_screen_get_vpos(machine->primary_screen))
+ if (input_port_read_indexed(machine, 9) < video_screen_get_vpos(machine->primary_screen))
val |= 0x02;
return (val << ((offset & 7) ^ 7)) & 0x80;
@@ -112,11 +112,11 @@ static READ8_HANDLER( boxer_misc_r )
break;
case 2:
- val = readinputport(1);
+ val = input_port_read_indexed(machine, 1);
break;
case 3:
- val = readinputport(2);
+ val = input_port_read_indexed(machine, 2);
break;
}
diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c
index 147f041bfd0..81a82e3a06c 100644
--- a/src/mame/drivers/btoads.c
+++ b/src/mame/drivers/btoads.c
@@ -84,7 +84,7 @@ static WRITE16_HANDLER( main_sound_w )
static READ16_HANDLER( special_port_4_r )
{
- int result = readinputport(4) & ~0x81;
+ int result = input_port_read_indexed(machine, 4) & ~0x81;
if (sound_to_main_ready)
result |= 0x01;
diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c
index 01848102bb6..776cf37f0b3 100644
--- a/src/mame/drivers/bwidow.c
+++ b/src/mame/drivers/bwidow.c
@@ -253,8 +253,8 @@ static READ8_HANDLER( spacduel_IN3_r )
int res1;
int res2;
- res1 = readinputportbytag("IN3");
- res2 = readinputportbytag("IN4");
+ res1 = input_port_read(machine, "IN3");
+ res2 = input_port_read(machine, "IN4");
res = 0x00;
switch (offset & 0x07)
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index b130fb0ce63..4878c4a8fc2 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -78,14 +78,14 @@ static INTERRUPT_GEN ( bwp1_interrupt )
break;
case 1:
- if (~readinputport(4) & 0x03)
+ if (~input_port_read_indexed(machine, 4) & 0x03)
{ if (!coin) { coin = 1; cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); } }
else
coin = 0;
break;
case 2:
- if (readinputport(5)) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
+ if (input_port_read_indexed(machine, 5)) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
break;
}
}
@@ -104,11 +104,11 @@ static WRITE8_HANDLER( bwp3_nmimask_w ) { bwp3_nmimask = data & 0x80; }
static READ8_HANDLER( bwp1_io_r )
{
- if (offset == 0) return(readinputport(0));
- if (offset == 1) return(readinputport(1));
- if (offset == 2) return(readinputport(2));
- if (offset == 3) return(readinputport(3));
- if (offset == 4) return(readinputport(4));
+ if (offset == 0) return(input_port_read_indexed(machine, 0));
+ if (offset == 1) return(input_port_read_indexed(machine, 1));
+ if (offset == 2) return(input_port_read_indexed(machine, 2));
+ if (offset == 3) return(input_port_read_indexed(machine, 3));
+ if (offset == 4) return(input_port_read_indexed(machine, 4));
return((bwp123_membase[0])[0x1b00 + offset]);
}
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index d9273e6799c..ab6a97cf64f 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -252,7 +252,7 @@ static MACHINE_START( redbaron )
static INTERRUPT_GEN( bzone_interrupt )
{
- if (readinputport(0) & 0x10)
+ if (input_port_read_indexed(machine, 0) & 0x10)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -268,7 +268,7 @@ READ8_HANDLER( bzone_IN0_r )
{
int res;
- res = readinputportbytag("IN0");
+ res = input_port_read(machine, "IN0");
if (activecpu_gettotalcycles() & 0x100)
res |= IN0_3KHZ;
@@ -299,7 +299,7 @@ static WRITE8_HANDLER( bzone_coin_counter_w )
static READ8_HANDLER( redbaron_joy_r )
{
- return readinputport(rb_input_select ? 5 : 6);
+ return input_port_read_indexed(machine, rb_input_select ? 5 : 6);
}
@@ -807,7 +807,7 @@ static READ8_HANDLER( analog_data_r )
static WRITE8_HANDLER( analog_select_w )
{
if (offset <= 2)
- analog_data = readinputport(6 + offset);
+ analog_data = input_port_read_indexed(machine, 6 + offset);
}
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index ba04ab68cc5..b16007d3609 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -87,7 +87,7 @@ static WRITE16_HANDLER( track_reset_w )
int i;
for (i = 0;i < 4;i++)
- last[i] = readinputport(3+i);
+ last[i] = input_port_read_indexed(machine, 3+i);
}
static READ16_HANDLER( track_r )
@@ -95,10 +95,10 @@ static READ16_HANDLER( track_r )
switch (offset)
{
default:
- case 0: return (( readinputport(3) - last[0]) & 0x00ff) | (((readinputport(5) - last[2]) & 0x00ff) << 8); /* X lo */
- case 1: return (((readinputport(3) - last[0]) & 0xff00) >> 8) | (( readinputport(5) - last[2]) & 0xff00); /* X hi */
- case 2: return (( readinputport(4) - last[1]) & 0x00ff) | (((readinputport(6) - last[3]) & 0x00ff) << 8); /* Y lo */
- case 3: return (((readinputport(4) - last[1]) & 0xff00) >> 8) | (( readinputport(6) - last[3]) & 0xff00); /* Y hi */
+ case 0: return (( input_port_read_indexed(machine, 3) - last[0]) & 0x00ff) | (((input_port_read_indexed(machine, 5) - last[2]) & 0x00ff) << 8); /* X lo */
+ case 1: return (((input_port_read_indexed(machine, 3) - last[0]) & 0xff00) >> 8) | (( input_port_read_indexed(machine, 5) - last[2]) & 0xff00); /* X hi */
+ case 2: return (( input_port_read_indexed(machine, 4) - last[1]) & 0x00ff) | (((input_port_read_indexed(machine, 6) - last[3]) & 0x00ff) << 8); /* Y lo */
+ case 3: return (((input_port_read_indexed(machine, 4) - last[1]) & 0xff00) >> 8) | (( input_port_read_indexed(machine, 6) - last[3]) & 0xff00); /* Y hi */
}
}
diff --git a/src/mame/drivers/canyon.c b/src/mame/drivers/canyon.c
index 3c65daac281..85c5acf5182 100644
--- a/src/mame/drivers/canyon.c
+++ b/src/mame/drivers/canyon.c
@@ -64,11 +64,11 @@ static READ8_HANDLER( canyon_switches_r )
{
UINT8 val = 0;
- if ((readinputport(2) >> (offset & 7)) & 1)
+ if ((input_port_read_indexed(machine, 2) >> (offset & 7)) & 1)
{
val |= 0x80;
}
- if ((readinputport(1) >> (offset & 3)) & 1)
+ if ((input_port_read_indexed(machine, 1) >> (offset & 3)) & 1)
{
val |= 0x01;
}
@@ -79,7 +79,7 @@ static READ8_HANDLER( canyon_switches_r )
static READ8_HANDLER( canyon_options_r )
{
- return (readinputport(0) >> (2 * (~offset & 3))) & 3;
+ return (input_port_read_indexed(machine, 0) >> (2 * (~offset & 3))) & 3;
}
diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c
index f92a35cbf75..8f5fe4e0b6b 100644
--- a/src/mame/drivers/capbowl.c
+++ b/src/mame/drivers/capbowl.c
@@ -111,7 +111,7 @@ static UINT8 last_trackball_val[2];
static INTERRUPT_GEN( capbowl_interrupt )
{
- if (readinputport(4) & 1) /* get status of the F2 key */
+ if (input_port_read_indexed(machine, 4) & 1) /* get status of the F2 key */
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */
}
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 30d87ea8436..4c879a78a7c 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -311,17 +311,17 @@ static int cave_region_byte;
static READ16_HANDLER( cave_input1_r )
{
- return readinputport(1) | ((EEPROM_read_bit() & 0x01) << 11);
+ return input_port_read_indexed(machine, 1) | ((EEPROM_read_bit() & 0x01) << 11);
}
static READ16_HANDLER( guwange_input1_r )
{
- return readinputport(1) | ((EEPROM_read_bit() & 0x01) << 7);
+ return input_port_read_indexed(machine, 1) | ((EEPROM_read_bit() & 0x01) << 7);
}
static READ16_HANDLER( gaia_dsw_r )
{
- return readinputport(2) | (readinputport(3) << 8);
+ return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3) << 8);
}
static WRITE16_HANDLER( cave_eeprom_msb_w )
@@ -870,12 +870,12 @@ static WRITE16_HANDLER( korokoro_eeprom_msb_w )
static READ16_HANDLER( korokoro_input0_r )
{
- return readinputport(0) | (hopper ? 0 : 0x8000);
+ return input_port_read_indexed(machine, 0) | (hopper ? 0 : 0x8000);
}
static READ16_HANDLER( korokoro_input1_r )
{
- return readinputport(1) | ((EEPROM_read_bit() & 0x01) << 12);
+ return input_port_read_indexed(machine, 1) | ((EEPROM_read_bit() & 0x01) << 12);
}
static ADDRESS_MAP_START( korokoro_readmem, ADDRESS_SPACE_PROGRAM, 16 )
@@ -1077,7 +1077,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( sailormn_input0_r )
{
// watchdog_reset16_r(0,0); // written too rarely for mame.
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
static READ16_HANDLER( agallet_irq_cause_r )
@@ -1984,7 +1984,7 @@ static MACHINE_RESET( cave )
/* modify the eeprom on a reset with the desired region for the games that have the
region factory set in eeprom */
if (cave_region_byte >= 0)
- EEPROM_get_data_pointer(0)[cave_region_byte] = readinputport(2);
+ EEPROM_get_data_pointer(0)[cave_region_byte] = input_port_read_indexed(machine, 2);
}
static const struct YMZ280Binterface ymz280b_intf =
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index e140e4b5f49..bb7a7b8d0c8 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -89,17 +89,17 @@ static READ16_HANDLER( twocrude_control_r )
switch (offset<<1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Dip Switches */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 4: /* Protection */
logerror("%04x : protection control read at 30c000 %d\n",activecpu_get_pc(),offset);
return prot;
case 6: /* Credits, VBL in byte 7 */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
return ~0;
diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c
index 746152de63a..4d6ea8a9d9a 100644
--- a/src/mame/drivers/ccastles.c
+++ b/src/mame/drivers/ccastles.c
@@ -291,7 +291,7 @@ static WRITE8_HANDLER( bankswitch_w )
static READ8_HANDLER( leta_r )
{
- return readinputport(2 + offset);
+ return input_port_read_indexed(machine, 2 + offset);
}
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 20fc72438e9..ebb1198b123 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -507,7 +507,7 @@ static WRITE8_HANDLER( irq_ack_w )
* to prevent the counter from wrapping around between reads.
*/
-INLINE int read_trackball(int idx, int switch_port)
+INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
{
UINT8 newpos;
@@ -517,10 +517,10 @@ INLINE int read_trackball(int idx, int switch_port)
/* if we're to read the dipswitches behind the trackball data, do it now */
if (dsw_select)
- return (readinputport(switch_port) & 0x7f) | sign[idx];
+ return (input_port_read_indexed(machine, switch_port) & 0x7f) | sign[idx];
/* get the new position and adjust the result */
- newpos = readinputport(6 + idx);
+ newpos = input_port_read_indexed(machine, 6 + idx);
if (newpos != oldpos[idx])
{
sign[idx] = (newpos - oldpos[idx]) & 0x80;
@@ -528,30 +528,30 @@ INLINE int read_trackball(int idx, int switch_port)
}
/* blend with the bits from the switch port */
- return (readinputport(switch_port) & 0x70) | (oldpos[idx] & 0x0f) | sign[idx];
+ return (input_port_read_indexed(machine, switch_port) & 0x70) | (oldpos[idx] & 0x0f) | sign[idx];
}
static READ8_HANDLER( centiped_IN0_r )
{
- return read_trackball(0, 0);
+ return read_trackball(machine, 0, 0);
}
static READ8_HANDLER( centiped_IN2_r )
{
- return read_trackball(1, 2);
+ return read_trackball(machine, 1, 2);
}
static READ8_HANDLER( milliped_IN1_r )
{
- return read_trackball(1, 1);
+ return read_trackball(machine, 1, 1);
}
static READ8_HANDLER( milliped_IN2_r )
{
- UINT8 data = readinputport(2);
+ UINT8 data = input_port_read_indexed(machine, 2);
/* MSH - 15 Feb, 2007
* The P2 X Joystick inputs are not properly handled in
@@ -562,7 +562,7 @@ static READ8_HANDLER( milliped_IN2_r )
*/
if (0 != control_select) {
/* Bottom 4 bits is our joystick inputs */
- UINT8 joy2data = readinputport(3) & 0x0f;
+ UINT8 joy2data = input_port_read_indexed(machine, 3) & 0x0f;
data = data & 0xf0; /* Keep the top 4 bits */
data |= (joy2data & 0x0a) >> 1; /* flip left and up */
data |= (joy2data & 0x05) << 1; /* flip right and down */
@@ -584,7 +584,7 @@ static WRITE8_HANDLER( control_select_w )
static READ8_HANDLER( mazeinv_input_r )
{
- return readinputport(6 + control_select);
+ return input_port_read_indexed(machine, 6 + control_select);
}
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 045bd65cf5a..8573acba620 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -106,8 +106,8 @@ static WRITE8_HANDLER( cham24_IN0_w )
in_0_shift = 0;
in_1_shift = 0;
- in_0 = readinputport(0);
- in_1 = readinputport(1);
+ in_0 = input_port_read_indexed(machine, 0);
+ in_1 = input_port_read_indexed(machine, 1);
}
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index 85e07ed31d9..1995cc97ed0 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -159,8 +159,8 @@ static UINT8 last_trackball_val[2] = {0,0};
static READ8_HANDLER( trackball_r )
{
UINT8 ret;
- UINT8 port4 = readinputport(4);
- UINT8 port5 = readinputport(5);
+ UINT8 port4 = input_port_read_indexed(machine, 4);
+ UINT8 port5 = input_port_read_indexed(machine, 5);
ret = (((port4 - last_trackball_val[0]) & 0x0f)<<4) | ((port5 - last_trackball_val[1]) & 0x0f);
diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c
index ffd0b71d648..2476e3adb6c 100644
--- a/src/mame/drivers/changela.c
+++ b/src/mame/drivers/changela.c
@@ -95,7 +95,7 @@ static WRITE8_HANDLER( changela_68705_ddrA_w )
static READ8_HANDLER( changela_68705_portB_r )
{
- return (portB_out & ddrB) | (readinputport(4) & ~ddrB);
+ return (portB_out & ddrB) | (input_port_read_indexed(machine, 4) & ~ddrB);
}
static WRITE8_HANDLER( changela_68705_portB_w )
@@ -177,7 +177,7 @@ static READ8_HANDLER( changela_25_r )
static READ8_HANDLER( changela_30_r )
{
- return readinputport(7) & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
+ return input_port_read_indexed(machine, 7) & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
}
static READ8_HANDLER( changela_31_r )
@@ -186,7 +186,7 @@ static READ8_HANDLER( changela_31_r )
or if the new value is greater than the old value, and it did wrap around,
then we are moving LEFT. */
static UINT8 prev_value = 0;
- UINT8 curr_value = readinputport(7);
+ UINT8 curr_value = input_port_read_indexed(machine, 7);
static int dir = 0;
if( (curr_value < prev_value && (prev_value - curr_value) < 0x80)
@@ -204,7 +204,7 @@ static READ8_HANDLER( changela_31_r )
static READ8_HANDLER( changela_2c_r )
{
- int val = readinputport(5);
+ int val = input_port_read_indexed(machine, 5);
val = (val&0x30) | ((val&1)<<7) | (((val&1)^1)<<6);
@@ -221,7 +221,7 @@ static READ8_HANDLER( changela_2d_r )
v8 = 1;
/* Gas pedal is made up of 2 switches, 1 active low, 1 active high */
- switch(readinputport(6) & 0x03)
+ switch(input_port_read_indexed(machine, 6) & 0x03)
{
case 0x02:
gas = 0x80;
@@ -234,7 +234,7 @@ static READ8_HANDLER( changela_2d_r )
break;
}
- return (readinputport(6) & 0x20) | gas | (v8<<4);
+ return (input_port_read_indexed(machine, 6) & 0x20) | gas | (v8<<4);
}
static WRITE8_HANDLER( mcu_PC0_w )
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index a24b99b766e..fc6fafd1afd 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -130,22 +130,22 @@ static READ8_HANDLER( chinsan_input_port_0_r )
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return readinputportbytag("MAHJONG_P2_1");
+ return input_port_read(machine, "MAHJONG_P2_1");
case 0x53:
- return readinputportbytag("MAHJONG_P2_2");
+ return input_port_read(machine, "MAHJONG_P2_2");
case 0x57:
- return readinputportbytag("MAHJONG_P2_3");
+ return input_port_read(machine, "MAHJONG_P2_3");
case 0x5b:
- return readinputportbytag("MAHJONG_P2_4");
+ return input_port_read(machine, "MAHJONG_P2_4");
case 0x5d:
- return readinputportbytag("MAHJONG_P2_5");
+ return input_port_read(machine, "MAHJONG_P2_5");
case 0x5e:
- return readinputportbytag("MAHJONG_P2_6");
+ return input_port_read(machine, "MAHJONG_P2_6");
}
printf("chinsan_input_port_0_r unk_r %02x\n", chinsan_port_select);
@@ -159,22 +159,22 @@ static READ8_HANDLER( chinsan_input_port_1_r )
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return readinputportbytag("MAHJONG_P1_1");
+ return input_port_read(machine, "MAHJONG_P1_1");
case 0x53:
- return readinputportbytag("MAHJONG_P1_2");
+ return input_port_read(machine, "MAHJONG_P1_2");
case 0x57:
- return readinputportbytag("MAHJONG_P1_3");
+ return input_port_read(machine, "MAHJONG_P1_3");
case 0x5b:
- return readinputportbytag("MAHJONG_P1_4");
+ return input_port_read(machine, "MAHJONG_P1_4");
case 0x5d:
- return readinputportbytag("MAHJONG_P1_5");
+ return input_port_read(machine, "MAHJONG_P1_5");
case 0x5e:
- return readinputportbytag("MAHJONG_P1_6");
+ return input_port_read(machine, "MAHJONG_P1_6");
}
printf("chinsan_input_port_1_r unk_r %02x\n", chinsan_port_select);
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index 9f3a78bc20e..b7af160a21d 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -125,8 +125,8 @@ static READ8_HANDLER( analog_read_r )
static int accel, wheel;
switch (analog_ctrl & 0x03){
- case 0x00: return (accel = readinputport(5)); /* accelerator */
- case 0x01: return (wheel = readinputport(6)); /* steering */
+ case 0x00: return (accel = input_port_read_indexed(machine, 5)); /* accelerator */
+ case 0x01: return (wheel = input_port_read_indexed(machine, 6)); /* steering */
case 0x02: return accel; /* accelerator (previous?) */
case 0x03: return wheel; /* steering (previous?) */
}
diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c
index cf75bba7a88..0b97d8cfa39 100644
--- a/src/mame/drivers/cidelsa.c
+++ b/src/mame/drivers/cidelsa.c
@@ -36,7 +36,7 @@ static UINT8 cidelsa_ef_r(void)
EF4 Coin 1
*/
- return readinputportbytag("EF");
+ return input_port_read(Machine, "EF");
}
static void cidelsa_q_w(int q)
diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c
index b9e46877d2d..2434958f60b 100644
--- a/src/mame/drivers/cinemat.c
+++ b/src/mame/drivers/cinemat.c
@@ -87,14 +87,14 @@ MACHINE_RESET( cinemat )
static READ8_HANDLER( inputs_r )
{
- return (readinputportbytag("INPUTS") >> offset) & 1;
+ return (input_port_read(machine, "INPUTS") >> offset) & 1;
}
static READ8_HANDLER( switches_r )
{
static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 };
- return (readinputportbytag("SWITCHES") >> switch_shuffle[offset]) & 1;
+ return (input_port_read(machine, "SWITCHES") >> switch_shuffle[offset]) & 1;
}
@@ -154,7 +154,7 @@ static UINT8 joystick_read(void)
if (port_tag_to_index("ANALOGX") != -1)
{
int xval = (INT16)(cpunum_get_reg(0, CCPU_X) << 4) >> 4;
- return (readinputportbytag(mux_select ? "ANALOGX" : "ANALOGY") - xval) < 0x800;
+ return (input_port_read(Machine, mux_select ? "ANALOGX" : "ANALOGY") - xval) < 0x800;
}
return 0;
}
@@ -173,7 +173,7 @@ static READ8_HANDLER( speedfrk_wheel_r )
int delta_wheel;
/* the shift register is cleared once per 'frame' */
- delta_wheel = (INT8)readinputportbytag("WHEEL") / 8;
+ delta_wheel = (INT8)input_port_read(machine, "WHEEL") / 8;
if (delta_wheel > 3)
delta_wheel = 3;
else if (delta_wheel < -3)
@@ -186,14 +186,14 @@ static READ8_HANDLER( speedfrk_wheel_r )
static READ8_HANDLER( speedfrk_gear_r )
{
static int gear = 0x0e;
- int gearval = readinputportbytag("GEAR");
+ int gearval = input_port_read(machine, "GEAR");
/* check the fake gear input port and determine the bit settings for the gear */
if ((gearval & 0x0f) != 0x0f)
gear = gearval & 0x0f;
/* add the start key into the mix -- note that it overlaps 4th gear */
- if (!(readinputportbytag("INPUTS") & 0x80))
+ if (!(input_port_read(machine, "INPUTS") & 0x80))
gear &= ~0x08;
return (gear >> offset) & 1;
@@ -239,9 +239,9 @@ static READ8_HANDLER( sundance_inputs_r )
{
/* handle special keys first */
if (sundance_port_map[offset].portname)
- return (readinputportbytag(sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
+ return (input_port_read(machine, sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
else
- return (readinputportbytag("INPUTS") >> offset) & 1;
+ return (input_port_read(machine, "INPUTS") >> offset) & 1;
}
@@ -254,7 +254,7 @@ static READ8_HANDLER( sundance_inputs_r )
static READ8_HANDLER( boxingb_dial_r )
{
- int value = readinputportbytag("DIAL");
+ int value = input_port_read(machine, "DIAL");
if (!mux_select) offset += 4;
return (value >> offset) & 1;
}
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 4d47e5f498a..265b5f6c55a 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -532,7 +532,7 @@ static WRITE16_HANDLER( scudhamm_motor_command_w )
READ16_HANDLER( scudhamm_analog_r )
{
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
/*
@@ -627,17 +627,17 @@ static READ16_HANDLER( armchmp2_analog_r )
int armdelta;
static int armold = 0;
- armdelta = readinputport(1) - armold;
- armold = readinputport(1);
+ armdelta = input_port_read_indexed(machine, 1) - armold;
+ armold = input_port_read_indexed(machine, 1);
return ~( scudhamm_motor_command + armdelta ); // + x : x<=0 and player loses, x>0 and player wins
}
static READ16_HANDLER( armchmp2_buttons_r )
{
- int arm_x = readinputport(1);
+ int arm_x = input_port_read_indexed(machine, 1);
- UINT16 ret = readinputport(0);
+ UINT16 ret = input_port_read_indexed(machine, 0);
if (arm_x < 0x40) ret &= ~1;
else if (arm_x > 0xc0) ret &= ~2;
diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c
index 3aa2811786c..66bd5218ccd 100644
--- a/src/mame/drivers/citycon.c
+++ b/src/mame/drivers/citycon.c
@@ -21,7 +21,7 @@ VIDEO_START( citycon );
static READ8_HANDLER( citycon_in_r )
{
- return readinputport(flip_screen_get() ? 1 : 0);
+ return input_port_read_indexed(machine, flip_screen_get() ? 1 : 0);
}
diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c
index 6d6df472d67..adde9ef21b5 100644
--- a/src/mame/drivers/clayshoo.c
+++ b/src/mame/drivers/clayshoo.c
@@ -39,12 +39,12 @@ static WRITE8_HANDLER( input_port_select_w )
}
-static UINT8 difficulty_input_port_r(int bit)
+static UINT8 difficulty_input_port_r(running_machine *machine, int bit)
{
UINT8 ret = 0;
/* read fake port and remap the buttons to 2 bits */
- UINT8 raw = readinputportbytag("FAKE");
+ UINT8 raw = input_port_read(machine, "FAKE");
if (raw & (1 << (bit + 1)))
ret = 0x03; /* expert */
@@ -63,12 +63,12 @@ static READ8_HANDLER( input_port_r )
switch (input_port_select)
{
- case 0x01: ret = readinputportbytag("IN0"); break;
- case 0x02: ret = readinputportbytag("IN1"); break;
- case 0x04: ret = (readinputportbytag("IN2") & 0xf0) |
- difficulty_input_port_r(0) |
- (difficulty_input_port_r(3) << 2); break;
- case 0x08: ret = readinputportbytag("IN3"); break;
+ case 0x01: ret = input_port_read(machine, "IN0"); break;
+ case 0x02: ret = input_port_read(machine, "IN1"); break;
+ case 0x04: ret = (input_port_read(machine, "IN2") & 0xf0) |
+ difficulty_input_port_r(machine, 0) |
+ (difficulty_input_port_r(machine, 3) << 2); break;
+ case 0x08: ret = input_port_read(machine, "IN3"); break;
case 0x10:
case 0x20: break; /* these two are not really used */
default: logerror("Unexpected port read: %02X\n", input_port_select);
@@ -107,8 +107,8 @@ static WRITE8_HANDLER( analog_reset_w )
analog_port_val = 0xff;
- timer_adjust_oneshot(analog_timer_1, compute_duration(readinputportbytag("AN1")), 0x02);
- timer_adjust_oneshot(analog_timer_2, compute_duration(readinputportbytag("AN2")), 0x01);
+ timer_adjust_oneshot(analog_timer_1, compute_duration(input_port_read(machine, "AN1")), 0x02);
+ timer_adjust_oneshot(analog_timer_2, compute_duration(input_port_read(machine, "AN2")), 0x01);
}
diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c
index ccf8047cda3..99a75d98438 100644
--- a/src/mame/drivers/cliffhgr.c
+++ b/src/mame/drivers/cliffhgr.c
@@ -165,7 +165,7 @@ static READ8_HANDLER( cliff_port_r )
{
if ( port_bank < 7 )
{
- return readinputport( port_bank );
+ return input_port_read_indexed(machine, port_bank );
}
/* output is pulled up for non-mapped ports */
diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c
index 7b56e229d8f..22fc333320b 100644
--- a/src/mame/drivers/cloud9.c
+++ b/src/mame/drivers/cloud9.c
@@ -248,7 +248,7 @@ static WRITE8_HANDLER( cloud9_coin_counter_w )
static READ8_HANDLER( leta_r )
{
- return readinputport(3 + offset);
+ return input_port_read_indexed(machine, 3 + offset);
}
diff --git a/src/mame/drivers/clshroad.c b/src/mame/drivers/clshroad.c
index f42c8404618..6cc29d28f7e 100644
--- a/src/mame/drivers/clshroad.c
+++ b/src/mame/drivers/clshroad.c
@@ -56,10 +56,10 @@ static WRITE8_HANDLER( clshroad_sharedram_w ) { clshroad_sharedram[offset] = dat
static READ8_HANDLER( clshroad_input_r )
{
- return ((~readinputportbytag("IN0") & (1 << offset)) ? 1 : 0) |
- ((~readinputportbytag("IN1") & (1 << offset)) ? 2 : 0) |
- ((~readinputportbytag("DSW1") & (1 << offset)) ? 4 : 0) |
- ((~readinputportbytag("DSW2") & (1 << offset)) ? 8 : 0) ;
+ return ((~input_port_read(machine, "IN0") & (1 << offset)) ? 1 : 0) |
+ ((~input_port_read(machine, "IN1") & (1 << offset)) ? 2 : 0) |
+ ((~input_port_read(machine, "DSW1") & (1 << offset)) ? 4 : 0) |
+ ((~input_port_read(machine, "DSW2") & (1 << offset)) ? 8 : 0) ;
}
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 0ab08732b3c..e782eac0495 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -133,17 +133,17 @@ static WRITE16_HANDLER( cninja_irq_w )
logerror("%08x: Unmapped IRQ write %d %04x\n",activecpu_get_pc(),offset,data);
}
-static READ16_HANDLER( robocop2_dip3_r ) { return readinputport(3); }
+static READ16_HANDLER( robocop2_dip3_r ) { return input_port_read_indexed(machine, 3); }
static READ16_HANDLER( robocop2_prot_r )
{
switch (offset<<1) {
case 0x41a: /* Player 1 & 2 input ports */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x320: /* Coins */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x4e6: /* Dip switches */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset);
return 0x84;
diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c
index e8e341b14e0..f0ed93c4985 100644
--- a/src/mame/drivers/cojag.c
+++ b/src/mame/drivers/cojag.c
@@ -368,7 +368,7 @@ static READ32_HANDLER( jaguar_wave_rom_r )
static READ32_HANDLER( jamma_r )
{
- return readinputport(0) | (readinputport(1) << 16);
+ return input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 1) << 16);
}
@@ -381,7 +381,7 @@ static READ32_HANDLER( status_r )
// D5 = /VOLUMEUP
// D4 = /VOLUMEDOWN
// D3-D0 = ACTC4-1
- return readinputport(2) | (readinputport(2) << 16);
+ return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 2) << 16);
}
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 69037fb95ac..2f88d68b471 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -169,7 +169,7 @@ static READ8_HANDLER( trackball_r )
{
UINT8 curr;
- curr = readinputport(4 + i);
+ curr = input_port_read_indexed(machine, 4 + i);
dir[i] = curr - pos[i];
sign[i] = dir[i] & 0x80;
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 58b430bd4e5..9c19d0f89b6 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -255,20 +255,20 @@ static TIMER_CALLBACK( amerdart_iop_response )
break;
case 0x100:
- iop_answer = (INT8)(-readinputportbytag("YAXIS2") - readinputportbytag("XAXIS2")) << 6;
+ iop_answer = (INT8)(-input_port_read(machine, "YAXIS2") - input_port_read(machine, "XAXIS2")) << 6;
break;
case 0x101:
- iop_answer = (INT8)(-readinputportbytag("YAXIS2") + readinputportbytag("XAXIS2")) << 6;
+ iop_answer = (INT8)(-input_port_read(machine, "YAXIS2") + input_port_read(machine, "XAXIS2")) << 6;
break;
case 0x102:
- iop_answer = (INT8)(-readinputportbytag("YAXIS1") - readinputportbytag("XAXIS1")) << 6;
+ iop_answer = (INT8)(-input_port_read(machine, "YAXIS1") - input_port_read(machine, "XAXIS1")) << 6;
break;
case 0x103:
- iop_answer = (INT8)(-readinputportbytag("YAXIS1") + readinputportbytag("XAXIS1")) << 6;
+ iop_answer = (INT8)(-input_port_read(machine, "YAXIS1") + input_port_read(machine, "XAXIS1")) << 6;
break;
case 0x500:
- iop_answer = readinputport(0);
+ iop_answer = input_port_read_indexed(machine, 0);
break;
}
@@ -420,9 +420,9 @@ static READ16_HANDLER( coolpool_input_r )
static UINT8 oldx, oldy;
static UINT16 lastresult;
- int result = (readinputportbytag("IN1") & 0x00ff) | (lastresult & 0xff00);
- UINT8 newx = readinputportbytag("XAXIS");
- UINT8 newy = readinputportbytag("YAXIS");
+ int result = (input_port_read(machine, "IN1") & 0x00ff) | (lastresult & 0xff00);
+ UINT8 newx = input_port_read(machine, "XAXIS");
+ UINT8 newy = input_port_read(machine, "YAXIS");
int dx = (INT8)(newx - oldx);
int dy = (INT8)(newy - oldy);
diff --git a/src/mame/drivers/cop01.c b/src/mame/drivers/cop01.c
index 5e3646d3dfe..06cfe38ab6f 100644
--- a/src/mame/drivers/cop01.c
+++ b/src/mame/drivers/cop01.c
@@ -101,10 +101,10 @@ static READ8_HANDLER( mightguy_dsw_r )
switch (offset)
{
case 0 :
- data = (readinputportbytag("DSW1") & 0x7f) | ((readinputportbytag("FAKE") & 0x04) << 5);
+ data = (input_port_read(machine, "DSW1") & 0x7f) | ((input_port_read(machine, "FAKE") & 0x04) << 5);
break;
case 1 :
- data = (readinputportbytag("DSW2") & 0x3f) | ((readinputportbytag("FAKE") & 0x03) << 6);
+ data = (input_port_read(machine, "DSW2") & 0x3f) | ((input_port_read(machine, "FAKE") & 0x03) << 6);
break;
}
diff --git a/src/mame/drivers/copsnrob.c b/src/mame/drivers/copsnrob.c
index 4c214f875b7..87435aa15c1 100644
--- a/src/mame/drivers/copsnrob.c
+++ b/src/mame/drivers/copsnrob.c
@@ -82,7 +82,7 @@ static UINT8 misc = 0;
static READ8_HANDLER( copsnrob_misc_r )
{
- return misc | (readinputport(0) & 0x80);
+ return misc | (input_port_read_indexed(machine, 0) & 0x80);
}
static WRITE8_HANDLER( copsnrob_misc_w )
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 343568c0dae..1caa06254ba 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -204,7 +204,7 @@ static INTERRUPT_GEN( cosmica_interrupt )
if (pixel_clock == 0)
{
- if (readinputport(3) & 1) /* Left Coin */
+ if (input_port_read_indexed(machine, 3) & 1) /* Left Coin */
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -218,7 +218,7 @@ static INTERRUPT_GEN( cosmicg_interrupt )
It makes sense and works fine, but I cannot be 100% sure this is correct,
as I have no Cosmic Guerilla console :-) . */
- if ((readinputport(2) & 1)) /* Coin */
+ if ((input_port_read_indexed(machine, 2) & 1)) /* Coin */
/* on tms9980, a 6 on the interrupt bus means level 4 interrupt */
cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 6);
else
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 70b1def8866..598fa0aa479 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -164,31 +164,31 @@ Stephh's log (2006.09.20) :
READ16_HANDLER( cps1_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- int control = readinputportbytag(dswname[offset]);
+ int control = input_port_read(machine, dswname[offset]);
return control << 8 | control;
}
READ16_HANDLER( cps1_in0_r )
{
- int buttons = readinputportbytag("IN0");
+ int buttons = input_port_read(machine, "IN0");
return buttons << 8 | buttons;
}
READ16_HANDLER( cps1_in1_r )
{
- int buttons = readinputportbytag("IN1");
+ int buttons = input_port_read(machine, "IN1");
return buttons;
}
READ16_HANDLER( cps1_in2_r )
{
- int buttons = readinputportbytag("IN2");
+ int buttons = input_port_read(machine, "IN2");
return buttons << 8 | buttons;
}
READ16_HANDLER( cps1_in3_r )
{
- int buttons = readinputportbytag("IN3");
+ int buttons = input_port_read(machine, "IN3");
return buttons << 8 | buttons;
}
@@ -197,22 +197,22 @@ static int dial[2];
static READ16_HANDLER( forgottn_dial_0_r )
{
- return ((readinputportbytag("DIAL0") - dial[0]) >> (8*offset)) & 0xff;
+ return ((input_port_read(machine, "DIAL0") - dial[0]) >> (8*offset)) & 0xff;
}
static READ16_HANDLER( forgottn_dial_1_r )
{
- return ((readinputportbytag("DIAL1") - dial[1]) >> (8*offset)) & 0xff;
+ return ((input_port_read(machine, "DIAL1") - dial[1]) >> (8*offset)) & 0xff;
}
static WRITE16_HANDLER( forgottn_dial_0_reset_w )
{
- dial[0] = readinputportbytag("DIAL0");
+ dial[0] = input_port_read(machine, "DIAL0");
}
static WRITE16_HANDLER( forgottn_dial_1_reset_w )
{
- dial[1] = readinputportbytag("DIAL1");
+ dial[1] = input_port_read(machine, "DIAL1");
}
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index e3a2149ef13..ff963a5c21d 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -848,9 +848,9 @@ static READ16_HANDLER( kludge_r )
static READ16_HANDLER( joy_or_paddle_r )
{
if (readpaddle != 0)
- return (readinputportbytag("IN0"));
+ return (input_port_read(machine, "IN0"));
else
- return (readinputportbytag("PADDLE1") & 0xff) | (readinputportbytag("PADDLE2") << 8);
+ return (input_port_read(machine, "PADDLE1") & 0xff) | (input_port_read(machine, "PADDLE2") << 8);
}
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 2a6a2ad67f3..91c551083b4 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -1782,12 +1782,12 @@ static WRITE32_HANDLER( cram_gfxflash_bank_w )
static READ32_HANDLER( cps3_io1_r )
{
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
static READ32_HANDLER( cps3_io2_r )
{
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
// this seems to be dma active flags, and maybe vblank... not if it is anything else
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index c5937817ac5..b0c5a7adad2 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -75,7 +75,7 @@ static CUSTOM_INPUT( pc3092_r )
/* enable coin & start input? Wild guess!!! */
if (pc3092_data[1] & 0x02)
- ret = readinputportbytag("PC3092");
+ ret = input_port_read(machine, "PC3092");
else
ret = 0x00;
@@ -145,7 +145,7 @@ static READ8_HANDLER( pc3259_r )
if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", safe_activecpu_get_pc(), reg, ret);
- return ret | (readinputportbytag("DSW1") & 0xf0);
+ return ret | (input_port_read(machine, "DSW1") & 0xf0);
}
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index c3ec7e2cd4b..8be7c9859ca 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -81,13 +81,13 @@ static MACHINE_START( crgolf )
static READ8_HANDLER( switch_input_r )
{
- return readinputport(port_select);
+ return input_port_read_indexed(machine, port_select);
}
static READ8_HANDLER( analog_input_r )
{
- return ((readinputport(7) >> 4) | (readinputport(8) & 0xf0)) ^ 0x88;
+ return ((input_port_read_indexed(machine, 7) >> 4) | (input_port_read_indexed(machine, 8) & 0xf0)) ^ 0x88;
}
diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c
index 0433a015b64..e75b9dcd7e2 100644
--- a/src/mame/drivers/crshrace.c
+++ b/src/mame/drivers/crshrace.c
@@ -173,7 +173,7 @@ static WRITE16_HANDLER( sound_command_w )
static READ16_HANDLER( country_sndpending_r )
{
- return readinputport(5) | (pending_command ? 0x8000 : 0);
+ return input_port_read_indexed(machine, 5) | (pending_command ? 0x8000 : 0);
}
static WRITE8_HANDLER( pending_command_clear_w )
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index 931255d23c6..e1e59eee3fb 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -181,18 +181,18 @@ static WRITE32_HANDLER(FlipCount_w)
static READ32_HANDLER(Input_r)
{
if(offset==0)
- return readinputport(0)|(readinputport(1)<<16);
+ return input_port_read_indexed(machine, 0)|(input_port_read_indexed(machine, 1)<<16);
else if(offset==1)
- return readinputport(2)|(readinputport(3)<<16);
+ return input_port_read_indexed(machine, 2)|(input_port_read_indexed(machine, 3)<<16);
else if(offset==2)
{
- UINT8 Port4=readinputport(4);
+ UINT8 Port4=input_port_read_indexed(machine, 4);
if(!(Port4&0x10) && ((OldPort4^Port4)&0x10)) //coin buttons trigger IRQs
IntReq(machine, 12);
if(!(Port4&0x20) && ((OldPort4^Port4)&0x20))
IntReq(machine, 19);
OldPort4=Port4;
- return /*dips*/readinputport(5)|(Port4<<16);
+ return /*dips*/input_port_read_indexed(machine, 5)|(Port4<<16);
}
return 0;
}
diff --git a/src/mame/drivers/csk.c b/src/mame/drivers/csk.c
index 97e233e0f07..f8d3c1ce6d9 100644
--- a/src/mame/drivers/csk.c
+++ b/src/mame/drivers/csk.c
@@ -161,7 +161,7 @@ static WRITE8_HANDLER( custom_io_w )
{
switch (data)
{
- case 0x00: protection_res = readinputport(7); break;
+ case 0x00: protection_res = input_port_read_indexed(machine, 7); break;
case 0x20: protection_res = 0x49; break;
case 0x21: protection_res = 0x47; break;
case 0x22: protection_res = 0x53; break;
diff --git a/src/mame/drivers/cubocd32.c b/src/mame/drivers/cubocd32.c
index 0c97f6ff401..5c4be096eb3 100644
--- a/src/mame/drivers/cubocd32.c
+++ b/src/mame/drivers/cubocd32.c
@@ -45,6 +45,7 @@
*/
#include "driver.h"
+#include "deprecat.h"
#include "memconv.h"
#include "sound/custom.h"
#include "includes/amiga.h"
@@ -106,7 +107,7 @@ static WRITE32_HANDLER( aga_overlay_w )
static UINT8 cd32_cia_0_porta_r(void)
{
- return readinputportbytag("CIA0PORTA");
+ return input_port_read(Machine, "CIA0PORTA");
}
static void cd32_cia_0_porta_w(UINT8 data)
@@ -148,7 +149,7 @@ static void cd32_cia_0_portb_w(UINT8 data)
static READ32_HANDLER( dipswitch_r )
{
- return readinputportbytag("DIPSW1");
+ return input_port_read(machine, "DIPSW1");
}
static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 )
diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c
index 4dbfd1fa992..ed8b44afc67 100644
--- a/src/mame/drivers/cyberbal.c
+++ b/src/mame/drivers/cyberbal.c
@@ -105,7 +105,7 @@ static MACHINE_RESET( cyberb2p )
static READ16_HANDLER( special_port0_r )
{
- int temp = readinputport(0);
+ int temp = input_port_read_indexed(machine, 0);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -113,7 +113,7 @@ static READ16_HANDLER( special_port0_r )
static READ16_HANDLER( special_port2_r )
{
- int temp = readinputport(2);
+ int temp = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) temp ^= 0x2000;
return temp;
}
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index ba03fe69f03..1ee3a3b85b3 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -236,7 +236,7 @@ static READ16_HANDLER( io_r )
switch( offset )
{
case 2/2:
- return ( (readinputportbytag("DSW1") << 8) | readinputportbytag("DSW2") );
+ return ( (input_port_read(machine, "DSW1") << 8) | input_port_read(machine, "DSW2") );
// 0x00110007 is controller device select
// 0x001100D5 is controller data
@@ -245,15 +245,15 @@ static READ16_HANDLER( io_r )
switch( (io_ram[7/2]) & 0xff )
{
case 0:
- io_ram[0xd5/2] = readinputportbytag("TRAVERSE");
+ io_ram[0xd5/2] = input_port_read(machine, "TRAVERSE");
break;
case 0x20:
- io_ram[0xd5/2] = readinputportbytag("ELEVATE");
+ io_ram[0xd5/2] = input_port_read(machine, "ELEVATE");
break;
case 0x40:
- io_ram[0xd5/2] = readinputportbytag("ACCEL");
+ io_ram[0xd5/2] = input_port_read(machine, "ACCEL");
break;
case 0x42:
@@ -265,7 +265,7 @@ static READ16_HANDLER( io_r )
break;
case 0x60:
- io_ram[0xd5/2] = readinputportbytag("HANDLE");
+ io_ram[0xd5/2] = input_port_read(machine, "HANDLE");
break;
default:
@@ -274,13 +274,13 @@ static READ16_HANDLER( io_r )
return 0;
case 6/2:
- return readinputportbytag("IN0"); // high half
+ return input_port_read(machine, "IN0"); // high half
case 9/2:
- return readinputportbytag("IN0"); // low half
+ return input_port_read(machine, "IN0"); // low half
case 0xb/2:
- return readinputportbytag("DSW3");
+ return input_port_read(machine, "DSW3");
case 0xd5/2:
return io_ram[offset]; // controller data
diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c
index 08883426081..2a1cfef4167 100644
--- a/src/mame/drivers/darkhors.c
+++ b/src/mame/drivers/darkhors.c
@@ -234,7 +234,7 @@ static NVRAM_HANDLER( darkhors )
static READ32_HANDLER( darkhors_eeprom_r )
{
// bit 31?
- return readinputport(4) | ((EEPROM_read_bit() & 1) << (7+16));
+ return input_port_read_indexed(machine, 4) | ((EEPROM_read_bit() & 1) << (7+16));
}
static WRITE32_HANDLER( darkhors_eeprom_w )
@@ -302,8 +302,8 @@ static READ32_HANDLER( darkhors_input_sel_r )
int bit_p1 = mask_to_bit((input_sel & 0x00ff0000) >> 16);
int bit_p2 = mask_to_bit((input_sel & 0xff000000) >> 24);
- return (readinputport(5 + bit_p1) & 0x00ffffff) |
- (readinputport(5 + bit_p2) & 0xff000000) ;
+ return (input_port_read_indexed(machine, 5 + bit_p1) & 0x00ffffff) |
+ (input_port_read_indexed(machine, 5 + bit_p2) & 0xff000000) ;
}
static WRITE32_HANDLER( darkhors_unk1_w )
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index 7e405f50e83..f56e2016ccb 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -54,13 +54,13 @@ static READ16_HANDLER( darkseal_control_r )
switch (offset<<1)
{
case 0: /* Dip Switches */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 2: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 4: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
return ~0;
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index de2c9fce469..f7a546c416b 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -138,19 +138,19 @@ static READ16_HANDLER( dassault_control_r )
switch (offset<<1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Player 3 & Player 4 joysticks & fire buttons */
- return (readinputport(6) + (readinputport(7) << 8));
+ return (input_port_read_indexed(machine, 6) + (input_port_read_indexed(machine, 7) << 8));
case 4: /* Dip 1 (stored at 0x3f8035) */
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
case 6: /* Dip 2 (stored at 0x3f8034) */
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
case 8: /* VBL, Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
return 0xffff;
@@ -165,7 +165,7 @@ static WRITE16_HANDLER( dassault_control_w )
static READ16_HANDLER( dassault_sub_control_r )
{
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
}
static WRITE16_HANDLER( dassault_sound_w )
diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c
index f15ba470fc3..22258947037 100644
--- a/src/mame/drivers/dbz.c
+++ b/src/mame/drivers/dbz.c
@@ -115,17 +115,17 @@ static WRITE16_HANDLER( dbzcontrol_w )
static READ16_HANDLER( dbz_inp0_r )
{
- return readinputportbytag("IN0") | (readinputportbytag("IN1")<<8);
+ return input_port_read(machine, "IN0") | (input_port_read(machine, "IN1")<<8);
}
static READ16_HANDLER( dbz_inp1_r )
{
- return readinputportbytag("IN3") | (readinputportbytag("DSW1")<<8);
+ return input_port_read(machine, "IN3") | (input_port_read(machine, "DSW1")<<8);
}
static READ16_HANDLER( dbz_inp2_r )
{
- return readinputportbytag("DSW2") | (readinputportbytag("DSW2")<<8);
+ return input_port_read(machine, "DSW2") | (input_port_read(machine, "DSW2")<<8);
}
static WRITE16_HANDLER( dbz_sound_command_w )
diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c
index 6c97649a3ec..be1c12b0c8f 100644
--- a/src/mame/drivers/dcheese.c
+++ b/src/mame/drivers/dcheese.c
@@ -128,13 +128,13 @@ static MACHINE_START( dcheese )
static READ16_HANDLER( port_0_r )
{
- return (readinputport(0) & 0xff7f) | (EEPROM_read_bit() << 7);
+ return (input_port_read_indexed(machine, 0) & 0xff7f) | (EEPROM_read_bit() << 7);
}
static READ16_HANDLER( port_2_r )
{
- return (readinputport(2) & 0xff1f) | (!soundlatch_full << 7) | (ticket_dispenser_r(machine, 0) >> 2);
+ return (input_port_read_indexed(machine, 2) & 0xff1f) | (!soundlatch_full << 7) | (ticket_dispenser_r(machine, 0) >> 2);
}
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index adafcffedf5..007a9e8ddb8 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -1305,7 +1305,7 @@ VIDEO_UPDATE(ddenlovr)
static READ16_HANDLER( ddenlovr_special_r )
{
- int res = readinputport(2) | (ddenlovr_blitter_irq_flag << 6);
+ int res = input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag << 6);
return res;
}
@@ -1486,9 +1486,9 @@ static READ8_HANDLER( rongrong_input2_r )
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch( ddenlovr_select2 )
{
- case 0x00: return readinputport(0);
- case 0x01: return readinputport(1);
- case 0x02: return readinputport(2);
+ case 0x00: return input_port_read_indexed(machine, 0);
+ case 0x01: return input_port_read_indexed(machine, 1);
+ case 0x02: return input_port_read_indexed(machine, 2);
}
return 0xff;
}
@@ -1496,9 +1496,9 @@ static READ8_HANDLER( rongrong_input2_r )
static READ8_HANDLER( quiz365_input_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(3);
- if (!(ddenlovr_select & 0x02)) return readinputport(4);
- if (!(ddenlovr_select & 0x04)) return readinputport(5);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
+ if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 5);
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine);
if (!(ddenlovr_select & 0x10)) return 0xff;//mame_rand(machine);
return 0xff;
@@ -1510,9 +1510,9 @@ static READ16_HANDLER( quiz365_input2_r )
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch( ddenlovr_select2 )
{
- case 0x10: return readinputport(0);
- case 0x11: return readinputport(1);
- case 0x12: return readinputport(2) | (ddenlovr_blitter_irq_flag << 6);
+ case 0x10: return input_port_read_indexed(machine, 0);
+ case 0x11: return input_port_read_indexed(machine, 1);
+ case 0x12: return input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag << 6);
}
return 0xff;
}
@@ -1615,9 +1615,9 @@ static UINT16 *ddenlvrj_dsw_sel;
static READ16_HANDLER( ddenlvrj_dsw_r )
{
UINT16 dsw = 0;
- if ((~*ddenlvrj_dsw_sel) & 0x01) dsw |= readinputport(3); // dsw 1
- if ((~*ddenlvrj_dsw_sel) & 0x02) dsw |= readinputport(4); // dsw 2
- if ((~*ddenlvrj_dsw_sel) & 0x04) dsw |= readinputport(5); // ?
+ if ((~*ddenlvrj_dsw_sel) & 0x01) dsw |= input_port_read_indexed(machine, 3); // dsw 1
+ if ((~*ddenlvrj_dsw_sel) & 0x02) dsw |= input_port_read_indexed(machine, 4); // dsw 2
+ if ((~*ddenlvrj_dsw_sel) & 0x04) dsw |= input_port_read_indexed(machine, 5); // ?
return dsw;
}
@@ -1633,7 +1633,7 @@ static WRITE16_HANDLER( ddenlvrj_coincounter_w )
static READ16_HANDLER( ddenlvrj_blitter_r )
{
- return readinputport(2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 ); // bit 4 = 1 -> blitter busy
+ return input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 ); // bit 4 = 1 -> blitter busy
}
static ADDRESS_MAP_START( ddenlvrj_readmem, ADDRESS_SPACE_PROGRAM, 16 )
@@ -1718,14 +1718,14 @@ ADDRESS_MAP_END
static READ16_HANDLER( nettoqc_special_r )
{
- return readinputport(2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 );
+ return input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 );
}
static READ16_HANDLER( nettoqc_input_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(3);
- if (!(ddenlovr_select & 0x02)) return readinputport(4);
- if (!(ddenlovr_select & 0x04)) return readinputport(5);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
+ if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 5);
return 0xffff;
}
@@ -1810,11 +1810,11 @@ ADDRESS_MAP_END
static READ8_HANDLER( rongrong_input_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(3);
- if (!(ddenlovr_select & 0x02)) return readinputport(4);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
if (!(ddenlovr_select & 0x04)) return 0xff;//mame_rand(machine);
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine);
- if (!(ddenlovr_select & 0x10)) return readinputport(5);
+ if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 5);
return 0xff;
}
@@ -2131,9 +2131,9 @@ static WRITE8_HANDLER( funkyfig_rombank_w )
static READ8_HANDLER( funkyfig_dsw_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(3);
- if (!(ddenlovr_select & 0x02)) return readinputport(4);
- if (!(ddenlovr_select & 0x04)) return readinputport(5);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
+ if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 5);
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select);
return 0xff;
}
@@ -2144,7 +2144,7 @@ static READ8_HANDLER( funkyfig_coin_r )
{
switch( ddenlovr_select2 )
{
- case 0x22: return readinputport(2);
+ case 0x22: return input_port_read_indexed(machine, 2);
case 0x23: return funkyfig_lockout;
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2);
@@ -2155,8 +2155,8 @@ static READ8_HANDLER( funkyfig_key_r )
{
switch( ddenlovr_select2 )
{
- case 0x20: return readinputport(0);
- case 0x21: return readinputport(1);
+ case 0x20: return input_port_read_indexed(machine, 0);
+ case 0x21: return input_port_read_indexed(machine, 1);
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2);
return 0xff;
@@ -2266,23 +2266,23 @@ static READ8_HANDLER( hanakanz_keyb_r )
{
UINT8 val = 0xff;
- if (!(keyb & 0x01)) val = readinputport(offset * 5 + 1);
- else if (!(keyb & 0x02)) val = readinputport(offset * 5 + 2);
- else if (!(keyb & 0x04)) val = readinputport(offset * 5 + 3);
- else if (!(keyb & 0x08)) val = readinputport(offset * 5 + 4);
- else if (!(keyb & 0x10)) val = readinputport(offset * 5 + 5);
+ if (!(keyb & 0x01)) val = input_port_read_indexed(machine, offset * 5 + 1);
+ else if (!(keyb & 0x02)) val = input_port_read_indexed(machine, offset * 5 + 2);
+ else if (!(keyb & 0x04)) val = input_port_read_indexed(machine, offset * 5 + 3);
+ else if (!(keyb & 0x08)) val = input_port_read_indexed(machine, offset * 5 + 4);
+ else if (!(keyb & 0x10)) val = input_port_read_indexed(machine, offset * 5 + 5);
- val |= readinputport(16 + offset);
+ val |= input_port_read_indexed(machine, 16 + offset);
return val;
}
static READ8_HANDLER( hanakanz_dsw_r )
{
- if (!(dsw & 0x01)) return readinputport(11);
- if (!(dsw & 0x02)) return readinputport(12);
- if (!(dsw & 0x04)) return readinputport(13);
- if (!(dsw & 0x08)) return readinputport(14);
- if (!(dsw & 0x10)) return readinputport(15);
+ if (!(dsw & 0x01)) return input_port_read_indexed(machine, 11);
+ if (!(dsw & 0x02)) return input_port_read_indexed(machine, 12);
+ if (!(dsw & 0x04)) return input_port_read_indexed(machine, 13);
+ if (!(dsw & 0x08)) return input_port_read_indexed(machine, 14);
+ if (!(dsw & 0x10)) return input_port_read_indexed(machine, 15);
return 0xff;
}
@@ -2471,13 +2471,13 @@ static READ8_HANDLER( mjchuuka_keyb_r )
{
UINT8 val = 0xff;
- if (!(keyb & 0x01)) val = readinputport(offset * 5 + 1);
- else if (!(keyb & 0x02)) val = readinputport(offset * 5 + 2);
- else if (!(keyb & 0x04)) val = readinputport(offset * 5 + 3);
- else if (!(keyb & 0x08)) val = readinputport(offset * 5 + 4);
- else if (!(keyb & 0x10)) val = readinputport(offset * 5 + 5);
+ if (!(keyb & 0x01)) val = input_port_read_indexed(machine, offset * 5 + 1);
+ else if (!(keyb & 0x02)) val = input_port_read_indexed(machine, offset * 5 + 2);
+ else if (!(keyb & 0x04)) val = input_port_read_indexed(machine, offset * 5 + 3);
+ else if (!(keyb & 0x08)) val = input_port_read_indexed(machine, offset * 5 + 4);
+ else if (!(keyb & 0x10)) val = input_port_read_indexed(machine, offset * 5 + 5);
- val |= readinputport(16 + offset);
+ val |= input_port_read_indexed(machine, 16 + offset);
if (offset) val |= 0x80; // blitter busy
return val;
}
@@ -2633,7 +2633,7 @@ static READ8_HANDLER( mjmyster_coins_r )
{
switch( ddenlovr_select2 )
{
- case 0x00: return readinputport(0);
+ case 0x00: return input_port_read_indexed(machine, 0);
case 0x01: return 0xff;
case 0x02: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x03: return 0xff;
@@ -2648,11 +2648,11 @@ static READ8_HANDLER( mjmyster_keyb_r )
{
UINT8 ret = 0xff;
- if (keyb & 0x01) ret = readinputport(1);
- else if (keyb & 0x02) ret = readinputport(2);
- else if (keyb & 0x04) ret = readinputport(3);
- else if (keyb & 0x08) ret = readinputport(4);
- else if (keyb & 0x10) ret = readinputport(5);
+ if (keyb & 0x01) ret = input_port_read_indexed(machine, 1);
+ else if (keyb & 0x02) ret = input_port_read_indexed(machine, 2);
+ else if (keyb & 0x04) ret = input_port_read_indexed(machine, 3);
+ else if (keyb & 0x08) ret = input_port_read_indexed(machine, 4);
+ else if (keyb & 0x10) ret = input_port_read_indexed(machine, 5);
else logerror("%06x: warning, unknown bits read, keyb = %02x\n", activecpu_get_pc(), keyb);
keyb <<= 1;
@@ -2662,11 +2662,11 @@ static READ8_HANDLER( mjmyster_keyb_r )
static READ8_HANDLER( mjmyster_dsw_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(9);
- if (!(ddenlovr_select & 0x02)) return readinputport(8);
- if (!(ddenlovr_select & 0x04)) return readinputport(7);
- if (!(ddenlovr_select & 0x08)) return readinputport(6);
- if (!(ddenlovr_select & 0x10)) return readinputport(10);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 9);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 8);
+ if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 7);
+ if (!(ddenlovr_select & 0x08)) return input_port_read_indexed(machine, 6);
+ if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 10);
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select);
return 0xff;
}
@@ -2765,11 +2765,11 @@ ADDRESS_MAP_END
static READ8_HANDLER( hginga_dsw_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(11);
- if (!(ddenlovr_select & 0x02)) return readinputport(12);
- if (!(ddenlovr_select & 0x04)) return readinputport(13);
- if (!(ddenlovr_select & 0x08)) return readinputport(14);
- if (!(ddenlovr_select & 0x10)) return readinputport(15);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 11);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 12);
+ if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 13);
+ if (!(ddenlovr_select & 0x08)) return input_port_read_indexed(machine, 14);
+ if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 15);
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select);
return 0xff;
}
@@ -2786,8 +2786,8 @@ static READ8_HANDLER( hginga_coins_r )
{
switch( hginga_select )
{
- case 0x20: return readinputport(0);
- case 0x21: return readinputport(16);
+ case 0x20: return input_port_read_indexed(machine, 0);
+ case 0x21: return input_port_read_indexed(machine, 16);
case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
case 0x23: return hginga_coins;
}
@@ -2832,11 +2832,11 @@ static READ8_HANDLER( hginga_input_r )
// player 1
case 0xa1:
- return readinputport(1 + hginga_ip++);
+ return input_port_read_indexed(machine, 1 + hginga_ip++);
// player 2
case 0xa2:
- return readinputport(1 + 5 + hginga_ip++);
+ return input_port_read_indexed(machine, 1 + 5 + hginga_ip++);
}
logerror("%04x: input_r with select = %02x\n",activecpu_get_pc(),hginga_select);
return 0xff;
@@ -2914,11 +2914,11 @@ static UINT8 hgokou_player_r(running_machine *machine, int player)
{
UINT8 hopper_bit = ((hgokou_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0 : (1<<6));
- if (!(ddenlovr_select2 & 0x01)) return readinputport(player * 5 + 1) | hopper_bit;
- if (!(ddenlovr_select2 & 0x02)) return readinputport(player * 5 + 2) | hopper_bit;
- if (!(ddenlovr_select2 & 0x04)) return readinputport(player * 5 + 3) | hopper_bit;
- if (!(ddenlovr_select2 & 0x08)) return readinputport(player * 5 + 4) | hopper_bit;
- if (!(ddenlovr_select2 & 0x10)) return readinputport(player * 5 + 5) | hopper_bit;
+ if (!(ddenlovr_select2 & 0x01)) return input_port_read_indexed(machine, player * 5 + 1) | hopper_bit;
+ if (!(ddenlovr_select2 & 0x02)) return input_port_read_indexed(machine, player * 5 + 2) | hopper_bit;
+ if (!(ddenlovr_select2 & 0x04)) return input_port_read_indexed(machine, player * 5 + 3) | hopper_bit;
+ if (!(ddenlovr_select2 & 0x08)) return input_port_read_indexed(machine, player * 5 + 4) | hopper_bit;
+ if (!(ddenlovr_select2 & 0x10)) return input_port_read_indexed(machine, player * 5 + 5) | hopper_bit;
return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
}
@@ -2927,7 +2927,7 @@ static READ8_HANDLER( hgokou_input_r )
{
switch (hginga_select)
{
- case 0x20: return readinputport(0);
+ case 0x20: return input_port_read_indexed(machine, 0);
case 0x21: return hgokou_player_r(machine, 1);
case 0x22: return hgokou_player_r(machine, 0);
case 0x23: return hginga_coins;
@@ -3037,12 +3037,12 @@ static READ8_HANDLER( hparadis_input_r )
{
switch (hginga_select)
{
- case 0x00: return readinputport(0); // P1 (Joy)
- case 0x01: return readinputport(1); // P2 (Joy)
- case 0x02: return readinputport(2); // Coins
+ case 0x00: return input_port_read_indexed(machine, 0); // P1 (Joy)
+ case 0x01: return input_port_read_indexed(machine, 1); // P2 (Joy)
+ case 0x02: return input_port_read_indexed(machine, 2); // Coins
case 0x0d: return 0x00;
- case 0x80: return readinputport(3 + hginga_ip++); // P1 (Keys)
- case 0x81: return readinputport(8 + hginga_ip++); // P2 (Keys)
+ case 0x80: return input_port_read_indexed(machine, 3 + hginga_ip++); // P1 (Keys)
+ case 0x81: return input_port_read_indexed(machine, 8 + hginga_ip++); // P2 (Keys)
}
logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select);
return 0xff;
@@ -3050,11 +3050,11 @@ static READ8_HANDLER( hparadis_input_r )
static READ8_HANDLER( hparadis_dsw_r )
{
- if (!(ddenlovr_select & 0x01)) return readinputport(13);
- if (!(ddenlovr_select & 0x02)) return readinputport(14);
+ if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 13);
+ if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 14);
if (!(ddenlovr_select & 0x04)) return 0xff;
if (!(ddenlovr_select & 0x08)) return 0xff;
- if (!(ddenlovr_select & 0x10)) return readinputport(15);
+ if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 15);
return 0xff;
}
@@ -3118,7 +3118,7 @@ static READ8_HANDLER( mjmywrld_coins_r )
{
switch( ddenlovr_select2 )
{
- case 0x80: return readinputport(0);
+ case 0x80: return input_port_read_indexed(machine, 0);
case 0x81: return 0x00;
case 0x82: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x83: return 0x00;
@@ -3194,8 +3194,8 @@ static UINT16 *akamaru_dsw_sel;
static READ16_HANDLER( akamaru_dsw_r )
{
UINT16 dsw = 0;
- if (akamaru_dsw_sel[1] == 0xff) dsw |= readinputport(3);
- if (akamaru_dsw_sel[0] == 0xff) dsw |= readinputport(4);
+ if (akamaru_dsw_sel[1] == 0xff) dsw |= input_port_read_indexed(machine, 3);
+ if (akamaru_dsw_sel[0] == 0xff) dsw |= input_port_read_indexed(machine, 4);
return dsw;
}
@@ -3280,11 +3280,11 @@ static READ8_HANDLER( mjflove_keyb_r )
{
UINT8 val = 0xff;
- if (!(keyb & 0x01)) val = readinputport(offset * 5 + 1);
- else if (!(keyb & 0x02)) val = readinputport(offset * 5 + 2);
- else if (!(keyb & 0x04)) val = readinputport(offset * 5 + 3);
- else if (!(keyb & 0x08)) val = readinputport(offset * 5 + 4);
- else if (!(keyb & 0x10)) val = readinputport(offset * 5 + 5);
+ if (!(keyb & 0x01)) val = input_port_read_indexed(machine, offset * 5 + 1);
+ else if (!(keyb & 0x02)) val = input_port_read_indexed(machine, offset * 5 + 2);
+ else if (!(keyb & 0x04)) val = input_port_read_indexed(machine, offset * 5 + 3);
+ else if (!(keyb & 0x08)) val = input_port_read_indexed(machine, offset * 5 + 4);
+ else if (!(keyb & 0x10)) val = input_port_read_indexed(machine, offset * 5 + 5);
return val;
}
@@ -3296,7 +3296,7 @@ static READ8_HANDLER( mjflove_blitter_r )
// bit 7 = 1 -> blitter busy
// bit 6 = 0 -> VBLANK?
// bit 5 = 0 -> RTC?
- return readinputport(0) | mjflove_irq_cause;
+ return input_port_read_indexed(machine, 0) | mjflove_irq_cause;
}
static WRITE8_HANDLER( mjflove_blitter_w )
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index 1d083446c63..cd677b4b393 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -53,11 +53,11 @@ extern VIDEO_UPDATE( deadang );
static READ16_HANDLER( ghunter_trackball_low_r )
{
- return (readinputport(3) & 0xff) | ((readinputport(4) & 0xff) << 8);
+ return (input_port_read_indexed(machine, 3) & 0xff) | ((input_port_read_indexed(machine, 4) & 0xff) << 8);
}
static READ16_HANDLER( ghunter_trackball_high_r )
{
- return ((readinputport(3) & 0x0f00) >> 4) | (readinputport(4) & 0x0f00);
+ return ((input_port_read_indexed(machine, 3) & 0x0f00) >> 4) | (input_port_read_indexed(machine, 4) & 0x0f00);
}
/* Memory Maps */
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 2a21885e6af..646aa3877af 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -119,9 +119,9 @@ static READ8_HANDLER( gondo_player_1_r )
{
switch (offset) {
case 0: /* Rotary low byte */
- return ~((1 << (readinputport(5) * 12 / 256))&0xff);
+ return ~((1 << (input_port_read_indexed(machine, 5) * 12 / 256))&0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~((1 << (readinputport(5) * 12 / 256))>>4))&0xf0) | (readinputport(0)&0xf);
+ return ((~((1 << (input_port_read_indexed(machine, 5) * 12 / 256))>>4))&0xf0) | (input_port_read_indexed(machine, 0)&0xf);
}
return 0xff;
}
@@ -130,9 +130,9 @@ static READ8_HANDLER( gondo_player_2_r )
{
switch (offset) {
case 0: /* Rotary low byte */
- return ~((1 << (readinputport(6) * 12 / 256))&0xff);
+ return ~((1 << (input_port_read_indexed(machine, 6) * 12 / 256))&0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~((1 << (readinputport(6) * 12 / 256))>>4))&0xf0) | (readinputport(1)&0xf);
+ return ((~((1 << (input_port_read_indexed(machine, 6) * 12 / 256))>>4))&0xf0) | (input_port_read_indexed(machine, 1)&0xf);
}
return 0xff;
}
@@ -178,8 +178,8 @@ static WRITE8_HANDLER( srdarwin_i8751_w )
if (i8751_value==0x5000) i8751_return=((coins / 10) << 4) | (coins % 10); /* Coin request */
if (i8751_value==0x6000) {i8751_value=-1; coins--; } /* Coin clear */
/* Nb: Command 0x4000 for setting coinage options is not supported */
- if ((readinputport(4)&1)==1) latch=1;
- if ((readinputport(4)&1)!=1 && latch) {coins++; latch=0;}
+ if ((input_port_read_indexed(machine, 4)&1)==1) latch=1;
+ if ((input_port_read_indexed(machine, 4)&1)!=1 && latch) {coins++; latch=0;}
/* This next value is the index to a series of tables,
each table controls the end of level bad guy, wrong values crash the
@@ -246,9 +246,9 @@ static WRITE8_HANDLER( gondo_i8751_w )
}
/* Coins are controlled by the i8751 */
- if ((readinputport(4)&3)==3) latch=1;
- if ((readinputport(4)&1)!=1 && latch) {coin1++; snd=1; latch=0;}
- if ((readinputport(4)&2)!=2 && latch) {coin2++; snd=1; latch=0;}
+ if ((input_port_read_indexed(machine, 4)&3)==3) latch=1;
+ if ((input_port_read_indexed(machine, 4)&1)!=1 && latch) {coin1++; snd=1; latch=0;}
+ if ((input_port_read_indexed(machine, 4)&2)!=2 && latch) {coin2++; snd=1; latch=0;}
/* Work out return values */
if (i8751_value==0x0000) {i8751_return=0; coin1=coin2=snd=0;}
@@ -279,9 +279,9 @@ static WRITE8_HANDLER( shackled_i8751_w )
}
/* Coins are controlled by the i8751 */
- if (/*(readinputport(2)&3)==3*/!latch) {latch=1;coin1=coin2=0;}
- if ((readinputport(2)&1)!=1 && latch) {coin1=1; latch=0;}
- if ((readinputport(2)&2)!=2 && latch) {coin2=1; latch=0;}
+ if (/*(input_port_read_indexed(machine, 2)&3)==3*/!latch) {latch=1;coin1=coin2=0;}
+ if ((input_port_read_indexed(machine, 2)&1)!=1 && latch) {coin1=1; latch=0;}
+ if ((input_port_read_indexed(machine, 2)&2)!=2 && latch) {coin2=1; latch=0;}
if (i8751_value==0x0050) i8751_return=0; /* Breywood ID */
if (i8751_value==0x0051) i8751_return=0; /* Shackled ID */
@@ -309,8 +309,8 @@ static WRITE8_HANDLER( lastmiss_i8751_w )
if(offset==0)
{
/* Coins are controlled by the i8751 */
- if ((readinputport(2)&3)==3 && !latch) latch=1;
- if ((readinputport(2)&3)!=3 && latch) {coin++; latch=0;snd=0x400;i8751_return=0x400;return;}
+ if ((input_port_read_indexed(machine, 2)&3)==3 && !latch) latch=1;
+ if ((input_port_read_indexed(machine, 2)&3)!=3 && latch) {coin++; latch=0;snd=0x400;i8751_return=0x400;return;}
if (i8751_value==0x007a) i8751_return=0x0185; /* Japan ID code */
if (i8751_value==0x007b) i8751_return=0x0184; /* USA ID code */
if (i8751_value==0x0001) {coin=snd=0;}//???
@@ -340,8 +340,8 @@ static WRITE8_HANDLER( csilver_i8751_w )
if(offset==0)
{
/* Coins are controlled by the i8751 */
- if ((readinputport(2)&3)==3 && !latch) latch=1;
- if ((readinputport(2)&3)!=3 && latch) {coin++; latch=0;snd=0x1200; i8751_return=0x1200;return;}
+ if ((input_port_read_indexed(machine, 2)&3)==3 && !latch) latch=1;
+ if ((input_port_read_indexed(machine, 2)&3)!=3 && latch) {coin++; latch=0;snd=0x1200; i8751_return=0x1200;return;}
if (i8751_value==0x054a) {i8751_return=~(0x4a); coin=0; snd=0;} /* Captain Silver (Japan) ID */
if (i8751_value==0x054c) {i8751_return=~(0x4c); coin=0; snd=0;} /* Captain Silver (World) ID */
@@ -366,9 +366,9 @@ static WRITE8_HANDLER( garyoret_i8751_w )
}
/* Coins are controlled by the i8751 */
- if ((readinputport(2)&3)==3) latch=1;
- if ((readinputport(2)&1)!=1 && latch) {coin1++; latch=0;}
- if ((readinputport(2)&2)!=2 && latch) {coin2++; latch=0;}
+ if ((input_port_read_indexed(machine, 2)&3)==3) latch=1;
+ if ((input_port_read_indexed(machine, 2)&1)!=1 && latch) {coin1++; latch=0;}
+ if ((input_port_read_indexed(machine, 2)&2)!=2 && latch) {coin2++; latch=0;}
/* Work out return values */
if ((i8751_value>>8)==0x00) {i8751_return=0; coin1=coin2=0;}
@@ -2046,7 +2046,7 @@ static const struct MSM5205interface msm5205_interface =
static INTERRUPT_GEN( ghostb_interrupt )
{
static int latch[4];
- int i8751_out=readinputport(4);
+ int i8751_out=input_port_read_indexed(machine, 4);
/* Ghostbusters coins are controlled by the i8751 */
if ((i8751_out & 0x8) == 0x8) latch[0]=1;
@@ -2073,8 +2073,8 @@ static INTERRUPT_GEN( oscar_interrupt )
{
static int latch=1;
- if ((readinputport(2) & 0x7) == 0x7) latch=1;
- if (latch && (readinputport(2) & 0x7) != 0x7) {
+ if ((input_port_read_indexed(machine, 2) & 0x7) == 0x7) latch=1;
+ if (latch && (input_port_read_indexed(machine, 2) & 0x7) != 0x7) {
latch=0;
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index e7349ab524b..5f97319c8f3 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -153,7 +153,7 @@ static VIDEO_UPDATE( wcvol95 )
static READ32_HANDLER(hvysmsh_eeprom_r)
{
- return (EEPROM_read_bit()<<24) | readinputport(0) | (readinputport(1)<<16);
+ return (EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 1)<<16);
}
static WRITE32_HANDLER(hvysmsh_eeprom_w)
@@ -196,7 +196,7 @@ static WRITE32_HANDLER(hvysmsh_oki_1_w)
static READ32_HANDLER(wcvol95_eeprom_r)
{
- return (EEPROM_read_bit()<<24) | readinputport(0) | ((readinputport(1)&0xff)<<16);
+ return (EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 0) | ((input_port_read_indexed(machine, 1)&0xff)<<16);
}
static WRITE32_HANDLER(wcvol95_eeprom_w)
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 42c669aa13d..854477576cd 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -331,9 +331,9 @@ static READ32_HANDLER( captaven_prot_r )
{
/* Protection/IO chip 75, same as Lemmings & Robocop 2 */
switch (offset<<2) {
- case 0x0a0: return readinputport(0); /* Player 1 & 2 controls */
- case 0x158: return readinputport(1); /* Player 3 & 4 controls */
- case 0xed4: return readinputport(2); /* Misc */
+ case 0x0a0: return input_port_read_indexed(machine, 0); /* Player 1 & 2 controls */
+ case 0x158: return input_port_read_indexed(machine, 1); /* Player 3 & 4 controls */
+ case 0xed4: return input_port_read_indexed(machine, 2); /* Misc */
}
logerror("%08x: Unmapped protection read %04x\n",activecpu_get_pc(),offset<<2);
@@ -343,14 +343,14 @@ static READ32_HANDLER( captaven_prot_r )
static READ32_HANDLER( captaven_soundcpu_r )
{
/* Top byte - top bit low == sound cpu busy, bottom word is dips */
- return 0xffff0000 | readinputport(3);
+ return 0xffff0000 | input_port_read_indexed(machine, 3);
}
static READ32_HANDLER( fghthist_control_r )
{
switch (offset) {
- case 0: return 0xffff0000 | readinputport(0);
- case 1: return 0xffff0000 | readinputport(1); //check top bits??
+ case 0: return 0xffff0000 | input_port_read_indexed(machine, 0);
+ case 1: return 0xffff0000 | input_port_read_indexed(machine, 1); //check top bits??
case 2: return 0xfffffffe | EEPROM_read_bit();
}
@@ -375,7 +375,7 @@ static WRITE32_HANDLER( fghthist_eeprom_w )
static READ32_HANDLER( dragngun_service_r )
{
// logerror("%08x:Read service\n",activecpu_get_pc());
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
static READ32_HANDLER( lockload_gun_mirror_r )
@@ -383,8 +383,8 @@ static READ32_HANDLER( lockload_gun_mirror_r )
//logerror("%08x:Read gun %d\n",activecpu_get_pc(),offset);
//return ((mame_rand(Machine)%0xffff)<<16) | mame_rand(Machine)%0xffff;
if (offset) /* Mirror of player 1 and player 2 fire buttons */
- return readinputport(5) | ((mame_rand(Machine)%0xff)<<16);
- return readinputport(4) | readinputport(6) | (readinputport(6)<<16) | (readinputport(6)<<24); //((mame_rand(Machine)%0xff)<<16);
+ return input_port_read_indexed(machine, 5) | ((mame_rand(Machine)%0xff)<<16);
+ return input_port_read_indexed(machine, 4) | input_port_read_indexed(machine, 6) | (input_port_read_indexed(machine, 6)<<16) | (input_port_read_indexed(machine, 6)<<24); //((mame_rand(Machine)%0xff)<<16);
}
static READ32_HANDLER( dragngun_prot_r )
@@ -398,9 +398,9 @@ static READ32_HANDLER( dragngun_prot_r )
//definitely vblank in locked load
switch (offset<<1) {
- case 0x140/2: return 0xffff0000 | readinputport(0); /* IN0 */
- case 0xadc/2: return 0xffff0000 | readinputport(1) | strobe; /* IN1 */
- case 0x6a0/2: return 0xffff0000 | readinputport(2); /* IN2 (Dip switch) */
+ case 0x140/2: return 0xffff0000 | input_port_read_indexed(machine, 0); /* IN0 */
+ case 0xadc/2: return 0xffff0000 | input_port_read_indexed(machine, 1) | strobe; /* IN1 */
+ case 0x6a0/2: return 0xffff0000 | input_port_read_indexed(machine, 2); /* IN2 (Dip switch) */
}
return 0xffffffff;
}
@@ -411,10 +411,10 @@ static READ32_HANDLER( dragngun_lightgun_r )
{
/* Ports 0-3 are read, but seem unused */
switch (dragngun_lightgun_port) {
- case 4: return readinputport(4); break;
- case 5: return readinputport(5); break;
- case 6: return readinputport(6); break;
- case 7: return readinputport(7); break;
+ case 4: return input_port_read_indexed(machine, 4); break;
+ case 5: return input_port_read_indexed(machine, 5); break;
+ case 6: return input_port_read_indexed(machine, 6); break;
+ case 7: return input_port_read_indexed(machine, 7); break;
}
// logerror("Illegal lightgun port %d read \n",dragngun_lightgun_port);
@@ -460,8 +460,8 @@ static int tattass_eprom_bit;
static READ32_HANDLER( tattass_prot_r )
{
switch (offset<<1) {
- case 0x280: return readinputport(0) << 16; /* IN0 */
- case 0x4c4: return readinputport(1) << 16; /* IN1 */
+ case 0x280: return input_port_read_indexed(machine, 0) << 16; /* IN0 */
+ case 0x4c4: return input_port_read_indexed(machine, 1) << 16; /* IN1 */
case 0x35a: return tattass_eprom_bit << 16;
}
@@ -623,8 +623,8 @@ static READ32_HANDLER( nslasher_prot_r )
{
switch (offset<<1) {
- case 0x280: return readinputport(0) << 16| 0xffff; /* IN0 */
- case 0x4c4: return readinputport(1) << 16| 0xffff; /* IN1 */
+ case 0x280: return input_port_read_indexed(machine, 0) << 16| 0xffff; /* IN0 */
+ case 0x4c4: return input_port_read_indexed(machine, 1) << 16| 0xffff; /* IN1 */
case 0x35a: return (EEPROM_read_bit()<< 16) | 0xffff; // Debug switch in low word??
}
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index ed0dfd82351..0d1fc4d1fde 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -118,13 +118,13 @@ static int mlc_raster_table[9][256];
static READ32_HANDLER( avengrs_control_r )
{
- return (readinputport(1)<<16) | (EEPROM_read_bit()<<23) | readinputport(0);
+ return (input_port_read_indexed(machine, 1)<<16) | (EEPROM_read_bit()<<23) | input_port_read_indexed(machine, 0);
}
static READ32_HANDLER(test2_r)
{
// if (offset==0)
-// return readinputport(0); //0xffffffff;
+// return input_port_read_indexed(machine, 0); //0xffffffff;
// logerror("%08x: Test2_r %d\n",activecpu_get_pc(),offset);
return mame_rand(Machine); //0xffffffff;
}
diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c
index c42c2692ff4..30bbdbc18ec 100644
--- a/src/mame/drivers/destroyr.c
+++ b/src/mame/drivers/destroyr.c
@@ -50,7 +50,7 @@ static TIMER_CALLBACK( destroyr_frame_callback )
/* PCB supports two dials, but cab has only got one */
- timer_set(video_screen_get_time_until_pos(machine->primary_screen, readinputport(3), 0), NULL, 0, destroyr_dial_callback);
+ timer_set(video_screen_get_time_until_pos(machine->primary_screen, input_port_read_indexed(machine, 3), 0), NULL, 0, destroyr_dial_callback);
timer_set(video_screen_get_time_until_pos(machine->primary_screen, 0, 0), NULL, 0, destroyr_frame_callback);
}
@@ -137,7 +137,7 @@ static READ8_HANDLER( destroyr_input_r )
if (offset == 0)
{
- UINT8 ret = readinputport(0);
+ UINT8 ret = input_port_read_indexed(machine, 0);
if (destroyr_potsense[0] && destroyr_potmask[0])
ret |= 4;
@@ -149,7 +149,7 @@ static READ8_HANDLER( destroyr_input_r )
if (offset == 1)
{
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
logerror("unmapped input port %d\n", offset);
diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c
index 022dd404e29..53e2c8bfc1a 100644
--- a/src/mame/drivers/djboy.c
+++ b/src/mame/drivers/djboy.c
@@ -225,9 +225,9 @@ ProtectionOut( int i, UINT8 data )
} /* ProtectionOut */
static int
-GetLives( void )
+GetLives( running_machine *machine )
{
- int dsw = readinputport(4);
+ int dsw = input_port_read_indexed(machine, 4);
switch( dsw&0x30 )
{
case 0x10: return 3;
@@ -240,7 +240,7 @@ GetLives( void )
static WRITE8_HANDLER( coinplus_w )
{
- int dsw = readinputport(3);
+ int dsw = input_port_read_indexed(machine, 3);
coin_counter_w( 0, data&1 );
coin_counter_w( 1, data&2 );
if( data&1 )
@@ -268,9 +268,9 @@ static WRITE8_HANDLER( coinplus_w )
} /* coinplus_w */
static void
-OutputProtectionState( int i, int type )
+OutputProtectionState( running_machine *machine, int i, int type )
{
- int io = ~readinputport(0);
+ int io = ~input_port_read_indexed(machine, 0);
int dat = 0x00;
switch( mDjBoyState )
@@ -337,7 +337,7 @@ OutputProtectionState( int i, int type )
{ /* p1 start */
dat = 0x16;
mDjBoyState = eDJBOY_ACTIVE_GAMEPLAY;
- lives[0] = GetLives();
+ lives[0] = GetLives(machine);
logerror( "P1 START!\n" );
coin-=4;
}
@@ -345,8 +345,8 @@ OutputProtectionState( int i, int type )
{ /* p2 start */
dat = 0x0a;
mDjBoyState = eDJBOY_ACTIVE_GAMEPLAY;
- lives[0] = GetLives();
- lives[1] = GetLives();
+ lives[0] = GetLives(machine);
+ lives[1] = GetLives(machine);
logerror( "P2 START!\n" );
coin-=8;
}
@@ -364,7 +364,7 @@ OutputProtectionState( int i, int type )
if( (io&1) && lives[0]==0 )
{
dat = 0x12; /* continue (P1) */
- lives[0] = GetLives();
+ lives[0] = GetLives(machine);
mDjBoyState = eDJBOY_ACTIVE_GAMEPLAY;
coin-=4;
logerror( "P1 CONTINUE!\n" );
@@ -372,7 +372,7 @@ OutputProtectionState( int i, int type )
else if( (io&2) && lives[1]==0 )
{
dat = 0x08; /* continue (P2) */
- lives[1] = GetLives();
+ lives[1] = GetLives(machine);
mDjBoyState = eDJBOY_ACTIVE_GAMEPLAY;
coin-=4;
logerror( "P2 CONTINUE!\n" );
@@ -385,7 +385,7 @@ OutputProtectionState( int i, int type )
} /* OutputProtectionState */
static void
-CommonProt( int i, int type )
+CommonProt( running_machine *machine, int i, int type )
{
int displayedCredits = coin/4;
if( displayedCredits>9 )
@@ -393,8 +393,8 @@ CommonProt( int i, int type )
displayedCredits = 9;
}
ProtectionOut( i++, displayedCredits );
- ProtectionOut( i++, readinputport(0) ); /* COIN/START */
- OutputProtectionState( i, type );
+ ProtectionOut( i++, input_port_read_indexed(machine, 0) ); /* COIN/START */
+ OutputProtectionState( machine, i, type );
} /* CommonProt */
static WRITE8_HANDLER( beast_data_w )
@@ -408,7 +408,7 @@ static WRITE8_HANDLER( beast_data_w )
if( prot_mode == ePROT_WAIT_DSW1_WRITEBACK )
{
logerror( "[DSW1_WRITEBACK]\n" );
- ProtectionOut( 0, readinputport(4) ); /* DSW2 */
+ ProtectionOut( 0, input_port_read_indexed(machine, 4) ); /* DSW2 */
prot_mode = ePROT_WAIT_DSW2_WRITEBACK;
}
else if( prot_mode == ePROT_WAIT_DSW2_WRITEBACK )
@@ -454,11 +454,11 @@ static WRITE8_HANDLER( beast_data_w )
break;
case 0x01: // pc=7389
- OutputProtectionState( 0, 0x01 );
+ OutputProtectionState( machine, 0, 0x01 );
break;
case 0x02:
- CommonProt( 0,0x02 );
+ CommonProt( machine,0,0x02 );
break;
case 0x03: /* prepare for memory write to protection device ram (pc == 0x7987) */ // -> 0x02
@@ -472,48 +472,48 @@ static WRITE8_HANDLER( beast_data_w )
ProtectionOut( 1,0 ); // ?
ProtectionOut( 2,0 ); // ?
ProtectionOut( 3,0 ); // ?
- CommonProt( 4,0x04 );
+ CommonProt( machine, 4,0x04 );
break;
case 0x05: /* 0x71f4 */
- ProtectionOut( 0,readinputport(1) ); // to $42
+ ProtectionOut( 0,input_port_read_indexed(machine, 1) ); // to $42
ProtectionOut( 1,0 ); // ?
- ProtectionOut( 2,readinputport(2) ); // to $43
+ ProtectionOut( 2,input_port_read_indexed(machine, 2) ); // to $43
ProtectionOut( 3,0 ); // ?
ProtectionOut( 4,0 ); // ?
- CommonProt( 5,0x05 );
+ CommonProt( machine, 5,0x05 );
break;
case 0x07:
- CommonProt( 0,0x07 );
+ CommonProt( machine, 0,0x07 );
break;
case 0x08: /* pc == 0x727a */
- ProtectionOut( 0,readinputport(0) ); /* COIN/START */
- ProtectionOut( 1,readinputport(1) ); /* JOY1 */
- ProtectionOut( 2,readinputport(2) ); /* JOY2 */
- ProtectionOut( 3,readinputport(3) ); /* DSW1 */
- ProtectionOut( 4,readinputport(4) ); /* DSW2 */
- CommonProt( 5, 0x08 );
+ ProtectionOut( 0,input_port_read_indexed(machine, 0) ); /* COIN/START */
+ ProtectionOut( 1,input_port_read_indexed(machine, 1) ); /* JOY1 */
+ ProtectionOut( 2,input_port_read_indexed(machine, 2) ); /* JOY2 */
+ ProtectionOut( 3,input_port_read_indexed(machine, 3) ); /* DSW1 */
+ ProtectionOut( 4,input_port_read_indexed(machine, 4) ); /* DSW2 */
+ CommonProt( machine, 5, 0x08 );
break;
case 0x09:
ProtectionOut( 0,0 ); // ?
ProtectionOut( 1,0 ); // ?
ProtectionOut( 2,0 ); // ?
- CommonProt( 3, 0x09 );
+ CommonProt( machine, 3, 0x09 );
break;
case 0x0a:
- CommonProt( 0,0x0a );
+ CommonProt( machine,0,0x0a );
break;
case 0x0c:
- CommonProt( 1,0x0c );
+ CommonProt( machine,1,0x0c );
break;
case 0x0d:
- CommonProt( 2,0x0d );
+ CommonProt( machine,2,0x0d );
break;
case 0xfe: /* prepare for memory read from protection device ram (pc == 0x79ee, 0x7a3f) */
@@ -531,7 +531,7 @@ static WRITE8_HANDLER( beast_data_w )
break;
case 0xff: /* read DSW (pc == 0x714d) */
- ProtectionOut( 0,readinputport(3) ); /* DSW1 */
+ ProtectionOut( 0,input_port_read_indexed(machine, 3) ); /* DSW1 */
prot_mode = ePROT_WAIT_DSW1_WRITEBACK;
break;
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index 2713b1dc489..e7a63e634b6 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -257,14 +257,14 @@ static READ32_HANDLER( v_rom_r )
static READ32_HANDLER( inp1_r )
{
- UINT32 result = (readinputport(5)<<24) | (readinputport(2)<<16) | (readinputport(1)<<8) | readinputport(0);
+ UINT32 result = (input_port_read_indexed(machine, 5)<<24) | (input_port_read_indexed(machine, 2)<<16) | (input_port_read_indexed(machine, 1)<<8) | input_port_read_indexed(machine, 0);
return result;
}
static READ32_HANDLER( inp2_r )
{
- return (readinputport(3)<<24) | (readinputport(4)<<16) | 0xffff;
+ return (input_port_read_indexed(machine, 3)<<24) | (input_port_read_indexed(machine, 4)<<16) | 0xffff;
}
static READ32_HANDLER( turntable_r )
@@ -276,7 +276,7 @@ static READ32_HANDLER( turntable_r )
UINT8 pos;
int delta;
- pos = readinputport(6 + turntable_select);
+ pos = input_port_read_indexed(machine, 6 + turntable_select);
delta = pos - turntable_last_pos[turntable_select];
if (delta < -128)
delta += 256;
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index e407baeee9f..d7a99e08f22 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -593,19 +593,19 @@ static READ8_HANDLER( dkong_in2_r )
#if DEBUG_DISC_SOUND
static UINT8 ui_snd = 0;
static UINT8 lst = 0;
- if (!lst && (readinputportbytag("TST") & 0x01))
+ if (!lst && (input_port_read(machine, "TST") & 0x01))
{
ui_snd = (ui_snd + 1) % 10;
popmessage("Sound %d", ui_snd);
}
- lst = readinputportbytag("TST") & 0x01;
+ lst = input_port_read(machine, "TST") & 0x01;
if (ui_snd<8)
- dkongjr_snd_w1(ui_snd, (readinputportbytag("TST") & 0x02)>>1);
+ dkongjr_snd_w1(ui_snd, (input_port_read(machine, "TST") & 0x02)>>1);
else
- dkongjr_snd_w2(ui_snd-8, (readinputportbytag("TST") & 0x02)>>1);
+ dkongjr_snd_w2(ui_snd-8, (input_port_read(machine, "TST") & 0x02)>>1);
#endif
- r = (readinputportbytag("IN2") & 0xBF) | (dkong_audio_status_r(machine,0) << 6);
+ r = (input_port_read(machine, "IN2") & 0xBF) | (dkong_audio_status_r(machine,0) << 6);
coin_counter_w(offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coint */
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index aefd8ef6988..74aec641e66 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -295,7 +295,7 @@ static MACHINE_RESET( dlair )
if (laserdisc_type & LASERDISC_TYPE_VARIABLE)
{
laserdisc_type &= ~LASERDISC_TYPE_MASK;
- laserdisc_type |= (readinputportbytag("DSW2") & 0x08) ? LASERDISC_TYPE_LDV1000 : LASERDISC_TYPE_PR7820;
+ laserdisc_type |= (input_port_read(machine, "DSW2") & 0x08) ? LASERDISC_TYPE_LDV1000 : LASERDISC_TYPE_PR7820;
}
laserdisc_reset(discinfo, laserdisc_type & LASERDISC_TYPE_MASK);
}
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index ee89b3cc816..38e95238f26 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -20,7 +20,7 @@ static TIMER_CALLBACK( dragrace_frame_callback )
for (i = 0; i < 2; i++)
{
- switch (readinputport(5 + i))
+ switch (input_port_read_indexed(machine, 5 + i))
{
case 0x01: dragrace_gear[i] = 1; break;
case 0x02: dragrace_gear[i] = 2; break;
@@ -31,7 +31,7 @@ static TIMER_CALLBACK( dragrace_frame_callback )
}
/* watchdog is disabled during service mode */
- watchdog_enable(machine, readinputport(0) & 0x20);
+ watchdog_enable(machine, input_port_read_indexed(machine, 0) & 0x20);
}
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( dragrace_misc_clear_w )
static READ8_HANDLER( dragrace_input_r )
{
- int val = readinputport(2);
+ int val = input_port_read_indexed(machine, 2);
UINT8 maskA = 1 << (offset % 8);
UINT8 maskB = 1 << (offset / 8);
@@ -125,7 +125,7 @@ static READ8_HANDLER( dragrace_input_r )
for (i = 0; i < 2; i++)
{
- int in = readinputport(i);
+ int in = input_port_read_indexed(machine, i);
if (dragrace_gear[i] != 0)
{
@@ -151,7 +151,7 @@ static READ8_HANDLER( dragrace_steering_r )
for (i = 0; i < 2; i++)
{
- int dial = readinputport(3 + i);
+ int dial = input_port_read_indexed(machine, 3 + i);
bitA[i] = ((dial + 1) / 2) & 1;
bitB[i] = ((dial + 0) / 2) & 1;
diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c
index 9a6036ad17f..4f0febfb862 100644
--- a/src/mame/drivers/dreamwld.c
+++ b/src/mame/drivers/dreamwld.c
@@ -193,13 +193,13 @@ static READ32_HANDLER( dreamwld_protdata_r )
static READ32_HANDLER( dreamwld_inputs_r )
{
- return readinputport(1)|(readinputport(0)<<16);
+ return input_port_read_indexed(machine, 1)|(input_port_read_indexed(machine, 0)<<16);
}
static READ32_HANDLER( dreamwld_dips_r )
{
int x;
- x= readinputport(2);
+ x= input_port_read_indexed(machine, 2);
return x|(x<<16);
}
diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c
index 2974a7f101a..5a350580daf 100644
--- a/src/mame/drivers/dribling.c
+++ b/src/mame/drivers/dribling.c
@@ -78,11 +78,11 @@ static READ8_HANDLER( input_mux0_r )
{
/* low value in the given bit selects */
if (!(input_mux & 0x01))
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
else if (!(input_mux & 0x02))
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
else if (!(input_mux & 0x04))
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
return 0xff;
}
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index 7f78f04124d..5b0118ebb14 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -345,7 +345,7 @@ static UINT8 dunhuang_hopper;
static WRITE8_HANDLER( dunhuang_input_w ) { dunhuang_input = data; }
static READ8_HANDLER( dunhuang_service_r )
{
- return readinputport(5)
+ return input_port_read_indexed(machine, 5)
| ((dunhuang_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0x00 : 0x08) // bit 3: hopper sensor
| 0x80 // bit 7 low -> tiles block transferrer busy
;
@@ -353,21 +353,21 @@ static READ8_HANDLER( dunhuang_service_r )
static READ8_HANDLER( dunhuang_dsw_r )
{
- if (!(dunhuang_input & 0x01)) return readinputport(0);
- if (!(dunhuang_input & 0x02)) return readinputport(1);
- if (!(dunhuang_input & 0x04)) return readinputport(2);
- if (!(dunhuang_input & 0x08)) return readinputport(3);
- if (!(dunhuang_input & 0x10)) return readinputport(4);
+ if (!(dunhuang_input & 0x01)) return input_port_read_indexed(machine, 0);
+ if (!(dunhuang_input & 0x02)) return input_port_read_indexed(machine, 1);
+ if (!(dunhuang_input & 0x04)) return input_port_read_indexed(machine, 2);
+ if (!(dunhuang_input & 0x08)) return input_port_read_indexed(machine, 3);
+ if (!(dunhuang_input & 0x10)) return input_port_read_indexed(machine, 4);
logerror("%06x: warning, unknown dsw bits read, dunhuang_input = %02x\n", activecpu_get_pc(), dunhuang_input);
return 0xff;
}
static READ8_HANDLER( dunhuang_input_r )
{
- if (!(dunhuang_input & 0x01)) return readinputport(6);
- if (!(dunhuang_input & 0x02)) return readinputport(7);
- if (!(dunhuang_input & 0x04)) return readinputport(8);
- if (!(dunhuang_input & 0x08)) return readinputport(9);
- if (!(dunhuang_input & 0x10)) return readinputport(10);
+ if (!(dunhuang_input & 0x01)) return input_port_read_indexed(machine, 6);
+ if (!(dunhuang_input & 0x02)) return input_port_read_indexed(machine, 7);
+ if (!(dunhuang_input & 0x04)) return input_port_read_indexed(machine, 8);
+ if (!(dunhuang_input & 0x08)) return input_port_read_indexed(machine, 9);
+ if (!(dunhuang_input & 0x10)) return input_port_read_indexed(machine, 10);
logerror("%06x: warning, unknown input bits read, dunhuang_input = %02x\n", activecpu_get_pc(), dunhuang_input);
return 0xff;
}
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index 759d3711b87..b56d4d03c0d 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -237,11 +237,11 @@ static READ8_HANDLER( hanamai_keyboard_0_r )
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (~keyb & 0x01) res &= readinputport(3);
- if (~keyb & 0x02) res &= readinputport(4);
- if (~keyb & 0x04) res &= readinputport(5);
- if (~keyb & 0x08) res &= readinputport(6);
- if (~keyb & 0x10) res &= readinputport(7);
+ if (~keyb & 0x01) res &= input_port_read_indexed(machine, 3);
+ if (~keyb & 0x02) res &= input_port_read_indexed(machine, 4);
+ if (~keyb & 0x04) res &= input_port_read_indexed(machine, 5);
+ if (~keyb & 0x08) res &= input_port_read_indexed(machine, 6);
+ if (~keyb & 0x10) res &= input_port_read_indexed(machine, 7);
return res;
}
@@ -251,11 +251,11 @@ static READ8_HANDLER( hanamai_keyboard_1_r )
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (~keyb & 0x01) res &= readinputport(8);
- if (~keyb & 0x02) res &= readinputport(9);
- if (~keyb & 0x04) res &= readinputport(10);
- if (~keyb & 0x08) res &= readinputport(11);
- if (~keyb & 0x10) res &= readinputport(12);
+ if (~keyb & 0x01) res &= input_port_read_indexed(machine, 8);
+ if (~keyb & 0x02) res &= input_port_read_indexed(machine, 9);
+ if (~keyb & 0x04) res &= input_port_read_indexed(machine, 10);
+ if (~keyb & 0x08) res &= input_port_read_indexed(machine, 11);
+ if (~keyb & 0x10) res &= input_port_read_indexed(machine, 12);
return res;
}
@@ -614,7 +614,7 @@ static READ8_HANDLER( yarunara_input_r )
switch( yarunara_select )
{
case 0x00:
- return readinputportbytag("IN2"); // coins
+ return input_port_read(machine, "IN2"); // coins
case 0x02:
return 0xff; // bit 7 must be 1. Bit 2?
@@ -631,12 +631,12 @@ static READ8_HANDLER( yarunara_input_r )
// player 2
case 0x01: //quiztvqq
case 0x81:
- return readinputport(3 + 5 + yarunara_ip++);
+ return input_port_read_indexed(machine, 3 + 5 + yarunara_ip++);
// player 1
case 0x02: //quiztvqq
case 0x82:
- return readinputport(3 + yarunara_ip++);
+ return input_port_read_indexed(machine, 3 + yarunara_ip++);
default:
return 0xff;
@@ -954,14 +954,14 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjelctrn_keyboard_1_r )
{
- return (hanamai_keyboard_1_r(machine,0) & 0x3f) | (readinputport(15) ? 0x40 : 0);
+ return (hanamai_keyboard_1_r(machine,0) & 0x3f) | (input_port_read_indexed(machine, 15) ? 0x40 : 0);
}
static READ8_HANDLER( mjelctrn_dsw_r )
{
int dsw = (keyb & 0xc0) >> 6;
if (dsw >= 2) dsw = dsw - 2 + 13; // 0-3 -> IN0,IN1,IN13,IN14
- return readinputport(dsw);
+ return input_port_read_indexed(machine, dsw);
}
static WRITE8_HANDLER( mjelctrn_blitter_ack_w )
@@ -1027,11 +1027,11 @@ static WRITE8_HANDLER( htengoku_dsw_w )
static READ8_HANDLER( htengoku_dsw_r )
{
- if (!(htengoku_dsw & 0x01)) return readinputport(11);
- if (!(htengoku_dsw & 0x02)) return readinputport(12);
- if (!(htengoku_dsw & 0x04)) return readinputport(13);
- if (!(htengoku_dsw & 0x08)) return readinputport(14);
- if (!(htengoku_dsw & 0x10)) return readinputport(15);
+ if (!(htengoku_dsw & 0x01)) return input_port_read_indexed(machine, 11);
+ if (!(htengoku_dsw & 0x02)) return input_port_read_indexed(machine, 12);
+ if (!(htengoku_dsw & 0x04)) return input_port_read_indexed(machine, 13);
+ if (!(htengoku_dsw & 0x08)) return input_port_read_indexed(machine, 14);
+ if (!(htengoku_dsw & 0x10)) return input_port_read_indexed(machine, 15);
logerror("%06x: warning, unknown bits read, htengoku_dsw = %02x\n", activecpu_get_pc(), htengoku_dsw);
return 0xff;
@@ -1064,8 +1064,8 @@ static READ8_HANDLER( htengoku_input_r )
{
switch( htengoku_select )
{
- case 0x81: return readinputport(1 + 5 + htengoku_ip++);
- case 0x82: return readinputport(1 + htengoku_ip++);
+ case 0x81: return input_port_read_indexed(machine, 1 + 5 + htengoku_ip++);
+ case 0x82: return input_port_read_indexed(machine, 1 + htengoku_ip++);
case 0x0d: return 0xff; // unused
}
logerror("%04x: input_r with select = %02x\n",activecpu_get_pc(),htengoku_select);
@@ -1076,7 +1076,7 @@ static READ8_HANDLER( htengoku_coin_r )
{
switch( htengoku_select )
{
- case 0x00: return readinputport(0);
+ case 0x00: return input_port_read_indexed(machine, 0);
case 0x01: return 0xff; //?
case 0x02: return 0xbf | ((htengoku_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0 : (1<<6));; // bit 7 = blitter busy, bit 6 = hopper
case 0x03: return htengoku_coins;
@@ -1196,7 +1196,7 @@ static READ8_HANDLER( tenkai_ip_r )
switch( tenkai_ipsel )
{
case 0x00:
- return readinputport(5); // coins
+ return input_port_read_indexed(machine, 5); // coins
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n",activecpu_get_pc(),tenkai_ipsel,offset);
@@ -1215,13 +1215,13 @@ static READ8_HANDLER( tenkai_ip_r )
case 0x81:
if (tenkai_ip >= 5)
logerror("%04x: unmapped tenkai_ip=%02x read\n",activecpu_get_pc(),tenkai_ip);
- return 0xff;//readinputport(6 + 5 + tenkai_ip++);
+ return 0xff;//input_port_read_indexed(machine, 6 + 5 + tenkai_ip++);
// player 1
case 0x82:
if (tenkai_ip >= 5)
logerror("%04x: unmapped tenkai_ip=%02x read\n",activecpu_get_pc(),tenkai_ip);
- return readinputport(6 + tenkai_ip++);
+ return input_port_read_indexed(machine, 6 + tenkai_ip++);
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n",activecpu_get_pc(),tenkai_ipsel,offset);
@@ -1239,11 +1239,11 @@ static WRITE8_HANDLER( tenkai_dswsel_w )
}
static READ8_HANDLER( tenkai_dsw_r )
{
- if (~tenkai_dswsel & 0x01) return readinputport(0);
- if (~tenkai_dswsel & 0x02) return readinputport(1);
- if (~tenkai_dswsel & 0x04) return readinputport(2);
- if (~tenkai_dswsel & 0x08) return readinputport(3);
- if (~tenkai_dswsel & 0x10) return readinputport(4);
+ if (~tenkai_dswsel & 0x01) return input_port_read_indexed(machine, 0);
+ if (~tenkai_dswsel & 0x02) return input_port_read_indexed(machine, 1);
+ if (~tenkai_dswsel & 0x04) return input_port_read_indexed(machine, 2);
+ if (~tenkai_dswsel & 0x08) return input_port_read_indexed(machine, 3);
+ if (~tenkai_dswsel & 0x10) return input_port_read_indexed(machine, 4);
logerror("%04x: unmapped dsw %02x read\n",activecpu_get_pc(),tenkai_dswsel);
return 0xff;
}
diff --git a/src/mame/drivers/embargo.c b/src/mame/drivers/embargo.c
index b0a30c3dcbd..496ca577406 100644
--- a/src/mame/drivers/embargo.c
+++ b/src/mame/drivers/embargo.c
@@ -58,7 +58,7 @@ static VIDEO_UPDATE( embargo )
static READ8_HANDLER( input_port_bit_r )
{
- return (readinputport(1) << (7 - input_select)) & 0x80;
+ return (input_port_read_indexed(machine, 1) << (7 - input_select)) & 0x80;
}
@@ -82,14 +82,14 @@ static READ8_HANDLER( dial_r )
if (dial_enable_1 && !dial_enable_2)
{
- lo = readinputport(3);
- hi = readinputport(4);
+ lo = input_port_read_indexed(machine, 3);
+ hi = input_port_read_indexed(machine, 4);
}
if (dial_enable_2 && !dial_enable_1)
{
- lo = readinputport(5);
- hi = readinputport(6);
+ lo = input_port_read_indexed(machine, 5);
+ hi = input_port_read_indexed(machine, 6);
}
lo = 12 * lo / 256;
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 1b09bad6672..d59970f50aa 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -323,7 +323,7 @@ if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, activec
if (protection_data != 0xff)
ret = protection_data ^ 0x88;
else
- ret = readinputport(2);
+ ret = input_port_read_indexed(machine, 2);
break;
case 0x02:
@@ -369,22 +369,22 @@ if (LOG_PROT) logerror("Protection Data Write: %x at %x\n", data, safe_activecpu
static WRITE8_HANDLER( enigma2_flip_screen_w )
{
- engima2_flip_screen = ((data >> 5) & 0x01) && ((readinputport(2) & 0x20) == 0x20);
+ engima2_flip_screen = ((data >> 5) & 0x01) && ((input_port_read_indexed(machine, 2) & 0x20) == 0x20);
}
static CUSTOM_INPUT( p1_controls_r )
{
- return readinputportbytag("P1CONTROLS");
+ return input_port_read(machine, "P1CONTROLS");
}
static CUSTOM_INPUT( p2_controls_r )
{
if (engima2_flip_screen)
- return readinputportbytag("P2CONTROLS");
+ return input_port_read(machine, "P2CONTROLS");
else
- return readinputportbytag("P1CONTROLS");
+ return input_port_read(machine, "P1CONTROLS");
}
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 345913bd682..2eedd792e7e 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -104,7 +104,7 @@ static READ32_HANDLER( eolith_custom_r )
*/
eolith_speedup_read();
- return (readinputport(0) & ~0x308) | (EEPROM_read_bit() << 3) | (mame_rand(Machine) & 0x300);
+ return (input_port_read_indexed(machine, 0) & ~0x308) | (EEPROM_read_bit() << 3) | (mame_rand(Machine) & 0x300);
}
static WRITE32_HANDLER( systemcontrol_w )
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 2e587db4e23..6548e073749 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -45,7 +45,7 @@ static WRITE16_HANDLER( eeprom_w )
static READ16_HANDLER( eolith16_custom_r )
{
eolith_speedup_read();
- return (readinputport(0) & ~0x10) | (EEPROM_read_bit() << 4);
+ return (input_port_read_indexed(machine, 0) & ~0x10) | (EEPROM_read_bit() << 4);
}
diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c
index 04b341f2aaa..eb6d7b6619d 100644
--- a/src/mame/drivers/eprom.c
+++ b/src/mame/drivers/eprom.c
@@ -90,7 +90,7 @@ static MACHINE_RESET( eprom )
static READ16_HANDLER( special_port1_r )
{
- int result = readinputport(1);
+ int result = input_port_read_indexed(machine, 1);
if (atarigen_sound_to_cpu_ready) result ^= 0x0004;
if (atarigen_cpu_to_sound_ready) result ^= 0x0008;
@@ -103,7 +103,7 @@ static READ16_HANDLER( special_port1_r )
static READ16_HANDLER( adc_r )
{
static int last_offset;
- int result = readinputport(2 + (last_offset & 3));
+ int result = input_port_read_indexed(machine, 2 + (last_offset & 3));
last_offset = offset;
return result;
}
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 85314600891..3b1af337123 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -412,7 +412,7 @@ static float cymvol,hihatvol;
static TIMER_CALLBACK( equites_frq_adjuster_callback )
{
- UINT8 frq = readinputportbytag(FRQ_ADJUSTER_TAG);
+ UINT8 frq = input_port_read(machine, FRQ_ADJUSTER_TAG);
msm5232_set_clock(sndti_token(SOUND_MSM5232, 0), MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
//popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", eq8155_port_c,eq8155_port_a,ay_port_a,ay_port_b,eq_cymbal_ctrl&15);
@@ -643,7 +643,7 @@ static WRITE8_HANDLER(equites_8155_w)
#if HVOLTAGE_DEBUG
static READ16_HANDLER(hvoltage_debug_r)
{
- return(readinputport(2));
+ return(input_port_read_indexed(machine, 2));
}
#endif
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index 324135d8b9a..1ca1912f312 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -220,7 +220,7 @@ static const struct AY8910interface ay8912_interface_3 =
static INTERRUPT_GEN( ettrivia_interrupt )
{
- if( readinputport(2) & 0x01 )
+ if( input_port_read_indexed(machine, 2) & 0x01 )
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
else
cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index 68a8ff510d9..62ee3a6f5e7 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -145,7 +145,7 @@ static UINT8 last_dial;
static CUSTOM_INPUT( teetert_input_direction_r )
{
int result = 0;
- UINT8 dial = readinputportbytag("DIAL");
+ UINT8 dial = input_port_read(machine, "DIAL");
if (dial != last_dial)
{
@@ -164,7 +164,7 @@ static CUSTOM_INPUT( teetert_input_direction_r )
static CUSTOM_INPUT( teetert_input_movement_r )
{
- UINT8 dial = readinputportbytag("DIAL");
+ UINT8 dial = input_port_read(machine, "DIAL");
return (dial != last_dial) ? 1 : 0;
}
diff --git a/src/mame/drivers/exidy440.c b/src/mame/drivers/exidy440.c
index 5c96134fb61..61a91a00031 100644
--- a/src/mame/drivers/exidy440.c
+++ b/src/mame/drivers/exidy440.c
@@ -290,7 +290,7 @@ static CUSTOM_INPUT( firq_vblank_r )
static CUSTOM_INPUT( hitnmiss_button1_r )
{
/* button 1 shows up in two bits */
- UINT32 button1 = readinputportbytag("HITNMISS_BUTTON1");
+ UINT32 button1 = input_port_read(machine, "HITNMISS_BUTTON1");
return (button1 << 1) | button1;
}
@@ -343,7 +343,7 @@ static READ8_HANDLER( exidy440_input_port_3_r )
{
/* I/O1 accesses clear the CIRQ flip/flop */
cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c
index 8c52c75f1c4..99d6f3f9103 100644
--- a/src/mame/drivers/exprraid.c
+++ b/src/mame/drivers/exprraid.c
@@ -105,7 +105,7 @@ static WRITE8_HANDLER( sound_cpu_command_w )
static READ8_HANDLER( vblank_r )
{
- return readinputport( 0 );
+ return input_port_read_indexed(machine, 0 );
}
static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 )
@@ -288,7 +288,7 @@ static INTERRUPT_GEN( exprraid_interrupt )
{
static int coin = 0;
- if ( ( ~readinputport( 3 ) ) & 0xc0 ) {
+ if ( ( ~input_port_read_indexed(machine, 3 ) ) & 0xc0 ) {
if ( coin == 0 ) {
coin = 1;
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index eeb03cd5624..d7c5da04125 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -140,7 +140,7 @@ static UINT16 exterm_trackball_port_r(running_machine *machine, int which, UINT1
UINT16 port;
/* Read the fake input port */
- UINT8 trackball_pos = readinputport(3 + which);
+ UINT8 trackball_pos = input_port_read_indexed(machine, 3 + which);
/* Calculate the change from the last position. */
UINT8 trackball_diff = trackball_old[which] - trackball_pos;
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index 734530ff39a..8b2d4c60be8 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -179,20 +179,20 @@ static READ8_HANDLER( borntofi_inputs_r )
static int old_x[2], old_y[2], old_f[2];
static UINT8 ret[2];
- switch (readinputport(7) & 0x03)
+ switch (input_port_read_indexed(machine, 7) & 0x03)
{
case 3:
- case 1: return readinputport(0 + offset); // Lightgun buttons
- case 2: return readinputport(4 + offset); // Joystick
+ case 1: return input_port_read_indexed(machine, 0 + offset); // Lightgun buttons
+ case 2: return input_port_read_indexed(machine, 4 + offset); // Joystick
}
// Trackball
- x = readinputport(13 + offset * 2);
- y = readinputport(12 + offset * 2);
+ x = input_port_read_indexed(machine, 13 + offset * 2);
+ y = input_port_read_indexed(machine, 12 + offset * 2);
f = video_screen_get_frame_number(machine->primary_screen);
- ret[offset] = (ret[offset] & 0x14) | (readinputport(2 + offset) & 0xc3);
+ ret[offset] = (ret[offset] & 0x14) | (input_port_read_indexed(machine, 2 + offset) & 0xc3);
x = (x & 0x7f) - (x & 0x80);
y = (y & 0x7f) - (y & 0x80);
@@ -696,7 +696,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( wheelrun_wheel_r )
{
int player = (FPTR)param;
- int delta = readinputport(4 + player);
+ int delta = input_port_read_indexed(machine, 4 + player);
delta = (delta & 0x7f) - (delta & 0x80) + 4;
if (delta > 7) delta = 7;
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index a05670fed5c..d4c757c1066 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -82,7 +82,7 @@ static PALETTE_INIT( fgoal )
static TIMER_CALLBACK( interrupt_callback )
{
int scanline;
- int coin = (readinputport(1) & 2);
+ int coin = (input_port_read_indexed(machine, 1) & 2);
cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
@@ -114,16 +114,16 @@ static unsigned video_ram_address(void)
static READ8_HANDLER( fgoal_analog_r )
{
- return readinputport(2 + fgoal_player); /* PCB can be jumpered to use a single dial */
+ return input_port_read_indexed(machine, 2 + fgoal_player); /* PCB can be jumpered to use a single dial */
}
static READ8_HANDLER( fgoal_switches_r )
{
if (video_screen_get_vpos(machine->primary_screen) & 0x80)
- return readinputport(1) | 0x80;
+ return input_port_read_indexed(machine, 1) | 0x80;
else
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
diff --git a/src/mame/drivers/filetto.c b/src/mame/drivers/filetto.c
index 46aeee10951..b4d7d8ed304 100644
--- a/src/mame/drivers/filetto.c
+++ b/src/mame/drivers/filetto.c
@@ -301,7 +301,7 @@ static READ8_HANDLER( disk_iobank_r )
{
printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,activecpu_get_pc());
if(offset == 1)
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
return disk_data[offset];
}
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 1cd38720027..1ba9b143b93 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -674,15 +674,15 @@ static READ32_HANDLER(input_r)
if (ACCESSING_BITS_24_31)
{
- r |= (readinputport(0) & 0xff) << 24;
+ r |= (input_port_read_indexed(machine, 0) & 0xff) << 24;
}
if (ACCESSING_BITS_8_15)
{
- r |= (readinputport(1) & 0xff) << 8;
+ r |= (input_port_read_indexed(machine, 1) & 0xff) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= (readinputport(2) & 0xff);
+ r |= (input_port_read_indexed(machine, 2) & 0xff);
}
return r;
@@ -692,11 +692,11 @@ static READ32_HANDLER( sensor_r )
{
if (offset == 0)
{
- return readinputport(3) | 0x01000100;
+ return input_port_read_indexed(machine, 3) | 0x01000100;
}
else
{
- return readinputport(4) | 0x01000100;
+ return input_port_read_indexed(machine, 4) | 0x01000100;
}
}
@@ -1383,11 +1383,11 @@ static READ32_HANDLER( keyboard_wheel_r )
{
if (offset == 0) // Keyboard Wheel (P1)
{
- return readinputport(3) << 24;
+ return input_port_read_indexed(machine, 3) << 24;
}
else if (offset == 2) // Keyboard Wheel (P2)
{
- return readinputport(4) << 24;
+ return input_port_read_indexed(machine, 4) << 24;
}
return 0;
@@ -1471,7 +1471,7 @@ static TIMER_CALLBACK( keyboard_timer_callback )
for (keyboard=0; keyboard < 2; keyboard++)
{
- UINT32 kbstate = readinputport(5 + keyboard);
+ UINT32 kbstate = input_port_read_indexed(machine, 5 + keyboard);
int uart_channel = kb_uart_channel[keyboard];
if (kbstate != keyboard_state[keyboard])
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index eb801190803..52dddef5dac 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -101,7 +101,7 @@ static READ8_HANDLER( firetrap_8751_bootleg_r )
/* Check for coin insertion */
/* the following only works in the bootleg version, which doesn't have an */
/* 8751 - the real thing is much more complicated than that. */
- if ((readinputport(2) & 0x70) != 0x70) return 0xff;
+ if ((input_port_read_indexed(machine, 2) & 0x70) != 0x70) return 0xff;
return 0;
}
@@ -545,11 +545,11 @@ static INTERRUPT_GEN( firetrap )
/* Check for coin IRQ */
if (cpu_getiloops()) {
- if ((readinputport(5) & 0x7) != 0x7 && !latch) {
- coin_command_pending=~readinputport(5);
+ if ((input_port_read_indexed(machine, 5) & 0x7) != 0x7 && !latch) {
+ coin_command_pending=~input_port_read_indexed(machine, 5);
latch=1;
}
- if ((readinputport(5) & 0x7) == 0x7)
+ if ((input_port_read_indexed(machine, 5) & 0x7) == 0x7)
latch=0;
/* Make sure coin IRQ's aren't generated when another command is pending, the main cpu
diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c
index 29dcc3bcdc5..9f8e6035d9a 100644
--- a/src/mame/drivers/firetrk.c
+++ b/src/mame/drivers/firetrk.c
@@ -169,8 +169,8 @@ static MACHINE_RESET( firetrk )
static READ8_HANDLER( firetrk_dip_r )
{
- UINT8 val0 = readinputportbytag("DIP_0");
- UINT8 val1 = readinputportbytag("DIP_1");
+ UINT8 val0 = input_port_read(machine, "DIP_0");
+ UINT8 val1 = input_port_read(machine, "DIP_1");
if (val1 & (1 << (2 * offset + 0))) val0 |= 1;
if (val1 & (1 << (2 * offset + 1))) val0 |= 2;
@@ -181,8 +181,8 @@ static READ8_HANDLER( firetrk_dip_r )
static READ8_HANDLER( montecar_dip_r )
{
- UINT8 val0 = readinputportbytag("DIP_0");
- UINT8 val1 = readinputportbytag("DIP_1");
+ UINT8 val0 = input_port_read(machine, "DIP_0");
+ UINT8 val1 = input_port_read(machine, "DIP_1");
if (val1 & (1 << (3 - offset))) val0 |= 1;
if (val1 & (1 << (7 - offset))) val0 |= 2;
@@ -244,7 +244,7 @@ static READ8_HANDLER( firetrk_input_r )
/* update steering wheels */
for (i = 0; i < 2; i++)
{
- UINT32 new_dial = readinputportbytag_safe((i ? "STEER_2" : "STEER_1"), 0);
+ UINT32 new_dial = input_port_read_safe(machine, (i ? "STEER_2" : "STEER_1"), 0);
INT32 delta = new_dial - dial[i];
if (delta != 0)
@@ -256,9 +256,9 @@ static READ8_HANDLER( firetrk_input_r )
}
}
- return ((readinputportbytag_safe("BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
- ((readinputportbytag_safe("BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
- ((readinputportbytag_safe("BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
+ return ((input_port_read_safe(machine, "BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
+ ((input_port_read_safe(machine, "BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
+ ((input_port_read_safe(machine, "BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
}
diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c
index 2cbd86b8376..5666aa797a1 100644
--- a/src/mame/drivers/flkatck.c
+++ b/src/mame/drivers/flkatck.c
@@ -63,13 +63,13 @@ static READ8_HANDLER( flkatck_ls138_r )
switch ((offset & 0x1c) >> 2){
case 0x00: /* inputs + DIPSW #3 + coinsw */
if (offset & 0x02)
- data = readinputport(2 + (offset & 0x01));
+ data = input_port_read_indexed(machine, 2 + (offset & 0x01));
else
- data = readinputport(4 + (offset & 0x01));
+ data = input_port_read_indexed(machine, 4 + (offset & 0x01));
break;
case 0x01: /* DIPSW #1 & DIPSW #2 */
if (offset & 0x02)
- data = readinputport(1 - (offset & 0x01));
+ data = input_port_read_indexed(machine, 1 - (offset & 0x01));
break;
}
diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c
index 6b67ec5ddb7..780176ff200 100644
--- a/src/mame/drivers/flstory.c
+++ b/src/mame/drivers/flstory.c
@@ -163,7 +163,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( victnine_port_5_r )
{
- return (victnine_mcu_status_r(machine,0) & 3) | (readinputport(5) & ~3);
+ return (victnine_mcu_status_r(machine,0) & 3) | (input_port_read_indexed(machine, 5) & ~3);
}
static ADDRESS_MAP_START( victnine_map, ADDRESS_SPACE_PROGRAM, 8 )
diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c
index 3f3ef6fcf52..6abdbed6922 100644
--- a/src/mame/drivers/flyball.c
+++ b/src/mame/drivers/flyball.c
@@ -41,10 +41,10 @@ static TIMER_CALLBACK( flyball_quarter_callback )
memset(potsense, 0, sizeof potsense);
- potsense[readinputport(1)] |= 1;
- potsense[readinputport(2)] |= 2;
- potsense[readinputport(3)] |= 4;
- potsense[readinputport(4)] |= 8;
+ potsense[input_port_read_indexed(machine, 1)] |= 1;
+ potsense[input_port_read_indexed(machine, 2)] |= 2;
+ potsense[input_port_read_indexed(machine, 3)] |= 4;
+ potsense[input_port_read_indexed(machine, 4)] |= 8;
for (i = 0; i < 64; i++)
if (potsense[i] != 0)
@@ -79,7 +79,7 @@ static MACHINE_RESET( flyball )
static READ8_HANDLER( flyball_input_r )
{
- return readinputport(0) & readinputport(5);
+ return input_port_read_indexed(machine, 0) & input_port_read_indexed(machine, 5);
}
static READ8_HANDLER( flyball_scanline_r )
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index cf9328aa028..6402fe64e03 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -202,7 +202,7 @@ static WRITE16_HANDLER( digital_w )
static READ16_HANDLER( analog_r )
{
- return readinputport(whichport);
+ return input_port_read_indexed(machine, whichport);
}
@@ -353,7 +353,7 @@ GFXDECODE_END
static READ8_HANDLER( pot_r )
{
- return (readinputport(5) >> offset) << 7;
+ return (input_port_read_indexed(machine, 5) >> offset) << 7;
}
static const struct POKEYinterface pokey_interface =
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 37e4676a568..49dca792931 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -93,12 +93,12 @@ static WRITE8_HANDLER( spinner_select_w )
static READ8_HANDLER( spinner_r )
{
- return readinputport(5 + spinner);
+ return input_port_read_indexed(machine, 5 + spinner);
}
static READ8_HANDLER( gigas_spinner_r )
{
- return readinputport( spinner );
+ return input_port_read_indexed(machine, spinner );
}
static MACHINE_RESET( pbillrd )
diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c
index 9c6346e9ffe..5f59c856b9b 100644
--- a/src/mame/drivers/fromanc2.c
+++ b/src/mame/drivers/fromanc2.c
@@ -156,10 +156,10 @@ static READ16_HANDLER( fromanc2_keymatrix_r )
UINT16 ret;
switch (fromanc2_portselect) {
- case 0x01: ret = readinputportbytag("IN1"); break;
- case 0x02: ret = readinputportbytag("IN2"); break;
- case 0x04: ret = readinputportbytag("IN3"); break;
- case 0x08: ret = readinputportbytag("IN4"); break;
+ case 0x01: ret = input_port_read(machine, "IN1"); break;
+ case 0x02: ret = input_port_read(machine, "IN2"); break;
+ case 0x04: ret = input_port_read(machine, "IN3"); break;
+ case 0x08: ret = input_port_read(machine, "IN4"); break;
default: ret = 0xffff;
logerror("PC:%08X unknown %02X\n", activecpu_get_pc(), fromanc2_portselect);
break;
@@ -176,7 +176,7 @@ static READ16_HANDLER( fromanc2_input_r )
((fromanc2_subcpu_nmi_flag & 1) << 6) |
((fromanc2_sndcpu_nmi_flag & 1) << 5));
eeprom = (EEPROM_read_bit() & 1) << 7; // EEPROM DATA
- coinsw = readinputport(0) & 0x030f; // COIN, TEST
+ coinsw = input_port_read_indexed(machine, 0) & 0x030f; // COIN, TEST
return (cflag | eeprom | coinsw);
}
@@ -187,7 +187,7 @@ static READ16_HANDLER( fromanc4_input_r )
cflag = (fromanc2_sndcpu_nmi_flag & 1) << 5;
eeprom = (EEPROM_read_bit() & 1) << 7; // EEPROM DATA
- coinsw = readinputport(0) & 0x001f; // COIN, TEST
+ coinsw = input_port_read_indexed(machine, 0) & 0x001f; // COIN, TEST
return (cflag | eeprom | coinsw);
}
diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c
index 88d131f57fc..09582e34a59 100644
--- a/src/mame/drivers/fromance.c
+++ b/src/mame/drivers/fromance.c
@@ -203,15 +203,15 @@ static READ8_HANDLER( fromance_keymatrix_r )
int ret = 0xff;
if (fromance_portselect & 0x01)
- ret &= readinputport(4);
+ ret &= input_port_read_indexed(machine, 4);
if (fromance_portselect & 0x02)
- ret &= readinputport(5);
+ ret &= input_port_read_indexed(machine, 5);
if (fromance_portselect & 0x04)
- ret &= readinputport(6);
+ ret &= input_port_read_indexed(machine, 6);
if (fromance_portselect & 0x08)
- ret &= readinputport(7);
+ ret &= input_port_read_indexed(machine, 7);
if (fromance_portselect & 0x10)
- ret &= readinputport(8);
+ ret &= input_port_read_indexed(machine, 8);
return ret;
}
diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c
index 08c771e6c90..c5a13486c0a 100644
--- a/src/mame/drivers/fuukifg3.c
+++ b/src/mame/drivers/fuukifg3.c
@@ -224,7 +224,7 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
\
static READ32_HANDLER( io32_##_N_##_r ) \
{ \
- return (readinputport( _N_ ) << 16) | readinputport( _N_ ); \
+ return (input_port_read_indexed(machine, _N_ ) << 16) | input_port_read_indexed(machine, _N_ ); \
}
FUUKI32_INPUT( 0 ) /* $800000.l Coins Inputs */
diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c
index ef84387f368..8c295d891d5 100644
--- a/src/mame/drivers/gaelco2.c
+++ b/src/mame/drivers/gaelco2.c
@@ -269,10 +269,10 @@ static INTERRUPT_GEN( bang_interrupt )
}
}
-static READ16_HANDLER(p1_gun_x) {return (readinputport(3)*320/0x100)+1;}
-static READ16_HANDLER(p1_gun_y) {return (readinputport(5)*240/0x100)-4;}
-static READ16_HANDLER(p2_gun_x) {return (readinputport(4)*320/0x100)+1;}
-static READ16_HANDLER(p2_gun_y) {return (readinputport(6)*240/0x100)-4;}
+static READ16_HANDLER(p1_gun_x) {return (input_port_read_indexed(machine, 3)*320/0x100)+1;}
+static READ16_HANDLER(p1_gun_y) {return (input_port_read_indexed(machine, 5)*240/0x100)-4;}
+static READ16_HANDLER(p2_gun_x) {return (input_port_read_indexed(machine, 4)*320/0x100)+1;}
+static READ16_HANDLER(p2_gun_y) {return (input_port_read_indexed(machine, 6)*240/0x100)-4;}
static ADDRESS_MAP_START( bang_readmem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) /* ROM */
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index 1eb724b99fc..46d063e5163 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -354,10 +354,10 @@ static WRITE16_HANDLER( sound_status_w )
*
*************************************/
-static READ32_HANDLER( input_port_0_020_r ) { return readinputport(0) << 16; }
-static READ32_HANDLER( input_port_1_020_r ) { return readinputport(1) << 16; }
-static READ32_HANDLER( input_port_2_020_r ) { return readinputport(2) << 16; }
-static READ32_HANDLER( input_port_3_020_r ) { return readinputport(3) << 16; }
+static READ32_HANDLER( input_port_0_020_r ) { return input_port_read_indexed(machine, 0) << 16; }
+static READ32_HANDLER( input_port_1_020_r ) { return input_port_read_indexed(machine, 1) << 16; }
+static READ32_HANDLER( input_port_2_020_r ) { return input_port_read_indexed(machine, 2) << 16; }
+static READ32_HANDLER( input_port_3_020_r ) { return input_port_read_indexed(machine, 3) << 16; }
static CUSTOM_INPUT( analog_bit_r )
@@ -393,10 +393,10 @@ static WRITE16_HANDLER( analog_port_latch_w )
{
if (!(data & 0xff))
{
- analog_ports[0] = readinputportbytag_safe("ANALOG0", 0);
- analog_ports[1] = readinputportbytag_safe("ANALOG1", 0);
- analog_ports[2] = readinputportbytag_safe("ANALOG2", 0);
- analog_ports[3] = readinputportbytag_safe("ANALOG3", 0);
+ analog_ports[0] = input_port_read_safe(machine, "ANALOG0", 0);
+ analog_ports[1] = input_port_read_safe(machine, "ANALOG1", 0);
+ analog_ports[2] = input_port_read_safe(machine, "ANALOG2", 0);
+ analog_ports[3] = input_port_read_safe(machine, "ANALOG3", 0);
}
}
else
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 2df3e540382..8d21f687aa2 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -716,8 +716,8 @@ static READ8_HANDLER( bosco_dsw_r )
{
int bit0,bit1;
- bit0 = (readinputportbytag("DSWB") >> offset) & 1;
- bit1 = (readinputportbytag("DSWA") >> offset) & 1;
+ bit0 = (input_port_read(machine, "DSWB") >> offset) & 1;
+ bit1 = (input_port_read(machine, "DSWA") >> offset) & 1;
return bit0 | (bit1 << 1);
}
@@ -771,14 +771,14 @@ static WRITE8_HANDLER( bosco_latch_w )
}
-static READ8_HANDLER( in0_l ) { return readinputportbytag("IN0"); } // fire and start buttons
-static READ8_HANDLER( in0_h ) { return readinputportbytag("IN0") >> 4; } // coins
-static READ8_HANDLER( in1_l ) { return readinputportbytag("IN1"); } // P1 joystick
-static READ8_HANDLER( in1_h ) { return readinputportbytag("IN1") >> 4; } // P2 joystick
-static READ8_HANDLER( dipA_l ) { return readinputportbytag("DSWA"); } // dips A
-static READ8_HANDLER( dipA_h ) { return readinputportbytag("DSWA") >> 4; } // dips A
-static READ8_HANDLER( dipB_l ) { return readinputportbytag("DSWB"); } // dips B
-static READ8_HANDLER( dipB_h ) { return readinputportbytag("DSWB") >> 4; } // dips B
+static READ8_HANDLER( in0_l ) { return input_port_read(machine, "IN0"); } // fire and start buttons
+static READ8_HANDLER( in0_h ) { return input_port_read(machine, "IN0") >> 4; } // coins
+static READ8_HANDLER( in1_l ) { return input_port_read(machine, "IN1"); } // P1 joystick
+static READ8_HANDLER( in1_h ) { return input_port_read(machine, "IN1") >> 4; } // P2 joystick
+static READ8_HANDLER( dipA_l ) { return input_port_read(machine, "DSWA"); } // dips A
+static READ8_HANDLER( dipA_h ) { return input_port_read(machine, "DSWA") >> 4; } // dips A
+static READ8_HANDLER( dipB_l ) { return input_port_read(machine, "DSWB"); } // dips B
+static READ8_HANDLER( dipB_h ) { return input_port_read(machine, "DSWB") >> 4; } // dips B
static WRITE8_HANDLER( out_0 )
{
set_led_status(1,data & 1);
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 1e7edc6f358..d1257b830d5 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -360,28 +360,28 @@ static WRITE8_HANDLER( konami_sound_filter_w )
static READ8_HANDLER( konami_porta_0_r )
{
// logerror("%04X:ppi0_porta_r\n", activecpu_get_pc());
- return readinputportbytag("IN0");
+ return input_port_read(machine, "IN0");
}
static READ8_HANDLER( konami_portb_0_r )
{
// logerror("%04X:ppi0_portb_r\n", activecpu_get_pc());
- return readinputportbytag("IN1");
+ return input_port_read(machine, "IN1");
}
static READ8_HANDLER( konami_portc_0_r )
{
logerror("%04X:ppi0_portc_r\n", activecpu_get_pc());
- return readinputportbytag("IN2");
+ return input_port_read(machine, "IN2");
}
static READ8_HANDLER( konami_portc_1_r )
{
logerror("%04X:ppi1_portc_r\n", activecpu_get_pc());
- return readinputportbytag("IN3");
+ return input_port_read(machine, "IN3");
}
@@ -761,7 +761,7 @@ static CUSTOM_INPUT( gmgalax_port_r )
const char *portname = param;
if (gmgalax_selected_game != 0)
portname += strlen(portname) + 1;
- return readinputportbytag(portname);
+ return input_port_read(machine, portname);
}
@@ -817,7 +817,7 @@ static WRITE8_HANDLER( zigzag_ay8910_w )
static CUSTOM_INPUT( azurian_port_r )
{
- return (readinputportbytag("FAKE") >> (FPTR)param) & 1;
+ return (input_port_read(machine, "FAKE") >> (FPTR)param) & 1;
}
@@ -831,7 +831,7 @@ static CUSTOM_INPUT( azurian_port_r )
static CUSTOM_INPUT( kingball_muxbit_r )
{
/* multiplex the service mode switch with a speech DIP switch */
- return (readinputportbytag("FAKE") >> kingball_speech_dip) & 1;
+ return (input_port_read(machine, "FAKE") >> kingball_speech_dip) & 1;
}
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 8e38ebdc79e..6f286c35984 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -546,9 +546,9 @@ ADDRESS_MAP_END
static READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
-static READ8_HANDLER( scramb2_port0_r ) { return (readinputport(0)>>offset)&0x1; }
-static READ8_HANDLER( scramb2_port1_r ) { return (readinputport(1)>>offset)&0x1; }
-static READ8_HANDLER( scramb2_port2_r ) { return (readinputport(2)>>offset)&0x1; }
+static READ8_HANDLER( scramb2_port0_r ) { return (input_port_read_indexed(machine, 0)>>offset)&0x1; }
+static READ8_HANDLER( scramb2_port1_r ) { return (input_port_read_indexed(machine, 1)>>offset)&0x1; }
+static READ8_HANDLER( scramb2_port2_r ) { return (input_port_read_indexed(machine, 2)>>offset)&0x1; }
static ADDRESS_MAP_START( scramb2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 9d0d7ec0a3f..51c530cc789 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -197,7 +197,7 @@ static WRITE16_HANDLER( galpani3_suprnova_sprite32regs_w )
***************************************************************************/
static UINT16 *mcu_ram, galpani3_mcu_com[4];
-static void galpani3_mcu_run(void)
+static void galpani3_mcu_run(running_machine *machine)
{
UINT16 mcu_command = mcu_ram[0x0010/2]; /* command nb */
UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
@@ -215,7 +215,7 @@ static void galpani3_mcu_run(void)
{
case 0x03: // DSW
{
- mcu_ram[mcu_offset] = readinputport(3);
+ mcu_ram[mcu_offset] = input_port_read_indexed(machine, 3);
logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n",activecpu_get_pc(),mcu_command,mcu_offset*2);
}
break;
@@ -295,7 +295,7 @@ static WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \
if (galpani3_mcu_com[3] != 0xFFFF) return; \
\
memset(galpani3_mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- galpani3_mcu_run(); \
+ galpani3_mcu_run(machine); \
}
GALPANI3_MCU_COM_W(0)
diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c
index 94efa7b6226..035eafe7330 100644
--- a/src/mame/drivers/gameplan.c
+++ b/src/mame/drivers/gameplan.c
@@ -98,7 +98,7 @@ static READ8_HANDLER( io_port_r )
{
gameplan_state *state = machine->driver_data;
- return readinputport(state->current_port);
+ return input_port_read_indexed(machine, state->current_port);
}
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index c8595d76296..bc585e1163b 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -180,14 +180,14 @@ VIDEO_EOF( gaplus ); /* update starfields */
***************************************************************************/
-static READ8_HANDLER( in0_l ) { return readinputport(0); } // P1 joystick
-static READ8_HANDLER( in0_h ) { return readinputport(0) >> 4; } // P2 joystick
-static READ8_HANDLER( in1_l ) { return readinputport(1); } // fire and start buttons
-static READ8_HANDLER( in1_h ) { return readinputport(1) >> 4; } // coins
-static READ8_HANDLER( dipA_l ) { return readinputport(2); } // dips A
-static READ8_HANDLER( dipA_h ) { return readinputport(2) >> 4; } // dips A
-static READ8_HANDLER( dipB_l ) { return readinputport(3); } // dips B
-static READ8_HANDLER( dipB_h ) { return readinputport(3) >> 4; } // dips B
+static READ8_HANDLER( in0_l ) { return input_port_read_indexed(machine, 0); } // P1 joystick
+static READ8_HANDLER( in0_h ) { return input_port_read_indexed(machine, 0) >> 4; } // P2 joystick
+static READ8_HANDLER( in1_l ) { return input_port_read_indexed(machine, 1); } // fire and start buttons
+static READ8_HANDLER( in1_h ) { return input_port_read_indexed(machine, 1) >> 4; } // coins
+static READ8_HANDLER( dipA_l ) { return input_port_read_indexed(machine, 2); } // dips A
+static READ8_HANDLER( dipA_h ) { return input_port_read_indexed(machine, 2) >> 4; } // dips A
+static READ8_HANDLER( dipB_l ) { return input_port_read_indexed(machine, 3); } // dips B
+static READ8_HANDLER( dipB_h ) { return input_port_read_indexed(machine, 3) >> 4; } // dips B
static WRITE8_HANDLER( out_lamps0 )
{
set_led_status(0,data & 1);
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 82624b76e20..4c16ac4c410 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -193,7 +193,7 @@ static MACHINE_RESET( gauntlet )
static READ16_HANDLER( port4_r )
{
- int temp = readinputport(4);
+ int temp = input_port_read_indexed(machine, 4);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
return temp;
@@ -237,7 +237,7 @@ static READ8_HANDLER( switch_6502_r )
if (atarigen_cpu_to_sound_ready) temp ^= 0x80;
if (atarigen_sound_to_cpu_ready) temp ^= 0x40;
if (tms5220_ready_r()) temp ^= 0x20;
- if (!(readinputport(4) & 0x0008)) temp ^= 0x10;
+ if (!(input_port_read_indexed(machine, 4) & 0x0008)) temp ^= 0x10;
return temp;
}
diff --git a/src/mame/drivers/genesis.c b/src/mame/drivers/genesis.c
index e7c89f400ef..3dadf7db5b7 100644
--- a/src/mame/drivers/genesis.c
+++ b/src/mame/drivers/genesis.c
@@ -320,7 +320,7 @@ READ16_HANDLER ( megaplay_68k_to_z80_r )
{
offset &=0x1fff;
// if(offset == 0)
-// return (readinputport(8) << 8) ^ 0xff00;
+// return (input_port_read_indexed(machine, 8) << 8) ^ 0xff00;
return (ic36_ram[offset] << 8) + ic36_ram[offset+1];
}
@@ -471,13 +471,13 @@ READ16_HANDLER ( genesis_io_r )
if (genesis_io_ram[offset] & 0x40)
{
- int iport = readinputport(9);
+ int iport = input_port_read_indexed(machine, 9);
return_value = iport & 0x3f;
}
else
{
- int iport1 = readinputport(12);
- int iport2 = readinputport(7) >> 1;
+ int iport1 = input_port_read_indexed(machine, 12);
+ int iport2 = input_port_read_indexed(machine, 7) >> 1;
return_value = (iport1 & 0x10) + (iport2 & 0x20);
if(iport1 & 0x10 || iport2 & 0x20)
return_value+=1;
@@ -492,14 +492,14 @@ READ16_HANDLER ( genesis_io_r )
if (genesis_io_ram[offset] & 0x40)
{
- int iport1 = (readinputport(9) & 0xc0) >> 6;
- int iport2 = (readinputport(8) & 0x0f) << 2;
+ int iport1 = (input_port_read_indexed(machine, 9) & 0xc0) >> 6;
+ int iport2 = (input_port_read_indexed(machine, 8) & 0x0f) << 2;
return_value = (iport1 + iport2) & 0x3f;
}
else
{
- int iport1 = readinputport(12) << 2;
- int iport2 = readinputport(7) >> 2;
+ int iport1 = input_port_read_indexed(machine, 12) << 2;
+ int iport2 = input_port_read_indexed(machine, 7) >> 2;
return_value = (iport1 & 0x10) + (iport2 & 0x20);
if(iport1 & 0x10 || iport2 & 0x20)
return_value+=1;
@@ -541,11 +541,11 @@ READ16_HANDLER ( megaplay_genesis_io_r )
case 1: /* port A data (joypad 1) */
if (genesis_io_ram[offset] & 0x40)
- return_value = readinputport(1) & (genesis_io_ram[4]^0xff);
+ return_value = input_port_read_indexed(machine, 1) & (genesis_io_ram[4]^0xff);
else
{
- return_value = readinputport(2) & (genesis_io_ram[4]^0xff);
- return_value |= readinputport(1) & 0x03;
+ return_value = input_port_read_indexed(machine, 2) & (genesis_io_ram[4]^0xff);
+ return_value |= input_port_read_indexed(machine, 1) & 0x03;
}
return_value = (genesis_io_ram[offset] & 0x80) | return_value;
// logerror ("reading joypad 1 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
@@ -554,11 +554,11 @@ READ16_HANDLER ( megaplay_genesis_io_r )
case 2: /* port B data (joypad 2) */
if (genesis_io_ram[offset] & 0x40)
- return_value = readinputport(3) & (genesis_io_ram[5]^0xff);
+ return_value = input_port_read_indexed(machine, 3) & (genesis_io_ram[5]^0xff);
else
{
- return_value = readinputport(4) & (genesis_io_ram[5]^0xff);
- return_value |= readinputport(3) & 0x03;
+ return_value = input_port_read_indexed(machine, 4) & (genesis_io_ram[5]^0xff);
+ return_value |= input_port_read_indexed(machine, 3) & 0x03;
}
return_value = (genesis_io_ram[offset] & 0x80) | return_value;
// logerror ("reading joypad 2 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index d0416921cbb..a857fc36ad9 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -216,14 +216,14 @@ static WRITE8_HANDLER( gladiatr_bankswitch_w )
static READ8_HANDLER( gladiator_dsw1_r )
{
- int orig = readinputportbytag("DSW1")^0xff;
+ int orig = input_port_read(machine, "DSW1")^0xff;
return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
}
static READ8_HANDLER( gladiator_dsw2_r )
{
- int orig = readinputportbytag("DSW2")^0xff;
+ int orig = input_port_read(machine, "DSW2")^0xff;
return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
}
@@ -232,15 +232,15 @@ static READ8_HANDLER( gladiator_controll_r )
{
int coins = 0;
- if( readinputportbytag("COINS") & 0xc0 ) coins = 0x80;
+ if( input_port_read(machine, "COINS") & 0xc0 ) coins = 0x80;
switch(offset)
{
case 0x01: /* start button , coins */
- return readinputportbytag("IN0") | coins;
+ return input_port_read(machine, "IN0") | coins;
case 0x02: /* Player 1 Controller , coins */
- return readinputportbytag("IN1") | coins;
+ return input_port_read(machine, "IN1") | coins;
case 0x04: /* Player 2 Controller , coins */
- return readinputportbytag("IN2") | coins;
+ return input_port_read(machine, "IN2") | coins;
}
/* unknown */
return 0;
@@ -251,7 +251,7 @@ static READ8_HANDLER( gladiator_button3_r )
switch(offset)
{
case 0x01: /* button 3 */
- return readinputportbytag("IN3");
+ return input_port_read(machine, "IN3");
}
/* unknown */
return 0;
@@ -278,7 +278,7 @@ static MACHINE_RESET( gladiator )
/* YM2203 port A handler (input) */
static READ8_HANDLER( gladiator_dsw3_r )
{
- return readinputportbytag("DSW3");
+ return input_port_read(machine, "DSW3");
}
/* YM2203 port B handler (output) */
static WRITE8_HANDLER( gladiator_int_control_w )
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index bf035bd2f67..94db61e837e 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -41,15 +41,15 @@ static READ16_HANDLER( goal92_inputs_r )
switch(offset)
{
case 0:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 1:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 2:
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 3:
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
case 7:
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
default:
logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n",offset, mem_mask,activecpu_get_pc());
diff --git a/src/mame/drivers/gomoku.c b/src/mame/drivers/gomoku.c
index 3e75281f319..51e0a8667fa 100644
--- a/src/mame/drivers/gomoku.c
+++ b/src/mame/drivers/gomoku.c
@@ -52,7 +52,7 @@ static READ8_HANDLER( input_port_r )
res = 0;
for (i = 0; i < 8; i++)
- res |= ((readinputport(i) >> offset) & 1) << i;
+ res |= ((input_port_read_indexed(machine, i) >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/goodejan.c b/src/mame/drivers/goodejan.c
index 6a93bee42c5..cea77a9b6bf 100644
--- a/src/mame/drivers/goodejan.c
+++ b/src/mame/drivers/goodejan.c
@@ -79,11 +79,11 @@ static READ16_HANDLER( mahjong_panel_r )
switch(goodejan_mux_data)
{
- case 1: ret = readinputport(1); break;
- case 2: ret = readinputport(2); break;
- case 4: ret = readinputport(3); break;
- case 8: ret = readinputport(4); break;
- case 0x10: ret = readinputport(5); break;
+ case 1: ret = input_port_read_indexed(machine, 1); break;
+ case 2: ret = input_port_read_indexed(machine, 2); break;
+ case 4: ret = input_port_read_indexed(machine, 3); break;
+ case 8: ret = input_port_read_indexed(machine, 4); break;
+ case 0x10: ret = input_port_read_indexed(machine, 5); break;
}
return ret;
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index c5469ec783f..8e4cdf58412 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -222,17 +222,17 @@ static READ8_HANDLER( stooges_IN4_r )
{
case 0:
default:
- joy = ((readinputportbytag("IN4") >> 0) & 0x0f); /* joystick 1 */
+ joy = ((input_port_read(machine, "IN4") >> 0) & 0x0f); /* joystick 1 */
break;
case 1:
- joy = ((readinputportbytag("IN5") >> 0) & 0x0f); /* joystick 2 */
+ joy = ((input_port_read(machine, "IN5") >> 0) & 0x0f); /* joystick 2 */
break;
case 2:
- joy = ((readinputportbytag("IN5") >> 4) & 0x0f); /* joystick 3 */
+ joy = ((input_port_read(machine, "IN5") >> 4) & 0x0f); /* joystick 3 */
break;
}
- return joy | (readinputportbytag("IN4") & 0xf0);
+ return joy | (input_port_read(machine, "IN4") & 0xf0);
}
static WRITE8_HANDLER( reactor_output_w )
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index cf95e42229b..9bda7e143e6 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -79,7 +79,7 @@
static MACHINE_START( grchamp )
{
/* if the coin system is 1 way, lock Coin B (Page 40) */
- if (readinputport(1) & 0x10)
+ if (input_port_read_indexed(machine, 1) & 0x10)
coin_lockout_w(1, 1);
}
diff --git a/src/mame/drivers/gridlee.c b/src/mame/drivers/gridlee.c
index e926d8e5d11..c8a87985b19 100644
--- a/src/mame/drivers/gridlee.c
+++ b/src/mame/drivers/gridlee.c
@@ -174,7 +174,7 @@ static READ8_HANDLER( analog_port_r )
UINT8 newval;
/* first read the new trackball value and compute the signed delta */
- newval = readinputport(offset + 2 * gridlee_cocktail_flip);
+ newval = input_port_read_indexed(machine, offset + 2 * gridlee_cocktail_flip);
delta = (int)newval - (int)last_analog_input[offset];
/* handle the case where we wrap around from 0x00 to 0xff, or vice versa */
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index bb2fe0e3b39..8a50ecfef05 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -177,7 +177,7 @@ static int gsword_protect_hack;
static int gsword_coins_in(void)
{
/* emulate 8741 coin slot */
- if (readinputport(4)&0xc0)
+ if (input_port_read_indexed(machine, 4)&0xc0)
{
logerror("Coin In\n");
return 0x80;
@@ -215,11 +215,11 @@ static READ8_HANDLER( gsword_8741_2_r )
switch (offset)
{
case 0x01: /* start button , coins */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x02: /* Player 1 Controller */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x04: /* Player 2 Controller */
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
// default:
// logerror("8741-2 unknown read %d PC=%04x\n",offset,activecpu_get_pc());
}
@@ -232,11 +232,11 @@ static READ8_HANDLER( gsword_8741_3_r )
switch (offset)
{
case 0x01: /* start button */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x02: /* Player 1 Controller? */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x04: /* Player 2 Controller? */
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
/* unknown */
// logerror("8741-3 unknown read %d PC=%04x\n",offset,activecpu_get_pc());
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 83ca8b7b138..85da7fd2a83 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -205,7 +205,7 @@ static void adc1038_di_w(int bit)
adc1038_data_in = bit & 1;
}
-static void adc1038_clk_w(int bit)
+static void adc1038_clk_w(running_machine *machine, int bit)
{
// GTI Club doesn't sync on SARS
if (adc1038_gticlub_hack)
@@ -216,10 +216,10 @@ static void adc1038_clk_w(int bit)
switch (adc1038_adr)
{
- case 0: adc1038_adc_data = readinputport(4); break;
- case 1: adc1038_adc_data = readinputport(5); break;
- case 2: adc1038_adc_data = readinputport(6); break;
- case 3: adc1038_adc_data = readinputport(7); break;
+ case 0: adc1038_adc_data = input_port_read_indexed(machine, 4); break;
+ case 1: adc1038_adc_data = input_port_read_indexed(machine, 5); break;
+ case 2: adc1038_adc_data = input_port_read_indexed(machine, 6); break;
+ case 3: adc1038_adc_data = input_port_read_indexed(machine, 7); break;
case 4: adc1038_adc_data = 0x000; break;
case 5: adc1038_adc_data = 0x000; break;
case 6: adc1038_adc_data = 0x000; break;
@@ -255,16 +255,16 @@ static void adc1038_clk_w(int bit)
adc1038_clk = bit;
}
-static int adc1038_sars_r(void)
+static int adc1038_sars_r(running_machine *machine)
{
adc1038_cycle = 0;
switch (adc1038_adr)
{
- case 0: adc1038_adc_data = readinputport(4); break;
- case 1: adc1038_adc_data = readinputport(5); break;
- case 2: adc1038_adc_data = readinputport(6); break;
- case 3: adc1038_adc_data = readinputport(7); break;
+ case 0: adc1038_adc_data = input_port_read_indexed(machine, 4); break;
+ case 1: adc1038_adc_data = input_port_read_indexed(machine, 5); break;
+ case 2: adc1038_adc_data = input_port_read_indexed(machine, 6); break;
+ case 3: adc1038_adc_data = input_port_read_indexed(machine, 7); break;
case 4: adc1038_adc_data = 0x000; break;
case 5: adc1038_adc_data = 0x000; break;
case 6: adc1038_adc_data = 0x000; break;
@@ -285,19 +285,19 @@ static READ32_HANDLER( sysreg_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(0) << 24;
+ r |= input_port_read_indexed(machine, 0) << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= readinputport(1) << 16;
+ r |= input_port_read_indexed(machine, 1) << 16;
}
if (ACCESSING_BITS_8_15)
{
- r |= (adc1038_sars_r() << 7) << 8;
+ r |= (adc1038_sars_r(machine) << 7) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= readinputport(3) << 0;
+ r |= input_port_read_indexed(machine, 3) << 0;
}
return r;
}
@@ -357,7 +357,7 @@ static WRITE32_HANDLER( sysreg_w )
}
adc1038_di_w((data >> 24) & 1);
- adc1038_clk_w((data >> 25) & 1);
+ adc1038_clk_w(machine, (data >> 25) & 1);
set_cgboard_id((data >> 28) & 0x3);
}
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index 6b945ba76a1..e459d70bb38 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -552,7 +552,7 @@ static READ16_HANDLER( io_r )
case 0x01:
case 0x02:
{
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
}
case 0x30:
{
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index 6a2404967d1..b4cb621b3dd 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -73,9 +73,9 @@ static INTERRUPT_GEN( yamyam_interrupt )
{
if (input_ports_hack)
{
- rambase[0x004] = readinputport(4); /* COIN */
- rambase[0x005] = readinputport(3); /* IN1 */
- rambase[0x006] = readinputport(2); /* IN0 */
+ rambase[0x004] = input_port_read_indexed(machine, 4); /* COIN */
+ rambase[0x005] = input_port_read_indexed(machine, 3); /* IN1 */
+ rambase[0x006] = input_port_read_indexed(machine, 2); /* IN0 */
}
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7); /* RST 10h vblank */
}
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index 31b0c871a54..118494eae85 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -1430,7 +1430,7 @@ static VIDEO_UPDATE( halleys )
else
fillbitmap(bitmap, bgcolor, cliprect);
- if (readinputportbytag("FAKE")) copy_scroll_xp(bitmap, render_layer[3], *scrollx0, *scrolly0); // not used???
+ if (input_port_read(screen->machine, "FAKE")) copy_scroll_xp(bitmap, render_layer[3], *scrollx0, *scrolly0); // not used???
copy_scroll_xp(bitmap, render_layer[2], *scrollx1, *scrolly1);
copy_fixed_2b (bitmap, render_layer[1]);
copy_fixed_xp (bitmap, render_layer[0]);
@@ -1593,7 +1593,7 @@ static READ8_HANDLER( coin_lockout_r )
{
// This is a hack, but it lets you coin up when COIN1 or COIN2 are signaled.
// See NMI for the twisted logic that is involved in handling coin input.
- int inp = readinputportbytag("IN0");
+ int inp = input_port_read(machine, "IN0");
int result = 0x01; // dual coin slots
if (inp & 0x80) result |= 0x02;
@@ -1605,7 +1605,7 @@ static READ8_HANDLER( coin_lockout_r )
static READ8_HANDLER( io_mirror_r )
{
- return(readinputport(offset + 3));
+ return(input_port_read_indexed(machine, offset + 3));
}
diff --git a/src/mame/drivers/hanaawas.c b/src/mame/drivers/hanaawas.c
index 7e17bf8d9bd..da4231da0b4 100644
--- a/src/mame/drivers/hanaawas.c
+++ b/src/mame/drivers/hanaawas.c
@@ -47,13 +47,13 @@ static READ8_HANDLER( hanaawas_input_port_0_r )
switch( mux )
{
case 1: /* start buttons */
- buttons = readinputport(4);
+ buttons = input_port_read_indexed(machine, 4);
break;
case 2: /* player 1 buttons */
- buttons = readinputport(2);
+ buttons = input_port_read_indexed(machine, 2);
break;
case 4: /* player 2 buttons */
- buttons = readinputport(3);
+ buttons = input_port_read_indexed(machine, 3);
break;
}
diff --git a/src/mame/drivers/hitme.c b/src/mame/drivers/hitme.c
index fa46fe1f78c..b06e85432c0 100644
--- a/src/mame/drivers/hitme.c
+++ b/src/mame/drivers/hitme.c
@@ -68,7 +68,7 @@ static VIDEO_START(barricad)
static VIDEO_UPDATE(hitme)
{
/* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */
- double width_resist = readinputport(7) * 25000 / 100;
+ double width_resist = input_port_read_indexed(screen->machine, 7) * 25000 / 100;
/* this triggers a oneshot for the following length of time */
double width_duration = 0.45 * 1000e-12 * width_resist;
/* the dot clock runs at the standard horizontal frequency * 320+16 clocks per scanline */
@@ -126,9 +126,9 @@ static VIDEO_UPDATE(barricad)
*
*************************************/
-static UINT8 read_port_and_t0(int port)
+static UINT8 read_port_and_t0(running_machine *machine, int port)
{
- UINT8 val = readinputport(port);
+ UINT8 val = input_port_read_indexed(machine, port);
if (attotime_compare(timer_get_time(), timeout_time) > 0)
val ^= 0x80;
return val;
@@ -137,7 +137,7 @@ static UINT8 read_port_and_t0(int port)
static UINT8 read_port_and_t0_and_hblank(running_machine *machine, int port)
{
- UINT8 val = read_port_and_t0(port);
+ UINT8 val = read_port_and_t0(machine, port);
if (video_screen_get_hpos(machine->primary_screen) < (video_screen_get_width(machine->primary_screen) * 9 / 10))
val ^= 0x04;
return val;
@@ -152,7 +152,7 @@ static READ8_HANDLER( hitme_port_0_r )
static READ8_HANDLER( hitme_port_1_r )
{
- return read_port_and_t0(1);
+ return read_port_and_t0(machine, 1);
}
@@ -164,7 +164,7 @@ static READ8_HANDLER( hitme_port_2_r )
static READ8_HANDLER( hitme_port_3_r )
{
- return read_port_and_t0(3);
+ return read_port_and_t0(machine, 3);
}
@@ -183,7 +183,7 @@ static WRITE8_HANDLER( output_port_0_w )
In fact, it is very important that our timing calculation timeout AFTER the sound
system's equivalent computation, or else we will hang notes.
*/
- UINT8 raw_game_speed = readinputport(6);
+ UINT8 raw_game_speed = input_port_read_indexed(machine, 6);
double resistance = raw_game_speed * 25000 / 100;
attotime duration = attotime_make(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data+1));
timeout_time = attotime_add(timer_get_time(), duration);
diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c
index c00bd19d02d..772f428f60c 100644
--- a/src/mame/drivers/hnayayoi.c
+++ b/src/mame/drivers/hnayayoi.c
@@ -56,7 +56,7 @@ static READ8_HANDLER( keyboard_0_r )
int i;
for (i = 0;i < 5;i++)
- if (~keyb & (1 << i)) res &= readinputport(4+i);
+ if (~keyb & (1 << i)) res &= input_port_read_indexed(machine, 4+i);
return res;
}
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 12cdf0fa78e..79658724ee9 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -729,12 +729,12 @@ static READ32_HANDLER( hng64_dualport_r )
//SamSho64
// case 0x00: toggi^=1; if (toggi==1) {return 0x00000400;} else {return 0x00000300;};
//RoadsEdge
-// case 0x00: return readinputportbytag("IPT_TEST");
+// case 0x00: return input_port_read(machine, "IPT_TEST");
//Fatfurwa
case 0x00: return 0x00000400;
- case 0x04: return readinputportbytag("IPT_NONE") | (readinputportbytag("FATFURWA_TST_ETC")<<16);
- case 0x08: return readinputportbytag("FATFURWA_PLR_2") | (readinputportbytag("FATFURWA_PLR_1")<<16);
+ case 0x04: return input_port_read(machine, "IPT_NONE") | (input_port_read(machine, "FATFURWA_TST_ETC")<<16);
+ case 0x08: return input_port_read(machine, "FATFURWA_PLR_2") | (input_port_read(machine, "FATFURWA_PLR_1")<<16);
// This takes care of the 'machine' error code
case 0x600: return no_machine_error_code;
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index 089d82e37c3..d1bc2e557cd 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -264,7 +264,7 @@ static READ8_HANDLER( mrokumei_keyboard_r )
{
if (keyb & (1 << i))
{
- res = readinputport(3+i) & 0x3f;
+ res = input_port_read_indexed(machine, 3+i) & 0x3f;
break;
}
}
@@ -398,7 +398,7 @@ static MACHINE_RESET( reikaids_upd7807 )
static READ8_HANDLER( reikaids_io_r )
{
- int res = readinputport(2); // bit 4 = coin, bit 5 = service
+ int res = input_port_read_indexed(machine, 2); // bit 4 = coin, bit 5 = service
res |= BIT(upd7807_portc,2) * 0x01; // bit 0 = upd7807 status
res |= BIT(upd7807_portc,6) * 0x02; // bit 1 = upd7807 data
@@ -468,7 +468,7 @@ static READ8_HANDLER( pteacher_io_r )
static READ8_HANDLER( pteacher_keyboard_r )
{
- int dips = readinputport(0);
+ int dips = input_port_read_indexed(machine, 0);
// logerror("%04x: keyboard_r with port A = %02x\n",activecpu_get_pc(),upd7807_porta);
@@ -476,7 +476,7 @@ static READ8_HANDLER( pteacher_keyboard_r )
{
/* player 1 + dip switches */
int row = (upd7807_porta & 0x07);
- return readinputport(2 + row) | (((dips >> row) & 1) << 5); // 0-5
+ return input_port_read_indexed(machine, 2 + row) | (((dips >> row) & 1) << 5); // 0-5
}
if (upd7807_porta & 0x08)
{
diff --git a/src/mame/drivers/homerun.c b/src/mame/drivers/homerun.c
index 8d9731fa324..b2e1666b788 100644
--- a/src/mame/drivers/homerun.c
+++ b/src/mame/drivers/homerun.c
@@ -92,9 +92,9 @@ ADDRESS_MAP_END
static READ8_HANDLER(homerun_40_r)
{
if(video_screen_get_vpos(machine->primary_screen)>116)
- return readinputport(0)|0x40;
+ return input_port_read_indexed(machine, 0)|0x40;
else
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
static ADDRESS_MAP_START( homerun_iomap, ADDRESS_SPACE_IO, 8 )
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 308d897ada4..238c5e4219b 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -596,15 +596,15 @@ static READ32_HANDLER( sysreg_r )
if (ACCESSING_BITS_24_31)
{
//printf("read sysreg 0\n");
- r |= readinputport(0) << 24;
+ r |= input_port_read_indexed(machine, 0) << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= readinputport(1) << 16;
+ r |= input_port_read_indexed(machine, 1) << 16;
}
if (ACCESSING_BITS_8_15)
{
- r |= readinputport(2) << 8;
+ r |= input_port_read_indexed(machine, 2) << 8;
}
if (ACCESSING_BITS_0_7)
{
@@ -615,7 +615,7 @@ static READ32_HANDLER( sysreg_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(3) << 24;
+ r |= input_port_read_indexed(machine, 3) << 24;
}
}
return r;
diff --git a/src/mame/drivers/hyperspt.c b/src/mame/drivers/hyperspt.c
index 7f3ce38006d..7f81174219f 100644
--- a/src/mame/drivers/hyperspt.c
+++ b/src/mame/drivers/hyperspt.c
@@ -45,7 +45,7 @@ static READ8_HANDLER( konami_IN1_r )
static int cheat = 0;
static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa };
- res = readinputportbytag("IN1");
+ res = input_port_read(machine, "IN1");
if ((res & 0x80) == 0)
{
diff --git a/src/mame/drivers/igs_blit.c b/src/mame/drivers/igs_blit.c
index 4e3f5bc42a0..10668071e35 100644
--- a/src/mame/drivers/igs_blit.c
+++ b/src/mame/drivers/igs_blit.c
@@ -334,7 +334,7 @@ static READ16_HANDLER( igs_##NUM##_input_r ) \
\
for (i = 0; i < NUM; i++) \
if ((~igs_input_sel) & (1 << i) ) \
- ret = readinputport(i); \
+ ret = input_port_read_indexed(machine, i); \
\
/* 0x0100 is blitter busy */ \
return (ret & 0xff) | 0x0000; \
@@ -663,11 +663,11 @@ static READ16_HANDLER( chmplst2_magic_r )
switch(igs_magic[0])
{
case 0x01:
- if (~igs_input_sel2 & 0x01) return readinputport(4);
- if (~igs_input_sel2 & 0x02) return readinputport(5);
- if (~igs_input_sel2 & 0x04) return readinputport(6);
- if (~igs_input_sel2 & 0x08) return readinputport(7);
- if (~igs_input_sel2 & 0x10) return readinputport(8);
+ if (~igs_input_sel2 & 0x01) return input_port_read_indexed(machine, 4);
+ if (~igs_input_sel2 & 0x02) return input_port_read_indexed(machine, 5);
+ if (~igs_input_sel2 & 0x04) return input_port_read_indexed(machine, 6);
+ if (~igs_input_sel2 & 0x08) return input_port_read_indexed(machine, 7);
+ if (~igs_input_sel2 & 0x10) return input_port_read_indexed(machine, 8);
/* fall through */
default:
logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]);
@@ -736,9 +736,9 @@ static READ16_HANDLER( chindrag_magic_r )
{
switch(igs_magic[0])
{
- case 0x00: return readinputport(4);
- case 0x01: return readinputport(5);
- case 0x02: return readinputport(6);
+ case 0x00: return input_port_read_indexed(machine, 4);
+ case 0x01: return input_port_read_indexed(machine, 5);
+ case 0x02: return input_port_read_indexed(machine, 6);
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -803,7 +803,7 @@ static READ16_HANDLER( grtwall_magic_r )
{
switch(igs_magic[0])
{
- case 0x00: return readinputport(5);
+ case 0x00: return input_port_read_indexed(machine, 5);
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -873,11 +873,11 @@ static READ16_HANDLER( lhb_input2_r )
case 0: return igs_input_sel2;
case 1:
- if (~igs_input_sel2 & 0x01) return readinputport(6);
- if (~igs_input_sel2 & 0x02) return readinputport(7);
- if (~igs_input_sel2 & 0x04) return readinputport(8);
- if (~igs_input_sel2 & 0x08) return readinputport(9);
- if (~igs_input_sel2 & 0x10) return readinputport(10);
+ if (~igs_input_sel2 & 0x01) return input_port_read_indexed(machine, 6);
+ if (~igs_input_sel2 & 0x02) return input_port_read_indexed(machine, 7);
+ if (~igs_input_sel2 & 0x04) return input_port_read_indexed(machine, 8);
+ if (~igs_input_sel2 & 0x08) return input_port_read_indexed(machine, 9);
+ if (~igs_input_sel2 & 0x10) return input_port_read_indexed(machine, 10);
logerror("%06x: warning, reading with igs_input_sel2 = %02x\n", activecpu_get_pc(), igs_input_sel2);
break;
@@ -918,8 +918,8 @@ static READ16_HANDLER( vbowl_magic_r )
{
switch(igs_magic[0])
{
- case 0x00: return readinputport(5);
- case 0x01: return readinputport(6);
+ case 0x00: return input_port_read_indexed(machine, 5);
+ case 0x01: return input_port_read_indexed(machine, 6);
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -985,14 +985,14 @@ static READ16_HANDLER( xymg_magic_r )
{
switch(igs_magic[0])
{
- case 0x00: return readinputport(3);
+ case 0x00: return input_port_read_indexed(machine, 3);
case 0x02:
- if (~igs_input_sel2 & 0x01) return readinputport(4);
- if (~igs_input_sel2 & 0x02) return readinputport(5);
- if (~igs_input_sel2 & 0x04) return readinputport(6);
- if (~igs_input_sel2 & 0x08) return readinputport(7);
- if (~igs_input_sel2 & 0x10) return readinputport(8);
+ if (~igs_input_sel2 & 0x01) return input_port_read_indexed(machine, 4);
+ if (~igs_input_sel2 & 0x02) return input_port_read_indexed(machine, 5);
+ if (~igs_input_sel2 & 0x04) return input_port_read_indexed(machine, 6);
+ if (~igs_input_sel2 & 0x08) return input_port_read_indexed(machine, 7);
+ if (~igs_input_sel2 & 0x10) return input_port_read_indexed(machine, 8);
/* fall through */
default:
logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]);
@@ -1194,7 +1194,7 @@ static UINT16 *vbowl_trackball;
static VIDEO_EOF( vbowl )
{
vbowl_trackball[0] = vbowl_trackball[1];
- vbowl_trackball[1] = (readinputport(8) << 8) | readinputport(7);
+ vbowl_trackball[1] = (input_port_read_indexed(machine, 8) << 8) | input_port_read_indexed(machine, 7);
}
static WRITE16_HANDLER( vbowl_pen_hi_w )
diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c
index 7aeb6df836d..116ad387558 100644
--- a/src/mame/drivers/imolagp.c
+++ b/src/mame/drivers/imolagp.c
@@ -371,7 +371,7 @@ static INTERRUPT_GEN( master_interrupt )
else
{
static int oldsteer;
- int newsteer = readinputport(3)&0xf;
+ int newsteer = input_port_read_indexed(machine, 3)&0xf;
if( newsteer!=oldsteer )
{
if( imola_steerlatch==0 )
diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c
index 244aeacab1e..3a8d249bf31 100644
--- a/src/mame/drivers/inufuku.c
+++ b/src/mame/drivers/inufuku.c
@@ -159,7 +159,7 @@ static READ16_HANDLER( inufuku_eeprom_r )
soundflag = pending_command ? 0x0000 : 0x0080; // bit7
eeprom = (EEPROM_read_bit() & 1) << 6; // bit6
- inputport = readinputport(4) & 0xff3f; // bit5-0
+ inputport = input_port_read_indexed(machine, 4) & 0xff3f; // bit5-0
return (soundflag | eeprom | inputport);
}
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index 2c77949685b..d3be7091252 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -354,7 +354,7 @@ static MACHINE_RESET( drivedge )
static READ16_HANDLER( special_port3_r )
{
- int result = readinputport(3);
+ int result = input_port_read_indexed(machine, 3);
if (sound_int_state) result ^= 0x08;
return result;
}
@@ -362,7 +362,7 @@ static READ16_HANDLER( special_port3_r )
static READ16_HANDLER( special_port4_r )
{
- int result = readinputport(4);
+ int result = input_port_read_indexed(machine, 4);
if (sound_int_state) result ^= 0x08;
return result;
}
@@ -370,8 +370,8 @@ static READ16_HANDLER( special_port4_r )
static READ16_HANDLER( trackball_r )
{
- int lower = readinputportbytag("TRACKX1");
- int upper = readinputportbytag("TRACKY1");
+ int lower = input_port_read(machine, "TRACKX1");
+ int upper = input_port_read(machine, "TRACKY1");
return (lower & 15) | ((upper & 15) << 4);
}
@@ -379,8 +379,8 @@ static READ16_HANDLER( trackball_r )
static READ32_HANDLER( trackball32_8bit_r )
{
- int lower = readinputportbytag("TRACKX1");
- int upper = readinputportbytag("TRACKY1");
+ int lower = input_port_read(machine, "TRACKX1");
+ int upper = input_port_read(machine, "TRACKY1");
return (lower & 255) | ((upper & 255) << 8);
}
@@ -398,8 +398,8 @@ static READ32_HANDLER( trackball32_4bit_r )
int upper, lower;
int dx, dy;
- int curx = readinputportbytag("TRACKX1");
- int cury = readinputportbytag("TRACKY1");
+ int curx = input_port_read(machine, "TRACKX1");
+ int cury = input_port_read(machine, "TRACKY1");
dx = curx - effx;
if (dx < -0x80) dx += 0x100;
@@ -437,8 +437,8 @@ static READ32_HANDLER( trackball32_4bit_p2_r )
int upper, lower;
int dx, dy;
- int curx = readinputportbytag("TRACKX2");
- int cury = readinputportbytag("TRACKY2");
+ int curx = input_port_read(machine, "TRACKX2");
+ int cury = input_port_read(machine, "TRACKY2");
dx = curx - effx;
if (dx < -0x80) dx += 0x100;
@@ -473,7 +473,7 @@ static READ32_HANDLER( trackball32_4bit_combined_r )
static READ32_HANDLER( drivedge_steering_r )
{
- int val = readinputport(5) * 2 - 0x100;
+ int val = input_port_read_indexed(machine, 5) * 2 - 0x100;
if (val < 0) val = 0x100 | (-val);
return val << 16;
}
@@ -481,7 +481,7 @@ static READ32_HANDLER( drivedge_steering_r )
static READ32_HANDLER( drivedge_gas_r )
{
- int val = readinputport(6);
+ int val = input_port_read_indexed(machine, 6);
return val << 16;
}
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 690b29083f0..aeaa515650c 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -714,7 +714,7 @@ static WRITE8_HANDLER( rimrockn_bank_w )
/* used by most games */
static READ8_HANDLER( special_port0_r )
{
- UINT8 result = readinputport(0);
+ UINT8 result = input_port_read_indexed(machine, 0);
result = (result & 0xfe) | (pia_portb_data & 0x01);
return result;
}
@@ -723,7 +723,7 @@ static READ8_HANDLER( special_port0_r )
/* used by Rim Rockin' Basketball */
static READ8_HANDLER( special_port1_r )
{
- UINT8 result = readinputport(1);
+ UINT8 result = input_port_read_indexed(machine, 1);
result = (result & 0x7f) | ((pia_portb_data & 0x01) << 7);
return result;
}
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 750697f8ffe..6390e202efa 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -89,9 +89,9 @@ static WRITE8_HANDLER( joinem_misc_w )
static READ8_HANDLER( joinem_input1_r )
{
- UINT8 ret = readinputport(1) & ~0x20;
+ UINT8 ret = input_port_read_indexed(machine, 1) & ~0x20;
- if((readinputport(4) & 0x80) && !joinem_snd_bit)
+ if((input_port_read_indexed(machine, 4) & 0x80) && !joinem_snd_bit)
ret |= 0x20;
return ret;
@@ -918,7 +918,7 @@ static INTERRUPT_GEN( joinem_interrupts )
cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
else
{
- if(!(readinputport(4) & 0x80))
+ if(!(input_port_read_indexed(machine, 4) & 0x80))
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
}
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 040a5bd60e4..de40c96031d 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -52,7 +52,7 @@ static int irq_enable;
static READ8_HANDLER( topgunbl_rotary_r )
{
- return (1 << (readinputport(5 + offset) * 8 / 256)) ^ 0xff;
+ return (1 << (input_port_read_indexed(machine, 5 + offset) * 8 / 256)) ^ 0xff;
}
static WRITE8_HANDLER( jackal_flipscreen_w )
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 354022faa3b..a8be084d62a 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -195,7 +195,7 @@ static VIDEO_START( jalmah )
}
#define MCU_READ(_number_,_bit_,_offset_,_retval_)\
-if((0xffff - readinputport(_number_)) & _bit_) { jm_regs[_offset_] = _retval_; }
+if((0xffff - input_port_read_indexed(machine, _number_)) & _bit_) { jm_regs[_offset_] = _retval_; }
/*RAM-based protection handlings*/
static void daireika_mcu_run(running_machine *machine)
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index b487ce02573..2d461d07788 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -220,7 +220,7 @@ This will benefit galpani3 and other kaneko16 games with TOYBOX MCU.
***************************************************************************/
static UINT16 *mcu_ram, jchan_mcu_com[4];
-static void jchan_mcu_run(void)
+static void jchan_mcu_run(running_machine *machine)
{
UINT16 mcu_command = mcu_ram[0x0010/2]; /* command nb */
UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
@@ -302,7 +302,7 @@ static void jchan_mcu_run(void)
case 0x03: // DSW
{
- mcu_ram[mcu_offset] = readinputport(3);
+ mcu_ram[mcu_offset] = input_port_read_indexed(machine, 3);
logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n",activecpu_get_pc(),mcu_command,mcu_offset*2);
}
break;
@@ -377,7 +377,7 @@ static WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \
if (jchan_mcu_com[3] != 0xFFFF) return; \
\
memset(jchan_mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- jchan_mcu_run(); \
+ jchan_mcu_run(machine); \
}
JCHAN_MCU_COM_W(0)
@@ -455,8 +455,8 @@ static READ16_HANDLER ( jchan_ctrl_r )
{
switch(offset)
{
- case 0/2: return readinputport(0); // Player 1 controls
- case 2/2: return readinputport(1); // Player 2 controls
+ case 0/2: return input_port_read_indexed(machine, 0); // Player 1 controls
+ case 2/2: return input_port_read_indexed(machine, 1); // Player 2 controls
default: logerror("jchan_ctrl_r unknown!"); break;
}
return jchan_ctrl[offset];
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index 253758cd37b..279c5bc1660 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -215,8 +215,8 @@ static READ8_HANDLER( a2d_data_r )
switch (state->a2d_select)
{
- case 0: ret = readinputport(2); break;
- case 2: ret = readinputport(3); break;
+ case 0: ret = input_port_read_indexed(machine, 2); break;
+ case 2: ret = input_port_read_indexed(machine, 3); break;
}
return ret;
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 24f3afcb4aa..6d542dc2af7 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -109,19 +109,19 @@ static READ8_HANDLER( keyboard1_r )
{
case 0xef:
- return readinputportbytag("0");
+ return input_port_read(machine, "0");
case 0xf7:
- return readinputportbytag("1");
+ return input_port_read(machine, "1");
case 0xfb:
- return readinputportbytag("2");
+ return input_port_read(machine, "2");
case 0xfd:
- return readinputportbytag("3");
+ return input_port_read(machine, "3");
case 0xfe:
- return readinputportbytag("4");
+ return input_port_read(machine, "4");
default:
printf("keyboard1_r, select %02x\n",keyboard_select);
@@ -137,19 +137,19 @@ static READ8_HANDLER( keyboard2_r )
switch (keyboard_select)
{
case 0xef:
- return readinputportbytag("5");
+ return input_port_read(machine, "5");
case 0xf7:
- return readinputportbytag("6");
+ return input_port_read(machine, "6");
case 0xfb:
- return readinputportbytag("7");
+ return input_port_read(machine, "7");
case 0xfd:
- return readinputportbytag("8");
+ return input_port_read(machine, "8");
case 0xfe:
- return readinputportbytag("9");
+ return input_port_read(machine, "9");
default:
printf("keyboard2_r, select %02x\n",keyboard_select);
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 56613bd93cb..b12fa17a39e 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -295,7 +295,7 @@ static READ16_HANDLER( duart_1_r )
}
case 0xd:
{
- val = readinputportbytag("TEST/DEMO");
+ val = input_port_read(machine, "TEST/DEMO");
break;
}
case 0xe:
@@ -409,11 +409,11 @@ static READ16_HANDLER( duart_2_r )
{
if (touch_cnt == 0)
{
- if ( readinputportbytag("TOUCH") & 0x1 )
+ if ( input_port_read(machine, "TOUCH") & 0x1 )
{
touch_data[0] = 0x2a;
- touch_data[1] = 0x7 - (readinputportbytag("TOUCH_Y") >> 5) + 0x30;
- touch_data[2] = (readinputportbytag("TOUCH_X") >> 5) + 0x30;
+ touch_data[1] = 0x7 - (input_port_read(machine, "TOUCH_Y") >> 5) + 0x30;
+ touch_data[2] = (input_port_read(machine, "TOUCH_X") >> 5) + 0x30;
/* Return RXRDY */
return 0x1;
@@ -477,22 +477,22 @@ static READ16_HANDLER( inputs1_r )
{
case 0:
{
- val = readinputportbytag("DSW");
+ val = input_port_read(machine, "DSW");
break;
}
case 2:
{
- val = readinputportbytag("SW2");
+ val = input_port_read(machine, "SW2");
break;
}
case 4:
{
- val = readinputportbytag("SW1");
+ val = input_port_read(machine, "SW1");
break;
}
case 9:
{
- val = readinputportbytag("COINS");
+ val = input_port_read(machine, "COINS");
break;
}
}
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index df95d1c7de3..c67558289c5 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -78,10 +78,10 @@ Dip locations verified from manual for:
#include "sound/2151intf.h"
#include "sound/okim6295.h"
-extern void (*toybox_mcu_run)(void); /* one of the following */
-void bloodwar_mcu_run(void);
-void bonkadv_mcu_run(void);
-void gtmr_mcu_run(void);
+extern void (*toybox_mcu_run)(running_machine *machine); /* one of the following */
+void bloodwar_mcu_run(running_machine *machine);
+void bonkadv_mcu_run(running_machine *machine);
+void gtmr_mcu_run(running_machine *machine);
/***************************************************************************
@@ -603,10 +603,10 @@ ADDRESS_MAP_END
static READ16_HANDLER( gtmr_wheel_r )
{
- if ( (readinputport(4) & 0x1800) == 0x10) // DSW setting
- return readinputport(5)<<8; // 360' Wheel
+ if ( (input_port_read_indexed(machine, 4) & 0x1800) == 0x10) // DSW setting
+ return input_port_read_indexed(machine, 5)<<8; // 360' Wheel
else
- return readinputport(5); // 270' Wheel
+ return input_port_read_indexed(machine, 5); // 270' Wheel
}
static WRITE16_HANDLER( gtmr_oki_0_bank_w )
@@ -708,16 +708,16 @@ ADDRESS_MAP_END
static READ16_HANDLER( gtmr2_wheel_r )
{
- switch (readinputport(4) & 0x1800)
+ switch (input_port_read_indexed(machine, 4) & 0x1800)
{
case 0x0000: // 270' A. Wheel
- return (readinputport(5));
+ return (input_port_read_indexed(machine, 5));
break;
case 0x1000: // 270' D. Wheel
- return (readinputport(6) << 8);
+ return (input_port_read_indexed(machine, 6) << 8);
break;
case 0x0800: // 360' Wheel
- return (readinputport(7) << 8);
+ return (input_port_read_indexed(machine, 7) << 8);
break;
default:
logerror("gtmr2_wheel_r : read at %06x with joystick\n", activecpu_get_pc());
@@ -728,7 +728,7 @@ static READ16_HANDLER( gtmr2_wheel_r )
static READ16_HANDLER( gtmr2_IN1_r )
{
- return (readinputport(1) & (readinputport(8) | ~0x7100));
+ return (input_port_read_indexed(machine, 1) & (input_port_read_indexed(machine, 8) | ~0x7100));
}
static ADDRESS_MAP_START( gtmr2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index b6fa68a4740..ec70c43e4e3 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -326,11 +326,11 @@ static READ16_HANDLER( karnov_control_r )
{
switch (offset<<1) {
case 0: /* Player controls */
- return ( readinputportbytag("IN0") + (readinputportbytag("IN1")<<8));
+ return ( input_port_read(machine, "IN0") + (input_port_read(machine, "IN1")<<8));
case 2: /* Start buttons & VBL */
- return readinputportbytag("IN2");
+ return input_port_read(machine, "IN2");
case 4: /* Dipswitch A & B */
- return ( readinputportbytag("DSW1") + (readinputportbytag("DSW2")<<8));
+ return ( input_port_read(machine, "DSW1") + (input_port_read(machine, "DSW2")<<8));
case 6: /* i8751 return values */
return i8751_return;
}
@@ -652,13 +652,13 @@ static INTERRUPT_GEN( karnov_interrupt )
static int latch;
/* Coin input to the i8751 generates an interrupt to the main cpu */
- if (readinputport(3) == coin_mask) latch=1;
- if (readinputport(3) != coin_mask && latch) {
+ if (input_port_read_indexed(machine, 3) == coin_mask) latch=1;
+ if (input_port_read_indexed(machine, 3) != coin_mask && latch) {
if (i8751_needs_ack) {
/* i8751 is busy - queue the command */
- i8751_coin_pending=readinputport(3) | 0x8000;
+ i8751_coin_pending=input_port_read_indexed(machine, 3) | 0x8000;
} else {
- i8751_return=readinputport(3) | 0x8000;
+ i8751_return=input_port_read_indexed(machine, 3) | 0x8000;
cpunum_set_input_line(machine, 0,6,HOLD_LINE);
i8751_needs_ack=1;
}
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index a91d007afef..ffbed9e5db5 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -313,7 +313,7 @@ static READ32_HANDLER( kinst_control_r )
switch (offset)
{
case 2: /* $90 -- sound return */
- result = 0xffff0000 | readinputport(offset);
+ result = 0xffff0000 | input_port_read_indexed(machine, offset);
result &= ~0x0002;
if (dcs_control_r() & 0x800)
result |= 0x0002;
@@ -322,11 +322,11 @@ static READ32_HANDLER( kinst_control_r )
case 0: /* $80 */
case 1: /* $88 */
case 3: /* $98 */
- result = 0xffff0000 | readinputport(offset);
+ result = 0xffff0000 | input_port_read_indexed(machine, offset);
break;
case 4: /* $a0 */
- result = 0xffff0000 | readinputport(offset);
+ result = 0xffff0000 | input_port_read_indexed(machine, offset);
if (activecpu_get_pc() == 0x802d428)
cpu_spinuntil_int();
break;
diff --git a/src/mame/drivers/kinstb.c b/src/mame/drivers/kinstb.c
index 25c8036fd24..de436077c96 100644
--- a/src/mame/drivers/kinstb.c
+++ b/src/mame/drivers/kinstb.c
@@ -46,9 +46,9 @@ static READ8_HANDLER(sharedram_r)
static INT32 oldinput=0;
INT32 coincnt;
#ifdef MAME_DEBUG
- INT32 input=readinputport(13);
+ INT32 input=input_port_read_indexed(machine, 13);
#else
- INT32 input=readinputport(10);
+ INT32 input=input_port_read_indexed(machine, 10);
#endif
if(input&3)
diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c
index 4523a4aa4fd..ebe9af9f5e6 100644
--- a/src/mame/drivers/klax.c
+++ b/src/mame/drivers/klax.c
@@ -47,7 +47,7 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(const device_config *screen, int scanline)
{
/* generate 32V signals */
- if ((scanline & 32) == 0 && !(readinputport(0) & 0x800))
+ if ((scanline & 32) == 0 && !(input_port_read_indexed(screen->machine, 0) & 0x800))
atarigen_scanline_int_gen(screen->machine, 0);
}
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index 48ab63fc194..d6d3215e68e 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -525,7 +525,7 @@ static READ32_HANDLER( trackball_r )
for( axis = 0; axis < 2; axis++ )
{
- value = readinputport( axis + 3 );
+ value = input_port_read_indexed(machine, axis + 3 );
diff = value - trackball_prev[ axis ];
trackball_prev[ axis ] = value;
trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
@@ -610,7 +610,7 @@ static READ32_HANDLER( btc_trackball_r )
for( axis = 0; axis < 4; axis++ )
{
- value = readinputport( axis + 3 );
+ value = input_port_read_indexed(machine, axis + 3 );
diff = value - btc_trackball_prev[ axis ];
btc_trackball_prev[ axis ] = value;
btc_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index 4ce01680722..2d77125d953 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -489,7 +489,7 @@ static READ32_HANDLER( eeprom_r )
// excpuint stat, objdma stat, eeprom do
// note: racin' force expects bit 1 of the eeprom port to toggle
- return(readinputport(6)<<24 | readinputport(7)<<16 | readinputport(0)<<8 | EEPROM_read_bit() | gx_rdport1_3);
+ return(input_port_read_indexed(machine, 6)<<24 | input_port_read_indexed(machine, 7)<<16 | input_port_read_indexed(machine, 0)<<8 | EEPROM_read_bit() | gx_rdport1_3);
}
static WRITE32_HANDLER( eeprom_w )
@@ -870,9 +870,9 @@ static double adc0834_callback( int input )
switch( input )
{
case ADC083X_CH0:
- return ( (double)5 * readinputport( 9 ) ) / 255; // steer
+ return ( (double)5 * input_port_read_indexed(Machine, 9 ) ) / 255; // steer
case ADC083X_CH1:
- return ( (double)5 * readinputport( 10 ) ) / 255; // gas
+ return ( (double)5 * input_port_read_indexed(Machine, 10 ) ) / 255; // gas
case ADC083X_VREF:
return 5;
}
@@ -881,23 +881,23 @@ static double adc0834_callback( int input )
static READ32_HANDLER( le2_gun_H_r )
{
- int p1x = readinputport(9)*287/0xff+22;
- int p2x = readinputport(11)*287/0xff+22;
+ int p1x = input_port_read_indexed(machine, 9)*287/0xff+22;
+ int p2x = input_port_read_indexed(machine, 11)*287/0xff+22;
return (p1x<<16)|p2x;
}
static READ32_HANDLER( le2_gun_V_r )
{
- int p1y = readinputport(10)*223/0xff+1;
- int p2y = readinputport(12)*223/0xff+1;
+ int p1y = input_port_read_indexed(machine, 10)*223/0xff+1;
+ int p2y = input_port_read_indexed(machine, 12)*223/0xff+1;
return (p1y<<16)|p2y;
}
static READ32_HANDLER( service_r )
{
- int res = (readinputport(1)<<24) | (readinputport(8)<<8);
+ int res = (input_port_read_indexed(machine, 1)<<24) | (input_port_read_indexed(machine, 8)<<8);
if (init_eeprom_count)
{
@@ -910,7 +910,7 @@ static READ32_HANDLER( service_r )
static READ32_HANDLER( players_r )
{
- return (readinputport(2)<<24) | (readinputport(3)<<16) | (readinputport(4)<<8) | (readinputport(5));
+ return (input_port_read_indexed(machine, 2)<<24) | (input_port_read_indexed(machine, 3)<<16) | (input_port_read_indexed(machine, 4)<<8) | (input_port_read_indexed(machine, 5));
}
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 20ad1768c8a..1a79c3666e4 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -205,6 +205,7 @@
*/
#include "driver.h"
+#include "deprecat.h"
#include "cdrom.h"
#include "cpu/mips/psx.h"
#include "includes/psx.h"
@@ -300,11 +301,11 @@ static READ32_HANDLER( jamma_r )
switch (offset)
{
case 0:
- data = readinputport(0);
+ data = input_port_read_indexed(machine, 0);
break;
case 1:
{
- data = readinputport(1);
+ data = input_port_read_indexed(machine, 1);
data |= 0x000000c0;
if( has_ds2401[ security_cart_number ] )
@@ -340,10 +341,10 @@ static READ32_HANDLER( jamma_r )
break;
}
case 2:
- data = readinputport(2);
+ data = input_port_read_indexed(machine, 2);
break;
case 3:
- data = readinputport(3);
+ data = input_port_read_indexed(machine, 3);
break;
}
@@ -1385,13 +1386,13 @@ static double analogue_inputs_callback( int input )
switch( input )
{
case ADC083X_CH0:
- return (double) ( readinputportbytag_safe( "analog0", 0 ) * 5 ) / 255;
+ return (double) ( input_port_read_safe(Machine, "analog0", 0 ) * 5 ) / 255;
case ADC083X_CH1:
- return (double) ( readinputportbytag_safe( "analog1", 0 ) * 5 ) / 255;
+ return (double) ( input_port_read_safe(Machine, "analog1", 0 ) * 5 ) / 255;
case ADC083X_CH2:
- return (double) ( readinputportbytag_safe( "analog2", 0 ) * 5 ) / 255;
+ return (double) ( input_port_read_safe(Machine, "analog2", 0 ) * 5 ) / 255;
case ADC083X_CH3:
- return (double) ( readinputportbytag_safe( "analog3", 0 ) * 5 ) / 255;
+ return (double) ( input_port_read_safe(Machine, "analog3", 0 ) * 5 ) / 255;
case ADC083X_AGND:
return 0;
case ADC083X_VREF:
@@ -1537,10 +1538,10 @@ static const struct PSXSPUinterface konami573_psxspu_interface =
psx_dma_install_write_handler
};
-static void update_mode( void )
+static void update_mode( running_machine *machine )
{
- int cart = readinputportbytag( "CART" );
- int cd = readinputportbytag( "CD" );
+ int cart = input_port_read(machine, "CART" );
+ int cd = input_port_read(machine, "CD" );
static SCSIInstance *new_cdrom;
if( chiptype[ 1 ] != 0 )
@@ -1570,7 +1571,7 @@ static void update_mode( void )
static INTERRUPT_GEN( sys573_vblank )
{
- update_mode();
+ update_mode(machine);
if( strcmp( machine->gamedrv->name, "ddr2ml" ) == 0 )
{
@@ -1604,8 +1605,8 @@ static READ32_HANDLER( ge765pwbba_r )
switch( offset )
{
case 0x26:
- uPD4701_y_add( 0, readinputportbytag_safe( "uPD4701_y", 0 ) );
- uPD4701_switches_set( 0, readinputportbytag_safe( "uPD4701_switches", 0 ) );
+ uPD4701_y_add( 0, input_port_read_safe(machine, "uPD4701_y", 0 ) );
+ uPD4701_switches_set( 0, input_port_read_safe(machine, "uPD4701_switches", 0 ) );
uPD4701_cs_w( 0, 0 );
uPD4701_xy_w( 0, 1 );
@@ -1881,7 +1882,7 @@ static void gn845pwbb_clk_w( int offset, int data )
static CUSTOM_INPUT( gn845pwbb_read )
{
- return readinputportbytag( "STAGE" ) & stage_mask;
+ return input_port_read(machine, "STAGE" ) & stage_mask;
}
static void gn845pwbb_output_callback( int offset, int data )
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index afafcc2a8c8..2f645e20724 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -154,7 +154,7 @@ static INPUT_CHANGED( coin2_inserted )
static CUSTOM_INPUT( ladybug_p1_control_r )
{
- return readinputportbytag(LADYBUG_P1_CONTROL_PORT_TAG);
+ return input_port_read(machine, LADYBUG_P1_CONTROL_PORT_TAG);
}
static CUSTOM_INPUT( ladybug_p2_control_r )
@@ -162,10 +162,10 @@ static CUSTOM_INPUT( ladybug_p2_control_r )
UINT32 ret;
/* upright cabinet only uses a single set of controls */
- if (readinputportbytag("DSW0") & 0x20)
- ret = readinputportbytag(LADYBUG_P2_CONTROL_PORT_TAG);
+ if (input_port_read(machine, "DSW0") & 0x20)
+ ret = input_port_read(machine, LADYBUG_P2_CONTROL_PORT_TAG);
else
- ret = readinputportbytag(LADYBUG_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(machine, LADYBUG_P1_CONTROL_PORT_TAG);
return ret;
}
diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c
index a35758cdc17..b4c6536016d 100644
--- a/src/mame/drivers/laserbat.c
+++ b/src/mame/drivers/laserbat.c
@@ -91,7 +91,7 @@ static WRITE8_HANDLER( laserbat_input_mux_w )
static READ8_HANDLER( laserbat_input_r )
{
// Add coktail inputs
- return readinputport(0 + laserbat_input_mux);
+ return input_port_read_indexed(machine, 0 + laserbat_input_mux);
}
static WRITE8_HANDLER( laserbat_cnteff_w )
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index ffb744df1a2..3cb527d25b4 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -306,12 +306,12 @@ static READ16_HANDLER( lastfght_c00002_r )
{
// high byte:
// mask 0x1c: from sound?
- return (mame_rand(Machine) & 0x1c00) | readinputport(0);
+ return (mame_rand(Machine) & 0x1c00) | input_port_read_indexed(machine, 0);
}
static READ16_HANDLER( lastfght_c00004_r )
{
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
static READ16_HANDLER( lastfght_c00006_r )
@@ -319,7 +319,7 @@ static READ16_HANDLER( lastfght_c00006_r )
// low byte:
// bit 7 = protection?
// bit 5 = blitter?
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
static WRITE16_HANDLER( lastfght_c00006_w )
diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c
index a9cf6d9dca1..7782fa78a1a 100644
--- a/src/mame/drivers/lemmings.c
+++ b/src/mame/drivers/lemmings.c
@@ -33,10 +33,10 @@ static WRITE16_HANDLER( lemmings_control_w )
static READ16_HANDLER( lemmings_trackball_r )
{
switch (offset) {
- case 0: return readinputport(4); break;
- case 1: return readinputport(5); break;
- case 4: return readinputport(6); break;
- case 5: return readinputport(7); break;
+ case 0: return input_port_read_indexed(machine, 4); break;
+ case 1: return input_port_read_indexed(machine, 5); break;
+ case 4: return input_port_read_indexed(machine, 6); break;
+ case 5: return input_port_read_indexed(machine, 7); break;
}
return 0;
}
@@ -46,13 +46,13 @@ static READ16_HANDLER( lemmings_prot_r )
{
switch (offset<<1) {
case 0x41a: /* Player input */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x320: /* Coins */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x4e6: /* Dips */
- return (readinputport(2) + (readinputport(3) << 8));
+ return (input_port_read_indexed(machine, 2) + (input_port_read_indexed(machine, 3) << 8));
}
return 0;
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index 930a254f233..b22404cff4f 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -177,8 +177,8 @@ maybe some priority issues / sprite placement issues..
#define SOUND_CLOCK XTAL_18_432MHz
-#define GUNX( a ) (( ( readinputport( a ) * 287 ) / 0xff ) + 16)
-#define GUNY( a ) (( ( readinputport( a ) * 223 ) / 0xff ) + 10)
+#define GUNX( a ) (( ( input_port_read_indexed(machine, a ) * 287 ) / 0xff ) + 16)
+#define GUNY( a ) (( ( input_port_read_indexed(machine, a ) * 223 ) / 0xff ) + 10)
VIDEO_START(lethalen);
VIDEO_UPDATE(lethalen);
diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c
index 7cf64c0d225..372565310d8 100644
--- a/src/mame/drivers/lethalj.c
+++ b/src/mame/drivers/lethalj.c
@@ -70,7 +70,7 @@ static CUSTOM_INPUT( ticket_status )
static CUSTOM_INPUT( cclownz_paddle )
{
- int value = readinputportbytag("PADDLE");
+ int value = input_port_read(machine, "PADDLE");
return ((value << 4) & 0xf00) | (value & 0x00f);
}
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 97abed41190..6ef7fb9d6d9 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -70,11 +70,11 @@ static READ8_HANDLER( deco16_io_r )
const UINT8 *ROM = memory_region(REGION_CPU1);
if (deco16_bank) {
- if (offset==0) return readinputportbytag("IN1"); /* Player 1 controls */
- if (offset==1) return readinputportbytag("IN2"); /* Player 2 controls */
- if (offset==2) return readinputportbytag("IN3"); /* Vblank, coins */
- if (offset==3) return readinputportbytag("DSW1"); /* Dip 1 */
- if (offset==4) return readinputportbytag("DSW2"); /* Dip 2 */
+ if (offset==0) return input_port_read(machine, "IN1"); /* Player 1 controls */
+ if (offset==1) return input_port_read(machine, "IN2"); /* Player 2 controls */
+ if (offset==2) return input_port_read(machine, "IN3"); /* Vblank, coins */
+ if (offset==3) return input_port_read(machine, "DSW1"); /* Dip 1 */
+ if (offset==4) return input_port_read(machine, "DSW2"); /* Dip 2 */
logerror("%04x: Read input %d\n",activecpu_get_pc(),offset);
return 0xff;
@@ -498,7 +498,7 @@ GFXDECODE_END
static INTERRUPT_GEN( deco16_interrupt )
{
static int latch=0;
- int p=~readinputport(3);
+ int p=~input_port_read_indexed(machine, 3);
if (p&0x43 && !latch) {
cpunum_set_input_line(machine, 0,DECO16_IRQ_LINE,ASSERT_LINE);
latch=1;
diff --git a/src/mame/drivers/liberatr.c b/src/mame/drivers/liberatr.c
index 3fec9e7f778..3da27294d03 100644
--- a/src/mame/drivers/liberatr.c
+++ b/src/mame/drivers/liberatr.c
@@ -177,8 +177,8 @@ static WRITE8_HANDLER( liberatr_trackball_reset_w )
/* input becomes the starting point for the trackball counters */
if (((data ^ ctrld) & 0x10) && (data & 0x10))
{
- UINT8 trackball = readinputport(4);
- UINT8 switches = readinputport(0);
+ UINT8 trackball = input_port_read_indexed(machine, 4);
+ UINT8 switches = input_port_read_indexed(machine, 0);
trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f);
}
ctrld = data & 0x10;
@@ -190,13 +190,13 @@ static READ8_HANDLER( liberatr_input_port_0_r )
/* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */
if (ctrld)
{
- UINT8 trackball = readinputport(4);
+ UINT8 trackball = input_port_read_indexed(machine, 4);
return ((trackball & 0xf0) - (trackball_offset & 0xf0)) | ((trackball - trackball_offset) & 0x0f);
}
/* otherwise, the LS191 is simply passing through the raw switch inputs */
else
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 46e6dfa2cd4..0c06c400659 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -39,7 +39,7 @@ static UINT32 *mainram;
static READ32_HANDLER( port2_r )
{
- return (EEPROM_read_bit() << 23) | (readinputport(2) & ~(1<<23));
+ return (EEPROM_read_bit() << 23) | (input_port_read_indexed(machine, 2) & ~(1<<23));
}
static WRITE32_HANDLER( eeprom_w )
diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c
index a569b33a4aa..68206b2a866 100644
--- a/src/mame/drivers/lockon.c
+++ b/src/mame/drivers/lockon.c
@@ -359,10 +359,10 @@ static READ8_HANDLER( adc_r )
{
switch (offset)
{
- case 0: return readinputportbytag("ADC_BANK");
- case 1: return readinputportbytag("ADC_PITCH");
- case 2: return readinputportbytag("ADC_MISSILE");
- case 3: return readinputportbytag("ADC_HOVER");
+ case 0: return input_port_read(machine, "ADC_BANK");
+ case 1: return input_port_read(machine, "ADC_PITCH");
+ case 2: return input_port_read(machine, "ADC_MISSILE");
+ case 3: return input_port_read(machine, "ADC_HOVER");
default: return 0;
}
}
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index 1fb9f930a68..8507e318410 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -55,7 +55,7 @@ WRITE16_HANDLER( lordgun_vram_1_w );
WRITE16_HANDLER( lordgun_vram_2_w );
WRITE16_HANDLER( lordgun_vram_3_w );
-void lordgun_update_gun(int i);
+void lordgun_update_gun(running_machine *machine, int i);
VIDEO_START( lordgun );
VIDEO_UPDATE( lordgun );
@@ -111,7 +111,7 @@ static WRITE8_HANDLER(fake2_w)
static READ8_HANDLER( lordgun_eeprom_r )
{
- return readinputport(0) | ((EEPROM_read_bit() & 1) << 7);
+ return input_port_read_indexed(machine, 0) | ((EEPROM_read_bit() & 1) << 7);
}
static WRITE8_HANDLER( lordgun_eeprom_w )
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( lordgun_eeprom_w )
// Update light guns positions
for (i = 0; i < 2; i++)
if ( (data & (0x04 << i)) && !(old & (0x04 << i)) )
- lordgun_update_gun(i);
+ lordgun_update_gun(machine, i);
// latch the bit
EEPROM_write_bit(data & 0x40);
diff --git a/src/mame/drivers/lvcards.c b/src/mame/drivers/lvcards.c
index 450504ab910..6303c4920c6 100644
--- a/src/mame/drivers/lvcards.c
+++ b/src/mame/drivers/lvcards.c
@@ -136,7 +136,7 @@ static WRITE8_HANDLER(control_port_2a_w)
static READ8_HANDLER( payout_r )
{
- result = readinputport(2);
+ result = input_port_read_indexed(machine, 2);
if (payout)
{
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index cefa37a845c..7ad4b257c15 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -181,10 +181,10 @@ static WRITE8_HANDLER( m10_ctrl_w )
/* I have NO IDEA if this is correct or not */
state->bottomline = ~data & 0x20;
- if (readinputportbytag("CAB") & 0x01)
+ if (input_port_read(machine, "CAB") & 0x01)
state->flip = ~data & 0x10;
- if (!(readinputportbytag("CAB") & 0x02))
+ if (!(input_port_read(machine, "CAB") & 0x02))
sound_global_enable(~data & 0x80);
/* sound command in lower 4 bytes */
@@ -257,10 +257,10 @@ static WRITE8_HANDLER( m11_ctrl_w )
state->bottomline = ~data & 0x20;
- if (readinputportbytag("CAB") & 0x01)
+ if (input_port_read(machine, "CAB") & 0x01)
state->flip = ~data & 0x10;
- if (!(readinputportbytag("CAB") & 0x02))
+ if (!(input_port_read(machine, "CAB") & 0x02))
sound_global_enable(~data & 0x80);
}
@@ -287,9 +287,9 @@ static WRITE8_HANDLER( m15_ctrl_w )
if (data & 0xF0)
popmessage("M15 ctrl: %02x",data);
#endif
- if (readinputportbytag("CAB") & 0x01)
+ if (input_port_read(machine, "CAB") & 0x01)
state->flip = ~data & 0x04;
- if (!(readinputportbytag("CAB") & 0x02))
+ if (!(input_port_read(machine, "CAB") & 0x02))
sound_global_enable(~data & 0x08);
}
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index e18dbdbe18c..72dfefc5356 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -617,7 +617,7 @@ static READ16_HANDLER( poundfor_trackball_r )
for (i = 0;i < 4;i++)
{
- curr = readinputport(3+i);
+ curr = input_port_read_indexed(machine, 3+i);
diff[i] = (curr - prev[i]);
prev[i] = curr;
}
@@ -629,7 +629,7 @@ static READ16_HANDLER( poundfor_trackball_r )
case 0:
return (diff[0] & 0xff) | ((diff[2] & 0xff) << 8);
case 1:
- return ((diff[0] >> 8) & 0x1f) | (diff[2] & 0x1f00) | (readinputport(0) & 0xe0e0);
+ return ((diff[0] >> 8) & 0x1f) | (diff[2] & 0x1f00) | (input_port_read_indexed(machine, 0) & 0xe0e0);
case 2:
return (diff[1] & 0xff) | ((diff[3] & 0xff) << 8);
case 3:
diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c
index e32c7ae6ecb..97eb6d8fa86 100644
--- a/src/mame/drivers/macrossp.c
+++ b/src/mame/drivers/macrossp.c
@@ -236,12 +236,12 @@ VIDEO_EOF(macrossp);
static READ32_HANDLER ( macrossp_ports1_r )
{
- return ((readinputport(0) << 16) | (readinputport(1) << 0));
+ return ((input_port_read_indexed(machine, 0) << 16) | (input_port_read_indexed(machine, 1) << 0));
}
static READ32_HANDLER ( macrossp_ports2_r )
{
- return ((readinputport(2) << 16) | (readinputport(3) << 0));
+ return ((input_port_read_indexed(machine, 2) << 16) | (input_port_read_indexed(machine, 3) << 0));
}
static WRITE32_HANDLER( paletteram32_macrossp_w )
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index fcb846204f1..5bc59c4dcf5 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -95,23 +95,23 @@ static READ8_HANDLER( macs_input_r )
/*It's bit-wise*/
switch(macs_mux_data&0x0f)
{
- case 0x00: return readinputportbytag("IN0");
- case 0x01: return readinputportbytag("IN1");
- case 0x02: return readinputportbytag("IN2");
- case 0x04: return readinputportbytag("IN3");
- case 0x08: return readinputportbytag("IN4");
+ case 0x00: return input_port_read(machine, "IN0");
+ case 0x01: return input_port_read(machine, "IN1");
+ case 0x02: return input_port_read(machine, "IN2");
+ case 0x04: return input_port_read(machine, "IN3");
+ case 0x08: return input_port_read(machine, "IN4");
default:
logerror("Unmapped mahjong panel mux data %02x\n",macs_mux_data);
return 0xff;
}
}
- case 1: return readinputportbytag("SYS0");
- case 2: return readinputportbytag("DSW0");
- case 3: return readinputportbytag("DSW1");
- case 4: return readinputportbytag("DSW2");
- case 5: return readinputportbytag("DSW3");
- case 6: return readinputportbytag("DSW4");
- case 7: return readinputportbytag("SYS1");
+ case 1: return input_port_read(machine, "SYS0");
+ case 2: return input_port_read(machine, "DSW0");
+ case 3: return input_port_read(machine, "DSW1");
+ case 4: return input_port_read(machine, "DSW2");
+ case 5: return input_port_read(machine, "DSW3");
+ case 6: return input_port_read(machine, "DSW4");
+ case 7: return input_port_read(machine, "SYS1");
default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",activecpu_get_pc(),offset+0xc0);
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index 4136a2abeb5..7dffb58fb2d 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -75,7 +75,7 @@ static READ8_HANDLER( s2636_portA_r )
// POT switch position, read from port A of the first S2636
// Not sure of the correct values to return, but these should
// do based on the game code.
- switch(readinputport(1))
+ switch(input_port_read_indexed(machine, 1))
{
case 0: // Normal play
return 0xf0;
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 6f8fdacd446..c7a7d2da568 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -604,18 +604,18 @@ WRITE8_HANDLER( superpac_flipscreen_w );
***************************************************************************/
static int mux;
-static READ8_HANDLER( in0_l ) { return readinputportbytag("IN0"); } // P1 joystick
-static READ8_HANDLER( in0_h ) { return readinputportbytag("IN0") >> 4; } // P2 joystick
-static READ8_HANDLER( in1_l ) { return readinputportbytag("IN1"); } // fire and start buttons
-static READ8_HANDLER( in1_h ) { return readinputportbytag("IN1") >> 4; } // coins
-static READ8_HANDLER( in2 ) { return readinputportbytag("DSW0"); } // test, cocktail, optional buttons
-static READ8_HANDLER( dipA_l ) { return readinputportbytag("DSW1"); } // dips A
-static READ8_HANDLER( dipA_h ) { return readinputportbytag("DSW1") >> 4; } // dips A
-static READ8_HANDLER( dipB_mux ) { return readinputportbytag("DSW2") >> (4*mux); } // dips B
+static READ8_HANDLER( in0_l ) { return input_port_read(machine, "IN0"); } // P1 joystick
+static READ8_HANDLER( in0_h ) { return input_port_read(machine, "IN0") >> 4; } // P2 joystick
+static READ8_HANDLER( in1_l ) { return input_port_read(machine, "IN1"); } // fire and start buttons
+static READ8_HANDLER( in1_h ) { return input_port_read(machine, "IN1") >> 4; } // coins
+static READ8_HANDLER( in2 ) { return input_port_read(machine, "DSW0"); } // test, cocktail, optional buttons
+static READ8_HANDLER( dipA_l ) { return input_port_read(machine, "DSW1"); } // dips A
+static READ8_HANDLER( dipA_h ) { return input_port_read(machine, "DSW1") >> 4; } // dips A
+static READ8_HANDLER( dipB_mux ) { return input_port_read(machine, "DSW2") >> (4*mux); } // dips B
static READ8_HANDLER( dipB_muxi ) // dips B
{
// bits are interleaved in Phozon
- return BITSWAP8(readinputport(4),6,4,2,0,7,5,3,1) >> (4*mux);
+ return BITSWAP8(input_port_read_indexed(machine, 4),6,4,2,0,7,5,3,1) >> (4*mux);
}
static WRITE8_HANDLER( out_mux ) { mux = data & 1; }
static WRITE8_HANDLER( out_lamps )
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index 435d9509f35..da18efd5451 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -133,7 +133,7 @@ static READ8_HANDLER( marinedt_port1_r )
//might need to be reversed for cocktail stuff
/* x/y multiplexed */
- return readinputport(3 + ((marinedt_pf&0x08)>>3));
+ return input_port_read_indexed(machine, 3 + ((marinedt_pf&0x08)>>3));
}
static READ8_HANDLER( marinedt_coll_r )
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index fb2ec03dd30..41eabe49df7 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -46,7 +46,7 @@ static emu_timer *mcu_timer;
static READ8_HANDLER( mcu_portA_r )
{
- portA_in = readinputport(5) | (readinputport(4) << 4) | (readinputport(0) << 5);
+ portA_in = input_port_read_indexed(machine, 5) | (input_port_read_indexed(machine, 4) << 4) | (input_port_read_indexed(machine, 0) << 5);
return (portA_in & ~ddrA) | (portA_out & ddrA);
}
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index a65d78d9836..98b1f87eff2 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -60,7 +60,7 @@ static READ8_HANDLER( key_matrix_r )
for (i=0; i<5; i++)
{
if (p & (1 << i))
- ret &= readinputport(i+7-offset*5);
+ ret &= input_port_read_indexed(machine, i+7-offset*5);
}
return ret;
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 10185d92689..f7b31406ffe 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -440,7 +440,7 @@ static READ8_HANDLER( zpu_inputs_r )
if (bcd_7445<10)
{
- ret = readinputport( bcd_7445 );
+ ret = input_port_read_indexed(machine, bcd_7445 );
}
return ret;
}
diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c
index 99874412d3a..b3ea34190ae 100644
--- a/src/mame/drivers/mcatadv.c
+++ b/src/mame/drivers/mcatadv.c
@@ -156,7 +156,7 @@ UINT16* mcatadv_vidregs;
static READ16_HANDLER( mcatadv_dsw_r )
{
- return readinputport(2+offset) << 8;
+ return input_port_read_indexed(machine, 2+offset) << 8;
}
static WRITE16_HANDLER( mcat_soundlatch_w )
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index 4ab441d7840..e9dd9c50433 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -319,9 +319,9 @@ static READ8_HANDLER( solarfox_ip0_r )
/* game in cocktail mode, they don't work at all. So we fake-mux */
/* the controls through player 1's ports */
if (mcr_cocktail_flip)
- return readinputportbytag("SSIO.IP0") | 0x08;
+ return input_port_read(machine, "SSIO.IP0") | 0x08;
else
- return ((readinputportbytag("SSIO.IP0") & ~0x14) | 0x08) | ((readinputportbytag("SSIO.IP0") & 0x08) >> 1) | ((readinputportbytag("SSIO.IP2") & 0x01) << 4);
+ return ((input_port_read(machine, "SSIO.IP0") & ~0x14) | 0x08) | ((input_port_read(machine, "SSIO.IP0") & 0x08) >> 1) | ((input_port_read(machine, "SSIO.IP2") & 0x01) << 4);
}
@@ -329,9 +329,9 @@ static READ8_HANDLER( solarfox_ip1_r )
{
/* same deal as above */
if (mcr_cocktail_flip)
- return readinputportbytag("SSIO.IP1") | 0xf0;
+ return input_port_read(machine, "SSIO.IP1") | 0xf0;
else
- return (readinputportbytag("SSIO.IP1") >> 4) | 0xf0;
+ return (input_port_read(machine, "SSIO.IP1") >> 4) | 0xf0;
}
@@ -344,7 +344,7 @@ static READ8_HANDLER( solarfox_ip1_r )
static READ8_HANDLER( kick_ip1_r )
{
- return (readinputportbytag("DIAL2") << 4) & 0xf0;
+ return (input_port_read(machine, "DIAL2") << 4) & 0xf0;
}
@@ -364,18 +364,18 @@ static WRITE8_HANDLER( wacko_op4_w )
static READ8_HANDLER( wacko_ip1_r )
{
if (!input_mux)
- return readinputportbytag("SSIO.IP1");
+ return input_port_read(machine, "SSIO.IP1");
else
- return readinputportbytag("SSIO.IP1.ALT");
+ return input_port_read(machine, "SSIO.IP1.ALT");
}
static READ8_HANDLER( wacko_ip2_r )
{
if (!input_mux)
- return readinputportbytag("SSIO.IP2");
+ return input_port_read(machine, "SSIO.IP2");
else
- return readinputportbytag("SSIO.IP2.ALT");
+ return input_port_read(machine, "SSIO.IP2.ALT");
}
@@ -388,7 +388,7 @@ static READ8_HANDLER( wacko_ip2_r )
static READ8_HANDLER( kroozr_ip1_r )
{
- int dial = readinputportbytag("DIAL");
+ int dial = input_port_read(machine, "DIAL");
return ((dial & 0x80) >> 1) | ((dial & 0x70) >> 4);
}
@@ -581,13 +581,13 @@ static WRITE8_HANDLER( nflfoot_op4_w )
static READ8_HANDLER( demoderb_ip1_r )
{
- return readinputportbytag(input_mux ? "SSIO.IP1.ALT" : "SSIO.IP1");
+ return input_port_read(machine, input_mux ? "SSIO.IP1.ALT" : "SSIO.IP1");
}
static READ8_HANDLER( demoderb_ip2_r )
{
- return readinputportbytag(input_mux ? "SSIO.IP2.ALT" : "SSIO.IP2");
+ return input_port_read(machine, input_mux ? "SSIO.IP2.ALT" : "SSIO.IP2");
}
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index 4c6604c9d40..da37b632bbe 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -120,13 +120,13 @@ static INT8 maxrpm_p2_shift;
static READ8_HANDLER( demoderm_ip1_r )
{
- return readinputportbytag(input_mux ? "MONO.IP1.ALT" : "MONO.IP1");
+ return input_port_read(machine, input_mux ? "MONO.IP1.ALT" : "MONO.IP1");
}
static READ8_HANDLER( demoderm_ip2_r )
{
- return readinputportbytag(input_mux ? "MONO.IP2.ALT" : "MONO.IP2");
+ return input_port_read(machine, input_mux ? "MONO.IP2.ALT" : "MONO.IP2");
}
@@ -157,8 +157,8 @@ static READ8_HANDLER( maxrpm_ip1_r )
static READ8_HANDLER( maxrpm_ip2_r )
{
static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 };
- UINT8 start = readinputportbytag("MONO.IP0");
- UINT8 shift = readinputportbytag("SHIFT");
+ UINT8 start = input_port_read(machine, "MONO.IP0");
+ UINT8 shift = input_port_read(machine, "SHIFT");
/* reset on a start */
if (!(start & 0x08))
@@ -231,7 +231,7 @@ static WRITE8_HANDLER( maxrpm_op6_w )
/* when the read is toggled is when the ADC value is latched */
if (!(data & 0x80))
- latched_input = readinputportbytag(inputs[maxrpm_adc_select]);
+ latched_input = input_port_read(machine, inputs[maxrpm_adc_select]);
/* when both the write and the enable are low, it's a write to the ADC0844 */
/* unfortunately the behavior below doesn't match up with the inputs on the */
@@ -253,7 +253,7 @@ static WRITE8_HANDLER( maxrpm_op6_w )
static READ8_HANDLER( rampage_ip4_r )
{
- return readinputportbytag("MONO.IP4") | (soundsgood_status_r(machine,0) << 7);
+ return input_port_read(machine, "MONO.IP4") | (soundsgood_status_r(machine,0) << 7);
}
@@ -276,7 +276,7 @@ static WRITE8_HANDLER( rampage_op6_w )
static READ8_HANDLER( powerdrv_ip2_r )
{
- return readinputportbytag("MONO.IP2") | (soundsgood_status_r(machine, 0) << 7);
+ return input_port_read(machine, "MONO.IP2") | (soundsgood_status_r(machine, 0) << 7);
}
@@ -320,7 +320,7 @@ static WRITE8_HANDLER( powerdrv_op6_w )
static READ8_HANDLER( stargrds_ip0_r )
{
- UINT8 result = readinputportbytag(input_mux ? "MONO.IP0.ALT" : "MONO.IP0");
+ UINT8 result = input_port_read(machine, input_mux ? "MONO.IP0.ALT" : "MONO.IP0");
return result | ((soundsgood_status_r(machine, 0) << 4) & 0x10);
}
@@ -361,14 +361,14 @@ static WRITE8_HANDLER( stargrds_op6_w )
static READ8_HANDLER( spyhunt_ip1_r )
{
- return readinputportbytag("SSIO.IP1") | (csdeluxe_status_r(machine, 0) << 5);
+ return input_port_read(machine, "SSIO.IP1") | (csdeluxe_status_r(machine, 0) << 5);
}
static READ8_HANDLER( spyhunt_ip2_r )
{
/* multiplexed steering wheel/gas pedal */
- return readinputportbytag(input_mux ? "SSIO.IP2.ALT" : "SSIO.IP2");
+ return input_port_read(machine, input_mux ? "SSIO.IP2.ALT" : "SSIO.IP2");
}
@@ -420,9 +420,9 @@ static READ8_HANDLER( turbotag_ip2_r )
{
/* multiplexed steering wheel/gas pedal */
if (input_mux)
- return readinputportbytag("SSIO.IP2.ALT");
+ return input_port_read(machine, "SSIO.IP2.ALT");
- return readinputportbytag("SSIO.IP2") + 5 * (video_screen_get_frame_number(machine->primary_screen) & 1);
+ return input_port_read(machine, "SSIO.IP2") + 5 * (video_screen_get_frame_number(machine->primary_screen) & 1);
}
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index ea561678053..a03e82afa04 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -74,8 +74,8 @@ static UINT8 protection_data[5];
READ8_HANDLER( zwackery_port_2_r )
{
- int result = readinputport(2);
- int wheel = readinputport(5);
+ int result = input_port_read_indexed(machine, 2);
+ int wheel = input_port_read_indexed(machine, 5);
return result | ((wheel >> 2) & 0x3e);
}
@@ -135,16 +135,16 @@ static WRITE16_HANDLER( blasted_control_w )
static READ16_HANDLER( spyhunt2_port_0_r )
{
- int result = readinputportbytag("IN0");
+ int result = input_port_read(machine, "IN0");
int which = (control_word >> 3) & 3;
- int analog = readinputport(3 + which);
+ int analog = input_port_read_indexed(machine, 3 + which);
return result | ((soundsgood_status_r(machine, 0) & 1) << 5) | (analog << 8);
}
static READ16_HANDLER( spyhunt2_port_1_r )
{
- int result = readinputportbytag("IN1");
+ int result = input_port_read(machine, "IN1");
return result | ((turbocs_status_r(machine, 0) & 1) << 7);
}
@@ -197,10 +197,10 @@ static const UINT8 translate49[7] = { 0x7, 0x3, 0x1, 0x0, 0xc, 0xe, 0xf };
static READ16_HANDLER( archrivl_port_1_r )
{
- return (translate49[readinputportbytag("49WAYY2") >> 4] << 12) |
- (translate49[readinputportbytag("49WAYX2") >> 4] << 8) |
- (translate49[readinputportbytag("49WAYY1") >> 4] << 4) |
- (translate49[readinputportbytag("49WAYX1") >> 4] << 0);
+ return (translate49[input_port_read(machine, "49WAYY2") >> 4] << 12) |
+ (translate49[input_port_read(machine, "49WAYX2") >> 4] << 8) |
+ (translate49[input_port_read(machine, "49WAYY1") >> 4] << 4) |
+ (translate49[input_port_read(machine, "49WAYX1") >> 4] << 0);
}
@@ -259,18 +259,18 @@ static READ16_HANDLER( pigskin_protection_r )
static READ16_HANDLER( pigskin_port_1_r )
{
/* see archrivl_port_1_r for 49-way joystick description */
- return readinputportbytag("IN1") |
- (translate49[readinputportbytag("49WAYX1") >> 4] << 12) |
- (translate49[readinputportbytag("49WAYY1") >> 4] << 8);
+ return input_port_read(machine, "IN1") |
+ (translate49[input_port_read(machine, "49WAYX1") >> 4] << 12) |
+ (translate49[input_port_read(machine, "49WAYY1") >> 4] << 8);
}
static READ16_HANDLER( pigskin_port_2_r )
{
/* see archrivl_port_1_r for 49-way joystick description */
- return readinputportbytag("DSW") |
- (translate49[readinputportbytag("49WAYX2") >> 4] << 12) |
- (translate49[readinputportbytag("49WAYY2") >> 4] << 8);
+ return input_port_read(machine, "DSW") |
+ (translate49[input_port_read(machine, "49WAYX2") >> 4] << 12) |
+ (translate49[input_port_read(machine, "49WAYY2") >> 4] << 8);
}
@@ -283,9 +283,9 @@ static READ16_HANDLER( pigskin_port_2_r )
static READ16_HANDLER( trisport_port_1_r )
{
- int xaxis = (INT8)readinputportbytag("AN1");
- int yaxis = (INT8)readinputportbytag("AN2");
- int result = readinputportbytag("IN1");
+ int xaxis = (INT8)input_port_read(machine, "AN1");
+ int yaxis = (INT8)input_port_read(machine, "AN2");
+ int result = input_port_read(machine, "IN1");
result |= (xaxis & 0x3c) << 6;
result |= (yaxis & 0x3c) << 10;
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 4fc05e970b5..bd481570ff6 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -508,20 +508,20 @@ static READ32_HANDLER( parallel_port_r )
if (ACCESSING_BITS_8_15)
{
- UINT8 nibble = parallel_latched;//(readinputport(parallel_pointer / 3) >> (4 * (parallel_pointer % 3))) & 15;
+ UINT8 nibble = parallel_latched;//(input_port_read_indexed(machine, parallel_pointer / 3) >> (4 * (parallel_pointer % 3))) & 15;
r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
logerror("%08X:parallel_port_r()\n", activecpu_get_pc());
/* if (controls_data == 0x18)
{
- r |= readinputport(0) << 8;
+ r |= input_port_read_indexed(machine, 0) << 8;
}
else if (controls_data == 0x60)
{
- r |= readinputport(1) << 8;
+ r |= input_port_read_indexed(machine, 1) << 8;
}
else if (controls_data == 0xff || controls_data == 0x50)
{
- r |= readinputport(2) << 8;
+ r |= input_port_read_indexed(machine, 2) << 8;
}
//r |= control_read << 8;*/
@@ -557,7 +557,7 @@ static WRITE32_HANDLER( parallel_port_w )
logerror("%08X:", activecpu_get_pc());
- parallel_latched = (readinputport(parallel_pointer / 3) >> (4 * (parallel_pointer % 3))) & 15;
+ parallel_latched = (input_port_read_indexed(machine, parallel_pointer / 3) >> (4 * (parallel_pointer % 3))) & 15;
// parallel_pointer++;
// logerror("[%02X] Advance pointer to %d\n", data, parallel_pointer);
switch (data & 0xfc)
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index 01d55d05f7f..24d089aef85 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -1708,21 +1708,21 @@ INPUT_PORTS_START( aladbl )
INPUT_PORTS_END
-#define MODE_BUTTON(player) ( (readinputport(player) & 0x800) >> 11 )
-#define Z_BUTTON(player) ( (readinputport(player) & 0x400) >> 10 )
-#define Y_BUTTON(player) ( (readinputport(player) & 0x200) >> 9 )
-#define X_BUTTON(player) ( (readinputport(player) & 0x100) >> 8 )
-
-
-#define START_BUTTON(player) ( (readinputport(player) & 0x80) >> 7 )
-#define C_BUTTON(player) ( (readinputport(player) & 0x40) >> 6 )
-#define B_BUTTON(player) ( (readinputport(player) & 0x20) >> 5 )
-#define A_BUTTON(player) ( (readinputport(player) & 0x10) >> 4 )
-#define RIGHT_BUTTON(player) ( (readinputport(player) & 0x08) >> 3 )
-#define LEFT_BUTTON(player) ( (readinputport(player) & 0x04) >> 2 )
-#define DOWN_BUTTON(player) ( (readinputport(player) & 0x02) >> 1 )
-#define UP_BUTTON(player) ( (readinputport(player) & 0x01) >> 0 )
-#define MD_RESET_BUTTON ( (readinputportbytag_safe("RESET",0x00) & 0x01) >> 0 )
+#define MODE_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x800) >> 11 )
+#define Z_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x400) >> 10 )
+#define Y_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x200) >> 9 )
+#define X_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x100) >> 8 )
+
+
+#define START_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x80) >> 7 )
+#define C_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x40) >> 6 )
+#define B_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x20) >> 5 )
+#define A_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x10) >> 4 )
+#define RIGHT_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x08) >> 3 )
+#define LEFT_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x04) >> 2 )
+#define DOWN_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x02) >> 1 )
+#define UP_BUTTON(player) ( (input_port_read_indexed(Machine, player) & 0x01) >> 0 )
+#define MD_RESET_BUTTON ( (input_port_read_safe(Machine, "RESET",0x00) & 0x01) >> 0 )
static UINT8 megadrive_io_data_regs[3];
static UINT8 megadrive_io_ctrl_regs[3];
@@ -2909,7 +2909,7 @@ static UINT16 vdp_get_word_from_68k_mem_svp(UINT32 source)
/* emulate testmode plug */
static UINT8 megadrive_io_read_data_port_svp(int portnum)
{
- if (portnum == 0 && readinputportbytag_safe("MEMORY_TEST", 0x00))
+ if (portnum == 0 && input_port_read_safe(Machine, "MEMORY_TEST", 0x00))
{
return (megadrive_io_data_regs[0] & 0xc0);
}
@@ -4755,7 +4755,7 @@ MACHINE_RESET( megadriv )
/* default state of z80 = reset, with bus */
mame_printf_debug("Resetting Megadrive / Genesis\n");
- switch (readinputportbytag_safe("REGION",0x00))
+ switch (input_port_read_safe(machine, "REGION",0x00))
{
case 1: // US
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index 357fb167f6c..4567dd53408 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -883,11 +883,11 @@ static READ16_HANDLER ( OLD_megaplay_genesis_io_r )
case 1: /* port A data (joypad 1) */
if (genesis_io_ram[offset] & 0x40)
- return_value = readinputport(1) & (genesis_io_ram[4]^0xff);
+ return_value = input_port_read_indexed(machine, 1) & (genesis_io_ram[4]^0xff);
else
{
- return_value = readinputport(2) & (genesis_io_ram[4]^0xff);
- return_value |= readinputport(1) & 0x03;
+ return_value = input_port_read_indexed(machine, 2) & (genesis_io_ram[4]^0xff);
+ return_value |= input_port_read_indexed(machine, 1) & 0x03;
}
return_value = (genesis_io_ram[offset] & 0x80) | return_value;
// logerror ("reading joypad 1 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
@@ -896,11 +896,11 @@ static READ16_HANDLER ( OLD_megaplay_genesis_io_r )
case 2: /* port B data (joypad 2) */
if (genesis_io_ram[offset] & 0x40)
- return_value = readinputport(3) & (genesis_io_ram[5]^0xff);
+ return_value = input_port_read_indexed(machine, 3) & (genesis_io_ram[5]^0xff);
else
{
- return_value = readinputport(4) & (genesis_io_ram[5]^0xff);
- return_value |= readinputport(3) & 0x03;
+ return_value = input_port_read_indexed(machine, 4) & (genesis_io_ram[5]^0xff);
+ return_value |= input_port_read_indexed(machine, 3) & 0x03;
}
return_value = (genesis_io_ram[offset] & 0x80) | return_value;
// logerror ("reading joypad 2 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index 699b8b2964b..e6742b405ae 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -175,14 +175,14 @@ static MACHINE_RESET( megasys1_hachoo )
[ Main CPU - System A / Z ]
***************************************************************************/
-static READ16_HANDLER( coins_r ) {return readinputport(0);} // < 00 | Coins >
-static READ16_HANDLER( player1_r ) {return readinputport(1);} // < 00 | Player 1 >
-static READ16_HANDLER( player2_r ) {return readinputport(2) * 256 +
- readinputport(3);} // < Reserve | Player 2 >
-static READ16_HANDLER( dsw1_r ) {return readinputport(4);} // DSW 1
-static READ16_HANDLER( dsw2_r ) {return readinputport(5);} // DSW 2
-static READ16_HANDLER( dsw_r ) {return readinputport(4) * 256 +
- readinputport(5);} // < DSW 1 | DSW 2 >
+static READ16_HANDLER( coins_r ) {return input_port_read_indexed(machine, 0);} // < 00 | Coins >
+static READ16_HANDLER( player1_r ) {return input_port_read_indexed(machine, 1);} // < 00 | Player 1 >
+static READ16_HANDLER( player2_r ) {return input_port_read_indexed(machine, 2) * 256 +
+ input_port_read_indexed(machine, 3);} // < Reserve | Player 2 >
+static READ16_HANDLER( dsw1_r ) {return input_port_read_indexed(machine, 4);} // DSW 1
+static READ16_HANDLER( dsw2_r ) {return input_port_read_indexed(machine, 5);} // DSW 2
+static READ16_HANDLER( dsw_r ) {return input_port_read_indexed(machine, 4) * 256 +
+ input_port_read_indexed(machine, 5);} // < DSW 1 | DSW 2 >
#define INTERRUPT_NUM_A 3
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index d073d1bf871..b0b20f0d879 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -503,10 +503,10 @@ static WRITE8_HANDLER( bios_ctrl_w )
}
-static READ8_HANDLER( megaplay_r0) { return readinputportbytag("BIOS_IN0") ; }
-static READ8_HANDLER( megaplay_r1) { return readinputportbytag("BIOS_IN1") ; }
-static READ8_HANDLER( megaplay_r2) { return readinputportbytag("BIOS_DSW0") ; }
-static READ8_HANDLER( megaplay_r3) { return readinputportbytag("BIOS_DSW1") ; }
+static READ8_HANDLER( megaplay_r0) { return input_port_read(machine, "BIOS_IN0") ; }
+static READ8_HANDLER( megaplay_r1) { return input_port_read(machine, "BIOS_IN1") ; }
+static READ8_HANDLER( megaplay_r2) { return input_port_read(machine, "BIOS_DSW0") ; }
+static READ8_HANDLER( megaplay_r3) { return input_port_read(machine, "BIOS_DSW1") ; }
static int mt_bank_bank_pos = 0;
static int mt_bank_partial = 0;
diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c
index cd90d9ef2db..3df0bdb5c8c 100644
--- a/src/mame/drivers/meijinsn.c
+++ b/src/mame/drivers/meijinsn.c
@@ -84,7 +84,7 @@ static READ16_HANDLER( alpha_mcu_r )
switch (offset)
{
case 0: /* Dipswitch 2 */
- shared_ram[0] = (source&0xff00)|readinputportbytag("IN2");
+ shared_ram[0] = (source&0xff00)|input_port_read(machine, "IN2");
return 0;
case 0x22: /* Coin value */
@@ -95,15 +95,15 @@ static READ16_HANDLER( alpha_mcu_r )
credits=0;
- if ((readinputportbytag("IN3")&0x3)==3) latch=0;
+ if ((input_port_read(machine, "IN3")&0x3)==3) latch=0;
- if ((readinputportbytag("IN3")&0x1)==0 && !latch)
+ if ((input_port_read(machine, "IN3")&0x1)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(0x22); // coinA
shared_ram[0x22] = (source&0xff00)|0x0;
latch=1;
- coinvalue = (~readinputportbytag("IN2")>>3) & 1;
+ coinvalue = (~input_port_read(machine, "IN2")>>3) & 1;
deposits1++;
if (deposits1 == coinage1[coinvalue][0])
@@ -114,13 +114,13 @@ static READ16_HANDLER( alpha_mcu_r )
else
credits = 0;
}
- else if ((readinputportbytag("IN3")&0x2)==0 && !latch)
+ else if ((input_port_read(machine, "IN3")&0x2)==0 && !latch)
{
shared_ram[0x29] = (source&0xff00)|(0x22); // coinA
shared_ram[0x22] = (source&0xff00)|0x0;
latch=1;
- coinvalue = (~readinputportbytag("IN2")>>3) & 1;
+ coinvalue = (~input_port_read(machine, "IN2")>>3) & 1;
deposits2++;
if (deposits2 == coinage2[coinvalue][0])
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 9d8018e0f46..83b17126cd1 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -261,10 +261,10 @@ static TIMER_CALLBACK(microtouch_timer_callback)
}
// send format tablet packet
- if ( readinputportbytag("TOUCH") & 0x01 )
+ if ( input_port_read(machine, "TOUCH") & 0x01 )
{
- int tx = readinputportbytag("TOUCH_X");
- int ty = readinputportbytag("TOUCH_Y");
+ int tx = input_port_read(machine, "TOUCH_X");
+ int ty = input_port_read(machine, "TOUCH_Y");
if ( microtouch.touch_callback == NULL ||
microtouch.touch_callback( &tx, &ty ) != 0 )
@@ -864,7 +864,7 @@ static const ppi8255_interface crt250_ppi8255_intf =
static READ8_HANDLER(meritm_ay8930_port_a_r)
{
- return readinputportbytag_safe("DSW", 0);
+ return input_port_read_safe(machine, "DSW", 0);
};
static WRITE8_HANDLER(meritm_ay8930_port_b_w)
@@ -922,12 +922,12 @@ static WRITE8_HANDLER(meritm_audio_pio_port_b_w)
static READ8_HANDLER(meritm_io_pio_port_a_r)
{
- return readinputportbytag("PIO1_PORTA");
+ return input_port_read(machine, "PIO1_PORTA");
};
static READ8_HANDLER(meritm_io_pio_port_b_r)
{
- return readinputportbytag("PIO1_PORTB");
+ return input_port_read(machine, "PIO1_PORTB");
};
static WRITE8_HANDLER(meritm_io_pio_port_a_w)
diff --git a/src/mame/drivers/metlclsh.c b/src/mame/drivers/metlclsh.c
index 4a7604ba2db..8140cb12653 100644
--- a/src/mame/drivers/metlclsh.c
+++ b/src/mame/drivers/metlclsh.c
@@ -302,7 +302,7 @@ static INTERRUPT_GEN( metlclsh_interrupt2 )
if (cpu_getiloops() == 0)
return;
/* generate NMI on coin insertion */
- if ((~readinputport(2) & 0xc0) || (~readinputport(3) & 0x40))
+ if ((~input_port_read_indexed(machine, 2) & 0xc0) || (~input_port_read_indexed(machine, 3) & 0x40))
cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
}
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index 01e258aa485..f517caf6a19 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -374,7 +374,7 @@ static READ16_HANDLER( metro_soundstatus_r )
static READ16_HANDLER( daitorid_soundstatus_r )
{
- return readinputport(0) | (busy_sndcpu ? 0x80 : 0x00);
+ return input_port_read_indexed(machine, 0) | (busy_sndcpu ? 0x80 : 0x00);
}
static WRITE16_HANDLER( metro_soundstatus_w )
@@ -908,9 +908,9 @@ ADDRESS_MAP_END
/* Really weird way of mapping 3 DSWs */
static READ16_HANDLER( balcube_dsw_r )
{
- UINT16 dsw1 = readinputport(2) >> 0;
- UINT16 dsw2 = readinputport(2) >> 8;
- UINT16 dsw3 = readinputport(3);
+ UINT16 dsw1 = input_port_read_indexed(machine, 2) >> 0;
+ UINT16 dsw2 = input_port_read_indexed(machine, 2) >> 8;
+ UINT16 dsw3 = input_port_read_indexed(machine, 3);
switch (offset*2)
{
@@ -1415,11 +1415,11 @@ static READ16_HANDLER( gakusai_input_r )
{
UINT16 input_sel = (*gakusai_input_sel) ^ 0x3e;
// Bit 0 ??
- if (input_sel & 0x0002) return readinputport(0);
- if (input_sel & 0x0004) return readinputport(1);
- if (input_sel & 0x0008) return readinputport(2);
- if (input_sel & 0x0010) return readinputport(3);
- if (input_sel & 0x0020) return readinputport(4);
+ if (input_sel & 0x0002) return input_port_read_indexed(machine, 0);
+ if (input_sel & 0x0004) return input_port_read_indexed(machine, 1);
+ if (input_sel & 0x0008) return input_port_read_indexed(machine, 2);
+ if (input_sel & 0x0010) return input_port_read_indexed(machine, 3);
+ if (input_sel & 0x0020) return input_port_read_indexed(machine, 4);
return 0xffff;
}
@@ -2097,7 +2097,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( puzzlet_dsw_r )
{
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
static WRITE16_HANDLER( puzzlet_irq_enable_w )
diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c
index dcde12497d0..b021eba635e 100644
--- a/src/mame/drivers/mgolf.c
+++ b/src/mame/drivers/mgolf.c
@@ -71,9 +71,9 @@ static VIDEO_UPDATE( mgolf )
}
-static void update_plunger(void)
+static void update_plunger(running_machine *machine)
{
- UINT8 val = readinputport(5);
+ UINT8 val = input_port_read_indexed(machine, 5);
if (prev != val)
{
@@ -96,7 +96,7 @@ static TIMER_CALLBACK( interrupt_callback )
{
int scanline = param;
- update_plunger();
+ update_plunger(machine);
cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
@@ -138,13 +138,13 @@ static READ8_HANDLER( mgolf_wram_r )
static READ8_HANDLER( mgolf_dial_r )
{
- UINT8 val = readinputport(1);
+ UINT8 val = input_port_read_indexed(machine, 1);
- if ((readinputport(4) + 0x00) & 0x20)
+ if ((input_port_read_indexed(machine, 4) + 0x00) & 0x20)
{
val |= 0x01;
}
- if ((readinputport(4) + 0x10) & 0x20)
+ if ((input_port_read_indexed(machine, 4) + 0x10) & 0x20)
{
val |= 0x02;
}
@@ -157,7 +157,7 @@ static READ8_HANDLER( mgolf_misc_r )
{
double plunger = calc_plunger_pos(); /* see Video Pinball */
- UINT8 val = readinputport(3);
+ UINT8 val = input_port_read_indexed(machine, 3);
if (plunger >= 0.000 && plunger <= 0.001)
{
diff --git a/src/mame/drivers/micro3d.c b/src/mame/drivers/micro3d.c
index ab44f899e6e..185955b5bf6 100644
--- a/src/mame/drivers/micro3d.c
+++ b/src/mame/drivers/micro3d.c
@@ -811,7 +811,7 @@ static READ8_HANDLER(sound_io_r)
switch(offset)
{
- case 0x01: return readinputport(3); /* Test push switch */
+ case 0x01: return input_port_read_indexed(machine, 3); /* Test push switch */
case 0x03: return (int)(upd7759_0_busy_r(machine,0))<<3;
default: return 0;
}
diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c
index 559d4cc6a3c..96a9f9ef798 100644
--- a/src/mame/drivers/midas.c
+++ b/src/mame/drivers/midas.c
@@ -180,7 +180,7 @@ static VIDEO_UPDATE( livequiz )
static READ16_HANDLER( livequiz_eeprom_r )
{
- return readinputport(2) | (EEPROM_read_bit() << 3);
+ return input_port_read_indexed(machine, 2) | (EEPROM_read_bit() << 3);
}
static WRITE16_HANDLER( livequiz_eeprom_w )
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index ed731c2f18c..ea137734ad3 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -104,7 +104,7 @@ static MACHINE_RESET( midvplus )
static READ32_HANDLER( port0_r )
{
- UINT16 val = readinputport(0);
+ UINT16 val = input_port_read_indexed(machine, 0);
UINT16 diff = val ^ last_port0;
/* make sure the shift controls are mutually exclusive */
@@ -126,13 +126,13 @@ static READ32_HANDLER( port0_r )
static READ32_HANDLER( port1_r )
{
- return (readinputport(1) << 16) | readinputport(1);
+ return (input_port_read_indexed(machine, 1) << 16) | input_port_read_indexed(machine, 1);
}
static READ32_HANDLER( port2_r )
{
- return (readinputport(2) << 16) | readinputport(2);
+ return (input_port_read_indexed(machine, 2) << 16) | input_port_read_indexed(machine, 2);
}
@@ -169,7 +169,7 @@ static WRITE32_HANDLER( midvunit_adc_w )
int which = (data >> adc_shift) - 4;
if (which < 0 || which > 2)
logerror("adc_w: unexpected which = %02X\n", which + 4);
- adc_data = readinputport(3 + which);
+ adc_data = input_port_read_indexed(machine, 3 + which);
timer_set(ATTOTIME_IN_MSEC(1), NULL, 0, adc_ready);
}
else
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index a92e8968fea..f07ef3a0f2d 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -451,7 +451,7 @@ static CUSTOM_INPUT( custom_49way_r )
static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
const char *namex = param;
const char *namey = namex + strlen(namex) + 1;
- return (translate49[readinputportbytag(namey) >> 4] << 4) | translate49[readinputportbytag(namex) >> 4];
+ return (translate49[input_port_read(machine, namey) >> 4] << 4) | translate49[input_port_read(machine, namex) >> 4];
}
@@ -464,7 +464,7 @@ static WRITE32_HANDLER( keypad_select_w )
static CUSTOM_INPUT( keypad_r )
{
- UINT32 bits = readinputportbytag(param);
+ UINT32 bits = input_port_read(machine, param);
UINT8 select = keypad_select;
while ((select & 1) != 0)
{
@@ -487,7 +487,7 @@ static READ32_HANDLER( analog_r )
static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" };
if (offset < 8 || offset > 11)
logerror("%06X:analog_r(%X)\n", activecpu_get_pc(), offset);
- return readinputportbytag(tags[offset & 3]);
+ return input_port_read(machine, tags[offset & 3]);
}
@@ -553,8 +553,8 @@ static WRITE32_HANDLER( invasn_gun_w )
{ "GUNX1", "GUNY1" },
{ "GUNX2", "GUNY2" }
};
- gun_x[player] = readinputportbytag(names[player][0]) * (visarea->max_x + 1 - visarea->min_x) / 255 + visarea->min_x + BEAM_XOFFS;
- gun_y[player] = readinputportbytag(names[player][1]) * (visarea->max_y + 1 - visarea->min_y) / 255 + visarea->min_y;
+ gun_x[player] = input_port_read(machine, names[player][0]) * (visarea->max_x + 1 - visarea->min_x) / 255 + visarea->min_x + BEAM_XOFFS;
+ gun_y[player] = input_port_read(machine, names[player][1]) * (visarea->max_y + 1 - visarea->min_y) / 255 + visarea->min_y;
timer_adjust_oneshot(gun_timer[player], video_screen_get_time_until_pos(machine->primary_screen, MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player);
}
}
diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c
index 745111854b8..547f63c0749 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -133,7 +133,7 @@ static VIDEO_UPDATE(mirage)
static READ16_HANDLER( mirage_controls_r )
{
- return readinputportbytag("SYSTEM_IN");
+ return input_port_read(machine, "SYSTEM_IN");
}
static READ16_HANDLER( random_readers )
@@ -143,7 +143,7 @@ static READ16_HANDLER( random_readers )
static READ16_HANDLER( mirage_input_r )
{
- UINT16 port = readinputportbytag("MIRAGE0");
+ UINT16 port = input_port_read(machine, "MIRAGE0");
return port;
}
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index 25d7329a745..773d397c7f6 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -658,21 +658,21 @@ static READ8_HANDLER( missile_r )
if (ctrld) /* trackball */
{
if (!flipscreen)
- result = ((readinputport(5) << 4) & 0xf0) | (readinputport(4) & 0x0f);
+ result = ((input_port_read_indexed(machine, 5) << 4) & 0xf0) | (input_port_read_indexed(machine, 4) & 0x0f);
else
- result = ((readinputport(7) << 4) & 0xf0) | (readinputport(6) & 0x0f);
+ result = ((input_port_read_indexed(machine, 7) << 4) & 0xf0) | (input_port_read_indexed(machine, 6) & 0x0f);
}
else /* buttons */
- result = readinputport(0);
+ result = input_port_read_indexed(machine, 0);
}
/* IN1 */
else if (offset < 0x4a00)
- result = readinputport(1);
+ result = input_port_read_indexed(machine, 1);
/* IN2 */
else if (offset < 0x4b00)
- result = readinputport(2);
+ result = input_port_read_indexed(machine, 2);
/* anything else */
else
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index f227901d186..02a54d66a5e 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -229,7 +229,7 @@ static READ8_HANDLER( block_input_r )
{
int delta;
- delta = (readinputport(4 + offset) - dial[offset]) & 0xff;
+ delta = (input_port_read_indexed(machine, 4 + offset) - dial[offset]) & 0xff;
if (delta & 0x80)
{
delta = (-delta) & 0xff;
@@ -256,7 +256,7 @@ static READ8_HANDLER( block_input_r )
{
int res;
- res = readinputport(2 + offset) & 0xf7;
+ res = input_port_read_indexed(machine, 2 + offset) & 0xf7;
if (dir[offset]) res |= 0x08;
return res;
@@ -268,8 +268,8 @@ static WRITE8_HANDLER( block_dial_control_w )
if (data == 0x08)
{
/* reset the dial counters */
- dial[0] = readinputport(4);
- dial[1] = readinputport(5);
+ dial[0] = input_port_read_indexed(machine, 4);
+ dial[1] = input_port_read_indexed(machine, 5);
}
else if (data == 0x80)
dial_selected = 0;
@@ -285,7 +285,7 @@ static READ8_HANDLER( mahjong_input_r )
int i;
for (i = 0;i < 5;i++)
- if (keymatrix & (0x80 >> i)) return readinputport(2 + 5 * offset + i);
+ if (keymatrix & (0x80 >> i)) return input_port_read_indexed(machine, 2 + 5 * offset + i);
return 0xff;
}
@@ -304,22 +304,22 @@ static READ8_HANDLER( input_r )
{
case 0:
default:
- return readinputport(1 + offset);
+ return input_port_read_indexed(machine, 1 + offset);
break;
case 1: /* Mahjong games */
if (offset) return mahjong_input_r(machine,offset-1);
- else return readinputport(1);
+ else return input_port_read_indexed(machine, 1);
break;
case 2: /* Block Block - dial control */
if (offset) return block_input_r(machine,offset-1);
- else return readinputport(1);
+ else return input_port_read_indexed(machine, 1);
break;
case 3: /* Super Pang - simulate START 1 press to initialize EEPROM */
- if (offset || init_eeprom_count == 0) return readinputport(1 + offset);
+ if (offset || init_eeprom_count == 0) return input_port_read_indexed(machine, 1 + offset);
else
{
init_eeprom_count--;
- return readinputport(1) & ~0x08;
+ return input_port_read_indexed(machine, 1) & ~0x08;
}
break;
}
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index be8923e2b2f..3026426dd43 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -110,12 +110,12 @@ static READ8_HANDLER( keyboard_r )
{
if (~keyb & (1 << i))
{
- res = readinputport(4+i) & 0x3f;
+ res = input_port_read_indexed(machine, 4+i) & 0x3f;
break;
}
}
- res |= (readinputport(3) & 0xc0);
+ res |= (input_port_read_indexed(machine, 3) & 0xc0);
if (nvram_init_count)
{
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index 1ac552a0d4f..0fe94e34bdf 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -141,7 +141,7 @@ static READ8_HANDLER( mjsister_keys_r )
for (i=0; i<6; i++)
{
if (p & (1 << i))
- ret |= readinputport(i+3);
+ ret |= input_port_read_indexed(machine, i+3);
}
return ret;
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index bb2d2a07d46..b63fd7d25f3 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -670,11 +670,11 @@ void model1_tgp_reset(int swa);
static READ16_HANDLER( io_r )
{
if(offset < 0x8)
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
if(offset < 0x10) {
offset -= 0x8;
if(offset < 3)
- return readinputport(offset+8) | 0xff00;
+ return input_port_read_indexed(machine, offset+8) | 0xff00;
return 0xff;
}
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 5bd89f5db83..cf798a1ee3a 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -433,7 +433,7 @@ static WRITE32_HANDLER(ctrl0_w)
static READ32_HANDLER(ctrl0_r)
{
- UINT32 ret = readinputport(0);
+ UINT32 ret = input_port_read_indexed(machine, 0);
ret <<= 16;
if(model2_ctrlmode==0)
{
@@ -447,25 +447,25 @@ static READ32_HANDLER(ctrl0_r)
}
static READ32_HANDLER(ctrl1_r)
{
- return readinputport(1) | readinputport(2)<<16;
+ return input_port_read_indexed(machine, 1) | input_port_read_indexed(machine, 2)<<16;
}
static READ32_HANDLER(ctrl10_r)
{
- return readinputport(0) | readinputport(1)<<16;
+ return input_port_read_indexed(machine, 0) | input_port_read_indexed(machine, 1)<<16;
}
static READ32_HANDLER(ctrl14_r)
{
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
static READ32_HANDLER(analog_r)
{
if (offset)
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
- return readinputport(3) | readinputport(4)<<16;
+ return input_port_read_indexed(machine, 3) | input_port_read_indexed(machine, 4)<<16;
}
static READ32_HANDLER(fifoctl_r)
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 08b8e9d3803..07acaea623f 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1058,10 +1058,10 @@ static READ64_HANDLER( model3_ctrl_r )
{
if(model3_controls_bank & 0x1) {
eeprom_bit = EEPROM_read_bit() << 5;
- return ((readinputport(1) & ~0x20) | eeprom_bit) << 24;
+ return ((input_port_read_indexed(machine, 1) & ~0x20) | eeprom_bit) << 24;
}
else {
- return (readinputport(0)) << 24;
+ return (input_port_read_indexed(machine, 0)) << 24;
}
}
break;
@@ -1069,11 +1069,11 @@ static READ64_HANDLER( model3_ctrl_r )
case 1:
if (ACCESSING_BITS_56_63)
{
- return (UINT64)readinputport(2) << 56;
+ return (UINT64)input_port_read_indexed(machine, 2) << 56;
}
else if (ACCESSING_BITS_24_31)
{
- return readinputport(3) << 24;
+ return input_port_read_indexed(machine, 3) << 24;
}
break;
@@ -1107,7 +1107,7 @@ static READ64_HANDLER( model3_ctrl_r )
case 7:
if (ACCESSING_BITS_24_31) /* ADC Data read */
{
- UINT8 adc_data = readinputport(5 + adc_channel);
+ UINT8 adc_data = input_port_read_indexed(machine, 5 + adc_channel);
adc_channel++;
adc_channel &= 0x7;
return (UINT64)adc_data << 24;
@@ -1159,32 +1159,32 @@ static WRITE64_HANDLER( model3_ctrl_w )
switch(lightgun_reg_sel) /* read lightrun register */
{
case 0: /* player 1 gun X-position, lower 8-bits */
- model3_serial_fifo2 = readinputport(6) & 0xff;
+ model3_serial_fifo2 = input_port_read_indexed(machine, 6) & 0xff;
break;
case 1: /* player 1 gun X-position, upper 2-bits */
- model3_serial_fifo2 = (readinputport(6) >> 8) & 0x3;
+ model3_serial_fifo2 = (input_port_read_indexed(machine, 6) >> 8) & 0x3;
break;
case 2: /* player 1 gun Y-position, lower 8-bits */
- model3_serial_fifo2 = readinputport(5) & 0xff;
+ model3_serial_fifo2 = input_port_read_indexed(machine, 5) & 0xff;
break;
case 3: /* player 1 gun Y-position, upper 2-bits */
- model3_serial_fifo2 = (readinputport(5) >> 8) & 0x3;
+ model3_serial_fifo2 = (input_port_read_indexed(machine, 5) >> 8) & 0x3;
break;
case 4: /* player 2 gun X-position, lower 8-bits */
- model3_serial_fifo2 = readinputport(8) & 0xff;
+ model3_serial_fifo2 = input_port_read_indexed(machine, 8) & 0xff;
break;
case 5: /* player 2 gun X-position, upper 2-bits */
- model3_serial_fifo2 = (readinputport(8) >> 8) & 0x3;
+ model3_serial_fifo2 = (input_port_read_indexed(machine, 8) >> 8) & 0x3;
break;
case 6: /* player 2 gun Y-position, lower 8-bits */
- model3_serial_fifo2 = readinputport(7) & 0xff;
+ model3_serial_fifo2 = input_port_read_indexed(machine, 7) & 0xff;
break;
case 7: /* player 2 gun Y-position, upper 2-bits */
- model3_serial_fifo2 = (readinputport(7) >> 8) & 0x3;
+ model3_serial_fifo2 = (input_port_read_indexed(machine, 7) >> 8) & 0x3;
break;
case 8: /* gun offscreen (bit set = gun offscreen, bit clear = gun on screen) */
model3_serial_fifo2 = 0; /* bit 0 = player 1, bit 1 = player 2 */
- if(readinputport(9) & 0x1) {
+ if(input_port_read_indexed(machine, 9) & 0x1) {
model3_serial_fifo2 |= 0x01;
}
break;
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index 0953ed10691..e9cce74fa7b 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -705,7 +705,7 @@ static const pia6821_interface pia_ic4_intf =
static READ8_HANDLER( pia_ic5_porta_r )
{
LOG(("%04x IC5 PIA Read of Port A (AUX1)\n",activecpu_get_previouspc()));
- return readinputportbytag("AUX1");
+ return input_port_read(machine, "AUX1");
}
@@ -716,7 +716,7 @@ static READ8_HANDLER( pia_ic5_portb_r )
coin_lockout_w(1, (pia_get_output_b(2) & 0x02) );
coin_lockout_w(2, (pia_get_output_b(2) & 0x04) );
coin_lockout_w(3, (pia_get_output_b(2) & 0x08) );
- return readinputportbytag("AUX2");
+ return input_port_read(machine, "AUX2");
}
@@ -956,8 +956,8 @@ static READ8_HANDLER( pia_ic8_porta_r )
/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
This is achieved via connecting every input line to an AND gate, thus allowing two strobes
to represent each orange input bank (strobes are active low). */
- pia_set_input_cb1(2, (readinputportbytag("AUX2") & 0x80));
- return readinputport(input_read);
+ pia_set_input_cb1(2, (input_port_read(machine, "AUX2") & 0x80));
+ return input_port_read_indexed(machine, input_read);
}
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index d1bcfd867d2..4fbf407bd75 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -8,6 +8,7 @@
#include "driver.h"
+#include "deprecat.h"
#include "includes/amiga.h"
#include "sound/es5503.h"
@@ -30,7 +31,7 @@
static UINT8 mquake_cia_0_porta_r(void)
{
- return readinputportbytag("CIA0PORTA");
+ return input_port_read(Machine, "CIA0PORTA");
}
static void mquake_cia_0_porta_w(UINT8 data)
@@ -124,7 +125,7 @@ static WRITE16_HANDLER( output_w )
static READ16_HANDLER( coin_chip_r )
{
if (offset == 1)
- return readinputportbytag("COINCHIP");
+ return input_port_read(machine, "COINCHIP");
logerror("%06x:coin_chip_r(%02x) & %04x\n", activecpu_get_pc(), offset, mem_mask ^ 0xffff);
return 0xffff;
}
diff --git a/src/mame/drivers/mrflea.c b/src/mame/drivers/mrflea.c
index 0972fbcde77..4e70a29b808 100644
--- a/src/mame/drivers/mrflea.c
+++ b/src/mame/drivers/mrflea.c
@@ -205,8 +205,8 @@ static WRITE8_HANDLER( mrflea_select3_w ){
/*******************************************************/
static READ8_HANDLER( mrflea_input0_r ){
- if( mrflea_select0 == 0x0f ) return readinputport(0);
- if( mrflea_select0 == 0x0e ) return readinputport(1);
+ if( mrflea_select0 == 0x0f ) return input_port_read_indexed(machine, 0);
+ if( mrflea_select0 == 0x0e ) return input_port_read_indexed(machine, 1);
return 0x00;
}
@@ -215,8 +215,8 @@ static READ8_HANDLER( mrflea_input1_r ){
}
static READ8_HANDLER( mrflea_input2_r ){
- if( mrflea_select2 == 0x0f ) return readinputport(2);
- if( mrflea_select2 == 0x0e ) return readinputport(3);
+ if( mrflea_select2 == 0x0f ) return input_port_read_indexed(machine, 2);
+ if( mrflea_select2 == 0x0e ) return input_port_read_indexed(machine, 3);
return 0x00;
}
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index 94804170e5d..a6bf27989bd 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -213,10 +213,10 @@ static UINT32 to_main;
static READ32_HANDLER ( ms32_read_inputs1 )
{
int a,b,c,d;
- a = readinputport(0); // unknown
- b = readinputport(1); // System inputs
- c = readinputport(2); // Player 1 inputs
- d = readinputport(3); // Player 2 inputs
+ a = input_port_read_indexed(machine, 0); // unknown
+ b = input_port_read_indexed(machine, 1); // System inputs
+ c = input_port_read_indexed(machine, 2); // Player 1 inputs
+ d = input_port_read_indexed(machine, 3); // Player 2 inputs
return a << 24 | b << 16 | c << 0 | d << 8;
}
@@ -224,31 +224,31 @@ static READ32_HANDLER ( ms32_read_inputs1 )
static READ32_HANDLER ( ms32_mahjong_read_inputs1 )
{
int a,b,c,d;
- a = readinputport(0); // unknown
- b = readinputport(1); // System inputs
+ a = input_port_read_indexed(machine, 0); // unknown
+ b = input_port_read_indexed(machine, 1); // System inputs
switch (ms32_mahjong_input_select[0])
{
case 0x01:
- c = readinputport(8); // Player 1 inputs
+ c = input_port_read_indexed(machine, 8); // Player 1 inputs
break;
case 0x02:
- c = readinputport(9); // Player 1 inputs
+ c = input_port_read_indexed(machine, 9); // Player 1 inputs
break;
case 0x04:
- c = readinputport(10); // Player 1 inputs
+ c = input_port_read_indexed(machine, 10); // Player 1 inputs
break;
case 0x08:
- c = readinputport(11); // Player 1 inputs
+ c = input_port_read_indexed(machine, 11); // Player 1 inputs
break;
case 0x10:
- c = readinputport(12); // Player 1 inputs
+ c = input_port_read_indexed(machine, 12); // Player 1 inputs
break;
default:
c = 0;
}
- d = readinputport(3); // Player 2 inputs
+ d = input_port_read_indexed(machine, 3); // Player 2 inputs
return a << 24 | b << 16 | c << 0 | d << 8;
}
@@ -256,20 +256,20 @@ static READ32_HANDLER ( ms32_mahjong_read_inputs1 )
static READ32_HANDLER ( ms32_read_inputs2 )
{
int a,b,c,d;
- a = readinputport(4); // Dip 1
- b = readinputport(5); // Dip 2
- c = readinputport(6); // Dip 3
- d = readinputport(7); // unused ?
+ a = input_port_read_indexed(machine, 4); // Dip 1
+ b = input_port_read_indexed(machine, 5); // Dip 2
+ c = input_port_read_indexed(machine, 6); // Dip 3
+ d = input_port_read_indexed(machine, 7); // unused ?
return a << 8 | b << 0 | c << 16 | d << 24;
}
static READ32_HANDLER ( ms32_read_inputs3 )
{
int a,b,c,d;
- a = readinputport(10); // unused?
- b = readinputport(10); // unused?
- c = readinputport(9);
- d = (readinputport(8) - 0xb0) & 0xff;
+ a = input_port_read_indexed(machine, 10); // unused?
+ b = input_port_read_indexed(machine, 10); // unused?
+ c = input_port_read_indexed(machine, 9);
+ d = (input_port_read_indexed(machine, 8) - 0xb0) & 0xff;
return a << 24 | b << 16 | c << 8 | d << 0;
}
diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c
index 3a98af917ac..36b8aa84c40 100644
--- a/src/mame/drivers/msisaac.c
+++ b/src/mame/drivers/msisaac.c
@@ -159,7 +159,7 @@ MCU simulation TODO:
//6-down
//7-leftdwn
- UINT8 val= (readinputport(4)>>2) & 0x0f;
+ UINT8 val= (input_port_read_indexed(machine, 4)>>2) & 0x0f;
/* bit0 = left
bit1 = right
bit2 = down
diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c
index 760a5f2e463..f84d677b0fc 100644
--- a/src/mame/drivers/mugsmash.c
+++ b/src/mame/drivers/mugsmash.c
@@ -161,16 +161,16 @@ static READ16_HANDLER ( mugsmash_input_ports_r )
switch (offset)
{
case 0 :
- data = (readinputport(0) & 0xff) | ((readinputport(3) & 0xc0) << 6) | ((readinputport(2) & 0x03) << 8);
+ data = (input_port_read_indexed(machine, 0) & 0xff) | ((input_port_read_indexed(machine, 3) & 0xc0) << 6) | ((input_port_read_indexed(machine, 2) & 0x03) << 8);
break;
case 1 :
- data = (readinputport(1) & 0xff) | ((readinputport(3) & 0x3f) << 8);
+ data = (input_port_read_indexed(machine, 1) & 0xff) | ((input_port_read_indexed(machine, 3) & 0x3f) << 8);
break;
case 2 :
- data = ((readinputport(4) & 0x3f) << 8);
+ data = ((input_port_read_indexed(machine, 4) & 0x3f) << 8);
break;
case 3 :
- data = ((readinputport(4) & 0xc0) << 2);
+ data = ((input_port_read_indexed(machine, 4) & 0xc0) << 2);
break;
}
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 7b74cfbdb80..53ab3ff2054 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -100,11 +100,11 @@ static WRITE8_HANDLER( multigam_IN0_w )
in_0_shift = 0;
in_1_shift = 0;
- in_0 = readinputport(0);
- in_1 = readinputport(1);
+ in_0 = input_port_read_indexed(machine, 0);
+ in_1 = input_port_read_indexed(machine, 1);
multigam_in_dsw_shift = 0;
- multigam_in_dsw = readinputport(3);
+ multigam_in_dsw = input_port_read_indexed(machine, 3);
}
static READ8_HANDLER( multigam_IN1_r )
@@ -117,7 +117,7 @@ static READ8_HANDLER( multigam_inputs_r )
/* bit 0: serial input (dsw)
bit 1: coin */
return ((multigam_in_dsw >> multigam_in_dsw_shift++) & 0x01) |
- readinputport(2);
+ input_port_read_indexed(machine, 2);
}
diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c
index 0b253443bc4..4ed95a8cbcd 100644
--- a/src/mame/drivers/mw8080bw.c
+++ b/src/mame/drivers/mw8080bw.c
@@ -319,8 +319,8 @@ static WRITE8_HANDLER( seawolf_periscope_lamp_w )
static CUSTOM_INPUT( seawolf_erase_input_r )
{
- return readinputportbytag(SEAWOLF_ERASE_SW_PORT_TAG) &
- readinputportbytag(SEAWOLF_ERASE_DIP_PORT_TAG);
+ return input_port_read(machine, SEAWOLF_ERASE_SW_PORT_TAG) &
+ input_port_read(machine, SEAWOLF_ERASE_DIP_PORT_TAG);
}
@@ -542,15 +542,15 @@ MACHINE_DRIVER_END
#define TORNBASE_CAB_TYPE_PORT_TAG ("CAB")
-UINT8 tornbase_get_cabinet_type()
+UINT8 tornbase_get_cabinet_type(running_machine *machine)
{
- return readinputportbytag(TORNBASE_CAB_TYPE_PORT_TAG);
+ return input_port_read(machine, TORNBASE_CAB_TYPE_PORT_TAG);
}
static CUSTOM_INPUT( tornbase_hit_left_input_r )
{
- return readinputportbytag(TORNBASE_L_HIT_PORT_TAG);
+ return input_port_read(machine, TORNBASE_L_HIT_PORT_TAG);
}
@@ -558,16 +558,16 @@ static CUSTOM_INPUT( tornbase_hit_right_input_r )
{
UINT32 ret;
- switch (tornbase_get_cabinet_type())
+ switch (tornbase_get_cabinet_type(machine))
{
case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
- ret = readinputportbytag(TORNBASE_L_HIT_PORT_TAG);
+ ret = input_port_read(machine, TORNBASE_L_HIT_PORT_TAG);
break;
case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
case TORNBASE_CAB_TYPE_COCKTAIL:
default:
- ret = readinputportbytag(TORNBASE_R_HIT_PORT_TAG);
+ ret = input_port_read(machine, TORNBASE_R_HIT_PORT_TAG);
break;
}
@@ -579,16 +579,16 @@ static CUSTOM_INPUT( tornbase_pitch_left_input_r )
{
UINT32 ret;
- switch (tornbase_get_cabinet_type())
+ switch (tornbase_get_cabinet_type(machine))
{
case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
- ret = readinputportbytag(TORNBASE_L_PITCH_PORT_TAG);
+ ret = input_port_read(machine, TORNBASE_L_PITCH_PORT_TAG);
break;
case TORNBASE_CAB_TYPE_COCKTAIL:
default:
- ret = readinputportbytag(TORNBASE_R_PITCH_PORT_TAG);
+ ret = input_port_read(machine, TORNBASE_R_PITCH_PORT_TAG);
break;
}
@@ -598,14 +598,14 @@ static CUSTOM_INPUT( tornbase_pitch_left_input_r )
static CUSTOM_INPUT( tornbase_pitch_right_input_r )
{
- return readinputportbytag(TORNBASE_L_PITCH_PORT_TAG);
+ return input_port_read(machine, TORNBASE_L_PITCH_PORT_TAG);
}
static CUSTOM_INPUT( tornbase_score_input_r )
{
- return readinputportbytag(TORNBASE_SCORE_SW_PORT_TAG) &
- readinputportbytag(TORNBASE_SCORE_DIP_PORT_TAG);
+ return input_port_read(machine, TORNBASE_SCORE_SW_PORT_TAG) &
+ input_port_read(machine, TORNBASE_SCORE_DIP_PORT_TAG);
}
@@ -1182,9 +1182,9 @@ static CUSTOM_INPUT( desertgu_gun_input_r )
UINT32 ret;
if (desertgu_controller_select)
- ret = readinputportbytag(DESERTGU_GUN_X_PORT_TAG);
+ ret = input_port_read(machine, DESERTGU_GUN_X_PORT_TAG);
else
- ret = readinputportbytag(DESERTGU_GUN_Y_PORT_TAG);
+ ret = input_port_read(machine, DESERTGU_GUN_Y_PORT_TAG);
return ret;
}
@@ -1195,9 +1195,9 @@ static CUSTOM_INPUT( desertgu_dip_sw_0_1_r )
UINT32 ret;
if (desertgu_controller_select)
- ret = readinputportbytag(DESERTGU_DIP_SW_0_1_SET_2_TAG);
+ ret = input_port_read(machine, DESERTGU_DIP_SW_0_1_SET_2_TAG);
else
- ret = readinputportbytag(DESERTGU_DIP_SW_0_1_SET_1_TAG);
+ ret = input_port_read(machine, DESERTGU_DIP_SW_0_1_SET_1_TAG);
return ret;
}
@@ -1308,10 +1308,10 @@ static CUSTOM_INPUT( dplay_pitch_left_input_r )
{
UINT32 ret;
- if (readinputportbytag(DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT)
- ret = readinputportbytag(DPLAY_L_PITCH_PORT_TAG);
+ if (input_port_read(machine, DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT)
+ ret = input_port_read(machine, DPLAY_L_PITCH_PORT_TAG);
else
- ret = readinputportbytag(DPLAY_R_PITCH_PORT_TAG);
+ ret = input_port_read(machine, DPLAY_R_PITCH_PORT_TAG);
return ret;
}
@@ -1319,7 +1319,7 @@ static CUSTOM_INPUT( dplay_pitch_left_input_r )
static CUSTOM_INPUT( dplay_pitch_right_input_r )
{
- return readinputportbytag(DPLAY_L_PITCH_PORT_TAG);
+ return input_port_read(machine, DPLAY_L_PITCH_PORT_TAG);
}
@@ -1698,11 +1698,11 @@ static CUSTOM_INPUT( clowns_controller_r )
if (clowns_controller_select)
{
- ret = readinputportbytag(CLOWNS_CONTROLLER_P2_TAG);
+ ret = input_port_read(machine, CLOWNS_CONTROLLER_P2_TAG);
}
else
{
- ret = readinputportbytag(CLOWNS_CONTROLLER_P1_TAG);
+ ret = input_port_read(machine, CLOWNS_CONTROLLER_P1_TAG);
}
return ret;
@@ -2447,7 +2447,7 @@ void invaders_set_flip_screen(UINT8 data)
static CUSTOM_INPUT( invaders_coin_input_r )
{
- UINT32 ret = readinputportbytag(INVADERS_COIN_INPUT_PORT_TAG);
+ UINT32 ret = input_port_read(machine, INVADERS_COIN_INPUT_PORT_TAG);
coin_counter_w(0, !ret);
@@ -2462,10 +2462,10 @@ static CUSTOM_INPUT( invaders_sw6_sw7_r )
/* upright PCB : switches visible
cocktail PCB: HI */
- if (invaders_is_cabinet_cocktail())
+ if (invaders_is_cabinet_cocktail(machine))
ret = 0x03;
else
- ret = readinputportbytag(INVADERS_SW6_SW7_PORT_TAG);
+ ret = input_port_read(machine, INVADERS_SW6_SW7_PORT_TAG);
return ret;
}
@@ -2478,10 +2478,10 @@ static CUSTOM_INPUT( invaders_sw5_r )
/* upright PCB : switch visible
cocktail PCB: HI */
- if (invaders_is_cabinet_cocktail())
+ if (invaders_is_cabinet_cocktail(machine))
ret = 0x01;
else
- ret = readinputportbytag(INVADERS_SW5_PORT_TAG);
+ ret = input_port_read(machine, INVADERS_SW5_PORT_TAG);
return ret;
}
@@ -2494,10 +2494,10 @@ static CUSTOM_INPUT( invaders_in0_control_r )
/* upright PCB : P1 controls
cocktail PCB: HI */
- if (invaders_is_cabinet_cocktail())
+ if (invaders_is_cabinet_cocktail(machine))
ret = 0x07;
else
- ret = readinputportbytag(INVADERS_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(machine, INVADERS_P1_CONTROL_PORT_TAG);
return ret;
}
@@ -2510,18 +2510,18 @@ CUSTOM_INPUT( invaders_in2_control_r )
/* upright PCB : P1 controls
cocktail PCB: P2 controls */
- if (invaders_is_cabinet_cocktail())
- ret = readinputportbytag(INVADERS_P2_CONTROL_PORT_TAG);
+ if (invaders_is_cabinet_cocktail(machine))
+ ret = input_port_read(machine, INVADERS_P2_CONTROL_PORT_TAG);
else
- ret = readinputportbytag(INVADERS_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(machine, INVADERS_P1_CONTROL_PORT_TAG);
return ret;
}
-int invaders_is_cabinet_cocktail()
+int invaders_is_cabinet_cocktail(running_machine *machine)
{
- return readinputportbytag(INVADERS_CAB_TYPE_PORT_TAG);
+ return input_port_read(machine, INVADERS_CAB_TYPE_PORT_TAG);
}
@@ -2647,7 +2647,7 @@ MACHINE_DRIVER_END
static CUSTOM_INPUT( blueshrk_coin_input_r )
{
- UINT32 ret = readinputportbytag(BLUESHRK_COIN_INPUT_PORT_TAG);
+ UINT32 ret = input_port_read(machine, BLUESHRK_COIN_INPUT_PORT_TAG);
coin_counter_w(0, !ret);
@@ -2724,7 +2724,7 @@ MACHINE_DRIVER_END
#ifdef UNUSED_FUNCTION
static UINT32 invad2ct_coin_input_r(void *param)
{
- UINT32 ret = readinputportbytag(INVAD2CT_COIN_INPUT_PORT_TAG);
+ UINT32 ret = input_port_read(machine, INVAD2CT_COIN_INPUT_PORT_TAG);
coin_counter_w(0, !ret);
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index c47fc4af0de..2cd5acf1f08 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -119,7 +119,7 @@ static READ16_HANDLER( mweeprom_r )
{
if (ACCESSING_BITS_0_7)
{
- int res = readinputport(1) | EEPROM_read_bit();
+ int res = input_port_read_indexed(machine, 1) | EEPROM_read_bit();
if (init_eeprom_count)
{
@@ -139,7 +139,7 @@ static READ16_HANDLER( vseeprom_r )
{
if (ACCESSING_BITS_0_7)
{
- int res = readinputport(1) | EEPROM_read_bit();
+ int res = input_port_read_indexed(machine, 1) | EEPROM_read_bit();
if (init_eeprom_count)
{
@@ -173,10 +173,10 @@ static READ16_HANDLER( dddeeprom_r )
{
if (ACCESSING_BITS_8_15)
{
- return (readinputport(1) | EEPROM_read_bit())<<8;
+ return (input_port_read_indexed(machine, 1) | EEPROM_read_bit())<<8;
}
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
static WRITE16_HANDLER( mmeeprom_w )
@@ -316,27 +316,27 @@ static WRITE16_HANDLER( irq_ack_w )
static READ16_HANDLER( player1_r )
{
- return readinputport(2) | (readinputport(3)<<8);
+ return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3)<<8);
}
static READ16_HANDLER( player2_r )
{
- return readinputport(4) | (readinputport(5)<<8);
+ return input_port_read_indexed(machine, 4) | (input_port_read_indexed(machine, 5)<<8);
}
static READ16_HANDLER( mmplayer1_r )
{
- return readinputport(2) | (readinputport(4)<<8);
+ return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 4)<<8);
}
static READ16_HANDLER( mmplayer2_r )
{
- return readinputport(3) | (readinputport(5)<<8);
+ return input_port_read_indexed(machine, 3) | (input_port_read_indexed(machine, 5)<<8);
}
static READ16_HANDLER( mmcoins_r )
{
- int res = readinputport(0);
+ int res = input_port_read_indexed(machine, 0);
if (init_eeprom_count)
{
@@ -349,7 +349,7 @@ static READ16_HANDLER( mmcoins_r )
static READ16_HANDLER( dddcoins_r )
{
- int res = (readinputport(0)<<8) | readinputport(2);
+ int res = (input_port_read_indexed(machine, 0)<<8) | input_port_read_indexed(machine, 2);
if (init_eeprom_count)
{
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index c1b0672d5a3..42a9f29b0ba 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -514,7 +514,7 @@ INPUT_PORTS_END
/***************************************************************************/
static void
-simulate_mcu( void )
+simulate_mcu( running_machine *machine )
{
int i;
UINT16 data;
@@ -524,11 +524,11 @@ simulate_mcu( void )
if (is_na2)
{
- mcu_ram[0xfc0/2] = readinputport(0x0); /* dipswitch */
+ mcu_ram[0xfc0/2] = input_port_read_indexed(machine, 0x0); /* dipswitch */
for( i=1; i<=4; i++ )
{
- data = readinputport(i)<<8;
+ data = input_port_read_indexed(machine, i)<<8;
switch( namcona1_gametype )
{
case NAMCO_KNCKHEAD:
@@ -547,11 +547,11 @@ simulate_mcu( void )
if( data&0x4000 ) data |= 0x10; /* jump */
if( i==1 )
{
- if( readinputport(1)&0x80 ) data |= 0x80; /* P1 start */
+ if( input_port_read_indexed(machine, 1)&0x80 ) data |= 0x80; /* P1 start */
}
if( i==2 )
{
- if( readinputport(2)&0x80 ) data |= 0x80; /* P2 start */
+ if( input_port_read_indexed(machine, 2)&0x80 ) data |= 0x80; /* P2 start */
}
break;
@@ -570,7 +570,7 @@ simulate_mcu( void )
mcu_ram[0xfc0/2+0x08] = 0xffff; /* analog6,7 */
mcu_ram[0xfc0/2+0x09] = 0xffff; /* encoder0,1 */
- poll_coins = readinputport(5); /* coin input */
+ poll_coins = input_port_read_indexed(machine, 5); /* coin input */
if( (poll_coins&0x8)&~(mCoinState&0x8) ) mCoinCount[0]++;
if( (poll_coins&0x4)&~(mCoinState&0x4) ) mCoinCount[1]++;
if( (poll_coins&0x2)&~(mCoinState&0x2) ) mCoinCount[2]++;
@@ -581,14 +581,14 @@ simulate_mcu( void )
mcu_ram[0xfc0/2+0xb] = (mCoinCount[2]<<8)|mCoinCount[3];
/* special handling for F/A */
- data = ~((readinputport(1)<<8)|readinputport(2));
+ data = ~((input_port_read_indexed(machine, 1)<<8)|input_port_read_indexed(machine, 2));
mcu_ram[0xffc/2] = data;
mcu_ram[0xffe/2] = data;
if( namcona1_gametype == NAMCO_XDAY2 )
{
- int p1 = readinputport(1);
- int p2 = readinputport(2);
+ int p1 = input_port_read_indexed(machine, 1);
+ int p2 = input_port_read_indexed(machine, 2);
UINT32 code = 0;
if( p2&0x40 ) code |= 0x2000; // enter (top-level of self-test)
if( p2&0x20 ) code |= 0x1000; // exit (top-level of self-test)
@@ -1195,19 +1195,19 @@ static READ8_HANDLER( port7_r )
switch (mcu_port6 & 0xe0)
{
case 0x40:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
break;
case 0x60:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
break;
case 0x20:
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
break;
case 0x00:
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
break;
}
@@ -1256,7 +1256,7 @@ static MACHINE_RESET( namcona1_mcu )
static READ8_HANDLER( portana_r )
{
static const UINT8 bitnum[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 };
- UINT8 port = readinputport(2);
+ UINT8 port = input_port_read_indexed(machine, 2);
return (port & bitnum[offset>>1]) ? 0xff : 0x00;
}
@@ -1275,7 +1275,7 @@ static INTERRUPT_GEN( namcona1_interrupt )
int level = cpu_getiloops(); /* 0,1,2,3,4 */
if( level==0 )
{
- simulate_mcu();
+ simulate_mcu(machine);
}
if( mEnableInterrupts )
{
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index f3b19513f51..31dcd29ea11 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -664,10 +664,10 @@ static READ32_HANDLER( gunbulet_gun_r )
switch( offset )
{
- case 0: case 1: result = (UINT8)(0x0f+readinputport(7)*224/255); break; /* Y (p2) */
- case 2: case 3: result = (UINT8)(0x26+readinputport(6)*288/314); break; /* X (p2) */
- case 4: case 5: result = (UINT8)(0x0f+readinputport(5)*224/255); break; /* Y (p1) */
- case 6: case 7: result = (UINT8)(0x26+readinputport(4)*288/314); break; /* X (p1) */
+ case 0: case 1: result = (UINT8)(0x0f+input_port_read_indexed(machine, 7)*224/255); break; /* Y (p2) */
+ case 2: case 3: result = (UINT8)(0x26+input_port_read_indexed(machine, 6)*288/314); break; /* X (p2) */
+ case 4: case 5: result = (UINT8)(0x0f+input_port_read_indexed(machine, 5)*224/255); break; /* Y (p1) */
+ case 6: case 7: result = (UINT8)(0x26+input_port_read_indexed(machine, 4)*288/314); break; /* X (p1) */
}
return result<<24;
} /* gunbulet_gun_r */
diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c
index 4c406e055a9..f98445f8a64 100644
--- a/src/mame/drivers/namcos1.c
+++ b/src/mame/drivers/namcos1.c
@@ -412,7 +412,7 @@ static WRITE8_HANDLER( firq_ack_w )
static READ8_HANDLER( dsw_r )
{
- int ret = readinputportbytag("DIPSW");
+ int ret = input_port_read(machine, "DIPSW");
if (!(offset & 2)) ret >>= 4;
return 0xf0 | ret;
}
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index c7838b04fd0..3f914c5cef1 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -575,16 +575,16 @@ static INTERRUPT_GEN( namcos11_vblank )
UINT16 n_coin;
UINT32 n_input;
- n_input = ( readinputportbytag( "PLAYER1" ) << 16 );
+ n_input = ( input_port_read(machine, "PLAYER1" ) << 16 );
SHRAM( 0xbd00 ) = n_input | ( ( n_input & ~SHRAM( 0xbd00 ) ) >> 8 ) | ( SHRAM( 0xbd00 ) & 0x0000ffff );
- n_input = readinputportbytag( "PLAYER2" ) | ( readinputportbytag( "PLAYER3" ) << 16 );
+ n_input = input_port_read(machine, "PLAYER2" ) | ( input_port_read(machine, "PLAYER3" ) << 16 );
SHRAM( 0xbd04 ) = n_input | ( ( n_input & ~SHRAM( 0xbd04 ) ) >> 8 );
- n_input = readinputportbytag( "PLAYER4" );
+ n_input = input_port_read(machine, "PLAYER4" );
SHRAM( 0xbd08 ) = n_input | ( ( n_input & ~SHRAM( 0xbd08 ) ) >> 8 ) | ( SHRAM( 0xbd08 ) & 0xffff0000 );
- n_coin = readinputportbytag( "COIN" );
+ n_coin = input_port_read(machine, "COIN" );
if( ( n_coin & m_n_oldcoin & 0x08 ) != 0 )
{
@@ -627,14 +627,14 @@ static INTERRUPT_GEN( namcos11_vblank )
SHRAM( 0xbd30 ) = ( SHRAM( 0xbd30 ) & 0x0000ffff ) | ( 0x0080 << 16 );
- SHRAM( 0xbd08 ) = ( SHRAM( 0xbd08 ) & 0x0000ffff ) | ( readinputportbytag( "STEERING" ) << 16 );
- SHRAM( 0xbd0c ) = ( SHRAM( 0xbd0c ) & 0xffff0000 ) | ( readinputportbytag( "GAS" ) << 0 );
+ SHRAM( 0xbd08 ) = ( SHRAM( 0xbd08 ) & 0x0000ffff ) | ( input_port_read(machine, "STEERING" ) << 16 );
+ SHRAM( 0xbd0c ) = ( SHRAM( 0xbd0c ) & 0xffff0000 ) | ( input_port_read(machine, "GAS" ) << 0 );
}
}
static TIMER_CALLBACK( mcu_timer )
{
- SHRAM( 0xbd00 ) = ( SHRAM( 0xbd00 ) & 0xffffff00 ) | readinputportbytag( "SWITCH" );
+ SHRAM( 0xbd00 ) = ( SHRAM( 0xbd00 ) & 0xffffff00 ) | input_port_read(machine, "SWITCH" );
}
static UINT32 m_n_bankoffset;
@@ -715,16 +715,16 @@ static READ32_HANDLER( lightgun_r )
switch( offset )
{
case 0:
- data = readinputportbytag( "GUN1X" );
+ data = input_port_read(machine, "GUN1X" );
break;
case 1:
- data = ( readinputportbytag( "GUN1Y" ) ) | ( ( readinputportbytag( "GUN1Y" ) + 1 ) << 16 );
+ data = ( input_port_read(machine, "GUN1Y" ) ) | ( ( input_port_read(machine, "GUN1Y" ) + 1 ) << 16 );
break;
case 2:
- data = readinputportbytag( "GUN2X" );
+ data = input_port_read(machine, "GUN2X" );
break;
case 3:
- data = ( readinputportbytag( "GUN2Y" ) ) | ( ( readinputportbytag( "GUN2Y" ) + 1 ) << 16 );
+ data = ( input_port_read(machine, "GUN2Y" ) ) | ( ( input_port_read(machine, "GUN2Y" ) + 1 ) << 16 );
break;
}
verboselog( 2, "lightgun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 24a25ecd065..95d8b611702 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1145,16 +1145,16 @@ static READ32_HANDLER( system11gun_r )
switch( offset )
{
case 0:
- data = readinputport( 3 );
+ data = input_port_read_indexed(machine, 3 );
break;
case 1:
- data = ( readinputport( 4 ) ) | ( ( readinputport( 4 ) + 1 ) << 16 );
+ data = ( input_port_read_indexed(machine, 4 ) ) | ( ( input_port_read_indexed(machine, 4 ) + 1 ) << 16 );
break;
case 2:
- data = readinputport( 5 );
+ data = input_port_read_indexed(machine, 5 );
break;
case 3:
- data = ( readinputport( 6 ) ) | ( ( readinputport( 6 ) + 1 ) << 16 );
+ data = ( input_port_read_indexed(machine, 6 ) ) | ( ( input_port_read_indexed(machine, 6 ) + 1 ) << 16 );
break;
}
verboselog( 2, "system11gun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
@@ -1387,7 +1387,7 @@ static READ8_HANDLER( s12_mcu_gun_h_r )
int index = port_tag_to_index("IN3");
if( index != -1 )
{
- int rv = readinputport( index ) << 6;
+ int rv = input_port_read_indexed(machine, index ) << 6;
if( ( offset & 1 ) != 0 )
{
@@ -1406,7 +1406,7 @@ static READ8_HANDLER( s12_mcu_gun_v_r )
int index = port_tag_to_index("IN4");
if( index != -1 )
{
- int rv = readinputport( index ) << 6;
+ int rv = input_port_read_indexed(machine, index ) << 6;
if( ( offset & 1 ) != 0 )
{
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index d2719d5f31d..db2faf8443a 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -203,20 +203,20 @@ nthbyte( const UINT32 *pSource, int offs )
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-ReadAnalogDrivingPorts( UINT16 *gas, UINT16 *brake, UINT16 *steer )
+ReadAnalogDrivingPorts( running_machine *machine, UINT16 *gas, UINT16 *brake, UINT16 *steer )
{
- *gas = readinputport(2);
- *brake = readinputport(3);
- *steer = readinputport(4);
+ *gas = input_port_read_indexed(machine, 2);
+ *brake = input_port_read_indexed(machine, 3);
+ *steer = input_port_read_indexed(machine, 4);
}
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static UINT16
-AnalogAsDigital( void )
+AnalogAsDigital( running_machine *machine )
{
- UINT16 stick = readinputport(1);
- UINT16 gas = readinputport(2);
- UINT16 steer = readinputport(4);
+ UINT16 stick = input_port_read_indexed(machine, 1);
+ UINT16 gas = input_port_read_indexed(machine, 2);
+ UINT16 steer = input_port_read_indexed(machine, 4);
UINT16 result = 0xffff;
switch( namcos22_gametype )
@@ -263,12 +263,12 @@ AnalogAsDigital( void )
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-HandleCoinage(int slots)
+HandleCoinage(running_machine *machine, int slots)
{
UINT16 *share16 = (UINT16 *)namcos22_shareram;
UINT32 coin_state;
- coin_state = readinputport(1) & 0x1200;
+ coin_state = input_port_read_indexed(machine, 1) & 0x1200;
if (!(coin_state & 0x1000) && (old_coin_state & 0x1000))
{
@@ -292,15 +292,15 @@ HandleCoinage(int slots)
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-HandleDrivingIO( void )
+HandleDrivingIO( running_machine *machine )
{
if( nthbyte(namcos22_system_controller,0x18)!=0 )
{
- UINT16 flags = readinputport(1);
+ UINT16 flags = input_port_read_indexed(machine, 1);
UINT16 gas,brake,steer;
- ReadAnalogDrivingPorts( &gas, &brake, &steer );
+ ReadAnalogDrivingPorts( machine, &gas, &brake, &steer );
- HandleCoinage(2);
+ HandleCoinage(machine, 2);
switch (namcos22_gametype)
{
@@ -348,22 +348,22 @@ HandleDrivingIO( void )
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-HandleCyberCommandoIO( void )
+HandleCyberCommandoIO( running_machine *machine )
{
if( nthbyte(namcos22_system_controller,0x18)!=0 )
{
- UINT16 flags = readinputport(1);
+ UINT16 flags = input_port_read_indexed(machine, 1);
- UINT16 volume0 = readinputport(2)*0x10;
- UINT16 volume1 = readinputport(3)*0x10;
- UINT16 volume2 = readinputport(4)*0x10;
- UINT16 volume3 = readinputport(5)*0x10;
+ UINT16 volume0 = input_port_read_indexed(machine, 2)*0x10;
+ UINT16 volume1 = input_port_read_indexed(machine, 3)*0x10;
+ UINT16 volume2 = input_port_read_indexed(machine, 4)*0x10;
+ UINT16 volume3 = input_port_read_indexed(machine, 5)*0x10;
namcos22_shareram[0x030/4] = (flags<<16)|volume0;
namcos22_shareram[0x034/4] = (volume1<<16)|volume2;
namcos22_shareram[0x038/4] = volume3<<16;
- HandleCoinage(1);
+ HandleCoinage(machine, 1);
}
} /* HandleCyberCommandoIO */
@@ -1299,14 +1299,14 @@ static READ32_HANDLER( namcos22_portbit_r )
}
static WRITE32_HANDLER( namcos22_portbit_w )
{
- unsigned dat50000008 = AnalogAsDigital();
+ unsigned dat50000008 = AnalogAsDigital(machine);
unsigned dat5000000a = 0xffff;
mSys22PortBits = (dat50000008<<16)|dat5000000a;
}
static READ32_HANDLER( namcos22_dipswitch_r )
{
- return readinputport(0)<<16;
+ return input_port_read_indexed(machine, 0)<<16;
}
static READ32_HANDLER( namcos22_mcuram_r )
@@ -1376,8 +1376,8 @@ static WRITE32_HANDLER( spotram_w )
static READ32_HANDLER( namcos22_gun_r )
{
- int xpos = readinputport(1)*640/0xff;
- int ypos = readinputport(2)*480/0xff;
+ int xpos = input_port_read_indexed(machine, 1)*640/0xff;
+ int ypos = input_port_read_indexed(machine, 2)*480/0xff;
switch( offset )
{
case 0: /* 430000 */
@@ -1541,11 +1541,11 @@ static READ8_HANDLER( mcu_port5_r )
{
if (mFrameCount & 1)
{
- return readinputportbytag_safe("MCUP5A", 0xff) | 0x80;
+ return input_port_read_safe(machine, "MCUP5A", 0xff) | 0x80;
}
else
{
- return readinputportbytag_safe("MCUP5A", 0xff) & 0x7f;
+ return input_port_read_safe(machine, "MCUP5A", 0xff) & 0x7f;
}
}
else
@@ -1564,11 +1564,11 @@ static READ8_HANDLER( mcu_port5_r )
{
if (p4 & 8)
{
- return readinputportbytag_safe("MCUP5A", 0xff);
+ return input_port_read_safe(machine, "MCUP5A", 0xff);
}
else
{
- return readinputportbytag_safe("MCUP5B", 0xff);
+ return input_port_read_safe(machine, "MCUP5B", 0xff);
}
}
}
@@ -1611,8 +1611,8 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
{
static UINT16 ddx, ddy;
- ddx = ((readinputport(2)^0xff)-1)<<2;
- ddy = (readinputport(3)-1)<<2;
+ ddx = ((input_port_read_indexed(machine, 2)^0xff)-1)<<2;
+ ddy = (input_port_read_indexed(machine, 3)-1)<<2;
switch (offset)
{
@@ -1625,7 +1625,7 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
// and timer A3 is configured by the MCU program to cause an interrupt each time
// it's clocked. by counting the number of interrupts in a frame, we can determine
// how fast the user is pedaling.
- if( readinputport(1) & 0x10 )
+ if( input_port_read_indexed(machine, 1) & 0x10 )
{
int i;
for (i = 0; i < 16; i++)
@@ -1654,12 +1654,12 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
// 0 H+L = swing, 1 H+L = edge
static READ8_HANDLER( alpineracer_mcu_adc_r )
{
- UINT16 swing = (0xff-readinputport(2))<<2;
- UINT16 edge = (0xff-readinputport(3))<<2;
+ UINT16 swing = (0xff-input_port_read_indexed(machine, 2))<<2;
+ UINT16 edge = (0xff-input_port_read_indexed(machine, 3))<<2;
// fake out the centering a bit
- if (readinputport(2) == 0x80) swing = 0x200;
- if (readinputport(3) == 0x80) edge = 0x200;
+ if (input_port_read_indexed(machine, 2) == 0x80) swing = 0x200;
+ if (input_port_read_indexed(machine, 3) == 0x80) edge = 0x200;
switch (offset)
{
@@ -1688,7 +1688,7 @@ static READ8_HANDLER( alpineracer_mcu_adc_r )
static READ8_HANDLER( cybrcycc_mcu_adc_r )
{
UINT16 gas,brake,steer;
- ReadAnalogDrivingPorts( &gas, &brake, &steer );
+ ReadAnalogDrivingPorts( machine, &gas, &brake, &steer );
gas <<= 2;
brake <<= 2;
@@ -1730,9 +1730,9 @@ static READ8_HANDLER( airco22_mcu_adc_r )
{
UINT16 pedal, x, y;
- pedal = readinputport(1)<<2;
- x = readinputport(2)<<2;
- y = readinputport(3)<<2;
+ pedal = input_port_read_indexed(machine, 1)<<2;
+ x = input_port_read_indexed(machine, 2)<<2;
+ y = input_port_read_indexed(machine, 3)<<2;
switch (offset)
@@ -2127,7 +2127,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
switch( namcos22_gametype )
{
case NAMCOS22_RIDGE_RACER:
- HandleDrivingIO();
+ HandleDrivingIO(machine);
irq_level1 = 4;
irq_level2 = 5;
// 1:0a0b6
@@ -2140,7 +2140,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
break;
case NAMCOS22_RIDGE_RACER2:
- HandleDrivingIO();
+ HandleDrivingIO(machine);
irq_level1 = 1;
irq_level2 = 5;
//1:0d10c 40000005
@@ -2153,11 +2153,11 @@ static INTERRUPT_GEN( namcos22_interrupt )
break;
case NAMCOS22_RAVE_RACER:
- HandleDrivingIO();
+ HandleDrivingIO(machine);
break;
case NAMCOS22_VICTORY_LAP:
- HandleDrivingIO();
+ HandleDrivingIO(machine);
// a54 indir to 21c2 (hblank?)
// a5a (rte)
// a5c (rte)
@@ -2170,7 +2170,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
break;
case NAMCOS22_ACE_DRIVER:
- HandleDrivingIO();
+ HandleDrivingIO(machine);
// 9f8 (rte)
// 9fa (rte)
// 9fc (rte)
@@ -2188,7 +2188,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
//move.b #$35, $40000004.l
//
//move.b #$34, $40000004.l
- HandleCyberCommandoIO();
+ HandleCyberCommandoIO(machine);
irq_level1 = nthbyte(namcos22_system_controller,0x04)&0x7;
irq_level2 = nthbyte(namcos22_system_controller,0x02)&0x7;
break;
@@ -4331,7 +4331,7 @@ static DRIVER_INIT( ridgeraj )
install_c74_speedup();
- old_coin_state = readinputport(1) & 0x1200;
+ old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
}
@@ -4341,7 +4341,7 @@ static DRIVER_INIT( ridger2j )
install_c74_speedup();
- old_coin_state = readinputport(1) & 0x1200;
+ old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
}
@@ -4351,7 +4351,7 @@ static DRIVER_INIT( acedrvr )
install_c74_speedup();
- old_coin_state = readinputport(1) & 0x1200;
+ old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
}
@@ -4361,7 +4361,7 @@ static DRIVER_INIT( victlap )
install_c74_speedup();
- old_coin_state = readinputport(1) & 0x1200;
+ old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
}
@@ -4371,7 +4371,7 @@ static DRIVER_INIT( raveracw )
install_c74_speedup();
- old_coin_state = readinputport(1) & 0x1200;
+ old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
}
@@ -4388,7 +4388,7 @@ static DRIVER_INIT( cybrcomm )
install_c74_speedup();
- old_coin_state = readinputport(1) & 0x1200;
+ old_coin_state = input_port_read_indexed(machine, 1) & 0x1200;
credits1 = credits2 = 0;
}
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index fa21a73faaa..d79db7fea8e 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -233,15 +233,15 @@ static READ8_HANDLER( dsw0_r )
{
int rhi, rlo;
- rhi = ( readinputportbytag("DSWA") & 0x01 ) << 4;
- rhi |= ( readinputportbytag("DSWA") & 0x04 ) << 3;
- rhi |= ( readinputportbytag("DSWA") & 0x10 ) << 2;
- rhi |= ( readinputportbytag("DSWA") & 0x40 ) << 1;
+ rhi = ( input_port_read(machine, "DSWA") & 0x01 ) << 4;
+ rhi |= ( input_port_read(machine, "DSWA") & 0x04 ) << 3;
+ rhi |= ( input_port_read(machine, "DSWA") & 0x10 ) << 2;
+ rhi |= ( input_port_read(machine, "DSWA") & 0x40 ) << 1;
- rlo = ( readinputportbytag("DSWB") & 0x01 );
- rlo |= ( readinputportbytag("DSWB") & 0x04 ) >> 1;
- rlo |= ( readinputportbytag("DSWB") & 0x10 ) >> 2;
- rlo |= ( readinputportbytag("DSWB") & 0x40 ) >> 3;
+ rlo = ( input_port_read(machine, "DSWB") & 0x01 );
+ rlo |= ( input_port_read(machine, "DSWB") & 0x04 ) >> 1;
+ rlo |= ( input_port_read(machine, "DSWB") & 0x10 ) >> 2;
+ rlo |= ( input_port_read(machine, "DSWB") & 0x40 ) >> 3;
return rhi | rlo;
}
@@ -250,15 +250,15 @@ static READ8_HANDLER( dsw1_r )
{
int rhi, rlo;
- rhi = ( readinputportbytag("DSWA") & 0x02 ) << 3;
- rhi |= ( readinputportbytag("DSWA") & 0x08 ) << 2;
- rhi |= ( readinputportbytag("DSWA") & 0x20 ) << 1;
- rhi |= ( readinputportbytag("DSWA") & 0x80 );
+ rhi = ( input_port_read(machine, "DSWA") & 0x02 ) << 3;
+ rhi |= ( input_port_read(machine, "DSWA") & 0x08 ) << 2;
+ rhi |= ( input_port_read(machine, "DSWA") & 0x20 ) << 1;
+ rhi |= ( input_port_read(machine, "DSWA") & 0x80 );
- rlo = ( readinputportbytag("DSWB") & 0x02 ) >> 1;
- rlo |= ( readinputportbytag("DSWB") & 0x08 ) >> 2;
- rlo |= ( readinputportbytag("DSWB") & 0x20 ) >> 3;
- rlo |= ( readinputportbytag("DSWB") & 0x80 ) >> 4;
+ rlo = ( input_port_read(machine, "DSWB") & 0x02 ) >> 1;
+ rlo |= ( input_port_read(machine, "DSWB") & 0x08 ) >> 2;
+ rlo |= ( input_port_read(machine, "DSWB") & 0x20 ) >> 3;
+ rlo |= ( input_port_read(machine, "DSWB") & 0x80 ) >> 4;
return rhi | rlo;
}
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index c9747745e49..7b7ab2362b3 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -217,7 +217,7 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( naughtyb_interrupt )
{
- if (readinputport(3) & 1)
+ if (input_port_read_indexed(machine, 3) & 1)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 20b482241fd..0d59710cd89 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -117,9 +117,9 @@ static WRITE8_HANDLER( nbmj9195_inputportsel_w )
nbmj9195_inputport = (data ^ 0xff);
}
-static int nbmj9195_dipsw_r(void)
+static int nbmj9195_dipsw_r(running_machine *machine)
{
- return ((((readinputport(0) & 0xff) | ((readinputport(1) & 0xff) << 8)) >> nbmj9195_dipswbitsel) & 0x01);
+ return ((((input_port_read_indexed(machine, 0) & 0xff) | ((input_port_read_indexed(machine, 1) & 0xff) << 8)) >> nbmj9195_dipswbitsel) & 0x01);
}
static void nbmj9195_dipswbitsel_w(int data)
@@ -149,19 +149,19 @@ static void mscoutm_inputportsel_w(int data)
static READ8_HANDLER( mscoutm_dipsw_0_r )
{
// DIPSW A
- return (((readinputport(0) & 0x01) << 7) | ((readinputport(0) & 0x02) << 5) |
- ((readinputport(0) & 0x04) << 3) | ((readinputport(0) & 0x08) << 1) |
- ((readinputport(0) & 0x10) >> 1) | ((readinputport(0) & 0x20) >> 3) |
- ((readinputport(0) & 0x40) >> 5) | ((readinputport(0) & 0x80) >> 7));
+ return (((input_port_read_indexed(machine, 0) & 0x01) << 7) | ((input_port_read_indexed(machine, 0) & 0x02) << 5) |
+ ((input_port_read_indexed(machine, 0) & 0x04) << 3) | ((input_port_read_indexed(machine, 0) & 0x08) << 1) |
+ ((input_port_read_indexed(machine, 0) & 0x10) >> 1) | ((input_port_read_indexed(machine, 0) & 0x20) >> 3) |
+ ((input_port_read_indexed(machine, 0) & 0x40) >> 5) | ((input_port_read_indexed(machine, 0) & 0x80) >> 7));
}
static READ8_HANDLER( mscoutm_dipsw_1_r )
{
// DIPSW B
- return (((readinputport(1) & 0x01) << 7) | ((readinputport(1) & 0x02) << 5) |
- ((readinputport(1) & 0x04) << 3) | ((readinputport(1) & 0x08) << 1) |
- ((readinputport(1) & 0x10) >> 1) | ((readinputport(1) & 0x20) >> 3) |
- ((readinputport(1) & 0x40) >> 5) | ((readinputport(1) & 0x80) >> 7));
+ return (((input_port_read_indexed(machine, 1) & 0x01) << 7) | ((input_port_read_indexed(machine, 1) & 0x02) << 5) |
+ ((input_port_read_indexed(machine, 1) & 0x04) << 3) | ((input_port_read_indexed(machine, 1) & 0x08) << 1) |
+ ((input_port_read_indexed(machine, 1) & 0x10) >> 1) | ((input_port_read_indexed(machine, 1) & 0x20) >> 3) |
+ ((input_port_read_indexed(machine, 1) & 0x40) >> 5) | ((input_port_read_indexed(machine, 1) & 0x80) >> 7));
}
@@ -182,29 +182,29 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset)
{
case 0: /* PA_0 */
// COIN IN, ETC...
- portdata = readinputport(2);
+ portdata = input_port_read_indexed(machine, 2);
break;
case 1: /* PB_0 */
// PLAYER1 KEY, DIPSW A/B
switch (mscoutm_inputport)
{
case 0x01:
- portdata = readinputport(3);
+ portdata = input_port_read_indexed(machine, 3);
break;
case 0x02:
- portdata = readinputport(4);
+ portdata = input_port_read_indexed(machine, 4);
break;
case 0x04:
- portdata = readinputport(5);
+ portdata = input_port_read_indexed(machine, 5);
break;
case 0x08:
- portdata = readinputport(6);
+ portdata = input_port_read_indexed(machine, 6);
break;
case 0x10:
- portdata = readinputport(7);
+ portdata = input_port_read_indexed(machine, 7);
break;
default:
- portdata = (readinputport(3) & readinputport(4) & readinputport(5) & readinputport(6) & readinputport(7));
+ portdata = (input_port_read_indexed(machine, 3) & input_port_read_indexed(machine, 4) & input_port_read_indexed(machine, 5) & input_port_read_indexed(machine, 6) & input_port_read_indexed(machine, 7));
break;
}
break;
@@ -213,22 +213,22 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset)
switch (mscoutm_inputport)
{
case 0x01:
- portdata = readinputport(8);
+ portdata = input_port_read_indexed(machine, 8);
break;
case 0x02:
- portdata = readinputport(9);
+ portdata = input_port_read_indexed(machine, 9);
break;
case 0x04:
- portdata = readinputport(10);
+ portdata = input_port_read_indexed(machine, 10);
break;
case 0x08:
- portdata = readinputport(11);
+ portdata = input_port_read_indexed(machine, 11);
break;
case 0x10:
- portdata = readinputport(12);
+ portdata = input_port_read_indexed(machine, 12);
break;
default:
- portdata = (readinputport(8) & readinputport(9) & readinputport(10) & readinputport(11) & readinputport(12));
+ portdata = (input_port_read_indexed(machine, 8) & input_port_read_indexed(machine, 9) & input_port_read_indexed(machine, 10) & input_port_read_indexed(machine, 11) & input_port_read_indexed(machine, 12));
break;
}
break;
@@ -267,29 +267,29 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset)
{
case 0: /* PA_0 */
// COIN IN, ETC...
- portdata = ((readinputport(2) & 0xfe) | nbmj9195_outcoin_flag);
+ portdata = ((input_port_read_indexed(machine, 2) & 0xfe) | nbmj9195_outcoin_flag);
break;
case 1: /* PB_0 */
// PLAYER1 KEY, DIPSW A/B
switch (nbmj9195_inputport)
{
case 0x01:
- portdata = readinputport(3);
+ portdata = input_port_read_indexed(machine, 3);
break;
case 0x02:
- portdata = readinputport(4);
+ portdata = input_port_read_indexed(machine, 4);
break;
case 0x04:
- portdata = readinputport(5);
+ portdata = input_port_read_indexed(machine, 5);
break;
case 0x08:
- portdata = readinputport(6);
+ portdata = input_port_read_indexed(machine, 6);
break;
case 0x10:
- portdata = ((readinputport(7) & 0x7f) | (nbmj9195_dipsw_r() << 7));
+ portdata = ((input_port_read_indexed(machine, 7) & 0x7f) | (nbmj9195_dipsw_r(machine) << 7));
break;
default:
- portdata = (readinputport(3) & readinputport(4) & readinputport(5) & readinputport(6) & (readinputport(12) & 0x7f));
+ portdata = (input_port_read_indexed(machine, 3) & input_port_read_indexed(machine, 4) & input_port_read_indexed(machine, 5) & input_port_read_indexed(machine, 6) & (input_port_read_indexed(machine, 12) & 0x7f));
break;
}
break;
@@ -298,22 +298,22 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset)
switch (nbmj9195_inputport)
{
case 0x01:
- portdata = readinputport(8);
+ portdata = input_port_read_indexed(machine, 8);
break;
case 0x02:
- portdata = readinputport(9);
+ portdata = input_port_read_indexed(machine, 9);
break;
case 0x04:
- portdata = readinputport(10);
+ portdata = input_port_read_indexed(machine, 10);
break;
case 0x08:
- portdata = readinputport(11);
+ portdata = input_port_read_indexed(machine, 11);
break;
case 0x10:
- portdata = readinputport(12) & 0x7f;
+ portdata = input_port_read_indexed(machine, 12) & 0x7f;
break;
default:
- portdata = (readinputport(8) & readinputport(9) & readinputport(10) & readinputport(11) & (readinputport(12) & 0x7f));
+ portdata = (input_port_read_indexed(machine, 8) & input_port_read_indexed(machine, 9) & input_port_read_indexed(machine, 10) & input_port_read_indexed(machine, 11) & (input_port_read_indexed(machine, 12) & 0x7f));
break;
}
break;
diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c
index 29f01fd521b..71b8d2907e2 100644
--- a/src/mame/drivers/nemesis.c
+++ b/src/mame/drivers/nemesis.c
@@ -217,8 +217,8 @@ static READ16_HANDLER( konamigt_input_word_r )
bit 12-15: accel
*/
- int data=readinputport(7);
- int data2=readinputport(6);
+ int data=input_port_read_indexed(machine, 7);
+ int data2=input_port_read_indexed(machine, 6);
int ret=0x0000;
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 4c375de75d0..93520f69ee9 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -7038,7 +7038,7 @@ static DRIVER_INIT( ms5plus )
static TIMER_CALLBACK( svcpcb_bios_timer_callback )
{
- int harddip3 = readinputportbytag("HARDDIP") & 1;
+ int harddip3 = input_port_read(machine, "HARDDIP") & 1;
memory_set_bankptr(NEOGEO_BANK_BIOS, memory_region(NEOGEO_REGION_MAIN_CPU_BIOS)+0x20000+harddip3*0x20000);
}
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 186bb957577..09c3efd724d 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -332,7 +332,7 @@ static CUSTOM_INPUT( multiplexed_controller_r )
sprintf(tag, "IN%s-%d", (const char *)param, controller_select & 0x01);
- return readinputportbytag(tag);
+ return input_port_read(machine, tag);
}
@@ -351,10 +351,10 @@ cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF
{
default:
case 0x00: ret = 0x0000; break; /* nothing? */
- case 0x09: ret = readinputportbytag("MAHJONG1"); break;
- case 0x12: ret = readinputportbytag("MAHJONG2"); break;
- case 0x1b: ret = readinputportbytag("MAHJONG3"); break; /* player 1 normal inputs? */
- case 0x24: ret = readinputportbytag("MAHJONG4"); break;
+ case 0x09: ret = input_port_read(machine, "MAHJONG1"); break;
+ case 0x12: ret = input_port_read(machine, "MAHJONG2"); break;
+ case 0x1b: ret = input_port_read(machine, "MAHJONG3"); break; /* player 1 normal inputs? */
+ case 0x24: ret = input_port_read(machine, "MAHJONG4"); break;
}
return ret;
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index 9b01bb55dcb..6b8cc08774e 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -326,8 +326,8 @@ static READ8_HANDLER( omegaf_io_protection_r )
case 1: // dip switches
switch (offset)
{
- case 0: result = readinputportbytag("DIPSW1"); break;
- case 1: result = readinputportbytag("DIPSW2"); break;
+ case 0: result = input_port_read(machine, "DIPSW1"); break;
+ case 1: result = input_port_read(machine, "DIPSW2"); break;
case 2: result = 0x02; break;
}
break;
@@ -335,8 +335,8 @@ static READ8_HANDLER( omegaf_io_protection_r )
case 2: // player inputs
switch (offset)
{
- case 0: result = readinputportbytag("PAD1"); break;
- case 1: result = readinputportbytag("PAD2"); break;
+ case 0: result = input_port_read(machine, "PAD1"); break;
+ case 1: result = input_port_read(machine, "PAD2"); break;
case 2: result = 0x01; break;
}
break;
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index c49cb3231a3..4363d5ce40e 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -248,27 +248,27 @@ static READ16_HANDLER( niyanpai_dipsw_r )
{
UINT8 dipsw_a, dipsw_b;
- dipsw_a = (((readinputport(0) & 0x01) << 7) | ((readinputport(0) & 0x02) << 5) |
- ((readinputport(0) & 0x04) << 3) | ((readinputport(0) & 0x08) << 1) |
- ((readinputport(0) & 0x10) >> 1) | ((readinputport(0) & 0x20) >> 3) |
- ((readinputport(0) & 0x40) >> 5) | ((readinputport(0) & 0x80) >> 7));
+ dipsw_a = (((input_port_read_indexed(machine, 0) & 0x01) << 7) | ((input_port_read_indexed(machine, 0) & 0x02) << 5) |
+ ((input_port_read_indexed(machine, 0) & 0x04) << 3) | ((input_port_read_indexed(machine, 0) & 0x08) << 1) |
+ ((input_port_read_indexed(machine, 0) & 0x10) >> 1) | ((input_port_read_indexed(machine, 0) & 0x20) >> 3) |
+ ((input_port_read_indexed(machine, 0) & 0x40) >> 5) | ((input_port_read_indexed(machine, 0) & 0x80) >> 7));
- dipsw_b = (((readinputport(1) & 0x01) << 7) | ((readinputport(1) & 0x02) << 5) |
- ((readinputport(1) & 0x04) << 3) | ((readinputport(1) & 0x08) << 1) |
- ((readinputport(1) & 0x10) >> 1) | ((readinputport(1) & 0x20) >> 3) |
- ((readinputport(1) & 0x40) >> 5) | ((readinputport(1) & 0x80) >> 7));
+ dipsw_b = (((input_port_read_indexed(machine, 1) & 0x01) << 7) | ((input_port_read_indexed(machine, 1) & 0x02) << 5) |
+ ((input_port_read_indexed(machine, 1) & 0x04) << 3) | ((input_port_read_indexed(machine, 1) & 0x08) << 1) |
+ ((input_port_read_indexed(machine, 1) & 0x10) >> 1) | ((input_port_read_indexed(machine, 1) & 0x20) >> 3) |
+ ((input_port_read_indexed(machine, 1) & 0x40) >> 5) | ((input_port_read_indexed(machine, 1) & 0x80) >> 7));
return ((dipsw_a << 8) | dipsw_b);
}
static READ16_HANDLER( niyanpai_inputport_0_r )
{
- return ((readinputport(3) << 8) | (readinputport(4) << 0));
+ return ((input_port_read_indexed(machine, 3) << 8) | (input_port_read_indexed(machine, 4) << 0));
}
static READ16_HANDLER( niyanpai_inputport_1_r )
{
- return ((readinputport(2) << 8) | 0xff);
+ return ((input_port_read_indexed(machine, 2) << 8) | 0xff);
}
static READ16_HANDLER( musobana_inputport_0_r )
@@ -277,12 +277,12 @@ static READ16_HANDLER( musobana_inputport_0_r )
switch ((musobana_inputport ^ 0xff00) >> 8)
{
- case 0x01: portdata = ((readinputport(3) << 8) | (readinputport(8))); break;
- case 0x02: portdata = ((readinputport(4) << 8) | (readinputport(9))); break;
- case 0x04: portdata = ((readinputport(5) << 8) | (readinputport(10))); break;
- case 0x08: portdata = ((readinputport(6) << 8) | (readinputport(11))); break;
- case 0x10: portdata = ((readinputport(7) << 8) | (readinputport(12))); break;
- default: portdata = (((readinputport(3) << 8) | (readinputport(8)))) & (((readinputport(4) << 8) | (readinputport(9)))) & (((readinputport(5) << 8) | (readinputport(10)))) & (((readinputport(6) << 8) | (readinputport(11)))) & (((readinputport(7) << 8) | (readinputport(12)))); break;
+ case 0x01: portdata = ((input_port_read_indexed(machine, 3) << 8) | (input_port_read_indexed(machine, 8))); break;
+ case 0x02: portdata = ((input_port_read_indexed(machine, 4) << 8) | (input_port_read_indexed(machine, 9))); break;
+ case 0x04: portdata = ((input_port_read_indexed(machine, 5) << 8) | (input_port_read_indexed(machine, 10))); break;
+ case 0x08: portdata = ((input_port_read_indexed(machine, 6) << 8) | (input_port_read_indexed(machine, 11))); break;
+ case 0x10: portdata = ((input_port_read_indexed(machine, 7) << 8) | (input_port_read_indexed(machine, 12))); break;
+ default: portdata = (((input_port_read_indexed(machine, 3) << 8) | (input_port_read_indexed(machine, 8)))) & (((input_port_read_indexed(machine, 4) << 8) | (input_port_read_indexed(machine, 9)))) & (((input_port_read_indexed(machine, 5) << 8) | (input_port_read_indexed(machine, 10)))) & (((input_port_read_indexed(machine, 6) << 8) | (input_port_read_indexed(machine, 11)))) & (((input_port_read_indexed(machine, 7) << 8) | (input_port_read_indexed(machine, 12)))); break;
}
return (portdata);
@@ -298,7 +298,7 @@ static READ16_HANDLER( musobana_inputport_1_r )
if (tmp68301_parallel_interface_r(machine, 0x0005, 0x00ff) & 0x0004) musobana_outcoin_flag ^= 1;
else musobana_outcoin_flag = 1;
- return (((readinputport(2) & 0xdf) | ((musobana_outcoin_flag & 0x01) << 5)) << 8);
+ return (((input_port_read_indexed(machine, 2) & 0xdf) | ((musobana_outcoin_flag & 0x01) << 5)) << 8);
}
static WRITE16_HANDLER ( musobana_inputport_w )
diff --git a/src/mame/drivers/nova2001.c b/src/mame/drivers/nova2001.c
index 6257157de76..dd6713dd50b 100644
--- a/src/mame/drivers/nova2001.c
+++ b/src/mame/drivers/nova2001.c
@@ -135,7 +135,7 @@ static UINT8 ninjakun_io_a002_ctrl;
static READ8_HANDLER( ninjakun_io_A002_r )
{
- return ninjakun_io_a002_ctrl | readinputport(2); /* vblank */
+ return ninjakun_io_a002_ctrl | input_port_read_indexed(machine, 2); /* vblank */
}
static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w )
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index 8975ad18387..3ab0948e385 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -556,11 +556,11 @@ static double adc12138_input_callback(int input)
int value = 0;
switch (input)
{
- case 0: value = readinputport(4) - 0x800; break;
- case 1: value = readinputport(5); break;
- case 2: value = readinputport(6); break;
- case 3: value = readinputport(7); break;
- case 4: value = readinputport(8); break;
+ case 0: value = input_port_read_indexed(Machine, 4) - 0x800; break;
+ case 1: value = input_port_read_indexed(Machine, 5); break;
+ case 2: value = input_port_read_indexed(Machine, 6); break;
+ case 3: value = input_port_read_indexed(Machine, 7); break;
+ case 4: value = input_port_read_indexed(Machine, 8); break;
}
return (double)(value) / 2047.0;
@@ -573,15 +573,15 @@ static READ32_HANDLER( sysreg_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(0) << 24;
+ r |= input_port_read_indexed(machine, 0) << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= readinputport(1) << 16;
+ r |= input_port_read_indexed(machine, 1) << 16;
}
if (ACCESSING_BITS_8_15)
{
- r |= readinputport(2) << 8;
+ r |= input_port_read_indexed(machine, 2) << 8;
}
if (ACCESSING_BITS_0_7)
{
@@ -592,7 +592,7 @@ static READ32_HANDLER( sysreg_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(3) << 24;
+ r |= input_port_read_indexed(machine, 3) << 24;
}
}
return r;
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index 2ba15caf6b9..ad25820c273 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -226,7 +226,7 @@ static READ8_HANDLER( nycaptor_b_r )
static READ8_HANDLER( nycaptor_by_r )
{
- int port=readinputport(6);
+ int port=input_port_read_indexed(machine, 6);
if(nyc_gametype==1)
port=255-port;
return port-8;
@@ -234,7 +234,7 @@ static READ8_HANDLER( nycaptor_by_r )
static READ8_HANDLER( nycaptor_bx_r )
{
- return (readinputport(5)+0x27)|1;
+ return (input_port_read_indexed(machine, 5)+0x27)|1;
}
diff --git a/src/mame/drivers/offtwall.c b/src/mame/drivers/offtwall.c
index 9372854792a..2d3f9caf25c 100644
--- a/src/mame/drivers/offtwall.c
+++ b/src/mame/drivers/offtwall.c
@@ -90,7 +90,7 @@ static WRITE16_HANDLER( offtwall_atarivc_w )
static READ16_HANDLER( special_port3_r )
{
- int result = readinputport(3);
+ int result = input_port_read_indexed(machine, 3);
if (atarigen_cpu_to_sound_ready) result ^= 0x0020;
return result;
}
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index 434433014d9..8bbbb525a86 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -146,18 +146,18 @@ static READ8_HANDLER( ojankohs_keymatrix_r )
int ret;
switch (ojankohs_portselect) {
- case 0x01: ret = readinputportbytag("IN4"); break;
- case 0x02: ret = readinputportbytag("IN5"); break;
- case 0x04: ret = readinputportbytag("IN6"); break;
- case 0x08: ret = readinputportbytag("IN7"); break;
- case 0x10: ret = readinputportbytag("IN8"); break;
+ case 0x01: ret = input_port_read(machine, "IN4"); break;
+ case 0x02: ret = input_port_read(machine, "IN5"); break;
+ case 0x04: ret = input_port_read(machine, "IN6"); break;
+ case 0x08: ret = input_port_read(machine, "IN7"); break;
+ case 0x10: ret = input_port_read(machine, "IN8"); break;
case 0x20: ret = 0xff; break;
case 0x3f: ret = 0xff;
- ret &= readinputportbytag("IN4");
- ret &= readinputportbytag("IN5");
- ret &= readinputportbytag("IN6");
- ret &= readinputportbytag("IN7");
- ret &= readinputportbytag("IN8");
+ ret &= input_port_read(machine, "IN4");
+ ret &= input_port_read(machine, "IN5");
+ ret &= input_port_read(machine, "IN6");
+ ret &= input_port_read(machine, "IN7");
+ ret &= input_port_read(machine, "IN8");
break;
default: ret = 0xff;
logerror("PC:%04X unknown %02X\n", activecpu_get_pc(), ojankohs_portselect);
@@ -174,48 +174,48 @@ static READ8_HANDLER( ojankoc_keymatrix_r )
for (i = 0; i < 5; i++) {
if (~ojankohs_portselect & (1 << i))
- ret |= readinputport(i + offset * 5 + 2);
+ ret |= input_port_read_indexed(machine, i + offset * 5 + 2);
}
- return (ret & 0x3f) | (readinputport(12 + offset) & 0xc0);
+ return (ret & 0x3f) | (input_port_read_indexed(machine, 12 + offset) & 0xc0);
}
static READ8_HANDLER( ojankohs_ay8910_0_r )
{
// DIPSW 1
- return (((readinputportbytag("DSW1") & 0x01) << 7) | ((readinputportbytag("DSW1") & 0x02) << 5) |
- ((readinputportbytag("DSW1") & 0x04) << 3) | ((readinputportbytag("DSW1") & 0x08) << 1) |
- ((readinputportbytag("DSW1") & 0x10) >> 1) | ((readinputportbytag("DSW1") & 0x20) >> 3) |
- ((readinputportbytag("DSW1") & 0x40) >> 5) | ((readinputportbytag("DSW1") & 0x80) >> 7));
+ return (((input_port_read(machine, "DSW1") & 0x01) << 7) | ((input_port_read(machine, "DSW1") & 0x02) << 5) |
+ ((input_port_read(machine, "DSW1") & 0x04) << 3) | ((input_port_read(machine, "DSW1") & 0x08) << 1) |
+ ((input_port_read(machine, "DSW1") & 0x10) >> 1) | ((input_port_read(machine, "DSW1") & 0x20) >> 3) |
+ ((input_port_read(machine, "DSW1") & 0x40) >> 5) | ((input_port_read(machine, "DSW1") & 0x80) >> 7));
}
static READ8_HANDLER( ojankohs_ay8910_1_r )
{
// DIPSW 1
- return (((readinputportbytag("DSW2") & 0x01) << 7) | ((readinputportbytag("DSW2") & 0x02) << 5) |
- ((readinputportbytag("DSW2") & 0x04) << 3) | ((readinputportbytag("DSW2") & 0x08) << 1) |
- ((readinputportbytag("DSW2") & 0x10) >> 1) | ((readinputportbytag("DSW2") & 0x20) >> 3) |
- ((readinputportbytag("DSW2") & 0x40) >> 5) | ((readinputportbytag("DSW2") & 0x80) >> 7));
+ return (((input_port_read(machine, "DSW2") & 0x01) << 7) | ((input_port_read(machine, "DSW2") & 0x02) << 5) |
+ ((input_port_read(machine, "DSW2") & 0x04) << 3) | ((input_port_read(machine, "DSW2") & 0x08) << 1) |
+ ((input_port_read(machine, "DSW2") & 0x10) >> 1) | ((input_port_read(machine, "DSW2") & 0x20) >> 3) |
+ ((input_port_read(machine, "DSW2") & 0x40) >> 5) | ((input_port_read(machine, "DSW2") & 0x80) >> 7));
}
static READ8_HANDLER( ojankoy_ay8910_0_r )
{
- return readinputportbytag("DSW1"); // DIPSW 1
+ return input_port_read(machine, "DSW1"); // DIPSW 1
}
static READ8_HANDLER( ojankoy_ay8910_1_r )
{
- return readinputportbytag("DSW2"); // DIPSW 2
+ return input_port_read(machine, "DSW2"); // DIPSW 2
}
static READ8_HANDLER( ccasino_dipsw3_r )
{
- return (readinputportbytag("DSW3") ^ 0xff); // DIPSW 3
+ return (input_port_read(machine, "DSW3") ^ 0xff); // DIPSW 3
}
static READ8_HANDLER( ccasino_dipsw4_r )
{
- return (readinputportbytag("DSW4") ^ 0xff); // DIPSW 4
+ return (input_port_read(machine, "DSW4") ^ 0xff); // DIPSW 4
}
static WRITE8_HANDLER( ojankoy_coinctr_w )
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index 2b4fb63c1ca..76de7701e99 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -293,7 +293,7 @@ static const UINT8 spinnerTable[64] =
static READ8_HANDLER( omegrace_spinner1_r )
{
- return (spinnerTable[readinputport(4) & 0x3f]);
+ return (spinnerTable[input_port_read_indexed(machine, 4) & 0x3f]);
}
diff --git a/src/mame/drivers/oneshot.c b/src/mame/drivers/oneshot.c
index 3bb57fdfa2b..143462b9018 100644
--- a/src/mame/drivers/oneshot.c
+++ b/src/mame/drivers/oneshot.c
@@ -54,7 +54,7 @@ VIDEO_UPDATE( maddonna );
static READ16_HANDLER( oneshot_in0_word_r )
{
- int data = readinputport(0);
+ int data = input_port_read_indexed(machine, 0);
switch (data & 0x0c)
{
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index a6e0b254ab1..2ecad41104e 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -140,13 +140,13 @@ static WRITE16_HANDLER( cchip_w )
static READ16_HANDLER( opwolf_in_r )
{
static const char *const inname[2] = { "IN0", "IN1" };
- return readinputportbytag(inname[offset]);
+ return input_port_read(machine, inname[offset]);
}
static READ16_HANDLER( opwolf_dsw_r )
{
static const char *const dswname[2] = { "DSWA", "DSWB" };
- return readinputportbytag(dswname[offset]);
+ return input_port_read(machine, dswname[offset]);
}
static READ16_HANDLER( opwolf_lightgun_r )
@@ -156,10 +156,10 @@ static READ16_HANDLER( opwolf_lightgun_r )
switch (offset)
{
case 0x00: /* P1X - Have to remap 8 bit input value, into 0-319 visible range */
- scaled=(readinputportbytag(P1X_PORT_TAG) * 320 ) / 256;
+ scaled=(input_port_read(machine, P1X_PORT_TAG) * 320 ) / 256;
return (scaled + 0x15 + opwolf_gun_xoffs);
case 0x01: /* P1Y */
- return (readinputportbytag(P1Y_PORT_TAG) - 0x24 + opwolf_gun_yoffs);
+ return (input_port_read(machine, P1Y_PORT_TAG) - 0x24 + opwolf_gun_yoffs);
}
return 0xff;
@@ -167,12 +167,12 @@ static READ16_HANDLER( opwolf_lightgun_r )
static READ8_HANDLER( z80_input1_r )
{
- return readinputportbytag("IN0"); /* irrelevant mirror ? */
+ return input_port_read(machine, "IN0"); /* irrelevant mirror ? */
}
static READ8_HANDLER( z80_input2_r )
{
- return readinputportbytag("IN0"); /* needed for coins */
+ return input_port_read(machine, "IN0"); /* needed for coins */
}
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index d1db813c34f..7e0cd4f14be 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -416,7 +416,7 @@ static READ16_HANDLER( othunder_TC0220IOC_r )
static READ16_HANDLER( othunder_lightgun_r )
{
static const char *const dswname[4] = { P1X_PORT_TAG, P1Y_PORT_TAG, P2X_PORT_TAG, P2Y_PORT_TAG };
- return readinputportbytag(dswname[offset]);
+ return input_port_read(machine, dswname[offset]);
}
static WRITE16_HANDLER( othunder_lightgun_w )
diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c
index 02027407ec8..140988b8886 100644
--- a/src/mame/drivers/pacland.c
+++ b/src/mame/drivers/pacland.c
@@ -210,8 +210,8 @@ static READ8_HANDLER( pacland_input_r )
{
int shift = 4 * (offset & 1);
int port = offset & 2;
- int r = ( readinputport( port+0 ) << shift ) & 0xf0;
- r |= ( readinputport( port+1 ) >> (4-shift) ) & 0x0f;
+ int r = ( input_port_read_indexed(machine, port+0 ) << shift ) & 0xf0;
+ r |= ( input_port_read_indexed(machine, port+1 ) >> (4-shift) ) & 0x0f;
return r;
}
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index f7d3abea574..38c2cd10e52 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -368,7 +368,7 @@ static UINT8 cannonb_bit_to_read;
static MACHINE_RESET( mschamp )
{
UINT8 *rom = memory_region(REGION_CPU1) + 0x10000;
- int whichbank = readinputportbytag("GAME") & 1;
+ int whichbank = input_port_read(machine, "GAME") & 1;
memory_configure_bank(1, 0, 2, &rom[0x0000], 0x8000);
memory_configure_bank(2, 0, 2, &rom[0x4000], 0x8000);
@@ -405,7 +405,7 @@ static INTERRUPT_GEN( pacman_interrupt )
int portnum = port_tag_to_index("FAKE");
if (portnum != -1)
{
- UINT8 value = readinputport(portnum);
+ UINT8 value = input_port_read_indexed(machine, portnum);
if ((value & 7) == 5 || (value & 6) == 2)
irq0_line_hold(machine, cpunum);
}
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 93e9c895d63..bb4c6532537 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -419,8 +419,8 @@ static READ8_HANDLER( peplus_crtc_lpen1_r )
static READ8_HANDLER( peplus_crtc_lpen2_r )
{
UINT8 ret_val = 0x00;
- UINT8 x_val = readinputportbytag_safe("TOUCH_X",0x00);
- UINT8 y_val = (0x19 - readinputportbytag_safe("TOUCH_Y",0x00));
+ UINT8 x_val = input_port_read_safe(machine, "TOUCH_X",0x00);
+ UINT8 y_val = (0x19 - input_port_read_safe(machine, "TOUCH_Y",0x00));
UINT16 t_val = y_val * 0x28 + (x_val+1);
switch(vid_register) {
@@ -530,7 +530,7 @@ static READ8_HANDLER( peplus_input_bank_a_r )
sda = i2cmem_read(0, I2CMEM_SDA);
}
- if ((readinputportbytag_safe("SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) {
+ if ((input_port_read_safe(machine, "SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) {
coin_state = 1; // Start Coin Cycle
last_cycles = activecpu_gettotalcycles();
} else {
@@ -566,7 +566,7 @@ static READ8_HANDLER( peplus_input_bank_a_r )
}
if (curr_cycles - last_door > 6000) { // Guessing with 6000
- if ((readinputportbytag_safe("DOOR",0xff) & 0x01) == 0x01) {
+ if ((input_port_read_safe(machine, "DOOR",0xff) & 0x01) == 0x01) {
door_open = (!door_open & 0x01);
} else {
door_open = 1;
@@ -963,7 +963,7 @@ static MACHINE_RESET( peplus )
autohold_addr = 0x5e7e; // AutoHold Address
if (autohold_addr)
- program_ram[autohold_addr] = readinputportbytag_safe("AUTOHOLD",0x00) & 0x01;
+ program_ram[autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01;
*/
}
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 5b626b5f7ed..60a663c6032 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -2061,7 +2061,7 @@ static READ16_HANDLER( killbld_prot_r )
else if(kb_cmd==5)
{
UINT32 protvalue;
- protvalue = 0x89911400|readinputport(4); // region
+ protvalue = 0x89911400|input_port_read_indexed(machine, 4); // region
res=(protvalue>>(8*(ptr-1)))&0xff;
}
@@ -2140,7 +2140,7 @@ static READ16_HANDLER(ddp2_protram_r)
{
if (PGMLOGERROR) logerror("prot_r %04x, %04x\n", offset,ddp2_protram[offset]);
- if (offset == 0x02/2) return readinputport(4);
+ if (offset == 0x02/2) return input_port_read_indexed(machine, 4);
if (offset == 0x1f00/2) return 0;
@@ -2252,7 +2252,7 @@ static READ16_HANDLER( olds_r16 )
res=olds_cmd3;
else if(kb_cmd==5)
{
- UINT32 protvalue = 0x900000|readinputport(4); // region from protection device.
+ UINT32 protvalue = 0x900000|input_port_read_indexed(machine, 4); // region from protection device.
res=(protvalue>>(8*(ptr-1)))&0xff; // includes region 1 = taiwan , 2 = china, 3 = japan (title = orlegend special), 4 = korea, 5 = hongkong, 6 = world
}
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index 07639412850..8e99f2f2bef 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -107,7 +107,7 @@ static READ32_HANDLER( polygonet_eeprom_r )
}
else
{
- return (readinputport(0)<<24);
+ return (input_port_read_indexed(machine, 0)<<24);
}
/* FIXME: code will never execute */
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 339a4cc25a7..60bdd372e5d 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -162,7 +162,7 @@ static UINT16 pntnpuzl_eeprom;
static READ16_HANDLER( pntnpuzl_eeprom_r )
{
/* bit 11 is EEPROM data */
- return (pntnpuzl_eeprom & 0xf4ff) | (EEPROM_read_bit()<<11) | (readinputport(3) & 0x0300);
+ return (pntnpuzl_eeprom & 0xf4ff) | (EEPROM_read_bit()<<11) | (input_port_read_indexed(machine, 3) & 0x0300);
}
static WRITE16_HANDLER( pntnpuzl_eeprom_w )
@@ -293,7 +293,7 @@ static WRITE16_HANDLER( pntnpuzl_vid_w )
static READ16_HANDLER( pntnpuzl_vblank_r )
{
- return (readinputport(0) & 1) << 11;
+ return (input_port_read_indexed(machine, 0) & 1) << 11;
}
@@ -351,11 +351,11 @@ static READ16_HANDLER( pntnpuzl_280014_r )
if (serial_out == 0x11)
{
static int touchscr[5];
- if (readinputport(0) & 0x10)
+ if (input_port_read_indexed(machine, 0) & 0x10)
{
touchscr[0] = 0x1b;
- touchscr[2] = BITSWAP8(readinputport(1),0,1,2,3,4,5,6,7);
- touchscr[4] = BITSWAP8(readinputport(2),0,1,2,3,4,5,6,7);
+ touchscr[2] = BITSWAP8(input_port_read_indexed(machine, 1),0,1,2,3,4,5,6,7);
+ touchscr[4] = BITSWAP8(input_port_read_indexed(machine, 2),0,1,2,3,4,5,6,7);
}
else
touchscr[0] = 0;
@@ -412,11 +412,11 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( pntnpuzl_irq )
{
- if (readinputport(0) & 0x02) /* coin */
+ if (input_port_read_indexed(machine, 0) & 0x02) /* coin */
cpunum_set_input_line(machine, 0, 1, PULSE_LINE);
- else if (readinputport(0) & 0x04) /* service */
+ else if (input_port_read_indexed(machine, 0) & 0x04) /* service */
cpunum_set_input_line(machine, 0, 2, PULSE_LINE);
- else if (readinputport(0) & 0x08) /* coin */
+ else if (input_port_read_indexed(machine, 0) & 0x08) /* coin */
cpunum_set_input_line(machine, 0, 4, PULSE_LINE);
}
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index 9e865d651f3..7b11996d8a9 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -302,7 +302,7 @@ static int auto_start_mask;
static READ8_HANDLER( polepos_adc_r )
{
- return readinputport(3 + adc_input);
+ return input_port_read_indexed(machine, 3 + adc_input);
}
static READ8_HANDLER( polepos_ready_r )
@@ -377,14 +377,14 @@ static WRITE16_HANDLER( polepos_z8002_nvi_enable_w )
}
-static READ8_HANDLER( in0_l ) { return readinputport(0) & auto_start_mask; } // fire and start buttons
-static READ8_HANDLER( in0_h ) { return readinputport(0) >> 4; } // coins
-static READ8_HANDLER( dipA_l ) { return readinputport(1); } // dips A
-static READ8_HANDLER( dipA_h ) { return readinputport(1) >> 4; } // dips A
-static READ8_HANDLER( dipB_l ) { return readinputport(2); } // dips B
-static READ8_HANDLER( dipB_h ) { return readinputport(2) >> 4; } // dips B
-static READ8_HANDLER( in1_l ) { return readinputport(5); } // wheel
-static READ8_HANDLER( in1_h ) { return readinputport(5) >> 4; } // wheel
+static READ8_HANDLER( in0_l ) { return input_port_read_indexed(machine, 0) & auto_start_mask; } // fire and start buttons
+static READ8_HANDLER( in0_h ) { return input_port_read_indexed(machine, 0) >> 4; } // coins
+static READ8_HANDLER( dipA_l ) { return input_port_read_indexed(machine, 1); } // dips A
+static READ8_HANDLER( dipA_h ) { return input_port_read_indexed(machine, 1) >> 4; } // dips A
+static READ8_HANDLER( dipB_l ) { return input_port_read_indexed(machine, 2); } // dips B
+static READ8_HANDLER( dipB_h ) { return input_port_read_indexed(machine, 2) >> 4; } // dips B
+static READ8_HANDLER( in1_l ) { return input_port_read_indexed(machine, 5); } // wheel
+static READ8_HANDLER( in1_h ) { return input_port_read_indexed(machine, 5) >> 4; } // wheel
static WRITE8_HANDLER( out_0 )
{
// no start lamps in pole position
diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c
index 1a94674fb0b..7b4a8ccb1c3 100644
--- a/src/mame/drivers/policetr.c
+++ b/src/mame/drivers/policetr.c
@@ -141,19 +141,19 @@ static INTERRUPT_GEN( irq4_gen )
static READ32_HANDLER( port0_r )
{
- return readinputport(0) << 16;
+ return input_port_read_indexed(machine, 0) << 16;
}
static READ32_HANDLER( port1_r )
{
- return (readinputport(1) << 16) | (EEPROM_read_bit() << 29);
+ return (input_port_read_indexed(machine, 1) << 16) | (EEPROM_read_bit() << 29);
}
static READ32_HANDLER( port2_r )
{
- return readinputport(2) << 16;
+ return input_port_read_indexed(machine, 2) << 16;
}
diff --git a/src/mame/drivers/polyplay.c b/src/mame/drivers/polyplay.c
index b5d3b4011c7..1be912f08a3 100644
--- a/src/mame/drivers/polyplay.c
+++ b/src/mame/drivers/polyplay.c
@@ -148,7 +148,7 @@ static INTERRUPT_GEN( coin_interrupt )
{
static int last = 0;
- if (readinputport(0) & 0x80)
+ if (input_port_read_indexed(machine, 0) & 0x80)
last = 0;
else
{
diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c
index df5fa5a7d4e..cbc6f8c104b 100644
--- a/src/mame/drivers/poolshrk.c
+++ b/src/mame/drivers/poolshrk.c
@@ -72,10 +72,10 @@ static WRITE8_HANDLER( poolshrk_watchdog_w )
static READ8_HANDLER( poolshrk_input_r )
{
- UINT8 val = readinputport(offset & 3);
+ UINT8 val = input_port_read_indexed(machine, offset & 3);
- int x = readinputport(4 + (offset & 1));
- int y = readinputport(6 + (offset & 1));
+ int x = input_port_read_indexed(machine, 4 + (offset & 1));
+ int y = input_port_read_indexed(machine, 6 + (offset & 1));
if (x >= poolshrk_da_latch) val |= 8;
if (y >= poolshrk_da_latch) val |= 4;
diff --git a/src/mame/drivers/popper.c b/src/mame/drivers/popper.c
index bf836bb5c80..0049e59d400 100644
--- a/src/mame/drivers/popper.c
+++ b/src/mame/drivers/popper.c
@@ -136,14 +136,14 @@ static READ8_HANDLER( popper_input_ports_r )
switch (offset)
{
// player inputs dsw1 dsw2
- case 0: data=readinputport(0) | ((readinputport(4)&0x02)<<5) | ((readinputport(5)&0x01)<<4); break;
- case 1: data=readinputport(1) | ((readinputport(4)&0x01)<<6) | ((readinputport(5)&0x02)<<3); break;
- case 2: data=readinputport(2) | ((readinputport(4)&0x08)<<3) | ((readinputport(5)&0x04)<<2); break;
- case 3: data=readinputport(3) | ((readinputport(4)&0x04)<<4) | ((readinputport(5)&0x08)<<1); break;
- case 4: data= ((readinputport(4)&0x20)<<2) | ((readinputport(5)&0x10)<<1); break;
- case 5: data= ((readinputport(4)&0x10)<<3) | ((readinputport(5)&0x20)<<0); break;
- case 6: data= ((readinputport(4)&0x80)<<0) | ((readinputport(5)&0x40)>>1); break;
- case 7: data= ((readinputport(4)&0x40)<<1) | ((readinputport(5)&0x80)>>2); break;
+ case 0: data=input_port_read_indexed(machine, 0) | ((input_port_read_indexed(machine, 4)&0x02)<<5) | ((input_port_read_indexed(machine, 5)&0x01)<<4); break;
+ case 1: data=input_port_read_indexed(machine, 1) | ((input_port_read_indexed(machine, 4)&0x01)<<6) | ((input_port_read_indexed(machine, 5)&0x02)<<3); break;
+ case 2: data=input_port_read_indexed(machine, 2) | ((input_port_read_indexed(machine, 4)&0x08)<<3) | ((input_port_read_indexed(machine, 5)&0x04)<<2); break;
+ case 3: data=input_port_read_indexed(machine, 3) | ((input_port_read_indexed(machine, 4)&0x04)<<4) | ((input_port_read_indexed(machine, 5)&0x08)<<1); break;
+ case 4: data= ((input_port_read_indexed(machine, 4)&0x20)<<2) | ((input_port_read_indexed(machine, 5)&0x10)<<1); break;
+ case 5: data= ((input_port_read_indexed(machine, 4)&0x10)<<3) | ((input_port_read_indexed(machine, 5)&0x20)<<0); break;
+ case 6: data= ((input_port_read_indexed(machine, 4)&0x80)<<0) | ((input_port_read_indexed(machine, 5)&0x40)>>1); break;
+ case 7: data= ((input_port_read_indexed(machine, 4)&0x40)<<1) | ((input_port_read_indexed(machine, 5)&0x80)>>2); break;
}
return data;
}
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index 5c43ec21ee2..a296ae7af12 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -193,7 +193,7 @@ GFXDECODE_END
#ifdef UNUSED_FUNCTION
static INTERRUPT_GEN( progolf_interrupt )
{
- //if (readinputport(2) & 0xc0)
+ //if (input_port_read_indexed(machine, 2) & 0xc0)
cpunum_set_input_line(machine, 0, /*0*/INPUT_LINE_NMI, /*HOLD_LINE*/PULSE_LINE);
}
#endif
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index 774664022ff..650512232ff 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -101,9 +101,9 @@ static MACHINE_RESET( psikyo )
***************************************************************************/
-static int psikyo_readcoinport(int has_mcu)
+static int psikyo_readcoinport(running_machine *machine, int has_mcu)
{
- int ret = readinputport(1) & ~0x84;
+ int ret = input_port_read_indexed(machine, 1) & ~0x84;
if (has_mcu)
{
@@ -142,9 +142,9 @@ static READ32_HANDLER( sngkace_input_r )
{
switch(offset)
{
- case 0x0: return (readinputport(0) << 16) | 0xffff;
- case 0x1: return (readinputport(2) << 16) | readinputport(4);
- case 0x2: return (psikyo_readcoinport(0) << 16) | readinputport(3);
+ case 0x0: return (input_port_read_indexed(machine, 0) << 16) | 0xffff;
+ case 0x1: return (input_port_read_indexed(machine, 2) << 16) | input_port_read_indexed(machine, 4);
+ case 0x2: return (psikyo_readcoinport(machine, 0) << 16) | input_port_read_indexed(machine, 3);
default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2);
return 0;
}
@@ -154,8 +154,8 @@ static READ32_HANDLER( gunbird_input_r )
{
switch(offset)
{
- case 0x0: return (readinputport(0) << 16) | psikyo_readcoinport(0);
- case 0x1: return (readinputport(2) << 16) | readinputport(3);
+ case 0x0: return (input_port_read_indexed(machine, 0) << 16) | psikyo_readcoinport(machine, 0);
+ case 0x1: return (input_port_read_indexed(machine, 2) << 16) | input_port_read_indexed(machine, 3);
default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2);
return 0;
}
@@ -310,8 +310,8 @@ static READ32_HANDLER( s1945_input_r )
{
switch(offset)
{
- case 0x0: return (readinputport(0) << 16) | psikyo_readcoinport(1);
- case 0x1: return (((readinputport(2) << 16) | readinputport(3)) & 0xffff000f) | s1945_mcu_r(machine, offset-1, mem_mask);
+ case 0x0: return (input_port_read_indexed(machine, 0) << 16) | psikyo_readcoinport(machine, 1);
+ case 0x1: return (((input_port_read_indexed(machine, 2) << 16) | input_port_read_indexed(machine, 3)) & 0xffff000f) | s1945_mcu_r(machine, offset-1, mem_mask);
case 0x2: return s1945_mcu_r(machine, offset-1, mem_mask);
default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2);
return 0;
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index 1226b158063..48178e79996 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -221,7 +221,7 @@ static READ32_HANDLER( ps4_eeprom_r )
// logerror("Unk EEPROM read mask %x\n", mem_mask);
- return readinputportbytag("JP4")<<16;
+ return input_port_read(machine, "JP4")<<16;
}
static INTERRUPT_GEN(psikyosh_interrupt)
@@ -234,17 +234,17 @@ static READ32_HANDLER(hotgmck_io32_r) /* used by hotgmck/hgkairak */
int ret = 0xff;
int sel = (ps4_io_select[0] & 0x0000ff00) >> 8;
- if (sel & 1) ret &= readinputport(0+4*offset);
- if (sel & 2) ret &= readinputport(1+4*offset);
- if (sel & 4) ret &= readinputport(2+4*offset);
- if (sel & 8) ret &= readinputport(3+4*offset);
+ if (sel & 1) ret &= input_port_read_indexed(machine, 0+4*offset);
+ if (sel & 2) ret &= input_port_read_indexed(machine, 1+4*offset);
+ if (sel & 4) ret &= input_port_read_indexed(machine, 2+4*offset);
+ if (sel & 8) ret &= input_port_read_indexed(machine, 3+4*offset);
- return ret<<24 | readinputport(8);
+ return ret<<24 | input_port_read_indexed(machine, 8);
}
static READ32_HANDLER(ps4_io32_r) /* used by loderndf/hotdebut */
{
- return ((readinputport(0+4*offset) << 24) | (readinputport(1+4*offset) << 16) | (readinputport(2+4*offset) << 8) | (readinputport(3+4*offset) << 0));
+ return ((input_port_read_indexed(machine, 0+4*offset) << 24) | (input_port_read_indexed(machine, 1+4*offset) << 16) | (input_port_read_indexed(machine, 2+4*offset) << 8) | (input_port_read_indexed(machine, 3+4*offset) << 0));
}
static WRITE32_HANDLER( ps4_paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index e69af93e499..8eccfe4856a 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -404,7 +404,7 @@ static READ32_HANDLER( psh_eeprom_r )
{
if (ACCESSING_BITS_24_31)
{
- return ((EEPROM_read_bit() << 28) | (readinputport(4) << 24)); /* EEPROM | Region */
+ return ((EEPROM_read_bit() << 28) | (input_port_read_indexed(machine, 4) << 24)); /* EEPROM | Region */
}
logerror("Unk EEPROM read mask %x\n", mem_mask);
@@ -419,7 +419,7 @@ static INTERRUPT_GEN(psikyosh_interrupt)
static READ32_HANDLER(io32_r)
{
- return ((readinputport(0) << 24) | (readinputport(1) << 16) | (readinputport(2) << 8) | (readinputport(3) << 0));
+ return ((input_port_read_indexed(machine, 0) << 24) | (input_port_read_indexed(machine, 1) << 16) | (input_port_read_indexed(machine, 2) << 8) | (input_port_read_indexed(machine, 3) << 0));
}
static WRITE32_HANDLER( paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
diff --git a/src/mame/drivers/quantum.c b/src/mame/drivers/quantum.c
index cb0cba74fe1..f821c741b48 100644
--- a/src/mame/drivers/quantum.c
+++ b/src/mame/drivers/quantum.c
@@ -60,25 +60,25 @@
static READ16_HANDLER( switches_r )
{
- return (readinputport(0) | (avgdvg_done() ? 1 : 0));
+ return (input_port_read_indexed(machine, 0) | (avgdvg_done() ? 1 : 0));
}
static READ16_HANDLER( trackball_r )
{
- return (readinputport(4) << 4) | readinputport(3);
+ return (input_port_read_indexed(machine, 4) << 4) | input_port_read_indexed(machine, 3);
}
static READ8_HANDLER( input_1_r )
{
- return (readinputport(1) << (7 - (offset - POT0_C))) & 0x80;
+ return (input_port_read_indexed(machine, 1) << (7 - (offset - POT0_C))) & 0x80;
}
static READ8_HANDLER( input_2_r )
{
- return (readinputport(2) << (7 - (offset - POT0_C))) & 0x80;
+ return (input_port_read_indexed(machine, 2) << (7 - (offset - POT0_C))) & 0x80;
}
diff --git a/src/mame/drivers/rabbit.c b/src/mame/drivers/rabbit.c
index cff9c8cd2fb..6a398e46fe9 100644
--- a/src/mame/drivers/rabbit.c
+++ b/src/mame/drivers/rabbit.c
@@ -448,7 +448,7 @@ static READ32_HANDLER( rabbit_input_r )
{
int rv;
- rv = (readinputport(1)<<16)|(readinputport(0));
+ rv = (input_port_read_indexed(machine, 1)<<16)|(input_port_read_indexed(machine, 0));
rv &= ~1;
rv |= EEPROM_read_bit(); // as per code at 4d932
return rv;
@@ -458,7 +458,7 @@ static READ32_HANDLER( tmmjprd_input_r )
{
int rv;
- rv = (readinputport(1)<<16)|(readinputport(0));
+ rv = (input_port_read_indexed(machine, 1)<<16)|(input_port_read_indexed(machine, 0));
rv &= ~0x80;
rv |= (EEPROM_read_bit()<<7); // as per code at 778
return rv;
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index 0ab58f0bd74..2756e9fbac1 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -482,13 +482,13 @@ static VIDEO_UPDATE ( raiden2 )
static INTERRUPT_GEN( raiden2_interrupt )
{
- mainram[0x740/2] = readinputport(2) | (readinputport(3) << 8);
+ mainram[0x740/2] = input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3) << 8);
mainram[0x742/2] = 0xffff;
- mainram[0x744/2] = readinputport(0) | (readinputport(1) << 8);
+ mainram[0x744/2] = input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 1) << 8);
mainram[0x746/2] = 0xffff;
mainram[0x748/2] = 0xffff;
mainram[0x74a/2] = 0xffff;
- mainram[0x74c/2] = readinputport(4) | 0xff00;
+ mainram[0x74c/2] = input_port_read_indexed(machine, 4) | 0xff00;
mainram[0x74e/2] = 0xffff;
cpunum_set_input_line_and_vector(machine, cpunum, 0, HOLD_LINE, 0xc0/4); /* VBL */
@@ -1872,7 +1872,7 @@ static WRITE16_HANDLER( rdx_v33_eeprom_w )
static READ16_HANDLER( rdx_v33_eeprom_r )
{
- return readinputport(0) | (EEPROM_read_bit()<<4);
+ return input_port_read_indexed(machine, 0) | (EEPROM_read_bit()<<4);
}
@@ -1906,7 +1906,7 @@ static WRITE16_HANDLER( mcu_prog_offs_w )
static READ16_HANDLER( r2_playerin_r )
{
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
static READ16_HANDLER( rdx_v33_oki_r )
{
diff --git a/src/mame/drivers/rcasino.c b/src/mame/drivers/rcasino.c
index d64be28272d..36a86f72676 100644
--- a/src/mame/drivers/rcasino.c
+++ b/src/mame/drivers/rcasino.c
@@ -165,7 +165,7 @@ static READ8_HANDLER( rcasino_port_11_r )
pulse = 0;
else pulse = 0x04;
}
- return readinputport(1) + pulse;
+ return input_port_read_indexed(machine, 1) + pulse;
}
static ADDRESS_MAP_START( rcasino_map, ADDRESS_SPACE_PROGRAM, 8 )
diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c
index 2dbdbbca4fe..d1131108115 100644
--- a/src/mame/drivers/realbrk.c
+++ b/src/mame/drivers/realbrk.c
@@ -53,15 +53,15 @@ static UINT16 *realbrk_dsw_select;
static READ16_HANDLER( realbrk_dsw_r )
{
UINT16 sel = ~realbrk_dsw_select[0];
- if (sel & 0x01) return (readinputport(2) & 0x00ff) << 8; // DSW1 low bits
- if (sel & 0x02) return (readinputport(3) & 0x00ff) << 8; // DSW2 low bits
- if (sel & 0x04) return (readinputport(4) & 0x00ff) << 8; // DSW3 low bits
- if (sel & 0x08) return (readinputport(5) & 0x00ff) << 8; // DSW4 low bits
-
- if (sel & 0x10) return ((readinputport(2) & 0x0300) << 0) | // DSWs high 2 bits
- ((readinputport(3) & 0x0300) << 2) |
- ((readinputport(4) & 0x0300) << 4) |
- ((readinputport(5) & 0x0300) << 6) ;
+ if (sel & 0x01) return (input_port_read_indexed(machine, 2) & 0x00ff) << 8; // DSW1 low bits
+ if (sel & 0x02) return (input_port_read_indexed(machine, 3) & 0x00ff) << 8; // DSW2 low bits
+ if (sel & 0x04) return (input_port_read_indexed(machine, 4) & 0x00ff) << 8; // DSW3 low bits
+ if (sel & 0x08) return (input_port_read_indexed(machine, 5) & 0x00ff) << 8; // DSW4 low bits
+
+ if (sel & 0x10) return ((input_port_read_indexed(machine, 2) & 0x0300) << 0) | // DSWs high 2 bits
+ ((input_port_read_indexed(machine, 3) & 0x0300) << 2) |
+ ((input_port_read_indexed(machine, 4) & 0x0300) << 4) |
+ ((input_port_read_indexed(machine, 5) & 0x0300) << 6) ;
logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",activecpu_get_pc(),realbrk_dsw_select[0]);
return 0xffff;
diff --git a/src/mame/drivers/redalert.c b/src/mame/drivers/redalert.c
index c56c493a52a..63ad413287e 100644
--- a/src/mame/drivers/redalert.c
+++ b/src/mame/drivers/redalert.c
@@ -86,7 +86,7 @@
static INTERRUPT_GEN( redalert_vblank_interrupt )
{
- if( readinputport(3) )
+ if( input_port_read_indexed(machine, 3) )
/* the service coin as conntected to the CPU's RDY pin as well */
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index 03c2b5dc6d8..ff5aa044315 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -45,9 +45,9 @@ extern VIDEO_EOF( redclash );
*/
static INTERRUPT_GEN( redclash_interrupt )
{
- if (readinputport(4) & 1) /* Left Coin */
+ if (input_port_read_indexed(machine, 4) & 1) /* Left Coin */
cpunum_set_input_line(machine, 0,0,ASSERT_LINE);
- else if (readinputport(4) & 2) /* Right Coin */
+ else if (input_port_read_indexed(machine, 4) & 2) /* Right Coin */
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/relief.c b/src/mame/drivers/relief.c
index 546e3dc8bdc..3a9570cc779 100644
--- a/src/mame/drivers/relief.c
+++ b/src/mame/drivers/relief.c
@@ -104,7 +104,7 @@ static MACHINE_RESET( relief )
static READ16_HANDLER( special_port2_r )
{
- int result = readinputport(2);
+ int result = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) result ^= 0x0020;
if (!(result & 0x0080) || atarigen_get_hblank(machine->primary_screen)) result ^= 0x0001;
return result;
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index be1c61b335e..c62e6c5253a 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -489,7 +489,7 @@ static INTERRUPT_GEN( renegade_interrupt )
{
/*
static int coin;
- int port = readinputport(1) & 0xc0;
+ int port = input_port_read_indexed(machine, 1) & 0xc0;
if (port != 0xc0)
{
if (coin == 0)
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index 1634a7a53e2..3fadbb4c190 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -87,9 +87,9 @@ logerror("%04x: keyboard_r\n",activecpu_get_pc());
for (i = 0;i < 31;i++)
{
- if (readinputport(2 + i/16) & (1<<(i&15))) return i+1;
+ if (input_port_read_indexed(machine, 2 + i/16) & (1<<(i&15))) return i+1;
}
- if (readinputport(3) & 0x8000) return 0x80; // coin
+ if (input_port_read_indexed(machine, 3) & 0x8000) return 0x80; // coin
return 0;
}
case 0x5c7b: // rmhaihai, rmhaisei, rmhaijin
diff --git a/src/mame/drivers/rockola.c b/src/mame/drivers/rockola.c
index 8b9ac99eba8..eea0c8b528e 100644
--- a/src/mame/drivers/rockola.c
+++ b/src/mame/drivers/rockola.c
@@ -1000,7 +1000,7 @@ static INTERRUPT_GEN( satansat_interrupt )
{
if (cpu_getiloops() != 0)
{
- UINT8 val = readinputportbytag("IN2");
+ UINT8 val = input_port_read(machine, "IN2");
coin_counter_w(0, val & 1);
@@ -1016,7 +1016,7 @@ static INTERRUPT_GEN( rockola_interrupt )
{
if (cpu_getiloops() != 0)
{
- UINT8 val = readinputportbytag("IN2");
+ UINT8 val = input_port_read(machine, "IN2");
coin_counter_w(0, val & 1);
coin_counter_w(1, val & 2);
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index 703a8245e62..6ce7b5e974a 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -125,9 +125,9 @@ VIDEO_UPDATE( wizdfire );
VIDEO_UPDATE( nitrobal );
WRITE16_HANDLER( rohga_buffer_spriteram16_w );
-static READ16_HANDLER( rohga_dip3_r ) { return readinputport(3); }
-static READ16_HANDLER( nitrobal_control_r ) { return readinputport(3); }
-static READ16_HANDLER( schmeisr_control_r ) { return readinputport(1); }
+static READ16_HANDLER( rohga_dip3_r ) { return input_port_read_indexed(machine, 3); }
+static READ16_HANDLER( nitrobal_control_r ) { return input_port_read_indexed(machine, 3); }
+static READ16_HANDLER( schmeisr_control_r ) { return input_port_read_indexed(machine, 1); }
/**********************************************************************************/
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index ad0abc80e38..ed5b5dc728b 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -174,10 +174,10 @@ static READ8_HANDLER( ttmahjng_input_port_matrix_r )
switch (ttmahjng_port_select)
{
- case 1: ret = readinputport(2); break;
- case 2: ret = readinputport(3); break;
- case 4: ret = readinputport(4); break;
- case 8: ret = readinputport(5); break;
+ case 1: ret = input_port_read_indexed(machine, 2); break;
+ case 2: ret = input_port_read_indexed(machine, 3); break;
+ case 4: ret = input_port_read_indexed(machine, 4); break;
+ case 8: ret = input_port_read_indexed(machine, 5); break;
default: break;
}
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index 6a76aee865c..0ec6af34326 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -251,9 +251,9 @@ static READ8_HANDLER ( majs101b_dsw_r )
{
switch (dsw_select)
{
- case 0x00: return readinputport(13); /* DSW3 */
- case 0x20: return readinputport(14); /* DSW4 */
- case 0x40: return readinputport(12); /* DSW2 */
+ case 0x00: return input_port_read_indexed(machine, 13); /* DSW3 */
+ case 0x20: return input_port_read_indexed(machine, 14); /* DSW4 */
+ case 0x40: return input_port_read_indexed(machine, 12); /* DSW2 */
}
return 0;
}
@@ -271,9 +271,9 @@ static READ8_HANDLER ( suzume_dsw_r )
{
switch (suzume_bank)
{
- case 0x08: return readinputport(14); /* DSW4 */
- case 0x10: return readinputport(13); /* DSW3 */
- case 0x18: return readinputport(12); /* DSW2 */
+ case 0x08: return input_port_read_indexed(machine, 14); /* DSW4 */
+ case 0x10: return input_port_read_indexed(machine, 13); /* DSW3 */
+ case 0x18: return input_port_read_indexed(machine, 12); /* DSW2 */
}
return 0;
}
@@ -312,7 +312,7 @@ static WRITE8_HANDLER( mjapinky_palbank_w )
static READ8_HANDLER( mjapinky_dsw_r )
{
- if (rombank == 0x0e) return readinputport(13);
+ if (rombank == 0x0e) return input_port_read_indexed(machine, 13);
else return *(memory_region(REGION_CPU1) + 0x10000 + 0x8000 * rombank);
}
@@ -502,11 +502,11 @@ static READ8_HANDLER( janptr96_dswsel_r )
static READ8_HANDLER( janptr96_dsw_r )
{
- if (~dsw_select & 0x01) return readinputportbytag("DSW4");
- if (~dsw_select & 0x02) return readinputportbytag("DSW3");
- if (~dsw_select & 0x04) return readinputportbytag("DSW2");
- if (~dsw_select & 0x08) return readinputportbytag("DSW1");
- if (~dsw_select & 0x10) return readinputportbytag("DSWTOP");
+ if (~dsw_select & 0x01) return input_port_read(machine, "DSW4");
+ if (~dsw_select & 0x02) return input_port_read(machine, "DSW3");
+ if (~dsw_select & 0x04) return input_port_read(machine, "DSW2");
+ if (~dsw_select & 0x08) return input_port_read(machine, "DSW1");
+ if (~dsw_select & 0x10) return input_port_read(machine, "DSWTOP");
return 0xff;
}
@@ -572,10 +572,10 @@ static READ8_HANDLER( mjifb_rom_io_r )
switch(offset)
{
- case 0x8000: return readinputport(14); // dsw 4
- case 0x8200: return readinputport(13); // dsw 3
+ case 0x8000: return input_port_read_indexed(machine, 14); // dsw 4
+ case 0x8200: return input_port_read_indexed(machine, 13); // dsw 3
case 0x9001: return AY8910_read_port_0_r(machine,0); // inputs
- case 0x9011: return readinputport(10);
+ case 0x9011: return input_port_read_indexed(machine, 10);
}
logerror("%04X: unmapped input read at %04X\n", activecpu_get_pc(), offset);
@@ -624,19 +624,19 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjifb_p3_r )
{
- return readinputport(11) >> 6;
+ return input_port_read_indexed(machine, 11) >> 6;
}
static READ8_HANDLER( mjifb_p5_r )
{
- return readinputport(11);
+ return input_port_read_indexed(machine, 11);
}
static READ8_HANDLER( mjifb_p6_r )
{
- return readinputport(12);
+ return input_port_read_indexed(machine, 12);
}
static READ8_HANDLER( mjifb_p7_r )
{
- return readinputport(12) >> 4;
+ return input_port_read_indexed(machine, 12) >> 4;
}
static READ8_HANDLER( mjifb_p8_r )
{
@@ -679,10 +679,10 @@ static READ8_HANDLER( mjdejavu_rom_io_r )
switch(offset)
{
- case 0x8000: return readinputport(14); // dsw 2
- case 0x8001: return readinputport(13); // dsw 1
+ case 0x8000: return input_port_read_indexed(machine, 14); // dsw 2
+ case 0x8001: return input_port_read_indexed(machine, 13); // dsw 1
case 0x9001: return AY8910_read_port_0_r(machine,0); // inputs
- case 0x9011: return readinputport(10);
+ case 0x9011: return input_port_read_indexed(machine, 10);
}
logerror("%04X: unmapped input read at %04X\n", activecpu_get_pc(), offset);
@@ -795,11 +795,11 @@ static READ8_HANDLER( cafetime_dsw_r )
{
switch( dsw_select )
{
- case 0x00: return readinputportbytag("DSW1");
- case 0x01: return readinputportbytag("DSW2");
- case 0x02: return readinputportbytag("DSW3");
- case 0x03: return readinputportbytag("DSW4");
- case 0x04: return readinputportbytag("DSWTOP");
+ case 0x00: return input_port_read(machine, "DSW1");
+ case 0x01: return input_port_read(machine, "DSW2");
+ case 0x02: return input_port_read(machine, "DSW3");
+ case 0x03: return input_port_read(machine, "DSW4");
+ case 0x04: return input_port_read(machine, "DSWTOP");
}
logerror("%04X: unmapped dsw read %02X\n", activecpu_get_pc(), dsw_select);
return 0xff;
diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c
index 42aff2217ea..c05d77fe4b3 100644
--- a/src/mame/drivers/rpunch.c
+++ b/src/mame/drivers/rpunch.c
@@ -165,7 +165,7 @@ static MACHINE_RESET( rpunch )
static READ16_HANDLER( common_port_r )
{
- return readinputport(offset) | readinputport(2);
+ return input_port_read_indexed(machine, offset) | input_port_read_indexed(machine, 2);
}
diff --git a/src/mame/drivers/runaway.c b/src/mame/drivers/runaway.c
index 11cfae3cdcf..fe26ef6f884 100644
--- a/src/mame/drivers/runaway.c
+++ b/src/mame/drivers/runaway.c
@@ -54,11 +54,11 @@ static READ8_HANDLER( runaway_input_r )
{
UINT8 val = 0;
- if (readinputport(0) & (1 << offset))
+ if (input_port_read_indexed(machine, 0) & (1 << offset))
{
val |= 0x80;
}
- if (readinputport(1) & (1 << offset))
+ if (input_port_read_indexed(machine, 1) & (1 << offset))
{
val |= 0x40;
}
@@ -69,7 +69,7 @@ static READ8_HANDLER( runaway_input_r )
static READ8_HANDLER( runaway_pot_r )
{
- return (readinputport(4) << (7 - offset)) & 0x80;
+ return (input_port_read_indexed(machine, 4) << (7 - offset)) & 0x80;
}
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index 63eb3fb185d..737e2ae310a 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -94,21 +94,21 @@ static READ16_HANDLER( rng_sysregs_r )
switch (offset)
{
case 0x00/2:
- if (readinputport(1) & 0x20)
- return(readinputport(2) | readinputport(4)<<8);
+ if (input_port_read_indexed(machine, 1) & 0x20)
+ return(input_port_read_indexed(machine, 2) | input_port_read_indexed(machine, 4)<<8);
else
{
- data = readinputport(2) & readinputport(4);
+ data = input_port_read_indexed(machine, 2) & input_port_read_indexed(machine, 4);
return(data<<8 | data);
}
break;
case 0x02/2:
- if (readinputport(1) & 0x20)
- return(readinputport(3) | readinputport(5)<<8);
+ if (input_port_read_indexed(machine, 1) & 0x20)
+ return(input_port_read_indexed(machine, 3) | input_port_read_indexed(machine, 5)<<8);
else
{
- data = readinputport(3) & readinputport(5);
+ data = input_port_read_indexed(machine, 3) & input_port_read_indexed(machine, 5);
return(data<<8 | data);
}
break;
@@ -125,7 +125,7 @@ static READ16_HANDLER( rng_sysregs_r )
case 0x06/2:
if (ACCESSING_BITS_0_7)
{
- data = readinputport(1) | EEPROM_read_bit();
+ data = input_port_read_indexed(machine, 1) | EEPROM_read_bit();
if (init_eeprom_count)
{
diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c
index 95a38579e74..84df183009e 100644
--- a/src/mame/drivers/sbrkout.c
+++ b/src/mame/drivers/sbrkout.c
@@ -125,7 +125,7 @@ static TIMER_CALLBACK( scanline_callback )
/* on the VBLANK, read the pot and schedule an interrupt time for it */
if (scanline == video_screen_get_visible_area(machine->primary_screen)->max_y + 1)
{
- UINT8 potvalue = readinputportbytag("PADDLE");
+ UINT8 potvalue = input_port_read(machine, "PADDLE");
timer_adjust_oneshot(pot_timer, video_screen_get_time_until_pos(machine->primary_screen, 72 + (potvalue / 2), (potvalue % 2) * 128), 0);
}
@@ -156,25 +156,25 @@ static READ8_HANDLER( switches_r )
/* DIP switches are selected by ADR0+ADR1 if ADR3 == 0 */
if ((offset & 0x0b) == 0x00)
- result &= (readinputportbytag("DIPS") << 6) | 0x3f;
+ result &= (input_port_read(machine, "DIPS") << 6) | 0x3f;
if ((offset & 0x0b) == 0x01)
- result &= (readinputportbytag("DIPS") << 4) | 0x3f;
+ result &= (input_port_read(machine, "DIPS") << 4) | 0x3f;
if ((offset & 0x0b) == 0x02)
- result &= (readinputportbytag("DIPS") << 0) | 0x3f;
+ result &= (input_port_read(machine, "DIPS") << 0) | 0x3f;
if ((offset & 0x0b) == 0x03)
- result &= (readinputportbytag("DIPS") << 2) | 0x3f;
+ result &= (input_port_read(machine, "DIPS") << 2) | 0x3f;
/* other switches are selected by ADR0+ADR1+ADR2 if ADR4 == 0 */
if ((offset & 0x17) == 0x00)
- result &= (readinputportbytag("SELECT") << 7) | 0x7f;
+ result &= (input_port_read(machine, "SELECT") << 7) | 0x7f;
if ((offset & 0x17) == 0x04)
result &= ((pot_trigger[0] & ~pot_mask[0]) << 7) | 0x7f;
if ((offset & 0x17) == 0x05)
result &= ((pot_trigger[1] & ~pot_mask[1]) << 7) | 0x7f;
if ((offset & 0x17) == 0x06)
- result &= readinputportbytag("SERVE");
+ result &= input_port_read(machine, "SERVE");
if ((offset & 0x17) == 0x07)
- result &= (readinputportbytag("SELECT") << 6) | 0x7f;
+ result &= (input_port_read(machine, "SELECT") << 6) | 0x7f;
return result;
}
diff --git a/src/mame/drivers/sderby.c b/src/mame/drivers/sderby.c
index d2f5d26f6fa..aa1516b8638 100644
--- a/src/mame/drivers/sderby.c
+++ b/src/mame/drivers/sderby.c
@@ -93,7 +93,7 @@ static READ16_HANDLER ( sderby_input_r )
switch (offset)
{
case 0x00 >> 1:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x02 >> 1:
return 0xffff; // to avoid game to reset (needs more work)
}
@@ -108,11 +108,11 @@ static READ16_HANDLER( roulette_input_r )
switch (offset)
{
case 0x00 >>1:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x02 >>1:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x04 >>1:
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
return 0xffff;
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index a5643a87738..51fbdb69b8e 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -1400,7 +1400,7 @@ static WRITE32_HANDLER( analog_port_w )
{
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", activecpu_get_pc(), data);
- pending_analog_read = readinputport(4 + (data & 7));
+ pending_analog_read = input_port_read_indexed(machine, 4 + (data & 7));
}
@@ -1418,39 +1418,39 @@ static READ32_HANDLER( carnevil_gun_r )
switch (offset)
{
case 0: /* low 8 bits of X */
- result = (readinputport(4) << 4) & 0xff;
+ result = (input_port_read_indexed(machine, 4) << 4) & 0xff;
break;
case 1: /* upper 4 bits of X */
- result = (readinputport(4) >> 4) & 0x0f;
- result |= (readinputport(8) & 0x03) << 4;
+ result = (input_port_read_indexed(machine, 4) >> 4) & 0x0f;
+ result |= (input_port_read_indexed(machine, 8) & 0x03) << 4;
result |= 0x40;
break;
case 2: /* low 8 bits of Y */
- result = (readinputport(5) << 2) & 0xff;
+ result = (input_port_read_indexed(machine, 5) << 2) & 0xff;
break;
case 3: /* upper 4 bits of Y */
- result = (readinputport(5) >> 6) & 0x03;
+ result = (input_port_read_indexed(machine, 5) >> 6) & 0x03;
break;
case 4: /* low 8 bits of X */
- result = (readinputport(6) << 4) & 0xff;
+ result = (input_port_read_indexed(machine, 6) << 4) & 0xff;
break;
case 5: /* upper 4 bits of X */
- result = (readinputport(6) >> 4) & 0x0f;
- result |= (readinputport(8) & 0x30);
+ result = (input_port_read_indexed(machine, 6) >> 4) & 0x0f;
+ result |= (input_port_read_indexed(machine, 8) & 0x30);
result |= 0x40;
break;
case 6: /* low 8 bits of Y */
- result = (readinputport(7) << 2) & 0xff;
+ result = (input_port_read_indexed(machine, 7) << 2) & 0xff;
break;
case 7: /* upper 4 bits of Y */
- result = (readinputport(7) >> 6) & 0x03;
+ result = (input_port_read_indexed(machine, 7) >> 6) & 0x03;
break;
}
return result;
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 54325170c4c..1906970a6a8 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -372,8 +372,8 @@ static READ16_HANDLER( io_chip_r )
/* otherwise, return an input port */
if (offset == 0x04/2 && sound_banks)
- return (readinputport(offset) & 0xbf) | (upd7759_0_busy_r(machine,0) << 6);
- return readinputport(offset);
+ return (input_port_read_indexed(machine, offset) & 0xbf) | (upd7759_0_busy_r(machine,0) << 6);
+ return input_port_read_indexed(machine, offset);
/* 'SEGA' protection */
case 0x10/2:
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index 174515af30b..38f0f39f35d 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -2288,10 +2288,10 @@ static READ8_HANDLER (segae_hangonjr_port_f8_r)
temp = 0;
if (port_fa_last == 0x08) /* 0000 1000 */ /* Angle */
- temp = readinputport(4);
+ temp = input_port_read_indexed(machine, 4);
if (port_fa_last == 0x09) /* 0000 1001 */ /* Accel */
- temp = readinputport(5);
+ temp = input_port_read_indexed(machine, 5);
return temp;
}
@@ -2327,13 +2327,13 @@ static WRITE8_HANDLER (segae_ridleofp_port_fa_w)
if (data & 1)
{
- int curr = readinputport(4);
+ int curr = input_port_read_indexed(machine, 4);
diff1 = ((curr - last1) & 0x0fff) | (curr & 0xf000);
last1 = curr;
}
if (data & 2)
{
- int curr = readinputport(5) & 0x0fff;
+ int curr = input_port_read_indexed(machine, 5) & 0x0fff;
diff2 = ((curr - last2) & 0x0fff) | (curr & 0xf000);
last2 = curr;
}
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index 54543971ccc..9eb4ef3561a 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -231,10 +231,10 @@ static READ8_HANDLER( mangled_ports_r )
/* read as two bits from each of 4 ports. For this reason, the input */
/* ports have been organized logically, and are demangled at runtime. */
/* 4 input ports each provide 8 bits of information. */
- UINT8 d7d6 = readinputportbytag("D7D6");
- UINT8 d5d4 = readinputportbytag("D5D4");
- UINT8 d3d2 = readinputportbytag("D3D2");
- UINT8 d1d0 = readinputportbytag("D1D0");
+ UINT8 d7d6 = input_port_read(machine, "D7D6");
+ UINT8 d5d4 = input_port_read(machine, "D5D4");
+ UINT8 d3d2 = input_port_read(machine, "D3D2");
+ UINT8 d1d0 = input_port_read(machine, "D1D0");
int shift = offset & 3;
return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
}
@@ -246,17 +246,17 @@ static READ8_HANDLER( spaceod_mangled_ports_r )
/* versus cocktail cabinets; we fix this here. The input ports are */
/* coded for cocktail mode; for upright mode, we manually shuffle the */
/* bits around. */
- UINT8 d7d6 = readinputportbytag("D7D6");
- UINT8 d5d4 = readinputportbytag("D5D4");
- UINT8 d3d2 = readinputportbytag("D3D2");
- UINT8 d1d0 = readinputportbytag("D1D0");
+ UINT8 d7d6 = input_port_read(machine, "D7D6");
+ UINT8 d5d4 = input_port_read(machine, "D5D4");
+ UINT8 d3d2 = input_port_read(machine, "D3D2");
+ UINT8 d1d0 = input_port_read(machine, "D1D0");
int shift = offset & 3;
/* tweak bits for the upright case */
UINT8 upright = d3d2 & 0x04;
if (upright)
{
- UINT8 fc = readinputportbytag("FC");
+ UINT8 fc = input_port_read(machine, "FC");
d7d6 |= 0x60;
d5d4 = (d5d4 & ~0x1c) |
((~fc & 0x20) >> 3) | /* IPT_BUTTON2 */
@@ -270,8 +270,8 @@ static READ8_HANDLER( spaceod_mangled_ports_r )
static READ8_HANDLER( spaceod_port_fc_r )
{
- UINT8 upright = readinputportbytag("D3D2") & 0x04;
- UINT8 fc = readinputportbytag("FC");
+ UINT8 upright = input_port_read(machine, "D3D2") & 0x04;
+ UINT8 fc = input_port_read(machine, "FC");
/* tweak bits for the upright case */
if (upright)
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index e9dd461eb41..ddfd0acd746 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -257,10 +257,10 @@ static READ8_HANDLER( mangled_ports_r )
/* read as two bits from each of 4 ports. For this reason, the input */
/* ports have been organized logically, and are demangled at runtime. */
/* 4 input ports each provide 8 bits of information. */
- UINT8 d7d6 = readinputportbytag("D7D6");
- UINT8 d5d4 = readinputportbytag("D5D4");
- UINT8 d3d2 = readinputportbytag("D3D2");
- UINT8 d1d0 = readinputportbytag("D1D0");
+ UINT8 d7d6 = input_port_read(machine, "D7D6");
+ UINT8 d5d4 = input_port_read(machine, "D5D4");
+ UINT8 d3d2 = input_port_read(machine, "D3D2");
+ UINT8 d1d0 = input_port_read(machine, "D1D0");
int shift = offset & 3;
return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
}
@@ -284,7 +284,7 @@ static READ8_HANDLER( spinner_input_r )
INT8 delta;
if (spinner_select & 1)
- return readinputportbytag("FC");
+ return input_port_read(machine, "FC");
/*
* The values returned are always increasing. That is, regardless of whether
@@ -294,7 +294,7 @@ static READ8_HANDLER( spinner_input_r )
*/
/* I'm sure this can be further simplified ;-) BW */
- delta = readinputportbytag("SPINNER");
+ delta = input_port_read(machine, "SPINNER");
if (delta != 0)
{
spinner_sign = (delta >> 7) & 1;
@@ -313,7 +313,7 @@ static READ8_HANDLER( spinner_input_r )
static CUSTOM_INPUT( elim4_joint_coin_r )
{
- return (readinputportbytag("COINS") & 0xf) != 0xf;
+ return (input_port_read(machine, "COINS") & 0xf) != 0xf;
}
@@ -329,11 +329,11 @@ static READ8_HANDLER( elim4_input_r )
{
case 6:
/* player 3 & 4 controls */
- result = readinputportbytag("FC");
+ result = input_port_read(machine, "FC");
break;
case 7:
/* the 4 coin inputs */
- result = readinputportbytag("COINS");
+ result = input_port_read(machine, "COINS");
break;
}
}
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index 585eb277674..0827a76809f 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -39,7 +39,7 @@ static UINT16 *workram;
static UINT8 adc_select;
-static void (*i8751_vblank_hook)(void);
+static void (*i8751_vblank_hook)(running_machine *machine);
@@ -150,13 +150,13 @@ static READ16_HANDLER( hangon_io_r )
return ppi8255_0_r(machine, offset & 3);
case 0x1000/2: /* Input ports and DIP switches */
- return readinputport(offset & 3);
+ return input_port_read_indexed(machine, offset & 3);
case 0x3000/2: /* PPI @ 4C */
return ppi8255_1_r(machine, offset & 3);
case 0x3020/2: /* ADC0804 data output */
- return readinputport(4 + adc_select);
+ return input_port_read_indexed(machine, 4 + adc_select);
}
logerror("%06X:hangon_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
@@ -195,14 +195,14 @@ static READ16_HANDLER( sharrier_io_r )
return ppi8255_0_r(machine, offset & 3);
case 0x0010/2: /* Input ports and DIP switches */
- return readinputport(offset & 3);
+ return input_port_read_indexed(machine, offset & 3);
case 0x0020/2: /* PPI @ 4C */
if (offset == 2) return 0;
return ppi8255_1_r(machine, offset & 3);
case 0x0030/2: /* ADC0804 data output */
- return readinputport(4 + adc_select);
+ return input_port_read_indexed(machine, 4 + adc_select);
}
logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
@@ -312,7 +312,7 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
{
/* if we have a fake 8751 handler, call it on VBLANK */
if (i8751_vblank_hook != NULL)
- (*i8751_vblank_hook)();
+ (*i8751_vblank_hook)(machine);
irq4_line_hold(machine, cpunum);
}
@@ -324,9 +324,9 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
*
*************************************/
-static void sharrier_i8751_sim(void)
+static void sharrier_i8751_sim(running_machine *machine)
{
- workram[0x492/2] = (readinputport(4) << 8) | readinputport(5);
+ workram[0x492/2] = (input_port_read_indexed(machine, 4) << 8) | input_port_read_indexed(machine, 5);
}
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index 734522e927f..d2e6a00d4b4 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -388,12 +388,12 @@ static READ16_HANDLER( outrun_custom_io_r )
return ppi8255_0_r(machine, offset & 3);
case 0x10/2:
- return readinputport(offset & 3);
+ return input_port_read_indexed(machine, offset & 3);
case 0x30/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
- return readinputportbytag_safe(ports[adc_select], 0x0010);
+ return input_port_read_safe(machine, ports[adc_select], 0x0010);
}
case 0x60/2:
@@ -451,12 +451,12 @@ static READ16_HANDLER( shangon_custom_io_r )
case 0x1002/2:
case 0x1004/2:
case 0x1006/2:
- return readinputport(offset & 3);
+ return input_port_read_indexed(machine, offset & 3);
case 0x3020/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return readinputportbytag_safe(ports[adc_select], 0x0010);
+ return input_port_read_safe(machine, ports[adc_select], 0x0010);
}
}
logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index b4f24b809ba..25b6029952e 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -279,10 +279,10 @@ static READ16_HANDLER( standard_io_r )
return ppi8255_0_r(machine, offset & 3);
case 0x1000/2:
- return readinputport(offset & 3);
+ return input_port_read_indexed(machine, offset & 3);
case 0x2000/2:
- return readinputport(4 + (offset & 1));
+ return input_port_read_indexed(machine, 4 + (offset & 1));
}
logerror("%06X:standard_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
return 0xffff;
@@ -580,25 +580,25 @@ static READ16_HANDLER( aceattaa_custom_io_r )
{
switch (video_control & 0xf)
{
- case 0x00: return readinputportbytag("P1");
- case 0x04: return readinputportbytag("ANALOGX1");
- case 0x08: return readinputportbytag("ANALOGY1");
- case 0x0c: return readinputportbytag("UNUSED");
+ case 0x00: return input_port_read(machine, "P1");
+ case 0x04: return input_port_read(machine, "ANALOGX1");
+ case 0x08: return input_port_read(machine, "ANALOGY1");
+ case 0x0c: return input_port_read(machine, "UNUSED");
}
break;
}
case 0x02:
- return readinputportbytag("DIAL1") | (readinputportbytag("DIAL2") << 4);
+ return input_port_read(machine, "DIAL1") | (input_port_read(machine, "DIAL2") << 4);
case 0x03:
{
switch (video_control & 0xf)
{
- case 0x00: return readinputportbytag("P2");
- case 0x04: return readinputportbytag("ANALOGX2");
- case 0x08: return readinputportbytag("ANALOGY2");
- case 0x0c: return readinputportbytag("POW2");
+ case 0x00: return input_port_read(machine, "P2");
+ case 0x04: return input_port_read(machine, "ANALOGX2");
+ case 0x08: return input_port_read(machine, "ANALOGY2");
+ case 0x0c: return input_port_read(machine, "POW2");
}
break;
}
@@ -628,9 +628,9 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* upper bit of the trackball controls */
case 0:
{
- UINT8 buttons = readinputportbytag("SERVICE");
- UINT8 analog1 = readinputportbytag((video_control & 4) ? "ANALOGY1" : "ANALOGX1");
- UINT8 analog2 = readinputportbytag((video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ UINT8 buttons = input_port_read(machine, "SERVICE");
+ UINT8 analog1 = input_port_read(machine, (video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ UINT8 analog2 = input_port_read(machine, (video_control & 4) ? "ANALOGY2" : "ANALOGX2");
buttons |= (analog1 & 0x80) >> 1;
buttons |= (analog2 & 0x80);
return buttons;
@@ -640,8 +640,8 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* player 1 select switch mapped to bit 7 */
case 1:
{
- UINT8 buttons = readinputportbytag("BUTTONS1");
- UINT8 analog = readinputportbytag((video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ UINT8 buttons = input_port_read(machine, "BUTTONS1");
+ UINT8 analog = input_port_read(machine, (video_control & 4) ? "ANALOGY1" : "ANALOGX1");
return (buttons & 0x80) | (analog & 0x7f);
}
@@ -649,13 +649,13 @@ static READ16_HANDLER( mjleague_custom_io_r )
case 2:
{
if (video_control & 4)
- return (readinputportbytag("ANALOGZ1") >> 4) | (readinputportbytag("ANALOGZ2") & 0xf0);
+ return (input_port_read(machine, "ANALOGZ1") >> 4) | (input_port_read(machine, "ANALOGZ2") & 0xf0);
else
{
static UINT8 last_buttons1 = 0;
static UINT8 last_buttons2 = 0;
- UINT8 buttons1 = readinputportbytag("BUTTONS1");
- UINT8 buttons2 = readinputportbytag("BUTTONS2");
+ UINT8 buttons1 = input_port_read(machine, "BUTTONS1");
+ UINT8 buttons2 = input_port_read(machine, "BUTTONS2");
if (!(buttons1 & 0x01))
last_buttons1 = 0;
@@ -683,8 +683,8 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* player 2 select switch mapped to bit 7 */
case 3:
{
- UINT8 buttons = readinputportbytag("BUTTONS2");
- UINT8 analog = readinputportbytag((video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ UINT8 buttons = input_port_read(machine, "BUTTONS2");
+ UINT8 analog = input_port_read(machine, (video_control & 4) ? "ANALOGY2" : "ANALOGX2");
return (buttons & 0x80) | (analog & 0x7f);
}
}
@@ -714,10 +714,10 @@ static READ16_HANDLER( pshot16a_custom_io_r )
case 1:
switch ((read_port++)&3)
{
- case 0: return readinputportbytag("P1");
- case 1: return readinputportbytag("P2");
- case 2: return readinputportbytag("P3");
- case 3: return readinputportbytag("P4");
+ case 0: return input_port_read(machine, "P1");
+ case 1: return input_port_read(machine, "P2");
+ case 2: return input_port_read(machine, "P3");
+ case 3: return input_port_read(machine, "P4");
}
break;
@@ -740,8 +740,8 @@ static READ16_HANDLER( sdi_custom_io_r )
case 0x1000/2:
switch (offset & 3)
{
- case 1: return readinputportbytag((video_control & 4) ? "ANALOGY1" : "ANALOGX1");
- case 3: return readinputportbytag((video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ case 1: return input_port_read(machine, (video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ case 3: return input_port_read(machine, (video_control & 4) ? "ANALOGY2" : "ANALOGX2");
}
break;
}
@@ -765,12 +765,12 @@ static READ16_HANDLER( sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
- if (readinputportbytag_safe(portname[mj_input_num], 0xff) != 0xff)
+ if (input_port_read_safe(machine, portname[mj_input_num], 0xff) != 0xff)
return 0xff & ~(1 << mj_input_num);
return 0xff;
case 2:
- return readinputportbytag_safe(portname[mj_input_num], 0xff);
+ return input_port_read_safe(machine, portname[mj_input_num], 0xff);
}
break;
}
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index c8286ce9829..0d5b909941e 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1120,10 +1120,10 @@ static READ16_HANDLER( standard_io_r )
switch (offset & (0x3000/2))
{
case 0x1000/2:
- return readinputport(offset & 3);
+ return input_port_read_indexed(machine, offset & 3);
case 0x2000/2:
- return readinputport(4 + (offset & 1));
+ return input_port_read_indexed(machine, 4 + (offset & 1));
}
logerror("%06X:standard_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2);
return segaic16_open_bus_r(machine,0,0);
@@ -1379,7 +1379,7 @@ static void altbeast_common_i8751_sim(running_machine *machine, offs_t soundoffs
}
/* read inputs */
- workram[inputoffs] = ~readinputport(0) << 8;
+ workram[inputoffs] = ~input_port_read_indexed(machine, 0) << 8;
}
static void altbeasj_i8751_sim(running_machine *machine)
@@ -1458,8 +1458,8 @@ static void goldnaxe_i8751_sim(running_machine *machine)
}
/* read inputs */
- workram[0x2cd0/2] = (readinputport(1) << 8) | readinputport(3);
- workram[0x2c96/2] = readinputport(0) << 8;
+ workram[0x2cd0/2] = (input_port_read_indexed(machine, 1) << 8) | input_port_read_indexed(machine, 3);
+ workram[0x2c96/2] = input_port_read_indexed(machine, 0) << 8;
}
@@ -1479,9 +1479,9 @@ static void tturf_i8751_sim(running_machine *machine)
}
/* read inputs */
- workram[0x01e6/2] = readinputport(0) << 8;
- workram[0x01e8/2] = readinputport(1) << 8;
- workram[0x01ea/2] = readinputport(3) << 8;
+ workram[0x01e6/2] = input_port_read_indexed(machine, 0) << 8;
+ workram[0x01e8/2] = input_port_read_indexed(machine, 1) << 8;
+ workram[0x01ea/2] = input_port_read_indexed(machine, 3) << 8;
}
@@ -1518,7 +1518,7 @@ static void wrestwar_i8751_sim(running_machine *machine)
}
/* read inputs */
- workram[0x2082/2] = readinputport(0);
+ workram[0x2082/2] = input_port_read_indexed(machine, 0);
}
@@ -1554,14 +1554,14 @@ static READ16_HANDLER( dunkshot_custom_io_r )
case 0x3000/2:
switch ((offset/2) & 7)
{
- case 0: return (readinputportbytag("ANALOGX1") << 4) >> (8 * (offset & 1));
- case 1: return (readinputportbytag("ANALOGY1") << 4) >> (8 * (offset & 1));
- case 2: return (readinputportbytag("ANALOGX2") << 4) >> (8 * (offset & 1));
- case 3: return (readinputportbytag("ANALOGY2") << 4) >> (8 * (offset & 1));
- case 4: return (readinputportbytag("ANALOGX3") << 4) >> (8 * (offset & 1));
- case 5: return (readinputportbytag("ANALOGY3") << 4) >> (8 * (offset & 1));
- case 6: return (readinputportbytag("ANALOGX4") << 4) >> (8 * (offset & 1));
- case 7: return (readinputportbytag("ANALOGY4") << 4) >> (8 * (offset & 1));
+ case 0: return (input_port_read(machine, "ANALOGX1") << 4) >> (8 * (offset & 1));
+ case 1: return (input_port_read(machine, "ANALOGY1") << 4) >> (8 * (offset & 1));
+ case 2: return (input_port_read(machine, "ANALOGX2") << 4) >> (8 * (offset & 1));
+ case 3: return (input_port_read(machine, "ANALOGY2") << 4) >> (8 * (offset & 1));
+ case 4: return (input_port_read(machine, "ANALOGX3") << 4) >> (8 * (offset & 1));
+ case 5: return (input_port_read(machine, "ANALOGY3") << 4) >> (8 * (offset & 1));
+ case 6: return (input_port_read(machine, "ANALOGX4") << 4) >> (8 * (offset & 1));
+ case 7: return (input_port_read(machine, "ANALOGY4") << 4) >> (8 * (offset & 1));
}
break;
}
@@ -1605,7 +1605,7 @@ static WRITE16_HANDLER( hwchamp_custom_io_w )
switch (offset & 0x30/2)
{
case 0x20/2:
- hwc_input_value = readinputportbytag_safe(portname[offset & 3], 0xff);
+ hwc_input_value = input_port_read_safe(machine, portname[offset & 3], 0xff);
break;
case 0x30/2:
@@ -1637,10 +1637,10 @@ static READ16_HANDLER( passshtj_custom_io_r )
case 0x3000/2:
switch (offset & 3)
{
- case 0: return readinputportbytag("P1");
- case 1: return readinputportbytag("P2");
- case 2: return readinputportbytag("P3");
- case 3: return readinputportbytag("P4");
+ case 0: return input_port_read(machine, "P1");
+ case 1: return input_port_read(machine, "P2");
+ case 2: return input_port_read(machine, "P3");
+ case 3: return input_port_read(machine, "P4");
}
break;
}
@@ -1662,10 +1662,10 @@ static READ16_HANDLER( sdi_custom_io_r )
case 0x3000/2:
switch ((offset/2) & 3)
{
- case 0: return readinputportbytag("ANALOGX1");
- case 1: return readinputportbytag("ANALOGY1");
- case 2: return readinputportbytag("ANALOGX2");
- case 3: return readinputportbytag("ANALOGY2");
+ case 0: return input_port_read(machine, "ANALOGX1");
+ case 1: return input_port_read(machine, "ANALOGY1");
+ case 2: return input_port_read(machine, "ANALOGX2");
+ case 3: return input_port_read(machine, "ANALOGY2");
}
break;
}
@@ -1689,12 +1689,12 @@ static READ16_HANDLER( sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
- if (readinputportbytag_safe(portname[mj_input_num], 0xff) != 0xff)
+ if (input_port_read_safe(machine, portname[mj_input_num], 0xff) != 0xff)
return 0xff & ~(1 << mj_input_num);
return 0xff;
case 2:
- return readinputportbytag_safe(portname[mj_input_num], 0xff);
+ return input_port_read_safe(machine, portname[mj_input_num], 0xff);
}
break;
}
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index 845ad6fe4c3..d35c20e83d3 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -236,7 +236,7 @@ static READ16_HANDLER( io_chip_r )
return misc_io_data[offset];
/* otherwise, return an input port */
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
/* 'SEGA' protection */
case 0x10/2:
@@ -330,7 +330,7 @@ static READ16_HANDLER( misc_io_r )
/* video control latch */
case 0x2000/2:
- return readinputport(4 + (offset & 1));
+ return input_port_read_indexed(machine, 4 + (offset & 1));
}
if (custom_io_r)
return custom_io_r(machine, offset, mem_mask);
@@ -419,13 +419,13 @@ static READ16_HANDLER( ddcrew_custom_io_r )
switch (offset)
{
case 0x3020/2:
- return readinputportbytag("P3");
+ return input_port_read(machine, "P3");
case 0x3022/2:
- return readinputportbytag("P4");
+ return input_port_read(machine, "P4");
case 0x3024/2:
- return readinputportbytag("P34START");
+ return input_port_read(machine, "P34START");
}
return segaic16_open_bus_r(machine,0,0);
}
@@ -460,19 +460,19 @@ static WRITE16_HANDLER( lghost_custom_io_w )
switch (offset)
{
case 0x3010/2:
- lghost_value = 255 - readinputportbytag("GUNY1");
+ lghost_value = 255 - input_port_read(machine, "GUNY1");
break;
case 0x3012/2:
- lghost_value = readinputportbytag("GUNX1");
+ lghost_value = input_port_read(machine, "GUNX1");
break;
case 0x3014/2:
- lghost_value = 255 - readinputportbytag(lghost_select ? "GUNY3" : "GUNY2");
+ lghost_value = 255 - input_port_read(machine, lghost_select ? "GUNY3" : "GUNY2");
break;
case 0x3016/2:
- lghost_value = readinputportbytag(lghost_select ? "GUNX3" : "GUNX2");
+ lghost_value = input_port_read(machine, lghost_select ? "GUNX3" : "GUNX2");
break;
case 0x3020/2:
@@ -494,22 +494,22 @@ static READ16_HANDLER( wwally_custom_io_r )
switch (offset)
{
case 0x3000/2:
- return (readinputportbytag("TRACKX1") - wwally_last_x[0]) & 0xff;
+ return (input_port_read(machine, "TRACKX1") - wwally_last_x[0]) & 0xff;
case 0x3004/2:
- return (readinputportbytag("TRACKY1") - wwally_last_y[0]) & 0xff;
+ return (input_port_read(machine, "TRACKY1") - wwally_last_y[0]) & 0xff;
case 0x3008/2:
- return (readinputportbytag("TRACKX2") - wwally_last_x[1]) & 0xff;
+ return (input_port_read(machine, "TRACKX2") - wwally_last_x[1]) & 0xff;
case 0x300c/2:
- return (readinputportbytag("TRACKY2") - wwally_last_y[1]) & 0xff;
+ return (input_port_read(machine, "TRACKY2") - wwally_last_y[1]) & 0xff;
case 0x3010/2:
- return (readinputportbytag("TRACKX3") - wwally_last_x[2]) & 0xff;
+ return (input_port_read(machine, "TRACKX3") - wwally_last_x[2]) & 0xff;
case 0x3014/2:
- return (readinputportbytag("TRACKY3") - wwally_last_y[2]) & 0xff;
+ return (input_port_read(machine, "TRACKY3") - wwally_last_y[2]) & 0xff;
}
return segaic16_open_bus_r(machine,0,0);
}
@@ -521,20 +521,20 @@ static WRITE16_HANDLER( wwally_custom_io_w )
{
case 0x3000/2:
case 0x3004/2:
- wwally_last_x[0] = readinputportbytag("TRACKX1");
- wwally_last_y[0] = readinputportbytag("TRACKY1");
+ wwally_last_x[0] = input_port_read(machine, "TRACKX1");
+ wwally_last_y[0] = input_port_read(machine, "TRACKY1");
break;
case 0x3008/2:
case 0x300c/2:
- wwally_last_x[1] = readinputportbytag("TRACKX2");
- wwally_last_y[1] = readinputportbytag("TRACKY2");
+ wwally_last_x[1] = input_port_read(machine, "TRACKX2");
+ wwally_last_y[1] = input_port_read(machine, "TRACKY2");
break;
case 0x3010/2:
case 0x3014/2:
- wwally_last_x[2] = readinputportbytag("TRACKX3");
- wwally_last_y[2] = readinputportbytag("TRACKY3");
+ wwally_last_x[2] = input_port_read(machine, "TRACKX3");
+ wwally_last_y[2] = input_port_read(machine, "TRACKY3");
break;
}
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 0c171329899..c9d030f2b9a 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -510,19 +510,19 @@ static UINT8 hotrod_io_r(running_machine *machine, int port)
{
switch(port) {
case 0:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 1:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 2:
return 0xff;
case 3:
return 0xff;
case 4:
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 5: // Dip switches
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
case 6:
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
case 7: // DAC
return 0xff;
}
@@ -534,20 +534,20 @@ static UINT8 dcclub_io_r(running_machine *machine, int port)
switch(port) {
case 0: {
static const UINT8 pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9 };
- return (readinputport(0) & 0xf) | ((~pos[readinputport(5)>>4]<<4) & 0xf0);
+ return (input_port_read_indexed(machine, 0) & 0xf) | ((~pos[input_port_read_indexed(machine, 5)>>4]<<4) & 0xf0);
}
case 1:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 2:
return 0xff;
case 3:
return 0xff;
case 4:
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 5: // Dip switches
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
case 6:
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
case 7: // DAC
return 0xff;
}
@@ -564,15 +564,15 @@ static UINT8 mahmajn_io_r(running_machine *machine, int port)
case 1:
return 0xff;
case 2:
- return readinputport(cur_input_line);
+ return input_port_read_indexed(machine, cur_input_line);
case 3:
return 0xff;
case 4:
- return readinputport(8);
+ return input_port_read_indexed(machine, 8);
case 5: // Dip switches
- return readinputport(9);
+ return input_port_read_indexed(machine, 9);
case 6:
- return readinputport(10);
+ return input_port_read_indexed(machine, 10);
case 7: // DAC
return 0xff;
}
@@ -583,19 +583,19 @@ static UINT8 gground_io_r(running_machine *machine, int port)
{
switch(port) {
case 0:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 1:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 2: // P3 inputs
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 3:
return 0xff;
case 4:
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
case 5: // Dip switches
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
case 6:
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
case 7: // DAC
return 0xff;
}
@@ -636,7 +636,7 @@ static WRITE16_HANDLER( hotrod3_ctrl_w )
{
if(ACCESSING_BITS_0_7) {
data &= 3;
- hotrod_ctrl_cur = readinputport(9+data);
+ hotrod_ctrl_cur = input_port_read_indexed(machine, 9+data);
}
}
@@ -646,21 +646,21 @@ static READ16_HANDLER( hotrod3_ctrl_r )
switch(offset) {
// Steering dials
case 0:
- return readinputport(5) & 0xff;
+ return input_port_read_indexed(machine, 5) & 0xff;
case 1:
- return readinputport(5) >> 8;
+ return input_port_read_indexed(machine, 5) >> 8;
case 2:
- return readinputport(6) & 0xff;
+ return input_port_read_indexed(machine, 6) & 0xff;
case 3:
- return readinputport(6) >> 8;
+ return input_port_read_indexed(machine, 6) >> 8;
case 4:
- return readinputport(7) & 0xff;
+ return input_port_read_indexed(machine, 7) & 0xff;
case 5:
- return readinputport(7) >> 8;
+ return input_port_read_indexed(machine, 7) >> 8;
case 6:
- return readinputport(8) & 0xff;
+ return input_port_read_indexed(machine, 8) & 0xff;
case 7:
- return readinputport(8) >> 8;
+ return input_port_read_indexed(machine, 8) >> 8;
case 8: { // Serial ADCs for the accel
int v = hotrod_ctrl_cur & 0x80;
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 5aa9ef3b416..0003878c9b7 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -591,7 +591,7 @@ static CUSTOM_INPUT( eeprom_bit_r )
}
-static UINT16 common_io_chip_r(int which, offs_t offset, UINT16 mem_mask)
+static UINT16 common_io_chip_r(running_machine *machine, int which, offs_t offset, UINT16 mem_mask)
{
offset &= 0x1f/2;
@@ -611,7 +611,7 @@ static UINT16 common_io_chip_r(int which, offs_t offset, UINT16 mem_mask)
return misc_io_data[which][offset];
/* otherwise, return an input port */
- return readinputport(which*8 + offset);
+ return input_port_read_indexed(machine, which*8 + offset);
/* 'SEGA' protection */
case 0x10/2:
@@ -700,7 +700,7 @@ static void common_io_chip_w(int which, offs_t offset, UINT16 data, UINT16 mem_m
static READ16_HANDLER( io_chip_r )
{
- return common_io_chip_r(0, offset, mem_mask);
+ return common_io_chip_r(machine, 0, offset, mem_mask);
}
@@ -712,8 +712,8 @@ static WRITE16_HANDLER( io_chip_w )
static READ32_HANDLER( io_chip_0_r )
{
- return common_io_chip_r(0, offset*2+0, mem_mask) |
- (common_io_chip_r(0, offset*2+1, mem_mask >> 16) << 16);
+ return common_io_chip_r(machine, 0, offset*2+0, mem_mask) |
+ (common_io_chip_r(machine, 0, offset*2+1, mem_mask >> 16) << 16);
}
@@ -728,8 +728,8 @@ static WRITE32_HANDLER( io_chip_0_w )
static READ32_HANDLER( io_chip_1_r )
{
- return common_io_chip_r(1, offset*2+0, mem_mask) |
- (common_io_chip_r(1, offset*2+1, mem_mask >> 16) << 16);
+ return common_io_chip_r(machine, 1, offset*2+0, mem_mask) |
+ (common_io_chip_r(machine, 1, offset*2+1, mem_mask >> 16) << 16);
}
@@ -868,7 +868,7 @@ static WRITE16_HANDLER( analog_custom_io_w )
case 0x12/2:
case 0x14/2:
case 0x16/2:
- analog_value[offset & 3] = readinputportbytag_safe(names[offset & 3], 0);
+ analog_value[offset & 3] = input_port_read_safe(machine, names[offset & 3], 0);
return;
}
logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask ^ 0xffff);
@@ -884,7 +884,7 @@ static READ16_HANDLER( extra_custom_io_r )
case 0x22/2:
case 0x24/2:
case 0x26/2:
- return readinputportbytag_safe(names[offset & 3], 0xffff);
+ return input_port_read_safe(machine, names[offset & 3], 0xffff);
}
logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask ^ 0xffff);
@@ -901,7 +901,7 @@ static WRITE16_HANDLER( orunners_custom_io_w )
case 0x12/2:
case 0x14/2:
case 0x16/2:
- analog_value[offset & 3] = readinputportbytag_safe(names[analog_bank * 4 + (offset & 3)], 0);
+ analog_value[offset & 3] = input_port_read_safe(machine, names[analog_bank * 4 + (offset & 3)], 0);
return;
case 0x20/2:
@@ -924,7 +924,7 @@ static READ16_HANDLER( sonic_custom_io_r )
case 0x0c/2:
case 0x10/2:
case 0x14/2:
- return (UINT8)(readinputportbytag(names[offset/2]) - sonic_last[offset/2]);
+ return (UINT8)(input_port_read(machine, names[offset/2]) - sonic_last[offset/2]);
}
logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask ^ 0xffff);
@@ -941,8 +941,8 @@ static WRITE16_HANDLER( sonic_custom_io_w )
case 0x00/2:
case 0x08/2:
case 0x10/2:
- sonic_last[offset/2 + 0] = readinputportbytag(names[offset/2 + 0]);
- sonic_last[offset/2 + 1] = readinputportbytag(names[offset/2 + 1]);
+ sonic_last[offset/2 + 0] = input_port_read(machine, names[offset/2 + 0]);
+ sonic_last[offset/2 + 1] = input_port_read(machine, names[offset/2 + 1]);
return;
}
diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c
index f3b6d9f7fc8..e443d9db6aa 100644
--- a/src/mame/drivers/segaxbd.c
+++ b/src/mame/drivers/segaxbd.c
@@ -240,7 +240,7 @@ static READ16_HANDLER( adc_r )
int which = (iochip_regs[0][2] >> 2) & 7;
/* on the write, latch the selected input port and stash the value */
- int value = readinputportbytag_safe(ports[which], 0x0010);
+ int value = input_port_read_safe(machine, ports[which], 0x0010);
/* reverse some port values */
if (adc_reverse[which])
@@ -300,11 +300,11 @@ static READ16_HANDLER( iochip_0_r )
D6: /INTR of ADC0804
D5-D0: CN C pin 24-19 (switch state 0= open, 1= closed)
*/
- return iochip_r(0, 0, readinputport(0));
+ return iochip_r(0, 0, input_port_read_indexed(machine, 0));
case 1:
/* I/O port: CN C pins 17,15,13,11,9,7,5,3 */
- return iochip_r(0, 1, readinputport(1));
+ return iochip_r(0, 1, input_port_read_indexed(machine, 1));
case 2:
/* Output port */
@@ -375,19 +375,19 @@ static READ16_HANDLER( iochip_1_r )
{
case 0:
/* Input port: switches, CN D pin A1-8 (switch state 1= open, 0= closed) */
- return iochip_r(1, 0, readinputport(2));
+ return iochip_r(1, 0, input_port_read_indexed(machine, 2));
case 1:
/* Input port: switches, CN D pin A9-16 (switch state 1= open, 0= closed) */
- return iochip_r(1, 1, readinputport(3));
+ return iochip_r(1, 1, input_port_read_indexed(machine, 3));
case 2:
/* Input port: DIP switches (1= off, 0= on) */
- return iochip_r(1, 2, readinputport(4));
+ return iochip_r(1, 2, input_port_read_indexed(machine, 4));
case 3:
/* Input port: DIP switches (1= off, 0= on) */
- return iochip_r(1, 3, readinputport(5));
+ return iochip_r(1, 3, input_port_read_indexed(machine, 5));
case 4:
/* Unused */
diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c
index 075f90f3f7b..be063dbc3a7 100644
--- a/src/mame/drivers/segaybd.c
+++ b/src/mame/drivers/segaybd.c
@@ -256,7 +256,7 @@ static READ16_HANDLER( io_chip_r )
return misc_io_data[offset];
/* otherwise, return an input port */
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
/* 'SEGA' protection */
case 0x10/2:
@@ -357,7 +357,7 @@ static WRITE16_HANDLER( analog_w )
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
int selected = ((offset & 3) == 3) ? (3 + (misc_io_data[0x08/2] & 3)) : (offset & 3);
- int value = readinputportbytag_safe(ports[selected], 0xff);
+ int value = input_port_read_safe(machine, ports[selected], 0xff);
analog_data[offset & 3] = value;
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 5b237d89cf3..438be889877 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -923,7 +923,7 @@ logerror("z80 data = %08x mask = %08x\n",data,mem_mask);
static READ32_HANDLER( spi_controls1_r )
{
if( ACCESSING_BITS_0_7 ) {
- return (readinputport(1) << 8) | readinputport(0) | 0xffff0000;
+ return (input_port_read_indexed(machine, 1) << 8) | input_port_read_indexed(machine, 0) | 0xffff0000;
}
return 0xffffffff;
}
@@ -931,7 +931,7 @@ static READ32_HANDLER( spi_controls1_r )
static READ32_HANDLER( spi_controls2_r )
{
if( ACCESSING_BITS_0_7 ) {
- return ((readinputport(2) | 0xffffff00) & ~0x40) | (EEPROM_read_bit() << 6);
+ return ((input_port_read_indexed(machine, 2) | 0xffffff00) & ~0x40) | (EEPROM_read_bit() << 6);
}
return 0xffffffff;
}
@@ -995,12 +995,12 @@ static WRITE8_HANDLER( z80_bank_w )
static READ8_HANDLER( z80_jp1_r )
{
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
static READ8_HANDLER( z80_coin_r )
{
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
}
static READ32_HANDLER( soundrom_r )
@@ -1971,7 +1971,7 @@ static READ32_HANDLER ( rfjet_speedup_r )
cpu_spinuntil_int(); // idle
// Hack to enter test mode
r = spimainram[(0x002894c-0x800)/4] & (~0x400);
- return r | (((readinputport(2) ^ 0xFF)<<8) & 0x400);
+ return r | (((input_port_read_indexed(machine, 2) ^ 0xFF)<<8) & 0x400);
}
/* rfjetj */
diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c
index 623aa30797b..9c4474a4d0f 100644
--- a/src/mame/drivers/seicross.c
+++ b/src/mame/drivers/seicross.c
@@ -92,7 +92,7 @@ static MACHINE_RESET( friskyt )
static READ8_HANDLER( friskyt_portB_r )
{
- return (portb & 0x9f) | (readinputport(6) & 0x60);
+ return (portb & 0x9f) | (input_port_read_indexed(machine, 6) & 0x60);
}
static WRITE8_HANDLER( friskyt_portB_w )
diff --git a/src/mame/drivers/sengokmj.c b/src/mame/drivers/sengokmj.c
index 00b9dbd4060..a389e27f3c0 100644
--- a/src/mame/drivers/sengokmj.c
+++ b/src/mame/drivers/sengokmj.c
@@ -67,12 +67,12 @@ static READ16_HANDLER( mahjong_panel_r )
{
switch(sengokumj_mux_data)
{
- case 1: return readinputport(2);
- case 2: return readinputport(3);
- case 4: return readinputport(4);
- case 8: return readinputport(5);
- case 0x10: return readinputport(6);
- case 0x20: return readinputport(7);
+ case 1: return input_port_read_indexed(machine, 2);
+ case 2: return input_port_read_indexed(machine, 3);
+ case 4: return input_port_read_indexed(machine, 4);
+ case 8: return input_port_read_indexed(machine, 5);
+ case 0x10: return input_port_read_indexed(machine, 6);
+ case 0x20: return input_port_read_indexed(machine, 7);
}
return 0xffff;
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index 56080559e51..e37cd0c09b6 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -1520,7 +1520,7 @@ static WRITE16_HANDLER( sub_ctrl_w )
/* DSW reading for 16 bit CPUs */
static READ16_HANDLER( seta_dsw_r )
{
- UINT16 dsw = readinputport(3);
+ UINT16 dsw = input_port_read_indexed(machine, 3);
if (offset == 0) return (dsw >> 8) & 0xff;
else return (dsw >> 0) & 0xff;
}
@@ -1530,12 +1530,12 @@ static READ16_HANDLER( seta_dsw_r )
static READ8_HANDLER( dsw1_r )
{
- return (readinputport(3) >> 8) & 0xff;
+ return (input_port_read_indexed(machine, 3) >> 8) & 0xff;
}
static READ8_HANDLER( dsw2_r )
{
- return (readinputport(3) >> 0) & 0xff;
+ return (input_port_read_indexed(machine, 3) >> 0) & 0xff;
}
@@ -1654,15 +1654,15 @@ ADDRESS_MAP_END
static READ16_HANDLER ( calibr50_ip_r )
{
- int dir1 = readinputportbytag("IN4") & 0xfff; // analog port
- int dir2 = readinputportbytag("IN5") & 0xfff; // analog port
+ int dir1 = input_port_read(machine, "IN4") & 0xfff; // analog port
+ int dir2 = input_port_read(machine, "IN5") & 0xfff; // analog port
switch (offset)
{
- case 0x00/2: return readinputportbytag("IN0"); // p1
- case 0x02/2: return readinputportbytag("IN1"); // p2
+ case 0x00/2: return input_port_read(machine, "IN0"); // p1
+ case 0x02/2: return input_port_read(machine, "IN1"); // p2
- case 0x08/2: return readinputport(2); // Coins
+ case 0x08/2: return input_port_read_indexed(machine, 2); // Coins
case 0x10/2: return (dir1&0xff); // lower 8 bits of p1 rotation
case 0x12/2: return (dir1>>8); // upper 4 bits of p1 rotation
@@ -1729,10 +1729,10 @@ static READ16_HANDLER( usclssic_dsw_r )
{
switch (offset)
{
- case 0/2: return (readinputport(3) >> 8) & 0xf;
- case 2/2: return (readinputport(3) >> 12) & 0xf;
- case 4/2: return (readinputport(3) >> 0) & 0xf;
- case 6/2: return (readinputport(3) >> 4) & 0xf;
+ case 0/2: return (input_port_read_indexed(machine, 3) >> 8) & 0xf;
+ case 2/2: return (input_port_read_indexed(machine, 3) >> 12) & 0xf;
+ case 4/2: return (input_port_read_indexed(machine, 3) >> 0) & 0xf;
+ case 6/2: return (input_port_read_indexed(machine, 3) >> 4) & 0xf;
}
return 0;
}
@@ -1741,8 +1741,8 @@ static READ16_HANDLER( usclssic_trackball_x_r )
{
switch (offset)
{
- case 0/2: return (readinputport(0) >> 0) & 0xff;
- case 2/2: return (readinputport(0) >> 8) & 0xff;
+ case 0/2: return (input_port_read_indexed(machine, 0) >> 0) & 0xff;
+ case 2/2: return (input_port_read_indexed(machine, 0) >> 8) & 0xff;
}
return 0;
}
@@ -1751,8 +1751,8 @@ static READ16_HANDLER( usclssic_trackball_y_r )
{
switch (offset)
{
- case 0/2: return (readinputport(1) >> 0) & 0xff;
- case 2/2: return (readinputport(1) >> 8) & 0xff;
+ case 0/2: return (input_port_read_indexed(machine, 1) >> 0) & 0xff;
+ case 2/2: return (input_port_read_indexed(machine, 1) >> 8) & 0xff;
}
return 0;
}
@@ -1960,7 +1960,7 @@ static int gun_input_bit = 0, gun_input_src = 0;
static READ16_HANDLER( zombraid_gun_r ) // Serial interface
{
- int data = readinputport(4 + gun_input_src); // Input Ports 5-8
+ int data = input_port_read_indexed(machine, 4 + gun_input_src); // Input Ports 5-8
return (data >> gun_input_bit) & 1;
}
@@ -2371,10 +2371,10 @@ ADDRESS_MAP_END
static READ16_HANDLER( krzybowl_input_r )
{
// analog ports
- int dir1x = readinputport(4) & 0xfff;
- int dir1y = readinputport(5) & 0xfff;
- int dir2x = readinputport(6) & 0xfff;
- int dir2y = readinputport(7) & 0xfff;
+ int dir1x = input_port_read_indexed(machine, 4) & 0xfff;
+ int dir1y = input_port_read_indexed(machine, 5) & 0xfff;
+ int dir2x = input_port_read_indexed(machine, 6) & 0xfff;
+ int dir2y = input_port_read_indexed(machine, 7) & 0xfff;
switch (offset)
{
@@ -2604,9 +2604,9 @@ static READ16_HANDLER( kiwame_input_r )
switch( offset )
{
- case 0x00/2: return readinputport( i );
+ case 0x00/2: return input_port_read_indexed(machine, i );
case 0x02/2: return 0xffff;
- case 0x04/2: return readinputport( 2 );
+ case 0x04/2: return input_port_read_indexed(machine, 2 );
// case 0x06/2:
case 0x08/2: return 0xffff;
@@ -2885,21 +2885,21 @@ ADDRESS_MAP_END
static READ8_HANDLER( downtown_ip_r )
{
- int dir1 = readinputport(4); // analog port
- int dir2 = readinputport(5); // analog port
+ int dir1 = input_port_read_indexed(machine, 4); // analog port
+ int dir2 = input_port_read_indexed(machine, 5); // analog port
dir1 = (~ (0x800 >> ((dir1 * 12)/0x100)) ) & 0xfff;
dir2 = (~ (0x800 >> ((dir2 * 12)/0x100)) ) & 0xfff;
switch (offset)
{
- case 0: return (readinputport(2) & 0xf0) + (dir1>>8); // upper 4 bits of p1 rotation + coins
+ case 0: return (input_port_read_indexed(machine, 2) & 0xf0) + (dir1>>8); // upper 4 bits of p1 rotation + coins
case 1: return (dir1&0xff); // lower 8 bits of p1 rotation
- case 2: return readinputport(0); // p1
+ case 2: return input_port_read_indexed(machine, 0); // p1
case 3: return 0xff; // ?
case 4: return (dir2>>8); // upper 4 bits of p2 rotation + ?
case 5: return (dir2&0xff); // lower 8 bits of p2 rotation
- case 6: return readinputport(1); // p2
+ case 6: return input_port_read_indexed(machine, 1); // p2
case 7: return 0xff; // ?
}
@@ -3102,9 +3102,9 @@ ADDRESS_MAP_END
static READ16_HANDLER( inttoote_dsw_r )
{
int shift = offset * 4;
- return ((((readinputport(0) >> shift) & 0xf)) << 0) |
- ((((readinputport(1) >> shift) & 0xf)) << 4) |
- ((((readinputport(1) >> (shift+8)) & 0xf)) << 8) ;
+ return ((((input_port_read_indexed(machine, 0) >> shift) & 0xf)) << 0) |
+ ((((input_port_read_indexed(machine, 1) >> shift) & 0xf)) << 4) |
+ ((((input_port_read_indexed(machine, 1) >> (shift+8)) & 0xf)) << 8) ;
}
static UINT16 *inttoote_key_select;
@@ -3112,11 +3112,11 @@ static READ16_HANDLER( inttoote_key_r )
{
switch( *inttoote_key_select )
{
- case 0x08: return readinputport(4+0);
- case 0x10: return readinputport(4+1);
- case 0x20: return readinputport(4+2);
- case 0x40: return readinputport(4+3);
- case 0x80: return readinputport(4+4);
+ case 0x08: return input_port_read_indexed(machine, 4+0);
+ case 0x10: return input_port_read_indexed(machine, 4+1);
+ case 0x20: return input_port_read_indexed(machine, 4+2);
+ case 0x40: return input_port_read_indexed(machine, 4+3);
+ case 0x80: return input_port_read_indexed(machine, 4+4);
}
logerror("%06X: unknown read, select = %04x\n",activecpu_get_pc(),*inttoote_key_select);
return 0xffff;
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index c46130be15c..6d849404a92 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -564,11 +564,11 @@ static READ16_HANDLER( mj4simai_p1_r )
{
switch (keyboard_row)
{
- case 0x01: return readinputport(3);
- case 0x02: return readinputport(4);
- case 0x04: return readinputport(5);
- case 0x08: return readinputport(6);
- case 0x10: return readinputport(7);
+ case 0x01: return input_port_read_indexed(machine, 3);
+ case 0x02: return input_port_read_indexed(machine, 4);
+ case 0x04: return input_port_read_indexed(machine, 5);
+ case 0x08: return input_port_read_indexed(machine, 6);
+ case 0x10: return input_port_read_indexed(machine, 7);
default: logerror("p1_r with keyboard_row = %02x\n",keyboard_row); return 0xffff;
}
}
@@ -686,7 +686,7 @@ static READ16_HANDLER( pzlbowl_protection_r )
static READ16_HANDLER( pzlbowl_coins_r )
{
- return readinputport(4) | (mame_rand(Machine) & 0x80 );
+ return input_port_read_indexed(machine, 4) | (mame_rand(Machine) & 0x80 );
}
static WRITE16_HANDLER( pzlbowl_coin_counter_w )
@@ -770,12 +770,12 @@ ADDRESS_MAP_END
static READ16_HANDLER( samshoot_lightgun1_r )
{
-// popmessage("%02x %02x",readinputport(3),readinputport(2));
- return (readinputport(2) << 8) | readinputport(3);
+// popmessage("%02x %02x",input_port_read_indexed(machine, 3),input_port_read_indexed(machine, 2));
+ return (input_port_read_indexed(machine, 2) << 8) | input_port_read_indexed(machine, 3);
}
static READ16_HANDLER( samshoot_lightgun2_r )
{
- return (readinputport(4) << 8) | readinputport(5);
+ return (input_port_read_indexed(machine, 4) << 8) | input_port_read_indexed(machine, 5);
}
static WRITE16_HANDLER( samshoot_coin_w )
diff --git a/src/mame/drivers/sgladiat.c b/src/mame/drivers/sgladiat.c
index 0304acbef88..8fe06e9826f 100644
--- a/src/mame/drivers/sgladiat.c
+++ b/src/mame/drivers/sgladiat.c
@@ -83,7 +83,7 @@ static READ8_HANDLER( sgladiat_sound_nmi_ack_r )
static READ8_HANDLER( sgladiat_inp0_r )
{
- return(readinputportbytag("IN0") | snk_sound_busy_bit);
+ return(input_port_read(machine, "IN0") | snk_sound_busy_bit);
}
static WRITE8_HANDLER( sglatiat_flipscreen_w )
diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c
index 3d1b9c24685..d282058671d 100644
--- a/src/mame/drivers/shadfrce.c
+++ b/src/mame/drivers/shadfrce.c
@@ -191,16 +191,16 @@ static READ16_HANDLER( shadfrce_input_ports_r )
switch (offset)
{
case 0 :
- data = (readinputport(0) & 0xff) | ((readinputport(7) & 0xc0) << 6) | ((readinputport(4) & 0x0f) << 8);
+ data = (input_port_read_indexed(machine, 0) & 0xff) | ((input_port_read_indexed(machine, 7) & 0xc0) << 6) | ((input_port_read_indexed(machine, 4) & 0x0f) << 8);
break;
case 1 :
- data = (readinputport(1) & 0xff) | ((readinputport(7) & 0x3f) << 8);
+ data = (input_port_read_indexed(machine, 1) & 0xff) | ((input_port_read_indexed(machine, 7) & 0x3f) << 8);
break;
case 2 :
- data = (readinputport(2) & 0xff) | ((readinputport(6) & 0x3f) << 8);
+ data = (input_port_read_indexed(machine, 2) & 0xff) | ((input_port_read_indexed(machine, 6) & 0x3f) << 8);
break;
case 3 :
- data = (readinputport(3) & 0xff) | ((readinputport(6) & 0xc0) << 2) | ((readinputport(5) & 0x3c) << 8);
+ data = (input_port_read_indexed(machine, 3) & 0xff) | ((input_port_read_indexed(machine, 6) & 0xc0) << 2) | ((input_port_read_indexed(machine, 5) & 0x3c) << 8);
break;
}
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index e2f0aaa8aa6..da81b14d938 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -291,7 +291,7 @@ static INTERRUPT_GEN( shootout_interrupt )
{
static int coin = 0;
- if ( readinputport( 2 ) & 0xc0 ) {
+ if ( input_port_read_indexed(machine, 2 ) & 0xc0 ) {
if ( coin == 0 ) {
coin = 1;
nmi_line_pulse(machine, cpunum);
diff --git a/src/mame/drivers/shuuz.c b/src/mame/drivers/shuuz.c
index b6b68bfc8d8..4908f237d74 100644
--- a/src/mame/drivers/shuuz.c
+++ b/src/mame/drivers/shuuz.c
@@ -99,8 +99,8 @@ static READ16_HANDLER( leta_r )
/* when reading the even ports, do a real analog port update */
if (which == 0)
{
- int dx = (INT8)readinputport(2);
- int dy = (INT8)readinputport(3);
+ int dx = (INT8)input_port_read_indexed(machine, 2);
+ int dy = (INT8)input_port_read_indexed(machine, 3);
cur[0] = dx + dy;
cur[1] = dx - dy;
@@ -140,7 +140,7 @@ static WRITE16_HANDLER( adpcm_w )
static READ16_HANDLER( special_port0_r )
{
- int result = readinputport(0);
+ int result = input_port_read_indexed(machine, 0);
if ((result & 0x0800) && atarigen_get_hblank(machine->primary_screen))
result &= ~0x0800;
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index 8638cbbb6b7..6d4fd4198ce 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -79,7 +79,7 @@ static READ8_HANDLER( turtship_ports_r )
res = 0;
for (i = 0;i < 8;i++)
- res |= ((readinputport(i) >> offset) & 1) << i;
+ res |= ((input_port_read_indexed(machine, i) >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/silkroad.c b/src/mame/drivers/silkroad.c
index 37c222f73ef..447bce2fc23 100644
--- a/src/mame/drivers/silkroad.c
+++ b/src/mame/drivers/silkroad.c
@@ -148,13 +148,13 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
/* player inputs */
static READ32_HANDLER(io32_r)
{
- return ((readinputport(0) << 16) | (readinputport(1) << 0));
+ return ((input_port_read_indexed(machine, 0) << 16) | (input_port_read_indexed(machine, 1) << 0));
}
/* dipswitches */
static READ32_HANDLER(io32_1_r)
{
- return readinputport(2)<<16;
+ return input_port_read_indexed(machine, 2)<<16;
}
/* sound I/O */
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index faae2b2c90f..49bdd9eb4c8 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -141,7 +141,7 @@ static READ32_HANDLER( simpl156_inputs_read )
int eep = EEPROM_read_bit();
UINT32 returndata;
- returndata = readinputport(0)^0xffff0000;
+ returndata = input_port_read_indexed(machine, 0)^0xffff0000;
returndata^= ( (eep<<8) );
return returndata;
@@ -172,7 +172,7 @@ static READ32_HANDLER( simpl156_system_r )
{
UINT32 returndata;
- returndata = readinputport(1);
+ returndata = input_port_read_indexed(machine, 1);
return returndata;
}
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index ac6fc788a30..42645c15e6c 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -96,7 +96,7 @@ static MACHINE_RESET( skullxbo )
static READ16_HANDLER( special_port1_r )
{
- int temp = readinputport(1);
+ int temp = input_port_read_indexed(machine, 1);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0040;
if (atarigen_get_hblank(machine->primary_screen)) temp ^= 0x0010;
return temp;
diff --git a/src/mame/drivers/skyfox.c b/src/mame/drivers/skyfox.c
index 337cd278918..b465848ad00 100644
--- a/src/mame/drivers/skyfox.c
+++ b/src/mame/drivers/skyfox.c
@@ -248,7 +248,7 @@ static INTERRUPT_GEN( skyfox_interrupt )
skyfox_bg_pos += (skyfox_bg_ctrl >> 1) & 0x7; // maybe..
/* Check coin 1 & 2 */
- if ((readinputportbytag("IN4") & 3) != 3) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
+ if ((input_port_read(machine, "IN4") & 3) != 3) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_DRIVER_START( skyfox )
diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c
index a4202db16f2..a5f11717971 100644
--- a/src/mame/drivers/skykid.c
+++ b/src/mame/drivers/skykid.c
@@ -53,19 +53,19 @@ static READ8_HANDLER( inputport_r )
switch (inputport_selected)
{
case 0x00: /* DSW B (bits 0-4) */
- return (readinputport(1) & 0xf8) >> 3; break;
+ return (input_port_read_indexed(machine, 1) & 0xf8) >> 3; break;
case 0x01: /* DSW B (bits 5-7), DSW A (bits 0-1) */
- return ((readinputport(1) & 0x07) << 2) | ((readinputport(0) & 0xc0) >> 6); break;
+ return ((input_port_read_indexed(machine, 1) & 0x07) << 2) | ((input_port_read_indexed(machine, 0) & 0xc0) >> 6); break;
case 0x02: /* DSW A (bits 2-6) */
- return (readinputport(0) & 0x3e) >> 1; break;
+ return (input_port_read_indexed(machine, 0) & 0x3e) >> 1; break;
case 0x03: /* DSW A (bit 7), DSW C (bits 0-3) */
- return ((readinputport(0) & 0x01) << 4) | (readinputport(2) & 0x0f); break;
+ return ((input_port_read_indexed(machine, 0) & 0x01) << 4) | (input_port_read_indexed(machine, 2) & 0x0f); break;
case 0x04: /* coins, start */
- return readinputport(3); break;
+ return input_port_read_indexed(machine, 3); break;
case 0x05: /* 2P controls */
- return readinputport(5); break;
+ return input_port_read_indexed(machine, 5); break;
case 0x06: /* 1P controls */
- return readinputport(4); break;
+ return input_port_read_indexed(machine, 4); break;
default:
return 0xff;
}
diff --git a/src/mame/drivers/skyraid.c b/src/mame/drivers/skyraid.c
index c0a6a10268b..c6ad2a09a34 100644
--- a/src/mame/drivers/skyraid.c
+++ b/src/mame/drivers/skyraid.c
@@ -52,11 +52,11 @@ static READ8_HANDLER( skyraid_alpha_num_r)
static READ8_HANDLER( skyraid_port_0_r )
{
- UINT8 val = readinputport(0);
+ UINT8 val = input_port_read_indexed(machine, 0);
- if (readinputport(4) > analog_range)
+ if (input_port_read_indexed(machine, 4) > analog_range)
val |= 0x40;
- if (readinputport(5) > analog_range)
+ if (input_port_read_indexed(machine, 5) > analog_range)
val |= 0x80;
return val;
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index 1ec42519fff..4a318c4d954 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -212,7 +212,7 @@ static READ16_HANDLER( slapshot_service_input_r )
static READ16_HANDLER( opwolf3_adc_r )
{
- return readinputport(6 + offset)<<8;
+ return input_port_read_indexed(machine, 6 + offset)<<8;
}
static WRITE16_HANDLER( opwolf3_adc_req_w )
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index 0e3a1e20236..11211f9da3c 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -290,11 +290,11 @@ static int snk_sound_register;
/*********************************************************************/
-static int snk_rot( int which ){
+static int snk_rot( running_machine *machine, int which ){
static int last_value[2] = {0, 0};
static int cp_count[2] = {0, 0};
int bttn;
- int value = readinputport(which + 1);
+ int value = input_port_read_indexed(machine, which + 1);
/* For Guerilla War we add a 0xf0 value for 1 input read once every 8 rotations.
* 0xf0 isn't a valid direction, but avoids the "joystick error" protection
@@ -325,8 +325,8 @@ static int snk_input_port_r( running_machine *machine, int which ){
return value;
}
- case SNK_ROT_PLAYER1: return snk_rot( 0 );
- case SNK_ROT_PLAYER2: return snk_rot( 1 );
+ case SNK_ROT_PLAYER1: return snk_rot( machine, 0 );
+ case SNK_ROT_PLAYER2: return snk_rot( machine, 1 );
case SNK_INP1: return input_port_1_r(machine,0);
case SNK_INP2: return input_port_2_r(machine,0);
diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c
index 8a19a723f92..b6455c5c791 100644
--- a/src/mame/drivers/snk68.c
+++ b/src/mame/drivers/snk68.c
@@ -78,43 +78,43 @@ static READ16_HANDLER( pow_spriteram16_r )
static READ16_HANDLER( control_1_r )
{
- return (readinputportbytag("IN0") + (readinputportbytag("IN1") << 8));
+ return (input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
}
static READ16_HANDLER( control_2_r )
{
- return readinputportbytag("IN2");
+ return input_port_read(machine, "IN2");
}
static READ16_HANDLER( dip_1_r )
{
- return readinputportbytag("DSW1") << 8;
+ return input_port_read(machine, "DSW1") << 8;
}
static READ16_HANDLER( dip_2_r )
{
- return readinputportbytag("DSW2") << 8;
+ return input_port_read(machine, "DSW2") << 8;
}
static READ16_HANDLER( rotary_1_r )
{
- return (( ~(1 << readinputportbytag("ROT1")) )<<8)&0xff00;
+ return (( ~(1 << input_port_read(machine, "ROT1")) )<<8)&0xff00;
}
static READ16_HANDLER( rotary_2_r )
{
- return (( ~(1 << readinputportbytag("ROT2")) )<<8)&0xff00;
+ return (( ~(1 << input_port_read(machine, "ROT2")) )<<8)&0xff00;
}
static READ16_HANDLER( rotary_lsb_r )
{
- return ((( ~(1 << readinputportbytag("ROT2")) ) <<4)&0xf000)
- + ((( ~(1 << readinputportbytag("ROT1")) ) )&0x0f00);
+ return ((( ~(1 << input_port_read(machine, "ROT2")) ) <<4)&0xf000)
+ + ((( ~(1 << input_port_read(machine, "ROT1")) ) )&0x0f00);
}
static READ16_HANDLER( protcontrols_r )
{
- return readinputport(offset) ^ invert_controls;
+ return input_port_read_indexed(machine, offset) ^ invert_controls;
}
static WRITE16_HANDLER( protection_w )
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 3fbb6301134..0ac13ea3897 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -104,7 +104,7 @@ static int mcu63701_command;
static int inputs[4];
#if 0 // default - more sensitive (state change and timing measured on real board?)
-static void mcu63705_update_inputs(void)
+static void mcu63705_update_inputs(running_machine *machine)
{
static int running[2],jumped[2];
int buttons[2];
@@ -116,8 +116,8 @@ static void mcu63705_update_inputs(void)
static int prev[2][2],countup[2][2],countdown[2][2];
int curr[2][2];
- curr[p][0] = readinputport(2+p) & 0x01;
- curr[p][1] = readinputport(2+p) & 0x02;
+ curr[p][0] = input_port_read_indexed(machine, 2+p) & 0x01;
+ curr[p][1] = input_port_read_indexed(machine, 2+p) & 0x02;
for (j = 0;j <= 1;j++)
{
@@ -152,7 +152,7 @@ static void mcu63705_update_inputs(void)
static int prev[2];
int curr[2];
- curr[p] = readinputport(2+p) & 0x30;
+ curr[p] = input_port_read_indexed(machine, 2+p) & 0x30;
if (jumped[p]) buttons[p] = 0; /* jump only momentarily flips the buttons */
else buttons[p] = curr[p];
@@ -163,13 +163,13 @@ static void mcu63705_update_inputs(void)
prev[p] = curr[p];
}
- inputs[0] = readinputport(2) & 0xcf;
- inputs[1] = readinputport(3) & 0x0f;
+ inputs[0] = input_port_read_indexed(machine, 2) & 0xcf;
+ inputs[1] = input_port_read_indexed(machine, 3) & 0x0f;
inputs[2] = running[0] | buttons[0];
inputs[3] = running[1] | buttons[1];
}
#else // alternate - less sensitive
-static void mcu63705_update_inputs(void)
+static void mcu63705_update_inputs(running_machine *machine)
{
#define DBLTAP_TOLERANCE 5
@@ -187,7 +187,7 @@ static void mcu63705_update_inputs(void)
for (p=0; p<=1; p++)
{
- curr_port[p] = readinputport(p+2);
+ curr_port[p] = input_port_read_indexed(machine, p+2);
curr_dash[p] = 0;
if (curr_port[p] & R)
@@ -242,7 +242,7 @@ static READ8_HANDLER( mcu63701_r )
case 1: return inputs[1];
case 2: return inputs[2];
case 3: return inputs[3];
- case 4: return readinputport(4);
+ case 4: return input_port_read_indexed(machine, 4);
}
}
@@ -250,13 +250,13 @@ static WRITE8_HANDLER( mcu63701_w )
{
// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",activecpu_get_pc(),data);
mcu63701_command = data;
- mcu63705_update_inputs();
+ mcu63705_update_inputs(machine);
}
static READ8_HANDLER( port_0_r )
{
- int port = readinputport(0);
+ int port = input_port_read_indexed(machine, 0);
toggle^=0x02; /* mcu63701_busy flag */
diff --git a/src/mame/drivers/speedatk.c b/src/mame/drivers/speedatk.c
index 7ad89e87991..47f07099ada 100644
--- a/src/mame/drivers/speedatk.c
+++ b/src/mame/drivers/speedatk.c
@@ -96,7 +96,7 @@ static READ8_HANDLER( key_matrix_r )
{
case 0x02:
{
- switch(readinputport(1))
+ switch(input_port_read_indexed(machine, 1))
{
case 0x002: return 0x02;
case 0x001: return 0x01;
@@ -115,7 +115,7 @@ static READ8_HANDLER( key_matrix_r )
}
case 0x04:
{
- switch(readinputport(2))
+ switch(input_port_read_indexed(machine, 2))
{
case 0x002: return 0x02;
case 0x001: return 0x01;
diff --git a/src/mame/drivers/sprint2.c b/src/mame/drivers/sprint2.c
index deadd2a4a63..64c044a97c5 100644
--- a/src/mame/drivers/sprint2.c
+++ b/src/mame/drivers/sprint2.c
@@ -47,9 +47,9 @@ static DRIVER_INIT( dominos )
}
-static int service_mode(void)
+static int service_mode(running_machine *machine)
{
- UINT8 v = readinputport(2);
+ UINT8 v = input_port_read_indexed(machine, 2);
if (GAME_IS_SPRINT1)
{
@@ -80,7 +80,7 @@ static INTERRUPT_GEN( sprint2 )
for (i = 0; i < 2; i++)
{
- signed char delta = readinputport(6 + i) - dial[i];
+ signed char delta = input_port_read_indexed(machine, 6 + i) - dial[i];
if (delta < 0)
{
@@ -93,7 +93,7 @@ static INTERRUPT_GEN( sprint2 )
dial[i] += delta;
- switch (readinputport(4 + i) & 15)
+ switch (input_port_read_indexed(machine, 4 + i) & 15)
{
case 1: gear[i] = 1; break;
case 2: gear[i] = 2; break;
@@ -109,9 +109,9 @@ static INTERRUPT_GEN( sprint2 )
/* interrupts and watchdog are disabled during service mode */
- watchdog_enable(machine, !service_mode());
+ watchdog_enable(machine, !service_mode(machine));
- if (!service_mode())
+ if (!service_mode(machine))
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -124,13 +124,13 @@ static READ8_HANDLER( sprint2_wram_r )
static READ8_HANDLER( sprint2_dip_r )
{
- return (readinputport(0) << (2 * ((offset & 3) ^ 3))) & 0xc0;
+ return (input_port_read_indexed(machine, 0) << (2 * ((offset & 3) ^ 3))) & 0xc0;
}
static READ8_HANDLER( sprint2_input_A_r )
{
- UINT8 val = readinputport(1);
+ UINT8 val = input_port_read_indexed(machine, 1);
if (GAME_IS_SPRINT2)
{
@@ -148,7 +148,7 @@ static READ8_HANDLER( sprint2_input_A_r )
static READ8_HANDLER( sprint2_input_B_r )
{
- UINT8 val = readinputport(2);
+ UINT8 val = input_port_read_indexed(machine, 2);
if (GAME_IS_SPRINT1)
{
diff --git a/src/mame/drivers/sprint4.c b/src/mame/drivers/sprint4.c
index 2f7d7606e54..e51357f8156 100644
--- a/src/mame/drivers/sprint4.c
+++ b/src/mame/drivers/sprint4.c
@@ -66,17 +66,17 @@ static TIMER_CALLBACK( nmi_callback )
UINT8 wheel[4] =
{
- readinputportbytag("WHEEL1"),
- readinputportbytag("WHEEL2"),
- readinputportbytag("WHEEL3"),
- readinputportbytag("WHEEL4")
+ input_port_read(machine, "WHEEL1"),
+ input_port_read(machine, "WHEEL2"),
+ input_port_read(machine, "WHEEL3"),
+ input_port_read(machine, "WHEEL4")
};
UINT8 lever[4] =
{
- readinputportbytag("LEVER1"),
- readinputportbytag("LEVER2"),
- readinputportbytag("LEVER3"),
- readinputportbytag("LEVER4")
+ input_port_read(machine, "LEVER1"),
+ input_port_read(machine, "LEVER2"),
+ input_port_read(machine, "LEVER3"),
+ input_port_read(machine, "LEVER4")
};
int i;
@@ -115,9 +115,9 @@ static TIMER_CALLBACK( nmi_callback )
/* NMI and watchdog are disabled during service mode */
- watchdog_enable(machine, readinputport(0) & 0x40);
+ watchdog_enable(machine, input_port_read_indexed(machine, 0) & 0x40);
- if (readinputport(0) & 0x40)
+ if (input_port_read_indexed(machine, 0) & 0x40)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
timer_set(video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), NULL, scanline, nmi_callback);
@@ -148,21 +148,21 @@ static READ8_HANDLER( sprint4_wram_r )
static READ8_HANDLER( sprint4_analog_r )
{
- return (readinputportbytag("ANALOG") << (~offset & 7)) & 0x80;
+ return (input_port_read(machine, "ANALOG") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( sprint4_coin_r )
{
- return (readinputportbytag("COIN") << (~offset & 7)) & 0x80;
+ return (input_port_read(machine, "COIN") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( sprint4_collision_r )
{
- return (readinputportbytag("COLLISION") << (~offset & 7)) & 0x80;
+ return (input_port_read(machine, "COLLISION") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( sprint4_options_r )
{
- return (readinputportbytag("DIP") >> (2 * (offset & 3))) & 3;
+ return (input_port_read(machine, "DIP") >> (2 * (offset & 3))) & 3;
}
diff --git a/src/mame/drivers/sprint8.c b/src/mame/drivers/sprint8.c
index f9dce70d956..63d6d65d98a 100644
--- a/src/mame/drivers/sprint8.c
+++ b/src/mame/drivers/sprint8.c
@@ -34,7 +34,7 @@ static TIMER_CALLBACK( input_callback )
for (i = 0; i < 8; i++)
{
- UINT8 val = readinputport(8 + i) >> 4;
+ UINT8 val = input_port_read_indexed(machine, 8 + i) >> 4;
signed char delta = (val - dial[i]) & 15;
@@ -71,7 +71,7 @@ static READ8_HANDLER( sprint8_collision_r )
static READ8_HANDLER( sprint8_input_r )
{
- UINT8 val = readinputport(offset);
+ UINT8 val = input_port_read_indexed(machine, offset);
if (steer_dir[offset])
{
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index 9e0e286fafe..8c2b4542572 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -304,7 +304,7 @@ static READ16_HANDLER( srmp2_input_1_r )
for (t = 0 ; t < 8 ; t ++)
{
- if (!(readinputport(j) & ( 1 << t )))
+ if (!(input_port_read_indexed(machine, j) & ( 1 << t )))
{
return (i + t);
}
@@ -313,7 +313,7 @@ static READ16_HANDLER( srmp2_input_1_r )
}
else /* Analizer and memory reset keys */
{
- return readinputportbytag("IN7");
+ return input_port_read(machine, "IN7");
}
return 0xffff;
@@ -527,7 +527,7 @@ static READ8_HANDLER( srmp3_input_r )
for (t = 0 ; t < 8 ; t ++)
{
- if (!(readinputport(j) & ( 1 << t )))
+ if (!(input_port_read_indexed(machine, j) & ( 1 << t )))
{
keydata = (i + t);
}
@@ -540,7 +540,7 @@ static READ8_HANDLER( srmp3_input_r )
if ((activecpu_get_pc() == 0x8926) || (activecpu_get_pc() == 0x7822)) /* Analizer and memory reset keys */
{
- keydata = readinputport(7);
+ keydata = input_port_read_indexed(machine, 7);
}
return keydata;
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index 5e31d858243..db01b2e7601 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -348,14 +348,14 @@ static WRITE16_HANDLER( srmp6_input_select_w )
static READ16_HANDLER( srmp6_inputs_r )
{
if (offset == 0) // DSW
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
switch(srmp6_input_select) // inputs
{
- case 1<<0: return readinputport(0);
- case 1<<1: return readinputport(1);
- case 1<<2: return readinputport(2);
- case 1<<3: return readinputport(3);
+ case 1<<0: return input_port_read_indexed(machine, 0);
+ case 1<<1: return input_port_read_indexed(machine, 1);
+ case 1<<2: return input_port_read_indexed(machine, 2);
+ case 1<<3: return input_port_read_indexed(machine, 3);
}
return 0;
diff --git a/src/mame/drivers/ssf2md.c b/src/mame/drivers/ssf2md.c
index 2d67941b5c5..40c7b5334b2 100644
--- a/src/mame/drivers/ssf2md.c
+++ b/src/mame/drivers/ssf2md.c
@@ -13,7 +13,7 @@ ROM_END
static READ16_HANDLER( ssf2ghw_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return readinputportbytag(dswname[offset]);
+ return input_port_read(machine, dswname[offset]);
}
static DRIVER_INIT( ssf2ghw )
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 1ebea0519d2..eb911651f9e 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -99,11 +99,11 @@ static READ16_HANDLER( sshangha_protection16_r )
switch (offset)
{
case 0x050 >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 0x76a >> 1: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x0ac >> 1: /* DIPS */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
// Protection TODO
}
@@ -117,11 +117,11 @@ static READ16_HANDLER( sshanghb_protection16_r )
switch (offset)
{
case 0x050 >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 0x76a >> 1: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x0ac >> 1: /* DIPS */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
}
return sshangha_prot_data[offset];
}
diff --git a/src/mame/drivers/ssozumo.c b/src/mame/drivers/ssozumo.c
index ca4c9d9b84d..7b0f4601cdf 100644
--- a/src/mame/drivers/ssozumo.c
+++ b/src/mame/drivers/ssozumo.c
@@ -34,7 +34,7 @@ static INTERRUPT_GEN( ssozumo_interrupt )
{
static int coin;
- if ((readinputport(0) & 0xc0) != 0xc0)
+ if ((input_port_read_indexed(machine, 0) & 0xc0) != 0xc0)
{
if (coin == 0)
{
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 2d506971518..ef4e9dc0e91 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -491,7 +491,7 @@ static UINT16 *gdfs_blitram;
static READ16_HANDLER( gdfs_eeprom_r )
{
- return (((gdfs_lightgun_select & 1) ? 0 : 0xff) ^ readinputport(5 + gdfs_lightgun_select)) | (EEPROM_read_bit() << 8);
+ return (((gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read_indexed(machine, 5 + gdfs_lightgun_select)) | (EEPROM_read_bit() << 8);
}
static WRITE16_HANDLER( gdfs_eeprom_w )
@@ -644,10 +644,10 @@ ADDRESS_MAP_END
static READ16_HANDLER( hypreact_input_r )
{
UINT16 input_sel = *ssv_input_sel;
- if (input_sel & 0x0001) return readinputport(5);
- if (input_sel & 0x0002) return readinputport(6);
- if (input_sel & 0x0004) return readinputport(7);
- if (input_sel & 0x0008) return readinputport(8);
+ if (input_sel & 0x0001) return input_port_read_indexed(machine, 5);
+ if (input_sel & 0x0002) return input_port_read_indexed(machine, 6);
+ if (input_sel & 0x0004) return input_port_read_indexed(machine, 7);
+ if (input_sel & 0x0008) return input_port_read_indexed(machine, 8);
logerror("CPU #0 PC %06X: unknown input read: %04X\n",activecpu_get_pc(),input_sel);
return 0xffff;
}
@@ -792,10 +792,10 @@ ADDRESS_MAP_END
static READ16_HANDLER( srmp4_input_r )
{
UINT16 input_sel = *ssv_input_sel;
- if (input_sel & 0x0002) return readinputport(5);
- if (input_sel & 0x0004) return readinputport(6);
- if (input_sel & 0x0008) return readinputport(7);
- if (input_sel & 0x0010) return readinputport(8);
+ if (input_sel & 0x0002) return input_port_read_indexed(machine, 5);
+ if (input_sel & 0x0004) return input_port_read_indexed(machine, 6);
+ if (input_sel & 0x0008) return input_port_read_indexed(machine, 7);
+ if (input_sel & 0x0010) return input_port_read_indexed(machine, 8);
logerror("CPU #0 PC %06X: unknown input read: %04X\n",activecpu_get_pc(),input_sel);
return 0xffff;
}
@@ -841,10 +841,10 @@ static WRITE16_HANDLER( srmp7_sound_bank_w )
static READ16_HANDLER( srmp7_input_r )
{
UINT16 input_sel = *ssv_input_sel;
- if (input_sel & 0x0002) return readinputport(5);
- if (input_sel & 0x0004) return readinputport(6);
- if (input_sel & 0x0008) return readinputport(7);
- if (input_sel & 0x0010) return readinputport(8);
+ if (input_sel & 0x0002) return input_port_read_indexed(machine, 5);
+ if (input_sel & 0x0004) return input_port_read_indexed(machine, 6);
+ if (input_sel & 0x0008) return input_port_read_indexed(machine, 7);
+ if (input_sel & 0x0010) return input_port_read_indexed(machine, 8);
logerror("CPU #0 PC %06X: unknown input read: %04X\n",activecpu_get_pc(),input_sel);
return 0xffff;
}
@@ -898,7 +898,7 @@ static UINT16 serial;
static READ16_HANDLER( sxyreact_ballswitch_r )
{
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
}
static READ16_HANDLER( sxyreact_dial_r )
@@ -913,7 +913,7 @@ static WRITE16_HANDLER( sxyreact_dial_w )
static int old;
if (data & 0x20)
- serial = readinputport(6) & 0xff;
+ serial = input_port_read_indexed(machine, 6) & 0xff;
if ( (old & 0x40) && !(data & 0x40) ) // $40 -> $00
serial <<= 1; // shift 1 bit
@@ -1071,11 +1071,11 @@ static READ16_HANDLER( eaglshot_trackball_r )
{
switch(trackball_select)
{
- case 0x60: return (readinputport(5) >> 8) & 0xff;
- case 0x40: return (readinputport(5) >> 0) & 0xff;
+ case 0x60: return (input_port_read_indexed(machine, 5) >> 8) & 0xff;
+ case 0x40: return (input_port_read_indexed(machine, 5) >> 0) & 0xff;
- case 0x70: return (readinputport(6) >> 8) & 0xff;
- case 0x50: return (readinputport(6) >> 0) & 0xff;
+ case 0x70: return (input_port_read_indexed(machine, 6) >> 8) & 0xff;
+ case 0x50: return (input_port_read_indexed(machine, 6) >> 0) & 0xff;
}
return 0;
}
diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c
index cca5b789ab2..74f6fbebb82 100644
--- a/src/mame/drivers/stactics.c
+++ b/src/mame/drivers/stactics.c
@@ -78,13 +78,13 @@ static READ8_HANDLER( horiz_pos_r )
}
-static void move_motor(stactics_state *state)
+static void move_motor(running_machine *machine, stactics_state *state)
{
/* monitor motor under joystick control */
if (*state->motor_on & 0x01)
{
- int ip3 = readinputport(3);
- int ip4 = readinputport(4);
+ int ip3 = input_port_read_indexed(machine, 3);
+ int ip4 = input_port_read_indexed(machine, 4);
/* up */
if (((ip4 & 0x01) == 0) && (state->vert_pos > -128))
@@ -157,7 +157,7 @@ static INTERRUPT_GEN( stactics_interrupt )
{
stactics_state *state = machine->driver_data;
- move_motor(state);
+ move_motor(machine, state);
cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
}
diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c
index 6e568968b8b..25bade84089 100644
--- a/src/mame/drivers/stadhero.c
+++ b/src/mame/drivers/stadhero.c
@@ -32,13 +32,13 @@ static READ16_HANDLER( stadhero_control_r )
switch (offset<<1)
{
case 0: /* Player 1 & 2 joystick & buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Credits, start buttons */
- return readinputport(2) | (readinputport(2)<<8);
+ return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 2)<<8);
case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",activecpu_get_pc(),0x30c000+offset);
diff --git a/src/mame/drivers/starshp1.c b/src/mame/drivers/starshp1.c
index a2edc3c620f..1555d89aa5b 100644
--- a/src/mame/drivers/starshp1.c
+++ b/src/mame/drivers/starshp1.c
@@ -17,7 +17,7 @@ static int starshp1_analog_in_select;
static INTERRUPT_GEN( starshp1_interrupt )
{
- if ((readinputport(0) & 0x90) != 0x90)
+ if ((input_port_read_indexed(machine, 0) & 0x90) != 0x90)
cpunum_set_input_line(machine, 0, 0, PULSE_LINE);
}
@@ -69,26 +69,26 @@ static READ8_HANDLER( starshp1_port_1_r )
switch (starshp1_analog_in_select)
{
case 0:
- val = readinputport(4);
+ val = input_port_read_indexed(machine, 4);
break;
case 1:
- val = readinputport(5);
+ val = input_port_read_indexed(machine, 5);
break;
case 2:
val = 0x20; /* DAC feedback, not used */
break;
case 3:
- val = readinputport(3);
+ val = input_port_read_indexed(machine, 3);
break;
}
- return (val & 0x3f) | readinputport(1);
+ return (val & 0x3f) | input_port_read_indexed(machine, 1);
}
static READ8_HANDLER( starshp1_port_2_r )
{
- return readinputport(2) | (starshp1_collision_latch & 0x0f);
+ return input_port_read_indexed(machine, 2) | (starshp1_collision_latch & 0x0f);
}
diff --git a/src/mame/drivers/stlforce.c b/src/mame/drivers/stlforce.c
index c18667402c2..54706ca2c29 100644
--- a/src/mame/drivers/stlforce.c
+++ b/src/mame/drivers/stlforce.c
@@ -86,7 +86,7 @@ WRITE16_HANDLER( stlforce_bg_videoram_w );
static READ16_HANDLER( stlforce_input_port_1_r )
{
- return (readinputport(1) & ~0x40) | (EEPROM_read_bit() << 6);
+ return (input_port_read_indexed(machine, 1) & ~0x40) | (EEPROM_read_bit() << 6);
}
static WRITE16_HANDLER( eeprom_w )
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 7958532fa8b..79df6cdd2c7 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -507,7 +507,7 @@ static void system_reset()
/*Order is surely wrong but whatever...*/
}
-static UINT8 stv_SMPC_r8 (int offset)
+static UINT8 stv_SMPC_r8 (running_machine *machine, int offset)
{
int return_data;
@@ -518,13 +518,13 @@ static UINT8 stv_SMPC_r8 (int offset)
return_data = 0x20 ^ 0xff;
if (offset == 0x75)//PDR1 read
- return_data = readinputport(0);
+ return_data = input_port_read_indexed(machine, 0);
if (offset == 0x77)//PDR2 read
return_data= (0xfe | EEPROM_read_bit());
// if (offset == 0x33) //country code
-// return_data = readinputport(7);
+// return_data = input_port_read_indexed(machine, 7);
if (activecpu_get_pc()==0x060020E6) return_data = 0x10;//???
@@ -683,7 +683,7 @@ static void stv_SMPC_w8 (running_machine *machine, int offset, UINT8 data)
smpc_ram[0x31]=0x00; //?
- //smpc_ram[0x33]=readinputport(7);
+ //smpc_ram[0x33]=input_port_read_indexed(machine, 7);
smpc_ram[0x35]=0x00;
smpc_ram[0x37]=0x00;
@@ -769,10 +769,10 @@ static READ32_HANDLER ( stv_SMPC_r32 )
/* registers are all byte accesses, convert here */
offset = offset << 2; // multiply offset by 4
- if (ACCESSING_BITS_24_31) { byte = 0; readdata = stv_SMPC_r8(offset+byte) << 24; }
- if (ACCESSING_BITS_16_23) { byte = 1; readdata = stv_SMPC_r8(offset+byte) << 16; }
- if (ACCESSING_BITS_8_15) { byte = 2; readdata = stv_SMPC_r8(offset+byte) << 8; }
- if (ACCESSING_BITS_0_7) { byte = 3; readdata = stv_SMPC_r8(offset+byte) << 0; }
+ if (ACCESSING_BITS_24_31) { byte = 0; readdata = stv_SMPC_r8(machine, offset+byte) << 24; }
+ if (ACCESSING_BITS_16_23) { byte = 1; readdata = stv_SMPC_r8(machine, offset+byte) << 16; }
+ if (ACCESSING_BITS_8_15) { byte = 2; readdata = stv_SMPC_r8(machine, offset+byte) << 8; }
+ if (ACCESSING_BITS_0_7) { byte = 3; readdata = stv_SMPC_r8(machine, offset+byte) << 0; }
return readdata;
}
@@ -952,21 +952,21 @@ static READ32_HANDLER ( stv_io_r32 )
case 0:
switch(port_sel)
{
- case 0x77: return 0xff000000|(readinputport(2) << 16) |0x0000ff00|(readinputport(3));
+ case 0x77: return 0xff000000|(input_port_read_indexed(machine, 2) << 16) |0x0000ff00|(input_port_read_indexed(machine, 3));
case 0x67:
{
switch(mux_data)
{
/*Mahjong panel interface,bit wise(ACTIVE LOW)*/
- case 0xfe: return 0xff000000 | (readinputport(7) << 16) | 0x0000ff00 | (readinputport(12));
- case 0xfd: return 0xff000000 | (readinputport(8) << 16) | 0x0000ff00 | (readinputport(13));
- case 0xfb: return 0xff000000 | (readinputport(9) << 16) | 0x0000ff00 | (readinputport(14));
- case 0xf7: return 0xff000000 | (readinputport(10) << 16) | 0x0000ff00 | (readinputport(15));
- case 0xef: return 0xff000000 | (readinputport(11) << 16) | 0x0000ff00 | (readinputport(16));
+ case 0xfe: return 0xff000000 | (input_port_read_indexed(machine, 7) << 16) | 0x0000ff00 | (input_port_read_indexed(machine, 12));
+ case 0xfd: return 0xff000000 | (input_port_read_indexed(machine, 8) << 16) | 0x0000ff00 | (input_port_read_indexed(machine, 13));
+ case 0xfb: return 0xff000000 | (input_port_read_indexed(machine, 9) << 16) | 0x0000ff00 | (input_port_read_indexed(machine, 14));
+ case 0xf7: return 0xff000000 | (input_port_read_indexed(machine, 10) << 16) | 0x0000ff00 | (input_port_read_indexed(machine, 15));
+ case 0xef: return 0xff000000 | (input_port_read_indexed(machine, 11) << 16) | 0x0000ff00 | (input_port_read_indexed(machine, 16));
/*Joystick panel*/
default:
//popmessage("%02x MUX DATA",mux_data);
- return (readinputport(2) << 16) | (readinputport(3));
+ return (input_port_read_indexed(machine, 2) << 16) | (input_port_read_indexed(machine, 3));
}
}
case 0x47:
@@ -976,12 +976,12 @@ static READ32_HANDLER ( stv_io_r32 )
int data1 = 0, data2 = 0;
/* Critter Crusher */
- data1 = readinputport(7);
+ data1 = input_port_read_indexed(machine, 7);
data1 = BITSWAP8(data1, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
- data1 |= (readinputport(2) & 1) ? 0x0 : 0x4;
- data2 = readinputport(8);
+ data1 |= (input_port_read_indexed(machine, 2) & 1) ? 0x0 : 0x4;
+ data2 = input_port_read_indexed(machine, 8);
data2 = BITSWAP8(data2, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
- data2 |= (readinputport(2) & 1) ? 0x0 : 0x4;
+ data2 |= (input_port_read_indexed(machine, 2) & 1) ? 0x0 : 0x4;
return 0xff000000 | data1 << 16 | 0x0000ff00 | data2;
}
@@ -989,21 +989,21 @@ static READ32_HANDLER ( stv_io_r32 )
//default:
default:
//popmessage("%02x PORT SEL",port_sel);
- return (readinputport(2) << 16) | (readinputport(3));
+ return (input_port_read_indexed(machine, 2) << 16) | (input_port_read_indexed(machine, 3));
}
case 1:
if ( strcmp(machine->gamedrv->name,"critcrsh") == 0 )
{
- return ((readinputport(4) << 16) & ((readinputport(2) & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
+ return ((input_port_read_indexed(machine, 4) << 16) & ((input_port_read_indexed(machine, 2) & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
}
else
{
- return (readinputport(4) << 16) | (ioga[1]);
+ return (input_port_read_indexed(machine, 4) << 16) | (ioga[1]);
}
case 2:
switch(port_sel)
{
- case 0x77: return (readinputport(5) << 16) | (readinputport(6));
+ case 0x77: return (input_port_read_indexed(machine, 5) << 16) | (input_port_read_indexed(machine, 6));
case 0x67: return 0xffffffff;/**/
case 0x20: return 0xffff0000 | (ioga[2] & 0xffff);
case 0x10: return ((ioga[2] & 0xffff) << 16) | 0xffff;
@@ -2521,7 +2521,7 @@ DRIVER_INIT ( stv )
smpc_ram[0x2d] = DectoBCD(systime.local_time.minute);
smpc_ram[0x2f] = DectoBCD(systime.local_time.second);
smpc_ram[0x31] = 0x00; //CTG1=0 CTG0=0 (correct??)
-// smpc_ram[0x33] = readinputport(7);
+// smpc_ram[0x33] = input_port_read_indexed(machine, 7);
smpc_ram[0x5f] = 0x10;
#ifdef MAME_DEBUG
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index e5ea7f2e048..abcbb1f0ff7 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -490,10 +490,10 @@ static READ8_HANDLER( hardhead_ip_r )
{
switch (*hardhead_ip)
{
- case 0: return readinputport(0);
- case 1: return readinputport(1);
- case 2: return readinputport(2);
- case 3: return readinputport(3);
+ case 0: return input_port_read_indexed(machine, 0);
+ case 1: return input_port_read_indexed(machine, 1);
+ case 2: return input_port_read_indexed(machine, 2);
+ case 3: return input_port_read_indexed(machine, 3);
default:
logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n",activecpu_get_pc(),*hardhead_ip);
return 0xff;
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index 1f762c1a4ed..582b24e4189 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -37,11 +37,11 @@ static READ16_HANDLER( supbtime_controls_r )
switch (offset<<1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Dips */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 8: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 10: /* ? Not used for anything */
case 12:
return 0;
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 2b0c3076c83..3a8099312cb 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -195,7 +195,7 @@ static int from_mcu_pending, from_z80_pending, invert_coin_lockout;
static READ8_HANDLER( in4_mcu_r )
{
// logerror("%04x: in4_mcu_r\n",activecpu_get_pc());
- return readinputport(4) | (from_mcu_pending << 6) | (from_z80_pending << 7);
+ return input_port_read_indexed(machine, 4) | (from_mcu_pending << 6) | (from_z80_pending << 7);
}
static READ8_HANDLER( sqix_from_mcu_r )
@@ -268,11 +268,11 @@ static READ8_HANDLER( mcu_p3_r )
{
if ((port1 & 0x10) == 0)
{
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
else if ((port1 & 0x20) == 0)
{
- return readinputport(2) | (from_mcu_pending << 6) | (from_z80_pending << 7);
+ return input_port_read_indexed(machine, 2) | (from_mcu_pending << 6) | (from_z80_pending << 7);
}
else if ((port1 & 0x40) == 0)
{
@@ -297,7 +297,7 @@ static READ8_HANDLER( nmi_ack_r )
static READ8_HANDLER( bootleg_in0_r )
{
- return BITSWAP8(readinputport(0), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(input_port_read_indexed(machine, 0), 0,1,2,3,4,5,6,7);
}
static WRITE8_HANDLER( bootleg_flipscreen_w )
@@ -318,14 +318,14 @@ static WRITE8_HANDLER( bootleg_flipscreen_w )
* connected to the 68705 which acts as a counter.
*/
-static int read_dial(int player)
+static int read_dial(running_machine *machine, int player)
{
int newpos;
static int oldpos[2];
static int sign[2];
/* get the new position and adjust the result */
- newpos = readinputport(3 + player);
+ newpos = input_port_read_indexed(machine, 3 + player);
if (newpos != oldpos[player])
{
sign[player] = ((newpos - oldpos[player]) & 0x80) >> 7;
@@ -401,11 +401,11 @@ static WRITE8_HANDLER( hotsmash_68705_portC_w )
switch (data & 0x07)
{
case 0x0: // dsw A
- portA_in = readinputport(0);
+ portA_in = input_port_read_indexed(machine, 0);
break;
case 0x1: // dsw B
- portA_in = readinputport(1);
+ portA_in = input_port_read_indexed(machine, 1);
break;
case 0x2:
@@ -424,11 +424,11 @@ logerror("%04x: z80 reads command %02x\n",activecpu_get_pc(),from_z80);
break;
case 0x6:
- portA_in = read_dial(0);
+ portA_in = read_dial(machine, 0);
break;
case 0x7:
- portA_in = read_dial(1);
+ portA_in = read_dial(machine, 1);
break;
}
}
@@ -449,7 +449,7 @@ logerror("%04x: z80 reads answer %02x\n",activecpu_get_pc(),from_mcu);
static READ8_HANDLER(hotsmash_ay_port_a_r)
{
//logerror("%04x: ay_port_a_r and mcu_pending is %d\n",activecpu_get_pc(),from_mcu_pending);
- return readinputport(2) | ((from_mcu_pending^1) << 7);
+ return input_port_read_indexed(machine, 2) | ((from_mcu_pending^1) << 7);
}
/**************************************************************************
@@ -469,10 +469,10 @@ static READ8_HANDLER(pbillian_from_mcu_r)
switch (from_z80)
{
- case 0x01: return readinputport(4 + 2 * curr_player);
- case 0x02: return readinputport(5 + 2 * curr_player);
- case 0x04: return readinputport(0);
- case 0x08: return readinputport(1);
+ case 0x01: return input_port_read_indexed(machine, 4 + 2 * curr_player);
+ case 0x02: return input_port_read_indexed(machine, 5 + 2 * curr_player);
+ case 0x04: return input_port_read_indexed(machine, 0);
+ case 0x08: return input_port_read_indexed(machine, 1);
case 0x80: curr_player = 0; return 0;
case 0x81: curr_player = 1; return 0;
}
@@ -485,7 +485,7 @@ static READ8_HANDLER(pbillian_ay_port_a_r)
{
// logerror("%04x: ay_port_a_r\n",activecpu_get_pc());
/* bits 76------ MCU status bits */
- return (mame_rand(Machine)&0xc0)|readinputport(3);
+ return (mame_rand(Machine)&0xc0)|input_port_read_indexed(machine, 3);
}
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index 515043ec5a5..420337918cd 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -702,17 +702,17 @@ INPUT_PORTS_END
static READ32_HANDLER( nova_input_port_0_r )
{
- return readinputport(0)<<24 | readinputport(1)<<16 | readinputport(2)<<8 | readinputport(3);
+ return input_port_read_indexed(machine, 0)<<24 | input_port_read_indexed(machine, 1)<<16 | input_port_read_indexed(machine, 2)<<8 | input_port_read_indexed(machine, 3);
}
static READ32_HANDLER( nova_input_port_3_r )
{
- return readinputport(8) | 0xffffff00;
+ return input_port_read_indexed(machine, 8) | 0xffffff00;
}
static READ32_HANDLER( nova_input_port_dip_r )
{
- return readinputport(4)<<24 | readinputport(5)<<16 | readinputport(6)<<8 | readinputport(7);
+ return input_port_read_indexed(machine, 4)<<24 | input_port_read_indexed(machine, 5)<<16 | input_port_read_indexed(machine, 6)<<8 | input_port_read_indexed(machine, 7);
}
static UINT32 timer_0_temp[4];
diff --git a/src/mame/drivers/suprridr.c b/src/mame/drivers/suprridr.c
index 22cda53506a..6f9b7b55dcb 100644
--- a/src/mame/drivers/suprridr.c
+++ b/src/mame/drivers/suprridr.c
@@ -229,9 +229,9 @@ static CUSTOM_INPUT( suprridr_control_r )
/* screen flip multiplexes controls */
if (suprridr_is_screen_flipped())
- ret = readinputportbytag(SUPRRIDR_P2_CONTROL_PORT_TAG);
+ ret = input_port_read(machine, SUPRRIDR_P2_CONTROL_PORT_TAG);
else
- ret = readinputportbytag(SUPRRIDR_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(machine, SUPRRIDR_P1_CONTROL_PORT_TAG);
return ret;
}
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 8358ec29fc8..b5082cca308 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -1201,7 +1201,7 @@ MACHINE_DRIVER_END
/***************************************************************************/
static READ16_HANDLER( ga_io_players_r ) {
- return (readinputport(0) << 8) | readinputport(1);
+ return (input_port_read_indexed(machine, 0) << 8) | input_port_read_indexed(machine, 1);
}
static READ16_HANDLER( ga_io_service_r )
{
@@ -1401,35 +1401,35 @@ static int passht4b_io3_val;
static READ16_HANDLER( passht4b_service_r )
{
UINT16 val=input_port_2_word_r(machine,offset,0);
- if(!(readinputport(0) & 0x40)) val&=0xef;
- if(!(readinputport(1) & 0x40)) val&=0xdf;
- if(!(readinputport(5) & 0x40)) val&=0xbf;
- if(!(readinputport(6) & 0x40)) val&=0x7f;
+ if(!(input_port_read_indexed(machine, 0) & 0x40)) val&=0xef;
+ if(!(input_port_read_indexed(machine, 1) & 0x40)) val&=0xdf;
+ if(!(input_port_read_indexed(machine, 5) & 0x40)) val&=0xbf;
+ if(!(input_port_read_indexed(machine, 6) & 0x40)) val&=0x7f;
- passht4b_io3_val=(readinputport(0)<<4) | (readinputport(5)&0xf);
- passht4b_io2_val=(readinputport(1)<<4) | (readinputport(6)&0xf);
+ passht4b_io3_val=(input_port_read_indexed(machine, 0)<<4) | (input_port_read_indexed(machine, 5)&0xf);
+ passht4b_io2_val=(input_port_read_indexed(machine, 1)<<4) | (input_port_read_indexed(machine, 6)&0xf);
passht4b_io1_val=0xff;
// player 1 buttons
- if(!(readinputport(0) & 0x10)) passht4b_io1_val &=0xfe;
- if(!(readinputport(0) & 0x20)) passht4b_io1_val &=0xfd;
- if(!(readinputport(0) & 0x80)) passht4b_io1_val &=0xfc;
+ if(!(input_port_read_indexed(machine, 0) & 0x10)) passht4b_io1_val &=0xfe;
+ if(!(input_port_read_indexed(machine, 0) & 0x20)) passht4b_io1_val &=0xfd;
+ if(!(input_port_read_indexed(machine, 0) & 0x80)) passht4b_io1_val &=0xfc;
// player 2 buttons
- if(!(readinputport(1) & 0x10)) passht4b_io1_val &=0xfb;
- if(!(readinputport(1) & 0x20)) passht4b_io1_val &=0xf7;
- if(!(readinputport(1) & 0x80)) passht4b_io1_val &=0xf3;
+ if(!(input_port_read_indexed(machine, 1) & 0x10)) passht4b_io1_val &=0xfb;
+ if(!(input_port_read_indexed(machine, 1) & 0x20)) passht4b_io1_val &=0xf7;
+ if(!(input_port_read_indexed(machine, 1) & 0x80)) passht4b_io1_val &=0xf3;
// player 3 buttons
- if(!(readinputport(5) & 0x10)) passht4b_io1_val &=0xef;
- if(!(readinputport(5) & 0x20)) passht4b_io1_val &=0xdf;
- if(!(readinputport(5) & 0x80)) passht4b_io1_val &=0xcf;
+ if(!(input_port_read_indexed(machine, 5) & 0x10)) passht4b_io1_val &=0xef;
+ if(!(input_port_read_indexed(machine, 5) & 0x20)) passht4b_io1_val &=0xdf;
+ if(!(input_port_read_indexed(machine, 5) & 0x80)) passht4b_io1_val &=0xcf;
// player 4 buttons
- if(!(readinputport(6) & 0x10)) passht4b_io1_val &=0xbf;
- if(!(readinputport(6) & 0x20)) passht4b_io1_val &=0x7f;
- if(!(readinputport(6) & 0x80)) passht4b_io1_val &=0x3f;
+ if(!(input_port_read_indexed(machine, 6) & 0x10)) passht4b_io1_val &=0xbf;
+ if(!(input_port_read_indexed(machine, 6) & 0x20)) passht4b_io1_val &=0x7f;
+ if(!(input_port_read_indexed(machine, 6) & 0x80)) passht4b_io1_val &=0x3f;
return val;
}
diff --git a/src/mame/drivers/system18.c b/src/mame/drivers/system18.c
index 87dfe460a8b..9c8b60d1791 100644
--- a/src/mame/drivers/system18.c
+++ b/src/mame/drivers/system18.c
@@ -490,14 +490,14 @@ static READ16_HANDLER( sys18_io_r )
if(io_reg[0x0F] & 0x01)
return io_reg[0x00];
else
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
break;
case 0x01: /* Port B - 2P controls */
if(io_reg[0x0F] & 0x02)
return io_reg[0x01];
else
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
break;
case 0x02: /* Port C - Bidirectional I/O port */
@@ -518,21 +518,21 @@ static READ16_HANDLER( sys18_io_r )
if(io_reg[0x0F] & 0x10)
return io_reg[0x04];
else
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
break;
case 0x05: /* Port F - DIP switch #1 */
if(io_reg[0x0F] & 0x20)
return io_reg[0x05];
else
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
break;
case 0x06: /* Port G - DIP switch #2 */
if(io_reg[0x0F] & 0x40)
return io_reg[0x06];
else
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
break;
case 0x07: /* Port H - Tile banking control */
diff --git a/src/mame/drivers/tagteam.c b/src/mame/drivers/tagteam.c
index 26b0ac0e861..7727dd355c2 100644
--- a/src/mame/drivers/tagteam.c
+++ b/src/mame/drivers/tagteam.c
@@ -100,7 +100,7 @@ static INTERRUPT_GEN( tagteam_interrupt )
static int coin;
int port;
- port = readinputportbytag("IN0") & 0xc0;
+ port = input_port_read(machine, "IN0") & 0xc0;
if (port != 0xc0) /* Coin */
{
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index 502967be37a..0cdd841154d 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -58,23 +58,23 @@ static READ32_HANDLER( f3_control_r )
case 0x0: /* MSW: Test switch, coins, eeprom access, LSW: Player Buttons, Start, Tilt, Service */
e=EEPROM_read_bit();
e=e|(e<<8);
- return ((e | readinputport(2) | (readinputport(2)<<8))<<16) /* top byte may be mirror of bottom byte?? see bubblem */
- | readinputport(1);
+ return ((e | input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 2)<<8))<<16) /* top byte may be mirror of bottom byte?? see bubblem */
+ | input_port_read_indexed(machine, 1);
case 0x1: /* MSW: Coin counters/lockouts are readable, LSW: Joysticks (Player 1 & 2) */
- return (coin_word[0]<<16) | readinputport(0) | 0xff00;
+ return (coin_word[0]<<16) | input_port_read_indexed(machine, 0) | 0xff00;
case 0x2: /* Analog control 1 */
- return ((readinputport(3)&0xf)<<12) | ((readinputport(3)&0xff0)>>4);
+ return ((input_port_read_indexed(machine, 3)&0xf)<<12) | ((input_port_read_indexed(machine, 3)&0xff0)>>4);
case 0x3: /* Analog control 2 */
- return ((readinputport(4)&0xf)<<12) | ((readinputport(4)&0xff0)>>4);
+ return ((input_port_read_indexed(machine, 4)&0xf)<<12) | ((input_port_read_indexed(machine, 4)&0xff0)>>4);
case 0x4: /* Player 3 & 4 fire buttons (Player 2 top fire buttons in Kaiser Knuckle) */
- return readinputport(5)<<8;
+ return input_port_read_indexed(machine, 5)<<8;
case 0x5: /* Player 3 & 4 joysticks (Player 1 top fire buttons in Kaiser Knuckle) */
- return (coin_word[1]<<16) | readinputport(6);
+ return (coin_word[1]<<16) | input_port_read_indexed(machine, 6);
}
logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",activecpu_get_pc(),offset);
diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c
index 0461a705a91..af19b78520d 100644
--- a/src/mame/drivers/taito_h.c
+++ b/src/mame/drivers/taito_h.c
@@ -205,37 +205,37 @@ static READ16_HANDLER( syvalion_input_bypass_r )
switch( port )
{
case 0x08: /* trackball y coords bottom 8 bits for 2nd player */
- return readinputportbytag(P2TRACKY_PORT_TAG);
+ return input_port_read(machine, P2TRACKY_PORT_TAG);
case 0x09: /* trackball y coords top 8 bits for 2nd player */
- if (readinputportbytag(P2TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
+ if (input_port_read(machine, P2TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
return 0xff;
else /* y+ direction (positive value) */
return 0x00;
case 0x0a: /* trackball x coords bottom 8 bits for 2nd player */
- return readinputportbytag(P2TRACKX_PORT_TAG);
+ return input_port_read(machine, P2TRACKX_PORT_TAG);
case 0x0b: /* trackball x coords top 8 bits for 2nd player */
- if (readinputportbytag(P2TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
+ if (input_port_read(machine, P2TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
return 0xff;
else /* x+ direction (positive value) */
return 0x00;
case 0x0c: /* trackball y coords bottom 8 bits for 1st player */
- return readinputportbytag(P1TRACKY_PORT_TAG);
+ return input_port_read(machine, P1TRACKY_PORT_TAG);
case 0x0d: /* trackball y coords top 8 bits for 1st player */
- if (readinputportbytag(P1TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
+ if (input_port_read(machine, P1TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
return 0xff;
else /* y+ direction (positive value) */
return 0x00;
case 0x0e: /* trackball x coords bottom 8 bits for 1st player */
- return readinputportbytag(P1TRACKX_PORT_TAG);
+ return input_port_read(machine, P1TRACKX_PORT_TAG);
case 0x0f: /* trackball x coords top 8 bits for 1st player */
- if (readinputportbytag(P1TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
+ if (input_port_read(machine, P1TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
return 0xff;
else /* x+ direction (positive value) */
return 0x00;
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 4f351a6a6f2..424d1ac73e3 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -620,35 +620,35 @@ static int trackx,tracky;
static READ8_HANDLER( horshoes_tracky_reset_r )
{
/* reset the trackball counter */
- tracky = readinputportbytag("AN0");
+ tracky = input_port_read(machine, "AN0");
return 0;
}
static READ8_HANDLER( horshoes_trackx_reset_r )
{
/* reset the trackball counter */
- trackx = readinputportbytag("AN1");
+ trackx = input_port_read(machine, "AN1");
return 0;
}
static READ8_HANDLER( horshoes_tracky_lo_r )
{
- return (readinputportbytag("AN0") - tracky) & 0xff;
+ return (input_port_read(machine, "AN0") - tracky) & 0xff;
}
static READ8_HANDLER( horshoes_tracky_hi_r )
{
- return (readinputportbytag("AN0") - tracky) >> 8;
+ return (input_port_read(machine, "AN0") - tracky) >> 8;
}
static READ8_HANDLER( horshoes_trackx_lo_r )
{
- return (readinputportbytag("AN1") - trackx) & 0xff;
+ return (input_port_read(machine, "AN1") - trackx) & 0xff;
}
static READ8_HANDLER( horshoes_trackx_hi_r )
{
- return (readinputportbytag("AN1") - trackx) >> 8;
+ return (input_port_read(machine, "AN1") - trackx) >> 8;
}
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index 99275b60821..0bae4bf737a 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -332,13 +332,13 @@ static READ16_HANDLER( superman_dsw_input_r )
switch (offset)
{
case 0x00:
- return readinputportbytag("DSWA") & 0x0f;
+ return input_port_read(machine, "DSWA") & 0x0f;
case 0x01:
- return (readinputportbytag("DSWA") & 0xf0) >> 4;
+ return (input_port_read(machine, "DSWA") & 0xf0) >> 4;
case 0x02:
- return readinputportbytag("DSWB") & 0x0f;
+ return input_port_read(machine, "DSWB") & 0x0f;
case 0x03:
- return (readinputportbytag("DSWB") & 0xf0) >> 4;
+ return (input_port_read(machine, "DSWB") & 0xf0) >> 4;
default:
logerror("taitox unknown dsw read offset: %04x\n", offset);
return 0x00;
@@ -350,11 +350,11 @@ static READ16_HANDLER( daisenpu_input_r )
switch (offset)
{
case 0x00:
- return readinputportbytag("IN0"); /* Player 1 controls + START1 */
+ return input_port_read(machine, "IN0"); /* Player 1 controls + START1 */
case 0x01:
- return readinputportbytag("IN1"); /* Player 2 controls + START2 */
+ return input_port_read(machine, "IN1"); /* Player 2 controls + START2 */
case 0x02:
- return readinputportbytag("IN2"); /* COINn + SERVICE1 + TILT */
+ return input_port_read(machine, "IN2"); /* COINn + SERVICE1 + TILT */
default:
logerror("taitox unknown input read offset: %04x\n", offset);
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c
index eb53fee2564..2c65055c136 100644
--- a/src/mame/drivers/taitoair.c
+++ b/src/mame/drivers/taitoair.c
@@ -312,16 +312,16 @@ static READ16_HANDLER( stick_input_r )
switch( offset )
{
case 0x00: /* "counter 1" lo */
- return readinputportbytag(STICK1_PORT_TAG);
+ return input_port_read(machine, STICK1_PORT_TAG);
case 0x01: /* "counter 2" lo */
- return readinputportbytag(STICK2_PORT_TAG);
+ return input_port_read(machine, STICK2_PORT_TAG);
case 0x02: /* "counter 1" hi */
- return (readinputportbytag(STICK1_PORT_TAG) & 0xff00) >> 8;
+ return (input_port_read(machine, STICK1_PORT_TAG) & 0xff00) >> 8;
case 0x03: /* "counter 2" hi */
- return (readinputportbytag(STICK2_PORT_TAG) & 0xff00) >> 8;
+ return (input_port_read(machine, STICK2_PORT_TAG) & 0xff00) >> 8;
}
return 0;
@@ -332,10 +332,10 @@ static READ16_HANDLER( stick2_input_r )
switch( offset )
{
case 0x00: /* "counter 3" lo */
- return readinputportbytag(STICK3_PORT_TAG);
+ return input_port_read(machine, STICK3_PORT_TAG);
case 0x02: /* "counter 3" hi */
- return (readinputportbytag(STICK3_PORT_TAG) & 0xff00) >> 8;
+ return (input_port_read(machine, STICK3_PORT_TAG) & 0xff00) >> 8;
}
return 0;
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 6de77f3f02d..a0b977db10a 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -421,7 +421,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= ((readinputport(0) & 0x2) << 2) << 24;
+ r |= ((input_port_read_indexed(machine, 0) & 0x2) << 2) << 24;
}
return r;
}
@@ -430,7 +430,7 @@ static READ32_HANDLER ( jc_control_r )
if (ACCESSING_BITS_24_31)
{
UINT32 data = EEPROM_read_bit() & 1;
- data |= readinputport(0) & 0xfe;
+ data |= input_port_read_indexed(machine, 0) & 0xfe;
r |= data << 24;
}
return r;
@@ -439,7 +439,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(1) << 24;
+ r |= input_port_read_indexed(machine, 1) << 24;
}
return r;
}
@@ -447,7 +447,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(2) << 24;
+ r |= input_port_read_indexed(machine, 2) << 24;
}
return r;
}
@@ -463,7 +463,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(3) << 24;
+ r |= input_port_read_indexed(machine, 3) << 24;
}
return r;
}
@@ -869,7 +869,7 @@ static WRITE8_HANDLER(hc11_data_w)
static READ8_HANDLER(hc11_analog_r)
{
- return readinputport(4 + offset);
+ return input_port_read_indexed(machine, 4 + offset);
}
diff --git a/src/mame/drivers/taitosj.c b/src/mame/drivers/taitosj.c
index 403838d08ad..dfe1039d27e 100644
--- a/src/mame/drivers/taitosj.c
+++ b/src/mame/drivers/taitosj.c
@@ -337,9 +337,9 @@ static CUSTOM_INPUT( kikstart_gear_r )
port_tag = "GEARP2";
/* gear MUST be 1, 2 or 3 */
- if (readinputportbytag(port_tag) & 0x01) kikstart_gears[player] = 0x02;
- if (readinputportbytag(port_tag) & 0x02) kikstart_gears[player] = 0x03;
- if (readinputportbytag(port_tag) & 0x04) kikstart_gears[player] = 0x01;
+ if (input_port_read(machine, port_tag) & 0x01) kikstart_gears[player] = 0x02;
+ if (input_port_read(machine, port_tag) & 0x02) kikstart_gears[player] = 0x03;
+ if (input_port_read(machine, port_tag) & 0x04) kikstart_gears[player] = 0x01;
return kikstart_gears[player];
}
diff --git a/src/mame/drivers/tankbatt.c b/src/mame/drivers/tankbatt.c
index 99c67fba5d7..7a67f855ece 100644
--- a/src/mame/drivers/tankbatt.c
+++ b/src/mame/drivers/tankbatt.c
@@ -81,7 +81,7 @@ static READ8_HANDLER( tankbatt_in0_r )
{
int val;
- val = readinputport(0);
+ val = input_port_read_indexed(machine, 0);
return ((val << (7-offset)) & 0x80);
}
@@ -89,7 +89,7 @@ static READ8_HANDLER( tankbatt_in1_r )
{
int val;
- val = readinputport(1);
+ val = input_port_read_indexed(machine, 1);
return ((val << (7-offset)) & 0x80);
}
@@ -97,7 +97,7 @@ static READ8_HANDLER( tankbatt_dsw_r )
{
int val;
- val = readinputport(2);
+ val = input_port_read_indexed(machine, 2);
return ((val << (7-offset)) & 0x80);
}
@@ -177,7 +177,7 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( tankbatt_interrupt )
{
- if ((readinputport (0) & 0x60) == 0) cpunum_set_input_line(machine, 0,0,HOLD_LINE);
+ if ((input_port_read_indexed(machine, 0) & 0x60) == 0) cpunum_set_input_line(machine, 0,0,HOLD_LINE);
else if (tankbatt_nmi_enable) cpunum_set_input_line(machine, 0,INPUT_LINE_NMI,PULSE_LINE);
}
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index c6582ffbb34..0650a49c965 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -162,8 +162,8 @@ static WRITE16_HANDLER(cyclwarr_cpu_bb_w) { COMBINE_DATA(&cyclwarr_cpub_ram[offs
static READ16_HANDLER(cyclwarr_palette_r) { return paletteram16[offset]; }
static READ16_HANDLER(cyclwarr_sprite_r) { return spriteram16[offset]; }
static WRITE16_HANDLER(cyclwarr_sprite_w) { COMBINE_DATA(&spriteram16[offset]); }
-static READ16_HANDLER(cyclwarr_input_r) { return readinputport(offset); }
-static READ16_HANDLER(cyclwarr_input2_r) { return readinputport(offset+4); }
+static READ16_HANDLER(cyclwarr_input_r) { return input_port_read_indexed(machine, offset); }
+static READ16_HANDLER(cyclwarr_input2_r) { return input_port_read_indexed(machine, offset+4); }
static WRITE16_HANDLER(bigfight_a20000_w) { COMBINE_DATA(&bigfight_a20000[offset]); }
static WRITE16_HANDLER(bigfight_a40000_w) { COMBINE_DATA(&bigfight_a40000[offset]); }
static WRITE16_HANDLER(bigfight_a60000_w) { COMBINE_DATA(&bigfight_a60000[offset]); }
diff --git a/src/mame/drivers/taxidrvr.c b/src/mame/drivers/taxidrvr.c
index a08b5434049..9a41106e22c 100644
--- a/src/mame/drivers/taxidrvr.c
+++ b/src/mame/drivers/taxidrvr.c
@@ -61,7 +61,7 @@ static READ8_HANDLER( p1b_r )
static READ8_HANDLER( p1c_r )
{
- return (s2 << 7) | (s4 << 6) | ((readinputportbytag("IN2") & 1) << 4);
+ return (s2 << 7) | (s4 << 6) | ((input_port_read(machine, "IN2") & 1) << 4);
}
static WRITE8_HANDLER( p1a_w )
diff --git a/src/mame/drivers/tceptor.c b/src/mame/drivers/tceptor.c
index 46e75911121..addf14fffe3 100644
--- a/src/mame/drivers/tceptor.c
+++ b/src/mame/drivers/tceptor.c
@@ -150,22 +150,22 @@ static UINT8 fix_input1(UINT8 in1, UINT8 in2)
static READ8_HANDLER( dsw0_r )
{
- return fix_input0(readinputport(0), readinputport(1));
+ return fix_input0(input_port_read_indexed(machine, 0), input_port_read_indexed(machine, 1));
}
static READ8_HANDLER( dsw1_r )
{
- return fix_input1(readinputport(0), readinputport(1));
+ return fix_input1(input_port_read_indexed(machine, 0), input_port_read_indexed(machine, 1));
}
static READ8_HANDLER( input0_r )
{
- return fix_input0(readinputport(2), readinputport(3));
+ return fix_input0(input_port_read_indexed(machine, 2), input_port_read_indexed(machine, 3));
}
static READ8_HANDLER( input1_r )
{
- return fix_input1(readinputport(2), readinputport(3));
+ return fix_input1(input_port_read_indexed(machine, 2), input_port_read_indexed(machine, 3));
}
static READ8_HANDLER( readFF )
diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c
index d2c9666b763..95cf30f89be 100644
--- a/src/mame/drivers/tehkanwc.c
+++ b/src/mame/drivers/tehkanwc.c
@@ -133,32 +133,32 @@ static READ8_HANDLER( tehkanwc_track_0_r )
{
int joy;
- joy = readinputport(10) >> (2*offset);
+ joy = input_port_read_indexed(machine, 10) >> (2*offset);
if (joy & 1) return -63;
if (joy & 2) return 63;
- return readinputport(3 + offset) - track0[offset];
+ return input_port_read_indexed(machine, 3 + offset) - track0[offset];
}
static READ8_HANDLER( tehkanwc_track_1_r )
{
int joy;
- joy = readinputport(10) >> (4+2*offset);
+ joy = input_port_read_indexed(machine, 10) >> (4+2*offset);
if (joy & 1) return -63;
if (joy & 2) return 63;
- return readinputport(6 + offset) - track1[offset];
+ return input_port_read_indexed(machine, 6 + offset) - track1[offset];
}
static WRITE8_HANDLER( tehkanwc_track_0_reset_w )
{
/* reset the trackball counters */
- track0[offset] = readinputport(3 + offset) + data;
+ track0[offset] = input_port_read_indexed(machine, 3 + offset) + data;
}
static WRITE8_HANDLER( tehkanwc_track_1_reset_w )
{
/* reset the trackball counters */
- track1[offset] = readinputport(6 + offset) + data;
+ track1[offset] = input_port_read_indexed(machine, 6 + offset) + data;
}
diff --git a/src/mame/drivers/tempest.c b/src/mame/drivers/tempest.c
index 8515ef9cf44..5c2631d98ed 100644
--- a/src/mame/drivers/tempest.c
+++ b/src/mame/drivers/tempest.c
@@ -320,11 +320,11 @@ static CUSTOM_INPUT( tempest_knob_r )
if (tempest_player_select)
{
- ret = readinputportbytag(TEMPEST_KNOB_P2_TAG);
+ ret = input_port_read(machine, TEMPEST_KNOB_P2_TAG);
}
else
{
- ret = readinputportbytag(TEMPEST_KNOB_P1_TAG);
+ ret = input_port_read(machine, TEMPEST_KNOB_P1_TAG);
}
return ret;
@@ -336,11 +336,11 @@ static CUSTOM_INPUT( tempest_buttons_r )
if (tempest_player_select)
{
- ret = readinputportbytag(TEMPEST_BUTTONS_P2_TAG);
+ ret = input_port_read(machine, TEMPEST_BUTTONS_P2_TAG);
}
else
{
- ret = readinputportbytag(TEMPEST_BUTTONS_P1_TAG);
+ ret = input_port_read(machine, TEMPEST_BUTTONS_P1_TAG);
}
return ret;
@@ -349,7 +349,7 @@ static CUSTOM_INPUT( tempest_buttons_r )
static READ8_HANDLER( tempest_IN0_r )
{
- int res = readinputport(0);
+ int res = input_port_read_indexed(machine, 0);
if (avgdvg_done())
res |= 0x40;
@@ -364,13 +364,13 @@ static READ8_HANDLER( tempest_IN0_r )
static READ8_HANDLER( input_port_1_bit_r )
{
- return (readinputport(1) & (1 << offset)) ? 0 : 228;
+ return (input_port_read_indexed(machine, 1) & (1 << offset)) ? 0 : 228;
}
static READ8_HANDLER( input_port_2_bit_r )
{
- return (readinputport(2) & (1 << offset)) ? 0 : 228;
+ return (input_port_read_indexed(machine, 2) & (1 << offset)) ? 0 : 228;
}
diff --git a/src/mame/drivers/terracre.c b/src/mame/drivers/terracre.c
index 2763da3f91c..9164d3f18fa 100644
--- a/src/mame/drivers/terracre.c
+++ b/src/mame/drivers/terracre.c
@@ -146,7 +146,7 @@ static const UINT16 mHoreKidProtData[] =
static READ16_HANDLER( horekid_IN2_r )
{
- int data = readinputportbytag("IN1");
+ int data = input_port_read(machine, "IN1");
if (!(data & 0x40)) // FAKE button 3 for "Debug Mode"
{
diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c
index d13a1941a6d..c333da65ac3 100644
--- a/src/mame/drivers/tetrisp2.c
+++ b/src/mame/drivers/tetrisp2.c
@@ -230,7 +230,7 @@ static WRITE16_HANDLER( rockn_soundvolume_w )
static READ16_HANDLER( tetrisp2_ip_1_word_r )
{
- return ( readinputportbytag("IN1") & 0xfcff ) |
+ return ( input_port_read(machine, "IN1") & 0xfcff ) |
( mame_rand(Machine) & ~0xfcff ) |
( 1 << (8 + (mame_rand(Machine)&1)) );
}
@@ -306,7 +306,7 @@ static WRITE16_HANDLER( rocknms_main2sub_w )
static READ16_HANDLER( rocknms_port_0_r )
{
- return ((readinputport(0) & 0xfffc ) | (rocknms_sub2main & 0x0003));
+ return ((input_port_read_indexed(machine, 0) & 0xfffc ) | (rocknms_sub2main & 0x0003));
}
static WRITE16_HANDLER( rocknms_sub2main_w )
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index 99f43ed9407..cf758955ad9 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -338,7 +338,7 @@ static INTERRUPT_GEN( thedeep_interrupt )
{
if (protection_command != 0x59)
{
- int coins = readinputport(4);
+ int coins = input_port_read_indexed(machine, 4);
if (coins & 1) protection_data = 1;
else if (coins & 2) protection_data = 2;
else if (coins & 4) protection_data = 3;
diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c
index 11d6b9a15b3..cf2ddc83544 100644
--- a/src/mame/drivers/thief.c
+++ b/src/mame/drivers/thief.c
@@ -158,10 +158,10 @@ static READ8_HANDLER( thief_io_r )
{
switch( thief_input_select )
{
- case 0x01: return readinputport(0); /* dsw#1 */
- case 0x02: return readinputport(1); /* dsw#2 */
- case 0x04: return readinputport(2); /* inp#1 */
- case 0x08: return readinputport(3); /* inp#2 */
+ case 0x01: return input_port_read_indexed(machine, 0); /* dsw#1 */
+ case 0x02: return input_port_read_indexed(machine, 1); /* dsw#2 */
+ case 0x04: return input_port_read_indexed(machine, 2); /* inp#1 */
+ case 0x08: return input_port_read_indexed(machine, 3); /* inp#2 */
}
return 0x00;
}
diff --git a/src/mame/drivers/thunderj.c b/src/mame/drivers/thunderj.c
index fb2d70d4402..de81eb58062 100644
--- a/src/mame/drivers/thunderj.c
+++ b/src/mame/drivers/thunderj.c
@@ -78,7 +78,7 @@ static MACHINE_RESET( thunderj )
static READ16_HANDLER( special_port2_r )
{
- int result = readinputport(2);
+ int result = input_port_read_indexed(machine, 2);
if (atarigen_sound_to_cpu_ready) result ^= 0x0004;
if (atarigen_cpu_to_sound_ready) result ^= 0x0008;
diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c
index 95bfc1b953d..053d276613c 100644
--- a/src/mame/drivers/tickee.c
+++ b/src/mame/drivers/tickee.c
@@ -43,8 +43,8 @@ INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *
{
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
- *x = (((readinputport(4 + player * 2) & 0xff) * (visarea->max_x - visarea->min_x)) >> 8) + visarea->min_x;
- *y = (((readinputport(5 + player * 2) & 0xff) * (visarea->max_y - visarea->min_y)) >> 8) + visarea->min_y;
+ *x = (((input_port_read_indexed(machine, 4 + player * 2) & 0xff) * (visarea->max_x - visarea->min_x)) >> 8) + visarea->min_x;
+ *y = (((input_port_read_indexed(machine, 5 + player * 2) & 0xff) * (visarea->max_y - visarea->min_y)) >> 8) + visarea->min_y;
}
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index b1bf7d54848..1a73a227100 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -94,10 +94,10 @@ static WRITE16_HANDLER( tmaster_oki_bank_w )
static int touchscreen;
-static void show_touchscreen(void)
+static void show_touchscreen(running_machine *machine)
{
#ifdef MAME_DEBUG
- popmessage("% d] %03x %03x - %d",touchscreen,readinputportbytag("TSCREEN_X")&0x1ff,readinputportbytag("TSCREEN_Y"),okibank);
+ popmessage("% d] %03x %03x - %d",touchscreen,input_port_read(machine, "TSCREEN_X")&0x1ff,input_port_read(machine, "TSCREEN_Y"),okibank);
#endif
}
@@ -106,7 +106,7 @@ static WRITE16_HANDLER( tmaster_tscreen_reset_w )
if (ACCESSING_BITS_0_7 && data == 0x05)
{
touchscreen = 0;
- show_touchscreen();
+ show_touchscreen(machine);
}
}
@@ -116,7 +116,7 @@ static READ16_HANDLER( tmaster_tscreen_next_r )
touchscreen++;
if (touchscreen == 6)
touchscreen = -1;
- show_touchscreen();
+ show_touchscreen(machine);
return 0;
}
@@ -134,17 +134,17 @@ static READ16_HANDLER( tmaster_tscreen_x_lo_r )
{
UINT16 val = 0;
- int press1 = readinputportbytag("TSCREEN_X") & 0x4000;
- int press2 = readinputportbytag("TSCREEN_X") & 0x8000;
+ int press1 = input_port_read(machine, "TSCREEN_X") & 0x4000;
+ int press2 = input_port_read(machine, "TSCREEN_X") & 0x8000;
if (press1) press2 = 1;
switch (touchscreen)
{
case 1: val = press1 ? 0 : 1<<6; break; // press
- case 2: val = readinputportbytag("TSCREEN_X") & 0x003; break;
- case 3: val = (readinputportbytag("TSCREEN_X") >> 2) & 0x7f; break;
+ case 2: val = input_port_read(machine, "TSCREEN_X") & 0x003; break;
+ case 3: val = (input_port_read(machine, "TSCREEN_X") >> 2) & 0x7f; break;
case 4: val = 0; break;
- case 5: val = ((readinputportbytag("TSCREEN_Y")^0xff) >> 1) & 0x7f; break;
+ case 5: val = ((input_port_read(machine, "TSCREEN_Y")^0xff) >> 1) & 0x7f; break;
default:
return 0;
@@ -383,7 +383,7 @@ static READ16_HANDLER( tmaster_blitter_r )
static READ16_HANDLER( tmaster_coins_r )
{
- return readinputportbytag("COIN")|(mame_rand(Machine)&0x0800);
+ return input_port_read(machine, "COIN")|(mame_rand(Machine)&0x0800);
}
static ADDRESS_MAP_START( tmaster_map, ADDRESS_SPACE_PROGRAM, 16 )
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 14bb96030dd..89cfef94223 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -281,8 +281,8 @@ static READ8_HANDLER( kageki_csport_r )
{
int dsw, dsw1, dsw2;
- dsw1 = readinputportbytag("DSWA");
- dsw2 = readinputportbytag("DSWB");
+ dsw1 = input_port_read(machine, "DSWA");
+ dsw2 = input_port_read(machine, "DSWB");
switch (kageki_csport_sel)
{
diff --git a/src/mame/drivers/toobin.c b/src/mame/drivers/toobin.c
index 8d4a9167aa7..3808ab4e457 100644
--- a/src/mame/drivers/toobin.c
+++ b/src/mame/drivers/toobin.c
@@ -95,7 +95,7 @@ static WRITE16_HANDLER( interrupt_scan_w )
static READ16_HANDLER( special_port1_r )
{
- int result = readinputport(1);
+ int result = input_port_read_indexed(machine, 1);
if (atarigen_get_hblank(machine->primary_screen)) result ^= 0x8000;
if (atarigen_cpu_to_sound_ready) result ^= 0x2000;
return result;
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index 4b0b893a428..54628757639 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -332,8 +332,8 @@ static READ16_HANDLER( topspeed_input_bypass_r )
{
UINT8 port = TC0220IOC_port_r(machine,0); /* read port number */
int steer = 0;
- int analogue_steer = readinputportbytag_safe(STEER_PORT_TAG,0x00);
- int fake = readinputportbytag_safe(FAKE_PORT_TAG,0x00);
+ int analogue_steer = input_port_read_safe(machine, STEER_PORT_TAG,0x00);
+ int fake = input_port_read_safe(machine, FAKE_PORT_TAG,0x00);
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c
index 07906fc2e1a..d420de4f558 100644
--- a/src/mame/drivers/toratora.c
+++ b/src/mame/drivers/toratora.c
@@ -39,7 +39,7 @@ static UINT8 clear_tv;
static READ8_HANDLER( port_b_u3_r )
{
logerror("%04x: read DIP\n",activecpu_get_pc());
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
diff --git a/src/mame/drivers/tourtabl.c b/src/mame/drivers/tourtabl.c
index d742637bbbb..8ee0b936c53 100644
--- a/src/mame/drivers/tourtabl.c
+++ b/src/mame/drivers/tourtabl.c
@@ -54,7 +54,7 @@ static READ8_HANDLER( r6532_1_ram_r )
static READ16_HANDLER( tourtabl_read_input_port )
{
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
}
static READ8_HANDLER( tourtabl_get_databus_contents )
diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c
index 7924ff649fa..3a8bf619208 100644
--- a/src/mame/drivers/toypop.c
+++ b/src/mame/drivers/toypop.c
@@ -56,17 +56,17 @@ PALETTE_INIT( toypop );
***************************************************************************/
-static READ8_HANDLER( in0_l ) { return readinputport(0); } // P1 joystick
-static READ8_HANDLER( in0_h ) { return readinputport(0) >> 4; } // P2 joystick
-static READ8_HANDLER( in1_l ) { return readinputport(1); } // fire and start buttons
-static READ8_HANDLER( in1_h ) { return readinputport(1) >> 4; } // coins
-static READ8_HANDLER( dipA_l ) { return readinputport(2); } // dips A
-static READ8_HANDLER( dipA_h ) { return readinputport(2) >> 4; } // dips A
-static READ8_HANDLER( dipB_l ) { return readinputport(3); } // dips B
-static READ8_HANDLER( dipB_h ) { return readinputport(3) >> 4; } // dips B
-static READ8_HANDLER( in2_l ) { return readinputport(4); } // P1 joystick left in liblrabl
-static READ8_HANDLER( in2_h ) { return readinputport(4) >> 4; } // P2 joystick left in liblrabl
-static READ8_HANDLER( in3 ) { return readinputport(5); } // test, cocktail, optional buttons
+static READ8_HANDLER( in0_l ) { return input_port_read_indexed(machine, 0); } // P1 joystick
+static READ8_HANDLER( in0_h ) { return input_port_read_indexed(machine, 0) >> 4; } // P2 joystick
+static READ8_HANDLER( in1_l ) { return input_port_read_indexed(machine, 1); } // fire and start buttons
+static READ8_HANDLER( in1_h ) { return input_port_read_indexed(machine, 1) >> 4; } // coins
+static READ8_HANDLER( dipA_l ) { return input_port_read_indexed(machine, 2); } // dips A
+static READ8_HANDLER( dipA_h ) { return input_port_read_indexed(machine, 2) >> 4; } // dips A
+static READ8_HANDLER( dipB_l ) { return input_port_read_indexed(machine, 3); } // dips B
+static READ8_HANDLER( dipB_h ) { return input_port_read_indexed(machine, 3) >> 4; } // dips B
+static READ8_HANDLER( in2_l ) { return input_port_read_indexed(machine, 4); } // P1 joystick left in liblrabl
+static READ8_HANDLER( in2_h ) { return input_port_read_indexed(machine, 4) >> 4; } // P2 joystick left in liblrabl
+static READ8_HANDLER( in3 ) { return input_port_read_indexed(machine, 5); } // test, cocktail, optional buttons
static WRITE8_HANDLER( out_coin0 )
{
coin_lockout_global_w(data & 4);
diff --git a/src/mame/drivers/triplhnt.c b/src/mame/drivers/triplhnt.c
index 54a353370cf..286b92738dd 100644
--- a/src/mame/drivers/triplhnt.c
+++ b/src/mame/drivers/triplhnt.c
@@ -76,7 +76,7 @@ static void triplhnt_update_misc(running_machine *machine, int offset)
discrete_sound_w(machine, TRIPLHNT_LAMP_EN, triplhnt_misc_flags & 0x02); // Lamp is used to reset noise
discrete_sound_w(machine, TRIPLHNT_BEAR_EN, triplhnt_misc_flags & 0x80); // bear
- is_witch_hunt = readinputport(2) == 0x40;
+ is_witch_hunt = input_port_read_indexed(machine, 2) == 0x40;
bit = ~triplhnt_misc_flags & 0x40;
/* if we're not playing the sample yet, start it */
@@ -108,21 +108,21 @@ static READ8_HANDLER( triplhnt_cmos_r )
static READ8_HANDLER( triplhnt_input_port_4_r )
{
watchdog_reset_w(machine, 0, 0);
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
}
static READ8_HANDLER( triplhnt_misc_r )
{
triplhnt_update_misc(machine, offset);
- return readinputport(7) | triplhnt_hit_code;
+ return input_port_read_indexed(machine, 7) | triplhnt_hit_code;
}
static READ8_HANDLER( triplhnt_da_latch_r )
{
- int cross_x = readinputport(8);
- int cross_y = readinputport(9);
+ int cross_x = input_port_read_indexed(machine, 8);
+ int cross_y = input_port_read_indexed(machine, 9);
triplhnt_da_latch = offset;
diff --git a/src/mame/drivers/truco.c b/src/mame/drivers/truco.c
index ccb9eefb347..69c3bf6a131 100644
--- a/src/mame/drivers/truco.c
+++ b/src/mame/drivers/truco.c
@@ -133,7 +133,7 @@ static INTERRUPT_GEN( truco_interrupt )
/* coinup */
static int trigger = 0;
- if ( readinputport( 2 ) & 1 )
+ if ( input_port_read_indexed(machine, 2 ) & 1 )
{
if ( trigger == 0 )
{
diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c
index fc7554c37a6..46676271fba 100644
--- a/src/mame/drivers/tugboat.c
+++ b/src/mame/drivers/tugboat.c
@@ -130,15 +130,15 @@ static int ctrl;
static READ8_HANDLER( tugboat_input_r )
{
if (~ctrl & 0x80)
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
else if (~ctrl & 0x40)
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
else if (~ctrl & 0x20)
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
else if (~ctrl & 0x10)
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
else
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
}
static READ8_HANDLER( tugboat_ctrl_r )
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index dfac9ca2575..7602ccf31b7 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -355,11 +355,11 @@ static READ16_HANDLER( tumblepopb_controls_r )
switch (offset<<1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Dips */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 8: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 10: /* ? */
case 12:
return 0;
@@ -3360,7 +3360,7 @@ static READ16_HANDLER( bcstory_1a0_read )
{
// mame_printf_debug("bcstory_io %06x\n",activecpu_get_pc());
if (activecpu_get_pc()==0x0560) return 0x1a0;
- else return readinputport(2);
+ else return input_port_read_indexed(machine, 2);
}
static DRIVER_INIT ( bcstory )
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index 56487eddd2b..36132be9d46 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -91,11 +91,11 @@ static READ16_HANDLER( tumblepop_controls_r )
switch (offset<<1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Dips */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 8: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 10: /* ? */
case 12:
return 0;
diff --git a/src/mame/drivers/tunhunt.c b/src/mame/drivers/tunhunt.c
index 8f173759a41..c1383ff3811 100644
--- a/src/mame/drivers/tunhunt.c
+++ b/src/mame/drivers/tunhunt.c
@@ -97,44 +97,44 @@ static WRITE8_HANDLER( tunhunt_control_w )
static READ8_HANDLER( tunhunt_button_r )
{
- int data = readinputportbytag("IN0");
+ int data = input_port_read(machine, "IN0");
return ((data>>offset)&1)?0x00:0x80;
}
static READ8_HANDLER( dsw1_r )
{
- return readinputportbytag("DSW")&0xff;
+ return input_port_read(machine, "DSW")&0xff;
}
static READ8_HANDLER( dsw2_0r )
{
- return (readinputportbytag("DSW")&0x0100)?0x80:0x00;
+ return (input_port_read(machine, "DSW")&0x0100)?0x80:0x00;
}
static READ8_HANDLER( dsw2_1r )
{
- return (readinputportbytag("DSW")&0x0200)?0x80:0x00;
+ return (input_port_read(machine, "DSW")&0x0200)?0x80:0x00;
}
static READ8_HANDLER( dsw2_2r )
{
- return (readinputportbytag("DSW")&0x0400)?0x80:0x00;
+ return (input_port_read(machine, "DSW")&0x0400)?0x80:0x00;
}
static READ8_HANDLER( dsw2_3r )
{
- return (readinputportbytag("DSW")&0x0800)?0x80:0x00;
+ return (input_port_read(machine, "DSW")&0x0800)?0x80:0x00;
}
static READ8_HANDLER( dsw2_4r )
{
- return (readinputportbytag("DSW")&0x1000)?0x80:0x00;
+ return (input_port_read(machine, "DSW")&0x1000)?0x80:0x00;
}
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index 2f7c6426faf..bf077da8c74 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -410,7 +410,7 @@ static READ8_HANDLER( turbo_8279_r )
{
/* read sensor RAM */
case 0x40:
- result = ~readinputport(1); /* DSW 1 - inverted! */
+ result = ~input_port_read_indexed(machine, 1); /* DSW 1 - inverted! */
break;
/* read display RAM */
@@ -545,7 +545,7 @@ static READ8_HANDLER( turbo_collision_r )
{
turbo_state *state = machine->driver_data;
video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
- return readinputport(3) | (state->turbo_collision & 15);
+ return input_port_read_indexed(machine, 3) | (state->turbo_collision & 15);
}
@@ -560,14 +560,14 @@ static WRITE8_HANDLER( turbo_collision_clear_w )
static READ8_HANDLER( turbo_analog_r )
{
turbo_state *state = machine->driver_data;
- return readinputport(4) - state->turbo_last_analog;
+ return input_port_read_indexed(machine, 4) - state->turbo_last_analog;
}
static WRITE8_HANDLER( turbo_analog_reset_w )
{
turbo_state *state = machine->driver_data;
- state->turbo_last_analog = readinputport(4);
+ state->turbo_last_analog = input_port_read_indexed(machine, 4);
}
@@ -606,8 +606,8 @@ static READ8_HANDLER( buckrog_cpu2_command_r )
static READ8_HANDLER( buckrog_port_2_r )
{
- int inp1 = readinputport(2);
- int inp2 = readinputport(3);
+ int inp1 = input_port_read_indexed(machine, 2);
+ int inp2 = input_port_read_indexed(machine, 3);
return (((inp2 >> 6) & 1) << 7) |
(((inp2 >> 4) & 1) << 6) |
@@ -622,8 +622,8 @@ static READ8_HANDLER( buckrog_port_2_r )
static READ8_HANDLER( buckrog_port_3_r )
{
- int inp1 = readinputport(2);
- int inp2 = readinputport(3);
+ int inp1 = input_port_read_indexed(machine, 2);
+ int inp2 = input_port_read_indexed(machine, 3);
return (((inp2 >> 7) & 1) << 7) |
(((inp2 >> 5) & 1) << 6) |
diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c
index aee99394054..3b3962ee1ad 100644
--- a/src/mame/drivers/twin16.c
+++ b/src/mame/drivers/twin16.c
@@ -218,13 +218,13 @@ static READ16_HANDLER( twin16_input_r )
{
switch( offset )
{
- case 0x00: return readinputport(0); // coin
- case 0x01: return readinputport(1); // p1
- case 0x02: return readinputport(2); // p2
- case 0x03: return readinputport(3); // p3 (Dark Adventure)
- case 0x08: return readinputport(5); // DSW1
- case 0x09: return readinputport(4); // DSW2
- case 0x0c: return readinputport(6); // DSW3
+ case 0x00: return input_port_read_indexed(machine, 0); // coin
+ case 0x01: return input_port_read_indexed(machine, 1); // p1
+ case 0x02: return input_port_read_indexed(machine, 2); // p2
+ case 0x03: return input_port_read_indexed(machine, 3); // p3 (Dark Adventure)
+ case 0x08: return input_port_read_indexed(machine, 5); // DSW1
+ case 0x09: return input_port_read_indexed(machine, 4); // DSW2
+ case 0x0c: return input_port_read_indexed(machine, 6); // DSW3
}
return 0;
}
diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c
index fb1c44cf91f..c0b8cacb784 100644
--- a/src/mame/drivers/tx1.c
+++ b/src/mame/drivers/tx1.c
@@ -389,7 +389,7 @@ INPUT_PORTS_END
static READ16_HANDLER( dipswitches_r )
{
- return (readinputport(0) & 0xfffe) | ts;
+ return (input_port_read_indexed(machine, 0) & 0xfffe) | ts;
}
/*
@@ -448,8 +448,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( tx1_ppi_latch_w )
{
- tx1_ppi_latch_a = ((readinputportbytag("AN_BRAKE") & 0xf) << 4) | (readinputportbytag("AN_ACCELERATOR") & 0xf);
- tx1_ppi_latch_b = readinputportbytag("AN_STEERING");
+ tx1_ppi_latch_a = ((input_port_read(machine, "AN_BRAKE") & 0xf) << 4) | (input_port_read(machine, "AN_ACCELERATOR") & 0xf);
+ tx1_ppi_latch_b = input_port_read(machine, "AN_STEERING");
}
static READ8_HANDLER( tx1_ppi_porta_r )
@@ -459,7 +459,7 @@ static READ8_HANDLER( tx1_ppi_porta_r )
static READ8_HANDLER( tx1_ppi_portb_r )
{
- return readinputportbytag("PPI_PORTD") | tx1_ppi_latch_b;
+ return input_port_read(machine, "PPI_PORTD") | tx1_ppi_latch_b;
}
static ADDRESS_MAP_START( tx1_sound_prg, ADDRESS_SPACE_PROGRAM, 8 )
@@ -535,11 +535,11 @@ static READ8_HANDLER( bb_analog_r )
{
if ( offset == 1 )
{
- return ((readinputportbytag("AN_ACCELERATOR") & 0xf) << 4) | readinputportbytag("AN_STEERING");
+ return ((input_port_read(machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(machine, "AN_STEERING");
}
else
{
- return (readinputportbytag("AN_BRAKE") & 0xf) << 4;
+ return (input_port_read(machine, "AN_BRAKE") & 0xf) << 4;
}
}
@@ -547,11 +547,11 @@ static READ8_HANDLER( bbjr_analog_r )
{
if ( offset == 0 )
{
- return ((readinputportbytag("AN_ACCELERATOR") & 0xf) << 4) | readinputportbytag("AN_STEERING");
+ return ((input_port_read(machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(machine, "AN_STEERING");
}
else
{
- return (readinputportbytag("AN_BRAKE") & 0xf) << 4;
+ return (input_port_read(machine, "AN_BRAKE") & 0xf) << 4;
}
}
diff --git a/src/mame/drivers/uapce.c b/src/mame/drivers/uapce.c
index 971b87254f1..792f477f52c 100644
--- a/src/mame/drivers/uapce.c
+++ b/src/mame/drivers/uapce.c
@@ -58,7 +58,7 @@ static READ8_HANDLER( jamma_if_read_dsw )
{
UINT8 dsw_val;
- dsw_val = readinputportbytag( "DSW" );
+ dsw_val = input_port_read(machine, "DSW" );
if ( BIT( offset, 7 ) == 0 )
{
@@ -100,11 +100,11 @@ static UINT8 jamma_if_read_joystick( void )
{
if ( jamma_if_control_latch & 0x10 )
{
- return readinputportbytag( "IN" );
+ return input_port_read(Machine, "IN" );
}
else
{
- return readinputportbytag( "IN" ) | 0x08;
+ return input_port_read(Machine, "IN" ) | 0x08;
}
}
diff --git a/src/mame/drivers/ultratnk.c b/src/mame/drivers/ultratnk.c
index 44e3713e178..5cc37ca5c88 100644
--- a/src/mame/drivers/ultratnk.c
+++ b/src/mame/drivers/ultratnk.c
@@ -28,7 +28,7 @@ static CUSTOM_INPUT( get_collision )
static CUSTOM_INPUT( get_joystick )
{
- UINT8 joy = readinputportbytag(param) & 3;
+ UINT8 joy = input_port_read(machine, param) & 3;
if (joy == 1)
{
@@ -52,9 +52,9 @@ static TIMER_CALLBACK( nmi_callback )
/* NMI and watchdog are disabled during service mode */
- watchdog_enable(machine, readinputport(0) & 0x40);
+ watchdog_enable(machine, input_port_read_indexed(machine, 0) & 0x40);
- if (readinputport(0) & 0x40)
+ if (input_port_read_indexed(machine, 0) & 0x40)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
timer_set(video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), NULL, scanline, nmi_callback);
@@ -75,21 +75,21 @@ static READ8_HANDLER( ultratnk_wram_r )
static READ8_HANDLER( ultratnk_analog_r )
{
- return (readinputportbytag("ANALOG") << (~offset & 7)) & 0x80;
+ return (input_port_read(machine, "ANALOG") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( ultratnk_coin_r )
{
- return (readinputportbytag("COIN") << (~offset & 7)) & 0x80;
+ return (input_port_read(machine, "COIN") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( ultratnk_collision_r )
{
- return (readinputportbytag("COLLISION") << (~offset & 7)) & 0x80;
+ return (input_port_read(machine, "COLLISION") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( ultratnk_options_r )
{
- return (readinputportbytag("DIP") >> (2 * (offset & 3))) & 3;
+ return (input_port_read(machine, "DIP") >> (2 * (offset & 3))) & 3;
}
diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c
index a383d7210b9..0c2b4b8b7f6 100644
--- a/src/mame/drivers/ultrsprt.c
+++ b/src/mame/drivers/ultrsprt.c
@@ -52,7 +52,7 @@ static READ32_HANDLER( eeprom_r )
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
- r |= (((EEPROM_read_bit()) << 1) | (readinputport(6) << 3)) << 24;
+ r |= (((EEPROM_read_bit()) << 1) | (input_port_read_indexed(machine, 6) << 3)) << 24;
return r;
}
@@ -69,12 +69,12 @@ static WRITE32_HANDLER( eeprom_w )
static READ32_HANDLER( control1_r )
{
- return (readinputport(0) << 28) | ((readinputport(1) & 0xfff) << 16) | (readinputport(2) & 0xfff);
+ return (input_port_read_indexed(machine, 0) << 28) | ((input_port_read_indexed(machine, 1) & 0xfff) << 16) | (input_port_read_indexed(machine, 2) & 0xfff);
}
static READ32_HANDLER( control2_r )
{
- return (readinputport(3) << 28) | ((readinputport(4) & 0xfff) << 16) | (readinputport(5) & 0xfff);
+ return (input_port_read_indexed(machine, 3) << 28) | ((input_port_read_indexed(machine, 4) & 0xfff) << 16) | (input_port_read_indexed(machine, 5) & 0xfff);
}
static WRITE32_HANDLER( int_ack_w )
diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c
index 7fde9c3f17f..fa0b08c0d21 100644
--- a/src/mame/drivers/unico.c
+++ b/src/mame/drivers/unico.c
@@ -128,7 +128,7 @@ static WRITE16_HANDLER( zeropnt_sound_bank_w )
/* Light Gun - need to wiggle the input slightly otherwise fire doesn't work */
static READ16_HANDLER( unico_gunx_0_msb_r )
{
- int x=readinputportbytag("X0");
+ int x=input_port_read(machine, "X0");
x=x*384/256; /* On screen pixel X */
if (x<0x160) x=0x30 + (x*0xd0/0x15f);
@@ -139,7 +139,7 @@ static READ16_HANDLER( unico_gunx_0_msb_r )
static READ16_HANDLER( unico_guny_0_msb_r )
{
- int y=readinputportbytag("Y0");
+ int y=input_port_read(machine, "Y0");
y=0x18+((y*0xe0)/0xff);
@@ -148,7 +148,7 @@ static READ16_HANDLER( unico_guny_0_msb_r )
static READ16_HANDLER( unico_gunx_1_msb_r )
{
- int x=readinputportbytag("X1");
+ int x=input_port_read(machine, "X1");
x=x*384/256; /* On screen pixel X */
if (x<0x160) x=0x30 + (x*0xd0/0x15f);
@@ -159,7 +159,7 @@ static READ16_HANDLER( unico_gunx_1_msb_r )
static READ16_HANDLER( unico_guny_1_msb_r )
{
- int y=readinputportbytag("Y1");
+ int y=input_port_read(machine, "Y1");
y=0x18+((y*0xe0)/0xff);
@@ -214,10 +214,10 @@ ADDRESS_MAP_END
Zero Point 2
***************************************************************************/
-static READ32_HANDLER( zeropnt2_coins_r ) { return (readinputportbytag("IN0") << 16) | 0xffff; }
-static READ32_HANDLER( zeropnt2_dsw1_r ) { return (readinputportbytag("DSW1") << 16) | 0xffff; }
-static READ32_HANDLER( zeropnt2_dsw2_r ) { return (readinputportbytag("DSW2") << 16) | 0xffff; }
-static READ32_HANDLER( zeropnt2_buttons_r ) { return ((readinputportbytag("IN7") | ((EEPROM_read_bit() & 0x01) << 7)) << 16) | 0xffff; }
+static READ32_HANDLER( zeropnt2_coins_r ) { return (input_port_read(machine, "IN0") << 16) | 0xffff; }
+static READ32_HANDLER( zeropnt2_dsw1_r ) { return (input_port_read(machine, "DSW1") << 16) | 0xffff; }
+static READ32_HANDLER( zeropnt2_dsw2_r ) { return (input_port_read(machine, "DSW2") << 16) | 0xffff; }
+static READ32_HANDLER( zeropnt2_buttons_r ) { return ((input_port_read(machine, "IN7") | ((EEPROM_read_bit() & 0x01) << 7)) << 16) | 0xffff; }
static READ32_HANDLER( zeropnt2_gunx_0_msb_r ) { return (unico_gunx_0_msb_r(machine,0,0)-0x0800) << 16; }
static READ32_HANDLER( zeropnt2_guny_0_msb_r ) { return (unico_guny_0_msb_r(machine,0,0)+0x0800) << 16; }
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index 73fa59256c8..961cf5094ae 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -24,6 +24,7 @@
**********************************************************************************/
#include "driver.h"
+#include "deprecat.h"
#include "includes/amiga.h"
@@ -209,7 +210,7 @@ static void upscope_cia_1_porta_w(UINT8 data)
if (data & 4)
{
if (LOG_IO) logerror("Internal register (%d) read\n", nvram_address_latch);
- nvram_data_latch = (nvram_address_latch == 0) ? readinputportbytag("IO0") : 0xff;
+ nvram_data_latch = (nvram_address_latch == 0) ? input_port_read(Machine, "IO0") : 0xff;
}
/* if SEL == 0, we read NVRAM */
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 0492996daa5..1d8ccba1297 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -203,12 +203,12 @@ F94B
static READ32_HANDLER( finalgdr_input0_r )
{
- return readinputport(0) << 16;
+ return input_port_read_indexed(machine, 0) << 16;
}
static READ32_HANDLER( finalgdr_input1_r )
{
- return readinputport(1) << 16;
+ return input_port_read_indexed(machine, 1) << 16;
}
static WRITE32_HANDLER( finalgdr_oki_bank_w )
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index b6c0001759e..4a9c21cff70 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -38,11 +38,11 @@ static READ16_HANDLER( vaportra_control_r )
switch (offset<<1)
{
case 4: /* Dip Switches */
- return (readinputport(4) + (readinputport(3) << 8));
+ return (input_port_read_indexed(machine, 4) + (input_port_read_indexed(machine, 3) << 8));
case 2: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
}
logerror("Unknown control read at %d\n",offset);
diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c
index f0f99e6240d..a4e4a2d2417 100644
--- a/src/mame/drivers/vegaeo.c
+++ b/src/mame/drivers/vegaeo.c
@@ -77,7 +77,7 @@ static WRITE32_HANDLER( vega_misc_w )
static READ32_HANDLER( vegaeo_custom_read )
{
eolith_speedup_read();
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
static ADDRESS_MAP_START( vega_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x00000000, 0x001fffff) AM_RAM
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index 2d012df8fa9..345ef07c0bd 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -1457,7 +1457,7 @@ static WRITE32_HANDLER( analog_port_w )
{
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", activecpu_get_pc(), data);
- pending_analog_read = readinputport(4 + (data & 7));
+ pending_analog_read = input_port_read_indexed(machine, 4 + (data & 7));
}
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index de534c162f3..37cc34c3e1d 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -150,7 +150,7 @@ static READ8_HANDLER( vendetta_eeprom_r )
res |= 0x02;//konami_eeprom_ack() << 5; /* add the ack */
- res |= readinputport( 3 ) & 0x0c; /* test switch */
+ res |= input_port_read_indexed(machine, 3 ) & 0x0c; /* test switch */
if (init_eeprom_count)
{
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index b8d5ca77e6a..5c249c1a50f 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -85,7 +85,7 @@ static void assert_coin_status(void)
static CUSTOM_INPUT( vicdual_read_coin_status )
{
- UINT32 coin_input = readinputportbytag(COIN_PORT_TAG);
+ UINT32 coin_input = input_port_read(machine, COIN_PORT_TAG);
if (coin_input && !last_coin_input)
{
@@ -188,9 +188,9 @@ static CUSTOM_INPUT( vicdual_get_timer_value )
#define COLOR_BW_PORT_TAG "COLOR_BW"
-int vicdual_is_cabinet_color(void)
+int vicdual_is_cabinet_color(running_machine *machine)
{
- return (readinputportbytag(COLOR_BW_PORT_TAG) == 0);
+ return (input_port_read(machine, COLOR_BW_PORT_TAG) == 0);
}
diff --git a/src/mame/drivers/videopin.c b/src/mame/drivers/videopin.c
index f44a124c68f..49aa6c63649 100644
--- a/src/mame/drivers/videopin.c
+++ b/src/mame/drivers/videopin.c
@@ -26,9 +26,9 @@ static WRITE8_HANDLER(videopin_out1_w);
static WRITE8_HANDLER(videopin_out2_w);
-static void update_plunger(void)
+static void update_plunger(running_machine *machine)
{
- UINT8 val = readinputport(3);
+ UINT8 val = input_port_read_indexed(machine, 3);
if (prev != val)
{
@@ -51,7 +51,7 @@ static TIMER_CALLBACK( interrupt_callback )
{
int scanline = param;
- update_plunger();
+ update_plunger(machine);
cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
@@ -94,7 +94,7 @@ static READ8_HANDLER( videopin_misc_r )
// signals received. This results in the MPU displaying the
// ball being shot onto the playfield at a certain speed.
- UINT8 val = readinputport(2);
+ UINT8 val = input_port_read_indexed(machine, 2);
if (plunger >= 0.000 && plunger <= 0.001)
{
diff --git a/src/mame/drivers/vindictr.c b/src/mame/drivers/vindictr.c
index 48cfb9243df..b8793eb4911 100644
--- a/src/mame/drivers/vindictr.c
+++ b/src/mame/drivers/vindictr.c
@@ -64,7 +64,7 @@ static MACHINE_RESET( vindictr )
static READ16_HANDLER( port1_r )
{
- int result = readinputport(1);
+ int result = input_port_read_indexed(machine, 1);
if (atarigen_sound_to_cpu_ready) result ^= 0x0004;
if (atarigen_cpu_to_sound_ready) result ^= 0x0008;
result ^= 0x0010;
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index 764317a4867..6d47239ac5c 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -144,14 +144,14 @@ static WRITE16_HANDLER( vmetal_mid2tileram_w )
}
-static READ16_HANDLER ( varia_dips_bit8_r ) { return ((readinputport(3) & 0x80) << 0) | ((readinputport(2) & 0x80) >> 1); }
-static READ16_HANDLER ( varia_dips_bit7_r ) { return ((readinputport(3) & 0x40) << 1) | ((readinputport(2) & 0x40) >> 0); }
-static READ16_HANDLER ( varia_dips_bit6_r ) { return ((readinputport(3) & 0x20) << 2) | ((readinputport(2) & 0x20) << 1); }
-static READ16_HANDLER ( varia_dips_bit5_r ) { return ((readinputport(3) & 0x10) << 3) | ((readinputport(2) & 0x10) << 2); }
-static READ16_HANDLER ( varia_dips_bit4_r ) { return ((readinputport(3) & 0x08) << 4) | ((readinputport(2) & 0x08) << 3); }
-static READ16_HANDLER ( varia_dips_bit3_r ) { return ((readinputport(3) & 0x04) << 5) | ((readinputport(2) & 0x04) << 4); }
-static READ16_HANDLER ( varia_dips_bit2_r ) { return ((readinputport(3) & 0x02) << 6) | ((readinputport(2) & 0x02) << 5); }
-static READ16_HANDLER ( varia_dips_bit1_r ) { return ((readinputport(3) & 0x01) << 7) | ((readinputport(2) & 0x01) << 6); }
+static READ16_HANDLER ( varia_dips_bit8_r ) { return ((input_port_read_indexed(machine, 3) & 0x80) << 0) | ((input_port_read_indexed(machine, 2) & 0x80) >> 1); }
+static READ16_HANDLER ( varia_dips_bit7_r ) { return ((input_port_read_indexed(machine, 3) & 0x40) << 1) | ((input_port_read_indexed(machine, 2) & 0x40) >> 0); }
+static READ16_HANDLER ( varia_dips_bit6_r ) { return ((input_port_read_indexed(machine, 3) & 0x20) << 2) | ((input_port_read_indexed(machine, 2) & 0x20) << 1); }
+static READ16_HANDLER ( varia_dips_bit5_r ) { return ((input_port_read_indexed(machine, 3) & 0x10) << 3) | ((input_port_read_indexed(machine, 2) & 0x10) << 2); }
+static READ16_HANDLER ( varia_dips_bit4_r ) { return ((input_port_read_indexed(machine, 3) & 0x08) << 4) | ((input_port_read_indexed(machine, 2) & 0x08) << 3); }
+static READ16_HANDLER ( varia_dips_bit3_r ) { return ((input_port_read_indexed(machine, 3) & 0x04) << 5) | ((input_port_read_indexed(machine, 2) & 0x04) << 4); }
+static READ16_HANDLER ( varia_dips_bit2_r ) { return ((input_port_read_indexed(machine, 3) & 0x02) << 6) | ((input_port_read_indexed(machine, 2) & 0x02) << 5); }
+static READ16_HANDLER ( varia_dips_bit1_r ) { return ((input_port_read_indexed(machine, 3) & 0x01) << 7) | ((input_port_read_indexed(machine, 2) & 0x01) << 6); }
static WRITE16_HANDLER( vmetal_control_w )
{
diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c
index 76404c3b169..f7840ad9efb 100644
--- a/src/mame/drivers/warpwarp.c
+++ b/src/mame/drivers/warpwarp.c
@@ -147,10 +147,10 @@ static READ8_HANDLER( geebee_in_r )
int res;
offset &= 3;
- res = readinputport(offset);
+ res = input_port_read_indexed(machine, offset);
if (offset == 3)
{
- res = readinputport(3 + (flip_screen_get() & 1)); // read player 2 input in cocktail mode
+ res = input_port_read_indexed(machine, 3 + (flip_screen_get() & 1)); // read player 2 input in cocktail mode
if (handle_joystick)
{
/* map digital two-way joystick to two fixed VOLIN values */
@@ -218,13 +218,13 @@ static WRITE8_HANDLER( geebee_out7_w )
/* Read Switch Inputs */
static READ8_HANDLER( warpwarp_sw_r )
{
- return (readinputport(0) >> (offset & 7)) & 1;
+ return (input_port_read_indexed(machine, 0) >> (offset & 7)) & 1;
}
/* Read Dipswitches */
static READ8_HANDLER( warpwarp_dsw1_r )
{
- return (readinputport(1) >> (offset & 7)) & 1;
+ return (input_port_read_indexed(machine, 1) >> (offset & 7)) & 1;
}
/* Read mux Controller Inputs */
@@ -232,7 +232,7 @@ static READ8_HANDLER( warpwarp_vol_r )
{
int res;
- res = readinputport(2 + (flip_screen_get() & 1));
+ res = input_port_read_indexed(machine, 2 + (flip_screen_get() & 1));
if (handle_joystick)
{
if (res & 1) return 0x0f;
diff --git a/src/mame/drivers/welltris.c b/src/mame/drivers/welltris.c
index 10c16b82b15..bb4b59434ea 100644
--- a/src/mame/drivers/welltris.c
+++ b/src/mame/drivers/welltris.c
@@ -354,7 +354,7 @@ static WRITE16_HANDLER( sound_command_w )
static READ16_HANDLER( in0_r )
{
- return readinputport(0) | (pending_command ? 0x80 : 0);
+ return input_port_read_indexed(machine, 0) | (pending_command ? 0x80 : 0);
}
static WRITE8_HANDLER( pending_command_clear_w )
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 5c3584c1793..18b15fddc2d 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -548,12 +548,12 @@ static WRITE16_HANDLER( rotate_port_w )
static READ16_HANDLER( wgp_adinput_r )
{
int steer = 0x40;
- int fake = readinputportbytag_safe(FAKE_PORT_TAG,0x00);
+ int fake = input_port_read_safe(machine, FAKE_PORT_TAG,0x00);
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* Reduce span to 0x80 */
- steer = (readinputportbytag_safe(STEER_PORT_TAG,0x00) * 0x80) / 0x100;
+ steer = (input_port_read_safe(machine, STEER_PORT_TAG,0x00) * 0x80) / 0x100;
}
else /* Digital steer */
{
@@ -598,7 +598,7 @@ static READ16_HANDLER( wgp_adinput_r )
}
case 0x05:
- return readinputportbytag_safe(UNKNOWN_PORT_TAG,0x00); /* unknown */
+ return input_port_read_safe(machine, UNKNOWN_PORT_TAG,0x00); /* unknown */
}
logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",activecpu_get_pc(),offset);
diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c
index 2c305e6a94e..1d6602eac6e 100644
--- a/src/mame/drivers/wheelfir.c
+++ b/src/mame/drivers/wheelfir.c
@@ -59,12 +59,12 @@ static READ16_HANDLER( wheelfir_rand1 )
- return readinputport(0)^toggle_bit;// mame_rand(Machine);
+ return input_port_read_indexed(machine, 0)^toggle_bit;// mame_rand(Machine);
}
static READ16_HANDLER( wheelfir_rand2 )
{
- return readinputport(1);// mame_rand(Machine);
+ return input_port_read_indexed(machine, 1);// mame_rand(Machine);
}
diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c
index cf110c16782..c460051278b 100644
--- a/src/mame/drivers/wink.c
+++ b/src/mame/drivers/wink.c
@@ -46,12 +46,12 @@ static WRITE8_HANDLER( wink_coin_counter_w )
static READ8_HANDLER( analog_port_r )
{
- return readinputport(0 /*+ 2 * player_mux*/);
+ return input_port_read_indexed(machine, 0 /*+ 2 * player_mux*/);
}
static READ8_HANDLER( player_inputs_r )
{
- return readinputport(1 /*+ 2 * player_mux*/);
+ return input_port_read_indexed(machine, 1 /*+ 2 * player_mux*/);
}
static WRITE8_HANDLER( sound_irq_w )
diff --git a/src/mame/drivers/wiping.c b/src/mame/drivers/wiping.c
index d4310588981..495a9224fcf 100644
--- a/src/mame/drivers/wiping.c
+++ b/src/mame/drivers/wiping.c
@@ -79,7 +79,7 @@ static READ8_HANDLER( ports_r )
res = 0;
for (i = 0;i < 8;i++)
- res |= ((readinputport(i) >> offset) & 1) << i;
+ res |= ((input_port_read_indexed(machine, i) >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index bf21f689b5e..17bcfbad8d1 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -319,10 +319,10 @@ static READ8_HANDLER(read_a00x)
switch(offset)
{
case 0x02: return reg_a002;
- case 0x04: return readinputportbytag("A004");
- case 0x05: return readinputportbytag("A005");
+ case 0x04: return input_port_read(machine, "A004");
+ case 0x05: return input_port_read(machine, "A005");
case 0x0c: return input_port_0_r(machine,0); // stats / reset
- case 0x0e: return readinputportbytag("A00E");// coin/reset
+ case 0x0e: return input_port_read(machine, "A00E");// coin/reset
}
@@ -411,8 +411,8 @@ static WRITE8_HANDLER(yscroll_w)
scrolly=data;
}
-static READ8_HANDLER(portA_r) { return readinputportbytag("YM_PortA"); }
-static READ8_HANDLER(portB_r) { return readinputportbytag("YM_PortB");}
+static READ8_HANDLER(portA_r) { return input_port_read(machine, "YM_PortA"); }
+static READ8_HANDLER(portB_r) { return input_port_read(machine, "YM_PortB");}
static const struct YM2203interface ym2203_interface_0 =
{
diff --git a/src/mame/drivers/wolfpack.c b/src/mame/drivers/wolfpack.c
index cadd9374d6a..3c691c402b8 100644
--- a/src/mame/drivers/wolfpack.c
+++ b/src/mame/drivers/wolfpack.c
@@ -58,13 +58,13 @@ static MACHINE_RESET( wolfpack )
static READ8_HANDLER( wolfpack_input_r )
{
- UINT8 val = readinputport(0);
+ UINT8 val = input_port_read_indexed(machine, 0);
- if (((readinputport(2) + 0) / 2) & 1)
+ if (((input_port_read_indexed(machine, 2) + 0) / 2) & 1)
{
val |= 1;
}
- if (((readinputport(2) + 1) / 2) & 1)
+ if (((input_port_read_indexed(machine, 2) + 1) / 2) & 1)
{
val |= 2;
}
diff --git a/src/mame/drivers/wwfsstar.c b/src/mame/drivers/wwfsstar.c
index 0546b3a3a8b..1fe7306b4b5 100644
--- a/src/mame/drivers/wwfsstar.c
+++ b/src/mame/drivers/wwfsstar.c
@@ -191,7 +191,7 @@ static INTERRUPT_GEN( wwfsstars_interrupt )
static READ16_HANDLER( input_port_2_word_r_cust )
{
- return readinputport(2) | vblank;
+ return input_port_read_indexed(machine, 2) | vblank;
}
/*******************************************************************************
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index 71dbda049a3..93a23549b7a 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -149,24 +149,24 @@ static READ16_HANDLER( wwfwfest_inputs_read )
switch (offset)
{
case 0x00:
- tmp = readinputport(0) | readinputport(4) << 8;
+ tmp = input_port_read_indexed(machine, 0) | input_port_read_indexed(machine, 4) << 8;
tmp &= 0xcfff;
- tmp |= ((readinputport(7) & 0xc0) << 6);
+ tmp |= ((input_port_read_indexed(machine, 7) & 0xc0) << 6);
break;
case 0x01:
- tmp = readinputport(1);
+ tmp = input_port_read_indexed(machine, 1);
tmp &= 0xc0ff;
- tmp |= ((readinputport(7) & 0x3f)<<8);
+ tmp |= ((input_port_read_indexed(machine, 7) & 0x3f)<<8);
break;
case 0x02:
- tmp = readinputport(2);
+ tmp = input_port_read_indexed(machine, 2);
tmp &= 0xc0ff;
- tmp |= ((readinputport(6) & 0x3f)<<8);
+ tmp |= ((input_port_read_indexed(machine, 6) & 0x3f)<<8);
break;
case 0x03:
- tmp = (readinputport(3) | readinputport(5) << 8) ;
+ tmp = (input_port_read_indexed(machine, 3) | input_port_read_indexed(machine, 5) << 8) ;
tmp &= 0xfcff;
- tmp |= ((readinputport(6) & 0xc0) << 2);
+ tmp |= ((input_port_read_indexed(machine, 6) & 0xc0) << 2);
break;
}
diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c
index c247d901b90..d00296756b6 100644
--- a/src/mame/drivers/xain.c
+++ b/src/mame/drivers/xain.c
@@ -245,7 +245,7 @@ static WRITE8_HANDLER( xain_68705_w )
static READ8_HANDLER( xain_input_port_4_r )
{
- return readinputport(4) | vblank;
+ return input_port_read_indexed(machine, 4) | vblank;
}
static INTERRUPT_GEN( xain_interrupt )
diff --git a/src/mame/drivers/xorworld.c b/src/mame/drivers/xorworld.c
index 2bfed4bcb8c..572bc5acc00 100644
--- a/src/mame/drivers/xorworld.c
+++ b/src/mame/drivers/xorworld.c
@@ -76,7 +76,7 @@ static NVRAM_HANDLER( xorworld )
/* the EEPROM is read thru bit 4 */
static READ16_HANDLER( xorworld_input_r )
{
- return readinputport(0) | ((EEPROM_read_bit() & 0x01) << 4);
+ return input_port_read_indexed(machine, 0) | ((EEPROM_read_bit() & 0x01) << 4);
}
static WRITE16_HANDLER( eeprom_chip_select_w )
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index 6e7280d8e1f..21958497b51 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -207,7 +207,7 @@ static WRITE16_HANDLER( bit_controls_w )
static READ16_HANDLER( port0_r )
{
- int result = readinputport(0);
+ int result = input_port_read_indexed(machine, 0);
result ^= ticket_dispenser_r(machine,0) >> 3;
return result;
}
@@ -215,7 +215,7 @@ static READ16_HANDLER( port0_r )
static READ16_HANDLER( analogx_r )
{
- return (readinputportbytag("ANALOGX") << 8) | 0x00ff;
+ return (input_port_read(machine, "ANALOGX") << 8) | 0x00ff;
}
@@ -223,7 +223,7 @@ static READ16_HANDLER( analogy_watchdog_r )
{
/* doubles as a watchdog address */
watchdog_reset_w(machine,0,0);
- return (readinputportbytag("ANALOGY") << 8) | 0x00ff;
+ return (input_port_read(machine, "ANALOGY") << 8) | 0x00ff;
}
diff --git a/src/mame/drivers/xxmissio.c b/src/mame/drivers/xxmissio.c
index e542f37cce8..e1fbcb2a233 100644
--- a/src/mame/drivers/xxmissio.c
+++ b/src/mame/drivers/xxmissio.c
@@ -38,7 +38,7 @@ static WRITE8_HANDLER( xxmissio_bank_sel_w )
static READ8_HANDLER( xxmissio_status_r )
{
- xxmissio_status = (xxmissio_status | 2) & ( readinputportbytag("IN2") | 0xfd );
+ xxmissio_status = (xxmissio_status | 2) & ( input_port_read(machine, "IN2") | 0xfd );
return xxmissio_status;
}
diff --git a/src/mame/drivers/xybots.c b/src/mame/drivers/xybots.c
index e267b106fbc..3a06f0875a4 100644
--- a/src/mame/drivers/xybots.c
+++ b/src/mame/drivers/xybots.c
@@ -66,7 +66,7 @@ static READ16_HANDLER( special_port1_r )
{
static int h256 = 0x0400;
- int result = readinputport(1);
+ int result = input_port_read_indexed(machine, 1);
if (atarigen_cpu_to_sound_ready) result ^= 0x0200;
result ^= h256 ^= 0x0400;
diff --git a/src/mame/drivers/xyonix.c b/src/mame/drivers/xyonix.c
index 619e0a751d5..791abbbcbc3 100644
--- a/src/mame/drivers/xyonix.c
+++ b/src/mame/drivers/xyonix.c
@@ -43,7 +43,7 @@ static WRITE8_HANDLER( xyonix_irqack_w )
static int e0_data,credits,coins;
-static void handle_coins(int coin)
+static void handle_coins(running_machine *machine, int coin)
{
static const int coinage_table[4][2] = {{2,3},{2,1},{1,2},{1,1}};
int tmp = 0;
@@ -52,7 +52,7 @@ static void handle_coins(int coin)
if (coin & 1) // Coin 2 !
{
- tmp = (readinputport(2) & 0xc0) >> 6;
+ tmp = (input_port_read_indexed(machine, 2) & 0xc0) >> 6;
coins++;
if (coins >= coinage_table[tmp][0])
{
@@ -65,7 +65,7 @@ static void handle_coins(int coin)
if (coin & 2) // Coin 1 !
{
- tmp = (readinputport(2) & 0x30) >> 4;
+ tmp = (input_port_read_indexed(machine, 2) & 0x30) >> 4;
coins++;
if (coins >= coinage_table[tmp][0])
{
@@ -99,23 +99,23 @@ static READ8_HANDLER ( xyonix_io_r )
switch (e0_data)
{
case 0x81 :
- return readinputport(0) & 0x7f;
+ return input_port_read_indexed(machine, 0) & 0x7f;
break;
case 0x82 :
- return readinputport(1) & 0x7f;
+ return input_port_read_indexed(machine, 1) & 0x7f;
break;
case 0x91:
/* check coin inputs */
- coin = ((readinputport(0) & 0x80) >> 7) | ((readinputport(1) & 0x80) >> 6);
+ coin = ((input_port_read_indexed(machine, 0) & 0x80) >> 7) | ((input_port_read_indexed(machine, 1) & 0x80) >> 6);
if (coin ^ prev_coin && coin != 3)
{
- if (credits < 9) handle_coins(coin);
+ if (credits < 9) handle_coins(machine, coin);
}
prev_coin = coin;
return credits;
break;
case 0x92:
- return ((readinputport(0) & 0x80) >> 7) | ((readinputport(1) & 0x80) >> 6);
+ return ((input_port_read_indexed(machine, 0) & 0x80) >> 7) | ((input_port_read_indexed(machine, 1) & 0x80) >> 6);
break;
case 0xe0: /* reset? */
coins = 0;
@@ -127,10 +127,10 @@ static READ8_HANDLER ( xyonix_io_r )
return 0xff;
break;
case 0xfe: /* Dip Switches 1 to 4 */
- return readinputport(2) & 0x0f;
+ return input_port_read_indexed(machine, 2) & 0x0f;
break;
case 0xff: /* Dip Switches 5 to 8 */
- return readinputport(2) >> 4;
+ return input_port_read_indexed(machine, 2) >> 4;
break;
}
}
diff --git a/src/mame/drivers/yumefuda.c b/src/mame/drivers/yumefuda.c
index 0c8f5e9e072..226aaa12774 100644
--- a/src/mame/drivers/yumefuda.c
+++ b/src/mame/drivers/yumefuda.c
@@ -161,14 +161,14 @@ static READ8_HANDLER( mux_r )
{
switch(mux_data)
{
- case 0x00: return readinputport(0);
- case 0x01: return readinputport(1);
- case 0x02: return readinputport(2);
- case 0x04: return readinputport(3);
- case 0x08: return readinputport(4);
+ case 0x00: return input_port_read_indexed(machine, 0);
+ case 0x01: return input_port_read_indexed(machine, 1);
+ case 0x02: return input_port_read_indexed(machine, 2);
+ case 0x04: return input_port_read_indexed(machine, 3);
+ case 0x08: return input_port_read_indexed(machine, 4);
/* FIXME: Was this a quick hack? */
- case 0x10: return 0xff; //return readinputport(5);
- case 0x20: return 0xff; //return readinputport(6);
+ case 0x10: return 0xff; //return input_port_read_indexed(machine, 5);
+ case 0x20: return 0xff; //return input_port_read_indexed(machine, 6);
}
return 0xff;
}
diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c
index 482f9c23860..28c3b20c326 100644
--- a/src/mame/drivers/zaccaria.c
+++ b/src/mame/drivers/zaccaria.c
@@ -79,7 +79,7 @@ logerror("PC %04x: portsel = %02x\n",activecpu_get_pc(),data);
static READ8_HANDLER( zaccaria_dsw_r )
{
- return readinputport(dsw);
+ return input_port_read_indexed(machine, dsw);
}
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index 0525d6e716b..8504888a82c 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -422,7 +422,7 @@ static CUSTOM_INPUT( razmataz_dial_r )
int num = (FPTR)param;
int delta, res;
- delta = readinputportbytag(dialname[num]);
+ delta = input_port_read(machine, dialname[num]);
if (delta < 0x80)
{
diff --git a/src/mame/drivers/zerozone.c b/src/mame/drivers/zerozone.c
index 17cada0a3e9..6257109dccf 100644
--- a/src/mame/drivers/zerozone.c
+++ b/src/mame/drivers/zerozone.c
@@ -42,13 +42,13 @@ static READ16_HANDLER( zerozone_input_r )
switch (offset)
{
case 0x00:
- return readinputport(0); /* IN0 */
+ return input_port_read_indexed(machine, 0); /* IN0 */
case 0x01:
- return (readinputport(1) | (readinputport(2) << 8)); /* IN1 & IN2 */
+ return (input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 2) << 8)); /* IN1 & IN2 */
case 0x04:
- return (readinputport(4) << 8);
+ return (input_port_read_indexed(machine, 4) << 8);
case 0x05:
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",activecpu_get_pc(),0x800000+offset);
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 674b88b5be9..b83ca20a6e0 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -246,8 +246,8 @@ static void sio_dip_handler( int n_data )
{
if( m_b_lastclock )
{
- verboselog( 2, "read dip %02x -> %02x\n", n_data, ( ( readinputport( 7 ) >> m_n_dip_bit ) & 1 ) * PSX_SIO_IN_DATA );
- psx_sio_input( 0, PSX_SIO_IN_DATA, ( ( readinputport( 7 ) >> m_n_dip_bit ) & 1 ) * PSX_SIO_IN_DATA );
+ verboselog( 2, "read dip %02x -> %02x\n", n_data, ( ( input_port_read_indexed(Machine, 7 ) >> m_n_dip_bit ) & 1 ) * PSX_SIO_IN_DATA );
+ psx_sio_input( 0, PSX_SIO_IN_DATA, ( ( input_port_read_indexed(Machine, 7 ) >> m_n_dip_bit ) & 1 ) * PSX_SIO_IN_DATA );
m_n_dip_bit++;
m_n_dip_bit &= 7;
}
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index 8f3d39eedc9..0f757b3a1c4 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -171,20 +171,20 @@ static READ32_HANDLER( sysreg_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= readinputport(0) << 24;
+ r |= input_port_read_indexed(machine, 0) << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= readinputport(1) << 16;
+ r |= input_port_read_indexed(machine, 1) << 16;
}
if (ACCESSING_BITS_8_15)
{
int adc_bit = adc083x_do_read(0);
- r |= ((readinputport(2) & 0x7f) | (adc_bit << 7)) << 8;
+ r |= ((input_port_read_indexed(machine, 2) & 0x7f) | (adc_bit << 7)) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= readinputport(3) << 0;
+ r |= input_port_read_indexed(machine, 3) << 0;
}
}
else if (offset == 1)
@@ -249,11 +249,11 @@ static double adc0838_callback(int input)
switch (input)
{
case ADC083X_CH0:
- return (double)(5 * readinputport(4)) / 255.0;
+ return (double)(5 * input_port_read_indexed(Machine, 4)) / 255.0;
case ADC083X_CH1:
- return (double)(5 * readinputport(5)) / 255.0;
+ return (double)(5 * input_port_read_indexed(Machine, 5)) / 255.0;
case ADC083X_CH2:
- return (double)(5 * readinputport(6)) / 255.0;
+ return (double)(5 * input_port_read_indexed(Machine, 6)) / 255.0;
case ADC083X_CH3:
return 0;
case ADC083X_COM:
diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h
index b0dad666849..52fdd587924 100644
--- a/src/mame/includes/8080bw.h
+++ b/src/mame/includes/8080bw.h
@@ -69,7 +69,7 @@ WRITE8_HANDLER( shuttlei_sh_port_2_w );
extern UINT8 *c8080bw_colorram;
-void c8080bw_flip_screen_w(int data);
+void c8080bw_flip_screen_w(running_machine *machine, int data);
void c8080bw_screen_red_w(int data);
void schaser_background_control_w(int data);
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 2de55287cbe..1a6a4e3811f 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -409,7 +409,7 @@ PALETTE_INIT( amiga );
VIDEO_START( amiga );
VIDEO_UPDATE( amiga );
-UINT32 amiga_gethvpos(void);
+UINT32 amiga_gethvpos(const device_config *screen);
void copper_setpc(UINT32 pc);
void amiga_set_genlock_color(UINT16 color);
void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline);
diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h
index 7a463a607e8..7df5553a476 100644
--- a/src/mame/includes/atari.h
+++ b/src/mame/includes/atari.h
@@ -52,8 +52,8 @@ DEVICE_IMAGE_UNLOAD( a5200_cart );
WRITE8_HANDLER ( atari_serout_w );
void atari_interrupt_cb(int mask);
-void a800_handle_keyboard(void);
-void a5200_handle_keypads(void);
+void a800_handle_keyboard(running_machine *machine);
+void a5200_handle_keypads(running_machine *machine);
/* video */
diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h
index d991b6a9010..2414939d0da 100644
--- a/src/mame/includes/mw8080bw.h
+++ b/src/mame/includes/mw8080bw.h
@@ -40,7 +40,7 @@ extern const char layout_invaders[];
#define TORNBASE_CAB_TYPE_UPRIGHT_OLD (0)
#define TORNBASE_CAB_TYPE_UPRIGHT_NEW (1)
#define TORNBASE_CAB_TYPE_COCKTAIL (2)
-UINT8 tornbase_get_cabinet_type(void);
+UINT8 tornbase_get_cabinet_type(running_machine *machine);
#define DESERTGU_GUN_X_PORT_TAG ("GUNX")
#define DESERTGU_GUN_Y_PORT_TAG ("GUNY")
@@ -63,7 +63,7 @@ void phantom2_set_cloud_counter(UINT16 data);
CUSTOM_INPUT( invaders_in2_control_r );
UINT8 invaders_is_flip_screen(void);
void invaders_set_flip_screen(UINT8 data);
-int invaders_is_cabinet_cocktail(void);
+int invaders_is_cabinet_cocktail(running_machine *machine);
#define BLUESHRK_SPEAR_PORT_TAG ("SPEAR")
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index 2df9fe54768..e63b7b447ce 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -27,7 +27,7 @@
UINT8 vicdual_videoram_r(offs_t offset);
UINT8 vicdual_characterram_r(offs_t offset);
-int vicdual_is_cabinet_color(void);
+int vicdual_is_cabinet_color(running_machine *machine);
/*----------- defined in video/vicdual.c -----------*/
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index 0928f3f50f5..1bd036bb28a 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -116,16 +116,16 @@ READ8_HANDLER( ajax_ls138_f10_r )
data = mame_rand(Machine);
break;
case 0x04: /* 2P inputs */
- data = readinputport(5);
+ data = input_port_read_indexed(machine, 5);
break;
case 0x06: /* 1P inputs + DIPSW #1 & #2 */
if (offset & 0x02)
- data = readinputport(offset & 0x01);
+ data = input_port_read_indexed(machine, offset & 0x01);
else
- data = readinputport(3 + (offset & 0x01));
+ data = input_port_read_indexed(machine, 3 + (offset & 0x01));
break;
case 0x07: /* DIPSW #3 */
- data = readinputport(2);
+ data = input_port_read_indexed(machine, 2);
break;
default:
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c
index 1c6c638750d..f53179b523a 100644
--- a/src/mame/machine/amiga.c
+++ b/src/mame/machine/amiga.c
@@ -462,7 +462,7 @@ static TIMER_CALLBACK( amiga_irq_proc )
CUSTOM_INPUT( amiga_joystick_convert )
{
- UINT8 bits = readinputportbytag(param);
+ UINT8 bits = input_port_read(machine, param);
int up = (bits >> 0) & 1;
int down = (bits >> 1) & 1;
int left = (bits >> 2) & 1;
@@ -1204,11 +1204,11 @@ READ16_HANDLER( amiga_custom_r )
case REG_VPOSR:
CUSTOM_REG(REG_VPOSR) &= 0xff00;
- CUSTOM_REG(REG_VPOSR) |= amiga_gethvpos() >> 16;
+ CUSTOM_REG(REG_VPOSR) |= amiga_gethvpos(machine->primary_screen) >> 16;
return CUSTOM_REG(REG_VPOSR);
case REG_VHPOSR:
- return amiga_gethvpos() & 0xffff;
+ return amiga_gethvpos(machine->primary_screen) & 0xffff;
case REG_SERDATR:
CUSTOM_REG(REG_SERDATR) &= ~0x4000;
@@ -1218,24 +1218,24 @@ READ16_HANDLER( amiga_custom_r )
case REG_JOY0DAT:
if (amiga_intf->joy0dat_r != NULL)
return (*amiga_intf->joy0dat_r)();
- return readinputportbytag_safe("JOY0DAT", 0xffff);
+ return input_port_read_safe(machine, "JOY0DAT", 0xffff);
case REG_JOY1DAT:
if (amiga_intf->joy1dat_r != NULL)
return (*amiga_intf->joy1dat_r)();
- return readinputportbytag_safe("JOY1DAT", 0xffff);
+ return input_port_read_safe(machine, "JOY1DAT", 0xffff);
case REG_ADKCONR:
return CUSTOM_REG(REG_ADKCON);
case REG_POTGOR:
- return readinputportbytag_safe("POTGO", 0x5500);
+ return input_port_read_safe(machine, "POTGO", 0x5500);
case REG_POT0DAT:
- return readinputportbytag_safe("POT0DAT", 0x0000);
+ return input_port_read_safe(machine, "POT0DAT", 0x0000);
case REG_POT1DAT:
- return readinputportbytag_safe("POT1DAT", 0x0000);
+ return input_port_read_safe(machine, "POT1DAT", 0x0000);
case REG_DSKBYTR:
if (amiga_intf->dskbytr_r != NULL)
diff --git a/src/mame/machine/asteroid.c b/src/mame/machine/asteroid.c
index ae265c3cb28..f316f0e8a6a 100644
--- a/src/mame/machine/asteroid.c
+++ b/src/mame/machine/asteroid.c
@@ -17,21 +17,21 @@ UINT8 *asteroid_ram1, *asteroid_ram2;
INTERRUPT_GEN( asteroid_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (!(readinputport(0) & 0x80))
+ if (!(input_port_read_indexed(machine, 0) & 0x80))
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( asterock_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if ((readinputport(0) & 0x80))
+ if ((input_port_read_indexed(machine, 0) & 0x80))
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( llander_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (readinputport(0) & 0x02)
+ if (input_port_read_indexed(machine, 0) & 0x02)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -42,7 +42,7 @@ READ8_HANDLER( asteroid_IN0_r )
int res;
int bitmask;
- res=readinputport(0);
+ res=input_port_read_indexed(machine, 0);
bitmask = (1 << offset);
@@ -64,7 +64,7 @@ READ8_HANDLER( asteroib_IN0_r )
{
int res;
- res=readinputport(0);
+ res=input_port_read_indexed(machine, 0);
// if (activecpu_gettotalcycles() & 0x100)
// res |= 0x02;
@@ -79,7 +79,7 @@ READ8_HANDLER( asterock_IN0_r )
int res;
int bitmask;
- res=readinputport(0);
+ res=input_port_read_indexed(machine, 0);
bitmask = (1 << offset);
@@ -106,7 +106,7 @@ READ8_HANDLER( asteroid_IN1_r )
int res;
int bitmask;
- res=readinputport(1);
+ res=input_port_read_indexed(machine, 1);
bitmask = (1 << (offset & 0x7));
if (res & bitmask)
@@ -122,7 +122,7 @@ READ8_HANDLER( asteroid_DSW1_r )
int res;
int res1;
- res1 = readinputport(2);
+ res1 = input_port_read_indexed(machine, 2);
res = 0xfc | ((res1 >> (2 * (3 - (offset & 0x3)))) & 0x3);
return res;
@@ -182,7 +182,7 @@ READ8_HANDLER( llander_IN0_r )
{
int res;
- res = readinputport(0);
+ res = input_port_read_indexed(machine, 0);
if (avgdvg_done())
res |= 0x01;
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index efbd17fc846..019fb977058 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -80,12 +80,12 @@ void atari_interrupt_cb(int mask)
static READ8_HANDLER(atari_pia_pa_r)
{
- return atari_input_disabled() ? 0xFF : readinputportbytag_safe("djoy_0_1", 0);
+ return atari_input_disabled() ? 0xFF : input_port_read_safe(machine, "djoy_0_1", 0);
}
static READ8_HANDLER(atari_pia_pb_r)
{
- return atari_input_disabled() ? 0xFF : readinputportbytag_safe("djoy_2_3", 0);
+ return atari_input_disabled() ? 0xFF : input_port_read_safe(machine, "djoy_2_3", 0);
}
static WRITE8_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(data); }
@@ -521,7 +521,7 @@ static const UINT8 keys[64][4] = {
};
-void a800_handle_keyboard(void)
+void a800_handle_keyboard(running_machine *machine)
{
static int atari_last = 0xff;
int i, modifiers, atari_code;
@@ -540,7 +540,7 @@ void a800_handle_keyboard(void)
for( i = 0; i < 64; i++ )
{
sprintf(tag, "keyboard_%d", i / 16);
- if( readinputportbytag_safe(tag, 0) & (1 << (i&15)) )
+ if( input_port_read_safe(machine, tag, 0) & (1 << (i&15)) )
{
atari_code = keys[i][modifiers];
if( atari_code != AKEY_NONE )
@@ -566,7 +566,7 @@ void a800_handle_keyboard(void)
#define VKEY_BREAK 0x10
/* absolutely no clue what to do here :((( */
-void a5200_handle_keypads(void)
+void a5200_handle_keypads(running_machine *machine)
{
int i, modifiers;
static int atari_last = 0xff;
@@ -584,7 +584,7 @@ void a5200_handle_keypads(void)
/* check keypad */
for (i = 0; i < 16; i++)
{
- if( readinputportbytag("keypad") & (1 << i) )
+ if( input_port_read(machine, "keypad") & (1 << i) )
{
if( i == atari_last )
return;
@@ -600,7 +600,7 @@ void a5200_handle_keypads(void)
}
/* check top button */
- if ((readinputportbytag("djoy_b") & 0x10) == 0)
+ if ((input_port_read(machine, "djoy_b") & 0x10) == 0)
{
if (atari_last == 0xFE)
return;
@@ -714,7 +714,7 @@ static void cart_reset(running_machine *machine)
static UINT8 console_read(void)
{
- return readinputportbytag("console");
+ return input_port_read(Machine, "console");
}
diff --git a/src/mame/machine/atarifb.c b/src/mame/machine/atarifb.c
index 9ae5716cf7a..5e6ed10b8de 100644
--- a/src/mame/machine/atarifb.c
+++ b/src/mame/machine/atarifb.c
@@ -161,14 +161,14 @@ READ8_HANDLER( atarifb_in0_r )
int new_x,new_y;
/* Read player 1 trackball */
- new_x = readinputport(3);
+ new_x = input_port_read_indexed(machine, 3);
if (new_x != counter_x)
{
sign_x_1 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = readinputport(2);
+ new_y = input_port_read_indexed(machine, 2);
if (new_y != counter_y)
{
sign_y_1 = (new_y - counter_y) & 0x80;
@@ -192,14 +192,14 @@ READ8_HANDLER( atarifb_in2_r )
int new_x,new_y;
/* Read player 2 trackball */
- new_x = readinputport(5);
+ new_x = input_port_read_indexed(machine, 5);
if (new_x != counter_x)
{
sign_x_2 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = readinputport(4);
+ new_y = input_port_read_indexed(machine, 4);
if (new_y != counter_y)
{
sign_y_2 = (new_y - counter_y) & 0x80;
@@ -234,14 +234,14 @@ READ8_HANDLER( atarifb4_in0_r )
int new_x,new_y;
/* Read player 1 trackball */
- new_x = readinputport(4);
+ new_x = input_port_read_indexed(machine, 4);
if (new_x != counter_x)
{
sign_x_1 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = readinputport(3);
+ new_y = input_port_read_indexed(machine, 3);
if (new_y != counter_y)
{
sign_y_1 = (new_y - counter_y) & 0x80;
@@ -257,14 +257,14 @@ READ8_HANDLER( atarifb4_in0_r )
int new_x,new_y;
/* Read player 2 trackball */
- new_x = readinputport(6);
+ new_x = input_port_read_indexed(machine, 6);
if (new_x != counter_x)
{
sign_x_2 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = readinputport(5);
+ new_y = input_port_read_indexed(machine, 5);
if (new_y != counter_y)
{
sign_y_2 = (new_y - counter_y) & 0x80;
@@ -291,14 +291,14 @@ READ8_HANDLER( atarifb4_in2_r )
int new_x,new_y;
/* Read player 3 trackball */
- new_x = readinputport(8);
+ new_x = input_port_read_indexed(machine, 8);
if (new_x != counter_x)
{
sign_x_3 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = readinputport(7);
+ new_y = input_port_read_indexed(machine, 7);
if (new_y != counter_y)
{
sign_y_3 = (new_y - counter_y) & 0x80;
@@ -314,14 +314,14 @@ READ8_HANDLER( atarifb4_in2_r )
int new_x,new_y;
/* Read player 4 trackball */
- new_x = readinputport(10);
+ new_x = input_port_read_indexed(machine, 10);
if (new_x != counter_x)
{
sign_x_4 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = readinputport(9);
+ new_y = input_port_read_indexed(machine, 9);
if (new_y != counter_y)
{
sign_y_4 = (new_y - counter_y) & 0x80;
diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c
index aa9f5359eab..e59a9162904 100644
--- a/src/mame/machine/balsente.c
+++ b/src/mame/machine/balsente.c
@@ -21,7 +21,7 @@ static void poly17_init(void);
static void counter_set_out(int which, int gate);
static TIMER_CALLBACK( counter_callback );
static TIMER_CALLBACK( clock_counter_0_ff );
-static void update_grudge_steering(void);
+static void update_grudge_steering(running_machine *machine);
/* global data */
UINT8 balsente_shooter;
@@ -123,7 +123,7 @@ static TIMER_CALLBACK( interrupt_timer )
/* if this is Grudge Match, update the steering */
if (grudge_steering_result & 0x80)
- update_grudge_steering();
+ update_grudge_steering(machine);
/* if we're a shooter, we do a little more work */
if (balsente_shooter)
@@ -133,8 +133,8 @@ static TIMER_CALLBACK( interrupt_timer )
/* we latch the beam values on the first interrupt after VBLANK */
if (param == 64 && balsente_shooter)
{
- balsente_shooter_x = readinputport(8);
- balsente_shooter_y = readinputport(9);
+ balsente_shooter_x = input_port_read_indexed(machine, 8);
+ balsente_shooter_y = input_port_read_indexed(machine, 9);
}
/* which bits get returned depends on which scanline we're at */
@@ -611,7 +611,7 @@ INTERRUPT_GEN( balsente_update_analog_inputs )
/* ports are read once a frame, just at varying intervals. To get around this, we */
/* read all the analog inputs at VBLANK time and just return the cached values. */
for (i = 0; i < 4; i++)
- analog_input_data[i] = readinputport(4 + i);
+ analog_input_data[i] = input_port_read_indexed(machine, 4 + i);
}
@@ -1122,7 +1122,7 @@ WRITE8_HANDLER( balsente_register_addr_w )
READ8_HANDLER( nstocker_port2_r )
{
- return (readinputport(2) & 0xf0) | nstocker_bits;
+ return (input_port_read_indexed(machine, 2) & 0xf0) | nstocker_bits;
}
@@ -1161,15 +1161,15 @@ READ8_HANDLER( spiker_expand_r )
}
-static void update_grudge_steering(void)
+static void update_grudge_steering(running_machine *machine)
{
UINT8 wheel[3];
INT8 diff[3];
/* read the current steering values */
- wheel[0] = readinputport(4);
- wheel[1] = readinputport(5);
- wheel[2] = readinputport(6);
+ wheel[0] = input_port_read_indexed(machine, 4);
+ wheel[1] = input_port_read_indexed(machine, 5);
+ wheel[2] = input_port_read_indexed(machine, 6);
/* diff the values */
diff[0] = wheel[0] - grudge_last_steering[0];
diff --git a/src/mame/machine/bonzeadv.c b/src/mame/machine/bonzeadv.c
index d8e705871ef..fff0159780c 100644
--- a/src/mame/machine/bonzeadv.c
+++ b/src/mame/machine/bonzeadv.c
@@ -445,10 +445,10 @@ READ16_HANDLER( bonzeadv_cchip_ram_r )
{
switch (offset)
{
- case 0x03: return readinputportbytag("800007"); /* STARTn + SERVICE1 */
- case 0x04: return readinputportbytag("800009"); /* COINn */
- case 0x05: return readinputportbytag("80000B"); /* Player controls + TILT */
- case 0x06: return readinputportbytag("80000D"); /* Player controls (cocktail) */
+ case 0x03: return input_port_read(machine, "800007"); /* STARTn + SERVICE1 */
+ case 0x04: return input_port_read(machine, "800009"); /* COINn */
+ case 0x05: return input_port_read(machine, "80000B"); /* Player controls + TILT */
+ case 0x06: return input_port_read(machine, "80000D"); /* Player controls (cocktail) */
case 0x08: return cc_port;
}
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index 4fc0de342f7..6431a93d181 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -181,7 +181,7 @@ WRITE8_HANDLER( bublbobl_mcu_ddr4_w )
READ8_HANDLER( bublbobl_mcu_port1_r )
{
//logerror("%04x: 6801U4 port 1 read\n",activecpu_get_pc());
- port1_in = readinputport(0);
+ port1_in = input_port_read_indexed(machine, 0);
return (port1_out & ddr1) | (port1_in & ~ddr1);
}
@@ -230,7 +230,7 @@ WRITE8_HANDLER( bublbobl_mcu_port2_w )
{
// read
if ((address & 0x0800) == 0x0000)
- port3_in = readinputport((address & 3) + 1);
+ port3_in = input_port_read_indexed(machine, (address & 3) + 1);
else if ((address & 0x0c00) == 0x0c00)
port3_in = bublbobl_mcu_sharedram[address & 0x03ff];
// logerror("reading %02x from shared RAM %04x\n",port3_in,address);
@@ -451,7 +451,7 @@ WRITE8_HANDLER( bublbobl_68705_portB_w )
if ((address & 0x0800) == 0x0000)
{
//logerror("%04x: 68705 read input port %02x\n",activecpu_get_pc(),address);
- latch = readinputport((address & 3) + 1);
+ latch = input_port_read_indexed(machine, (address & 3) + 1);
}
else if ((address & 0x0c00) == 0x0c00)
{
diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c
index c9c658ee58b..15042f6b006 100644
--- a/src/mame/machine/carpolo.c
+++ b/src/mame/machine/carpolo.c
@@ -241,7 +241,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
/* check the coins here as well - they drive the clock of the flip-flops */
- port_value = readinputport(0);
+ port_value = input_port_read_indexed(machine, 0);
TTL7474_clock_w(TTL7474_2S_1, port_value & 0x01);
TTL7474_clock_w(TTL7474_2S_2, port_value & 0x02);
@@ -261,7 +261,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
int dir_flip_flop = movement_flip_flop + 1;
- port_value = readinputport(2 + player);
+ port_value = input_port_read_indexed(machine, 2 + player);
if (port_value != last_wheel_value[player])
{
@@ -282,7 +282,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
/* finally read the accelerator pedals */
- port_value = readinputport(6);
+ port_value = input_port_read_indexed(machine, 6);
for (player = 0; player < 4; player++)
{
@@ -446,7 +446,7 @@ static READ8_HANDLER( pia_1_port_a_r )
(TTL7474_output_r(TTL7474_1C_2) ? 0x02 : 0x00) |
(TTL7474_output_r(TTL7474_1D_2) ? 0x04 : 0x00) |
(TTL7474_output_r(TTL7474_1F_2) ? 0x08 : 0x00) |
- (readinputport(7) & 0xf0);
+ (input_port_read_indexed(machine, 7) & 0xf0);
return ret;
}
diff --git a/src/mame/machine/cchip.c b/src/mame/machine/cchip.c
index 4b216d65a9c..b2ac87d0b43 100644
--- a/src/mame/machine/cchip.c
+++ b/src/mame/machine/cchip.c
@@ -125,9 +125,9 @@ READ16_HANDLER( cchip1_ram_r )
{
switch (offset)
{
- case 0x00: return readinputportbytag("IN0"); /* Player 1 controls + START1 */
- case 0x01: return readinputportbytag("IN1"); /* Player 2 controls + START2 */
- case 0x02: return readinputportbytag("IN2"); /* COINn + SERVICE1 + TILT */
+ case 0x00: return input_port_read(machine, "IN0"); /* Player 1 controls + START1 */
+ case 0x01: return input_port_read(machine, "IN1"); /* Player 2 controls + START2 */
+ case 0x02: return input_port_read(machine, "IN2"); /* COINn + SERVICE1 + TILT */
case 0x03: return cc_port;
}
}
diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c
index 226ad13d65e..f114ae6a444 100644
--- a/src/mame/machine/dc.c
+++ b/src/mame/machine/dc.c
@@ -446,7 +446,7 @@ WRITE64_HANDLER( dc_maple_w )
maple0x86data2[3] = maple0x86data2[3] | 0x0c;
maple0x86data2[6] = maple0x86data2[6] & 0xcf;
- a = readinputportbytag("IN0"); // put keys here
+ a = input_port_read(machine, "IN0"); // put keys here
maple0x86data2[6] = maple0x86data2[6] | (a << 4);
pos = 0x11;
tocopy = 17;
@@ -524,10 +524,10 @@ WRITE64_HANDLER( dc_maple_w )
// first function
maple0x86data2[pos+ 9]=1; // report
maple0x86data2[pos+10]=0; // bits TEST TILT1 TILT2 TILT3 ? ? ? ?
- maple0x86data2[pos+11]=readinputportbytag("IN1"); // bits 1Pstart 1Pservice 1Pup 1Pdown 1Pleft 1Pright 1Ppush1 1Ppush2
- maple0x86data2[pos+12]=readinputportbytag("IN2"); // bits 1Ppush3 1Ppush4 1Ppush5 1Ppush6 1Ppush7 1Ppush8 ...
- maple0x86data2[pos+13]=readinputportbytag("IN3"); // bits 2Pstart 2Pservice 2Pup 2Pdown 2Pleft 2Pright 2Ppush1 2Ppush2
- maple0x86data2[pos+14]=readinputportbytag("IN4"); // bits 2Ppush3 2Ppush4 2Ppush5 2Ppush6 2Ppush7 2Ppush8 ...
+ maple0x86data2[pos+11]=input_port_read(machine, "IN1"); // bits 1Pstart 1Pservice 1Pup 1Pdown 1Pleft 1Pright 1Ppush1 1Ppush2
+ maple0x86data2[pos+12]=input_port_read(machine, "IN2"); // bits 1Ppush3 1Ppush4 1Ppush5 1Ppush6 1Ppush7 1Ppush8 ...
+ maple0x86data2[pos+13]=input_port_read(machine, "IN3"); // bits 2Pstart 2Pservice 2Pup 2Pdown 2Pleft 2Pright 2Ppush1 2Ppush2
+ maple0x86data2[pos+14]=input_port_read(machine, "IN4"); // bits 2Ppush3 2Ppush4 2Ppush5 2Ppush6 2Ppush7 2Ppush8 ...
// second function
maple0x86data2[pos+15]=1; // report
maple0x86data2[pos+16]=(dc_coin_counts[0] >> 8) & 0xff; // 1CONDITION, 1SLOT COIN(bit13-8)
diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c
index ad5a9f5ea6c..a1ff6f0d315 100644
--- a/src/mame/machine/dec0.c
+++ b/src/mame/machine/dec0.c
@@ -20,13 +20,13 @@ READ16_HANDLER( dec0_controls_r )
switch (offset<<1)
{
case 0: /* Player 1 & 2 joystick & buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Credits, start buttons */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 8: /* Intel 8751 mc, Bad Dudes & Heavy Barrel only */
//logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",activecpu_get_pc(),0x30c000+offset);
@@ -44,10 +44,10 @@ READ16_HANDLER( dec0_rotary_r )
switch (offset<<1)
{
case 0: /* Player 1 rotary */
- return ~(1 << (readinputport(5) * 12 / 256));
+ return ~(1 << (input_port_read_indexed(machine, 5) * 12 / 256));
case 8: /* Player 2 rotary */
- return ~(1 << (readinputport(6) * 12 / 256));
+ return ~(1 << (input_port_read_indexed(machine, 6) * 12 / 256));
default:
logerror("Unknown rotary read at 300000 %02x\n",offset);
@@ -63,19 +63,19 @@ READ16_HANDLER( midres_controls_r )
switch (offset<<1)
{
case 0: /* Player 1 Joystick + start, Player 2 Joystick + start */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Dipswitches */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 4: /* Player 1 rotary */
- return ~(1 << (readinputport(5) * 12 / 256));
+ return ~(1 << (input_port_read_indexed(machine, 5) * 12 / 256));
case 6: /* Player 2 rotary */
- return ~(1 << (readinputport(6) * 12 / 256));
+ return ~(1 << (input_port_read_indexed(machine, 6) * 12 / 256));
case 8: /* Credits, start buttons */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 12:
return 0; /* ?? watchdog ?? */
@@ -92,13 +92,13 @@ READ16_HANDLER( slyspy_controls_r )
switch (offset<<1)
{
case 0: /* Dip Switches */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 2: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 4: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
}
logerror("Unknown control read at 30c000 %d\n",offset);
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 6cb4253b94e..cae44c35c44 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -208,7 +208,7 @@ READ8_HANDLER( decocass_input_r )
switch (offset & 7)
{
case 0: case 1: case 2:
- data = readinputport(offset & 7);
+ data = input_port_read_indexed(machine, offset & 7);
break;
case 3: case 4: case 5: case 6:
data = decocass_quadrature_decoder[(offset & 7) - 3];
diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c
index 39299ce7696..6433946572e 100644
--- a/src/mame/machine/decoprot.c
+++ b/src/mame/machine/decoprot.c
@@ -129,16 +129,16 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */
{
switch (offset<<1) {
case 0x110: /* Player input */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x36c: /* Coins */
case 0x334: /* Probably also, c6, 2c0, 2e0, 4b2, 46a, 4da, rohga is 44c */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x0dc:
- return readinputport(1)<<4;
+ return input_port_read_indexed(machine, 1)<<4;
case 0x494: /* Dips */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x244:
return deco16_prot_ram[0];
@@ -361,9 +361,9 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
/* Player 1 & 2 controls, read in IRQ then written *back* to protection device */
case 0x50: /* written to 9e byte */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x6f8: /* written to 76 byte */
- return (readinputport(0)>>8)|(readinputport(0)<<8); /* byte swap IN0 */
+ return (input_port_read_indexed(machine, 0)>>8)|(input_port_read_indexed(machine, 0)<<8); /* byte swap IN0 */
case 0x5c: /* After coin insert, high 0x8000 bit set starts game */
return deco16_prot_ram[0x3b];
@@ -373,9 +373,9 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return ((deco16_prot_ram[0x9e/2]&0xff00)>>8) | ((deco16_prot_ram[0x9e/2]&0x00ff)<<8);
case 0xac: /* Dip switches */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0xc2:
- return readinputport(2) ^ deco16_prot_ram[0x2c/2];
+ return input_port_read_indexed(machine, 2) ^ deco16_prot_ram[0x2c/2];
case 0x5d4: /* The state of the dips last frame */
return deco16_prot_ram[0x34/2];
@@ -387,7 +387,7 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return (((deco16_prot_ram[0]&0xfff0)>>0) | ((deco16_prot_ram[0]&0x000c)>>2) | ((deco16_prot_ram[0]&0x0003)<<2)) & (~deco16_prot_ram[0x36/2]);
case 0x76a: /* Coins */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x284: /* Bit shifting with inverted mask register */
return (((deco16_prot_ram[0x40/2]&0xfff0)>>0) | ((deco16_prot_ram[0x40/2]&0x0007)<<1) | ((deco16_prot_ram[0x40/2]&0x0008)>>3)) & (~deco16_prot_ram[0x36/2]);
@@ -401,7 +401,7 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return (((deco16_prot_ram[0x6a/2]&0x00f0)<<4) | ((deco16_prot_ram[0x6a/2]&0x0f00)<<4) | ((deco16_prot_ram[0x6a/2]&0x0007)<<5) | ((deco16_prot_ram[0x6a/2]&0x0008)<<1)) & (~deco16_prot_ram[0x36/2]);
case 0x7d6: /* XOR IN0 */
- return readinputport(0) ^ deco16_prot_ram[0x2c/2];
+ return input_port_read_indexed(machine, 0) ^ deco16_prot_ram[0x2c/2];
case 0x4b4:
return ((deco16_prot_ram[0x32/2]&0x00f0)<<8) | ((deco16_prot_ram[0x32/2]&0x000e)<<7) | ((deco16_prot_ram[0x32/2]&0x0001)<<11);
}
@@ -462,15 +462,15 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
switch (offset*2) {
case 0xac: /* Dip switches */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0xc2: /* Dip switches */
- return readinputport(2) ^ deco16_prot_ram[0x2c/2];
+ return input_port_read_indexed(machine, 2) ^ deco16_prot_ram[0x2c/2];
case 0x46: /* Coins */
- return readinputport(1) ^ deco16_prot_ram[0x2c/2];
+ return input_port_read_indexed(machine, 1) ^ deco16_prot_ram[0x2c/2];
case 0x50: /* Player 1 & 2 input ports */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x63c: /* Player 1 & 2 input ports */
- return readinputport(0) ^ deco16_prot_ram[0x2c/2];
+ return input_port_read_indexed(machine, 0) ^ deco16_prot_ram[0x2c/2];
case 0x5f4:
return deco16_prot_ram[0x18/2];
@@ -645,13 +645,13 @@ READ16_HANDLER( deco16_104_cninja_prot_r )
return deco16_prot_ram[15];
case 0x36: /* Dip switches */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x1c8: /* Coins */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x22c: /* Player 1 & 2 input ports */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset);
@@ -741,15 +741,15 @@ READ16_HANDLER( deco16_146_funkyjet_prot_r )
return ((deco16_prot_ram[0x78e>>1]>>4)&0xff00) | (deco16_prot_ram[0x78e>>1]&0x000f) | ((deco16_prot_ram[0x78e>>1]<<8)&0xf000);
case 0x00c >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
- return (readinputport(0) + (readinputport(1) << 8));
+ return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 0x778 >> 1: /* Credits */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x382 >> 1: /* DIPS */
- return (readinputport(3) + (readinputport(4) << 8));
+ return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
}
if (activecpu_get_pc()!=0xc0ea)
- logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n",activecpu_get_pc(),offset<<1, readinputport(0));
+ logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n",activecpu_get_pc(),offset<<1, input_port_read_indexed(machine, 0));
return 0;
}
@@ -858,14 +858,14 @@ READ16_HANDLER( deco16_104_rohga_prot_r )
switch (offset) {
case 0x88/2: /* Player 1 & 2 input ports */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x36c/2:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x44c/2:
- return ((readinputport(1)&0x7)<<13)|((readinputport(1)&0x8)<<9);
+ return ((input_port_read_indexed(machine, 1)&0x7)<<13)|((input_port_read_indexed(machine, 1)&0x8)<<9);
case 0x292/2: /* Dips */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x44/2:
return ((((DECO_PORT(0x2c)&0x000f)<<12)) ^ deco16_xor) & (~deco16_mask);
@@ -1242,11 +1242,11 @@ static READ16_HANDLER( deco16_146_core_prot_r )
switch (offset)
{
case 0x582: /* Player 1 & Player 2 */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x04c: /* Coins/VBL */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x672: /* Dip switches */
- return readinputport(2);
+ return input_port_read_indexed(machine, 2);
case 0x13a:
return ((DECO_PORT(0x190)&0x00f0)<<8) | ((DECO_PORT(0x190)&0x0003)<<10) | ((DECO_PORT(0x190)&0x000c)<<6);
@@ -1304,8 +1304,8 @@ static READ16_HANDLER( deco16_146_core_prot_r )
/*********************************************************************************/
-// case 0x582: return readinputport(0); /* IN0 */
-// case 0x672: return readinputport(1); /* IN1 */
+// case 0x582: return input_port_read_indexed(machine, 0); /* IN0 */
+// case 0x672: return input_port_read_indexed(machine, 1); /* IN1 */
// case 0x04c: return EEPROM_read_bit();
case 0x468:
@@ -1653,8 +1653,8 @@ READ32_HANDLER( deco16_146_fghthist_prot_r )
/* Special case inputs, because this is the only game with an eprom */
switch (addr)
{
- case 0x582: return (readinputport(0)<<16) | 0xffff; /* IN0 */
- case 0x672: return (readinputport(1)<<16) | 0xffff; /* IN1 */
+ case 0x582: return (input_port_read_indexed(machine, 0)<<16) | 0xffff; /* IN0 */
+ case 0x672: return (input_port_read_indexed(machine, 1)<<16) | 0xffff; /* IN1 */
case 0x04c: return (EEPROM_read_bit()<<16) | 0xffff;
}
diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c
index b0df1dbbdfd..2badfdea8ee 100644
--- a/src/mame/machine/gaelco2.c
+++ b/src/mame/machine/gaelco2.c
@@ -193,7 +193,7 @@ READ16_HANDLER( gaelco2_eeprom_r )
/* bit 6 is EEPROM data (DOUT) */
/* bit 7 is EEPROM ready */
/* bits 0-5, COINSW, STARTSW & Service */
- return (1 << 7) | (EEPROM_read_bit() << 6) | (readinputport(2) & 0x3f);
+ return (1 << 7) | (EEPROM_read_bit() << 6) | (input_port_read_indexed(machine, 2) & 0x3f);
}
WRITE16_HANDLER( gaelco2_eeprom_cs_w )
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index 4a9ab4f4394..239e2f00c1d 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -225,9 +225,9 @@ DRIVER_INIT( dingoe )
static READ8_HANDLER( kingball_IN0_r )
{
if (kingball_speech_dip)
- return (readinputport(0) & ~0x40) | ((readinputport(3) & 0x01) << 6);
+ return (input_port_read_indexed(machine, 0) & ~0x40) | ((input_port_read_indexed(machine, 3) & 0x01) << 6);
else
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
static READ8_HANDLER( kingball_IN1_r )
@@ -236,7 +236,7 @@ static READ8_HANDLER( kingball_IN1_r )
that it's working, doesn't actually use return value, so we can just use
rand() */
- return (readinputport(1) & ~0x20) | (mame_rand(Machine) & 0x20);
+ return (input_port_read_indexed(machine, 1) & ~0x20) | (mame_rand(Machine) & 0x20);
}
WRITE8_HANDLER( kingball_speech_dip_w )
@@ -282,12 +282,12 @@ READ8_HANDLER( scramblb_protection_2_r )
static READ8_HANDLER( azurian_IN1_r )
{
- return (readinputport(1) & ~0x40) | ((readinputport(3) & 0x01) << 6);
+ return (input_port_read_indexed(machine, 1) & ~0x40) | ((input_port_read_indexed(machine, 3) & 0x01) << 6);
}
static READ8_HANDLER( azurian_IN2_r )
{
- return (readinputport(2) & ~0x04) | ((readinputport(3) & 0x02) << 1);
+ return (input_port_read_indexed(machine, 2) & ~0x04) | ((input_port_read_indexed(machine, 3) & 0x02) << 1);
}
@@ -300,12 +300,12 @@ WRITE8_HANDLER( _4in1_bank_w )
READ8_HANDLER( _4in1_input_port_1_r )
{
- return (readinputport(1) & ~0xc0) | (readinputport(3+_4in1_bank) & 0xc0);
+ return (input_port_read_indexed(machine, 1) & ~0xc0) | (input_port_read_indexed(machine, 3+_4in1_bank) & 0xc0);
}
READ8_HANDLER( _4in1_input_port_2_r )
{
- return (readinputport(2) & 0x04) | (readinputport(3+_4in1_bank) & ~0xc4);
+ return (input_port_read_indexed(machine, 2) & 0x04) | (input_port_read_indexed(machine, 3+_4in1_bank) & ~0xc4);
}
@@ -320,17 +320,17 @@ static void gmgalax_select_game(int game)
READ8_HANDLER( gmgalax_input_port_0_r )
{
- return readinputport(gmgalax_selected_game ? 3 : 0);
+ return input_port_read_indexed(machine, gmgalax_selected_game ? 3 : 0);
}
READ8_HANDLER( gmgalax_input_port_1_r )
{
- return readinputport(gmgalax_selected_game ? 4 : 1);
+ return input_port_read_indexed(machine, gmgalax_selected_game ? 4 : 1);
}
READ8_HANDLER( gmgalax_input_port_2_r )
{
- return readinputport(gmgalax_selected_game ? 5 : 2);
+ return input_port_read_indexed(machine, gmgalax_selected_game ? 5 : 2);
}
diff --git a/src/mame/machine/gaplus.c b/src/mame/machine/gaplus.c
index d726303860e..fa412cfaf0e 100644
--- a/src/mame/machine/gaplus.c
+++ b/src/mame/machine/gaplus.c
@@ -37,7 +37,7 @@ READ8_HANDLER( gaplus_customio_3_r )
switch (offset)
{
case 0:
- return readinputport( 4 ); /* cabinet & test mode */
+ return input_port_read_indexed(machine, 4 ); /* cabinet & test mode */
break;
case 2:
return 0x0f;
@@ -51,7 +51,7 @@ READ8_HANDLER( gaplus_customio_3_r )
switch (offset)
{
case 0:
- return readinputport( 4 ); /* cabinet & test mode */
+ return input_port_read_indexed(machine, 4 ); /* cabinet & test mode */
break;
case 1:
return 0x0f;
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index c81173337c3..0aa5ce311e0 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -350,7 +350,7 @@ READ16_HANDLER( hd68k_port0_r )
.....
0x8000 = SW1 #1
*/
- int temp = readinputport(0);
+ int temp = input_port_read_indexed(machine, 0);
if (atarigen_get_hblank(machine->primary_screen)) temp ^= 0x0002;
temp ^= 0x0018; /* both EOCs always high for now */
return temp;
@@ -359,7 +359,7 @@ READ16_HANDLER( hd68k_port0_r )
READ16_HANDLER( hdc68k_port1_r )
{
- UINT16 result = readinputport(1);
+ UINT16 result = input_port_read_indexed(machine, 1);
UINT16 diff = result ^ hdc68k_last_port1;
/* if a new shifter position is selected, use it */
@@ -387,7 +387,7 @@ READ16_HANDLER( hdc68k_port1_r )
READ16_HANDLER( hda68k_port1_r )
{
- UINT16 result = readinputport(1);
+ UINT16 result = input_port_read_indexed(machine, 1);
/* merge in the wheel edge latch bit */
if (hdc68k_wheel_edge)
@@ -400,7 +400,7 @@ READ16_HANDLER( hda68k_port1_r )
READ16_HANDLER( hdc68k_wheel_r )
{
/* grab the new wheel value and upconvert to 12 bits */
- UINT16 new_wheel = readinputport(10) << 4;
+ UINT16 new_wheel = input_port_read_indexed(machine, 10) << 4;
/* hack to display the wheel position */
if (input_code_pressed(KEYCODE_LSHIFT))
@@ -451,14 +451,14 @@ WRITE16_HANDLER( hd68k_adc_control_w )
if (adc_control & 0x08)
{
adc8_select = adc_control & 0x07;
- adc8_data = readinputport(2 + adc8_select);
+ adc8_data = input_port_read_indexed(machine, 2 + adc8_select);
}
/* handle a write to the 12-bit ADC address select */
if (adc_control & 0x40)
{
adc12_select = (adc_control >> 4) & 0x03;
- adc12_data = readinputport(10 + adc12_select) << 4;
+ adc12_data = input_port_read_indexed(machine, 10 + adc12_select) << 4;
}
/* bit 7 selects which byte of the 12 bit data to read */
diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c
index a9eef3f8a05..6ec73208607 100644
--- a/src/mame/machine/irobot.c
+++ b/src/mame/machine/irobot.c
@@ -226,9 +226,9 @@ READ8_HANDLER( irobot_control_r )
{
if (irobot_control_num == 0)
- return readinputport (5);
+ return input_port_read_indexed(machine, 5);
else if (irobot_control_num == 1)
- return readinputport (6);
+ return input_port_read_indexed(machine, 6);
return 0;
}
diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c
index a358d326002..a3a052b3a16 100644
--- a/src/mame/machine/kaneko16.c
+++ b/src/mame/machine/kaneko16.c
@@ -270,7 +270,7 @@ FFFE : probably polled by MCU, needs to be kept alive (cleared by main cpu - IT2
00207FE0 : may serves for relocating code (written as .l)
*/
-static void calc3_mcu_run(void);
+static void calc3_mcu_run(running_machine *machine);
static int calc3_mcu_status, calc3_mcu_command_offset;
@@ -284,14 +284,14 @@ void calc3_mcu_init(void)
WRITE16_HANDLER( calc3_mcu_ram_w )
{
COMBINE_DATA(&kaneko16_mcu_ram[offset]);
- calc3_mcu_run();
+ calc3_mcu_run(machine);
}
#define CALC3_MCU_COM_W(_n_) \
WRITE16_HANDLER( calc3_mcu_com##_n_##_w ) \
{ \
calc3_mcu_status |= (1 << _n_); \
- calc3_mcu_run(); \
+ calc3_mcu_run(machine); \
}
CALC3_MCU_COM_W(0)
@@ -312,7 +312,7 @@ CALC3_MCU_COM_W(3)
- Supply code snippets to the 68000
*/
-static void calc3_mcu_run(void)
+static void calc3_mcu_run(running_machine *machine)
{
UINT16 mcu_command;
@@ -343,7 +343,7 @@ static void calc3_mcu_run(void)
// execute the command:
- kaneko16_mcu_ram[param1 / 2] = ~readinputport(4); // DSW
+ kaneko16_mcu_ram[param1 / 2] = ~input_port_read_indexed(machine, 4); // DSW
kaneko16_mcu_ram[param2 / 2] = 0xffff; // ? -1 / anything else
calc3_mcu_command_offset = param3 / 2; // where next command will be written?
@@ -542,10 +542,10 @@ probably the MCU model string, so this one should be in internal MCU ROM (anothe
TODO: look at this one since this remark is only driver-based.
*/
-void (*toybox_mcu_run)(void); /* One of the following */
-void bloodwar_mcu_run(void);
-void bonkadv_mcu_run(void);
-void gtmr_mcu_run(void);
+void (*toybox_mcu_run)(running_machine *machine); /* One of the following */
+void bloodwar_mcu_run(running_machine *machine);
+void bonkadv_mcu_run(running_machine *machine);
+void gtmr_mcu_run(running_machine *machine);
static UINT16 toybox_mcu_com[4];
@@ -564,7 +564,7 @@ WRITE16_HANDLER( toybox_mcu_com##_n_##_w ) \
if (toybox_mcu_com[3] != 0xFFFF) return; \
\
memset(toybox_mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- toybox_mcu_run(); \
+ toybox_mcu_run(machine); \
}
TOYBOX_MCU_COM_W(0)
@@ -586,7 +586,7 @@ READ16_HANDLER( toybox_mcu_status_r )
Blood Warrior
***************************************************************************/
-void bloodwar_mcu_run(void)
+void bloodwar_mcu_run(running_machine *machine)
{
UINT16 mcu_command = kaneko16_mcu_ram[0x0010/2];
UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2;
@@ -620,7 +620,7 @@ void bloodwar_mcu_run(void)
case 0x03: // DSW
{
- kaneko16_mcu_ram[mcu_offset] = readinputport(4);
+ kaneko16_mcu_ram[mcu_offset] = input_port_read_indexed(machine, 4);
logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", activecpu_get_pc(), mcu_command, mcu_offset*2);
}
break;
@@ -700,7 +700,7 @@ void bloodwar_mcu_run(void)
Bonk's Adventure
***************************************************************************/
-void bonkadv_mcu_run(void)
+void bonkadv_mcu_run(running_machine *machine)
{
UINT16 mcu_command = kaneko16_mcu_ram[0x0010/2];
UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2;
@@ -747,7 +747,7 @@ void bonkadv_mcu_run(void)
case 0x03: // DSW
{
- kaneko16_mcu_ram[mcu_offset] = readinputport(4);
+ kaneko16_mcu_ram[mcu_offset] = input_port_read_indexed(machine, 4);
logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", activecpu_get_pc(), mcu_command, mcu_offset*2);
}
break;
@@ -820,7 +820,7 @@ void bonkadv_mcu_run(void)
- Read the DSWs
*/
-void gtmr_mcu_run(void)
+void gtmr_mcu_run(running_machine *machine)
{
UINT16 mcu_command = kaneko16_mcu_ram[0x0010/2];
UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2;
@@ -855,7 +855,7 @@ void gtmr_mcu_run(void)
case 0x03: // DSW
{
- kaneko16_mcu_ram[mcu_offset] = readinputport(4);
+ kaneko16_mcu_ram[mcu_offset] = input_port_read_indexed(machine, 4);
}
break;
diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c
index cfec1cde6a8..8b3b7cad810 100644
--- a/src/mame/machine/leland.c
+++ b/src/mame/machine/leland.c
@@ -129,16 +129,16 @@ static int dial_compute_value(int new_val, int indx)
READ8_HANDLER( cerberus_dial_1_r )
{
- int original = readinputport(0);
- int modified = dial_compute_value(readinputport(4), 0);
+ int original = input_port_read_indexed(machine, 0);
+ int modified = dial_compute_value(input_port_read_indexed(machine, 4), 0);
return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
}
READ8_HANDLER( cerberus_dial_2_r )
{
- int original = readinputport(2);
- int modified = dial_compute_value(readinputport(5), 1);
+ int original = input_port_read_indexed(machine, 2);
+ int modified = dial_compute_value(input_port_read_indexed(machine, 5), 1);
return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
}
@@ -180,10 +180,10 @@ WRITE8_HANDLER( alleymas_joystick_kludge )
*
*************************************/
-static void update_dangerz_xy(void)
+static void update_dangerz_xy(running_machine *machine)
{
- UINT8 newy = readinputport(4);
- UINT8 newx = readinputport(5);
+ UINT8 newy = input_port_read_indexed(machine, 4);
+ UINT8 newx = input_port_read_indexed(machine, 5);
int deltay = newy - dial_last_input[0];
int deltax = newx - dial_last_input[1];
@@ -206,21 +206,21 @@ static void update_dangerz_xy(void)
READ8_HANDLER( dangerz_input_y_r )
{
- update_dangerz_xy();
+ update_dangerz_xy(machine);
return dangerz_y & 0xff;
}
READ8_HANDLER( dangerz_input_x_r )
{
- update_dangerz_xy();
+ update_dangerz_xy(machine);
return dangerz_x & 0xff;
}
READ8_HANDLER( dangerz_input_upper_r )
{
- update_dangerz_xy();
+ update_dangerz_xy(machine);
return ((dangerz_y >> 2) & 0xc0) | ((dangerz_x >> 8) & 0x03);
}
@@ -236,27 +236,27 @@ static const UINT8 redline_pedal_value[8] = { 0xf0, 0xe0, 0xc0, 0xd0, 0x90, 0xb0
READ8_HANDLER( redline_pedal_1_r )
{
- int pedal = readinputport(0);
+ int pedal = input_port_read_indexed(machine, 0);
return redline_pedal_value[pedal >> 5] | 0x0f;
}
READ8_HANDLER( redline_pedal_2_r )
{
- int pedal = readinputport(2);
+ int pedal = input_port_read_indexed(machine, 2);
return redline_pedal_value[pedal >> 5] | 0x0f;
}
READ8_HANDLER( redline_wheel_1_r )
{
- return dial_compute_value(readinputport(4), 0);
+ return dial_compute_value(input_port_read_indexed(machine, 4), 0);
}
READ8_HANDLER( redline_wheel_2_r )
{
- return dial_compute_value(readinputport(5), 1);
+ return dial_compute_value(input_port_read_indexed(machine, 5), 1);
}
@@ -269,19 +269,19 @@ READ8_HANDLER( redline_wheel_2_r )
READ8_HANDLER( offroad_wheel_1_r )
{
- return dial_compute_value(readinputport(7), 0);
+ return dial_compute_value(input_port_read_indexed(machine, 7), 0);
}
READ8_HANDLER( offroad_wheel_2_r )
{
- return dial_compute_value(readinputport(8), 1);
+ return dial_compute_value(input_port_read_indexed(machine, 8), 1);
}
READ8_HANDLER( offroad_wheel_3_r )
{
- return dial_compute_value(readinputport(9), 2);
+ return dial_compute_value(input_port_read_indexed(machine, 9), 2);
}
@@ -294,7 +294,7 @@ READ8_HANDLER( offroad_wheel_3_r )
READ8_HANDLER( ataxx_trackball_r )
{
- return dial_compute_value(readinputport(3 + offset), offset);
+ return dial_compute_value(input_port_read_indexed(machine, 3 + offset), offset);
}
@@ -307,7 +307,7 @@ READ8_HANDLER( ataxx_trackball_r )
READ8_HANDLER( indyheat_wheel_r )
{
- return dial_compute_value(readinputport(3 + offset), offset);
+ return dial_compute_value(input_port_read_indexed(machine, 3 + offset), offset);
}
@@ -337,7 +337,7 @@ WRITE8_HANDLER( indyheat_analog_w )
switch (offset)
{
case 3:
- analog_result = readinputport(6 + data);
+ analog_result = input_port_read_indexed(machine, 6 + data);
break;
case 0:
@@ -493,7 +493,7 @@ static TIMER_CALLBACK( ataxx_interrupt_callback )
INTERRUPT_GEN( leland_master_interrupt )
{
/* check for coins here */
- if ((readinputport(1) & 0x0e) != 0x0e)
+ if ((input_port_read_indexed(machine, 1) & 0x0e) != 0x0e)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
}
@@ -844,7 +844,7 @@ void ataxx_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offse
READ8_HANDLER( ataxx_eeprom_r )
{
- int port = readinputport(2);
+ int port = input_port_read_indexed(machine, 2);
if (LOG_EEPROM) logerror("%04X:EE read\n", safe_activecpu_get_pc());
return (port & ~0x01) | EEPROM_read_bit();
}
@@ -1114,7 +1114,7 @@ WRITE8_HANDLER( leland_master_analog_key_w )
break;
case 0x01: /* FE = analog port select/bankswitch */
- analog_result = readinputport((data & 15) + 4);
+ analog_result = input_port_read_indexed(machine, (data & 15) + 4);
/* update top board banking for some games */
if (LOG_BANKSWITCHING_M)
@@ -1145,11 +1145,11 @@ READ8_HANDLER( leland_master_input_r )
switch (offset)
{
case 0x00: /* /GIN0 */
- result = readinputport(0);
+ result = input_port_read_indexed(machine, 0);
break;
case 0x01: /* /GIN1 */
- result = readinputport(1);
+ result = input_port_read_indexed(machine, 1);
if (cpunum_get_reg(1, Z80_HALT))
result ^= 0x01;
break;
@@ -1165,11 +1165,11 @@ READ8_HANDLER( leland_master_input_r )
break;
case 0x10: /* /GIN0 */
- result = readinputport(2);
+ result = input_port_read_indexed(machine, 2);
break;
case 0x11: /* /GIN1 */
- result = readinputport(3);
+ result = input_port_read_indexed(machine, 3);
if (LOG_EEPROM) logerror("%04X:EE read\n", safe_activecpu_get_pc());
result = (result & ~0x01) | EEPROM_read_bit();
break;
@@ -1228,11 +1228,11 @@ READ8_HANDLER( ataxx_master_input_r )
switch (offset)
{
case 0x06: /* /GIN0 */
- result = readinputport(0);
+ result = input_port_read_indexed(machine, 0);
break;
case 0x07: /* /SLVBLK */
- result = readinputport(1);
+ result = input_port_read_indexed(machine, 1);
if (cpunum_get_reg(1, Z80_HALT))
result ^= 0x01;
break;
diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c
index fdd92c64dd8..6ea64091924 100644
--- a/src/mame/machine/mcr.c
+++ b/src/mame/machine/mcr.c
@@ -141,7 +141,7 @@ READ8_HANDLER( zwackery_port_2_r );
static READ8_HANDLER( zwackery_port_1_r )
{
- UINT8 ret = readinputport(1);
+ UINT8 ret = input_port_read_indexed(machine, 1);
pia_set_port_a_z_mask(3, ret);
@@ -151,7 +151,7 @@ static READ8_HANDLER( zwackery_port_1_r )
static READ8_HANDLER( zwackery_port_3_r )
{
- UINT8 ret = readinputport(3);
+ UINT8 ret = input_port_read_indexed(machine, 3);
pia_set_port_a_z_mask(4, ret);
diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c
index c3b8d5075a8..61b8cd39759 100644
--- a/src/mame/machine/mexico86.c
+++ b/src/mame/machine/mexico86.c
@@ -46,7 +46,7 @@ WRITE8_HANDLER( mexico86_f008_w )
***************************************************************************/
-static void mcu_simulate(void)
+static void mcu_simulate(running_machine *machine)
{
if (!kikikai_mcu_initialised)
{
@@ -71,7 +71,7 @@ logerror("initialising MCU\n");
int coin_curr;
- coin_curr = ~readinputport(0) & 1;
+ coin_curr = ~input_port_read_indexed(machine, 0) & 1;
if (coin_curr && !coin_last && mexico86_protection_ram[0x01] < 9)
{
mexico86_protection_ram[0x01]++; // increase credits counter
@@ -81,8 +81,8 @@ logerror("initialising MCU\n");
mexico86_protection_ram[0x04] = 0x3c; // coin inputs
- mexico86_protection_ram[0x02] = BITSWAP8(readinputport(1), 7,6,5,4,2,3,1,0); // player 1
- mexico86_protection_ram[0x03] = BITSWAP8(readinputport(2), 7,6,5,4,2,3,1,0); // player 2
+ mexico86_protection_ram[0x02] = BITSWAP8(input_port_read_indexed(machine, 1), 7,6,5,4,2,3,1,0); // player 1
+ mexico86_protection_ram[0x03] = BITSWAP8(input_port_read_indexed(machine, 2), 7,6,5,4,2,3,1,0); // player 2
if (mexico86_protection_ram[0x19] == 0xaa) // player 2 active
mexico86_protection_ram[0x1b] = mexico86_protection_ram[0x03];
@@ -154,7 +154,7 @@ logerror("initialising MCU\n");
INTERRUPT_GEN( kikikai_interrupt )
{
if (kikikai_mcu_running)
- mcu_simulate();
+ mcu_simulate(machine);
cpunum_set_input_line_vector(0,0,mexico86_protection_ram[0]);
cpunum_set_input_line(machine, 0,0,HOLD_LINE);
@@ -302,7 +302,7 @@ WRITE8_HANDLER( mexico86_68705_portB_w )
else
{
//logerror("%04x: 68705 read input port %04x\n",activecpu_get_pc(),address);
- latch = readinputport((address & 1) + 1);
+ latch = input_port_read_indexed(machine, (address & 1) + 1);
}
}
else /* write */
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index 9434342fe20..8317775ecc8 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -225,9 +225,9 @@ READ8_HANDLER( mhavoc_port_0_r )
/* Bits 7-6 = selected based on Player 1 */
/* Bits 5-4 = common */
if (player_1)
- res = (readinputport(0) & 0x30) | (readinputport(5) & 0xc0);
+ res = (input_port_read_indexed(machine, 0) & 0x30) | (input_port_read_indexed(machine, 5) & 0xc0);
else
- res = readinputport(0) & 0xf0;
+ res = input_port_read_indexed(machine, 0) & 0xf0;
/* Bit 3 = Gamma rcvd flag */
if (gamma_rcvd)
@@ -252,7 +252,7 @@ READ8_HANDLER( mhavoc_port_0_r )
READ8_HANDLER( alphaone_port_0_r )
{
/* Bits 7-2 = common */
- UINT8 res = readinputport(0) & 0xfc;
+ UINT8 res = input_port_read_indexed(machine, 0) & 0xfc;
/* Bit 1 = 2.4kHz (divide 2.5MHz by 1024) */
if (!(activecpu_gettotalcycles() & 0x400))
@@ -269,7 +269,7 @@ READ8_HANDLER( alphaone_port_0_r )
READ8_HANDLER( mhavoc_port_1_r )
{
/* Bits 7-2 = input switches */
- UINT8 res = readinputport(1) & 0xfc;
+ UINT8 res = input_port_read_indexed(machine, 1) & 0xfc;
/* Bit 1 = Alpha rcvd flag */
if (has_gamma_cpu && alpha_rcvd)
@@ -285,7 +285,7 @@ READ8_HANDLER( mhavoc_port_1_r )
READ8_HANDLER( mhavoc_port_1_sp_r )
{
/* Bits 7-3 = input switches */
- UINT8 res = readinputport(1) & 0xf8;
+ UINT8 res = input_port_read_indexed(machine, 1) & 0xf8;
/* Bit 2 = TMS5220 ready flag */
if (!tms5220_ready_r())
diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c
index 2c36aaa8f7b..5cb3c9172e9 100644
--- a/src/mame/machine/midtunit.c
+++ b/src/mame/machine/midtunit.c
@@ -105,7 +105,7 @@ READ16_HANDLER( midtunit_cmos_r )
READ16_HANDLER( midtunit_input_r )
{
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
}
diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c
index 94ab6af3146..ccf9db38d14 100644
--- a/src/mame/machine/midwayic.c
+++ b/src/mame/machine/midwayic.c
@@ -870,7 +870,7 @@ READ32_HANDLER( midway_ioasic_r )
switch (offset)
{
case IOASIC_PORT0:
- result = readinputport(0);
+ result = input_port_read_indexed(machine, 0);
/* bit 0 seems to be a ready flag before shuffling happens */
if (!ioasic.shuffle_active)
{
@@ -882,15 +882,15 @@ READ32_HANDLER( midway_ioasic_r )
break;
case IOASIC_PORT1:
- result = readinputport(1);
+ result = input_port_read_indexed(machine, 1);
break;
case IOASIC_PORT2:
- result = readinputport(2);
+ result = input_port_read_indexed(machine, 2);
break;
case IOASIC_PORT3:
- result = readinputport(3);
+ result = input_port_read_indexed(machine, 3);
break;
case IOASIC_UARTIN:
diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c
index fe60d729a0d..301d6062f9e 100644
--- a/src/mame/machine/midwunit.c
+++ b/src/mame/machine/midwunit.c
@@ -188,7 +188,7 @@ READ16_HANDLER( midwunit_io_r )
case 1:
case 2:
case 3:
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
case 4:
return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(machine,0,0);
@@ -211,7 +211,7 @@ READ16_HANDLER( midxunit_io_r )
case 1:
case 2:
case 3:
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
default:
logerror("%08X:Unknown I/O read from %d\n", activecpu_get_pc(), offset);
@@ -223,7 +223,7 @@ READ16_HANDLER( midxunit_io_r )
READ16_HANDLER( midxunit_analog_r )
{
- return readinputport(midxunit_analog_port);
+ return input_port_read_indexed(machine, midxunit_analog_port);
}
diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c
index 59d1c9c52f6..3ea9ae61cff 100644
--- a/src/mame/machine/midyunit.c
+++ b/src/mame/machine/midyunit.c
@@ -142,7 +142,7 @@ READ16_HANDLER( midyunit_protection_r )
READ16_HANDLER( midyunit_input_r )
{
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
}
@@ -156,15 +156,15 @@ READ16_HANDLER( midyunit_input_r )
static READ16_HANDLER( term2_input_r )
{
if (offset != 2)
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
switch (term2_analog_select)
{
default:
- case 0: return readinputport(2); break;
- case 1: return readinputport(6); break;
- case 2: return readinputport(7); break;
- case 3: return readinputport(8); break;
+ case 0: return input_port_read_indexed(machine, 2); break;
+ case 1: return input_port_read_indexed(machine, 6); break;
+ case 2: return input_port_read_indexed(machine, 7); break;
+ case 3: return input_port_read_indexed(machine, 8); break;
}
}
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index 24aede9b075..5bea339907b 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -1092,7 +1092,7 @@ static UINT8 calc_mempack_crc(UINT8 *buffer, int length)
return crc;
}
-static int pif_channel_handle_command(int channel, int slength, UINT8 *sdata, int rlength, UINT8 *rdata)
+static int pif_channel_handle_command(running_machine *machine, int channel, int slength, UINT8 *sdata, int rlength, UINT8 *rdata)
{
int i;
UINT8 command = sdata[0];
@@ -1156,9 +1156,9 @@ static int pif_channel_handle_command(int channel, int slength, UINT8 *sdata, in
{
case 0:
{
- buttons = readinputport((channel*3) + 0);
- x = readinputport((channel*3) + 1) - 128;
- y = readinputport((channel*3) + 2) - 128;
+ buttons = input_port_read_indexed(machine, (channel*3) + 0);
+ x = input_port_read_indexed(machine, (channel*3) + 1) - 128;
+ y = input_port_read_indexed(machine, (channel*3) + 2) - 128;
rdata[0] = (buttons >> 8) & 0xff;
rdata[1] = (buttons >> 0) & 0xff;
@@ -1319,7 +1319,7 @@ static int pif_channel_handle_command(int channel, int slength, UINT8 *sdata, in
return 0;
}
-static void handle_pif(void)
+static void handle_pif(running_machine *machine)
{
int j;
@@ -1371,7 +1371,7 @@ static void handle_pif(void)
send_buffer[j] = pif_cmd[cmd_ptr++];
}
- res = pif_channel_handle_command(channel, bytes_to_send, send_buffer, bytes_to_recv, recv_buffer);
+ res = pif_channel_handle_command(machine, channel, bytes_to_send, send_buffer, bytes_to_recv, recv_buffer);
if (res == 0)
{
@@ -1411,7 +1411,7 @@ static void handle_pif(void)
*/
}
-static void pif_dma(int direction)
+static void pif_dma(running_machine *machine, int direction)
{
int i;
UINT32 *src, *dst;
@@ -1438,7 +1438,7 @@ static void pif_dma(int direction)
}
else // PIF RAM -> RDRAM
{
- handle_pif();
+ handle_pif(machine);
dst = (UINT32*)&rdram[(si_dram_addr & 0x1fffffff) / 4];
@@ -1483,13 +1483,13 @@ WRITE32_HANDLER( n64_si_reg_w )
case 0x04/4: // SI_PIF_ADDR_RD64B_REG
// PIF RAM -> RDRAM
si_pif_addr = data;
- pif_dma(0);
+ pif_dma(machine, 0);
break;
case 0x10/4: // SI_PIF_ADDR_WR64B_REG
// RDRAM -> PIF RAM
si_pif_addr = data;
- pif_dma(1);
+ pif_dma(machine, 1);
break;
case 0x18/4: // SI_STATUS_REG
diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c
index bea3bb5fe15..d18f5641692 100644
--- a/src/mame/machine/namcoio.c
+++ b/src/mame/machine/namcoio.c
@@ -382,7 +382,7 @@ static UINT8 namcoio_51XX_read(running_machine *machine, int chip)
}
}
- if (~readinputport(0) & 0x80) /* check test mode switch */
+ if (~input_port_read_indexed(machine, 0) & 0x80) /* check test mode switch */
return 0xbb;
return (io[chip].credits / 10) * 16 + io[chip].credits % 10;
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index d3f8dabe3f8..2b712958fcd 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -1257,9 +1257,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (readinputportbytag("CONTROL0")&0x90) | qstrobe | (readinputportbytag("PADDLE0")&0x0f);
+ ret = (input_port_read(machine, "CONTROL0")&0x90) | qstrobe | (input_port_read(machine, "PADDLE0")&0x0f);
else
- ret = (readinputportbytag("CONTROL0")&0x90) | qstrobe | (readinputportbytag("PADDLE1")&0x0f);
+ ret = (input_port_read(machine, "CONTROL0")&0x90) | qstrobe | (input_port_read(machine, "PADDLE1")&0x0f);
qstrobe ^= 0x40;
@@ -1270,9 +1270,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (readinputportbytag("CONTROL1")&0x90) | qnum | (readinputportbytag("PADDLE0")>>4);
+ ret = (input_port_read(machine, "CONTROL1")&0x90) | qnum | (input_port_read(machine, "PADDLE0")>>4);
else
- ret = (readinputportbytag("CONTROL1")&0x90) | qnum | (readinputportbytag("PADDLE1")>>4);
+ ret = (input_port_read(machine, "CONTROL1")&0x90) | qnum | (input_port_read(machine, "PADDLE1")>>4);
if (!qstrobe) qnum ^= 0x20;
@@ -1302,7 +1302,7 @@ static READ8_HANDLER( berabohm_buttons_r )
{
int inp = input_count;
- if (inp == 4) res = readinputportbytag("CONTROL0");
+ if (inp == 4) res = input_port_read(machine, "CONTROL0");
else
{
char portname[4];
@@ -1311,7 +1311,7 @@ static READ8_HANDLER( berabohm_buttons_r )
static int counter[4];
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = readinputportbytag(portname);
+ res = input_port_read(machine, portname);
if (res & 0x80)
{
if (counter[inp] >= 0)
@@ -1335,7 +1335,7 @@ static READ8_HANDLER( berabohm_buttons_r )
counter[inp] = -1;
#else
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = readinputportbytag(portname);
+ res = input_port_read(machine, portname);
if (res & 1) res = 0x7f; /* weak */
else if (res & 2) res = 0x48; /* medium */
else if (res & 4) res = 0x40; /* strong */
@@ -1346,7 +1346,7 @@ static READ8_HANDLER( berabohm_buttons_r )
}
else
{
- res = readinputportbytag("CONTROL1") & 0x8f;
+ res = input_port_read(machine, "CONTROL1") & 0x8f;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1388,13 +1388,13 @@ static READ8_HANDLER( faceoff_inputs_r )
if (offset == 0)
{
- res = (readinputportbytag("CONTROL0") & 0x80) | stored_input[0];
+ res = (input_port_read(machine, "CONTROL0") & 0x80) | stored_input[0];
return res;
}
else
{
- res = readinputportbytag("CONTROL1") & 0x80;
+ res = input_port_read(machine, "CONTROL1") & 0x80;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1409,15 +1409,15 @@ static READ8_HANDLER( faceoff_inputs_r )
switch (input_count)
{
case 0:
- stored_input[0] = readinputportbytag("IN0") & 0x1f;
- stored_input[1] = (readinputportbytag("IN3") & 0x07) << 3;
+ stored_input[0] = input_port_read(machine, "IN0") & 0x1f;
+ stored_input[1] = (input_port_read(machine, "IN3") & 0x07) << 3;
case 3:
- stored_input[0] = readinputportbytag("IN2") & 0x1f;
+ stored_input[0] = input_port_read(machine, "IN2") & 0x1f;
case 4:
- stored_input[0] = readinputportbytag("IN1") & 0x1f;
- stored_input[1] = readinputportbytag("IN3") & 0x18;
+ stored_input[0] = input_port_read(machine, "IN1") & 0x1f;
+ stored_input[1] = input_port_read(machine, "IN3") & 0x18;
}
input_count = (input_count + 1) & 7;
diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c
index 7732b9fcc50..b267888ee9f 100644
--- a/src/mame/machine/namcos2.c
+++ b/src/mame/machine/namcos2.c
@@ -835,18 +835,18 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
READ8_HANDLER( namcos2_input_port_0_r )
{
- int data=readinputport(0);
+ int data=input_port_read_indexed(machine, 0);
return data;
}
READ8_HANDLER( namcos2_input_port_10_r )
{
- int data=readinputport(10);
+ int data=input_port_read_indexed(machine, 10);
return data;
}
READ8_HANDLER( namcos2_input_port_12_r )
{
- int data=readinputport(12);
+ int data=input_port_read_indexed(machine, 12);
return data;
}
diff --git a/src/mame/machine/nb1413m3.c b/src/mame/machine/nb1413m3.c
index 41ed443d9be..b7ab81c5b30 100644
--- a/src/mame/machine/nb1413m3.c
+++ b/src/mame/machine/nb1413m3.c
@@ -401,53 +401,53 @@ READ8_HANDLER( nb1413m3_inputport1_r )
case NB1413M3_TAIWANMB:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return readinputport(4);
- case 0x02: return readinputport(5);
- case 0x04: return readinputport(6);
- case 0x08: return readinputport(7);
- case 0x10: return readinputport(8);
- default: return (readinputport(4) & readinputport(5) & readinputport(6) & readinputport(7) & readinputport(8));
+ case 0x01: return input_port_read_indexed(machine, 4);
+ case 0x02: return input_port_read_indexed(machine, 5);
+ case 0x04: return input_port_read_indexed(machine, 6);
+ case 0x08: return input_port_read_indexed(machine, 7);
+ case 0x10: return input_port_read_indexed(machine, 8);
+ default: return (input_port_read_indexed(machine, 4) & input_port_read_indexed(machine, 5) & input_port_read_indexed(machine, 6) & input_port_read_indexed(machine, 7) & input_port_read_indexed(machine, 8));
}
break;
case NB1413M3_HYHOO:
case NB1413M3_HYHOO2:
switch ((nb1413m3_inputport ^ 0xff) & 0x07)
{
- case 0x01: return readinputport(3);
- case 0x02: return readinputport(4);
+ case 0x01: return input_port_read_indexed(machine, 3);
+ case 0x02: return input_port_read_indexed(machine, 4);
case 0x04: return 0xff;
default: return 0xff;
}
break;
case NB1413M3_MSJIKEN:
case NB1413M3_TELMAHJN:
- if (readinputport(0) & 0x80)
+ if (input_port_read_indexed(machine, 0) & 0x80)
{
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return readinputport(3);
- case 0x02: return readinputport(4);
- case 0x04: return readinputport(5);
- case 0x08: return readinputport(6);
- case 0x10: return readinputport(7);
- default: return (readinputport(3) & readinputport(4) & readinputport(5) & readinputport(6) & readinputport(7));
+ case 0x01: return input_port_read_indexed(machine, 3);
+ case 0x02: return input_port_read_indexed(machine, 4);
+ case 0x04: return input_port_read_indexed(machine, 5);
+ case 0x08: return input_port_read_indexed(machine, 6);
+ case 0x10: return input_port_read_indexed(machine, 7);
+ default: return (input_port_read_indexed(machine, 3) & input_port_read_indexed(machine, 4) & input_port_read_indexed(machine, 5) & input_port_read_indexed(machine, 6) & input_port_read_indexed(machine, 7));
}
}
- else return readinputport(14);
+ else return input_port_read_indexed(machine, 14);
break;
case NB1413M3_PAIRSNB:
case NB1413M3_PAIRSTEN:
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
break;
default:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return readinputport(3);
- case 0x02: return readinputport(4);
- case 0x04: return readinputport(5);
- case 0x08: return readinputport(6);
- case 0x10: return readinputport(7);
- default: return (readinputport(3) & readinputport(4) & readinputport(5) & readinputport(6) & readinputport(7));
+ case 0x01: return input_port_read_indexed(machine, 3);
+ case 0x02: return input_port_read_indexed(machine, 4);
+ case 0x04: return input_port_read_indexed(machine, 5);
+ case 0x08: return input_port_read_indexed(machine, 6);
+ case 0x10: return input_port_read_indexed(machine, 7);
+ default: return (input_port_read_indexed(machine, 3) & input_port_read_indexed(machine, 4) & input_port_read_indexed(machine, 5) & input_port_read_indexed(machine, 6) & input_port_read_indexed(machine, 7));
}
break;
}
@@ -462,12 +462,12 @@ READ8_HANDLER( nb1413m3_inputport2_r )
case NB1413M3_TAIWANMB:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return readinputport(9);
- case 0x02: return readinputport(10);
- case 0x04: return readinputport(11);
- case 0x08: return readinputport(12);
- case 0x10: return readinputport(13);
- default: return (readinputport(9) & readinputport(10) & readinputport(11) & readinputport(12) & readinputport(13));
+ case 0x01: return input_port_read_indexed(machine, 9);
+ case 0x02: return input_port_read_indexed(machine, 10);
+ case 0x04: return input_port_read_indexed(machine, 11);
+ case 0x08: return input_port_read_indexed(machine, 12);
+ case 0x10: return input_port_read_indexed(machine, 13);
+ default: return (input_port_read_indexed(machine, 9) & input_port_read_indexed(machine, 10) & input_port_read_indexed(machine, 11) & input_port_read_indexed(machine, 12) & input_port_read_indexed(machine, 13));
}
break;
case NB1413M3_HYHOO:
@@ -476,39 +476,39 @@ READ8_HANDLER( nb1413m3_inputport2_r )
{
case 0x01: return 0xff;
case 0x02: return 0xff;
- case 0x04: return readinputport(5);
+ case 0x04: return input_port_read_indexed(machine, 5);
default: return 0xff;
}
break;
case NB1413M3_MSJIKEN:
case NB1413M3_TELMAHJN:
- if (readinputport(0) & 0x80)
+ if (input_port_read_indexed(machine, 0) & 0x80)
{
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return readinputport(8);
- case 0x02: return readinputport(9);
- case 0x04: return readinputport(10);
- case 0x08: return readinputport(11);
- case 0x10: return readinputport(12);
- default: return (readinputport(8) & readinputport(9) & readinputport(10) & readinputport(11) & readinputport(12));
+ case 0x01: return input_port_read_indexed(machine, 8);
+ case 0x02: return input_port_read_indexed(machine, 9);
+ case 0x04: return input_port_read_indexed(machine, 10);
+ case 0x08: return input_port_read_indexed(machine, 11);
+ case 0x10: return input_port_read_indexed(machine, 12);
+ default: return (input_port_read_indexed(machine, 8) & input_port_read_indexed(machine, 9) & input_port_read_indexed(machine, 10) & input_port_read_indexed(machine, 11) & input_port_read_indexed(machine, 12));
}
}
- else return readinputport(13);
+ else return input_port_read_indexed(machine, 13);
break;
case NB1413M3_PAIRSNB:
case NB1413M3_PAIRSTEN:
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
break;
default:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return readinputport(8);
- case 0x02: return readinputport(9);
- case 0x04: return readinputport(10);
- case 0x08: return readinputport(11);
- case 0x10: return readinputport(12);
- default: return (readinputport(8) & readinputport(9) & readinputport(10) & readinputport(11) & readinputport(12));
+ case 0x01: return input_port_read_indexed(machine, 8);
+ case 0x02: return input_port_read_indexed(machine, 9);
+ case 0x04: return input_port_read_indexed(machine, 10);
+ case 0x08: return input_port_read_indexed(machine, 11);
+ case 0x10: return input_port_read_indexed(machine, 12);
+ default: return (input_port_read_indexed(machine, 8) & input_port_read_indexed(machine, 9) & input_port_read_indexed(machine, 10) & input_port_read_indexed(machine, 11) & input_port_read_indexed(machine, 12));
}
break;
}
@@ -551,16 +551,16 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
{
case NB1413M3_KANATUEN:
case NB1413M3_KYUHITO:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
break;
case NB1413M3_TAIWANMB:
- return ((readinputport(0) & 0xf0) | ((readinputport(1) & 0xf0) >> 4));
+ return ((input_port_read_indexed(machine, 0) & 0xf0) | ((input_port_read_indexed(machine, 1) & 0xf0) >> 4));
break;
case NB1413M3_OTONANO:
case NB1413M3_MJCAMERA:
case NB1413M3_IDHIMITU:
case NB1413M3_KAGUYA2:
- return (((readinputport(0) & 0x0f) << 4) | (readinputport(1) & 0x0f));
+ return (((input_port_read_indexed(machine, 0) & 0x0f) << 4) | (input_port_read_indexed(machine, 1) & 0x0f));
break;
case NB1413M3_SCANDAL:
case NB1413M3_SCANDALM:
@@ -572,7 +572,7 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
case NB1413M3_UCHUUAI:
case NB1413M3_TOKIMBSJ:
case NB1413M3_TOKYOGAL:
- return ((readinputport(0) & 0x0f) | ((readinputport(1) & 0x0f) << 4));
+ return ((input_port_read_indexed(machine, 0) & 0x0f) | ((input_port_read_indexed(machine, 1) & 0x0f) << 4));
break;
case NB1413M3_TRIPLEW1:
case NB1413M3_NTOPSTAR:
@@ -583,13 +583,13 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
case NB1413M3_MJLSTORY:
case NB1413M3_QMHAYAKU:
case NB1413M3_MJGOTTUB:
- return (((readinputport(1) & 0x01) >> 0) | ((readinputport(1) & 0x04) >> 1) |
- ((readinputport(1) & 0x10) >> 2) | ((readinputport(1) & 0x40) >> 3) |
- ((readinputport(0) & 0x01) << 4) | ((readinputport(0) & 0x04) << 3) |
- ((readinputport(0) & 0x10) << 2) | ((readinputport(0) & 0x40) << 1));
+ return (((input_port_read_indexed(machine, 1) & 0x01) >> 0) | ((input_port_read_indexed(machine, 1) & 0x04) >> 1) |
+ ((input_port_read_indexed(machine, 1) & 0x10) >> 2) | ((input_port_read_indexed(machine, 1) & 0x40) >> 3) |
+ ((input_port_read_indexed(machine, 0) & 0x01) << 4) | ((input_port_read_indexed(machine, 0) & 0x04) << 3) |
+ ((input_port_read_indexed(machine, 0) & 0x10) << 2) | ((input_port_read_indexed(machine, 0) & 0x40) << 1));
break;
default:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
break;
}
}
@@ -600,16 +600,16 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
{
case NB1413M3_KANATUEN:
case NB1413M3_KYUHITO:
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
break;
case NB1413M3_TAIWANMB:
- return (((readinputport(0) & 0x0f) << 4) | (readinputport(1) & 0x0f));
+ return (((input_port_read_indexed(machine, 0) & 0x0f) << 4) | (input_port_read_indexed(machine, 1) & 0x0f));
break;
case NB1413M3_OTONANO:
case NB1413M3_MJCAMERA:
case NB1413M3_IDHIMITU:
case NB1413M3_KAGUYA2:
- return ((readinputport(0) & 0xf0) | ((readinputport(1) & 0xf0) >> 4));
+ return ((input_port_read_indexed(machine, 0) & 0xf0) | ((input_port_read_indexed(machine, 1) & 0xf0) >> 4));
break;
case NB1413M3_SCANDAL:
case NB1413M3_SCANDALM:
@@ -621,7 +621,7 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
case NB1413M3_UCHUUAI:
case NB1413M3_TOKIMBSJ:
case NB1413M3_TOKYOGAL:
- return (((readinputport(0) & 0xf0) >> 4) | (readinputport(1) & 0xf0));
+ return (((input_port_read_indexed(machine, 0) & 0xf0) >> 4) | (input_port_read_indexed(machine, 1) & 0xf0));
break;
case NB1413M3_TRIPLEW1:
case NB1413M3_NTOPSTAR:
@@ -632,25 +632,25 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
case NB1413M3_MJLSTORY:
case NB1413M3_QMHAYAKU:
case NB1413M3_MJGOTTUB:
- return (((readinputport(1) & 0x02) >> 1) | ((readinputport(1) & 0x08) >> 2) |
- ((readinputport(1) & 0x20) >> 3) | ((readinputport(1) & 0x80) >> 4) |
- ((readinputport(0) & 0x02) << 3) | ((readinputport(0) & 0x08) << 2) |
- ((readinputport(0) & 0x20) << 1) | ((readinputport(0) & 0x80) << 0));
+ return (((input_port_read_indexed(machine, 1) & 0x02) >> 1) | ((input_port_read_indexed(machine, 1) & 0x08) >> 2) |
+ ((input_port_read_indexed(machine, 1) & 0x20) >> 3) | ((input_port_read_indexed(machine, 1) & 0x80) >> 4) |
+ ((input_port_read_indexed(machine, 0) & 0x02) << 3) | ((input_port_read_indexed(machine, 0) & 0x08) << 2) |
+ ((input_port_read_indexed(machine, 0) & 0x20) << 1) | ((input_port_read_indexed(machine, 0) & 0x80) << 0));
break;
default:
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
break;
}
}
READ8_HANDLER( nb1413m3_dipsw3_l_r )
{
- return ((readinputport(2) & 0xf0) >> 4);
+ return ((input_port_read_indexed(machine, 2) & 0xf0) >> 4);
}
READ8_HANDLER( nb1413m3_dipsw3_h_r )
{
- return ((readinputport(2) & 0x0f) >> 0);
+ return ((input_port_read_indexed(machine, 2) & 0x0f) >> 0);
}
WRITE8_HANDLER( nb1413m3_outcoin_w )
diff --git a/src/mame/machine/nitedrvr.c b/src/mame/machine/nitedrvr.c
index c1b4fd1e760..ed8fa98f521 100644
--- a/src/mame/machine/nitedrvr.c
+++ b/src/mame/machine/nitedrvr.c
@@ -28,12 +28,12 @@ Be sure to keep returning a direction until steering_reset is called,
because D6 and D7 are apparently checked at different times, and a
change in-between can affect the direction you move.
***************************************************************************/
-static int nitedrvr_steering(void)
+static int nitedrvr_steering(running_machine *machine)
{
int this_val;
int delta;
- this_val = readinputport(5);
+ this_val = input_port_read_indexed(machine, 5);
delta=this_val-last_steering_val;
last_steering_val=this_val;
@@ -107,7 +107,7 @@ READ8_HANDLER( nitedrvr_in0_r )
{
int gear;
- gear = readinputport(2);
+ gear = input_port_read_indexed(machine, 2);
if (gear & 0x10) nitedrvr_gear=1;
else if (gear & 0x20) nitedrvr_gear=2;
else if (gear & 0x40) nitedrvr_gear=3;
@@ -116,16 +116,16 @@ READ8_HANDLER( nitedrvr_in0_r )
switch (offset & 0x03)
{
case 0x00: /* No remapping necessary */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
case 0x01: /* No remapping necessary */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
case 0x02: /* Remap our gear shift */
if (nitedrvr_gear==1) return 0xE0;
else if (nitedrvr_gear==2) return 0xD0;
else if (nitedrvr_gear==3) return 0xB0;
else return 0x70;
case 0x03: /* Remap our steering */
- return (readinputport(3) | nitedrvr_steering());
+ return (input_port_read_indexed(machine, 3) | nitedrvr_steering(machine));
default:
return 0xFF;
}
@@ -169,7 +169,7 @@ READ8_HANDLER( nitedrvr_in1_r )
ac_line=(ac_line+1) % 3;
- port = readinputport(4);
+ port = input_port_read_indexed(machine, 4);
if (port & 0x10) nitedrvr_track=0;
else if (port & 0x20) nitedrvr_track=1;
else if (port & 0x40) nitedrvr_track=2;
diff --git a/src/mame/machine/opwolf.c b/src/mame/machine/opwolf.c
index b1c4cfdfc93..652ec0f8f0b 100644
--- a/src/mame/machine/opwolf.c
+++ b/src/mame/machine/opwolf.c
@@ -532,8 +532,8 @@ READ16_HANDLER( opwolf_cchip_data_r )
static TIMER_CALLBACK( cchip_timer )
{
// Update input ports, these are used by both the 68k directly and by the c-chip
- cchip_ram[0x4]=readinputportbytag("IN0");
- cchip_ram[0x5]=readinputportbytag("IN1");
+ cchip_ram[0x4]=input_port_read(machine, "IN0");
+ cchip_ram[0x5]=input_port_read(machine, "IN1");
// Coin slots
if (cchip_ram[0x4]!=cchip_last_04)
diff --git a/src/mame/machine/pcecommn.c b/src/mame/machine/pcecommn.c
index 99c6c395373..a7a9ed42684 100644
--- a/src/mame/machine/pcecommn.c
+++ b/src/mame/machine/pcecommn.c
@@ -57,7 +57,7 @@ READ8_HANDLER ( pce_joystick_r )
}
else
{
- data = readinputport(0);
+ data = input_port_read_indexed(machine, 0);
}
if(joystick_data_select) data >>= 4;
ret = (data & 0x0F) | pce.io_port_options;
diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c
index 38ccedd9f9b..2d5f4e54f45 100644
--- a/src/mame/machine/pckeybrd.c
+++ b/src/mame/machine/pckeybrd.c
@@ -17,6 +17,7 @@
*/
#include "driver.h"
+#include "deprecat.h"
#include "machine/pckeybrd.h"
#ifdef MESS
@@ -508,7 +509,7 @@ static UINT32 at_keyboard_readport(int port)
{
UINT32 result = 0;
if (keyboard.ports[port] >= 0)
- result = readinputport(keyboard.ports[port]);
+ result = input_port_read_indexed(Machine, keyboard.ports[port]);
return result;
}
diff --git a/src/mame/machine/pgmprot.c b/src/mame/machine/pgmprot.c
index e0d208f33cc..7d7a4206c61 100644
--- a/src/mame/machine/pgmprot.c
+++ b/src/mame/machine/pgmprot.c
@@ -117,7 +117,7 @@ static const int Pstar_80[0x1a3]={
READ16_HANDLER (PSTARS_protram_r)
{
if (offset == 4) //region
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
else if (offset >= 0x10) //timer
{
logerror("PSTARS ACCESS COUNTER %6X\n",pstar_ram[offset-0x10]);
@@ -314,11 +314,11 @@ static UINT32 bt(UINT32 v, int bit)
return (v & (1<<bit)) != 0;
}
-static void asic3_compute_hold(void)
+static void asic3_compute_hold(running_machine *machine)
{
// The mode is dependant on the region
static const int modes[4] = { 1, 1, 3, 2 };
- int mode = modes[readinputport(4) & 3];
+ int mode = modes[input_port_read_indexed(machine, 4) & 3];
switch(mode) {
case 1:
@@ -354,9 +354,9 @@ READ16_HANDLER( pgm_asic3_r )
/* region is supplied by the protection device */
switch(asic3_reg) {
- case 0x00: res = (asic3_latch[0] & 0xf7) | ((readinputport(4) << 3) & 0x08); break;
+ case 0x00: res = (asic3_latch[0] & 0xf7) | ((input_port_read_indexed(machine, 4) << 3) & 0x08); break;
case 0x01: res = asic3_latch[1]; break;
- case 0x02: res = (asic3_latch[2] & 0x7f) | ((readinputport(4) << 6) & 0x80); break;
+ case 0x02: res = (asic3_latch[2] & 0x7f) | ((input_port_read_indexed(machine, 4) << 6) & 0x80); break;
case 0x03:
res = (bt(asic3_hold, 15) << 0)
| (bt(asic3_hold, 12) << 1)
@@ -414,7 +414,7 @@ WRITE16_HANDLER( pgm_asic3_w )
} else if(asic3_reg >= 0x80 && asic3_reg <= 0x87) {
asic3_y = asic3_reg & 7;
asic3_z = data;
- asic3_compute_hold();
+ asic3_compute_hold(machine);
}
}
}
@@ -462,7 +462,7 @@ READ16_HANDLER (sango_protram_r)
// 4 = hong kong
// 5 = world
- if (offset == 4) return readinputport(4);
+ if (offset == 4) return input_port_read_indexed(machine, 4);
// otherwise it doesn't seem to use the ram for anything important, we return 0 to avoid test mode corruption
// kovplus reads from offset 000e a lot ... why?
diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c
index cf8c71a2a8c..e4b0498627c 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -61,7 +61,7 @@ MACHINE_RESET( pc10 )
*************************************/
READ8_HANDLER( pc10_port_0_r )
{
- return readinputport( 0 ) | ( ( ~pc10_int_detect & 1 ) << 3 );
+ return input_port_read_indexed(machine, 0 ) | ( ( ~pc10_int_detect & 1 ) << 3 );
}
WRITE8_HANDLER( pc10_SDCS_w )
@@ -183,8 +183,8 @@ WRITE8_HANDLER( pc10_in0_w )
return;
/* load up the latches */
- input_latch[0] = readinputport( 3 );
- input_latch[1] = readinputport( 4 );
+ input_latch[0] = input_port_read_indexed(machine, 3 );
+ input_latch[1] = input_port_read_indexed(machine, 4 );
/* apply any masking from the BIOS */
if ( cntrl_mask )
@@ -218,9 +218,9 @@ READ8_HANDLER( pc10_in1_r )
/* do the gun thing */
if ( pc10_gun_controller )
{
- int trigger = readinputport( 3 );
- int x = readinputport( 5 );
- int y = readinputport( 6 );
+ int trigger = input_port_read_indexed(machine, 3 );
+ int x = input_port_read_indexed(machine, 5 );
+ int y = input_port_read_indexed(machine, 6 );
UINT32 pix, color_base;
/* no sprite hit (yet) */
diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c
index 84498d88f58..e92f03c53e2 100644
--- a/src/mame/machine/qix.c
+++ b/src/mame/machine/qix.c
@@ -466,7 +466,7 @@ READ8_HANDLER( qix_68705_portB_r )
UINT8 ddr = state->_68705_ddr[1];
UINT8 out = state->_68705_port_out[1];
- UINT8 in = (readinputport(1) & 0x0f) | ((readinputport(1) & 0x80) >> 3);
+ UINT8 in = (input_port_read_indexed(machine, 1) & 0x0f) | ((input_port_read_indexed(machine, 1) & 0x80) >> 3);
return (out & ddr) | (in & ~ddr);
}
@@ -477,7 +477,7 @@ READ8_HANDLER( qix_68705_portC_r )
UINT8 ddr = state->_68705_ddr[2];
UINT8 out = state->_68705_port_out[2];
- UINT8 in = (state->coinctrl & 0x08) | ((readinputport(1) & 0x70) >> 4);
+ UINT8 in = (state->coinctrl & 0x08) | ((input_port_read_indexed(machine, 1) & 0x70) >> 4);
return (out & ddr) | (in & ~ddr);
}
@@ -598,7 +598,7 @@ static READ8_HANDLER( slither_trak_lr_r )
{
qix_state *state = machine->driver_data;
- return readinputport(state->flip ? 6 : 4);
+ return input_port_read_indexed(machine, state->flip ? 6 : 4);
}
@@ -606,5 +606,5 @@ static READ8_HANDLER( slither_trak_ud_r )
{
qix_state *state = machine->driver_data;
- return readinputport(state->flip ? 5 : 3);
+ return input_port_read_indexed(machine, state->flip ? 5 : 3);
}
diff --git a/src/mame/machine/rainbow.c b/src/mame/machine/rainbow.c
index ed1b37d0687..7bfd4543700 100644
--- a/src/mame/machine/rainbow.c
+++ b/src/mame/machine/rainbow.c
@@ -760,10 +760,10 @@ static TIMER_CALLBACK( cchip_timer )
coin_counter_w(1, CRAM[0][8] & 0x20);
coin_counter_w(0, CRAM[0][8] & 0x10);
- CRAM[0][3] = readinputportbytag("800007"); /* STARTn + SERVICE1 */
- CRAM[0][4] = readinputportbytag("800009"); /* COINn */
- CRAM[0][5] = readinputportbytag("80000B"); /* Player controls + TILT */
- CRAM[0][6] = readinputportbytag("80000D"); /* Player controls (cocktail) */
+ CRAM[0][3] = input_port_read(machine, "800007"); /* STARTn + SERVICE1 */
+ CRAM[0][4] = input_port_read(machine, "800009"); /* COINn */
+ CRAM[0][5] = input_port_read(machine, "80000B"); /* Player controls + TILT */
+ CRAM[0][6] = input_port_read(machine, "80000D"); /* Player controls (cocktail) */
}
/*************************************
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index b6c2ecf5061..9226059b2a4 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -70,7 +70,7 @@ static READ8_HANDLER( scrambls_input_port_2_r )
UINT8 res;
- res = readinputport(2);
+ res = input_port_read_indexed(machine, 2);
/*logerror("%04x: read IN2\n",activecpu_get_pc());*/
@@ -99,12 +99,12 @@ static READ8_HANDLER( scrambls_input_port_2_r )
static READ8_HANDLER( ckongs_input_port_1_r )
{
- return (readinputport(1) & 0xfc) | ((readinputport(2) & 0x06) >> 1);
+ return (input_port_read_indexed(machine, 1) & 0xfc) | ((input_port_read_indexed(machine, 2) & 0x06) >> 1);
}
static READ8_HANDLER( ckongs_input_port_2_r )
{
- return (readinputport(2) & 0xf9) | ((readinputport(1) & 0x03) << 1);
+ return (input_port_read_indexed(machine, 2) & 0xf9) | ((input_port_read_indexed(machine, 1) & 0x03) << 1);
}
@@ -118,24 +118,24 @@ static READ8_HANDLER( moonwar_input_port_0_r )
UINT8 sign;
UINT8 delta;
- delta = (moonwar_port_select ? readinputport(3) : readinputport(4));
+ delta = (moonwar_port_select ? input_port_read_indexed(machine, 3) : input_port_read_indexed(machine, 4));
sign = (delta & 0x80) >> 3;
delta &= 0x0f;
- return ((readinputport(0) & 0xe0) | delta | sign );
+ return ((input_port_read_indexed(machine, 0) & 0xe0) | delta | sign );
}
/* the coinage DIPs are spread accross two input ports */
static READ8_HANDLER( stratgyx_input_port_2_r )
{
- return (readinputport(2) & ~0x06) | ((readinputport(4) << 1) & 0x06);
+ return (input_port_read_indexed(machine, 2) & ~0x06) | ((input_port_read_indexed(machine, 4) << 1) & 0x06);
}
static READ8_HANDLER( stratgyx_input_port_3_r )
{
- return (readinputport(3) & ~0x03) | ((readinputport(4) >> 2) & 0x03);
+ return (input_port_read_indexed(machine, 3) & ~0x03) | ((input_port_read_indexed(machine, 4) >> 2) & 0x03);
}
@@ -151,7 +151,7 @@ static READ8_HANDLER( darkplnt_input_port_1_r )
0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
UINT8 val;
- val = readinputport(1);
+ val = input_port_read_indexed(machine, 1);
return ((val & 0x03) | (remap[val >> 2] << 2));
}
diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c
index dd6ead18e43..9304b588545 100644
--- a/src/mame/machine/simpsons.c
+++ b/src/mame/machine/simpsons.c
@@ -57,7 +57,7 @@ READ8_HANDLER( simpsons_eeprom_r )
res |= 0x20;//konami_eeprom_ack() << 5; /* add the ack */
- res |= readinputport( 5 ) & 1; /* test switch */
+ res |= input_port_read_indexed(machine, 5 ) & 1; /* test switch */
if (init_eeprom_count)
{
diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c
index a708d586595..e4210ec4bed 100644
--- a/src/mame/machine/slikshot.c
+++ b/src/mame/machine/slikshot.c
@@ -545,8 +545,8 @@ VIDEO_UPDATE( slikshot )
VIDEO_UPDATE_CALL(itech8_2page);
/* add the current X,Y positions to the list */
- xbuffer[ybuffer_next % YBUFFER_COUNT] = readinputportbytag_safe("FAKEX", 0);
- ybuffer[ybuffer_next % YBUFFER_COUNT] = readinputportbytag_safe("FAKEY", 0);
+ xbuffer[ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine, "FAKEX", 0);
+ ybuffer[ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine, "FAKEY", 0);
ybuffer_next++;
/* determine where to draw the starting point */
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 0279d55221e..01115a3f0be 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -176,14 +176,14 @@ static TIMER_CALLBACK( snes_scanline_tick )
{
int i;
- joypad[0].low = readinputport( 0 );
- joypad[0].high = readinputport( 1 );
- joypad[1].low = readinputport( 2 );
- joypad[1].high = readinputport( 3 );
- joypad[2].low = readinputport( 4 );
- joypad[2].high = readinputport( 5 );
- joypad[3].low = readinputport( 6 );
- joypad[3].high = readinputport( 7 );
+ joypad[0].low = input_port_read_indexed(machine, 0 );
+ joypad[0].high = input_port_read_indexed(machine, 1 );
+ joypad[1].low = input_port_read_indexed(machine, 2 );
+ joypad[1].high = input_port_read_indexed(machine, 3 );
+ joypad[2].low = input_port_read_indexed(machine, 4 );
+ joypad[2].high = input_port_read_indexed(machine, 5 );
+ joypad[3].low = input_port_read_indexed(machine, 6 );
+ joypad[3].high = input_port_read_indexed(machine, 7 );
// avoid sending signals that could crash games
for (i = 0; i < 4; i++)
@@ -953,9 +953,9 @@ READ8_HANDLER( snes_r_io )
#ifndef MESS
case 0x4100: /* NSS Dip-Switches */
#ifdef MAME_DEBUG
- return readinputport(12);
+ return input_port_read_indexed(machine, 12);
#else
- return readinputport(9);
+ return input_port_read_indexed(machine, 9);
#endif /* MAME_DEBUG */
// case 0x4101: //PC: a104 - a10e - a12a //only nss_actr
// case 0x420c: //PC: 9c7d - 8fab //only nss_ssoc
diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c
index 42dcc8c7241..2940a3084e3 100644
--- a/src/mame/machine/starwars.c
+++ b/src/mame/machine/starwars.c
@@ -129,7 +129,7 @@ WRITE8_HANDLER( starwars_out_w )
READ8_HANDLER( starwars_input_1_r )
{
- int x = readinputport(1);
+ int x = input_port_read_indexed(machine, 1);
/* set the matrix processor flag */
if (math_run)
@@ -158,11 +158,11 @@ READ8_HANDLER( starwars_adc_r )
{
/* pitch */
if (control_num == kPitch)
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
/* yaw */
else if (control_num == kYaw)
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
/* default to unused thrust */
else
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index 91c26a22db8..1342966f46a 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -118,7 +118,7 @@ INTERRUPT_GEN( stfight_vb_interrupt )
// Perhaps define dipswitches as active low?
READ8_HANDLER( stfight_dsw_r )
{
- return( ~readinputport( 3+offset ) );
+ return( ~input_port_read_indexed(machine, 3+offset ) );
}
static int stfight_coin_mech_query_active = 0;
@@ -145,7 +145,7 @@ READ8_HANDLER( stfight_coin_r )
* since it's read by the 30Hz interrupt ISR
*/
- coin_mech_data = readinputport( 5 );
+ coin_mech_data = input_port_read_indexed(machine, 5 );
for( i=0; i<2; i++ )
{
diff --git a/src/mame/machine/strtheat.c b/src/mame/machine/strtheat.c
index bd4a13b0b6e..c9f37e49619 100644
--- a/src/mame/machine/strtheat.c
+++ b/src/mame/machine/strtheat.c
@@ -152,29 +152,29 @@ static void strtheat_decrypt_rom_B(void)
static READ8_HANDLER( strtheat_inputport_0_r )
{
- if(readinputport(3) & 0x40)
+ if(input_port_read_indexed(machine, 3) & 0x40)
{
/* Joystick inputs */
- return readinputport(0);
+ return input_port_read_indexed(machine, 0);
}
else
{
/* Steering Wheel inputs */
- return (readinputport(0) & ~3) | (readinputport(4) & 3);
+ return (input_port_read_indexed(machine, 0) & ~3) | (input_port_read_indexed(machine, 4) & 3);
}
}
static READ8_HANDLER( strtheat_inputport_1_r )
{
- if(readinputport(3) & 0x40)
+ if(input_port_read_indexed(machine, 3) & 0x40)
{
/* Joystick inputs */
- return readinputport(1);
+ return input_port_read_indexed(machine, 1);
}
else
{
/* Steering Wheel inputs */
- return (readinputport(1) & ~3) | (readinputport(5) & 3);
+ return (input_port_read_indexed(machine, 1) & ~3) | (input_port_read_indexed(machine, 5) & 3);
}
}
diff --git a/src/mame/machine/tatsumi.c b/src/mame/machine/tatsumi.c
index 0add9cbbca7..f950fcf4558 100644
--- a/src/mame/machine/tatsumi.c
+++ b/src/mame/machine/tatsumi.c
@@ -132,8 +132,8 @@ WRITE16_HANDLER(apache3_z80_w)
READ8_HANDLER( apache3_adc_r )
{
if (apache3_adc==0)
- return readinputport(1);
- return readinputport(2);
+ return input_port_read_indexed(machine, 1);
+ return input_port_read_indexed(machine, 2);
}
WRITE8_HANDLER( apache3_adc_w )
diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c
index 1e4475c4627..6f3f4393f2c 100644
--- a/src/mame/machine/tnzs.c
+++ b/src/mame/machine/tnzs.c
@@ -117,7 +117,7 @@ READ8_HANDLER( arknoid2_sh_f000_r )
// logerror("PC %04x: read input %04x\n", activecpu_get_pc(), 0xf000 + offset);
- val = readinputport(7 + offset/2);
+ val = input_port_read_indexed(machine, 7 + offset/2);
if (offset & 1)
{
return ((val >> 8) & 0xff);
@@ -247,7 +247,7 @@ static READ8_HANDLER( mcu_arknoid2_r )
}
else return mcu_credits;
}
- else return readinputport(2); /* buttons */
+ else return input_port_read_indexed(machine, 2); /* buttons */
default:
logerror("error, unknown mcu command\n");
@@ -338,16 +338,16 @@ static READ8_HANDLER( mcu_extrmatn_r )
switch (mcu_command)
{
case 0x01:
- return readinputport(2) ^ 0xff; /* player 1 joystick + buttons */
+ return input_port_read_indexed(machine, 2) ^ 0xff; /* player 1 joystick + buttons */
case 0x02:
- return readinputport(3) ^ 0xff; /* player 2 joystick + buttons */
+ return input_port_read_indexed(machine, 3) ^ 0xff; /* player 2 joystick + buttons */
case 0x1a:
- return (readinputport(5) | (readinputport(6) << 1));
+ return (input_port_read_indexed(machine, 5) | (input_port_read_indexed(machine, 6) << 1));
case 0x21:
- return readinputport(4) & 0x0f;
+ return input_port_read_indexed(machine, 4) & 0x0f;
case 0x41:
return mcu_credits;
@@ -375,7 +375,7 @@ static READ8_HANDLER( mcu_extrmatn_r )
else return mcu_credits;
}
/* buttons */
- else return ((readinputport(2) & 0xf0) | (readinputport(3) >> 4)) ^ 0xff;
+ else return ((input_port_read_indexed(machine, 2) & 0xf0) | (input_port_read_indexed(machine, 3) >> 4)) ^ 0xff;
default:
logerror("error, unknown mcu command\n");
@@ -660,9 +660,9 @@ INTERRUPT_GEN( arknoid2_interrupt )
case MCU_DRTOPPEL:
case MCU_PLUMPOP:
coin = 0;
- coin |= ((readinputport(5) & 1) << 0);
- coin |= ((readinputport(6) & 1) << 1);
- coin |= ((readinputport(4) & 3) << 2);
+ coin |= ((input_port_read_indexed(machine, 5) & 1) << 0);
+ coin |= ((input_port_read_indexed(machine, 6) & 1) << 1);
+ coin |= ((input_port_read_indexed(machine, 4) & 3) << 2);
coin ^= 0x0c;
mcu_handle_coins(coin);
break;
diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c
index c7c457cf225..7056dd6e927 100644
--- a/src/mame/machine/vertigo.c
+++ b/src/mame/machine/vertigo.c
@@ -126,7 +126,7 @@ READ16_HANDLER( vertigo_io_convert )
if (offset > 2)
adc_result = 0;
else
- adc_result = readinputport(offset);
+ adc_result = input_port_read_indexed(machine, offset);
update_irq_encoder(INPUT_LINE_IRQ2, ASSERT_LINE);
return 0;
@@ -143,14 +143,14 @@ READ16_HANDLER( vertigo_io_adc )
READ16_HANDLER( vertigo_coin_r )
{
update_irq_encoder(INPUT_LINE_IRQ6, CLEAR_LINE);
- return (readinputportbytag("COIN"));
+ return (input_port_read(machine, "COIN"));
}
INTERRUPT_GEN( vertigo_interrupt )
{
/* Coin inputs cause IRQ6 */
- if ((readinputportbytag("COIN") & 0x7) < 0x7)
+ if ((input_port_read(machine, "COIN") & 0x7) < 0x7)
update_irq_encoder(INPUT_LINE_IRQ6, ASSERT_LINE);
}
diff --git a/src/mame/machine/volfied.c b/src/mame/machine/volfied.c
index 95d93a9c463..518597c9a9e 100644
--- a/src/mame/machine/volfied.c
+++ b/src/mame/machine/volfied.c
@@ -437,10 +437,10 @@ READ16_HANDLER( volfied_cchip_ram_r )
{
switch (offset)
{
- case 0x03: return readinputportbytag("F00007"); /* STARTn + SERVICE1 */
- case 0x04: return readinputportbytag("F00009"); /* COINn */
- case 0x05: return readinputportbytag("F0000B"); /* Player controls + TILT */
- case 0x06: return readinputportbytag("F0000D"); /* Player controls (cocktail) */
+ case 0x03: return input_port_read(machine, "F00007"); /* STARTn + SERVICE1 */
+ case 0x04: return input_port_read(machine, "F00009"); /* COINn */
+ case 0x05: return input_port_read(machine, "F0000B"); /* Player controls + TILT */
+ case 0x06: return input_port_read(machine, "F0000D"); /* Player controls (cocktail) */
case 0x08: return cc_port;
}
}
diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c
index 1b19c1dc8af..c215df0e8ea 100644
--- a/src/mame/machine/vsnes.c
+++ b/src/mame/machine/vsnes.c
@@ -117,8 +117,8 @@ WRITE8_HANDLER( vsnes_in0_w )
if ( data & 1 )
{
/* load up the latches */
- input_latch[0] = readinputport( 0 );
- input_latch[1] = readinputport( 1 );
+ input_latch[0] = input_port_read_indexed(machine, 0 );
+ input_latch[1] = input_port_read_indexed(machine, 1 );
}
}
@@ -129,8 +129,8 @@ static READ8_HANDLER( gun_in0_r )
/* shift */
input_latch[0] >>= 1;
- ret |= readinputport( 2 ); /* merge coins, etc */
- ret |= ( readinputport( 3 ) & 3 ) << 3; /* merge 2 dipswitches */
+ ret |= input_port_read_indexed(machine, 2 ); /* merge coins, etc */
+ ret |= ( input_port_read_indexed(machine, 3 ) & 3 ) << 3; /* merge 2 dipswitches */
/* The gun games expect a 1 returned on every 5th read after sound_fix is reset*/
/* Info Supplied by Ben Parnell <xodnizel@home.com> of FCE Ultra fame */
@@ -155,8 +155,8 @@ READ8_HANDLER( vsnes_in0_r )
/* shift */
input_latch[0] >>= 1;
- ret |= readinputport( 2 ); /* merge coins, etc */
- ret |= ( readinputport( 3 ) & 3 ) << 3; /* merge 2 dipswitches */
+ ret |= input_port_read_indexed(machine, 2 ); /* merge coins, etc */
+ ret |= ( input_port_read_indexed(machine, 3 ) & 3 ) << 3; /* merge 2 dipswitches */
return ret;
@@ -167,7 +167,7 @@ READ8_HANDLER( vsnes_in1_r )
{
int ret = ( input_latch[1] ) & 1;
- ret |= readinputport( 3 ) & ~3; /* merge the rest of the dipswitches */
+ ret |= input_port_read_indexed(machine, 3 ) & ~3; /* merge the rest of the dipswitches */
/* shift */
input_latch[1] >>= 1;
@@ -181,8 +181,8 @@ WRITE8_HANDLER( vsnes_in0_1_w )
if ( data & 1 )
{
/* load up the latches */
- input_latch[2] = readinputport( 4 );
- input_latch[3] = readinputport( 5 );
+ input_latch[2] = input_port_read_indexed(machine, 4 );
+ input_latch[3] = input_port_read_indexed(machine, 5 );
}
}
@@ -193,8 +193,8 @@ READ8_HANDLER( vsnes_in0_1_r )
/* shift */
input_latch[2] >>= 1;
- ret |= readinputport( 6 ); /* merge coins, etc */
- ret |= ( readinputport( 7 ) & 3 ) << 3; /* merge 2 dipswitches */
+ ret |= input_port_read_indexed(machine, 6 ); /* merge coins, etc */
+ ret |= ( input_port_read_indexed(machine, 7 ) & 3 ) << 3; /* merge 2 dipswitches */
return ret;
}
@@ -202,7 +202,7 @@ READ8_HANDLER( vsnes_in1_1_r )
{
int ret = ( input_latch[3] ) & 1;
- ret |= readinputport( 7 ) & ~3; /* merge the rest of the dipswitches */
+ ret |= input_port_read_indexed(machine, 7 ) & ~3; /* merge the rest of the dipswitches */
/* shift */
input_latch[3] >>= 1;
@@ -345,13 +345,13 @@ static WRITE8_HANDLER( gun_in0_w )
{
/* load up the latches */
- input_latch[0] = readinputport( 0 );
+ input_latch[0] = input_port_read_indexed(machine, 0 );
/* do the gun thing */
if ( vsnes_gun_controller )
{
- int x = readinputport( 4 );
- int y = readinputport( 5 );
+ int x = input_port_read_indexed(machine, 4 );
+ int y = input_port_read_indexed(machine, 5 );
UINT32 pix, color_base;
/* get the pixel at the gun position */
@@ -368,7 +368,7 @@ static WRITE8_HANDLER( gun_in0_w )
}
}
- input_latch[1] = readinputport( 1 );
+ input_latch[1] = input_port_read_indexed(machine, 1 );
}
if ( ( zapstore & 1 ) && ( !( data & 1 ) ) )
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index dfd0542a20f..f46dd10460c 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -568,13 +568,13 @@ WRITE8_HANDLER( williams_port_select_w )
READ8_HANDLER( williams_input_port_0_3_r )
{
- return readinputport(port_select ? 3 : 0);
+ return input_port_read_indexed(machine, port_select ? 3 : 0);
}
READ8_HANDLER( williams_input_port_1_4_r )
{
- return readinputport(port_select ? 4 : 1);
+ return input_port_read_indexed(machine, port_select ? 4 : 1);
}
@@ -606,7 +606,7 @@ READ8_HANDLER( williams_input_port_1_4_r )
READ8_HANDLER( williams_49way_port_0_r )
{
static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 };
- return (translate49[readinputportbytag("49WAYX") >> 4] << 4) | translate49[readinputportbytag("49WAYY") >> 4];
+ return (translate49[input_port_read(machine, "49WAYX") >> 4] << 4) | translate49[input_port_read(machine, "49WAYY") >> 4];
}
@@ -615,7 +615,7 @@ READ8_HANDLER( williams_input_port_49way_0_5_r )
if (port_select)
return williams_49way_port_0_r(machine,0);
else
- return readinputport(5);
+ return input_port_read_indexed(machine, 5);
}
diff --git a/src/mame/machine/xevious.c b/src/mame/machine/xevious.c
index dad7b6a988f..d1edad0e9a3 100644
--- a/src/mame/machine/xevious.c
+++ b/src/mame/machine/xevious.c
@@ -170,10 +170,10 @@ READ8_HANDLER( battles_input_port_r )
switch ( offset )
{
default:
- case 0: return ~BITSWAP8(readinputport(0),6,7,5,4,3,2,1,0) >> 4;
- case 1: return ~readinputport(1) & 0x0f;
- case 2: return ~readinputport(1) >> 4;
- case 3: return ~readinputport(0) & 0x0f;
+ case 0: return ~BITSWAP8(input_port_read_indexed(machine, 0),6,7,5,4,3,2,1,0) >> 4;
+ case 1: return ~input_port_read_indexed(machine, 1) & 0x0f;
+ case 2: return ~input_port_read_indexed(machine, 1) >> 4;
+ case 3: return ~input_port_read_indexed(machine, 0) & 0x0f;
}
}
diff --git a/src/mame/video/8080bw.c b/src/mame/video/8080bw.c
index 583308e7a39..71293ee3482 100644
--- a/src/mame/video/8080bw.c
+++ b/src/mame/video/8080bw.c
@@ -24,10 +24,10 @@ static UINT8 schaser_background_select;
-void c8080bw_flip_screen_w(int data)
+void c8080bw_flip_screen_w(running_machine *machine, int data)
{
color_map = data;
- c8080bw_flip_screen = data && (readinputportbytag(CABINET_PORT_TAG) & 0x01);
+ c8080bw_flip_screen = data && (input_port_read(machine, CABINET_PORT_TAG) & 0x01);
}
diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c
index 527e7c42ad4..843b40180c3 100644
--- a/src/mame/video/aeroboto.c
+++ b/src/mame/video/aeroboto.c
@@ -75,7 +75,7 @@ VIDEO_START( aeroboto )
READ8_HANDLER( aeroboto_in0_r )
{
- return readinputport(flip_screen_get() ? 1 : 0);
+ return input_port_read_indexed(machine, flip_screen_get() ? 1 : 0);
}
WRITE8_HANDLER( aeroboto_3000_w )
diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c
index c3275531777..b90c9759c86 100644
--- a/src/mame/video/amiga.c
+++ b/src/mame/video/amiga.c
@@ -166,10 +166,10 @@ VIDEO_START( amiga )
*
*************************************/
-UINT32 amiga_gethvpos(void)
+UINT32 amiga_gethvpos(const device_config *screen)
{
- UINT32 hvpos = (last_scanline << 8) | (video_screen_get_hpos(Machine->primary_screen) >> 2);
- UINT32 latchedpos = readinputportbytag_safe("HVPOS", 0);
+ UINT32 hvpos = (last_scanline << 8) | (video_screen_get_hpos(screen) >> 2);
+ UINT32 latchedpos = input_port_read_safe(screen->machine, "HVPOS", 0);
/* if there's no latched position, or if we are in the active display area */
/* but before the latching point, return the live HV position */
diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c
index ef2e67502cc..db595e8504f 100644
--- a/src/mame/video/astrocde.c
+++ b/src/mame/video/astrocde.c
@@ -532,51 +532,51 @@ READ8_HANDLER( astrocade_data_chip_register_r )
break;
case 0x10: /* player 1 handle */
- result = readinputportbytag_safe("P1HANDLE", 0xff);
+ result = input_port_read_safe(machine, "P1HANDLE", 0xff);
break;
case 0x11: /* player 2 handle */
- result = readinputportbytag_safe("P2HANDLE", 0xff);
+ result = input_port_read_safe(machine, "P2HANDLE", 0xff);
break;
case 0x12: /* player 3 handle */
- result = readinputportbytag_safe("P3HANDLE", 0xff);
+ result = input_port_read_safe(machine, "P3HANDLE", 0xff);
break;
case 0x13: /* player 4 handle */
- result = readinputportbytag_safe("P4HANDLE", 0xff);
+ result = input_port_read_safe(machine, "P4HANDLE", 0xff);
break;
case 0x14: /* keypad column 0 */
- result = readinputportbytag_safe("KEYPAD0", 0xff);
+ result = input_port_read_safe(machine, "KEYPAD0", 0xff);
break;
case 0x15: /* keypad column 1 */
- result = readinputportbytag_safe("KEYPAD1", 0xff);
+ result = input_port_read_safe(machine, "KEYPAD1", 0xff);
break;
case 0x16: /* keypad column 2 */
- result = readinputportbytag_safe("KEYPAD2", 0xff);
+ result = input_port_read_safe(machine, "KEYPAD2", 0xff);
break;
case 0x17: /* keypad column 3 */
- result = readinputportbytag_safe("KEYPAD3", 0xff);
+ result = input_port_read_safe(machine, "KEYPAD3", 0xff);
break;
case 0x1c: /* player 1 knob */
- result = readinputportbytag_safe("P1_KNOB", 0xff);
+ result = input_port_read_safe(machine, "P1_KNOB", 0xff);
break;
case 0x1d: /* player 2 knob */
- result = readinputportbytag_safe("P2_KNOB", 0xff);
+ result = input_port_read_safe(machine, "P2_KNOB", 0xff);
break;
case 0x1e: /* player 3 knob */
- result = readinputportbytag_safe("P3_KNOB", 0xff);
+ result = input_port_read_safe(machine, "P3_KNOB", 0xff);
break;
case 0x1f: /* player 4 knob */
- result = readinputportbytag_safe("P4_KNOB", 0xff);
+ result = input_port_read_safe(machine, "P4_KNOB", 0xff);
break;
}
diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c
index 607cbdb00b6..d2b9ba9912c 100644
--- a/src/mame/video/atari.c
+++ b/src/mame/video/atari.c
@@ -781,7 +781,7 @@ VIDEO_UPDATE( atari )
VIDEO_UPDATE_CALL(generic_bitmapped);
- new_tv_artifacts = readinputportbytag_safe("artifacts", 0);
+ new_tv_artifacts = input_port_read_safe(screen->machine, "artifacts", 0);
if( tv_artifacts != new_tv_artifacts )
{
tv_artifacts = new_tv_artifacts;
@@ -1492,7 +1492,7 @@ static void antic_scanline_dma(int param)
*
*****************************************************************************/
-static void generic_atari_interrupt(void (*handle_keyboard)(void), int button_count)
+static void generic_atari_interrupt(running_machine *machine, void (*handle_keyboard)(running_machine *machine), int button_count)
{
int button_port, i;
@@ -1506,7 +1506,7 @@ static void generic_atari_interrupt(void (*handle_keyboard)(void), int button_co
if( antic.scanline == VBL_START )
{
- button_port = readinputportbytag_safe("djoy_b", 0);
+ button_port = input_port_read_safe(machine, "djoy_b", 0);
/* specify buttons relevant to this Atari variant */
for (i = 0; i < button_count; i++)
@@ -1520,7 +1520,7 @@ static void generic_atari_interrupt(void (*handle_keyboard)(void), int button_co
for (i = button_count; i < 4; i++)
gtia.r.but[i] = 1;
- handle_keyboard();
+ handle_keyboard(machine);
/* do nothing new for the rest of the frame */
antic.modelines = video_screen_get_height(Machine->primary_screen) - VBL_START;
@@ -1544,20 +1544,20 @@ static void generic_atari_interrupt(void (*handle_keyboard)(void), int button_co
INTERRUPT_GEN( a400_interrupt )
{
- generic_atari_interrupt(a800_handle_keyboard, 4);
+ generic_atari_interrupt(machine, a800_handle_keyboard, 4);
}
INTERRUPT_GEN( a800_interrupt )
{
- generic_atari_interrupt(a800_handle_keyboard, 4);
+ generic_atari_interrupt(machine, a800_handle_keyboard, 4);
}
INTERRUPT_GEN( a800xl_interrupt )
{
- generic_atari_interrupt(a800_handle_keyboard, 2);
+ generic_atari_interrupt(machine, a800_handle_keyboard, 2);
}
INTERRUPT_GEN( a5200_interrupt )
{
- generic_atari_interrupt(a5200_handle_keypads, 4);
+ generic_atari_interrupt(machine, a5200_handle_keypads, 4);
}
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index bd4bb61d776..92b409d75cf 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -216,12 +216,12 @@ WRITE8_HANDLER( bking_playfield_w )
READ8_HANDLER( bking_input_port_5_r )
{
- return readinputport(controller ? 7 : 5);
+ return input_port_read_indexed(machine, controller ? 7 : 5);
}
READ8_HANDLER( bking_input_port_6_r )
{
- return readinputport(controller ? 8 : 6);
+ return input_port_read_indexed(machine, controller ? 8 : 6);
}
READ8_HANDLER( bking_pos_r )
diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c
index ede656581bd..bf917fc8936 100644
--- a/src/mame/video/bwing.c
+++ b/src/mame/video/bwing.c
@@ -144,7 +144,7 @@ WRITE8_HANDLER( bwing_paletteram_w )
g = ((g<<5) + (g<<2) + (g>>1));
b = ((b<<5) + (b<<2) + (b>>1));
- if ((i = readinputport(7)) < 4)
+ if ((i = input_port_read_indexed(machine, 7)) < 4)
{
r = (float)r * rgb[i][0];
g = (float)g * rgb[i][1];
diff --git a/src/mame/video/canyon.c b/src/mame/video/canyon.c
index 446d0648c31..f9403416eca 100644
--- a/src/mame/video/canyon.c
+++ b/src/mame/video/canyon.c
@@ -91,7 +91,7 @@ VIDEO_UPDATE( canyon )
draw_bombs(bitmap, cliprect);
/* watchdog is disabled during service mode */
- watchdog_enable(screen->machine, !(readinputport(2) & 0x10));
+ watchdog_enable(screen->machine, !(input_port_read_indexed(screen->machine, 2) & 0x10));
return 0;
}
diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c
index f41ee0b1b1c..f01ba9ad2b0 100644
--- a/src/mame/video/centiped.c
+++ b/src/mame/video/centiped.c
@@ -103,7 +103,7 @@ VIDEO_START( warlords )
bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
/* we overload centiped_flipscreen here to track the cocktail/upright state */
- centiped_flipscreen = readinputport(0) & 0x80;
+ centiped_flipscreen = input_port_read_indexed(machine, 0) & 0x80;
tilemap_set_flip(bg_tilemap, centiped_flipscreen ? TILEMAP_FLIPX : 0);
}
@@ -443,7 +443,7 @@ VIDEO_UPDATE( centiped )
VIDEO_UPDATE( warlords )
{
- int upright_mode = readinputport(0) & 0x80;
+ int upright_mode = input_port_read_indexed(screen->machine, 0) & 0x80;
int offs;
/* if the cocktail/upright switch flipped, force refresh */
diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c
index 5e6bc0da5c1..d4ab44c61d6 100644
--- a/src/mame/video/cinemat.c
+++ b/src/mame/video/cinemat.c
@@ -243,7 +243,7 @@ VIDEO_UPDATE( cinemat )
VIDEO_UPDATE( spacewar )
{
- int sw_option = readinputportbytag("INPUTS");
+ int sw_option = input_port_read(screen->machine, "INPUTS");
VIDEO_UPDATE_CALL(cinemat);
diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c
index b9d78888b73..27bbecf073b 100644
--- a/src/mame/video/cischeat.c
+++ b/src/mame/video/cischeat.c
@@ -183,10 +183,10 @@ VIDEO_START( bigrun )
and allows the shift to be handled using two buttons */
-static int read_shift(void)
+static int read_shift(running_machine *machine)
{
static int ret = 1; /* start with low shift */
- switch ( (readinputport(0) >> 2) & 3 )
+ switch ( (input_port_read_indexed(machine, 0) >> 2) & 3 )
{
case 1 : ret = 1; break; // low shift: button 3
case 2 : ret = 0; break; // high shift: button 4
@@ -204,9 +204,9 @@ static int read_shift(void)
We support just 2 values for now..
*/
-static int read_accelerator(void)
+static int read_accelerator(running_machine *machine)
{
- if (readinputport(0) & 1) return 0x00; // pedal pressed
+ if (input_port_read_indexed(machine, 0) & 1) return 0x00; // pedal pressed
else return 0xff;
}
@@ -219,26 +219,26 @@ READ16_HANDLER( bigrun_vregs_r )
{
switch (offset)
{
- case 0x0000/2 : return readinputport(1); // Coins
- case 0x0002/2 : return readinputport(2) +
- (read_shift()<<1); // Buttons
- case 0x0004/2 : return readinputport(3); // Motor Limit Switches
- case 0x0006/2 : return readinputport(4); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read_indexed(machine, 1); // Coins
+ case 0x0002/2 : return input_port_read_indexed(machine, 2) +
+ (read_shift(machine)<<1); // Buttons
+ case 0x0004/2 : return input_port_read_indexed(machine, 3); // Motor Limit Switches
+ case 0x0006/2 : return input_port_read_indexed(machine, 4); // DSW 1 & 2
case 0x0008/2 : return soundlatch2_word_r(machine,0,0); // From sound cpu
case 0x0010/2 :
switch (cischeat_ip_select & 0x3)
{
- case 0 : return readinputport(6); // Driving Wheel
+ case 0 : return input_port_read_indexed(machine, 6); // Driving Wheel
case 1 : return 0xffff; // Cockpit: Up / Down Position
case 2 : return 0xffff; // Cockpit: Left / Right Position?
- case 3 : return ~read_accelerator(); // Accelerator (Pedal)
+ case 3 : return ~read_accelerator(machine); // Accelerator (Pedal)
default: return 0xffff;
}
- case 0x2200/2 : return readinputport(5); // DSW 3 (4 bits)
+ case 0x2200/2 : return input_port_read_indexed(machine, 5); // DSW 3 (4 bits)
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return megasys1_vregs[offset];
@@ -316,22 +316,22 @@ READ16_HANDLER( cischeat_vregs_r )
{
switch (offset)
{
- case 0x0000/2 : return readinputport(1); // Coins
- case 0x0002/2 : return readinputport(2) +
- (read_shift()<<1); // Buttons
- case 0x0004/2 : return readinputport(3); // Motor Limit Switches
- case 0x0006/2 : return readinputport(4); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read_indexed(machine, 1); // Coins
+ case 0x0002/2 : return input_port_read_indexed(machine, 2) +
+ (read_shift(machine)<<1); // Buttons
+ case 0x0004/2 : return input_port_read_indexed(machine, 3); // Motor Limit Switches
+ case 0x0006/2 : return input_port_read_indexed(machine, 4); // DSW 1 & 2
case 0x0010/2 :
switch (cischeat_ip_select & 0x3)
{
- case 0 : return readinputport(6); // Driving Wheel
+ case 0 : return input_port_read_indexed(machine, 6); // Driving Wheel
case 1 : return ~0; // Cockpit: Up / Down Position?
case 2 : return ~0; // Cockpit: Left / Right Position?
default: return ~0;
}
- case 0x2200/2 : return readinputport(5); // DSW 3 (4 bits)
+ case 0x2200/2 : return input_port_read_indexed(machine, 5); // DSW 3 (4 bits)
case 0x2300/2 : return soundlatch2_r(machine,0); // From sound cpu
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
@@ -412,22 +412,22 @@ READ16_HANDLER( f1gpstar_vregs_r )
{
case 0x0000/2 : // DSW 1&2: coinage changes with Country
{
- int val = readinputport(1);
- if (val & 0x0200) return readinputport(6) | val; // JP, US
- else return readinputport(7) | val; // UK, FR
+ int val = input_port_read_indexed(machine, 1);
+ if (val & 0x0200) return input_port_read_indexed(machine, 6) | val; // JP, US
+ else return input_port_read_indexed(machine, 7) | val; // UK, FR
}
// case 0x0002/2 : return 0xFFFF;
- case 0x0004/2 : return readinputport(2) +
- (read_shift()<<5); // Buttons
+ case 0x0004/2 : return input_port_read_indexed(machine, 2) +
+ (read_shift(machine)<<5); // Buttons
- case 0x0006/2 : return readinputport(3); // ? Read at boot only
+ case 0x0006/2 : return input_port_read_indexed(machine, 3); // ? Read at boot only
case 0x0008/2 : return soundlatch2_r(machine,0); // From sound cpu
- case 0x000c/2 : return readinputport(4); // DSW 3
+ case 0x000c/2 : return input_port_read_indexed(machine, 4); // DSW 3
case 0x0010/2 : // Accel + Driving Wheel
- return (read_accelerator()&0xff) + ((readinputport(5)&0xff)<<8);
+ return (read_accelerator(machine)&0xff) + ((input_port_read_indexed(machine, 5)&0xff)<<8);
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return megasys1_vregs[offset];
@@ -460,14 +460,14 @@ READ16_HANDLER( wildplt_vregs_r )
switch (offset)
{
- case 0x0000/2 : return readinputport(0); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read_indexed(machine, 0); // DSW 1 & 2
- case 0x0004/2 : return readinputport(1); // Buttons
+ case 0x0004/2 : return input_port_read_indexed(machine, 1); // Buttons
case 0x0008/2 : return soundlatch2_r(machine,0); // From sound cpu
case 0x0010/2 : // X, Y
- return readinputport(2) | (readinputport(3)<<8);
+ return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3)<<8);
case 0x0018/2 :
return (f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c
index 682303273d3..6ea98a47073 100644
--- a/src/mame/video/combatsc.c
+++ b/src/mame/video/combatsc.c
@@ -346,7 +346,7 @@ static WRITE8_HANDLER( combascb_sh_irqtrigger_w )
static READ8_HANDLER( combascb_io_r )
{
- return readinputport(offset);
+ return input_port_read_indexed(machine, offset);
}
static WRITE8_HANDLER( combascb_priority_w )
diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c
index de30e7c9e0a..6fdbc5beb2f 100644
--- a/src/mame/video/dcheese.c
+++ b/src/mame/video/dcheese.c
@@ -317,9 +317,9 @@ READ16_HANDLER( madmax_blitter_vidparam_r )
{
/* analog inputs seem to be hooked up here -- might not actually map to blitter */
if (offset == 0x02/2)
- return readinputport(3);
+ return input_port_read_indexed(machine, 3);
if (offset == 0x0e/2)
- return readinputport(4);
+ return input_port_read_indexed(machine, 4);
/* early code polls on this bit, wants it to be 0 */
if (offset == 0x36/2)
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index af694e5aeed..01e8c082d82 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -840,7 +840,7 @@ static void check_palette(running_machine *machine)
num = port_tag_to_index("VIDHW");
if (num>=0)
{
- newset = readinputport(num);
+ newset = input_port_read_indexed(machine, num);
if (newset != state->vidhw)
{
state->vidhw = newset;
diff --git a/src/mame/video/exidy.c b/src/mame/video/exidy.c
index 95b21b2b4b8..1d13d09ce70 100644
--- a/src/mame/video/exidy.c
+++ b/src/mame/video/exidy.c
@@ -70,17 +70,17 @@ VIDEO_START( exidy )
*
*************************************/
-INLINE void latch_condition(int collision)
+INLINE void latch_condition(running_machine *machine, int collision)
{
collision ^= collision_invert;
- int_condition = (readinputportbytag("INTSOURCE") & ~0x1c) | (collision & collision_mask);
+ int_condition = (input_port_read(machine, "INTSOURCE") & ~0x1c) | (collision & collision_mask);
}
INTERRUPT_GEN( exidy_vblank_interrupt )
{
/* latch the current condition */
- latch_condition(0);
+ latch_condition(machine, 0);
int_condition &= ~0x80;
/* set the IRQ line */
@@ -283,7 +283,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static TIMER_CALLBACK( collision_irq_callback )
{
/* latch the collision bits */
- latch_condition(param);
+ latch_condition(machine, param);
/* set the IRQ line */
cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c
index 1492185452a..427581dc1e9 100644
--- a/src/mame/video/exidy440.c
+++ b/src/mame/video/exidy440.c
@@ -446,8 +446,8 @@ static VIDEO_UPDATE( exidy440 )
{
int i;
- int beamx = ((readinputport(4) & 0xff) * (HBSTART - HBEND)) >> 8;
- int beamy = ((readinputport(5) & 0xff) * (VBSTART - VBEND)) >> 8;
+ int beamx = ((input_port_read_indexed(screen->machine, 4) & 0xff) * (HBSTART - HBEND)) >> 8;
+ int beamy = ((input_port_read_indexed(screen->machine, 5) & 0xff) * (VBSTART - VBEND)) >> 8;
/* The timing of this FIRQ is very important. The games look for an FIRQ
and then wait about 650 cycles, clear the old FIRQ, and wait a
diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c
index 654f0f98df7..ae30d56c381 100644
--- a/src/mame/video/fgoal.c
+++ b/src/mame/video/fgoal.c
@@ -51,7 +51,7 @@ VIDEO_UPDATE( fgoal )
/* draw color overlay foreground and background */
- if (fgoal_player == 1 && (readinputport(1) & 0x40))
+ if (fgoal_player == 1 && (input_port_read_indexed(screen->machine, 1) & 0x40))
{
drawgfxzoom(fgbitmap, screen->machine->gfx[0],
0, (fgoal_player << 2) | current_color,
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 53028bd0153..1ee779141d1 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -479,7 +479,7 @@ READ8_HANDLER( itech8_blitter_r )
/* a read from offsets 12-15 return input port values */
if (offset >= 12 && offset <= 15)
- result = readinputport(3 + offset - 12);
+ result = input_port_read_indexed(machine, 3 + offset - 12);
return result;
}
diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c
index 430488ebc49..e8927e84ce6 100644
--- a/src/mame/video/jaguar.c
+++ b/src/mame/video/jaguar.c
@@ -241,8 +241,8 @@ INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *
int width = visarea->max_x + 1 - visarea->min_x;
int height = visarea->max_y + 1 - visarea->min_y;
- *x = visarea->min_x + (((readinputport(3 + player * 2) & 0xff) * width) >> 8);
- *y = visarea->min_y + (((readinputport(4 + player * 2) & 0xff) * height) >> 8);
+ *x = visarea->min_x + (((input_port_read_indexed(machine, 3 + player * 2) & 0xff) * width) >> 8);
+ *y = visarea->min_y + (((input_port_read_indexed(machine, 4 + player * 2) & 0xff) * height) >> 8);
}
@@ -741,7 +741,7 @@ READ32_HANDLER( cojag_gun_input_r )
return (beamy << 16) | (beamx ^ 0x1ff);
case 2:
- return readinputport(7) << 16;
+ return input_port_read_indexed(machine, 7) << 16;
}
return 0;
}
diff --git a/src/mame/video/lazercmd.c b/src/mame/video/lazercmd.c
index 9b44ce9481c..349953e88d8 100644
--- a/src/mame/video/lazercmd.c
+++ b/src/mame/video/lazercmd.c
@@ -57,7 +57,7 @@ VIDEO_UPDATE( lazercmd )
{
int i,x,y;
- int video_inverted = readinputport(2) & 0x20;
+ int video_inverted = input_port_read_indexed(screen->machine, 2) & 0x20;
/* The first row of characters are invisible */
for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++)
diff --git a/src/mame/video/lethal.c b/src/mame/video/lethal.c
index 627751d4226..6f72a0c6d9e 100644
--- a/src/mame/video/lethal.c
+++ b/src/mame/video/lethal.c
@@ -10,8 +10,8 @@
#include "driver.h"
#include "video/konamiic.h"
-#define GUNX( a ) ( ( readinputport( a ) * 287 ) / 0xff )
-#define GUNY( a ) ( ( readinputport( a ) * 223 ) / 0xff )
+#define GUNX( a ) ( ( input_port_read_indexed(machine, a ) * 287 ) / 0xff )
+#define GUNY( a ) ( ( input_port_read_indexed(machine, a ) * 223 ) / 0xff )
static int sprite_colorbase;
static int layer_colorbase[4];
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c
index 4965f01de38..982bf8ee685 100644
--- a/src/mame/video/lethalj.c
+++ b/src/mame/video/lethalj.c
@@ -40,8 +40,8 @@ INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *
int width = visarea->max_x + 1 - visarea->min_x;
int height = visarea->max_y + 1 - visarea->min_y;
- *x = ((readinputport(2 + player * 2) & 0xff) * width) / 255;
- *y = ((readinputport(3 + player * 2) & 0xff) * height) / 255;
+ *x = ((input_port_read_indexed(machine, 2 + player * 2) & 0xff) * width) / 255;
+ *y = ((input_port_read_indexed(machine, 3 + player * 2) & 0xff) * height) / 255;
}
diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c
index 8a251f1629b..e4824cb04e1 100644
--- a/src/mame/video/lordgun.c
+++ b/src/mame/video/lordgun.c
@@ -187,24 +187,24 @@ static const int lordgun_gun_x_table[] =
0x1B3,0x1B4,0x1B5,0x1B6,0x1B7,0x1B8,0x1B9,0x1BA,0x1BB,0x1BC,0x1BD,0x1BE,0x1BF,0x1BF
};
-static void lorddgun_calc_gun_scr(int i)
+static void lorddgun_calc_gun_scr(running_machine *machine, int i)
{
- int x = readinputport(5+i) - 0x3c;
+ int x = input_port_read_indexed(machine, 5+i) - 0x3c;
if ( (x < 0) || (x > sizeof(lordgun_gun_x_table)/sizeof(lordgun_gun_x_table[0])) )
x = 0;
lordgun_gun[i].scr_x = lordgun_gun_x_table[x];
- lordgun_gun[i].scr_y = readinputport(7+i);
+ lordgun_gun[i].scr_y = input_port_read_indexed(machine, 7+i);
}
-void lordgun_update_gun(int i)
+void lordgun_update_gun(running_machine *machine, int i)
{
- const rectangle *visarea = video_screen_get_visible_area(Machine->primary_screen);
+ const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
- lordgun_gun[i].hw_x = readinputport(5+i);
- lordgun_gun[i].hw_y = readinputport(7+i);
+ lordgun_gun[i].hw_x = input_port_read_indexed(machine, 5+i);
+ lordgun_gun[i].hw_y = input_port_read_indexed(machine, 7+i);
- lorddgun_calc_gun_scr(i);
+ lorddgun_calc_gun_scr(machine, i);
if ( (lordgun_gun[i].scr_x < visarea->min_x) ||
(lordgun_gun[i].scr_x > visarea->max_x) ||
diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c
index 0b3c8c7a7b0..313d48fa171 100644
--- a/src/mame/video/m52.c
+++ b/src/mame/video/m52.c
@@ -279,7 +279,7 @@ WRITE8_HANDLER( m52_bgcontrol_w )
WRITE8_HANDLER( m52_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flip_screen_set((data & 0x01) ^ (~readinputportbytag("DSW2") & 0x01));
+ flip_screen_set((data & 0x01) ^ (~input_port_read(machine, "DSW2") & 0x01));
coin_counter_w(0, data & 0x02);
coin_counter_w(1, data & 0x20);
diff --git a/src/mame/video/m57.c b/src/mame/video/m57.c
index 0b71fd7582f..634b3155155 100644
--- a/src/mame/video/m57.c
+++ b/src/mame/video/m57.c
@@ -158,7 +158,7 @@ VIDEO_START( m57 )
WRITE8_HANDLER( m57_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flipscreen = (data & 0x01) ^ (~readinputportbytag("DSW2") & 0x01);
+ flipscreen = (data & 0x01) ^ (~input_port_read(machine, "DSW2") & 0x01);
tilemap_set_flip(bg_tilemap, flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
coin_counter_w(0,data & 0x02);
diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c
index 14852fa289e..b7a3c6d6a87 100644
--- a/src/mame/video/m58.c
+++ b/src/mame/video/m58.c
@@ -203,7 +203,7 @@ VIDEO_START( yard )
WRITE8_HANDLER( yard_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flip_screen_set((data & 0x01) ^ (~readinputportbytag("DSW2") & 0x01));
+ flip_screen_set((data & 0x01) ^ (~input_port_read(machine, "DSW2") & 0x01));
coin_counter_w(0, data & 0x02);
coin_counter_w(1, data & 0x20);
diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c
index b883bf922fc..d3175e8a097 100644
--- a/src/mame/video/m62.c
+++ b/src/mame/video/m62.c
@@ -295,7 +295,7 @@ static void register_savestate(void)
WRITE8_HANDLER( m62_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- data ^= ~readinputport(4) & 1;
+ data ^= ~input_port_read_indexed(machine, 4) & 1;
flipscreen = data & 0x01;
if (flipscreen)
diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c
index 192f5cf4c6b..a47212cd6e1 100644
--- a/src/mame/video/m72.c
+++ b/src/mame/video/m72.c
@@ -346,7 +346,7 @@ WRITE16_HANDLER( m72_port02_w )
coin_counter_w(1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((data & 0x04) >> 2) ^ ((~readinputport(2) >> 8) & 1));
+ flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read_indexed(machine, 2) >> 8) & 1));
/* bit 3 is display disable */
video_off = data & 0x08;
@@ -372,7 +372,7 @@ WRITE16_HANDLER( rtype2_port02_w )
coin_counter_w(1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((data & 0x04) >> 2) ^ ((~readinputport(2) >> 8) & 1));
+ flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read_indexed(machine, 2) >> 8) & 1));
/* bit 3 is display disable */
video_off = data & 0x08;
diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c
index b09ee96a7a0..19b9b9dd5d3 100644
--- a/src/mame/video/m92.c
+++ b/src/mame/video/m92.c
@@ -463,7 +463,7 @@ VIDEO_UPDATE( m92 )
m92_screenrefresh(screen->machine, bitmap, cliprect);
/* Flipscreen appears hardwired to the dipswitch - strange */
- if (readinputportbytag("DIPS21") & 0x100)
+ if (input_port_read(screen->machine, "DIPS21") & 0x100)
flip_screen_set(0);
else
flip_screen_set(1);
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c
index 9dfe00a2305..0ee87a78ae0 100644
--- a/src/mame/video/madalien.c
+++ b/src/mame/video/madalien.c
@@ -253,7 +253,7 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
static VIDEO_UPDATE( madalien )
{
- int flip = BIT(readinputportbytag("DIP"), 6) && BIT(*madalien_video_control, 0);
+ int flip = BIT(input_port_read(screen->machine, "DIP"), 6) && BIT(*madalien_video_control, 0);
// bits #0 and #1 define scrolling mode
//
diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c
index f153ce2d5fc..691dca0815c 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -212,7 +212,7 @@ VIDEO_UPDATE( mario )
mario_state *state = screen->machine->driver_data;
int t;
- t = readinputportbytag("MONITOR");
+ t = input_port_read(screen->machine, "MONITOR");
if (t != state->monitor)
{
state->monitor = t;
diff --git a/src/mame/video/momoko.c b/src/mame/video/momoko.c
index 7f0bba37332..a984c4e3356 100644
--- a/src/mame/video/momoko.c
+++ b/src/mame/video/momoko.c
@@ -111,7 +111,7 @@ VIDEO_UPDATE( momoko )
UINT8 *TEXT_COLOR = memory_region( REGION_PROMS );
- flip = momoko_flipscreen ^ (readinputport(4) & 0x01);
+ flip = momoko_flipscreen ^ (input_port_read_indexed(screen->machine, 4) & 0x01);
/* draw BG layer */
diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c
index 97c59af615c..e31bf4eb698 100644
--- a/src/mame/video/mystston.c
+++ b/src/mame/video/mystston.c
@@ -257,7 +257,7 @@ static VIDEO_UPDATE( mystston )
{
mystston_state *state = screen->machine->driver_data;
- int flip = (*state->video_control & 0x80) ^ ((readinputportbytag("DSW1") & 0x20) << 2);
+ int flip = (*state->video_control & 0x80) ^ ((input_port_read(screen->machine, "DSW1") & 0x20) << 2);
set_palette(screen->machine, state);
diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c
index 93aac6626c5..3e62f6fd24b 100644
--- a/src/mame/video/n8080.c
+++ b/src/mame/video/n8080.c
@@ -269,8 +269,8 @@ VIDEO_UPDATE( sheriff )
VIDEO_UPDATE( helifire )
{
- int SUN_BRIGHTNESS = readinputport(4);
- int SEA_BRIGHTNESS = readinputport(5);
+ int SUN_BRIGHTNESS = input_port_read_indexed(screen->machine, 4);
+ int SEA_BRIGHTNESS = input_port_read_indexed(screen->machine, 5);
static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 };
diff --git a/src/mame/video/namcofl.c b/src/mame/video/namcofl.c
index 6c081b513f5..7a340b804b6 100644
--- a/src/mame/video/namcofl.c
+++ b/src/mame/video/namcofl.c
@@ -87,24 +87,24 @@ static UINT8 credits1, credits2;
static int old_coin_state;
static void
-handle_mcu( void )
+handle_mcu( running_machine *machine )
{
UINT8 *IORAM = (UINT8 *)namcofl_mcuram;
static int toggle;
- int new_coin_state = readinputport(3)&0x30;
- unsigned p1 = readinputport(0);
- unsigned p2 = readinputport(2);
- unsigned p3 = readinputport(1);
- unsigned p4 = readinputport(3);
+ int new_coin_state = input_port_read_indexed(machine, 3)&0x30;
+ unsigned p1 = input_port_read_indexed(machine, 0);
+ unsigned p2 = input_port_read_indexed(machine, 2);
+ unsigned p3 = input_port_read_indexed(machine, 1);
+ unsigned p4 = input_port_read_indexed(machine, 3);
IORAM[BYTE4_XOR_LE(0x6000)] = p1;
IORAM[BYTE4_XOR_LE(0x6003)] = p2;
IORAM[BYTE4_XOR_LE(0x6005)] = p3;
IORAM[BYTE4_XOR_LE(0x60b8)] = p4;
- IORAM[BYTE4_XOR_LE(0x6014)] = readinputport(6)-1; // handle
- IORAM[BYTE4_XOR_LE(0x6016)] = readinputport(5); // brake
- IORAM[BYTE4_XOR_LE(0x6018)] = readinputport(4); // accelerator
+ IORAM[BYTE4_XOR_LE(0x6014)] = input_port_read_indexed(machine, 6)-1; // handle
+ IORAM[BYTE4_XOR_LE(0x6016)] = input_port_read_indexed(machine, 5); // brake
+ IORAM[BYTE4_XOR_LE(0x6018)] = input_port_read_indexed(machine, 4); // accelerator
if (!(new_coin_state & 0x20) && (old_coin_state & 0x20))
{
@@ -145,7 +145,7 @@ VIDEO_UPDATE( namcofl )
{
int pri;
- handle_mcu();
+ handle_mcu(screen->machine);
namcofl_install_palette(screen->machine);
fillbitmap( bitmap, get_black_pen(screen->machine), cliprect );
@@ -180,7 +180,7 @@ static int FLobjcode2tile( int code )
VIDEO_START( namcofl )
{
credits1 = credits2 = 0;
- old_coin_state = readinputport(3)&0x30;
+ old_coin_state = input_port_read_indexed(machine, 3)&0x30;
namco_tilemap_init( NAMCONB1_TILEGFX, memory_region(NAMCONB1_TILEMASKREGION), TilemapCB );
namco_obj_init(NAMCONB1_SPRITEGFX,0x0,FLobjcode2tile);
diff --git a/src/mame/video/namconb1.c b/src/mame/video/namconb1.c
index ac5365c7bd4..36606bc2f12 100644
--- a/src/mame/video/namconb1.c
+++ b/src/mame/video/namconb1.c
@@ -106,7 +106,7 @@ static void namconb1_install_palette(running_machine *machine)
* communication with the sound CPU.
*/
static void
-handle_mcu( void )
+handle_mcu( running_machine *machine )
{
static int toggle;
static UINT16 credits;
@@ -115,18 +115,18 @@ handle_mcu( void )
static int old_p2;
static int old_p3;
static int old_p4;
- int new_coin_state = readinputport(0)&0x3; /* coin1,2 */
- unsigned dsw = readinputport(1)<<16;
- unsigned p1 = readinputport(2);
- unsigned p2 = readinputport(3);
+ int new_coin_state = input_port_read_indexed(machine, 0)&0x3; /* coin1,2 */
+ unsigned dsw = input_port_read_indexed(machine, 1)<<16;
+ unsigned p1 = input_port_read_indexed(machine, 2);
+ unsigned p2 = input_port_read_indexed(machine, 3);
unsigned p3;
unsigned p4;
toggle = !toggle;
if( toggle ) dsw &= ~(0x80<<16);
if( namcos2_gametype == NAMCONB2_MACH_BREAKERS )
{
- p3 = readinputport(4);
- p4 = readinputport(5);
+ p3 = input_port_read_indexed(machine, 4);
+ p4 = input_port_read_indexed(machine, 5);
}
else
{
@@ -161,7 +161,7 @@ static void
video_update_common(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bROZ )
{
int pri;
- handle_mcu();
+ handle_mcu(machine);
namconb1_install_palette(machine);
if( bROZ )
diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c
index 95264b83d9a..890be16b37d 100644
--- a/src/mame/video/nmk16.c
+++ b/src/mame/video/nmk16.c
@@ -554,7 +554,7 @@ VIDEO_UPDATE( macross )
}
/*coin setting MCU simulation*/
-static void mcu_run(UINT8 dsw_setting)
+static void mcu_run(running_machine *machine, UINT8 dsw_setting)
{
static UINT8 read_coin;
static UINT8 old_value;
@@ -563,24 +563,24 @@ static void mcu_run(UINT8 dsw_setting)
/*needed because of the uncompatibility of the dsw settings.*/
if(dsw_setting)
{
- dsw_a = (readinputport(2+dsw_setting) & 0x7);
- dsw_b = (readinputport(2+dsw_setting) & 0x38) >> 3;
+ dsw_a = (input_port_read_indexed(machine, 2+dsw_setting) & 0x7);
+ dsw_b = (input_port_read_indexed(machine, 2+dsw_setting) & 0x38) >> 3;
}
else
{
- dsw_a = (readinputport(2) & 0x0700) >> 8;
- dsw_b = (readinputport(2) & 0x3800) >> 11;
+ dsw_a = (input_port_read_indexed(machine, 2) & 0x0700) >> 8;
+ dsw_b = (input_port_read_indexed(machine, 2) & 0x3800) >> 11;
}
read_coin = old_value;
- old_value = readinputport(0);
+ old_value = input_port_read_indexed(machine, 0);
if(dsw_a == 0 || dsw_b == 0)
nmk16_mainram[0x9000/2]|=0x4000; //free_play
if(read_coin != old_value)
{
- if(!(readinputport(0) & 0x01))//COIN1
+ if(!(input_port_read_indexed(machine, 0) & 0x01))//COIN1
{
switch(dsw_a & 7)
{
@@ -615,7 +615,7 @@ static void mcu_run(UINT8 dsw_setting)
}
}
- if(!(readinputport(0) & 0x02))//COIN2
+ if(!(input_port_read_indexed(machine, 0) & 0x02))//COIN2
{
switch(dsw_b & 7)
{
@@ -650,19 +650,19 @@ static void mcu_run(UINT8 dsw_setting)
}
}
- if(!(readinputport(0) & 0x04))//SERVICE_COIN
+ if(!(input_port_read_indexed(machine, 0) & 0x04))//SERVICE_COIN
nmk16_mainram[0xef00/2]++;
if(nmk16_mainram[0xef00/2] >= 1 && (nmk16_mainram[0x9000/2] & 0x8000))/*enable start button*/
{
/*Start a 1-player game,but don't decrement if the player 1 is already playing*/
- if((!(readinputport(0) & 0x08)) /*START1*/
+ if((!(input_port_read_indexed(machine, 0) & 0x08)) /*START1*/
&& (!(nmk16_mainram[0x9000/2] & 0x0200)) /*PLAYER-1 playing*/
)
nmk16_mainram[0xef00/2]--;
/*Start a 2-players game,but don't decrement if the player 2 is already playing*/
- if((!(readinputport(0) & 0x10))
+ if((!(input_port_read_indexed(machine, 0) & 0x10))
&& (!(nmk16_mainram[0x9000/2] & 0x0100))
)
{
@@ -679,7 +679,7 @@ static void mcu_run(UINT8 dsw_setting)
VIDEO_UPDATE( tdragon )
{
- mcu_run(1);
+ mcu_run(screen->machine, 1);
tilemap_set_scrollx(tx_tilemap,0,-videoshift);
@@ -696,7 +696,7 @@ VIDEO_UPDATE( tdragon )
VIDEO_UPDATE( hachamf )
{
- mcu_run(0);
+ mcu_run(screen->machine, 0);
tilemap_set_scrollx(tx_tilemap,0,-videoshift);
@@ -1052,8 +1052,8 @@ static void video_update(running_machine *machine, bitmap_t *bitmap, const recta
if (dsw_flipscreen)
{
- flip_screen_x_set(~readinputport(2) & 0x0100);
- flip_screen_y_set(~readinputport(2) & 0x0200);
+ flip_screen_x_set(~input_port_read_indexed(machine, 2) & 0x0100);
+ flip_screen_y_set(~input_port_read_indexed(machine, 2) & 0x0200);
}
tilemap_set_scrollx(tilemap_0, 0, afega_scroll_0[1] + xoffset);
diff --git a/src/mame/video/oneshot.c b/src/mame/video/oneshot.c
index 2fbe46af974..089dd01dbb4 100644
--- a/src/mame/video/oneshot.c
+++ b/src/mame/video/oneshot.c
@@ -76,12 +76,12 @@ VIDEO_START( oneshot )
tilemap_set_transparent_pen(oneshot_fg_tilemap,0);
}
-static void draw_crosshairs( bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_crosshairs( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
int xpos,ypos;
/* get gun raw coordonates (player 1) */
- gun_x_p1 = (readinputport(5) & 0xff) * 320 / 256;
- gun_y_p1 = (readinputport(6) & 0xff) * 240 / 256;
+ gun_x_p1 = (input_port_read_indexed(machine, 5) & 0xff) * 320 / 256;
+ gun_y_p1 = (input_port_read_indexed(machine, 6) & 0xff) * 240 / 256;
/* compute the coordonates for drawing (from routine at 0x009ab0) */
xpos = gun_x_p1;
@@ -95,8 +95,8 @@ static void draw_crosshairs( bitmap_t *bitmap, const rectangle *cliprect )
/* get gun raw coordonates (player 2) */
- gun_x_p2 = (readinputport(7) & 0xff) * 320 / 256;
- gun_y_p2 = (readinputport(8) & 0xff) * 240 / 256;
+ gun_x_p2 = (input_port_read_indexed(machine, 7) & 0xff) * 320 / 256;
+ gun_y_p2 = (input_port_read_indexed(machine, 8) & 0xff) * 240 / 256;
/* compute the coordonates for drawing (from routine at 0x009b6e) */
xpos = gun_x_p2;
ypos = gun_y_p2;
@@ -177,7 +177,7 @@ VIDEO_UPDATE( oneshot )
tilemap_draw(bitmap,cliprect,oneshot_mid_tilemap,0,0);
draw_sprites(screen->machine,bitmap,cliprect);
tilemap_draw(bitmap,cliprect,oneshot_fg_tilemap,0,0);
- draw_crosshairs(bitmap,cliprect);
+ draw_crosshairs(screen->machine,bitmap,cliprect);
return 0;
}
@@ -191,7 +191,7 @@ VIDEO_UPDATE( maddonna )
tilemap_draw(bitmap,cliprect,oneshot_fg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,oneshot_bg_tilemap,0,0);
draw_sprites(screen->machine,bitmap,cliprect);
-// draw_crosshairs(bitmap,cliprect); // not a gun game
+// draw_crosshairs(screen->machine,bitmap,cliprect); // not a gun game
// popmessage ("%04x %04x %04x %04x %04x %04x %04x %04x", oneshot_scroll[0],oneshot_scroll[1],oneshot_scroll[2],oneshot_scroll[3],oneshot_scroll[4],oneshot_scroll[5],oneshot_scroll[6],oneshot_scroll[7]);
return 0;
diff --git a/src/mame/video/orbit.c b/src/mame/video/orbit.c
index 5fc109e09f8..3056c958330 100644
--- a/src/mame/video/orbit.c
+++ b/src/mame/video/orbit.c
@@ -86,7 +86,7 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta
VIDEO_UPDATE( orbit )
{
- orbit_flip_screen = readinputport(3) & 8;
+ orbit_flip_screen = input_port_read_indexed(screen->machine, 3) & 8;
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c
index 9a54446c683..31d7df32122 100644
--- a/src/mame/video/phoenix.c
+++ b/src/mame/video/phoenix.c
@@ -293,14 +293,14 @@ WRITE8_HANDLER( phoenix_scroll_w )
READ8_HANDLER( phoenix_input_port_0_r )
{
if (cocktail_mode)
- return (readinputportbytag("IN0") & 0x07) | (readinputportbytag("IN1") & 0xf8);
+ return (input_port_read(machine, "IN0") & 0x07) | (input_port_read(machine, "IN1") & 0xf8);
else
- return readinputportbytag("IN0");
+ return input_port_read(machine, "IN0");
}
READ8_HANDLER( pleiads_input_port_0_r )
{
- int ret = readinputportbytag("IN0") & 0xf7;
+ int ret = input_port_read(machine, "IN0") & 0xf7;
/* handle Pleiads protection */
switch (pleiads_protection_question)
@@ -323,7 +323,7 @@ READ8_HANDLER( pleiads_input_port_0_r )
READ8_HANDLER( survival_input_port_0_r )
{
- int ret = readinputportbytag("IN0");
+ int ret = input_port_read(machine, "IN0");
if (survival_protection_value)
{
diff --git a/src/mame/video/polepos.c b/src/mame/video/polepos.c
index 65a900cf06f..bb2ff504d58 100644
--- a/src/mame/video/polepos.c
+++ b/src/mame/video/polepos.c
@@ -518,7 +518,7 @@ VIDEO_UPDATE( polepos )
/* original arcade doesn't work in this way */
#ifdef MAME_DEBUG
{
- int in = readinputport( 0 );
+ int in = input_port_read_indexed(screen->machine, 0 );
static int lastin;
if ((in ^ lastin) & polepos_gear_bit)
diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c
index b38d0115cee..571123306a2 100644
--- a/src/mame/video/policetr.c
+++ b/src/mame/video/policetr.c
@@ -283,25 +283,25 @@ READ32_HANDLER( policetr_video_r )
{
/* latch 0x00 is player 1's gun X coordinate */
case 0x00:
- inputval = ((readinputport(3) & 0xff) * width) >> 8;
+ inputval = ((input_port_read_indexed(machine, 3) & 0xff) * width) >> 8;
inputval += 0x50;
return (inputval << 20) | 0x20000000;
/* latch 0x01 is player 1's gun Y coordinate */
case 0x01:
- inputval = ((readinputport(4) & 0xff) * height) >> 8;
+ inputval = ((input_port_read_indexed(machine, 4) & 0xff) * height) >> 8;
inputval += 0x17;
return (inputval << 20);
/* latch 0x02 is player 2's gun X coordinate */
case 0x02:
- inputval = ((readinputport(5) & 0xff) * width) >> 8;
+ inputval = ((input_port_read_indexed(machine, 5) & 0xff) * width) >> 8;
inputval += 0x50;
return (inputval << 20) | 0x20000000;
/* latch 0x03 is player 2's gun Y coordinate */
case 0x03:
- inputval = ((readinputport(6) & 0xff) * height) >> 8;
+ inputval = ((input_port_read_indexed(machine, 6) & 0xff) * height) >> 8;
inputval += 0x17;
return (inputval << 20);
diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c
index 8a0bc2b3abc..14a0e0cffa2 100644
--- a/src/mame/video/prehisle.c
+++ b/src/mame/video/prehisle.c
@@ -32,11 +32,11 @@ READ16_HANDLER( prehisle_control16_r )
{
switch (offset)
{
- case 0x08: return readinputport(1); // Player 2
- case 0x10: return readinputport(2); // Coins, Tilt, Service
- case 0x20: return readinputport(0) ^ invert_controls; // Player 1
- case 0x21: return readinputport(3); // DIPs
- case 0x22: return readinputport(4); // DIPs + VBLANK
+ case 0x08: return input_port_read_indexed(machine, 1); // Player 2
+ case 0x10: return input_port_read_indexed(machine, 2); // Coins, Tilt, Service
+ case 0x20: return input_port_read_indexed(machine, 0) ^ invert_controls; // Player 1
+ case 0x21: return input_port_read_indexed(machine, 3); // DIPs
+ case 0x22: return input_port_read_indexed(machine, 4); // DIPs + VBLANK
default: return 0;
}
}
diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c
index 6a99ca7ad7f..5a8a04e0d18 100644
--- a/src/mame/video/psikyo.c
+++ b/src/mame/video/psikyo.c
@@ -434,7 +434,7 @@ VIDEO_UPDATE( psikyo )
tilemap *tmptilemap0, *tmptilemap1;
- flip_screen_set(~readinputport(2) & 1); // hardwired to a DSW bit
+ flip_screen_set(~input_port_read_indexed(screen->machine, 2) & 1); // hardwired to a DSW bit
/* Layers enable (not quite right) */
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c
index 6db40bce84c..457a4a84ccf 100644
--- a/src/mame/video/snes.c
+++ b/src/mame/video/snes.c
@@ -1443,7 +1443,7 @@ static void snes_update_objects(UINT8 screen, UINT16 curline )
* Stop drawing if exceeded 32 objects and
* enforcing that limit is enabled */
range_over++;
- if( range_over == 32 ) //&& (readinputport( 16 ) & 0x10) )
+ if( range_over == 32 ) //&& (input_port_read_indexed(machine, 16 ) & 0x10) )
{
/* Set the flag in STAT77 register */
snes_ram[STAT77] |= 0x40;
@@ -1984,7 +1984,7 @@ static UINT8 snes_dbg_video(bitmap_t *bitmap, UINT16 curline )
if( !debug_options.input_count-- )
{
- UINT8 toggles = readinputport( 10 );
+ UINT8 toggles = input_port_read_indexed(machine, 10 );
if( toggles & 0x1 )
debug_options.bg_disabled[0] = !debug_options.bg_disabled[0];
if( toggles & 0x2 )
@@ -2001,7 +2001,7 @@ static UINT8 snes_dbg_video(bitmap_t *bitmap, UINT16 curline )
debug_options.bg_disabled[5] = !debug_options.bg_disabled[5];
if( toggles & 0x80 )
debug_options.windows_disabled = !debug_options.windows_disabled;
- toggles = readinputport( 11 );
+ toggles = input_port_read_indexed(machine, 11 );
if( toggles & 0x4 )
debug_options.transparency_disabled = !debug_options.transparency_disabled;
debug_options.input_count = 5;
@@ -2111,9 +2111,9 @@ static UINT8 snes_dbg_video(bitmap_t *bitmap, UINT16 curline )
}
/* Just for testing, draw as many tiles as possible */
{
- UINT8 adjust = readinputport( 1 );
- UINT8 dip = readinputport( 9 );
- UINT8 inp = readinputport( 11 );
+ UINT8 adjust = input_port_read_indexed(machine, 1 );
+ UINT8 dip = input_port_read_indexed(machine, 9 );
+ UINT8 inp = input_port_read_indexed(machine, 11 );
UINT8 dt = 1 << ((dip & 0x3) - 1);
UINT8 dm = 1 << (((dip & 0xc) >> 2) - 1);
if( dt )
diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c
index 5c800874cea..cad78782eaa 100644
--- a/src/mame/video/st0016.c
+++ b/src/mame/video/st0016.c
@@ -670,7 +670,7 @@ VIDEO_UPDATE( st0016 )
{
if(ISMACS1)
{
- if(!(readinputportbytag("SYS1")&1)) //fake coins - MACS2 system
+ if(!(input_port_read(screen->machine, "SYS1")&1)) //fake coins - MACS2 system
{
macs_ram2[0]++;
}
diff --git a/src/mame/video/superqix.c b/src/mame/video/superqix.c
index f291539d668..6bcef565a72 100644
--- a/src/mame/video/superqix.c
+++ b/src/mame/video/superqix.c
@@ -241,14 +241,14 @@ VIDEO_UPDATE( pbillian )
{
int curr_power;
- curr_power = ((readinputport(4)&0x3f)*100)/0x3f;
+ curr_power = ((input_port_read_indexed(screen->machine, 4)&0x3f)*100)/0x3f;
if (last_power[0] != curr_power)
{
popmessage ("Power %d%%", curr_power);
last_power[0] = curr_power;
}
- curr_power = ((readinputport(6)&0x3f)*100)/0x3f;
+ curr_power = ((input_port_read_indexed(screen->machine, 6)&0x3f)*100)/0x3f;
if (last_power[1] != curr_power)
{
popmessage ("Power %d%%", curr_power);
diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c
index a639a1ba7cf..fa1dad7fff7 100644
--- a/src/mame/video/travrusa.c
+++ b/src/mame/video/travrusa.c
@@ -274,7 +274,7 @@ WRITE8_HANDLER( travrusa_scroll_x_high_w )
WRITE8_HANDLER( travrusa_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- data ^= ~readinputport(4) & 1;
+ data ^= ~input_port_read_indexed(machine, 4) & 1;
flip_screen_set(data & 1);
diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c
index d935a03d842..fa1b9d25ba8 100644
--- a/src/mame/video/turbo.c
+++ b/src/mame/video/turbo.c
@@ -274,7 +274,7 @@ INLINE UINT32 sprite_xscale(UINT8 dacinput, double vr1, double vr2, double cext)
*
*************************************/
-static void turbo_prepare_sprites(turbo_state *state, UINT8 y, sprite_info *info)
+static void turbo_prepare_sprites(running_machine *machine, turbo_state *state, UINT8 y, sprite_info *info)
{
const UINT8 *pr1119 = memory_region(REGION_PROMS) + 0x200;
int sprnum;
@@ -334,7 +334,7 @@ static void turbo_prepare_sprites(turbo_state *state, UINT8 y, sprite_info *info
VR1 = 310 Ohm
VR2 = 910 Ohm
*/
- info->step[level] = sprite_xscale(xscale, 1.0e3 * readinputportbytag("VR1") / 100.0, 1.0e3 * readinputportbytag("VR2") / 100.0, 100e-12);
+ info->step[level] = sprite_xscale(xscale, 1.0e3 * input_port_read(machine, "VR1") / 100.0, 1.0e3 * input_port_read(machine, "VR2") / 100.0, 100e-12);
}
}
}
@@ -428,7 +428,7 @@ VIDEO_UPDATE( turbo )
/* compute the sprite information; we use y-1 since this info was computed during HBLANK */
/* on the previous scanline */
- turbo_prepare_sprites(state, y, &sprinfo);
+ turbo_prepare_sprites(screen->machine, state, y, &sprinfo);
/* loop over columns */
for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
diff --git a/src/mame/video/vicdual.c b/src/mame/video/vicdual.c
index 33b85a25bc8..48e93533818 100644
--- a/src/mame/video/vicdual.c
+++ b/src/mame/video/vicdual.c
@@ -141,7 +141,7 @@ VIDEO_UPDATE( vicdual_color )
VIDEO_UPDATE( vicdual_bw_or_color )
{
- if (vicdual_is_cabinet_color())
+ if (vicdual_is_cabinet_color(screen->machine))
VIDEO_UPDATE_CALL(vicdual_color);
else
VIDEO_UPDATE_CALL(vicdual_bw);
diff --git a/src/mame/video/warpwarp.c b/src/mame/video/warpwarp.c
index 276cfbf9e15..81b2a769fdd 100644
--- a/src/mame/video/warpwarp.c
+++ b/src/mame/video/warpwarp.c
@@ -242,7 +242,7 @@ VIDEO_UPDATE( geebee )
{
/* use an overlay only in upright mode */
if (geebee_handleoverlay)
- output_set_value("overlay", (readinputport(2) & 0x01) == 0);
+ output_set_value("overlay", (input_port_read_indexed(screen->machine, 2) & 0x01) == 0);
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);