summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/crsshair.c10
-rw-r--r--src/emu/devcb.c18
-rw-r--r--src/emu/devcb.h2
-rw-r--r--src/emu/device.c2
-rw-r--r--src/emu/device.h38
-rw-r--r--src/emu/emu.h29
-rw-r--r--src/emu/info.c100
-rw-r--r--src/emu/ioport.c6807
-rw-r--r--src/emu/ioport.h1930
-rw-r--r--src/emu/machine.c3
-rw-r--r--src/emu/machine/generic.c2
-rw-r--r--src/emu/machine/jvsdev.c2
-rw-r--r--src/emu/machine/microtch.c6
-rw-r--r--src/emu/memory.c22
-rw-r--r--src/emu/rendlay.c10
-rw-r--r--src/emu/screen.c11
-rw-r--r--src/emu/screen.h1
-rw-r--r--src/emu/sound/disc_cls.h2
-rw-r--r--src/emu/sound/disc_inp.c2
-rw-r--r--src/emu/ui.c56
-rw-r--r--src/emu/uiinput.c11
-rw-r--r--src/emu/uimain.c165
-rw-r--r--src/emu/uimain.h4
-rw-r--r--src/emu/uimenu.c2
-rw-r--r--src/emu/validity.c117
-rw-r--r--src/emu/validity.h6
-rw-r--r--src/emu/video/pc_cga.c8
-rw-r--r--src/ldplayer/ldplayer.c4
-rw-r--r--src/mame/audio/8080bw.c4
-rw-r--r--src/mame/audio/atarijsa.c16
-rw-r--r--src/mame/audio/cchasm.c8
-rw-r--r--src/mame/audio/cyberbal.c4
-rw-r--r--src/mame/audio/harddriv.c2
-rw-r--r--src/mame/audio/mario.c4
-rw-r--r--src/mame/audio/micro3d.c2
-rw-r--r--src/mame/audio/midway.c2
-rw-r--r--src/mame/audio/mw8080bw.c4
-rw-r--r--src/mame/audio/suna8.c2
-rw-r--r--src/mame/drivers/2mindril.c6
-rw-r--r--src/mame/drivers/30test.c8
-rw-r--r--src/mame/drivers/39in1.c2
-rw-r--r--src/mame/drivers/3do.c2
-rw-r--r--src/mame/drivers/40love.c2
-rw-r--r--src/mame/drivers/5clown.c8
-rw-r--r--src/mame/drivers/8080bw.c4
-rw-r--r--src/mame/drivers/ace.c2
-rw-r--r--src/mame/drivers/acefruit.c22
-rw-r--r--src/mame/drivers/acommand.c4
-rw-r--r--src/mame/drivers/actfancr.c12
-rw-r--r--src/mame/drivers/adp.c34
-rw-r--r--src/mame/drivers/aeroboto.c2
-rw-r--r--src/mame/drivers/airbustr.c36
-rw-r--r--src/mame/drivers/albazg.c62
-rw-r--r--src/mame/drivers/aleck64.c6
-rw-r--r--src/mame/drivers/alg.c10
-rw-r--r--src/mame/drivers/alpha68k.c88
-rw-r--r--src/mame/drivers/ampoker2.c24
-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/arcadecl.c4
-rw-r--r--src/mame/drivers/aristmk4.c28
-rw-r--r--src/mame/drivers/aristmk5.c4
-rw-r--r--src/mame/drivers/arkanoid.c2
-rw-r--r--src/mame/drivers/armedf.c16
-rw-r--r--src/mame/drivers/artmagic.c2
-rw-r--r--src/mame/drivers/asterix.c2
-rw-r--r--src/mame/drivers/asteroid.c16
-rw-r--r--src/mame/drivers/astinvad.c6
-rw-r--r--src/mame/drivers/astrocde.c6
-rw-r--r--src/mame/drivers/astrocorp.c2
-rw-r--r--src/mame/drivers/astrof.c28
-rw-r--r--src/mame/drivers/asuka.c34
-rw-r--r--src/mame/drivers/atarifb.c6
-rw-r--r--src/mame/drivers/atarig1.c12
-rw-r--r--src/mame/drivers/atarig42.c8
-rw-r--r--src/mame/drivers/atarigt.c12
-rw-r--r--src/mame/drivers/atarigx2.c14
-rw-r--r--src/mame/drivers/atarisy1.c32
-rw-r--r--src/mame/drivers/atarisy2.c30
-rw-r--r--src/mame/drivers/atarisy4.c10
-rw-r--r--src/mame/drivers/ataxx.c8
-rw-r--r--src/mame/drivers/atetris.c2
-rw-r--r--src/mame/drivers/attckufo.c4
-rw-r--r--src/mame/drivers/avalnche.c2
-rw-r--r--src/mame/drivers/aztarac.c4
-rw-r--r--src/mame/drivers/backfire.c16
-rw-r--r--src/mame/drivers/badlands.c14
-rw-r--r--src/mame/drivers/bagman.c8
-rw-r--r--src/mame/drivers/balsente.c2
-rw-r--r--src/mame/drivers/baraduke.c14
-rw-r--r--src/mame/drivers/batman.c4
-rw-r--r--src/mame/drivers/battlane.c2
-rw-r--r--src/mame/drivers/battlera.c10
-rw-r--r--src/mame/drivers/bbusters.c6
-rw-r--r--src/mame/drivers/beaminv.c2
-rw-r--r--src/mame/drivers/beathead.c2
-rw-r--r--src/mame/drivers/berzerk.c10
-rw-r--r--src/mame/drivers/bfcobra.c4
-rw-r--r--src/mame/drivers/bfm_sc1.c6
-rw-r--r--src/mame/drivers/bfm_sc2.c16
-rw-r--r--src/mame/drivers/bfm_sc4h.c4
-rw-r--r--src/mame/drivers/big10.c6
-rw-r--r--src/mame/drivers/bigevglf.c6
-rw-r--r--src/mame/drivers/bionicc.c6
-rw-r--r--src/mame/drivers/bladestl.c2
-rw-r--r--src/mame/drivers/blitz.c8
-rw-r--r--src/mame/drivers/blitz68k.c22
-rw-r--r--src/mame/drivers/blktiger.c2
-rw-r--r--src/mame/drivers/blmbycar.c4
-rw-r--r--src/mame/drivers/blockade.c16
-rw-r--r--src/mame/drivers/bloodbro.c6
-rw-r--r--src/mame/drivers/blstroid.c6
-rw-r--r--src/mame/drivers/bmcbowl.c8
-rw-r--r--src/mame/drivers/bnstars.c12
-rw-r--r--src/mame/drivers/bogeyman.c2
-rw-r--r--src/mame/drivers/boogwing.c2
-rw-r--r--src/mame/drivers/boxer.c20
-rw-r--r--src/mame/drivers/brkthru.c2
-rw-r--r--src/mame/drivers/bsktball.c2
-rw-r--r--src/mame/drivers/btime.c20
-rw-r--r--src/mame/drivers/bwidow.c6
-rw-r--r--src/mame/drivers/bwing.c18
-rw-r--r--src/mame/drivers/bzone.c6
-rw-r--r--src/mame/drivers/cabal.c16
-rw-r--r--src/mame/drivers/calchase.c12
-rw-r--r--src/mame/drivers/calomega.c24
-rw-r--r--src/mame/drivers/canyon.c8
-rw-r--r--src/mame/drivers/capbowl.c10
-rw-r--r--src/mame/drivers/cave.c50
-rw-r--r--src/mame/drivers/cb2001.c32
-rw-r--r--src/mame/drivers/cbasebal.c2
-rw-r--r--src/mame/drivers/cbuster.c8
-rw-r--r--src/mame/drivers/ccastles.c4
-rw-r--r--src/mame/drivers/cchance.c2
-rw-r--r--src/mame/drivers/cd32.c2
-rw-r--r--src/mame/drivers/cdi.c20
-rw-r--r--src/mame/drivers/centiped.c22
-rw-r--r--src/mame/drivers/cesclass.c2
-rw-r--r--src/mame/drivers/cham24.c8
-rw-r--r--src/mame/drivers/champbwl.c4
-rw-r--r--src/mame/drivers/chanbara.c2
-rw-r--r--src/mame/drivers/chance32.c2
-rw-r--r--src/mame/drivers/changela.c12
-rw-r--r--src/mame/drivers/chinagat.c4
-rw-r--r--src/mame/drivers/chinsan.c24
-rw-r--r--src/mame/drivers/chqflag.c4
-rw-r--r--src/mame/drivers/cinemat.c18
-rw-r--r--src/mame/drivers/circus.c10
-rw-r--r--src/mame/drivers/cischeat.c42
-rw-r--r--src/mame/drivers/citycon.c2
-rw-r--r--src/mame/drivers/clayshoo.c14
-rw-r--r--src/mame/drivers/cliffhgr.c6
-rw-r--r--src/mame/drivers/cloak.c2
-rw-r--r--src/mame/drivers/cloud9.c2
-rw-r--r--src/mame/drivers/clshroad.c8
-rw-r--r--src/mame/drivers/cmmb.c6
-rw-r--r--src/mame/drivers/cninja.c14
-rw-r--r--src/mame/drivers/cntsteer.c6
-rw-r--r--src/mame/drivers/combatsc.c6
-rw-r--r--src/mame/drivers/compgolf.c2
-rw-r--r--src/mame/drivers/coolpool.c14
-rw-r--r--src/mame/drivers/cop01.c2
-rw-r--r--src/mame/drivers/copsnrob.c6
-rw-r--r--src/mame/drivers/corona.c12
-rw-r--r--src/mame/drivers/cosmic.c16
-rw-r--r--src/mame/drivers/cps1.c80
-rw-r--r--src/mame/drivers/cps2.c8
-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.c8
-rw-r--r--src/mame/drivers/crystal.c10
-rw-r--r--src/mame/drivers/cshooter.c2
-rw-r--r--src/mame/drivers/csplayh5.c10
-rw-r--r--src/mame/drivers/cubeqst.c4
-rw-r--r--src/mame/drivers/cvs.c17
-rw-r--r--src/mame/drivers/cyberbal.c8
-rw-r--r--src/mame/drivers/cybertnk.c16
-rw-r--r--src/mame/drivers/dai3wksi.c2
-rw-r--r--src/mame/drivers/dambustr.c16
-rw-r--r--src/mame/drivers/darius.c10
-rw-r--r--src/mame/drivers/darkhors.c4
-rw-r--r--src/mame/drivers/darkseal.c8
-rw-r--r--src/mame/drivers/dassault.c20
-rw-r--r--src/mame/drivers/dblewing.c16
-rw-r--r--src/mame/drivers/dcheese.c2
-rw-r--r--src/mame/drivers/dday.c16
-rw-r--r--src/mame/drivers/ddealer.c2
-rw-r--r--src/mame/drivers/ddenlovr.c206
-rw-r--r--src/mame/drivers/ddragon.c18
-rw-r--r--src/mame/drivers/ddragon3.c10
-rw-r--r--src/mame/drivers/deadang.c4
-rw-r--r--src/mame/drivers/dec0.c14
-rw-r--r--src/mame/drivers/dec8.c56
-rw-r--r--src/mame/drivers/deco156.c6
-rw-r--r--src/mame/drivers/deco32.c50
-rw-r--r--src/mame/drivers/deco_ld.c4
-rw-r--r--src/mame/drivers/deco_mlc.c2
-rw-r--r--src/mame/drivers/decocass.c6
-rw-r--r--src/mame/drivers/deshoros.c6
-rw-r--r--src/mame/drivers/destroyr.c8
-rw-r--r--src/mame/drivers/dgpix.c4
-rw-r--r--src/mame/drivers/dietgo.c2
-rw-r--r--src/mame/drivers/discoboy.c2
-rw-r--r--src/mame/drivers/djboy.c14
-rw-r--r--src/mame/drivers/djmain.c48
-rw-r--r--src/mame/drivers/dkong.c30
-rw-r--r--src/mame/drivers/dlair.c34
-rw-r--r--src/mame/drivers/dmndrby.c32
-rw-r--r--src/mame/drivers/dogfgt.c2
-rw-r--r--src/mame/drivers/dooyong.c82
-rw-r--r--src/mame/drivers/dragrace.c10
-rw-r--r--src/mame/drivers/dribling.c6
-rw-r--r--src/mame/drivers/drw80pkr.c2
-rw-r--r--src/mame/drivers/dunhuang.c22
-rw-r--r--src/mame/drivers/dwarfd.c2
-rw-r--r--src/mame/drivers/dynax.c98
-rw-r--r--src/mame/drivers/dynduke.c6
-rw-r--r--src/mame/drivers/embargo.c10
-rw-r--r--src/mame/drivers/enigma2.c10
-rw-r--r--src/mame/drivers/eolith.c12
-rw-r--r--src/mame/drivers/eolith16.c4
-rw-r--r--src/mame/drivers/eprom.c10
-rw-r--r--src/mame/drivers/equites.c4
-rw-r--r--src/mame/drivers/ertictac.c42
-rw-r--r--src/mame/drivers/esd16.c26
-rw-r--r--src/mame/drivers/esripsys.c16
-rw-r--r--src/mame/drivers/ettrivia.c2
-rw-r--r--src/mame/drivers/exerion.c4
-rw-r--r--src/mame/drivers/exidy.c46
-rw-r--r--src/mame/drivers/exidy440.c6
-rw-r--r--src/mame/drivers/exprraid.c38
-rw-r--r--src/mame/drivers/exterm.c4
-rw-r--r--src/mame/drivers/f-32.c4
-rw-r--r--src/mame/drivers/f1gp.c14
-rw-r--r--src/mame/drivers/famibox.c8
-rw-r--r--src/mame/drivers/fantland.c112
-rw-r--r--src/mame/drivers/fcombat.c4
-rw-r--r--src/mame/drivers/feversoc.c2
-rw-r--r--src/mame/drivers/fgoal.c4
-rw-r--r--src/mame/drivers/finalizr.c2
-rw-r--r--src/mame/drivers/firebeat.c16
-rw-r--r--src/mame/drivers/firefox.c6
-rw-r--r--src/mame/drivers/firetrap.c6
-rw-r--r--src/mame/drivers/firetrk.c20
-rw-r--r--src/mame/drivers/flkatck.c6
-rw-r--r--src/mame/drivers/flyball.c10
-rw-r--r--src/mame/drivers/foodf.c4
-rw-r--r--src/mame/drivers/forte2.c2
-rw-r--r--src/mame/drivers/freekick.c2
-rw-r--r--src/mame/drivers/fromanc2.c18
-rw-r--r--src/mame/drivers/fromance.c10
-rw-r--r--src/mame/drivers/funkball.c16
-rw-r--r--src/mame/drivers/funkybee.c2
-rw-r--r--src/mame/drivers/funkyjet.c2
-rw-r--r--src/mame/drivers/fuukifg3.c8
-rw-r--r--src/mame/drivers/gaelco2.c8
-rw-r--r--src/mame/drivers/gaelco3d.c8
-rw-r--r--src/mame/drivers/galaga.c134
-rw-r--r--src/mame/drivers/galastrm.c4
-rw-r--r--src/mame/drivers/galaxia.c2
-rw-r--r--src/mame/drivers/galaxian.c20
-rw-r--r--src/mame/drivers/galaxold.c28
-rw-r--r--src/mame/drivers/galdrvr.c78
-rw-r--r--src/mame/drivers/galivan.c2
-rw-r--r--src/mame/drivers/galpani3.c2
-rw-r--r--src/mame/drivers/gameplan.c2
-rw-r--r--src/mame/drivers/gauntlet.c8
-rw-r--r--src/mame/drivers/gcpinbal.c6
-rw-r--r--src/mame/drivers/gei.c16
-rw-r--r--src/mame/drivers/gijoe.c2
-rw-r--r--src/mame/drivers/gladiatr.c14
-rw-r--r--src/mame/drivers/go2000.c16
-rw-r--r--src/mame/drivers/goal92.c10
-rw-r--r--src/mame/drivers/goldnpkr.c16
-rw-r--r--src/mame/drivers/goldstar.c444
-rw-r--r--src/mame/drivers/gomoku.c2
-rw-r--r--src/mame/drivers/goodejan.c10
-rw-r--r--src/mame/drivers/gottlieb.c28
-rw-r--r--src/mame/drivers/gpworld.c4
-rw-r--r--src/mame/drivers/grchamp.c2
-rw-r--r--src/mame/drivers/gridlee.c4
-rw-r--r--src/mame/drivers/groundfx.c4
-rw-r--r--src/mame/drivers/gstream.c12
-rw-r--r--src/mame/drivers/gsword.c14
-rw-r--r--src/mame/drivers/gticlub.c14
-rw-r--r--src/mame/drivers/guab.c2
-rw-r--r--src/mame/drivers/gunbustr.c4
-rw-r--r--src/mame/drivers/gundealr.c6
-rw-r--r--src/mame/drivers/gunpey.c10
-rw-r--r--src/mame/drivers/halleys.c8
-rw-r--r--src/mame/drivers/hanaawas.c8
-rw-r--r--src/mame/drivers/harddriv.c14
-rw-r--r--src/mame/drivers/highvdeo.c8
-rw-r--r--src/mame/drivers/hitme.c6
-rw-r--r--src/mame/drivers/hitpoker.c2
-rw-r--r--src/mame/drivers/hnayayoi.c2
-rw-r--r--src/mame/drivers/hng64.c34
-rw-r--r--src/mame/drivers/homedata.c12
-rw-r--r--src/mame/drivers/hornet.c8
-rw-r--r--src/mame/drivers/hvyunit.c42
-rw-r--r--src/mame/drivers/icecold.c6
-rw-r--r--src/mame/drivers/igs009.c10
-rw-r--r--src/mame/drivers/igs011.c48
-rw-r--r--src/mame/drivers/igs017.c156
-rw-r--r--src/mame/drivers/igspoker.c2
-rw-r--r--src/mame/drivers/imolagp.c2
-rw-r--r--src/mame/drivers/irobot.c2
-rw-r--r--src/mame/drivers/itech32.c28
-rw-r--r--src/mame/drivers/itech8.c2
-rw-r--r--src/mame/drivers/jack.c20
-rw-r--r--src/mame/drivers/jackal.c2
-rw-r--r--src/mame/drivers/jackpool.c28
-rw-r--r--src/mame/drivers/jaguar.c8
-rw-r--r--src/mame/drivers/jalmah.c50
-rw-r--r--src/mame/drivers/jangou.c22
-rw-r--r--src/mame/drivers/jantotsu.c8
-rw-r--r--src/mame/drivers/jchan.c34
-rw-r--r--src/mame/drivers/jedi.c6
-rw-r--r--src/mame/drivers/jongkyo.c36
-rw-r--r--src/mame/drivers/jpmimpct.c34
-rw-r--r--src/mame/drivers/jpmsys5.c8
-rw-r--r--src/mame/drivers/kaneko16.c26
-rw-r--r--src/mame/drivers/karnov.c10
-rw-r--r--src/mame/drivers/kas89.c20
-rw-r--r--src/mame/drivers/kingdrby.c14
-rw-r--r--src/mame/drivers/kingobox.c2
-rw-r--r--src/mame/drivers/kinst.c6
-rw-r--r--src/mame/drivers/klax.c4
-rw-r--r--src/mame/drivers/koikoi.c4
-rw-r--r--src/mame/drivers/konamigq.c2
-rw-r--r--src/mame/drivers/konamigv.c4
-rw-r--r--src/mame/drivers/konamigx.c14
-rw-r--r--src/mame/drivers/kongambl.c4
-rw-r--r--src/mame/drivers/kopunch.c2
-rw-r--r--src/mame/drivers/ksys573.c30
-rw-r--r--src/mame/drivers/ladybug.c16
-rw-r--r--src/mame/drivers/laserbat.c8
-rw-r--r--src/mame/drivers/lastfght.c6
-rw-r--r--src/mame/drivers/lazercmd.c10
-rw-r--r--src/mame/drivers/leland.c26
-rw-r--r--src/mame/drivers/lemmings.c16
-rw-r--r--src/mame/drivers/lethal.c6
-rw-r--r--src/mame/drivers/lethalj.c2
-rw-r--r--src/mame/drivers/liberate.c20
-rw-r--r--src/mame/drivers/liberatr.c10
-rw-r--r--src/mame/drivers/limenko.c4
-rw-r--r--src/mame/drivers/lockon.c8
-rw-r--r--src/mame/drivers/looping.c2
-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/m107.c4
-rw-r--r--src/mame/drivers/m14.c4
-rw-r--r--src/mame/drivers/m63.c8
-rw-r--r--src/mame/drivers/m72.c22
-rw-r--r--src/mame/drivers/m79amb.c10
-rw-r--r--src/mame/drivers/macs.c30
-rw-r--r--src/mame/drivers/madalien.c2
-rw-r--r--src/mame/drivers/madmotor.c2
-rw-r--r--src/mame/drivers/magic10.c10
-rw-r--r--src/mame/drivers/magicfly.c10
-rw-r--r--src/mame/drivers/magtouch.c2
-rw-r--r--src/mame/drivers/majorpkr.c12
-rw-r--r--src/mame/drivers/malzak.c6
-rw-r--r--src/mame/drivers/mappy.c120
-rw-r--r--src/mame/drivers/marinedt.c2
-rw-r--r--src/mame/drivers/matmania.c2
-rw-r--r--src/mame/drivers/maxaflex.c6
-rw-r--r--src/mame/drivers/maygay1b.c6
-rw-r--r--src/mame/drivers/maygayv1.c4
-rw-r--r--src/mame/drivers/mayumi.c2
-rw-r--r--src/mame/drivers/mazerbla.c2
-rw-r--r--src/mame/drivers/mcatadv.c24
-rw-r--r--src/mame/drivers/mcr.c28
-rw-r--r--src/mame/drivers/mcr3.c30
-rw-r--r--src/mame/drivers/mcr68.c36
-rw-r--r--src/mame/drivers/mediagx.c10
-rw-r--r--src/mame/drivers/megadrvb.c10
-rw-r--r--src/mame/drivers/megasys1.c18
-rw-r--r--src/mame/drivers/megatech.c2
-rw-r--r--src/mame/drivers/meijinsn.c12
-rw-r--r--src/mame/drivers/merit.c4
-rw-r--r--src/mame/drivers/meritm.c2
-rw-r--r--src/mame/drivers/metlclsh.c2
-rw-r--r--src/mame/drivers/metro.c18
-rw-r--r--src/mame/drivers/mexico86.c2
-rw-r--r--src/mame/drivers/meyc8080.c8
-rw-r--r--src/mame/drivers/meyc8088.c10
-rw-r--r--src/mame/drivers/mgolf.c12
-rw-r--r--src/mame/drivers/midas.c4
-rw-r--r--src/mame/drivers/midvunit.c8
-rw-r--r--src/mame/drivers/midzeus.c10
-rw-r--r--src/mame/drivers/mirage.c12
-rw-r--r--src/mame/drivers/mirax.c2
-rw-r--r--src/mame/drivers/missile.c10
-rw-r--r--src/mame/drivers/mitchell.c32
-rw-r--r--src/mame/drivers/mjkjidai.c4
-rw-r--r--src/mame/drivers/mjsister.c4
-rw-r--r--src/mame/drivers/mlanding.c22
-rw-r--r--src/mame/drivers/model1.c4
-rw-r--r--src/mame/drivers/model2.c8
-rw-r--r--src/mame/drivers/model3.c38
-rw-r--r--src/mame/drivers/moo.c2
-rw-r--r--src/mame/drivers/mpoker.c2
-rw-r--r--src/mame/drivers/mpu3.c10
-rw-r--r--src/mame/drivers/mpu4.c8
-rw-r--r--src/mame/drivers/mpu4vid.c46
-rw-r--r--src/mame/drivers/mquake.c2
-rw-r--r--src/mame/drivers/ms32.c20
-rw-r--r--src/mame/drivers/msisaac.c2
-rw-r--r--src/mame/drivers/mugsmash.c8
-rw-r--r--src/mame/drivers/multigam.c6
-rw-r--r--src/mame/drivers/mw18w.c32
-rw-r--r--src/mame/drivers/mw8080bw.c262
-rw-r--r--src/mame/drivers/mwarr.c2
-rw-r--r--src/mame/drivers/mystston.c2
-rw-r--r--src/mame/drivers/mystwarr.c10
-rw-r--r--src/mame/drivers/namcofl.c14
-rw-r--r--src/mame/drivers/namcona1.c10
-rw-r--r--src/mame/drivers/namconb1.c32
-rw-r--r--src/mame/drivers/namcos1.c2
-rw-r--r--src/mame/drivers/namcos10.c2
-rw-r--r--src/mame/drivers/namcos11.c36
-rw-r--r--src/mame/drivers/namcos12.c18
-rw-r--r--src/mame/drivers/namcos21.c4
-rw-r--r--src/mame/drivers/namcos22.c58
-rw-r--r--src/mame/drivers/namcos23.c20
-rw-r--r--src/mame/drivers/namcos86.c32
-rw-r--r--src/mame/drivers/naomi.c2
-rw-r--r--src/mame/drivers/naughtyb.c12
-rw-r--r--src/mame/drivers/nbmj9195.c74
-rw-r--r--src/mame/drivers/nemesis.c20
-rw-r--r--src/mame/drivers/neodrvr.c4
-rw-r--r--src/mame/drivers/neogeo.c18
-rw-r--r--src/mame/drivers/nexus3d.c2
-rw-r--r--src/mame/drivers/nightgal.c36
-rw-r--r--src/mame/drivers/ninjakd2.c58
-rw-r--r--src/mame/drivers/nitedrvr.c2
-rw-r--r--src/mame/drivers/niyanpai.c30
-rw-r--r--src/mame/drivers/nmg5.c32
-rw-r--r--src/mame/drivers/nmk16.c12
-rw-r--r--src/mame/drivers/nova2001.c8
-rw-r--r--src/mame/drivers/nwk-tr.c18
-rw-r--r--src/mame/drivers/nycaptor.c4
-rw-r--r--src/mame/drivers/nyny.c6
-rw-r--r--src/mame/drivers/offtwall.c4
-rw-r--r--src/mame/drivers/ojankohs.c46
-rw-r--r--src/mame/drivers/omegrace.c2
-rw-r--r--src/mame/drivers/oneshot.c2
-rw-r--r--src/mame/drivers/onetwo.c6
-rw-r--r--src/mame/drivers/opwolf.c16
-rw-r--r--src/mame/drivers/orbit.c2
-rw-r--r--src/mame/drivers/othldrby.c2
-rw-r--r--src/mame/drivers/othunder.c2
-rw-r--r--src/mame/drivers/overdriv.c2
-rw-r--r--src/mame/drivers/pachifev.c4
-rw-r--r--src/mame/drivers/pacland.c4
-rw-r--r--src/mame/drivers/pacman.c12
-rw-r--r--src/mame/drivers/paradise.c12
-rw-r--r--src/mame/drivers/pastelg.c20
-rw-r--r--src/mame/drivers/pcat_nit.c2
-rw-r--r--src/mame/drivers/pcxt.c4
-rw-r--r--src/mame/drivers/pengadvb.c4
-rw-r--r--src/mame/drivers/peplus.c12
-rw-r--r--src/mame/drivers/peyper.c4
-rw-r--r--src/mame/drivers/pgm.c2
-rw-r--r--src/mame/drivers/phoenix.c30
-rw-r--r--src/mame/drivers/pingpong.c14
-rw-r--r--src/mame/drivers/pinkiri8.c20
-rw-r--r--src/mame/drivers/pipedrm.c2
-rw-r--r--src/mame/drivers/pktgaldx.c2
-rw-r--r--src/mame/drivers/playch10.c140
-rw-r--r--src/mame/drivers/playmark.c34
-rw-r--r--src/mame/drivers/plygonet.c6
-rw-r--r--src/mame/drivers/pntnpuzl.c10
-rw-r--r--src/mame/drivers/polepos.c8
-rw-r--r--src/mame/drivers/polyplay.c2
-rw-r--r--src/mame/drivers/poolshrk.c6
-rw-r--r--src/mame/drivers/popeye.c4
-rw-r--r--src/mame/drivers/popper.c16
-rw-r--r--src/mame/drivers/powerbal.c58
-rw-r--r--src/mame/drivers/prehisle.c2
-rw-r--r--src/mame/drivers/progolf.c10
-rw-r--r--src/mame/drivers/psikyo.c28
-rw-r--r--src/mame/drivers/psikyo4.c16
-rw-r--r--src/mame/drivers/psikyosh.c8
-rw-r--r--src/mame/drivers/pushman.c4
-rw-r--r--src/mame/drivers/pzletime.c2
-rw-r--r--src/mame/drivers/qdrmfgp.c2
-rw-r--r--src/mame/drivers/quantum.c6
-rw-r--r--src/mame/drivers/quasar.c12
-rw-r--r--src/mame/drivers/quizpani.c64
-rw-r--r--src/mame/drivers/raiden.c6
-rw-r--r--src/mame/drivers/rainbow.c32
-rw-r--r--src/mame/drivers/rallyx.c48
-rw-r--r--src/mame/drivers/rampart.c6
-rw-r--r--src/mame/drivers/re900.c18
-rw-r--r--src/mame/drivers/realbrk.c54
-rw-r--r--src/mame/drivers/redalert.c6
-rw-r--r--src/mame/drivers/redclash.c4
-rw-r--r--src/mame/drivers/relief.c4
-rw-r--r--src/mame/drivers/renegade.c2
-rw-r--r--src/mame/drivers/rltennis.c6
-rw-r--r--src/mame/drivers/rmhaihai.c4
-rw-r--r--src/mame/drivers/rohga.c8
-rw-r--r--src/mame/drivers/rollrace.c2
-rw-r--r--src/mame/drivers/route16.c8
-rw-r--r--src/mame/drivers/royalmah.c108
-rw-r--r--src/mame/drivers/rpunch.c2
-rw-r--r--src/mame/drivers/runaway.c10
-rw-r--r--src/mame/drivers/rungun.c18
-rw-r--r--src/mame/drivers/safarir.c2
-rw-r--r--src/mame/drivers/saturn.c276
-rw-r--r--src/mame/drivers/sbowling.c4
-rw-r--r--src/mame/drivers/sbrkout.c58
-rw-r--r--src/mame/drivers/scobra.c2
-rw-r--r--src/mame/drivers/scramble.c6
-rw-r--r--src/mame/drivers/scregg.c2
-rw-r--r--src/mame/drivers/sderby.c10
-rw-r--r--src/mame/drivers/seattle.c22
-rw-r--r--src/mame/drivers/segac2.c6
-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.c10
-rw-r--r--src/mame/drivers/segaorun.c8
-rw-r--r--src/mame/drivers/segas16a.c62
-rw-r--r--src/mame/drivers/segas16b.c80
-rw-r--r--src/mame/drivers/segas18.c42
-rw-r--r--src/mame/drivers/segas24.c66
-rw-r--r--src/mame/drivers/segas32.c14
-rw-r--r--src/mame/drivers/segaxbd.c14
-rw-r--r--src/mame/drivers/segaybd.c4
-rw-r--r--src/mame/drivers/seibuspi.c38
-rw-r--r--src/mame/drivers/seicross.c2
-rw-r--r--src/mame/drivers/sengokmj.c14
-rw-r--r--src/mame/drivers/seta.c378
-rw-r--r--src/mame/drivers/seta2.c34
-rw-r--r--src/mame/drivers/sf.c4
-rw-r--r--src/mame/drivers/sfbonus.c4
-rw-r--r--src/mame/drivers/sfkick.c10
-rw-r--r--src/mame/drivers/shadfrce.c8
-rw-r--r--src/mame/drivers/shangha3.c10
-rw-r--r--src/mame/drivers/shangkid.c2
-rw-r--r--src/mame/drivers/shisen.c14
-rw-r--r--src/mame/drivers/shootout.c2
-rw-r--r--src/mame/drivers/shuuz.c10
-rw-r--r--src/mame/drivers/sidearms.c6
-rw-r--r--src/mame/drivers/sigmab98.c8
-rw-r--r--src/mame/drivers/simpl156.c6
-rw-r--r--src/mame/drivers/skimaxx.c6
-rw-r--r--src/mame/drivers/skullxbo.c4
-rw-r--r--src/mame/drivers/skydiver.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.c6
-rw-r--r--src/mame/drivers/slotcarn.c4
-rw-r--r--src/mame/drivers/snesb.c6
-rw-r--r--src/mame/drivers/snk.c28
-rw-r--r--src/mame/drivers/snk68.c14
-rw-r--r--src/mame/drivers/snookr10.c2
-rw-r--r--src/mame/drivers/snowbros.c38
-rw-r--r--src/mame/drivers/spcforce.c4
-rw-r--r--src/mame/drivers/spdodgeb.c18
-rw-r--r--src/mame/drivers/speedatk.c4
-rw-r--r--src/mame/drivers/spiders.c6
-rw-r--r--src/mame/drivers/splash.c2
-rw-r--r--src/mame/drivers/splus.c20
-rw-r--r--src/mame/drivers/spoker.c10
-rw-r--r--src/mame/drivers/spool99.c44
-rw-r--r--src/mame/drivers/sprint2.c12
-rw-r--r--src/mame/drivers/sprint4.c30
-rw-r--r--src/mame/drivers/sprint8.c8
-rw-r--r--src/mame/drivers/srmp2.c4
-rw-r--r--src/mame/drivers/srmp5.c8
-rw-r--r--src/mame/drivers/srmp6.c10
-rw-r--r--src/mame/drivers/ssfindo.c10
-rw-r--r--src/mame/drivers/sshangha.c46
-rw-r--r--src/mame/drivers/ssingles.c2
-rw-r--r--src/mame/drivers/ssozumo.c2
-rw-r--r--src/mame/drivers/ssrj.c2
-rw-r--r--src/mame/drivers/sstrangr.c4
-rw-r--r--src/mame/drivers/ssv.c38
-rw-r--r--src/mame/drivers/st0016.c18
-rw-r--r--src/mame/drivers/stactics.c4
-rw-r--r--src/mame/drivers/stadhero.c8
-rw-r--r--src/mame/drivers/starfire.c16
-rw-r--r--src/mame/drivers/starshp1.c10
-rw-r--r--src/mame/drivers/statriv2.c2
-rw-r--r--src/mame/drivers/stlforce.c2
-rw-r--r--src/mame/drivers/stv.c16
-rw-r--r--src/mame/drivers/subs.c2
-rw-r--r--src/mame/drivers/subsino2.c12
-rw-r--r--src/mame/drivers/suna8.c10
-rw-r--r--src/mame/drivers/supbtime.c10
-rw-r--r--src/mame/drivers/superchs.c10
-rw-r--r--src/mame/drivers/superqix.c32
-rw-r--r--src/mame/drivers/suprgolf.c8
-rw-r--r--src/mame/drivers/suprnova.c2
-rw-r--r--src/mame/drivers/suprridr.c4
-rw-r--r--src/mame/drivers/system1.c6
-rw-r--r--src/mame/drivers/system16.c42
-rw-r--r--src/mame/drivers/tagteam.c10
-rw-r--r--src/mame/drivers/tail2nos.c2
-rw-r--r--src/mame/drivers/taito_b.c20
-rw-r--r--src/mame/drivers/taito_f2.c98
-rw-r--r--src/mame/drivers/taito_f3.c6
-rw-r--r--src/mame/drivers/taito_h.c16
-rw-r--r--src/mame/drivers/taito_l.c58
-rw-r--r--src/mame/drivers/taito_o.c4
-rw-r--r--src/mame/drivers/taito_x.c14
-rw-r--r--src/mame/drivers/taito_z.c50
-rw-r--r--src/mame/drivers/taitoair.c12
-rw-r--r--src/mame/drivers/taitogn.c12
-rw-r--r--src/mame/drivers/taitojc.c20
-rw-r--r--src/mame/drivers/taitosj.c6
-rw-r--r--src/mame/drivers/tank8.c2
-rw-r--r--src/mame/drivers/tankbatt.c6
-rw-r--r--src/mame/drivers/tapatune.c6
-rw-r--r--src/mame/drivers/tatsumi.c20
-rw-r--r--src/mame/drivers/taxidriv.c2
-rw-r--r--src/mame/drivers/tceptor.c8
-rw-r--r--src/mame/drivers/tecmo.c8
-rw-r--r--src/mame/drivers/tecmosys.c4
-rw-r--r--src/mame/drivers/tehkanwc.c12
-rw-r--r--src/mame/drivers/tempest.c10
-rw-r--r--src/mame/drivers/terracre.c2
-rw-r--r--src/mame/drivers/tetrisp2.c4
-rw-r--r--src/mame/drivers/thayers.c6
-rw-r--r--src/mame/drivers/thedeep.c6
-rw-r--r--src/mame/drivers/thepit.c16
-rw-r--r--src/mame/drivers/thief.c10
-rw-r--r--src/mame/drivers/thunderj.c4
-rw-r--r--src/mame/drivers/tiamc1.c2
-rw-r--r--src/mame/drivers/tickee.c4
-rw-r--r--src/mame/drivers/timetrv.c4
-rw-r--r--src/mame/drivers/tmaster.c6
-rw-r--r--src/mame/drivers/tmmjprd.c12
-rw-r--r--src/mame/drivers/tmnt.c22
-rw-r--r--src/mame/drivers/tmspoker.c2
-rw-r--r--src/mame/drivers/tnzs.c4
-rw-r--r--src/mame/drivers/toaplan1.c6
-rw-r--r--src/mame/drivers/toaplan2.c152
-rw-r--r--src/mame/drivers/tomcat.c6
-rw-r--r--src/mame/drivers/toobin.c4
-rw-r--r--src/mame/drivers/topspeed.c4
-rw-r--r--src/mame/drivers/toratora.c10
-rw-r--r--src/mame/drivers/tourtabl.c2
-rw-r--r--src/mame/drivers/toypop.c28
-rw-r--r--src/mame/drivers/trackfld.c8
-rw-r--r--src/mame/drivers/triplhnt.c12
-rw-r--r--src/mame/drivers/truco.c2
-rw-r--r--src/mame/drivers/tryout.c2
-rw-r--r--src/mame/drivers/tugboat.c10
-rw-r--r--src/mame/drivers/tumbleb.c36
-rw-r--r--src/mame/drivers/tumblep.c8
-rw-r--r--src/mame/drivers/tunhunt.c14
-rw-r--r--src/mame/drivers/turbo.c14
-rw-r--r--src/mame/drivers/twin16.c14
-rw-r--r--src/mame/drivers/twincobr.c6
-rw-r--r--src/mame/drivers/twinkle.c12
-rw-r--r--src/mame/drivers/tx1.c16
-rw-r--r--src/mame/drivers/uapce.c6
-rw-r--r--src/mame/drivers/ultratnk.c16
-rw-r--r--src/mame/drivers/ultrsprt.c6
-rw-r--r--src/mame/drivers/undrfire.c14
-rw-r--r--src/mame/drivers/unico.c8
-rw-r--r--src/mame/drivers/unkhorse.c6
-rw-r--r--src/mame/drivers/upscope.c2
-rw-r--r--src/mame/drivers/usgames.c2
-rw-r--r--src/mame/drivers/vamphalf.c2
-rw-r--r--src/mame/drivers/vaportra.c8
-rw-r--r--src/mame/drivers/vball.c2
-rw-r--r--src/mame/drivers/vcombat.c6
-rw-r--r--src/mame/drivers/vegaeo.c2
-rw-r--r--src/mame/drivers/vegas.c2
-rw-r--r--src/mame/drivers/vendetta.c6
-rw-r--r--src/mame/drivers/vicdual.c42
-rw-r--r--src/mame/drivers/videopin.c6
-rw-r--r--src/mame/drivers/videopkr.c8
-rw-r--r--src/mame/drivers/vindictr.c4
-rw-r--r--src/mame/drivers/viper.c4
-rw-r--r--src/mame/drivers/vmetal.c18
-rw-r--r--src/mame/drivers/voyager.c2
-rw-r--r--src/mame/drivers/vpoker.c2
-rw-r--r--src/mame/drivers/wardner.c2
-rw-r--r--src/mame/drivers/warpsped.c2
-rw-r--r--src/mame/drivers/warpwarp.c74
-rw-r--r--src/mame/drivers/wecleman.c12
-rw-r--r--src/mame/drivers/wgp.c6
-rw-r--r--src/mame/drivers/williams.c8
-rw-r--r--src/mame/drivers/wink.c4
-rw-r--r--src/mame/drivers/wiping.c2
-rw-r--r--src/mame/drivers/witch.c14
-rw-r--r--src/mame/drivers/wolfpack.c2
-rw-r--r--src/mame/drivers/wwfwfest.c6
-rw-r--r--src/mame/drivers/xexex.c4
-rw-r--r--src/mame/drivers/xmen.c2
-rw-r--r--src/mame/drivers/xtheball.c4
-rw-r--r--src/mame/drivers/xxmissio.c2
-rw-r--r--src/mame/drivers/xybots.c4
-rw-r--r--src/mame/drivers/xyonix.c16
-rw-r--r--src/mame/drivers/yunsung8.c4
-rw-r--r--src/mame/drivers/zac2650.c4
-rw-r--r--src/mame/drivers/zaccaria.c4
-rw-r--r--src/mame/drivers/zaxxon.c2
-rw-r--r--src/mame/drivers/zn.c10
-rw-r--r--src/mame/drivers/zr107.c14
-rw-r--r--src/mame/includes/galpnipt.h32
-rw-r--r--src/mame/includes/iremipt.h28
-rw-r--r--src/mame/includes/lordgun.h2
-rw-r--r--src/mame/includes/toaplipt.h56
-rw-r--r--src/mame/machine/acitya.c2
-rw-r--r--src/mame/machine/ajax.c8
-rw-r--r--src/mame/machine/amiga.c12
-rw-r--r--src/mame/machine/arkanoid.c4
-rw-r--r--src/mame/machine/asteroid.c14
-rw-r--r--src/mame/machine/atari.c16
-rw-r--r--src/mame/machine/atarifb.c30
-rw-r--r--src/mame/machine/balsente.c16
-rw-r--r--src/mame/machine/beezer.c8
-rw-r--r--src/mame/machine/bonzeadv.c8
-rw-r--r--src/mame/machine/bsktball.c10
-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/cdislave.c6
-rw-r--r--src/mame/machine/dc-ctrl.c32
-rw-r--r--src/mame/machine/dec0.c20
-rw-r--r--src/mame/machine/decocass.c10
-rw-r--r--src/mame/machine/decoprot.c78
-rw-r--r--src/mame/machine/gaelco2.c4
-rw-r--r--src/mame/machine/galaxold.c4
-rw-r--r--src/mame/machine/gaplus.c2
-rw-r--r--src/mame/machine/harddriv.c14
-rw-r--r--src/mame/machine/irobot.c4
-rw-r--r--src/mame/machine/jvs13551.c8
-rw-r--r--src/mame/machine/kaneko16.c10
-rw-r--r--src/mame/machine/leland.c66
-rw-r--r--src/mame/machine/lsasquad.c4
-rw-r--r--src/mame/machine/mcr68.c4
-rw-r--r--src/mame/machine/megadriv.c34
-rw-r--r--src/mame/machine/mexico86.c8
-rw-r--r--src/mame/machine/mhavoc.c2
-rw-r--r--src/mame/machine/micro3d.c12
-rw-r--r--src/mame/machine/midtunit.c2
-rw-r--r--src/mame/machine/midwayic.c8
-rw-r--r--src/mame/machine/midwunit.c4
-rw-r--r--src/mame/machine/midxunit.c6
-rw-r--r--src/mame/machine/midyunit.c12
-rw-r--r--src/mame/machine/mie.c4
-rw-r--r--src/mame/machine/n64.c6
-rw-r--r--src/mame/machine/namcos1.c30
-rw-r--r--src/mame/machine/namcos2.c38
-rw-r--r--src/mame/machine/nb1413m3.c120
-rw-r--r--src/mame/machine/nitedrvr.c12
-rw-r--r--src/mame/machine/opwolf.c4
-rw-r--r--src/mame/machine/pcecommn.c2
-rw-r--r--src/mame/machine/pckeybrd.c20
-rw-r--r--src/mame/machine/pgmprot.c6
-rw-r--r--src/mame/machine/pgmprot1.c6
-rw-r--r--src/mame/machine/pgmprot2.c18
-rw-r--r--src/mame/machine/pgmprot4.c4
-rw-r--r--src/mame/machine/pgmprot6.c2
-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.c2
-rw-r--r--src/mame/machine/segamsys.c8
-rw-r--r--src/mame/machine/seicop.c32
-rw-r--r--src/mame/machine/simpsons.c2
-rw-r--r--src/mame/machine/slikshot.c4
-rw-r--r--src/mame/machine/smpc.c54
-rw-r--r--src/mame/machine/snes.c12
-rw-r--r--src/mame/machine/starwars.c4
-rw-r--r--src/mame/machine/stfight.c4
-rw-r--r--src/mame/machine/subs.c12
-rw-r--r--src/mame/machine/tait8741.c22
-rw-r--r--src/mame/machine/taitosj.c4
-rw-r--r--src/mame/machine/tatsumi.c8
-rw-r--r--src/mame/machine/tnzs.c32
-rw-r--r--src/mame/machine/toaplan1.c8
-rw-r--r--src/mame/machine/vectrex.c8
-rw-r--r--src/mame/machine/vertigo.c6
-rw-r--r--src/mame/machine/volfied.c8
-rw-r--r--src/mame/machine/vsnes.c42
-rw-r--r--src/mame/machine/williams.c10
-rw-r--r--src/mame/machine/xevious.c8
-rw-r--r--src/mame/video/aeroboto.c2
-rw-r--r--src/mame/video/amiga.c2
-rw-r--r--src/mame/video/argus.c2
-rw-r--r--src/mame/video/artmagic.c2
-rw-r--r--src/mame/video/astrocde.c24
-rw-r--r--src/mame/video/atari.c4
-rw-r--r--src/mame/video/atarisy1.c2
-rw-r--r--src/mame/video/balsente.c6
-rw-r--r--src/mame/video/bking.c4
-rw-r--r--src/mame/video/blockade.c2
-rw-r--r--src/mame/video/btime.c6
-rw-r--r--src/mame/video/bwing.c2
-rw-r--r--src/mame/video/canyon.c2
-rw-r--r--src/mame/video/cave.c4
-rw-r--r--src/mame/video/centiped.c2
-rw-r--r--src/mame/video/changela.c10
-rw-r--r--src/mame/video/cinemat.c2
-rw-r--r--src/mame/video/cischeat.c42
-rw-r--r--src/mame/video/cosmic.c2
-rw-r--r--src/mame/video/cps1.c4
-rw-r--r--src/mame/video/dc.c2
-rw-r--r--src/mame/video/dcheese.c6
-rw-r--r--src/mame/video/deco_mlc.c2
-rw-r--r--src/mame/video/decocass.c2
-rw-r--r--src/mame/video/dkong.c12
-rw-r--r--src/mame/video/dooyong.c30
-rw-r--r--src/mame/video/dynax.c4
-rw-r--r--src/mame/video/esripsys.c2
-rw-r--r--src/mame/video/exerion.c2
-rw-r--r--src/mame/video/exidy.c2
-rw-r--r--src/mame/video/exidy440.c4
-rw-r--r--src/mame/video/f1gp.c4
-rw-r--r--src/mame/video/fgoal.c2
-rw-r--r--src/mame/video/gomoku.c4
-rw-r--r--src/mame/video/hyprduel.c2
-rw-r--r--src/mame/video/itech32.c2
-rw-r--r--src/mame/video/itech8.c4
-rw-r--r--src/mame/video/jaguar.c6
-rw-r--r--src/mame/video/kangaroo.c2
-rw-r--r--src/mame/video/lazercmd.c4
-rw-r--r--src/mame/video/lethalj.c6
-rw-r--r--src/mame/video/lordgun.c12
-rw-r--r--src/mame/video/lwings.c2
-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.c4
-rw-r--r--src/mame/video/madalien.c2
-rw-r--r--src/mame/video/mario.c2
-rw-r--r--src/mame/video/mcatadv.c2
-rw-r--r--src/mame/video/mcd212.c2
-rw-r--r--src/mame/video/metro.c2
-rw-r--r--src/mame/video/model2.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/namcos22.c4
-rw-r--r--src/mame/video/naughtyb.c4
-rw-r--r--src/mame/video/neogeo.c2
-rw-r--r--src/mame/video/nmk16.c4
-rw-r--r--src/mame/video/oneshot.c8
-rw-r--r--src/mame/video/opwolf.c4
-rw-r--r--src/mame/video/orbit.c2
-rw-r--r--src/mame/video/pgm.c2
-rw-r--r--src/mame/video/phoenix.c10
-rw-r--r--src/mame/video/policetr.c10
-rw-r--r--src/mame/video/prehisle.c10
-rw-r--r--src/mame/video/psikyo.c4
-rw-r--r--src/mame/video/psychic5.c10
-rw-r--r--src/mame/video/route16.c2
-rw-r--r--src/mame/video/shisen.c2
-rw-r--r--src/mame/video/snes.c10
-rw-r--r--src/mame/video/system1.c2
-rw-r--r--src/mame/video/thepit.c4
-rw-r--r--src/mame/video/tmnt.c2
-rw-r--r--src/mame/video/travrusa.c2
-rw-r--r--src/mame/video/turbo.c4
-rw-r--r--src/mame/video/tx1.c22
-rw-r--r--src/mame/video/undrfire.c4
-rw-r--r--src/mame/video/vectrex.c6
-rw-r--r--src/mame/video/vertigo.c2
-rw-r--r--src/mame/video/wecleman.c2
-rw-r--r--src/mame/video/zac2650.c2
-rw-r--r--src/osd/sdl/input.c58
-rw-r--r--src/osd/windows/debugwin.c2
-rw-r--r--src/osd/windows/input.c23
880 files changed, 10846 insertions, 10966 deletions
diff --git a/src/emu/crsshair.c b/src/emu/crsshair.c
index 693d620cf19..cd4a86d427b 100644
--- a/src/emu/crsshair.c
+++ b/src/emu/crsshair.c
@@ -221,11 +221,11 @@ void crosshair_init(running_machine &machine)
global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT;
/* determine who needs crosshairs */
- for (input_port_config *port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->crossaxis != CROSSHAIR_AXIS_NONE)
+ for (ioport_port *port = machine.ioport().first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE)
{
- int player = field->player;
+ int player = field->player();
assert(player < MAX_PLAYERS);
@@ -347,7 +347,7 @@ static void animate(running_machine &machine, screen_device &device, bool vblank
{
/* read all the lightgun values */
if (global.used[player])
- input_port_get_crosshair_position(device.machine(), player, &global.x[player], &global.y[player]);
+ device.machine().ioport().crosshair_position(player, global.x[player], global.y[player]);
/* auto visibility */
if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index bb338d602ae..83ddadf6b20 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -63,7 +63,7 @@ UINT8 devcb_resolved_write16::s_null;
class devcb_resolver
{
public:
- static const input_port_config *resolve_port(const char *tag, device_t &current);
+ static ioport_port *resolve_port(const char *tag, device_t &current);
static device_t *resolve_device(int index, const char *tag, device_t &current);
static device_execute_interface *resolve_execute_interface(const char *tag, device_t &current);
static address_space *resolve_space(int index, const char *tag, device_t &current);
@@ -80,10 +80,10 @@ public:
// based on the provided tag
//-------------------------------------------------
-const input_port_config *devcb_resolver::resolve_port(const char *tag, device_t &current)
+ioport_port *devcb_resolver::resolve_port(const char *tag, device_t &current)
{
astring fullname;
- const input_port_config *result = current.ioport(current.siblingtag(fullname, tag));
+ ioport_port *result = current.ioport(current.siblingtag(fullname, tag));
if (result == NULL)
throw emu_fatalerror("Unable to find input port '%s' (requested by %s '%s')", fullname.cstr(), current.name(), current.tag());
return result;
@@ -221,7 +221,7 @@ void devcb_resolved_read_line::resolve(const devcb_read_line &desc, device_t &de
int devcb_resolved_read_line::from_port()
{
- return (input_port_read_direct(m_object.port) & 1) ? ASSERT_LINE : CLEAR_LINE;
+ return (m_object.port->read() & 1) ? ASSERT_LINE : CLEAR_LINE;
}
@@ -325,7 +325,7 @@ void devcb_resolved_write_line::to_null(int state)
void devcb_resolved_write_line::to_port(int state)
{
- input_port_write_direct(m_object.port, state, 0xffffffff);
+ m_object.port->write(state, 0xffffffff);
}
@@ -419,7 +419,7 @@ void devcb_resolved_read8::resolve(const devcb_read8 &desc, device_t &device)
UINT8 devcb_resolved_read8::from_port(offs_t offset)
{
- return input_port_read_direct(m_object.port);
+ return m_object.port->read();
}
@@ -522,7 +522,7 @@ void devcb_resolved_write8::to_null(offs_t offset, UINT8 data)
void devcb_resolved_write8::to_port(offs_t offset, UINT8 data)
{
- input_port_write_direct(m_object.port, data, 0xff);
+ m_object.port->write(data, 0xff);
}
@@ -616,7 +616,7 @@ void devcb_resolved_read16::resolve(const devcb_read16 &desc, device_t &device)
UINT16 devcb_resolved_read16::from_port(offs_t offset, UINT16 mask)
{
- return input_port_read_direct(m_object.port);
+ return m_object.port->read();
}
@@ -719,7 +719,7 @@ void devcb_resolved_write16::to_null(offs_t offset, UINT16 data, UINT16 mask)
void devcb_resolved_write16::to_port(offs_t offset, UINT16 data, UINT16 mask)
{
- input_port_write_direct(m_object.port, data, mask);
+ m_object.port->write(data, mask);
}
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index 1dcb8e49a20..2f323b41311 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -203,7 +203,7 @@ void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask)
// resolving a devcb may produce one of the following object types
union devcb_resolved_objects
{
- const input_port_config * port;
+ ioport_port * port;
address_space * space;
device_t * device;
device_execute_interface * execute;
diff --git a/src/emu/device.c b/src/emu/device.c
index 350a80d305c..2ecf2a6839f 100644
--- a/src/emu/device.c
+++ b/src/emu/device.c
@@ -239,7 +239,7 @@ memory_bank *device_t::membank(const char *_tag) const
// object for a given port name
//-------------------------------------------------
-input_port_config *device_t::ioport(const char *tag) const
+ioport_port *device_t::ioport(const char *tag) const
{
// safety first
if (this == NULL)
diff --git a/src/emu/device.h b/src/emu/device.h
index 2ca4343b989..a1a4cafec77 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -95,7 +95,7 @@ class validity_checker;
struct rom_entry;
class machine_config;
class emu_timer;
-typedef struct _input_device_default input_device_default;
+struct input_device_default;
@@ -188,7 +188,7 @@ public:
memory_region *memregion(const char *tag) const;
memory_share *memshare(const char *tag) const;
memory_bank *membank(const char *tag) const;
- input_port_config *ioport(const char *tag) const;
+ ioport_port *ioport(const char *tag) const;
device_t *subdevice(const char *tag) const;
device_t *siblingdevice(const char *tag) const;
template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
@@ -506,12 +506,12 @@ public:
// device finder template
template<bool _Required>
-class device_t::ioport_finder : public device_t::object_finder_base<input_port_config>
+class device_t::ioport_finder : public device_t::object_finder_base<ioport_port>
{
public:
// construction/destruction
ioport_finder(device_t &base, const char *tag)
- : object_finder_base<input_port_config>(base, tag) { }
+ : object_finder_base<ioport_port>(base, tag) { }
// finder
virtual bool findit()
@@ -927,36 +927,6 @@ private:
};
-// ======================> device_delegate
-
-// device_delegate is a delegate that wraps with a device tag and can be easily
-// late bound without replicating logic everywhere
-template<typename _Signature>
-class device_delegate : public delegate<_Signature>
-{
- typedef delegate<_Signature> basetype;
-
-public:
- // provide same set of constructors as the base class, with additional device name
- // parameter
- device_delegate() : basetype(), m_device_name(NULL) { }
- device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
- device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
- template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
- template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
- device_delegate(typename basetype::template traits<device_t>::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
- device_delegate(typename basetype::template traits<device_t>::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
- device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
-
- // perform the binding
- void bind_relative_to(device_t &search_root);
-
-private:
- // internal state
- const char *m_device_name;
-};
-
-
//**************************************************************************
// INLINE FUNCTIONS
diff --git a/src/emu/emu.h b/src/emu/emu.h
index e39935f2e9b..a0e75095db4 100644
--- a/src/emu/emu.h
+++ b/src/emu/emu.h
@@ -81,6 +81,35 @@
class machine_config;
typedef device_t * (*machine_config_constructor)(machine_config &config, device_t *owner);
+// device_delegate is a delegate that wraps with a device tag and can be easily
+// late bound without replicating logic everywhere
+template<typename _Signature>
+class device_delegate : public delegate<_Signature>
+{
+ typedef delegate<_Signature> basetype;
+
+public:
+ // provide same set of constructors as the base class, with additional device name
+ // parameter
+ device_delegate() : basetype(), m_device_name(NULL) { }
+ device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
+ device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
+ template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
+ template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
+ template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
+ template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
+ device_delegate(typename basetype::template traits<device_t>::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
+ device_delegate(typename basetype::template traits<device_t>::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
+ device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
+
+ // perform the binding
+ void bind_relative_to(device_t &search_root);
+
+private:
+ // internal state
+ const char *m_device_name;
+};
+
// I/O
#include "input.h"
#include "ioport.h"
diff --git a/src/emu/info.c b/src/emu/info.c
index e29fb7108d4..af3588818b4 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -267,7 +267,7 @@ void info_xml_creator::output_one()
astring errors;
device_iterator iter(config.root_device());
for (device_t *device = iter.first(); device != NULL; device = iter.next())
- input_port_list_init(*device, portlist, errors);
+ portlist.append(*device, errors);
// print the header and the game name
fprintf(m_output, "\t<%s",emulator_info::get_xml_top());
@@ -352,11 +352,11 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
astring errors;
device_iterator iptiter(device);
for (device_t *dev = iptiter.first(); dev != NULL; dev = iptiter.next())
- input_port_list_init(*dev, portlist, errors);
+ portlist.append(*dev, errors);
// check if the device adds player inputs (other than dsw and configs) to the system
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
- for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->type >= IPT_START1 && field->type < __ipt_ui_start)
+ for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST)
{
has_input = TRUE;
break;
@@ -830,33 +830,33 @@ void info_xml_creator::output_input(const ioport_list &portlist)
bool gambling = false;
// iterate over the ports
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
- for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
+ for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
{
int analogtype = -1;
// track the highest player number
- if (nplayer < field->player + 1)
- nplayer = field->player + 1;
+ if (nplayer < field->player() + 1)
+ nplayer = field->player() + 1;
// switch off of the type
- switch (field->type)
+ switch (field->type())
{
// map which joystick directions are present
- case IPT_JOYSTICK_UP: joytype[0] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICK_DOWN: joytype[0] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICK_LEFT: joytype[0] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICK_RIGHT: joytype[0] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICK_UP: joytype[0] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICK_DOWN: joytype[0] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICK_LEFT: joytype[0] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICK_RIGHT: joytype[0] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKLEFT_UP: joytype[1] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKLEFT_DOWN: joytype[1] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKLEFT_LEFT: joytype[1] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKLEFT_RIGHT: joytype[1] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKLEFT_UP: joytype[1] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKLEFT_DOWN: joytype[1] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKLEFT_LEFT: joytype[1] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKLEFT_RIGHT: joytype[1] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKRIGHT_UP: joytype[2] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKRIGHT_DOWN: joytype[2] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKRIGHT_LEFT: joytype[2] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0); break;
- case IPT_JOYSTICKRIGHT_RIGHT: joytype[2] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKRIGHT_UP: joytype[2] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKRIGHT_DOWN: joytype[2] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKRIGHT_LEFT: joytype[2] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0); break;
+ case IPT_JOYSTICKRIGHT_RIGHT: joytype[2] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0); break;
// mark as an analog input, and get analog stats after switch
case IPT_AD_STICK_X:
@@ -918,7 +918,7 @@ void info_xml_creator::output_input(const ioport_list &portlist)
case IPT_BUTTON14:
case IPT_BUTTON15:
case IPT_BUTTON16:
- nbutton = MAX(nbutton, field->type - IPT_BUTTON1 + 1);
+ nbutton = MAX(nbutton, field->type() - IPT_BUTTON1 + 1);
break;
// track maximum coin index
@@ -930,7 +930,7 @@ void info_xml_creator::output_input(const ioport_list &portlist)
case IPT_COIN6:
case IPT_COIN7:
case IPT_COIN8:
- ncoin = MAX(ncoin, field->type - IPT_COIN1 + 1);
+ ncoin = MAX(ncoin, field->type() - IPT_COIN1 + 1);
break;
// track presence of these guys
@@ -952,11 +952,11 @@ void info_xml_creator::output_input(const ioport_list &portlist)
break;
default:
- if (field->type >= __ipt_mahjong_start && field->type <= __ipt_mahjong_end)
+ if (field->type() > IPT_MAHJONG_FIRST && field->type() < IPT_MAHJONG_LAST)
mahjong = true;
- else if (field->type >= __ipt_hanafuda_start && field->type <= __ipt_hanafuda_end)
+ else if (field->type() > IPT_HANAFUDA_FIRST && field->type() < IPT_HANAFUDA_LAST)
hanafuda = true;
- else if (field->type >= __ipt_gambling_start && field->type <= __ipt_gambling_end)
+ else if (field->type() > IPT_GAMBLING_FIRST && field->type() < IPT_GAMBLING_LAST)
gambling = true;
break;
}
@@ -964,15 +964,15 @@ void info_xml_creator::output_input(const ioport_list &portlist)
// get the analog stats
if (analogtype != -1)
{
- if (field->min != 0)
- control_info[analogtype].min = field->min;
- if (field->max != 0)
- control_info[analogtype].max = field->max;
- if (field->sensitivity != 0)
- control_info[analogtype].sensitivity = field->sensitivity;
- if (field->delta != 0)
- control_info[analogtype].keydelta = field->delta;
- if ((field->flags & ANALOG_FLAG_REVERSE) != 0)
+ if (field->minval() != 0)
+ control_info[analogtype].min = field->minval();
+ if (field->maxval() != 0)
+ control_info[analogtype].max = field->maxval();
+ if (field->sensitivity() != 0)
+ control_info[analogtype].sensitivity = field->sensitivity();
+ if (field->delta() != 0)
+ control_info[analogtype].keydelta = field->delta();
+ if (field->analog_reverse() != 0)
control_info[analogtype].reverse = true;
}
}
@@ -1080,25 +1080,25 @@ void info_xml_creator::output_input(const ioport_list &portlist)
void info_xml_creator::output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag)
{
// iterate looking for DIP switches
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
- for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->type == type)
+ for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->type() == type)
{
- astring newtag(field->port().tag()), oldtag(":");
+ astring newtag(port->tag()), oldtag(":");
newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len());
// output the switch name information
- fprintf(m_output, "\t\t<%s name=\"%s\"", outertag, xml_normalize_string(input_field_name(field)));
+ fprintf(m_output, "\t\t<%s name=\"%s\"", outertag, xml_normalize_string(field->name()));
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag));
- fprintf(m_output, " mask=\"%u\"", field->mask);
+ fprintf(m_output, " mask=\"%u\"", field->mask());
fprintf(m_output, ">\n");
// loop over settings
- for (input_setting_config *setting = field->settinglist().first(); setting != NULL; setting = setting->next())
+ for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
{
- fprintf(m_output, "\t\t\t<%s name=\"%s\"", innertag, xml_normalize_string(setting->name));
- fprintf(m_output, " value=\"%u\"", setting->value);
- if (setting->value == field->defvalue)
+ fprintf(m_output, "\t\t\t<%s name=\"%s\"", innertag, xml_normalize_string(setting->name()));
+ fprintf(m_output, " value=\"%u\"", setting->value());
+ if (setting->value() == field->defvalue())
fprintf(m_output, " default=\"yes\"");
fprintf(m_output, "/>\n");
}
@@ -1117,10 +1117,10 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char *
void info_xml_creator::output_adjusters(const ioport_list &portlist)
{
// iterate looking for Adjusters
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
- for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->type == IPT_ADJUSTER)
- fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(input_field_name(field)), field->defvalue);
+ for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->type() == IPT_ADJUSTER)
+ fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(field->name()), field->defvalue());
}
diff --git a/src/emu/ioport.c b/src/emu/ioport.c
index 081b1a7d6a6..2341aa9a51c 100644
--- a/src/emu/ioport.c
+++ b/src/emu/ioport.c
@@ -4,8 +4,36 @@
Input/output port handling.
- Copyright Nicola Salmoria and the MAME Team.
- Visit http://mamedev.org for licensing and usage restrictions.
+****************************************************************************
+
+ Copyright Aaron Giles
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name 'MAME' nor the names of its contributors may be
+ used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
****************************************************************************
@@ -103,459 +131,527 @@
#include <ctype.h>
#include <time.h>
-/* temporary: set this to 1 to enable the originally defined behavior that
- a field specified via PORT_MODIFY which intersects a previously-defined
- field completely wipes out the previous definition */
+// temporary: set this to 1 to enable the originally defined behavior that
+// a field specified via PORT_MODIFY which intersects a previously-defined
+// field completely wipes out the previous definition
#define INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS 1
-/***************************************************************************
- CONSTANTS
-***************************************************************************/
-
-/* these constants must match the order of the joystick directions in the IPT definition */
-#define JOYDIR_UP 0
-#define JOYDIR_DOWN 1
-#define JOYDIR_LEFT 2
-#define JOYDIR_RIGHT 3
+//**************************************************************************
+// DEBUGGING
+//**************************************************************************
+
+#define LOG_NATURAL_KEYBOARD 0
+
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+const int SPACE_COUNT = 3;
+const int KEY_BUFFER_SIZE = 4096;
+const unicode_char INVALID_CHAR = '?';
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// live analog field information
+class analog_field
+{
+ friend class simple_list<analog_field>;
+ friend class ioport_manager;
+ friend void ioport_field::set_user_settings(const ioport_field::user_settings &settings);
+
+public:
+ // construction/destruction
+ analog_field(ioport_field &field);
+
+ // getters
+ analog_field *next() const { return m_next; }
+ ioport_manager &manager() const { return m_field.manager(); }
+ ioport_field &field() const { return m_field; }
+ INT32 sensitivity() const { return m_sensitivity; }
+ bool reverse() const { return m_reverse; }
+ INT32 delta() const { return m_delta; }
+ INT32 centerdelta() const { return m_centerdelta; }
+
+ // helpers
+ ioport_value apply_min_max(ioport_value value) const;
+ ioport_value apply_settings(ioport_value value) const;
+ ioport_value apply_sensitivity(ioport_value value) const;
+ ioport_value apply_inverse_sensitivity(ioport_value value) const;
+
+ // readers
+ void read(ioport_value &value);
+ float crosshair_read();
+ void frame_update(running_machine &machine);
+
+private:
+ // internal state
+ analog_field * m_next; // link to the next analog state for this port
+ ioport_field & m_field; // pointer to the input field referenced
+
+ // adjusted values (right-justified and tweaked)
+ UINT8 m_shift; // shift to align final value in the port
+ INT32 m_adjdefvalue; // adjusted default value from the config
+ INT32 m_adjmin; // adjusted minimum value from the config
+ INT32 m_adjmax; // adjusted maximum value from the config
+
+ // live values of configurable parameters
+ INT32 m_sensitivity; // current live sensitivity (100=normal)
+ bool m_reverse; // current live reverse flag
+ INT32 m_delta; // current live delta to apply each frame a digital inc/dec key is pressed
+ INT32 m_centerdelta; // current live delta to apply each frame no digital inputs are pressed
+
+ // live analog value tracking
+ INT32 m_accum; // accumulated value (including relative adjustments)
+ INT32 m_previous; // previous adjusted value
+ INT32 m_previousanalog; // previous analog value
+
+ // parameters for modifying live values
+ INT32 m_minimum; // minimum adjusted value
+ INT32 m_maximum; // maximum adjusted value
+ INT32 m_center; // center adjusted value for autocentering
+ INT32 m_reverse_val; // value where we subtract from to reverse directions
+
+ // scaling factors
+ INT64 m_scalepos; // scale factor to apply to positive adjusted values
+ INT64 m_scaleneg; // scale factor to apply to negative adjusted values
+ INT64 m_keyscalepos; // scale factor to apply to the key delta field when pos
+ INT64 m_keyscaleneg; // scale factor to apply to the key delta field when neg
+ INT64 m_positionalscale; // scale factor to divide a joystick into positions
+
+ // misc flags
+ bool m_absolute; // is this an absolute or relative input?
+ bool m_wraps; // does the control wrap around?
+ bool m_autocenter; // autocenter this input?
+ bool m_single_scale; // scale joystick differently if default is between min/max
+ bool m_interpolate; // should we do linear interpolation for mid-frame reads?
+ bool m_lastdigital; // was the last modification caused by a digital form?
+};
-#define JOYDIR_UP_BIT (1 << JOYDIR_UP)
-#define JOYDIR_DOWN_BIT (1 << JOYDIR_DOWN)
-#define JOYDIR_LEFT_BIT (1 << JOYDIR_LEFT)
-#define JOYDIR_RIGHT_BIT (1 << JOYDIR_RIGHT)
-#define LOG_INPUTX 0
-#define SPACE_COUNT 3
-#define INVALID_CHAR '?'
-#define IP_NAME_DEFAULT NULL
+// live device field information
+class dynamic_field
+{
+ friend class simple_list<dynamic_field>;
+
+public:
+ // construction/destruction
+ dynamic_field(ioport_field &field);
+
+ // getters
+ dynamic_field *next() const { return m_next; }
+ ioport_field &field() const { return m_field; }
+
+ // read/write
+ void read(ioport_value &result);
+ void write(ioport_value newval);
+
+private:
+ // internal state
+ dynamic_field * m_next; // linked list of info for this port
+ ioport_field & m_field; // reference to the input field
+ UINT8 m_shift; // shift to apply to the final result
+ ioport_value m_oldval; // last value
+};
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
+// internal live state of an input field
+struct ioport_field_live
+{
+ // construction/destruction
+ ioport_field_live(ioport_field &field, analog_field *analog);
-/* live analog field information */
-typedef struct _analog_field_state analog_field_state;
-struct _analog_field_state
-{
- analog_field_state * next; /* link to the next analog state for this port */
- const input_field_config * field; /* pointer to the input field referenced */
-
- /* adjusted values (right-justified and tweaked) */
- UINT8 shift; /* shift to align final value in the port */
- INT32 adjdefvalue; /* adjusted default value from the config */
- INT32 adjmin; /* adjusted minimum value from the config */
- INT32 adjmax; /* adjusted maximum value from the config */
-
- /* live values of configurable parameters */
- INT32 sensitivity; /* current live sensitivity (100=normal) */
- UINT8 reverse; /* current live reverse flag */
- INT32 delta; /* current live delta to apply each frame a digital inc/dec key is pressed */
- INT32 centerdelta; /* current live delta to apply each frame no digital inputs are pressed */
-
- /* live analog value tracking */
- INT32 accum; /* accumulated value (including relative adjustments) */
- INT32 previous; /* previous adjusted value */
- INT32 previousanalog; /* previous analog value */
-
- /* parameters for modifying live values */
- INT32 minimum; /* minimum adjusted value */
- INT32 maximum; /* maximum adjusted value */
- INT32 center; /* center adjusted value for autocentering */
- INT32 reverse_val; /* value where we subtract from to reverse directions */
-
- /* scaling factors */
- INT64 scalepos; /* scale factor to apply to positive adjusted values */
- INT64 scaleneg; /* scale factor to apply to negative adjusted values */
- INT64 keyscalepos; /* scale factor to apply to the key delta field when pos */
- INT64 keyscaleneg; /* scale factor to apply to the key delta field when neg */
- INT64 positionalscale; /* scale factor to divide a joystick into positions */
-
- /* misc flags */
- UINT8 absolute; /* is this an absolute or relative input? */
- UINT8 wraps; /* does the control wrap around? */
- UINT8 autocenter; /* autocenter this input? */
- UINT8 single_scale; /* scale joystick differently if default is between min/max */
- UINT8 interpolate; /* should we do linear interpolation for mid-frame reads? */
- UINT8 lastdigital; /* was the last modification caused by a digital form? */
+ // public state
+ analog_field * analog; // pointer to live analog data if this is an analog field
+ digital_joystick * joystick; // pointer to digital joystick information
+ input_seq seq[SEQ_TYPE_TOTAL];// currently configured input sequences
+ ioport_value value; // current value of this port
+ UINT8 impulse; // counter for impulse controls
+ bool last; // were we pressed last time?
+ digital_joystick::direction_t joydir; // digital joystick direction index
+ astring name; // overridden name
};
-/* live device field information */
-typedef struct _device_field_info device_field_info;
-struct _device_field_info
+// internal live state of an input port
+struct ioport_port_live
{
- device_field_info * next; /* linked list of info for this port */
- const input_field_config * field; /* pointer to the input field referenced */
- device_t * device; /* device */
- UINT8 shift; /* shift to apply to the final result */
- input_port_value oldval; /* last value */
+ // construction/destruction
+ ioport_port_live(ioport_port &port);
+
+ // public state
+ simple_list<analog_field> analoglist; // list of analog port info
+ simple_list<dynamic_field> readlist; // list of dynamic read fields
+ simple_list<dynamic_field> writelist; // list of dynamic write fields
+ ioport_value defvalue; // combined default value across the port
+ ioport_value digital; // current value from all digital inputs
+ ioport_value outputvalue; // current value for outputs
};
-/* internal live state of an input field */
-struct _input_field_state
+// character information
+struct char_info
{
- analog_field_state * analog; /* pointer to live analog data if this is an analog field */
- digital_joystick_state * joystick; /* pointer to digital joystick information */
- input_seq seq[SEQ_TYPE_TOTAL];/* currently configured input sequences */
- input_port_value value; /* current value of this port */
- UINT8 impulse; /* counter for impulse controls */
- UINT8 last; /* were we pressed last time? */
- UINT8 joydir; /* digital joystick direction index */
- char * name; /* overridden name */
+ unicode_char ch;
+ const char *name;
+ const char *alternate; // alternative string, in UTF-8
+
+ static const char_info *find(unicode_char target);
};
-/* internal live state of an input port */
-struct _input_port_state
-{
- analog_field_state * analoglist; /* pointer to list of analog port info */
- device_field_info * readdevicelist; /* pointer to list of input device info */
- device_field_info * writedevicelist; /* pointer to list of output device info */
- input_port_value defvalue; /* combined default value across the port */
- input_port_value digital; /* current value from all digital inputs */
- input_port_value vblank; /* value of all IPT_VBLANK bits */
- input_port_value outputvalue; /* current value for outputs */
-};
+//**************************************************************************
+// INLINE FUNCTIONS
+//**************************************************************************
-#define KEY_BUFFER_SIZE 4096
+//-------------------------------------------------
+// compute_scale -- compute an 8.24 scale value
+// from a numerator and a denominator
+//-------------------------------------------------
-typedef struct _char_info char_info;
-struct _char_info
+inline INT32 compute_scale(INT32 num, INT32 den)
{
- unicode_char ch;
- const char *name;
- const char *alternate; /* alternative string, in UTF-8 */
-};
+ return (INT64(num) << 24) / den;
+}
-/***************************************************************************
- MACROS
-***************************************************************************/
+//-------------------------------------------------
+// recip_scale -- compute an 8.24 reciprocal of
+// an 8.24 scale value
+//-------------------------------------------------
+
+inline INT32 recip_scale(INT32 scale)
+{
+ return (INT64(1) << 48) / scale;
+}
+
-#define APPLY_SENSITIVITY(x,s) (((INT64)(x) * (s)) / 100.0 + 0.5)
-#define APPLY_INVERSE_SENSITIVITY(x,s) (((INT64)(x) * 100) / (s))
+//-------------------------------------------------
+// apply_scale -- apply an 8.24 scale value to
+// a 32-bit value
+//-------------------------------------------------
-#define COMPUTE_SCALE(num,den) (((INT64)(num) << 24) / (den))
-#define RECIP_SCALE(s) (((INT64)1 << 48) / (s))
-#define APPLY_SCALE(x,s) (((INT64)(x) * (s)) >> 24)
+inline INT32 apply_scale(INT32 value, INT32 scale)
+{
+ return (INT64(value) * scale) >> 24;
+}
-/***************************************************************************
- GLOBAL VARIABLES
-***************************************************************************/
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
-/* XML attributes for the different types */
+// XML attributes for the different types
static const char *const seqtypestrings[] = { "standard", "increment", "decrement" };
-
+// master character info table
static const char_info charinfo[] =
{
- { 0x0008, "Backspace", NULL }, /* Backspace */
- { 0x0009, "Tab", " " }, /* Tab */
- { 0x000c, "Clear", NULL }, /* Clear */
- { 0x000d, "Enter", NULL }, /* Enter */
- { 0x001a, "Esc", NULL }, /* Esc */
- { 0x0020, "Space", " " }, /* Space */
- { 0x0061, NULL, "A" }, /* a */
- { 0x0062, NULL, "B" }, /* b */
- { 0x0063, NULL, "C" }, /* c */
- { 0x0064, NULL, "D" }, /* d */
- { 0x0065, NULL, "E" }, /* e */
- { 0x0066, NULL, "F" }, /* f */
- { 0x0067, NULL, "G" }, /* g */
- { 0x0068, NULL, "H" }, /* h */
- { 0x0069, NULL, "I" }, /* i */
- { 0x006a, NULL, "J" }, /* j */
- { 0x006b, NULL, "K" }, /* k */
- { 0x006c, NULL, "L" }, /* l */
- { 0x006d, NULL, "M" }, /* m */
- { 0x006e, NULL, "N" }, /* n */
- { 0x006f, NULL, "O" }, /* o */
- { 0x0070, NULL, "P" }, /* p */
- { 0x0071, NULL, "Q" }, /* q */
- { 0x0072, NULL, "R" }, /* r */
- { 0x0073, NULL, "S" }, /* s */
- { 0x0074, NULL, "T" }, /* t */
- { 0x0075, NULL, "U" }, /* u */
- { 0x0076, NULL, "V" }, /* v */
- { 0x0077, NULL, "W" }, /* w */
- { 0x0078, NULL, "X" }, /* x */
- { 0x0079, NULL, "Y" }, /* y */
- { 0x007a, NULL, "Z" }, /* z */
- { 0x00a0, NULL, " " }, /* non breaking space */
- { 0x00a1, NULL, "!" }, /* inverted exclaimation mark */
- { 0x00a6, NULL, "|" }, /* broken bar */
- { 0x00a9, NULL, "(c)" }, /* copyright sign */
- { 0x00ab, NULL, "<<" }, /* left pointing double angle */
- { 0x00ae, NULL, "(r)" }, /* registered sign */
- { 0x00bb, NULL, ">>" }, /* right pointing double angle */
- { 0x00bc, NULL, "1/4" }, /* vulgar fraction one quarter */
- { 0x00bd, NULL, "1/2" }, /* vulgar fraction one half */
- { 0x00be, NULL, "3/4" }, /* vulgar fraction three quarters */
- { 0x00bf, NULL, "?" }, /* inverted question mark */
- { 0x00c0, NULL, "A" }, /* 'A' grave */
- { 0x00c1, NULL, "A" }, /* 'A' acute */
- { 0x00c2, NULL, "A" }, /* 'A' circumflex */
- { 0x00c3, NULL, "A" }, /* 'A' tilde */
- { 0x00c4, NULL, "A" }, /* 'A' diaeresis */
- { 0x00c5, NULL, "A" }, /* 'A' ring above */
- { 0x00c6, NULL, "AE" }, /* 'AE' ligature */
- { 0x00c7, NULL, "C" }, /* 'C' cedilla */
- { 0x00c8, NULL, "E" }, /* 'E' grave */
- { 0x00c9, NULL, "E" }, /* 'E' acute */
- { 0x00ca, NULL, "E" }, /* 'E' circumflex */
- { 0x00cb, NULL, "E" }, /* 'E' diaeresis */
- { 0x00cc, NULL, "I" }, /* 'I' grave */
- { 0x00cd, NULL, "I" }, /* 'I' acute */
- { 0x00ce, NULL, "I" }, /* 'I' circumflex */
- { 0x00cf, NULL, "I" }, /* 'I' diaeresis */
- { 0x00d0, NULL, "D" }, /* 'ETH' */
- { 0x00d1, NULL, "N" }, /* 'N' tilde */
- { 0x00d2, NULL, "O" }, /* 'O' grave */
- { 0x00d3, NULL, "O" }, /* 'O' acute */
- { 0x00d4, NULL, "O" }, /* 'O' circumflex */
- { 0x00d5, NULL, "O" }, /* 'O' tilde */
- { 0x00d6, NULL, "O" }, /* 'O' diaeresis */
- { 0x00d7, NULL, "X" }, /* multiplication sign */
- { 0x00d8, NULL, "O" }, /* 'O' stroke */
- { 0x00d9, NULL, "U" }, /* 'U' grave */
- { 0x00da, NULL, "U" }, /* 'U' acute */
- { 0x00db, NULL, "U" }, /* 'U' circumflex */
- { 0x00dc, NULL, "U" }, /* 'U' diaeresis */
- { 0x00dd, NULL, "Y" }, /* 'Y' acute */
- { 0x00df, NULL, "SS" }, /* sharp S */
- { 0x00e0, NULL, "a" }, /* 'a' grave */
- { 0x00e1, NULL, "a" }, /* 'a' acute */
- { 0x00e2, NULL, "a" }, /* 'a' circumflex */
- { 0x00e3, NULL, "a" }, /* 'a' tilde */
- { 0x00e4, NULL, "a" }, /* 'a' diaeresis */
- { 0x00e5, NULL, "a" }, /* 'a' ring above */
- { 0x00e6, NULL, "ae" }, /* 'ae' ligature */
- { 0x00e7, NULL, "c" }, /* 'c' cedilla */
- { 0x00e8, NULL, "e" }, /* 'e' grave */
- { 0x00e9, NULL, "e" }, /* 'e' acute */
- { 0x00ea, NULL, "e" }, /* 'e' circumflex */
- { 0x00eb, NULL, "e" }, /* 'e' diaeresis */
- { 0x00ec, NULL, "i" }, /* 'i' grave */
- { 0x00ed, NULL, "i" }, /* 'i' acute */
- { 0x00ee, NULL, "i" }, /* 'i' circumflex */
- { 0x00ef, NULL, "i" }, /* 'i' diaeresis */
- { 0x00f0, NULL, "d" }, /* 'eth' */
- { 0x00f1, NULL, "n" }, /* 'n' tilde */
- { 0x00f2, NULL, "o" }, /* 'o' grave */
- { 0x00f3, NULL, "o" }, /* 'o' acute */
- { 0x00f4, NULL, "o" }, /* 'o' circumflex */
- { 0x00f5, NULL, "o" }, /* 'o' tilde */
- { 0x00f6, NULL, "o" }, /* 'o' diaeresis */
- { 0x00f8, NULL, "o" }, /* 'o' stroke */
- { 0x00f9, NULL, "u" }, /* 'u' grave */
- { 0x00fa, NULL, "u" }, /* 'u' acute */
- { 0x00fb, NULL, "u" }, /* 'u' circumflex */
- { 0x00fc, NULL, "u" }, /* 'u' diaeresis */
- { 0x00fd, NULL, "y" }, /* 'y' acute */
- { 0x00ff, NULL, "y" }, /* 'y' diaeresis */
- { 0x2010, NULL, "-" }, /* hyphen */
- { 0x2011, NULL, "-" }, /* non-breaking hyphen */
- { 0x2012, NULL, "-" }, /* figure dash */
- { 0x2013, NULL, "-" }, /* en dash */
- { 0x2014, NULL, "-" }, /* em dash */
- { 0x2015, NULL, "-" }, /* horizontal dash */
- { 0x2018, NULL, "\'" }, /* left single quotation mark */
- { 0x2019, NULL, "\'" }, /* right single quotation mark */
- { 0x201a, NULL, "\'" }, /* single low quotation mark */
- { 0x201b, NULL, "\'" }, /* single high reversed quotation mark */
- { 0x201c, NULL, "\"" }, /* left double quotation mark */
- { 0x201d, NULL, "\"" }, /* right double quotation mark */
- { 0x201e, NULL, "\"" }, /* double low quotation mark */
- { 0x201f, NULL, "\"" }, /* double high reversed quotation mark */
- { 0x2024, NULL, "." }, /* one dot leader */
- { 0x2025, NULL, ".." }, /* two dot leader */
- { 0x2026, NULL, "..." }, /* horizontal ellipsis */
- { 0x2047, NULL, "??" }, /* double question mark */
- { 0x2048, NULL, "?!" }, /* question exclamation mark */
- { 0x2049, NULL, "!?" }, /* exclamation question mark */
- { 0xff01, NULL, "!" }, /* fullwidth exclamation point */
- { 0xff02, NULL, "\"" }, /* fullwidth quotation mark */
- { 0xff03, NULL, "#" }, /* fullwidth number sign */
- { 0xff04, NULL, "$" }, /* fullwidth dollar sign */
- { 0xff05, NULL, "%" }, /* fullwidth percent sign */
- { 0xff06, NULL, "&" }, /* fullwidth ampersand */
- { 0xff07, NULL, "\'" }, /* fullwidth apostrophe */
- { 0xff08, NULL, "(" }, /* fullwidth left parenthesis */
- { 0xff09, NULL, ")" }, /* fullwidth right parenthesis */
- { 0xff0a, NULL, "*" }, /* fullwidth asterisk */
- { 0xff0b, NULL, "+" }, /* fullwidth plus */
- { 0xff0c, NULL, "," }, /* fullwidth comma */
- { 0xff0d, NULL, "-" }, /* fullwidth minus */
- { 0xff0e, NULL, "." }, /* fullwidth period */
- { 0xff0f, NULL, "/" }, /* fullwidth slash */
- { 0xff10, NULL, "0" }, /* fullwidth zero */
- { 0xff11, NULL, "1" }, /* fullwidth one */
- { 0xff12, NULL, "2" }, /* fullwidth two */
- { 0xff13, NULL, "3" }, /* fullwidth three */
- { 0xff14, NULL, "4" }, /* fullwidth four */
- { 0xff15, NULL, "5" }, /* fullwidth five */
- { 0xff16, NULL, "6" }, /* fullwidth six */
- { 0xff17, NULL, "7" }, /* fullwidth seven */
- { 0xff18, NULL, "8" }, /* fullwidth eight */
- { 0xff19, NULL, "9" }, /* fullwidth nine */
- { 0xff1a, NULL, ":" }, /* fullwidth colon */
- { 0xff1b, NULL, ";" }, /* fullwidth semicolon */
- { 0xff1c, NULL, "<" }, /* fullwidth less than sign */
- { 0xff1d, NULL, "=" }, /* fullwidth equals sign */
- { 0xff1e, NULL, ">" }, /* fullwidth greater than sign */
- { 0xff1f, NULL, "?" }, /* fullwidth question mark */
- { 0xff20, NULL, "@" }, /* fullwidth at sign */
- { 0xff21, NULL, "A" }, /* fullwidth 'A' */
- { 0xff22, NULL, "B" }, /* fullwidth 'B' */
- { 0xff23, NULL, "C" }, /* fullwidth 'C' */
- { 0xff24, NULL, "D" }, /* fullwidth 'D' */
- { 0xff25, NULL, "E" }, /* fullwidth 'E' */
- { 0xff26, NULL, "F" }, /* fullwidth 'F' */
- { 0xff27, NULL, "G" }, /* fullwidth 'G' */
- { 0xff28, NULL, "H" }, /* fullwidth 'H' */
- { 0xff29, NULL, "I" }, /* fullwidth 'I' */
- { 0xff2a, NULL, "J" }, /* fullwidth 'J' */
- { 0xff2b, NULL, "K" }, /* fullwidth 'K' */
- { 0xff2c, NULL, "L" }, /* fullwidth 'L' */
- { 0xff2d, NULL, "M" }, /* fullwidth 'M' */
- { 0xff2e, NULL, "N" }, /* fullwidth 'N' */
- { 0xff2f, NULL, "O" }, /* fullwidth 'O' */
- { 0xff30, NULL, "P" }, /* fullwidth 'P' */
- { 0xff31, NULL, "Q" }, /* fullwidth 'Q' */
- { 0xff32, NULL, "R" }, /* fullwidth 'R' */
- { 0xff33, NULL, "S" }, /* fullwidth 'S' */
- { 0xff34, NULL, "T" }, /* fullwidth 'T' */
- { 0xff35, NULL, "U" }, /* fullwidth 'U' */
- { 0xff36, NULL, "V" }, /* fullwidth 'V' */
- { 0xff37, NULL, "W" }, /* fullwidth 'W' */
- { 0xff38, NULL, "X" }, /* fullwidth 'X' */
- { 0xff39, NULL, "Y" }, /* fullwidth 'Y' */
- { 0xff3a, NULL, "Z" }, /* fullwidth 'Z' */
- { 0xff3b, NULL, "[" }, /* fullwidth left bracket */
- { 0xff3c, NULL, "\\" }, /* fullwidth backslash */
- { 0xff3d, NULL, "]" }, /* fullwidth right bracket */
- { 0xff3e, NULL, "^" }, /* fullwidth caret */
- { 0xff3f, NULL, "_" }, /* fullwidth underscore */
- { 0xff40, NULL, "`" }, /* fullwidth backquote */
- { 0xff41, NULL, "a" }, /* fullwidth 'a' */
- { 0xff42, NULL, "b" }, /* fullwidth 'b' */
- { 0xff43, NULL, "c" }, /* fullwidth 'c' */
- { 0xff44, NULL, "d" }, /* fullwidth 'd' */
- { 0xff45, NULL, "e" }, /* fullwidth 'e' */
- { 0xff46, NULL, "f" }, /* fullwidth 'f' */
- { 0xff47, NULL, "g" }, /* fullwidth 'g' */
- { 0xff48, NULL, "h" }, /* fullwidth 'h' */
- { 0xff49, NULL, "i" }, /* fullwidth 'i' */
- { 0xff4a, NULL, "j" }, /* fullwidth 'j' */
- { 0xff4b, NULL, "k" }, /* fullwidth 'k' */
- { 0xff4c, NULL, "l" }, /* fullwidth 'l' */
- { 0xff4d, NULL, "m" }, /* fullwidth 'm' */
- { 0xff4e, NULL, "n" }, /* fullwidth 'n' */
- { 0xff4f, NULL, "o" }, /* fullwidth 'o' */
- { 0xff50, NULL, "p" }, /* fullwidth 'p' */
- { 0xff51, NULL, "q" }, /* fullwidth 'q' */
- { 0xff52, NULL, "r" }, /* fullwidth 'r' */
- { 0xff53, NULL, "s" }, /* fullwidth 's' */
- { 0xff54, NULL, "t" }, /* fullwidth 't' */
- { 0xff55, NULL, "u" }, /* fullwidth 'u' */
- { 0xff56, NULL, "v" }, /* fullwidth 'v' */
- { 0xff57, NULL, "w" }, /* fullwidth 'w' */
- { 0xff58, NULL, "x" }, /* fullwidth 'x' */
- { 0xff59, NULL, "y" }, /* fullwidth 'y' */
- { 0xff5a, NULL, "z" }, /* fullwidth 'z' */
- { 0xff5b, NULL, "{" }, /* fullwidth left brace */
- { 0xff5c, NULL, "|" }, /* fullwidth vertical bar */
- { 0xff5d, NULL, "}" }, /* fullwidth right brace */
- { 0xff5e, NULL, "~" }, /* fullwidth tilde */
- { 0xff5f, NULL, "((" }, /* fullwidth double left parenthesis */
- { 0xff60, NULL, "))" }, /* fullwidth double right parenthesis */
- { 0xffe0, NULL, "\xC2\xA2" }, /* fullwidth cent sign */
- { 0xffe1, NULL, "\xC2\xA3" }, /* fullwidth pound sign */
- { 0xffe4, NULL, "\xC2\xA4" }, /* fullwidth broken bar */
- { 0xffe5, NULL, "\xC2\xA5" }, /* fullwidth yen sign */
- { 0xffe6, NULL, "\xE2\x82\xA9" }, /* fullwidth won sign */
- { 0xffe9, NULL, "\xE2\x86\x90" }, /* fullwidth left arrow */
- { 0xffea, NULL, "\xE2\x86\x91" }, /* fullwidth up arrow */
- { 0xffeb, NULL, "\xE2\x86\x92" }, /* fullwidth right arrow */
- { 0xffec, NULL, "\xE2\x86\x93" }, /* fullwidth down arrow */
- { 0xffed, NULL, "\xE2\x96\xAA" }, /* fullwidth solid box */
- { 0xffee, NULL, "\xE2\x97\xA6" }, /* fullwidth open circle */
- { UCHAR_SHIFT_1, "Shift", NULL }, /* Shift key */
- { UCHAR_SHIFT_2, "Ctrl", NULL }, /* Ctrl key */
- { UCHAR_MAMEKEY(F1), "F1", NULL }, /* F1 function key */
- { UCHAR_MAMEKEY(F2), "F2", NULL }, /* F2 function key */
- { UCHAR_MAMEKEY(F3), "F3", NULL }, /* F3 function key */
- { UCHAR_MAMEKEY(F4), "F4", NULL }, /* F4 function key */
- { UCHAR_MAMEKEY(F5), "F5", NULL }, /* F5 function key */
- { UCHAR_MAMEKEY(F6), "F6", NULL }, /* F6 function key */
- { UCHAR_MAMEKEY(F7), "F7", NULL }, /* F7 function key */
- { UCHAR_MAMEKEY(F8), "F8", NULL }, /* F8 function key */
- { UCHAR_MAMEKEY(F9), "F9", NULL }, /* F9 function key */
- { UCHAR_MAMEKEY(F10), "F10", NULL }, /* F10 function key */
- { UCHAR_MAMEKEY(F11), "F11", NULL }, /* F11 function key */
- { UCHAR_MAMEKEY(F12), "F12", NULL }, /* F12 function key */
- { UCHAR_MAMEKEY(F13), "F13", NULL }, /* F13 function key */
- { UCHAR_MAMEKEY(F14), "F14", NULL }, /* F14 function key */
- { UCHAR_MAMEKEY(F15), "F15", NULL }, /* F15 function key */
- { UCHAR_MAMEKEY(ESC), "Esc", "\033" }, /* Esc key */
- { UCHAR_MAMEKEY(INSERT), "Insert", NULL }, /* Insert key */
- { UCHAR_MAMEKEY(DEL), "Delete", "\010" }, /* Delete key */
- { UCHAR_MAMEKEY(HOME), "Home", "\014" }, /* Home key */
- { UCHAR_MAMEKEY(END), "End", NULL }, /* End key */
- { UCHAR_MAMEKEY(PGUP), "Page Up", NULL }, /* Page Up key */
- { UCHAR_MAMEKEY(PGDN), "Page Down", NULL }, /* Page Down key */
- { UCHAR_MAMEKEY(LEFT), "Cursor Left", NULL }, /* Cursor Left */
- { UCHAR_MAMEKEY(RIGHT), "Cursor Right", NULL }, /* Cursor Right */
- { UCHAR_MAMEKEY(UP), "Cursor Up", NULL }, /* Cursor Up */
- { UCHAR_MAMEKEY(DOWN), "Cursor Down", NULL }, /* Cursor Down */
- { UCHAR_MAMEKEY(0_PAD), "Keypad 0", NULL }, /* 0 on the numeric keypad */
- { UCHAR_MAMEKEY(1_PAD), "Keypad 1", NULL }, /* 1 on the numeric keypad */
- { UCHAR_MAMEKEY(2_PAD), "Keypad 2", NULL }, /* 2 on the numeric keypad */
- { UCHAR_MAMEKEY(3_PAD), "Keypad 3", NULL }, /* 3 on the numeric keypad */
- { UCHAR_MAMEKEY(4_PAD), "Keypad 4", NULL }, /* 4 on the numeric keypad */
- { UCHAR_MAMEKEY(5_PAD), "Keypad 5", NULL }, /* 5 on the numeric keypad */
- { UCHAR_MAMEKEY(6_PAD), "Keypad 6", NULL }, /* 6 on the numeric keypad */
- { UCHAR_MAMEKEY(7_PAD), "Keypad 7", NULL }, /* 7 on the numeric keypad */
- { UCHAR_MAMEKEY(8_PAD), "Keypad 8", NULL }, /* 8 on the numeric keypad */
- { UCHAR_MAMEKEY(9_PAD), "Keypad 9", NULL }, /* 9 on the numeric keypad */
- { UCHAR_MAMEKEY(SLASH_PAD), "Keypad /", NULL }, /* / on the numeric keypad */
- { UCHAR_MAMEKEY(ASTERISK), "Keypad *", NULL }, /* * on the numeric keypad */
- { UCHAR_MAMEKEY(MINUS_PAD), "Keypad -", NULL }, /* - on the numeric Keypad */
- { UCHAR_MAMEKEY(PLUS_PAD), "Keypad +", NULL }, /* + on the numeric Keypad */
- { UCHAR_MAMEKEY(DEL_PAD), "Keypad .", NULL }, /* . on the numeric keypad */
- { UCHAR_MAMEKEY(ENTER_PAD), "Keypad Enter", NULL }, /* Enter on the numeric keypad */
- { UCHAR_MAMEKEY(PRTSCR), "Print Screen", NULL }, /* Print Screen key */
- { UCHAR_MAMEKEY(PAUSE), "Pause", NULL }, /* Pause key */
- { UCHAR_MAMEKEY(LSHIFT), "Left Shift", NULL }, /* Left Shift key */
- { UCHAR_MAMEKEY(RSHIFT), "Right Shift", NULL }, /* Right Shift key */
- { UCHAR_MAMEKEY(LCONTROL), "Left Ctrl", NULL }, /* Left Control key */
- { UCHAR_MAMEKEY(RCONTROL), "Right Ctrl", NULL }, /* Right Control key */
- { UCHAR_MAMEKEY(LALT), "Left Alt", NULL }, /* Left Alt key */
- { UCHAR_MAMEKEY(RALT), "Right Alt", NULL }, /* Right Alt key */
- { UCHAR_MAMEKEY(SCRLOCK), "Scroll Lock", NULL }, /* Scroll Lock key */
- { UCHAR_MAMEKEY(NUMLOCK), "Num Lock", NULL }, /* Num Lock key */
- { UCHAR_MAMEKEY(CAPSLOCK), "Caps Lock", NULL }, /* Caps Lock key */
- { UCHAR_MAMEKEY(LWIN), "Left Win", NULL }, /* Left Win key */
- { UCHAR_MAMEKEY(RWIN), "Right Win", NULL }, /* Right Win key */
- { UCHAR_MAMEKEY(MENU), "Menu", NULL }, /* Menu key */
- { UCHAR_MAMEKEY(CANCEL), "Break", NULL } /* Break/Pause key */
+ { 0x0008, "Backspace", NULL }, // Backspace
+ { 0x0009, "Tab", " " }, // Tab
+ { 0x000c, "Clear", NULL }, // Clear
+ { 0x000d, "Enter", NULL }, // Enter
+ { 0x001a, "Esc", NULL }, // Esc
+ { 0x0020, "Space", " " }, // Space
+ { 0x0061, NULL, "A" }, // a
+ { 0x0062, NULL, "B" }, // b
+ { 0x0063, NULL, "C" }, // c
+ { 0x0064, NULL, "D" }, // d
+ { 0x0065, NULL, "E" }, // e
+ { 0x0066, NULL, "F" }, // f
+ { 0x0067, NULL, "G" }, // g
+ { 0x0068, NULL, "H" }, // h
+ { 0x0069, NULL, "I" }, // i
+ { 0x006a, NULL, "J" }, // j
+ { 0x006b, NULL, "K" }, // k
+ { 0x006c, NULL, "L" }, // l
+ { 0x006d, NULL, "M" }, // m
+ { 0x006e, NULL, "N" }, // n
+ { 0x006f, NULL, "O" }, // o
+ { 0x0070, NULL, "P" }, // p
+ { 0x0071, NULL, "Q" }, // q
+ { 0x0072, NULL, "R" }, // r
+ { 0x0073, NULL, "S" }, // s
+ { 0x0074, NULL, "T" }, // t
+ { 0x0075, NULL, "U" }, // u
+ { 0x0076, NULL, "V" }, // v
+ { 0x0077, NULL, "W" }, // w
+ { 0x0078, NULL, "X" }, // x
+ { 0x0079, NULL, "Y" }, // y
+ { 0x007a, NULL, "Z" }, // z
+ { 0x00a0, NULL, " " }, // non breaking space
+ { 0x00a1, NULL, "!" }, // inverted exclaimation mark
+ { 0x00a6, NULL, "|" }, // broken bar
+ { 0x00a9, NULL, "(c)" }, // copyright sign
+ { 0x00ab, NULL, "<<" }, // left pointing double angle
+ { 0x00ae, NULL, "(r)" }, // registered sign
+ { 0x00bb, NULL, ">>" }, // right pointing double angle
+ { 0x00bc, NULL, "1/4" }, // vulgar fraction one quarter
+ { 0x00bd, NULL, "1/2" }, // vulgar fraction one half
+ { 0x00be, NULL, "3/4" }, // vulgar fraction three quarters
+ { 0x00bf, NULL, "?" }, // inverted question mark
+ { 0x00c0, NULL, "A" }, // 'A' grave
+ { 0x00c1, NULL, "A" }, // 'A' acute
+ { 0x00c2, NULL, "A" }, // 'A' circumflex
+ { 0x00c3, NULL, "A" }, // 'A' tilde
+ { 0x00c4, NULL, "A" }, // 'A' diaeresis
+ { 0x00c5, NULL, "A" }, // 'A' ring above
+ { 0x00c6, NULL, "AE" }, // 'AE' ligature
+ { 0x00c7, NULL, "C" }, // 'C' cedilla
+ { 0x00c8, NULL, "E" }, // 'E' grave
+ { 0x00c9, NULL, "E" }, // 'E' acute
+ { 0x00ca, NULL, "E" }, // 'E' circumflex
+ { 0x00cb, NULL, "E" }, // 'E' diaeresis
+ { 0x00cc, NULL, "I" }, // 'I' grave
+ { 0x00cd, NULL, "I" }, // 'I' acute
+ { 0x00ce, NULL, "I" }, // 'I' circumflex
+ { 0x00cf, NULL, "I" }, // 'I' diaeresis
+ { 0x00d0, NULL, "D" }, // 'ETH'
+ { 0x00d1, NULL, "N" }, // 'N' tilde
+ { 0x00d2, NULL, "O" }, // 'O' grave
+ { 0x00d3, NULL, "O" }, // 'O' acute
+ { 0x00d4, NULL, "O" }, // 'O' circumflex
+ { 0x00d5, NULL, "O" }, // 'O' tilde
+ { 0x00d6, NULL, "O" }, // 'O' diaeresis
+ { 0x00d7, NULL, "X" }, // multiplication sign
+ { 0x00d8, NULL, "O" }, // 'O' stroke
+ { 0x00d9, NULL, "U" }, // 'U' grave
+ { 0x00da, NULL, "U" }, // 'U' acute
+ { 0x00db, NULL, "U" }, // 'U' circumflex
+ { 0x00dc, NULL, "U" }, // 'U' diaeresis
+ { 0x00dd, NULL, "Y" }, // 'Y' acute
+ { 0x00df, NULL, "SS" }, // sharp S
+ { 0x00e0, NULL, "a" }, // 'a' grave
+ { 0x00e1, NULL, "a" }, // 'a' acute
+ { 0x00e2, NULL, "a" }, // 'a' circumflex
+ { 0x00e3, NULL, "a" }, // 'a' tilde
+ { 0x00e4, NULL, "a" }, // 'a' diaeresis
+ { 0x00e5, NULL, "a" }, // 'a' ring above
+ { 0x00e6, NULL, "ae" }, // 'ae' ligature
+ { 0x00e7, NULL, "c" }, // 'c' cedilla
+ { 0x00e8, NULL, "e" }, // 'e' grave
+ { 0x00e9, NULL, "e" }, // 'e' acute
+ { 0x00ea, NULL, "e" }, // 'e' circumflex
+ { 0x00eb, NULL, "e" }, // 'e' diaeresis
+ { 0x00ec, NULL, "i" }, // 'i' grave
+ { 0x00ed, NULL, "i" }, // 'i' acute
+ { 0x00ee, NULL, "i" }, // 'i' circumflex
+ { 0x00ef, NULL, "i" }, // 'i' diaeresis
+ { 0x00f0, NULL, "d" }, // 'eth'
+ { 0x00f1, NULL, "n" }, // 'n' tilde
+ { 0x00f2, NULL, "o" }, // 'o' grave
+ { 0x00f3, NULL, "o" }, // 'o' acute
+ { 0x00f4, NULL, "o" }, // 'o' circumflex
+ { 0x00f5, NULL, "o" }, // 'o' tilde
+ { 0x00f6, NULL, "o" }, // 'o' diaeresis
+ { 0x00f8, NULL, "o" }, // 'o' stroke
+ { 0x00f9, NULL, "u" }, // 'u' grave
+ { 0x00fa, NULL, "u" }, // 'u' acute
+ { 0x00fb, NULL, "u" }, // 'u' circumflex
+ { 0x00fc, NULL, "u" }, // 'u' diaeresis
+ { 0x00fd, NULL, "y" }, // 'y' acute
+ { 0x00ff, NULL, "y" }, // 'y' diaeresis
+ { 0x2010, NULL, "-" }, // hyphen
+ { 0x2011, NULL, "-" }, // non-breaking hyphen
+ { 0x2012, NULL, "-" }, // figure dash
+ { 0x2013, NULL, "-" }, // en dash
+ { 0x2014, NULL, "-" }, // em dash
+ { 0x2015, NULL, "-" }, // horizontal dash
+ { 0x2018, NULL, "\'" }, // left single quotation mark
+ { 0x2019, NULL, "\'" }, // right single quotation mark
+ { 0x201a, NULL, "\'" }, // single low quotation mark
+ { 0x201b, NULL, "\'" }, // single high reversed quotation mark
+ { 0x201c, NULL, "\"" }, // left double quotation mark
+ { 0x201d, NULL, "\"" }, // right double quotation mark
+ { 0x201e, NULL, "\"" }, // double low quotation mark
+ { 0x201f, NULL, "\"" }, // double high reversed quotation mark
+ { 0x2024, NULL, "." }, // one dot leader
+ { 0x2025, NULL, ".." }, // two dot leader
+ { 0x2026, NULL, "..." }, // horizontal ellipsis
+ { 0x2047, NULL, "??" }, // double question mark
+ { 0x2048, NULL, "?!" }, // question exclamation mark
+ { 0x2049, NULL, "!?" }, // exclamation question mark
+ { 0xff01, NULL, "!" }, // fullwidth exclamation point
+ { 0xff02, NULL, "\"" }, // fullwidth quotation mark
+ { 0xff03, NULL, "#" }, // fullwidth number sign
+ { 0xff04, NULL, "$" }, // fullwidth dollar sign
+ { 0xff05, NULL, "%" }, // fullwidth percent sign
+ { 0xff06, NULL, "&" }, // fullwidth ampersand
+ { 0xff07, NULL, "\'" }, // fullwidth apostrophe
+ { 0xff08, NULL, "(" }, // fullwidth left parenthesis
+ { 0xff09, NULL, ")" }, // fullwidth right parenthesis
+ { 0xff0a, NULL, "*" }, // fullwidth asterisk
+ { 0xff0b, NULL, "+" }, // fullwidth plus
+ { 0xff0c, NULL, "," }, // fullwidth comma
+ { 0xff0d, NULL, "-" }, // fullwidth minus
+ { 0xff0e, NULL, "." }, // fullwidth period
+ { 0xff0f, NULL, "/" }, // fullwidth slash
+ { 0xff10, NULL, "0" }, // fullwidth zero
+ { 0xff11, NULL, "1" }, // fullwidth one
+ { 0xff12, NULL, "2" }, // fullwidth two
+ { 0xff13, NULL, "3" }, // fullwidth three
+ { 0xff14, NULL, "4" }, // fullwidth four
+ { 0xff15, NULL, "5" }, // fullwidth five
+ { 0xff16, NULL, "6" }, // fullwidth six
+ { 0xff17, NULL, "7" }, // fullwidth seven
+ { 0xff18, NULL, "8" }, // fullwidth eight
+ { 0xff19, NULL, "9" }, // fullwidth nine
+ { 0xff1a, NULL, ":" }, // fullwidth colon
+ { 0xff1b, NULL, ";" }, // fullwidth semicolon
+ { 0xff1c, NULL, "<" }, // fullwidth less than sign
+ { 0xff1d, NULL, "=" }, // fullwidth equals sign
+ { 0xff1e, NULL, ">" }, // fullwidth greater than sign
+ { 0xff1f, NULL, "?" }, // fullwidth question mark
+ { 0xff20, NULL, "@" }, // fullwidth at sign
+ { 0xff21, NULL, "A" }, // fullwidth 'A'
+ { 0xff22, NULL, "B" }, // fullwidth 'B'
+ { 0xff23, NULL, "C" }, // fullwidth 'C'
+ { 0xff24, NULL, "D" }, // fullwidth 'D'
+ { 0xff25, NULL, "E" }, // fullwidth 'E'
+ { 0xff26, NULL, "F" }, // fullwidth 'F'
+ { 0xff27, NULL, "G" }, // fullwidth 'G'
+ { 0xff28, NULL, "H" }, // fullwidth 'H'
+ { 0xff29, NULL, "I" }, // fullwidth 'I'
+ { 0xff2a, NULL, "J" }, // fullwidth 'J'
+ { 0xff2b, NULL, "K" }, // fullwidth 'K'
+ { 0xff2c, NULL, "L" }, // fullwidth 'L'
+ { 0xff2d, NULL, "M" }, // fullwidth 'M'
+ { 0xff2e, NULL, "N" }, // fullwidth 'N'
+ { 0xff2f, NULL, "O" }, // fullwidth 'O'
+ { 0xff30, NULL, "P" }, // fullwidth 'P'
+ { 0xff31, NULL, "Q" }, // fullwidth 'Q'
+ { 0xff32, NULL, "R" }, // fullwidth 'R'
+ { 0xff33, NULL, "S" }, // fullwidth 'S'
+ { 0xff34, NULL, "T" }, // fullwidth 'T'
+ { 0xff35, NULL, "U" }, // fullwidth 'U'
+ { 0xff36, NULL, "V" }, // fullwidth 'V'
+ { 0xff37, NULL, "W" }, // fullwidth 'W'
+ { 0xff38, NULL, "X" }, // fullwidth 'X'
+ { 0xff39, NULL, "Y" }, // fullwidth 'Y'
+ { 0xff3a, NULL, "Z" }, // fullwidth 'Z'
+ { 0xff3b, NULL, "[" }, // fullwidth left bracket
+ { 0xff3c, NULL, "\\" }, // fullwidth backslash
+ { 0xff3d, NULL, "]" }, // fullwidth right bracket
+ { 0xff3e, NULL, "^" }, // fullwidth caret
+ { 0xff3f, NULL, "_" }, // fullwidth underscore
+ { 0xff40, NULL, "`" }, // fullwidth backquote
+ { 0xff41, NULL, "a" }, // fullwidth 'a'
+ { 0xff42, NULL, "b" }, // fullwidth 'b'
+ { 0xff43, NULL, "c" }, // fullwidth 'c'
+ { 0xff44, NULL, "d" }, // fullwidth 'd'
+ { 0xff45, NULL, "e" }, // fullwidth 'e'
+ { 0xff46, NULL, "f" }, // fullwidth 'f'
+ { 0xff47, NULL, "g" }, // fullwidth 'g'
+ { 0xff48, NULL, "h" }, // fullwidth 'h'
+ { 0xff49, NULL, "i" }, // fullwidth 'i'
+ { 0xff4a, NULL, "j" }, // fullwidth 'j'
+ { 0xff4b, NULL, "k" }, // fullwidth 'k'
+ { 0xff4c, NULL, "l" }, // fullwidth 'l'
+ { 0xff4d, NULL, "m" }, // fullwidth 'm'
+ { 0xff4e, NULL, "n" }, // fullwidth 'n'
+ { 0xff4f, NULL, "o" }, // fullwidth 'o'
+ { 0xff50, NULL, "p" }, // fullwidth 'p'
+ { 0xff51, NULL, "q" }, // fullwidth 'q'
+ { 0xff52, NULL, "r" }, // fullwidth 'r'
+ { 0xff53, NULL, "s" }, // fullwidth 's'
+ { 0xff54, NULL, "t" }, // fullwidth 't'
+ { 0xff55, NULL, "u" }, // fullwidth 'u'
+ { 0xff56, NULL, "v" }, // fullwidth 'v'
+ { 0xff57, NULL, "w" }, // fullwidth 'w'
+ { 0xff58, NULL, "x" }, // fullwidth 'x'
+ { 0xff59, NULL, "y" }, // fullwidth 'y'
+ { 0xff5a, NULL, "z" }, // fullwidth 'z'
+ { 0xff5b, NULL, "{" }, // fullwidth left brace
+ { 0xff5c, NULL, "|" }, // fullwidth vertical bar
+ { 0xff5d, NULL, "}" }, // fullwidth right brace
+ { 0xff5e, NULL, "~" }, // fullwidth tilde
+ { 0xff5f, NULL, "((" }, // fullwidth double left parenthesis
+ { 0xff60, NULL, "))" }, // fullwidth double right parenthesis
+ { 0xffe0, NULL, "\xC2\xA2" }, // fullwidth cent sign
+ { 0xffe1, NULL, "\xC2\xA3" }, // fullwidth pound sign
+ { 0xffe4, NULL, "\xC2\xA4" }, // fullwidth broken bar
+ { 0xffe5, NULL, "\xC2\xA5" }, // fullwidth yen sign
+ { 0xffe6, NULL, "\xE2\x82\xA9" }, // fullwidth won sign
+ { 0xffe9, NULL, "\xE2\x86\x90" }, // fullwidth left arrow
+ { 0xffea, NULL, "\xE2\x86\x91" }, // fullwidth up arrow
+ { 0xffeb, NULL, "\xE2\x86\x92" }, // fullwidth right arrow
+ { 0xffec, NULL, "\xE2\x86\x93" }, // fullwidth down arrow
+ { 0xffed, NULL, "\xE2\x96\xAA" }, // fullwidth solid box
+ { 0xffee, NULL, "\xE2\x97\xA6" }, // fullwidth open circle
+ { UCHAR_SHIFT_1, "Shift", NULL }, // Shift key
+ { UCHAR_SHIFT_2, "Ctrl", NULL }, // Ctrl key
+ { UCHAR_MAMEKEY(F1), "F1", NULL }, // F1 function key
+ { UCHAR_MAMEKEY(F2), "F2", NULL }, // F2 function key
+ { UCHAR_MAMEKEY(F3), "F3", NULL }, // F3 function key
+ { UCHAR_MAMEKEY(F4), "F4", NULL }, // F4 function key
+ { UCHAR_MAMEKEY(F5), "F5", NULL }, // F5 function key
+ { UCHAR_MAMEKEY(F6), "F6", NULL }, // F6 function key
+ { UCHAR_MAMEKEY(F7), "F7", NULL }, // F7 function key
+ { UCHAR_MAMEKEY(F8), "F8", NULL }, // F8 function key
+ { UCHAR_MAMEKEY(F9), "F9", NULL }, // F9 function key
+ { UCHAR_MAMEKEY(F10), "F10", NULL }, // F10 function key
+ { UCHAR_MAMEKEY(F11), "F11", NULL }, // F11 function key
+ { UCHAR_MAMEKEY(F12), "F12", NULL }, // F12 function key
+ { UCHAR_MAMEKEY(F13), "F13", NULL }, // F13 function key
+ { UCHAR_MAMEKEY(F14), "F14", NULL }, // F14 function key
+ { UCHAR_MAMEKEY(F15), "F15", NULL }, // F15 function key
+ { UCHAR_MAMEKEY(ESC), "Esc", "\033" }, // Esc key
+ { UCHAR_MAMEKEY(INSERT), "Insert", NULL }, // Insert key
+ { UCHAR_MAMEKEY(DEL), "Delete", "\010" }, // Delete key
+ { UCHAR_MAMEKEY(HOME), "Home", "\014" }, // Home key
+ { UCHAR_MAMEKEY(END), "End", NULL }, // End key
+ { UCHAR_MAMEKEY(PGUP), "Page Up", NULL }, // Page Up key
+ { UCHAR_MAMEKEY(PGDN), "Page Down", NULL }, // Page Down key
+ { UCHAR_MAMEKEY(LEFT), "Cursor Left", NULL }, // Cursor Left
+ { UCHAR_MAMEKEY(RIGHT), "Cursor Right", NULL }, // Cursor Right
+ { UCHAR_MAMEKEY(UP), "Cursor Up", NULL }, // Cursor Up
+ { UCHAR_MAMEKEY(DOWN), "Cursor Down", NULL }, // Cursor Down
+ { UCHAR_MAMEKEY(0_PAD), "Keypad 0", NULL }, // 0 on the numeric keypad
+ { UCHAR_MAMEKEY(1_PAD), "Keypad 1", NULL }, // 1 on the numeric keypad
+ { UCHAR_MAMEKEY(2_PAD), "Keypad 2", NULL }, // 2 on the numeric keypad
+ { UCHAR_MAMEKEY(3_PAD), "Keypad 3", NULL }, // 3 on the numeric keypad
+ { UCHAR_MAMEKEY(4_PAD), "Keypad 4", NULL }, // 4 on the numeric keypad
+ { UCHAR_MAMEKEY(5_PAD), "Keypad 5", NULL }, // 5 on the numeric keypad
+ { UCHAR_MAMEKEY(6_PAD), "Keypad 6", NULL }, // 6 on the numeric keypad
+ { UCHAR_MAMEKEY(7_PAD), "Keypad 7", NULL }, // 7 on the numeric keypad
+ { UCHAR_MAMEKEY(8_PAD), "Keypad 8", NULL }, // 8 on the numeric keypad
+ { UCHAR_MAMEKEY(9_PAD), "Keypad 9", NULL }, // 9 on the numeric keypad
+ { UCHAR_MAMEKEY(SLASH_PAD), "Keypad /", NULL }, // / on the numeric keypad
+ { UCHAR_MAMEKEY(ASTERISK), "Keypad *", NULL }, // * on the numeric keypad
+ { UCHAR_MAMEKEY(MINUS_PAD), "Keypad -", NULL }, // - on the numeric Keypad
+ { UCHAR_MAMEKEY(PLUS_PAD), "Keypad +", NULL }, // + on the numeric Keypad
+ { UCHAR_MAMEKEY(DEL_PAD), "Keypad .", NULL }, // . on the numeric keypad
+ { UCHAR_MAMEKEY(ENTER_PAD), "Keypad Enter", NULL }, // Enter on the numeric keypad
+ { UCHAR_MAMEKEY(PRTSCR), "Print Screen", NULL }, // Print Screen key
+ { UCHAR_MAMEKEY(PAUSE), "Pause", NULL }, // Pause key
+ { UCHAR_MAMEKEY(LSHIFT), "Left Shift", NULL }, // Left Shift key
+ { UCHAR_MAMEKEY(RSHIFT), "Right Shift", NULL }, // Right Shift key
+ { UCHAR_MAMEKEY(LCONTROL), "Left Ctrl", NULL }, // Left Control key
+ { UCHAR_MAMEKEY(RCONTROL), "Right Ctrl", NULL }, // Right Control key
+ { UCHAR_MAMEKEY(LALT), "Left Alt", NULL }, // Left Alt key
+ { UCHAR_MAMEKEY(RALT), "Right Alt", NULL }, // Right Alt key
+ { UCHAR_MAMEKEY(SCRLOCK), "Scroll Lock", NULL }, // Scroll Lock key
+ { UCHAR_MAMEKEY(NUMLOCK), "Num Lock", NULL }, // Num Lock key
+ { UCHAR_MAMEKEY(CAPSLOCK), "Caps Lock", NULL }, // Caps Lock key
+ { UCHAR_MAMEKEY(LWIN), "Left Win", NULL }, // Left Win key
+ { UCHAR_MAMEKEY(RWIN), "Right Win", NULL }, // Right Win key
+ { UCHAR_MAMEKEY(MENU), "Menu", NULL }, // Menu key
+ { UCHAR_MAMEKEY(CANCEL), "Break", NULL } // Break/Pause key
};
-static TIMER_CALLBACK(inputx_timerproc);
-/* Debugging commands and handlers. */
-static void execute_input(running_machine &machine, int ref, int params, const char *param[]);
-static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[]);
-
-/***************************************************************************
- COMMON SHARED STRINGS
-***************************************************************************/
+//**************************************************************************
+// COMMON SHARED STRINGS
+//**************************************************************************
static const struct
{
@@ -686,2526 +782,2331 @@ static const struct
-/***************************************************************************
- BUILT-IN CORE MAPPINGS
-***************************************************************************/
+//**************************************************************************
+// BUILT-IN CORE MAPPINGS
+//**************************************************************************
#include "inpttype.h"
-/***************************************************************************
- FUNCTION PROTOTYPES
-***************************************************************************/
-
-/* core system management */
-static void input_port_exit(running_machine &machine);
-
-/* port reading */
-static INT32 apply_analog_settings(INT32 current, analog_field_state *analog);
-
-/* initialization helpers */
-static void init_port_types(running_machine &machine);
-static void init_port_state(running_machine &machine);
-static void init_autoselect_devices(running_machine &machine, int type1, int type2, int type3, const char *option, const char *ananame);
-static device_field_info *init_field_device_info(const input_field_config *field,const char *device_name);
-static analog_field_state *init_field_analog_state(const input_field_config *field);
-
-/* once-per-frame updates */
-static void frame_update_callback(running_machine &machine);
-static void frame_update(running_machine &machine);
-static void frame_update_digital_joysticks(running_machine &machine);
-static void frame_update_analog_field(running_machine &machine, analog_field_state *analog);
-static int frame_get_digital_field_state(const input_field_config *field, int mouse_down);
-
-/* tokenization helpers */
-static int token_to_input_field_type(running_machine &machine, const char *string, int *player);
-static const char *input_field_type_to_token(running_machine &machine, int type, int player);
-static int token_to_seq_type(const char *string);
-
-/* settings load */
-static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
-static void load_remap_table(running_machine &machine, xml_data_node *parentnode);
-static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
-static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
-
-/* settings save */
-static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
-static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq &seq);
-static int save_this_input_field_type(int type);
-static void save_default_inputs(running_machine &machine, xml_data_node *parentnode);
-static void save_game_inputs(running_machine &machine, xml_data_node *parentnode);
-
-/* input playback */
-static time_t playback_init(running_machine &machine);
-static void playback_end(running_machine &machine, const char *message);
-static void playback_frame(running_machine &machine, attotime curtime);
-static void playback_port(const input_port_config *port);
-
-/* input recording */
-static void record_init(running_machine &machine);
-static void record_end(running_machine &machine, const char *message);
-static void record_frame(running_machine &machine, attotime curtime);
-static void record_port(const input_port_config *port);
+//**************************************************************************
+// PORT CONFIGURATIONS
+//**************************************************************************
+//**************************************************************************
+// I/O PORT LIST
+//**************************************************************************
+//-------------------------------------------------
+// append - append the given device's input ports
+// to the current list
+//-------------------------------------------------
-/***************************************************************************
- INLINE FUNCTIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- apply_analog_min_max - clamp the given input
- value to the appropriate min/max for the
- analog control
--------------------------------------------------*/
-
-INLINE INT32 apply_analog_min_max(const analog_field_state *analog, INT32 value)
+void ioport_list::append(device_t &device, astring &errorbuf)
{
- /* take the analog minimum and maximum values and apply the inverse of the */
- /* sensitivity so that we can clamp against them before applying sensitivity */
- INT32 adjmin = APPLY_INVERSE_SENSITIVITY(analog->minimum, analog->sensitivity);
- INT32 adjmax = APPLY_INVERSE_SENSITIVITY(analog->maximum, analog->sensitivity);
+ // no constructor, no list
+ ioport_constructor constructor = device.input_ports();
+ if (constructor == NULL)
+ return;
- /* for absolute devices, clamp to the bounds absolutely */
- if (!analog->wraps)
- {
- if (value > adjmax)
- value = adjmax;
- else if (value < adjmin)
- value = adjmin;
- }
+ // reset error buffer
+ errorbuf.reset();
- /* for relative devices, wrap around when we go past the edge */
- else
- {
- INT32 range = adjmax - adjmin;
- /* rolls to other end when 1 position past end. */
- value = (value - adjmin) % range;
- if (value < 0)
- value += range;
- value += adjmin;
- }
+ // detokenize into the list
+ (*constructor)(device, *this, errorbuf);
- return value;
+ // collapse fields and sort the list
+ for (ioport_port *port = first(); port != NULL; port = port->next())
+ port->collapse_fields(errorbuf);
}
-/*-------------------------------------------------
- get_port_tag - return a guaranteed tag for
- a port
--------------------------------------------------*/
-
-INLINE const char *get_port_tag(const input_port_config *port, char *tempbuffer)
-{
- return port->tag();
-}
+//**************************************************************************
+// INPUT TYPE ENTRY
+//**************************************************************************
-/*-------------------------------------------------
- condition_equal - TRUE if two conditions are
- equivalent
--------------------------------------------------*/
+//-------------------------------------------------
+// input_type_entry - constructors
+//-------------------------------------------------
-INLINE int condition_equal(const input_condition *cond1, const input_condition *cond2)
+input_type_entry::input_type_entry(ioport_type type, ioport_group group, int player, const char *token, const char *name, input_seq standard)
+ : m_next(NULL),
+ m_type(type),
+ m_group(group),
+ m_player(player),
+ m_token(token),
+ m_name(name)
{
- return (cond1->mask == cond2->mask && cond1->value == cond2->value && cond1->condition == cond2->condition && strcmp(cond1->tag, cond2->tag) == 0);
-}
-
-
-
-/***************************************************************************
- CORE SYSTEM MANAGEMENT
-***************************************************************************/
-
-/*-------------------------------------------------
- input_port_init - initialize the input port
- system
--------------------------------------------------*/
-
-ioport_manager::ioport_manager(running_machine &machine)
- : safe_to_read(false),
- last_frame_time(attotime::zero),
- last_delta_nsec(0),
- record_file(NULL),
- playback_file(NULL),
- playback_accumulated_speed(0),
- playback_accumulated_frames(0),
- codes(NULL),
- inputx_timer(NULL),
- queue_chars(NULL),
- accept_char(NULL),
- charqueue_empty(NULL),
- current_rate(attotime::zero),
- m_machine(machine)
-{
- memset(type_to_entry, 0, sizeof(type_to_entry));
- memset(joystick_info, 0, sizeof(joystick_info));
+ m_defseq[SEQ_TYPE_STANDARD] = m_seq[SEQ_TYPE_STANDARD] = standard;
}
-time_t ioport_manager::initialize()
+input_type_entry::input_type_entry(ioport_type type, ioport_group group, int player, const char *token, const char *name, input_seq standard, input_seq decrement, input_seq increment)
+ : m_next(NULL),
+ m_type(type),
+ m_group(group),
+ m_player(player),
+ m_token(token),
+ m_name(name)
{
- /* add an exit callback and a frame callback */
- machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(input_port_exit), &machine()));
- machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(frame_update_callback), &machine()));
-
- /* initialize the default port info from the OSD */
- init_port_types(machine());
-
- /* if we have a token list, proceed */
- device_iterator iter(machine().root_device());
- for (device_t *device = iter.first(); device != NULL; device = iter.next())
- {
- astring errors;
- input_port_list_init(*device, m_portlist, errors);
- if (errors)
- mame_printf_error("Input port errors:\n%s", errors.cstr());
- }
-
- init_port_state(machine());
- /* register callbacks for when we load configurations */
- config_register(machine(), "input", config_saveload_delegate(FUNC(load_config_callback), &machine()), config_saveload_delegate(FUNC(save_config_callback), &machine()));
-
- /* open playback and record files if specified */
- time_t basetime = playback_init(machine());
- record_init(machine());
-
- return basetime;
+ m_defseq[SEQ_TYPE_STANDARD] = m_seq[SEQ_TYPE_STANDARD] = standard;
+ m_defseq[SEQ_TYPE_INCREMENT] = m_seq[SEQ_TYPE_INCREMENT] = increment;
+ m_defseq[SEQ_TYPE_DECREMENT] = m_seq[SEQ_TYPE_DECREMENT] = decrement;
}
-/*-------------------------------------------------
- input_port_exit - exit callback to ensure
- we clean up and close our files
--------------------------------------------------*/
+//-------------------------------------------------
+// configure_osd - set the token and name of an
+// OSD entry
+//-------------------------------------------------
-static void input_port_exit(running_machine &machine)
+void input_type_entry::configure_osd(const char *token, const char *name)
{
- /* close any playback or recording files */
- playback_end(machine, NULL);
- record_end(machine, NULL);
+ assert(m_type >= IPT_OSD_1 && m_type <= IPT_OSD_16);
+ m_token = token;
+ m_name = name;
}
+//**************************************************************************
+// DIGITAL JOYSTICKS
+//**************************************************************************
-/***************************************************************************
- PORT CONFIGURATIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- input_port_list_init - initialize an input
- port list structure and allocate ports
- according to the given tokens
--------------------------------------------------*/
+//-------------------------------------------------
+// digital_joystick - constructor
+//-------------------------------------------------
-void input_port_list_init(device_t &device, ioport_list &portlist, astring &errorbuf)
+digital_joystick::digital_joystick(int player, int number)
+ : m_player(player),
+ m_number(number),
+ m_current(0),
+ m_current4way(0),
+ m_previous(0)
{
- /* no constructor, no list */
- ioport_constructor constructor = device.input_ports();
- if (constructor == NULL)
- return;
+ memset(m_field, 0, sizeof(m_field));
+}
- /* reset error buffer */
- errorbuf.reset();
- /* detokenize into the list */
- (*constructor)(device, portlist, errorbuf);
+//-------------------------------------------------
+// set_axis - configure a single axis of a
+// digital joystick
+//-------------------------------------------------
- // collapse fields and sort the list
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
- port->collapse_fields(errorbuf);
+digital_joystick::direction_t digital_joystick::set_axis(ioport_field &field)
+{
+ direction_t direction = direction_t((field.type() - (IPT_DIGITAL_JOYSTICK_FIRST + 1)) % 4);
+ m_field[direction] = &field;
+ return direction;
}
-/*-------------------------------------------------
- input_field_by_tag_and_mask - return a pointer
- to the first field that intersects the given
- mask on the tagged port
--------------------------------------------------*/
+//-------------------------------------------------
+// frame_update - update the state of digital
+// joysticks prior to accumulating the results
+// in a port
+//-------------------------------------------------
-const input_field_config *input_field_by_tag_and_mask(running_machine &machine, const char *tag, input_port_value mask)
+void digital_joystick::frame_update()
{
- const input_port_config *port = machine.root_device().ioport(tag);
+ // remember previous state and reset current state
+ m_previous = m_current;
+ m_current = 0;
- /* if we got the port, look for the field */
- if (port != NULL)
- for (const input_field_config *field = port->first_field(); field != NULL; field = field->next())
- if ((field->mask & mask) != 0)
- return field;
+ // read all the associated ports
+ running_machine *machine = NULL;
+ for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; direction++)
+ if (m_field[direction] != NULL)
+ {
+ machine = &m_field[direction]->machine();
+ if (machine->input().seq_pressed(m_field[direction]->seq(SEQ_TYPE_STANDARD)))
+ m_current |= 1 << direction;
+ }
- return NULL;
+ // lock out opposing directions (left + right or up + down)
+ if ((m_current & (UP_BIT | DOWN_BIT)) == (UP_BIT | DOWN_BIT))
+ m_current &= ~(UP_BIT | DOWN_BIT);
+ if ((m_current & (LEFT_BIT | RIGHT_BIT)) == (LEFT_BIT | RIGHT_BIT))
+ m_current &= ~(LEFT_BIT | RIGHT_BIT);
+
+ // only update 4-way case if joystick has moved
+ if (m_current != m_previous)
+ {
+ m_current4way = m_current;
+
+ //
+ // If joystick is pointing at a diagonal, acknowledge that the player moved
+ // the joystick by favoring a direction change. This minimizes frustration
+ // when using a keyboard for input, and maximizes responsiveness.
+ //
+ // For example, if you are holding "left" then switch to "up" (where both left
+ // and up are briefly pressed at the same time), we'll transition immediately
+ // to "up."
+ //
+ // Zero any switches that didn't change from the previous to current state.
+ //
+ if ((m_current4way & (UP_BIT | DOWN_BIT)) &&
+ (m_current4way & (LEFT_BIT | RIGHT_BIT)))
+ {
+ m_current4way ^= m_current4way & m_previous;
+ }
+
+ //
+ // If we are still pointing at a diagonal, we are in an indeterminant state.
+ //
+ // This could happen if the player moved the joystick from the idle position directly
+ // to a diagonal, or from one diagonal directly to an extreme diagonal.
+ //
+ // The chances of this happening with a keyboard are slim, but we still need to
+ // constrain this case.
+ //
+ // For now, just resolve randomly.
+ //
+ if ((m_current4way & (UP_BIT | DOWN_BIT)) &&
+ (m_current4way & (LEFT_BIT | RIGHT_BIT)))
+ {
+ if (machine->rand() & 1)
+ m_current4way &= ~(LEFT_BIT | RIGHT_BIT);
+ else
+ m_current4way &= ~(UP_BIT | DOWN_BIT);
+ }
+ }
}
-/***************************************************************************
- ACCESSORS FOR INPUT FIELDS
-***************************************************************************/
+//**************************************************************************
+// NATURAL KEYBOARD
+//**************************************************************************
-/*-------------------------------------------------
- input_field_name - return the field name for
- a given input field
--------------------------------------------------*/
+//-------------------------------------------------
+// natural_keyboard - constructor
+//-------------------------------------------------
-const char *input_field_name(const input_field_config *field)
+natural_keyboard::natural_keyboard(running_machine &machine)
+ : m_machine(machine),
+ m_bufbegin(0),
+ m_bufend(0),
+ m_status_keydown(false),
+ m_last_cr(false),
+ m_timer(NULL),
+ m_current_rate(attotime::zero)
{
- /* if we have a non-default name, use that */
- if ((field->state != NULL) && (field->state->name != NULL))
- return field->state->name;
- if (field->name != NULL)
- return field->name;
+ // reigster debugger commands
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
+ {
+ debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
+ debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
+ }
- /* otherwise, return the name associated with the type */
- return input_type_name(field->machine(), field->type, field->player);
+ // posting keys directly only makes sense for a computer
+ if (machine.ioport().has_keyboard())
+ {
+ m_buffer.resize(KEY_BUFFER_SIZE);
+ m_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(natural_keyboard::timer), this));
+ build_codes(machine.ioport());
+ }
}
-/*-------------------------------------------------
- input_field_seq - return the input sequence
- for the given input field
--------------------------------------------------*/
+//-------------------------------------------------
+// configure - configure callbacks for full-
+// featured keyboard support
+//-------------------------------------------------
-const input_seq &input_field_seq(const input_field_config *field, input_seq_type seqtype)
+void natural_keyboard::configure(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty)
{
- /* if the field is disabled, return no key */
- if (field->flags & FIELD_FLAG_UNUSED)
- return input_seq::empty_seq;
-
- /* select either the live or config state depending on whether we have live state */
- const input_seq &portseq = (field->state == NULL) ? field->seq[seqtype] : field->state->seq[seqtype];
-
- /* if the portseq is the special default code, return the expanded default value */
- if (portseq.is_default())
- return input_type_seq(field->machine(), field->type, field->player, seqtype);
-
- /* otherwise, return the sequence as-is */
- return portseq;
+ // set the callbacks
+ m_queue_chars = queue_chars;
+ m_accept_char = accept_char;
+ m_charqueue_empty = charqueue_empty;
}
-/*-------------------------------------------------
- input_field_get_user_settings - return the current
- settings for the given input field
--------------------------------------------------*/
+//-------------------------------------------------
+// post - post a single character
+//-------------------------------------------------
-void input_field_get_user_settings(const input_field_config *field, input_field_user_settings *settings)
+void natural_keyboard::post(unicode_char ch)
{
- int seqtype;
-
- /* zap the entire structure */
- memset(settings, 0, sizeof(*settings));
-
- /* copy the basics */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
- settings->seq[seqtype] = field->state->seq[seqtype];
-
- /* if there's a list of settings or we're an adjuster, copy the current value */
- if (field->settinglist().count() != 0 || field->type == IPT_ADJUSTER)
- settings->value = field->state->value;
-
- /* if there's analog data, extract the analog settings */
- if (field->state->analog != NULL)
+ // ignore any \n that are preceded by \r
+ if (m_last_cr && ch == '\n')
{
- settings->sensitivity = field->state->analog->sensitivity;
- settings->delta = field->state->analog->delta;
- settings->centerdelta = field->state->analog->centerdelta;
- settings->reverse = field->state->analog->reverse;
+ m_last_cr = false;
+ return;
}
-}
+ // change all eolns to '\r'
+ if (ch == '\n')
+ ch = '\r';
+ else
+ m_last_cr = (ch == '\r');
-/*-------------------------------------------------
- input_field_set_user_settings - modify the current
- settings for the given input field
--------------------------------------------------*/
-
-void input_field_set_user_settings(const input_field_config *field, const input_field_user_settings *settings)
-{
- int seqtype;
-
- /* copy the basics */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
+ // logging
+ if (LOG_NATURAL_KEYBOARD)
{
- const input_seq &defseq = input_type_seq(field->machine(), field->type, field->player, (input_seq_type)seqtype);
- if (defseq == settings->seq[seqtype])
- field->state->seq[seqtype].set_default();
- else
- field->state->seq[seqtype] = settings->seq[seqtype];
+ const keycode_map_entry *code = find_code(ch);
+ astring tempstr;
+ logerror("natural_keyboard::post(): code=%i (%s) field->name='%s'\n", int(ch), unicode_to_string(tempstr, ch), (code != NULL && code->field[0] != NULL) ? code->field[0]->name() : "<null>");
}
- /* if there's a list of settings or we're an adjuster, copy the current value */
- if (field->settinglist().count() != 0 || field->type == IPT_ADJUSTER)
- field->state->value = settings->value;
+ // can we post this key in the queue directly?
+ if (can_post_directly(ch))
+ internal_post(ch);
- /* if there's analog data, extract the analog settings */
- if (field->state->analog != NULL)
+ // can we post this key with an alternate representation?
+ else if (can_post_alternate(ch))
{
- field->state->analog->sensitivity = settings->sensitivity;
- field->state->analog->delta = settings->delta;
- field->state->analog->centerdelta = settings->centerdelta;
- field->state->analog->reverse = settings->reverse;
+ const char_info *info = char_info::find(ch);
+ assert(info != NULL && info->alternate != NULL);
+ const char *altstring = info->alternate;
+ while (*altstring != 0)
+ {
+ altstring += uchar_from_utf8(&ch, altstring, strlen(altstring));
+ internal_post(ch);
+ }
}
}
-/*-------------------------------------------------
- input_field_setting_name - return the expanded
- setting name for a field
--------------------------------------------------*/
+//-------------------------------------------------
+// post - post a unicode encoded string
+//-------------------------------------------------
-const char *input_field_setting_name(const input_field_config *field)
+void natural_keyboard::post(const unicode_char *text, size_t length, attotime rate)
{
- const input_setting_config *setting;
-
- /* only makes sense if we have settings */
- assert(field->settinglist().count() != 0);
+ // set the fixed rate
+ m_current_rate = rate;
+
+ // 0 length means strlen
+ if (length == 0)
+ for (const unicode_char *scan = text; *scan != 0; scan++)
+ length++;
- /* scan the list of settings looking for a match on the current value */
- for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
- if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
- if (setting->value == field->state->value)
- return setting->name;
-
- return "INVALID";
+ // iterate over characters or until the buffer is full up
+ while (length > 0 && !full())
+ {
+ // fetch next character
+ post(*text++);
+ length--;
+ }
}
-/*-------------------------------------------------
- input_field_has_previous_setting - return TRUE
- if the given field has a "previous" setting
--------------------------------------------------*/
+//-------------------------------------------------
+// post_utf8 - post a UTF-8 encoded string
+//-------------------------------------------------
-int input_field_has_previous_setting(const input_field_config *field)
+void natural_keyboard::post_utf8(const char *text, size_t length, attotime rate)
{
- const input_setting_config *setting;
-
- /* only makes sense if we have settings */
- assert(field->settinglist().count() != 0);
-
- /* scan the list of settings looking for a match on the current value */
- for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
- if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
- return (setting->value != field->state->value);
+ // set the fixed rate
+ m_current_rate = rate;
+
+ // 0-length means strlen
+ if (length == 0)
+ length = strlen(text);
- return FALSE;
+ // iterate until out of characters
+ while (length > 0)
+ {
+ // decode the next character
+ unicode_char uc;
+ int count = uchar_from_utf8(&uc, text, length);
+ if (count < 0)
+ {
+ count = 1;
+ uc = INVALID_CHAR;
+ }
+
+ // append to the buffer
+ post(uc);
+ text += count;
+ length -= count;
+ }
}
-/*-------------------------------------------------
- input_field_select_previous_setting - select
- the previous item for a DIP switch or
- configuration field
--------------------------------------------------*/
+//-------------------------------------------------
+// post_coded - post a coded string
+//-------------------------------------------------
-void input_field_select_previous_setting(const input_field_config *field)
+void natural_keyboard::post_coded(const char *text, size_t length, attotime rate)
{
- const input_setting_config *setting, *prevsetting;
- int found_match = FALSE;
+ static const struct
+ {
+ const char *key;
+ unicode_char code;
+ } codes[] =
+ {
+ { "BACKSPACE", 8 },
+ { "BS", 8 },
+ { "BKSP", 8 },
+ { "DEL", UCHAR_MAMEKEY(DEL) },
+ { "DELETE", UCHAR_MAMEKEY(DEL) },
+ { "END", UCHAR_MAMEKEY(END) },
+ { "ENTER", 13 },
+ { "ESC", '\033' },
+ { "HOME", UCHAR_MAMEKEY(HOME) },
+ { "INS", UCHAR_MAMEKEY(INSERT) },
+ { "INSERT", UCHAR_MAMEKEY(INSERT) },
+ { "PGDN", UCHAR_MAMEKEY(PGDN) },
+ { "PGUP", UCHAR_MAMEKEY(PGUP) },
+ { "SPACE", 32 },
+ { "TAB", 9 },
+ { "F1", UCHAR_MAMEKEY(F1) },
+ { "F2", UCHAR_MAMEKEY(F2) },
+ { "F3", UCHAR_MAMEKEY(F3) },
+ { "F4", UCHAR_MAMEKEY(F4) },
+ { "F5", UCHAR_MAMEKEY(F5) },
+ { "F6", UCHAR_MAMEKEY(F6) },
+ { "F7", UCHAR_MAMEKEY(F7) },
+ { "F8", UCHAR_MAMEKEY(F8) },
+ { "F9", UCHAR_MAMEKEY(F9) },
+ { "F10", UCHAR_MAMEKEY(F10) },
+ { "F11", UCHAR_MAMEKEY(F11) },
+ { "F12", UCHAR_MAMEKEY(F12) },
+ { "QUOTE", '\"' }
+ };
- /* only makes sense if we have settings */
- assert(field->settinglist().count() != 0);
+ // set the fixed rate
+ m_current_rate = rate;
+
+ // 0-length means strlen
+ if (length == 0)
+ length = strlen(text);
- /* scan the list of settings looking for a match on the current value */
- prevsetting = NULL;
- for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
- if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
- {
- if (setting->value == field->state->value)
+ // iterate through the source string
+ size_t curpos = 0;
+ while (curpos < length)
+ {
+ // extract next character
+ unicode_char ch = text[curpos];
+ size_t increment = 1;
+
+ // look for escape characters
+ if (ch == '{')
+ for (int codenum = 0; codenum < ARRAY_LENGTH(codes); codenum++)
{
- found_match = TRUE;
- if (prevsetting != NULL)
- break;
+ size_t keylen = strlen(codes[codenum].key);
+ if (curpos + keylen + 2 <= length)
+ if (core_strnicmp(codes[codenum].key, &text[curpos + 1], keylen) == 0 && text[curpos + keylen + 1] == '}')
+ {
+ ch = codes[codenum].code;
+ increment = keylen + 2;
+ }
}
- prevsetting = setting;
- }
- /* if we didn't find a matching value, select the first */
- if (!found_match)
- {
- for (prevsetting = field->settinglist().first(); prevsetting != NULL; prevsetting = prevsetting->next())
- if (input_condition_true(field->machine(), &prevsetting->condition, field->port().owner()))
- break;
+ // if we got a code, post it
+ if (ch != 0)
+ post(ch);
+ curpos += increment;
}
-
- /* update the value to the previous one */
- if (prevsetting != NULL)
- field->state->value = prevsetting->value;
}
-/*-------------------------------------------------
- input_field_has_next_setting - return TRUE
- if the given field has a "next" setting
--------------------------------------------------*/
+//-------------------------------------------------
+// build_codes - given an input port table, create
+// an input code table useful for mapping unicode
+// chars
+//-------------------------------------------------
-int input_field_has_next_setting(const input_field_config *field)
+void natural_keyboard::build_codes(ioport_manager &manager)
{
- const input_setting_config *setting;
- int found = FALSE;
+ // iterate over shift keys
+ ioport_field *shift[UCHAR_SHIFT_END + 1 - UCHAR_SHIFT_BEGIN] = { 0 };
+ for (int curshift = 0; curshift <= ARRAY_LENGTH(shift); curshift++)
+ if (curshift == 0 || shift[curshift - 1] != NULL)
- /* only makes sense if we have settings */
- assert(field->settinglist().count() != 0);
+ // iterate over ports and fields
+ for (ioport_port *port = manager.first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->type() == IPT_KEYBOARD)
+ {
+ // fetch the code, ignoring 0
+ unicode_char code = field->keyboard_code(curshift);
+ if (code == 0)
+ continue;
- /* scan the list of settings looking for a match on the current value */
- for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
- if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
- {
- if (found)
- return TRUE;
- if (setting->value == field->state->value)
- found = TRUE;
- }
+ // is this a shifter key?
+ if (code >= UCHAR_SHIFT_BEGIN && code <= UCHAR_SHIFT_END)
+ shift[code - UCHAR_SHIFT_BEGIN] = field;
- return FALSE;
+ // not a shifter key; record normally
+ else
+ {
+ keycode_map_entry newcode;
+ if (curshift == 0)
+ newcode.field[0] = field;
+ else
+ {
+ newcode.field[0] = shift[curshift - 1];
+ newcode.field[1] = field;
+ }
+ newcode.ch = code;
+ m_keycode_map.append(newcode);
+
+ if (LOG_NATURAL_KEYBOARD)
+ {
+ astring tempstr;
+ logerror("natural_keyboard: code=%i (%s) port=%p field->name='%s'\n", int(code), unicode_to_string(tempstr, code), port, field->name());
+ }
+ }
+ }
}
-/*-------------------------------------------------
- input_field_select_next_setting - select the
- next item for a DIP switch or
- configuration field
--------------------------------------------------*/
+//-------------------------------------------------
+// can_post_directly - determine if the given
+// unicode character can be directly posted
+//-------------------------------------------------
-void input_field_select_next_setting(const input_field_config *field)
+bool natural_keyboard::can_post_directly(unicode_char ch)
{
- const input_setting_config *setting, *nextsetting;
+ // if we have a queueing callback, then it depends on whether we can accept the character
+ if (!m_queue_chars.isnull())
+ return m_accept_char.isnull() ? true : m_accept_char(ch);
- /* only makes sense if we have settings */
- assert(field->settinglist().count() != 0);
+ // otherwise, it depends on the input codes
+ const keycode_map_entry *code = find_code(ch);
+ return (code != NULL && code->field[0] != NULL);
+}
- /* scan the list of settings looking for a match on the current value */
- nextsetting = NULL;
- for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
- if (input_condition_true(field->machine(), &setting->condition, field->port().owner()))
- if (setting->value == field->state->value)
- break;
- /* if we found one, scan forward for the next valid one */
- if (setting != NULL)
- for (nextsetting = setting->next(); nextsetting != NULL; nextsetting = nextsetting->next())
- if (input_condition_true(field->machine(), &nextsetting->condition, field->port().owner()))
- break;
+//-------------------------------------------------
+// can_post_alternate - determine if the given
+// unicode character can be posted via translation
+//-------------------------------------------------
- /* if we hit the end, search from the beginning */
- if (nextsetting == NULL)
- for (nextsetting = field->settinglist().first(); nextsetting != NULL; nextsetting = nextsetting->next())
- if (input_condition_true(field->machine(), &nextsetting->condition, field->port().owner()))
- break;
+bool natural_keyboard::can_post_alternate(unicode_char ch)
+{
+ const char_info *info = char_info::find(ch);
+ if (info == NULL)
+ return false;
+
+ const char *altstring = info->alternate;
+ if (altstring == NULL)
+ return false;
- /* update the value to the previous one */
- if (nextsetting != NULL)
- field->state->value = nextsetting->value;
+ while (*altstring != 0)
+ {
+ unicode_char uchar;
+ int count = uchar_from_utf8(&uchar, altstring, strlen(altstring));
+ if (count <= 0)
+ return false;
+ if (!can_post_directly(uchar))
+ return false;
+ altstring += count;
+ }
+ return true;
}
+//-------------------------------------------------
+// choose_delay - determine the delay between
+// posting keyboard events
+//-------------------------------------------------
-/***************************************************************************
- ACCESSORS FOR INPUT TYPES
-***************************************************************************/
+attotime natural_keyboard::choose_delay(unicode_char ch)
+{
+ // if we have a live rate, just use that
+ if (m_current_rate != attotime::zero)
+ return m_current_rate;
-/*-------------------------------------------------
- input_type_is_analog - return TRUE if
- the given type represents an analog control
--------------------------------------------------*/
+ // systems with queue_chars can afford a much smaller delay
+ if (!m_queue_chars.isnull())
+ return attotime::from_msec(10);
-int input_type_is_analog(int type)
-{
- return (type >= __ipt_analog_start && type <= __ipt_analog_end);
+ // otherwise, default to constant delay with a longer delay on CR
+ return attotime::from_msec((ch == '\r') ? 200 : 50);
}
-/*-------------------------------------------------
- input_type_name - return the name
- for the given type/player
--------------------------------------------------*/
+//-------------------------------------------------
+// internal_post - post a keyboard event
+//-------------------------------------------------
-const char *input_type_name(running_machine &machine, int type, int player)
+void natural_keyboard::internal_post(unicode_char ch)
{
- /* if we have a machine, use the live state and quick lookup */
- ioport_manager &portdata = machine.ioport();
- input_type_entry *entry = portdata.type_to_entry[type][player];
- if (entry != NULL)
- return entry->name;
+ // need to start up the timer?
+ if (empty())
+ {
+ m_timer->adjust(choose_delay(ch));
+ m_status_keydown = 0;
+ }
- /* if we find nothing, return an invalid group */
- return "???";
+ // add to the buffer, resizing if necessary
+ m_buffer[m_bufend++] = ch;
+ if ((m_bufend + 1) % m_buffer.count() == m_bufbegin)
+ m_buffer.resize(m_buffer.count() + KEY_BUFFER_SIZE, true);
+ m_bufend %= m_buffer.count();
}
-/*-------------------------------------------------
- input_type_group - return the group
- for the given type/player
--------------------------------------------------*/
+//-------------------------------------------------
+// timer - timer callback to keep things flowing
+// when posting a string of characters
+//-------------------------------------------------
-int input_type_group(running_machine &machine, int type, int player)
+void natural_keyboard::timer(void *ptr, int param)
{
- ioport_manager &portdata = machine.ioport();
- input_type_entry *entry = portdata.type_to_entry[type][player];
- if (entry != NULL)
- return entry->group;
+ // the driver has a queue_chars handler
+ if (!m_queue_chars.isnull())
+ {
+ while (!empty() && m_queue_chars(&m_buffer[m_bufbegin], 1))
+ {
+ m_bufbegin = (m_bufbegin + 1) % m_buffer.count();
+ if (m_current_rate != attotime::zero)
+ break;
+ }
+ }
- /* if we find nothing, return an invalid group */
- return IPG_INVALID;
+ // the driver does not have a queue_chars handler
+ else
+ {
+ if (m_status_keydown)
+ m_bufbegin = (m_bufbegin + 1) % m_buffer.count();
+ m_status_keydown = !m_status_keydown;
+ }
+
+ // need to make sure timerproc is called again if buffer not empty
+ if (!empty())
+ m_timer->adjust(choose_delay(m_buffer[m_bufbegin]));
}
-/*-------------------------------------------------
- input_type_seq - return the input
- sequence for the given type/player
--------------------------------------------------*/
+//-------------------------------------------------
+// unicode_to_string - obtain a string
+// representation of a given code; used for
+// logging and debugging
+//-------------------------------------------------
-const input_seq &input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype)
+const char *natural_keyboard::unicode_to_string(astring &buffer, unicode_char ch)
{
- assert(type >= 0 && type < __ipt_max);
- assert(player >= 0 && player < MAX_PLAYERS);
+ buffer.reset();
+ switch (ch)
+ {
+ // check some magic values
+ case '\0': buffer.cpy("\\0"); break;
+ case '\r': buffer.cpy("\\r"); break;
+ case '\n': buffer.cpy("\\n"); break;
+ case '\t': buffer.cpy("\\t"); break;
- /* if we have a machine, use the live state and quick lookup */
- ioport_manager &portdata = machine.ioport();
- input_type_entry *entry = portdata.type_to_entry[type][player];
- if (entry != NULL)
- return entry->seq[seqtype];
+ default:
+ // seven bit ASCII is easy
+ if (ch >= 32 && ch < 128)
+ {
+ char temp[2] = { char(ch), 0 };
+ buffer.cpy(temp);
+ }
+ else if (ch >= UCHAR_MAMEKEY_BEGIN)
+ {
+ // try to obtain a codename with code_name(); this can result in an empty string
+ input_code code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(ch - UCHAR_MAMEKEY_BEGIN));
+ machine().input().code_name(buffer, code);
+ }
- /* if we find nothing, return an empty sequence */
- return input_seq::empty_seq;
+ // did we fail to resolve? if so, we have a last resort
+ if (buffer.len() == 0)
+ buffer.format("U+%04X", unsigned(ch));
+ break;
+ }
+ return buffer;
}
-/*-------------------------------------------------
- input_type_set_seq - change the input
- sequence for the given type/player
--------------------------------------------------*/
+//-------------------------------------------------
+// find_code - find a code in our lookup table
+//-------------------------------------------------
-void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq)
+const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(unicode_char ch) const
{
- ioport_manager &portdata = machine.ioport();
- input_type_entry *entry = portdata.type_to_entry[type][player];
- if (entry != NULL)
- entry->seq[seqtype] = *newseq;
+ for (int code = 0; m_keycode_map[code].ch != 0; code++)
+ if (m_keycode_map[code].ch == ch)
+ return &m_keycode_map[code];
+ return NULL;
}
-/*-------------------------------------------------
- input_type_pressed - return TRUE if
- the sequence for the given input type/player
- is pressed
--------------------------------------------------*/
+//-------------------------------------------------
+// frame_update - once per frame update of the
+// natural keyboard state
+//-------------------------------------------------
-int input_type_pressed(running_machine &machine, int type, int player)
+void natural_keyboard::frame_update(ioport_port &port, ioport_value &digital)
{
- return machine.input().seq_pressed(input_type_seq(machine, type, player, SEQ_TYPE_STANDARD));
+ // is there currently a key down?
+ if (m_status_keydown && !empty())
+ {
+ // loop through this character's component codes
+ const keycode_map_entry *code = find_code(m_buffer[m_bufbegin]);
+ if (code != NULL)
+ for (int fieldnum = 0; fieldnum < ARRAY_LENGTH(code->field) && code->field[fieldnum] != NULL; fieldnum++)
+ if (&code->field[fieldnum]->port() == &port)
+ digital |= code->field[fieldnum]->mask();
+ }
}
-/*-------------------------------------------------
- input_type_list - return the list of types
--------------------------------------------------*/
+//-------------------------------------------------
+// key_name - returns the name of a specific key
+//-------------------------------------------------
-const simple_list<input_type_entry> &input_type_list(running_machine &machine)
+const char *natural_keyboard::key_name(astring &string, unicode_char ch)
{
- ioport_manager &portdata = machine.ioport();
- return portdata.typelist;
-}
-
+ // attempt to get the string from the character info table
+ const char_info *ci = char_info::find(ch);
+ const char *result = (ci != NULL) ? ci->name : NULL;
+ if (result != NULL)
+ string.cpy(result);
+ // if that doesn't work, convert to UTF-8
+ else if (ch > 0x7F || isprint(ch))
+ {
+ char buf[10];
+ int count = utf8_from_uchar(buf, ARRAY_LENGTH(buf), ch);
+ buf[count] = 0;
+ string.cpy(buf);
+ }
-/***************************************************************************
- PORT CHECKING
-***************************************************************************/
-
-
-/*-------------------------------------------------
- input_port_exists - return whether an input
- port exists
--------------------------------------------------*/
-
-bool input_port_exists(running_machine &machine, const char *tag)
-{
- return machine.root_device().ioport(tag) != 0;
+ // otherwise, opt for question marks
+ else
+ string.cpy("???");
+ return string;
}
-/*-------------------------------------------------
- input_port_active - return a bitmask of which
- bits of an input port are active (i.e. not
- unused or unknown)
--------------------------------------------------*/
+//-------------------------------------------------
+// execute_input - debugger command to enter
+// natural keyboard input
+//-------------------------------------------------
-input_port_value input_port_active(running_machine &machine, const char *tag)
+void natural_keyboard::execute_input(running_machine &machine, int ref, int params, const char *param[])
{
- const input_port_config *port = machine.root_device().ioport(tag);
- if (port == NULL)
- fatalerror("Unable to locate input port '%s'", tag);
- return port->active;
+ machine.ioport().natkeyboard().post_coded(param[0]);
}
-/*-------------------------------------------------
- input_port_active_safe - return a bitmask of
- which bits of an input port are active (i.e.
- not unused or unknown), or a default value if
- the port does not exist
--------------------------------------------------*/
+//-------------------------------------------------
+// execute_dumpkbd - debugger command to natural
+// keyboard codes
+//-------------------------------------------------
-input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue)
+void natural_keyboard::execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[])
{
- const input_port_config *port = machine.root_device().ioport(tag);
- return port == NULL ? defvalue : port->active;
-}
+ // was there a file specified?
+ const char *filename = (params > 0) ? param[0] : NULL;
+ FILE *file = NULL;
+ if (filename != NULL)
+ {
+ // if so, open it
+ file = fopen(filename, "w");
+ if (file == NULL)
+ {
+ debug_console_printf(machine, "Cannot open \"%s\"\n", filename);
+ return;
+ }
+ }
+
+ // loop through all codes
+ natural_keyboard &natkeyboard = machine.ioport().natkeyboard();
+ dynamic_array<keycode_map_entry> &keycode_map = natkeyboard.m_keycode_map;
+ astring buffer, tempstr;
+ const size_t left_column_width = 24;
+ for (int index = 0; index < keycode_map.count(); index++)
+ {
+ // describe the character code
+ const keycode_map_entry &code = keycode_map[index];
+ buffer.printf("%08X (%s) ", code.ch, natkeyboard.unicode_to_string(tempstr, code.ch));
+ // pad with spaces
+ while (buffer.len() < left_column_width)
+ buffer.cat(' ');
+ // identify the keys used
+ for (int field = 0; field < ARRAY_LENGTH(code.field) && code.field[field] != 0; field++)
+ buffer.catprintf("%s'%s'", (field > 0) ? ", " : "", code.field[field]->name());
-/***************************************************************************
- PORT READING
-***************************************************************************/
+ // and output it as appropriate
+ if (file != NULL)
+ fprintf(file, "%s\n", buffer.cstr());
+ else
+ debug_console_printf(machine, "%s\n", buffer.cstr());
+ }
-/*-------------------------------------------------
- input_port_read_direct - return the value of
- an input port
--------------------------------------------------*/
+ // cleanup
+ if (file != NULL)
+ fclose(file);
+}
-input_port_value input_port_read_direct(const input_port_config *port)
-{
- assert(port != NULL);
- ioport_manager &portdata = port->machine().ioport();
- analog_field_state *analog;
- device_field_info *device_field;
- input_port_value result;
- assert_always(portdata.safe_to_read, "Input ports cannot be read at init time!");
+//**************************************************************************
+// I/O PORT CONDITION
+//**************************************************************************
- /* start with the digital */
- result = port->state->digital;
+//-------------------------------------------------
+// eval - evaluate condition
+//-------------------------------------------------
- /* update read values */
- for (device_field = port->state->readdevicelist; device_field != NULL; device_field = device_field->next)
- if (input_condition_true(port->machine(), &device_field->field->condition, port->owner()))
- {
- /* replace the bits with bits from the device */
- input_port_value newval = device_field->field->read(*device_field->field, device_field->field->read_param);
- device_field->oldval = newval;
- result = (result & ~device_field->field->mask) | ((newval << device_field->shift) & device_field->field->mask);
- }
+bool ioport_condition::eval(device_t &device) const
+{
+ // always condition is always true
+ if (m_condition == ALWAYS)
+ return true;
- /* update VBLANK bits */
- if (port->state->vblank != 0)
+ // otherwise, read the referenced port and switch off the condition type
+ ioport_value condvalue = device.ioport(m_tag)->read();
+ switch (m_condition)
{
- if (port->machine().primary_screen->vblank())
- result |= port->state->vblank;
- else
- result &= ~port->state->vblank;
+ case ALWAYS: return true;
+ case EQUALS: return ((condvalue & m_mask) == m_value);
+ case NOTEQUALS: return ((condvalue & m_mask) != m_value);
+ case GREATERTHAN: return ((condvalue & m_mask) > m_value);
+ case NOTGREATERTHAN: return ((condvalue & m_mask) <= m_value);
+ case LESSTHAN: return ((condvalue & m_mask) < m_value);
+ case NOTLESSTHAN: return ((condvalue & m_mask) >= m_value);
}
+ return true;
+}
- /* apply active high/low state to digital, read, and VBLANK inputs */
- result ^= port->state->defvalue;
-
- /* merge in analog portions */
- for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
- if (input_condition_true(port->machine(), &analog->field->condition, port->owner()))
- {
- /* start with the raw value */
- INT32 value = analog->accum;
- /* interpolate if appropriate and if time has passed since the last update */
- if (analog->interpolate && !(analog->field->flags & ANALOG_FLAG_RESET) && portdata.last_delta_nsec != 0)
- {
- attoseconds_t nsec_since_last = (port->machine().time() - portdata.last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
- value = analog->previous + ((INT64)(analog->accum - analog->previous) * nsec_since_last / portdata.last_delta_nsec);
- }
- /* apply standard analog settings */
- value = apply_analog_settings(value, analog);
+//**************************************************************************
+// I/O PORT SETTING
+//**************************************************************************
- /* remap the value if needed */
- if (analog->field->remap_table != NULL)
- value = analog->field->remap_table[value];
+//-------------------------------------------------
+// ioport_setting - constructor
+//-------------------------------------------------
- /* invert bits if needed */
- if (analog->field->flags & ANALOG_FLAG_INVERT)
- value = ~value;
+ioport_setting::ioport_setting(ioport_field &field, ioport_value _value, const char *_name)
+ : m_next(NULL),
+ m_field(field),
+ m_value(_value),
+ m_name(_name)
+{
+}
- /* insert into the port */
- result = (result & ~analog->field->mask) | ((value << analog->shift) & analog->field->mask);
- }
- return result;
-}
+//**************************************************************************
+// I/O PORT DIP LOCATION
+//**************************************************************************
-/*-------------------------------------------------
- input_port_read - return the value of
- an input port specified by tag
--------------------------------------------------*/
+//-------------------------------------------------
+// ioport_diplocation - constructor
+//-------------------------------------------------
-input_port_value input_port_read(running_machine &machine, const char *tag)
+ioport_diplocation::ioport_diplocation(const char *name, UINT8 swnum, bool invert)
+ : m_next(NULL),
+ m_name(name),
+ m_number(swnum),
+ m_invert(invert)
{
- const input_port_config *port = machine.root_device().ioport(tag);
- if (port == NULL)
- fatalerror("Unable to locate input port '%s'", tag);
- return input_port_read_direct(port);
}
-/*-------------------------------------------------
- input_port_read - return the value of
- a device input port specified by tag
--------------------------------------------------*/
-input_port_value input_port_read(device_t &device, const char *tag)
-{
- const input_port_config *port = device.ioport(tag);
- if (port == NULL)
- fatalerror("Unable to locate input port '%s'", tag);
- return input_port_read_direct(port);
+//**************************************************************************
+// I/O PORT FIELD
+//**************************************************************************
+
+//-------------------------------------------------
+// ioport_field - constructor
+//-------------------------------------------------
+
+ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value defvalue, ioport_value maskbits, const char *name)
+ : m_next(NULL),
+ m_port(port),
+ m_live(NULL),
+ m_modcount(port.modcount()),
+ m_mask(maskbits),
+ m_defvalue(defvalue & maskbits),
+ m_type(type),
+ m_player(0),
+ m_flags(0),
+ m_impulse(0),
+ m_name(name),
+ m_read_param(NULL),
+ m_write_param(NULL),
+ m_min(0),
+ m_max(maskbits),
+ m_sensitivity(0),
+ m_delta(0),
+ m_centerdelta(0),
+ m_crosshair_axis(CROSSHAIR_AXIS_NONE),
+ m_crosshair_scale(1.0),
+ m_crosshair_offset(0),
+ m_crosshair_altaxis(0),
+ m_full_turn_count(0),
+ m_remap_table(NULL),
+ m_way(0)
+{
+ // reset sequences and chars
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ m_seq[seqtype].set_default();
+ m_chars[0] = m_chars[1] = m_chars[2] = unicode_char(0);
+
+ // for DIP switches and configs, look for a default value from the owner
+ if (type == IPT_DIPSWITCH || type == IPT_CONFIG)
+ {
+ const input_device_default *def = device().input_ports_defaults();
+ if (def != NULL)
+ {
+ const char *fulltag = port.tag();
+ astring fullpath;
+ for ( ; def->tag != NULL; def++)
+ if (device().subtag(fullpath, def->tag) == fulltag && def->mask == m_mask)
+ m_defvalue = def->defvalue & m_mask;
+ }
+ }
}
-/*-------------------------------------------------
- input_port_read_safe - return the value of
- an input port specified by tag, or a default
- value if the port does not exist
--------------------------------------------------*/
+//-------------------------------------------------
+// ~ioport_field - destructor
+//-------------------------------------------------
-input_port_value input_port_read_safe(running_machine &machine, const char *tag, UINT32 defvalue)
+ioport_field::~ioport_field()
{
- const input_port_config *port = machine.root_device().ioport(tag);
- return (port == NULL) ? defvalue : input_port_read_direct(port);
+ global_free(m_live);
}
-/*-------------------------------------------------
- input_port_read_crosshair - return the
- extracted crosshair values for the given
- player
--------------------------------------------------*/
+//-------------------------------------------------
+// name - return the field name for a given input
+// field
+//-------------------------------------------------
-int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y)
+const char *ioport_field::name() const
{
- const input_port_config *port;
- const input_field_config *field;
- int gotx = FALSE, goty = FALSE;
+ // if we have a non-default name, use that
+ if (m_live != NULL && m_live->name)
+ return m_live->name;
+ if (m_name != NULL)
+ return m_name;
- /* read all the lightgun values */
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (field = port->first_field(); field != NULL; field = field->next())
- if (field->player == player && field->crossaxis != CROSSHAIR_AXIS_NONE)
- if (input_condition_true(machine, &field->condition, port->owner()))
- {
- analog_field_state *analog = field->state->analog;
- INT32 rawvalue = apply_analog_settings(analog->accum, analog) & (analog->field->mask >> analog->shift);
- float value = (float)(rawvalue - field->state->analog->adjmin) / (float)(field->state->analog->adjmax - field->state->analog->adjmin);
+ // otherwise, return the name associated with the type
+ return machine().ioport().type_name(m_type, m_player);
+}
- /* apply the scale and offset */
- if (field->crossscale < 0)
- value = -(1.0 - value) * field->crossscale;
- else
- value *= field->crossscale;
- value += field->crossoffset;
- /* apply custom mapping if necessary */
- if (!field->crossmapper.isnull())
- value = field->crossmapper(*field, value);
+//-------------------------------------------------
+// seq - return the input sequence for the given
+// input field
+//-------------------------------------------------
- /* handle X axis */
- if (field->crossaxis == CROSSHAIR_AXIS_X)
- {
- *x = value;
- gotx = TRUE;
- if (field->crossaltaxis != 0)
- {
- *y = field->crossaltaxis;
- goty = TRUE;
- }
- }
+const input_seq &ioport_field::seq(input_seq_type seqtype) const
+{
+ // if the field is disabled, return no key
+ if (m_flags & FIELD_FLAG_UNUSED)
+ return input_seq::empty_seq;
- /* handle Y axis */
- else
- {
- *y = value;
- goty = TRUE;
- if (field->crossaltaxis != 0)
- {
- *x = field->crossaltaxis;
- gotx = TRUE;
- }
- }
+ // select either the live or config state depending on whether we have live state
+ const input_seq &portseq = (m_live == NULL) ? m_seq[seqtype] : m_live->seq[seqtype];
- /* if we got both, stop */
- if (gotx && goty)
- break;
- }
+ // if the portseq is the special default code, return the expanded default value
+ if (portseq.is_default())
+ return machine().ioport().type_seq(m_type, m_player, seqtype);
- return (gotx && goty);
+ // otherwise, return the sequence as-is
+ return portseq;
}
-/*-------------------------------------------------
- input_port_update_defaults - force an update
- to the input port values based on current
- conditions
--------------------------------------------------*/
+//-------------------------------------------------
+// type_class - return the type class for this
+// field
+//-------------------------------------------------
-void input_port_update_defaults(running_machine &machine)
+ioport_type_class ioport_field::type_class() const
{
- int loopnum;
+ ioport_type_class result;
- /* two passes to catch conditionals properly */
- for (loopnum = 0; loopnum < 2; loopnum++)
+ switch (m_type)
{
- const input_port_config *port;
+ case IPT_JOYSTICK_UP:
+ case IPT_JOYSTICK_DOWN:
+ case IPT_JOYSTICK_LEFT:
+ case IPT_JOYSTICK_RIGHT:
+ case IPT_JOYSTICKLEFT_UP:
+ case IPT_JOYSTICKLEFT_DOWN:
+ case IPT_JOYSTICKLEFT_LEFT:
+ case IPT_JOYSTICKLEFT_RIGHT:
+ case IPT_JOYSTICKRIGHT_UP:
+ case IPT_JOYSTICKRIGHT_DOWN:
+ case IPT_JOYSTICKRIGHT_LEFT:
+ case IPT_JOYSTICKRIGHT_RIGHT:
+ case IPT_BUTTON1:
+ case IPT_BUTTON2:
+ case IPT_BUTTON3:
+ case IPT_BUTTON4:
+ case IPT_BUTTON5:
+ case IPT_BUTTON6:
+ case IPT_BUTTON7:
+ case IPT_BUTTON8:
+ case IPT_BUTTON9:
+ case IPT_BUTTON10:
+ case IPT_AD_STICK_X:
+ case IPT_AD_STICK_Y:
+ case IPT_AD_STICK_Z:
+ case IPT_TRACKBALL_X:
+ case IPT_TRACKBALL_Y:
+ case IPT_LIGHTGUN_X:
+ case IPT_LIGHTGUN_Y:
+ case IPT_MOUSE_X:
+ case IPT_MOUSE_Y:
+ case IPT_START:
+ case IPT_SELECT:
+ result = INPUT_CLASS_CONTROLLER;
+ break;
- /* loop over all input ports */
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- {
- const input_field_config *field;
+ case IPT_KEYPAD:
+ case IPT_KEYBOARD:
+ result = INPUT_CLASS_KEYBOARD;
+ break;
- /* only clear on the first pass */
- if (loopnum == 0)
- port->state->defvalue = 0;
+ case IPT_CONFIG:
+ result = INPUT_CLASS_CONFIG;
+ break;
- /* first compute the default value for the entire port */
- for (field = port->first_field(); field != NULL; field = field->next())
- if (input_condition_true(machine, &field->condition, port->owner()))
- port->state->defvalue = (port->state->defvalue & ~field->mask) | (field->state->value & field->mask);
- }
+ case IPT_DIPSWITCH:
+ result = INPUT_CLASS_DIPSWITCH;
+ break;
+
+ case 0:
+ if (m_name != NULL && m_name != (const char *)-1)
+ result = INPUT_CLASS_MISC;
+ else
+ result = INPUT_CLASS_INTERNAL;
+ break;
+
+ default:
+ result = INPUT_CLASS_INTERNAL;
+ break;
}
+ return result;
}
-/*-------------------------------------------------
- apply_analog_settings - return the value of
- an input port
--------------------------------------------------*/
+//-------------------------------------------------
+// keyboard_code - accesses a particular keyboard
+// code
+//-------------------------------------------------
-static INT32 apply_analog_settings(INT32 value, analog_field_state *analog)
+unicode_char ioport_field::keyboard_code(int which) const
{
- /* apply the min/max and then the sensitivity */
- value = apply_analog_min_max(analog, value);
- value = APPLY_SENSITIVITY(value, analog->sensitivity);
+ unicode_char ch = m_chars[which];
- /* apply reversal if needed */
- if (analog->reverse)
- value = analog->reverse_val - value;
- else if (analog->single_scale)
- /* it's a pedal or the default value is equal to min/max */
- /* so we need to adjust the center to the minimum */
- value -= INPUT_ABSOLUTE_MIN;
-
- /* map differently for positive and negative values */
- if (value >= 0)
- value = APPLY_SCALE(value, analog->scalepos);
- else
- value = APPLY_SCALE(value, analog->scaleneg);
- value += analog->adjdefvalue;
-
- return value;
+ // special hack to allow for PORT_CODE('\xA3')
+ if (ch >= 0xffffff80 && ch <= 0xffffffff)
+ ch &= 0xff;
+ return ch;
}
-/***************************************************************************
- PORT WRITING
-***************************************************************************/
-
-/*-------------------------------------------------
- input_port_write_direct - write a value
- to a port
--------------------------------------------------*/
+//-------------------------------------------------
+// get_user_settings - return the current
+// settings for the given input field
+//-------------------------------------------------
-void input_port_write_direct(const input_port_config *port, input_port_value data, input_port_value mem_mask)
+void ioport_field::get_user_settings(user_settings &settings)
{
- /* call device line write handlers */
- device_field_info *device_field;
+ // zap the entire structure
+ memset(&settings, 0, sizeof(settings));
- COMBINE_DATA(&port->state->outputvalue);
+ // copy the basics
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ settings.seq[seqtype] = m_live->seq[seqtype];
- for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
- if (device_field->field->type == IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition, port->owner()))
- {
- input_port_value newval = ( (port->state->outputvalue ^ device_field->field->defvalue ) & device_field->field->mask) >> device_field->shift;
-
- /* if the bits have write, call the handler */
- if (device_field->oldval != newval)
- {
- device_field->field->write(*device_field->field, device_field->field->write_param, device_field->oldval, newval);
+ // if there's a list of settings or we're an adjuster, copy the current value
+ if (first_setting() != NULL || m_type == IPT_ADJUSTER)
+ settings.value = m_live->value;
- device_field->oldval = newval;
- }
- }
+ // if there's analog data, extract the analog settings
+ if (m_live->analog != NULL)
+ {
+ settings.sensitivity = m_live->analog->sensitivity();
+ settings.delta = m_live->analog->delta();
+ settings.centerdelta = m_live->analog->centerdelta();
+ settings.reverse = m_live->analog->reverse();
+ }
}
-/*-------------------------------------------------
- input_port_write - write a value to a
- port specified by tag
--------------------------------------------------*/
+//-------------------------------------------------
+// set_user_settings - modify the current
+// settings for the given input field
+//-------------------------------------------------
-void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
+void ioport_field::set_user_settings(const user_settings &settings)
{
- const input_port_config *port = machine.root_device().ioport(tag);
- if (port == NULL)
- fatalerror("Unable to locate input port '%s'", tag);
- input_port_write_direct(port, value, mask);
-}
-
+ // copy the basics
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ {
+ const input_seq &defseq = manager().type_seq(m_type, m_player, input_seq_type(seqtype));
+ if (defseq == settings.seq[seqtype])
+ m_live->seq[seqtype].set_default();
+ else
+ m_live->seq[seqtype] = settings.seq[seqtype];
+ }
-/*-------------------------------------------------
- input_port_write_safe - write a value to
- a port, ignore if the port does not exist
--------------------------------------------------*/
+ // if there's a list of settings or we're an adjuster, copy the current value
+ if (first_setting() != NULL || m_type == IPT_ADJUSTER)
+ m_live->value = settings.value;
-void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
-{
- const input_port_config *port = machine.root_device().ioport(tag);
- if (port != NULL)
- input_port_write_direct(port, value, mask);
+ // if there's analog data, extract the analog settings
+ if (m_live->analog != NULL)
+ {
+ m_live->analog->m_sensitivity = settings.sensitivity;
+ m_live->analog->m_delta = settings.delta;
+ m_live->analog->m_centerdelta = settings.centerdelta;
+ m_live->analog->m_reverse = settings.reverse;
+ }
}
+//-------------------------------------------------
+// setting_name - return the expanded setting
+// name for a field
+//-------------------------------------------------
-/***************************************************************************
- MISC HELPER FUNCTIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- input_condition_true - return the TRUE
- if the given condition attached is true
--------------------------------------------------*/
-
-int input_condition_true(running_machine &machine, const input_condition *condition, device_t &owner)
+const char *ioport_field::setting_name() const
{
- input_port_value condvalue;
-
- /* always condition is always true */
- if (condition->condition == PORTCOND_ALWAYS)
- return TRUE;
+ // only makes sense if we have settings
+ assert(first_setting() != NULL);
- /* otherwise, read the referenced port */
- astring conditiontag;
- owner.subtag(conditiontag, condition->tag);
- condvalue = input_port_read(machine, conditiontag.cstr());
+ // scan the list of settings looking for a match on the current value
+ for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
+ if (setting->enabled())
+ if (setting->value() == m_live->value)
+ return setting->name();
- /* based on the condition encoded, determine truth */
- switch (condition->condition)
- {
- case PORTCOND_EQUALS:
- return ((condvalue & condition->mask) == condition->value);
+ return "INVALID";
+}
- case PORTCOND_NOTEQUALS:
- return ((condvalue & condition->mask) != condition->value);
- case PORTCOND_GREATERTHAN:
- return ((condvalue & condition->mask) > condition->value);
+//-------------------------------------------------
+// has_previous_setting - return true if the
+// given field has a "previous" setting
+//-------------------------------------------------
- case PORTCOND_NOTGREATERTHAN:
- return ((condvalue & condition->mask) <= condition->value);
+bool ioport_field::has_previous_setting() const
+{
+ // only makes sense if we have settings
+ assert(first_setting() != NULL);
- case PORTCOND_LESSTHAN:
- return ((condvalue & condition->mask) < condition->value);
+ // scan the list of settings looking for a match on the current value
+ for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
+ if (setting->enabled())
+ return (setting->value() != m_live->value);
- case PORTCOND_NOTLESSTHAN:
- return ((condvalue & condition->mask) >= condition->value);
- }
- return TRUE;
+ return false;
}
-/*-------------------------------------------------
- input_port_string_from_token - convert an
- input_port_token to a default string
--------------------------------------------------*/
+//-------------------------------------------------
+// select_previous_setting - select the previous
+// item for a DIP switch or configuration field
+//-------------------------------------------------
-const char *input_port_string_from_token(const char *string)
+void ioport_field::select_previous_setting()
{
- /* 0 is an invalid index */
- if (string == NULL)
- return NULL;
-
- /* if the index is greater than the count, assume it to be a pointer */
- if (FPTR(string) >= INPUT_STRING_COUNT)
- return string;
+ // only makes sense if we have settings
+ assert(first_setting() != NULL);
-#if FALSE // Set TRUE, If you want to take care missing-token or wrong-sorting
+ // scan the list of settings looking for a match on the current value
+ ioport_setting *prevsetting = NULL;
+ bool found_match = false;
+ for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
+ if (setting->enabled())
+ {
+ if (setting->value() == m_live->value)
+ {
+ found_match = true;
+ if (prevsetting != NULL)
+ break;
+ }
+ prevsetting = setting;
+ }
- /* otherwise, scan the list for a matching string and return it */
+ // if we didn't find a matching value, select the first
+ if (!found_match)
{
- int index;
- for (index = 0; index < ARRAY_LENGTH(input_port_default_strings); index++)
- if (input_port_default_strings[index].id == FPTR(string))
- return input_port_default_strings[index].string;
+ for (prevsetting = first_setting(); prevsetting != NULL; prevsetting = prevsetting->next())
+ if (prevsetting->enabled())
+ break;
}
- return "(Unknown Default)";
-
-#else
-
- return input_port_default_strings[FPTR(string)-1].string;
-#endif
+ // update the value to the previous one
+ if (prevsetting != NULL)
+ m_live->value = prevsetting->value();
}
+//-------------------------------------------------
+// has_next_setting - return true if the given
+// field has a "next" setting
+//-------------------------------------------------
-/***************************************************************************
- INITIALIZATION HELPERS
-***************************************************************************/
-
-/*-------------------------------------------------
- init_port_types - initialize the default
- type list
--------------------------------------------------*/
-
-static void init_port_types(running_machine &machine)
+bool ioport_field::has_next_setting() const
{
- ioport_manager &portdata = machine.ioport();
+ // only makes sense if we have settings
+ assert(first_setting() != NULL);
- /* convert the array into a list of type states that can be modified */
- construct_core_types(portdata.typelist);
-
- /* ask the OSD to customize the list */
- machine.osd().customize_input_type_list(portdata.typelist);
-
- /* now iterate over the OSD-modified types */
- for (input_type_entry *curtype = portdata.typelist.first(); curtype != NULL; curtype = curtype->next())
- {
- /* first copy all the OSD-updated sequences into our current state */
- for (int seqtype = 0; seqtype < ARRAY_LENGTH(curtype->seq); seqtype++)
- curtype->seq[seqtype] = curtype->defseq[seqtype];
+ // scan the list of settings looking for a match on the current value
+ bool found = false;
+ for (ioport_setting *setting = first_setting(); setting != NULL; setting = setting->next())
+ if (setting->enabled())
+ {
+ if (found)
+ return true;
+ if (setting->value() == m_live->value)
+ found = true;
+ }
- /* also make a lookup table mapping type/player to the appropriate type list entry */
- portdata.type_to_entry[curtype->type][curtype->player] = curtype;
- }
+ return false;
}
-/*-------------------------------------------------
- get_keyboard_code - accesses a particular
- keyboard code
--------------------------------------------------*/
+//-------------------------------------------------
+// select_next_setting - select the next item for
+// a DIP switch or configuration field
+//-------------------------------------------------
-static unicode_char get_keyboard_code(const input_field_config *field, int i)
+void ioport_field::select_next_setting()
{
- unicode_char ch = field->chars[i];
+ // only makes sense if we have settings
+ assert(first_setting() != NULL);
- /* special hack to allow for PORT_CODE('\xA3') */
- if ((ch >= 0xFFFFFF80) && (ch <= 0xFFFFFFFF))
- ch &= 0xFF;
- return ch;
-}
+ // scan the list of settings looking for a match on the current value
+ ioport_setting *nextsetting = NULL;
+ ioport_setting *setting;
+ for (setting = first_setting(); setting != NULL; setting = setting->next())
+ if (setting->enabled())
+ if (setting->value() == m_live->value)
+ break;
+ // if we found one, scan forward for the next valid one
+ if (setting != NULL)
+ for (nextsetting = setting->next(); nextsetting != NULL; nextsetting = nextsetting->next())
+ if (nextsetting->enabled())
+ break;
-/***************************************************************************
- MISCELLANEOUS
-***************************************************************************/
+ // if we hit the end, search from the beginning
+ if (nextsetting == NULL)
+ for (nextsetting = first_setting(); nextsetting != NULL; nextsetting = nextsetting->next())
+ if (nextsetting->enabled())
+ break;
+
+ // update the value to the previous one
+ if (nextsetting != NULL)
+ m_live->value = nextsetting->value();
+}
-/*-------------------------------------------------
- find_charinfo - looks up information about a
- particular character
--------------------------------------------------*/
-static const char_info *find_charinfo(unicode_char target_char)
+//-------------------------------------------------
+// frame_update_digital - get the state of a
+// digital field
+//-------------------------------------------------
+
+void ioport_field::frame_update(ioport_value &result, bool mouse_down)
{
- int low = 0;
- int high = ARRAY_LENGTH(charinfo);
- int i;
- unicode_char ch;
+ // skip if not enabled
+ if (!enabled())
+ return;
- /* perform a simple binary search to find the proper alternate */
- while(high > low)
+ // handle analog inputs first
+ if (m_live->analog != NULL)
{
- i = (high + low) / 2;
- ch = charinfo[i].ch;
- if (ch < target_char)
- low = i + 1;
- else if (ch > target_char)
- high = i;
- else
- return &charinfo[i];
+ m_live->analog->frame_update(machine());
+ return;
}
- return NULL;
-}
-
-/*-------------------------------------------------
- inputx_key_name - returns the name of a
- specific key
--------------------------------------------------*/
+
+ // if UI is active, ignore digital inputs
+ if (ui_is_menu_active())
+ return;
-static const char *inputx_key_name(unicode_char ch)
-{
- static char buf[UTF8_CHAR_MAX + 1];
- const char_info *ci;
- const char *result;
- int pos;
+ // if the state changed, look for switch down/switch up
+ bool curstate = mouse_down || machine().input().seq_pressed(seq());
+ bool changed = false;
+ if (curstate != m_live->last)
+ {
+ m_live->last = curstate;
+ changed = true;
+ }
- ci = find_charinfo(ch);
- result = ci ? ci->name : NULL;
+ // if we're a keyboard type and using natural keyboard, bail
+ if (m_type == IPT_KEYBOARD && ui_get_use_natural_keyboard(machine()))
+ return;
- if (ci && ci->name)
+ // coin impulse option
+ int effective_impulse = m_impulse;
+ int impulse_option_val = machine().options().coin_impulse();
+ if (impulse_option_val != 0)
{
- result = ci->name;
+ if (impulse_option_val < 0)
+ effective_impulse = 0;
+ else if ((m_type >= IPT_COIN1 && m_type <= IPT_COIN12) || m_impulse != 0)
+ effective_impulse = impulse_option_val;
}
- else
+
+ // if this is a switch-down event, handle impulse and toggle
+ if (changed && curstate)
{
- if ((ch > 0x7F) || isprint(ch))
+ // impluse controls: reset the impulse counter
+ if (effective_impulse != 0 && m_live->impulse == 0)
+ m_live->impulse = effective_impulse;
+
+ // toggle controls: flip the toggle state or advance to the next setting
+ if (toggle())
{
- pos = utf8_from_uchar(buf, ARRAY_LENGTH(buf), ch);
- buf[pos] = '\0';
- result = buf;
+ if (m_settinglist.count() == 0)
+ m_live->value ^= m_mask;
+ else
+ select_next_setting();
}
- else
- result = "???";
}
- return result;
-}
-/*-------------------------------------------------
- get_keyboard_key_name - builds the name of
- a key based on natural keyboard characters
--------------------------------------------------*/
-
-static astring &get_keyboard_key_name(astring &name, const input_field_config *field)
-{
- int i;
- unicode_char ch;
-
- name.reset();
- /* loop through each character on the field*/
- for (i = 0; i < ARRAY_LENGTH(field->chars) && (field->chars[i] != '\0'); i++)
+ // update the current state with the impulse state
+ if (effective_impulse != 0)
{
- ch = get_keyboard_code(field, i);
- name.catprintf("%-*s ", MAX(SPACE_COUNT - 1, 0), inputx_key_name(ch));
+ curstate = (m_live->impulse != 0);
+ if (curstate)
+ m_live->impulse--;
}
- /* trim extra spaces */
- name.trimspace();
-
- /* special case */
- if (name.len() == 0)
- name.cpy("Unnamed Key");
-
- return name;
-}
-
-/*-------------------------------------------------
- init_port_state - initialize the live port
- states based on the tokens
--------------------------------------------------*/
+ // for toggle switches, the current value is folded into the port's default value
+ // so we always return FALSE here
+ if (toggle())
+ curstate = false;
-static void init_port_state(running_machine &machine)
-{
- const char *joystick_map_default = machine.options().joystick_map();
- ioport_manager &portdata = machine.ioport();
- input_field_config *field;
- input_port_config *port;
+ // additional logic to restrict digital joysticks
+ if (curstate && !mouse_down && m_live->joystick != NULL && m_way != 16 && !machine().options().joystick_contradictory())
+ {
+ UINT8 mask = (m_way == 4) ? m_live->joystick->current4way() : m_live->joystick->current();
+ if (!(mask & (1 << m_live->joydir)))
+ curstate = false;
+ }
- /* allocate live structures to mirror the configuration */
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
+ // skip locked-out coin inputs
+ if (curstate && m_type >= IPT_COIN1 && m_type <= IPT_COIN12 && coin_lockout_get_state(machine(), m_type - IPT_COIN1))
{
- analog_field_state **analogstatetail;
- device_field_info **readdevicetail;
- device_field_info **writedevicetail;
- input_port_state *portstate;
-
- /* allocate a new input_port_info structure */
- portstate = auto_alloc_clear(machine, input_port_state);
- ((input_port_config *)port)->state = portstate;
-
- /* start with tail pointers to all the data */
- analogstatetail = &portstate->analoglist;
- readdevicetail = &portstate->readdevicelist;
- writedevicetail = &portstate->writedevicelist;
-
- /* iterate over fields */
- for (field = port->first_field(); field != NULL; field = field->next())
+ bool verbose = machine().options().verbose();
+#ifdef MAME_DEBUG
+ verbose = true;
+#endif
+ if (machine().options().coin_lockout())
{
- input_field_state *fieldstate;
- int seqtype;
-
- /* allocate a new input_field_info structure */
- fieldstate = auto_alloc_clear(machine, input_field_state);
- ((input_field_config *)field)->state = fieldstate;
-
- /* fill in the basic values */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(fieldstate->seq); seqtype++)
- fieldstate->seq[seqtype] = field->seq[seqtype];
- fieldstate->value = field->defvalue;
-
- /* if this is an analog field, allocate memory for the analog data */
- if (field->type >= __ipt_analog_start && field->type <= __ipt_analog_end)
- {
- *analogstatetail = fieldstate->analog = init_field_analog_state(field);
- analogstatetail = &(*analogstatetail)->next;
- }
-
- /* if this is a digital joystick field, make a note of it */
- if (field->type >= __ipt_digital_joystick_start && field->type <= __ipt_digital_joystick_end)
- {
- fieldstate->joystick = &portdata.joystick_info[field->player][(field->type - __ipt_digital_joystick_start) / 4];
- fieldstate->joydir = (field->type - __ipt_digital_joystick_start) % 4;
- fieldstate->joystick->field[fieldstate->joydir] = field;
- fieldstate->joystick->inuse = TRUE;
- }
-
- /* if this entry has device input, allocate memory for the tracking structure */
- astring devicetag;
- if (!field->read.isnull())
- {
- *readdevicetail = init_field_device_info(field, port->owner().subtag(devicetag, field->read_device));
- field->read.late_bind(*(*readdevicetail)->device);
- if (!field->read.has_object())
- fatalerror("Input port %s, unable to find valid device with tag '%s'", port->tag(), devicetag.cstr());
- readdevicetail = &(*readdevicetail)->next;
- }
-
- /* if this entry has device output, allocate memory for the tracking structure */
- if (!field->write.isnull())
- {
- *writedevicetail = init_field_device_info(field, port->owner().subtag(devicetag, field->write_device));
- field->write.late_bind(*(*writedevicetail)->device);
- if (!field->write.has_object())
- fatalerror("Input port %s, unable to find valid device with tag '%s'", port->tag(), devicetag.cstr());
- writedevicetail = &(*writedevicetail)->next;
- }
-
- /* if this entry has device output, allocate memory for the tracking structure */
- if (!field->crossmapper.isnull())
- {
- device_t *device = machine.device(port->owner().subtag(devicetag, field->crossmapper_device));
- field->crossmapper.late_bind(*device);
- }
-
- /* Name keyboard key names */
- if ((field->type == IPT_KEYBOARD || field->type == IPT_KEYPAD) && (field->name == NULL))
- {
- astring name;
- field->state->name = auto_strdup(machine, get_keyboard_key_name(name, field));
- }
+ if (verbose)
+ ui_popup_time(3, "Coinlock disabled %s.", name());
+ curstate = false;
}
+ else
+ if (verbose)
+ ui_popup_time(3, "Coinlock disabled, but broken through %s.", name());
}
- /* handle autoselection of devices */
- init_autoselect_devices(machine, IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE, "analog joystick");
- init_autoselect_devices(machine, IPT_PADDLE, IPT_PADDLE_V, 0, OPTION_PADDLE_DEVICE, "paddle");
- init_autoselect_devices(machine, IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, OPTION_PEDAL_DEVICE, "pedal");
- init_autoselect_devices(machine, IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, 0, OPTION_LIGHTGUN_DEVICE, "lightgun");
- init_autoselect_devices(machine, IPT_POSITIONAL, IPT_POSITIONAL_V, 0, OPTION_POSITIONAL_DEVICE, "positional");
- init_autoselect_devices(machine, IPT_DIAL, IPT_DIAL_V, 0, OPTION_DIAL_DEVICE, "dial");
- init_autoselect_devices(machine, IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
- init_autoselect_devices(machine, IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
-
- /* look for 4-way joysticks and change the default map if we find any */
- if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (field = port->first_field(); field != NULL; field = field->next())
- if (field->state->joystick != NULL && field->way == 4)
- {
- machine.input().set_global_joystick_map((field->flags & FIELD_FLAG_ROTATED) ? joystick_map_4way_diagonal : joystick_map_4way_sticky);
- break;
- }
+ // if we're active, set the appropriate bits in the digital state
+ if (curstate)
+ result |= m_mask;
}
-/*-------------------------------------------------
- init_autoselect_devices - autoselect a single
- device based on the input port list passed
- in and the corresponding option
--------------------------------------------------*/
+//-------------------------------------------------
+// crosshair_position - compute the crosshair
+// position
+//-------------------------------------------------
-static void init_autoselect_devices(running_machine &machine, int type1, int type2, int type3, const char *option, const char *ananame)
+void ioport_field::crosshair_position(float &x, float &y, bool &gotx, bool &goty)
{
- const char *stemp = machine.options().value(option);
- input_device_class autoenable = DEVICE_CLASS_KEYBOARD;
- const char *autostring = "keyboard";
- const input_field_config *field;
- const input_port_config *port;
+ float value = m_live->analog->crosshair_read();
- /* if nothing specified, ignore the option */
- if (stemp[0] == 0)
- return;
+ // apply the scale and offset
+ if (m_crosshair_scale < 0)
+ value = -(1.0 - value) * m_crosshair_scale;
+ else
+ value *= m_crosshair_scale;
+ value += m_crosshair_offset;
- /* extract valid strings */
- if (strcmp(stemp, "mouse") == 0)
- {
- autoenable = DEVICE_CLASS_MOUSE;
- autostring = "mouse";
- }
- else if (strcmp(stemp, "joystick") == 0)
- {
- autoenable = DEVICE_CLASS_JOYSTICK;
- autostring = "joystick";
- }
- else if (strcmp(stemp, "lightgun") == 0)
+ // apply custom mapping if necessary
+ if (!m_crosshair_mapper.isnull())
+ value = m_crosshair_mapper(*this, value);
+
+ // handle X axis
+ if (m_crosshair_axis == CROSSHAIR_AXIS_X)
{
- autoenable = DEVICE_CLASS_LIGHTGUN;
- autostring = "lightgun";
+ x = value;
+ gotx = true;
+ if (m_crosshair_altaxis != 0)
+ {
+ y = m_crosshair_altaxis;
+ goty = true;
+ }
}
- else if (strcmp(stemp, "none") == 0)
+
+ // handle Y axis
+ else
{
- /* nothing specified */
- return;
+ y = value;
+ goty = true;
+ if (m_crosshair_altaxis != 0)
+ {
+ x = m_crosshair_altaxis;
+ gotx = true;
+ }
}
- else if (strcmp(stemp, "keyboard") != 0)
- mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
-
- /* only scan the list if we haven't already enabled this class of control */
- if (machine.ioport().first_port() != NULL && !machine.input().device_class(autoenable).enabled())
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (field = port->first_field(); field != NULL; field = field->next())
-
- /* if this port type is in use, apply the autoselect criteria */
- if ((type1 != 0 && field->type == type1) ||
- (type2 != 0 && field->type == type2) ||
- (type3 != 0 && field->type == type3))
- {
- mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
- machine.input().device_class(autoenable).enable();
- break;
- }
}
-/*-------------------------------------------------
- init_field_device_info - allocate and populate
- information about a device callback
--------------------------------------------------*/
+//-------------------------------------------------
+// expand_diplocation - expand a string-based
+// DIP location into a linked list of
+// descriptions
+//-------------------------------------------------
-static device_field_info *init_field_device_info(const input_field_config *field, const char *device_name)
+void ioport_field::expand_diplocation(const char *location, astring &errorbuf)
{
- device_field_info *info;
- input_port_value mask;
-
- /* allocate memory */
- info = auto_alloc_clear(field->machine(), device_field_info);
-
- /* fill in the data */
- info->field = field;
- for (mask = field->mask; !(mask & 1); mask >>= 1)
- info->shift++;
+ // if nothing present, bail
+ if (location == NULL)
+ return;
- info->device = (device_name != NULL) ? field->machine().device(device_name) : &field->port().owner();
+ m_diploclist.reset();
- info->oldval = field->defvalue >> info->shift;
- return info;
-}
+ // parse the string
+ astring name; // Don't move this variable inside the loop, lastname's lifetime depends on it being outside
+ const char *lastname = NULL;
+ const char *curentry = location;
+ int entries = 0;
+ while (*curentry != 0)
+ {
+ // find the end of this entry
+ const char *comma = strchr(curentry, ',');
+ if (comma == NULL)
+ comma = curentry + strlen(curentry);
+ // extract it to tempbuf
+ astring tempstr;
+ tempstr.cpy(curentry, comma - curentry);
-/*-------------------------------------------------
- init_field_analog_state - allocate and populate
- information about an analog port
--------------------------------------------------*/
+ // first extract the switch name if present
+ const char *number = tempstr;
+ const char *colon = strchr(tempstr, ':');
-static analog_field_state *init_field_analog_state(const input_field_config *field)
-{
- analog_field_state *state;
- input_port_value mask;
+ // allocate and copy the name if it is present
+ if (colon != NULL)
+ {
+ lastname = name.cpy(number, colon - number);
+ number = colon + 1;
+ }
- /* allocate memory */
- state = auto_alloc_clear(field->machine(), analog_field_state);
+ // otherwise, just copy the last name
+ else
+ {
+ if (lastname == NULL)
+ {
+ errorbuf.catprintf("Switch location '%s' missing switch name!\n", location);
+ lastname = (char *)"UNK";
+ }
+ name.cpy(lastname);
+ }
- /* compute the shift amount and number of bits */
- for (mask = field->mask; !(mask & 1); mask >>= 1)
- state->shift++;
+ // if the number is preceded by a '!' it's active high
+ bool invert = false;
+ if (*number == '!')
+ {
+ invert = true;
+ number++;
+ }
- /* initialize core data */
- state->field = field;
- state->adjdefvalue = (field->defvalue & field->mask) >> state->shift;
- state->adjmin = (field->min & field->mask) >> state->shift;
- state->adjmax = (field->max & field->mask) >> state->shift;
- state->sensitivity = field->sensitivity;
- state->reverse = ((field->flags & ANALOG_FLAG_REVERSE) != 0);
- state->delta = field->delta;
- state->centerdelta = field->centerdelta;
- state->minimum = INPUT_ABSOLUTE_MIN;
- state->maximum = INPUT_ABSOLUTE_MAX;
+ // now scan the switch number
+ int swnum = -1;
+ if (sscanf(number, "%d", &swnum) != 1)
+ errorbuf.catprintf("Switch location '%s' has invalid format!\n", location);
- /* set basic parameters based on the configured type */
- switch (field->type)
- {
- /* paddles and analog joysticks are absolute and autocenter */
- case IPT_AD_STICK_X:
- case IPT_AD_STICK_Y:
- case IPT_AD_STICK_Z:
- case IPT_PADDLE:
- case IPT_PADDLE_V:
- state->absolute = TRUE;
- state->autocenter = TRUE;
- state->interpolate = TRUE;
- break;
+ // allocate a new entry
+ m_diploclist.append(*global_alloc(ioport_diplocation(name, swnum, invert)));
+ entries++;
- /* pedals start at and autocenter to the min range */
- case IPT_PEDAL:
- case IPT_PEDAL2:
- case IPT_PEDAL3:
- state->center = INPUT_ABSOLUTE_MIN;
- state->accum = APPLY_INVERSE_SENSITIVITY(state->center, state->sensitivity);
- state->absolute = TRUE;
- state->autocenter = TRUE;
- state->interpolate = TRUE;
- break;
+ // advance to the next item
+ curentry = comma;
+ if (*curentry != 0)
+ curentry++;
+ }
- /* lightguns are absolute as well, but don't autocenter and don't interpolate their values */
- case IPT_LIGHTGUN_X:
- case IPT_LIGHTGUN_Y:
- state->absolute = TRUE;
- state->autocenter = FALSE;
- state->interpolate = FALSE;
- break;
+ // then verify the number of bits in the mask matches
+ ioport_value temp;
+ int bits;
+ for (bits = 0, temp = m_mask; temp != 0 && bits < 32; bits++)
+ temp &= temp - 1;
+ if (bits != entries)
+ errorbuf.catprintf("Switch location '%s' does not describe enough bits for mask %X\n", location, m_mask);
+}
- /* positional devices are absolute, but can also wrap like relative devices */
- /* set each position to be 512 units */
- case IPT_POSITIONAL:
- case IPT_POSITIONAL_V:
- state->positionalscale = COMPUTE_SCALE(field->max, INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
- state->adjmin = 0;
- state->adjmax = field->max - 1;
- state->wraps = ((field->flags & ANALOG_FLAG_WRAPS) != 0);
- state->autocenter = !state->wraps;
- break;
- /* dials, mice and trackballs are relative devices */
- /* these have fixed "min" and "max" values based on how many bits are in the port */
- /* in addition, we set the wrap around min/max values to 512 * the min/max values */
- /* this takes into account the mapping that one mouse unit ~= 512 analog units */
- case IPT_DIAL:
- case IPT_DIAL_V:
- case IPT_TRACKBALL_X:
- case IPT_TRACKBALL_Y:
- case IPT_MOUSE_X:
- case IPT_MOUSE_Y:
- state->absolute = FALSE;
- state->wraps = TRUE;
- state->interpolate = TRUE;
- break;
+//-------------------------------------------------
+// init_live_state - create live state structures
+//-------------------------------------------------
- default:
- fatalerror("Unknown analog port type -- don't know if it is absolute or not");
- break;
- }
+void ioport_field::init_live_state(analog_field *analog)
+{
+ // resolve callbacks
+ m_read.bind_relative_to(device());
+ m_write.bind_relative_to(device());
+ m_crosshair_mapper.bind_relative_to(device());
- /* further processing for absolute controls */
- if (state->absolute)
- {
- /* if the default value is pegged at the min or max, use a single scale value for the whole axis */
- state->single_scale = (state->adjdefvalue == state->adjmin) || (state->adjdefvalue == state->adjmax);
+ // allocate live state
+ m_live = global_alloc(ioport_field_live(*this, analog));
+}
- /* if not "single scale", compute separate scales for each side of the default */
- if (!state->single_scale)
- {
- /* unsigned */
- state->scalepos = COMPUTE_SCALE(state->adjmax - state->adjdefvalue, INPUT_ABSOLUTE_MAX - 0);
- state->scaleneg = COMPUTE_SCALE(state->adjdefvalue - state->adjmin, 0 - INPUT_ABSOLUTE_MIN);
- if (state->adjmin > state->adjmax)
- state->scaleneg = -state->scaleneg;
- /* reverse point is at center */
- state->reverse_val = 0;
- }
- else
- {
- /* single axis that increases from default */
- state->scalepos = COMPUTE_SCALE(state->adjmax - state->adjmin, INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
+//**************************************************************************
+// I/O PORT FIELD LIVE
+//**************************************************************************
- /* move from default */
- if (state->adjdefvalue == state->adjmax)
- state->scalepos = -state->scalepos;
+//-------------------------------------------------
+// ioport_field_live - constructor
+//-------------------------------------------------
- /* make the scaling the same for easier coding when we need to scale */
- state->scaleneg = state->scalepos;
+ioport_field_live::ioport_field_live(ioport_field &field, analog_field *analog)
+ : analog(analog),
+ joystick(NULL),
+ value(field.defvalue()),
+ impulse(0),
+ last(0),
+ joydir(digital_joystick::JOYDIR_COUNT)
+{
+ // fill in the basic values
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ seq[seqtype] = field.seq(seqtype);
- /* reverse point is at max */
- state->reverse_val = state->maximum;
- }
+ // if this is a digital joystick field, make a note of it
+ if (field.is_digital_joystick())
+ {
+ joystick = &field.manager().digjoystick(field.player(), (field.type() - (IPT_DIGITAL_JOYSTICK_FIRST + 1)) / 4);
+ joydir = joystick->set_axis(field);
}
- /* relative and positional controls all map directly with a 512x scale factor */
- else
+ // Name keyboard key names
+ if (field.type_class() == INPUT_CLASS_KEYBOARD && field.specific_name() == NULL)
{
- /* The relative code is set up to allow specifing PORT_MINMAX and default values. */
- /* The validity checks are purposely set up to not allow you to use anything other */
- /* a default of 0 and PORT_MINMAX(0,mask). This is in case the need arises to use */
- /* this feature in the future. Keeping the code in does not hurt anything. */
- if (state->adjmin > state->adjmax)
- /* adjust for signed */
- state->adjmin = -state->adjmin;
-
- if (state->wraps)
- state->adjmax++;
-
- state->minimum = (state->adjmin - state->adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
- state->maximum = (state->adjmax - state->adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
-
- /* make the scaling the same for easier coding when we need to scale */
- state->scaleneg = state->scalepos = COMPUTE_SCALE(1, INPUT_RELATIVE_PER_PIXEL);
-
- if (field->flags & ANALOG_FLAG_RESET)
- /* delta values reverse from center */
- state->reverse_val = 0;
- else
+ // loop through each character on the field
+ astring tempstr;
+ for (int which = 0; ; which++)
{
- /* positional controls reverse from their max range */
- state->reverse_val = state->maximum + state->minimum;
-
- /* relative controls reverse from 1 past their max range */
- if (state->wraps)
- state->reverse_val -= INPUT_RELATIVE_PER_PIXEL;
+ unicode_char ch = field.keyboard_code(which);
+ if (ch == 0)
+ break;
+ name.catprintf("%-*s ", MAX(SPACE_COUNT - 1, 0), field.manager().natkeyboard().key_name(tempstr, ch));
}
- }
- /* compute scale for keypresses */
- state->keyscalepos = RECIP_SCALE(state->scalepos);
- state->keyscaleneg = RECIP_SCALE(state->scaleneg);
+ // trim extra spaces
+ name.trimspace();
- return state;
+ // special case
+ if (name.len() == 0)
+ name.cpy("Unnamed Key");
+ }
}
-/***************************************************************************
- ONCE-PER-FRAME UPDATES
-***************************************************************************/
+//**************************************************************************
+// I/O PORT
+//**************************************************************************
-/*-------------------------------------------------
- frame_update_callback - system-wide callback to
- update the input ports once per frame, but
- only if we are not paused
--------------------------------------------------*/
+//-------------------------------------------------
+// ioport_port - constructor
+//-------------------------------------------------
-static void frame_update_callback(running_machine &machine)
+ioport_port::ioport_port(device_t &owner, const char *tag)
+ : m_next(NULL),
+ m_device(owner),
+ m_tag(tag),
+ m_modcount(0),
+ m_active(0),
+ m_live(NULL)
{
- /* if we're paused, don't do anything */
- if (machine.paused())
- return;
-
- /* otherwise, use the common code */
- frame_update(machine);
}
-static key_buffer *get_buffer(running_machine &machine)
+
+//-------------------------------------------------
+// ~ioport_port - destructor
+//-------------------------------------------------
+
+ioport_port::~ioport_port()
{
- ioport_manager &portdata = machine.ioport();
- assert(inputx_can_post(machine));
- return (key_buffer *)&portdata.keybuffer;
+ global_free(m_live);
}
+//-------------------------------------------------
+// machine - return a reference to the running
+// machine
+//-------------------------------------------------
-static const inputx_code *find_code(inputx_code *codes, unicode_char ch)
+running_machine &ioport_port::machine() const
{
- int i;
-
- assert(codes);
- for (i = 0; codes[i].ch; i++)
- {
- if (codes[i].ch == ch)
- return &codes[i];
- }
- return NULL;
+ return m_device.machine();
}
-/*-------------------------------------------------
- input_port_update_hook - hook function
- called from core to allow for natural keyboard
--------------------------------------------------*/
-static void input_port_update_hook(running_machine &machine, const input_port_config *port, input_port_value *digital)
+//-------------------------------------------------
+// manager - return a reference to the
+// ioport_manager on the running machine
+//-------------------------------------------------
+
+ioport_manager &ioport_port::manager() const
{
- ioport_manager &portdata = machine.ioport();
- const key_buffer *keybuf;
- const inputx_code *code;
- unicode_char ch;
- int i;
- UINT32 value;
+ return machine().ioport();
+}
- if (inputx_can_post(machine))
- {
- keybuf = get_buffer(machine);
- /* is the key down right now? */
- if (keybuf && keybuf->status_keydown && (keybuf->begin_pos != keybuf->end_pos))
- {
- /* identify the character that is down right now, and its component codes */
- ch = keybuf->buffer[keybuf->begin_pos];
- code = find_code(portdata.codes, ch);
+//-------------------------------------------------
+// field - return a pointer to the first field
+// that intersects the given mask
+//-------------------------------------------------
- /* loop through this character's component codes */
- if (code != NULL)
- {
- for (i = 0; i < ARRAY_LENGTH(code->field) && (code->field[i] != NULL); i++)
- {
- if (&code->field[i]->port() == port)
- {
- value = code->field[i]->mask;
- *digital |= value;
- }
- }
- }
- }
- }
+ioport_field *ioport_port::field(ioport_value mask)
+{
+ // if we got the port, look for the field
+ for (ioport_field *field = first_field(); field != NULL; field = field->next())
+ if ((field->mask() & mask) != 0)
+ return field;
+ return NULL;
}
-/*-------------------------------------------------
- frame_update - core logic for per-frame input
- port updating
--------------------------------------------------*/
+//-------------------------------------------------
+// read - return the value of an I/O port
+//-------------------------------------------------
-static void frame_update(running_machine &machine)
+ioport_value ioport_port::read()
{
- ioport_manager &portdata = machine.ioport();
- const input_field_config *mouse_field = NULL;
- int ui_visible = ui_is_menu_active();
- attotime curtime = machine.time();
- const input_port_config *port;
- render_target *mouse_target;
- INT32 mouse_target_x;
- INT32 mouse_target_y;
- int mouse_button;
+ assert_always(manager().safe_to_read(), "Input ports cannot be read at init time!");
-g_profiler.start(PROFILER_INPUT);
+ // start with the digital state
+ ioport_value result = m_live->digital;
- /* record/playback information about the current frame */
- playback_frame(machine, curtime);
- record_frame(machine, curtime);
+ // insert dynamic read values
+ for (dynamic_field *dynfield = m_live->readlist.first(); dynfield != NULL; dynfield = dynfield->next())
+ dynfield->read(result);
- /* track the duration of the previous frame */
- portdata.last_delta_nsec = (curtime - portdata.last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
- portdata.last_frame_time = curtime;
+ // apply active high/low state to digital and dynamic read inputs
+ result ^= m_live->defvalue;
- /* update the digital joysticks */
- frame_update_digital_joysticks(machine);
+ // insert analog portions
+ for (analog_field *analog = m_live->analoglist.first(); analog != NULL; analog = analog->next())
+ analog->read(result);
- /* compute default values for all the ports */
- input_port_update_defaults(machine);
+ return result;
+}
- /* perform the mouse hit test */
- mouse_target = ui_input_find_mouse(machine, &mouse_target_x, &mouse_target_y, &mouse_button);
- if (mouse_button && mouse_target)
- {
- const char *tag = NULL;
- input_port_value mask;
- float x, y;
- if (mouse_target->map_point_input(mouse_target_x, mouse_target_y, tag, mask, x, y))
- mouse_field = input_field_by_tag_and_mask(machine, tag, mask);
- }
- /* loop over all input ports */
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- {
- const input_field_config *field;
- device_field_info *device_field;
- input_port_value newvalue;
+//-------------------------------------------------
+// write - write a value to a port
+//-------------------------------------------------
- /* start with 0 values for the digital and VBLANK bits */
- port->state->digital = 0;
- port->state->vblank = 0;
+void ioport_port::write(ioport_value data, ioport_value mem_mask)
+{
+ // call device line write handlers
+ COMBINE_DATA(&m_live->outputvalue);
+ for (dynamic_field *dynfield = m_live->writelist.first(); dynfield != NULL; dynfield = dynfield->next())
+ if (dynfield->field().type() == IPT_OUTPUT)
+ dynfield->write(m_live->outputvalue);
+}
- /* now loop back and modify based on the inputs */
- for (field = port->first_field(); field != NULL; field = field->next())
- if (input_condition_true(port->machine(), &field->condition, port->owner()))
- {
- /* accumulate VBLANK bits */
- if (field->type == IPT_VBLANK)
- port->state->vblank ^= field->mask;
- /* handle analog inputs */
- else if (field->state->analog != NULL)
- frame_update_analog_field(machine, field->state->analog);
+//-------------------------------------------------
+// frame_update - once/frame update
+//-------------------------------------------------
- /* handle non-analog types, but only when the UI isn't visible */
- else if (!ui_visible && frame_get_digital_field_state(field, field == mouse_field))
- port->state->digital |= field->mask;
- }
+void ioport_port::frame_update(ioport_field *mouse_field)
+{
+ // start with 0 values for the digital bits
+ m_live->digital = 0;
- /* hook for MESS's natural keyboard support */
- input_port_update_hook(machine, port, &port->state->digital);
+ // now loop back and modify based on the inputs
+ for (ioport_field *field = first_field(); field != NULL; field = field->next())
+ field->frame_update(m_live->digital, field == mouse_field);
- /* handle playback/record */
- playback_port(port);
- record_port(port);
+ // hook for MESS's natural keyboard support
+ manager().natkeyboard().frame_update(*this, m_live->digital);
- /* call device line write handlers */
- newvalue = input_port_read_direct(port);
- for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
- if (device_field->field->type != IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition, port->owner()))
- {
- input_port_value newval = (newvalue & device_field->field->mask) >> device_field->shift;
+ // call device line write handlers
+ ioport_value newvalue = read();
+ for (dynamic_field *dynfield = m_live->writelist.first(); dynfield != NULL; dynfield = dynfield->next())
+ if (dynfield->field().type() != IPT_OUTPUT)
+ dynfield->write(newvalue);
+}
- /* if the bits have write, call the handler */
- if (device_field->oldval != newval)
- {
- device_field->field->write(*device_field->field, device_field->field->write_param, device_field->oldval, newval);
- device_field->oldval = newval;
- }
- }
- }
+//-------------------------------------------------
+// collapse_fields - remove any fields that are
+// wholly overlapped by other fields
+//-------------------------------------------------
-g_profiler.stop();
+void ioport_port::collapse_fields(astring &errorbuf)
+{
+ ioport_value maskbits = 0;
+ int lastmodcount = -1;
+
+ // remove the whole list and start from scratch
+ ioport_field *field = m_fieldlist.detach_all();
+ while (field != NULL)
+ {
+ // if this modcount doesn't match, reset
+ if (field->modcount() != lastmodcount)
+ {
+ lastmodcount = field->modcount();
+ maskbits = 0;
+ }
+
+ // reinsert this field
+ ioport_field *current = field;
+ field = field->next();
+ insert_field(*current, maskbits, errorbuf);
+ }
}
-/*-------------------------------------------------
- frame_update_digital_joysticks - update the
- state of digital joysticks prior to
- accumulating the results in a port
--------------------------------------------------*/
+//-------------------------------------------------
+// insert_field - insert a new field, checking
+// for errors
+//-------------------------------------------------
-static void frame_update_digital_joysticks(running_machine &machine)
+void ioport_port::insert_field(ioport_field &newfield, ioport_value &disallowedbits, astring &errorbuf)
{
- ioport_manager &portdata = machine.ioport();
- int player, joyindex;
+ // verify against the disallowed bits, but only if we are condition-free
+ if (newfield.condition().none())
+ {
+ if ((newfield.mask() & disallowedbits) != 0)
+ errorbuf.catprintf("INPUT_TOKEN_FIELD specifies duplicate port bits (port=%s mask=%X)\n", tag(), newfield.mask());
+ disallowedbits |= newfield.mask();
+ }
- /* loop over all the joysticks */
- for (player = 0; player < MAX_PLAYERS; player++)
- for (joyindex = 0; joyindex < DIGITAL_JOYSTICKS_PER_PLAYER; joyindex++)
+ // first modify/nuke any entries that intersect our maskbits
+ ioport_field *nextfield;
+ for (ioport_field *field = first_field(); field != NULL; field = nextfield)
+ {
+ nextfield = field->next();
+ if ((field->mask() & newfield.mask()) != 0 &&
+ (newfield.condition().none() || field->condition().none() || field->condition() == newfield.condition()))
{
- digital_joystick_state *joystick = &portdata.joystick_info[player][joyindex];
- if (joystick->inuse)
- {
- joystick->previous = joystick->current;
- joystick->current = 0;
-
- /* read all the associated ports */
- if (joystick->field[JOYDIR_UP] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_UP], SEQ_TYPE_STANDARD)))
- joystick->current |= JOYDIR_UP_BIT;
- if (joystick->field[JOYDIR_DOWN] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_DOWN], SEQ_TYPE_STANDARD)))
- joystick->current |= JOYDIR_DOWN_BIT;
- if (joystick->field[JOYDIR_LEFT] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_LEFT], SEQ_TYPE_STANDARD)))
- joystick->current |= JOYDIR_LEFT_BIT;
- if (joystick->field[JOYDIR_RIGHT] != NULL && machine.input().seq_pressed(input_field_seq(joystick->field[JOYDIR_RIGHT], SEQ_TYPE_STANDARD)))
- joystick->current |= JOYDIR_RIGHT_BIT;
-
- /* lock out opposing directions (left + right or up + down) */
- if ((joystick->current & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) == (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT))
- joystick->current &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
- if ((joystick->current & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)) == (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT))
- joystick->current &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
-
- /* only update 4-way case if joystick has moved */
- if (joystick->current != joystick->previous)
- {
- joystick->current4way = joystick->current;
+ // reduce the mask of the field we found
+ field->reduce_mask(newfield.mask());
- /*
- If joystick is pointing at a diagonal, acknowledge that the player moved
- the joystick by favoring a direction change. This minimizes frustration
- when using a keyboard for input, and maximizes responsiveness.
+ // if the new entry fully overrides the previous one, we nuke
+ if (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS || field->mask() == 0)
+ m_fieldlist.remove(*field);
+ }
+ }
- For example, if you are holding "left" then switch to "up" (where both left
- and up are briefly pressed at the same time), we'll transition immediately
- to "up."
+ // make a mask of just the low bit
+ ioport_value lowbit = (newfield.mask() ^ (newfield.mask() - 1)) & newfield.mask();
- Zero any switches that didn't change from the previous to current state.
- */
- if ((joystick->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
- (joystick->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
- {
- joystick->current4way ^= joystick->current4way & joystick->previous;
- }
+ // scan forward to find where to insert ourselves
+ ioport_field *field;
+ for (field = first_field(); field != NULL; field = field->next())
+ if (field->mask() > lowbit)
+ break;
- /*
- If we are still pointing at a diagonal, we are in an indeterminant state.
+ // insert it into the list
+ m_fieldlist.insert_before(newfield, field);
+}
- This could happen if the player moved the joystick from the idle position directly
- to a diagonal, or from one diagonal directly to an extreme diagonal.
- The chances of this happening with a keyboard are slim, but we still need to
- constrain this case.
+//-------------------------------------------------
+// init_live_state - create the live state
+//-------------------------------------------------
- For now, just resolve randomly.
- */
- if ((joystick->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
- (joystick->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
- {
- if (machine.rand() & 1)
- joystick->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
- else
- joystick->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
- }
- }
- }
- }
+void ioport_port::init_live_state()
+{
+ m_live = global_alloc(ioport_port_live(*this));
}
-/*-------------------------------------------------
- frame_update_analog_field - update the
- internals of a single analog field
--------------------------------------------------*/
-
-static void frame_update_analog_field(running_machine &machine, analog_field_state *analog)
-{
- input_item_class itemclass;
- int keypressed = FALSE;
- INT64 keyscale;
- INT32 rawvalue;
- INT32 delta = 0;
- /* clamp the previous value to the min/max range and remember it */
- analog->previous = analog->accum = apply_analog_min_max(analog, analog->accum);
+//**************************************************************************
+// I/O PORT LIVE STATE
+//**************************************************************************
- /* get the new raw analog value and its type */
- rawvalue = machine.input().seq_axis_value(input_field_seq(analog->field, SEQ_TYPE_STANDARD), itemclass);
+//-------------------------------------------------
+// ioport_port_live - constructor
+//-------------------------------------------------
- /* if we got an absolute input, it overrides everything else */
- if (itemclass == ITEM_CLASS_ABSOLUTE)
+ioport_port_live::ioport_port_live(ioport_port &port)
+ : defvalue(0),
+ digital(0),
+ outputvalue(0)
+{
+ // iterate over fields
+ for (ioport_field *field = port.first_field(); field != NULL; field = field->next())
{
- if (analog->previousanalog != rawvalue)
- {
- /* only update if analog value changed */
- analog->previousanalog = rawvalue;
+ // allocate analog state if it's analog
+ analog_field *analog = NULL;
+ if (field->is_analog())
+ analog = &analoglist.append(*global_alloc(analog_field(*field)));
+
+ // allocate a dynamic field for reading
+ if (field->has_dynamic_read())
+ readlist.append(*global_alloc(dynamic_field(*field)));
+
+ // allocate a dynamic field for writing
+ if (field->has_dynamic_write())
+ writelist.append(*global_alloc(dynamic_field(*field)));
+
+ // let the field initialize its live state
+ field->init_live_state(analog);
+ }
+}
- /* apply the inverse of the sensitivity to the raw value so that */
- /* it will still cover the full min->max range requested after */
- /* we apply the sensitivity adjustment */
- if (analog->absolute || (analog->field->flags & ANALOG_FLAG_RESET))
- {
- /* if port is absolute, then just return the absolute data supplied */
- analog->accum = APPLY_INVERSE_SENSITIVITY(rawvalue, analog->sensitivity);
- }
- else if (analog->positionalscale != 0)
- {
- /* if port is positional, we will take the full analog control and divide it */
- /* into positions, that way as the control is moved full scale, */
- /* it moves through all the positions */
- rawvalue = APPLY_SCALE(rawvalue - INPUT_ABSOLUTE_MIN, analog->positionalscale) * INPUT_RELATIVE_PER_PIXEL + analog->minimum;
-
- /* clamp the high value so it does not roll over */
- rawvalue = MIN(rawvalue, analog->maximum);
- analog->accum = APPLY_INVERSE_SENSITIVITY(rawvalue, analog->sensitivity);
- }
- else
- /* if port is relative, we use the value to simulate the speed of relative movement */
- /* sensitivity adjustment is allowed for this mode */
- analog->accum += rawvalue;
- analog->lastdigital = FALSE;
- /* do not bother with other control types if the analog data is changing */
- return;
- }
- else
- {
- /* we still have to update fake relative from joystick control */
- if (!analog->absolute && analog->positionalscale == 0)
- analog->accum += rawvalue;
- }
- }
- /* if we got it from a relative device, use that as the starting delta */
- /* also note that the last input was not a digital one */
- if (itemclass == ITEM_CLASS_RELATIVE && rawvalue != 0)
- {
- delta = rawvalue;
- analog->lastdigital = FALSE;
- }
+//**************************************************************************
+// I/O PORT MANAGER
+//**************************************************************************
- keyscale = (analog->accum >= 0) ? analog->keyscalepos : analog->keyscaleneg;
+//-------------------------------------------------
+// ioport_manager - constructor
+//-------------------------------------------------
- /* if the decrement code sequence is pressed, add the key delta to */
- /* the accumulated delta; also note that the last input was a digital one */
- if (machine.input().seq_pressed(input_field_seq(analog->field, SEQ_TYPE_DECREMENT)))
- {
- keypressed = TRUE;
- if (analog->delta != 0)
- delta -= APPLY_SCALE(analog->delta, keyscale);
- else if (!analog->lastdigital)
- /* decrement only once when first pressed */
- delta -= APPLY_SCALE(1, keyscale);
- analog->lastdigital = TRUE;
- }
+ioport_manager::ioport_manager(running_machine &machine)
+ : m_machine(machine),
+ m_safe_to_read(false),
+ m_natkeyboard(machine),
+ m_last_frame_time(attotime::zero),
+ m_last_delta_nsec(0),
+ m_record_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS),
+ m_playback_file(machine.options().input_directory(), OPEN_FLAG_READ),
+ m_playback_accumulated_speed(0),
+ m_playback_accumulated_frames(0)
+{
+ memset(m_type_to_entry, 0, sizeof(m_type_to_entry));
+}
- /* same for the increment code sequence */
- if (machine.input().seq_pressed(input_field_seq(analog->field, SEQ_TYPE_INCREMENT)))
- {
- keypressed = TRUE;
- if (analog->delta)
- delta += APPLY_SCALE(analog->delta, keyscale);
- else if (!analog->lastdigital)
- /* increment only once when first pressed */
- delta += APPLY_SCALE(1, keyscale);
- analog->lastdigital = TRUE;
- }
- /* if resetting is requested, clear the accumulated position to 0 before */
- /* applying the deltas so that we only return this frame's delta */
- /* note that centering only works for relative controls */
- /* no need to check if absolute here because it is checked by the validity tests */
- if (analog->field->flags & ANALOG_FLAG_RESET)
- analog->accum = 0;
+//-------------------------------------------------
+// initialize - walk the configured ports and
+// create live state information
+//-------------------------------------------------
+
+time_t ioport_manager::initialize()
+{
+ // add an exit callback and a frame callback
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ioport_manager::exit), this));
+ machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(ioport_manager::frame_update), this));
- /* apply the delta to the accumulated value */
- analog->accum += delta;
+ // initialize the default port info from the OSD
+ init_port_types();
- /* if our last movement was due to a digital input, and if this control */
- /* type autocenters, and if neither the increment nor the decrement seq */
- /* was pressed, apply autocentering */
- if (analog->autocenter)
+ // if we have a token list, proceed
+ device_iterator iter(machine().root_device());
+ for (device_t *device = iter.first(); device != NULL; device = iter.next())
{
- INT32 center = APPLY_INVERSE_SENSITIVITY(analog->center, analog->sensitivity);
- if (analog->lastdigital && !keypressed)
- {
- /* autocenter from positive values */
- if (analog->accum >= center)
- {
- analog->accum -= APPLY_SCALE(analog->centerdelta, analog->keyscalepos);
- if (analog->accum < center)
- {
- analog->accum = center;
- analog->lastdigital = FALSE;
- }
- }
+ astring errors;
+ m_portlist.append(*device, errors);
+ if (errors)
+ mame_printf_error("Input port errors:\n%s", errors.cstr());
+ }
- /* autocenter from negative values */
- else
- {
- analog->accum += APPLY_SCALE(analog->centerdelta, analog->keyscaleneg);
- if (analog->accum > center)
+ // allocate live structures to mirror the configuration
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ port->init_live_state();
+
+ // handle autoselection of devices
+ init_autoselect_devices(IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE, "analog joystick");
+ init_autoselect_devices(IPT_PADDLE, IPT_PADDLE_V, 0, OPTION_PADDLE_DEVICE, "paddle");
+ init_autoselect_devices(IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, OPTION_PEDAL_DEVICE, "pedal");
+ init_autoselect_devices(IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, 0, OPTION_LIGHTGUN_DEVICE, "lightgun");
+ init_autoselect_devices(IPT_POSITIONAL, IPT_POSITIONAL_V, 0, OPTION_POSITIONAL_DEVICE, "positional");
+ init_autoselect_devices(IPT_DIAL, IPT_DIAL_V, 0, OPTION_DIAL_DEVICE, "dial");
+ init_autoselect_devices(IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
+ init_autoselect_devices(IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
+
+ // look for 4-way joysticks and change the default map if we find any
+ const char *joystick_map_default = machine().options().joystick_map();
+ if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->live().joystick != NULL && field->way() == 4)
{
- analog->accum = center;
- analog->lastdigital = FALSE;
+ machine().input().set_global_joystick_map(field->rotated() ? joystick_map_4way_diagonal : joystick_map_4way_sticky);
+ break;
}
- }
- }
- }
- else if (!keypressed)
- analog->lastdigital = FALSE;
+
+ // register callbacks for when we load configurations
+ config_register(machine(), "input", config_saveload_delegate(FUNC(ioport_manager::load_config), this), config_saveload_delegate(FUNC(ioport_manager::save_config), this));
+
+ // open playback and record files if specified
+ time_t basetime = playback_init();
+ record_init();
+ return basetime;
}
-/*-------------------------------------------------
- frame_get_digital_field_state - get the state
- of a digital field
--------------------------------------------------*/
+//-------------------------------------------------
+// init_port_types - initialize the default
+// type list
+//-------------------------------------------------
-static int frame_get_digital_field_state(const input_field_config *field, int mouse_down)
+void ioport_manager::init_port_types()
{
- int curstate = mouse_down || field->machine().input().seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD));
- int changed = FALSE;
- int temp_field_impulse;
+ // convert the array into a list of type states that can be modified
+ construct_core_types(m_typelist);
- /* if the state changed, look for switch down/switch up */
- if (curstate != field->state->last)
+ // ask the OSD to customize the list
+ machine().osd().customize_input_type_list(m_typelist);
+
+ // now iterate over the OSD-modified types
+ for (input_type_entry *curtype = first_type(); curtype != NULL; curtype = curtype->next())
{
- field->state->last = curstate;
- changed = TRUE;
+ // first copy all the OSD-updated sequences into our current state
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ curtype->m_seq[seqtype] = curtype->defseq(seqtype);
+
+ // also make a lookup table mapping type/player to the appropriate type list entry
+ m_type_to_entry[curtype->type()][curtype->player()] = curtype;
}
+}
- if (field->type == IPT_KEYBOARD && ui_get_use_natural_keyboard(field->machine()))
- return FALSE;
- /* coin impulse option */
- {
- int temp_option_impulse = field->machine().options().coin_impulse();
- temp_field_impulse = field->impulse;
- if ( temp_option_impulse != 0)
- {
- if (temp_option_impulse < 0)
- temp_field_impulse = 0;
- else if ((field->type >= IPT_COIN1 && field->type <= IPT_COIN12) || field->impulse != 0)
- temp_field_impulse = temp_option_impulse;
- }
- }
+//-------------------------------------------------
+// init_autoselect_devices - autoselect a single
+// device based on the input port list passed
+// in and the corresponding option
+//-------------------------------------------------
- /* if this is a switch-down event, handle impulse and toggle */
- if (changed && curstate)
- {
- /* impluse controls: reset the impulse counter */
- if (temp_field_impulse != 0 && field->state->impulse == 0)
- field->state->impulse = temp_field_impulse;
+void ioport_manager::init_autoselect_devices(int type1, int type2, int type3, const char *option, const char *ananame)
+{
+ // if nothing specified, ignore the option
+ const char *stemp = machine().options().value(option);
+ if (stemp[0] == 0)
+ return;
- /* toggle controls: flip the toggle state or advance to the next setting */
- if (field->flags & FIELD_FLAG_TOGGLE)
- {
- if (field->settinglist().count() == 0)
- field->state->value ^= field->mask;
- else
- input_field_select_next_setting(field);
- }
+ // extract valid strings
+ const char *autostring = "keyboard";
+ input_device_class autoenable = DEVICE_CLASS_KEYBOARD;
+ if (strcmp(stemp, "mouse") == 0)
+ {
+ autoenable = DEVICE_CLASS_MOUSE;
+ autostring = "mouse";
}
-
- /* update the current state with the impulse state */
- if (temp_field_impulse != 0)
+ else if (strcmp(stemp, "joystick") == 0)
{
- if (field->state->impulse != 0)
- {
- field->state->impulse--;
- curstate = TRUE;
- }
- else
- curstate = FALSE;
+ autoenable = DEVICE_CLASS_JOYSTICK;
+ autostring = "joystick";
}
-
- /* for toggle switches, the current value is folded into the port's default value */
- /* so we always return FALSE here */
- if (field->flags & FIELD_FLAG_TOGGLE)
- curstate = FALSE;
-
- /* additional logic to restrict digital joysticks */
- if (curstate && !mouse_down && field->state->joystick != NULL && field->way != 16 && !field->machine().options().joystick_contradictory())
+ else if (strcmp(stemp, "lightgun") == 0)
{
- UINT8 mask = (field->way == 4) ? field->state->joystick->current4way : field->state->joystick->current;
- if (!(mask & (1 << field->state->joydir)))
- curstate = FALSE;
+ autoenable = DEVICE_CLASS_LIGHTGUN;
+ autostring = "lightgun";
}
-
- /* skip locked-out coin inputs */
- if (curstate && field->type >= IPT_COIN1 && field->type <= IPT_COIN12 && coin_lockout_get_state(field->machine(), field->type - IPT_COIN1))
+ else if (strcmp(stemp, "none") == 0)
{
- int verbose = field->machine().options().verbose();
-#ifdef MAME_DEBUG
- verbose = 1;
-#endif
- if (field->machine().options().coin_lockout())
- {
- if (verbose)
- ui_popup_time(3, "Coinlock disabled %s.", input_field_name(field));
- return FALSE; /* curstate = FALSE; */
- }
- else
- if (verbose)
- ui_popup_time(3, "Coinlock disabled, but broken through %s.", input_field_name(field));
+ // nothing specified
+ return;
}
+ else if (strcmp(stemp, "keyboard") != 0)
+ mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
+
+ // only scan the list if we haven't already enabled this class of control
+ if (first_port() != NULL && !machine().input().device_class(autoenable).enabled())
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
- return curstate;
+ // if this port type is in use, apply the autoselect criteria
+ if ((type1 != 0 && field->type() == type1) || (type2 != 0 && field->type() == type2) || (type3 != 0 && field->type() == type3))
+ {
+ mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
+ machine().input().device_class(autoenable).enable();
+ break;
+ }
}
+//-------------------------------------------------
+// exit - exit callback to ensure we clean up
+// and close our files
+//-------------------------------------------------
-/***************************************************************************
- PORT CONFIGURATION HELPERS
-***************************************************************************/
-
-/*-------------------------------------------------
- port_default_value - updates default value
- of port settings according to device settings
--------------------------------------------------*/
-
-UINT32 port_default_value(const char *fulltag, UINT32 mask, UINT32 defval, device_t &owner)
+void ioport_manager::exit()
{
- const input_device_default *def = owner.input_ports_defaults();
- if (def != NULL)
- {
- astring fullpath;
- for ( ; def->tag != NULL; def++)
- if (owner.subtag(fullpath, def->tag) == fulltag && def->mask == mask)
- return def->defvalue;
- }
- return defval;
+ // close any playback or recording files
+ playback_end();
+ record_end();
}
-/*-------------------------------------------------
- input_port_config - constructor for an
- I/O port configuration object
--------------------------------------------------*/
+//-------------------------------------------------
+// type_name - return the name for the given
+// type/player
+//-------------------------------------------------
-input_port_config::input_port_config(device_t &owner, const char *tag)
- : state(NULL),
- active(0),
- m_next(NULL),
- m_owner(owner),
- m_tag(tag),
- m_modcount(0)
+const char *ioport_manager::type_name(ioport_type type, UINT8 player)
{
+ // if we have a machine, use the live state and quick lookup
+ input_type_entry *entry = m_type_to_entry[type][player];
+ if (entry != NULL)
+ return entry->name();
+
+ // if we find nothing, return an invalid group
+ return "???";
}
-running_machine &input_port_config::machine() const
+//-------------------------------------------------
+// type_group - return the group for the given
+// type/player
+//-------------------------------------------------
+
+ioport_group ioport_manager::type_group(ioport_type type, int player)
{
- return m_owner.machine();
+ input_type_entry *entry = m_type_to_entry[type][player];
+ if (entry != NULL)
+ return entry->group();
+
+ // if we find nothing, return an invalid group
+ return IPG_INVALID;
}
-/*-------------------------------------------------
- field_config_alloc - allocate a new input
- port field config
--------------------------------------------------*/
+//-------------------------------------------------
+// type_seq - return the input sequence for the
+// given type/player
+//-------------------------------------------------
-input_field_config::input_field_config(input_port_config &port, int _type, input_port_value _defvalue, input_port_value _maskbits, const char *_name)
- : mask(_maskbits),
- defvalue(_defvalue & _maskbits),
- type(_type),
- player(0),
- flags(0),
- impulse(0),
- name(_name),
- read_param(NULL),
- read_device(DEVICE_SELF),
- write_param(NULL),
- write_device(DEVICE_SELF),
- min(0),
- max(_maskbits),
- sensitivity(0),
- delta(0),
- centerdelta(0),
- crossaxis(0),
- crossscale(0),
- crossoffset(0),
- crossaltaxis(0),
- crossmapper_device(DEVICE_SELF),
- full_turn_count(0),
- remap_table(NULL),
- way(0),
- state(NULL),
- m_next(NULL),
- m_port(port),
- m_modcount(port.modcount())
+const input_seq &ioport_manager::type_seq(ioport_type type, int player, input_seq_type seqtype)
{
- memset(&condition, 0, sizeof(condition));
- for (int seqtype = 0; seqtype < ARRAY_LENGTH(seq); seqtype++)
- seq[seqtype].set_default();
- chars[0] = chars[1] = chars[2] = (unicode_char) 0;
+ assert(type >= 0 && type < IPT_COUNT);
+ assert(player >= 0 && player < MAX_PLAYERS);
+
+ // if we have a machine, use the live state and quick lookup
+ input_type_entry *entry = m_type_to_entry[type][player];
+ if (entry != NULL)
+ return entry->seq(seqtype);
+
+ // if we find nothing, return an empty sequence
+ return input_seq::empty_seq;
}
-input_setting_config::input_setting_config(input_field_config &field, input_port_value _value, const char *_name)
- : value(_value),
- name(_name),
- m_field(field),
- m_next(NULL)
+//-------------------------------------------------
+// set_type_seq - change the input sequence for
+// the given type/player
+//-------------------------------------------------
+
+void ioport_manager::set_type_seq(ioport_type type, int player, input_seq_type seqtype, const input_seq &newseq)
{
- memset(&condition, 0, sizeof(condition));
+ input_type_entry *entry = m_type_to_entry[type][player];
+ if (entry != NULL)
+ entry->m_seq[seqtype] = newseq;
}
-input_field_diplocation::input_field_diplocation(const char *string, UINT8 _swnum, bool _invert)
- : swname(string),
- swnum(_swnum),
- invert(_invert)
+
+//-------------------------------------------------
+// type_pressed - return true if the sequence for
+// the given input type/player is pressed
+//-------------------------------------------------
+
+bool ioport_manager::type_pressed(ioport_type type, int player)
{
+ return machine().input().seq_pressed(type_seq(type, player));
}
-/*-------------------------------------------------
- field_config_insert - insert an allocated
- input port field config, replacing any
- intersecting fields already present and
- inserting at the correct sorted location
--------------------------------------------------*/
-void input_port_config::collapse_fields(astring &errorbuf)
+//-------------------------------------------------
+// type_class_present - return true if the given
+// ioport_type_class exists in at least one port
+//-------------------------------------------------
+
+bool ioport_manager::type_class_present(ioport_type_class inputclass)
{
- input_field_config *list = m_fieldlist.detach_all();
- input_port_value maskbits = 0;
- int lastmodcount = -1;
- while (list != NULL)
- {
- if (list->modcount() != lastmodcount)
- {
- lastmodcount = list->modcount();
- maskbits = 0;
- }
- input_field_config *current = list;
- list = list->next();
- field_config_insert(*current, maskbits, errorbuf);
- }
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->type_class() == inputclass)
+ return true;
+ return false;
}
-void field_config_insert(input_field_config &newfield, input_port_value &disallowedbits, astring &errorbuf)
-{
- input_port_value lowbit;
- /* verify against the disallowed bits, but only if we are condition-free */
- if (newfield.condition.condition == PORTCOND_ALWAYS)
- {
- if ((newfield.mask & disallowedbits) != 0)
- errorbuf.catprintf("INPUT_TOKEN_FIELD specifies duplicate port bits (port=%s mask=%X)\n", newfield.port().tag(), newfield.mask);
- disallowedbits |= newfield.mask;
- }
+//-------------------------------------------------
+// has_keyboard - determine if there is a
+// keyboard present in the control list
+//-------------------------------------------------
- /* first modify/nuke any entries that intersect our maskbits */
- input_field_config *nextfield;
- for (input_field_config *field = newfield.port().fieldlist().first(); field != NULL; field = nextfield)
- {
- nextfield = field->next();
- if ((field->mask & newfield.mask) != 0 && (newfield.condition.condition == PORTCOND_ALWAYS ||
- field->condition.condition == PORTCOND_ALWAYS ||
- condition_equal(&field->condition, &newfield.condition)))
+bool ioport_manager::has_keyboard() const
+{
+ // iterate over ports and fields
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
{
- /* reduce the mask of the field we found */
- field->mask &= ~newfield.mask;
+ // if we are at init, check IPT_KEYBOARD
+ if (!m_safe_to_read && field->type() == IPT_KEYBOARD)
+ return true;
- /* if the new entry fully overrides the previous one, we nuke */
- if (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS || field->mask == 0)
- newfield.port().fieldlist().remove(*field);
+ // else, check if there is a keyboard and if such a keyboard is enabled
+ if (field->type() == IPT_KEYBOARD && field->enabled())
+ return true;
}
- }
- /* make a mask of just the low bit */
- lowbit = (newfield.mask ^ (newfield.mask - 1)) & newfield.mask;
+ return false;
+}
+
+//-------------------------------------------------
+// count_players - counts the number of active
+// players
+//-------------------------------------------------
- /* scan forward to find where to insert ourselves */
- input_field_config *field;
- for (field = newfield.port().fieldlist().first(); field != NULL; field = field->next())
- if (field->mask > lowbit)
- break;
+int ioport_manager::count_players() const
+{
+ int max_player = 0;
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->type_class() == INPUT_CLASS_CONTROLLER && max_player <= field->player() + 1)
+ max_player = field->player() + 1;
- /* insert it into the list */
- newfield.port().fieldlist().insert_before(newfield, field);
+ return max_player;
}
-/*-------------------------------------------------
- diplocation_expand - expand a string-based
- DIP location into a linked list of
- descriptions
--------------------------------------------------*/
+//-------------------------------------------------
+// crosshair_position - return the extracted
+// crosshair values for the given player
+//-------------------------------------------------
-void diplocation_list_alloc(input_field_config &field, const char *location, astring &errorbuf)
+bool ioport_manager::crosshair_position(int player, float &x, float &y)
{
- /* if nothing present, bail */
- if (location == NULL)
- return;
-
- field.diploclist().reset();
+ // read all the lightgun values
+ bool gotx = false, goty = false;
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->player() == player && field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->enabled())
+ {
+ field->crosshair_position(x, y, gotx, goty);
- /* parse the string */
- astring name; // Don't move this variable inside the loop, lastname's lifetime depends on it being outside
- const char *lastname = NULL;
- const char *curentry = location;
- int entries = 0;
- while (*curentry != 0)
- {
- /* find the end of this entry */
- const char *comma = strchr(curentry, ',');
- if (comma == NULL)
- comma = curentry + strlen(curentry);
+ // if we got both, stop
+ if (gotx && goty)
+ break;
+ }
- /* extract it to tempbuf */
- astring tempstr;
- tempstr.cpy(curentry, comma - curentry);
+ return (gotx && goty);
+}
- /* first extract the switch name if present */
- const char *number = tempstr;
- const char *colon = strchr(tempstr, ':');
- /* allocate and copy the name if it is present */
- if (colon != NULL)
- {
- lastname = name.cpy(number, colon - number);
- number = colon + 1;
- }
+//-------------------------------------------------
+// update_defaults - force an update to the input
+// port values based on current conditions
+//-------------------------------------------------
- /* otherwise, just copy the last name */
- else
+void ioport_manager::update_defaults()
+{
+ // two passes to catch conditionals properly
+ for (int loopnum = 0; loopnum < 2; loopnum++)
+ {
+ // loop over all input ports
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
{
- if (lastname == NULL)
- {
- errorbuf.catprintf("Switch location '%s' missing switch name!\n", location);
- lastname = (char *)"UNK";
- }
- name.cpy(lastname);
- }
+ // only clear on the first pass
+ if (loopnum == 0)
+ port->live().defvalue = 0;
- /* if the number is preceded by a '!' it's active high */
- bool invert = false;
- if (*number == '!')
- {
- invert = true;
- number++;
+ // first compute the default value for the entire port
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (field->enabled())
+ port->live().defvalue = (port->live().defvalue & ~field->mask()) | (field->live().value & field->mask());
}
+ }
+}
- /* now scan the switch number */
- int swnum = -1;
- if (sscanf(number, "%d", &swnum) != 1)
- errorbuf.catprintf("Switch location '%s' has invalid format!\n", location);
-
- /* allocate a new entry */
- field.diploclist().append(*global_alloc(input_field_diplocation(name, swnum, invert)));
- entries++;
- /* advance to the next item */
- curentry = comma;
- if (*curentry != 0)
- curentry++;
- }
+//-------------------------------------------------
+// frame_update - core logic for per-frame input
+// port updating
+//-------------------------------------------------
- /* then verify the number of bits in the mask matches */
- input_port_value temp;
- int bits;
- for (bits = 0, temp = field.mask; temp != 0 && bits < 32; bits++)
- temp &= temp - 1;
- if (bits != entries)
- errorbuf.catprintf("Switch location '%s' does not describe enough bits for mask %X\n", location, field.mask);
+digital_joystick &ioport_manager::digjoystick(int player, int number)
+{
+ // find it in the list
+ for (digital_joystick *joystick = m_joystick_list.first(); joystick != NULL; joystick = joystick->next())
+ if (joystick->player() == player && joystick->number() == number)
+ return *joystick;
+
+ // create a new one
+ return m_joystick_list.append(*global_alloc(digital_joystick(player, number)));
}
+//-------------------------------------------------
+// frame_update - core logic for per-frame input
+// port updating
+//-------------------------------------------------
-/***************************************************************************
- TOKENIZATION HELPERS
-***************************************************************************/
+void ioport_manager::frame_update()
+{
+ // if we're paused, don't do anything
+ if (machine().paused())
+ return;
-/*-------------------------------------------------
- token_to_input_field_type - convert a string
- token to an input field type and player
--------------------------------------------------*/
+g_profiler.start(PROFILER_INPUT);
-static int token_to_input_field_type(running_machine &machine, const char *string, int *player)
-{
- ioport_manager &portdata = machine.ioport();
- int ipnum;
+ // record/playback information about the current frame
+ attotime curtime = machine().time();
+ playback_frame(curtime);
+ record_frame(curtime);
- /* check for our failsafe case first */
- if (sscanf(string, "TYPE_OTHER(%d,%d)", &ipnum, player) == 2)
- return ipnum;
+ // track the duration of the previous frame
+ m_last_delta_nsec = (curtime - m_last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ m_last_frame_time = curtime;
- /* find the token in the list */
- for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
- if (entry->token != NULL && !strcmp(entry->token, string))
- {
- *player = entry->player;
- return entry->type;
- }
+ // update the digital joysticks
+ for (digital_joystick *joystick = m_joystick_list.first(); joystick != NULL; joystick = joystick->next())
+ joystick->frame_update();
- /* if we fail, return IPT_UNKNOWN */
- *player = 0;
- return IPT_UNKNOWN;
-}
+ // compute default values for all the ports
+ update_defaults();
+ // perform mouse hit testing
+ INT32 mouse_target_x, mouse_target_y;
+ int mouse_button;
+ render_target *mouse_target = ui_input_find_mouse(machine(), &mouse_target_x, &mouse_target_y, &mouse_button);
-/*-------------------------------------------------
- input_field_type_to_token - convert an input
- field type and player to a string token
--------------------------------------------------*/
+ // if the button is pressed, map the point and determine what was hit
+ ioport_field *mouse_field = NULL;
+ if (mouse_button && mouse_target != NULL)
+ {
+ const char *tag = NULL;
+ ioport_value mask;
+ float x, y;
+ if (mouse_target->map_point_input(mouse_target_x, mouse_target_y, tag, mask, x, y))
+ {
+ ioport_port *port = machine().root_device().ioport(tag);
+ if (port != NULL)
+ mouse_field = port->field(mask);
+ }
+ }
-static const char *input_field_type_to_token(running_machine &machine, int type, int player)
-{
- ioport_manager &portdata = machine.ioport();
- static char tempbuf[32];
+ // loop over all input ports
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ {
+ port->frame_update(mouse_field);
- /* look up the port and return the token */
- input_type_entry *entry = portdata.type_to_entry[type][player];
- if (entry != NULL)
- return entry->token;
+ // handle playback/record
+ playback_port(*port);
+ record_port(*port);
+ }
- /* if that fails, carry on */
- sprintf(tempbuf, "TYPE_OTHER(%d,%d)", type, player);
- return tempbuf;
+g_profiler.stop();
}
-/*-------------------------------------------------
- token_to_seq_type - convert a string to
- a sequence type
--------------------------------------------------*/
+//-------------------------------------------------
+// frame_interpolate - interpolate between two
+// values based on the time between frames
+//-------------------------------------------------
-static int token_to_seq_type(const char *string)
+ioport_value ioport_manager::frame_interpolate(ioport_value oldval, ioport_value newval)
{
- int seqindex;
+ // if no last delta, just use new value
+ if (m_last_delta_nsec == 0)
+ return newval;
- /* look up the string in the table of possible sequence types and return the index */
- for (seqindex = 0; seqindex < ARRAY_LENGTH(seqtypestrings); seqindex++)
- if (!mame_stricmp(string, seqtypestrings[seqindex]))
- return seqindex;
-
- return -1;
+ // otherwise, interpolate
+ attoseconds_t nsec_since_last = (machine().time() - m_last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ return oldval + (INT64(newval - oldval) * nsec_since_last / m_last_delta_nsec);
}
+//-------------------------------------------------
+// load_config - callback to extract configuration
+// data from the XML nodes
+//-------------------------------------------------
-/***************************************************************************
- SETTINGS LOAD
-***************************************************************************/
-
-/*-------------------------------------------------
- load_config_callback - callback to extract
- configuration data from the XML nodes
--------------------------------------------------*/
-
-static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
+void ioport_manager::load_config(int config_type, xml_data_node *parentnode)
{
- ioport_manager &portdata = machine.ioport();
- xml_data_node *portnode;
- int seqtype;
-
- /* in the completion phase, we finish the initialization with the final ports */
+ // in the completion phase, we finish the initialization with the final ports
if (config_type == CONFIG_TYPE_FINAL)
{
- portdata.safe_to_read = TRUE;
- frame_update(machine);
+ m_safe_to_read = true;
+ frame_update();
}
- /* early exit if no data to parse */
+ // early exit if no data to parse
if (parentnode == NULL)
return;
- /* iterate over all the remap nodes for controller configs only */
+ // iterate over all the remap nodes for controller configs only
if (config_type == CONFIG_TYPE_CONTROLLER)
- load_remap_table(machine, parentnode);
+ load_remap_table(parentnode);
- /* iterate over all the port nodes */
- for (portnode = xml_get_sibling(parentnode->child, "port"); portnode; portnode = xml_get_sibling(portnode->next, "port"))
+ // iterate over all the port nodes
+ for (xml_data_node *portnode = xml_get_sibling(parentnode->child, "port"); portnode; portnode = xml_get_sibling(portnode->next, "port"))
{
- input_seq newseq[SEQ_TYPE_TOTAL], tempseq;
- xml_data_node *seqnode;
- int type, player;
+ // get the basic port info from the attributes
+ int player;
+ int type = token_to_input_type(xml_get_attribute_string(portnode, "type", ""), player);
- /* get the basic port info from the attributes */
- type = token_to_input_field_type(machine, xml_get_attribute_string(portnode, "type", ""), &player);
-
- /* initialize sequences to invalid defaults */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(newseq); seqtype++)
+ // initialize sequences to invalid defaults
+ input_seq newseq[SEQ_TYPE_TOTAL];
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
newseq[seqtype].set(INPUT_CODE_INVALID);
- /* loop over new sequences */
- for (seqnode = xml_get_sibling(portnode->child, "newseq"); seqnode; seqnode = xml_get_sibling(seqnode->next, "newseq"))
+ // loop over new sequences
+ for (xml_data_node *seqnode = xml_get_sibling(portnode->child, "newseq"); seqnode; seqnode = xml_get_sibling(seqnode->next, "newseq"))
{
- /* with a valid type, parse out the new sequence */
- seqtype = token_to_seq_type(xml_get_attribute_string(seqnode, "type", ""));
+ // with a valid type, parse out the new sequence
+ input_seq_type seqtype = token_to_seq_type(xml_get_attribute_string(seqnode, "type", ""));
if (seqtype != -1 && seqnode->value != NULL)
{
if (strcmp(seqnode->value, "NONE") == 0)
newseq[seqtype].set();
else
- machine.input().seq_from_tokens(newseq[seqtype], seqnode->value);
+ machine().input().seq_from_tokens(newseq[seqtype], seqnode->value);
}
}
- /* if we're loading default ports, apply to the defaults */
+ // if we're loading default ports, apply to the defaults
if (config_type != CONFIG_TYPE_GAME)
- load_default_config(machine, portnode, type, player, newseq);
+ load_default_config(portnode, type, player, newseq);
else
- load_game_config(machine, portnode, type, player, newseq);
+ load_game_config(portnode, type, player, newseq);
}
- /* after applying the controller config, push that back into the backup, since that is */
- /* what we will diff against */
+ // after applying the controller config, push that back into the backup, since that is
+ // what we will diff against
if (config_type == CONFIG_TYPE_CONTROLLER)
- for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
- for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
- entry->defseq[seqtype] = entry->seq[seqtype];
+ for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ entry->defseq(seqtype) = entry->seq(seqtype);
}
-/*-------------------------------------------------
- load_remap_table - extract and apply the
- global remapping table
--------------------------------------------------*/
+//-------------------------------------------------
+// load_remap_table - extract and apply the
+// global remapping table
+//-------------------------------------------------
-static void load_remap_table(running_machine &machine, xml_data_node *parentnode)
+void ioport_manager::load_remap_table(xml_data_node *parentnode)
{
- ioport_manager &portdata = machine.ioport();
- input_code *oldtable, *newtable;
- xml_data_node *remapnode;
- int count;
-
- /* count items first so we can allocate */
- count = 0;
- for (remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
+ // count items first so we can allocate
+ int count = 0;
+ for (xml_data_node *remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
count++;
- /* if we have some, deal with them */
+ // if we have some, deal with them
if (count > 0)
{
- int remapnum;
-
- /* allocate tables */
- oldtable = global_alloc_array(input_code, count);
- newtable = global_alloc_array(input_code, count);
+ // allocate tables
+ dynamic_array<input_code> oldtable(count);
+ dynamic_array<input_code> newtable(count);
- /* build up the remap table */
+ // build up the remap table
count = 0;
- for (remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
+ for (xml_data_node *remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap"))
{
- input_code origcode = machine.input().code_from_token(xml_get_attribute_string(remapnode, "origcode", ""));
- input_code newcode = machine.input().code_from_token(xml_get_attribute_string(remapnode, "newcode", ""));
+ input_code origcode = machine().input().code_from_token(xml_get_attribute_string(remapnode, "origcode", ""));
+ input_code newcode = machine().input().code_from_token(xml_get_attribute_string(remapnode, "newcode", ""));
if (origcode != INPUT_CODE_INVALID && newcode != INPUT_CODE_INVALID)
{
oldtable[count] = origcode;
@@ -3214,214 +3115,187 @@ static void load_remap_table(running_machine &machine, xml_data_node *parentnode
}
}
- /* loop over the remapping table, operating only if something was specified */
- for (remapnum = 0; remapnum < count; remapnum++)
- {
- input_code oldcode = oldtable[remapnum];
- input_code newcode = newtable[remapnum];
-
- /* loop over all default ports, remapping the requested keys */
- for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
- {
- /* remap anything in the default sequences */
- for (int seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
- entry->seq[seqtype].replace(oldcode, newcode);
- }
- }
-
- /* release the tables */
- global_free(oldtable);
- global_free(newtable);
+ // loop over the remapping table, then over default ports, replacing old with new
+ for (int remapnum = 0; remapnum < count; remapnum++)
+ for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ entry->m_seq[seqtype].replace(oldtable[remapnum], newtable[remapnum]);
}
}
-/*-------------------------------------------------
- load_default_config - apply configuration
- data to the default mappings
--------------------------------------------------*/
+//-------------------------------------------------
+// load_default_config - apply configuration
+// data to the default mappings
+//-------------------------------------------------
-static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
+bool ioport_manager::load_default_config(xml_data_node *portnode, int type, int player, const input_seq *newseq)
{
- ioport_manager &portdata = machine.ioport();
-
- /* find a matching port in the list */
- for (input_type_entry *entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
- if (entry->type == type && entry->player == player)
+ // find a matching port in the list
+ for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
+ if (entry->type() == type && entry->player() == player)
{
- for (int seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
if (newseq[seqtype][0] != INPUT_CODE_INVALID)
- entry->seq[seqtype] = newseq[seqtype];
- return TRUE;
+ entry->m_seq[seqtype] = newseq[seqtype];
+ return true;
}
- return FALSE;
+ return false;
}
-/*-------------------------------------------------
- load_game_config - apply configuration
- data to the current set of input ports
--------------------------------------------------*/
+//-------------------------------------------------
+// load_game_config - apply configuration
+// data to the current set of input ports
+//-------------------------------------------------
-static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
+bool ioport_manager::load_game_config(xml_data_node *portnode, int type, int player, const input_seq *newseq)
{
- input_port_value mask, defvalue;
- const input_field_config *field;
- const input_port_config *port;
- char tempbuffer[20];
- const char *tag;
-
- /* read the mask, index, and defvalue attributes */
- tag = xml_get_attribute_string(portnode, "tag", NULL);
- mask = xml_get_attribute_int(portnode, "mask", 0);
- defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
+ // read the mask, index, and defvalue attributes
+ const char *tag = xml_get_attribute_string(portnode, "tag", NULL);
+ ioport_value mask = xml_get_attribute_int(portnode, "mask", 0);
+ ioport_value defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
- /* find the port we want; if no tag, search them all */
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- if (tag == NULL || strcmp(get_port_tag(port, tempbuffer), tag) == 0)
- for (field = port->first_field(); field != NULL; field = field->next())
+ // find the port we want; if no tag, search them all
+ for (ioport_port *port = first_port(); port != NULL; port = port->next())
+ if (tag == NULL || strcmp(port->tag(), tag) == 0)
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
- /* find the matching mask and defvalue */
- if (field->type == type && field->player == player &&
- field->mask == mask && (field->defvalue & mask) == (defvalue & mask))
+ // find the matching mask and defvalue
+ if (field->type() == type && field->player() == player &&
+ field->mask() == mask && (field->defvalue() & mask) == (defvalue & mask))
{
- const char *revstring;
- int seqtype;
-
- /* if a sequence was specified, copy it in */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
+ // if a sequence was specified, copy it in
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
if (newseq[seqtype][0] != INPUT_CODE_INVALID)
- field->state->seq[seqtype] = newseq[seqtype];
+ field->live().seq[seqtype] = newseq[seqtype];
- /* for non-analog fields, fetch the value */
- if (field->state->analog == NULL)
- field->state->value = xml_get_attribute_int(portnode, "value", field->defvalue);
+ // for non-analog fields, fetch the value
+ if (field->live().analog == NULL)
+ field->live().value = xml_get_attribute_int(portnode, "value", field->defvalue());
- /* for analog fields, fetch configurable analog attributes */
+ // for analog fields, fetch configurable analog attributes
else
{
- /* get base attributes */
- field->state->analog->delta = xml_get_attribute_int(portnode, "keydelta", field->delta);
- field->state->analog->centerdelta = xml_get_attribute_int(portnode, "centerdelta", field->centerdelta);
- field->state->analog->sensitivity = xml_get_attribute_int(portnode, "sensitivity", field->sensitivity);
+ // get base attributes
+ field->live().analog->m_delta = xml_get_attribute_int(portnode, "keydelta", field->delta());
+ field->live().analog->m_centerdelta = xml_get_attribute_int(portnode, "centerdelta", field->centerdelta());
+ field->live().analog->m_sensitivity = xml_get_attribute_int(portnode, "sensitivity", field->sensitivity());
- /* fetch yes/no for reverse setting */
- revstring = xml_get_attribute_string(portnode, "reverse", NULL);
+ // fetch yes/no for reverse setting
+ const char *revstring = xml_get_attribute_string(portnode, "reverse", NULL);
if (revstring != NULL)
- field->state->analog->reverse = (strcmp(revstring, "yes") == 0);
+ field->live().analog->m_reverse = (strcmp(revstring, "yes") == 0);
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-/***************************************************************************
- SETTINGS SAVE
-***************************************************************************/
+//**************************************************************************
+// SETTINGS SAVE
+//**************************************************************************
-/*-------------------------------------------------
- save_config_callback - config callback for
- saving input port configuration
--------------------------------------------------*/
+//-------------------------------------------------
+// save_config - config callback for saving input
+// port configuration
+//-------------------------------------------------
-static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
+void ioport_manager::save_config(int config_type, xml_data_node *parentnode)
{
- /* if no parentnode, ignore */
+ // if no parentnode, ignore
if (parentnode == NULL)
return;
- /* default ports save differently */
+ // default ports save differently
if (config_type == CONFIG_TYPE_DEFAULT)
- save_default_inputs(machine, parentnode);
+ save_default_inputs(parentnode);
else
- save_game_inputs(machine, parentnode);
+ save_game_inputs(parentnode);
}
-/*-------------------------------------------------
- save_sequence - add a node for an input
- sequence
--------------------------------------------------*/
+//-------------------------------------------------
+// save_sequence - add a node for an input
+// sequence
+//-------------------------------------------------
-static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq &seq)
+void ioport_manager::save_sequence(xml_data_node *parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq)
{
+ // get the string for the sequence
astring seqstring;
- xml_data_node *seqnode;
-
- /* get the string for the sequence */
if (seq.length() == 0)
seqstring.cpy("NONE");
else
- machine.input().seq_to_tokens(seqstring, seq);
+ machine().input().seq_to_tokens(seqstring, seq);
- /* add the new node */
- seqnode = xml_add_child(parentnode, "newseq", seqstring);
+ // add the new node
+ xml_data_node *seqnode = xml_add_child(parentnode, "newseq", seqstring);
if (seqnode != NULL)
xml_set_attribute(seqnode, "type", seqtypestrings[type]);
}
-/*-------------------------------------------------
- save_this_input_field_type - determine if the given
- port type is worth saving
--------------------------------------------------*/
+//-------------------------------------------------
+// save_this_input_field_type - determine if the
+// given port type is worth saving
+//-------------------------------------------------
-static int save_this_input_field_type(int type)
+bool ioport_manager::save_this_input_field_type(ioport_type type)
{
switch (type)
{
case IPT_UNUSED:
case IPT_END:
case IPT_PORT:
- case IPT_VBLANK:
case IPT_UNKNOWN:
- return FALSE;
+ return false;
+
+ default:
+ break;
}
- return TRUE;
+ return true;
}
-/*-------------------------------------------------
- save_default_inputs - add nodes for any default
- mappings that have changed
--------------------------------------------------*/
+//-------------------------------------------------
+// save_default_inputs - add nodes for any default
+// mappings that have changed
+//-------------------------------------------------
-static void save_default_inputs(running_machine &machine, xml_data_node *parentnode)
+void ioport_manager::save_default_inputs(xml_data_node *parentnode)
{
- ioport_manager &portdata = machine.ioport();
- input_type_entry *entry;
-
- /* iterate over ports */
- for (entry = portdata.typelist.first(); entry != NULL; entry = entry->next())
+ // iterate over ports
+ for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
{
- /* only save if this port is a type we save */
- if (save_this_input_field_type(entry->type))
+ // only save if this port is a type we save
+ if (save_this_input_field_type(entry->type()))
{
- int seqtype;
-
- /* see if any of the sequences have changed */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
- if (entry->seq[seqtype] != entry->defseq[seqtype])
+ // see if any of the sequences have changed
+ input_seq_type seqtype;
+ for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ if (entry->seq(seqtype) != entry->defseq(seqtype))
break;
- /* if so, we need to add a node */
- if (seqtype < ARRAY_LENGTH(entry->seq))
+ // if so, we need to add a node
+ if (seqtype < SEQ_TYPE_TOTAL)
{
- /* add a new port node */
+ // add a new port node
xml_data_node *portnode = xml_add_child(parentnode, "port", NULL);
if (portnode != NULL)
{
- /* add the port information and attributes */
- xml_set_attribute(portnode, "type", input_field_type_to_token(machine, entry->type, entry->player));
-
- /* add only the sequences that have changed from the defaults */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(entry->seq); seqtype++)
- if (entry->seq[seqtype] != entry->defseq[seqtype])
- save_sequence(machine, portnode, seqtype, entry->type, entry->seq[seqtype]);
+ // add the port information and attributes
+ astring tempstr;
+ xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player()));
+
+ // add only the sequences that have changed from the defaults
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ if (entry->seq(seqtype) != entry->defseq(seqtype))
+ save_sequence(portnode, seqtype, entry->type(), entry->seq(seqtype));
}
}
}
@@ -3429,79 +3303,73 @@ static void save_default_inputs(running_machine &machine, xml_data_node *parentn
}
-/*-------------------------------------------------
- save_game_inputs - add nodes for any game
- mappings that have changed
--------------------------------------------------*/
+//-------------------------------------------------
+// save_game_inputs - add nodes for any game
+// mappings that have changed
+//-------------------------------------------------
-static void save_game_inputs(running_machine &machine, xml_data_node *parentnode)
+void ioport_manager::save_game_inputs(xml_data_node *parentnode)
{
- const input_field_config *field;
- const input_port_config *port;
-
- /* iterate over ports */
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (field = port->first_field(); field != NULL; field = field->next())
- if (save_this_input_field_type(field->type))
+ // iterate over ports
+ for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
+ if (save_this_input_field_type(field->type()))
{
+ // determine if we changed
bool changed = false;
- int seqtype;
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ changed |= (field->live().seq[seqtype] != field->seq(seqtype));
- /* determine if we changed */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
- changed |= (field->state->seq[seqtype] != field->seq[seqtype]);
+ // non-analog changes
+ if (field->live().analog == NULL)
+ changed |= ((field->live().value & field->mask()) != (field->defvalue() & field->mask()));
- /* non-analog changes */
- if (field->state->analog == NULL)
- changed |= ((field->state->value & field->mask) != (field->defvalue & field->mask));
-
- /* analog changes */
+ // analog changes
else
{
- changed |= (field->state->analog->delta != field->delta);
- changed |= (field->state->analog->centerdelta != field->centerdelta);
- changed |= (field->state->analog->sensitivity != field->sensitivity);
- changed |= (field->state->analog->reverse != ((field->flags & ANALOG_FLAG_REVERSE) != 0));
+ changed |= (field->live().analog->m_delta != field->delta());
+ changed |= (field->live().analog->m_centerdelta != field->centerdelta());
+ changed |= (field->live().analog->m_sensitivity != field->sensitivity());
+ changed |= (field->live().analog->m_reverse != field->analog_reverse());
}
- /* if we did change, add a new node */
+ // if we did change, add a new node
if (changed)
{
- /* add a new port node */
+ // add a new port node
xml_data_node *portnode = xml_add_child(parentnode, "port", NULL);
if (portnode != NULL)
{
- char tempbuffer[20];
-
- /* add the identifying information and attributes */
- xml_set_attribute(portnode, "tag", get_port_tag(port, tempbuffer));
- xml_set_attribute(portnode, "type", input_field_type_to_token(machine, field->type, field->player));
- xml_set_attribute_int(portnode, "mask", field->mask);
- xml_set_attribute_int(portnode, "defvalue", field->defvalue & field->mask);
-
- /* add sequences if changed */
- for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
- if (field->state->seq[seqtype] != field->seq[seqtype])
- save_sequence(machine, portnode, seqtype, field->type, field->state->seq[seqtype]);
-
- /* write out non-analog changes */
- if (field->state->analog == NULL)
+ // add the identifying information and attributes
+ astring tempstr;
+ xml_set_attribute(portnode, "tag", port->tag());
+ xml_set_attribute(portnode, "type", input_type_to_token(tempstr, field->type(), field->player()));
+ xml_set_attribute_int(portnode, "mask", field->mask());
+ xml_set_attribute_int(portnode, "defvalue", field->defvalue() & field->mask());
+
+ // add sequences if changed
+ for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
+ if (field->live().seq[seqtype] != field->seq(seqtype))
+ save_sequence(portnode, seqtype, field->type(), field->live().seq[seqtype]);
+
+ // write out non-analog changes
+ if (field->live().analog == NULL)
{
- if ((field->state->value & field->mask) != (field->defvalue & field->mask))
- xml_set_attribute_int(portnode, "value", field->state->value & field->mask);
+ if ((field->live().value & field->mask()) != (field->defvalue() & field->mask()))
+ xml_set_attribute_int(portnode, "value", field->live().value & field->mask());
}
- /* write out analog changes */
+ // write out analog changes
else
{
- if (field->state->analog->delta != field->delta)
- xml_set_attribute_int(portnode, "keydelta", field->state->analog->delta);
- if (field->state->analog->centerdelta != field->centerdelta)
- xml_set_attribute_int(portnode, "centerdelta", field->state->analog->centerdelta);
- if (field->state->analog->sensitivity != field->sensitivity)
- xml_set_attribute_int(portnode, "sensitivity", field->state->analog->sensitivity);
- if (field->state->analog->reverse != ((field->flags & ANALOG_FLAG_REVERSE) != 0))
- xml_set_attribute(portnode, "reverse", field->state->analog->reverse ? "yes" : "no");
+ if (field->live().analog->m_delta != field->delta())
+ xml_set_attribute_int(portnode, "keydelta", field->live().analog->m_delta);
+ if (field->live().analog->m_centerdelta != field->centerdelta())
+ xml_set_attribute_int(portnode, "centerdelta", field->live().analog->m_centerdelta);
+ if (field->live().analog->m_sensitivity != field->sensitivity())
+ xml_set_attribute_int(portnode, "sensitivity", field->live().analog->m_sensitivity);
+ if (field->live().analog->m_reverse != field->analog_reverse())
+ xml_set_attribute(portnode, "reverse", field->live().analog->m_reverse ? "yes" : "no");
}
}
}
@@ -3510,311 +3378,212 @@ static void save_game_inputs(running_machine &machine, xml_data_node *parentnode
-/***************************************************************************
- INPUT PLAYBACK
-***************************************************************************/
+//**************************************************************************
+// INPUT PLAYBACK
+//**************************************************************************
-/*-------------------------------------------------
- playback_read_uint8 - read an 8-bit value
- from the playback file
--------------------------------------------------*/
+//-------------------------------------------------
+// playback_read - read a value from the playback
+// file
+//-------------------------------------------------
-static UINT8 playback_read_uint8(running_machine &machine)
+template<typename _Type>
+_Type ioport_manager::playback_read(_Type &result)
{
- ioport_manager &portdata = machine.ioport();
- UINT8 result;
+ // protect against NULL handles if previous reads fail
+ if (!m_playback_file.is_open())
+ result = 0;
- /* protect against NULL handles if previous reads fail */
- if (portdata.playback_file == NULL)
- return 0;
-
- /* read the value; if we fail, end playback */
- if (portdata.playback_file->read(&result, sizeof(result)) != sizeof(result))
+ // read the value; if we fail, end playback
+ else if (m_playback_file.read(&result, sizeof(result)) != sizeof(result))
{
- playback_end(machine, "End of file");
- return 0;
+ playback_end("End of file");
+ result = 0;
}
- /* return the appropriate value */
+ // return the appropriate value
+ else if (sizeof(result) == 8)
+ result = LITTLE_ENDIANIZE_INT64(result);
+ else if (sizeof(result) == 4)
+ result = LITTLE_ENDIANIZE_INT32(result);
+ else if (sizeof(result) == 2)
+ result = LITTLE_ENDIANIZE_INT16(result);
return result;
}
-
-/*-------------------------------------------------
- playback_read_uint32 - read a 32-bit value
- from the playback file
--------------------------------------------------*/
-
-static UINT32 playback_read_uint32(running_machine &machine)
-{
- ioport_manager &portdata = machine.ioport();
- UINT32 result;
-
- /* protect against NULL handles if previous reads fail */
- if (portdata.playback_file == NULL)
- return 0;
-
- /* read the value; if we fail, end playback */
- if (portdata.playback_file->read(&result, sizeof(result)) != sizeof(result))
- {
- playback_end(machine, "End of file");
- return 0;
- }
-
- /* return the appropriate value */
- return LITTLE_ENDIANIZE_INT32(result);
-}
-
-
-/*-------------------------------------------------
- playback_read_uint64 - read a 64-bit value
- from the playback file
--------------------------------------------------*/
-
-static UINT64 playback_read_uint64(running_machine &machine)
+template<>
+bool ioport_manager::playback_read<bool>(bool &result)
{
- ioport_manager &portdata = machine.ioport();
- UINT64 result;
-
- /* protect against NULL handles if previous reads fail */
- if (portdata.playback_file == NULL)
- return 0;
-
- /* read the value; if we fail, end playback */
- if (portdata.playback_file->read(&result, sizeof(result)) != sizeof(result))
- {
- playback_end(machine, "End of file");
- return 0;
- }
-
- /* return the appropriate value */
- return LITTLE_ENDIANIZE_INT64(result);
+ UINT8 temp;
+ playback_read(temp);
+ return result = bool(temp);
}
-/*-------------------------------------------------
- playback_init - initialize INP playback
--------------------------------------------------*/
+//-------------------------------------------------
+// playback_init - initialize INP playback
+//-------------------------------------------------
-static time_t playback_init(running_machine &machine)
+time_t ioport_manager::playback_init()
{
- const char *filename = machine.options().playback();
- ioport_manager &portdata = machine.ioport();
- UINT8 header[INP_HEADER_SIZE];
- time_t basetime;
-
- /* if no file, nothing to do */
+ // if no file, nothing to do
+ const char *filename = machine().options().playback();
if (filename[0] == 0)
return 0;
- /* open the playback file */
- portdata.playback_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_READ));
- file_error filerr = portdata.playback_file->open(filename);
+ // open the playback file
+ file_error filerr = m_playback_file.open(filename);
assert_always(filerr == FILERR_NONE, "Failed to open file for playback");
- /* read the header and verify that it is a modern version; if not, print an error */
- if (portdata.playback_file->read(header, sizeof(header)) != sizeof(header))
+ // read the header and verify that it is a modern version; if not, print an error
+ UINT8 header[INP_HEADER_SIZE];
+ if (m_playback_file.read(header, sizeof(header)) != sizeof(header))
fatalerror("Input file is corrupt or invalid (missing header)");
if (memcmp(header, "MAMEINP\0", 8) != 0)
fatalerror("Input file invalid or in an older, unsupported format");
if (header[0x10] != INP_HEADER_MAJVERSION)
fatalerror("Input file format version mismatch");
- /* output info to console */
+ // output info to console
mame_printf_info("Input file: %s\n", filename);
mame_printf_info("INP version %d.%d\n", header[0x10], header[0x11]);
- basetime = header[0x08] | (header[0x09] << 8) | (header[0x0a] << 16) | (header[0x0b] << 24) |
- ((UINT64)header[0x0c] << 32) | ((UINT64)header[0x0d] << 40) | ((UINT64)header[0x0e] << 48) | ((UINT64)header[0x0f] << 56);
+ time_t basetime = header[0x08] | (header[0x09] << 8) | (header[0x0a] << 16) | (header[0x0b] << 24) |
+ ((UINT64)header[0x0c] << 32) | ((UINT64)header[0x0d] << 40) | ((UINT64)header[0x0e] << 48) | ((UINT64)header[0x0f] << 56);
mame_printf_info("Created %s", ctime(&basetime));
mame_printf_info("Recorded using %s\n", header + 0x20);
- /* verify the header against the current game */
- if (memcmp(machine.system().name, header + 0x14, strlen(machine.system().name) + 1) != 0)
- mame_printf_info("Input file is for %s '%s', not for current %s '%s'\n", emulator_info::get_gamenoun(), header + 0x14, emulator_info::get_gamenoun(), machine.system().name);
-
- /* enable compression */
- portdata.playback_file->compress(FCOMPRESS_MEDIUM);
+ // verify the header against the current game
+ if (memcmp(machine().system().name, header + 0x14, strlen(machine().system().name) + 1) != 0)
+ mame_printf_info("Input file is for %s '%s', not for current %s '%s'\n", emulator_info::get_gamenoun(), header + 0x14, emulator_info::get_gamenoun(), machine().system().name);
+ // enable compression
+ m_playback_file.compress(FCOMPRESS_MEDIUM);
return basetime;
}
-/*-------------------------------------------------
- playback_end - end INP playback
--------------------------------------------------*/
+//-------------------------------------------------
+// playback_end - end INP playback
+//-------------------------------------------------
-static void playback_end(running_machine &machine, const char *message)
+void ioport_manager::playback_end(const char *message)
{
- ioport_manager &portdata = machine.ioport();
-
- /* only applies if we have a live file */
- if (portdata.playback_file != NULL)
+ // only applies if we have a live file
+ if (m_playback_file.is_open())
{
- /* close the file */
- auto_free(machine, portdata.playback_file);
- portdata.playback_file = NULL;
+ // close the file
+ m_playback_file.close();
- /* pop a message */
+ // pop a message
if (message != NULL)
popmessage("Playback Ended\nReason: %s", message);
- /* display speed stats */
- portdata.playback_accumulated_speed /= portdata.playback_accumulated_frames;
- mame_printf_info("Total playback frames: %d\n", (UINT32)portdata.playback_accumulated_frames);
- mame_printf_info("Average recorded speed: %d%%\n", (UINT32)((portdata.playback_accumulated_speed * 200 + 1) >> 21));
+ // display speed stats
+ m_playback_accumulated_speed /= m_playback_accumulated_frames;
+ mame_printf_info("Total playback frames: %d\n", UINT32(m_playback_accumulated_frames));
+ mame_printf_info("Average recorded speed: %d%%\n", UINT32((m_playback_accumulated_speed * 200 + 1) >> 21));
}
}
-/*-------------------------------------------------
- playback_frame - start of frame callback for
- playback
--------------------------------------------------*/
+//-------------------------------------------------
+// playback_frame - start of frame callback for
+// playback
+//-------------------------------------------------
-static void playback_frame(running_machine &machine, attotime curtime)
+void ioport_manager::playback_frame(attotime curtime)
{
- ioport_manager &portdata = machine.ioport();
-
- /* if playing back, fetch the information and verify */
- if (portdata.playback_file != NULL)
+ // if playing back, fetch the information and verify
+ if (m_playback_file.is_open())
{
+ // first the absolute time
attotime readtime;
-
- /* first the absolute time */
- readtime.seconds = playback_read_uint32(machine);
- readtime.attoseconds = playback_read_uint64(machine);
+ playback_read(readtime.seconds);
+ playback_read(readtime.attoseconds);
if (readtime != curtime)
- playback_end(machine, "Out of sync");
+ playback_end("Out of sync");
- /* then the speed */
- portdata.playback_accumulated_speed += playback_read_uint32(machine);
- portdata.playback_accumulated_frames++;
+ // then the speed
+ UINT32 curspeed;
+ m_playback_accumulated_speed += playback_read(curspeed);
+ m_playback_accumulated_frames++;
}
}
-/*-------------------------------------------------
- playback_port - per-port callback for playback
--------------------------------------------------*/
+//-------------------------------------------------
+// playback_port - per-port callback for playback
+//-------------------------------------------------
-static void playback_port(const input_port_config *port)
+void ioport_manager::playback_port(ioport_port &port)
{
- ioport_manager &portdata = port->machine().ioport();
-
- /* if playing back, fetch information about this port */
- if (portdata.playback_file != NULL)
+ // if playing back, fetch information about this port
+ if (m_playback_file.is_open())
{
- analog_field_state *analog;
-
- /* read the default value and the digital state */
- port->state->defvalue = playback_read_uint32(port->machine());
- port->state->digital = playback_read_uint32(port->machine());
+ // read the default value and the digital state
+ playback_read(port.live().defvalue);
+ playback_read(port.live().digital);
- /* loop over analog ports and save their data */
- for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
+ // loop over analog ports and save their data
+ for (analog_field *analog = port.live().analoglist.first(); analog != NULL; analog = analog->next())
{
- /* read current and previous values */
- analog->accum = playback_read_uint32(port->machine());
- analog->previous = playback_read_uint32(port->machine());
+ // read current and previous values
+ playback_read(analog->m_accum);
+ playback_read(analog->m_previous);
- /* read configuration information */
- analog->sensitivity = playback_read_uint32(port->machine());
- analog->reverse = playback_read_uint8(port->machine());
+ // read configuration information
+ playback_read(analog->m_sensitivity);
+ playback_read(analog->m_reverse);
}
}
}
+//-------------------------------------------------
+// record_write - write a value to the record file
+//-------------------------------------------------
-/***************************************************************************
- INPUT RECORDING
-***************************************************************************/
-
-/*-------------------------------------------------
- record_write_uint8 - write an 8-bit value
- to the record file
--------------------------------------------------*/
-
-static void record_write_uint8(running_machine &machine, UINT8 data)
+template<typename _Type>
+void ioport_manager::record_write(_Type value)
{
- ioport_manager &portdata = machine.ioport();
- UINT8 result = data;
-
- /* protect against NULL handles if previous reads fail */
- if (portdata.record_file == NULL)
- return;
-
- /* read the value; if we fail, end playback */
- if (portdata.record_file->write(&result, sizeof(result)) != sizeof(result))
- record_end(machine, "Out of space");
-}
-
-
-/*-------------------------------------------------
- record_write_uint32 - write a 32-bit value
- to the record file
--------------------------------------------------*/
-
-static void record_write_uint32(running_machine &machine, UINT32 data)
-{
- ioport_manager &portdata = machine.ioport();
- UINT32 result = LITTLE_ENDIANIZE_INT32(data);
-
- /* protect against NULL handles if previous reads fail */
- if (portdata.record_file == NULL)
+ // protect against NULL handles if previous reads fail
+ if (!m_record_file.is_open())
return;
- /* read the value; if we fail, end playback */
- if (portdata.record_file->write(&result, sizeof(result)) != sizeof(result))
- record_end(machine, "Out of space");
+ // read the value; if we fail, end playback
+ if (m_record_file.write(&value, sizeof(value)) != sizeof(value))
+ record_end("Out of space");
}
-
-/*-------------------------------------------------
- record_write_uint64 - write a 64-bit value
- to the record file
--------------------------------------------------*/
-
-static void record_write_uint64(running_machine &machine, UINT64 data)
+template<>
+void ioport_manager::record_write<bool>(bool value)
{
- ioport_manager &portdata = machine.ioport();
- UINT64 result = LITTLE_ENDIANIZE_INT64(data);
-
- /* protect against NULL handles if previous reads fail */
- if (portdata.record_file == NULL)
- return;
-
- /* read the value; if we fail, end playback */
- if (portdata.record_file->write(&result, sizeof(result)) != sizeof(result))
- record_end(machine, "Out of space");
+ UINT8 byte = UINT8(value);
+ record_write(byte);
}
-/*-------------------------------------------------
- record_init - initialize INP recording
--------------------------------------------------*/
+//-------------------------------------------------
+// record_init - initialize INP recording
+//-------------------------------------------------
-static void record_init(running_machine &machine)
+void ioport_manager::record_init()
{
- const char *filename = machine.options().record();
- ioport_manager &portdata = machine.ioport();
- UINT8 header[INP_HEADER_SIZE];
- system_time systime;
-
- /* if no file, nothing to do */
+ // if no file, nothing to do
+ const char *filename = machine().options().record();
if (filename[0] == 0)
return;
- /* open the record file */
- portdata.record_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
- file_error filerr = portdata.record_file->open(filename);
+ // open the record file
+ file_error filerr = m_record_file.open(filename);
assert_always(filerr == FILERR_NONE, "Failed to open file for recording");
- /* get the base time */
- machine.base_datetime(systime);
+ // get the base time
+ system_time systime;
+ machine().base_datetime(systime);
- /* fill in the header */
- memset(header, 0, sizeof(header));
+ // fill in the header
+ UINT8 header[INP_HEADER_SIZE] = { 0 };
memcpy(header, "MAMEINP\0", 8);
header[0x08] = systime.time >> 0;
header[0x09] = systime.time >> 8;
@@ -3826,1042 +3595,922 @@ static void record_init(running_machine &machine)
header[0x0f] = systime.time >> 56;
header[0x10] = INP_HEADER_MAJVERSION;
header[0x11] = INP_HEADER_MINVERSION;
- strcpy((char *)header + 0x14, machine.system().name);
+ strcpy((char *)header + 0x14, machine().system().name);
sprintf((char *)header + 0x20, "%s %s", emulator_info::get_appname(), build_version);
- /* write it */
- portdata.record_file->write(header, sizeof(header));
+ // write it
+ m_record_file.write(header, sizeof(header));
- /* enable compression */
- portdata.record_file->compress(FCOMPRESS_MEDIUM);
+ // enable compression
+ m_record_file.compress(FCOMPRESS_MEDIUM);
}
-/*-------------------------------------------------
- record_end - end INP recording
--------------------------------------------------*/
+//-------------------------------------------------
+// record_end - end INP recording
+//-------------------------------------------------
-static void record_end(running_machine &machine, const char *message)
+void ioport_manager::record_end(const char *message)
{
- ioport_manager &portdata = machine.ioport();
-
- /* only applies if we have a live file */
- if (portdata.record_file != NULL)
+ // only applies if we have a live file
+ if (m_record_file.is_open())
{
- /* close the file */
- auto_free(machine, portdata.record_file);
- portdata.record_file = NULL;
+ // close the file
+ m_record_file.close();
- /* pop a message */
+ // pop a message
if (message != NULL)
popmessage("Recording Ended\nReason: %s", message);
}
}
-/*-------------------------------------------------
- record_frame - start of frame callback for
- recording
--------------------------------------------------*/
+//-------------------------------------------------
+// record_frame - start of frame callback for
+// recording
+//-------------------------------------------------
-static void record_frame(running_machine &machine, attotime curtime)
+void ioport_manager::record_frame(attotime curtime)
{
- ioport_manager &portdata = machine.ioport();
-
- /* if recording, record information about the current frame */
- if (portdata.record_file != NULL)
+ // if recording, record information about the current frame
+ if (m_record_file.is_open())
{
- /* first the absolute time */
- record_write_uint32(machine, curtime.seconds);
- record_write_uint64(machine, curtime.attoseconds);
+ // first the absolute time
+ record_write(curtime.seconds);
+ record_write(curtime.attoseconds);
- /* then the current speed */
- record_write_uint32(machine, machine.video().speed_percent() * (double)(1 << 20));
+ // then the current speed
+ record_write(UINT32(machine().video().speed_percent() * double(1 << 20)));
}
}
-/*-------------------------------------------------
- record_port - per-port callback for record
--------------------------------------------------*/
+//-------------------------------------------------
+// record_port - per-port callback for record
+//-------------------------------------------------
-static void record_port(const input_port_config *port)
+void ioport_manager::record_port(ioport_port &port)
{
- ioport_manager &portdata = port->machine().ioport();
-
- /* if recording, store information about this port */
- if (portdata.record_file != NULL)
+ // if recording, store information about this port
+ if (m_record_file.is_open())
{
- analog_field_state *analog;
+ // store the default value and digital state
+ record_write(port.live().defvalue);
+ record_write(port.live().digital);
- /* store the default value and digital state */
- record_write_uint32(port->machine(), port->state->defvalue);
- record_write_uint32(port->machine(), port->state->digital);
-
- /* loop over analog ports and save their data */
- for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
+ // loop over analog ports and save their data
+ for (analog_field *analog = port.live().analoglist.first(); analog != NULL; analog = analog->next())
{
- /* store current and previous values */
- record_write_uint32(port->machine(), analog->accum);
- record_write_uint32(port->machine(), analog->previous);
+ // store current and previous values
+ record_write(analog->m_accum);
+ record_write(analog->m_previous);
- /* store configuration information */
- record_write_uint32(port->machine(), analog->sensitivity);
- record_write_uint8(port->machine(), analog->reverse);
+ // store configuration information
+ record_write(analog->m_sensitivity);
+ record_write(analog->m_reverse);
}
}
}
-int input_machine_has_keyboard(running_machine &machine)
-{
- int have_keyboard = FALSE;
- const input_field_config *field;
- const input_port_config *port;
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- {
- for (field = port->first_field(); field != NULL; field = field->next())
- {
- // if we are at init, check IPT_KEYBOARD for inputx_init
- if (!port->machine().ioport().safe_to_read && field->type == IPT_KEYBOARD)
- {
- have_keyboard = TRUE;
- break;
- }
- // else, check if there is a keyboard and if such a keyboard is enabled
- if (field->type == IPT_KEYBOARD && input_condition_true(field->machine(), &field->condition, field->port().owner()))
- {
- have_keyboard = TRUE;
- break;
- }
- }
- }
- return have_keyboard;
-}
-/***************************************************************************
- CODE ASSEMBLING
-***************************************************************************/
+//**************************************************************************
+// I/O PORT CONFIGURER
+//**************************************************************************
-/*-------------------------------------------------
- code_point_string - obtain a string representation of a
- given code; used for logging and debugging
--------------------------------------------------*/
+//-------------------------------------------------
+// ioport_configurer - constructor
+//-------------------------------------------------
-static const char *code_point_string(running_machine &machine, unicode_char ch)
+ioport_configurer::ioport_configurer(device_t &owner, ioport_list &portlist, astring &errorbuf)
+ : m_owner(owner),
+ m_portlist(portlist),
+ m_errorbuf(errorbuf),
+ m_curport(NULL),
+ m_curfield(NULL),
+ m_cursetting(NULL)
{
- static char buf[16];
- const char *result = buf;
-
- switch(ch)
- {
- /* check some magic values */
- case '\0': strcpy(buf, "\\0"); break;
- case '\r': strcpy(buf, "\\r"); break;
- case '\n': strcpy(buf, "\\n"); break;
- case '\t': strcpy(buf, "\\t"); break;
-
- default:
- if ((ch >= 32) && (ch < 128))
- {
- /* seven bit ASCII is easy */
- buf[0] = (char) ch;
- buf[1] = '\0';
- }
- else if (ch >= UCHAR_MAMEKEY_BEGIN)
- {
- /* try to obtain a codename with code_name(); this can result in an empty string */
- input_code code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(ch - UCHAR_MAMEKEY_BEGIN));
- astring tempstr;
- snprintf(buf, ARRAY_LENGTH(buf), "%s", machine.input().code_name(tempstr, code));
- }
- else
- {
- /* empty string; resolve later */
- buf[0] = '\0';
- }
-
- /* did we fail to resolve? if so, we have a last resort */
- if (buf[0] == '\0')
- snprintf(buf, ARRAY_LENGTH(buf), "U+%04X", (unsigned) ch);
- break;
- }
- return result;
}
-/*-------------------------------------------------
- scan_keys - scans through input ports and
- sets up natural keyboard input mapping
--------------------------------------------------*/
+//-------------------------------------------------
+// string_from_token - convert an
+// ioport_token to a default string
+//-------------------------------------------------
-static int scan_keys(running_machine &machine, const input_port_config *portconfig, inputx_code *codes, const input_port_config * *ports, const input_field_config * *shift_ports, int keys, int shift)
+const char *ioport_configurer::string_from_token(const char *string)
{
- int code_count = 0;
- const input_port_config *port;
- const input_field_config *field;
- unicode_char code;
+ // 0 is an invalid index
+ if (string == NULL)
+ return NULL;
+
+ // if the index is greater than the count, assume it to be a pointer
+ if (FPTR(string) >= INPUT_STRING_COUNT)
+ return string;
- assert(keys < NUM_SIMUL_KEYS);
+#if FALSE // Set TRUE, If you want to take care missing-token or wrong-sorting
- for (port = portconfig; port != NULL; port = port->next())
+ // otherwise, scan the list for a matching string and return it
{
- for (field = port->first_field(); field != NULL; field = field->next())
- {
- if (field->type == IPT_KEYBOARD)
- {
- code = get_keyboard_code(field, shift);
- if (code != 0)
- {
- /* is this a shifter key? */
- if ((code >= UCHAR_SHIFT_BEGIN) && (code <= UCHAR_SHIFT_END))
- {
- shift_ports[keys] = field;
- code_count += scan_keys(machine,
- portconfig,
- codes ? &codes[code_count] : NULL,
- ports,
- shift_ports,
- keys+1,
- code - UCHAR_SHIFT_1 + 1);
- }
- else
- {
- /* not a shifter key; record normally */
- if (codes)
- {
- /* if we have a destination, record the codes used here */
- memcpy((void *) codes[code_count].field, shift_ports, sizeof(shift_ports[0]) * keys);
- codes[code_count].ch = code;
- codes[code_count].field[keys] = field;
- }
+ int index;
+ for (index = 0; index < ARRAY_LENGTH(input_port_default_strings); index++)
+ if (input_port_default_strings[index].id == FPTR(string))
+ return input_port_default_strings[index].string;
+ }
+ return "(Unknown Default)";
- /* increment the count */
- code_count++;
+#else
- if (LOG_INPUTX)
- logerror("inputx: code=%i (%s) port=%p field->name='%s'\n", (int) code, code_point_string(machine, code), port, field->name);
- }
- }
- }
- }
- }
- return code_count;
-}
+ return input_port_default_strings[FPTR(string)-1].string;
+#endif
+}
-/*-------------------------------------------------
- build_codes - given an input port table, create
- a input code table useful for mapping unicode
- chars
--------------------------------------------------*/
+//-------------------------------------------------
+// port_alloc - allocate a new port
+//-------------------------------------------------
-static inputx_code *build_codes(running_machine &machine, const input_port_config *portconfig)
+void ioport_configurer::port_alloc(const char *tag)
{
- inputx_code *codes = NULL;
- const input_port_config *ports[NUM_SIMUL_KEYS];
- const input_field_config *fields[NUM_SIMUL_KEYS];
- int code_count;
+ // create the full tag
+ astring fulltag;
+ m_owner.subtag(fulltag, tag);
+
+ // add it to the list, and reset current field/setting
+ m_curport = &m_portlist.append(fulltag, *global_alloc(ioport_port(m_owner, fulltag)));
+ m_curfield = NULL;
+ m_cursetting = NULL;
+}
- /* first count the number of codes */
- code_count = scan_keys(machine, portconfig, NULL, ports, fields, 0, 0);
- if (code_count > 0)
- {
- /* allocate the codes */
- codes = auto_alloc_array_clear(machine, inputx_code, code_count + 1);
- /* and populate them */
- scan_keys(machine, portconfig, codes, ports, fields, 0, 0);
- }
- return codes;
-}
+//-------------------------------------------------
+// port_modify - find an existing port and
+// modify it
+//-------------------------------------------------
+void ioport_configurer::port_modify(const char *tag)
+{
+ // create the full tag
+ astring fulltag;
+ m_owner.subtag(fulltag, tag);
+ // find the existing port
+ m_curport = m_portlist.find(fulltag.cstr());
+ if (m_curport == NULL)
+ throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr());
+
+ // bump the modification count, and reset current field/setting
+ m_curport->m_modcount++;
+ m_curfield = NULL;
+ m_cursetting = NULL;
+}
-/***************************************************************************
- VALIDITY CHECKS
-***************************************************************************/
-/*-------------------------------------------------
- validate_natural_keyboard_statics -
- validates natural keyboard static data
--------------------------------------------------*/
+//-------------------------------------------------
+// field_alloc - allocate a new field
+//-------------------------------------------------
-int validate_natural_keyboard_statics(void)
+void ioport_configurer::field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name)
{
- int i;
- int error = FALSE;
- unicode_char last_char = 0;
- const char_info *ci;
+ // make sure we have a port
+ if (m_curport == NULL)
+ throw emu_fatalerror("alloc_field called with no active port (mask=%X defval=%X)\n", mask, defval); \
- /* check to make sure that charinfo is in order */
- for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
- {
- if (last_char >= charinfo[i].ch)
- {
- mame_printf_error("inputx: charinfo is out of order; 0x%08x should be higher than 0x%08x\n", charinfo[i].ch, last_char);
- error = TRUE;
- }
- last_char = charinfo[i].ch;
- }
+ // append the field
+ if (type != IPT_UNKNOWN && type != IPT_UNUSED)
+ m_curport->m_active |= mask;
+ m_curfield = &m_curport->m_fieldlist.append(*global_alloc(ioport_field(*m_curport, type, defval, mask, string_from_token(name))));
- /* check to make sure that I can look up everything on alternate_charmap */
- for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
- {
- ci = find_charinfo(charinfo[i].ch);
- if (ci != &charinfo[i])
- {
- mame_printf_error("inputx: expected find_charinfo(0x%08x) to work properly\n", charinfo[i].ch);
- error = TRUE;
- }
- }
- return error;
+ // reset the current setting
+ m_cursetting = NULL;
}
+//-------------------------------------------------
+// field_add_char - add a character to a field
+//-------------------------------------------------
-/***************************************************************************
- CORE IMPLEMENTATION
-***************************************************************************/
-
-static void clear_keybuffer(running_machine &machine)
+void ioport_configurer::field_add_char(unicode_char ch)
{
- ioport_manager &portdata = machine.ioport();
- portdata.keybuffer.buffer = NULL;
- portdata.queue_chars = NULL;
- portdata.codes = NULL;
+ for (int index = 0; index < ARRAY_LENGTH(m_curfield->m_chars); index++)
+ if (m_curfield->m_chars[index] == 0)
+ {
+ m_curfield->m_chars[index] = ch;
+ break;
+ }
}
+//-------------------------------------------------
+// field_add_code - add a character to a field
+//-------------------------------------------------
-static void setup_keybuffer(running_machine &machine)
+void ioport_configurer::field_add_code(input_seq_type which, input_code code)
{
- ioport_manager &portdata = machine.ioport();
- portdata.inputx_timer = machine.scheduler().timer_alloc(FUNC(inputx_timerproc));
- portdata.keybuffer.begin_pos = 0;
- portdata.keybuffer.end_pos = 0;
- portdata.keybuffer.status_keydown = 0;
- portdata.keybuffer.size = KEY_BUFFER_SIZE;
- portdata.keybuffer.buffer = auto_alloc_array(machine, unicode_char, portdata.keybuffer.size);
- machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(clear_keybuffer), &machine));
+ m_curfield->m_seq[which] |= code;
}
+//-------------------------------------------------
+// setting_alloc - allocate a new setting
+//-------------------------------------------------
-void inputx_init(running_machine &machine)
+void ioport_configurer::setting_alloc(ioport_value value, const char *name)
{
- ioport_manager &portdata = machine.ioport();
- portdata.inputx_timer = NULL;
- portdata.accept_char = NULL;
- portdata.charqueue_empty = NULL;
- clear_keybuffer(machine);
+ // make sure we have a field
+ if (m_curfield == NULL)
+ throw emu_fatalerror("alloc_setting called with no active field (value=%X name=%s)\n", value, name);
- if (machine.debug_flags & DEBUG_FLAG_ENABLED)
- {
- debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
- debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
- }
-
- /* posting keys directly only makes sense for a computer */
- if (input_machine_has_keyboard(machine))
- {
- portdata.codes = build_codes(machine, machine.ioport().first_port());
- setup_keybuffer(machine);
- }
+ // append a new setting
+ m_curfield->m_settinglist.append(*global_alloc(ioport_setting(*m_curfield, value & m_curfield->mask(), string_from_token(name))));
}
+//-------------------------------------------------
+// set_condition - set the condition for either
+// the current setting or field
+//-------------------------------------------------
-void inputx_setup_natural_keyboard(
- running_machine &machine,
- int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
- int (*accept_char)(running_machine &machine, unicode_char ch),
- int (*charqueue_empty)(running_machine &machine))
+void ioport_configurer::set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value)
{
- ioport_manager &portdata = machine.ioport();
- portdata.queue_chars = queue_chars;
- portdata.accept_char = accept_char;
- portdata.charqueue_empty = charqueue_empty;
+ ioport_condition &target = (m_cursetting != NULL) ? m_cursetting->condition() : m_curfield->condition();
+ target.set(condition, tag, mask, value);
}
-int inputx_can_post(running_machine &machine)
-{
- ioport_manager &portdata = machine.ioport();
- return portdata.queue_chars || portdata.codes;
-}
+//-------------------------------------------------
+// onoff_alloc - allocate an on/off DIP switch
+//-------------------------------------------------
-static int can_post_key_directly(running_machine &machine, unicode_char ch)
+void ioport_configurer::onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation)
{
- ioport_manager &portdata = machine.ioport();
- int rc = FALSE;
- const inputx_code *code;
+ // allocate a field normally
+ field_alloc(IPT_DIPSWITCH, defval, mask, name);
- if (portdata.queue_chars)
- {
- rc = portdata.accept_char ? (*portdata.accept_char)(machine, ch) : TRUE;
- }
- else
+ // special case service mode
+ if (name == DEF_STR(Service_Mode))
{
- code = find_code(portdata.codes, ch);
- if (code)
- rc = code->field[0] != NULL;
+ field_set_toggle();
+ m_curfield->m_seq[SEQ_TYPE_STANDARD].set(KEYCODE_F2);
}
- return rc;
+
+ // expand the diplocation
+ if (diplocation != NULL)
+ field_set_diplocation(diplocation);
+
+ // allocate settings
+ setting_alloc(defval & mask, DEF_STR(Off));
+ setting_alloc(~defval & mask, DEF_STR(On));
}
-static int can_post_key_alternate(running_machine &machine, unicode_char ch)
-{
- const char *s;
- const char_info *ci;
- unicode_char uchar;
- int rc;
+/***************************************************************************
+ MISCELLANEOUS
+***************************************************************************/
- ci = find_charinfo(ch);
- s = ci ? ci->alternate : NULL;
- if (!s)
- return 0;
+//-------------------------------------------------
+// find - look up information about a particular
+// character
+//-------------------------------------------------
- while(*s)
+const char_info *char_info::find(unicode_char target)
+{
+ // perform a simple binary search to find the proper alternate
+ int low = 0;
+ int high = ARRAY_LENGTH(charinfo);
+ while (high > low)
{
- rc = uchar_from_utf8(&uchar, s, strlen(s));
- if (rc <= 0)
- return 0;
- if (!can_post_key_directly(machine, uchar))
- return 0;
- s += rc;
+ int middle = (high + low) / 2;
+ unicode_char ch = charinfo[middle].ch;
+ if (ch < target)
+ low = middle + 1;
+ else if (ch > target)
+ high = middle;
+ else
+ return &charinfo[middle];
}
- return 1;
+ return NULL;
}
-static attotime choose_delay(ioport_manager &portdata, unicode_char ch)
-{
- if (portdata.current_rate != attotime::zero)
- return portdata.current_rate;
- attotime delay = attotime::zero;
- if (portdata.queue_chars)
- {
- /* systems with queue_chars can afford a much smaller delay */
- delay = attotime::from_msec(10);
- }
- else
- {
- switch(ch) {
- case '\r':
- delay = attotime::from_msec(200);
- break;
+//-------------------------------------------------
+// dynamic_field - constructor
+//-------------------------------------------------
- default:
- delay = attotime::from_msec(50);
- break;
- }
- }
- return delay;
+dynamic_field::dynamic_field(ioport_field &field)
+ : m_next(NULL),
+ m_field(field),
+ m_shift(0),
+ m_oldval(field.defvalue())
+{
+ // fill in the data
+ for (ioport_value mask = field.mask(); !(mask & 1); mask >>= 1)
+ m_shift++;
+ m_oldval >>= m_shift;
}
+//-------------------------------------------------
+// read - read the updated value and merge it
+// into the target
+//-------------------------------------------------
-static void internal_post_key(running_machine &machine, unicode_char ch)
+void dynamic_field::read(ioport_value &result)
{
- ioport_manager &portdata = machine.ioport();
- key_buffer *keybuf;
+ // skip if not enabled
+ if (!m_field.enabled())
+ return;
+
+ // call the callback to read a new value
+ ioport_value newval = m_field.m_read(m_field, m_field.m_read_param);
+ m_oldval = newval;
+
+ // merge in the bits (don't invert yet, as all digitals are inverted together)
+ result = (result & ~m_field.mask()) | ((newval << m_shift) & m_field.mask());
+}
- keybuf = get_buffer(machine);
- /* need to start up the timer? */
- if (keybuf->begin_pos == keybuf->end_pos)
- {
- portdata.inputx_timer->adjust(choose_delay(portdata, ch));
- keybuf->status_keydown = 0;
- }
+//-------------------------------------------------
+// write - track a change to a value and call
+// the write callback if there's something new
+//-------------------------------------------------
+
+void dynamic_field::write(ioport_value newval)
+{
+ // skip if not enabled
+ if (!m_field.enabled())
+ return;
- keybuf->buffer[keybuf->end_pos++] = ch;
- if ((keybuf->end_pos+1) % keybuf->size == keybuf->begin_pos)
+ // if the bits have changed, call the handler
+ newval = ((newval ^ m_field.defvalue()) & m_field.mask()) >> m_shift;
+ if (m_oldval != newval)
{
- // Buffer full
- unicode_char *old_buffer = keybuf->buffer;
- keybuf->size = keybuf->size + KEY_BUFFER_SIZE;
- keybuf->buffer = auto_alloc_array(machine, unicode_char, keybuf->size);
- for( int i = keybuf->begin_pos; i <= keybuf->end_pos; i++ )
- {
- keybuf->buffer[i] = old_buffer[i];
- }
- auto_free(machine, old_buffer);
+ m_field.m_write(m_field, m_field.m_write_param, m_oldval, newval);
+ m_oldval = newval;
}
- keybuf->end_pos %= keybuf->size;
}
+//-------------------------------------------------
+// analog_field - constructor
+//-------------------------------------------------
-static int buffer_full(running_machine &machine)
-{
- key_buffer *keybuf;
- keybuf = get_buffer(machine);
- return ((keybuf->end_pos + 1) % keybuf->size) == keybuf->begin_pos;
-}
+analog_field::analog_field(ioport_field &field)
+ : m_next(NULL),
+ m_field(field),
+ m_shift(0),
+ m_adjdefvalue(field.defvalue() & field.mask()),
+ m_adjmin(field.minval() & field.mask()),
+ m_adjmax(field.maxval() & field.mask()),
+ m_sensitivity(field.sensitivity()),
+ m_reverse(field.analog_reverse()),
+ m_delta(field.delta()),
+ m_centerdelta(field.centerdelta()),
+ m_accum(0),
+ m_previous(0),
+ m_previousanalog(0),
+ m_minimum(INPUT_ABSOLUTE_MIN),
+ m_maximum(INPUT_ABSOLUTE_MAX),
+ m_center(0),
+ m_reverse_val(0),
+ m_scalepos(0),
+ m_scaleneg(0),
+ m_keyscalepos(0),
+ m_keyscaleneg(0),
+ m_positionalscale(0),
+ m_absolute(false),
+ m_wraps(false),
+ m_autocenter(false),
+ m_single_scale(false),
+ m_interpolate(false),
+ m_lastdigital(false)
+{
+ // compute the shift amount and number of bits
+ for (ioport_value mask = field.mask(); !(mask & 1); mask >>= 1)
+ m_shift++;
+
+ // initialize core data
+ m_adjdefvalue >>= m_shift;
+ m_adjmin >>= m_shift;
+ m_adjmax >>= m_shift;
+
+ // set basic parameters based on the configured type
+ switch (field.type())
+ {
+ // paddles and analog joysticks are absolute and autocenter
+ case IPT_AD_STICK_X:
+ case IPT_AD_STICK_Y:
+ case IPT_AD_STICK_Z:
+ case IPT_PADDLE:
+ case IPT_PADDLE_V:
+ m_absolute = true;
+ m_autocenter = true;
+ m_interpolate = !field.analog_reset();
+ break;
+ // pedals start at and autocenter to the min range
+ case IPT_PEDAL:
+ case IPT_PEDAL2:
+ case IPT_PEDAL3:
+ m_center = INPUT_ABSOLUTE_MIN;
+ m_accum = apply_inverse_sensitivity(m_center);
+ m_absolute = true;
+ m_autocenter = true;
+ m_interpolate = !field.analog_reset();
+ break;
+ // lightguns are absolute as well, but don't autocenter and don't interpolate their values
+ case IPT_LIGHTGUN_X:
+ case IPT_LIGHTGUN_Y:
+ m_absolute = true;
+ m_autocenter = false;
+ m_interpolate = false;
+ break;
-static void inputx_postn_rate(running_machine &machine, const unicode_char *text, size_t text_len, attotime rate)
-{
- ioport_manager &portdata = machine.ioport();
- int last_cr = 0;
- unicode_char ch;
- const char *s;
- const char_info *ci;
- const inputx_code *code;
+ // positional devices are absolute, but can also wrap like relative devices
+ // set each position to be 512 units
+ case IPT_POSITIONAL:
+ case IPT_POSITIONAL_V:
+ m_positionalscale = compute_scale(field.maxval(), INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
+ m_adjmin = 0;
+ m_adjmax = field.maxval() - 1;
+ m_wraps = field.analog_wraps();
+ m_autocenter = !m_wraps;
+ break;
- portdata.current_rate = rate;
+ // dials, mice and trackballs are relative devices
+ // these have fixed "min" and "max" values based on how many bits are in the port
+ // in addition, we set the wrap around min/max values to 512 * the min/max values
+ // this takes into account the mapping that one mouse unit ~= 512 analog units
+ case IPT_DIAL:
+ case IPT_DIAL_V:
+ case IPT_TRACKBALL_X:
+ case IPT_TRACKBALL_Y:
+ case IPT_MOUSE_X:
+ case IPT_MOUSE_Y:
+ m_absolute = false;
+ m_wraps = true;
+ m_interpolate = !field.analog_reset();
+ break;
+
+ default:
+ fatalerror("Unknown analog port type -- don't know if it is absolute or not");
+ break;
+ }
- if (inputx_can_post(machine))
+ // further processing for absolute controls
+ if (m_absolute)
{
- while((text_len > 0) && !buffer_full(machine))
- {
- ch = *(text++);
- text_len--;
+ // if the default value is pegged at the min or max, use a single scale value for the whole axis
+ m_single_scale = (m_adjdefvalue == m_adjmin) || (m_adjdefvalue == m_adjmax);
- /* change all eolns to '\r' */
- if ((ch != '\n') || !last_cr)
- {
- if (ch == '\n')
- ch = '\r';
- else
- last_cr = (ch == '\r');
+ // if not "single scale", compute separate scales for each side of the default
+ if (!m_single_scale)
+ {
+ // unsigned
+ m_scalepos = compute_scale(m_adjmax - m_adjdefvalue, INPUT_ABSOLUTE_MAX - 0);
+ m_scaleneg = compute_scale(m_adjdefvalue - m_adjmin, 0 - INPUT_ABSOLUTE_MIN);
- if (LOG_INPUTX)
- {
- code = find_code(portdata.codes, ch);
- logerror("inputx_postn(): code=%i (%s) field->name='%s'\n", (int) ch, code_point_string(machine, ch), (code && code->field[0]) ? code->field[0]->name : "<null>");
- }
+ if (m_adjmin > m_adjmax)
+ m_scaleneg = -m_scaleneg;
- if (can_post_key_directly(machine, ch))
- {
- /* we can post this key in the queue directly */
- internal_post_key(machine, ch);
- }
- else if (can_post_key_alternate(machine, ch))
- {
- /* we can post this key with an alternate representation */
- ci = find_charinfo(ch);
- assert(ci && ci->alternate);
- s = ci->alternate;
- while(*s)
- {
- s += uchar_from_utf8(&ch, s, strlen(s));
- internal_post_key(machine, ch);
- }
- }
- }
- else
- {
- last_cr = 0;
- }
+ // reverse point is at center
+ m_reverse_val = 0;
}
- }
-}
-
-
+ else
+ {
+ // single axis that increases from default
+ m_scalepos = compute_scale(m_adjmax - m_adjmin, INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN);
-static TIMER_CALLBACK(inputx_timerproc)
-{
- ioport_manager &portdata = machine.ioport();
- key_buffer *keybuf;
- attotime delay;
+ // move from default
+ if (m_adjdefvalue == m_adjmax)
+ m_scalepos = -m_scalepos;
- keybuf = get_buffer(machine);
+ // make the scaling the same for easier coding when we need to scale
+ m_scaleneg = m_scalepos;
- if (portdata.queue_chars)
- {
- /* the driver has a queue_chars handler */
- while((keybuf->begin_pos != keybuf->end_pos) && (*portdata.queue_chars)(machine, &keybuf->buffer[keybuf->begin_pos], 1))
- {
- keybuf->begin_pos++;
- keybuf->begin_pos %= keybuf->size;
-
- if (portdata.current_rate != attotime::zero)
- break;
+ // reverse point is at max
+ m_reverse_val = m_maximum;
}
}
+
+ // relative and positional controls all map directly with a 512x scale factor
else
{
- /* the driver does not have a queue_chars handler */
- if (keybuf->status_keydown)
- {
- keybuf->status_keydown = FALSE;
- keybuf->begin_pos++;
- keybuf->begin_pos %= keybuf->size;
- }
+ // The relative code is set up to allow specifing PORT_MINMAX and default values.
+ // The validity checks are purposely set up to not allow you to use anything other
+ // a default of 0 and PORT_MINMAX(0,mask). This is in case the need arises to use
+ // this feature in the future. Keeping the code in does not hurt anything.
+ if (m_adjmin > m_adjmax)
+ // adjust for signed
+ m_adjmin = -m_adjmin;
+
+ if (m_wraps)
+ m_adjmax++;
+
+ m_minimum = (m_adjmin - m_adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
+ m_maximum = (m_adjmax - m_adjdefvalue) * INPUT_RELATIVE_PER_PIXEL;
+
+ // make the scaling the same for easier coding when we need to scale
+ m_scaleneg = m_scalepos = compute_scale(1, INPUT_RELATIVE_PER_PIXEL);
+
+ if (m_field.analog_reset())
+ // delta values reverse from center
+ m_reverse_val = 0;
else
{
- keybuf->status_keydown = TRUE;
- }
- }
+ // positional controls reverse from their max range
+ m_reverse_val = m_maximum + m_minimum;
- /* need to make sure timerproc is called again if buffer not empty */
- if (keybuf->begin_pos != keybuf->end_pos)
- {
- delay = choose_delay(portdata, keybuf->buffer[keybuf->begin_pos]);
- portdata.inputx_timer->adjust(delay);
+ // relative controls reverse from 1 past their max range
+ if (m_wraps)
+ m_reverse_val -= INPUT_RELATIVE_PER_PIXEL;
+ }
}
-}
-int inputx_is_posting(running_machine &machine)
-{
- ioport_manager &portdata = machine.ioport();
- const key_buffer *keybuf;
- keybuf = get_buffer(machine);
- return (keybuf->begin_pos != keybuf->end_pos) || (portdata.charqueue_empty && !(*portdata.charqueue_empty)(machine));
+ // compute scale for keypresses
+ m_keyscalepos = recip_scale(m_scalepos);
+ m_keyscaleneg = recip_scale(m_scaleneg);
}
-/***************************************************************************
- Coded input
+//-------------------------------------------------
+// apply_min_max - clamp the given input value to
+// the appropriate min/max for the analog control
+//-------------------------------------------------
-***************************************************************************/
-static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate);
-
-static void inputx_postn_coded_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
+inline ioport_value analog_field::apply_min_max(ioport_value value) const
{
- size_t i, j, key_len, increment;
- unicode_char ch;
+ // take the analog minimum and maximum values and apply the inverse of the
+ // sensitivity so that we can clamp against them before applying sensitivity
+ INT32 adjmin = apply_inverse_sensitivity(m_minimum);
+ INT32 adjmax = apply_inverse_sensitivity(m_maximum);
- static const struct
- {
- const char *key;
- unicode_char code;
- } codes[] =
+ // for absolute devices, clamp to the bounds absolutely
+ if (!m_wraps)
{
- { "BACKSPACE", 8 },
- { "BS", 8 },
- { "BKSP", 8 },
- { "DEL", UCHAR_MAMEKEY(DEL) },
- { "DELETE", UCHAR_MAMEKEY(DEL) },
- { "END", UCHAR_MAMEKEY(END) },
- { "ENTER", 13 },
- { "ESC", '\033' },
- { "HOME", UCHAR_MAMEKEY(HOME) },
- { "INS", UCHAR_MAMEKEY(INSERT) },
- { "INSERT", UCHAR_MAMEKEY(INSERT) },
- { "PGDN", UCHAR_MAMEKEY(PGDN) },
- { "PGUP", UCHAR_MAMEKEY(PGUP) },
- { "SPACE", 32 },
- { "TAB", 9 },
- { "F1", UCHAR_MAMEKEY(F1) },
- { "F2", UCHAR_MAMEKEY(F2) },
- { "F3", UCHAR_MAMEKEY(F3) },
- { "F4", UCHAR_MAMEKEY(F4) },
- { "F5", UCHAR_MAMEKEY(F5) },
- { "F6", UCHAR_MAMEKEY(F6) },
- { "F7", UCHAR_MAMEKEY(F7) },
- { "F8", UCHAR_MAMEKEY(F8) },
- { "F9", UCHAR_MAMEKEY(F9) },
- { "F10", UCHAR_MAMEKEY(F10) },
- { "F11", UCHAR_MAMEKEY(F11) },
- { "F12", UCHAR_MAMEKEY(F12) },
- { "QUOTE", '\"' }
- };
+ if (value > adjmax)
+ value = adjmax;
+ else if (value < adjmin)
+ value = adjmin;
+ }
- i = 0;
- while(i < text_len)
+ // for relative devices, wrap around when we go past the edge
+ else
{
- ch = text[i];
- increment = 1;
-
- if (ch == '{')
- {
- for (j = 0; j < ARRAY_LENGTH(codes); j++)
- {
- key_len = strlen(codes[j].key);
- if (i + key_len + 2 <= text_len)
- {
- if (!core_strnicmp(codes[j].key, &text[i + 1], key_len) && (text[i + key_len + 1] == '}'))
- {
- ch = codes[j].code;
- increment = key_len + 2;
- }
- }
- }
- }
-
- if (ch)
- inputx_postc_rate(machine, ch, rate);
- i += increment;
+ INT32 range = adjmax - adjmin;
+ // rolls to other end when 1 position past end.
+ value = (value - adjmin) % range;
+ if (value < 0)
+ value += range;
+ value += adjmin;
}
+
+ return value;
}
+//-------------------------------------------------
+// apply_sensitivity - apply a sensitivity
+// adjustment for a current value
+//-------------------------------------------------
-/***************************************************************************
+inline ioport_value analog_field::apply_sensitivity(ioport_value value) const
+{
+ return INT32((INT64(value) * m_sensitivity) / 100.0 + 0.5);
+}
- Alternative calls
-***************************************************************************/
+//-------------------------------------------------
+// apply_inverse_sensitivity - reverse-apply the
+// sensitivity adjustment for a current value
+//-------------------------------------------------
-static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate)
+inline ioport_value analog_field::apply_inverse_sensitivity(ioport_value value) const
{
- inputx_postn_rate(machine, &ch, 1, rate);
+ return INT32((INT64(value) * 100) / m_sensitivity);
}
-void inputx_postc(running_machine &machine, unicode_char ch)
+
+//-------------------------------------------------
+// apply_settings - return the value of an
+// analog input
+//-------------------------------------------------
+
+ioport_value analog_field::apply_settings(ioport_value value) const
{
- inputx_postc_rate(machine, ch, attotime::zero);
+ // apply the min/max and then the sensitivity
+ value = apply_min_max(value);
+ value = apply_sensitivity(value);
+
+ // apply reversal if needed
+ if (m_reverse)
+ value = m_reverse_val - value;
+ else if (m_single_scale)
+ // it's a pedal or the default value is equal to min/max
+ // so we need to adjust the center to the minimum
+ value -= INPUT_ABSOLUTE_MIN;
+
+ // map differently for positive and negative values
+ if (value >= 0)
+ value = apply_scale(value, m_scalepos);
+ else
+ value = apply_scale(value, m_scaleneg);
+ value += m_adjdefvalue;
+
+ return value;
}
-static void inputx_postn_utf8_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
+
+//-------------------------------------------------
+// frame_update - update the internals of a
+// single analog field periodically
+//-------------------------------------------------
+
+void analog_field::frame_update(running_machine &machine)
{
- size_t len = 0;
- unicode_char buf[256];
- unicode_char c;
- int rc;
+ // clamp the previous value to the min/max range and remember it
+ m_previous = m_accum = apply_min_max(m_accum);
- while(text_len > 0)
+ // get the new raw analog value and its type
+ input_item_class itemclass;
+ INT32 rawvalue = machine.input().seq_axis_value(m_field.seq(SEQ_TYPE_STANDARD), itemclass);
+
+ // if we got an absolute input, it overrides everything else
+ if (itemclass == ITEM_CLASS_ABSOLUTE)
{
- if (len == ARRAY_LENGTH(buf))
+ if (m_previousanalog != rawvalue)
{
- inputx_postn_rate(machine, buf, len, attotime::zero);
- len = 0;
- }
+ // only update if analog value changed
+ m_previousanalog = rawvalue;
+
+ // apply the inverse of the sensitivity to the raw value so that
+ // it will still cover the full min->max range requested after
+ // we apply the sensitivity adjustment
+ if (m_absolute || m_field.analog_reset())
+ {
+ // if port is absolute, then just return the absolute data supplied
+ m_accum = apply_inverse_sensitivity(rawvalue);
+ }
+ else if (m_positionalscale != 0)
+ {
+ // if port is positional, we will take the full analog control and divide it
+ // into positions, that way as the control is moved full scale,
+ // it moves through all the positions
+ rawvalue = apply_scale(rawvalue - INPUT_ABSOLUTE_MIN, m_positionalscale) * INPUT_RELATIVE_PER_PIXEL + m_minimum;
+
+ // clamp the high value so it does not roll over
+ rawvalue = MIN(rawvalue, m_maximum);
+ m_accum = apply_inverse_sensitivity(rawvalue);
+ }
+ else
+ // if port is relative, we use the value to simulate the speed of relative movement
+ // sensitivity adjustment is allowed for this mode
+ m_accum += rawvalue;
- rc = uchar_from_utf8(&c, text, text_len);
- if (rc < 0)
+ m_lastdigital = false;
+ // do not bother with other control types if the analog data is changing
+ return;
+ }
+ else
{
- rc = 1;
- c = INVALID_CHAR;
+ // we still have to update fake relative from joystick control
+ if (!m_absolute && m_positionalscale == 0)
+ m_accum += rawvalue;
}
- text += rc;
- text_len -= rc;
- buf[len++] = c;
}
- inputx_postn_rate(machine, buf, len, rate);
-}
-
-void inputx_post_utf8(running_machine &machine, const char *text)
-{
- inputx_postn_utf8_rate(machine, text, strlen(text), attotime::zero);
-}
-
-void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate)
-{
- inputx_postn_utf8_rate(machine, text, strlen(text), rate);
-}
-
-/***************************************************************************
- Other stuff
+ // if we got it from a relative device, use that as the starting delta
+ // also note that the last input was not a digital one
+ INT32 delta = 0;
+ if (itemclass == ITEM_CLASS_RELATIVE && rawvalue != 0)
+ {
+ delta = rawvalue;
+ m_lastdigital = false;
+ }
- This stuff is here more out of convienience than anything else
-***************************************************************************/
+ INT64 keyscale = (m_accum >= 0) ? m_keyscalepos : m_keyscaleneg;
-int input_classify_port(const input_field_config *field)
-{
- int result;
+ // if the decrement code sequence is pressed, add the key delta to
+ // the accumulated delta; also note that the last input was a digital one
+ bool keypressed = false;
+ if (machine.input().seq_pressed(m_field.seq(SEQ_TYPE_DECREMENT)))
+ {
+ keypressed = true;
+ if (m_delta != 0)
+ delta -= apply_scale(m_delta, keyscale);
+ else if (!m_lastdigital)
+ // decrement only once when first pressed
+ delta -= apply_scale(1, keyscale);
+ m_lastdigital = true;
+ }
- switch(field->type)
+ // same for the increment code sequence
+ if (machine.input().seq_pressed(m_field.seq(SEQ_TYPE_INCREMENT)))
{
- case IPT_JOYSTICK_UP:
- case IPT_JOYSTICK_DOWN:
- case IPT_JOYSTICK_LEFT:
- case IPT_JOYSTICK_RIGHT:
- case IPT_JOYSTICKLEFT_UP:
- case IPT_JOYSTICKLEFT_DOWN:
- case IPT_JOYSTICKLEFT_LEFT:
- case IPT_JOYSTICKLEFT_RIGHT:
- case IPT_JOYSTICKRIGHT_UP:
- case IPT_JOYSTICKRIGHT_DOWN:
- case IPT_JOYSTICKRIGHT_LEFT:
- case IPT_JOYSTICKRIGHT_RIGHT:
- case IPT_BUTTON1:
- case IPT_BUTTON2:
- case IPT_BUTTON3:
- case IPT_BUTTON4:
- case IPT_BUTTON5:
- case IPT_BUTTON6:
- case IPT_BUTTON7:
- case IPT_BUTTON8:
- case IPT_BUTTON9:
- case IPT_BUTTON10:
- case IPT_AD_STICK_X:
- case IPT_AD_STICK_Y:
- case IPT_AD_STICK_Z:
- case IPT_TRACKBALL_X:
- case IPT_TRACKBALL_Y:
- case IPT_LIGHTGUN_X:
- case IPT_LIGHTGUN_Y:
- case IPT_MOUSE_X:
- case IPT_MOUSE_Y:
- case IPT_START:
- case IPT_SELECT:
- result = INPUT_CLASS_CONTROLLER;
- break;
+ keypressed = true;
+ if (m_delta)
+ delta += apply_scale(m_delta, keyscale);
+ else if (!m_lastdigital)
+ // increment only once when first pressed
+ delta += apply_scale(1, keyscale);
+ m_lastdigital = true;
+ }
- case IPT_KEYPAD:
- case IPT_KEYBOARD:
- result = INPUT_CLASS_KEYBOARD;
- break;
+ // if resetting is requested, clear the accumulated position to 0 before
+ // applying the deltas so that we only return this frame's delta
+ // note that centering only works for relative controls
+ // no need to check if absolute here because it is checked by the validity tests
+ if (m_field.analog_reset())
+ m_accum = 0;
- case IPT_CONFIG:
- result = INPUT_CLASS_CONFIG;
- break;
+ // apply the delta to the accumulated value
+ m_accum += delta;
- case IPT_DIPSWITCH:
- result = INPUT_CLASS_DIPSWITCH;
- break;
+ // if our last movement was due to a digital input, and if this control
+ // type autocenters, and if neither the increment nor the decrement seq
+ // was pressed, apply autocentering
+ if (m_autocenter)
+ {
+ INT32 center = apply_inverse_sensitivity(m_center);
+ if (m_lastdigital && !keypressed)
+ {
+ // autocenter from positive values
+ if (m_accum >= center)
+ {
+ m_accum -= apply_scale(m_centerdelta, m_keyscalepos);
+ if (m_accum < center)
+ {
+ m_accum = center;
+ m_lastdigital = false;
+ }
+ }
- case 0:
- if (field->name && (field->name != (const char *) -1))
- result = INPUT_CLASS_MISC;
+ // autocenter from negative values
else
- result = INPUT_CLASS_INTERNAL;
- break;
-
- default:
- result = INPUT_CLASS_INTERNAL;
- break;
+ {
+ m_accum += apply_scale(m_centerdelta, m_keyscaleneg);
+ if (m_accum > center)
+ {
+ m_accum = center;
+ m_lastdigital = false;
+ }
+ }
+ }
}
- return result;
+ else if (!keypressed)
+ m_lastdigital = false;
}
+//-------------------------------------------------
+// read - read the current value and insert into
+// the provided ioport_value
+//-------------------------------------------------
-int input_player_number(const input_field_config *port)
+void analog_field::read(ioport_value &result)
{
- return port->player;
-}
+ // do nothing if we're not enabled
+ if (!m_field.enabled())
+ return;
+ // start with the raw value
+ INT32 value = m_accum;
+ // interpolate if appropriate and if time has passed since the last update
+ if (m_interpolate)
+ value = manager().frame_interpolate(m_previous, m_accum);
-/*-------------------------------------------------
- input_has_input_class - checks to see if a
- particular input class is present
--------------------------------------------------*/
+ // apply standard analog settings
+ value = apply_settings(value);
-int input_has_input_class(running_machine &machine, int inputclass)
-{
- const input_port_config *port;
- const input_field_config *field;
+ // remap the value if needed
+ if (m_field.remap_table() != NULL)
+ value = m_field.remap_table()[value];
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- {
- for (field = port->first_field(); field != NULL; field = field->next())
- {
- if (input_classify_port(field) == inputclass)
- return TRUE;
- }
- }
- return FALSE;
-}
+ // invert bits if needed
+ if (m_field.analog_invert())
+ value = ~value;
+ // insert into the port
+ result = (result & ~m_field.mask()) | ((value << m_shift) & m_field.mask());
+}
-/*-------------------------------------------------
- input_count_players - counts the number of
- active players
--------------------------------------------------*/
+//-------------------------------------------------
+// crosshair_read - read a value for crosshairs,
+// scaled between 0 and 1
+//-------------------------------------------------
-int input_count_players(running_machine &machine)
+float analog_field::crosshair_read()
{
- const input_port_config *port;
- const input_field_config *field;
- int joystick_count;
-
- joystick_count = 0;
- for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- {
- for (field = port->first_field(); field != NULL; field = field->next())
- {
- if (input_classify_port(field) == INPUT_CLASS_CONTROLLER)
- {
- if (joystick_count <= field->player + 1)
- joystick_count = field->player + 1;
- }
- }
- }
- return joystick_count;
+ INT32 rawvalue = apply_settings(m_accum) & (m_field.mask() >> m_shift);
+ return float(rawvalue - m_adjmin) / float(m_adjmax - m_adjmin);
}
/***************************************************************************
- DEBUGGER SUPPORT
+ TOKENIZATION HELPERS
***************************************************************************/
-/*-------------------------------------------------
- execute_input - debugger command to enter
- natural keyboard input
--------------------------------------------------*/
+//-------------------------------------------------
+// token_to_input_type - convert a string token
+// to an input field type and player
+//-------------------------------------------------
-static void execute_input(running_machine &machine, int ref, int params, const char *param[])
+ioport_type ioport_manager::token_to_input_type(const char *string, int &player) const
{
- inputx_postn_coded_rate(machine, param[0], strlen(param[0]), attotime::zero);
-}
-
-
-
-/*-------------------------------------------------
- execute_dumpkbd - debugger command to natural
- keyboard codes
--------------------------------------------------*/
+ // check for our failsafe case first
+ int ipnum;
+ if (sscanf(string, "TYPE_OTHER(%d,%d)", &ipnum, &player) == 2)
+ return ioport_type(ipnum);
-static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[])
-{
- inputx_code *codes = machine.ioport().codes;
- const char *filename;
- FILE *file = NULL;
- const inputx_code *code;
- char buffer[512];
- size_t pos;
- int i, j;
- size_t left_column_width = 24;
-
- /* was there a file specified? */
- filename = (params > 0) ? param[0] : NULL;
- if (filename != NULL)
- {
- /* if so, open it */
- file = fopen(filename, "w");
- if (file == NULL)
+ // find the token in the list
+ for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
+ if (entry->token() != NULL && !strcmp(entry->token(), string))
{
- debug_console_printf(machine, "Cannot open \"%s\"\n", filename);
- return;
+ player = entry->player();
+ return entry->type();
}
- }
-
- if ((codes != NULL) && (codes[0].ch != 0))
- {
- /* loop through all codes */
- for (i = 0; codes[i].ch; i++)
- {
- code = &codes[i];
- pos = 0;
- /* describe the character code */
- pos += snprintf(&buffer[pos], ARRAY_LENGTH(buffer) - pos, "%08X (%s) ",
- code->ch,
- code_point_string(machine, code->ch));
-
- /* pad with spaces */
- while(pos < left_column_width)
- buffer[pos++] = ' ';
- buffer[pos] = '\0';
+ // if we fail, return IPT_UNKNOWN
+ player = 0;
+ return IPT_UNKNOWN;
+}
- /* identify the keys used */
- for (j = 0; j < ARRAY_LENGTH(code->field) && (code->field[j] != NULL); j++)
- {
- pos += snprintf(&buffer[pos], ARRAY_LENGTH(buffer) - pos, "%s'%s'",
- (j > 0) ? ", " : "",
- code->field[j]->name);
- }
- /* and output it as appropriate */
- if (file != NULL)
- fprintf(file, "%s\n", buffer);
- else
- debug_console_printf(machine, "%s\n", buffer);
- }
- }
- else
- {
- debug_console_printf(machine, "No natural keyboard support\n");
- }
+//-------------------------------------------------
+// input_type_to_token - convert an input field
+// type and player to a string token
+//-------------------------------------------------
- /* cleanup */
- if (file != NULL)
- fclose(file);
+const char *ioport_manager::input_type_to_token(astring &string, ioport_type type, int player)
+{
+ // look up the port and return the token
+ input_type_entry *entry = m_type_to_entry[type][player];
+ if (entry != NULL)
+ return string.cpy(entry->token());
+ // if that fails, carry on
+ return string.format("TYPE_OTHER(%d,%d)", type, player);
}
+//-------------------------------------------------
+// token_to_seq_type - convert a string to
+// a sequence type
+//-------------------------------------------------
-input_port_config *ioconfig_alloc_port(ioport_list &portlist, device_t &device, const char *tag)
+input_seq_type ioport_manager::token_to_seq_type(const char *string)
{
- astring fulltag;
- device.subtag(fulltag, tag);
- return &portlist.append(fulltag, *global_alloc(input_port_config(device, fulltag)));
+ // look up the string in the table of possible sequence types and return the index
+ for (int seqindex = 0; seqindex < ARRAY_LENGTH(seqtypestrings); seqindex++)
+ if (!mame_stricmp(string, seqtypestrings[seqindex]))
+ return input_seq_type(seqindex);
+ return SEQ_TYPE_INVALID;
}
-input_port_config *ioconfig_modify_port(ioport_list &portlist, device_t &device, const char *tag)
-{
- astring fulltag;
- device.subtag(fulltag, tag);
- input_port_config *port = portlist.find(fulltag.cstr());
- if (port == NULL)
- throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.cstr());
- port->bump_modcount();
- return port;
-}
-input_field_config *ioconfig_alloc_field(input_port_config &port, int type, input_port_value defval, input_port_value mask, const char *name)
-{
- if (&port == NULL)
- throw emu_fatalerror("INPUT_TOKEN_FIELD encountered with no active port (mask=%X defval=%X)\n", mask, defval); \
- if (type != IPT_UNKNOWN && type != IPT_UNUSED)
- port.active |= mask;
- if (type == IPT_DIPSWITCH || type == IPT_CONFIG)
- defval = port_default_value(port.tag(), mask, defval, port.owner());
- return &port.fieldlist().append(*global_alloc(input_field_config(port, type, defval, mask, input_port_string_from_token(name))));
-}
-input_field_config *ioconfig_alloc_onoff(input_port_config &port, const char *name, input_port_value defval, input_port_value mask, const char *diplocation, astring &errorbuf)
-{
- input_field_config *curfield = ioconfig_alloc_field(port, IPT_DIPSWITCH, defval, mask, name);
- if (name == DEF_STR(Service_Mode))
- {
- curfield->flags |= FIELD_FLAG_TOGGLE;
- curfield->seq[SEQ_TYPE_STANDARD].set(KEYCODE_F2);
- }
- if (diplocation != NULL)
- diplocation_list_alloc(*curfield, diplocation, errorbuf);
- ioconfig_alloc_setting(*curfield, defval & mask, DEF_STR(Off));
- ioconfig_alloc_setting(*curfield, ~defval & mask, DEF_STR(On));
- return curfield;
-}
+//-------------------------------------------------
+// validate_natural_keyboard_statics -
+// validates natural keyboard static data
+//-------------------------------------------------
-input_setting_config *ioconfig_alloc_setting(input_field_config &field, input_port_value value, const char *name)
+/*
+int validate_natural_keyboard_statics(void)
{
- return &field.settinglist().append(*global_alloc(input_setting_config(field, value, input_port_string_from_token(name))));
-}
+ int i;
+ int error = FALSE;
+ unicode_char last_char = 0;
+ const char_info *ci;
-void ioconfig_field_add_char(input_field_config &field, unicode_char ch, astring &errorbuf)
-{
- for (int index = 0; index < ARRAY_LENGTH(field.chars); index++)
- if (field.chars[index] == 0)
+ // check to make sure that charinfo is in order
+ for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
+ {
+ if (last_char >= charinfo[i].ch)
{
- field.chars[index] = ch;
- break;
+ mame_printf_error("inputx: charinfo is out of order; 0x%08x should be higher than 0x%08x\n", charinfo[i].ch, last_char);
+ error = TRUE;
}
-}
+ last_char = charinfo[i].ch;
+ }
-void ioconfig_add_code(input_field_config &field, int which, input_code code)
-{
- field.seq[which] |= code;
+ // check to make sure that I can look up everything on alternate_charmap
+ for (i = 0; i < ARRAY_LENGTH(charinfo); i++)
+ {
+ ci = char_info::find(charinfo[i].ch);
+ if (ci != &charinfo[i])
+ {
+ mame_printf_error("ioport: expected char_info::find(0x%08x) to work properly\n", charinfo[i].ch);
+ error = TRUE;
+ }
+ }
+ return error;
}
+*/
-
-input_type_entry::input_type_entry(UINT32 _type, ioport_group _group, int _player, const char *_token, const char *_name, input_seq standard)
- : type(_type),
- group(_group),
- player(_player),
- token(_token),
- name(_name),
- m_next(NULL)
-{
- defseq[SEQ_TYPE_STANDARD] = seq[SEQ_TYPE_STANDARD] = standard;
-}
-
-input_type_entry::input_type_entry(UINT32 _type, ioport_group _group, int _player, const char *_token, const char *_name, input_seq standard, input_seq decrement, input_seq increment)
- : type(_type),
- group(_group),
- player(_player),
- token(_token),
- name(_name),
- m_next(NULL)
-{
- defseq[SEQ_TYPE_STANDARD] = seq[SEQ_TYPE_STANDARD] = standard;
- defseq[SEQ_TYPE_INCREMENT] = seq[SEQ_TYPE_INCREMENT] = increment;
- defseq[SEQ_TYPE_DECREMENT] = seq[SEQ_TYPE_DECREMENT] = decrement;
-}
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index 8856e15ae4a..21050a6fb57 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -4,8 +4,36 @@
Input/output port handling.
- Copyright Nicola Salmoria and the MAME Team.
- Visit http://mamedev.org for licensing and usage restrictions.
+****************************************************************************
+
+ Copyright Aaron Giles
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name 'MAME' nor the names of its contributors may be
+ used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
@@ -21,61 +49,48 @@
#include <time.h>
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
-/***************************************************************************
- CONSTANTS
-***************************************************************************/
-
-#define MAX_PLAYERS 8
-
-#define IP_ACTIVE_HIGH 0x00000000
-#define IP_ACTIVE_LOW 0xffffffff
+// input ports support up to 32 bits each
+typedef UINT32 ioport_value;
+// active high/low values for input ports
+const ioport_value IP_ACTIVE_HIGH = 0x00000000;
+const ioport_value IP_ACTIVE_LOW = 0xffffffff;
-/* flags for input_field_configs */
-#define FIELD_FLAG_UNUSED 0x01 /* set if this field is unused but relevant to other games on the same hw */
-#define FIELD_FLAG_COCKTAIL 0x02 /* set if this field is relevant only for cocktail cabinets */
-#define FIELD_FLAG_TOGGLE 0x04 /* set if this field should behave as a toggle */
-#define FIELD_FLAG_ROTATED 0x08 /* set if this field represents a rotated control */
-#define ANALOG_FLAG_REVERSE 0x10 /* analog only: reverse the sense of the axis */
-#define ANALOG_FLAG_RESET 0x20 /* analog only: always preload in->default for relative axes, returning only deltas */
-#define ANALOG_FLAG_WRAPS 0x40 /* analog only: positional count wraps around */
-#define ANALOG_FLAG_INVERT 0x80 /* analog only: bitwise invert bits */
+// maximum number of players supported
+const int MAX_PLAYERS = 8;
+// INP file parameters
+const UINT32 INP_HEADER_SIZE = 64;
+const UINT32 INP_HEADER_MAJVERSION = 3;
+const UINT32 INP_HEADER_MINVERSION = 0;
-/* INP file information */
-#define INP_HEADER_SIZE 64
-#define INP_HEADER_MAJVERSION 3
-#define INP_HEADER_MINVERSION 0
+// unicode constants
+const unicode_char UCHAR_PRIVATE = 0x100000;
+const unicode_char UCHAR_SHIFT_1 = UCHAR_PRIVATE + 0;
+const unicode_char UCHAR_SHIFT_2 = UCHAR_PRIVATE + 1;
+const unicode_char UCHAR_SHIFT_BEGIN = UCHAR_SHIFT_1;
+const unicode_char UCHAR_SHIFT_END = UCHAR_SHIFT_2;
+const unicode_char UCHAR_MAMEKEY_BEGIN = UCHAR_PRIVATE + 2;
-/* sequence types for input_port_seq() call */
-enum _input_seq_type
+// sequence types for input_port_seq() call
+enum input_seq_type
{
+ SEQ_TYPE_INVALID = -1,
SEQ_TYPE_STANDARD = 0,
SEQ_TYPE_INCREMENT,
SEQ_TYPE_DECREMENT,
SEQ_TYPE_TOTAL
};
-typedef enum _input_seq_type input_seq_type;
DECLARE_ENUM_OPERATORS(input_seq_type)
-/* conditions for DIP switches */
-enum
-{
- PORTCOND_ALWAYS = 0,
- PORTCOND_EQUALS,
- PORTCOND_NOTEQUALS,
- PORTCOND_GREATERTHAN,
- PORTCOND_NOTGREATERTHAN,
- PORTCOND_LESSTHAN,
- PORTCOND_NOTLESSTHAN
-};
-
-
-/* crosshair types */
-enum
+// crosshair types
+enum crosshair_axis_t
{
CROSSHAIR_AXIS_NONE = 0,
CROSSHAIR_AXIS_X,
@@ -83,7 +98,7 @@ enum
};
-/* groups for input ports */
+// groups for input ports
enum ioport_group
{
IPG_UI = 0,
@@ -101,20 +116,19 @@ enum ioport_group
};
-/* various input port types */
-enum
+// various input port types
+enum ioport_type
{
- /* pseudo-port types */
+ // pseudo-port types
IPT_INVALID = 0,
IPT_UNUSED,
IPT_END,
IPT_UNKNOWN,
IPT_PORT,
IPT_DIPSWITCH,
- IPT_VBLANK,
IPT_CONFIG,
- /* start buttons */
+ // start buttons
IPT_START1,
IPT_START2,
IPT_START3,
@@ -124,7 +138,7 @@ enum
IPT_START7,
IPT_START8,
- /* coin slots */
+ // coin slots
IPT_COIN1,
IPT_COIN2,
IPT_COIN3,
@@ -139,48 +153,51 @@ enum
IPT_COIN12,
IPT_BILL1,
- /* service coin */
+ // service coin
IPT_SERVICE1,
IPT_SERVICE2,
IPT_SERVICE3,
IPT_SERVICE4,
- /* tilt inputs */
+ // tilt inputs
IPT_TILT1,
IPT_TILT2,
IPT_TILT3,
IPT_TILT4,
- /* misc other digital inputs */
+ // misc other digital inputs
IPT_SERVICE,
IPT_TILT,
IPT_INTERLOCK,
IPT_VOLUME_UP,
IPT_VOLUME_DOWN,
- IPT_START, /* MESS only */
- IPT_SELECT, /* MESS only */
- IPT_KEYPAD, /* MESS only */
- IPT_KEYBOARD, /* MESS only */
-
-#define __ipt_digital_joystick_start IPT_JOYSTICK_UP
- /* use IPT_JOYSTICK for panels where the player has one single joystick */
- IPT_JOYSTICK_UP,
- IPT_JOYSTICK_DOWN,
- IPT_JOYSTICK_LEFT,
- IPT_JOYSTICK_RIGHT,
-
- /* use IPT_JOYSTICKLEFT and IPT_JOYSTICKRIGHT for dual joystick panels */
- IPT_JOYSTICKRIGHT_UP,
- IPT_JOYSTICKRIGHT_DOWN,
- IPT_JOYSTICKRIGHT_LEFT,
- IPT_JOYSTICKRIGHT_RIGHT,
- IPT_JOYSTICKLEFT_UP,
- IPT_JOYSTICKLEFT_DOWN,
- IPT_JOYSTICKLEFT_LEFT,
- IPT_JOYSTICKLEFT_RIGHT,
-#define __ipt_digital_joystick_end IPT_JOYSTICKLEFT_RIGHT
-
- /* action buttons */
+ IPT_START, // MESS only
+ IPT_SELECT, // MESS only
+ IPT_KEYPAD, // MESS only
+ IPT_KEYBOARD, // MESS only
+
+ // digital joystick inputs
+ IPT_DIGITAL_JOYSTICK_FIRST,
+
+ // use IPT_JOYSTICK for panels where the player has one single joystick
+ IPT_JOYSTICK_UP = IPT_DIGITAL_JOYSTICK_FIRST,
+ IPT_JOYSTICK_DOWN,
+ IPT_JOYSTICK_LEFT,
+ IPT_JOYSTICK_RIGHT,
+
+ // use IPT_JOYSTICKLEFT and IPT_JOYSTICKRIGHT for dual joystick panels
+ IPT_JOYSTICKRIGHT_UP,
+ IPT_JOYSTICKRIGHT_DOWN,
+ IPT_JOYSTICKRIGHT_LEFT,
+ IPT_JOYSTICKRIGHT_RIGHT,
+ IPT_JOYSTICKLEFT_UP,
+ IPT_JOYSTICKLEFT_DOWN,
+ IPT_JOYSTICKLEFT_LEFT,
+ IPT_JOYSTICKLEFT_RIGHT,
+
+ IPT_DIGITAL_JOYSTICK_LAST,
+
+ // action buttons
IPT_BUTTON1,
IPT_BUTTON2,
IPT_BUTTON3,
@@ -198,210 +215,234 @@ enum
IPT_BUTTON15,
IPT_BUTTON16,
- /* mahjong inputs */
-#define __ipt_mahjong_start IPT_MAHJONG_A
- IPT_MAHJONG_A,
- IPT_MAHJONG_B,
- IPT_MAHJONG_C,
- IPT_MAHJONG_D,
- IPT_MAHJONG_E,
- IPT_MAHJONG_F,
- IPT_MAHJONG_G,
- IPT_MAHJONG_H,
- IPT_MAHJONG_I,
- IPT_MAHJONG_J,
- IPT_MAHJONG_K,
- IPT_MAHJONG_L,
- IPT_MAHJONG_M,
- IPT_MAHJONG_N,
- IPT_MAHJONG_O,
- IPT_MAHJONG_P,
- IPT_MAHJONG_Q,
- IPT_MAHJONG_KAN,
- IPT_MAHJONG_PON,
- IPT_MAHJONG_CHI,
- IPT_MAHJONG_REACH, //IPT_MAHJONG_RIICHI, // REACH is Japanglish
- IPT_MAHJONG_RON,
- IPT_MAHJONG_BET,
- IPT_MAHJONG_LAST_CHANCE,
- IPT_MAHJONG_SCORE,
- IPT_MAHJONG_DOUBLE_UP,
- IPT_MAHJONG_FLIP_FLOP,
- IPT_MAHJONG_BIG,
- IPT_MAHJONG_SMALL,
-#define __ipt_mahjong_end IPT_MAHJONG_SMALL
-
- /* hanafuda inputs */
-#define __ipt_hanafuda_start IPT_HANAFUDA_A
- IPT_HANAFUDA_A,
- IPT_HANAFUDA_B,
- IPT_HANAFUDA_C,
- IPT_HANAFUDA_D,
- IPT_HANAFUDA_E,
- IPT_HANAFUDA_F,
- IPT_HANAFUDA_G,
- IPT_HANAFUDA_H,
- IPT_HANAFUDA_YES,
- IPT_HANAFUDA_NO,
-#define __ipt_hanafuda_end IPT_HANAFUDA_NO
-
-#define __ipt_gambling_start IPT_GAMBLE_KEYIN
-
- /* gambling inputs */
- IPT_GAMBLE_KEYIN, // attendant
- IPT_GAMBLE_KEYOUT, // attendant
- IPT_GAMBLE_SERVICE, // attendant
- IPT_GAMBLE_BOOK, // attendant
- IPT_GAMBLE_DOOR, // attendant
-// IPT_GAMBLE_DOOR2, // many gambling games have several doors.
-// IPT_GAMBLE_DOOR3,
-// IPT_GAMBLE_DOOR4,
-// IPT_GAMBLE_DOOR5,
-
- IPT_GAMBLE_HIGH, // player
- IPT_GAMBLE_LOW, // player
- IPT_GAMBLE_HALF, // player
- IPT_GAMBLE_DEAL, // player
- IPT_GAMBLE_D_UP, // player
- IPT_GAMBLE_TAKE, // player
- IPT_GAMBLE_STAND, // player
- IPT_GAMBLE_BET, // player
- IPT_GAMBLE_PAYOUT, // player
-// IPT_GAMBLE_BUTTON1, // player
-// IPT_GAMBLE_BUTTON2, // many many gambling games have multi-games and/or multi-function-buttons
-// IPT_GAMBLE_BUTTON3, // I suggest to eliminate specific names
-// IPT_GAMBLE_BUTTON4,
-// IPT_GAMBLE_BUTTON5,
-// IPT_GAMBLE_BUTTON6,
-// IPT_GAMBLE_BUTTON7,
-// IPT_GAMBLE_BUTTON8,
-// IPT_GAMBLE_BUTTON9,
-// IPT_GAMBLE_BUTTON10,
-// IPT_GAMBLE_BUTTON11,
-// IPT_GAMBLE_BUTTON12,
-// IPT_GAMBLE_BUTTON13,
-// IPT_GAMBLE_BUTTON14,
-// IPT_GAMBLE_BUTTON15,
-// IPT_GAMBLE_BUTTON16,
-
- /* poker-specific inputs */
- IPT_POKER_HOLD1,
- IPT_POKER_HOLD2,
- IPT_POKER_HOLD3,
- IPT_POKER_HOLD4,
- IPT_POKER_HOLD5,
- IPT_POKER_CANCEL,
- IPT_POKER_BET,
-
- /* slot-specific inputs */
- IPT_SLOT_STOP1,
- IPT_SLOT_STOP2,
- IPT_SLOT_STOP3,
- IPT_SLOT_STOP4,
- IPT_SLOT_STOP_ALL,
-
-#define __ipt_gambling_end IPT_SLOT_STOP_ALL
-
- /* analog inputs */
-#define __ipt_analog_start IPT_AD_STICK_X
-#define __ipt_analog_absolute_start IPT_AD_STICK_X
- IPT_AD_STICK_X, // absolute // autocenter
- IPT_AD_STICK_Y, // absolute // autocenter
- IPT_AD_STICK_Z, // absolute // autocenter
- IPT_PADDLE, // absolute // autocenter
- IPT_PADDLE_V, // absolute // autocenter
- IPT_PEDAL, // absolute // autocenter
- IPT_PEDAL2, // absolute // autocenter
- IPT_PEDAL3, // absolute // autocenter
- IPT_LIGHTGUN_X, // absolute
- IPT_LIGHTGUN_Y, // absolute
- IPT_POSITIONAL, // absolute // autocenter if not wraps
- IPT_POSITIONAL_V, // absolute // autocenter if not wraps
-#define __ipt_analog_absolute_end IPT_POSITIONAL_V
-
- IPT_DIAL, // relative
- IPT_DIAL_V, // relative
- IPT_TRACKBALL_X, // relative
- IPT_TRACKBALL_Y, // relative
- IPT_MOUSE_X, // relative
- IPT_MOUSE_Y, // relative
-#define __ipt_analog_end IPT_MOUSE_Y
-
- /* analog adjuster support */
+ // mahjong inputs
+ IPT_MAHJONG_FIRST,
+
+ IPT_MAHJONG_A,
+ IPT_MAHJONG_B,
+ IPT_MAHJONG_C,
+ IPT_MAHJONG_D,
+ IPT_MAHJONG_E,
+ IPT_MAHJONG_F,
+ IPT_MAHJONG_G,
+ IPT_MAHJONG_H,
+ IPT_MAHJONG_I,
+ IPT_MAHJONG_J,
+ IPT_MAHJONG_K,
+ IPT_MAHJONG_L,
+ IPT_MAHJONG_M,
+ IPT_MAHJONG_N,
+ IPT_MAHJONG_O,
+ IPT_MAHJONG_P,
+ IPT_MAHJONG_Q,
+ IPT_MAHJONG_KAN,
+ IPT_MAHJONG_PON,
+ IPT_MAHJONG_CHI,
+ IPT_MAHJONG_REACH, //IPT_MAHJONG_RIICHI, // REACH is Japanglish
+ IPT_MAHJONG_RON,
+ IPT_MAHJONG_BET,
+ IPT_MAHJONG_LAST_CHANCE,
+ IPT_MAHJONG_SCORE,
+ IPT_MAHJONG_DOUBLE_UP,
+ IPT_MAHJONG_FLIP_FLOP,
+ IPT_MAHJONG_BIG,
+ IPT_MAHJONG_SMALL,
+
+ IPT_MAHJONG_LAST,
+
+ // hanafuda inputs
+ IPT_HANAFUDA_FIRST,
+
+ IPT_HANAFUDA_A,
+ IPT_HANAFUDA_B,
+ IPT_HANAFUDA_C,
+ IPT_HANAFUDA_D,
+ IPT_HANAFUDA_E,
+ IPT_HANAFUDA_F,
+ IPT_HANAFUDA_G,
+ IPT_HANAFUDA_H,
+ IPT_HANAFUDA_YES,
+ IPT_HANAFUDA_NO,
+
+ IPT_HANAFUDA_LAST,
+
+ // gambling inputs
+ IPT_GAMBLING_FIRST,
+
+ IPT_GAMBLE_KEYIN, // attendant
+ IPT_GAMBLE_KEYOUT, // attendant
+ IPT_GAMBLE_SERVICE, // attendant
+ IPT_GAMBLE_BOOK, // attendant
+ IPT_GAMBLE_DOOR, // attendant
+ // IPT_GAMBLE_DOOR2, // many gambling games have several doors.
+ // IPT_GAMBLE_DOOR3,
+ // IPT_GAMBLE_DOOR4,
+ // IPT_GAMBLE_DOOR5,
+
+ IPT_GAMBLE_HIGH, // player
+ IPT_GAMBLE_LOW, // player
+ IPT_GAMBLE_HALF, // player
+ IPT_GAMBLE_DEAL, // player
+ IPT_GAMBLE_D_UP, // player
+ IPT_GAMBLE_TAKE, // player
+ IPT_GAMBLE_STAND, // player
+ IPT_GAMBLE_BET, // player
+ IPT_GAMBLE_PAYOUT, // player
+ // IPT_GAMBLE_BUTTON1, // player
+ // IPT_GAMBLE_BUTTON2, // many many gambling games have multi-games and/or multi-function-buttons
+ // IPT_GAMBLE_BUTTON3, // I suggest to eliminate specific names
+ // IPT_GAMBLE_BUTTON4,
+ // IPT_GAMBLE_BUTTON5,
+ // IPT_GAMBLE_BUTTON6,
+ // IPT_GAMBLE_BUTTON7,
+ // IPT_GAMBLE_BUTTON8,
+ // IPT_GAMBLE_BUTTON9,
+ // IPT_GAMBLE_BUTTON10,
+ // IPT_GAMBLE_BUTTON11,
+ // IPT_GAMBLE_BUTTON12,
+ // IPT_GAMBLE_BUTTON13,
+ // IPT_GAMBLE_BUTTON14,
+ // IPT_GAMBLE_BUTTON15,
+ // IPT_GAMBLE_BUTTON16,
+
+ // poker-specific inputs
+ IPT_POKER_HOLD1,
+ IPT_POKER_HOLD2,
+ IPT_POKER_HOLD3,
+ IPT_POKER_HOLD4,
+ IPT_POKER_HOLD5,
+ IPT_POKER_CANCEL,
+ IPT_POKER_BET,
+
+ // slot-specific inputs
+ IPT_SLOT_STOP1,
+ IPT_SLOT_STOP2,
+ IPT_SLOT_STOP3,
+ IPT_SLOT_STOP4,
+ IPT_SLOT_STOP_ALL,
+
+ IPT_GAMBLING_LAST,
+
+ // analog inputs
+ IPT_ANALOG_FIRST,
+
+ IPT_ANALOG_ABSOLUTE_FIRST,
+
+ IPT_AD_STICK_X, // absolute // autocenter
+ IPT_AD_STICK_Y, // absolute // autocenter
+ IPT_AD_STICK_Z, // absolute // autocenter
+ IPT_PADDLE, // absolute // autocenter
+ IPT_PADDLE_V, // absolute // autocenter
+ IPT_PEDAL, // absolute // autocenter
+ IPT_PEDAL2, // absolute // autocenter
+ IPT_PEDAL3, // absolute // autocenter
+ IPT_LIGHTGUN_X, // absolute
+ IPT_LIGHTGUN_Y, // absolute
+ IPT_POSITIONAL, // absolute // autocenter if not wraps
+ IPT_POSITIONAL_V, // absolute // autocenter if not wraps
+
+ IPT_ANALOG_ABSOLUTE_LAST,
+
+ IPT_DIAL, // relative
+ IPT_DIAL_V, // relative
+ IPT_TRACKBALL_X, // relative
+ IPT_TRACKBALL_Y, // relative
+ IPT_MOUSE_X, // relative
+ IPT_MOUSE_Y, // relative
+
+ IPT_ANALOG_LAST,
+
+ // analog adjuster support
IPT_ADJUSTER,
- /* the following are special codes for user interface handling - not to be used by drivers! */
-#define __ipt_ui_start IPT_UI_CONFIGURE
- IPT_UI_CONFIGURE,
- IPT_UI_ON_SCREEN_DISPLAY,
- IPT_UI_DEBUG_BREAK,
- IPT_UI_PAUSE,
- IPT_UI_RESET_MACHINE,
- IPT_UI_SOFT_RESET,
- IPT_UI_SHOW_GFX,
- IPT_UI_FRAMESKIP_DEC,
- IPT_UI_FRAMESKIP_INC,
- IPT_UI_THROTTLE,
- IPT_UI_FAST_FORWARD,
- IPT_UI_SHOW_FPS,
- IPT_UI_SNAPSHOT,
- IPT_UI_RECORD_MOVIE,
- IPT_UI_TOGGLE_CHEAT,
- IPT_UI_UP,
- IPT_UI_DOWN,
- IPT_UI_LEFT,
- IPT_UI_RIGHT,
- IPT_UI_HOME,
- IPT_UI_END,
- IPT_UI_PAGE_UP,
- IPT_UI_PAGE_DOWN,
- IPT_UI_SELECT,
- IPT_UI_CANCEL,
- IPT_UI_DISPLAY_COMMENT,
- IPT_UI_CLEAR,
- IPT_UI_ZOOM_IN,
- IPT_UI_ZOOM_OUT,
- IPT_UI_PREV_GROUP,
- IPT_UI_NEXT_GROUP,
- IPT_UI_ROTATE,
- IPT_UI_SHOW_PROFILER,
- IPT_UI_TOGGLE_UI,
- IPT_UI_TOGGLE_DEBUG,
- IPT_UI_PASTE,
- IPT_UI_SAVE_STATE,
- IPT_UI_LOAD_STATE,
-
- /* additional OSD-specified UI port types (up to 16) */
- IPT_OSD_1,
- IPT_OSD_2,
- IPT_OSD_3,
- IPT_OSD_4,
- IPT_OSD_5,
- IPT_OSD_6,
- IPT_OSD_7,
- IPT_OSD_8,
- IPT_OSD_9,
- IPT_OSD_10,
- IPT_OSD_11,
- IPT_OSD_12,
- IPT_OSD_13,
- IPT_OSD_14,
- IPT_OSD_15,
- IPT_OSD_16,
-#define __ipt_ui_end IPT_OSD_16
-
- /* other meaning not mapped to standard defaults */
+ // the following are special codes for user interface handling - not to be used by drivers!
+ IPT_UI_FIRST,
+
+ IPT_UI_CONFIGURE,
+ IPT_UI_ON_SCREEN_DISPLAY,
+ IPT_UI_DEBUG_BREAK,
+ IPT_UI_PAUSE,
+ IPT_UI_RESET_MACHINE,
+ IPT_UI_SOFT_RESET,
+ IPT_UI_SHOW_GFX,
+ IPT_UI_FRAMESKIP_DEC,
+ IPT_UI_FRAMESKIP_INC,
+ IPT_UI_THROTTLE,
+ IPT_UI_FAST_FORWARD,
+ IPT_UI_SHOW_FPS,
+ IPT_UI_SNAPSHOT,
+ IPT_UI_RECORD_MOVIE,
+ IPT_UI_TOGGLE_CHEAT,
+ IPT_UI_UP,
+ IPT_UI_DOWN,
+ IPT_UI_LEFT,
+ IPT_UI_RIGHT,
+ IPT_UI_HOME,
+ IPT_UI_END,
+ IPT_UI_PAGE_UP,
+ IPT_UI_PAGE_DOWN,
+ IPT_UI_SELECT,
+ IPT_UI_CANCEL,
+ IPT_UI_DISPLAY_COMMENT,
+ IPT_UI_CLEAR,
+ IPT_UI_ZOOM_IN,
+ IPT_UI_ZOOM_OUT,
+ IPT_UI_PREV_GROUP,
+ IPT_UI_NEXT_GROUP,
+ IPT_UI_ROTATE,
+ IPT_UI_SHOW_PROFILER,
+ IPT_UI_TOGGLE_UI,
+ IPT_UI_TOGGLE_DEBUG,
+ IPT_UI_PASTE,
+ IPT_UI_SAVE_STATE,
+ IPT_UI_LOAD_STATE,
+
+ // additional OSD-specified UI port types (up to 16)
+ IPT_OSD_1,
+ IPT_OSD_2,
+ IPT_OSD_3,
+ IPT_OSD_4,
+ IPT_OSD_5,
+ IPT_OSD_6,
+ IPT_OSD_7,
+ IPT_OSD_8,
+ IPT_OSD_9,
+ IPT_OSD_10,
+ IPT_OSD_11,
+ IPT_OSD_12,
+ IPT_OSD_13,
+ IPT_OSD_14,
+ IPT_OSD_15,
+ IPT_OSD_16,
+
+ IPT_UI_LAST,
+
+ // other meaning not mapped to standard defaults
IPT_OTHER,
- /* special meaning handled by custom code */
+ // special meaning handled by custom code
IPT_SPECIAL,
+ IPT_CUSTOM,
IPT_OUTPUT,
- __ipt_max
+ IPT_COUNT
+};
+DECLARE_ENUM_OPERATORS(ioport_type)
+
+
+// input type classes
+enum ioport_type_class
+{
+ INPUT_CLASS_INTERNAL,
+ INPUT_CLASS_KEYBOARD,
+ INPUT_CLASS_CONTROLLER,
+ INPUT_CLASS_CONFIG,
+ INPUT_CLASS_DIPSWITCH,
+ INPUT_CLASS_MISC
};
-/* default strings used in port definitions */
+// default strings used in port definitions
enum
{
INPUT_STRING_Off = 1,
@@ -627,300 +668,565 @@ enum
};
-/* input classes */
-enum
-{
- INPUT_CLASS_INTERNAL,
- INPUT_CLASS_KEYBOARD,
- INPUT_CLASS_CONTROLLER,
- INPUT_CLASS_CONFIG,
- INPUT_CLASS_DIPSWITCH,
- INPUT_CLASS_MISC
-};
-
-#define UCHAR_PRIVATE (0x100000)
-#define UCHAR_SHIFT_1 (UCHAR_PRIVATE + 0)
-#define UCHAR_SHIFT_2 (UCHAR_PRIVATE + 1)
-#define UCHAR_MAMEKEY_BEGIN (UCHAR_PRIVATE + 2)
-#define UCHAR_MAMEKEY(code) (UCHAR_MAMEKEY_BEGIN + ITEM_ID_##code)
-
-#define UCHAR_SHIFT_BEGIN (UCHAR_SHIFT_1)
-#define UCHAR_SHIFT_END (UCHAR_SHIFT_2)
-
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
-/* input ports support up to 32 bits each */
-typedef UINT32 input_port_value;
+// opaque types pointing to live state
+struct input_port_state;
+struct input_field_state;
+// forward declarations
+class ioport_list;
+class ioport_port;
+struct ioport_port_live;
+class ioport_field;
+struct ioport_field_live;
+class ioport_manager;
+class emu_timer;
+typedef struct _xml_data_node xml_data_node;
+class analog_field;
-/* opaque types pointing to live state */
-typedef struct _input_port_state input_port_state;
-typedef struct _input_field_state input_field_state;
-
+// constructor function pointer
+typedef void (*ioport_constructor)(device_t &owner, ioport_list &portlist, astring &errorbuf);
-/* forward declarations */
-class input_port_config;
-class input_field_config;
-class emu_timer;
+// I/O port callback function delegates
+typedef device_delegate<ioport_value (ioport_field &, void *)> ioport_field_read_delegate;
+typedef device_delegate<void (ioport_field &, void *, ioport_value, ioport_value)> ioport_field_write_delegate;
+typedef device_delegate<float (ioport_field &, float)> ioport_field_crossmap_delegate;
-/* template specializations */
-typedef tagged_list<input_port_config> ioport_list;
+// keyboard helper function delegates
+typedef delegate<int (const unicode_char *, size_t)> ioport_queue_chars_delegate;
+typedef delegate<bool (unicode_char)> ioport_accept_char_delegate;
+typedef delegate<bool ()> ioport_charqueue_empty_delegate;
-/* read input port callback function */
-typedef delegate<UINT32 (const input_field_config &, void *)> input_field_read_delegate;
+// ======================> inp_header
-/* input port write callback function */
-typedef delegate<void (const input_field_config &, void *, input_port_value, input_port_value)> input_field_write_delegate;
+// header at the front of INP files
+struct inp_header
+{
+ char header[8]; // +00: 8 byte header - must be "MAMEINP\0"
+ UINT64 basetime; // +08: base time of recording
+ UINT8 majversion; // +10: major INP version
+ UINT8 minversion; // +11: minor INP version
+ UINT8 reserved[2]; // +12: must be zero
+ char gamename[12]; // +14: game name string, NULL-terminated
+ char version[32]; // +20: system version string, NULL-terminated
+};
-/* crosshair mapping function */
-typedef delegate<float (const input_field_config &, float)> input_field_crossmap_delegate;
+// ======================> input_device_default
-/* encapsulates a condition on a port field or setting */
-typedef struct _input_condition input_condition;
-struct _input_condition
+// device defined default input settings
+struct input_device_default
{
- const char * tag; /* tag of port whose condition is to be tested */
- input_port_value mask; /* mask to apply to the port */
- input_port_value value; /* value to compare against */
- UINT8 condition; /* condition to use */
+ const char * tag; // tag of port to update
+ ioport_value mask; // mask to apply to the port
+ ioport_value defvalue; // new default value
};
-/* a single setting for a configuration or DIP switch */
-class input_setting_config
+// ======================> input_type_entry
+
+// describes a fundamental input type, including default input sequences
+class input_type_entry
{
- DISABLE_COPYING(input_setting_config);
- friend class simple_list<input_setting_config>;
+ friend class simple_list<input_type_entry>;
+ friend class ioport_manager;
public:
- input_setting_config(input_field_config &field, input_port_value value, const char *name);
- input_setting_config *next() const { return m_next; }
-
- input_port_value value; /* value of the bits in this setting */
- input_condition condition; /* condition under which this setting is valid */
- const char * name; /* user-friendly name to display */
+ // construction/destruction
+ input_type_entry(ioport_type type, ioport_group group, int player, const char *token, const char *name, input_seq standard);
+ input_type_entry(ioport_type type, ioport_group group, int player, const char *token, const char *name, input_seq standard, input_seq decrement, input_seq increment);
+ // getters
+ input_type_entry *next() const { return m_next; }
+ ioport_type type() const { return m_type; }
+ ioport_group group() const { return m_group; }
+ UINT8 player() const { return m_player; }
+ const char *token() const { return m_token; }
+ const char *name() const { return m_name; }
+ input_seq &defseq(input_seq_type seqtype = SEQ_TYPE_STANDARD) { return m_defseq[seqtype]; }
+ const input_seq &seq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const { return m_seq[seqtype]; }
+
+ // setters
+ void configure_osd(const char *token, const char *name);
+
private:
- input_field_config & m_field; /* pointer back to the field that owns us */
- input_setting_config * m_next; /* pointer to next setting in sequence */
+ // internal state
+ input_type_entry * m_next; // next description in the list
+ ioport_type m_type; // IPT_* for this entry
+ ioport_group m_group; // which group the port belongs to
+ UINT8 m_player; // player number (0 is player 1)
+ const char * m_token; // token used to store settings
+ const char * m_name; // user-friendly name
+ input_seq m_defseq[SEQ_TYPE_TOTAL];// default input sequence
+ input_seq m_seq[SEQ_TYPE_TOTAL];// currently configured sequences
};
-/* a mapping from a bit to a physical DIP switch description */
-class input_field_diplocation
+// ======================> digital_joystick
+
+// tracking information about a digital joystick input
+class digital_joystick
{
- DISABLE_COPYING(input_field_diplocation);
- friend class simple_list<input_field_diplocation>;
+ DISABLE_COPYING(digital_joystick);
+ friend class simple_list<digital_joystick>;
public:
- input_field_diplocation(const char *string, UINT8 swnum, bool invert);
- input_field_diplocation *next() const { return m_next; }
-
- astring swname; /* name of the physical DIP switch */
- UINT8 swnum; /* physical switch number */
- bool invert; /* is this an active-high DIP? */
+ // directions
+ enum direction_t
+ {
+ JOYDIR_UP,
+ JOYDIR_DOWN,
+ JOYDIR_LEFT,
+ JOYDIR_RIGHT,
+ JOYDIR_COUNT
+ };
+
+ // bit constants
+ static const UINT8 UP_BIT = 1 << JOYDIR_UP;
+ static const UINT8 DOWN_BIT = 1 << JOYDIR_DOWN;
+ static const UINT8 LEFT_BIT = 1 << JOYDIR_LEFT;
+ static const UINT8 RIGHT_BIT = 1 << JOYDIR_RIGHT;
+ // construction/destruction
+ digital_joystick(int player, int number);
+
+ // getters
+ digital_joystick *next() const { return m_next; }
+ int player() const { return m_player; }
+ int number() const { return m_number; }
+ UINT8 current() const { return m_current; }
+ UINT8 current4way() const { return m_current4way; }
+
+ // configuration
+ direction_t set_axis(ioport_field &field);
+
+ // updates
+ void frame_update();
+
private:
- input_field_diplocation * m_next; /* pointer to the next bit */
+ // internal state
+ digital_joystick * m_next; // next joystick in the list
+ int m_player; // player number represented
+ int m_number; // joystick number represented
+ ioport_field * m_field[JOYDIR_COUNT]; // input field for each direction
+ UINT8 m_current; // current value
+ UINT8 m_current4way; // current 4-way value
+ UINT8 m_previous; // previous value
};
+DECLARE_ENUM_OPERATORS(digital_joystick::direction_t)
-/* a single bitfield within an input port */
-class input_field_config
+// ======================> natural_keyboard
+
+// buffer to handle copy/paste/insert of keys
+class natural_keyboard
{
- DISABLE_COPYING(input_field_config);
- friend class simple_list<input_field_config>;
+ DISABLE_COPYING(natural_keyboard);
public:
- input_field_config(input_port_config &port, int type, input_port_value defvalue, input_port_value maskbits, const char *name = NULL);
+ // construction/destruction
+ natural_keyboard(running_machine &machine);
+
+ // getters and queries
+ running_machine &machine() const { return m_machine; }
+ bool empty() const { return (m_bufbegin == m_bufend); }
+ bool full() const { return ((m_bufend + 1) % m_buffer.count()) == m_bufbegin; }
+ bool can_post() const { return (!m_queue_chars.isnull() || m_keycode_map.count() == 0); }
+ bool is_posting() const { return (!empty() || (!m_charqueue_empty.isnull() && !m_charqueue_empty())); }
- input_field_config *next() const { return m_next; }
- input_port_config &port() const { return m_port; }
- running_machine &machine() const;
- simple_list<input_setting_config> &settinglist() { return m_settinglist; }
- const simple_list<input_setting_config> &settinglist() const { return m_settinglist; }
- simple_list<input_field_diplocation> &diploclist() { return m_diploclist; }
- int modcount() const { return m_modcount; }
+ // configuration
+ void configure(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty);
- /* generally-applicable data */
- input_port_value mask; /* mask of bits belonging to the field */
- input_port_value defvalue; /* default value of these bits */
- input_condition condition; /* condition under which this field is relevant */
- UINT32 type; /* IPT_* type for this port */
- UINT8 player; /* player number (0-based) */
- UINT32 flags; /* combination of FIELD_FLAG_* and ANALOG_FLAG_* above */
- UINT8 impulse; /* number of frames before reverting to defvalue */
- const char * name; /* user-friendly name to display */
- input_seq seq[SEQ_TYPE_TOTAL];/* sequences of all types */
- input_field_read_delegate read; /* read callback routine */
- void * read_param; /* parameter for read callback routine */
- const char * read_device; /* parameter for read callback routine */
- input_field_write_delegate write; /* write callback routine */
- void * write_param; /* parameter for write callback routine */
- const char * write_device; /* parameter for write callback routine */
-
- /* data relevant to analog control types */
- INT32 min; /* minimum value for absolute axes */
- INT32 max; /* maximum value for absolute axes */
- INT32 sensitivity; /* sensitivity (100=normal) */
- INT32 delta; /* delta to apply each frame a digital inc/dec key is pressed */
- INT32 centerdelta; /* delta to apply each frame no digital inputs are pressed */
- UINT8 crossaxis; /* crosshair axis */
- double crossscale; /* crosshair scale */
- double crossoffset; /* crosshair offset */
- double crossaltaxis; /* crosshair alternate axis value */
- input_field_crossmap_delegate crossmapper; /* crosshair mapping function */
- const char * crossmapper_device; /* parameter for write callback routine */
- UINT16 full_turn_count;/* number of optical counts for 1 full turn of the original control */
- const input_port_value * remap_table; /* pointer to an array that remaps the port value */
-
- /* data relevant to other specific types */
- UINT8 way; /* digital joystick 2/4/8-way descriptions */
- unicode_char chars[3]; /* (MESS-specific) unicode key data */
-
- /* this field is only valid if the device is live */
- input_field_state * state; /* live state of field (NULL if not live) */
+ // posting
+ void post(unicode_char ch);
+ void post(const unicode_char *text, size_t length = 0, attotime rate = attotime::zero);
+ void post_utf8(const char *text, size_t length = 0, attotime rate = attotime::zero);
+ void post_coded(const char *text, size_t length = 0, attotime rate = attotime::zero);
+
+ void frame_update(ioport_port &port, ioport_value &digital);
+ const char *key_name(astring &string, unicode_char ch);
private:
- input_field_config * m_next; /* pointer to next field in sequence */
- input_port_config & m_port; /* pointer back to the port that owns us */
- int m_modcount;
- simple_list<input_setting_config> m_settinglist; /* list of input_setting_configs */
- simple_list<input_field_diplocation> m_diploclist; /* list of locations for various bits */
+ // internal keyboard code information
+ struct keycode_map_entry
+ {
+ unicode_char ch;
+ ioport_field * field[UCHAR_SHIFT_END + 1 - UCHAR_SHIFT_BEGIN];
+ };
+
+ // internal helpers
+ void build_codes(ioport_manager &manager);
+ bool can_post_directly(unicode_char ch);
+ bool can_post_alternate(unicode_char ch);
+ attotime choose_delay(unicode_char ch);
+ void internal_post(unicode_char ch);
+ void timer(void *ptr, int param);
+ const char *unicode_to_string(astring &buffer, unicode_char ch);
+ const keycode_map_entry *find_code(unicode_char ch) const;
+
+ // debugger helpers
+ static void execute_input(running_machine &machine, int ref, int params, const char *param[]);
+ static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[]);
+
+ // internal state
+ running_machine & m_machine; // reference to our machine
+ UINT32 m_bufbegin; // index of starting character
+ UINT32 m_bufend; // index of ending character
+ dynamic_array<unicode_char> m_buffer; // actual buffer
+ bool m_status_keydown; // current keydown status
+ bool m_last_cr; // was the last char a CR?
+ emu_timer * m_timer; // timer for posting characters
+ attotime m_current_rate; // current rate for posting
+ ioport_queue_chars_delegate m_queue_chars; // queue characters callback
+ ioport_accept_char_delegate m_accept_char; // accept character callback
+ ioport_charqueue_empty_delegate m_charqueue_empty; // character queue empty callback
+ dynamic_array<keycode_map_entry> m_keycode_map; // keycode map
};
-/* user-controllable settings for a field */
-typedef struct _input_field_user_settings input_field_user_settings;
-struct _input_field_user_settings
-{
- input_port_value value; /* for DIP switches */
- input_seq seq[SEQ_TYPE_TOTAL];/* sequences of all types */
- INT32 sensitivity; /* for analog controls */
- INT32 delta; /* for analog controls */
- INT32 centerdelta; /* for analog controls */
- UINT8 reverse; /* for analog controls */
-};
+// ======================> ioport_condition
-/* device defined default input settings */
-typedef struct _input_device_default input_device_default;
-struct _input_device_default
+// encapsulates a condition on a port field or setting
+class ioport_condition
{
- const char * tag; /* tag of port to update */
- input_port_value mask; /* mask to apply to the port */
- input_port_value defvalue; /* new default value */
+public:
+ // condition types
+ enum condition_t
+ {
+ ALWAYS = 0,
+ EQUALS,
+ NOTEQUALS,
+ GREATERTHAN,
+ NOTGREATERTHAN,
+ LESSTHAN,
+ NOTLESSTHAN
+ };
+
+ // construction/destruction
+ ioport_condition() { reset(); }
+ ioport_condition(condition_t condition, const char *tag, ioport_value mask, ioport_value value) { set(condition, tag, mask, value); }
+
+ // getters
+ const char *tag() const { return m_tag; }
+
+ // operators
+ bool operator==(const ioport_condition &rhs) const { return (m_mask == rhs.m_mask && m_value == rhs.m_value && m_condition == rhs.m_condition && strcmp(m_tag, rhs.m_tag) == 0); }
+ bool eval(device_t &device) const;
+ bool none() const { return (m_condition == ALWAYS); }
+
+ // configuration
+ void reset() { set(ALWAYS, NULL, 0, 0); }
+ void set(condition_t condition, const char *tag, ioport_value mask, ioport_value value)
+ {
+ m_condition = condition;
+ m_tag = tag;
+ m_mask = mask;
+ m_value = value;
+ }
+
+private:
+ // internal state
+ condition_t m_condition; // condition to use
+ const char * m_tag; // tag of port whose condition is to be tested
+ ioport_value m_mask; // mask to apply to the port
+ ioport_value m_value; // value to compare against
};
-/* a single input port configuration */
-class input_port_config
+
+// ======================> ioport_setting
+
+// a single setting for a configuration or DIP switch
+class ioport_setting
{
- DISABLE_COPYING(input_port_config);
- friend class simple_list<input_port_config>;
+ DISABLE_COPYING(ioport_setting);
+ friend class simple_list<ioport_setting>;
public:
// construction/destruction
- input_port_config(device_t &owner, const char *tag);
-
+ ioport_setting(ioport_field &field, ioport_value value, const char *name);
+
// getters
- input_port_config *next() const { return m_next; }
- device_t &owner() const { return m_owner; }
+ ioport_setting *next() const { return m_next; }
+ ioport_field &field() const { return m_field; }
+ device_t &device() const;
running_machine &machine() const;
- input_field_config *first_field() const { return m_fieldlist.first(); }
- simple_list<input_field_config> &fieldlist() { return m_fieldlist; }
- const char *tag() const { return m_tag; }
- int modcount() const { return m_modcount; }
+ ioport_value value() const { return m_value; }
+ ioport_condition &condition() { return m_condition; }
+ const char *name() const { return m_name; }
- void bump_modcount() { m_modcount++; }
+ // helpers
+ bool enabled() { return m_condition.eval(device()); }
- void collapse_fields(astring &errorbuf);
+private:
+ // internal state
+ ioport_setting * m_next; // pointer to next setting in sequence
+ ioport_field & m_field; // pointer back to the field that owns us
+ ioport_value m_value; // value of the bits in this setting
+ const char * m_name; // user-friendly name to display
+ ioport_condition m_condition; // condition under which this setting is valid
+};
- /* these fields are only valid if the port is live */
- input_port_state * state; /* live state of port (NULL if not live) */
- input_port_value active; /* mask of active bits in the port */
+
+// ======================> ioport_diplocation
+
+// a mapping from a bit to a physical DIP switch description
+class ioport_diplocation
+{
+ DISABLE_COPYING(ioport_diplocation);
+ friend class simple_list<ioport_diplocation>;
+
+public:
+ // construction/destruction
+ ioport_diplocation(const char *name, UINT8 swnum, bool invert);
+
+ // getters
+ ioport_diplocation *next() const { return m_next; }
+ const char *name() const { return m_name; }
+ UINT8 number() const { return m_number; }
+ bool inverted() const { return m_invert; }
private:
- input_port_config * m_next; /* pointer to next port */
- device_t & m_owner; /* associated device, when appropriate */
- simple_list<input_field_config> m_fieldlist; /* list of input_field_configs */
- astring m_tag; /* pointer to this port's tag */
- int m_modcount;
+ ioport_diplocation * m_next; // pointer to the next bit
+ astring m_name; // name of the physical DIP switch
+ UINT8 m_number; // physical switch number
+ bool m_invert; // is this an active-high DIP?
};
-/* describes a fundamental input type, including default input sequences */
-class input_type_entry
+// ======================> ioport_field
+
+// a single bitfield within an input port
+class ioport_field
{
- friend class simple_list<input_type_entry>;
+ DISABLE_COPYING(ioport_field);
+ friend class simple_list<ioport_field>;
+ friend class ioport_configurer;
+ friend class dynamic_field;
+
+ // flags for ioport_fields
+ static const int FIELD_FLAG_UNUSED = 0x01; // set if this field is unused but relevant to other games on the same hw
+ static const int FIELD_FLAG_COCKTAIL = 0x02; // set if this field is relevant only for cocktail cabinets
+ static const int FIELD_FLAG_TOGGLE = 0x04; // set if this field should behave as a toggle
+ static const int FIELD_FLAG_ROTATED = 0x08; // set if this field represents a rotated control
+ static const int ANALOG_FLAG_REVERSE = 0x10; // analog only: reverse the sense of the axis
+ static const int ANALOG_FLAG_RESET = 0x20; // analog only: always preload in->default for relative axes, returning only deltas
+ static const int ANALOG_FLAG_WRAPS = 0x40; // analog only: positional count wraps around
+ static const int ANALOG_FLAG_INVERT = 0x80; // analog only: bitwise invert bits
public:
- input_type_entry(UINT32 type, ioport_group group, int player, const char *token, const char *name, input_seq standard);
- input_type_entry(UINT32 type, ioport_group group, int player, const char *token, const char *name, input_seq standard, input_seq decrement, input_seq increment);
-
- input_type_entry *next() const { return m_next; }
+ // construction/destruction
+ ioport_field(ioport_port &port, ioport_type type, ioport_value defvalue, ioport_value maskbits, const char *name = NULL);
+ ~ioport_field();
- UINT32 type; /* IPT_* for this entry */
- ioport_group group; /* which group the port belongs to */
- UINT8 player; /* player number (0 is player 1) */
- const char * token; /* token used to store settings */
- const char * name; /* user-friendly name */
- input_seq defseq[SEQ_TYPE_TOTAL];/* default input sequence */
- input_seq seq[SEQ_TYPE_TOTAL];/* currently configured sequences */
+ // getters
+ ioport_field *next() const { return m_next; }
+ ioport_port &port() const { return m_port; }
+ device_t &device() const;
+ ioport_manager &manager() const;
+ running_machine &machine() const;
+ int modcount() const { return m_modcount; }
+ ioport_setting *first_setting() const { return m_settinglist.first(); }
+ ioport_diplocation *first_diplocation() const { return m_diploclist.first(); }
+
+ ioport_value mask() const { return m_mask; }
+ ioport_value defvalue() const { return m_defvalue; }
+ ioport_condition &condition() { return m_condition; }
+ ioport_type type() const { return m_type; }
+ UINT8 player() const { return m_player + 1; }
+
+ bool unused() const { return ((m_flags & FIELD_FLAG_UNUSED) != 0); }
+ bool cocktail() const { return ((m_flags & FIELD_FLAG_COCKTAIL) != 0); }
+ bool toggle() const { return ((m_flags & FIELD_FLAG_TOGGLE) != 0); }
+ bool rotated() const { return ((m_flags & FIELD_FLAG_ROTATED) != 0); }
+ bool analog_reverse() const { return ((m_flags & ANALOG_FLAG_REVERSE) != 0); }
+ bool analog_reset() const { return ((m_flags & ANALOG_FLAG_RESET) != 0); }
+ bool analog_wraps() const { return ((m_flags & ANALOG_FLAG_WRAPS) != 0); }
+ bool analog_invert() const { return ((m_flags & ANALOG_FLAG_INVERT) != 0); }
+
+ UINT8 impulse() const { return m_impulse; }
+ const char *name() const;
+ const char *specific_name() const { return m_name; }
+ const input_seq &seq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const;
+ bool has_dynamic_read() const { return !m_read.isnull(); }
+ bool has_dynamic_write() const { return !m_write.isnull(); }
+
+ ioport_value minval() const { return m_min; }
+ ioport_value maxval() const { return m_max; }
+ INT32 sensitivity() const { return m_sensitivity; }
+ INT32 delta() const { return m_delta; }
+ INT32 centerdelta() const { return m_centerdelta; }
+ crosshair_axis_t crosshair_axis() const { return m_crosshair_axis; }
+ double crosshair_scale() const { return m_crosshair_scale; }
+ double crosshair_offset() const { return m_crosshair_offset; }
+ UINT16 full_turn_count() const { return m_full_turn_count; }
+ const ioport_value *remap_table() const { return m_remap_table; }
+
+ UINT8 way() const { return m_way; }
+ unicode_char keyboard_code(int which) const;
+ ioport_field_live &live() const { assert(m_live != NULL); return *m_live; }
+
+ // setters
+ void set_crosshair_scale(double scale) { m_crosshair_scale = scale; }
+ void set_crosshair_offset(double offset) { m_crosshair_offset = offset; }
+
+ // derived getters
+ ioport_type_class type_class() const;
+ bool is_analog() const { return (m_type > IPT_ANALOG_FIRST && m_type < IPT_ANALOG_LAST); }
+ bool is_digital_joystick() const { return (m_type > IPT_DIGITAL_JOYSTICK_FIRST && m_type < IPT_DIGITAL_JOYSTICK_LAST); }
+
+ // additional operations
+ bool enabled() const { return m_condition.eval(device()); }
+ const char *setting_name() const;
+ bool has_previous_setting() const;
+ void select_previous_setting();
+ bool has_next_setting() const;
+ void select_next_setting();
+ void crosshair_position(float &x, float &y, bool &gotx, bool &goty);
+ void init_live_state(analog_field *analog);
+ void frame_update(ioport_value &result, bool mouse_down);
+ void reduce_mask(ioport_value bits_to_remove) { m_mask &= ~bits_to_remove; }
+
+ // user-controllable settings for a field
+ struct user_settings
+ {
+ ioport_value value; // for DIP switches
+ input_seq seq[SEQ_TYPE_TOTAL]; // sequences of all types
+ INT32 sensitivity; // for analog controls
+ INT32 delta; // for analog controls
+ INT32 centerdelta; // for analog controls
+ bool reverse; // for analog controls
+ };
+ void get_user_settings(user_settings &settings);
+ void set_user_settings(const user_settings &settings);
private:
- input_type_entry * m_next; /* next description in the list */
+ void expand_diplocation(const char *location, astring &errorbuf);
+
+ // internal state
+ ioport_field * m_next; // pointer to next field in sequence
+ ioport_port & m_port; // reference to the port that owns us
+ ioport_field_live * m_live; // live state of field (NULL if not live)
+ int m_modcount; // modification count
+ simple_list<ioport_setting> m_settinglist; // list of input_setting_configs
+ simple_list<ioport_diplocation> m_diploclist; // list of locations for various bits
+
+ // generally-applicable data
+ ioport_value m_mask; // mask of bits belonging to the field
+ ioport_value m_defvalue; // default value of these bits
+ ioport_condition m_condition; // condition under which this field is relevant
+ ioport_type m_type; // IPT_* type for this port
+ UINT8 m_player; // player number (0-based)
+ UINT32 m_flags; // combination of FIELD_FLAG_* and ANALOG_FLAG_* above
+ UINT8 m_impulse; // number of frames before reverting to defvalue
+ const char * m_name; // user-friendly name to display
+ input_seq m_seq[SEQ_TYPE_TOTAL];// sequences of all types
+ ioport_field_read_delegate m_read; // read callback routine
+ void * m_read_param; // parameter for read callback routine
+ ioport_field_write_delegate m_write; // write callback routine
+ void * m_write_param; // parameter for write callback routine
+
+ // data relevant to analog control types
+ ioport_value m_min; // minimum value for absolute axes
+ ioport_value m_max; // maximum value for absolute axes
+ INT32 m_sensitivity; // sensitivity (100=normal)
+ INT32 m_delta; // delta to apply each frame a digital inc/dec key is pressed
+ INT32 m_centerdelta; // delta to apply each frame no digital inputs are pressed
+ crosshair_axis_t m_crosshair_axis; // crosshair axis
+ double m_crosshair_scale; // crosshair scale
+ double m_crosshair_offset; // crosshair offset
+ double m_crosshair_altaxis;// crosshair alternate axis value
+ ioport_field_crossmap_delegate m_crosshair_mapper; // crosshair mapping function
+ UINT16 m_full_turn_count; // number of optical counts for 1 full turn of the original control
+ const ioport_value * m_remap_table; // pointer to an array that remaps the port value
+
+ // data relevant to other specific types
+ UINT8 m_way; // digital joystick 2/4/8-way descriptions
+ unicode_char m_chars[4]; // unicode key data
};
-/* header at the front of INP files */
-typedef struct _inp_header inp_header;
-struct _inp_header
+// ======================> ioport_list
+
+// class that holds a list of I/O ports
+class ioport_list : public tagged_list<ioport_port>
{
- char header[8]; /* +00: 8 byte header - must be "MAMEINP\0" */
- UINT64 basetime; /* +08: base time of recording */
- UINT8 majversion; /* +10: major INP version */
- UINT8 minversion; /* +11: minor INP version */
- UINT8 reserved[2]; /* +12: must be zero */
- char gamename[12]; /* +14: game name string, NULL-terminated */
- char version[32]; /* +20: system version string, NULL-terminated */
-};
+ DISABLE_COPYING(ioport_list);
+public:
+ // construction/destruction
+ ioport_list(resource_pool &pool = global_resource_pool())
+ : tagged_list<ioport_port>(pool) { }
-struct digital_joystick_state
-{
- const input_field_config * field[4]; /* input field for up, down, left, right respectively */
- UINT8 inuse; /* is this joystick used? */
- UINT8 current; /* current value */
- UINT8 current4way; /* current 4-way value */
- UINT8 previous; /* previous value */
+ using tagged_list<ioport_port>::append;
+ void append(device_t &device, astring &errorbuf);
};
-#define DIGITAL_JOYSTICKS_PER_PLAYER 3
-#define NUM_SIMUL_KEYS (UCHAR_SHIFT_END - UCHAR_SHIFT_BEGIN + 1)
-struct inputx_code
-{
- unicode_char ch;
- const input_field_config * field[NUM_SIMUL_KEYS];
-};
+// ======================> ioport_port
-struct key_buffer
+// a single input port configuration
+class ioport_port
{
- int begin_pos;
- int end_pos;
- unsigned int status_keydown : 1;
- int size;
- unicode_char *buffer;
+ DISABLE_COPYING(ioport_port);
+ friend class simple_list<ioport_port>;
+ friend class ioport_configurer;
+
+public:
+ // construction/destruction
+ ioport_port(device_t &owner, const char *tag);
+ ~ioport_port();
+
+ // getters
+ ioport_port *next() const { return m_next; }
+ ioport_manager &manager() const;
+ device_t &device() const { return m_device; }
+ running_machine &machine() const;
+ ioport_field *first_field() const { return m_fieldlist.first(); }
+ const char *tag() const { return m_tag; }
+ int modcount() const { return m_modcount; }
+ ioport_value active() const { return m_active; }
+ ioport_value active_safe(ioport_value defval) const { return (this == NULL) ? defval : active(); }
+ ioport_port_live &live() const { assert(m_live != NULL); return *m_live; }
+
+ // read/write to the port
+ ioport_value read();
+ ioport_value read_safe(ioport_value defval) { return (this == NULL) ? defval : read(); }
+ void write(ioport_value value, ioport_value mask = ~0);
+ void write_safe(ioport_value value, ioport_value mask = ~0) { if (this != NULL) write(value, mask); }
+
+ // other operations
+ ioport_field *field(ioport_value mask);
+ void collapse_fields(astring &errorbuf);
+ void frame_update(ioport_field *mouse_field);
+ void init_live_state();
+
+private:
+ void insert_field(ioport_field &newfield, ioport_value &disallowedbits, astring &errorbuf);
+
+ // internal state
+ ioport_port * m_next; // pointer to next port
+ device_t & m_device; // associated device
+ simple_list<ioport_field> m_fieldlist; // list of ioport_fields
+ astring m_tag; // copy of this port's tag
+ int m_modcount; // modification count
+ ioport_value m_active; // mask of active bits in the port
+ ioport_port_live * m_live; // live state of port (NULL if not live)
};
-/* private input port state */
+
+// ======================> ioport_manager
+
+// private input port state
class ioport_manager
{
+ DISABLE_COPYING(ioport_manager);
friend class device_t;
+ friend class ioport_configurer;
public:
// construction/destruction
@@ -929,368 +1235,406 @@ public:
// getters
running_machine &machine() const { return m_machine; }
- input_port_config *first_port() const { return m_portlist.first(); }
-
- /* global state */
- UINT8 safe_to_read; /* clear at start; set after state is loaded */
-
- /* types */
- simple_list<input_type_entry> typelist; /* list of live type states */
- input_type_entry * type_to_entry[__ipt_max][MAX_PLAYERS]; /* map from type/player to type state */
-
- /* specific special global input states */
- digital_joystick_state joystick_info[MAX_PLAYERS][DIGITAL_JOYSTICKS_PER_PLAYER]; /* joystick states */
-
- /* frame time tracking */
- attotime last_frame_time; /* time of the last frame callback */
- attoseconds_t last_delta_nsec; /* nanoseconds that passed since the previous callback */
-
- /* playback/record information */
- emu_file * record_file; /* recording file (NULL if not recording) */
- emu_file * playback_file; /* playback file (NULL if not recording) */
- UINT64 playback_accumulated_speed;/* accumulated speed during playback */
- UINT32 playback_accumulated_frames;/* accumulated frames during playback */
-
- /* inputx */
- inputx_code *codes;
- key_buffer keybuffer;
- emu_timer *inputx_timer;
- int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len);
- int (*accept_char)(running_machine &machine, unicode_char ch);
- int (*charqueue_empty)(running_machine &machine);
- attotime current_rate;
+ ioport_port *first_port() const { return m_portlist.first(); }
+ bool safe_to_read() const { return m_safe_to_read; }
+ natural_keyboard &natkeyboard() { return m_natkeyboard; }
+
+ // type helpers
+ input_type_entry *first_type() const { return m_typelist.first(); }
+ bool type_pressed(ioport_type type, int player = 0);
+ const char *type_name(ioport_type type, UINT8 player);
+ ioport_group type_group(ioport_type type, int player);
+ const input_seq &type_seq(ioport_type type, int player = 0, input_seq_type seqtype = SEQ_TYPE_STANDARD);
+ void set_type_seq(ioport_type type, int player, input_seq_type seqtype, const input_seq &newseq);
+ static bool type_is_analog(ioport_type type) { return (type > IPT_ANALOG_FIRST && type < IPT_ANALOG_LAST); }
+ bool type_class_present(ioport_type_class inputclass);
+
+ // other helpers
+ digital_joystick &digjoystick(int player, int joysticknum);
+ int count_players() const;
+ bool crosshair_position(int player, float &x, float &y);
+ bool has_keyboard() const;
+ void setup_natural_keyboard(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty);
+ ioport_value frame_interpolate(ioport_value oldval, ioport_value newval);
+ ioport_type token_to_input_type(const char *string, int &player) const;
+ const char *input_type_to_token(astring &string, ioport_type type, int player);
+ void frame_update();
private:
- input_port_config *port(const char *tag) const { return m_portlist.find(tag); }
-
- // internals
- ioport_list m_portlist; // points to a list of input port configurations
+ // internal helpers
+ void init_port_types();
+ void init_autoselect_devices(int type1, int type2, int type3, const char *option, const char *ananame);
+
+ ioport_port *port(const char *tag) const { return m_portlist.find(tag); }
+ void exit();
+ input_seq_type token_to_seq_type(const char *string);
+ void update_defaults();
+
+ void load_config(int config_type, xml_data_node *parentnode);
+ void load_remap_table(xml_data_node *parentnode);
+ bool load_default_config(xml_data_node *portnode, int type, int player, const input_seq *newseq);
+ bool load_game_config(xml_data_node *portnode, int type, int player, const input_seq *newseq);
+
+ void save_config(int config_type, xml_data_node *parentnode);
+ void save_sequence(xml_data_node *parentnode, input_seq_type type, ioport_type porttype, const input_seq &seq);
+ bool save_this_input_field_type(ioport_type type);
+ void save_default_inputs(xml_data_node *parentnode);
+ void save_game_inputs(xml_data_node *parentnode);
+
+ template<typename _Type> _Type playback_read(_Type &result);
+ time_t playback_init();
+ void playback_end(const char *message = NULL);
+ void playback_frame(attotime curtime);
+ void playback_port(ioport_port &port);
+
+ template<typename _Type> void record_write(_Type value);
+ void record_init();
+ void record_end(const char *message = NULL);
+ void record_frame(attotime curtime);
+ void record_port(ioport_port &port);
// internal state
- running_machine & m_machine;
+ running_machine & m_machine; // reference to owning machine
+ bool m_safe_to_read; // clear at start; set after state is loaded
+ ioport_list m_portlist; // list of input port configurations
+
+ // types
+ simple_list<input_type_entry> m_typelist; // list of live type states
+ input_type_entry * m_type_to_entry[IPT_COUNT][MAX_PLAYERS]; // map from type/player to type state
+
+ // specific special global input states
+ simple_list<digital_joystick> m_joystick_list; // list of digital joysticks
+ natural_keyboard m_natkeyboard; // natural keyboard support
+
+ // frame time tracking
+ attotime m_last_frame_time; // time of the last frame callback
+ attoseconds_t m_last_delta_nsec; // nanoseconds that passed since the previous callback
+
+ // playback/record information
+ emu_file m_record_file; // recording file (NULL if not recording)
+ emu_file m_playback_file; // playback file (NULL if not recording)
+ UINT64 m_playback_accumulated_speed; // accumulated speed during playback
+ UINT32 m_playback_accumulated_frames; // accumulated frames during playback
};
-/***************************************************************************
- MACROS
-***************************************************************************/
+// ======================> ioport_configurer
-/* macro for a read callback function (PORT_CUSTOM) */
-#define CUSTOM_INPUT(name) input_port_value name(device_t &device, const input_field_config &field, void *param)
-#define CUSTOM_INPUT_MEMBER(name) input_port_value name(const input_field_config &field, void *param)
-#define DECLARE_CUSTOM_INPUT_MEMBER(name) input_port_value name(const input_field_config &field, void *param)
+// class to wrap helper functions
+class ioport_configurer
+{
+public:
+ // construction/destruction
+ ioport_configurer(device_t &owner, ioport_list &portlist, astring &errorbuf);
+
+ // static helpers
+ static const char *string_from_token(const char *string);
+
+ // port helpers
+ void port_alloc(const char *tag);
+ void port_modify(const char *tag);
+
+ // field helpers
+ void field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name = NULL);
+ void field_add_char(unicode_char ch);
+ void field_add_code(input_seq_type which, input_code code);
+ void field_set_way(int way) const { m_curfield->m_way = way; }
+ void field_set_rotated() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; }
+ void field_set_name(const char *name) const { m_curfield->m_name = string_from_token(name); }
+ void field_set_player(int player) const { m_curfield->m_player = player - 1; }
+ void field_set_cocktail() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); }
+ void field_set_toggle() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; }
+ void field_set_impulse(UINT8 impulse) const { m_curfield->m_impulse = impulse; }
+ void field_set_analog_reverse() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_REVERSE; }
+ void field_set_analog_reset() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_RESET; }
+ void field_set_unused() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_UNUSED; }
+ void field_set_min_max(ioport_value minval, ioport_value maxval) const { m_curfield->m_min = minval; m_curfield->m_max = maxval; }
+ void field_set_sensitivity(INT32 sensitivity) const { m_curfield->m_sensitivity = sensitivity; }
+ void field_set_delta(INT32 delta) const { m_curfield->m_centerdelta = m_curfield->m_delta = delta; }
+ void field_set_centerdelta(INT32 delta) const { m_curfield->m_centerdelta = delta; }
+ void field_set_crosshair(crosshair_axis_t axis, double altaxis, double scale, double offset) const { m_curfield->m_crosshair_axis = axis; m_curfield->m_crosshair_altaxis = altaxis; m_curfield->m_crosshair_scale = scale; m_curfield->m_crosshair_offset = offset; }
+ void field_set_crossmapper(ioport_field_crossmap_delegate callback) const { m_curfield->m_crosshair_mapper = callback; }
+ void field_set_full_turn_count(UINT16 count) const { m_curfield->m_full_turn_count = count; }
+ void field_set_analog_wraps() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_WRAPS; }
+ void field_set_remap_table(const ioport_value *table) { m_curfield->m_remap_table = table; }
+ void field_set_analog_invert() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_INVERT; }
+ void field_set_dynamic_read(ioport_field_read_delegate delegate, void *param = NULL) const { m_curfield->m_read = delegate; m_curfield->m_read_param = param; }
+ void field_set_dynamic_write(ioport_field_write_delegate delegate, void *param = NULL) const { m_curfield->m_write = delegate; m_curfield->m_write_param = param; }
+ void field_set_diplocation(const char *location) const { m_curfield->expand_diplocation(location, m_errorbuf); }
+
+ // setting helpers
+ void setting_alloc(ioport_value value, const char *name);
+
+ // misc helpers
+ void set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value);
+ void onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation);
-/* macro for port write callback functions (PORT_CHANGED) */
-#define INPUT_CHANGED(name) void name(device_t &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
-#define INPUT_CHANGED_MEMBER(name) void name(const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
-#define DECLARE_INPUT_CHANGED_MEMBER(name) void name(const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
+private:
+ // internal state
+ device_t & m_owner;
+ ioport_list & m_portlist;
+ astring & m_errorbuf;
+
+ ioport_port * m_curport;
+ ioport_field * m_curfield;
+ ioport_setting * m_cursetting;
+};
-/* macro for port changed callback functions (PORT_CROSSHAIR_MAPPER) */
-#define CROSSHAIR_MAPPER(name) float name(device_t &device, const input_field_config &field, float linear_value)
-#define CROSSHAIR_MAPPER_MEMBER(name) float name(const input_field_config &field, float linear_value)
-#define DECLARE_CROSSHAIR_MAPPER_MEMBER(name) float name(const input_field_config &field, float linear_value)
-/* macro for wrapping a default string */
-#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
+//**************************************************************************
+// MACROS
+//**************************************************************************
-template<int (*_FunctionPointer)(device_t *)>
-input_port_value ioport_read_line_wrapper(device_t &device, const input_field_config &field, void *param)
-{
- return (*_FunctionPointer)(&device);
-}
+#define UCHAR_MAMEKEY(code) (UCHAR_MAMEKEY_BEGIN + ITEM_ID_##code)
-template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()>
-input_port_value ioport_read_line_wrapper(_FunctionClass &device, const input_field_config &field, void *param)
-{
- return (device.*_FunctionPointer)();
-}
+// macro for a read callback function (PORT_CUSTOM)
+#define CUSTOM_INPUT(name) ioport_value name(device_t &device, ioport_field &field, void *param)
+#define CUSTOM_INPUT_MEMBER(name) ioport_value name(ioport_field &field, void *param)
+#define DECLARE_CUSTOM_INPUT_MEMBER(name) ioport_value name(ioport_field &field, void *param)
-template<void (*_FunctionPointer)(device_t *, int)>
-void ioport_write_line_wrapper(device_t &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
-{
- return (*_FunctionPointer)(&device, newval);
-}
+// macro for port write callback functions (PORT_CHANGED)
+#define INPUT_CHANGED(name) void name(device_t &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
+#define INPUT_CHANGED_MEMBER(name) void name(ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
+#define DECLARE_INPUT_CHANGED_MEMBER(name) void name(ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
-template<class _FunctionClass, void (_FunctionClass::*_FunctionPointer)(int)>
-void ioport_write_line_wrapper(_FunctionClass &device, const input_field_config &field, void *param, input_port_value oldval, input_port_value newval)
-{
- return (device.*_FunctionPointer)(newval);
-}
+// macro for port changed callback functions (PORT_CROSSHAIR_MAPPER)
+#define CROSSHAIR_MAPPER(name) float name(device_t &device, ioport_field &field, float linear_value)
+#define CROSSHAIR_MAPPER_MEMBER(name) float name(ioport_field &field, float linear_value)
+#define DECLARE_CROSSHAIR_MAPPER_MEMBER(name) float name(ioport_field &field, float linear_value)
+// macro for wrapping a default string
+#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
-/***************************************************************************
- MACROS FOR BUILDING INPUT PORTS
-***************************************************************************/
-typedef void (*ioport_constructor)(device_t &owner, ioport_list &portlist, astring &errorbuf);
+//**************************************************************************
+// MACROS FOR BUILDING INPUT PORTS
+//**************************************************************************
-/* so that "0" can be used for unneeded input ports */
+// so that "0" can be used for unneeded input ports
#define construct_ioport_0 NULL
-/* name of table */
+// name of table
#define INPUT_PORTS_NAME(_name) construct_ioport_##_name
-/* start of table */
+// start of table
#define INPUT_PORTS_START(_name) \
ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, astring &errorbuf) \
{ \
- astring fulltag; \
- input_setting_config *cursetting = NULL; \
- input_field_config *curfield = NULL; \
- input_port_config *curport = NULL; \
- input_port_value maskbits = 0; \
- (void)cursetting; (void)curfield; (void)curport; (void)maskbits; \
-
-/* end of table */
+ ioport_configurer configurer(owner, portlist, errorbuf); \
+
+// end of table
#define INPUT_PORTS_END \
}
-/* aliasing */
+// aliasing
#define INPUT_PORTS_EXTERN(_name) \
extern void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, astring &errorbuf)
-/* including */
+// including
#define PORT_INCLUDE(_name) \
INPUT_PORTS_NAME(_name)(owner, portlist, errorbuf); \
-/* start of a new input port (with included tag) */
+// start of a new input port (with included tag)
#define PORT_START(_tag) \
- curport = ioconfig_alloc_port(portlist, owner, _tag); \
- curfield = NULL; \
- cursetting = NULL; \
- maskbits = 0; \
+ configurer.port_alloc(_tag); \
-/* modify an existing port */
+// modify an existing port
#define PORT_MODIFY(_tag) \
- curport = ioconfig_modify_port(portlist, owner, _tag); \
- curfield = NULL; \
- cursetting = NULL; \
- maskbits = 0; \
+ configurer.port_modify(_tag); \
-/* input bit definition */
+// input bit definition
#define PORT_BIT(_mask, _default, _type) \
- curfield = ioconfig_alloc_field(*curport, (_type), (_default), (_mask)); \
- cursetting = NULL;
+ configurer.field_alloc((_type), (_default), (_mask)); \
-#define PORT_SPECIAL_ONOFF(_mask, _default, _strindex) PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, NULL)
+#define PORT_SPECIAL_ONOFF(_mask, _default, _strindex) \
+ PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, NULL)
#define PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, _diploc) \
- curfield = ioconfig_alloc_onoff(*curport, DEF_STR(_strindex), _default, _mask, _diploc, errorbuf); \
- cursetting = NULL;
+ configurer.onoff_alloc(DEF_STR(_strindex), _default, _mask, _diploc); \
-/* append a code */
+// append a code
#define PORT_CODE(_code) \
- ioconfig_add_code(*curfield, SEQ_TYPE_STANDARD, _code);
+ configurer.field_add_code(SEQ_TYPE_STANDARD, _code);
#define PORT_CODE_DEC(_code) \
- ioconfig_add_code(*curfield, SEQ_TYPE_DECREMENT, _code);
+ configurer.field_add_code(SEQ_TYPE_DECREMENT, _code);
#define PORT_CODE_INC(_code) \
- ioconfig_add_code(*curfield, SEQ_TYPE_INCREMENT, _code);
+ configurer.field_add_code(SEQ_TYPE_INCREMENT, _code);
-/* joystick flags */
+// joystick flags
#define PORT_2WAY \
- curfield->way = 2;
+ configurer.field_set_way(2);
#define PORT_4WAY \
- curfield->way = 4;
+ configurer.field_set_way(4);
#define PORT_8WAY \
- curfield->way = 8;
+ configurer.field_set_way(8);
#define PORT_16WAY \
- curfield->way = 16;
+ configurer.field_set_way(16);
#define PORT_ROTATED \
- curfield->flags |= FIELD_FLAG_ROTATED
+ configurer.field_set_rotated();
-/* general flags */
+// general flags
#define PORT_NAME(_name) \
- curfield->name = input_port_string_from_token(_name);
+ configurer.field_set_name(_name);
#define PORT_PLAYER(_player) \
- curfield->player = (_player) - 1;
+ configurer.field_set_player(_player);
#define PORT_COCKTAIL \
- curfield->flags |= FIELD_FLAG_COCKTAIL; \
- curfield->player = 1;
+ configurer.field_set_cocktail();
#define PORT_TOGGLE \
- curfield->flags |= FIELD_FLAG_TOGGLE;
+ configurer.field_set_toggle();
#define PORT_IMPULSE(_duration) \
- curfield->impulse = _duration;
+ configurer.field_set_impulse(_duration);
#define PORT_REVERSE \
- curfield->flags |= ANALOG_FLAG_REVERSE;
+ configurer.field_set_analog_reverse();
#define PORT_RESET \
- curfield->flags |= ANALOG_FLAG_RESET;
+ configurer.field_set_analog_reset();
#define PORT_UNUSED \
- curfield->flags |= FIELD_FLAG_UNUSED;
+ configurer.field_set_unused();
-/* analog settings */
-/* if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value */
+// analog settings
+// if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value
#define PORT_MINMAX(_min, _max) \
- curfield->min = _min; \
- curfield->max = _max;
+ configurer.field_set_min_max(_min, _max);
#define PORT_SENSITIVITY(_sensitivity) \
- curfield->sensitivity = _sensitivity;
+ configurer.field_set_sensitivity(_sensitivity);
#define PORT_KEYDELTA(_delta) \
- curfield->delta = curfield->centerdelta = _delta;
+ configurer.field_set_delta(_delta); \
-/* note that PORT_CENTERDELTA must appear after PORT_KEYDELTA */
+// note that PORT_CENTERDELTA must appear after PORT_KEYDELTA
#define PORT_CENTERDELTA(_delta) \
- curfield->centerdelta = _delta;
+ configurer.field_set_centerdelta(_delta);
#define PORT_CROSSHAIR(axis, scale, offset, altaxis) \
- curfield->crossaxis = CROSSHAIR_AXIS_##axis; \
- curfield->crossaltaxis = altaxis; \
- curfield->crossscale = scale; \
- curfield->crossoffset = offset;
+ configurer.field_set_crosshair(CROSSHAIR_AXIS_##axis, altaxis, scale, offset);
#define PORT_CROSSHAIR_MAPPER(_callback) \
- curfield->crossmapper = input_field_crossmap_delegate(_callback, #_callback, (device_t *)NULL); \
- curfield->crossmapper_device = DEVICE_SELF;
+ configurer.field_set_crossmapper(ioport_field_crossmap_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL));
#define PORT_CROSSHAIR_MAPPER_MEMBER(_device, _class, _member) \
- curfield->crossmapper = input_field_crossmap_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \
- curfield->crossmapper_device = _device;
+ configurer.field_set_crossmapper(ioport_field_crossmap_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL));
-/* how many optical counts for 1 full turn of the control */
+// how many optical counts for 1 full turn of the control
#define PORT_FULL_TURN_COUNT(_count) \
- curfield->full_turn_count = _count;
+ configurer.field_set_full_turn_count(_count);
-/* positional controls can be binary or 1 of X */
-/* 1 of X not completed yet */
-/* if it is specified as PORT_REMAP_TABLE then it is binary, but remapped */
-/* otherwise it is binary */
+// positional controls can be binary or 1 of X
+// 1 of X not completed yet
+// if it is specified as PORT_REMAP_TABLE then it is binary, but remapped
+// otherwise it is binary
#define PORT_POSITIONS(_positions) \
- curfield->max = _positions;
+ configurer.field_set_min_max(0, _positions);
-/* positional control wraps at min/max */
+// positional control wraps at min/max
#define PORT_WRAPS \
- curfield->flags |= ANALOG_FLAG_WRAPS;
+ configurer.field_set_analog_wraps();
-/* positional control uses this remap table */
+// positional control uses this remap table
#define PORT_REMAP_TABLE(_table) \
- curfield->remap_table = _table;
+ configurer.field_set_remap_table(_table);
-/* positional control bits are active low */
+// positional control bits are active low
#define PORT_INVERT \
- curfield->flags |= ANALOG_FLAG_INVERT;
+ configurer.field_set_analog_invert();
-/* read callbacks */
+// read callbacks
#define PORT_CUSTOM(_callback, _param) \
- curfield->read = input_field_read_delegate(_callback, #_callback, (device_t *)NULL); \
- curfield->read_param = (void *)(_param); \
- curfield->read_device = DEVICE_SELF;
+ configurer.field_set_dynamic_read(ioport_field_read_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL), (void *)(_param));
#define PORT_CUSTOM_MEMBER(_device, _class, _member, _param) \
- curfield->read = input_field_read_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \
- curfield->read_param = (void *)(_param); \
- curfield->read_device = (_device);
+ configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL), (void *)(_param));
-/* write callbacks */
+// write callbacks
#define PORT_CHANGED(_callback, _param) \
- curfield->write = input_field_write_delegate(_callback, #_callback, (device_t *)NULL); \
- curfield->write_param = (void *)(_param); \
- curfield->write_device = DEVICE_SELF;
+ configurer.field_set_dynamic_write(ioport_field_write_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL), (void *)(_param));
#define PORT_CHANGED_MEMBER(_device, _class, _member, _param) \
- curfield->write = input_field_write_delegate(&_class::_member, #_class "::" #_member, (_class *)NULL); \
- curfield->write_param = (void *)(_param); \
- curfield->write_device = (_device);
+ configurer.field_set_dynamic_write(ioport_field_write_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL), (void *)(_param));
-/* input device handler */
+// input device handler
#define PORT_READ_LINE_DEVICE(_device, _read_line_device) \
- curfield->read = input_field_read_delegate(&ioport_read_line_wrapper<_read_line_device>, #_read_line_device, (device_t *)NULL); \
- curfield->read_param = NULL; \
- curfield->read_device = _device;
+ configurer.field_set_dynamic_read(ioport_field_read_delegate(&ioport_read_line_wrapper<_read_line_device>, #_read_line_device, _device, (device_t *)NULL));
#define PORT_READ_LINE_DEVICE_MEMBER(_device, _class, _member) \
- curfield->read = input_field_read_delegate(&ioport_read_line_wrapper<_class, &_class::_member>, #_class "::" #_member, (_class *)NULL); \
- curfield->read_param = NULL; \
- curfield->read_device = _device;
+ configurer.field_set_dynamic_read(ioport_field_read_delegate(&ioport_read_line_wrapper<_class, &_class::_member>, #_class "::" #_member, _device, (_class *)NULL));
-/* output device handler */
+// output device handler
#define PORT_WRITE_LINE_DEVICE(_device, _write_line_device) \
- curfield->write = input_field_write_delegate(&ioport_write_line_wrapper<_write_line_device>, #_write_line_device, (device_t *)NULL); \
- curfield->write_param = NULL; \
- curfield->write_device = _device;
+ configurer.field_set_dynamic_write(ioport_field_write_delegate(&ioport_write_line_wrapper<_write_line_device>, #_write_line_device, _device, (device_t *)NULL));
#define PORT_WRITE_LINE_DEVICE_MEMBER(_device, _class, _member) \
- curfield->write = input_field_write_delegate(&ioport_write_line_wrapper<_class, &_class::_member>, #_class "::" #_member, (_class *)NULL); \
- curfield->write_param = NULL; \
- curfield->write_device = _device;
+ configurer.field_set_dynamic_write(ioport_field_write_delegate(&ioport_write_line_wrapper<_class, &_class::_member>, #_class "::" #_member, _device, (_class *)NULL));
-/* dip switch definition */
+// dip switch definition
#define PORT_DIPNAME(_mask, _default, _name) \
- curfield = ioconfig_alloc_field(*curport, IPT_DIPSWITCH, (_default), (_mask), (_name)); \
- cursetting = NULL;
+ configurer.field_alloc(IPT_DIPSWITCH, (_default), (_mask), (_name)); \
#define PORT_DIPSETTING(_default, _name) \
- cursetting = ioconfig_alloc_setting(*curfield, (_default) & curfield->mask, (_name));
+ configurer.setting_alloc((_default), (_name)); \
-/* physical location, of the form: name:[!]sw,[name:][!]sw,... */
-/* note that these are specified LSB-first */
+// physical location, of the form: name:[!]sw,[name:][!]sw,...
+// note that these are specified LSB-first
#define PORT_DIPLOCATION(_location) \
- diplocation_list_alloc(*curfield, _location, errorbuf);
+ configurer.field_set_diplocation(_location); \
-/* conditionals for dip switch settings */
+// conditionals for dip switch settings
#define PORT_CONDITION(_tag, _mask, _condition, _value) \
-{ \
- input_condition &condition = (cursetting != NULL) ? cursetting->condition : curfield->condition; \
- condition.tag = (_tag); \
- condition.mask = (_mask); \
- condition.condition = (_condition); \
- condition.value = (_value); \
-}
+ configurer.set_condition(ioport_condition::_condition, _tag, _mask, _value); \
-/* analog adjuster definition */
+// analog adjuster definition
#define PORT_ADJUSTER(_default, _name) \
- curfield = ioconfig_alloc_field(*curport, IPT_ADJUSTER, (_default), 0xff, (_name)); \
- cursetting = NULL; \
+ configurer.field_alloc(IPT_ADJUSTER, (_default), 0xff, (_name)); \
-/* config definition */
+// config definition
#define PORT_CONFNAME(_mask, _default, _name) \
- curfield = ioconfig_alloc_field(*curport, IPT_CONFIG, (_default), (_mask), (_name)); \
- cursetting = NULL; \
+ configurer.field_alloc(IPT_CONFIG, (_default), (_mask), (_name)); \
#define PORT_CONFSETTING(_default, _name) \
- cursetting = ioconfig_alloc_setting(*curfield, (_default) & curfield->mask, (_name));
+ configurer.setting_alloc((_default), (_name));
-/* keyboard chars */
+// keyboard chars
#define PORT_CHAR(_ch) \
- ioconfig_field_add_char(*curfield, _ch, errorbuf);
+ configurer.field_add_char(_ch);
-/* name of table */
+// name of table
#define DEVICE_INPUT_DEFAULTS_NAME(_name) device_iptdef_##_name
#define device_iptdef_0 NULL
#define device_iptdef___null NULL
-/* start of table */
+// start of table
#define DEVICE_INPUT_DEFAULTS_START(_name) \
const input_device_default DEVICE_INPUT_DEFAULTS_NAME(_name)[] = {
-/* end of table */
+// end of table
#define DEVICE_INPUT_DEFAULTS(_tag,_mask,_defval) \
{ _tag ,_mask, _defval }, \
-/* end of table */
+// end of table
#define DEVICE_INPUT_DEFAULTS_END \
{NULL,0,0} };
-/***************************************************************************
- HELPER MACROS
-***************************************************************************/
+
+
+//**************************************************************************
+// HELPER MACROS
+//**************************************************************************
#define PORT_DIPUNUSED_DIPLOC(_mask, _default, _diploc) \
PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, Unused, _diploc)
@@ -1313,181 +1657,51 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, a
#define PORT_SERVICE_NO_TOGGLE(_mask, _default) \
PORT_BIT( _mask, _mask & _default, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ))
+#define PORT_VBLANK(_screen) \
+ PORT_READ_LINE_DEVICE_MEMBER(_screen, screen_device, vblank_port_read)
-/***************************************************************************
- FUNCTION PROTOTYPES
-***************************************************************************/
-
-
-/* ----- port configurations ----- */
-
-/* initialize an input port list structure and allocate ports according to the given tokens */
-void input_port_list_init(device_t &device, ioport_list &portlist, astring &errorbuf);
-
-/* return the field that matches the given tag and mask */
-const input_field_config *input_field_by_tag_and_mask(running_machine &machine, const char *tag, input_port_value mask);
-
-
-
-/* ----- accessors for input types ----- */
-
-/* return TRUE if the given type represents an analog control */
-int input_type_is_analog(int type);
-
-/* return the name for the given type/player */
-const char *input_type_name(running_machine &machine, int type, int player);
-
-/* return the group for the given type/player */
-int input_type_group(running_machine &machine, int type, int player);
-
-/* return the global input mapping sequence for the given type/player */
-const input_seq &input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype);
-/* change the global input sequence for the given type/player */
-void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq);
+//**************************************************************************
+// INLINE TEMPLATES
+//**************************************************************************
-/* return TRUE if the sequence for the given input type/player is pressed */
-int input_type_pressed(running_machine &machine, int type, int player);
-
-/* return the list of default mappings */
-const simple_list<input_type_entry> &input_type_list(running_machine &machine);
-
-
-
-/* ----- accessors for input fields ----- */
-
-/* return the expanded string name of the field */
-const char *input_field_name(const input_field_config *field);
-
-/* return the input sequence for the given input field */
-const input_seq &input_field_seq(const input_field_config *field, input_seq_type seqtype);
-
-/* return the current settings for the given input field */
-void input_field_get_user_settings(const input_field_config *field, input_field_user_settings *settings);
-
-/* modify the current settings for the given input field */
-void input_field_set_user_settings(const input_field_config *field, const input_field_user_settings *settings);
-
-/* return the expanded setting name for a field */
-const char *input_field_setting_name(const input_field_config *field);
-
-/* return TRUE if the given field has a "previous" setting */
-int input_field_has_previous_setting(const input_field_config *field);
-
-/* select the previous item for a DIP switch or configuration field */
-void input_field_select_previous_setting(const input_field_config *field);
-
-/* return TRUE if the given field has a "next" setting */
-int input_field_has_next_setting(const input_field_config *field);
-
-/* select the next item for a DIP switch or configuration field */
-void input_field_select_next_setting(const input_field_config *field);
-
-
-/* ----- port checking ----- */
-
-/* return whether an input port exists */
-bool input_port_exists(running_machine &machine, const char *tag);
-
-/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown) */
-input_port_value input_port_active(running_machine &machine, const char *tag);
-
-/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown), or a default value if the port does not exist */
-input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue);
-
-
-/* ----- port reading ----- */
-
-/* return the value of an input port */
-input_port_value input_port_read_direct(const input_port_config *port);
-
-/* return the value of an input port specified by tag */
-input_port_value input_port_read(running_machine &machine, const char *tag);
-
-/* return the value of a device input port specified by tag */
-input_port_value input_port_read(device_t &device, const char *tag);
-
-/* return the value of an input port specified by tag, or a default value if the port does not exist */
-input_port_value input_port_read_safe(running_machine &machine, const char *tag, input_port_value defvalue);
-
-/* return the extracted crosshair values for the given player */
-int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y);
-
-/* force an update to the input port values based on current conditions */
-void input_port_update_defaults(running_machine &machine);
-
-
-
-/* ----- port writing ----- */
-
-/* write a value to a port */
-void input_port_write_direct(const input_port_config *port, input_port_value value, input_port_value mask);
-
-/* write a value to a port specified by tag */
-void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
-
-/* write a value to a port, ignore if the port does not exist */
-void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
-
-
-
-/* ----- misc helper functions ----- */
-
-/* return the TRUE if the given condition attached is true */
-int input_condition_true(running_machine &machine, const input_condition *condition,device_t &owner);
-
-/* convert an input_port_token to a default string */
-const char *input_port_string_from_token(const char *token);
-
-/* return TRUE if machine use full keyboard emulation */
-int input_machine_has_keyboard(running_machine &machine);
-
-/* these are called by the core; they should not be called from FEs */
-void inputx_init(running_machine &machine);
-
-/* called by drivers to setup natural keyboard support */
-void inputx_setup_natural_keyboard(running_machine &machine,
- int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
- int (*accept_char)(running_machine &machine, unicode_char ch),
- int (*charqueue_empty)(running_machine &machine));
-
-/* validity checks */
-int validate_natural_keyboard_statics(void);
-
-/* these can be called from FEs */
-int inputx_can_post(running_machine &machine);
-
-/* various posting functions; can be called from FEs */
-void inputx_postc(running_machine &machine, unicode_char ch);
-void inputx_post_utf8(running_machine &machine, const char *text);
-void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate);
-int inputx_is_posting(running_machine &machine);
+template<int (*_FunctionPointer)(device_t *)>
+ioport_value ioport_read_line_wrapper(device_t &device, ioport_field &field, void *param)
+{
+ return (*_FunctionPointer)(&device);
+}
-/* miscellaneous functions */
-int input_classify_port(const input_field_config *field);
-int input_has_input_class(running_machine &machine, int inputclass);
-int input_player_number(const input_field_config *field);
-int input_count_players(running_machine &machine);
+template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()>
+ioport_value ioport_read_line_wrapper(_FunctionClass &device, ioport_field &field, void *param)
+{
+ return (device.*_FunctionPointer)();
+}
+template<void (*_FunctionPointer)(device_t *, int)>
+void ioport_write_line_wrapper(device_t &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
+{
+ return (*_FunctionPointer)(&device, newval);
+}
-inline running_machine &input_field_config::machine() const
+template<class _FunctionClass, void (_FunctionClass::*_FunctionPointer)(int)>
+void ioport_write_line_wrapper(_FunctionClass &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval)
{
- return m_port.machine();
+ return (device.*_FunctionPointer)(newval);
}
-// temporary construction helpers
-void field_config_insert(input_field_config &newfield, input_port_value &disallowedbits, astring &errorbuf);
-void diplocation_list_alloc(input_field_config &field, const char *location, astring &errorbuf);
+//**************************************************************************
+// INLINE FUNCITONS
+//**************************************************************************
+
+inline ioport_manager &ioport_field::manager() const { return m_port.manager(); }
+inline device_t &ioport_field::device() const { return m_port.device(); }
+inline running_machine &ioport_field::machine() const { return m_port.machine(); }
+
+inline device_t &ioport_setting::device() const { return m_field.device(); }
+inline running_machine &ioport_setting::machine() const { return m_field.machine(); }
-input_port_config *ioconfig_alloc_port(ioport_list &portlist, device_t &device, const char *tag);
-input_port_config *ioconfig_modify_port(ioport_list &portlist, device_t &device, const char *tag);
-input_field_config *ioconfig_alloc_field(input_port_config &port, int type, input_port_value defval, input_port_value mask, const char *name = NULL);
-input_field_config *ioconfig_alloc_onoff(input_port_config &port, const char *name, input_port_value defval, input_port_value mask, const char *diplocation, astring &errorbuf);
-input_setting_config *ioconfig_alloc_setting(input_field_config &field, input_port_value value, const char *name);
-void ioconfig_field_add_char(input_field_config &field, unicode_char ch, astring &errorbuf);
-void ioconfig_add_code(input_field_config &field, int which, input_code code);
-#endif /* __INPTPORT_H__ */
+#endif // __INPTPORT_H__ */
diff --git a/src/emu/machine.c b/src/emu/machine.c
index 55bcbaa565f..86b5aff6a23 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -284,9 +284,6 @@ void running_machine::start()
// allocate the gfx elements prior to device initialization
gfx_init(*this);
- // initialize natural keyboard support
- inputx_init(*this);
-
// initialize image devices
image_init(*this);
m_tilemap = auto_alloc(*this, tilemap_manager(*this));
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 54e4d93dd38..fdec7134531 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -528,7 +528,7 @@ void set_led_status(running_machine &machine, int num, int on)
CUSTOM_INPUT_MEMBER( driver_device::custom_port_read )
{
const char *tag = (const char *)param;
- return input_port_read(machine(), tag);
+ return ioport(tag)->read();
}
diff --git a/src/emu/machine/jvsdev.c b/src/emu/machine/jvsdev.c
index ebed2095d40..d80169d0920 100644
--- a/src/emu/machine/jvsdev.c
+++ b/src/emu/machine/jvsdev.c
@@ -249,6 +249,6 @@ void jvs_device::handle_output(const char *tag, UINT8 id, UINT8 val)
case 2: jvs_outputs ^= m; break;
}
- input_port_write_safe(machine(), tag, jvs_outputs, m);
+ machine().root_device().ioport(tag)->write_safe(jvs_outputs, m);
}
diff --git a/src/emu/machine/microtch.c b/src/emu/machine/microtch.c
index 1ca1ae76edc..7315cdbd7fe 100644
--- a/src/emu/machine/microtch.c
+++ b/src/emu/machine/microtch.c
@@ -82,8 +82,8 @@ void microtouch_device::send_format_decimal_packet(int x, int y)
void microtouch_device::send_touch_packet()
{
- int tx = input_port_read(*this, "TOUCH_X");
- int ty = input_port_read(*this, "TOUCH_Y");
+ int tx = ioport("TOUCH_X")->read();
+ int ty = ioport("TOUCH_Y")->read();
if ( m_out_touch_cb == NULL ||
m_out_touch_cb( &tx, &ty ) != 0 )
@@ -127,7 +127,7 @@ void microtouch_device::device_timer(emu_timer &timer, device_timer_id id, int p
}
// send format tablet packet
- if ( input_port_read(*this, "TOUCH") & 0x01 )
+ if ( ioport("TOUCH")->read() & 0x01 )
{
send_touch_packet();
}
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 1ca92ac8a9d..fc9f48ea49c 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -397,7 +397,7 @@ public:
void set_legacy_func(device_t &device, read64_device_func func, const char *name, UINT64 mask = 0);
// configure I/O port access
- void set_ioport(const input_port_config &ioport);
+ void set_ioport(ioport_port &ioport);
// read via the underlying delegates
UINT8 read8(address_space &space, offs_t offset, UINT8 mask) const { return m_read.r8(space, offset, mask); }
@@ -419,7 +419,7 @@ private:
// stubs for reading I/O ports
template<typename _UintType>
- _UintType read_stub_ioport(address_space &space, offs_t offset, _UintType mask) { return input_port_read_direct(m_ioport); }
+ _UintType read_stub_ioport(address_space &space, offs_t offset, _UintType mask) { return m_ioport->read(); }
// internal helper
virtual void remove_subunit(int entry);
@@ -427,7 +427,7 @@ private:
// internal state
access_handler m_read;
access_handler m_subread[8];
- const input_port_config * m_ioport;
+ ioport_port * m_ioport;
bool m_sub_is_legacy[8];
legacy_info m_legacy_info;
@@ -504,7 +504,7 @@ public:
void set_legacy_func(device_t &device, write64_device_func func, const char *name, UINT64 mask = 0);
// configure I/O port access
- void set_ioport(const input_port_config &ioport);
+ void set_ioport(ioport_port &ioport);
// write via the underlying delegates
void write8(address_space &space, offs_t offset, UINT8 data, UINT8 mask) const { m_write.w8(space, offset, data, mask); }
@@ -526,7 +526,7 @@ private:
// stubs for writing I/O ports
template<typename _UintType>
- void write_stub_ioport(address_space &space, offs_t offset, _UintType data, _UintType mask) { input_port_write_direct(m_ioport, data, mask); }
+ void write_stub_ioport(address_space &space, offs_t offset, _UintType data, _UintType mask) { m_ioport->write(data, mask); }
// internal helper
virtual void remove_subunit(int entry);
@@ -534,7 +534,7 @@ private:
// internal state
access_handler m_write;
access_handler m_subwrite[8];
- const input_port_config * m_ioport;
+ ioport_port * m_ioport;
bool m_sub_is_legacy[8];
legacy_info m_legacy_info;
@@ -571,7 +571,7 @@ public:
}
// forward I/O port access configuration
- void set_ioport(const input_port_config &ioport) const {
+ void set_ioport(ioport_port &ioport) const {
for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
(*i)->set_ioport(ioport);
}
@@ -2323,7 +2323,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off
{
// find the port
astring fulltag;
- input_port_config *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag));
+ ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag));
if (port == NULL)
throw emu_fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, m_name, m_device.tag());
@@ -2335,7 +2335,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off
{
// find the port
astring fulltag;
- input_port_config *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag));
+ ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag));
if (port == NULL)
fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, m_name, m_device.tag());
@@ -4958,7 +4958,7 @@ void handler_entry_read::set_legacy_func(device_t &device, read64_device_func fu
// of the appropriate size
//-------------------------------------------------
-void handler_entry_read::set_ioport(const input_port_config &ioport)
+void handler_entry_read::set_ioport(ioport_port &ioport)
{
m_ioport = &ioport;
if (m_datawidth == 8)
@@ -5413,7 +5413,7 @@ void handler_entry_write::set_legacy_func(device_t &device, write64_device_func
// of the appropriate size
//-------------------------------------------------
-void handler_entry_write::set_ioport(const input_port_config &ioport)
+void handler_entry_write::set_ioport(ioport_port &ioport)
{
m_ioport = &ioport;
if (m_datawidth == 8)
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 51a9c09ec9a..2c502cf031d 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -2208,9 +2208,13 @@ int layout_view::item::state() const
// if configured to an input, fetch the input value
else if (m_input_tag[0] != 0)
{
- const input_field_config *field = input_field_by_tag_and_mask(m_element->machine(), m_input_tag, m_input_mask);
- if (field != NULL)
- state = ((input_port_read_safe(m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0;
+ ioport_port *port = m_element->machine().root_device().ioport(m_input_tag);
+ if (port != NULL)
+ {
+ ioport_field *field = port->field(m_input_mask);
+ if (field != NULL)
+ state = ((port->read() ^ field->defvalue()) & m_input_mask) ? 1 : 0;
+ }
}
return state;
}
diff --git a/src/emu/screen.c b/src/emu/screen.c
index aece8df6d93..05aa8ac141b 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -782,6 +782,17 @@ void screen_device::register_screen_bitmap(bitmap_t &bitmap)
//-------------------------------------------------
+// vblank_port_read - custom port handler to
+// return a VBLANK state
+//-------------------------------------------------
+
+int screen_device::vblank_port_read()
+{
+ return vblank();
+}
+
+
+//-------------------------------------------------
// vblank_begin - call any external callbacks to
// signal the VBLANK period has begun
//-------------------------------------------------
diff --git a/src/emu/screen.h b/src/emu/screen.h
index ed141513c18..c89f227c1b7 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -227,6 +227,7 @@ public:
// additional helpers
void register_vblank_callback(vblank_state_delegate vblank_callback);
void register_screen_bitmap(bitmap_t &bitmap);
+ int vblank_port_read();
// internal to the video system
bool update_quads();
diff --git a/src/emu/sound/disc_cls.h b/src/emu/sound/disc_cls.h
index e6be420716f..bbdad7b3391 100644
--- a/src/emu/sound/disc_cls.h
+++ b/src/emu/sound/disc_cls.h
@@ -149,7 +149,7 @@ public:
void step(void);
void reset(void);
private:
- const input_port_config *m_port;
+ ioport_port *m_port;
INT32 m_lastpval;
INT32 m_pmin;
double m_pscale;
diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c
index d34505afe63..02fe15fa186 100644
--- a/src/emu/sound/disc_inp.c
+++ b/src/emu/sound/disc_inp.c
@@ -55,7 +55,7 @@ WRITE8_DEVICE_HANDLER(discrete_sound_w)
DISCRETE_STEP(dss_adjustment)
{
- INT32 rawportval = input_port_read_direct(m_port);
+ INT32 rawportval = m_port->read();
/* only recompute if the value changed from last time */
if (UNEXPECTED(rawportval != m_lastpval))
diff --git a/src/emu/ui.c b/src/emu/ui.c
index 820928da2da..648c6b4236d 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -935,7 +935,7 @@ static astring &warnings_string(running_machine &machine, astring &string)
string.cat(" have not been correctly dumped.\n");
}
/* add one line per warning flag */
- if (input_machine_has_keyboard(machine))
+ if (machine.ioport().has_keyboard())
string.cat("The keyboard emulation may not be 100% accurate.\n");
if (machine.system().flags & GAME_IMPERFECT_COLORS)
string.cat("The colors aren't 100% accurate.\n");
@@ -1213,7 +1213,7 @@ static void process_natural_keyboard(running_machine &machine)
{
/* if this was a UI_EVENT_CHAR event, post it */
if (event.event_type == UI_EVENT_CHAR)
- inputx_postc(machine, event.ch);
+ machine.ioport().natkeyboard().post(event.ch);
}
/* process natural keyboard keys that don't get UI_EVENT_CHARs */
@@ -1236,7 +1236,7 @@ static void process_natural_keyboard(running_machine &machine)
*key_down_ptr |= key_down_mask;
/* post the key */
- inputx_postc(machine, UCHAR_MAMEKEY_BEGIN + code.item_id());
+ machine.ioport().natkeyboard().post(UCHAR_MAMEKEY_BEGIN + code.item_id());
}
else if (!pressed && (*key_down_ptr & key_down_mask))
{
@@ -1259,7 +1259,7 @@ void ui_paste(running_machine &machine)
if (text != NULL)
{
/* post the text */
- inputx_post_utf8(machine, text);
+ machine.ioport().natkeyboard().post_utf8(text);
/* free the string */
osd_free(text);
@@ -1317,10 +1317,10 @@ static UINT32 handler_ingame(running_machine &machine, render_container *contain
}
/* determine if we should disable the rest of the UI */
- int ui_disabled = (input_machine_has_keyboard(machine) && !machine.ui_active());
+ int ui_disabled = (machine.ioport().has_keyboard() && !machine.ui_active());
/* is ScrLk UI toggling applicable here? */
- if (input_machine_has_keyboard(machine))
+ if (machine.ioport().has_keyboard())
{
/* are we toggling the UI with ScrLk? */
if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
@@ -1488,7 +1488,7 @@ static UINT32 handler_ingame(running_machine &machine, render_container *contain
machine.video().set_throttled(!machine.video().throttled());
/* check for fast forward */
- if (input_type_pressed(machine, IPT_UI_FAST_FORWARD, 0))
+ if (machine.ioport().type_pressed(IPT_UI_FAST_FORWARD))
{
machine.video().set_fastforward(true);
ui_show_fps_temp(0.5);
@@ -1640,8 +1640,8 @@ static slider_state *slider_alloc(running_machine &machine, const char *title, I
static slider_state *slider_init(running_machine &machine)
{
- input_field_config *field;
- input_port_config *port;
+ ioport_field *field;
+ ioport_port *port;
slider_state *listhead = NULL;
slider_state **tailptr = &listhead;
astring string;
@@ -1666,11 +1666,11 @@ static slider_state *slider_init(running_machine &machine)
/* add analog adjusters */
for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->type == IPT_ADJUSTER)
+ for (field = port->first_field(); field != NULL; field = field->next())
+ if (field->type() == IPT_ADJUSTER)
{
void *param = (void *)field;
- *tailptr = slider_alloc(machine, field->name, 0, field->defvalue, 100, 1, slider_adjuster, param);
+ *tailptr = slider_alloc(machine, field->name(), 0, field->defvalue(), 100, 1, slider_adjuster, param);
tailptr = &(*tailptr)->next;
}
@@ -1772,14 +1772,14 @@ static slider_state *slider_init(running_machine &machine)
#ifdef MAME_DEBUG
/* add crosshair adjusters */
for (port = machine.ioport().first_port(); port != NULL; port = port->next())
- for (field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0)
+ for (field = port->first_field(); field != NULL; field = field->next())
+ if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->player() == 0)
{
void *param = (void *)field;
- string.printf("Crosshair Scale %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y");
+ string.printf("Crosshair Scale %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y");
*tailptr = slider_alloc(machine, string, -3000, 1000, 3000, 100, slider_crossscale, param);
tailptr = &(*tailptr)->next;
- string.printf("Crosshair Offset %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y");
+ string.printf("Crosshair Offset %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y");
*tailptr = slider_alloc(machine, string, -3000, 0, 3000, 100, slider_crossoffset, param);
tailptr = &(*tailptr)->next;
}
@@ -1832,14 +1832,14 @@ static INT32 slider_mixervol(running_machine &machine, void *arg, astring *strin
static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval)
{
- const input_field_config *field = (const input_field_config *)arg;
- input_field_user_settings settings;
+ ioport_field *field = (ioport_field *)arg;
+ ioport_field::user_settings settings;
- input_field_get_user_settings(field, &settings);
+ field->get_user_settings(settings);
if (newval != SLIDER_NOCHANGE)
{
settings.value = newval;
- input_field_set_user_settings(field, &settings);
+ field->set_user_settings(settings);
}
if (string != NULL)
string->printf("%d%%", settings.value);
@@ -2185,13 +2185,13 @@ static char *slider_get_screen_desc(screen_device &screen)
#ifdef MAME_DEBUG
static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
- input_field_config *field = (input_field_config *)arg;
+ ioport_field *field = (ioport_field *)arg;
if (newval != SLIDER_NOCHANGE)
- field->crossscale = (float)newval * 0.001f;
+ field->set_crosshair_scale(float(newval) * 0.001);
if (string != NULL)
- string->printf("%s %s %1.3f", "Crosshair Scale", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
- return floor(field->crossscale * 1000.0f + 0.5f);
+ string->printf("%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
+ return floor(field->crosshair_scale() * 1000.0f + 0.5f);
}
#endif
@@ -2204,13 +2204,13 @@ static INT32 slider_crossscale(running_machine &machine, void *arg, astring *str
#ifdef MAME_DEBUG
static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
- input_field_config *field = (input_field_config *)arg;
+ ioport_field *field = (ioport_field *)arg;
if (newval != SLIDER_NOCHANGE)
- field->crossoffset = (float)newval * 0.001f;
+ field->set_crosshair_offset(float(newval) * 0.001f);
if (string != NULL)
- string->printf("%s %s %1.3f", "Crosshair Offset", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
- return field->crossoffset;
+ string->printf("%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
+ return field->crosshair_offset();
}
#endif
diff --git a/src/emu/uiinput.c b/src/emu/uiinput.c
index 2cb781a5d19..1be9eeb3c52 100644
--- a/src/emu/uiinput.c
+++ b/src/emu/uiinput.c
@@ -37,8 +37,8 @@ enum
struct _ui_input_private
{
/* pressed states; retrieved with ui_input_pressed() */
- osd_ticks_t next_repeat[__ipt_max];
- UINT8 seqpressed[__ipt_max];
+ osd_ticks_t next_repeat[IPT_COUNT];
+ UINT8 seqpressed[IPT_COUNT];
/* mouse position/info */
render_target * current_mouse_target;
@@ -97,12 +97,11 @@ void ui_input_init(running_machine &machine)
void ui_input_frame_update(running_machine &machine)
{
ui_input_private *uidata = machine.ui_input_data;
- int code;
/* update the state of all the UI keys */
- for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
+ for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; code++)
{
- int pressed = machine.input().seq_pressed(input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD));
+ bool pressed = machine.ioport().type_pressed(code);
if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET)
uidata->seqpressed[code] = pressed;
}
@@ -199,7 +198,7 @@ void ui_input_reset(running_machine &machine)
uidata->events_start = 0;
uidata->events_end = 0;
- for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
+ for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
{
uidata->seqpressed[code] = SEQ_PRESSED_RESET;
uidata->next_repeat[code] = 0;
diff --git a/src/emu/uimain.c b/src/emu/uimain.c
index 85af3575eeb..48538e7a573 100644
--- a/src/emu/uimain.c
+++ b/src/emu/uimain.c
@@ -109,8 +109,8 @@ ui_menu_main::ui_menu_main(running_machine &machine, render_container *container
void ui_menu_main::populate()
{
- input_field_config *field;
- input_port_config *port;
+ ioport_field *field;
+ ioport_port *port;
int has_configs = false;
int has_analog = false;
int has_dips = false;
@@ -118,13 +118,13 @@ void ui_menu_main::populate()
astring menu_text;
/* scan the input port array to see what options we need to enable */
for (port = machine().ioport().first_port(); port != NULL; port = port->next())
- for (field = port->fieldlist().first(); field != NULL; field = field->next())
+ for (field = port->first_field(); field != NULL; field = field->next())
{
- if (field->type == IPT_DIPSWITCH)
+ if (field->type() == IPT_DIPSWITCH)
has_dips = true;
- if (field->type == IPT_CONFIG)
+ if (field->type() == IPT_CONFIG)
has_configs = true;
- if (input_type_is_analog(field->type))
+ if (field->is_analog())
has_analog = true;
}
device_iterator deviter(machine().root_device());
@@ -192,7 +192,7 @@ void ui_menu_main::populate()
}
/* add keyboard mode menu */
- if (input_machine_has_keyboard(machine()) && inputx_can_post(machine()))
+ if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post())
item_append("Keyboard Mode", NULL, 0, (void *)KEYBOARD_MODE);
/* add sliders menu */
@@ -671,10 +671,10 @@ void ui_menu_input_general::populate()
suborder[SEQ_TYPE_INCREMENT] = 2;
/* iterate over the input ports and add menu items */
- for (input_type_entry *entry = input_type_list(machine()).first(); entry != NULL; entry = entry->next())
+ for (input_type_entry *entry = machine().ioport().first_type(); entry != NULL; entry = entry->next())
/* add if we match the group and we have a valid name */
- if (entry->group == group && entry->name != NULL && entry->name[0] != 0)
+ if (entry->group() == group && entry->name() != NULL && entry->name()[0] != 0)
{
input_seq_type seqtype;
@@ -689,11 +689,11 @@ void ui_menu_input_general::populate()
if(pollingitem && pollingref == entry && pollingseq == seqtype)
pollingitem = item;
item->seqtype = seqtype;
- item->seq = input_type_seq(machine(), entry->type, entry->player, seqtype);
- item->defseq = &entry->defseq[seqtype];
+ item->seq = machine().ioport().type_seq(entry->type(), entry->player(), seqtype);
+ item->defseq = &entry->defseq(seqtype);
item->sortorder = sortorder * 4 + suborder[seqtype];
- item->type = input_type_is_analog(entry->type) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
- item->name = entry->name;
+ item->type = ioport_manager::type_is_analog(entry->type()) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
+ item->name = entry->name();
item->next = itemlist;
itemlist = item;
@@ -723,8 +723,8 @@ ui_menu_input_specific::ui_menu_input_specific(running_machine &machine, render_
void ui_menu_input_specific::populate()
{
input_item_data *itemlist = NULL;
- input_field_config *field;
- input_port_config *port;
+ ioport_field *field;
+ ioport_port *port;
int suborder[SEQ_TYPE_TOTAL];
astring tempstring;
@@ -735,22 +735,22 @@ void ui_menu_input_specific::populate()
/* iterate over the input ports and add menu items */
for (port = machine().ioport().first_port(); port != NULL; port = port->next())
- for (field = port->fieldlist().first(); field != NULL; field = field->next())
+ for (field = port->first_field(); field != NULL; field = field->next())
{
- const char *name = input_field_name(field);
+ const char *name = field->name();
/* add if we match the group and we have a valid name */
- if (name != NULL && input_condition_true(machine(), &field->condition, port->owner()) &&
- ((field->type == IPT_OTHER && field->name != NULL) || input_type_group(machine(), field->type, field->player) != IPG_INVALID))
+ if (name != NULL && field->enabled() &&
+ ((field->type() == IPT_OTHER && field->name() != NULL) || machine().ioport().type_group(field->type(), field->player()) != IPG_INVALID))
{
input_seq_type seqtype;
UINT16 sortorder;
/* determine the sorting order */
- if (field->type >= IPT_START1 && field->type <= __ipt_analog_end)
- sortorder = (field->type << 2) | (field->player << 12);
+ if (field->type() >= IPT_START1 && field->type() < IPT_ANALOG_LAST)
+ sortorder = (field->type() << 2) | (field->player() << 12);
else
- sortorder = field->type | 0xf000;
+ sortorder = field->type() | 0xf000;
/* loop over all sequence types */
for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
@@ -762,10 +762,10 @@ void ui_menu_input_specific::populate()
item->seqtype = seqtype;
if(pollingitem && pollingref == field && pollingseq == seqtype)
pollingitem = item;
- item->seq = input_field_seq(field, seqtype);
+ item->seq = field->seq(seqtype);
item->defseq = &get_field_default_seq(field, seqtype);
item->sortorder = sortorder + suborder[seqtype];
- item->type = input_type_is_analog(field->type) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
+ item->type = field->is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
item->name = name;
item->next = itemlist;
itemlist = item;
@@ -820,12 +820,12 @@ void ui_menu_input::toggle_none_default(input_seq &selected_seq, input_seq &orig
to the default sequence for the given field
-------------------------------------------------*/
-const input_seq &ui_menu_input::get_field_default_seq(input_field_config *field, input_seq_type seqtype)
+const input_seq &ui_menu_input::get_field_default_seq(ioport_field *field, input_seq_type seqtype)
{
- if (field->seq[seqtype].is_default())
- return input_type_seq(field->machine(), field->type, field->player, seqtype);
+ if (field->seq(seqtype).is_default())
+ return field->machine().ioport().type_seq(field->type(), field->player(), seqtype);
else
- return field->seq[seqtype];
+ return field->seq(seqtype);
}
void ui_menu_input::handle()
@@ -916,16 +916,16 @@ void ui_menu_input::handle()
void ui_menu_input_general::update_input(struct input_item_data *seqchangeditem)
{
const input_type_entry *entry = (const input_type_entry *)seqchangeditem->ref;
- input_type_set_seq(machine(), entry->type, entry->player, seqchangeditem->seqtype, &seqchangeditem->seq);
+ machine().ioport().set_type_seq(entry->type(), entry->player(), seqchangeditem->seqtype, seqchangeditem->seq);
}
void ui_menu_input_specific::update_input(struct input_item_data *seqchangeditem)
{
- input_field_user_settings settings;
+ ioport_field::user_settings settings;
- input_field_get_user_settings((input_field_config *)seqchangeditem->ref, &settings);
+ ((ioport_field *)seqchangeditem->ref)->get_user_settings(settings);
settings.seq[seqchangeditem->seqtype] = seqchangeditem->seq;
- input_field_set_user_settings((input_field_config *)seqchangeditem->ref, &settings);
+ ((ioport_field *)seqchangeditem->ref)->set_user_settings(settings);
}
@@ -1047,29 +1047,29 @@ void ui_menu_settings::handle()
/* handle events */
if (menu_event != NULL && menu_event->itemref != NULL)
{
- input_field_config *field = (input_field_config *)menu_event->itemref;
- input_field_user_settings settings;
+ ioport_field *field = (ioport_field *)menu_event->itemref;
+ ioport_field::user_settings settings;
int changed = false;
switch (menu_event->iptkey)
{
/* if selected, reset to default value */
case IPT_UI_SELECT:
- input_field_get_user_settings(field, &settings);
- settings.value = field->defvalue;
- input_field_set_user_settings(field, &settings);
+ field->get_user_settings(settings);
+ settings.value = field->defvalue();
+ field->set_user_settings(settings);
changed = true;
break;
/* left goes to previous setting */
case IPT_UI_LEFT:
- input_field_select_previous_setting(field);
+ field->select_previous_setting();
changed = true;
break;
/* right goes to next setting */
case IPT_UI_RIGHT:
- input_field_select_next_setting(field);
+ field->select_next_setting();
changed = true;
break;
}
@@ -1093,8 +1093,8 @@ ui_menu_settings::ui_menu_settings(running_machine &machine, render_container *c
void ui_menu_settings::populate()
{
- input_field_config *field;
- input_port_config *port;
+ ioport_field *field;
+ ioport_port *port;
dip_descriptor **diplist_tailptr;
/* reset the dip switch tracking */
@@ -1104,39 +1104,39 @@ void ui_menu_settings::populate()
/* loop over input ports and set up the current values */
for (port = machine().ioport().first_port(); port != NULL; port = port->next())
- for (field = port->fieldlist().first(); field != NULL; field = field->next())
- if (field->type == type && input_condition_true(machine(), &field->condition, port->owner()))
+ for (field = port->first_field(); field != NULL; field = field->next())
+ if (field->type() == type && field->enabled())
{
UINT32 flags = 0;
/* set the left/right flags appropriately */
- if (input_field_has_previous_setting(field))
+ if (field->has_previous_setting())
flags |= MENU_FLAG_LEFT_ARROW;
- if (input_field_has_next_setting(field))
+ if (field->has_next_setting())
flags |= MENU_FLAG_RIGHT_ARROW;
/* add the menu item */
- item_append(input_field_name(field), input_field_setting_name(field), flags, (void *)field);
+ item_append(field->name(), field->setting_name(), flags, (void *)field);
/* for DIP switches, build up the model */
- if (type == IPT_DIPSWITCH && field->diploclist().count() != 0)
+ if (type == IPT_DIPSWITCH && field->first_diplocation() != NULL)
{
- const input_field_diplocation *diploc;
- input_field_user_settings settings;
- UINT32 accummask = field->mask;
+ const ioport_diplocation *diploc;
+ ioport_field::user_settings settings;
+ UINT32 accummask = field->mask();
/* get current settings */
- input_field_get_user_settings(field, &settings);
+ field->get_user_settings(settings);
/* iterate over each bit in the field */
- for (diploc = field->diploclist().first(); diploc != NULL; diploc = diploc->next())
+ for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next())
{
UINT32 mask = accummask & ~(accummask - 1);
dip_descriptor *dip;
/* find the matching switch name */
for (dip = diplist; dip != NULL; dip = dip->next)
- if (strcmp(dip->name, diploc->swname) == 0)
+ if (strcmp(dip->name, diploc->name()) == 0)
break;
/* allocate new if none */
@@ -1144,7 +1144,7 @@ void ui_menu_settings::populate()
{
dip = (dip_descriptor *)m_pool_alloc(sizeof(*dip));
dip->next = NULL;
- dip->name = diploc->swname;
+ dip->name = diploc->name();
dip->mask = dip->state = 0;
*diplist_tailptr = dip;
diplist_tailptr = &dip->next;
@@ -1153,9 +1153,9 @@ void ui_menu_settings::populate()
}
/* apply the bits */
- dip->mask |= 1 << (diploc->swnum - 1);
- if (((settings.value & mask) != 0 && !diploc->invert) || ((settings.value & mask) == 0 && diploc->invert))
- dip->state |= 1 << (diploc->swnum - 1);
+ dip->mask |= 1 << (diploc->number() - 1);
+ if (((settings.value & mask) != 0 && !diploc->inverted()) || ((settings.value & mask) == 0 && diploc->inverted()))
+ dip->state |= 1 << (diploc->number() - 1);
/* clear the relevant bit in the accumulated mask */
accummask &= ~mask;
@@ -1177,7 +1177,7 @@ ui_menu_settings::~ui_menu_settings()
void ui_menu_settings_dip_switches::custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
{
- input_field_config *field = (input_field_config *)selectedref;
+ ioport_field *field = (ioport_field *)selectedref;
dip_descriptor *dip;
/* add borders */
@@ -1193,14 +1193,14 @@ void ui_menu_settings_dip_switches::custom_render(void *selectedref, float top,
{
if (mame_stricmp(dip->name, "FAKE") != 0)
{
- const input_field_diplocation *diploc;
+ const ioport_diplocation *diploc;
UINT32 selectedmask = 0;
/* determine the mask of selected bits */
if (field != NULL)
- for (diploc = field->diploclist().first(); diploc != NULL; diploc = diploc->next())
- if (strcmp(dip->name, diploc->swname) == 0)
- selectedmask |= 1 << (diploc->swnum - 1);
+ for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next())
+ if (strcmp(dip->name, diploc->name()) == 0)
+ selectedmask |= 1 << (diploc->number() - 1);
/* draw one switch */
custom_render_one(x1, y1, x2, y1 + DIP_SWITCH_HEIGHT, dip, selectedmask);
@@ -1322,10 +1322,10 @@ void ui_menu_analog::handle()
/* if things changed, update */
if (newval != data->cur)
{
- input_field_user_settings settings;
+ ioport_field::user_settings settings;
/* get the settings and set the new value */
- input_field_get_user_settings(data->field, &settings);
+ data->field->get_user_settings(settings);
switch (data->type)
{
case ANALOG_ITEM_KEYSPEED: settings.delta = newval; break;
@@ -1333,7 +1333,7 @@ void ui_menu_analog::handle()
case ANALOG_ITEM_REVERSE: settings.reverse = newval; break;
case ANALOG_ITEM_SENSITIVITY: settings.sensitivity = newval; break;
}
- input_field_set_user_settings(data->field, &settings);
+ data->field->set_user_settings(settings);
/* rebuild the menu */
reset(UI_MENU_RESET_REMEMBER_POSITION);
@@ -1353,26 +1353,26 @@ ui_menu_analog::ui_menu_analog(running_machine &machine, render_container *conta
void ui_menu_analog::populate()
{
- input_field_config *field;
- input_port_config *port;
+ ioport_field *field;
+ ioport_port *port;
astring subtext;
astring text;
/* loop over input ports and add the items */
for (port = machine().ioport().first_port(); port != NULL; port = port->next())
- for (field = port->fieldlist().first(); field != NULL; field = field->next())
- if (input_type_is_analog(field->type) && input_condition_true(machine(), &field->condition, port->owner()))
+ for (field = port->first_field(); field != NULL; field = field->next())
+ if (field->is_analog() && field->enabled())
{
- input_field_user_settings settings;
+ ioport_field::user_settings settings;
int use_autocenter = false;
int type;
/* based on the type, determine if we enable autocenter */
- switch (field->type)
+ switch (field->type())
{
case IPT_POSITIONAL:
case IPT_POSITIONAL_V:
- if (field->flags & ANALOG_FLAG_WRAPS)
+ if (field->analog_wraps())
break;
case IPT_AD_STICK_X:
@@ -1385,10 +1385,13 @@ void ui_menu_analog::populate()
case IPT_PEDAL3:
use_autocenter = true;
break;
+
+ default:
+ break;
}
/* get the user settings */
- input_field_get_user_settings(field, &settings);
+ field->get_user_settings(settings);
/* iterate over types */
for (type = 0; type < ANALOG_ITEM_COUNT; type++)
@@ -1407,39 +1410,39 @@ void ui_menu_analog::populate()
{
default:
case ANALOG_ITEM_KEYSPEED:
- text.printf("%s Digital Speed", input_field_name(field));
+ text.printf("%s Digital Speed", field->name());
subtext.printf("%d", settings.delta);
data->min = 0;
data->max = 255;
data->cur = settings.delta;
- data->defvalue = field->delta;
+ data->defvalue = field->delta();
break;
case ANALOG_ITEM_CENTERSPEED:
- text.printf("%s Autocenter Speed", input_field_name(field));
+ text.printf("%s Autocenter Speed", field->name());
subtext.printf("%d", settings.centerdelta);
data->min = 0;
data->max = 255;
data->cur = settings.centerdelta;
- data->defvalue = field->centerdelta;
+ data->defvalue = field->centerdelta();
break;
case ANALOG_ITEM_REVERSE:
- text.printf("%s Reverse", input_field_name(field));
+ text.printf("%s Reverse", field->name());
subtext.cpy(settings.reverse ? "On" : "Off");
data->min = 0;
data->max = 1;
data->cur = settings.reverse;
- data->defvalue = ((field->flags & ANALOG_FLAG_REVERSE) != 0);
+ data->defvalue = field->analog_reverse();
break;
case ANALOG_ITEM_SENSITIVITY:
- text.printf("%s Sensitivity", input_field_name(field));
+ text.printf("%s Sensitivity", field->name());
subtext.printf("%d", settings.sensitivity);
data->min = 1;
data->max = 255;
data->cur = settings.sensitivity;
- data->defvalue = field->sensitivity;
+ data->defvalue = field->sensitivity();
break;
}
diff --git a/src/emu/uimain.h b/src/emu/uimain.h
index 355d6dc831a..87297901f1f 100644
--- a/src/emu/uimain.h
+++ b/src/emu/uimain.h
@@ -121,7 +121,7 @@ protected:
void populate_and_sort(struct input_item_data *itemlist);
virtual void update_input(struct input_item_data *seqchangeditem) = 0;
void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq);
- const input_seq &get_field_default_seq(input_field_config *field, input_seq_type seqtype);
+ const input_seq &get_field_default_seq(ioport_field *field, input_seq_type seqtype);
protected:
const void * pollingref;
@@ -212,7 +212,7 @@ private:
/* internal analog menu item data */
struct analog_item_data {
- input_field_config *field;
+ ioport_field *field;
int type;
int min, max;
int cur;
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index 53f9474ba2c..a70a4303cbb 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -907,7 +907,7 @@ void ui_menu::handle_keys(UINT32 flags)
/* see if any other UI keys are pressed */
if (menu_event.iptkey == IPT_INVALID)
- for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
+ for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
{
if (code == IPT_UI_CONFIGURE || (code == IPT_UI_LEFT && ignoreleft) || (code == IPT_UI_RIGHT && ignoreright) || (code == IPT_UI_PAUSE && ignorepause))
continue;
diff --git a/src/emu/validity.c b/src/emu/validity.c
index f9a1232e4bc..e8c7abaacf9 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -71,7 +71,7 @@ UINT8 your_ptr64_flag_is_wrong[(int)(5 - sizeof(void *))];
inline const char *validity_checker::ioport_string_from_index(UINT32 index)
{
- return input_port_string_from_token((const char *)(FPTR)index);
+ return ioport_configurer::string_from_token((const char *)(FPTR)index);
}
@@ -808,38 +808,38 @@ void validity_checker::validate_gfx()
// analog input field
//-------------------------------------------------
-void validity_checker::validate_analog_input_field(input_field_config &field)
+void validity_checker::validate_analog_input_field(ioport_field &field)
{
// analog ports must have a valid sensitivity
- if (field.sensitivity == 0)
+ if (field.sensitivity() == 0)
mame_printf_error("Analog port with zero sensitivity\n");
// check that the default falls in the bitmask range
- if (field.defvalue & ~field.mask)
- mame_printf_error("Analog port with a default value (%X) out of the bitmask range (%X)\n", field.defvalue, field.mask);
+ if (field.defvalue() & ~field.mask())
+ mame_printf_error("Analog port with a default value (%X) out of the bitmask range (%X)\n", field.defvalue(), field.mask());
// tests for positional devices
- if (field.type == IPT_POSITIONAL || field.type == IPT_POSITIONAL_V)
+ if (field.type() == IPT_POSITIONAL || field.type() == IPT_POSITIONAL_V)
{
int shift;
- for (shift = 0; shift <= 31 && (~field.mask & (1 << shift)) != 0; shift++) ;
+ for (shift = 0; shift <= 31 && (~field.mask() & (1 << shift)) != 0; shift++) ;
// convert the positional max value to be in the bitmask for testing
- INT32 analog_max = field.max;
+ INT32 analog_max = field.maxval();
analog_max = (analog_max - 1) << shift;
// positional port size must fit in bits used
- if ((field.mask >> shift) + 1 < field.max)
+ if ((field.mask() >> shift) + 1 < field.maxval())
mame_printf_error("Analog port with a positional port size bigger then the mask size\n");
}
// tests for absolute devices
- else if (field.type >= __ipt_analog_absolute_start && field.type <= __ipt_analog_absolute_end)
+ else if (field.type() > IPT_ANALOG_ABSOLUTE_FIRST && field.type() < IPT_ANALOG_ABSOLUTE_LAST)
{
// adjust for signed values
- INT32 default_value = field.defvalue;
- INT32 analog_min = field.min;
- INT32 analog_max = field.max;
+ INT32 default_value = field.defvalue();
+ INT32 analog_min = field.minval();
+ INT32 analog_max = field.maxval();
if (analog_min > analog_max)
{
analog_min = -analog_min;
@@ -849,19 +849,19 @@ void validity_checker::validate_analog_input_field(input_field_config &field)
// check that the default falls in the MINMAX range
if (default_value < analog_min || default_value > analog_max)
- mame_printf_error("Analog port with a default value (%X) out of PORT_MINMAX range (%X-%X)\n", field.defvalue, field.min, field.max);
+ mame_printf_error("Analog port with a default value (%X) out of PORT_MINMAX range (%X-%X)\n", field.defvalue(), field.minval(), field.maxval());
// check that the MINMAX falls in the bitmask range
// we use the unadjusted min for testing
- if (field.min & ~field.mask || analog_max & ~field.mask)
- mame_printf_error("Analog port with a PORT_MINMAX (%X-%X) value out of the bitmask range (%X)\n", field.min, field.max, field.mask);
+ if (field.minval() & ~field.mask() || analog_max & ~field.mask())
+ mame_printf_error("Analog port with a PORT_MINMAX (%X-%X) value out of the bitmask range (%X)\n", field.minval(), field.maxval(), field.mask());
// absolute analog ports do not use PORT_RESET
- if (field.flags & ANALOG_FLAG_RESET)
+ if (field.analog_reset())
mame_printf_error("Absolute analog port using PORT_RESET\n");
// absolute analog ports do not use PORT_WRAPS
- if (field.flags & ANALOG_FLAG_WRAPS)
+ if (field.analog_wraps())
mame_printf_error("Absolute analog port using PORT_WRAPS\n");
}
@@ -869,16 +869,16 @@ void validity_checker::validate_analog_input_field(input_field_config &field)
else
{
// relative devices do not use PORT_MINMAX
- if (field.min != 0 || field.max != field.mask)
+ if (field.minval() != 0 || field.maxval() != field.mask())
mame_printf_error("Relative port using PORT_MINMAX\n");
// relative devices do not use a default value
// the counter is at 0 on power up
- if (field.defvalue != 0)
+ if (field.defvalue() != 0)
mame_printf_error("Relative port using non-0 default value\n");
// relative analog ports do not use PORT_WRAPS
- if (field.flags & ANALOG_FLAG_WRAPS)
+ if (field.analog_wraps())
mame_printf_error("Absolute analog port using PORT_WRAPS\n");
}
}
@@ -889,7 +889,7 @@ void validity_checker::validate_analog_input_field(input_field_config &field)
// setting
//-------------------------------------------------
-void validity_checker::validate_dip_settings(input_field_config &field)
+void validity_checker::validate_dip_settings(ioport_field &field)
{
const char *demo_sounds = ioport_string_from_index(INPUT_STRING_Demo_Sounds);
const char *flipscreen = ioport_string_from_index(INPUT_STRING_Flip_Screen);
@@ -897,46 +897,46 @@ void validity_checker::validate_dip_settings(input_field_config &field)
bool coin_error = false;
// iterate through the settings
- for (const input_setting_config *setting = field.settinglist().first(); setting != NULL; setting = setting->next())
+ for (ioport_setting *setting = field.first_setting(); setting != NULL; setting = setting->next())
{
// note any coinage strings
- int strindex = get_defstr_index(setting->name);
+ int strindex = get_defstr_index(setting->name());
if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end)
coin_list[strindex - __input_string_coinage_start] = 1;
// make sure demo sounds default to on
- if (field.name == demo_sounds && strindex == INPUT_STRING_On && field.defvalue != setting->value)
+ if (field.name() == demo_sounds && strindex == INPUT_STRING_On && field.defvalue() != setting->value())
mame_printf_error("Demo Sounds must default to On\n");
// check for bad demo sounds options
- if (field.name == demo_sounds && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
- mame_printf_error("Demo Sounds option must be Off/On, not %s\n", setting->name);
+ if (field.name() == demo_sounds && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
+ mame_printf_error("Demo Sounds option must be Off/On, not %s\n", setting->name());
// check for bad flip screen options
- if (field.name == flipscreen && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
- mame_printf_error("Flip Screen option must be Off/On, not %s\n", setting->name);
+ if (field.name() == flipscreen && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
+ mame_printf_error("Flip Screen option must be Off/On, not %s\n", setting->name());
// if we have a neighbor, compare ourselves to him
if (setting->next() != NULL)
{
// check for inverted off/on dispswitch order
- int next_strindex = get_defstr_index(setting->next()->name, true);
+ int next_strindex = get_defstr_index(setting->next()->name(), true);
if (strindex == INPUT_STRING_On && next_strindex == INPUT_STRING_Off)
- mame_printf_error("%s option must have Off/On options in the order: Off, On\n", field.name);
+ mame_printf_error("%s option must have Off/On options in the order: Off, On\n", field.name());
// check for inverted yes/no dispswitch order
else if (strindex == INPUT_STRING_Yes && next_strindex == INPUT_STRING_No)
- mame_printf_error("%s option must have Yes/No options in the order: No, Yes\n", field.name);
+ mame_printf_error("%s option must have Yes/No options in the order: No, Yes\n", field.name());
// check for inverted upright/cocktail dispswitch order
else if (strindex == INPUT_STRING_Cocktail && next_strindex == INPUT_STRING_Upright)
- mame_printf_error("%s option must have Upright/Cocktail options in the order: Upright, Cocktail\n", field.name);
+ mame_printf_error("%s option must have Upright/Cocktail options in the order: Upright, Cocktail\n", field.name());
// check for proper coin ordering
else if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end && next_strindex >= __input_string_coinage_start && next_strindex <= __input_string_coinage_end &&
- strindex >= next_strindex && memcmp(&setting->condition, &setting->next()->condition, sizeof(setting->condition)) == 0)
+ strindex >= next_strindex && setting->condition() == setting->next()->condition())
{
- mame_printf_error("%s option has unsorted coinage %s > %s\n", field.name, setting->name, setting->next()->name);
+ mame_printf_error("%s option has unsorted coinage %s > %s\n", field.name(), setting->name(), setting->next()->name());
coin_error = true;
}
}
@@ -958,15 +958,15 @@ void validity_checker::validate_dip_settings(input_field_config &field)
// stored within an ioport field or setting
//-------------------------------------------------
-void validity_checker::validate_condition(input_condition &condition, device_t &device, int_map &port_map)
+void validity_checker::validate_condition(ioport_condition &condition, device_t &device, int_map &port_map)
{
// resolve the tag
astring porttag;
- device.subtag(porttag, condition.tag);
+ device.subtag(porttag, condition.tag());
// then find a matching port
if (port_map.find(porttag) == 0)
- mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag);
+ mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag());
}
@@ -992,38 +992,38 @@ void validity_checker::validate_inputs()
// allocate the input ports
ioport_list portlist;
astring errorbuf;
- input_port_list_init(*device, portlist, errorbuf);
+ portlist.append(*device, errorbuf);
// report any errors during construction
if (errorbuf)
mame_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr());
// do a first pass over ports to add their names and find duplicates
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
+ for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
if (port_map.add(port->tag(), 1, false) == TMERR_DUPLICATE)
mame_printf_error("Multiple I/O ports with the same tag '%s' defined\n", port->tag());
// iterate over ports
- for (input_port_config *port = portlist.first(); port != NULL; port = port->next())
+ for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
{
m_current_ioport = port->tag();
// iterate through the fields on this port
- for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next())
+ for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
{
// verify analog inputs
- if (input_type_is_analog(field->type))
+ if (field->is_analog())
validate_analog_input_field(*field);
// look for invalid (0) types which should be mapped to IPT_OTHER
- if (field->type == IPT_INVALID)
+ if (field->type() == IPT_INVALID)
mame_printf_error("Field has an invalid type (0); use IPT_OTHER instead\n");
// verify dip switches
- if (field->type == IPT_DIPSWITCH)
+ if (field->type() == IPT_DIPSWITCH)
{
// dip switch fields must have a name
- if (field->name == NULL)
+ if (field->name() == NULL)
mame_printf_error("DIP switch has a NULL name\n");
// verify the settings list
@@ -1031,32 +1031,33 @@ void validity_checker::validate_inputs()
}
// verify names
- if (field->name != NULL)
+ const char *name = field->specific_name();
+ if (name != NULL)
{
// check for empty string
- if (field->name[0] == 0)
+ if (name[0] == 0)
mame_printf_error("Field name is an empty string\n");
// check for trailing spaces
- if (field->name[0] != 0 && field->name[strlen(field->name) - 1] == ' ')
- mame_printf_error("Field '%s' has trailing spaces\n", field->name);
+ if (name[0] != 0 && name[strlen(name) - 1] == ' ')
+ mame_printf_error("Field '%s' has trailing spaces\n", name);
// check for invalid UTF-8
- if (!utf8_is_valid_string(field->name))
- mame_printf_error("Field '%s' has invalid characters\n", field->name);
+ if (!utf8_is_valid_string(name))
+ mame_printf_error("Field '%s' has invalid characters\n", name);
// look up the string and print an error if default strings are not used
- /*strindex =get_defstr_index(defstr_map, field->name, driver, &error);*/
+ /*strindex =get_defstr_index(defstr_map, name, driver, &error);*/
}
// verify conditions on the field
- if (field->condition.tag != NULL)
- validate_condition(field->condition, *device, port_map);
+ if (!field->condition().none())
+ validate_condition(field->condition(), *device, port_map);
// verify conditions on the settings
- for (input_setting_config *setting = field->settinglist().first(); setting != NULL; setting = setting->next())
- if (setting->condition.tag != NULL)
- validate_condition(setting->condition, *device, port_map);
+ for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
+ if (!setting->condition().none())
+ validate_condition(setting->condition(), *device, port_map);
}
// done with this port
diff --git a/src/emu/validity.h b/src/emu/validity.h
index dd7799b3047..06f817f781e 100644
--- a/src/emu/validity.h
+++ b/src/emu/validity.h
@@ -93,9 +93,9 @@ private:
void validate_roms();
void validate_display();
void validate_gfx();
- void validate_analog_input_field(input_field_config &field);
- void validate_dip_settings(input_field_config &field);
- void validate_condition(input_condition &condition, device_t &device, int_map &port_map);
+ void validate_analog_input_field(ioport_field &field);
+ void validate_dip_settings(ioport_field &field);
+ void validate_condition(ioport_condition &condition, device_t &device, int_map &port_map);
void validate_inputs();
void validate_devices();
diff --git a/src/emu/video/pc_cga.c b/src/emu/video/pc_cga.c
index 7bf42a468bf..00384260d6f 100644
--- a/src/emu/video/pc_cga.c
+++ b/src/emu/video/pc_cga.c
@@ -138,10 +138,10 @@ INPUT_PORTS_START( pcvideo_pc1512 )
INPUT_PORTS_END
/* Dipswitch for font selection */
-#define CGA_FONT (input_port_read_direct(cga.config_input_port)&3)
+#define CGA_FONT (cga.config_input_port->read()&3)
/* Dipswitch for monitor selection */
-#define CGA_MONITOR (input_port_read_direct(cga.config_input_port)&0x1C)
+#define CGA_MONITOR (cga.config_input_port->read()&0x1C)
#define CGA_MONITOR_RGB 0x00 /* Colour RGB */
#define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */
#define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */
@@ -150,7 +150,7 @@ INPUT_PORTS_END
/* Dipswitch for chipset selection */
-#define CGA_CHIPSET (input_port_read_direct(cga.config_input_port)&0xE0)
+#define CGA_CHIPSET (cga.config_input_port->read()&0xE0)
#define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */
#define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */
#define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */
@@ -242,7 +242,7 @@ static struct
UINT8 *chr_gen;
- const input_port_config *config_input_port;
+ ioport_port *config_input_port;
mc6845_update_row_func update_row;
UINT8 palette_lut_2bpp[4];
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index b7de0776b94..bd2899079a4 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -97,7 +97,7 @@ protected:
// internal state
astring m_filename;
- input_port_value m_last_controls;
+ ioport_value m_last_controls;
bool m_playing;
required_device<laserdisc_device> m_laserdisc;
};
@@ -217,7 +217,7 @@ chd_file *ldplayer_state::get_disc()
void ldplayer_state::process_commands()
{
- input_port_value controls = input_port_read(machine(), "controls");
+ ioport_value controls = machine().root_device().ioport("controls")->read();
int number;
// step backwards
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index 3ac3085c83a..2dc4395e9f7 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -865,7 +865,7 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_2_w)
m_schaser_background_disable = (data >> 3) & 0x01;
m_schaser_background_select = (data >> 4) & 0x01;
- m_c8080bw_flip_screen = (data & 0x20) && (input_port_read(machine(), CABINET_PORT_TAG) & 0x01);
+ m_c8080bw_flip_screen = (data & 0x20) && (ioport(CABINET_PORT_TAG)->read() & 0x01);
m_port_2_last_extra = data;
}
@@ -1032,7 +1032,7 @@ WRITE8_MEMBER(_8080bw_state::lupin3_sh_port_2_w)
m_color_map = data & 0x40;
- m_c8080bw_flip_screen = (data & 0x20) && (input_port_read(machine(), "IN2") & 0x04);
+ m_c8080bw_flip_screen = (data & 0x20) && (ioport("IN2")->read() & 0x04);
m_port_2_last_extra = data;
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index e12016138b3..c6ba04b31ae 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -227,8 +227,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine(), "JSAI");
- if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
+ result = space->machine().root_device().ioport("JSAI")->read();
+ if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
@@ -360,8 +360,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine(), "JSAII");
- if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
+ result = space->machine().root_device().ioport("JSAII")->read();
+ if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -483,8 +483,8 @@ static READ8_HANDLER( jsa3_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = input_port_read(space->machine(), "JSAIII");
- if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
+ result = space->machine().root_device().ioport("JSAIII")->read();
+ if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break;
@@ -617,8 +617,8 @@ static READ8_HANDLER( jsa3s_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = input_port_read(space->machine(), "JSAIII");
- if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
+ result = space->machine().root_device().ioport("JSAIII")->read();
+ if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break;
diff --git a/src/mame/audio/cchasm.c b/src/mame/audio/cchasm.c
index 73c0d33b937..655b260c089 100644
--- a/src/mame/audio/cchasm.c
+++ b/src/mame/audio/cchasm.c
@@ -32,7 +32,7 @@ INPUT_CHANGED_MEMBER(cchasm_state::cchasm_set_coin_flag )
READ8_MEMBER(cchasm_state::cchasm_coin_sound_r)
{
- UINT8 coin = (input_port_read(machine(), "IN3") >> 4) & 0x7;
+ UINT8 coin = (ioport("IN3")->read() >> 4) & 0x7;
return m_sound_flags | (m_coin_flag << 3) | coin;
}
@@ -85,11 +85,11 @@ READ16_MEMBER(cchasm_state::cchasm_io_r)
m_sound_flags &= ~0x40;
return soundlatch4_byte_r(space,offset) << 8;
case 0x2:
- return (m_sound_flags| (input_port_read(machine(), "IN3") & 0x07) | 0x08) << 8;
+ return (m_sound_flags| (ioport("IN3")->read() & 0x07) | 0x08) << 8;
case 0x5:
- return input_port_read(machine(), "IN2") << 8;
+ return ioport("IN2")->read() << 8;
case 0x8:
- return input_port_read(machine(), "IN1") << 8;
+ return ioport("IN1")->read() << 8;
default:
return 0xff << 8;
}
diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c
index c26cd4bc7f5..2fbdcd3183b 100644
--- a/src/mame/audio/cyberbal.c
+++ b/src/mame/audio/cyberbal.c
@@ -37,8 +37,8 @@ void cyberbal_sound_reset(running_machine &machine)
READ8_MEMBER(cyberbal_state::cyberbal_special_port3_r)
{
- int temp = input_port_read(machine(), "JSAII");
- if (!(input_port_read(machine(), "IN0") & 0x8000)) temp ^= 0x80;
+ int temp = ioport("JSAII")->read();
+ if (!(ioport("IN0")->read() & 0x8000)) temp ^= 0x80;
if (m_cpu_to_sound_ready) temp ^= 0x40;
if (m_sound_to_cpu_ready) temp ^= 0x20;
return temp;
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index 4ec64efdf66..5c4c9e03f6a 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -144,7 +144,7 @@ READ16_MEMBER(harddriv_state::hdsnd68k_status_r)
// D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready)
logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
- return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((input_port_read(machine(), "IN0") & 0x0020) << 8) | 0;
+ return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((ioport("IN0")->read() & 0x0020) << 8) | 0;
}
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index ec09d7f29d4..342efd2ad39 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -416,7 +416,7 @@ static SOUND_START( mario )
mario_state *state = machine.driver_data<mario_state>();
device_t *audiocpu = machine.device("audiocpu");
#if USE_8039
- UINT8 *SND = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *SND = state->memregion("audiocpu")->base();
SND[0x1001] = 0x01;
#endif
@@ -426,7 +426,7 @@ static SOUND_START( mario )
{
state->m_eabank = "bank1";
audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1");
- state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base());
+ state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base());
state->membank("bank1")->configure_entry(1, state->memregion("audiocpu")->base() + 0x1000);
}
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index 362c15b6a0c..8d63b2d07e2 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -407,7 +407,7 @@ READ8_MEMBER(micro3d_state::micro3d_sound_io_r)
switch (offset)
{
- case 0x01: return (m_sound_port_latch[offset] & 0x7f) | input_port_read(machine(), "SOUND_SW");
+ case 0x01: return (m_sound_port_latch[offset] & 0x7f) | ioport("SOUND_SW")->read();
case 0x03: return (m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(machine().device("upd7759")) ? 0x08 : 0);
default: return 0;
}
diff --git a/src/mame/audio/midway.c b/src/mame/audio/midway.c
index 597f1a6b825..c9b312ca5bd 100644
--- a/src/mame/audio/midway.c
+++ b/src/mame/audio/midway.c
@@ -144,7 +144,7 @@ READ8_MEMBER(midway_ssio_device::ioport_read)
{
static const char *const port[] = { "IP0", "IP1", "IP2", "IP3", "IP4" };
astring tempstr;
- UINT8 result = input_port_read_safe(machine(), subtag(tempstr, port[offset]), 0xff);
+ UINT8 result = ioport(port[offset])->read_safe(0xff);
if (!m_custom_input[offset].isnull())
result = (result & ~m_custom_input_mask[offset]) |
(m_custom_input[offset](space, offset, 0xff) & m_custom_input_mask[offset]);
diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c
index 84c469e864e..71cd369d69f 100644
--- a/src/mame/audio/mw8080bw.c
+++ b/src/mame/audio/mw8080bw.c
@@ -575,7 +575,7 @@ MACHINE_CONFIG_END
void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
{
/* controls need to be active low */
- int controls = ~input_port_read(device->machine(), "IN0") & 0xff;
+ int controls = ~device->machine().root_device().ioport("IN0")->read() & 0xff;
discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
@@ -587,7 +587,7 @@ void maze_write_discrete(device_t *device, 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 */
/* immediately start making tones if pressed right after the coin is inserted. */
- discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine(), "IN1") >> 3) & 0x01);
+ discrete_sound_w(device, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
}
diff --git a/src/mame/audio/suna8.c b/src/mame/audio/suna8.c
index 337e6a1348d..fab2cbeaff7 100644
--- a/src/mame/audio/suna8.c
+++ b/src/mame/audio/suna8.c
@@ -52,7 +52,7 @@ SAMPLES_START( suna8_sh_start )
{
suna8_state *state = device.machine().driver_data<suna8_state>();
running_machine &machine = device.machine();
- int i, len = machine.root_device().memregion("samples")->bytes();
+ int i, len = state->memregion("samples")->bytes();
UINT8 *ROM = state->memregion("samples")->base();
state->m_samplebuf = auto_alloc_array(machine, INT16, len);
diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c
index a81a83e31f9..a27083502a9 100644
--- a/src/mame/drivers/2mindril.c
+++ b/src/mame/drivers/2mindril.c
@@ -73,10 +73,10 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
switch(offset)
{
- case 0x0/2: return input_port_read(machine(), "DSW");
+ case 0x0/2: return ioport("DSW")->read();
case 0x2/2:
{
- int arm_pwr = input_port_read(machine(), "IN0");//throw
+ int arm_pwr = ioport("IN0")->read();//throw
//popmessage("PC=%08x %02x",cpu_get_pc(&space.device()),arm_pwr);
if(arm_pwr > 0xe0) return ~0x1800;
@@ -86,7 +86,7 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
else return ~0x0000;
}
case 0x4/2: return (m_defender_sensor) | (m_shutter_sensor);
- case 0xe/2: return input_port_read(machine(), "IN2");//coins
+ case 0xe/2: return ioport("IN2")->read();//coins
// default: printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(&space.device()), offset * 2, m_iodata[offset]);
}
diff --git a/src/mame/drivers/30test.c b/src/mame/drivers/30test.c
index 0a18a42d64f..8d5ff35be5b 100644
--- a/src/mame/drivers/30test.c
+++ b/src/mame/drivers/30test.c
@@ -93,10 +93,10 @@ READ8_MEMBER(namco_30test_state::namco_30test_mux_r)
switch(m_mux_data)
{
- case 0x01: res = input_port_read(machine(), "IN0"); break;
- case 0x02: res = input_port_read(machine(), "IN1"); break;
- case 0x04: res = input_port_read(machine(), "IN2"); break;
- case 0x08: res = input_port_read(machine(), "IN3"); break;
+ case 0x01: res = ioport("IN0")->read(); break;
+ case 0x02: res = ioport("IN1")->read(); break;
+ case 0x04: res = ioport("IN2")->read(); break;
+ case 0x08: res = ioport("IN3")->read(); break;
}
return res;
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index dc1a0e68e04..348a0d87a9f 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -1377,7 +1377,7 @@ READ32_MEMBER(_39in1_state::cpld_r)
}
else if (cpu_get_pc(&space.device()) == 0xe3af4)
{
- return input_port_read(machine(), "MCUIPT");
+ return ioport("MCUIPT")->read();
}
else
{
diff --git a/src/mame/drivers/3do.c b/src/mame/drivers/3do.c
index d3fc660c1ff..3dccf7a6ea8 100644
--- a/src/mame/drivers/3do.c
+++ b/src/mame/drivers/3do.c
@@ -135,7 +135,7 @@ static MACHINE_RESET( 3do )
state->m_maincpu = downcast<legacy_cpu_device*>( machine.device("maincpu") );
- state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base());
+ state->membank("bank2")->set_base(state->memregion("user1")->base());
/* configure overlay */
state->membank("bank1")->configure_entry(0, state->m_dram);
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c
index 8fc6ed5ff08..482100bb019 100644
--- a/src/mame/drivers/40love.c
+++ b/src/mame/drivers/40love.c
@@ -578,7 +578,7 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love )
{
fortyl_state *state = machine.driver_data<fortyl_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
#if 0
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index 7f4dd34fa2a..d93e7ee1f14 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -591,10 +591,10 @@ static READ8_DEVICE_HANDLER( mux_port_r )
_5clown_state *state = device->machine().driver_data<_5clown_state>();
switch( state->m_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine(), "IN0-0");
- case 0x20: return input_port_read(device->machine(), "IN0-1");
- case 0x40: return input_port_read(device->machine(), "IN0-2");
- case 0x80: return input_port_read(device->machine(), "IN0-3");
+ case 0x10: return state->ioport("IN0-0")->read();
+ case 0x20: return state->ioport("IN0-1")->read();
+ case 0x40: return state->ioport("IN0-2")->read();
+ case 0x80: return state->ioport("IN0-3")->read();
}
return 0xff;
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 8ea3bdc221e..4a664ab7fb5 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -1892,7 +1892,7 @@ static INPUT_PORTS_START( shuttlei )
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
@@ -1932,7 +1932,7 @@ static INPUT_PORTS_START( skylove )
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) // must be off to boot
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
diff --git a/src/mame/drivers/ace.c b/src/mame/drivers/ace.c
index 1e0e4c5c594..2a84108ddb8 100644
--- a/src/mame/drivers/ace.c
+++ b/src/mame/drivers/ace.c
@@ -248,7 +248,7 @@ static INPUT_PORTS_START( ace )
//c012
PORT_START("c014") /* VBLANK??? */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("c015") /* coin input */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 209266d3584..af3311542cd 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -179,9 +179,9 @@ CUSTOM_INPUT_MEMBER(acefruit_state::sidewndr_payout_r)
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0);
+ return ((ioport("PAYOUT")->read() & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1);
+ return ((ioport("PAYOUT")->read() & bit_mask) >> 1);
default:
logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -195,13 +195,13 @@ CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_coinage_r)
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 1);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 2);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 2);
case 0x08:
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 3);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 3);
default:
logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -215,11 +215,11 @@ CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_payout_r)
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0);
+ return ((ioport("PAYOUT")->read() & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1);
+ return ((ioport("PAYOUT")->read() & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 2);
+ return ((ioport("PAYOUT")->read() & bit_mask) >> 2);
default:
logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -316,7 +316,7 @@ static INPUT_PORTS_START( sidewndr )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Stop Nudge/Nudge Up or Down" )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Gamble" )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) /* "Cash in" */
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) /* active low or high?? */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* active low or high?? */
PORT_BIT( 0xd8, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1") // 1
@@ -437,7 +437,7 @@ static INPUT_PORTS_START( starspnr )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
/* tested at 0xef77 after IN5 bit 1 and before IN2 bit 2 - after coins are tested - table at 0xefa5 (3 bytes) */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) /* active low or high?? */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* active low or high?? */
PORT_START("IN1") // 1
/* tested at 0xe77c - call from 0x012c */
diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c
index f41d79caaa3..198410306cc 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -321,7 +321,7 @@ READ16_MEMBER(acommand_state::ac_devices_r)
---- ---- ---- --x- (Activate Test)
---- ---- ---- ---x (Advance through Tests)
*/
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x0014/2:
case 0x0016/2:
return machine().device<okim6295_device>("oki1")->read(space,0);
@@ -392,7 +392,7 @@ READ16_MEMBER(acommand_state::ac_devices_r)
xxxx xxxx ---- ---- DIPSW4
---- ---- xxxx xxxx DIPSW3
*/
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
return m_ac_devram[offset];
}
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index 9751a205fd3..a8338c53a1e 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -43,11 +43,11 @@ READ8_MEMBER(actfancr_state::triothep_control_r)
{
switch (m_trio_control_select)
{
- case 0: return input_port_read(machine(), "P1");
- case 1: return input_port_read(machine(), "P2");
- case 2: return input_port_read(machine(), "DSW1");
- case 3: return input_port_read(machine(), "DSW2");
- case 4: return input_port_read(machine(), "SYSTEM"); /* VBL */
+ case 0: return ioport("P1")->read();
+ case 1: return ioport("P2")->read();
+ case 2: return ioport("DSW1")->read();
+ case 3: return ioport("DSW2")->read();
+ case 4: return ioport("SYSTEM")->read(); /* VBL */
}
return 0xff;
@@ -154,7 +154,7 @@ static INPUT_PORTS_START( actfancr )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c
index 958feee13d1..58ddc66789e 100644
--- a/src/mame/drivers/adp.c
+++ b/src/mame/drivers/adp.c
@@ -287,7 +287,7 @@ WRITE8_MEMBER( adp_state::microtouch_tx )
static UINT8 duart_input( device_t *device )
{
- return input_port_read(device->machine(), "DSW1");
+ return device->machine().root_device().ioport("DSW1")->read();
}
static const microtouch_interface adb_microtouch_config =
@@ -386,22 +386,22 @@ READ16_MEMBER(adp_state::test_r)
switch (m_mux_data)
{
- case 0x00: value = input_port_read(machine(), "x0"); break;
- case 0x01: value = input_port_read(machine(), "x1"); break;
- case 0x02: value = input_port_read(machine(), "x2"); break;
- case 0x03: value = input_port_read(machine(), "1P_UP"); break;
- case 0x04: value = input_port_read(machine(), "1P_B1"); break;
- case 0x05: value = input_port_read(machine(), "x5"); break;
- case 0x06: value = input_port_read(machine(), "1P_RIGHT"); break;
- case 0x07: value = input_port_read(machine(), "1P_DOWN"); break;
- case 0x08: value = input_port_read(machine(), "1P_LEFT"); break;
- case 0x09: value = input_port_read(machine(), "x9"); break;
- case 0x0a: value = input_port_read(machine(), "x10"); break;
- case 0x0b: value = input_port_read(machine(), "x11"); break;
- case 0x0c: value = input_port_read(machine(), "x12"); break;
- case 0x0d: value = input_port_read(machine(), "x13"); break;
- case 0x0e: value = input_port_read(machine(), "1P_START"); break;
- case 0x0f: value = input_port_read(machine(), "1P_COIN"); break;
+ case 0x00: value = ioport("x0")->read(); break;
+ case 0x01: value = ioport("x1")->read(); break;
+ case 0x02: value = ioport("x2")->read(); break;
+ case 0x03: value = ioport("1P_UP")->read(); break;
+ case 0x04: value = ioport("1P_B1")->read(); break;
+ case 0x05: value = ioport("x5")->read(); break;
+ case 0x06: value = ioport("1P_RIGHT")->read(); break;
+ case 0x07: value = ioport("1P_DOWN")->read(); break;
+ case 0x08: value = ioport("1P_LEFT")->read(); break;
+ case 0x09: value = ioport("x9")->read(); break;
+ case 0x0a: value = ioport("x10")->read(); break;
+ case 0x0b: value = ioport("x11")->read(); break;
+ case 0x0c: value = ioport("x12")->read(); break;
+ case 0x0d: value = ioport("x13")->read(); break;
+ case 0x0e: value = ioport("1P_START")->read(); break;
+ case 0x0f: value = ioport("1P_COIN")->read(); break;
}
m_mux_data++;
diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c
index 6a366324ace..a2341670732 100644
--- a/src/mame/drivers/aeroboto.c
+++ b/src/mame/drivers/aeroboto.c
@@ -227,7 +227,7 @@ static MACHINE_START( formatz )
{
aeroboto_state *state = machine.driver_data<aeroboto_state>();
- state->m_stars_rom = machine.root_device().memregion("gfx2")->base();
+ state->m_stars_rom = state->memregion("gfx2")->base();
state->m_stars_length = state->memregion("gfx2")->bytes();
state->save_item(NAME(state->m_disable_irq));
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index 6bbcf1af3c6..44e84b06ab7 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -439,23 +439,23 @@ static INPUT_PORTS_START( airbustr )
PORT_DIPSETTING( 0x08, "Mode 1" ) // routine at 0x056d: 11 21 12 16 (bit 3 active)
PORT_DIPSETTING( 0x00, "Mode 2" ) // 11 21 13 14 (bit 3 not active)
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
@@ -571,8 +571,8 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr )
{
airbustr_state *state = machine.driver_data<airbustr_state>();
- UINT8 *MASTER = machine.root_device().memregion("master")->base();
- UINT8 *SLAVE = machine.root_device().memregion("slave")->base();
+ UINT8 *MASTER = state->memregion("master")->base();
+ UINT8 *SLAVE = state->memregion("slave")->base();
UINT8 *AUDIO = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 3, &MASTER[0x00000], 0x4000);
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index a982fc2bcc6..5eb80c5c486 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -154,13 +154,13 @@ static READ8_DEVICE_HANDLER( mux_r )
albazg_state *state = device->machine().driver_data<albazg_state>();
switch(state->m_mux_data)
{
- case 0x00: return input_port_read(device->machine(), "IN0");
- case 0x01: return input_port_read(device->machine(), "IN1");
- case 0x02: return input_port_read(device->machine(), "IN2");
- case 0x04: return input_port_read(device->machine(), "IN3");
- case 0x08: return input_port_read(device->machine(), "IN4");
- case 0x10: return input_port_read(device->machine(), "IN5");
- case 0x20: return input_port_read(device->machine(), "IN6");
+ case 0x00: return state->ioport("IN0")->read();
+ case 0x01: return state->ioport("IN1")->read();
+ case 0x02: return state->ioport("IN2")->read();
+ case 0x04: return state->ioport("IN3")->read();
+ case 0x08: return state->ioport("IN4")->read();
+ case 0x10: return state->ioport("IN5")->read();
+ case 0x20: return state->ioport("IN6")->read();
}
return 0xff;
@@ -276,32 +276,32 @@ static INPUT_PORTS_START( yumefuda )
PORT_START("IN1")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_START("IN2")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_START("IN3")
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
/* Some bits of these three are actually used if you use the Royal Panel type */
PORT_START("IN4")
@@ -309,10 +309,10 @@ static INPUT_PORTS_START( yumefuda )
PORT_START("IN5")
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_START("IN6")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index c05164565fd..c95812b55b3 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -199,12 +199,12 @@ static READ32_HANDLER( aleck_dips_r )
switch( offset )
{
case 0:
- return (input_port_read(space->machine(), "IN0")); /* mtetrisc has regular inputs here */
+ return (space->machine().root_device().ioport("IN0")->read()); /* mtetrisc has regular inputs here */
case 1:
- return (input_port_read(space->machine(), "IN1"));
+ return (space->machine().root_device().ioport("IN1")->read());
case 2:
{
- UINT32 val = input_port_read(space->machine(), "INMJ");
+ UINT32 val = space->machine().root_device().ioport("INMJ")->read();
switch( dip_read_offset >> 8 & 0xff )
{
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 6c081f9b170..cbf25cbf12a 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -61,8 +61,8 @@ static int get_lightgun_pos(screen_device &screen, int player, int *x, int *y)
{
const rectangle &visarea = screen.visible_area();
- int xpos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff);
- int ypos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff);
+ int xpos = screen.machine().root_device().ioport((player == 0) ? "GUN1X" : "GUN2X")->read_safe(0xffffffff);
+ int ypos = screen.machine().root_device().ioport((player == 0) ? "GUN1Y" : "GUN2Y")->read_safe(0xffffffff);
if (xpos == -1 || ypos == -1)
return FALSE;
@@ -201,7 +201,7 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_trigger_r)
{
/* read the trigger control based on the input select */
- return (input_port_read(machine(), "TRIGGERS") >> m_input_select) & 1;
+ return (ioport("TRIGGERS")->read() >> m_input_select) & 1;
}
@@ -209,7 +209,7 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_holster_r)
{
/* read the holster control based on the input select */
- return (input_port_read(machine(), "TRIGGERS") >> (2 + m_input_select)) & 1;
+ return (ioport("TRIGGERS")->read() >> (2 + m_input_select)) & 1;
}
@@ -240,7 +240,7 @@ static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
static READ8_DEVICE_HANDLER( alg_cia_0_porta_r )
{
- return input_port_read(device->machine(), "FIRE") | 0x3f;
+ return device->machine().root_device().ioport("FIRE")->read() | 0x3f;
}
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index 30ec17b0434..eca22cdcba7 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -233,40 +233,40 @@ WRITE16_MEMBER(alpha68k_state::alpha_microcontroller_w)
READ16_MEMBER(alpha68k_state::kyros_dip_r)
{
- return input_port_read(machine(), "IN1") << 8;
+ return ioport("IN1")->read() << 8;
}
READ16_MEMBER(alpha68k_state::control_1_r)
{
if (m_invert_controls)
- return ~(input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8));
+ return ~(ioport("IN0")->read() + (ioport("IN1")->read() << 8));
- return (input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8));
+ return (ioport("IN1")->read() << 8);
}
READ16_MEMBER(alpha68k_state::control_2_r)
{
if (m_invert_controls)
- return ~(input_port_read(machine(), "IN3") + ((~(1 << input_port_read(machine(), "IN5"))) << 8));
+ return ~(ioport("IN3")->read() + ((~(1 << ioport("IN5")->read())) << 8));
- return input_port_read(machine(), "IN3") + /* Low byte of CN1 */
- ((~(1 << input_port_read(machine(), "IN5"))) << 8);
+ return ioport("IN3")->read() + /* Low byte of CN1 */
+ ((~(1 << ioport("IN5")->read())) << 8);
}
READ16_MEMBER(alpha68k_state::control_2_V_r)
{
- return input_port_read(machine(), "IN3");
+ return ioport("IN3")->read();
}
READ16_MEMBER(alpha68k_state::control_3_r)
{
if (m_invert_controls)
- return ~(((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00);
+ return ~(((~(1 << ioport("IN6")->read())) << 8) & 0xff00);
- return ((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00;
+ return ((~(1 << ioport("IN6")->read())) << 8) & 0xff00;
}
/* High 4 bits of CN1 & CN2 */
@@ -274,20 +274,20 @@ READ16_MEMBER(alpha68k_state::control_4_r)
{
if (m_invert_controls)
- return ~((((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00));
+ return ~((((~(1 << ioport("IN6")->read())) << 4) & 0xf000)
+ + (((~(1 << ioport("IN5")->read()))) & 0x0f00));
- return (((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00);
+ return (((~(1 << ioport("IN6")->read())) << 4) & 0xf000)
+ + (((~(1 << ioport("IN5")->read()))) & 0x0f00);
}
READ16_MEMBER(alpha68k_state::jongbou_inputs_r)
{
- UINT8 inp1 = input_port_read(machine(), "IN3");
- UINT8 inp2 = input_port_read(machine(), "IN4");
+ UINT8 inp1 = ioport("IN3")->read();
+ UINT8 inp2 = ioport("IN4")->read();
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 input_port_read(machine(), "IN0") | inp1 | inp2 << 4;
+ return ioport("IN0")->read() | inp1 | inp2 << 4;
}
@@ -353,15 +353,15 @@ READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r)
return 0;
case 0x29: /* Query microcontroller for coin insert */
m_trigstate++;
- if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0;
- if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
+ if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x0;
m_latch = 1;
- m_coinvalue = (~input_port_read(machine(), "IN1") >> 1) & 7;
+ m_coinvalue = (~ioport("IN1")->read() >> 1) & 7;
m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0])
{
@@ -371,13 +371,13 @@ READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r)
else
m_credits = 0;
}
- else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
+ else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
m_shared_ram[0x22] = (source & 0xff00) | 0x0;
m_latch = 1;
- m_coinvalue = (~input_port_read(machine(), "IN1") >>1 ) & 7;
+ m_coinvalue = (~ioport("IN1")->read() >>1 ) & 7;
m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0])
{
@@ -430,7 +430,7 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
switch (offset)
{
case 0: /* Dipswitch 2 */
- m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4");
+ m_shared_ram[0] = (source & 0xff00) | ioport("IN4")->read();
return 0;
case 0x22: /* Coin value */
@@ -438,9 +438,9 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0;
- if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
+ if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -449,9 +449,9 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
if ((m_coin_id & 0xff) == 0x22)
{
if (m_game_id == ALPHA68K_BTLFIELDB)
- m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7;
+ m_coinvalue = (ioport("IN4")->read() >> 0) & 7;
else
- m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7;
+ m_coinvalue = (~ioport("IN4")->read() >> 0) & 7;
m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0])
@@ -463,7 +463,7 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
m_credits = 0;
}
}
- else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
+ else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -472,9 +472,9 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
if ((m_coin_id >> 8) == 0x22)
{
if (m_game_id == ALPHA68K_BTLFIELDB)
- m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7;
+ m_coinvalue = (ioport("IN4")->read() >> 0) & 7;
else
- m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7;
+ m_coinvalue = (~ioport("IN4")->read() >> 0) & 7;
m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0])
@@ -524,15 +524,15 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
switch (offset)
{
case 0: /* Dipswitch 1 */
- m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4");
+ m_shared_ram[0] = (source & 0xff00) | ioport("IN4")->read();
return 0;
case 0x22: /* Coin value */
m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0;
- if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
+ if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -540,7 +540,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id & 0xff) == 0x22)
{
- m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0])
{
@@ -551,7 +551,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
m_credits = 0;
}
}
- else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
+ else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id>>8); // coinB
m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -559,7 +559,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id >> 8) == 0x22)
{
- m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0])
{
@@ -585,12 +585,12 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
break;
case 0x1f00: /* Dipswitch 1 */
- m_shared_ram[0x1f00] = (source & 0xff00) | input_port_read(machine(), "IN4");
+ m_shared_ram[0x1f00] = (source & 0xff00) | ioport("IN4")->read();
return 0;
case 0x1f29: /* Query microcontroller for coin insert */
- if ((input_port_read(machine(), "IN2") & 0x3) == 3)
+ if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0;
- if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch)
+ if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{
m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@@ -598,7 +598,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id & 0xff) == 0x22)
{
- m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0])
{
@@ -609,7 +609,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
m_credits = 0;
}
}
- else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch)
+ else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{
m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@@ -617,7 +617,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id >> 8) == 0x22)
{
- m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7;
+ m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0])
{
@@ -638,7 +638,7 @@ READ16_MEMBER(alpha68k_state::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 = m_shared_ram[0x0163];
- m_shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(machine(), "IN4") << 8);
+ m_shared_ram[0x0163] = (source & 0x00ff) | (ioport("IN4")->read() << 8);
return 0;
case 0x1ffe: /* Custom ID check */
@@ -1568,10 +1568,10 @@ static INPUT_PORTS_START( tnextspc )
PORT_DIPSETTING( 0x03, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,PORTCOND_EQUALS,0x08)
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,EQUALS,0x08)
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, "Game Mode" ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,PORTCOND_EQUALS,0x00)
+ PORT_DIPNAME( 0x04, 0x04, "Game Mode" ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,EQUALS,0x00)
PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)")
PORT_DIPNAME( 0x08, 0x08, "SW2:3 Demo Sound/Game Mode" ) PORT_DIPLOCATION("SW2:4")
diff --git a/src/mame/drivers/ampoker2.c b/src/mame/drivers/ampoker2.c
index 77c962ddbbb..6fee8e1a5b1 100644
--- a/src/mame/drivers/ampoker2.c
+++ b/src/mame/drivers/ampoker2.c
@@ -703,10 +703,10 @@ static INPUT_PORTS_START( ampoker2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
- PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x08)
- PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x08)
- PORT_DIPSETTING( 0x08, "Cred x 20" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
- PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x08)
+ PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x08)
+ PORT_DIPSETTING( 0x08, "Cred x 20" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x00) /* x100 in ampkr95 */
+ PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x00)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card")
PORT_START("IN4")
@@ -788,10 +788,10 @@ static INPUT_PORTS_START( ampkr95 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
- PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
- PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
- PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
- PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
+ PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
+ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00) /* x100 in ampkr95 */
+ PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card")
PORT_START("IN4")
@@ -873,10 +873,10 @@ static INPUT_PORTS_START( sigmapkr )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
- PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
- PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08)
- PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */
- PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
+ PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
+ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00) /* x100 in ampkr95 */
+ PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double") PORT_CODE(KEYCODE_S)
PORT_START("IN4")
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index cdcc304182e..6784a449dcb 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -38,7 +38,7 @@ static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
{
amspdwy_state *state = machine.driver_data<amspdwy_state>();
static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };
- UINT8 wheel = input_port_read(machine, portnames[2 + index]);
+ UINT8 wheel = machine.root_device().ioport(portnames[2 + index])->read();
if (wheel != state->m_wheel_old[index])
{
wheel = (wheel & 0x7fff) - (wheel & 0x8000);
@@ -49,7 +49,7 @@ static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
state->m_wheel_old[index] = wheel;
}
- return state->m_wheel_return[index] | input_port_read(machine, portnames[index]);
+ return state->m_wheel_return[index] | machine.root_device().ioport(portnames[index])->read();
}
READ8_MEMBER(amspdwy_state::amspdwy_wheel_0_r)
@@ -64,7 +64,7 @@ READ8_MEMBER(amspdwy_state::amspdwy_wheel_1_r)
static READ8_DEVICE_HANDLER( amspdwy_sound_r )
{
- return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine(), "IN0");
+ return (ym2151_status_port_r(device, 0) & ~ 0x30) | device->machine().root_device().ioport("IN0")->read();
}
WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 6f870098984..7d4d9e056bc 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -160,9 +160,9 @@ READ8_MEMBER(angelkds_state::angelkds_input_r)
static const char *const portnames[] = { "I81", "I82" };
static const char *const fakenames[] = { "FAKE1", "FAKE2" };
- fake = input_port_read(machine(), fakenames[offset]);
+ fake = ioport(fakenames[offset])->read();
- return ((fake & 0x01) ? fake : input_port_read(machine(), portnames[offset]));
+ return ((fake & 0x01) ? fake : ioport(portnames[offset])->read());
}
#else
@@ -171,7 +171,7 @@ READ8_MEMBER(angelkds_state::angelkds_input_r)
{
static const char *const portnames[] = { "I81", "I82" };
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
#endif
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index e6db4e1233c..381ec81d255 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -46,7 +46,7 @@ READ16_MEMBER(aquarium_state::aquarium_coins_r)
{
int data;
- data = (input_port_read(machine(), "SYSTEM") & 0x7fff);
+ data = (ioport("SYSTEM")->read() & 0x7fff);
data |= m_aquarium_snd_ack;
m_aquarium_snd_ack = 0;
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index fc155180f13..bbfc979faf2 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -145,7 +145,7 @@ READ8_MEMBER(arabian_state::mcu_portk_r)
{
if (~sel & (1 << i))
{
- val = input_port_read(machine(), comnames[i]);
+ val = ioport(comnames[i])->read();
break;
}
}
diff --git a/src/mame/drivers/arcadecl.c b/src/mame/drivers/arcadecl.c
index c349e466e61..fe7aa2052b7 100644
--- a/src/mame/drivers/arcadecl.c
+++ b/src/mame/drivers/arcadecl.c
@@ -208,7 +208,7 @@ static INPUT_PORTS_START( arcadecl )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN")
@@ -268,7 +268,7 @@ static INPUT_PORTS_START( sparkz )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN")
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 2a958a6892c..3def932bee1 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -321,7 +321,7 @@ INLINE void uBackgroundColour(running_machine &machine)
There are 4 possible combinations for colour select via SW7, colours vary based on software installed.
*/
- switch(input_port_read(machine, "SW7"))
+ switch(state->ioport("SW7")->read())
{
case 0x00:
// restore defaults
@@ -380,12 +380,12 @@ static SCREEN_UPDATE_IND16(aristmk4)
READ8_MEMBER(aristmk4_state::ldsw)
{
- int U3_p2_ret= input_port_read(machine(), "5002");
+ int U3_p2_ret= ioport("5002")->read();
if(U3_p2_ret & 0x1)
{
return 0;
}
- return m_cgdrsw = input_port_read(machine(), "5005");
+ return m_cgdrsw = ioport("5005")->read();
}
READ8_MEMBER(aristmk4_state::cgdrr)
@@ -420,8 +420,8 @@ WRITE8_MEMBER(aristmk4_state::u3_p0)
READ8_MEMBER(aristmk4_state::u3_p2)
{
- int u3_p2_ret= input_port_read(machine(), "5002");
- int u3_p3_ret= input_port_read(machine(), "5003");
+ int u3_p2_ret= ioport("5002")->read();
+ int u3_p3_ret= ioport("5003")->read();
output_set_lamp_value(19, (u3_p2_ret >> 4) & 1); //auditkey light
output_set_lamp_value(20, (u3_p3_ret >> 2) & 1); //jackpotkey light
@@ -434,7 +434,7 @@ READ8_MEMBER(aristmk4_state::u3_p2)
if (m_inscrd==0)
{
- m_inscrd=input_port_read(machine(), "insertcoin");
+ m_inscrd=ioport("insertcoin")->read();
}
if (m_inscrd==1)
@@ -446,7 +446,7 @@ READ8_MEMBER(aristmk4_state::u3_p2)
READ8_MEMBER(aristmk4_state::u3_p3)
{
- int u3_p3_ret= input_port_read(machine(), "5003");
+ int u3_p3_ret= ioport("5003")->read();
if ((m_printer_motor)==1) // Printer Motor Off
@@ -474,7 +474,7 @@ READ8_MEMBER(aristmk4_state::bv_p0)
switch(m_insnote)
{
case 0x01:
- bv_p0_ret=input_port_read(machine(), "NS")+0x81; //check note selector
+ bv_p0_ret=ioport("NS")->read()+0x81; //check note selector
m_insnote++;
break;
case 0x02:
@@ -496,7 +496,7 @@ READ8_MEMBER(aristmk4_state::bv_p1)
int bv_p1_ret=0x00;
if (m_insnote==0)
- m_insnote=input_port_read(machine(), "insertnote");
+ m_insnote=ioport("insertnote")->read();
if (m_insnote==1)
bv_p1_ret=0x08;
@@ -645,7 +645,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
{
aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
- int ret=input_port_read(device->machine(), "via_port_b");
+ int ret=state->ioport("via_port_b")->read();
// Not expecting to read anything from port B on the AY8910's ( controls BC1, BC2 and BDIR )
// However there are extra 4 bits not going to the AY8910's on the schematics, which get read from here.
@@ -1561,12 +1561,12 @@ static const mc6845_interface mc6845_intf =
static READ8_DEVICE_HANDLER(pa1_r)
{
- return (input_port_read(device->machine(), "SW3") << 4) + input_port_read(device->machine(), "SW4");
+ return (device->machine().root_device().ioport("SW3")->read() << 4) + device->machine().root_device().ioport("SW4")->read();
}
static READ8_DEVICE_HANDLER(pb1_r)
{
- return (input_port_read(device->machine(), "SW5") << 4) + input_port_read(device->machine(), "SW6");
+ return (device->machine().root_device().ioport("SW5")->read() << 4) + device->machine().root_device().ioport("SW6")->read();
}
static READ8_DEVICE_HANDLER(pc1_r)
@@ -1630,7 +1630,7 @@ static MACHINE_START( aristmk4 )
static MACHINE_RESET( aristmk4 )
{
/* mark 4 has a link on the motherboard to switch between 1.5MHz and 3MHz clock speed */
- switch(input_port_read(machine, "LK13")) // CPU speed control... 3mhz or 1.5MHz
+ switch(machine.root_device().ioport("LK13")->read()) // CPU speed control... 3mhz or 1.5MHz
{
case 0x00:
machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 MHz
@@ -1659,7 +1659,7 @@ static TIMER_DEVICE_CALLBACK( aristmk4_pf )
Note: The use of 1 Hz in the timer is to avoid unintentional triggering the NMI ( ie.. hold down L for at least 1 second )
*/
- if(input_port_read(timer.machine(), "powerfail")) // send NMI signal if L pressed
+ if(timer.machine().root_device().ioport("powerfail")->read()) // send NMI signal if L pressed
{
cputag_set_input_line( timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
}
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index 546da3d4a2b..8cc140927b4 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -392,13 +392,13 @@ static MACHINE_RESET( aristmk5 )
/* load the roms according to what the operator wants */
{
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 *PRG;// = state->memregion("prg_code")->base();
int i;
UINT8 op_mode;
static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "clear_chip", "game_prg" };
- op_mode = input_port_read(machine, "ROM_LOAD");
+ op_mode = machine.root_device().ioport("ROM_LOAD")->read();
PRG = machine.root_device().memregion(rom_region[op_mode & 3])->base();
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index 17f47bba4af..5193b8aea96 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -1643,7 +1643,7 @@ static DRIVER_INIT( paddle2 )
static DRIVER_INIT( tetrsark )
{
arkanoid_state *state = machine.driver_data<arkanoid_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
int x;
for (x = 0; x < 0x8000; x++)
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index f5ff09cc617..0c10c26b8f5 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -556,16 +556,16 @@ READ16_MEMBER(bigfghtr_state::sharedram_r)
break;
case 0x642/2:
- return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff;
+ return (ioport("DSW0")->read() & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff;
+ return (ioport("DSW1")->read() & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff;
+ return (ioport("P1")->read() & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff;
+ return (ioport("P2")->read() & 0xffff) ^ 0xffff;
}
}
@@ -581,16 +581,16 @@ READ16_MEMBER(bigfghtr_state::sharedram_r)
}
break;
case 0x642/2:
- return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff;
+ return (ioport("DSW0")->read() & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff;
+ return (ioport("DSW1")->read() & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff;
+ return (ioport("P1")->read() & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff;
+ return (ioport("P2")->read() & 0xffff) ^ 0xffff;
/*
protection controls where the program code should jump to.
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index 88da98d61a5..518b29b71dd 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -152,7 +152,7 @@ READ16_MEMBER(artmagic_state::ultennis_hack_r)
update_irq_state(machine());
machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
}
- return input_port_read(machine(), "300000");
+ return ioport("300000")->read();
}
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index b02aa33e16b..c75ab45f14d 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -46,7 +46,7 @@ WRITE16_MEMBER(asterix_state::control2_w)
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
/* bit 5 is select tile bank */
k056832_set_tile_bank(m_k056832, (data & 0x20) >> 5);
diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c
index bc6ca05f647..e82f1ccaa5b 100644
--- a/src/mame/drivers/asteroid.c
+++ b/src/mame/drivers/asteroid.c
@@ -422,14 +422,14 @@ static INPUT_PORTS_START( asterock )
PORT_DIPSETTING ( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING ( 0x20, "Special" )
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:7,8")
- PORT_DIPSETTING ( 0xc0, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING ( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING ( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
-// PORT_DIPSETTING ( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING ( 0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING ( 0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING ( 0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
-// PORT_DIPSETTING ( 0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00)
+ PORT_DIPSETTING ( 0xc0, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
+ PORT_DIPSETTING ( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
+ PORT_DIPSETTING ( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
+// PORT_DIPSETTING ( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
+ PORT_DIPSETTING ( 0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
+ PORT_DIPSETTING ( 0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
+ PORT_DIPSETTING ( 0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
+// PORT_DIPSETTING ( 0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
INPUT_PORTS_END
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 9b675ad0ac5..2e9585d377c 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -352,7 +352,7 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) state->m_samples->start(5, SND_FLEET4);
if (bits_gone_hi & 0x10) state->m_samples->start(4, SND_UFOHIT);
- state->m_screen_flip = (input_port_read(device->machine(), "CABINET") & data & 0x20) ? 0xff : 0x00;
+ state->m_screen_flip = (state->ioport("CABINET")->read() & data & 0x20) ? 0xff : 0x00;
}
@@ -383,7 +383,7 @@ WRITE8_MEMBER(astinvad_state::spaceint_sound2_w)
if (bits_gone_hi & 0x04) m_samples->start(3, SND_INVADERHIT);
- m_screen_flip = (input_port_read(machine(), "CABINET") & data & 0x80) ? 0xff : 0x00;
+ m_screen_flip = (ioport("CABINET")->read() & data & 0x80) ? 0xff : 0x00;
}
@@ -460,7 +460,7 @@ static INPUT_PORTS_START( kamikaze )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("CABINET")
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index d505ae461c1..98133ed5b58 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -256,7 +256,7 @@ WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41
CUSTOM_INPUT_MEMBER(astrocde_state::ebases_trackball_r)
{
static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
- return input_port_read(machine(), names[m_input_select]);
+ return ioport(names[m_input_select])->read();
}
@@ -283,7 +283,7 @@ READ8_MEMBER(astrocde_state::spacezap_io_r)
{
coin_counter_w(machine(), 0, (offset >> 8) & 1);
coin_counter_w(machine(), 1, (offset >> 9) & 1);
- return input_port_read_safe(machine(), "P3HANDLE", 0xff);
+ return ioport("P3HANDLE")->read_safe(0xff);
}
@@ -482,7 +482,7 @@ READ8_MEMBER(astrocde_state::demndrgn_io_r)
CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r)
{
static const char *const names[] = { "MOVEX", "MOVEY" };
- return input_port_read(machine(), names[m_input_select]);
+ return ioport(names[m_input_select])->read();
}
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index a3257efa30c..b318f5f7a3c 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -177,7 +177,7 @@ WRITE16_MEMBER(astrocorp_state::astrocorp_eeprom_w)
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index e9bfc515ae6..d068ddcfb64 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -120,7 +120,7 @@ INPUT_CHANGED_MEMBER(astrof_state::service_coin_inserted)
CUSTOM_INPUT_MEMBER(astrof_state::astrof_p1_controls_r)
{
- return input_port_read(machine(), "P1");
+ return ioport("P1")->read();
}
@@ -131,10 +131,10 @@ CUSTOM_INPUT_MEMBER(astrof_state::astrof_p2_controls_r)
/* on an upright cabinet, a single set of controls
is connected to both sets of pins on the edge
connector */
- if (input_port_read(machine(), "CAB"))
- ret = input_port_read(machine(), "P2");
+ if (ioport("CAB")->read())
+ ret = ioport("P2")->read();
else
- ret = input_port_read(machine(), "P1");
+ ret = ioport("P1")->read();
return ret;
}
@@ -149,9 +149,9 @@ CUSTOM_INPUT_MEMBER(astrof_state::tomahawk_controls_r)
(not verified on pcb) */
if (m_flipscreen)
- ret = input_port_read(machine(), "P2");
+ ret = ioport("P2")->read();
else
- ret = input_port_read(machine(), "P1");
+ ret = ioport("P1")->read();
return ret;
}
@@ -204,7 +204,7 @@ static void astrof_get_pens( running_machine &machine, pen_t *pens )
astrof_state *state = machine.driver_data<astrof_state>();
offs_t i;
UINT8 bank = (state->m_astrof_palette_bank ? 0x10 : 0x00);
- UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
+ UINT8 config = state->ioport("FAKE")->read_safe(0x00);
UINT8 *prom = state->memregion("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */
@@ -240,7 +240,7 @@ static void tomahawk_get_pens( running_machine &machine, pen_t *pens )
{
offs_t i;
UINT8 *prom = machine.root_device().memregion("proms")->base();
- UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
+ UINT8 config = machine.root_device().ioport("FAKE")->read_safe(0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
{
@@ -295,7 +295,7 @@ WRITE8_MEMBER(astrof_state::tomahawk_videoram_w)
WRITE8_MEMBER(astrof_state::video_control_1_w)
{
- m_flipscreen = ((data >> 0) & 0x01) & input_port_read(machine(), "CAB");
+ m_flipscreen = ((data >> 0) & 0x01) & ioport("CAB")->read();
/* this ties to the CLR pin of the shift registers */
m_screen_off = (data & 0x02) ? TRUE : FALSE;
@@ -690,7 +690,7 @@ static INPUT_PORTS_START( astrof )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@@ -745,7 +745,7 @@ static INPUT_PORTS_START( abattle )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@@ -797,7 +797,7 @@ static INPUT_PORTS_START( spfghmk2 )
PORT_DIPSETTING( 0x20, "2500" )
PORT_DIPSETTING( 0x30, "3000" )
PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW:7" )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@@ -852,7 +852,7 @@ static INPUT_PORTS_START( spfghmk22 )
PORT_DIPNAME( 0x40, 0x00, "Kill Saucer after Invaders" ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) /* if saucer lands, game is over */
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@@ -911,7 +911,7 @@ static INPUT_PORTS_START( tomahawk )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index f29d7b9aa55..cbea2526435 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -655,23 +655,23 @@ static INPUT_PORTS_START( galmedes )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:5,6")
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,8")
- PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
/* 0x400002 -> 0x100984 */
PORT_MODIFY("DSWB")
@@ -842,7 +842,7 @@ static MACHINE_START( asuka )
state->m_tc0100scn = machine.device("tc0100scn");
/* configure the banks */
- state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base());
+ state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base());
state->membank("bank1")->configure_entries(1, 3, state->memregion("audiocpu")->base() + 0x10000, 0x04000);
state->save_item(NAME(state->m_adpcm_pos));
diff --git a/src/mame/drivers/atarifb.c b/src/mame/drivers/atarifb.c
index 15168195d22..60763ba854f 100644
--- a/src/mame/drivers/atarifb.c
+++ b/src/mame/drivers/atarifb.c
@@ -240,7 +240,7 @@ static INPUT_PORTS_START( atarifb )
PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("IN1")
@@ -310,7 +310,7 @@ static INPUT_PORTS_START( atarifb4 )
PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT ( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -387,7 +387,7 @@ static INPUT_PORTS_START( soccer )
PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */
PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x00, "Time per coin" ) PORT_DIPLOCATION("SW1:1,2,3")
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index 0aa1d0326d3..ce171ac62a6 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -92,7 +92,7 @@ WRITE16_MEMBER(atarig1_state::mo_command_w)
READ16_MEMBER(atarig1_state::special_port0_r)
{
- int temp = input_port_read(machine(), "IN0");
+ int temp = ioport("IN0")->read();
if (m_cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
@@ -111,11 +111,11 @@ READ16_MEMBER(atarig1_state::a2d_data_r)
/* Pit Fighter has no A2D, just another input port */
if (m_is_pitfight)
- return input_port_read(machine(), "ADC0");
+ return ioport("ADC0")->read();
/* otherwise, assume it's hydra */
if (m_which_input < 3)
- return input_port_read(machine(), adcnames[m_which_input]) << 8;
+ return ioport(adcnames[m_which_input])->read() << 8;
return 0;
}
@@ -247,7 +247,7 @@ static INPUT_PORTS_START( hydra )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("ADC0") /* ADC 0 @ fc8000 */
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
@@ -279,7 +279,7 @@ static INPUT_PORTS_START( pitfight )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("ADC0") /* fc8000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
@@ -324,7 +324,7 @@ static INPUT_PORTS_START( pitfightj )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("ADC0") /* fc8000 */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index bd25e0e7418..116e8ec9cfd 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -72,7 +72,7 @@ static MACHINE_RESET( atarig42 )
READ16_MEMBER(atarig42_state::special_port2_r)
{
- int temp = input_port_read(machine(), "IN2");
+ int temp = ioport("IN2")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -84,7 +84,7 @@ WRITE16_MEMBER(atarig42_state::a2d_select_w)
{
static const char *const portnames[] = { "A2D0", "A2D1" };
- m_analog_data = input_port_read(machine(), portnames[offset != 0]);
+ m_analog_data = ioport(portnames[offset != 0])->read();
}
@@ -386,7 +386,7 @@ static INPUT_PORTS_START( roadriot )
PORT_START("IN2") /* e00010 */
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( atarijsa_iii ) /* audio board port */
@@ -437,7 +437,7 @@ static INPUT_PORTS_START( guardian )
PORT_START("IN2") /* e00010 */
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( atarijsa_iii ) /* audio board port */
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index 254c329de86..66c717b727b 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -99,7 +99,7 @@ static void cage_irq_callback(running_machine &machine, int reason)
READ32_MEMBER(atarigt_state::special_port2_r)
{
- int temp = input_port_read(machine(), "SERVICE");
+ int temp = ioport("SERVICE")->read();
temp ^= 0x0001; /* /A2DRDY always high for now */
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
@@ -108,7 +108,7 @@ READ32_MEMBER(atarigt_state::special_port2_r)
READ32_MEMBER(atarigt_state::special_port3_r)
{
- int temp = input_port_read(machine(), "COIN");
+ int temp = ioport("COIN")->read();
if (m_video_int_state) temp ^= 0x0001;
if (m_scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp;
@@ -118,7 +118,7 @@ READ32_MEMBER(atarigt_state::special_port3_r)
#if (HACK_TMEK_CONTROLS)
INLINE void compute_fake_pots(int *pots)
{
- int fake = input_port_read(machine, "FAKE");
+ int fake = machine.root_device().ioport("FAKE")->read();
pots[0] = pots[1] = pots[2] = pots[3] = 0x80;
@@ -155,7 +155,7 @@ READ32_MEMBER(atarigt_state::analog_port0_r)
compute_fake_pots(pots);
return (pots[0] << 24) | (pots[3] << 8);
#else
- return (input_port_read(machine(), "AN1") << 24) | (input_port_read(machine(), "AN2") << 8);
+ return (ioport("AN2")->read() << 8);
#endif
}
@@ -167,7 +167,7 @@ READ32_MEMBER(atarigt_state::analog_port1_r)
compute_fake_pots(pots);
return (pots[2] << 24) | (pots[1] << 8);
#else
- return (input_port_read(machine(), "AN3") << 24) | (input_port_read(machine(), "AN4") << 8);
+ return (ioport("AN4")->read() << 8);
#endif
}
@@ -658,7 +658,7 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNUSED ) /* NC */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) /* SELFTEST */
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) /* VBLANK */
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN") /* 68.STATUS (A2=1) */
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index a7948aea720..6af6f4209a6 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -67,7 +67,7 @@ static MACHINE_RESET( atarigx2 )
READ32_MEMBER(atarigx2_state::special_port2_r)
{
- int temp = input_port_read(machine(), "SERVICE");
+ int temp = ioport("SERVICE")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -77,7 +77,7 @@ READ32_MEMBER(atarigx2_state::special_port2_r)
READ32_MEMBER(atarigx2_state::special_port3_r)
{
- int temp = input_port_read(machine(), "SPECIAL");
+ int temp = ioport("SPECIAL")->read();
return (temp << 16) | temp;
}
@@ -89,9 +89,9 @@ READ32_MEMBER(atarigx2_state::a2d_data_r)
switch (offset)
{
case 0:
- return (input_port_read(machine(), "A2D0") << 24) | (input_port_read(machine(), "A2D1") << 8);
+ return (ioport("A2D1")->read() << 8);
case 1:
- return (input_port_read(machine(), "A2D2") << 24) | (input_port_read(machine(), "A2D3") << 8);
+ return (ioport("A2D3")->read() << 8);
}
return 0;
@@ -1205,7 +1205,7 @@ static INPUT_PORTS_START( spclords )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL") /* 68.STATUS (A2=1) */
@@ -1253,7 +1253,7 @@ static INPUT_PORTS_START( motofren )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL") /* 68.STATUS (A2=1) */
@@ -1301,7 +1301,7 @@ static INPUT_PORTS_START( rrreveng )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL") /* 68.STATUS (A2=1) */
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 4ddf818b602..331993de7d9 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -268,15 +268,15 @@ READ16_MEMBER(atarisy1_state::joystick_r)
/* digital joystick type */
if (m_joystick_type == 1)
- newval = (input_port_read(machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
+ newval = (ioport("IN0")->read() & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */
else if (m_joystick_type == 2)
- newval = input_port_read(machine(), portnames[offset & 1]);
+ newval = ioport(portnames[offset & 1])->read();
/* Road Blasters gas pedal */
else if (m_joystick_type == 3)
- newval = input_port_read(machine(), "IN1");
+ newval = ioport("IN1")->read();
/* the A4 bit enables/disables joystick IRQs */
m_joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@@ -321,13 +321,13 @@ READ16_MEMBER(atarisy1_state::trakball_r)
if (player == 0)
{
- posx = (INT8)input_port_read(machine(), "IN0");
- posy = (INT8)input_port_read(machine(), "IN1");
+ posx = (INT8)ioport("IN0")->read();
+ posy = (INT8)ioport("IN1")->read();
}
else
{
- posx = (INT8)input_port_read(machine(), "IN2");
- posy = (INT8)input_port_read(machine(), "IN3");
+ posx = (INT8)ioport("IN2")->read();
+ posy = (INT8)ioport("IN3")->read();
}
m_cur[player][0] = posx + posy;
@@ -339,7 +339,7 @@ READ16_MEMBER(atarisy1_state::trakball_r)
/* Road Blasters steering wheel */
else if (m_trackball_type == 2)
- result = input_port_read(machine(), "IN0");
+ result = ioport("IN0")->read();
return result;
}
@@ -354,7 +354,7 @@ READ16_MEMBER(atarisy1_state::trakball_r)
READ16_MEMBER(atarisy1_state::port4_r)
{
- int temp = input_port_read(machine(), "F60000");
+ int temp = ioport("F60000")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -369,11 +369,11 @@ READ16_MEMBER(atarisy1_state::port4_r)
READ8_MEMBER(atarisy1_state::switch_6502_r)
{
- int temp = input_port_read(machine(), "1820");
+ int temp = ioport("1820")->read();
if (m_cpu_to_sound_ready) temp ^= 0x08;
if (m_sound_to_cpu_ready) temp ^= 0x10;
- if (!(input_port_read(machine(), "F60000") & 0x0040)) temp ^= 0x80;
+ if (!(ioport("F60000")->read() & 0x0040)) temp ^= 0x80;
return temp;
}
@@ -534,7 +534,7 @@ static INPUT_PORTS_START( marble )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@@ -573,7 +573,7 @@ static INPUT_PORTS_START( peterpak )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Throw/P2 Start")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Jump")
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@@ -612,7 +612,7 @@ static INPUT_PORTS_START( indytemp )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Whip/P2 Start")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* freeze? */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@@ -659,7 +659,7 @@ static INPUT_PORTS_START( roadrunn )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Hop/P2 Start")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Unused Button 1")
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Unused Button 2")
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@@ -694,7 +694,7 @@ static INPUT_PORTS_START( roadblst )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Lasers")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 542f3ac5753..8ac4ebba715 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -360,7 +360,7 @@ static void bankselect_postload(running_machine &machine)
READ16_MEMBER(atarisy2_state::switch_r)
{
- int result = input_port_read(machine(), "1800") | (input_port_read(machine(), "1801") << 8);
+ int result = ioport("1800")->read() | (ioport("1801")->read() << 8);
if (m_cpu_to_sound_ready) result ^= 0x20;
if (m_sound_to_cpu_ready) result ^= 0x10;
@@ -371,13 +371,13 @@ READ16_MEMBER(atarisy2_state::switch_r)
READ8_MEMBER(atarisy2_state::switch_6502_r)
{
- int result = input_port_read(machine(), "1840");
+ int result = ioport("1840")->read();
if (m_cpu_to_sound_ready) result |= 0x01;
if (m_sound_to_cpu_ready) result |= 0x02;
if ((m_has_tms5220) && (tms5220_readyq_r(machine().device("tms")) == 0))
result &= ~0x04;
- if (!(input_port_read(machine(), "1801") & 0x80)) result |= 0x10;
+ if (!(ioport("1801")->read() & 0x80)) result |= 0x10;
return result;
}
@@ -412,9 +412,9 @@ READ16_MEMBER(atarisy2_state::adc_r)
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
if (m_which_adc < m_pedal_count)
- return ~input_port_read(machine(), adcnames[m_which_adc]);
+ return ~ioport(adcnames[m_which_adc])->read();
- return input_port_read(machine(), adcnames[m_which_adc]) | 0xff00;
+ return ioport(adcnames[m_which_adc])->read() | 0xff00;
}
@@ -424,7 +424,7 @@ READ8_MEMBER(atarisy2_state::leta_r)
if (offset <= 1 && m_pedal_count == -1) /* 720 */
{
- switch (input_port_read(machine(), "SELECT"))
+ switch (ioport("SELECT")->read())
{
case 0: /* Real */
break;
@@ -432,8 +432,8 @@ READ8_MEMBER(atarisy2_state::leta_r)
case 1: /* Fake Joystick */
/* special thanks to MAME Analog+ for the mapping code */
{
- int analogx = input_port_read(machine(), "FAKE_JOY_X") - 128;
- int analogy = input_port_read(machine(), "FAKE_JOY_Y") - 128;
+ int analogx = ioport("FAKE_JOY_X")->read() - 128;
+ int analogy = ioport("FAKE_JOY_Y")->read() - 128;
double angle;
/* if the joystick is centered, leave the rest of this alone */
@@ -472,7 +472,7 @@ READ8_MEMBER(atarisy2_state::leta_r)
{
INT32 diff;
UINT32 temp;
- UINT32 rotate_count = input_port_read(machine(), "FAKE_SPINNER") & 0xffff;
+ UINT32 rotate_count = ioport("FAKE_SPINNER")->read() & 0xffff;
/* rotate_count behaves the same as the real LEAT1 Rotate encoder
* we use it to generate the LETA0 Center encoder count
*/
@@ -550,7 +550,7 @@ READ8_MEMBER(atarisy2_state::leta_r)
return 0xff;
}
}
- return input_port_read(machine(), letanames[offset]);
+ return ioport(letanames[offset])->read();
}
@@ -962,25 +962,25 @@ static INPUT_PORTS_START( 720 )
/* Center disc */
/* X1, X2 LETA inputs */
PORT_MODIFY("LETA0") /* not direct mapped */
- PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Center") PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Center") PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
/* Rotate disc */
/* Y1, Y2 LETA inputs */
/* The disc has 72 teeth which are read by the hardware at 2x */
/* Computer hardware reads at 4x, so we set the sensitivity to 50% */
PORT_MODIFY("LETA1") /* not direct mapped */
- PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_FULL_TURN_COUNT(144) PORT_NAME("Rotate") PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_FULL_TURN_COUNT(144) PORT_NAME("Rotate") PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
PORT_START("FAKE_JOY_X") /* not direct mapped */
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
PORT_START("FAKE_JOY_Y") /* not direct mapped */
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
/* Let's assume we are using a 1200 count spinner. We scale to get a 144 count.
* 144/1200 = 0.12 = 12% */
PORT_START("FAKE_SPINNER") /* not direct mapped */
- PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
+ PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
PORT_START("SELECT")
PORT_CONFNAME( 0x03, 0x02, "Controller Type" )
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 8efaa96524f..62dead00419 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -687,7 +687,7 @@ ADDRESS_MAP_END
READ16_MEMBER(atarisy4_state::analog_r)
{
- return (input_port_read(machine(), "STICKX") << 8) | input_port_read(machine(), "STICKY");
+ return (ioport("STICKX")->read() << 8) | ioport("STICKY")->read();
}
static INPUT_PORTS_START( atarisy4 )
@@ -969,8 +969,8 @@ static DRIVER_INIT( laststar )
state->m_shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
/* Populate the 68000 address space with data from the HEX files */
- load_hexfile(main, machine.root_device().memregion("code")->base());
- load_hexfile(main, machine.root_device().memregion("data")->base());
+ load_hexfile(main, state->memregion("code")->base());
+ load_hexfile(main, state->memregion("data")->base());
/* Set up the DSP */
state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
@@ -986,12 +986,12 @@ static DRIVER_INIT( airrace )
state->m_shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
/* Populate RAM with data from the HEX files */
- load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.root_device().memregion("code")->base());
+ load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), state->memregion("code")->base());
/* Set up the first DSP */
state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
state->membank("dsp0_bank1")->set_base(&state->m_shared_ram[0][0x800]);
- load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.root_device().memregion("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), state->memregion("dsp")->base());
/* Set up the second DSP */
state->membank("dsp1_bank0")->set_base(state->m_shared_ram[1]);
diff --git a/src/mame/drivers/ataxx.c b/src/mame/drivers/ataxx.c
index 6a834f10a01..b4fbb587455 100644
--- a/src/mame/drivers/ataxx.c
+++ b/src/mame/drivers/ataxx.c
@@ -115,7 +115,7 @@ static INPUT_PORTS_START( ataxx )
PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */
@@ -146,7 +146,7 @@ static INPUT_PORTS_START( wsf )
PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */
@@ -198,7 +198,7 @@ static INPUT_PORTS_START( indyheat )
PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */
@@ -244,7 +244,7 @@ static INPUT_PORTS_START( brutforc )
PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index ae22738f811..ab6087225b4 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -255,7 +255,7 @@ static INPUT_PORTS_START( atetris )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "50H:!2" ) /* Listed As "SPARE2 (Unused)" */
PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "50H:!1" ) /* Listed As "SPARE1 (Unused)" */
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
PORT_START("IN1")
diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c
index 1b33ef72046..3c2c6ae0fd6 100644
--- a/src/mame/drivers/attckufo.c
+++ b/src/mame/drivers/attckufo.c
@@ -104,8 +104,8 @@ READ8_MEMBER(attckufo_state::attckufo_io_r)
{
switch(offset)
{
- case 0: return input_port_read(machine(), "DSW");
- case 2: return input_port_read(machine(), "INPUT");
+ case 0: return ioport("DSW")->read();
+ case 2: return ioport("INPUT")->read();
}
return 0xff;
}
diff --git a/src/mame/drivers/avalnche.c b/src/mame/drivers/avalnche.c
index a0ca3b6cbce..9084209f7a4 100644
--- a/src/mame/drivers/avalnche.c
+++ b/src/mame/drivers/avalnche.c
@@ -181,7 +181,7 @@ static INPUT_PORTS_START( avalnche )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SLAM */
PORT_SERVICE( 0x20, IP_ACTIVE_HIGH)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Serve */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* VBLANK */
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_START("PADDLE")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x40, 0xb7) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
diff --git a/src/mame/drivers/aztarac.c b/src/mame/drivers/aztarac.c
index b74a217a9b6..d45f6666f54 100644
--- a/src/mame/drivers/aztarac.c
+++ b/src/mame/drivers/aztarac.c
@@ -63,8 +63,8 @@ READ16_MEMBER(aztarac_state::nvram_r)
READ16_MEMBER(aztarac_state::joystick_r)
{
- return (((input_port_read(machine(), "STICKZ") - 0xf) << 8) |
- ((input_port_read(machine(), "STICKY") - 0xf) & 0xff));
+ return (((ioport("STICKZ")->read() - 0xf) << 8) |
+ ((ioport("STICKY")->read() - 0xf) & 0xff));
}
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 5c5995753c2..a6839afb465 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -177,16 +177,16 @@ static READ32_DEVICE_HANDLER( backfire_eeprom_r )
/* some kind of screen indicator? checked by backfirea set before it will boot */
int backfire_screen = device->machine().rand() & 1;
eeprom_device *eeprom = downcast<eeprom_device *>(device);
- return ((eeprom->read_bit() << 24) | input_port_read(device->machine(), "IN0")
- | ((input_port_read(device->machine(), "IN2") & 0xbf) << 16)
- | ((input_port_read(device->machine(), "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
+ return ((eeprom->read_bit() << 24) | device->machine().root_device().ioport("IN0")->read()
+ | ((device->machine().root_device().ioport("IN2")->read() & 0xbf) << 16)
+ | ((device->machine().root_device().ioport("IN3")->read() & 0x40) << 16)) ^ (backfire_screen << 26) ;
}
READ32_MEMBER(backfire_state::backfire_control2_r)
{
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
- return (m_eeprom->read_bit() << 24) | input_port_read(machine(), "IN1") | (input_port_read(machine(), "IN1") << 16);
+ return (m_eeprom->read_bit() << 24) | ioport("IN1")->read() | (ioport("IN1")->read() << 16);
}
#ifdef UNUSED_FUNCTION
@@ -194,7 +194,7 @@ READ32_MEMBER(backfire_state::backfire_control3_r)
{
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
- return (m_eeprom->read_bit() << 24) | input_port_read(machine(), "IN2") | (input_port_read(machine(), "IN2") << 16);
+ return (m_eeprom->read_bit() << 24) | ioport("IN2")->read() | (ioport("IN2")->read() << 16);
}
#endif
@@ -233,7 +233,7 @@ WRITE32_MEMBER(backfire_state::backfire_pf4_rowscroll_w){ data &= 0x0000ffff; me
#ifdef UNUSED_FUNCTION
READ32_MEMBER(backfire_state::backfire_unknown_wheel_r)
{
- return input_port_read(machine(), "PADDLE0");
+ return ioport("PADDLE0")->read();
}
READ32_MEMBER(backfire_state::backfire_wheel1_r)
@@ -339,7 +339,7 @@ static INPUT_PORTS_START( backfire )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -354,7 +354,7 @@ static INPUT_PORTS_START( backfire )
PORT_START("IN3")
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) /* all other bits like low IN2 */
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("PADDLE0")
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index 686e961b4f2..02ea5b0fb27 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -192,7 +192,7 @@ static void scanline_update(screen_device &screen, int scanline)
/* sound IRQ is on 32V */
if (scanline & 32)
atarigen_6502_irq_ack_r(space, 0);
- else if (!(input_port_read(screen.machine(), "FE4000") & 0x40))
+ else if (!(screen.machine().root_device().ioport("FE4000")->read() & 0x40))
atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
}
@@ -232,7 +232,7 @@ static MACHINE_RESET( badlands )
static INTERRUPT_GEN( vblank_int )
{
badlands_state *state = device->machine().driver_data<badlands_state>();
- int pedal_state = input_port_read(device->machine(), "PEDALS");
+ int pedal_state = state->ioport("PEDALS")->read();
int i;
/* update the pedals once per frame */
@@ -306,8 +306,8 @@ READ8_MEMBER(badlands_state::audio_io_r)
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(machine(), "AUDIO");
- if (!(input_port_read(machine(), "FE4000") & 0x0080)) result ^= 0x90;
+ result = ioport("AUDIO")->read();
+ if (!(ioport("FE4000")->read() & 0x0080)) result ^= 0x90;
if (m_cpu_to_sound_ready) result ^= 0x40;
if (m_sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10;
@@ -426,7 +426,7 @@ static INPUT_PORTS_START( badlands )
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -586,7 +586,7 @@ static DRIVER_INIT( badlands )
badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the audio system */
- state->m_bank_base = &machine.root_device().memregion("audiocpu")->base()[0x03000];
+ state->m_bank_base = &state->memregion("audiocpu")->base()[0x03000];
state->m_bank_source_data = &state->memregion("audiocpu")->base()[0x10000];
}
@@ -688,7 +688,7 @@ static void scanline_update_bootleg(screen_device &screen, int scanline)
/* sound IRQ is on 32V */
// if (scanline & 32)
// atarigen_6502_irq_ack_r(screen.machine(), 0);
-// else if (!(input_port_read(machine, "FE4000") & 0x40))
+// else if (!(machine.root_device().ioport("FE4000")->read() & 0x40))
// atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
}
diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c
index e8f3468f5f1..c77abbfaecf 100644
--- a/src/mame/drivers/bagman.c
+++ b/src/mame/drivers/bagman.c
@@ -379,7 +379,7 @@ static READ8_DEVICE_HANDLER( dial_input_p1_r )
bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val;
- dial_val = input_port_read(device->machine(), "DIAL_P1");
+ dial_val = state->ioport("DIAL_P1")->read();
if(state->m_p1_res != 0x60)
state->m_p1_res = 0x60;
@@ -392,7 +392,7 @@ static READ8_DEVICE_HANDLER( dial_input_p1_r )
state->m_p1_old_val = dial_val;
- return (input_port_read(device->machine(), "P1") & 0x9f) | (state->m_p1_res);
+ return (state->ioport("P1")->read() & 0x9f) | (state->m_p1_res);
}
static READ8_DEVICE_HANDLER( dial_input_p2_r )
@@ -400,7 +400,7 @@ static READ8_DEVICE_HANDLER( dial_input_p2_r )
bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val;
- dial_val = input_port_read(device->machine(), "DIAL_P2");
+ dial_val = state->ioport("DIAL_P2")->read();
if(state->m_p2_res != 0x60)
state->m_p2_res = 0x60;
@@ -413,7 +413,7 @@ static READ8_DEVICE_HANDLER( dial_input_p2_r )
state->m_p2_old_val = dial_val;
- return (input_port_read(device->machine(), "P2") & 0x9f) | (state->m_p2_res);
+ return (state->ioport("P2")->read() & 0x9f) | (state->m_p2_res);
}
static const ay8910_interface ay8910_dial_config =
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index 7835db46643..ce47124f326 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -385,7 +385,7 @@ static INPUT_PORTS_START( sentetst )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
/* Analog ports */
PORT_START("AN0")
diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c
index 1fe26476c9f..aa6483ffb80 100644
--- a/src/mame/drivers/baraduke.c
+++ b/src/mame/drivers/baraduke.c
@@ -129,19 +129,19 @@ READ8_MEMBER(baraduke_state::inputport_r)
switch (m_inputport_selected)
{
case 0x00: /* DSW A (bits 0-4) */
- return (input_port_read(machine(), "DSWA") & 0xf8) >> 3;
+ return (ioport("DSWA")->read() & 0xf8) >> 3;
case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */
- return ((input_port_read(machine(), "DSWA") & 0x07) << 2) | ((input_port_read(machine(), "DSWB") & 0xc0) >> 6);
+ return ((ioport("DSWA")->read() & 0x07) << 2) | ((ioport("DSWB")->read() & 0xc0) >> 6);
case 0x02: /* DSW B (bits 2-6) */
- return (input_port_read(machine(), "DSWB") & 0x3e) >> 1;
+ return (ioport("DSWB")->read() & 0x3e) >> 1;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
- return ((input_port_read(machine(), "DSWB") & 0x01) << 4) | (input_port_read(machine(), "EDGE") & 0x0f);
+ return ((ioport("DSWB")->read() & 0x01) << 4) | (ioport("EDGE")->read() & 0x0f);
case 0x04: /* coins, start */
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x05: /* 2P controls */
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
case 0x06: /* 1P controls */
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
default:
return 0xff;
}
diff --git a/src/mame/drivers/batman.c b/src/mame/drivers/batman.c
index 7fe976ed4de..17f8c25e1e3 100644
--- a/src/mame/drivers/batman.c
+++ b/src/mame/drivers/batman.c
@@ -89,7 +89,7 @@ WRITE16_MEMBER(batman_state::batman_atarivc_w)
READ16_MEMBER(batman_state::special_port2_r)
{
- int result = input_port_read(machine(), "260010");
+ int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0010;
if (m_cpu_to_sound_ready) result ^= 0x0020;
return result;
@@ -180,7 +180,7 @@ static INPUT_PORTS_START( batman )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@260040) */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( atarijsa_iii ) /* audio board port */
INPUT_PORTS_END
diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c
index 5480dbd50b5..b2d8430caed 100644
--- a/src/mame/drivers/battlane.c
+++ b/src/mame/drivers/battlane.c
@@ -137,7 +137,7 @@ static INPUT_PORTS_START( battlane )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2")
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index 09307745865..84eaa9872cf 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -51,11 +51,11 @@ READ8_MEMBER(battlera_state::control_data_r)
{
switch (m_control_port_select)
{
- 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 */
+ case 0xfe: return ioport("IN0")->read(); /* Player 1 */
+ case 0xfd: return ioport("IN1")->read(); /* Player 2 */
+ case 0xfb: return ioport("IN2")->read(); /* Coins */
+ case 0xf7: return ioport("DSW2")->read(); /* Dip 2 */
+ case 0xef: return ioport("DSW1")->read(); /* Dip 1 */
}
return 0xff;
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index 1d8caa16925..6c2bd79596f 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -269,7 +269,7 @@ READ16_MEMBER(bbusters_state::control_3_r)
{
static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
- UINT16 retdata = input_port_read(machine(), port[m_gun_select]);
+ UINT16 retdata = ioport(port[m_gun_select])->read();
retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better
@@ -309,8 +309,8 @@ READ16_MEMBER(bbusters_state::mechatt_gun_r)
{
int x, y;
- x = input_port_read(machine(), offset ? "GUNX2" : "GUNX1");
- y = input_port_read(machine(), offset ? "GUNY2" : "GUNY1");
+ x = ioport(offset ? "GUNX2" : "GUNX1")->read();
+ y = ioport(offset ? "GUNY2" : "GUNY1")->read();
/* 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 9bbe342b254..26b791fea92 100644
--- a/src/mame/drivers/beaminv.c
+++ b/src/mame/drivers/beaminv.c
@@ -221,7 +221,7 @@ WRITE8_MEMBER(beaminv_state::controller_select_w)
READ8_MEMBER(beaminv_state::controller_r)
{
- return input_port_read(machine(), (m_controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
+ return ioport((m_controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG)->read();
}
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index f73e677b295..c9441b8ea45 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -256,7 +256,7 @@ WRITE32_MEMBER( beathead_state::eeprom_enable_w )
READ32_MEMBER( beathead_state::input_2_r )
{
- int result = input_port_read(machine(), "IN2");
+ int result = ioport("IN2")->read();
if (m_sound_to_cpu_ready) result ^= 0x10;
if (m_cpu_to_sound_ready) result ^= 0x20;
return result;
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index c6145e213da..cf308eccdca 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -426,7 +426,7 @@ static void get_pens(running_machine &machine, pen_t *pens)
int color;
double color_weights[2];
- if (input_port_read(machine, MONITOR_TYPE_PORT_TAG) == 0)
+ if (machine.root_device().ioport(MONITOR_TYPE_PORT_TAG)->read() == 0)
compute_resistor_weights(0, 0xff, -1.0,
2, resistances_wg, color_weights, 0, 270,
2, resistances_wg, color_weights, 0, 270,
@@ -903,9 +903,9 @@ READ8_MEMBER(berzerk_state::moonwarp_p1_r)
// one difference is it lacks the strobe input (does it?), which if not active causes
// the dial input to go open bus. This is used in moon war 2 to switch between player 1
// and player 2 dials, which share a single port. moonwarp uses separate ports for the dials.
- signed char dialread = input_port_read(machine(),"P1_DIAL");
+ signed char dialread = ioport("P1_DIAL")->read();
UINT8 ret;
- UINT8 buttons = (input_port_read(machine(),"P1")&0xe0);
+ UINT8 buttons = (ioport("P1")->read()&0xe0);
if (dialread < 0) m_p1_direction = 0;
else if (dialread > 0) m_p1_direction = 0x10;
m_p1_counter_74ls161 += abs(dialread);
@@ -918,9 +918,9 @@ READ8_MEMBER(berzerk_state::moonwarp_p1_r)
READ8_MEMBER(berzerk_state::moonwarp_p2_r)
{
// same as above, but for player 2 in cocktail mode
- signed char dialread = input_port_read(machine(),"P2_DIAL");
+ signed char dialread = ioport("P2_DIAL")->read();
UINT8 ret;
- UINT8 buttons = (input_port_read(machine(),"P2")&0xe0);
+ UINT8 buttons = (ioport("P2")->read()&0xe0);
if (dialread < 0) m_p2_direction = 0;
else if (dialread > 0) m_p2_direction = 0x10;
m_p2_counter_74ls161 += abs(dialread);
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index 44004de40ec..836301f26b4 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -914,7 +914,7 @@ READ8_MEMBER(bfcobra_state::chipset_r)
}
case 0x22:
{
- val = 0x40 | input_port_read(machine(), "JOYSTICK");
+ val = 0x40 | ioport("JOYSTICK")->read();
break;
}
default:
@@ -1433,7 +1433,7 @@ WRITE8_MEMBER(bfcobra_state::latch_w)
/* Clock is low */
if (!(data & 0x08))
- m_mux_input = input_port_read(machine(), port[input_strobe]);
+ m_mux_input = ioport(port[input_strobe])->read();
}
break;
}
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index 328999c1980..e8d7dcaddd6 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -205,7 +205,7 @@ static INTERRUPT_GEN( timer_irq )
{
state->m_irq_status = 0x01 |0x02; //0xff;
- state->m_sc1_Inputs[2] = input_port_read(device->machine(),"STROBE0");
+ state->m_sc1_Inputs[2] = state->ioport("STROBE0")->read();
generic_pulse_irq_line(device->machine().device("maincpu"), M6809_IRQ_LINE, 1);
}
@@ -320,7 +320,7 @@ READ8_MEMBER(bfm_sc1_state::mmtr_r)
READ8_MEMBER(bfm_sc1_state::dipcoin_r)
{
- return input_port_read(machine(),"STROBE0") & 0x1F;
+ return ioport("STROBE0")->read() & 0x1F;
}
///////////////////////////////////////////////////////////////////////////
@@ -444,7 +444,7 @@ WRITE8_MEMBER(bfm_sc1_state::mux1latch_w)
if ( !(data & 0x08) )
{
- m_sc1_Inputs[ input_strobe ] = input_port_read(machine(),portnames[input_strobe]);
+ m_sc1_Inputs[ input_strobe ] = ioport(portnames[input_strobe])->read();
m_mux1_input = m_sc1_Inputs[ input_strobe ];
}
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index 15bb4d912cb..571c93d0148 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -630,11 +630,11 @@ READ8_MEMBER(bfm_sc2_state::mux_input_r)
t1 = m_input_override[offset]; // strobe 0-7 data 0-4
t2 = m_input_override[offset+idx]; // strobe 8-B data 0-4
- t1 = (m_sc2_Inputs[offset] & t1) | ( ( input_port_read(machine(), port[offset]) & ~t1) & 0x1F);
+ t1 = (m_sc2_Inputs[offset] & t1) | ( ( ioport(port[offset])->read() & ~t1) & 0x1F);
if (idx == 8)
- t2 = (m_sc2_Inputs[offset+8] & t2) | ( ( input_port_read(machine(), port[offset+8]) & ~t2) << 5);
+ t2 = (m_sc2_Inputs[offset+8] & t2) | ( ( ioport(port[offset+8])->read() & ~t2) << 5);
else
- t2 = (m_sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read(machine(), port[offset+4]) & ~t2) << 2) & 0x60);
+ t2 = (m_sc2_Inputs[offset+4] & t2) | ( ( ( ioport(port[offset+4])->read() & ~t2) << 2) & 0x60);
m_sc2_Inputs[offset] = (m_sc2_Inputs[offset] & ~0x1F) | t1;
m_sc2_Inputs[offset+idx] = (m_sc2_Inputs[offset+idx] & ~0x60) | t2;
@@ -857,7 +857,7 @@ WRITE8_MEMBER(bfm_sc2_state::coininhib_w)
READ8_MEMBER(bfm_sc2_state::coin_input_r)
{
- return input_port_read(machine(), "COINS");
+ return ioport("COINS")->read();
}
///////////////////////////////////////////////////////////////////////////
@@ -1696,10 +1696,10 @@ static INPUT_PORTS_START( gldncrwn )
PORT_MODIFY("STROBE11")
PORT_DIPNAME( 0x01, 0x00, "Credits required:" )PORT_DIPLOCATION("DIL:!12")
- PORT_DIPSETTING( 0x00, "4 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x01, "2 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "1 credit per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x01, "4 credits per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, "4 credits per game")PORT_CONDITION("STROBE10",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x01, "2 credits per game")PORT_CONDITION("STROBE10",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 credit per round")PORT_CONDITION("STROBE10",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x01, "4 credits per round")PORT_CONDITION("STROBE10",0x10,EQUALS,0x10)
PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:!13")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/bfm_sc4h.c b/src/mame/drivers/bfm_sc4h.c
index e419c977a24..f6990d0252c 100644
--- a/src/mame/drivers/bfm_sc4h.c
+++ b/src/mame/drivers/bfm_sc4h.c
@@ -48,11 +48,11 @@ UINT8 read_input_matrix(running_machine &machine, int row)
if (row<4)
{
- value = (input_port_read_safe(machine, portnames[row], 0x00) & 0x1f) + ((input_port_read_safe(machine, portnames[row+8], 0x00) & 0x07) << 5);
+ value = (machine.root_device().ioport(portnames[row])->read_safe(0x00) & 0x1f) + ((machine.root_device().ioport(portnames[row+8])->read_safe(0x00) & 0x07) << 5);
}
else
{
- value = (input_port_read_safe(machine, portnames[row], 0x00) & 0x1f) + ((input_port_read_safe(machine, portnames[row+4], 0x00) & 0x18) << 2);
+ value = (machine.root_device().ioport(portnames[row])->read_safe(0x00) & 0x1f) + ((machine.root_device().ioport(portnames[row+4])->read_safe(0x00) & 0x18) << 2);
}
return value;
diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c
index df2ea5f0307..872f3b4d126 100644
--- a/src/mame/drivers/big10.c
+++ b/src/mame/drivers/big10.c
@@ -119,9 +119,9 @@ READ8_MEMBER(big10_state::mux_r)
{
switch(m_mux_data)
{
- case 1: return input_port_read(machine(), "IN1");
- case 2: return input_port_read(machine(), "IN2");
- case 4: return input_port_read(machine(), "IN3");
+ case 1: return ioport("IN1")->read();
+ case 2: return ioport("IN2")->read();
+ case 4: return ioport("IN3")->read();
}
return m_mux_data;
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index 425b7134587..cc00b4e9195 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -196,14 +196,14 @@ READ8_MEMBER(bigevglf_state::beg_trackball_x_r)
{
static const char *const portx_name[2] = { "P1X", "P2X" };
- return input_port_read(machine(), portx_name[m_port_select]);
+ return ioport(portx_name[m_port_select])->read();
}
READ8_MEMBER(bigevglf_state::beg_trackball_y_r)
{
static const char *const porty_name[2] = { "P1Y", "P2Y" };
- return input_port_read(machine(), porty_name[m_port_select]);
+ return ioport(porty_name[m_port_select])->read();
}
WRITE8_MEMBER(bigevglf_state::beg_port08_w)
@@ -336,7 +336,7 @@ READ8_MEMBER(bigevglf_state::sub_cpu_mcu_coin_port_r)
*/
m_mcu_coin_bit5 ^= 0x20;
- return bigevglf_mcu_status_r(space, 0) | (input_port_read(machine(), "PORT04") & 3) | m_mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
+ return bigevglf_mcu_status_r(space, 0) | (ioport("PORT04")->read() & 3) | m_mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
}
static ADDRESS_MAP_START( bigevglf_sub_portmap, AS_IO, 8, bigevglf_state )
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index 9055b1d8c3b..eaa8bd45a8a 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -87,13 +87,13 @@ READ16_MEMBER(bionicc_state::hacked_controls_r)
WRITE16_MEMBER(bionicc_state::bionicc_mpu_trigger_w)
{
- data = input_port_read(machine(), "SYSTEM") >> 12;
+ data = ioport("SYSTEM")->read() >> 12;
m_inp[0] = data ^ 0x0f;
- data = input_port_read(machine(), "P2");
+ data = ioport("P2")->read();
m_inp[1] = data ^ 0xff;
- data = input_port_read(machine(), "P1");
+ data = ioport("P1")->read();
m_inp[2] = data ^ 0xff;
}
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index d5011f55fb6..1d059b6ed0d 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -59,7 +59,7 @@ READ8_MEMBER(bladestl_state::trackball_r)
static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
int curr, delta;
- curr = input_port_read(machine(), port[offset]);
+ curr = ioport(port[offset])->read();
delta = (curr - m_last_track[offset]) & 0xff;
m_last_track[offset] = curr;
diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c
index e46258ef83a..05507a9bca3 100644
--- a/src/mame/drivers/blitz.c
+++ b/src/mame/drivers/blitz.c
@@ -422,10 +422,10 @@ static READ8_DEVICE_HANDLER( megadpkr_mux_port_r )
blitz_state *state = device->machine().driver_data<blitz_state>();
switch( state->m_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine(), "IN0-0");
- case 0x20: return input_port_read(device->machine(), "IN0-1");
- case 0x40: return input_port_read(device->machine(), "IN0-2");
- case 0x80: return input_port_read(device->machine(), "IN0-3");
+ case 0x10: return state->ioport("IN0-0")->read();
+ case 0x20: return state->ioport("IN0-1")->read();
+ case 0x40: return state->ioport("IN0-2")->read();
+ case 0x80: return state->ioport("IN0-3")->read();
}
return 0xff;
}
diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c
index 9ef120b333d..b97b2ffeb8c 100644
--- a/src/mame/drivers/blitz68k.c
+++ b/src/mame/drivers/blitz68k.c
@@ -1156,12 +1156,12 @@ WRITE16_MEMBER(blitz68k_state::hermit_leds2_w)
READ16_MEMBER(blitz68k_state::hermit_track_r)
{
#ifdef MAME_DEBUG
-// popmessage("track %02x %02x", input_port_read(machine(), "TRACK_X"), input_port_read(machine(), "TRACK_Y"));
+// popmessage("track %02x %02x", ioport("TRACK_Y")->read());
#endif
return
- ((0xf - ((input_port_read(machine(), "TRACK_Y") + 0x7) & 0xf)) << 12) |
- ((0xf - ((input_port_read(machine(), "TRACK_X") + 0x7) & 0xf)) << 8) ;
+ ((0xf - ((ioport("TRACK_Y")->read() + 0x7) & 0xf)) << 12) |
+ ((0xf - ((ioport("TRACK_X")->read() + 0x7) & 0xf)) << 8) ;
}
static ADDRESS_MAP_START( hermit_map, AS_PROGRAM, 16, blitz68k_state )
@@ -1737,14 +1737,14 @@ static TIMER_DEVICE_CALLBACK( steaser_mcu_sim )
// for(i=0;i<8;i+=2)
// state->m_nvram[((0x8a0)+i)/2] = 0;
/*finally, read the inputs*/
- state->m_nvram[0x89e/2] = input_port_read(timer.machine(), "MENU") & 0xffff;
- state->m_nvram[0x8a0/2] = input_port_read(timer.machine(), "STAT") & 0xffff;
- state->m_nvram[0x8a2/2] = input_port_read(timer.machine(), "BET_DEAL") & 0xffff;
- state->m_nvram[0x8a4/2] = input_port_read(timer.machine(), "TAKE_DOUBLE") & 0xffff;
- state->m_nvram[0x8a6/2] = input_port_read(timer.machine(), "SMALL_BIG") & 0xffff;
- state->m_nvram[0x8a8/2] = input_port_read(timer.machine(), "CANCEL_HOLD1") & 0xffff;
- state->m_nvram[0x8aa/2] = input_port_read(timer.machine(), "HOLD2_HOLD3") & 0xffff;
- state->m_nvram[0x8ac/2] = input_port_read(timer.machine(), "HOLD4_HOLD5") & 0xffff;
+ state->m_nvram[0x89e/2] = timer.machine().root_device().ioport("MENU")->read() & 0xffff;
+ state->m_nvram[0x8a0/2] = timer.machine().root_device().ioport("STAT")->read() & 0xffff;
+ state->m_nvram[0x8a2/2] = timer.machine().root_device().ioport("BET_DEAL")->read() & 0xffff;
+ state->m_nvram[0x8a4/2] = timer.machine().root_device().ioport("TAKE_DOUBLE")->read() & 0xffff;
+ state->m_nvram[0x8a6/2] = timer.machine().root_device().ioport("SMALL_BIG")->read() & 0xffff;
+ state->m_nvram[0x8a8/2] = timer.machine().root_device().ioport("CANCEL_HOLD1")->read() & 0xffff;
+ state->m_nvram[0x8aa/2] = timer.machine().root_device().ioport("HOLD2_HOLD3")->read() & 0xffff;
+ state->m_nvram[0x8ac/2] = timer.machine().root_device().ioport("HOLD4_HOLD5")->read() & 0xffff;
}
diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c
index 978939500d0..b53b3bb5b03 100644
--- a/src/mame/drivers/blktiger.c
+++ b/src/mame/drivers/blktiger.c
@@ -59,7 +59,7 @@ WRITE8_MEMBER(blktiger_state::blktiger_bankswitch_w)
WRITE8_MEMBER(blktiger_state::blktiger_coinlockout_w)
{
- if (input_port_read(machine(), "COIN_LOCKOUT") & 0x01)
+ if (ioport("COIN_LOCKOUT")->read() & 0x01)
{
coin_lockout_w(machine(), 0,~data & 0x01);
coin_lockout_w(machine(), 1,~data & 0x02);
diff --git a/src/mame/drivers/blmbycar.c b/src/mame/drivers/blmbycar.c
index e685f142a71..a91d3ba5108 100644
--- a/src/mame/drivers/blmbycar.c
+++ b/src/mame/drivers/blmbycar.c
@@ -62,7 +62,7 @@ WRITE16_MEMBER(blmbycar_state::blmbycar_pot_wheel_reset_w)
{
if (ACCESSING_BITS_0_7)
- m_pot_wheel = ~input_port_read(machine(), "WHEEL") & 0xff;
+ m_pot_wheel = ~ioport("WHEEL")->read() & 0xff;
}
WRITE16_MEMBER(blmbycar_state::blmbycar_pot_wheel_shift_w)
@@ -86,7 +86,7 @@ READ16_MEMBER(blmbycar_state::blmbycar_pot_wheel_r)
READ16_MEMBER(blmbycar_state::blmbycar_opt_wheel_r)
{
- return (~input_port_read(machine(), "WHEEL") & 0xff) << 8;
+ return (~ioport("WHEEL")->read() & 0xff) << 8;
}
diff --git a/src/mame/drivers/blockade.c b/src/mame/drivers/blockade.c
index b05df252b35..5f51848a6a7 100644
--- a/src/mame/drivers/blockade.c
+++ b/src/mame/drivers/blockade.c
@@ -63,7 +63,7 @@ static INTERRUPT_GEN( blockade_interrupt )
blockade_state *state = device->machine().driver_data<blockade_state>();
device_resume(device, SUSPEND_ANY_REASON);
- if ((input_port_read(device->machine(), "IN0") & 0x80) == 0)
+ if ((state->ioport("IN0")->read() & 0x80) == 0)
{
state->m_just_been_reset = 1;
device_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE);
@@ -79,7 +79,7 @@ static INTERRUPT_GEN( blockade_interrupt )
READ8_MEMBER(blockade_state::blockade_input_port_0_r)
{
/* coin latch is bit 7 */
- UINT8 temp = (input_port_read(machine(), "IN0") & 0x7f);
+ UINT8 temp = (ioport("IN0")->read() & 0x7f);
return (m_coin_latch << 7) | temp;
}
@@ -183,7 +183,7 @@ static INPUT_PORTS_START( blockade )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN3")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -226,7 +226,7 @@ static INPUT_PORTS_START( comotion )
PORT_START("IN3")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( blasto )
@@ -271,7 +271,7 @@ static INPUT_PORTS_START( blasto )
PORT_START("IN3")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( hustle )
@@ -315,7 +315,7 @@ static INPUT_PORTS_START( hustle )
PORT_START("IN3")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( mineswpr )
@@ -357,7 +357,7 @@ static INPUT_PORTS_START( mineswpr )
PORT_START("IN3")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( mineswpr4 )
@@ -399,7 +399,7 @@ static INPUT_PORTS_START( mineswpr4 )
PORT_START("IN3")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/bloodbro.c b/src/mame/drivers/bloodbro.c
index d71f2a6831b..6a2799fe41b 100644
--- a/src/mame/drivers/bloodbro.c
+++ b/src/mame/drivers/bloodbro.c
@@ -174,7 +174,7 @@ ADDRESS_MAP_END
PORT_DIPSETTING( 0x0001, "Mode 1" ) \
PORT_DIPSETTING( 0x0000, "Mode 2" ) \
/* Coin Mode 1 */ \
- PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0001) \
+ PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW",0x0001,EQUALS,0x0001) \
PORT_DIPSETTING( 0x0014, DEF_STR( 6C_1C ) ) \
PORT_DIPSETTING( 0x0016, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) ) \
@@ -192,12 +192,12 @@ ADDRESS_MAP_END
PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) \
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) \
/* Coin Mode 2 */ \
- PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0000) \
+ PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW",0x0001,EQUALS,0x0000) \
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) \
PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) ) \
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_1C ) ) \
- PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW",0x0001,PORTCOND_EQUALS,0x0000) \
+ PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW",0x0001,EQUALS,0x0000) \
PORT_DIPSETTING( 0x0018, DEF_STR( 1C_2C ) ) \
PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) \
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_5C ) ) \
diff --git a/src/mame/drivers/blstroid.c b/src/mame/drivers/blstroid.c
index fd707504407..0f3034a56aa 100644
--- a/src/mame/drivers/blstroid.c
+++ b/src/mame/drivers/blstroid.c
@@ -74,7 +74,7 @@ static MACHINE_RESET( blstroid )
READ16_MEMBER(blstroid_state::inputs_r)
{
static const char *const iptnames[] = { "IN0", "IN1" };
- int temp = input_port_read(machine(), iptnames[offset & 1]);
+ int temp = ioport(iptnames[offset & 1])->read();
if (m_cpu_to_sound_ready) temp ^= 0x0040;
if (atarigen_get_hblank(*machine().primary_screen)) temp ^= 0x0010;
@@ -135,7 +135,7 @@ static INPUT_PORTS_START( blstroid )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -146,7 +146,7 @@ static INPUT_PORTS_START( blstroid )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c
index f8266123c44..5ef489ef48a 100644
--- a/src/mame/drivers/bmcbowl.c
+++ b/src/mame/drivers/bmcbowl.c
@@ -230,7 +230,7 @@ WRITE16_MEMBER(bmcbowl_state::scroll_w)
static READ8_DEVICE_HANDLER(via_b_in)
{
- return input_port_read(device->machine(), "IN3");
+ return device->machine().root_device().ioport("IN3")->read();
}
@@ -444,7 +444,7 @@ static INPUT_PORTS_START( bmcbowl )
PORT_START("IN3")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -453,8 +453,8 @@ static READ8_DEVICE_HANDLER(dips1_r)
bmcbowl_state *state = device->machine().driver_data<bmcbowl_state>();
switch(state->m_bmc_input)
{
- case 0x00: return input_port_read(device->machine(), "IN1");
- case 0x40: return input_port_read(device->machine(), "IN2");
+ case 0x00: return state->ioport("IN1")->read();
+ case 0x40: return state->ioport("IN2")->read();
}
logerror("%s:unknown input - %X\n",device->machine().describe_context(),state->m_bmc_input);
return 0xff;
diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c
index 5c429381dcb..27d00fb8ccd 100644
--- a/src/mame/drivers/bnstars.c
+++ b/src/mame/drivers/bnstars.c
@@ -1246,28 +1246,28 @@ READ32_MEMBER(bnstars_state::bnstars1_r)
return 0xffffffff;
case 0x0000:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x0080:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 0x2000:
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
case 0x2080:
- return input_port_read(machine(), "IN3");
+ return ioport("IN3")->read();
}
}
READ32_MEMBER(bnstars_state::bnstars2_r)
{
- return input_port_read(machine(), "IN4");
+ return ioport("IN4")->read();
}
READ32_MEMBER(bnstars_state::bnstars3_r)
{
- return input_port_read(machine(), "IN5");
+ return ioport("IN5")->read();
}
WRITE32_MEMBER(bnstars_state::bnstars1_mahjong_select_w)
diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c
index 9348005edb6..f26f57a9830 100644
--- a/src/mame/drivers/bogeyman.c
+++ b/src/mame/drivers/bogeyman.c
@@ -81,7 +81,7 @@ static INPUT_PORTS_START( bogeyman )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index b4631969eaa..1d90c1e30cf 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -148,7 +148,7 @@ static INPUT_PORTS_START( boogwing )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW")
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index b38dc0ac590..bc1da41b908 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -81,12 +81,12 @@ static TIMER_CALLBACK( periodic_callback )
memset(mask, 0, sizeof mask);
- mask[input_port_read(machine, "STICK0_X")] |= 0x01;
- mask[input_port_read(machine, "STICK0_Y")] |= 0x02;
- mask[input_port_read(machine, "PADDLE0")] |= 0x04;
- mask[input_port_read(machine, "STICK1_X")] |= 0x08;
- mask[input_port_read(machine, "STICK1_Y")] |= 0x10;
- mask[input_port_read(machine, "PADDLE1")] |= 0x20;
+ mask[state->ioport("STICK0_X")->read()] |= 0x01;
+ mask[state->ioport("STICK0_Y")->read()] |= 0x02;
+ mask[state->ioport("PADDLE0")->read()] |= 0x04;
+ mask[state->ioport("STICK1_X")->read()] |= 0x08;
+ mask[state->ioport("STICK1_Y")->read()] |= 0x10;
+ mask[state->ioport("PADDLE1")->read()] |= 0x20;
for (i = 1; i < 256; i++)
if (mask[i] != 0)
@@ -203,9 +203,9 @@ static SCREEN_UPDATE_IND16( boxer )
READ8_MEMBER(boxer_state::boxer_input_r)
{
- UINT8 val = input_port_read(machine(), "IN0");
+ UINT8 val = ioport("IN0")->read();
- if (input_port_read(machine(), "IN3") < machine().primary_screen->vpos())
+ if (ioport("IN3")->read() < machine().primary_screen->vpos())
val |= 0x02;
return (val << ((offset & 7) ^ 7)) & 0x80;
@@ -227,11 +227,11 @@ READ8_MEMBER(boxer_state::boxer_misc_r)
break;
case 2:
- val = input_port_read(machine(), "IN1");
+ val = ioport("IN1")->read();
break;
case 3:
- val = input_port_read(machine(), "IN2");
+ val = ioport("IN2")->read();
break;
}
diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c
index 423f50c1d3e..10c3102b4cc 100644
--- a/src/mame/drivers/brkthru.c
+++ b/src/mame/drivers/brkthru.c
@@ -181,7 +181,7 @@ static INPUT_PORTS_START( brkthru )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* used only by the self test */
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* used only by the self test */
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
diff --git a/src/mame/drivers/bsktball.c b/src/mame/drivers/bsktball.c
index 4c8e6decfe3..f85c529f703 100644
--- a/src/mame/drivers/bsktball.c
+++ b/src/mame/drivers/bsktball.c
@@ -128,7 +128,7 @@ static INPUT_PORTS_START( bsktball )
/* 0x80 - DR3 = PL1 V DIR */
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SPARE */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* TEST STEP */
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 726ca644651..25aeabe5418 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -223,7 +223,7 @@ static void btime_decrypt( address_space *space )
/* however if the previous instruction was JSR (which caused a write to */
/* the stack), fetch the address of the next instruction. */
addr1 = cpu_get_previouspc(&space->device());
- src1 = (addr1 < 0x9000) ? state->m_rambase : space->machine().root_device().memregion("maincpu")->base();
+ src1 = (addr1 < 0x9000) ? state->m_rambase : state->memregion("maincpu")->base();
if (decrypted[addr1] == 0x20) /* JSR $xxxx */
addr = src1[addr1 + 1] + 256 * src1[addr1 + 2];
@@ -550,7 +550,7 @@ READ8_MEMBER(btime_state::audio_command_r)
READ8_MEMBER(btime_state::zoar_dsw1_read)
{
- return (!machine().primary_screen->vblank() << 7) | (input_port_read(machine(), "DSW1") & 0x7f);
+ return (!machine().primary_screen->vblank() << 7) | (ioport("DSW1")->read() & 0x7f);
}
static INPUT_PORTS_START( btime )
@@ -611,7 +611,7 @@ static INPUT_PORTS_START( btime )
// PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("15D:8")
// PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
// PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("14D:1")
@@ -684,7 +684,7 @@ static INPUT_PORTS_START( cookrace )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
@@ -833,7 +833,7 @@ static INPUT_PORTS_START( lnc )
// PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
// PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
// PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1")
@@ -896,7 +896,7 @@ static INPUT_PORTS_START( wtennis )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
@@ -972,7 +972,7 @@ static INPUT_PORTS_START( mmonkey )
// PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
// PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
// PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
@@ -1050,7 +1050,7 @@ static INPUT_PORTS_START( bnj )
// PORT_DIPNAME( 0x80, 0x00, "Control Panel" ) PORT_DIPLOCATION("8D:8")
// PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
// PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("7D:1")
@@ -1141,7 +1141,7 @@ static INPUT_PORTS_START( disco )
PORT_START("VBLANK")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( sdtennis )
@@ -1193,7 +1193,7 @@ static INPUT_PORTS_START( sdtennis )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c
index 2589e903437..fc82de21902 100644
--- a/src/mame/drivers/bwidow.c
+++ b/src/mame/drivers/bwidow.c
@@ -274,9 +274,9 @@ READ8_MEMBER(bwidow_state::spacduel_IN3_r)
int res2;
int res3;
- res1 = input_port_read(machine(), "IN3");
- res2 = input_port_read(machine(), "IN4");
- res3 = input_port_read_safe(machine(), "DSW2", 0);
+ res1 = ioport("IN3")->read();
+ res2 = ioport("IN4")->read();
+ res3 = ioport("DSW2")->read_safe(0);
res = 0x00;
switch (offset & 0x07)
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index c9fb4586977..5e364a3fdb6 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -67,11 +67,11 @@ WRITE8_MEMBER(bwing_state::bwp3_nmiack_w)
READ8_MEMBER(bwing_state::bwp1_io_r)
{
- if (offset == 0) return(input_port_read(machine(), "DSW0"));
- if (offset == 1) return(input_port_read(machine(), "DSW1"));
- if (offset == 2) return(input_port_read(machine(), "IN0"));
- if (offset == 3) return(input_port_read(machine(), "IN1"));
- if (offset == 4) return(input_port_read(machine(), "IN2"));
+ if (offset == 0) return(ioport("DSW0")->read());
+ if (offset == 1) return(ioport("DSW1")->read());
+ if (offset == 2) return(ioport("IN0")->read());
+ if (offset == 3) return(ioport("IN1")->read());
+ if (offset == 4) return(ioport("IN2")->read());
return((m_bwp123_membase[0])[0x1b00 + offset]);
}
@@ -279,13 +279,13 @@ static INPUT_PORTS_START( bwing )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_TILT ) PORT_CHANGED_MEMBER(DEVICE_SELF, bwing_state,tilt_pressed,0)
PORT_START("VBLANK")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("EXTRA") // a matter of taste
PORT_DIPNAME( 0x07, 0x00, "RGB" )
@@ -586,8 +586,8 @@ static DRIVER_INIT( bwing )
{
bwing_state *state = machine.driver_data<bwing_state>();
- state->m_bwp123_membase[0] = machine.root_device().memregion("maincpu")->base();
- state->m_bwp123_membase[1] = machine.root_device().memregion("sub")->base();
+ state->m_bwp123_membase[0] = state->memregion("maincpu")->base();
+ state->m_bwp123_membase[1] = state->memregion("sub")->base();
state->m_bwp123_membase[2] = state->memregion("audiocpu")->base();
fix_bwp3(machine);
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index a5f2a462670..c2a34c7c15e 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -244,7 +244,7 @@ static MACHINE_START( redbaron )
static INTERRUPT_GEN( bzone_interrupt )
{
- if (input_port_read(device->machine(), "IN0") & 0x10)
+ if (device->machine().root_device().ioport("IN0")->read() & 0x10)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -278,7 +278,7 @@ WRITE8_MEMBER(bzone_state::bzone_coin_counter_w)
static READ8_DEVICE_HANDLER( redbaron_joy_r )
{
bzone_state *state = device->machine().driver_data<bzone_state>();
- return input_port_read(device->machine(), state->m_rb_input_select ? "FAKE1" : "FAKE2");
+ return state->ioport(state->m_rb_input_select ? "FAKE1" : "FAKE2")->read();
}
static WRITE8_DEVICE_HANDLER( redbaron_joysound_w )
@@ -789,7 +789,7 @@ WRITE8_MEMBER(bzone_state::analog_select_w)
static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
if (offset <= 2)
- m_analog_data = input_port_read(machine(), analog_port[offset]);
+ m_analog_data = ioport(analog_port[offset])->read();
}
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 0d0b750bee1..5dec9211884 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -84,7 +84,7 @@ WRITE16_MEMBER(cabal_state::track_reset_w)
static const char *const track_names[] = { "IN0", "IN1", "IN2", "IN3" };
for (i = 0; i < 4; i++)
- m_last[i] = input_port_read(machine(), track_names[i]);
+ m_last[i] = ioport(track_names[i])->read();
}
READ16_MEMBER(cabal_state::track_r)
@@ -93,10 +93,10 @@ READ16_MEMBER(cabal_state::track_r)
switch (offset)
{
default:
- case 0: return (( input_port_read(machine(), "IN0") - m_last[0]) & 0x00ff) | (((input_port_read(machine(), "IN2") - m_last[2]) & 0x00ff) << 8); /* X lo */
- case 1: return (((input_port_read(machine(), "IN0") - m_last[0]) & 0xff00) >> 8) | (( input_port_read(machine(), "IN2") - m_last[2]) & 0xff00); /* X hi */
- case 2: return (( input_port_read(machine(), "IN1") - m_last[1]) & 0x00ff) | (((input_port_read(machine(), "IN3") - m_last[3]) & 0x00ff) << 8); /* Y lo */
- case 3: return (((input_port_read(machine(), "IN1") - m_last[1]) & 0xff00) >> 8) | (( input_port_read(machine(), "IN3") - m_last[3]) & 0xff00); /* Y hi */
+ case 0: return (( ioport("IN0")->read() - m_last[0]) & 0x00ff) | (((ioport("IN2")->read() - m_last[2]) & 0x00ff) << 8); /* X lo */
+ case 1: return (((ioport("IN0")->read() - m_last[0]) & 0xff00) >> 8) | (( ioport("IN2")->read() - m_last[2]) & 0xff00); /* X hi */
+ case 2: return (( ioport("IN1")->read() - m_last[1]) & 0x00ff) | (((ioport("IN3")->read() - m_last[3]) & 0x00ff) << 8); /* Y lo */
+ case 3: return (((ioport("IN1")->read() - m_last[1]) & 0xff00) >> 8) | (( ioport("IN3")->read() - m_last[3]) & 0xff00); /* Y hi */
}
}
@@ -246,7 +246,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( common )
PORT_START("DSW")
- PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x00)
+ PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x000a, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x000b, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x000c, DEF_STR( 4C_1C ) )
@@ -263,12 +263,12 @@ static INPUT_PORTS_START( common )
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0005, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A )) PORT_DIPLOCATION("SW1:1,2") PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x00)
+ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A )) PORT_DIPLOCATION("SW1:1,2") PORT_CONDITION("DSW", 0x0010, EQUALS, 0x00)
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0001, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0002, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B )) PORT_DIPLOCATION("SW1:3,4") PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x00)
+ PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B )) PORT_DIPLOCATION("SW1:3,4") PORT_CONDITION("DSW", 0x0010, EQUALS, 0x00)
PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 1C_5C ) )
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 2e72d3aa052..285d54b9cac 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -493,28 +493,28 @@ WRITE32_MEMBER(calchase_state::bios_ram_w)
READ16_MEMBER(calchase_state::calchase_iocard1_r)
{
- return input_port_read(machine(), "IOCARD1");
+ return ioport("IOCARD1")->read();
}
READ16_MEMBER(calchase_state::calchase_iocard2_r)
{
- return input_port_read(machine(), "IOCARD2");
+ return ioport("IOCARD2")->read();
}
READ16_MEMBER(calchase_state::calchase_iocard3_r)
{
- return input_port_read(machine(), "IOCARD3");
+ return ioport("IOCARD3")->read();
}
/* These two controls wheel pot or whatever this game uses ... */
READ16_MEMBER(calchase_state::calchase_iocard4_r)
{
- return input_port_read(machine(), "IOCARD4");
+ return ioport("IOCARD4")->read();
}
READ16_MEMBER(calchase_state::calchase_iocard5_r)
{
- return input_port_read(machine(), "IOCARD5");
+ return ioport("IOCARD5")->read();
}
@@ -677,7 +677,7 @@ static INPUT_PORTS_START( calchase )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // returns back to MS-DOS (likely to be unmapped and actually used as a lame protection check)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IOCARD3")
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xdfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IOCARD4")
diff --git a/src/mame/drivers/calomega.c b/src/mame/drivers/calomega.c
index 4b6f066d915..882b813883a 100644
--- a/src/mame/drivers/calomega.c
+++ b/src/mame/drivers/calomega.c
@@ -660,7 +660,7 @@
static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
{
int trx_clk;
- UINT8 dsw2 = input_port_read(device->machine(), "SW2");
+ UINT8 dsw2 = device->machine().root_device().ioport("SW2")->read();
trx_clk = UART_CLOCK * dsw2 / 128;
acia6850_device *acia = downcast<acia6850_device *>(device);
acia->set_rx_clock(trx_clk);
@@ -673,13 +673,13 @@ static READ8_DEVICE_HANDLER( s903_mux_port_r )
calomega_state *state = device->machine().driver_data<calomega_state>();
switch( state->m_s903_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine(), "IN0-0");
- case 0x20: return input_port_read(device->machine(), "IN0-1");
- case 0x40: return input_port_read(device->machine(), "IN0-2");
- case 0x80: return input_port_read(device->machine(), "IN0-3");
+ case 0x10: return state->ioport("IN0-0")->read();
+ case 0x20: return state->ioport("IN0-1")->read();
+ case 0x40: return state->ioport("IN0-2")->read();
+ case 0x80: return state->ioport("IN0-3")->read();
}
- return input_port_read(device->machine(), "FRQ"); /* bit7 used for 50/60 Hz selector */
+ return device->machine().root_device().ioport("FRQ")->read(); /* bit7 used for 50/60 Hz selector */
}
static WRITE8_DEVICE_HANDLER( s903_mux_w )
@@ -695,13 +695,13 @@ static READ8_DEVICE_HANDLER( s905_mux_port_r )
calomega_state *state = device->machine().driver_data<calomega_state>();
switch( state->m_s905_mux_data & 0x0f ) /* bits 0-3 */
{
- case 0x01: return input_port_read(device->machine(), "IN0-0");
- case 0x02: return input_port_read(device->machine(), "IN0-1");
- case 0x04: return input_port_read(device->machine(), "IN0-2");
- case 0x08: return input_port_read(device->machine(), "IN0-3");
+ case 0x01: return state->ioport("IN0-0")->read();
+ case 0x02: return state->ioport("IN0-1")->read();
+ case 0x04: return state->ioport("IN0-2")->read();
+ case 0x08: return state->ioport("IN0-3")->read();
}
- return input_port_read(device->machine(), "FRQ"); /* bit6 used for 50/60 Hz selector */
+ return device->machine().root_device().ioport("FRQ")->read(); /* bit6 used for 50/60 Hz selector */
}
static WRITE8_DEVICE_HANDLER( s905_mux_w )
@@ -717,7 +717,7 @@ static READ8_DEVICE_HANDLER( pia0_ain_r )
{
/* Valid input port. Each polled value is stored at $0538 */
logerror("PIA0: Port A in\n");
- return input_port_read(device->machine(), "IN0");
+ return device->machine().root_device().ioport("IN0")->read();
}
static READ8_DEVICE_HANDLER( pia0_bin_r )
diff --git a/src/mame/drivers/canyon.c b/src/mame/drivers/canyon.c
index 6cd18f3aec6..1f7efac5632 100644
--- a/src/mame/drivers/canyon.c
+++ b/src/mame/drivers/canyon.c
@@ -67,10 +67,10 @@ READ8_MEMBER(canyon_state::canyon_switches_r)
{
UINT8 val = 0;
- if ((input_port_read(machine(), "IN2") >> (offset & 7)) & 1)
+ if ((ioport("IN2")->read() >> (offset & 7)) & 1)
val |= 0x80;
- if ((input_port_read(machine(), "IN1") >> (offset & 3)) & 1)
+ if ((ioport("IN1")->read() >> (offset & 3)) & 1)
val |= 0x01;
return val;
@@ -79,7 +79,7 @@ READ8_MEMBER(canyon_state::canyon_switches_r)
READ8_MEMBER(canyon_state::canyon_options_r)
{
- return (input_port_read(machine(), "DSW") >> (2 * (~offset & 3))) & 3;
+ return (ioport("DSW")->read() >> (2 * (~offset & 3))) & 3;
}
@@ -160,7 +160,7 @@ static INPUT_PORTS_START( canyon )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Hiscore Reset") PORT_CODE(KEYCODE_H)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_TILT ) /* SLAM */
diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c
index 3a33186adc2..87ac1abcb3a 100644
--- a/src/mame/drivers/capbowl.c
+++ b/src/mame/drivers/capbowl.c
@@ -107,7 +107,7 @@
static INTERRUPT_GEN( capbowl_interrupt )
{
- if (input_port_read(device->machine(), "SERVICE") & 1) /* get status of the F2 key */
+ if (device->machine().root_device().ioport("SERVICE")->read() & 1) /* get status of the F2 key */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */
}
@@ -152,13 +152,13 @@ WRITE8_MEMBER(capbowl_state::capbowl_rom_select_w)
READ8_MEMBER(capbowl_state::track_0_r)
{
- return (input_port_read(machine(), "IN0") & 0xf0) | ((input_port_read(machine(), "TRACKY") - m_last_trackball_val[0]) & 0x0f);
+ return (ioport("IN0")->read() & 0xf0) | ((ioport("TRACKY")->read() - m_last_trackball_val[0]) & 0x0f);
}
READ8_MEMBER(capbowl_state::track_1_r)
{
- return (input_port_read(machine(), "IN1") & 0xf0) | ((input_port_read(machine(), "TRACKX") - m_last_trackball_val[1]) & 0x0f);
+ return (ioport("IN1")->read() & 0xf0) | ((ioport("TRACKX")->read() - m_last_trackball_val[1]) & 0x0f);
}
@@ -166,8 +166,8 @@ WRITE8_MEMBER(capbowl_state::track_reset_w)
{
/* reset the trackball counters */
- m_last_trackball_val[0] = input_port_read(machine(), "TRACKY");
- m_last_trackball_val[1] = input_port_read(machine(), "TRACKX");
+ m_last_trackball_val[0] = ioport("TRACKY")->read();
+ m_last_trackball_val[1] = ioport("TRACKX")->read();
watchdog_reset_w(space, offset, data);
}
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 54dc33087d9..6fe83ed495d 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -859,7 +859,7 @@ ADDRESS_MAP_END
READ16_MEMBER(cave_state::sailormn_input0_r)
{
// watchdog_reset16_r(0, 0); // written too rarely for mame.
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16, cave_state )
@@ -1361,14 +1361,14 @@ static INPUT_PORTS_START( gaia )
PORT_DIPSETTING( 0x0200, "4" )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0xc000)
- PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0xa000)
- PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0xe000)
- PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x6000)
- PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x8000)
- PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x2000)
- PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x4000)
- PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xc000)
+ PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xa000)
+ PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0xe000)
+ PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x6000)
+ PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x8000)
+ PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x2000)
+ PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x4000)
+ PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xe000, EQUALS, 0x0000)
PORT_DIPNAME( 0x1800, 0x1800, "Damage" ) PORT_DIPLOCATION("SW2:4,5")
PORT_DIPSETTING( 0x1800, "+0" )
PORT_DIPSETTING( 0x1000, "+1" )
@@ -1394,10 +1394,10 @@ static INPUT_PORTS_START( theroes )
PORT_DIPSETTING( 0x0004, DEF_STR( Chinese ) )
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x8000)
- PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0xc000)
- PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x4000)
- PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0400, "150k/300k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
+ PORT_DIPSETTING( 0x0400, "150k/350k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
+ PORT_DIPSETTING( 0x0400, "150k/400k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
+ PORT_DIPSETTING( 0x0400, "200k/500k" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x0000)
PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW2:6" )
PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x8000, DEF_STR( Very_Easy ) )
@@ -4544,7 +4544,7 @@ static DRIVER_INIT( guwange )
static DRIVER_INIT( hotdogst )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
init_cave(machine);
@@ -4563,10 +4563,10 @@ static DRIVER_INIT( hotdogst )
static DRIVER_INIT( mazinger )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine.root_device().memregion("sprites")->base();
- int len = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *src = state->memregion("sprites")->base();
+ int len = state->memregion("sprites")->bytes();
init_cave(machine);
@@ -4600,14 +4600,14 @@ static DRIVER_INIT( mazinger )
static DRIVER_INIT( metmqstr )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
init_cave(machine);
state->membank("bank1")->configure_entries(0, 0x2, &ROM[0x00000], 0x4000);
state->membank("bank1")->configure_entries(2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine.root_device().memregion("oki1")->base();
+ ROM = state->memregion("oki1")->base();
state->membank("bank3")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
state->membank("bank4")->configure_entries(0, 8, &ROM[0x00000], 0x20000);
@@ -4625,9 +4625,9 @@ static DRIVER_INIT( metmqstr )
static DRIVER_INIT( pwrinst2j )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine.root_device().memregion("sprites")->base();
+ UINT8 *src = state->memregion("sprites")->base();
int len = state->memregion("sprites")->bytes();
int i, j;
@@ -4674,17 +4674,17 @@ static DRIVER_INIT( pwrinst2 )
static DRIVER_INIT( sailormn )
{
cave_state *state = machine.driver_data<cave_state>();
- UINT8 *ROM = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *ROM = state->memregion("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine.root_device().memregion("sprites")->base();
- int len = machine.root_device().memregion("sprites")->bytes();
+ UINT8 *src = state->memregion("sprites")->base();
+ int len = state->memregion("sprites")->bytes();
init_cave(machine);
state->membank("bank1")->configure_entries(0, 0x02, &ROM[0x00000], 0x4000);
state->membank("bank1")->configure_entries(2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine.root_device().memregion("oki1")->base();
+ ROM = state->memregion("oki1")->base();
state->membank("bank3")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
state->membank("bank4")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000);
diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c
index 73bc0459c38..b9980832767 100644
--- a/src/mame/drivers/cb2001.c
+++ b/src/mame/drivers/cb2001.c
@@ -656,28 +656,28 @@ static INPUT_PORTS_START( cb2001 )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c
index 099d55eb2ca..c07b174bc93 100644
--- a/src/mame/drivers/cbasebal.c
+++ b/src/mame/drivers/cbasebal.c
@@ -168,7 +168,7 @@ static INPUT_PORTS_START( cbasebal )
PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) /* ? */
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* ? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_START( "IO_01" )
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index 5a598462ca1..d3b01190171 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -84,17 +84,17 @@ READ16_MEMBER(cbuster_state::twocrude_control_r)
switch (offset << 1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(machine(), "P1_P2");
+ return ioport("P1_P2")->read();
case 2: /* Dip Switches */
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 4: /* Protection */
logerror("%04x : protection control read at 30c000 %d\n", cpu_get_pc(&space.device()), offset);
return m_prot;
case 6: /* Credits, VBL in byte 7 */
- return input_port_read(machine(), "COINS");
+ return ioport("COINS")->read();
}
return ~0;
@@ -164,7 +164,7 @@ static INPUT_PORTS_START( twocrude )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c
index d20cb36bea5..625bf884bf8 100644
--- a/src/mame/drivers/ccastles.c
+++ b/src/mame/drivers/ccastles.c
@@ -191,7 +191,7 @@ static MACHINE_START( ccastles )
rectangle visarea;
/* initialize globals */
- state->m_syncprom = machine.root_device().memregion("proms")->base() + 0x000;
+ state->m_syncprom = state->memregion("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->m_vblank_start = 0; state->m_vblank_start < 256; state->m_vblank_start++)
@@ -273,7 +273,7 @@ READ8_MEMBER(ccastles_state::leta_r)
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
- return input_port_read(machine(), letanames[offset]);
+ return ioport(letanames[offset])->read();
}
diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c
index c77239d8719..48a232881db 100644
--- a/src/mame/drivers/cchance.c
+++ b/src/mame/drivers/cchance.c
@@ -65,7 +65,7 @@ WRITE8_MEMBER(cchance_state::output_0_w)
READ8_MEMBER(cchance_state::input_1_r)
{
- return (m_hop_io) | (m_bell_io) | (input_port_read(machine(), "SP") & 0xff);
+ return (m_hop_io) | (m_bell_io) | (ioport("SP")->read() & 0xff);
}
WRITE8_MEMBER(cchance_state::output_1_w)
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index c9e422b2498..f6ef8eed6c7 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -223,7 +223,7 @@ static UINT16 handle_joystick_potgor(running_machine &machine, UINT16 potgor)
/* shift at 1 == return one, >1 = return button states */
if (state->m_cd32_shifter[i] == 0)
potgor &= ~p9dat; /* shift at zero == return zero */
- if (state->m_cd32_shifter[i] >= 2 && (input_port_read(machine, player_portname[i]) & (1 << (state->m_cd32_shifter[i] - 2))))
+ if (state->m_cd32_shifter[i] >= 2 && (state->ioport(player_portname[i])->read() & (1 << (state->m_cd32_shifter[i] - 2))))
potgor &= ~p9dat;
}
return potgor;
diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c
index 0606bb18a32..16674c3bfc8 100644
--- a/src/mame/drivers/cdi.c
+++ b/src/mame/drivers/cdi.c
@@ -87,35 +87,35 @@ INPUT_CHANGED_MEMBER(cdi_state::mcu_input)
switch((FPTR)param)
{
case 0x39:
- if(input_port_read(machine(), "INPUT1") & 0x01) send = true;
+ if(ioport("INPUT1")->read() & 0x01) send = true;
break;
case 0x37:
- if(input_port_read(machine(), "INPUT1") & 0x02) send = true;
+ if(ioport("INPUT1")->read() & 0x02) send = true;
break;
case 0x31:
- if(input_port_read(machine(), "INPUT1") & 0x04) send = true;
+ if(ioport("INPUT1")->read() & 0x04) send = true;
break;
case 0x32:
- if(input_port_read(machine(), "INPUT1") & 0x08) send = true;
+ if(ioport("INPUT1")->read() & 0x08) send = true;
break;
case 0x33:
- if(input_port_read(machine(), "INPUT1") & 0x10) send = true;
+ if(ioport("INPUT1")->read() & 0x10) send = true;
break;
case 0x30:
- if(input_port_read(machine(), "INPUT2") & 0x01) send = true;
+ if(ioport("INPUT2")->read() & 0x01) send = true;
break;
case 0x38:
- if(input_port_read(machine(), "INPUT2") & 0x02) send = true;
+ if(ioport("INPUT2")->read() & 0x02) send = true;
break;
case 0x34:
- if(input_port_read(machine(), "INPUT2") & 0x04) send = true;
+ if(ioport("INPUT2")->read() & 0x04) send = true;
break;
case 0x35:
- if(input_port_read(machine(), "INPUT2") & 0x08) send = true;
+ if(ioport("INPUT2")->read() & 0x08) send = true;
break;
case 0x36:
- if(input_port_read(machine(), "INPUT2") & 0x10) send = true;
+ if(ioport("INPUT2")->read() & 0x10) send = true;
break;
}
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 8eb5cbb67c1..8cbac5cd484 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -528,10 +528,10 @@ INLINE int read_trackball(running_machine &machine, int idx, int switch_port)
/* if we're to read the dipswitches behind the trackball data, do it now */
if (state->m_dsw_select)
- return (input_port_read(machine, portnames[switch_port]) & 0x7f) | state->m_sign[idx];
+ return (machine.root_device().ioport(portnames[switch_port])->read() & 0x7f) | state->m_sign[idx];
/* get the new position and adjust the result */
- newpos = input_port_read(machine, tracknames[idx]);
+ newpos = machine.root_device().ioport(tracknames[idx])->read();
if (newpos != state->m_oldpos[idx])
{
state->m_sign[idx] = (newpos - state->m_oldpos[idx]) & 0x80;
@@ -539,7 +539,7 @@ INLINE int read_trackball(running_machine &machine, int idx, int switch_port)
}
/* blend with the bits from the switch port */
- return (input_port_read(machine, portnames[switch_port]) & 0x70) | (state->m_oldpos[idx] & 0x0f) | state->m_sign[idx];
+ return (machine.root_device().ioport(portnames[switch_port])->read() & 0x70) | (state->m_oldpos[idx] & 0x0f) | state->m_sign[idx];
}
@@ -562,7 +562,7 @@ READ8_MEMBER(centiped_state::milliped_IN1_r)
READ8_MEMBER(centiped_state::milliped_IN2_r)
{
- UINT8 data = input_port_read(machine(), "IN2");
+ UINT8 data = ioport("IN2")->read();
/* MSH - 15 Feb, 2007
* The P2 X Joystick inputs are not properly handled in
@@ -573,7 +573,7 @@ READ8_MEMBER(centiped_state::milliped_IN2_r)
*/
if (0 != m_control_select) {
/* Bottom 4 bits is our joystick inputs */
- UINT8 joy2data = input_port_read(machine(), "IN3") & 0x0f;
+ UINT8 joy2data = ioport("IN3")->read() & 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 */
@@ -599,7 +599,7 @@ READ8_MEMBER(centiped_state::mazeinv_input_r)
{
static const char *const sticknames[] = { "STICK0", "STICK1", "STICK2", "STICK3" };
- return input_port_read(machine(), sticknames[m_control_select]);
+ return ioport(sticknames[m_control_select])->read();
}
@@ -879,7 +879,7 @@ static INPUT_PORTS_START( centiped )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) )
PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* trackball sign bit */
PORT_START("IN1")
@@ -1115,7 +1115,7 @@ static INPUT_PORTS_START( milliped )
PORT_DIPSETTING( 0x0c, "0 1x 2x 3x" )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* trackball sign bit */
PORT_START("IN1") /* $2001 */ /* see port 7 for y trackball */
@@ -1224,7 +1224,7 @@ static INPUT_PORTS_START( warlords )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x80, "Upright (overlay)" )
PORT_DIPSETTING( 0x00, "Cocktail (no overlay)" )
@@ -1307,7 +1307,7 @@ static INPUT_PORTS_START( mazeinv )
PORT_DIPNAME( 0x40, 0x00, "Minimum credits" ) PORT_DIPLOCATION("SW0:!7")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x40, "2" )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1396,7 +1396,7 @@ static INPUT_PORTS_START( bullsdrt )
PORT_START("IN0")
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* trackball data */
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* trackball sign bit */
PORT_START("IN1")
diff --git a/src/mame/drivers/cesclass.c b/src/mame/drivers/cesclass.c
index be17c054950..a689fd77eb4 100644
--- a/src/mame/drivers/cesclass.c
+++ b/src/mame/drivers/cesclass.c
@@ -229,7 +229,7 @@ static INPUT_PORTS_START( cesclassic )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_START("VBLANK")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static PALETTE_INIT( cesclassic )
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 66d95f2e626..e2278fe2887 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -173,8 +173,8 @@ WRITE8_MEMBER(cham24_state::cham24_IN0_w)
m_in_0_shift = 0;
m_in_1_shift = 0;
- m_in_0 = input_port_read(machine(), "P1");
- m_in_1 = input_port_read(machine(), "P2");
+ m_in_0 = ioport("P1")->read();
+ m_in_1 = ioport("P2")->read();
}
@@ -304,8 +304,8 @@ static MACHINE_START( cham24 )
{
cham24_state *state = machine.driver_data<cham24_state>();
/* switch PRG rom */
- UINT8* dst = machine.root_device().memregion("maincpu")->base();
- UINT8* src = machine.root_device().memregion("user1")->base();
+ UINT8* dst = state->memregion("maincpu")->base();
+ UINT8* src = state->memregion("user1")->base();
memcpy(&dst[0x8000], &src[0x0f8000], 0x4000);
memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index eefecc0d0ed..bf41a43e322 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -175,8 +175,8 @@ public:
READ8_MEMBER(champbwl_state::trackball_r)
{
UINT8 ret;
- UINT8 port4 = input_port_read(machine(), "FAKEX");
- UINT8 port5 = input_port_read(machine(), "FAKEY");
+ UINT8 port4 = ioport("FAKEX")->read();
+ UINT8 port5 = ioport("FAKEY")->read();
ret = (((port4 - m_last_trackball_val[0]) & 0x0f)<<4) | ((port5 - m_last_trackball_val[1]) & 0x0f);
diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c
index aa920ee5a86..d5e68bb2950 100644
--- a/src/mame/drivers/chanbara.c
+++ b/src/mame/drivers/chanbara.c
@@ -265,7 +265,7 @@ static INPUT_PORTS_START( chanbara )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* same coinage as COIN1 */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START ("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN )
diff --git a/src/mame/drivers/chance32.c b/src/mame/drivers/chance32.c
index dded4796e58..d0a26e8dde3 100644
--- a/src/mame/drivers/chance32.c
+++ b/src/mame/drivers/chance32.c
@@ -132,7 +132,7 @@ READ8_MEMBER(chance32_state::mux_r)
for(i=0;i<4;i++)
{
if(mux_data & 1 << i)
- res |= input_port_read(machine(),muxnames[i]);
+ res |= ioport(muxnames[i])->read();
}
return res;
diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c
index a94f193f729..ad225c29048 100644
--- a/src/mame/drivers/changela.c
+++ b/src/mame/drivers/changela.c
@@ -52,7 +52,7 @@ WRITE8_MEMBER(changela_state::changela_68705_ddr_a_w)
READ8_MEMBER(changela_state::changela_68705_port_b_r)
{
- return (m_port_b_out & m_ddr_b) | (input_port_read(machine(), "MCU") & ~m_ddr_b);
+ return (m_port_b_out & m_ddr_b) | (ioport("MCU")->read() & ~m_ddr_b);
}
WRITE8_MEMBER(changela_state::changela_68705_port_b_w)
@@ -122,7 +122,7 @@ READ8_MEMBER(changela_state::changela_25_r)
READ8_MEMBER(changela_state::changela_30_r)
{
- return input_port_read(machine(), "WHEEL") & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
+ return ioport("WHEEL")->read() & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
}
READ8_MEMBER(changela_state::changela_31_r)
@@ -130,7 +130,7 @@ READ8_MEMBER(changela_state::changela_31_r)
/* If the new value is less than the old value, and it did not wrap around,
or if the new value is greater than the old value, and it did wrap around,
then we are moving LEFT. */
- UINT8 curr_value = input_port_read(machine(), "WHEEL");
+ UINT8 curr_value = ioport("WHEEL")->read();
if ((curr_value < m_prev_value_31 && (m_prev_value_31 - curr_value) < 0x80)
|| (curr_value > m_prev_value_31 && (curr_value - m_prev_value_31) > 0x80))
@@ -147,7 +147,7 @@ READ8_MEMBER(changela_state::changela_31_r)
READ8_MEMBER(changela_state::changela_2c_r)
{
- int val = input_port_read(machine(), "IN0");
+ int val = ioport("IN0")->read();
val = (val & 0x30) | ((val & 1) << 7) | (((val & 1) ^ 1) << 6);
@@ -164,7 +164,7 @@ READ8_MEMBER(changela_state::changela_2d_r)
v8 = 1;
/* Gas pedal is made up of 2 switches, 1 active low, 1 active high */
- switch (input_port_read(machine(), "IN1") & 0x03)
+ switch (ioport("IN1")->read() & 0x03)
{
case 0x02:
gas = 0x80;
@@ -177,7 +177,7 @@ READ8_MEMBER(changela_state::changela_2d_r)
break;
}
- return (input_port_read(machine(), "IN1") & 0x20) | gas | (v8 << 4);
+ return (ioport("IN1")->read() & 0x20) | gas | (v8 << 4);
}
WRITE8_MEMBER(changela_state::mcu_pc_0_w)
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 7a25c6a2a19..3b7fc5308ff 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -387,7 +387,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( chinagat )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
@@ -912,7 +912,7 @@ ROM_END
static DRIVER_INIT( chinagat )
{
ddragon_state *state = machine.driver_data<ddragon_state>();
- UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *MAIN = state->memregion("maincpu")->base();
UINT8 *SUB = state->memregion("sub")->base();
state->m_technos_video_hw = 1;
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index bd4e43e88e3..d58292c5dd2 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -173,22 +173,22 @@ READ8_MEMBER(chinsan_state::chinsan_input_port_0_r)
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return input_port_read(machine(), "MAHJONG_P2_1");
+ return ioport("MAHJONG_P2_1")->read();
case 0x53:
- return input_port_read(machine(), "MAHJONG_P2_2");
+ return ioport("MAHJONG_P2_2")->read();
case 0x57:
- return input_port_read(machine(), "MAHJONG_P2_3");
+ return ioport("MAHJONG_P2_3")->read();
case 0x5b:
- return input_port_read(machine(), "MAHJONG_P2_4");
+ return ioport("MAHJONG_P2_4")->read();
case 0x5d:
- return input_port_read(machine(), "MAHJONG_P2_5");
+ return ioport("MAHJONG_P2_5")->read();
case 0x5e:
- return input_port_read(machine(), "MAHJONG_P2_6");
+ return ioport("MAHJONG_P2_6")->read();
}
printf("chinsan_input_port_0_r unk_r %02x\n", m_port_select);
@@ -203,22 +203,22 @@ READ8_MEMBER(chinsan_state::chinsan_input_port_1_r)
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return input_port_read(machine(), "MAHJONG_P1_1");
+ return ioport("MAHJONG_P1_1")->read();
case 0x53:
- return input_port_read(machine(), "MAHJONG_P1_2");
+ return ioport("MAHJONG_P1_2")->read();
case 0x57:
- return input_port_read(machine(), "MAHJONG_P1_3");
+ return ioport("MAHJONG_P1_3")->read();
case 0x5b:
- return input_port_read(machine(), "MAHJONG_P1_4");
+ return ioport("MAHJONG_P1_4")->read();
case 0x5d:
- return input_port_read(machine(), "MAHJONG_P1_5");
+ return ioport("MAHJONG_P1_5")->read();
case 0x5e:
- return input_port_read(machine(), "MAHJONG_P1_6");
+ return ioport("MAHJONG_P1_6")->read();
}
printf("chinsan_input_port_1_r unk_r %02x\n", m_port_select);
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index 1d62ab94608..84e4f04c4ff 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -120,8 +120,8 @@ READ8_MEMBER(chqflag_state::analog_read_r)
{
switch (m_analog_ctrl & 0x03)
{
- case 0x00: return (m_accel = input_port_read(machine(), "IN3")); /* accelerator */
- case 0x01: return (m_wheel = input_port_read(machine(), "IN4")); /* steering */
+ case 0x00: return (m_accel = ioport("IN3")->read()); /* accelerator */
+ case 0x01: return (m_wheel = ioport("IN4")->read()); /* steering */
case 0x02: return m_accel; /* accelerator (previous?) */
case 0x03: return m_wheel; /* steering (previous?) */
}
diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c
index ffe9c6c0579..51d9e304ba5 100644
--- a/src/mame/drivers/cinemat.c
+++ b/src/mame/drivers/cinemat.c
@@ -79,14 +79,14 @@ MACHINE_RESET( cinemat )
READ8_MEMBER(cinemat_state::inputs_r)
{
- return (input_port_read(machine(), "INPUTS") >> offset) & 1;
+ return (ioport("INPUTS")->read() >> offset) & 1;
}
READ8_MEMBER(cinemat_state::switches_r)
{
static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 };
- return (input_port_read(machine(), "SWITCHES") >> switch_shuffle[offset]) & 1;
+ return (ioport("SWITCHES")->read() >> switch_shuffle[offset]) & 1;
}
@@ -149,7 +149,7 @@ static UINT8 joystick_read(device_t *device)
else
{
int xval = (INT16)(cpu_get_reg(device, CCPU_X) << 4) >> 4;
- return (input_port_read_safe(device->machine(), state->m_mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800;
+ return (state->ioport(state->m_mux_select ? "ANALOGX" : "ANALOGY")->read_safe(0) - xval) < 0x800;
}
}
@@ -167,7 +167,7 @@ READ8_MEMBER(cinemat_state::speedfrk_wheel_r)
int delta_wheel;
/* the shift register is cleared once per 'frame' */
- delta_wheel = (INT8)input_port_read(machine(), "WHEEL") / 8;
+ delta_wheel = (INT8)ioport("WHEEL")->read() / 8;
if (delta_wheel > 3)
delta_wheel = 3;
else if (delta_wheel < -3)
@@ -179,14 +179,14 @@ READ8_MEMBER(cinemat_state::speedfrk_wheel_r)
READ8_MEMBER(cinemat_state::speedfrk_gear_r)
{
- int gearval = input_port_read(machine(), "GEAR");
+ int gearval = ioport("GEAR")->read();
/* check the fake gear input port and determine the bit settings for the gear */
if ((gearval & 0x0f) != 0x0f)
m_gear = gearval & 0x0f;
/* add the start key into the mix -- note that it overlaps 4th gear */
- if (!(input_port_read(machine(), "INPUTS") & 0x80))
+ if (!(ioport("INPUTS")->read() & 0x80))
m_gear &= ~0x08;
return (m_gear >> offset) & 1;
@@ -232,9 +232,9 @@ READ8_MEMBER(cinemat_state::sundance_inputs_r)
{
/* handle special keys first */
if (sundance_port_map[offset].portname)
- return (input_port_read(machine(), sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
+ return (ioport(sundance_port_map[offset].portname)->read() & sundance_port_map[offset].bitmask) ? 0 : 1;
else
- return (input_port_read(machine(), "INPUTS") >> offset) & 1;
+ return (ioport("INPUTS")->read() >> offset) & 1;
}
@@ -247,7 +247,7 @@ READ8_MEMBER(cinemat_state::sundance_inputs_r)
READ8_MEMBER(cinemat_state::boxingb_dial_r)
{
- int value = input_port_read(machine(), "DIAL");
+ int value = ioport("DIAL")->read();
if (!m_mux_select) offset += 4;
return (value >> offset) & 1;
}
diff --git a/src/mame/drivers/circus.c b/src/mame/drivers/circus.c
index ee1381b1e65..632c8f4c47e 100644
--- a/src/mame/drivers/circus.c
+++ b/src/mame/drivers/circus.c
@@ -54,7 +54,7 @@ READ8_MEMBER(circus_state::circus_paddle_r)
{
// also clears irq
cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
- return input_port_read(machine(), "PADDLE");
+ return ioport("PADDLE")->read();
}
static ADDRESS_MAP_START( circus_map, AS_PROGRAM, 8, circus_state )
@@ -96,7 +96,7 @@ static INPUT_PORTS_START( circus )
PORT_DIPSETTING( 0x00, "Single Line" )
PORT_DIPSETTING( 0x20, "Super Bonus" )
PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "14A:1" ) /* Not mentioned in the manual */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("PADDLE")
PORT_BIT( 0xff, 115, IPT_PADDLE ) PORT_MINMAX(64,167) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
@@ -130,7 +130,7 @@ static INPUT_PORTS_START( robotbwl )
PORT_DIPSETTING( 0x20, "5 seconds" )
PORT_DIPSETTING( 0x40, "7 seconds" )
PORT_DIPSETTING( 0x60, "9 seconds" )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("PADDLE")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
@@ -164,7 +164,7 @@ static INPUT_PORTS_START( crash )
PORT_DIPSETTING( 0x10, "Credit Awarded" )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "14A:2" ) /* Not mentioned in the manual */
PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "14A:1" ) /* Not mentioned in the manual */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("PADDLE")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
@@ -204,7 +204,7 @@ static INPUT_PORTS_START( ripcord )
PORT_DIPSETTING( 0x00, "No Award" )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "14A:2" ) /* Not mentioned in the manual */
PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "14A:1" ) /* Not mentioned in the manual */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("PADDLE")
PORT_BIT( 0xff, 115, IPT_PADDLE ) PORT_MINMAX(64,167) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 96364eeff31..778184c75bd 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -429,7 +429,7 @@ WRITE16_MEMBER(cischeat_state::scudhamm_motor_command_w)
READ16_MEMBER(cischeat_state::scudhamm_analog_r)
{
- int i=input_port_read(machine(), "IN1"),j;
+ int i=ioport("IN1")->read(),j;
if ((i^m_prev)&0x4000) {
if (i<m_prev) m_prev-=0x8000;
@@ -527,17 +527,17 @@ READ16_MEMBER(cischeat_state::armchmp2_analog_r)
{
int armdelta;
- armdelta = input_port_read(machine(), "IN1") - m_armold;
- m_armold = input_port_read(machine(), "IN1");
+ armdelta = ioport("IN1")->read() - m_armold;
+ m_armold = ioport("IN1")->read();
return ~( m_scudhamm_motor_command + armdelta ); // + x : x<=0 and player loses, x>0 and player wins
}
READ16_MEMBER(cischeat_state::armchmp2_buttons_r)
{
- int arm_x = input_port_read(machine(), "IN1");
+ int arm_x = ioport("IN1")->read();
- UINT16 ret = input_port_read(machine(), "IN0");
+ UINT16 ret = ioport("IN0")->read();
if (arm_x < 0x40) ret &= ~1;
else if (arm_x > 0xc0) ret &= ~2;
@@ -844,12 +844,12 @@ static INPUT_PORTS_START( bigrun )
// DSW 3
PORT_DIPNAME( 0x0003, 0x0003, "Extra Setting For Coin B" ) PORT_DIPLOCATION("SW302:8,7") /* 'Not used' (and must be OFF) according to the manual */
PORT_DIPSETTING( 0x0003, DEF_STR( Unused ) )
- PORT_DIPSETTING( 0x0001, DEF_STR( 1C_5C ) ) PORT_CONDITION("IN4", 0x1c00, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x0002, DEF_STR( 1C_6C ) ) PORT_CONDITION("IN4", 0x1c00, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_7C ) ) PORT_CONDITION("IN4", 0x1c00, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x0001, DEF_STR( Unused ) ) PORT_CONDITION("IN4", 0x1c00, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0002, DEF_STR( Unused ) ) PORT_CONDITION("IN4", 0x1c00, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, DEF_STR( Unused ) ) PORT_CONDITION("IN4", 0x1c00, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0001, DEF_STR( 1C_5C ) ) PORT_CONDITION("IN4", 0x1c00, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0002, DEF_STR( 1C_6C ) ) PORT_CONDITION("IN4", 0x1c00, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_7C ) ) PORT_CONDITION("IN4", 0x1c00, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0001, DEF_STR( Unused ) ) PORT_CONDITION("IN4", 0x1c00, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0002, DEF_STR( Unused ) ) PORT_CONDITION("IN4", 0x1c00, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( Unused ) ) PORT_CONDITION("IN4", 0x1c00, EQUALS, 0x0000)
PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW302:6")
PORT_DIPSETTING( 0x0004, DEF_STR( No ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) )
@@ -875,7 +875,7 @@ static INPUT_PORTS_START( bigrun )
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW301:7")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
- PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, PORTCOND_EQUALS, 0x0003)
+ PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, EQUALS, 0x0003)
PORT_DIPSETTING( 0x1000, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0800, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x1800, DEF_STR( 2C_1C ) )
@@ -884,7 +884,7 @@ static INPUT_PORTS_START( bigrun )
PORT_DIPSETTING( 0x1400, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x1c00, 0x1c00, "Set Coin B" ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, PORTCOND_NOTEQUALS, 0x0003)
+ PORT_DIPNAME( 0x1c00, 0x1c00, "Set Coin B" ) PORT_DIPLOCATION("SW301:6,5,4") PORT_CONDITION("IN4", 0x0003, NOTEQUALS, 0x0003)
PORT_DIPSETTING( 0x1c00, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW301:3,2,1")
@@ -1051,7 +1051,7 @@ static INPUT_PORTS_START( f1gpstar )
PORT_START("IN1") // DSW 1 & 2 - $80000.w -> !f9012
// DSW 1
// Coinage Japan & USA (it changes with Country)
- PORT_DIPNAME( 0x0007, 0x0007, "Coin A (JP US)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, PORTCOND_GREATERTHAN, 0x0100)
+ PORT_DIPNAME( 0x0007, 0x0007, "Coin A (JP US)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, GREATERTHAN, 0x0100)
PORT_DIPSETTING( 0x0001, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0003, DEF_STR( 2C_1C ) )
@@ -1060,7 +1060,7 @@ static INPUT_PORTS_START( f1gpstar )
PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x0038, 0x0038, "Coin B (JP US)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, PORTCOND_GREATERTHAN, 0x0100)
+ PORT_DIPNAME( 0x0038, 0x0038, "Coin B (JP US)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, GREATERTHAN, 0x0100)
PORT_DIPSETTING( 0x0008, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) )
@@ -1068,11 +1068,11 @@ static INPUT_PORTS_START( f1gpstar )
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0028, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) )
- PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_GREATERTHAN, 0x0100) // unused?
+ PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, GREATERTHAN, 0x0100) // unused?
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
// Coinage Europe & France (it changes with Country)
- PORT_DIPNAME( 0x0007, 0x0007, "Coin A (EU FR)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTGREATERTHAN, 0x0100)
+ PORT_DIPNAME( 0x0007, 0x0007, "Coin A (EU FR)" ) PORT_DIPLOCATION("SW01:1,2,3") PORT_CONDITION("IN1", 0x0300, NOTGREATERTHAN, 0x0100)
PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) )
@@ -1081,7 +1081,7 @@ static INPUT_PORTS_START( f1gpstar )
PORT_DIPSETTING( 0x0003, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0002, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x0001, DEF_STR( 1C_7C ) )
- PORT_DIPNAME( 0x0038, 0x0038, "Coin B (EU FR)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTGREATERTHAN, 0x0100)
+ PORT_DIPNAME( 0x0038, 0x0038, "Coin B (EU FR)" ) PORT_DIPLOCATION("SW01:4,5,6") PORT_CONDITION("IN1", 0x0300, NOTGREATERTHAN, 0x0100)
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0008, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) )
@@ -1090,7 +1090,7 @@ static INPUT_PORTS_START( f1gpstar )
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0028, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) )
- PORT_DIPNAME( 0x0040, 0x0040, "Free Play (EU & FR)" ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTGREATERTHAN, 0x0100)
+ PORT_DIPNAME( 0x0040, 0x0040, "Free Play (EU & FR)" ) PORT_DIPLOCATION("SW01:7") PORT_CONDITION("IN1", 0x0300, NOTGREATERTHAN, 0x0100)
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -1113,10 +1113,10 @@ static INPUT_PORTS_START( f1gpstar )
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW02:6")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
- PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_EQUALS, 0x0300) // unused?
+ PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, EQUALS, 0x0300) // unused?
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x4000, 0x4000, "Choose Race (US EU FR)" ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, PORTCOND_NOTEQUALS, 0x0300) // -> f0020
+ PORT_DIPNAME( 0x4000, 0x4000, "Choose Race (US EU FR)" ) PORT_DIPLOCATION("SW02:7") PORT_CONDITION("IN1", 0x0300, NOTEQUALS, 0x0300) // -> f0020
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x4000, DEF_STR( On ) )
PORT_DIPNAME( 0x8000, 0x8000, "Vibrations" ) PORT_DIPLOCATION("SW02:8")
diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c
index 1558c9c7007..8c5e95ef4c9 100644
--- a/src/mame/drivers/citycon.c
+++ b/src/mame/drivers/citycon.c
@@ -16,7 +16,7 @@ Dip locations added from dip listing at crazykong.com
READ8_MEMBER(citycon_state::citycon_in_r)
{
- return input_port_read(machine(), flip_screen() ? "P2" : "P1");
+ return ioport(flip_screen() ? "P2" : "P1")->read();
}
READ8_MEMBER(citycon_state::citycon_irq_ack_r)
diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c
index 4574b8f51bf..82a868ae39f 100644
--- a/src/mame/drivers/clayshoo.c
+++ b/src/mame/drivers/clayshoo.c
@@ -54,7 +54,7 @@ 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 = input_port_read(machine, "FAKE");
+ UINT8 raw = machine.root_device().ioport("FAKE")->read();
if (raw & (1 << (bit + 1)))
ret = 0x03; /* expert */
@@ -74,11 +74,11 @@ static READ8_DEVICE_HANDLER( input_port_r )
switch (state->m_input_port_select)
{
- case 0x01: ret = input_port_read(device->machine(), "IN0"); break;
- case 0x02: ret = input_port_read(device->machine(), "IN1"); break;
- case 0x04: ret = (input_port_read(device->machine(), "IN2") & 0xf0) | difficulty_input_port_r(device->machine(), 0) |
+ case 0x01: ret = state->ioport("IN0")->read(); break;
+ case 0x02: ret = state->ioport("IN1")->read(); break;
+ case 0x04: ret = (state->ioport("IN2")->read() & 0xf0) | difficulty_input_port_r(device->machine(), 0) |
(difficulty_input_port_r(device->machine(), 3) << 2); break;
- case 0x08: ret = input_port_read(device->machine(), "IN3"); break;
+ case 0x08: ret = state->ioport("IN3")->read(); break;
case 0x10:
case 0x20: break; /* these two are not really used */
default: logerror("Unexpected port read: %02X\n", state->m_input_port_select);
@@ -118,8 +118,8 @@ WRITE8_MEMBER(clayshoo_state::analog_reset_w)
m_analog_port_val = 0xff;
- m_analog_timer_1->adjust(compute_duration(&space.device(), input_port_read(machine(), "AN1")), 0x02);
- m_analog_timer_2->adjust(compute_duration(&space.device(), input_port_read(machine(), "AN2")), 0x01);
+ m_analog_timer_1->adjust(compute_duration(&space.device(), ioport("AN1")->read()), 0x02);
+ m_analog_timer_2->adjust(compute_duration(&space.device(), ioport("AN2")->read()), 0x01);
}
diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c
index e488e1be9ea..6a93d9b3022 100644
--- a/src/mame/drivers/cliffhgr.c
+++ b/src/mame/drivers/cliffhgr.c
@@ -134,7 +134,7 @@ READ8_MEMBER(cliffhgr_state::cliff_port_r)
if (m_port_bank < 7)
- return input_port_read(machine(), banknames[m_port_bank]);
+ return ioport(banknames[m_port_bank])->read();
/* output is pulled up for non-mapped ports */
return 0xff;
@@ -555,8 +555,8 @@ static INPUT_PORTS_START( goaltogo )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, "Single Coin Continue" ) PORT_DIPLOCATION("E11:2")
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_CONDITION("BANK1",0x01,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_CONDITION("BANK1",0x01,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_CONDITION("BANK1",0x01,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_CONDITION("BANK1",0x01,EQUALS,0x00)
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("E11:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/cloak.c b/src/mame/drivers/cloak.c
index 702f1687ec5..cbf212c3cff 100644
--- a/src/mame/drivers/cloak.c
+++ b/src/mame/drivers/cloak.c
@@ -228,7 +228,7 @@ static INPUT_PORTS_START( cloak )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) // player 2 controls, not used
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c
index 1e67eb65964..4a929ff3a4e 100644
--- a/src/mame/drivers/cloud9.c
+++ b/src/mame/drivers/cloud9.c
@@ -230,7 +230,7 @@ WRITE8_MEMBER(cloud9_state::cloud9_coin_counter_w)
READ8_MEMBER(cloud9_state::leta_r)
{
- return input_port_read(machine(), offset ? "TRACKX" : "TRACKY");
+ return ioport(offset ? "TRACKX" : "TRACKY")->read();
}
diff --git a/src/mame/drivers/clshroad.c b/src/mame/drivers/clshroad.c
index bf9fdbd04bc..24f03ea0199 100644
--- a/src/mame/drivers/clshroad.c
+++ b/src/mame/drivers/clshroad.c
@@ -31,10 +31,10 @@ static MACHINE_RESET( clshroad )
READ8_MEMBER(clshroad_state::clshroad_input_r)
{
- return ((~input_port_read(machine(), "P1") & (1 << offset)) ? 1 : 0) |
- ((~input_port_read(machine(), "P2") & (1 << offset)) ? 2 : 0) |
- ((~input_port_read(machine(), "DSW1") & (1 << offset)) ? 4 : 0) |
- ((~input_port_read(machine(), "DSW2") & (1 << offset)) ? 8 : 0) ;
+ return ((~ioport("P1")->read() & (1 << offset)) ? 1 : 0) |
+ ((~ioport("P2")->read() & (1 << offset)) ? 2 : 0) |
+ ((~ioport("DSW1")->read() & (1 << offset)) ? 4 : 0) |
+ ((~ioport("DSW2")->read() & (1 << offset)) ? 8 : 0) ;
}
diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c
index 2a863a6c41f..5f51b42b9d1 100644
--- a/src/mame/drivers/cmmb.c
+++ b/src/mame/drivers/cmmb.c
@@ -125,10 +125,10 @@ READ8_MEMBER(cmmb_state::cmmb_input_r)
//printf("%02x R\n",offset);
switch(offset)
{
- case 0x00: return input_port_read(machine(), "IN2");
+ case 0x00: return ioport("IN2")->read();
case 0x03: return 4; //eeprom?
- case 0x0e: return input_port_read(machine(), "IN0");
- case 0x0f: return input_port_read(machine(), "IN1");
+ case 0x0e: return ioport("IN0")->read();
+ case 0x0f: return ioport("IN1")->read();
}
return 0xff;
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index 86a457ccaa7..7b11a5f2c2b 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -131,11 +131,11 @@ READ16_MEMBER(cninja_state::robocop2_prot_r)
switch (offset << 1)
{
case 0x41a: /* Player 1 & 2 input ports */
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x320: /* Coins */
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 0x4e6: /* Dip switches */
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(&space.device()), offset);
return 0x84;
@@ -386,7 +386,7 @@ static INPUT_PORTS_START( edrandy )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW")
DATAEAST_COINAGE
@@ -440,7 +440,7 @@ static INPUT_PORTS_START( cninja )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW") /* Dip switch bank 1 */
@@ -509,7 +509,7 @@ static INPUT_PORTS_START( robocop2 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW") /* Dip switch bank 1 */
@@ -577,7 +577,7 @@ static INPUT_PORTS_START( mutantf )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW") /* Dip switch bank 1 */
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index 33a92cc86a8..92a1e53d2ed 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -501,7 +501,7 @@ WRITE8_MEMBER(cntsteer_state::cntsteer_main_irq_w)
READ8_MEMBER(cntsteer_state::cntsteer_adx_r)
{
UINT8 res = 0, adx_val;
- adx_val = input_port_read(machine(), "AN_STEERING");
+ adx_val = ioport("AN_STEERING")->read();
if (adx_val >= 0x70 && adx_val <= 0x90)
res = 0xff;
@@ -643,7 +643,7 @@ static INPUT_PORTS_START( zerotrgt )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
@@ -716,7 +716,7 @@ static INPUT_PORTS_START( cntsteer )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 2b19da054ab..ff4199ae0a0 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -158,7 +158,7 @@ READ8_MEMBER(combatsc_state::combatscb_io_r)
{
static const char *const portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
WRITE8_MEMBER(combatsc_state::combatscb_priority_w)
@@ -279,7 +279,7 @@ READ8_MEMBER(combatsc_state::trackball_r)
{
UINT8 curr;
- curr = input_port_read_safe(machine(), tracknames[i], 0xff);
+ curr = ioport(tracknames[i])->read_safe(0xff);
dir[i] = curr - m_pos[i];
m_sign[i] = dir[i] & 0x80;
@@ -690,7 +690,7 @@ static const ym2203_interface ym2203_bootleg_config =
static MACHINE_START( combatsc )
{
combatsc_state *state = machine.driver_data<combatsc_state>();
- UINT8 *MEM = machine.root_device().memregion("maincpu")->base() + 0x38000;
+ UINT8 *MEM = state->memregion("maincpu")->base() + 0x38000;
state->m_io_ram = MEM + 0x0000;
state->m_page[0] = MEM + 0x4000;
diff --git a/src/mame/drivers/compgolf.c b/src/mame/drivers/compgolf.c
index ac04bc490e4..2da4c355ac9 100644
--- a/src/mame/drivers/compgolf.c
+++ b/src/mame/drivers/compgolf.c
@@ -99,7 +99,7 @@ static INPUT_PORTS_START( compgolf )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 31d6183360b..2a6630580c8 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -406,10 +406,10 @@ READ16_MEMBER(coolpool_state::amerdart_trackball_r)
m_result = (m_lastresult | 0x00ff);
- m_newx[1] = input_port_read(machine(), "XAXIS1"); /* Trackball 1 Left - Right */
- m_newy[1] = input_port_read(machine(), "YAXIS1"); /* Trackball 1 Up - Down */
- m_newx[2] = input_port_read(machine(), "XAXIS2"); /* Trackball 2 Left - Right */
- m_newy[2] = input_port_read(machine(), "YAXIS2"); /* Trackball 2 Up - Down */
+ m_newx[1] = ioport("XAXIS1")->read(); /* Trackball 1 Left - Right */
+ m_newy[1] = ioport("YAXIS1")->read(); /* Trackball 1 Up - Down */
+ m_newx[2] = ioport("XAXIS2")->read(); /* Trackball 2 Left - Right */
+ m_newy[2] = ioport("YAXIS2")->read(); /* Trackball 2 Up - Down */
m_dx[1] = (INT8)(m_newx[1] - m_oldx[1]);
m_dy[1] = (INT8)(m_newy[1] - m_oldy[1]);
@@ -572,9 +572,9 @@ static WRITE16_DEVICE_HANDLER( dsp_dac_w )
READ16_MEMBER(coolpool_state::coolpool_input_r)
{
- m_result = (input_port_read(machine(), "IN1") & 0x00ff) | (m_lastresult & 0xff00);
- m_newx[1] = input_port_read(machine(), "XAXIS");
- m_newy[1] = input_port_read(machine(), "YAXIS");
+ m_result = (ioport("IN1")->read() & 0x00ff) | (m_lastresult & 0xff00);
+ m_newx[1] = ioport("XAXIS")->read();
+ m_newy[1] = ioport("YAXIS")->read();
m_dx[1] = (INT8)(m_newx[1] - m_oldx[1]);
m_dy[1] = (INT8)(m_newy[1] - m_oldy[1]);
diff --git a/src/mame/drivers/cop01.c b/src/mame/drivers/cop01.c
index bc6ec5a81bb..5e0b913c6a8 100644
--- a/src/mame/drivers/cop01.c
+++ b/src/mame/drivers/cop01.c
@@ -98,7 +98,7 @@ READ8_MEMBER(cop01_state::cop01_sound_command_r)
CUSTOM_INPUT_MEMBER(cop01_state::mightguy_area_r)
{
int bit_mask = (FPTR)param;
- return (input_port_read(machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
+ return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00;
}
WRITE8_MEMBER(cop01_state::cop01_irq_ack_w)
diff --git a/src/mame/drivers/copsnrob.c b/src/mame/drivers/copsnrob.c
index 775df0b092f..374a0e662b7 100644
--- a/src/mame/drivers/copsnrob.c
+++ b/src/mame/drivers/copsnrob.c
@@ -81,7 +81,7 @@ static PALETTE_INIT( copsnrob )
READ8_MEMBER(copsnrob_state::copsnrob_misc_r)
{
- return input_port_read(machine(), "IN0") & 0x80;
+ return ioport("IN0")->read() & 0x80;
}
WRITE8_MEMBER(copsnrob_state::copsnrob_misc2_w)
@@ -133,11 +133,11 @@ ADDRESS_MAP_END
*
*************************************/
-static const input_port_value gun_table[] = {0x3f, 0x5f, 0x6f, 0x77, 0x7b, 0x7d, 0x7e};
+static const ioport_value gun_table[] = {0x3f, 0x5f, 0x6f, 0x77, 0x7b, 0x7d, 0x7e};
static INPUT_PORTS_START( copsnrob )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
diff --git a/src/mame/drivers/corona.c b/src/mame/drivers/corona.c
index ee4c88d0e92..e13d2d2d964 100644
--- a/src/mame/drivers/corona.c
+++ b/src/mame/drivers/corona.c
@@ -515,12 +515,12 @@ READ8_MEMBER(corona_state::mux_port_r)
{
switch( m_input_selector )
{
- case 0x01: return input_port_read(machine(), "IN0-1");
- case 0x02: return input_port_read(machine(), "IN0-2");
- case 0x04: return input_port_read(machine(), "IN0-3");
- case 0x08: return input_port_read(machine(), "IN0-4");
- case 0x10: return input_port_read(machine(), "IN0-5");
- case 0x20: return input_port_read(machine(), "IN0-6");
+ case 0x01: return ioport("IN0-1")->read();
+ case 0x02: return ioport("IN0-2")->read();
+ case 0x04: return ioport("IN0-3")->read();
+ case 0x08: return ioport("IN0-4")->read();
+ case 0x10: return ioport("IN0-5")->read();
+ case 0x20: return ioport("IN0-6")->read();
}
return 0xff;
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 8647b8a63cc..c7b2d9379ea 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -315,12 +315,12 @@ READ8_MEMBER(cosmic_state::cosmica_pixel_clock_r)
READ8_MEMBER(cosmic_state::cosmicg_port_0_r)
{
/* The top four address lines from the CRTC are bits 0-3 */
- return (input_port_read(machine(), "IN0") & 0xf0) | ((machine().primary_screen->vpos() & 0xf0) >> 4);
+ return (ioport("IN0")->read() & 0xf0) | ((machine().primary_screen->vpos() & 0xf0) >> 4);
}
READ8_MEMBER(cosmic_state::magspot_coinage_dip_r)
{
- return (input_port_read_safe(machine(), "DSW", 0) & (1 << (7 - offset))) ? 0 : 1;
+ return (ioport("DSW")->read_safe(0) & (1 << (7 - offset))) ? 0 : 1;
}
@@ -328,8 +328,8 @@ READ8_MEMBER(cosmic_state::magspot_coinage_dip_r)
READ8_MEMBER(cosmic_state::nomnlnd_port_0_1_r)
{
- int control = input_port_read(machine(), offset ? "IN1" : "IN0");
- int fire = input_port_read(machine(), "IN3");
+ int control = ioport(offset ? "IN1" : "IN0")->read();
+ int fire = ioport("IN3")->read();
/* If firing - stop tank */
if ((fire & 0xc0) == 0) return 0xff;
@@ -630,7 +630,7 @@ static INPUT_PORTS_START( magspot )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN3")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNUSED ) /* always HI */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) /* reads what was written to 4808. Probably not used?? */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
@@ -715,7 +715,7 @@ static INPUT_PORTS_START( devzone )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN3")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
@@ -811,7 +811,7 @@ static INPUT_PORTS_START( nomnlnd )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN3")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNUSED ) /* always HI */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) /* reads what was written to 4808. Probably not used?? */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
@@ -1512,7 +1512,7 @@ static DRIVER_INIT( cosmicg )
cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs, len;
UINT8 *rom;
- len = machine.root_device().memregion("maincpu")->bytes();
+ len = state->memregion("maincpu")->bytes();
rom = state->memregion("maincpu")->base();
for (offs = 0; offs < len; offs++)
{
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 0093a4ce16e..4dfdd769f67 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -247,35 +247,35 @@ Stephh's log (2006.09.20) :
READ16_MEMBER(cps_state::cps1_dsw_r)
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
- int in = input_port_read(machine(), dswname[offset]);
+ int in = ioport(dswname[offset])->read();
return (in << 8) | 0xff;
}
READ16_MEMBER(cps_state::cps1_hack_dsw_r)
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
- int in = input_port_read(machine(), dswname[offset]);
+ int in = ioport(dswname[offset])->read();
return (in << 8) | in;
}
READ16_MEMBER(cps_state::forgottn_dial_0_r)
{
- return ((input_port_read(machine(), "DIAL0") - m_dial[0]) >> (8 * offset)) & 0xff;
+ return ((ioport("DIAL0")->read() - m_dial[0]) >> (8 * offset)) & 0xff;
}
READ16_MEMBER(cps_state::forgottn_dial_1_r)
{
- return ((input_port_read(machine(), "DIAL1") - m_dial[1]) >> (8 * offset)) & 0xff;
+ return ((ioport("DIAL1")->read() - m_dial[1]) >> (8 * offset)) & 0xff;
}
WRITE16_MEMBER(cps_state::forgottn_dial_0_reset_w)
{
- m_dial[0] = input_port_read(machine(), "DIAL0");
+ m_dial[0] = ioport("DIAL0")->read();
}
WRITE16_MEMBER(cps_state::forgottn_dial_1_reset_w)
{
- m_dial[1] = input_port_read(machine(), "DIAL1");
+ m_dial[1] = ioport("DIAL1")->read();
}
@@ -912,7 +912,7 @@ static INPUT_PORTS_START( ghoulsu )
PORT_MODIFY("DSWB")
/* Standard Dip Switches */
- PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
PORT_DIPSETTING( 0x04, "1 (Easiest)" )
PORT_DIPSETTING( 0x05, "2" )
PORT_DIPSETTING( 0x06, "3" )
@@ -921,16 +921,16 @@ static INPUT_PORTS_START( ghoulsu )
PORT_DIPSETTING( 0x02, "6" )
PORT_DIPSETTING( 0x01, "7" )
PORT_DIPSETTING( 0x00, "8 (Hardest)" )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4")
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):5,6")
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):5,6")
PORT_DIPSETTING( 0x20, "10K, 30K and every 30K" )
PORT_DIPSETTING( 0x10, "20K, 50K and every 70K" )
PORT_DIPSETTING( 0x30, "30K, 60K and every 70K" )
PORT_DIPSETTING( 0x00, "40K, 70K and every 80K" )
/* Debug Dip Switches */
- PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1,2,3")
+ PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1,2,3")
PORT_DIPSETTING( 0x07, "Spear" )
PORT_DIPSETTING( 0x06, "Knife" )
PORT_DIPSETTING( 0x05, "Torch" )
@@ -939,7 +939,7 @@ static INPUT_PORTS_START( ghoulsu )
PORT_DIPSETTING( 0x02, "Shield" )
PORT_DIPSETTING( 0x01, "Super Weapon" )
// PORT_DIPSETTING( 0x00, "INVALID !" )
- PORT_DIPNAME( 0x38, 0x30, "Armor on New Life" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):4,5,6")
+ PORT_DIPNAME( 0x38, 0x30, "Armor on New Life" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):4,5,6")
// PORT_DIPSETTING( 0x38, "Silver Armor" )
PORT_DIPSETTING( 0x18, "Golden Armor" )
PORT_DIPSETTING( 0x30, "Silver Armor" )
@@ -956,7 +956,7 @@ static INPUT_PORTS_START( ghoulsu )
PORT_MODIFY("DSWA")
/* Standard Dip Switches */
- PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
@@ -965,7 +965,7 @@ static INPUT_PORTS_START( ghoulsu )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
+ PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
@@ -975,7 +975,7 @@ static INPUT_PORTS_START( ghoulsu )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_6C ) )
/* Debug Dip Switches */
- PORT_DIPNAME( 0x0f, 0x0f, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4")
+ PORT_DIPNAME( 0x0f, 0x0f, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4")
PORT_DIPSETTING( 0x0f, "Level 1 (1st half)" )
PORT_DIPSETTING( 0x0e, "Level 1 (2nd half)" )
PORT_DIPSETTING( 0x0d, "Level 2 (1st half)" )
@@ -992,10 +992,10 @@ static INPUT_PORTS_START( ghoulsu )
// PORT_DIPSETTING( 0x02, "INVALID !" )
// PORT_DIPSETTING( 0x01, "INVALID !" )
// PORT_DIPSETTING( 0x00, "INVALID !" )
- PORT_DIPNAME( 0x10, 0x10, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):5")
+ PORT_DIPNAME( 0x10, 0x10, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):6")
+ PORT_DIPNAME( 0x20, 0x20, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1139,27 +1139,27 @@ static INPUT_PORTS_START( willow )
PORT_START("DSWC")
/* Standard Dip Switches */
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):1,2")
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(C):1,2")
PORT_DIPSETTING( 0x02, "1" )
PORT_DIPSETTING( 0x03, "2" )
PORT_DIPSETTING( 0x01, "3" )
PORT_DIPSETTING( 0x00, "4" )
- PORT_DIPNAME( 0x0c, 0x0c, "Vitality" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):3,4")
+ PORT_DIPNAME( 0x0c, 0x0c, "Vitality" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(C):3,4")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x0c, "3" )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x04, "5" )
/* Debug Dip Switches */
- PORT_DIPNAME( 0x01, 0x01, "Turbo Mode" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):1")
+ PORT_DIPNAME( 0x01, 0x01, "Turbo Mode" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):2")
+ PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):3")
+ PORT_DIPNAME( 0x04, 0x04, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):4")
+ PORT_DIPNAME( 0x08, 0x08, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1168,11 +1168,11 @@ static INPUT_PORTS_START( willow )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Standard Dip Switches */
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):6")
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(C):6")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
/* Debug Dip Switches */
- PORT_DIPNAME( 0x20, 0x20, "Display Debug Infos" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):6")
+ PORT_DIPNAME( 0x20, 0x20, "Display Debug Infos" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(C):6")
PORT_DIPSETTING( 0x20, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
@@ -1185,7 +1185,7 @@ static INPUT_PORTS_START( willow )
PORT_START("DSWB")
/* Standard Dip Switches */
- PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
PORT_DIPSETTING( 0x04, "1 (Easiest)" )
PORT_DIPSETTING( 0x05, "2" )
PORT_DIPSETTING( 0x06, "3" )
@@ -1194,25 +1194,25 @@ static INPUT_PORTS_START( willow )
PORT_DIPSETTING( 0x02, "6" )
PORT_DIPSETTING( 0x01, "7" )
PORT_DIPSETTING( 0x00, "8 (Hardest)" )
- PORT_DIPNAME( 0x18, 0x18, "Nando Speed" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4,5")
+ PORT_DIPNAME( 0x18, 0x18, "Nando Speed" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4,5")
PORT_DIPSETTING( 0x10, "Slow" )
PORT_DIPSETTING( 0x18, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x08, "Fast" )
PORT_DIPSETTING( 0x00, "Very Fast" )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):6")
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):7")
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, "Stage Magic Continue" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):8")
+ PORT_DIPNAME( 0x80, 0x80, "Stage Magic Continue" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(B):8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Debug Dip Switches */
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1")
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x1e, 0x1e, "Slow Motion Delay" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):2,3,4,5")
+ PORT_DIPNAME( 0x1e, 0x1e, "Slow Motion Delay" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):2,3,4,5")
PORT_DIPSETTING( 0x1e, "2 Frames" )
PORT_DIPSETTING( 0x1c, "3 Frames" )
PORT_DIPSETTING( 0x1a, "4 Frames" )
@@ -1229,7 +1229,7 @@ static INPUT_PORTS_START( willow )
PORT_DIPSETTING( 0x04, "15 Frames" )
PORT_DIPSETTING( 0x02, "16 Frames" )
PORT_DIPSETTING( 0x00, "17 Frames" )
- PORT_DIPNAME( 0xe0, 0xe0, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):6,7,8")
+ PORT_DIPNAME( 0xe0, 0xe0, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(B):6,7,8")
PORT_DIPSETTING( 0xe0, "Level 1" )
PORT_DIPSETTING( 0xc0, "Level 2" )
PORT_DIPSETTING( 0xa0, "Level 3" )
@@ -1241,7 +1241,7 @@ static INPUT_PORTS_START( willow )
PORT_START("DSWA")
/* Standard Dip Switches */
- PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
@@ -1250,7 +1250,7 @@ static INPUT_PORTS_START( willow )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
- PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
+ PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
PORT_DIPSETTING( 0x08, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) )
@@ -1259,20 +1259,20 @@ static INPUT_PORTS_START( willow )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) )
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):7,8")
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW(A):7,8")
PORT_DIPSETTING( 0xc0, "Upright 1 Player" )
PORT_DIPSETTING( 0x80, "Upright 2 Players" )
// PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
/* Debug Dip Switches */
- PORT_DIPNAME( 0x3f, 0x3f, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4,5,6")
+ PORT_DIPNAME( 0x3f, 0x3f, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4,5,6")
PORT_DIPSETTING( 0x3f, DEF_STR( Off ) )
PORT_DIPSETTING( 0x38, DEF_STR( On ) )
/* Other values don't give free play */
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
PORT_DIPSETTING( 0x40, "Upright 1 Player" )
PORT_DIPSETTING( 0x00, "Upright 2 Players" )
- PORT_DIPNAME( 0x80, 0x80, "Maximum magic/sword power" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):8")
+ PORT_DIPNAME( 0x80, 0x80, "Maximum magic/sword power" ) PORT_CONDITION("DSWC", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -1818,10 +1818,10 @@ static INPUT_PORTS_START( 3wonders )
PORT_START("DSWA")
CPS1_COINAGE_1( "SW(A)" )
- PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" ) PORT_CONDITION("DSWA", 0x3f,PORTCOND_NOTEQUALS,0x00) PORT_DIPLOCATION("SW(A):7")
+ PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" ) PORT_CONDITION("DSWA", 0x3f,NOTEQUALS,0x00) PORT_DIPLOCATION("SW(A):7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWA", 0x3f, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWA", 0x3f, EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Free Play: ALL bits 0 to 7 must be ON ; 4C_1C, 4C_1C, 2 Coins to Start, 1 to Continue ON */
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index edfbc134dec..f4a19720829 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -706,7 +706,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
/* bit 7 - */
/* EEPROM */
- input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
+ state->ioport("EEPROMOUT")->write(data, 0xffff);
}
if (ACCESSING_BITS_0_7)
@@ -798,9 +798,9 @@ static READ16_HANDLER( joy_or_paddle_r )
cps_state *state = space->machine().driver_data<cps_state>();
if (state->m_readpaddle != 0)
- return (input_port_read(space->machine(), "IN0"));
+ return (state->ioport("IN0")->read());
else
- return (input_port_read(space->machine(), "PADDLE1") & 0xff) | (input_port_read(space->machine(), "PADDLE2") << 8);
+ return (state->ioport("PADDLE1")->read() & 0xff) | (state->ioport("PADDLE2")->read() << 8);
}
@@ -8181,7 +8181,7 @@ static DRIVER_INIT( gigaman2 )
{
cps_state *state = machine.driver_data<cps_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT16 *rom = (UINT16 *)state->memregion("maincpu")->base();
int length = state->memregion("maincpu")->bytes();
gigaman2_gfx_reorder(machine);
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 764d490c35c..356a92fc16e 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -663,7 +663,7 @@ static void cps3_decrypt_bios(running_machine &machine)
{
cps3_state *state = machine.driver_data<cps3_state>();
int i;
- UINT32 *coderegion = (UINT32*)machine.root_device().memregion("user1")->base();
+ UINT32 *coderegion = (UINT32*)state->memregion("user1")->base();
state->m_decrypted_bios = (UINT32*)state->memregion("user1")->base();
@@ -701,7 +701,7 @@ static void init_common(running_machine &machine, UINT32 key1, UINT32 key2, int
state->m_altEncryption = altEncryption;
// cache pointers to regions
- state->m_user4region = machine.root_device().memregion("user4")->base();
+ state->m_user4region = state->memregion("user4")->base();
state->m_user5region = state->memregion("user5")->base();
if (!state->m_user4region) state->m_user4region = auto_alloc_array(machine, UINT8, USER4REGION_LENGTH);
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index 99136f08b51..1726319a43f 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -73,7 +73,7 @@ CUSTOM_INPUT_MEMBER(crbaloon_state::pc3092_r)
/* enable coin & start input? Wild guess!!! */
if (m_pc3092_data[1] & 0x02)
- ret = input_port_read(machine(), "PC3092");
+ ret = ioport("PC3092")->read();
else
ret = 0x00;
@@ -143,7 +143,7 @@ READ8_MEMBER(crbaloon_state::pc3259_r)
if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", cpu_get_pc(&space.device()), reg, ret);
- return ret | (input_port_read(machine(), "DSW1") & 0xf0);
+ return ret | (ioport("DSW1")->read() & 0xf0);
}
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index 0cf9bec1bdb..42774338182 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -90,13 +90,13 @@ READ8_MEMBER(crgolf_state::switch_input_r)
{
static const char *const portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" };
- return input_port_read(machine(), portnames[m_port_select]);
+ return ioport(portnames[m_port_select])->read();
}
READ8_MEMBER(crgolf_state::analog_input_r)
{
- return ((input_port_read(machine(), "STICK0") >> 4) | (input_port_read(machine(), "STICK1") & 0xf0)) ^ 0x88;
+ return ((ioport("STICK1")->read() & 0xf0)) ^ 0x88;
}
diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c
index acbd282a6a0..ace213cbf46 100644
--- a/src/mame/drivers/crshrace.c
+++ b/src/mame/drivers/crshrace.c
@@ -271,7 +271,7 @@ static INPUT_PORTS_START( crshrace )
PORT_DIPNAME( 0x0100, 0x0100, "Coin Slot" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0100, "Same" )
PORT_DIPSETTING( 0x0000, "Individual" )
- PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, PORTCOND_EQUALS, 0x0100)
+ PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, EQUALS, 0x0100)
PORT_DIPSETTING( 0x0a00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0c00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_1C ) )
@@ -280,7 +280,7 @@ static INPUT_PORTS_START( crshrace )
PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0200, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, PORTCOND_EQUALS, 0x0100)
+ PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, EQUALS, 0x0100)
PORT_DIPSETTING( 0x5000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x6000, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x7000, DEF_STR( 1C_1C ) )
@@ -289,7 +289,7 @@ static INPUT_PORTS_START( crshrace )
PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x1000, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, PORTCOND_NOTEQUALS, 0x0100)
+ PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4") PORT_CONDITION("DSW0", 0x0100, NOTEQUALS, 0x0100)
PORT_DIPSETTING( 0x0a00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0c00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_1C ) )
@@ -298,7 +298,7 @@ static INPUT_PORTS_START( crshrace )
PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0200, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
- PORT_DIPUNUSED_DIPLOC( 0x7000, 0x7000, "SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, PORTCOND_NOTEQUALS, 0x0100)
+ PORT_DIPUNUSED_DIPLOC( 0x7000, 0x7000, "SW1:5,6,7") PORT_CONDITION("DSW0", 0x0100, NOTEQUALS, 0x0100)
PORT_DIPNAME( 0x8000, 0x8000, "2 to Start, 1 to Cont." ) PORT_DIPLOCATION("SW1:8") // Other desc. was too long !
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index 419acd18a88..80f995dd873 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -233,18 +233,18 @@ READ32_MEMBER(crystal_state::Input_r)
{
if (offset == 0)
- return input_port_read(machine(), "P1_P2");
+ return ioport("P1_P2")->read();
else if (offset == 1)
- return input_port_read(machine(), "P3_P4");
+ return ioport("P3_P4")->read();
else if( offset == 2)
{
- UINT8 Port4 = input_port_read(machine(), "SYSTEM");
+ UINT8 Port4 = ioport("SYSTEM")->read();
if (!(Port4 & 0x10) && ((m_OldPort4 ^ Port4) & 0x10)) //coin buttons trigger IRQs
IntReq(machine(), 12);
if (!(Port4 & 0x20) && ((m_OldPort4 ^ Port4) & 0x20))
IntReq(machine(), 19);
m_OldPort4 = Port4;
- return /*dips*/input_port_read(machine(), "DSW") | (Port4 << 16);
+ return /*dips*/ioport("DSW")->read() | (Port4 << 16);
}
return 0;
}
@@ -565,7 +565,7 @@ static void crystal_banksw_postload(running_machine &machine)
crystal_state *state = machine.driver_data<crystal_state>();
if (state->m_Bank <= 2)
- state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + state->m_Bank * 0x1000000);
+ state->membank("bank1")->set_base(state->memregion("user1")->base() + state->m_Bank * 0x1000000);
else
state->membank("bank1")->set_base(state->memregion("user2")->base());
}
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index 8f768c491b5..9d6a0938997 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -226,7 +226,7 @@ READ8_MEMBER(cshooter_state::cshooter_coin_r)
/* Even reads must return 0xff - Odd reads must return the contents of input port 5.
Code at 0x5061 is executed once during P.O.S.T. where there is one read.
Code at 0x50b4 is then executed each frame (not sure) where there are 2 reads. */
- return ( (m_counter++ & 1) ? 0xff : input_port_read(machine(), "COIN") );
+ return ( (m_counter++ & 1) ? 0xff : ioport("COIN")->read() );
}
WRITE8_MEMBER(cshooter_state::cshooter_c500_w)
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index 3275952e33a..dac27fe869d 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -92,11 +92,11 @@ READ16_MEMBER(csplayh5_state::csplayh5_mux_r)
{
switch(m_mux_data)
{
- case 0x01: return input_port_read(machine(), "KEY0");
- case 0x02: return input_port_read(machine(), "KEY1");
- case 0x04: return input_port_read(machine(), "KEY2");
- case 0x08: return input_port_read(machine(), "KEY3");
- case 0x10: return input_port_read(machine(), "KEY4");
+ case 0x01: return ioport("KEY0")->read();
+ case 0x02: return ioport("KEY1")->read();
+ case 0x04: return ioport("KEY2")->read();
+ case 0x08: return ioport("KEY3")->read();
+ case 0x10: return ioport("KEY4")->read();
}
return 0xffff;
diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c
index e00e654cfbc..11943d372a6 100644
--- a/src/mame/drivers/cubeqst.c
+++ b/src/mame/drivers/cubeqst.c
@@ -329,7 +329,7 @@ WRITE16_MEMBER(cubeqst_state::io_w)
READ16_MEMBER(cubeqst_state::io_r)
{
- UINT16 port_data = input_port_read(machine(), "IO");
+ UINT16 port_data = ioport("IO")->read();
/*
Certain bits depend on Q7 of the IO latch:
@@ -350,7 +350,7 @@ READ16_MEMBER(cubeqst_state::io_r)
/* Trackball ('CHOP') */
READ16_MEMBER(cubeqst_state::chop_r)
{
- return (input_port_read(machine(), "TRACK_X") << 8) | input_port_read(machine(), "TRACK_Y");
+ return (ioport("TRACK_X")->read() << 8) | ioport("TRACK_Y")->read();
}
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 90ad7c04833..5c3a82103fa 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -261,12 +261,12 @@ READ8_MEMBER(cvs_state::cvs_input_r)
/* the lower 4 (or 3?) bits select the port to read */
switch (offset & 0x0f) /* might be 0x07 */
{
- case 0x00: ret = input_port_read(machine(), "IN0"); break;
- case 0x02: ret = input_port_read(machine(), "IN1"); break;
- case 0x03: ret = input_port_read(machine(), "IN2"); break;
- case 0x04: ret = input_port_read(machine(), "IN3"); break;
- case 0x06: ret = input_port_read(machine(), "DSW3"); break;
- case 0x07: ret = input_port_read(machine(), "DSW2"); break;
+ case 0x00: ret = ioport("IN0")->read(); break;
+ case 0x02: ret = ioport("IN1")->read(); break;
+ case 0x03: ret = ioport("IN2")->read(); break;
+ case 0x04: ret = ioport("IN3")->read(); break;
+ case 0x06: ret = ioport("DSW3")->read(); break;
+ case 0x07: ret = ioport("DSW2")->read(); break;
default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", cpu_get_pc(&space.device()), offset & 0x0f); break;
}
@@ -425,8 +425,7 @@ static WRITE8_DEVICE_HANDLER( cvs_tms5110_pdc_w )
static int speech_rom_read_bit( device_t *device )
{
cvs_state *state = device->machine().driver_data<cvs_state>();
- running_machine &machine = device->machine();
- UINT8 *ROM = machine.root_device().memregion("speechdata")->base();
+ UINT8 *ROM = state->memregion("speechdata")->base();
int bit;
/* before reading the bit, clamp the address to the region length */
@@ -612,7 +611,7 @@ static INPUT_PORTS_START( cvs )
PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH ) /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( cvs_registration )
diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c
index a2a48df0787..6dae1175163 100644
--- a/src/mame/drivers/cyberbal.c
+++ b/src/mame/drivers/cyberbal.c
@@ -103,7 +103,7 @@ static MACHINE_RESET( cyberbal2p )
READ16_MEMBER(cyberbal_state::special_port0_r)
{
- int temp = input_port_read(machine(), "IN0");
+ int temp = ioport("IN0")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -111,7 +111,7 @@ READ16_MEMBER(cyberbal_state::special_port0_r)
READ16_MEMBER(cyberbal_state::special_port2_r)
{
- int temp = input_port_read(machine(), "IN2");
+ int temp = ioport("IN2")->read();
if (m_cpu_to_sound_ready) temp ^= 0x2000;
return temp;
}
@@ -306,7 +306,7 @@ static INPUT_PORTS_START( cyberbal )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2") /* fake port for screen switching */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -346,7 +346,7 @@ static INPUT_PORTS_START( cyberbal2p )
PORT_START("IN2") /* fc4000 */
PORT_BIT( 0x1fff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
PORT_INCLUDE( atarijsa_ii ) /* audio board port */
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index bcf51d5c6c2..6f58c0a6904 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -531,7 +531,7 @@ READ16_MEMBER(cybertnk_state::io_r)
switch( offset )
{
case 2/2:
- return input_port_read(machine(), "DSW1");
+ return ioport("DSW1")->read();
// 0x00110007 is controller device select
// 0x001100D5 is controller data
@@ -540,15 +540,15 @@ READ16_MEMBER(cybertnk_state::io_r)
switch( (m_io_ram[6/2]) & 0xff )
{
case 0:
- m_io_ram[0xd4/2] = input_port_read(machine(), "TRAVERSE");
+ m_io_ram[0xd4/2] = ioport("TRAVERSE")->read();
break;
case 0x20:
- m_io_ram[0xd4/2] = input_port_read(machine(), "ELEVATE");
+ m_io_ram[0xd4/2] = ioport("ELEVATE")->read();
break;
case 0x40:
- m_io_ram[0xd4/2] = input_port_read(machine(), "ACCEL");
+ m_io_ram[0xd4/2] = ioport("ACCEL")->read();
break;
case 0x42:
@@ -560,7 +560,7 @@ READ16_MEMBER(cybertnk_state::io_r)
break;
case 0x60:
- m_io_ram[0xd4/2] = input_port_read(machine(), "HANDLE");
+ m_io_ram[0xd4/2] = ioport("HANDLE")->read();
break;
//default:
@@ -569,13 +569,13 @@ READ16_MEMBER(cybertnk_state::io_r)
return 0;
case 6/2:
- return input_port_read(machine(), "IN0"); // high half
+ return ioport("IN0")->read(); // high half
case 8/2:
- return input_port_read(machine(), "IN0"); // low half
+ return ioport("IN0")->read(); // low half
case 0xa/2:
- return input_port_read(machine(), "DSW2");
+ return ioport("DSW2")->read();
case 0xd4/2:
return m_io_ram[offset]; // controller data
diff --git a/src/mame/drivers/dai3wksi.c b/src/mame/drivers/dai3wksi.c
index e249046142b..af119ebe521 100644
--- a/src/mame/drivers/dai3wksi.c
+++ b/src/mame/drivers/dai3wksi.c
@@ -150,7 +150,7 @@ static SCREEN_UPDATE_RGB32( dai3wksi )
}
else
{
- if (input_port_read(screen.machine(), "IN2") & 0x03)
+ if (state->ioport("IN2")->read() & 0x03)
color = vr_prom2[value];
else
color = vr_prom1[value];
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index 7d1f3ba31c6..c7d3707f276 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -136,10 +136,10 @@ static INPUT_PORTS_START( dambustr )
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x40, "2" )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, "A 1/1 B 1/2" ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
- PORT_DIPSETTING( 0x00, "A 1/2 B 1/6" ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, "A 1/1 B 1/2" ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
+ PORT_DIPSETTING( 0x00, "A 1/2 B 1/6" ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
PORT_START("DSW")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:!3,!4")
@@ -162,10 +162,10 @@ static INPUT_PORTS_START( dambustruk )
PORT_MODIFY("IN1")
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, "A 1/1 B 1/6" ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
- PORT_DIPSETTING( 0x00, "A 1/2 B 1/12" ) PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, "A 1/1 B 1/6" ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
+ PORT_DIPSETTING( 0x00, "A 1/2 B 1/12" ) PORT_CONDITION("IN1", 0x40, EQUALS, 0x40)
INPUT_PORTS_END
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index 35a6fa8ab3a..cffcc293a91 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -180,19 +180,19 @@ READ16_MEMBER(darius_state::darius_ioc_r)
return (tc0140syt_comm_r(m_tc0140syt, 0) & 0xff); /* sound interface read */
case 0x04:
- return input_port_read(machine(), "P1");
+ return ioport("P1")->read();
case 0x05:
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
case 0x06:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 0x07:
return m_coin_word; /* bits 3&4 coin lockouts, must return zero */
case 0x08:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
}
logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(&space.device()),offset);
@@ -842,7 +842,7 @@ static MACHINE_START( darius )
{
darius_state *state = machine.driver_data<darius_state>();
- state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x8000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("audiocpu")->base() + 0x10000, 0x8000);
state->membank("bank1")->configure_entry(4, state->memregion("audiocpu")->base());
state->membank("bank1")->set_entry(4);
diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c
index 40afe81d13e..2d1f97caa5d 100644
--- a/src/mame/drivers/darkhors.c
+++ b/src/mame/drivers/darkhors.c
@@ -313,8 +313,8 @@ READ32_MEMBER(darkhors_state::darkhors_input_sel_r)
int bit_p2 = mask_to_bit((m_input_sel & 0xff000000) >> 24);
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
- return (input_port_read(machine(), portnames[bit_p1]) & 0x00ffffff) |
- (input_port_read(machine(), portnames[bit_p2]) & 0xff000000) ;
+ return (ioport(portnames[bit_p1])->read() & 0x00ffffff) |
+ (ioport(portnames[bit_p2])->read() & 0xff000000) ;
}
WRITE32_MEMBER(darkhors_state::darkhors_unk1_w)
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index 363a7b2e3e1..3f016f0319f 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -45,13 +45,13 @@ READ16_MEMBER(darkseal_state::darkseal_control_r)
switch (offset<<1)
{
case 0:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 2:
- return input_port_read(machine(), "P1_P2");
+ return ioport("P1_P2")->read();
case 4:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
return ~0;
@@ -120,7 +120,7 @@ static INPUT_PORTS_START( darkseal )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index 407001c3f58..2702d286e72 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -134,19 +134,19 @@ READ16_MEMBER(dassault_state::dassault_control_r)
switch (offset << 1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(machine(), "P1_P2");
+ return ioport("P1_P2")->read();
case 2: /* Player 3 & Player 4 joysticks & fire buttons */
- return input_port_read(machine(), "P3_P4");
+ return ioport("P3_P4")->read();
case 4: /* Dip 1 (stored at 0x3f8035) */
- return input_port_read(machine(), "DSW1");
+ return ioport("DSW1")->read();
case 6: /* Dip 2 (stored at 0x3f8034) */
- return input_port_read(machine(), "DSW2");
+ return ioport("DSW2")->read();
case 8: /* VBL, Credits */
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
return 0xffff;
@@ -161,7 +161,7 @@ WRITE16_MEMBER(dassault_state::dassault_control_w)
READ16_MEMBER(dassault_state::dassault_sub_control_r)
{
- return input_port_read(machine(), "VBLANK1");
+ return ioport("VBLANK1")->read();
}
WRITE16_MEMBER(dassault_state::dassault_sound_w)
@@ -302,7 +302,7 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_START("VBLANK1") /* Cpu 1 vblank */
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( thndzone )
@@ -312,7 +312,7 @@ static INPUT_PORTS_START( thndzone )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Adds 4 credits/coins !
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -369,7 +369,7 @@ static INPUT_PORTS_START( dassault )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
@@ -427,7 +427,7 @@ static INPUT_PORTS_START( dassault4 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index 46cbd895aa5..76cd1671039 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -145,11 +145,11 @@ READ16_MEMBER(dblewing_state::dblewing_prot_r)
case 0x330: return 0; // controls bonuses such as shoot type,bombs etc.
case 0x1d4: return m_70c_data; //controls restart points
- case 0x0ac: return (input_port_read(machine(), "DSW") & 0x40) << 4;//flip screen
+ case 0x0ac: return (ioport("DSW")->read() & 0x40) << 4;//flip screen
case 0x4b0: return m_608_data;//coinage
case 0x068:
{
- switch (input_port_read(machine(), "DSW") & 0x0300) //I don't know how to relationate this...
+ switch (ioport("DSW")->read() & 0x0300) //I don't know how to relationate this...
{
case 0x0000: return 0x000;//0
case 0x0100: return 0x060;//3
@@ -159,12 +159,12 @@ READ16_MEMBER(dblewing_state::dblewing_prot_r)
}
case 0x094: return m_104_data;// p1 inputs select screen OK
case 0x24c: return m_008_data;//read DSW (mirror for coinage/territory)
- case 0x298: return input_port_read(machine(), "SYSTEM");//vblank
- case 0x476: return input_port_read(machine(), "SYSTEM");//mirror for coins
- case 0x506: return input_port_read(machine(), "DSW");
+ case 0x298: return ioport("SYSTEM")->read();//vblank
+ case 0x476: return ioport("SYSTEM")->read();//mirror for coins
+ case 0x506: return ioport("DSW")->read();
case 0x5d8: return m_406_data;
- case 0x2b4: return input_port_read(machine(), "P1_P2");
- case 0x1a8: return (input_port_read(machine(), "DSW") & 0x4000) >> 12;//allow continue
+ case 0x2b4: return ioport("P1_P2")->read();
+ case 0x1a8: return (ioport("DSW")->read() & 0x4000) >> 12;//allow continue
case 0x3ec: return m_70c_data; //score entry
case 0x246: return m_580_data; // these three controls "perfect bonus" I suppose...
case 0x52e: return m_580_data;
@@ -424,7 +424,7 @@ static INPUT_PORTS_START( dblewing )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW")
/* 16bit - These values are for Dip Switch #1 */
diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c
index eb3141bc59c..763aa4d56b9 100644
--- a/src/mame/drivers/dcheese.c
+++ b/src/mame/drivers/dcheese.c
@@ -129,7 +129,7 @@ WRITE16_MEMBER(dcheese_state::eeprom_control_w)
/* bits $0080-$0010 are probably lamps */
if (ACCESSING_BITS_0_7)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
machine().device<ticket_dispenser_device>("ticket")->write(space, 0, (data & 1) << 7);
}
}
diff --git a/src/mame/drivers/dday.c b/src/mame/drivers/dday.c
index 696116172ab..e4aef9e9fba 100644
--- a/src/mame/drivers/dday.c
+++ b/src/mame/drivers/dday.c
@@ -86,14 +86,14 @@ static INPUT_PORTS_START( dday )
/* accessed */
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW3:1,2")
- PORT_DIPSETTING( 0x00, "2" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
- PORT_DIPSETTING( 0x01, "3" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
- PORT_DIPSETTING( 0x02, "4" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
- PORT_DIPSETTING( 0x03, "5" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x80)
- PORT_DIPSETTING( 0x00, "5" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x01, "6" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x02, "7" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x03, "8" ) PORT_CONDITION("DSW0", 0x80, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "2" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
+ PORT_DIPSETTING( 0x01, "3" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
+ PORT_DIPSETTING( 0x02, "4" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
+ PORT_DIPSETTING( 0x03, "5" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x80)
+ PORT_DIPSETTING( 0x00, "5" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x01, "6" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, "7" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x03, "8" ) PORT_CONDITION("DSW0", 0x80, EQUALS, 0x00)
PORT_DIPNAME( 0x0c, 0x00, "Extended Play At" ) PORT_DIPLOCATION("SW3:3,4")
PORT_DIPSETTING( 0x00, "10000" )
diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c
index cb8657604a9..4fa4b1b242d 100644
--- a/src/mame/drivers/ddealer.c
+++ b/src/mame/drivers/ddealer.c
@@ -309,7 +309,7 @@ static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
/*coin/credit simulation*/
/*$fe002 is used,might be for multiple coins for one credit settings.*/
- state->m_coin_input = (~(input_port_read(timer.machine(), "IN0")));
+ state->m_coin_input = (~(timer.machine().root_device().ioport("IN0")->read()));
if (state->m_coin_input & 0x01)//coin 1
{
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index ae2953d3703..c9053256762 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -430,7 +430,7 @@ INLINE void log_draw_error( int src, int cmd )
static int blit_draw( running_machine &machine, int src, int sx )
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *src_data = machine.root_device().memregion("blitter")->base();
+ UINT8 *src_data = state->memregion("blitter")->base();
int src_len = state->memregion("blitter")->bytes();
int bit_addr = (src & 0xffffff) * state->m_ddenlovr_blit_rom_bits; /* convert to bit address */
int pen_size, arg_size, cmd;
@@ -1597,9 +1597,9 @@ READ8_MEMBER(dynax_state::rongrong_input2_r)
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (m_input_sel)
{
- case 0x00: return input_port_read(machine(), "P1");
- case 0x01: return input_port_read(machine(), "P2");
- case 0x02: return input_port_read(machine(), "SYSTEM");
+ case 0x00: return ioport("P1")->read();
+ case 0x01: return ioport("P2")->read();
+ case 0x02: return ioport("SYSTEM")->read();
}
return 0xff;
}
@@ -1609,9 +1609,9 @@ static READ8_DEVICE_HANDLER( quiz365_input_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->m_dsw_sel, 0)) return input_port_read(device->machine(), "DSW1");
- if (!BIT(state->m_dsw_sel, 1)) return input_port_read(device->machine(), "DSW2");
- if (!BIT(state->m_dsw_sel, 2)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW1")->read();
+ if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW2")->read();
+ if (!BIT(state->m_dsw_sel, 2)) return state->ioport("DSW3")->read();
if (!BIT(state->m_dsw_sel, 3)) return 0xff;//device->machine().rand();
if (!BIT(state->m_dsw_sel, 4)) return 0xff;//device->machine().rand();
return 0xff;
@@ -1624,9 +1624,9 @@ READ16_MEMBER(dynax_state::quiz365_input2_r)
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (m_input_sel)
{
- case 0x10: return input_port_read(machine(), "P1");
- case 0x11: return input_port_read(machine(), "P2");
- case 0x12: return input_port_read(machine(), "SYSTEM");
+ case 0x10: return ioport("P1")->read();
+ case 0x11: return ioport("P2")->read();
+ case 0x12: return ioport("SYSTEM")->read();
}
return 0xff;
}
@@ -1728,9 +1728,9 @@ ADDRESS_MAP_END
READ16_MEMBER(dynax_state::ddenlovj_dsw_r)
{
UINT16 dsw = 0;
- if ((~*m_dsw_sel16) & 0x01) dsw |= input_port_read(machine(), "DSW1");
- if ((~*m_dsw_sel16) & 0x02) dsw |= input_port_read(machine(), "DSW2");
- if ((~*m_dsw_sel16) & 0x04) dsw |= input_port_read(machine(), "DSW3");
+ if ((~*m_dsw_sel16) & 0x01) dsw |= ioport("DSW1")->read();
+ if ((~*m_dsw_sel16) & 0x02) dsw |= ioport("DSW2")->read();
+ if ((~*m_dsw_sel16) & 0x04) dsw |= ioport("DSW3")->read();
return dsw;
}
@@ -1888,9 +1888,9 @@ CUSTOM_INPUT_MEMBER(dynax_state::nettoqc_special_r)
READ16_MEMBER(dynax_state::nettoqc_input_r)
{
- if (!BIT(m_dsw_sel, 0)) return input_port_read(machine(), "DSW1");
- if (!BIT(m_dsw_sel, 1)) return input_port_read(machine(), "DSW2");
- if (!BIT(m_dsw_sel, 2)) return input_port_read(machine(), "DSW3");
+ if (!BIT(m_dsw_sel, 0)) return ioport("DSW1")->read();
+ if (!BIT(m_dsw_sel, 1)) return ioport("DSW2")->read();
+ if (!BIT(m_dsw_sel, 2)) return ioport("DSW3")->read();
return 0xffff;
}
@@ -1971,11 +1971,11 @@ ADDRESS_MAP_END
READ8_MEMBER(dynax_state::rongrong_input_r)
{
- if (!BIT(m_dsw_sel, 0)) return input_port_read(machine(), "DSW1");
- if (!BIT(m_dsw_sel, 1)) return input_port_read(machine(), "DSW2");
+ if (!BIT(m_dsw_sel, 0)) return ioport("DSW1")->read();
+ if (!BIT(m_dsw_sel, 1)) return ioport("DSW2")->read();
if (!BIT(m_dsw_sel, 2)) return 0xff;//machine().rand();
if (!BIT(m_dsw_sel, 3)) return 0xff;//machine().rand();
- if (!BIT(m_dsw_sel, 4)) return input_port_read(machine(), "DSW3");
+ if (!BIT(m_dsw_sel, 4)) return ioport("DSW3")->read();
return 0xff;
}
@@ -2252,9 +2252,9 @@ WRITE8_MEMBER(dynax_state::funkyfig_rombank_w)
READ8_MEMBER(dynax_state::funkyfig_dsw_r)
{
- if (!BIT(m_dsw_sel, 0)) return input_port_read(machine(), "DSW1");
- if (!BIT(m_dsw_sel, 1)) return input_port_read(machine(), "DSW2");
- if (!BIT(m_dsw_sel, 2)) return input_port_read(machine(), "DSW3");
+ if (!BIT(m_dsw_sel, 0)) return ioport("DSW1")->read();
+ if (!BIT(m_dsw_sel, 1)) return ioport("DSW2")->read();
+ if (!BIT(m_dsw_sel, 2)) return ioport("DSW3")->read();
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
return 0xff;
}
@@ -2264,7 +2264,7 @@ READ8_MEMBER(dynax_state::funkyfig_coin_r)
switch (m_input_sel)
{
- case 0x22: return input_port_read(machine(), "IN2");
+ case 0x22: return ioport("IN2")->read();
case 0x23: return m_funkyfig_lockout;
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
@@ -2276,8 +2276,8 @@ READ8_MEMBER(dynax_state::funkyfig_key_r)
switch (m_input_sel)
{
- case 0x20: return input_port_read(machine(), "IN0");
- case 0x21: return input_port_read(machine(), "IN1");
+ case 0x20: return ioport("IN0")->read();
+ case 0x21: return ioport("IN1")->read();
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
return 0xff;
@@ -2379,24 +2379,24 @@ READ8_MEMBER(dynax_state::hanakanz_keyb_r)
UINT8 val = 0xff;
- if (!BIT(m_keyb, 0)) val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
- else if (!BIT(m_keyb, 1)) val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
- else if (!BIT(m_keyb, 2)) val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
- else if (!BIT(m_keyb, 3)) val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
- else if (!BIT(m_keyb, 4)) val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
+ if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read();
+ else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read();
+ else if (!BIT(m_keyb, 2)) val = ioport(offset ? "KEY7" : "KEY2")->read();
+ else if (!BIT(m_keyb, 3)) val = ioport(offset ? "KEY8" : "KEY3")->read();
+ else if (!BIT(m_keyb, 4)) val = ioport(offset ? "KEY9" : "KEY4")->read();
- val |= input_port_read(machine(), offset ? "HOPPER" : "BET");
+ val |= ioport(offset ? "HOPPER" : "BET")->read();
return val;
}
READ8_MEMBER(dynax_state::hanakanz_dsw_r)
{
- if (!BIT(m_dsw_sel, 0)) return input_port_read(machine(), "DSW1");
- if (!BIT(m_dsw_sel, 1)) return input_port_read(machine(), "DSW2");
- if (!BIT(m_dsw_sel, 2)) return input_port_read(machine(), "DSW3");
- if (!BIT(m_dsw_sel, 3)) return input_port_read(machine(), "DSW4");
- if (!BIT(m_dsw_sel, 4)) return input_port_read(machine(), "DSW5");
+ if (!BIT(m_dsw_sel, 0)) return ioport("DSW1")->read();
+ if (!BIT(m_dsw_sel, 1)) return ioport("DSW2")->read();
+ if (!BIT(m_dsw_sel, 2)) return ioport("DSW3")->read();
+ if (!BIT(m_dsw_sel, 3)) return ioport("DSW4")->read();
+ if (!BIT(m_dsw_sel, 4)) return ioport("DSW5")->read();
return 0xff;
}
@@ -2562,13 +2562,13 @@ READ8_MEMBER(dynax_state::mjchuuka_keyb_r)
{
UINT8 val = 0xff;
- if (!BIT(m_keyb, 0)) val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
- else if (!BIT(m_keyb, 1)) val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
- else if (!BIT(m_keyb, 2)) val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
- else if (!BIT(m_keyb, 3)) val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
- else if (!BIT(m_keyb, 4)) val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
+ if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read();
+ else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read();
+ else if (!BIT(m_keyb, 2)) val = ioport(offset ? "KEY7" : "KEY2")->read();
+ else if (!BIT(m_keyb, 3)) val = ioport(offset ? "KEY8" : "KEY3")->read();
+ else if (!BIT(m_keyb, 4)) val = ioport(offset ? "KEY9" : "KEY4")->read();
- val |= input_port_read(machine(), offset ? "HOPPER" : "BET");
+ val |= ioport(offset ? "HOPPER" : "BET")->read();
if (offset)
val |= 0x80; // blitter busy
@@ -2585,7 +2585,7 @@ WRITE8_MEMBER(dynax_state::mjchuuka_blitter_w)
static void mjchuuka_get_romdata(running_machine &machine)
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *rom = machine.root_device().memregion("blitter")->base();
+ UINT8 *rom = state->memregion("blitter")->base();
size_t size = state->memregion("blitter")->bytes();
int address = (state->m_ddenlovr_blit_address & 0xffffff) * 2;
@@ -2716,7 +2716,7 @@ READ8_MEMBER(dynax_state::mjmyster_coins_r)
switch (m_input_sel)
{
- case 0x00: return input_port_read(machine(), "SYSTEM");
+ case 0x00: return ioport("SYSTEM")->read();
case 0x01: return 0xff;
case 0x02: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x03: return 0xff;
@@ -2731,11 +2731,11 @@ READ8_MEMBER(dynax_state::mjmyster_keyb_r)
{
UINT8 ret = 0xff;
- if (BIT(m_keyb, 0)) ret = input_port_read(machine(), "KEY0");
- else if (BIT(m_keyb, 1)) ret = input_port_read(machine(), "KEY1");
- else if (BIT(m_keyb, 2)) ret = input_port_read(machine(), "KEY2");
- else if (BIT(m_keyb, 3)) ret = input_port_read(machine(), "KEY3");
- else if (BIT(m_keyb, 4)) ret = input_port_read(machine(), "KEY4");
+ if (BIT(m_keyb, 0)) ret = ioport("KEY0")->read();
+ else if (BIT(m_keyb, 1)) ret = ioport("KEY1")->read();
+ else if (BIT(m_keyb, 2)) ret = ioport("KEY2")->read();
+ else if (BIT(m_keyb, 3)) ret = ioport("KEY3")->read();
+ else if (BIT(m_keyb, 4)) ret = ioport("KEY4")->read();
else logerror("%06x: warning, unknown bits read, keyb = %02x\n", cpu_get_pc(&space.device()), m_keyb);
m_keyb <<= 1;
@@ -2746,11 +2746,11 @@ READ8_MEMBER(dynax_state::mjmyster_keyb_r)
READ8_MEMBER(dynax_state::mjmyster_dsw_r)
{
- if (!BIT(m_dsw_sel, 0)) return input_port_read(machine(), "DSW4");
- if (!BIT(m_dsw_sel, 1)) return input_port_read(machine(), "DSW3");
- if (!BIT(m_dsw_sel, 2)) return input_port_read(machine(), "DSW2");
- if (!BIT(m_dsw_sel, 3)) return input_port_read(machine(), "DSW1");
- if (!BIT(m_dsw_sel, 4)) return input_port_read(machine(), "DSW5");
+ if (!BIT(m_dsw_sel, 0)) return ioport("DSW4")->read();
+ if (!BIT(m_dsw_sel, 1)) return ioport("DSW3")->read();
+ if (!BIT(m_dsw_sel, 2)) return ioport("DSW2")->read();
+ if (!BIT(m_dsw_sel, 3)) return ioport("DSW1")->read();
+ if (!BIT(m_dsw_sel, 4)) return ioport("DSW5")->read();
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(&space.device()), m_dsw_sel);
return 0xff;
}
@@ -2841,11 +2841,11 @@ static READ8_DEVICE_HANDLER( hginga_dsw_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->m_dsw_sel, 0)) return input_port_read(device->machine(), "DSW4");
- if (!BIT(state->m_dsw_sel, 1)) return input_port_read(device->machine(), "DSW3");
- if (!BIT(state->m_dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
- if (!BIT(state->m_dsw_sel, 3)) return input_port_read(device->machine(), "DSW1");
- if (!BIT(state->m_dsw_sel, 4)) return input_port_read(device->machine(), "DSW5");
+ if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW4")->read();
+ if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW3")->read();
+ if (!BIT(state->m_dsw_sel, 2)) return state->ioport("DSW2")->read();
+ if (!BIT(state->m_dsw_sel, 3)) return state->ioport("DSW1")->read();
+ if (!BIT(state->m_dsw_sel, 4)) return state->ioport("DSW5")->read();
logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine().describe_context(), state->m_dsw_sel);
return 0xff;
@@ -2862,8 +2862,8 @@ READ8_MEMBER(dynax_state::hginga_coins_r)
switch (m_input_sel)
{
- case 0x20: return input_port_read(machine(), "SYSTEM");
- case 0x21: return input_port_read(machine(), "BET");
+ case 0x20: return ioport("SYSTEM")->read();
+ case 0x21: return ioport("BET")->read();
case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
case 0x23: return m_coins;
}
@@ -2912,11 +2912,11 @@ READ8_MEMBER(dynax_state::hginga_input_r)
// player 1
case 0xa1:
- return input_port_read(machine(), keynames0[m_keyb++]);
+ return ioport(keynames0[m_keyb++])->read();
// player 2
case 0xa2:
- return input_port_read(machine(), keynames1[m_keyb++]);
+ return ioport(keynames1[m_keyb++])->read();
}
logerror("%04x: input_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
return 0xff;
@@ -2988,11 +2988,11 @@ static UINT8 hgokou_player_r( address_space *space, int player )
dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 hopper_bit = ((state->m_hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
- if (!BIT(state->m_input_sel, 0)) return input_port_read(space->machine(), player ? "KEY5" : "KEY0") | hopper_bit;
- if (!BIT(state->m_input_sel, 1)) return input_port_read(space->machine(), player ? "KEY6" : "KEY1") | hopper_bit;
- if (!BIT(state->m_input_sel, 2)) return input_port_read(space->machine(), player ? "KEY7" : "KEY2") | hopper_bit;
- if (!BIT(state->m_input_sel, 3)) return input_port_read(space->machine(), player ? "KEY8" : "KEY3") | hopper_bit;
- if (!BIT(state->m_input_sel, 4)) return input_port_read(space->machine(), player ? "KEY9" : "KEY4") | hopper_bit;
+ if (!BIT(state->m_input_sel, 0)) return state->ioport(player ? "KEY5" : "KEY0")->read() | hopper_bit;
+ if (!BIT(state->m_input_sel, 1)) return state->ioport(player ? "KEY6" : "KEY1")->read() | hopper_bit;
+ if (!BIT(state->m_input_sel, 2)) return state->ioport(player ? "KEY7" : "KEY2")->read() | hopper_bit;
+ if (!BIT(state->m_input_sel, 3)) return state->ioport(player ? "KEY8" : "KEY3")->read() | hopper_bit;
+ if (!BIT(state->m_input_sel, 4)) return state->ioport(player ? "KEY9" : "KEY4")->read() | hopper_bit;
return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
}
@@ -3007,7 +3007,7 @@ READ8_MEMBER(dynax_state::hgokou_input_r)
switch (m_dsw_sel)
{
- case 0x20: return input_port_read(machine(), "SYSTEM");
+ case 0x20: return ioport("SYSTEM")->read();
case 0x21: return hgokou_player_r(&space, 1);
case 0x22: return hgokou_player_r(&space, 0);
case 0x23: return m_coins;
@@ -3170,12 +3170,12 @@ READ8_MEMBER(dynax_state::hparadis_input_r)
switch (m_input_sel)
{
- case 0x00: return input_port_read(machine(), "P1");
- case 0x01: return input_port_read(machine(), "P2");
- case 0x02: return input_port_read(machine(), "SYSTEM");
+ case 0x00: return ioport("P1")->read();
+ case 0x01: return ioport("P2")->read();
+ case 0x02: return ioport("SYSTEM")->read();
case 0x0d: return 0x00;
- case 0x80: return input_port_read(machine(), keynames0[m_keyb++]); // P1 (Keys)
- case 0x81: return input_port_read(machine(), keynames1[m_keyb++]); // P2 (Keys)
+ case 0x80: return ioport(keynames0[m_keyb++])->read(); // P1 (Keys)
+ case 0x81: return ioport(keynames1[m_keyb++])->read(); // P2 (Keys)
}
logerror("%06x: warning, unknown bits read, input_sel = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
return 0xff;
@@ -3184,11 +3184,11 @@ READ8_MEMBER(dynax_state::hparadis_input_r)
READ8_MEMBER(dynax_state::hparadis_dsw_r)
{
- if (!BIT(m_dsw_sel, 0)) return input_port_read(machine(), "DSW1");
- if (!BIT(m_dsw_sel, 1)) return input_port_read(machine(), "DSW2");
+ if (!BIT(m_dsw_sel, 0)) return ioport("DSW1")->read();
+ if (!BIT(m_dsw_sel, 1)) return ioport("DSW2")->read();
if (!BIT(m_dsw_sel, 2)) return 0xff;
if (!BIT(m_dsw_sel, 3)) return 0xff;
- if (!BIT(m_dsw_sel, 4)) return input_port_read(machine(), "DSW3");
+ if (!BIT(m_dsw_sel, 4)) return ioport("DSW3")->read();
return 0xff;
}
@@ -3246,7 +3246,7 @@ READ8_MEMBER(dynax_state::mjmywrld_coins_r)
switch (m_input_sel)
{
- case 0x80: return input_port_read(machine(), "SYSTEM");
+ case 0x80: return ioport("SYSTEM")->read();
case 0x81: return 0x00;
case 0x82: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x83: return 0x00;
@@ -3316,8 +3316,8 @@ READ16_MEMBER(dynax_state::akamaru_dsw_r)
{
UINT16 dsw = 0;
- if (m_dsw_sel16[1] == 0xff) dsw |= input_port_read(machine(), "DSW1");
- if (m_dsw_sel16[0] == 0xff) dsw |= input_port_read(machine(), "DSW2");
+ if (m_dsw_sel16[1] == 0xff) dsw |= ioport("DSW1")->read();
+ if (m_dsw_sel16[0] == 0xff) dsw |= ioport("DSW2")->read();
return dsw;
}
@@ -3402,11 +3402,11 @@ READ8_MEMBER(dynax_state::mjflove_keyb_r)
{
UINT8 val = 0xff;
- if (!BIT(m_keyb, 0)) val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
- else if (!BIT(m_keyb, 1)) val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
- else if (!BIT(m_keyb, 2)) val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
- else if (!BIT(m_keyb, 3)) val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
- else if (!BIT(m_keyb, 4)) val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
+ if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read();
+ else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read();
+ else if (!BIT(m_keyb, 2)) val = ioport(offset ? "KEY7" : "KEY2")->read();
+ else if (!BIT(m_keyb, 3)) val = ioport(offset ? "KEY8" : "KEY3")->read();
+ else if (!BIT(m_keyb, 4)) val = ioport(offset ? "KEY9" : "KEY4")->read();
return val;
}
@@ -3524,13 +3524,13 @@ READ8_MEMBER(dynax_state::sryudens_keyb_r)
{
UINT8 val = 0x3f;
- if (!BIT(m_keyb, 0)) val = input_port_read(machine(), offset ? "KEY5" : "KEY0");
- else if (!BIT(m_keyb, 1)) val = input_port_read(machine(), offset ? "KEY6" : "KEY1");
- else if (!BIT(m_keyb, 2)) val = input_port_read(machine(), offset ? "KEY7" : "KEY2");
- else if (!BIT(m_keyb, 3)) val = input_port_read(machine(), offset ? "KEY8" : "KEY3");
- else if (!BIT(m_keyb, 4)) val = input_port_read(machine(), offset ? "KEY9" : "KEY4");
+ if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read();
+ else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read();
+ else if (!BIT(m_keyb, 2)) val = ioport(offset ? "KEY7" : "KEY2")->read();
+ else if (!BIT(m_keyb, 3)) val = ioport(offset ? "KEY8" : "KEY3")->read();
+ else if (!BIT(m_keyb, 4)) val = ioport(offset ? "KEY9" : "KEY4")->read();
- val |= input_port_read(machine(), offset ? "HOPPER" : "BET");
+ val |= ioport(offset ? "HOPPER" : "BET")->read();
if (offset)
val &= 0x7f; // bit 7 = blitter busy
return val;
@@ -3600,13 +3600,13 @@ READ8_MEMBER(dynax_state::daimyojn_keyb1_r)
{
UINT8 val = 0x3f;
- if (!BIT(m_keyb, 0)) val = input_port_read(machine(), "KEY0");
- else if (!BIT(m_keyb, 1)) val = input_port_read(machine(), "KEY1");
- else if (!BIT(m_keyb, 2)) val = input_port_read(machine(), "KEY2");
- else if (!BIT(m_keyb, 3)) val = input_port_read(machine(), "KEY3");
- else if (!BIT(m_keyb, 4)) val = input_port_read(machine(), "KEY4");
+ if (!BIT(m_keyb, 0)) val = ioport("KEY0")->read();
+ else if (!BIT(m_keyb, 1)) val = ioport("KEY1")->read();
+ else if (!BIT(m_keyb, 2)) val = ioport("KEY2")->read();
+ else if (!BIT(m_keyb, 3)) val = ioport("KEY3")->read();
+ else if (!BIT(m_keyb, 4)) val = ioport("KEY4")->read();
- val |= input_port_read(machine(), "BET");
+ val |= ioport("BET")->read();
return val;
}
@@ -3614,13 +3614,13 @@ READ8_MEMBER(dynax_state::daimyojn_keyb2_r)
{
UINT8 val = 0x3f;
- if (!BIT(m_keyb, 0)) val = input_port_read(machine(), "KEY5");
- else if (!BIT(m_keyb, 1)) val = input_port_read(machine(), "KEY6");
- else if (!BIT(m_keyb, 2)) val = input_port_read(machine(), "KEY7");
- else if (!BIT(m_keyb, 3)) val = input_port_read(machine(), "KEY8");
- else if (!BIT(m_keyb, 4)) val = input_port_read(machine(), "KEY9");
+ if (!BIT(m_keyb, 0)) val = ioport("KEY5")->read();
+ else if (!BIT(m_keyb, 1)) val = ioport("KEY6")->read();
+ else if (!BIT(m_keyb, 2)) val = ioport("KEY7")->read();
+ else if (!BIT(m_keyb, 3)) val = ioport("KEY8")->read();
+ else if (!BIT(m_keyb, 4)) val = ioport("KEY9")->read();
- val |= input_port_read(machine(), "HOPPER");
+ val |= ioport("HOPPER")->read();
return val;
}
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index 90baa9cc663..a003c06c896 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -690,7 +690,7 @@ static INPUT_PORTS_START( ddragon )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddragon_state,sub_cpu_busy, NULL)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2023,25 +2023,25 @@ static DRIVER_INIT( toffy )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::toffy_bankswitch_w),state));
/* the program rom has a simple bitswap encryption */
- rom = machine.root_device().memregion("maincpu")->base();
- length = machine.root_device().memregion("maincpu")->bytes();
+ rom = state->memregion("maincpu")->base();
+ length = state->memregion("maincpu")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 6,7,5,4,3,2,1,0);
/* and the fg gfx ... */
- rom = machine.root_device().memregion("gfx1")->base();
- length = machine.root_device().memregion("gfx1")->bytes();
+ rom = state->memregion("gfx1")->base();
+ length = state->memregion("gfx1")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0);
/* and the sprites gfx */
- rom = machine.root_device().memregion("gfx2")->base();
- length = machine.root_device().memregion("gfx2")->bytes();
+ rom = state->memregion("gfx2")->base();
+ length = state->memregion("gfx2")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1);
/* and the bg gfx */
- rom = machine.root_device().memregion("gfx3")->base();
+ rom = state->memregion("gfx3")->base();
length = state->memregion("gfx3")->bytes();
for (i = 0; i < length / 2; i++)
{
@@ -2058,7 +2058,7 @@ static DRIVER_INIT( ddragon6809 )
int i;
UINT8 *dst,*src;
- src = machine.root_device().memregion("chars")->base();
+ src = state->memregion("chars")->base();
dst = state->memregion("gfx1")->base();
for (i = 0; i < 0x8000; i++)
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index 50366dfc566..bc546432bea 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -365,7 +365,7 @@ static INPUT_PORTS_START( ctribe )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -420,10 +420,10 @@ static INPUT_PORTS_START( ctribe )
PORT_DIPSETTING( 0x0800, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:5" )
PORT_DIPNAME( 0x2000, 0x2000, "Stage Clear Energy" ) PORT_DIPLOCATION("SW2:6")
- PORT_DIPSETTING( 0x2000, "0" ) PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0100)
- PORT_DIPSETTING( 0x0000, "50" ) PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0100)
- PORT_DIPSETTING( 0x2000, "100" ) PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, "150" ) PORT_CONDITION("IN3", 0x0100, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x2000, "0" ) PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0100)
+ PORT_DIPSETTING( 0x0000, "50" ) PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0100)
+ PORT_DIPSETTING( 0x2000, "100" ) PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, "150" ) PORT_CONDITION("IN3", 0x0100, EQUALS, 0x0000)
PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN3")
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index 1d276e389ae..6ada2b4e34a 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -47,11 +47,11 @@ Dip locations and factory settings verified with US manual
READ16_MEMBER(deadang_state::ghunter_trackball_low_r)
{
- return (input_port_read(machine(), "TRACKX") & 0xff) | ((input_port_read(machine(), "TRACKY") & 0xff) << 8);
+ return (ioport("TRACKX")->read() & 0xff) | ((ioport("TRACKY")->read() & 0xff) << 8);
}
READ16_MEMBER(deadang_state::ghunter_trackball_high_r)
{
- return ((input_port_read(machine(), "TRACKX") & 0x0f00) >> 4) | (input_port_read(machine(), "TRACKY") & 0x0f00);
+ return ((ioport("TRACKX")->read() & 0x0f00) >> 4) | (ioport("TRACKY")->read() & 0x0f00);
}
/* Memory Maps */
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index 062d2964194..314e4ac228d 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -337,13 +337,13 @@ READ16_MEMBER(dec0_state::slyspy_controls_r)
switch (offset<<1)
{
case 0: /* Dip Switches */
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 2: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 4: /* Credits */
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
logerror("Unknown control read at 30c000 %d\n", offset);
@@ -693,7 +693,7 @@ static INPUT_PORTS_START( dec0 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( dec1 )
@@ -719,7 +719,7 @@ static INPUT_PORTS_START( dec1 )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -977,7 +977,7 @@ static INPUT_PORTS_START( hippodrm )
PORT_DIPUNUSED_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" ) // Always OFF
PORT_START("VBLANK")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( ffantasy )
@@ -1121,7 +1121,7 @@ static INPUT_PORTS_START( bouldash )
PORT_INCLUDE( dec1 )
PORT_MODIFY("SYSTEM")
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) /* extremely slow palette fades with ACTIVE_HIGH */
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* extremely slow palette fades with ACTIVE_HIGH */
PORT_START("DSW")
/* Different Coinage. Just a few combinations from manual, the rest was figured out */
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index cc10df49c9f..452e15b6fae 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -96,28 +96,28 @@ WRITE8_MEMBER(dec8_state::i8751_reset_w)
READ8_MEMBER(dec8_state::gondo_player_1_r)
{
- int val = 1 << input_port_read(machine(), "AN0");
+ int val = 1 << ioport("AN0")->read();
switch (offset)
{
case 0: /* Rotary low byte */
return ~(val & 0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~val >> 4) & 0xf0) | (input_port_read(machine(), "IN0") & 0xf);
+ return ((~val >> 4) & 0xf0) | (ioport("IN0")->read() & 0xf);
}
return 0xff;
}
READ8_MEMBER(dec8_state::gondo_player_2_r)
{
- int val = 1 << input_port_read(machine(), "AN1");
+ int val = 1 << ioport("AN1")->read();
switch (offset)
{
case 0: /* Rotary low byte */
return ~(val & 0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~val >> 4) & 0xf0) | (input_port_read(machine(), "IN1") & 0xf);
+ return ((~val >> 4) & 0xf0) | (ioport("IN1")->read() & 0xf);
}
return 0xff;
}
@@ -183,8 +183,8 @@ WRITE8_MEMBER(dec8_state::lastmisn_i8751_w)
}
/* Coins are controlled by the i8751 */
- if ((input_port_read(machine(), "IN2") & 3) == 3) m_latch = 1;
- if ((input_port_read(machine(), "IN2") & 1) != 1 && m_latch)
+ if ((ioport("IN2")->read() & 3) == 3) m_latch = 1;
+ if ((ioport("IN2")->read() & 1) != 1 && m_latch)
{
m_coin1++;
m_latch = 0;
@@ -196,7 +196,7 @@ WRITE8_MEMBER(dec8_state::lastmisn_i8751_w)
m_credits+=m_cred1;
}
}
- if ((input_port_read(machine(), "IN2") & 2) != 2 && m_latch)
+ if ((ioport("IN2")->read() & 2) != 2 && m_latch)
{
m_coin2++;
m_latch = 0;
@@ -246,9 +246,9 @@ WRITE8_MEMBER(dec8_state::shackled_i8751_w)
}
/* Coins are controlled by the i8751 */
- if (/*(input_port_read(machine(), "IN2") & 3) == 3*/!m_latch) { m_latch = 1; m_coin1 = m_coin2 = 0; }
- if ((input_port_read(machine(), "IN2") & 1) != 1 && m_latch) { m_coin1 = 1; m_latch = 0; }
- if ((input_port_read(machine(), "IN2") & 2) != 2 && m_latch) { m_coin2 = 1; m_latch = 0; }
+ if (/*(ioport("IN2")->read() & 3) == 3*/!m_latch) { m_latch = 1; m_coin1 = m_coin2 = 0; }
+ if ((ioport("IN2")->read() & 1) != 1 && m_latch) { m_coin1 = 1; m_latch = 0; }
+ if ((ioport("IN2")->read() & 2) != 2 && m_latch) { m_coin2 = 1; m_latch = 0; }
if (m_i8751_value == 0x0102) m_i8751_return = 0; /* ??? */
if (m_i8751_value == 0x0101) m_i8751_return = 0; /* ??? */
@@ -284,8 +284,8 @@ WRITE8_MEMBER(dec8_state::csilver_i8751_w)
}
/* Coins are controlled by the i8751 */
- if ((input_port_read(machine(), "IN2") & 3) == 3) m_latch = 1;
- if ((input_port_read(machine(), "IN2") & 1) != 1 && m_latch)
+ if ((ioport("IN2")->read() & 3) == 3) m_latch = 1;
+ if ((ioport("IN2")->read() & 1) != 1 && m_latch)
{
m_coin1++;
m_latch = 0;
@@ -297,7 +297,7 @@ WRITE8_MEMBER(dec8_state::csilver_i8751_w)
m_credits+=m_cred1;
}
}
- if ((input_port_read(machine(), "IN2") & 2) != 2 && m_latch)
+ if ((ioport("IN2")->read() & 2) != 2 && m_latch)
{
m_coin2++;
m_latch = 0;
@@ -351,8 +351,8 @@ WRITE8_MEMBER(dec8_state::srdarwin_i8751_w)
}
/* Coins are controlled by the i8751 */
- if ((input_port_read(machine(), "I8751") & 3) == 3) m_latch = 1;
- if ((input_port_read(machine(), "I8751") & 1) != 1 && m_latch)
+ if ((ioport("I8751")->read() & 3) == 3) m_latch = 1;
+ if ((ioport("I8751")->read() & 1) != 1 && m_latch)
{
m_coin1++;
m_latch = 0;
@@ -362,7 +362,7 @@ WRITE8_MEMBER(dec8_state::srdarwin_i8751_w)
m_credits+=m_cred1;
}
}
- if ((input_port_read(machine(), "I8751") & 2) != 2 && m_latch)
+ if ((ioport("I8751")->read() & 2) != 2 && m_latch)
{
m_coin2++;
m_latch = 0;
@@ -934,7 +934,7 @@ READ8_MEMBER(dec8_state::dec8_mcu_from_main_r)
case 2:
return 0xff;
case 3:
- return input_port_read(machine(), "I8751");
+ return ioport("I8751")->read();
}
return 0xff; //compile safe.
@@ -1005,7 +1005,7 @@ static INPUT_PORTS_START( lastmisn )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
@@ -1095,7 +1095,7 @@ static INPUT_PORTS_START( shackled )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
@@ -1189,7 +1189,7 @@ static INPUT_PORTS_START( gondo )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("I8751") /* hooked up on the i8751 */
/* Low 4 bits not connected on schematics */
@@ -1260,7 +1260,7 @@ static INPUT_PORTS_START( garyoret )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* shoot */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) /* bomb */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("I8751") /* hooked up on the (fake) i8751 */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
@@ -1344,7 +1344,7 @@ static INPUT_PORTS_START( ghostb )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -1473,7 +1473,7 @@ static INPUT_PORTS_START( csilver )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
@@ -1560,7 +1560,7 @@ static INPUT_PORTS_START( oscar )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) /* table at 0xf8e3 (4 * 2 bytes : coins then credits) */
@@ -1649,7 +1649,7 @@ static INPUT_PORTS_START( srdarwin )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("I8751") /* Fake port for i8751 */
@@ -1743,7 +1743,7 @@ static INPUT_PORTS_START( cobracom )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) /* code at 0x88b7 in 'cobracom', 0x890e in 'cobracomj' */
@@ -1966,8 +1966,8 @@ static INTERRUPT_GEN( gondo_interrupt )
static INTERRUPT_GEN( oscar_interrupt )
{
dec8_state *state = device->machine().driver_data<dec8_state>();
- if ((input_port_read(device->machine(), "IN2") & 0x7) == 0x7) state->m_latch = 1;
- if (state->m_latch && (input_port_read(device->machine(), "IN2") & 0x7) != 0x7)
+ if ((state->ioport("IN2")->read() & 0x7) == 0x7) state->m_latch = 1;
+ if (state->m_latch && (state->ioport("IN2")->read() & 0x7) != 0x7)
{
state->m_latch = 0;
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index d4331375694..6464b4e0983 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -89,7 +89,7 @@ WRITE32_MEMBER(deco156_state::hvysmsh_eeprom_w)
if (ACCESSING_BITS_0_7)
{
m_oki2->set_bank_base(0x40000 * (data & 0x7));
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
@@ -189,7 +189,7 @@ static INPUT_PORTS_START( hvysmsh )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00080000, IP_ACTIVE_LOW )
- PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -231,7 +231,7 @@ static INPUT_PORTS_START( wcvol95 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00080000, IP_ACTIVE_LOW )
- PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index e037dbdfb9e..f59db7d2a04 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -358,9 +358,9 @@ READ32_MEMBER(deco32_state::captaven_prot_r)
{
/* Protection/IO chip 75, same as Lemmings & Robocop 2 */
switch (offset<<2) {
- case 0x0a0: return input_port_read(machine(), "IN0"); /* Player 1 & 2 controls */
- case 0x158: return input_port_read(machine(), "IN1"); /* Player 3 & 4 controls */
- case 0xed4: return input_port_read(machine(), "IN2"); /* Misc */
+ case 0x0a0: return ioport("IN0")->read(); /* Player 1 & 2 controls */
+ case 0x158: return ioport("IN1")->read(); /* Player 3 & 4 controls */
+ case 0xed4: return ioport("IN2")->read(); /* Misc */
}
logerror("%08x: Unmapped protection read %04x\n",cpu_get_pc(&space.device()),offset<<2);
@@ -370,14 +370,14 @@ READ32_MEMBER(deco32_state::captaven_prot_r)
READ32_MEMBER(deco32_state::captaven_soundcpu_r)
{
/* Top byte - top bit low == sound cpu busy, bottom word is dips */
- return 0xffff0000 | input_port_read(machine(), "DSW");
+ return 0xffff0000 | ioport("DSW")->read();
}
READ32_MEMBER(deco32_state::fghthist_control_r)
{
switch (offset) {
- case 0: return 0xffff0000 | input_port_read(machine(), "IN0");
- case 1: return 0xffff0000 | input_port_read(machine(), "IN1"); //check top bits??
+ case 0: return 0xffff0000 | ioport("IN0")->read();
+ case 1: return 0xffff0000 | ioport("IN1")->read(); //check top bits??
case 2: return 0xfffffffe | machine().device<eeprom_device>("eeprom")->read_bit();
}
@@ -405,7 +405,7 @@ WRITE32_MEMBER(deco32_state::fghthist_eeprom_w)
READ32_MEMBER(deco32_state::dragngun_service_r)
{
// logerror("%08x:Read service\n",cpu_get_pc(&space.device()));
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
}
READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
@@ -413,8 +413,8 @@ READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
//logerror("%08x:Read gun %d\n",cpu_get_pc(&space.device()),offset);
//return ((machine().rand()%0xffff)<<16) | machine().rand()%0xffff;
if (offset) /* Mirror of player 1 and player 2 fire buttons */
- return input_port_read(machine(), "IN4") | ((machine().rand()%0xff)<<16);
- return input_port_read(machine(), "IN3") | input_port_read(machine(), "LIGHT0_X") | (input_port_read(machine(), "LIGHT0_X")<<16) | (input_port_read(machine(), "LIGHT0_X")<<24); //((machine().rand()%0xff)<<16);
+ return ioport("IN4")->read() | ((machine().rand()%0xff)<<16);
+ return ioport("IN3")->read() | ioport("LIGHT0_X")->read() | (ioport("LIGHT0_X")->read()<<16) | (ioport("LIGHT0_X")->read()<<24); //((machine().rand()%0xff)<<16);
}
READ32_MEMBER(deco32_state::dragngun_prot_r)
@@ -427,9 +427,9 @@ READ32_MEMBER(deco32_state::dragngun_prot_r)
//definitely vblank in locked load
switch (offset<<1) {
- case 0x140/2: return 0xffff0000 | input_port_read(machine(), "IN0"); /* IN0 */
- case 0xadc/2: return 0xffff0000 | input_port_read(machine(), "IN1") | m_strobe; /* IN1 */
- case 0x6a0/2: return 0xffff0000 | input_port_read(machine(), "DSW"); /* IN2 (Dip switch) */
+ case 0x140/2: return 0xffff0000 | ioport("IN0")->read(); /* IN0 */
+ case 0xadc/2: return 0xffff0000 | ioport("IN1")->read() | m_strobe; /* IN1 */
+ case 0x6a0/2: return 0xffff0000 | ioport("DSW")->read(); /* IN2 (Dip switch) */
}
return 0xffffffff;
}
@@ -439,10 +439,10 @@ READ32_MEMBER(dragngun_state::dragngun_lightgun_r)
{
/* Ports 0-3 are read, but seem unused */
switch (m_dragngun_lightgun_port) {
- case 4: return input_port_read(machine(), "LIGHT0_X");
- case 5: return input_port_read(machine(), "LIGHT1_X");
- case 6: return input_port_read(machine(), "LIGHT0_Y");
- case 7: return input_port_read(machine(), "LIGHT1_Y");
+ case 4: return ioport("LIGHT0_X")->read();
+ case 5: return ioport("LIGHT1_X")->read();
+ case 6: return ioport("LIGHT0_Y")->read();
+ case 7: return ioport("LIGHT1_Y")->read();
}
// logerror("Illegal lightgun port %d read \n",m_dragngun_lightgun_port);
@@ -479,8 +479,8 @@ static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w )
READ32_MEMBER(deco32_state::tattass_prot_r)
{
switch (offset<<1) {
- case 0x280: return input_port_read(machine(), "IN0") << 16;
- case 0x4c4: return input_port_read(machine(), "IN1") << 16;
+ case 0x280: return ioport("IN0")->read() << 16;
+ case 0x4c4: return ioport("IN1")->read() << 16;
case 0x35a: return m_tattass_eprom_bit << 16;
}
@@ -637,8 +637,8 @@ READ32_MEMBER(deco32_state::nslasher_prot_r)
{
switch (offset<<1) {
- case 0x280: return input_port_read(machine(), "IN0") << 16| 0xffff; /* IN0 */
- case 0x4c4: return input_port_read(machine(), "IN1") << 16| 0xffff; /* IN1 */
+ case 0x280: return ioport("IN0")->read() << 16| 0xffff; /* IN0 */
+ case 0x4c4: return ioport("IN1")->read() << 16| 0xffff; /* IN1 */
case 0x35a: return (machine().device<eeprom_device>("eeprom")->read_bit()<< 16) | 0xffff; // Debug switch in low word??
}
@@ -1208,7 +1208,7 @@ static INPUT_PORTS_START( fghthist )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1287,7 +1287,7 @@ static INPUT_PORTS_START( dragngun )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_START("IN2")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) //check //test BUTTON F2
@@ -1363,7 +1363,7 @@ static INPUT_PORTS_START( lockload )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_START("IN2")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK ) //IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNUSED ) //check //test BUTTON F2
@@ -1413,7 +1413,7 @@ static INPUT_PORTS_START( tattass )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1451,7 +1451,7 @@ static INPUT_PORTS_START( nslasher )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c
index 6e36d1098d0..b192cdd992f 100644
--- a/src/mame/drivers/deco_ld.c
+++ b/src/mame/drivers/deco_ld.c
@@ -286,7 +286,7 @@ static INPUT_PORTS_START( cobra )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_DIPNAME( 0x01, 0x00, "SYS1" )
@@ -442,7 +442,7 @@ static INPUT_PORTS_START( rblaster )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_DIPNAME( 0x01, 0x00, "SYS1" )
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index 49193b71d81..8683af4c63d 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -110,7 +110,7 @@
READ32_MEMBER(deco_mlc_state::test2_r)
{
// if (offset==0)
-// return input_port_read(machine(), "IN0"); //0xffffffff;
+// return ioport("IN0")->read(); //0xffffffff;
// logerror("%08x: Test2_r %d\n",cpu_get_pc(&space.device()),offset);
return machine().rand(); //0xffffffff;
}
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index 62b23f275ac..4bc90931622 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -239,7 +239,7 @@ static INPUT_PORTS_START( decocass )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
PORT_START("DSW2") /* Start with all Unknown as each can change per game, except for Country Code */
PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1") /* Most Dipswitch Settings sheets show this as "Number of Players" (Lives) */
@@ -1475,8 +1475,8 @@ static DRIVER_INIT( decocass )
static DRIVER_INIT( decocrom )
{
decocass_state *state = machine.driver_data<decocass_state>();
- int romlength = machine.root_device().memregion("user3")->bytes();
- UINT8 *rom = machine.root_device().memregion("user3")->base();
+ int romlength = state->memregion("user3")->bytes();
+ UINT8 *rom = state->memregion("user3")->base();
int i;
state->m_decrypted2 = auto_alloc_array(machine, UINT8, romlength);
diff --git a/src/mame/drivers/deshoros.c b/src/mame/drivers/deshoros.c
index a3c9c76cd0d..3653d0f6018 100644
--- a/src/mame/drivers/deshoros.c
+++ b/src/mame/drivers/deshoros.c
@@ -81,9 +81,9 @@ READ8_MEMBER(deshoros_state::io_r)
switch(offset)
{
case 0x00: return 0xff; //printer read
- case 0x03: return input_port_read(machine(), "KEY0" );
- case 0x04: return input_port_read(machine(), "KEY1" );
- case 0x05: return input_port_read(machine(), "SYSTEM" );
+ case 0x03: return ioport("KEY0" )->read();
+ case 0x04: return ioport("KEY1" )->read();
+ case 0x05: return ioport("SYSTEM" )->read();
case 0x0a: return m_io_ram[offset]; //"buzzer" 0 read
case 0x0b: return m_io_ram[offset]; //"buzzer" 1 read
}
diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c
index 84d70b16988..69f55526e0d 100644
--- a/src/mame/drivers/destroyr.c
+++ b/src/mame/drivers/destroyr.c
@@ -146,7 +146,7 @@ static TIMER_CALLBACK( destroyr_frame_callback )
state->m_potsense[1] = 0;
/* PCB supports two dials, but cab has only got one */
- machine.scheduler().timer_set(machine.primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(state->ioport("PADDLE")->read()), FUNC(destroyr_dial_callback));
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
}
@@ -237,12 +237,12 @@ READ8_MEMBER(destroyr_state::destroyr_input_r)
if (offset & 1)
{
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
else
{
- UINT8 ret = input_port_read(machine(), "IN0");
+ UINT8 ret = ioport("IN0")->read();
if (m_potsense[0] && m_potmask[0])
ret |= 4;
@@ -297,7 +297,7 @@ static INPUT_PORTS_START( destroyr )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:4,3")
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index 5a53d6a3b8a..87d75104606 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -195,7 +195,7 @@ READ32_MEMBER(dgpix_state::vblank_r)
{
/* burn a bunch of cycles because this is polled frequently during busy loops */
device_eat_cycles(&space.device(), 100);
- return input_port_read(machine(), "VBLANK");
+ return ioport("VBLANK")->read();
}
static ADDRESS_MAP_START( cpu_map, AS_PROGRAM, 32, dgpix_state )
@@ -250,7 +250,7 @@ static NVRAM_HANDLER( flashroms )
static INPUT_PORTS_START( dgpix )
PORT_START("VBLANK")
- PORT_BIT( 0x00000003, IP_ACTIVE_LOW, IPT_VBLANK ) //value 2 is used by fmaniac3
+ PORT_BIT( 0x00000003, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //value 2 is used by fmaniac3
PORT_BIT( 0xfffffffc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("INPUTS")
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index f2565929dc3..c78e77c2247 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -50,7 +50,7 @@ static INPUT_PORTS_START( dietgo )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c
index d833b8f54a3..fd2f974dab3 100644
--- a/src/mame/drivers/discoboy.c
+++ b/src/mame/drivers/discoboy.c
@@ -560,7 +560,7 @@ ROM_END
static DRIVER_INIT( discoboy )
{
discoboy_state *state = machine.driver_data<discoboy_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 *AUDIO = state->memregion("audiocpu")->base();
memset(state->m_ram_1, 0, sizeof(state->m_ram_1));
diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c
index 834b592d1ee..1e98df56c0b 100644
--- a/src/mame/drivers/djboy.c
+++ b/src/mame/drivers/djboy.c
@@ -347,9 +347,9 @@ READ8_MEMBER(djboy_state::beast_p2_r)
switch ((m_beast_p0 >> 2) & 3)
{
- case 0: return input_port_read(machine(), "IN1");
- case 1: return input_port_read(machine(), "IN2");
- case 2: return input_port_read(machine(), "IN0");
+ case 0: return ioport("IN1")->read();
+ case 1: return ioport("IN2")->read();
+ case 2: return ioport("IN0")->read();
default: return 0xff;
}
}
@@ -363,8 +363,8 @@ READ8_MEMBER(djboy_state::beast_p3_r)
{
UINT8 dsw = 0;
- UINT8 dsw1 = ~input_port_read(machine(), "DSW1");
- UINT8 dsw2 = ~input_port_read(machine(), "DSW2");
+ UINT8 dsw1 = ~ioport("DSW1")->read();
+ UINT8 dsw2 = ~ioport("DSW2")->read();
switch ((m_beast_p0 >> 5) & 3)
{
@@ -522,8 +522,8 @@ static const kaneko_pandora_interface djboy_pandora_config =
static MACHINE_START( djboy )
{
djboy_state *state = machine.driver_data<djboy_state>();
- UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
- UINT8 *CPU1 = machine.root_device().memregion("cpu1")->base();
+ UINT8 *MAIN = state->memregion("maincpu")->base();
+ UINT8 *CPU1 = state->memregion("cpu1")->base();
UINT8 *CPU2 = state->memregion("cpu2")->base();
state->membank("bank1")->configure_entries(0, 4, &MAIN[0x00000], 0x2000);
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index 18ab3d630af..42ac7e18658 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -229,13 +229,13 @@ READ32_MEMBER(djmain_state::v_rom_r)
READ8_MEMBER(djmain_state::inp1_r)
{
static const char *const portnames[] = { "DSW3", "BTN3", "BTN2", "BTN1" };
- return input_port_read(machine(), portnames[ offset & 0x03 ]);
+ return ioport(portnames[ offset & 0x03 ])->read();
}
READ8_MEMBER(djmain_state::inp2_r)
{
static const char *const portnames[] = { "DSW1", "DSW2", "UNK2", "UNK1" };
- return input_port_read(machine(), portnames[ offset & 0x03 ]);
+ return ioport(portnames[ offset & 0x03 ])->read();
}
READ32_MEMBER(djmain_state::turntable_r)
@@ -248,7 +248,7 @@ READ32_MEMBER(djmain_state::turntable_r)
UINT8 pos;
int delta;
- pos = input_port_read_safe(machine(), ttnames[m_turntable_select], 0);
+ pos = ioport(ttnames[m_turntable_select])->read_safe(0);
delta = pos - m_turntable_last_pos[m_turntable_select];
if (delta < -128)
delta += 256;
@@ -660,11 +660,11 @@ INPUT_PORTS_END
#ifdef PRIORITY_EASINESS_TO_PLAY
#define BEATMANIA_DSW3_STAGES_OLD \
- PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
PORT_DIPSETTING( 0x00, "4 Stages" ) \
PORT_DIPSETTING( 0x08, "5 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -672,7 +672,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x08, "5 Stages" )
#else
#define BEATMANIA_DSW3_STAGES_OLD \
- PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Normal Mode Stages" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
PORT_DIPSETTING( 0x1c, "4 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x0c, "4 Stages" ) /* duplicated setting */ \
@@ -681,7 +681,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x18, "4 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x00, "4 Stages" ) \
PORT_DIPSETTING( 0x08, "5 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -694,11 +694,11 @@ INPUT_PORTS_END
#ifdef PRIORITY_EASINESS_TO_PLAY
#define BEATMANIA_DSW3_STAGES_MIDDLE( str ) \
- PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x10, "3 / 3 Stages" ) \
PORT_DIPSETTING( 0x00, "4 / 4 Stages" ) \
PORT_DIPSETTING( 0x08, "5 / 5 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -706,7 +706,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x08, "5 Stages" )
#else
#define BEATMANIA_DSW3_STAGES_MIDDLE( str ) \
- PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x10, "3 / 3 Stages" ) \
PORT_DIPSETTING( 0x1c, "4 / 4 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x0c, "4 / 4 Stages" ) /* duplicated setting */ \
@@ -715,7 +715,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x18, "4 / 4 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x00, "4 / 4 Stages" ) \
PORT_DIPSETTING( 0x08, "5 / 5 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -728,11 +728,11 @@ INPUT_PORTS_END
#ifdef PRIORITY_EASINESS_TO_PLAY
#define BEATMANIA_DSW3_STAGES_NEW( str ) \
- PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x10, "3 / 2 Stages" ) \
PORT_DIPSETTING( 0x00, "4 / 3 Stages" ) \
PORT_DIPSETTING( 0x08, "5 / 3 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -740,7 +740,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x08, "5 Stages" )
#else
#define BEATMANIA_DSW3_STAGES_NEW( str ) \
- PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x10, "3 / 2 Stages" ) \
PORT_DIPSETTING( 0x1c, "4 / 3 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x0c, "4 / 3 Stages" ) /* duplicated setting */ \
@@ -749,7 +749,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x18, "4 / 3 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x00, "4 / 3 Stages" ) \
PORT_DIPSETTING( 0x08, "5 / 3 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -853,10 +853,10 @@ INPUT_PORTS_END
PORT_START("DSW3") \
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) /* bit 7,6 don't exist */ \
BEATMANIA_DSW3_EVENTMODE /* SW3:1 */ \
- PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x1c, "3 / 3 Stages" ) \
PORT_DIPSETTING( 0x10, "4 / 4 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -869,7 +869,7 @@ INPUT_PORTS_END
PORT_START("DSW3") \
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) /* bit 7,6 don't exist */ \
BEATMANIA_DSW3_EVENTMODE /* SW3:1 */ \
- PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, str ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x1c, "3 / 3 Stages" ) \
PORT_DIPSETTING( 0x0c, "3 / 3 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x14, "3 / 3 Stages" ) /* duplicated setting */ \
@@ -878,7 +878,7 @@ INPUT_PORTS_END
PORT_DIPSETTING( 0x08, "3 / 3 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x00, "3 / 3 Stages" ) /* duplicated setting */ \
PORT_DIPSETTING( 0x10, "4 / 4 Stages" ) \
- PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
+ PORT_DIPNAME( 0x1c, 0x1c, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:4,3,2") \
PORT_DIPSETTING( 0x0c, "1 Stage" ) \
PORT_DIPSETTING( 0x14, "2 Stages" ) \
PORT_DIPSETTING( 0x10, "3 Stages" ) \
@@ -914,21 +914,21 @@ static INPUT_PORTS_START( bm2ndmix )
/* "Free Hidden Songs" 3-3=On 3-6=On */
PORT_MODIFY("DSW3")
BEATMANIA_DSW3_EVENTMODE /* SW3:1 */
- PORT_DIPNAME( 0x10, 0x10, "Unused (Used if Event Mode)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:2")
+ PORT_DIPNAME( 0x10, 0x10, "Unused (Used if Event Mode)" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:2")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, "Free Hidden Songs (step1of2)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:3")
+ PORT_DIPNAME( 0x08, 0x08, "Free Hidden Songs (step1of2)" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:3")
PORT_DIPSETTING( 0x08, "No (Off)" )
PORT_DIPSETTING( 0x00, "Yes (On)" )
- PORT_DIPNAME( 0x18, 0x18, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:3,2")
+ PORT_DIPNAME( 0x18, 0x18, "Event Mode Stages" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:3,2")
PORT_DIPSETTING( 0x18, "1 Stage" )
PORT_DIPSETTING( 0x08, "2 Stages" )
PORT_DIPSETTING( 0x10, "3 Stages" )
PORT_DIPSETTING( 0x00, "4 Stages" )
- PORT_DIPNAME( 0x01, 0x01, "Free Hidden Songs (step2of2)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
+ PORT_DIPNAME( 0x01, 0x01, "Free Hidden Songs (step2of2)" ) PORT_CONDITION("DSW3", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
PORT_DIPSETTING( 0x01, "No (Off)" )
PORT_DIPSETTING( 0x00, "Yes (On)" )
- PORT_DIPNAME( 0x01, 0x01, "Unused (Used if not Event Mode)" ) PORT_CONDITION("DSW3", 0x20, PORTCOND_NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
+ PORT_DIPNAME( 0x01, 0x01, "Unused (Used if not Event Mode)" ) PORT_CONDITION("DSW3", 0x20, NOTEQUALS, 0x20) PORT_DIPLOCATION("SW3:6")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* "Free Hidden Songs" 3-3=On 3-6=On */
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index 6d8756b0371..e2b5f35dc30 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -579,7 +579,7 @@ READ8_MEMBER(dkong_state::dkong_in2_r)
UINT8 mcustatus = latch8_bit4_q_r(m_dev_vp2, 0);
UINT8 r;
- r = (input_port_read(machine(), "IN2") & 0xBF) | (mcustatus << 6);
+ r = (ioport("IN2")->read() & 0xBF) | (mcustatus << 6);
coin_counter_w(machine(), offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coin */
@@ -592,7 +592,7 @@ READ8_MEMBER(dkong_state::dkongjr_in2_r)
UINT8 r;
- r = (input_port_read(machine(), "IN2") & 0xBF) | 0x40;
+ r = (ioport("IN2")->read() & 0xBF) | 0x40;
coin_counter_w(machine(), offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coin */
@@ -724,30 +724,30 @@ WRITE8_MEMBER(dkong_state::dkong3_2a03_reset_w)
READ8_MEMBER(dkong_state::strtheat_inputport_0_r)
{
- if(input_port_read(machine(), "DSW0") & 0x40)
+ if(ioport("DSW0")->read() & 0x40)
{
/* Joystick inputs */
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
else
{
/* Steering Wheel inputs */
- return (input_port_read(machine(), "IN0") & ~3) | (input_port_read(machine(), "IN4") & 3);
+ return (ioport("IN4")->read() & 3);
}
}
READ8_MEMBER(dkong_state::strtheat_inputport_1_r)
{
- if(input_port_read(machine(), "DSW0") & 0x40)
+ if(ioport("DSW0")->read() & 0x40)
{
/* Joystick inputs */
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
else
{
/* Steering Wheel inputs */
- return (input_port_read(machine(), "IN1") & ~3) | (input_port_read(machine(), "IN5") & 3);
+ return (ioport("IN5")->read() & 3);
}
}
@@ -1196,7 +1196,7 @@ static INPUT_PORTS_START( hunchbkd )
PORT_DIPSETTING( 0x0c, "80000" )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
@@ -1240,7 +1240,7 @@ static INPUT_PORTS_START( shootgal )
PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
@@ -1273,7 +1273,7 @@ static INPUT_PORTS_START( sbdk )
PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
@@ -1292,7 +1292,7 @@ static INPUT_PORTS_START( herbiedk )
PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
@@ -1326,7 +1326,7 @@ static INPUT_PORTS_START( herodk )
PORT_DIPSETTING( 0x0c, "3" )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
@@ -1424,7 +1424,7 @@ static INPUT_PORTS_START( spclforc )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
@@ -1457,7 +1457,7 @@ static INPUT_PORTS_START( 8ballact )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:!8" )
PORT_START("SENSE") /* Sense */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( dkong_config )
INPUT_PORTS_END
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 5c18a3db1af..8daef61526d 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -260,7 +260,7 @@ static MACHINE_RESET( dlair )
/* determine the laserdisc player from the DIP switches */
if (state->m_laserdisc_type == LASERDISC_TYPE_VARIABLE)
{
- int newtype = (input_port_read(machine, "DSW2") & 0x08) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
+ int newtype = (state->ioport("DSW2")->read() & 0x08) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
laserdisc_set_type(state->m_laserdisc, newtype);
}
#endif
@@ -555,14 +555,14 @@ static INPUT_PORTS_START( dlair )
PORT_DIPSETTING( 0x40, "PAYG3" )
PORT_DIPSETTING( 0x60, "PAYG4" )
PORT_DIPNAME( 0x90, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("B:8,5")
- PORT_DIPSETTING( 0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
- PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
- PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
- PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
+ PORT_DIPSETTING( 0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
+ PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
+ PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
+ PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
PORT_START("CONTROLS")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
@@ -657,14 +657,14 @@ static INPUT_PORTS_START( dleuro )
PORT_DIPSETTING( 0x40, "PAYG3" )
PORT_DIPSETTING( 0x60, "PAYG4" )
PORT_DIPNAME( 0x90, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("B:8,5s")
- PORT_DIPSETTING( 0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
- PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
- PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
- PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x04)
+ PORT_DIPSETTING( 0x00, "Increase after 5" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, "Increase after 9" ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Hard ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
+ PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
+ PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
+ PORT_DIPSETTING( 0x90, DEF_STR( Easy ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x04)
INPUT_PORTS_END
diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c
index 8dc44c02903..439e9b853cf 100644
--- a/src/mame/drivers/dmndrby.c
+++ b/src/mame/drivers/dmndrby.c
@@ -91,14 +91,14 @@ READ8_MEMBER(dmndrby_state::input_r)
{
switch(offset & 7)
{
- case 0: return input_port_read(machine(), "IN0");
- case 1: return input_port_read(machine(), "IN1");
- case 2: return input_port_read(machine(), "IN2");
- case 3: return input_port_read(machine(), "IN3");
- case 4: return input_port_read(machine(), "IN4");
- case 5: return input_port_read(machine(), "IN5");
- case 6: return input_port_read(machine(), "IN6");
- case 7: return input_port_read(machine(), "IN7");
+ case 0: return ioport("IN0")->read();
+ case 1: return ioport("IN1")->read();
+ case 2: return ioport("IN2")->read();
+ case 3: return ioport("IN3")->read();
+ case 4: return ioport("IN4")->read();
+ case 5: return ioport("IN5")->read();
+ case 6: return ioport("IN6")->read();
+ case 7: return ioport("IN7")->read();
}
return 0xff;
@@ -209,14 +209,14 @@ static INPUT_PORTS_START( dderby )
PORT_DIPSETTING( 0x04, "480p (cash + tokens)" )
PORT_DIPSETTING( 0x00, "600p (cash + tokens)" )
PORT_DIPNAME( 0x30, 0x00, "Percentage Payout" )
- PORT_DIPSETTING( 0x00, "76%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
- PORT_DIPSETTING( 0x10, "80%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
- PORT_DIPSETTING( 0x20, "86%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
- PORT_DIPSETTING( 0x30, "88%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
- PORT_DIPSETTING( 0x00, "78%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
- PORT_DIPSETTING( 0x10, "82%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
- PORT_DIPSETTING( 0x20, "86%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
- PORT_DIPSETTING( 0x30, "90%" ) PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x00, "76%" ) PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x10, "80%" ) PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x20, "86%" ) PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x30, "88%" ) PORT_CONDITION("DSW1", 0xc0, LESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x00, "78%" ) PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x10, "82%" ) PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x20, "86%" ) PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
+ PORT_DIPSETTING( 0x30, "90%" ) PORT_CONDITION("DSW1", 0xc0, NOTLESSTHAN, 0x80)
PORT_DIPNAME( 0xc0, 0x80, "Price Per Game" )
PORT_DIPSETTING( 0x00, "2p" )
PORT_DIPSETTING( 0x40, "5p" )
diff --git a/src/mame/drivers/dogfgt.c b/src/mame/drivers/dogfgt.c
index e098ed4840e..c93191ac264 100644
--- a/src/mame/drivers/dogfgt.c
+++ b/src/mame/drivers/dogfgt.c
@@ -160,7 +160,7 @@ There is a side note for these two: "Change both together"
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
/* Manual shows:
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index ff8a70e12d3..67fe0f8f31f 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -327,23 +327,23 @@ static INPUT_PORTS_START( dooyongz80_generic )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:5,6")
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
- PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,8")
- PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWA", 0x02, PORTCOND_NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWA", 0x02, NOTEQUALS, 0x02)
PORT_START("DSWB")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:1,2")
@@ -413,23 +413,23 @@ static INPUT_PORTS_START( dooyongm68_generic )
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:5,6")
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:1,2")
PORT_DIPSETTING( 0x0000, "1" )
PORT_DIPSETTING( 0x0200, "2" )
@@ -536,7 +536,7 @@ static INPUT_PORTS_START( gulfstrm )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_VBLANK ) /* ??? */
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* ??? */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -605,14 +605,14 @@ static INPUT_PORTS_START( rshark )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, NOTEQUALS, 0x0002)
INPUT_PORTS_END
static INPUT_PORTS_START( superx )
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index 4a874fa6c6c..4c61198a7f7 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -18,7 +18,7 @@ static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
for (i = 0; i < 2; i++)
{
- switch (input_port_read(timer.machine(), portnames[i]))
+ switch (timer.machine().root_device().ioport(portnames[i])->read())
{
case 0x01: state->m_gear[i] = 1; break;
case 0x02: state->m_gear[i] = 2; break;
@@ -29,7 +29,7 @@ static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
}
/* watchdog is disabled during service mode */
- timer.machine().watchdog_enable(input_port_read(timer.machine(), "IN0") & 0x20);
+ timer.machine().watchdog_enable(timer.machine().root_device().ioport("IN0")->read() & 0x20);
}
@@ -112,7 +112,7 @@ WRITE8_MEMBER(dragrace_state::dragrace_misc_clear_w)
READ8_MEMBER(dragrace_state::dragrace_input_r)
{
- int val = input_port_read(machine(), "IN2");
+ int val = ioport("IN2")->read();
static const char *const portnames[] = { "IN0", "IN1" };
UINT8 maskA = 1 << (offset % 8);
@@ -122,7 +122,7 @@ READ8_MEMBER(dragrace_state::dragrace_input_r)
for (i = 0; i < 2; i++)
{
- int in = input_port_read(machine(), portnames[i]);
+ int in = ioport(portnames[i])->read();
if (m_gear[i] != 0)
in &= ~(1 << m_gear[i]);
@@ -145,7 +145,7 @@ READ8_MEMBER(dragrace_state::dragrace_steering_r)
for (i = 0; i < 2; i++)
{
- int dial = input_port_read(machine(), dialnames[i]);
+ int dial = ioport(dialnames[i])->read();
bitA[i] = ((dial + 1) / 2) & 1;
bitB[i] = ((dial + 0) / 2) & 1;
diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c
index 5b45506663f..5ab2b5fd711 100644
--- a/src/mame/drivers/dribling.c
+++ b/src/mame/drivers/dribling.c
@@ -68,11 +68,11 @@ static READ8_DEVICE_HANDLER( input_mux0_r )
/* low value in the given bit selects */
if (!(state->m_input_mux & 0x01))
- return input_port_read(device->machine(), "MUX0");
+ return state->ioport("MUX0")->read();
else if (!(state->m_input_mux & 0x02))
- return input_port_read(device->machine(), "MUX1");
+ return state->ioport("MUX1")->read();
else if (!(state->m_input_mux & 0x04))
- return input_port_read(device->machine(), "MUX2");
+ return state->ioport("MUX2")->read();
return 0xff;
}
diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c
index db76e138a51..9d82b4451c9 100644
--- a/src/mame/drivers/drw80pkr.c
+++ b/src/mame/drivers/drw80pkr.c
@@ -284,7 +284,7 @@ READ8_MEMBER(drw80pkr_state::drw80pkr_io_r)
{
// TODO: Get Input Port Values
- kbdin = ((input_port_read(machine(), "IN1") & 0xaf ) << 8) + input_port_read(machine(), "IN0");
+ kbdin = ((ioport("IN1")->read() & 0xaf ) << 8) + ioport("IN0")->read();
switch (kbdin)
{
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index f3a79f60f92..28deb4277c7 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -432,7 +432,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_input_w)
READ8_MEMBER(dunhuang_state::dunhuang_service_r)
{
- return input_port_read(machine(), "SERVICE")
+ return ioport("SERVICE")->read()
| ((m_hopper && !(machine().primary_screen->frame_number() % 10)) ? 0x00 : 0x08) // bit 3: hopper sensor
| 0x80 // bit 7 low -> tiles block transferrer busy
;
@@ -441,21 +441,21 @@ READ8_MEMBER(dunhuang_state::dunhuang_service_r)
static READ8_DEVICE_HANDLER( dunhuang_dsw_r )
{
dunhuang_state *state = device->machine().driver_data<dunhuang_state>();
- if (!(state->m_input & 0x01)) return input_port_read(device->machine(), "DSW1");
- if (!(state->m_input & 0x02)) return input_port_read(device->machine(), "DSW2");
- if (!(state->m_input & 0x04)) return input_port_read(device->machine(), "DSW3");
- if (!(state->m_input & 0x08)) return input_port_read(device->machine(), "DSW4");
- if (!(state->m_input & 0x10)) return input_port_read(device->machine(), "DSW5");
+ if (!(state->m_input & 0x01)) return state->ioport("DSW1")->read();
+ if (!(state->m_input & 0x02)) return state->ioport("DSW2")->read();
+ if (!(state->m_input & 0x04)) return state->ioport("DSW3")->read();
+ if (!(state->m_input & 0x08)) return state->ioport("DSW4")->read();
+ if (!(state->m_input & 0x10)) return state->ioport("DSW5")->read();
logerror("%s: warning, unknown dsw bits read, input = %02x\n", device->machine().describe_context(), state->m_input);
return 0xff;
}
READ8_MEMBER(dunhuang_state::dunhuang_input_r)
{
- if (!(m_input & 0x01)) return input_port_read(machine(), "IN0");
- if (!(m_input & 0x02)) return input_port_read(machine(), "IN1");
- if (!(m_input & 0x04)) return input_port_read(machine(), "IN2");
- if (!(m_input & 0x08)) return input_port_read(machine(), "IN3");
- if (!(m_input & 0x10)) return input_port_read(machine(), "IN4");
+ if (!(m_input & 0x01)) return ioport("IN0")->read();
+ if (!(m_input & 0x02)) return ioport("IN1")->read();
+ if (!(m_input & 0x04)) return ioport("IN2")->read();
+ if (!(m_input & 0x08)) return ioport("IN3")->read();
+ if (!(m_input & 0x10)) return ioport("IN4")->read();
logerror("%s: warning, unknown input bits read, input = %02x\n", machine().describe_context(), m_input);
return 0xff;
}
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index b5c391efd34..dfe8a7d9769 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -1290,7 +1290,7 @@ static DRIVER_INIT(dwarfd)
UINT8 *src, *dst;
/* expand gfx roms */
- src = machine.root_device().memregion("gfx1")->base();
+ src = state->memregion("gfx1")->base();
dst = state->memregion("gfx2")->base();
for (i = 0; i < 0x4000; i++)
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index ab60a610672..d18608c24d1 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -235,11 +235,11 @@ READ8_MEMBER(dynax_state::hanamai_keyboard_0_r)
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY0");
- if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY1");
- if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY2");
- if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY3");
- if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY4");
+ if (!BIT(m_keyb, 0)) res &= ioport("KEY0")->read();
+ if (!BIT(m_keyb, 1)) res &= ioport("KEY1")->read();
+ if (!BIT(m_keyb, 2)) res &= ioport("KEY2")->read();
+ if (!BIT(m_keyb, 3)) res &= ioport("KEY3")->read();
+ if (!BIT(m_keyb, 4)) res &= ioport("KEY4")->read();
return res;
}
@@ -249,11 +249,11 @@ READ8_MEMBER(dynax_state::hanamai_keyboard_1_r)
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY5");
- if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY6");
- if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY7");
- if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY8");
- if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY9");
+ if (!BIT(m_keyb, 0)) res &= ioport("KEY5")->read();
+ if (!BIT(m_keyb, 1)) res &= ioport("KEY6")->read();
+ if (!BIT(m_keyb, 2)) res &= ioport("KEY7")->read();
+ if (!BIT(m_keyb, 3)) res &= ioport("KEY8")->read();
+ if (!BIT(m_keyb, 4)) res &= ioport("KEY9")->read();
return res;
}
@@ -621,7 +621,7 @@ READ8_MEMBER(dynax_state::hjingi_keyboard_0_r)
READ8_MEMBER(dynax_state::hjingi_keyboard_1_r)
{
- return hanamai_keyboard_1_r(space, 0) | input_port_read(machine(), "BET");
+ return hanamai_keyboard_1_r(space, 0) | ioport("BET")->read();
}
static ADDRESS_MAP_START( hjingi_mem_map, AS_PROGRAM, 8, dynax_state )
@@ -715,7 +715,7 @@ READ8_MEMBER(dynax_state::yarunara_input_r)
switch (m_input_sel)
{
case 0x00:
- return input_port_read(machine(), "COINS"); // coins
+ return ioport("COINS")->read(); // coins
case 0x02:
return 0xff; // bit 7 must be 1. Bit 2?
@@ -732,12 +732,12 @@ READ8_MEMBER(dynax_state::yarunara_input_r)
// player 2
case 0x01: //quiztvqq
case 0x81:
- return input_port_read(machine(), keynames1[m_keyb++]);
+ return ioport(keynames1[m_keyb++])->read();
// player 1
case 0x02: //quiztvqq
case 0x82:
- return input_port_read(machine(), keynames0[m_keyb++]);
+ return ioport(keynames0[m_keyb++])->read();
default:
return 0xff;
@@ -1050,7 +1050,7 @@ ADDRESS_MAP_END
READ8_MEMBER(dynax_state::mjelctrn_keyboard_1_r)
{
- return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (input_port_read(machine(), "FAKE") ? 0x40 : 0);
+ return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (ioport("FAKE")->read() ? 0x40 : 0);
}
READ8_MEMBER(dynax_state::mjelctrn_dsw_r)
@@ -1058,7 +1058,7 @@ READ8_MEMBER(dynax_state::mjelctrn_dsw_r)
int dsw = (m_keyb & 0xc0) >> 6;
static const char *const dswnames[] = { "DSW0", "DSW1", "DSW3", "DSW4" };
- return input_port_read(machine(), dswnames[dsw]);
+ return ioport(dswnames[dsw])->read();
}
WRITE8_MEMBER(dynax_state::mjelctrn_blitter_ack_w)
@@ -1124,11 +1124,11 @@ static WRITE8_DEVICE_HANDLER( htengoku_dsw_w )
static READ8_DEVICE_HANDLER( htengoku_dsw_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->m_dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
- if (!BIT(state->m_dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
- if (!BIT(state->m_dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
- if (!BIT(state->m_dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
- if (!BIT(state->m_dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
+ if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW0")->read();
+ if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW1")->read();
+ if (!BIT(state->m_dsw_sel, 2)) return state->ioport("DSW2")->read();
+ if (!BIT(state->m_dsw_sel, 3)) return state->ioport("DSW3")->read();
+ if (!BIT(state->m_dsw_sel, 4)) return state->ioport("DSW4")->read();
logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine().describe_context(), state->m_dsw_sel);
return 0xff;
@@ -1165,8 +1165,8 @@ READ8_MEMBER(dynax_state::htengoku_input_r)
switch (m_input_sel)
{
- case 0x81: return input_port_read(machine(), keynames1[m_keyb++]);
- case 0x82: return input_port_read(machine(), keynames0[m_keyb++]);
+ case 0x81: return ioport(keynames1[m_keyb++])->read();
+ case 0x82: return ioport(keynames0[m_keyb++])->read();
case 0x0d: return 0xff; // unused
}
logerror("%04x: input_r with select = %02x\n", cpu_get_pc(&space.device()), m_input_sel);
@@ -1178,7 +1178,7 @@ READ8_MEMBER(dynax_state::htengoku_coin_r)
switch (m_input_sel)
{
- case 0x00: return input_port_read(machine(), "COINS");
+ case 0x00: return ioport("COINS")->read();
case 0x01: return 0xff; //?
case 0x02: return 0xbf | ((m_hopper && !(machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6)); // bit 7 = blitter busy, bit 6 = hopper
case 0x03: return m_coins;
@@ -1290,7 +1290,7 @@ READ8_MEMBER(dynax_state::tenkai_ip_r)
switch (m_input_sel)
{
case 0x00:
- return input_port_read(machine(), "COINS"); // coins
+ return ioport("COINS")->read(); // coins
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(&space.device()), m_input_sel, offset);
@@ -1309,13 +1309,13 @@ READ8_MEMBER(dynax_state::tenkai_ip_r)
case 0x81:
if (m_keyb >= 5)
logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(&space.device()), m_keyb);
- return 0xff;//input_port_read(machine(), keynames1[m_keyb++]);
+ return 0xff;//ioport(keynames1[m_keyb++])->read();
// player 1
case 0x82:
if (m_keyb >= 5)
logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(&space.device()), m_keyb);
- return input_port_read(machine(), keynames0[m_keyb++]);
+ return ioport(keynames0[m_keyb++])->read();
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(&space.device()), m_input_sel, offset);
@@ -1337,11 +1337,11 @@ static READ8_DEVICE_HANDLER( tenkai_dsw_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->m_dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
- if (!BIT(state->m_dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
- if (!BIT(state->m_dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
- if (!BIT(state->m_dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
- if (!BIT(state->m_dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
+ if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW0")->read();
+ if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW1")->read();
+ if (!BIT(state->m_dsw_sel, 2)) return state->ioport("DSW2")->read();
+ if (!BIT(state->m_dsw_sel, 3)) return state->ioport("DSW3")->read();
+ if (!BIT(state->m_dsw_sel, 4)) return state->ioport("DSW4")->read();
logerror("%s: unmapped dsw %02x read\n", device->machine().describe_context(), state->m_dsw_sel);
return 0xff;
@@ -1533,11 +1533,11 @@ READ8_MEMBER(dynax_state::gekisha_keyboard_0_r)
{
int res = 0x3f;
- if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY0");
- if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY1");
- if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY2");
- if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY3");
- if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY4");
+ if (!BIT(m_keyb, 0)) res &= ioport("KEY0")->read();
+ if (!BIT(m_keyb, 1)) res &= ioport("KEY1")->read();
+ if (!BIT(m_keyb, 2)) res &= ioport("KEY2")->read();
+ if (!BIT(m_keyb, 3)) res &= ioport("KEY3")->read();
+ if (!BIT(m_keyb, 4)) res &= ioport("KEY4")->read();
return res;
}
@@ -1545,14 +1545,14 @@ READ8_MEMBER(dynax_state::gekisha_keyboard_1_r)
{
int res = 0x3f;
- if (!BIT(m_keyb, 0)) res &= input_port_read(machine(), "KEY5");
- if (!BIT(m_keyb, 1)) res &= input_port_read(machine(), "KEY6");
- if (!BIT(m_keyb, 2)) res &= input_port_read(machine(), "KEY7");
- if (!BIT(m_keyb, 3)) res &= input_port_read(machine(), "KEY8");
- if (!BIT(m_keyb, 4)) res &= input_port_read(machine(), "KEY9");
+ if (!BIT(m_keyb, 0)) res &= ioport("KEY5")->read();
+ if (!BIT(m_keyb, 1)) res &= ioport("KEY6")->read();
+ if (!BIT(m_keyb, 2)) res &= ioport("KEY7")->read();
+ if (!BIT(m_keyb, 3)) res &= ioport("KEY8")->read();
+ if (!BIT(m_keyb, 4)) res &= ioport("KEY9")->read();
// bit 6
- res |= input_port_read(machine(), "BET");
+ res |= ioport("BET")->read();
// bit 7 = blitter busy
@@ -1586,13 +1586,13 @@ READ8_MEMBER(dynax_state::gekisha_8000_r)
switch (offset + 0x8000)
{
- case 0x8061: return input_port_read(machine(), "COINS");
+ case 0x8061: return ioport("COINS")->read();
case 0x8062: return gekisha_keyboard_1_r(space, 0);
case 0x8063: return gekisha_keyboard_0_r(space, 0);
- case 0x8064: return input_port_read(machine(), "DSW1");
- case 0x8065: return input_port_read(machine(), "DSW3");
- case 0x8066: return input_port_read(machine(), "DSW4");
- case 0x8067: return input_port_read(machine(), "DSW2");
+ case 0x8064: return ioport("DSW1")->read();
+ case 0x8065: return ioport("DSW3")->read();
+ case 0x8066: return ioport("DSW4")->read();
+ case 0x8067: return ioport("DSW2")->read();
}
logerror("%04x: unmapped offset %04X read with rombank=%02X\n",cpu_get_pc(&space.device()), offset, m_rombank);
@@ -4630,7 +4630,7 @@ static const msm5205_interface jantouki_msm5205_interface =
static MACHINE_START( jantouki )
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *MAIN = state->memregion("maincpu")->base();
UINT8 *SOUND = state->memregion("soundcpu")->base();
state->membank("bank1")->configure_entries(0, 0x10, &MAIN[0x8000], 0x8000);
diff --git a/src/mame/drivers/dynduke.c b/src/mame/drivers/dynduke.c
index 40e3eae7ae3..66a73903534 100644
--- a/src/mame/drivers/dynduke.c
+++ b/src/mame/drivers/dynduke.c
@@ -139,18 +139,18 @@ static INPUT_PORTS_START( dynduke )
PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0001, "Mode 1" )
PORT_DIPSETTING( 0x0000, "Mode 2" )
- PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0000)
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x0018, 0x0008, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPNAME( 0x0018, 0x0008, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0000)
PORT_DIPSETTING( 0x0018, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0001)
+ PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0001)
PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x001a, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x001c, DEF_STR( 2C_1C ) )
diff --git a/src/mame/drivers/embargo.c b/src/mame/drivers/embargo.c
index eaa28cedb57..b4e14642d3a 100644
--- a/src/mame/drivers/embargo.c
+++ b/src/mame/drivers/embargo.c
@@ -72,7 +72,7 @@ static SCREEN_UPDATE_RGB32( embargo )
READ8_MEMBER(embargo_state::input_port_bit_r)
{
- return (input_port_read(machine(), "IN1") << (7 - m_input_select)) & 0x80;
+ return (ioport("IN1")->read() << (7 - m_input_select)) & 0x80;
}
@@ -97,14 +97,14 @@ READ8_MEMBER(embargo_state::dial_r)
if (m_dial_enable_1 && !m_dial_enable_2)
{
- lo = input_port_read(machine(), "DIAL0");
- hi = input_port_read(machine(), "DIAL1");
+ lo = ioport("DIAL0")->read();
+ hi = ioport("DIAL1")->read();
}
if (m_dial_enable_2 && !m_dial_enable_1)
{
- lo = input_port_read(machine(), "DIAL2");
- hi = input_port_read(machine(), "DIAL3");
+ lo = ioport("DIAL2")->read();
+ hi = ioport("DIAL3")->read();
}
lo = 12 * lo / 256;
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 5bdb653fa97..7967f276442 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -365,7 +365,7 @@ READ8_MEMBER(enigma2_state::dip_switch_r)
if (m_protection_data != 0xff)
ret = m_protection_data ^ 0x88;
else
- ret = input_port_read(machine(), "DSW");
+ ret = ioport("DSW")->read();
break;
case 0x02:
@@ -413,22 +413,22 @@ static WRITE8_DEVICE_HANDLER( protection_data_w )
WRITE8_MEMBER(enigma2_state::enigma2_flip_screen_w)
{
- m_flip_screen = ((data >> 5) & 0x01) && ((input_port_read(machine(), "DSW") & 0x20) == 0x20);
+ m_flip_screen = ((data >> 5) & 0x01) && ((ioport("DSW")->read() & 0x20) == 0x20);
}
CUSTOM_INPUT_MEMBER(enigma2_state::p1_controls_r)
{
- return input_port_read(machine(), "P1CONTROLS");
+ return ioport("P1CONTROLS")->read();
}
CUSTOM_INPUT_MEMBER(enigma2_state::p2_controls_r)
{
if (m_flip_screen)
- return input_port_read(machine(), "P2CONTROLS");
+ return ioport("P2CONTROLS")->read();
else
- return input_port_read(machine(), "P1CONTROLS");
+ return ioport("P1CONTROLS")->read();
}
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index c74ecf8b501..2dc54a53225 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -112,7 +112,7 @@ READ32_MEMBER(eolith_state::eolith_custom_r)
*/
eolith_speedup_read(&space);
- return (input_port_read(machine(), "IN0") & ~0x300) | (machine().rand() & 0x300);
+ return (ioport("IN0")->read() & ~0x300) | (machine().rand() & 0x300);
}
WRITE32_MEMBER(eolith_state::systemcontrol_w)
@@ -121,7 +121,7 @@ WRITE32_MEMBER(eolith_state::systemcontrol_w)
coin_counter_w(machine(), 0, data & m_coin_counter_bit);
set_led_status(machine(), 0, data & 1);
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
// bit 0x100 and 0x040 ?
}
@@ -129,8 +129,8 @@ WRITE32_MEMBER(eolith_state::systemcontrol_w)
READ32_MEMBER(eolith_state::hidctch3_pen1_r)
{
//320 x 240
- int xpos = input_port_read(machine(), "PEN_X_P1");
- int ypos = input_port_read(machine(), "PEN_Y_P1");
+ int xpos = ioport("PEN_X_P1")->read();
+ int ypos = ioport("PEN_Y_P1")->read();
return xpos + (ypos*168*2);
}
@@ -138,8 +138,8 @@ READ32_MEMBER(eolith_state::hidctch3_pen1_r)
READ32_MEMBER(eolith_state::hidctch3_pen2_r)
{
//320 x 240
- int xpos = input_port_read(machine(), "PEN_X_P2");
- int ypos = input_port_read(machine(), "PEN_Y_P2");
+ int xpos = ioport("PEN_X_P2")->read();
+ int ypos = ioport("PEN_Y_P2")->read();
return xpos + (ypos*168*2);
}
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 812eafb67bd..54826bb0602 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -51,7 +51,7 @@ WRITE16_MEMBER(eolith16_state::eeprom_w)
m_vbuffer = (data & 0x80) >> 7;
coin_counter_w(machine(), 0, data & 1);
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
//data & 0x100 and data & 0x004 always set
}
@@ -59,7 +59,7 @@ WRITE16_MEMBER(eolith16_state::eeprom_w)
READ16_MEMBER(eolith16_state::eolith16_custom_r)
{
eolith_speedup_read(&space);
- return input_port_read(machine(), "SPECIAL");
+ return ioport("SPECIAL")->read();
}
diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c
index 9d409424318..f6d23f59c70 100644
--- a/src/mame/drivers/eprom.c
+++ b/src/mame/drivers/eprom.c
@@ -76,7 +76,7 @@ static MACHINE_RESET( eprom )
READ16_MEMBER(eprom_state::special_port1_r)
{
- int result = input_port_read(machine(), "260010");
+ int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0004;
if (m_cpu_to_sound_ready) result ^= 0x0008;
@@ -89,7 +89,7 @@ READ16_MEMBER(eprom_state::special_port1_r)
READ16_MEMBER(eprom_state::adc_r)
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- int result = input_port_read(machine(), adcnames[m_last_offset & 3]);
+ int result = ioport(adcnames[m_last_offset & 3])->read();
m_last_offset = offset;
return result;
@@ -245,7 +245,7 @@ static INPUT_PORTS_START( eprom )
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("260010")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
@@ -290,7 +290,7 @@ static INPUT_PORTS_START( klaxp )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_START("260010")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
@@ -319,7 +319,7 @@ static INPUT_PORTS_START( guts )
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("260010") /* 260010 */
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index e9212174c22..030d0207fb3 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -404,7 +404,7 @@ static TIMER_CALLBACK( equites_nmi_callback )
static TIMER_CALLBACK( equites_frq_adjuster_callback )
{
equites_state *state = machine.driver_data<equites_state>();
- UINT8 frq = input_port_read(machine, FRQ_ADJUSTER_TAG);
+ UINT8 frq = state->ioport(FRQ_ADJUSTER_TAG)->read();
msm5232_set_clock(state->m_msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
//popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", state->m_eq8155_port_c, state->m_eq8155_port_a, state->m_ay_port_a, state->m_ay_port_b, state->m_eq_cymbal_ctrl & 15);
@@ -647,7 +647,7 @@ WRITE8_MEMBER(equites_state::equites_8155_w)
#if HVOLTAGE_DEBUG
READ16_MEMBER(equites_state::hvoltage_debug_r)
{
- return(input_port_read(machine(), "FAKE"));
+ return(ioport("FAKE")->read());
}
#endif
diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c
index 8b774442603..544e5c19d44 100644
--- a/src/mame/drivers/ertictac.c
+++ b/src/mame/drivers/ertictac.c
@@ -44,11 +44,11 @@ READ32_MEMBER(ertictac_state::ertictac_podule_r)
switch(offset)
{
- case 0x04/4: return input_port_read(machine(), "DSW1") & 0xff;
- case 0x08/4: return input_port_read(machine(), "DSW2") & 0xff;
- case 0x10/4: return input_port_read(machine(), "SYSTEM") & 0xff;
- case 0x14/4: return input_port_read(machine(), "P2") & 0xff;
- case 0x18/4: return input_port_read(machine(), "P1") & 0xff;
+ case 0x04/4: return ioport("DSW1")->read() & 0xff;
+ case 0x08/4: return ioport("DSW2")->read() & 0xff;
+ case 0x10/4: return ioport("SYSTEM")->read() & 0xff;
+ case 0x14/4: return ioport("P2")->read() & 0xff;
+ case 0x18/4: return ioport("P1")->read() & 0xff;
}
return 0;
@@ -167,22 +167,22 @@ static INPUT_PORTS_START( poizone )
PORT_DIPSETTING( 0x01, "Manual" )
PORT_DIPSETTING( 0x00, "Automatic" )
PORT_DIPNAME( 0x1A, 0x00, "Setting 2" ) PORT_DIPLOCATION("DSW2:3,4,5")
- PORT_DIPSETTING( 0x00, "Extremely Easy - 2:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x02, "Very Easy - 1:30") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x08, "Easy - 2:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x0A, "Normal 1 - 1:30") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, "Normal 2 - 1:45") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x12, "Difficult - 2:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x18, "Very Difficult - 2:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x1A, "Extremely Difficult - 1:30") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "Clear 20% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x02, "Clear 30% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x08, "Clear 40% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x0A, "Clear 50% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x10, "Clear 60% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x12, "Clear 70% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x18, "Clear 80% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x1A, "Clear 90% - 1:00") PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPSETTING( 0x00, "Extremely Easy - 2:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, "Very Easy - 1:30") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x08, "Easy - 2:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x0A, "Normal 1 - 1:30") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, "Normal 2 - 1:45") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x12, "Difficult - 2:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x18, "Very Difficult - 2:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x1A, "Extremely Difficult - 1:30") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "Clear 20% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x02, "Clear 30% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x08, "Clear 40% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x0A, "Clear 50% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x10, "Clear 60% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x12, "Clear 70% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x18, "Clear 80% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x1A, "Clear 90% - 1:00") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DSW2:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW2:6" )
INPUT_PORTS_END
diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c
index 2b4d380e8b8..508f75eee83 100644
--- a/src/mame/drivers/esd16.c
+++ b/src/mame/drivers/esd16.c
@@ -125,7 +125,7 @@ READ16_MEMBER(esd16_state::esd_eeprom_r)
WRITE16_MEMBER(esd16_state::esd_eeprom_w)
{
if (ACCESSING_BITS_8_15)
- input_port_write(machine(), "EEPROMOUT", data, 0xffff);
+ ioport("EEPROMOUT")->write(data, 0xffff);
// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(&space.device()), data, mem_mask);
}
@@ -305,21 +305,21 @@ static INPUT_PORTS_START( multchmp )
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0002)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW", 0x0002, EQUALS, 0x0000)
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) )
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index 9ef89f44487..94efb528157 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -276,32 +276,32 @@ READ8_MEMBER(esripsys_state::g_iobus_r)
return m_cmos_ram[(m_cmos_ram_a10_3 << 3) | (m_cmos_ram_a2_0 & 3)];
case 8:
{
- int keypad = input_port_read(machine(), "KEYPAD_B") | m_keypad_status;
+ int keypad = ioport("KEYPAD_B")->read() | m_keypad_status;
m_keypad_status = 0;
m_io_firq_status = 0;
return keypad;
}
case 9:
{
- return input_port_read(machine(), "KEYPAD_A");
+ return ioport("KEYPAD_A")->read();
}
case 0xa:
{
- int coins = m_coin_latch | (input_port_read(machine(), "COINS") & 0x30);
+ int coins = m_coin_latch | (ioport("COINS")->read() & 0x30);
m_coin_latch = 0;
m_io_firq_status = 0;
return coins;
}
case 0x10:
- return input_port_read(machine(), "IO_1");
+ return ioport("IO_1")->read();
case 0x11:
- return input_port_read(machine(), "JOYSTICK_X");
+ return ioport("JOYSTICK_X")->read();
case 0x12:
- return input_port_read(machine(), "JOYSTICK_Y");
+ return ioport("JOYSTICK_Y")->read();
case 0x16:
return m_io_firq_status;
case 0x18:
- return input_port_read(machine(), "IO_2");
+ return ioport("IO_2")->read();
/* Unused I/O */
case 0x19:
case 0x1a:
@@ -417,7 +417,7 @@ INPUT_CHANGED_MEMBER(esripsys_state::coin_interrupt)
if (newval == 1)
{
m_io_firq_status |= 2;
- m_coin_latch = input_port_read(machine(), "COINS") << 2;
+ m_coin_latch = ioport("COINS")->read() << 2;
cputag_set_input_line(machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
}
}
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index e8dcdabe62a..ad4c667e56b 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -290,7 +290,7 @@ static const ay8910_interface ay8912_interface_3 =
static INTERRUPT_GEN( ettrivia_interrupt )
{
- if( input_port_read(device->machine(), "COIN") & 0x01 )
+ if( device->machine().root_device().ioport("COIN")->read() & 0x01 )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
else
device_set_input_line(device, 0, HOLD_LINE);
diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c
index b25944ef8e5..1beb52222fe 100644
--- a/src/mame/drivers/exerion.c
+++ b/src/mame/drivers/exerion.c
@@ -133,7 +133,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
CUSTOM_INPUT_MEMBER(exerion_state::exerion_controls_r)
{
static const char *const inname[2] = { "P1", "P2" };
- return input_port_read(machine(), inname[m_cocktail_flip]) & 0x3f;
+ return ioport(inname[m_cocktail_flip])->read() & 0x3f;
}
@@ -261,7 +261,7 @@ static INPUT_PORTS_START( exerion )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
PORT_START("DSW1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) ) /* see notes */
PORT_DIPSETTING( 0x0e, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 4C_1C ) )
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index 7dd1aa5b9b2..30122f6da87 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -157,7 +157,7 @@ Fax 1982 6502 FXL, FLA
CUSTOM_INPUT_MEMBER(exidy_state::teetert_input_r)
{
- UINT8 dial = input_port_read(machine(), "DIAL");
+ UINT8 dial = ioport("DIAL")->read();
int result = 0;
result = (dial != m_last_dial) << 4;
@@ -379,7 +379,7 @@ static INPUT_PORTS_START( targ )
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -404,14 +404,14 @@ static INPUT_PORTS_START( rallys )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "2C/1P, 50P Coin/3P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x01, "1C/1P, 50P Coin/6P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x02, "1C/2P, 50P Coin/12P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x03, "1C/3P, 50P Coin/18P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "2C/1P, 50P Coin/3P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x01, "1C/1P, 50P Coin/6P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, "1C/2P, 50P Coin/12P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x03, "1C/3P, 50P Coin/18P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
PORT_DIPNAME( 0x04, 0x00, "Top Score Award" ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x00, "Credit" )
PORT_DIPSETTING( 0x04, "Extended Play" )
@@ -445,14 +445,14 @@ static INPUT_PORTS_START( phantoma )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x80, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "2F/1P, 5F Coin/3P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x01, "1F/1P, 5F Coin/6P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x02, "1F/2P, 5F Coin/12P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x03, "1F/3P, 5F Coin/18P" ) PORT_CONDITION("DSW", 0x80, PORTCOND_NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x80, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "2F/1P, 5F Coin/3P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x01, "1F/1P, 5F Coin/6P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, "1F/2P, 5F Coin/12P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x03, "1F/3P, 5F Coin/18P" ) PORT_CONDITION("DSW", 0x80, NOTEQUALS, 0x00)
INPUT_PORTS_END
@@ -507,7 +507,7 @@ static INPUT_PORTS_START( mtrap )
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Yellow Button")
@@ -569,7 +569,7 @@ static INPUT_PORTS_START( venture )
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -625,7 +625,7 @@ static INPUT_PORTS_START( teetert )
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -685,7 +685,7 @@ static INPUT_PORTS_START( pepper2 )
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -737,7 +737,7 @@ static INPUT_PORTS_START( fax )
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/exidy440.c b/src/mame/drivers/exidy440.c
index be9de4bd273..cbf5768b6f1 100644
--- a/src/mame/drivers/exidy440.c
+++ b/src/mame/drivers/exidy440.c
@@ -282,7 +282,7 @@ CUSTOM_INPUT_MEMBER(exidy440_state::firq_vblank_r)
CUSTOM_INPUT_MEMBER(exidy440_state::hitnmiss_button1_r)
{
/* button 1 shows up in two bits */
- UINT32 button1 = input_port_read(machine(), "HITNMISS_BUTTON1");
+ UINT32 button1 = ioport("HITNMISS_BUTTON1")->read();
return (button1 << 1) | button1;
}
@@ -336,7 +336,7 @@ READ8_MEMBER(exidy440_state::exidy440_input_port_3_r)
{
/* I/O1 accesses clear the CIRQ flip/flop */
cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
- return input_port_read(machine(), "IN3");
+ return ioport("IN3")->read();
}
@@ -424,7 +424,7 @@ READ8_MEMBER(exidy440_state::claypign_protection_r)
READ8_MEMBER(exidy440_state::topsecex_input_port_5_r)
{
- return (input_port_read(machine(), "AN1") & 1) ? 0x01 : 0x02;
+ return (ioport("AN1")->read() & 1) ? 0x01 : 0x02;
}
diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c
index 0f458c7e02c..38ee48121dd 100644
--- a/src/mame/drivers/exprraid.c
+++ b/src/mame/drivers/exprraid.c
@@ -238,7 +238,7 @@ WRITE8_MEMBER(exprraid_state::sound_cpu_command_w)
READ8_MEMBER(exprraid_state::vblank_r)
{
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, exprraid_state )
@@ -288,27 +288,27 @@ INPUT_CHANGED_MEMBER(exprraid_state::coin_inserted_nmi)
static INPUT_PORTS_START( exprraid )
PORT_START("IN0") /* 0x3800 */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0") /* 0x1800 */
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4")
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW0",0x10,EQUALS,0x10)
PORT_DIPNAME( 0x10, 0x10, "Coin Mode" ) PORT_DIPLOCATION("SW1:5") /* see notes */
PORT_DIPSETTING( 0x10, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
@@ -451,7 +451,7 @@ static INTERRUPT_GEN( exprraid_interrupt )
{
exprraid_state *state = device->machine().driver_data<exprraid_state>();
- if ((~input_port_read(device->machine(), "IN2")) & 0xc0)
+ if ((~state->ioport("IN2")->read()) & 0xc0)
{
if (state->m_coin == 0)
{
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index c12e492ee45..ddf2c66ac4c 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -101,7 +101,7 @@ static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 me
UINT16 port;
/* Read the fake input port */
- UINT8 trackball_pos = input_port_read(space->machine(), which ? "DIAL1" : "DIAL0");
+ UINT8 trackball_pos = state->ioport(which ? "DIAL1" : "DIAL0")->read();
/* Calculate the change from the last position. */
UINT8 trackball_diff = state->m_trackball_old[which] - trackball_pos;
@@ -117,7 +117,7 @@ static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 me
state->m_aimpos[which] = (state->m_aimpos[which] + trackball_diff) & 0x3f;
/* Combine it with the standard input bits */
- port = which ? input_port_read(space->machine(), "P2") : input_port_read(space->machine(), "P1");
+ port = state->ioport(which ? "P2" : "P1")->read();
return (port & 0xc0ff) | (state->m_aimpos[which] << 8);
}
diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c
index 24806edbba8..299190fcc6b 100644
--- a/src/mame/drivers/f-32.c
+++ b/src/mame/drivers/f-32.c
@@ -69,7 +69,7 @@ READ32_MEMBER(mosaicf2_state::f32_input_port_1_r)
if ((pc == 0x000379de) || (pc == 0x000379cc) )
m_maincpu->eat_cycles(100);
//else printf("PC %08x\n", pc );
- return input_port_read(machine(), "SYSTEM_P2");
+ return ioport("SYSTEM_P2")->read();
}
@@ -107,7 +107,7 @@ static INPUT_PORTS_START( mosaicf2 )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_SERVICE_NO_TOGGLE( 0x00000400, IP_ACTIVE_LOW )
PORT_BIT( 0x00007800, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/f1gp.c b/src/mame/drivers/f1gp.c
index 3b5f0edfe77..4091a4f8149 100644
--- a/src/mame/drivers/f1gp.c
+++ b/src/mame/drivers/f1gp.c
@@ -241,7 +241,7 @@ static INPUT_PORTS_START( f1gp )
PORT_START("DSW1")
PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW1:1" ) /* Listed as "Unused" */
- PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW1",0x8000,PORTCOND_EQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4")
+ PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW1",0x8000,EQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4")
PORT_DIPSETTING( 0x0a00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0c00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_1C ) )
@@ -250,7 +250,7 @@ static INPUT_PORTS_START( f1gp )
PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x0200, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW1",0x8000,PORTCOND_EQUALS,0x8000) PORT_DIPLOCATION("SW1:5,6,7")
+ PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW1",0x8000,EQUALS,0x8000) PORT_DIPLOCATION("SW1:5,6,7")
PORT_DIPSETTING( 0x5000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x6000, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x7000, DEF_STR( 1C_1C ) )
@@ -259,7 +259,7 @@ static INPUT_PORTS_START( f1gp )
PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x1000, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0x7e00, 0x7e00, DEF_STR( Coinage ) ) PORT_CONDITION("DSW1",0x8000,PORTCOND_NOTEQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4,5,6,7")
+ PORT_DIPNAME( 0x7e00, 0x7e00, DEF_STR( Coinage ) ) PORT_CONDITION("DSW1",0x8000,NOTEQUALS,0x8000) PORT_DIPLOCATION("SW1:2,3,4,5,6,7")
PORT_DIPSETTING( 0x7e00, "2 to Start, 1 to Continue" )
PORT_DIPNAME( 0x8000, 0x8000, "Continue Coin" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x8000, "Normal Coinage" )
@@ -273,10 +273,10 @@ static INPUT_PORTS_START( f1gp )
PORT_DIPSETTING( 0x0004, DEF_STR( Single ) )
PORT_DIPSETTING( 0x0000, "Multiple" )
PORT_DIPNAME( 0x0008, 0x0008, "Multi Player Mode" ) PORT_DIPLOCATION("SW2:4")
- PORT_DIPSETTING( 0x0008, "Single or Multi Player" ) PORT_CONDITION("DSW1",0x0004,PORTCOND_EQUALS,0x0000)
- PORT_DIPSETTING( 0x0000, "Multi Player Game Only" ) PORT_CONDITION("DSW1",0x0004,PORTCOND_EQUALS,0x0000)
- PORT_DIPSETTING( 0x0008, "Multi Player Off" ) PORT_CONDITION("DSW1",0x0004,PORTCOND_NOTEQUALS,0x0000)
- PORT_DIPSETTING( 0x0000, "Multi Player Off" ) PORT_CONDITION("DSW1",0x0004,PORTCOND_NOTEQUALS,0x0000)
+ PORT_DIPSETTING( 0x0008, "Single or Multi Player" ) PORT_CONDITION("DSW1",0x0004,EQUALS,0x0000)
+ PORT_DIPSETTING( 0x0000, "Multi Player Game Only" ) PORT_CONDITION("DSW1",0x0004,EQUALS,0x0000)
+ PORT_DIPSETTING( 0x0008, "Multi Player Off" ) PORT_CONDITION("DSW1",0x0004,NOTEQUALS,0x0000)
+ PORT_DIPSETTING( 0x0000, "Multi Player Off" ) PORT_CONDITION("DSW1",0x0004,NOTEQUALS,0x0000)
PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c
index 62a3fbaf7f1..6927dcb9525 100644
--- a/src/mame/drivers/famibox.c
+++ b/src/mame/drivers/famibox.c
@@ -207,8 +207,8 @@ WRITE8_MEMBER(famibox_state::famibox_IN0_w)
m_in_0_shift = 0;
m_in_1_shift = 0;
- m_in_0 = input_port_read(machine(), "P1");
- m_in_1 = input_port_read(machine(), "P2");
+ m_in_0 = ioport("P1")->read();
+ m_in_1 = ioport("P2")->read();
}
READ8_MEMBER(famibox_state::famibox_IN1_r)
@@ -312,9 +312,9 @@ READ8_MEMBER(famibox_state::famibox_system_r)
return ret;
}
case 2:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 3:
- return input_port_read(machine(), "KEYSWITCH");
+ return ioport("KEYSWITCH")->read();
case 7:
return 0x02;
default:
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index daf3ac136fb..a21d3ed496f 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -179,20 +179,20 @@ READ8_MEMBER(fantland_state::borntofi_inputs_r)
{
int x, y, f;
- switch (input_port_read(machine(), "Controls") & 0x03)
+ switch (ioport("Controls")->read() & 0x03)
{
case 3:
- case 1: return input_port_read(machine(), offset ? "P2_GUN" : "P1_GUN"); // Lightgun buttons
- case 2: return input_port_read(machine(), offset ? "P2_JOY" : "P1_JOY"); // Joystick
+ case 1: return ioport(offset ? "P2_GUN" : "P1_GUN")->read(); // Lightgun buttons
+ case 2: return ioport(offset ? "P2_JOY" : "P1_JOY")->read(); // Joystick
}
// Trackball
- x = input_port_read(machine(), offset ? "P2 Trackball X" : "P1 Trackball X");
- y = input_port_read(machine(), offset ? "P2 Trackball Y" : "P1 Trackball Y");
+ x = ioport(offset ? "P2 Trackball X" : "P1 Trackball X")->read();
+ y = ioport(offset ? "P2 Trackball Y" : "P1 Trackball Y")->read();
f = machine().primary_screen->frame_number();
- m_input_ret[offset] = (m_input_ret[offset] & 0x14) | (input_port_read(machine(), offset ? "P2_TRACK" : "P1_TRACK") & 0xc3);
+ m_input_ret[offset] = (m_input_ret[offset] & 0x14) | (ioport(offset ? "P2_TRACK" : "P1_TRACK")->read() & 0xc3);
x = (x & 0x7f) - (x & 0x80);
y = (y & 0x7f) - (y & 0x80);
@@ -368,7 +368,7 @@ static void borntofi_adpcm_int( device_t *device, int voice )
if (!state->m_adpcm_playing[voice])
return;
- rom = device->machine().root_device().memregion("adpcm")->base();
+ rom = state->memregion("adpcm")->base();
len = state->memregion("adpcm")->bytes() * 2;
start = state->m_adpcm_addr[0][voice] + state->m_adpcm_nibble[voice];
@@ -585,64 +585,64 @@ INPUT_PORTS_END
static INPUT_PORTS_START( borntofi )
PORT_START("P1_GUN") /* 53000 (Lightgun) */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
PORT_START("P2_GUN") /* 53001 (Lightgun) */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03) PORT_PLAYER(2)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03) PORT_PLAYER(2)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x03)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03) PORT_PLAYER(2)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03) PORT_PLAYER(2)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x03)
PORT_START("P1_TRACK") /* 53000 (Trackball) */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
PORT_START("P2_TRACK") /* 53001 (Trackball) */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball x
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) // trackball y
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) PORT_PLAYER(2)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x00) PORT_PLAYER(2)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball x
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) // trackball y
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) PORT_PLAYER(2)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x00) PORT_PLAYER(2)
PORT_START("P1_JOY") /* 53000 (Joystick) */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
PORT_START("P2_JOY") /* 53001 (Joystick) */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, PORTCOND_EQUALS, 0x02) PORT_PLAYER(2)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("Controls", 0x03, EQUALS, 0x02) PORT_PLAYER(2)
PORT_START("DSW") /* 53002 */
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:1,2,3")
@@ -721,7 +721,7 @@ INPUT_PORTS_END
CUSTOM_INPUT_MEMBER(fantland_state::wheelrun_wheel_r)
{
int player = (FPTR)param;
- int delta = input_port_read(machine(), player ? "WHEEL1" : "WHEEL0");
+ int delta = ioport(player ? "WHEEL1" : "WHEEL0")->read();
delta = (delta & 0x7f) - (delta & 0x80) + 4;
if (delta > 7) delta = 7;
diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c
index 1c69aa3e049..b2d0908e91a 100644
--- a/src/mame/drivers/fcombat.c
+++ b/src/mame/drivers/fcombat.c
@@ -61,7 +61,7 @@ READ8_MEMBER(fcombat_state::fcombat_protection_r)
READ8_MEMBER(fcombat_state::fcombat_port01_r)
{
/* the cocktail flip bit muxes between ports 0 and 1 */
- return m_cocktail_flip ? input_port_read(machine(), "IN1") : input_port_read(machine(), "IN0");
+ return ioport(m_cocktail_flip ? "IN1" : "IN0")->read();
}
@@ -194,7 +194,7 @@ static INPUT_PORTS_START( fcombat )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
PORT_START("DSW1") /* dip switches/VBLANK (0xe200) */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // related to vblank
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c
index 710198dec9f..0e559fae6ad 100644
--- a/src/mame/drivers/feversoc.c
+++ b/src/mame/drivers/feversoc.c
@@ -138,7 +138,7 @@ READ32_MEMBER(feversoc_state::in0_r)
{
m_x^=0x40; //vblank? eeprom read bit?
- return (input_port_read(machine(), "IN0") | m_x) | (input_port_read(machine(), "IN1")<<16);
+ return (ioport("IN1")->read()<<16);
}
WRITE32_MEMBER(feversoc_state::output_w)
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index 6b0ca694f1f..055138fe589 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -73,7 +73,7 @@ static TIMER_CALLBACK( interrupt_callback )
{
fgoal_state *state = machine.driver_data<fgoal_state>();
int scanline;
- int coin = (input_port_read(machine, "IN1") & 2);
+ int coin = (state->ioport("IN1")->read() & 2);
device_set_input_line(state->m_maincpu, 0, ASSERT_LINE);
@@ -100,7 +100,7 @@ static unsigned video_ram_address( running_machine &machine )
READ8_MEMBER(fgoal_state::fgoal_analog_r)
{
- return input_port_read(machine(), m_fgoal_player ? "PADDLE1" : "PADDLE0"); /* PCB can be jumpered to use a single dial */
+ return ioport(m_fgoal_player ? "PADDLE1" : "PADDLE0")->read(); /* PCB can be jumpered to use a single dial */
}
diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c
index 24c623e2057..85c6661e49e 100644
--- a/src/mame/drivers/finalizr.c
+++ b/src/mame/drivers/finalizr.c
@@ -139,7 +139,7 @@ static INPUT_PORTS_START( finalizr )
KONAMI8_SYSTEM_10
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("P1")
KONAMI8_MONO_B12_UNK
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 96e9947e624..e5679b08d2e 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -727,15 +727,15 @@ static READ32_HANDLER(input_r)
if (ACCESSING_BITS_24_31)
{
- r |= (input_port_read(space->machine(), "IN0") & 0xff) << 24;
+ r |= (space->machine().root_device().ioport("IN0")->read() & 0xff) << 24;
}
if (ACCESSING_BITS_8_15)
{
- r |= (input_port_read(space->machine(), "IN1") & 0xff) << 8;
+ r |= (space->machine().root_device().ioport("IN1")->read() & 0xff) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= (input_port_read(space->machine(), "IN2") & 0xff);
+ r |= (space->machine().root_device().ioport("IN2")->read() & 0xff);
}
return r;
@@ -745,11 +745,11 @@ static READ32_HANDLER( sensor_r )
{
if (offset == 0)
{
- return input_port_read(space->machine(), "SENSOR1") | 0x01000100;
+ return space->machine().root_device().ioport("SENSOR1")->read() | 0x01000100;
}
else
{
- return input_port_read(space->machine(), "SENSOR2") | 0x01000100;
+ return space->machine().root_device().ioport("SENSOR2")->read() | 0x01000100;
}
}
@@ -1365,11 +1365,11 @@ static READ32_HANDLER( keyboard_wheel_r )
{
if (offset == 0) // Keyboard Wheel (P1)
{
- return input_port_read(space->machine(), "WHEEL_P1") << 24;
+ return space->machine().root_device().ioport("WHEEL_P1")->read() << 24;
}
else if (offset == 2) // Keyboard Wheel (P2)
{
- return input_port_read(space->machine(), "WHEEL_P2") << 24;
+ return space->machine().root_device().ioport("WHEEL_P2")->read() << 24;
}
return 0;
@@ -1459,7 +1459,7 @@ static TIMER_CALLBACK( keyboard_timer_callback )
for (keyboard=0; keyboard < 2; keyboard++)
{
- UINT32 kbstate = input_port_read(machine, keynames[keyboard]);
+ UINT32 kbstate = machine.root_device().ioport(keynames[keyboard])->read();
int uart_channel = kb_uart_channel[keyboard];
if (kbstate != state->m_keyboard_state[keyboard])
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 8c48f1486d9..8c9bcaf11cf 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -381,10 +381,10 @@ READ8_MEMBER(firefox_state::adc_r)
{
if( m_control_num == 0 )
{
- return input_port_read( machine(), "PITCH" );
+ return ioport( "PITCH" )->read();
}
- return input_port_read( machine(), "YAW" );
+ return ioport( "YAW" )->read();
}
WRITE8_MEMBER(firefox_state::adc_select_w)
@@ -579,7 +579,7 @@ static INPUT_PORTS_START( firefox )
PORT_START("rdin1")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,mainflag_r, NULL)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,soundflag_r, NULL)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index a495d6011aa..99ae63bc44c 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -192,7 +192,7 @@ READ8_MEMBER(firetrap_state::firetrap_8751_bootleg_r)
/* the following only works in the bootleg version, which doesn't have an */
/* 8751 - the real thing is much more complicated than that. */
UINT8 coin = 0;
- UINT8 port = input_port_read(machine(), "IN2") & 0x70;
+ UINT8 port = ioport("IN2")->read() & 0x70;
if (cpu_get_pc(&space.device()) == 0x1188)
return ~m_coin_command_pending;
@@ -454,7 +454,7 @@ static INPUT_PORTS_START( firetrap )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW0") /* DSW0 */
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
@@ -593,7 +593,7 @@ static INTERRUPT_GEN( firetrap_irq )
static MACHINE_START( firetrap )
{
firetrap_state *state = machine.driver_data<firetrap_state>();
- UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *MAIN = state->memregion("maincpu")->base();
UINT8 *SOUND = state->memregion("audiocpu")->base();
state->m_maincpu = machine.device("maincpu");
diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c
index f6f61cb8ffe..33fb6bafb8b 100644
--- a/src/mame/drivers/firetrk.c
+++ b/src/mame/drivers/firetrk.c
@@ -172,8 +172,8 @@ static MACHINE_RESET( firetrk )
READ8_MEMBER(firetrk_state::firetrk_dip_r)
{
- UINT8 val0 = input_port_read(machine(), "DIP_0");
- UINT8 val1 = input_port_read(machine(), "DIP_1");
+ UINT8 val0 = ioport("DIP_0")->read();
+ UINT8 val1 = ioport("DIP_1")->read();
if (val1 & (1 << (2 * offset + 0))) val0 |= 1;
if (val1 & (1 << (2 * offset + 1))) val0 |= 2;
@@ -184,8 +184,8 @@ READ8_MEMBER(firetrk_state::firetrk_dip_r)
READ8_MEMBER(firetrk_state::montecar_dip_r)
{
- UINT8 val0 = input_port_read(machine(), "DIP_0");
- UINT8 val1 = input_port_read(machine(), "DIP_1");
+ UINT8 val0 = ioport("DIP_0")->read();
+ UINT8 val1 = ioport("DIP_1")->read();
if (val1 & (1 << (3 - offset))) val0 |= 1;
if (val1 & (1 << (7 - offset))) val0 |= 2;
@@ -247,7 +247,7 @@ READ8_MEMBER(firetrk_state::firetrk_input_r)
/* update steering wheels */
for (i = 0; i < 2; i++)
{
- UINT32 new_dial = input_port_read_safe(machine(), (i ? "STEER_2" : "STEER_1"), 0);
+ UINT32 new_dial = ioport((i ? "STEER_2" : "STEER_1"))->read_safe(0);
INT32 delta = new_dial - m_dial[i];
if (delta != 0)
@@ -259,9 +259,9 @@ READ8_MEMBER(firetrk_state::firetrk_input_r)
}
}
- 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);
+ return ((ioport("BIT_0")->read_safe(0) & (1 << offset)) ? 0x01 : 0) |
+ ((ioport("BIT_6")->read_safe(0) & (1 << offset)) ? 0x40 : 0) |
+ ((ioport("BIT_7")->read_safe(0) & (1 << offset)) ? 0x80 : 0);
}
@@ -447,7 +447,7 @@ static INPUT_PORTS_START( firetrk )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("Both Players Start")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE) PORT_PLAYER(1)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ))
PORT_DIPSETTING( 0x00, "Smokey Joe (1 Player)" )
PORT_DIPSETTING( 0x40, "Fire Truck (2 Players)" )
@@ -579,7 +579,7 @@ static INPUT_PORTS_START( montecar )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state,gear_r, (void *)2)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas")
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state,steer_dir_r, (void *)0)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firetrk_state,skid_r, (void *)1)
diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c
index f8b3eff010a..dfb2b18e917 100644
--- a/src/mame/drivers/flkatck.c
+++ b/src/mame/drivers/flkatck.c
@@ -47,13 +47,13 @@ READ8_MEMBER(flkatck_state::flkatck_ls138_r)
{
case 0x00:
if (offset & 0x02)
- data = input_port_read(machine(), (offset & 0x01) ? "COIN" : "DSW3");
+ data = ioport((offset & 0x01) ? "COIN" : "DSW3")->read();
else
- data = input_port_read(machine(), (offset & 0x01) ? "P2" : "P1");
+ data = ioport((offset & 0x01) ? "P2" : "P1")->read();
break;
case 0x01:
if (offset & 0x02)
- data = input_port_read(machine(), (offset & 0x01) ? "DSW1" : "DSW2");
+ data = ioport((offset & 0x01) ? "DSW1" : "DSW2")->read();
break;
}
diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c
index f92be725a2a..5c0b1e9ec8e 100644
--- a/src/mame/drivers/flyball.c
+++ b/src/mame/drivers/flyball.c
@@ -145,10 +145,10 @@ static TIMER_CALLBACK( flyball_quarter_callback )
memset(potsense, 0, sizeof potsense);
- potsense[input_port_read(machine, "STICK1_Y")] |= 1;
- potsense[input_port_read(machine, "STICK1_X")] |= 2;
- potsense[input_port_read(machine, "STICK0_Y")] |= 4;
- potsense[input_port_read(machine, "STICK0_X")] |= 8;
+ potsense[state->ioport("STICK1_Y")->read()] |= 1;
+ potsense[state->ioport("STICK1_X")->read()] |= 2;
+ potsense[state->ioport("STICK0_Y")->read()] |= 4;
+ potsense[state->ioport("STICK0_X")->read()] |= 8;
for (i = 0; i < 64; i++)
if (potsense[i] != 0)
@@ -173,7 +173,7 @@ static TIMER_CALLBACK( flyball_quarter_callback )
/* two physical buttons (start game and stop runner) share the same port bit */
READ8_MEMBER(flyball_state::flyball_input_r)
{
- return input_port_read(machine(), "IN0") & input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
READ8_MEMBER(flyball_state::flyball_scanline_r)
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index 203802c8dd9..187f7bba387 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -189,7 +189,7 @@ READ16_MEMBER(foodf_state::analog_r)
{
static const char *const portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" };
- return input_port_read(machine(), portnames[m_whichport]);
+ return ioport(portnames[m_whichport])->read();
}
@@ -326,7 +326,7 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER( pot_r )
{
- return (input_port_read(device->machine(), "DSW") >> offset) << 7;
+ return (device->machine().root_device().ioport("DSW")->read() >> offset) << 7;
}
static const pokey_interface pokey_config =
diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c
index 9dbce97e5a5..b71ffcabeb7 100644
--- a/src/mame/drivers/forte2.c
+++ b/src/mame/drivers/forte2.c
@@ -72,7 +72,7 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER(forte2_ay8910_read_input)
{
forte2_state *state = device->machine().driver_data<forte2_state>();
- return input_port_read(device->machine(), "IN0") | (state->m_input_mask&0x3f);
+ return state->ioport("IN0")->read() | (state->m_input_mask&0x3f);
}
static WRITE8_DEVICE_HANDLER( forte2_ay8910_set_input_mask )
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 7be573f7a1b..77c4f8a8e6c 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -63,7 +63,7 @@ WRITE8_MEMBER(freekick_state::spinner_select_w)
READ8_MEMBER(freekick_state::spinner_r)
{
- return input_port_read(machine(), m_spinner ? "IN3" : "IN2");
+ return ioport(m_spinner ? "IN3" : "IN2")->read();
}
WRITE8_MEMBER(freekick_state::pbillrd_bankswitch_w)
diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c
index b9038ed4eda..f98536c7bbf 100644
--- a/src/mame/drivers/fromanc2.c
+++ b/src/mame/drivers/fromanc2.c
@@ -58,10 +58,10 @@ READ16_MEMBER(fromanc2_state::fromanc2_keymatrix_r)
switch (m_portselect)
{
- case 0x01: ret = input_port_read(machine(), "KEY0"); break;
- case 0x02: ret = input_port_read(machine(), "KEY1"); break;
- case 0x04: ret = input_port_read(machine(), "KEY2"); break;
- case 0x08: ret = input_port_read(machine(), "KEY3"); break;
+ case 0x01: ret = ioport("KEY0")->read(); break;
+ case 0x02: ret = ioport("KEY1")->read(); break;
+ case 0x04: ret = ioport("KEY2")->read(); break;
+ case 0x08: ret = ioport("KEY3")->read(); break;
default: ret = 0xffff;
logerror("PC:%08X unknown %02X\n", cpu_get_pc(&space.device()), m_portselect);
break;
@@ -88,7 +88,7 @@ CUSTOM_INPUT_MEMBER(fromanc2_state::subcpu_nmi_r)
WRITE16_MEMBER(fromanc2_state::fromanc2_eeprom_w)
{
if (ACCESSING_BITS_8_15)
- input_port_write(machine(), "EEPROMOUT", data, 0xffff);
+ ioport("EEPROMOUT")->write(data, 0xffff);
}
WRITE16_MEMBER(fromanc2_state::fromancr_eeprom_w)
@@ -96,14 +96,14 @@ WRITE16_MEMBER(fromanc2_state::fromancr_eeprom_w)
if (ACCESSING_BITS_0_7)
{
fromancr_gfxbank_w(machine(), data & 0xfff8);
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
WRITE16_MEMBER(fromanc2_state::fromanc4_eeprom_w)
{
if (ACCESSING_BITS_0_7)
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
WRITE16_MEMBER(fromanc2_state::fromanc2_subcpu_w)
@@ -524,8 +524,8 @@ static MACHINE_START( fromanc2 )
{
fromanc2_state *state = machine.driver_data<fromanc2_state>();
- state->membank("bank1")->configure_entries(0, 4, machine.root_device().memregion("sub")->base(), 0x4000);
- state->membank("bank2")->configure_entry(0, machine.root_device().memregion("sub")->base() + 0x08000);
+ state->membank("bank1")->configure_entries(0, 4, state->memregion("sub")->base(), 0x4000);
+ state->membank("bank2")->configure_entry(0, state->memregion("sub")->base() + 0x08000);
state->membank("bank2")->configure_entries(1, 3, state->memregion("sub")->base() + 0x14000, 0x4000);
MACHINE_START_CALL(fromanc4);
diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c
index 6fba7c8b44e..a1723dbb34f 100644
--- a/src/mame/drivers/fromance.c
+++ b/src/mame/drivers/fromance.c
@@ -180,15 +180,15 @@ READ8_MEMBER(fromance_state::fromance_keymatrix_r)
int ret = 0xff;
if (m_portselect & 0x01)
- ret &= input_port_read(machine(), "KEY1");
+ ret &= ioport("KEY1")->read();
if (m_portselect & 0x02)
- ret &= input_port_read(machine(), "KEY2");
+ ret &= ioport("KEY2")->read();
if (m_portselect & 0x04)
- ret &= input_port_read(machine(), "KEY3");
+ ret &= ioport("KEY3")->read();
if (m_portselect & 0x08)
- ret &= input_port_read(machine(), "KEY4");
+ ret &= ioport("KEY4")->read();
if (m_portselect & 0x10)
- ret &= input_port_read(machine(), "KEY5");
+ ret &= ioport("KEY5")->read();
return ret;
}
diff --git a/src/mame/drivers/funkball.c b/src/mame/drivers/funkball.c
index 4140f92f93b..2bae619ea1e 100644
--- a/src/mame/drivers/funkball.c
+++ b/src/mame/drivers/funkball.c
@@ -555,7 +555,7 @@ READ8_MEMBER( funkball_state::test_r )
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7",
"IN8", "IN9", "INA", "INB", "INC", "IND", "INE", "INF",};
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
static ADDRESS_MAP_START(funkball_map, AS_PROGRAM, 32, funkball_state)
@@ -1118,13 +1118,13 @@ static MACHINE_START( funkball )
static MACHINE_RESET( funkball )
{
funkball_state *state = machine.driver_data<funkball_state>();
- state->membank("bios_ext1")->set_base(machine.root_device().memregion("bios")->base() + 0x00000);
- state->membank("bios_ext2")->set_base(machine.root_device().memregion("bios")->base() + 0x04000);
- state->membank("bios_ext3")->set_base(machine.root_device().memregion("bios")->base() + 0x08000);
- state->membank("bios_ext4")->set_base(machine.root_device().memregion("bios")->base() + 0x0c000);
- state->membank("bios_bank1")->set_base(machine.root_device().memregion("bios")->base() + 0x10000);
- state->membank("bios_bank2")->set_base(machine.root_device().memregion("bios")->base() + 0x14000);
- state->membank("bios_bank3")->set_base(machine.root_device().memregion("bios")->base() + 0x18000);
+ state->membank("bios_ext1")->set_base(state->memregion("bios")->base() + 0x00000);
+ state->membank("bios_ext2")->set_base(state->memregion("bios")->base() + 0x04000);
+ state->membank("bios_ext3")->set_base(state->memregion("bios")->base() + 0x08000);
+ state->membank("bios_ext4")->set_base(state->memregion("bios")->base() + 0x0c000);
+ state->membank("bios_bank1")->set_base(state->memregion("bios")->base() + 0x10000);
+ state->membank("bios_bank2")->set_base(state->memregion("bios")->base() + 0x14000);
+ state->membank("bios_bank3")->set_base(state->memregion("bios")->base() + 0x18000);
state->membank("bios_bank4")->set_base(state->memregion("bios")->base() + 0x1c000);
state->m_voodoo_pci_regs.base_addr = 0xff000000;
}
diff --git a/src/mame/drivers/funkybee.c b/src/mame/drivers/funkybee.c
index 4061207310e..f0d6ddb6505 100644
--- a/src/mame/drivers/funkybee.c
+++ b/src/mame/drivers/funkybee.c
@@ -80,7 +80,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
READ8_MEMBER(funkybee_state::funkybee_input_port_0_r)
{
watchdog_reset_r(space, 0);
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
WRITE8_MEMBER(funkybee_state::funkybee_coin_counter_w)
diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c
index 72384402487..d97b898dd7f 100644
--- a/src/mame/drivers/funkyjet.c
+++ b/src/mame/drivers/funkyjet.c
@@ -155,7 +155,7 @@ static INPUT_PORTS_START( funkyjet )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
/* Dips seem inverted with respect to other Deco games */
PORT_START("DSW")
diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c
index 956ce5ea82c..ca4d47ee38c 100644
--- a/src/mame/drivers/fuukifg3.c
+++ b/src/mame/drivers/fuukifg3.c
@@ -425,8 +425,8 @@ static INPUT_PORTS_START( asurabld )
PORT_DIPSETTING( 0x2000, "2C Start / 1C Continue" )
// PORT_DIPSETTING( 0x7000, "Error!!" ) // Causes graphics issues - Service Mode shows "Error"
// PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) // Duplicate 2C_1C
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x0f00,PORTCOND_NOTEQUALS,0x0000)
- PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x0f00,PORTCOND_EQUALS,0x0000) // Set both for Free Play
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x0f00,NOTEQUALS,0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x0f00,EQUALS,0x0000) // Set both for Free Play
PORT_DIPNAME( 0x0f00, 0x0f00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW4:5,6,7,8") /* Service Mode Shows Player 1 */
PORT_DIPSETTING( 0x0800, DEF_STR( 8C_1C ) )
PORT_DIPSETTING( 0x0900, DEF_STR( 7C_1C ) )
@@ -443,8 +443,8 @@ static INPUT_PORTS_START( asurabld )
PORT_DIPSETTING( 0x0200, "2C Start / 1C Continue" )
// PORT_DIPSETTING( 0x0700, "Error!!" ) // Causes graphics issues - Service Mode shows "Error"
// PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) // Duplicate 2C_1C
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0xf000,PORTCOND_NOTEQUALS,0x0000)
- PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0xf000,PORTCOND_EQUALS,0x0000) // Set both for Free Play
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0xf000,NOTEQUALS,0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0xf000,EQUALS,0x0000) // Set both for Free Play
INPUT_PORTS_END
static INPUT_PORTS_START( asurabus )
diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c
index 5429bca2230..a386d57c4b7 100644
--- a/src/mame/drivers/gaelco2.c
+++ b/src/mame/drivers/gaelco2.c
@@ -206,10 +206,10 @@ ROM_END
BANG
============================================================================*/
-READ16_MEMBER(gaelco2_state::p1_gun_x){return (input_port_read(machine(), "LIGHT0_X") * 320 / 0x100) + 1;}
-READ16_MEMBER(gaelco2_state::p1_gun_y){return (input_port_read(machine(), "LIGHT0_Y") * 240 / 0x100) - 4;}
-READ16_MEMBER(gaelco2_state::p2_gun_x){return (input_port_read(machine(), "LIGHT1_X") * 320 / 0x100) + 1;}
-READ16_MEMBER(gaelco2_state::p2_gun_y){return (input_port_read(machine(), "LIGHT1_Y") * 240 / 0x100) - 4;}
+READ16_MEMBER(gaelco2_state::p1_gun_x){return (ioport("LIGHT0_X")->read() * 320 / 0x100) + 1;}
+READ16_MEMBER(gaelco2_state::p1_gun_y){return (ioport("LIGHT0_Y")->read() * 240 / 0x100) - 4;}
+READ16_MEMBER(gaelco2_state::p2_gun_x){return (ioport("LIGHT1_X")->read() * 320 / 0x100) + 1;}
+READ16_MEMBER(gaelco2_state::p2_gun_y){return (ioport("LIGHT1_Y")->read() * 240 / 0x100) - 4;}
static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16, gaelco2_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index 0f181ddaea5..7126729f52e 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -449,10 +449,10 @@ WRITE16_MEMBER(gaelco3d_state::analog_port_latch_w)
{
if (!(data & 0xff))
{
- m_analog_ports[0] = input_port_read_safe(machine(), "ANALOG0", 0);
- m_analog_ports[1] = input_port_read_safe(machine(), "ANALOG1", 0);
- m_analog_ports[2] = input_port_read_safe(machine(), "ANALOG2", 0);
- m_analog_ports[3] = input_port_read_safe(machine(), "ANALOG3", 0);
+ m_analog_ports[0] = ioport("ANALOG0")->read_safe(0);
+ m_analog_ports[1] = ioport("ANALOG1")->read_safe(0);
+ m_analog_ports[2] = ioport("ANALOG2")->read_safe(0);
+ m_analog_ports[3] = ioport("ANALOG3")->read_safe(0);
}
}
else
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 13551f7b783..573872b0953 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -717,8 +717,8 @@ READ8_MEMBER(galaga_state::bosco_dsw_r)
{
int bit0,bit1;
- bit0 = (input_port_read(machine(), "DSWB") >> offset) & 1;
- bit1 = (input_port_read(machine(), "DSWA") >> offset) & 1;
+ bit0 = (ioport("DSWB")->read() >> offset) & 1;
+ bit1 = (ioport("DSWA")->read() >> offset) & 1;
return bit0 | (bit1 << 1);
}
@@ -777,7 +777,7 @@ WRITE8_MEMBER(galaga_state::bosco_latch_w)
}
}
-CUSTOM_INPUT_MEMBER(digdug_state::shifted_port_r){ return input_port_read(machine(), (const char *)param) >> 4; }
+CUSTOM_INPUT_MEMBER(digdug_state::shifted_port_r){ return ioport((const char *)param)->read() >> 4; }
static WRITE8_DEVICE_HANDLER( out_0 )
{
@@ -1077,22 +1077,22 @@ static INPUT_PORTS_START( bosco )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
/* bonus scores are different for 5 lives */
PORT_DIPNAME( 0x38, 0x20, "Bonus Fighter" ) PORT_DIPLOCATION("SWA:4,5,6")
- PORT_DIPSETTING( 0x30, "15K and 50K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) /* Began with 1, 2 or 3 fighters */
- PORT_DIPSETTING( 0x38, "20K and 70K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x08, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x10, "15K, 50K, Every 50K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x18, "15K, 70K, Every 70K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x20, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
- PORT_DIPSETTING( 0x28, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x30, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0) /* Began with 5 fighters */
- PORT_DIPSETTING( 0x38, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x08, "15K and 70K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x10, "20K and 70K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x18, "20K and 100K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x20, "30K and 120K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x28, "30K, 80K, Every 80K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
+ PORT_DIPSETTING( 0x30, "15K and 50K Only" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) /* Began with 1, 2 or 3 fighters */
+ PORT_DIPSETTING( 0x38, "20K and 70K Only" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x08, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x10, "15K, 50K, Every 50K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x18, "15K, 70K, Every 70K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x20, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
+ PORT_DIPSETTING( 0x28, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x30, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0) /* Began with 5 fighters */
+ PORT_DIPSETTING( 0x38, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x08, "15K and 70K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x10, "20K and 70K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x18, "20K and 100K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x20, "30K and 120K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x28, "30K, 80K, Every 80K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:7,8")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x40, "2" )
@@ -1181,22 +1181,22 @@ static INPUT_PORTS_START( galaga )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x38, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWA:4,5,6")
- PORT_DIPSETTING( 0x20, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) /* Began with 2, 3 or 4 fighters */
- PORT_DIPSETTING( 0x18, "20K and 60K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x10, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
- PORT_DIPSETTING( 0x30, "20K, 80K, Every 80K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x38, "30K and 80K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x28, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x20, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0) /* Began with 5 fighters */
- PORT_DIPSETTING( 0x18, "30K and 150K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x10, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x30, "30K, 150K, Every 150K" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x38, "30K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x08, "30K and 100K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x28, "30K and 120K Only" ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,PORTCOND_EQUALS,0xc0)
+ PORT_DIPSETTING( 0x20, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) /* Began with 2, 3 or 4 fighters */
+ PORT_DIPSETTING( 0x18, "20K and 60K Only" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x10, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0) // factory default = "20K, 70K, Every70K"
+ PORT_DIPSETTING( 0x30, "20K, 80K, Every 80K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x38, "30K and 80K Only" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x28, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x20, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0) /* Began with 5 fighters */
+ PORT_DIPSETTING( 0x18, "30K and 150K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x10, "30K, 120K, Every 120K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x30, "30K, 150K, Every 150K" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x38, "30K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x08, "30K and 100K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x28, "30K and 120K Only" ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWB",0xc0,EQUALS,0xc0)
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:7,8")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x80, "3" ) // factory default = "3"
@@ -1268,22 +1268,22 @@ static INPUT_PORTS_START( xevious )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWA:3,4,5")
- PORT_DIPSETTING( 0x18, "10K, 40K, Every 40K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x14, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x10, "20K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x1c, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00) // factory default = "20K, 60K, Every60K"
- PORT_DIPSETTING( 0x0c, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x08, "20K, 80K, Every 80K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x04, "20K and 60K Only" ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0x60,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x18, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x14, "20K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x1c, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0c, "20K, 80K, Every 80K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x04, "20K and 80K Only" ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0x60,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "10K, 40K, Every 40K" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x14, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "20K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x1c, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00) // factory default = "20K, 60K, Every60K"
+ PORT_DIPSETTING( 0x0c, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "20K, 80K, Every 80K" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x04, "20K and 60K Only" ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0x60,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x14, "20K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x1c, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0c, "20K, 80K, Every 80K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "30K, 100K, Every 100K" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x04, "20K and 80K Only" ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0x60,EQUALS,0x00)
PORT_DIPNAME( 0x60, 0x60, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:6,7")
PORT_DIPSETTING( 0x40, "1" )
PORT_DIPSETTING( 0x20, "2" )
@@ -1393,22 +1393,22 @@ static INPUT_PORTS_START( digdug )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_7C ) )
PORT_DIPNAME( 0x38, 0x18, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWA:4,5,6")
- PORT_DIPSETTING( 0x20, "10K, 40K, Every 40K" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0) // Atari factory default = "10K, 40K, Every40K"
- PORT_DIPSETTING( 0x10, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x30, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x08, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x28, "10K and 40K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x18, "20K and 60K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0) // Namco factory default = "20K, 60K"
- PORT_DIPSETTING( 0x38, "10K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0xc0,PORTCOND_NOTEQUALS,0xc0)
- PORT_DIPSETTING( 0x20, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x10, "30K, 80K, Every 80K" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x30, "20K and 50K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x08, "20K and 60K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x28, "30K and 70K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x18, "20K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x38, "30K Only" ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0xc0,PORTCOND_EQUALS,0xc0)
+ PORT_DIPSETTING( 0x20, "10K, 40K, Every 40K" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0) // Atari factory default = "10K, 40K, Every40K"
+ PORT_DIPSETTING( 0x10, "10K, 50K, Every 50K" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x30, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x08, "20K, 70K, Every 70K" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x28, "10K and 40K Only" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x18, "20K and 60K Only" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0) // Namco factory default = "20K, 60K"
+ PORT_DIPSETTING( 0x38, "10K Only" ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0xc0,NOTEQUALS,0xc0)
+ PORT_DIPSETTING( 0x20, "20K, 60K, Every 60K" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x10, "30K, 80K, Every 80K" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x30, "20K and 50K Only" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x08, "20K and 60K Only" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x28, "30K and 70K Only" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x18, "20K Only" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x38, "30K Only" ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSWA",0xc0,EQUALS,0xc0)
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:7,8")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x40, "2" )
diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c
index 094563eda17..c8ddd82a29a 100644
--- a/src/mame/drivers/galastrm.c
+++ b/src/mame/drivers/galastrm.c
@@ -150,9 +150,9 @@ READ32_MEMBER(galastrm_state::galastrm_adstick_ctrl_r)
if (offset == 0x00)
{
if (ACCESSING_BITS_24_31)
- return input_port_read(machine(), "STICKX") << 24;
+ return ioport("STICKX")->read() << 24;
if (ACCESSING_BITS_16_23)
- return input_port_read(machine(), "STICKY") << 16;
+ return ioport("STICKY")->read() << 16;
}
return 0;
}
diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c
index fa19767788b..7dd51b908a4 100644
--- a/src/mame/drivers/galaxia.c
+++ b/src/mame/drivers/galaxia.c
@@ -234,7 +234,7 @@ static INPUT_PORTS_START( galaxia )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 99b1c8f4da0..996c07e0378 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -452,7 +452,7 @@ static INTERRUPT_GEN( fakechange_interrupt_gen )
galaxian_state *state = device->machine().driver_data<galaxian_state>();
interrupt_gen(device);
- if (input_port_read_safe(device->machine(), "FAKE_SELECT", 0x00))
+ if (state->ioport("FAKE_SELECT")->read_safe(0x00))
{
state->m_tenspot_current_game++;
state->m_tenspot_current_game%=10;
@@ -1103,7 +1103,7 @@ CUSTOM_INPUT_MEMBER(galaxian_state::gmgalax_port_r)
const char *portname = (const char *)param;
if (m_gmgalax_selected_game != 0)
portname += strlen(portname) + 1;
- return input_port_read(machine(), portname);
+ return ioport(portname)->read();
}
@@ -1154,7 +1154,7 @@ WRITE8_MEMBER(galaxian_state::zigzag_ay8910_w)
CUSTOM_INPUT_MEMBER(galaxian_state::azurian_port_r)
{
- return (input_port_read(machine(), "FAKE") >> (FPTR)param) & 1;
+ return (ioport("FAKE")->read() >> (FPTR)param) & 1;
}
@@ -1168,7 +1168,7 @@ CUSTOM_INPUT_MEMBER(galaxian_state::azurian_port_r)
CUSTOM_INPUT_MEMBER(galaxian_state::kingball_muxbit_r)
{
/* multiplex the service mode switch with a speech DIP switch */
- return (input_port_read(machine(), "FAKE") >> m_kingball_speech_dip) & 1;
+ return (ioport("FAKE")->read() >> m_kingball_speech_dip) & 1;
}
@@ -2810,10 +2810,10 @@ static DRIVER_INIT( gmgalax )
/* ROM is banked */
space->install_read_bank(0x0000, 0x3fff, "bank1");
- machine.root_device().membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
- state->gmgalax_game_changed(*machine.ioport().first_port()->fieldlist().first(), NULL, 0, 0);
+ state->gmgalax_game_changed(*machine.ioport().first_port()->first_field(), NULL, 0, 0);
state_save_register_global(machine, state->m_gmgalax_selected_game);
}
@@ -2927,7 +2927,7 @@ READ8_MEMBER(galaxian_state::tenspot_dsw_read)
{
char tmp[64];
sprintf(tmp,"IN2_GAME%d", m_tenspot_current_game);
- return input_port_read_safe(machine(), tmp, 0x00);
+ return ioport(tmp)->read_safe(0x00);
}
@@ -3026,8 +3026,8 @@ static DRIVER_INIT( zigzag )
/* make ROMs 2 & 3 swappable */
space->install_read_bank(0x2000, 0x2fff, "bank1");
space->install_read_bank(0x3000, 0x3fff, "bank2");
- state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
- state->membank("bank2")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x2000, 0x1000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x2000, 0x1000);
+ state->membank("bank2")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x2000, 0x1000);
/* also re-install the fixed ROM area as a bank in order to inform the memory system that
the fixed area only extends to 0x1fff */
@@ -3502,7 +3502,7 @@ static DRIVER_INIT( scorpion )
/* extra ROM */
space->install_read_bank(0x5800, 0x67ff, "bank1");
- state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5800);
+ state->membank("bank1")->set_base(state->memregion("maincpu")->base() + 0x5800);
/* no background related */
// space->nop_write(0x6803, 0x6803);
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index d2ab18c3ebc..3e3bf34b595 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -580,9 +580,9 @@ static ADDRESS_MAP_START( scramblb_map, AS_PROGRAM, 8, galaxold_state )
ADDRESS_MAP_END
READ8_MEMBER(galaxold_state::scramb2_protection_r){ return 0x25; }
-READ8_MEMBER(galaxold_state::scramb2_port0_r){ return (input_port_read(machine(), "IN0") >> offset) & 0x1; }
-READ8_MEMBER(galaxold_state::scramb2_port1_r){ return (input_port_read(machine(), "IN1") >> offset) & 0x1; }
-READ8_MEMBER(galaxold_state::scramb2_port2_r){ return (input_port_read(machine(), "IN2") >> offset) & 0x1; }
+READ8_MEMBER(galaxold_state::scramb2_port0_r){ return (ioport("IN0")->read() >> offset) & 0x1; }
+READ8_MEMBER(galaxold_state::scramb2_port1_r){ return (ioport("IN1")->read() >> offset) & 0x1; }
+READ8_MEMBER(galaxold_state::scramb2_port2_r){ return (ioport("IN2")->read() >> offset) & 0x1; }
static ADDRESS_MAP_START( scramb2_map, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
@@ -923,9 +923,9 @@ CUSTOM_INPUT_MEMBER(galaxold_state::vpool_lives_r)
switch (bit_mask)
{
case 0x40: /* vpool : IN1 (0xa800) bit 6 */
- return ((input_port_read(machine(), "LIVES") & bit_mask) >> 6);
+ return ((ioport("LIVES")->read() & bit_mask) >> 6);
case 0x01: /* vpool : DSW (0xb000) bit 0 */
- return ((input_port_read(machine(), "LIVES") & bit_mask) >> 0);
+ return ((ioport("LIVES")->read() & bit_mask) >> 0);
default:
logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask);
@@ -1070,14 +1070,14 @@ CUSTOM_INPUT_MEMBER(galaxold_state::ckongg_coinage_r)
switch (bit_mask)
{
case 0x0c: /* ckongg : DSW (0xc800) bits 2 and 3 */
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 2);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 2);
case 0x40: /* ckongg : IN1 (0xc400) bit 6 */
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 6);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 6);
case 0xc0: /* ckongmc : IN1 (0xa800) bits 6 and 7 */
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 6);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 6);
case 0x01: /* ckongmc : DSW (0xb000) bit 0 */
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 0);
default:
logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask);
@@ -1438,9 +1438,9 @@ CUSTOM_INPUT_MEMBER(galaxold_state::dkongjrm_coinage_r)
switch (bit_mask)
{
case 0xc0: /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 6);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 6);
case 0x01: /* dkongjrm : DSW (0xb0??) bit 0 */
- return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
+ return ((ioport("COINAGE")->read() & bit_mask) >> 0);
default:
logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask);
@@ -1869,7 +1869,7 @@ static INPUT_PORTS_START( drivfrcg )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -1933,7 +1933,7 @@ static INPUT_PORTS_START( racknrol )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -1997,7 +1997,7 @@ static INPUT_PORTS_START( trvchlng )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/galdrvr.c b/src/mame/drivers/galdrvr.c
index 9773d9bd8f8..496d721b8c1 100644
--- a/src/mame/drivers/galdrvr.c
+++ b/src/mame/drivers/galdrvr.c
@@ -898,37 +898,37 @@ static INPUT_PORTS_START( gmgalax )
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxian_state, gmgalax_port_r, "GMIN2\0GLIN2")
PORT_START("GMIN0") /* Ghost Muncher - IN0 */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPNAME( 0x20, 0x00, "Ghost Muncher - Cabinet" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_DIPNAME( 0x20, 0x00, "Ghost Muncher - Cabinet" ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
PORT_START("GMIN1") /* Ghost Muncher - IN1 */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPNAME( 0xc0, 0x40, "Ghost Muncher - Bonus Life" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
+ PORT_DIPNAME( 0xc0, 0x40, "Ghost Muncher - Bonus Life" ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
PORT_DIPSETTING( 0x40, "10000" )
PORT_DIPSETTING( 0x80, "15000" )
PORT_DIPSETTING( 0xc0, "20000" )
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_START("GMIN2") /* Ghost Muncher - IN2 */
- PORT_DIPNAME( 0x03, 0x02, "Ghost Muncher - Coinage" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
+ PORT_DIPNAME( 0x03, 0x02, "Ghost Muncher - Coinage" ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x0c, 0x04, "Ghost Muncher - Lives" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_NOTEQUALS,0x01)
+ PORT_DIPNAME( 0x0c, 0x04, "Ghost Muncher - Lives" ) PORT_CONDITION("GAMESEL",0x01,NOTEQUALS,0x01)
PORT_DIPSETTING( 0x0c, "1" )
PORT_DIPSETTING( 0x08, "2" )
PORT_DIPSETTING( 0x04, "3" )
@@ -936,37 +936,37 @@ static INPUT_PORTS_START( gmgalax )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("GLIN0") /* Galaxian - IN0 */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPNAME( 0x20, 0x00, "Galaxian - Cabinet" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_DIPNAME( 0x20, 0x00, "Galaxian - Cabinet" ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) )
- PORT_SERVICE( 0x40, IP_ACTIVE_HIGH ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
+ PORT_SERVICE( 0x40, IP_ACTIVE_HIGH ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
PORT_START("GLIN1") /* Galaxian - IN1 */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPNAME( 0xc0, 0x00, "Galaxian - Coinage" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
+ PORT_DIPNAME( 0xc0, 0x00, "Galaxian - Coinage" ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( Free_Play ) )
PORT_START("GLIN2") /* Galaxian - IN2 */
- PORT_DIPNAME( 0x03, 0x01, "Galaxian - Bonus Life" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
+ PORT_DIPNAME( 0x03, 0x01, "Galaxian - Bonus Life" ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
PORT_DIPSETTING( 0x01, "4000" )
PORT_DIPSETTING( 0x02, "5000" )
PORT_DIPSETTING( 0x03, "7000" )
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
- PORT_DIPNAME( 0x04, 0x00, "Galaxian - Lives" ) PORT_CONDITION("GAMESEL",0x01,PORTCOND_EQUALS,0x01)
+ PORT_DIPNAME( 0x04, 0x00, "Galaxian - Lives" ) PORT_CONDITION("GAMESEL",0x01,EQUALS,0x01)
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x04, "5" )
PORT_DIPUNUSED( 0x08, 0x00 )
@@ -2489,7 +2489,7 @@ CUSTOM_INPUT_MEMBER(galaxian_state::moonwar_dial_r)
// see http://www.cityofberwyn.com/schematics/stern/MoonWar_opto.tiff for schematic
// I.e. a 74ls161 counts from 0 to 15 which is the absolute number of bars passed on the quadrature
- signed char dialread = input_port_read(machine(), dialname[p]);
+ signed char dialread = ioport(dialname[p])->read();
UINT8 ret;
@@ -2521,8 +2521,8 @@ static INPUT_PORTS_START( moonwar )
PORT_DIPSETTING( 0x03, DEF_STR( Free_Play ) ) /* see notes */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("IN2", 0x08, PORTCOND_EQUALS, 0x08) // cocktail: p2 thrust
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CONDITION("IN2", 0x08, PORTCOND_EQUALS, 0x00) // upright: p1&p2 hyperflip
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("IN2", 0x08, EQUALS, 0x08) // cocktail: p2 thrust
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CONDITION("IN2", 0x08, EQUALS, 0x00) // upright: p1&p2 hyperflip
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) // both: p1(upright: &p2) shield
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) // both: p1(upright: &p2) thrust
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) // both: p1(upright: &p2) fire
@@ -2543,8 +2543,8 @@ static INPUT_PORTS_START( moonwar )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P1_DIAL")
- PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_REVERSE PORT_RESET PORT_CONDITION("IN2", 0x08, PORTCOND_EQUALS, 0x08) // cocktail: dial is reversed
- PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_RESET PORT_CONDITION("IN2", 0x08, PORTCOND_EQUALS, 0x00) // upright: dial works normally
+ PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_REVERSE PORT_RESET PORT_CONDITION("IN2", 0x08, EQUALS, 0x08) // cocktail: dial is reversed
+ PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_RESET PORT_CONDITION("IN2", 0x08, EQUALS, 0x00) // upright: dial works normally
PORT_START("P2_DIAL")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(4) PORT_RESET PORT_COCKTAIL PORT_REVERSE // cocktail: dial is reversed
diff --git a/src/mame/drivers/galivan.c b/src/mame/drivers/galivan.c
index 58cd8c13582..58515db0088 100644
--- a/src/mame/drivers/galivan.c
+++ b/src/mame/drivers/galivan.c
@@ -1085,7 +1085,7 @@ static DRIVER_INIT( youmab )
galivan_state *state = machine.driver_data<galivan_state>();
machine.device("maincpu")->memory().space(AS_IO)->install_write_handler(0x82, 0x82, write8_delegate(FUNC(galivan_state::youmab_extra_bank_w),state)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
- state->membank("bank3")->set_base(machine.root_device().memregion("maincpu")->base());
+ state->membank("bank3")->set_base(state->memregion("maincpu")->base());
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
state->membank("bank2")->configure_entries(0, 2, state->memregion("user2")->base(), 0x4000);
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 0da0d925935..3471baa250c 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -529,7 +529,7 @@ static void galpani3_mcu_run(running_machine &machine)
{
case 0x03: // DSW
{
- state->m_mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
+ state->m_mcu_ram[mcu_offset] = state->ioport("DSW")->read();
logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c
index 1ad5d2d07ed..6fceb7f51bc 100644
--- a/src/mame/drivers/gameplan.c
+++ b/src/mame/drivers/gameplan.c
@@ -110,7 +110,7 @@ static READ8_DEVICE_HANDLER( io_port_r )
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
gameplan_state *state = device->machine().driver_data<gameplan_state>();
- return input_port_read(device->machine(), portnames[state->m_current_port]);
+ return state->ioport(portnames[state->m_current_port])->read();
}
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 69aeb15b302..9ebf2acb90a 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -187,7 +187,7 @@ static MACHINE_RESET( gauntlet )
READ16_MEMBER(gauntlet_state::port4_r)
{
- int temp = input_port_read(machine(), "803008");
+ int temp = ioport("803008")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010;
return temp;
@@ -240,7 +240,7 @@ READ8_MEMBER(gauntlet_state::switch_6502_r)
if (m_cpu_to_sound_ready) temp ^= 0x80;
if (m_sound_to_cpu_ready) temp ^= 0x40;
if (!tms5220_readyq_r(machine().device("tms"))) temp ^= 0x20;
- if (!(input_port_read(machine(), "803008") & 0x0008)) temp ^= 0x10;
+ if (!(ioport("803008")->read() & 0x0008)) temp ^= 0x10;
return temp;
}
@@ -408,7 +408,7 @@ static INPUT_PORTS_START( gauntlet )
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("COIN") /* 1020 (sound) */
@@ -455,7 +455,7 @@ static INPUT_PORTS_START( vindctr2 )
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("COIN") /* 1020 (sound) */
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index 209d1e4de10..52c5ffc279d 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -82,13 +82,13 @@ READ16_MEMBER(gcpinbal_state::ioc_r)
switch (offset)
{
case 0x80/2:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 0x84/2:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x86/2:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 0x50:
case 0x51:
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index c58e5d5d07c..95a15b0a135 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -719,10 +719,10 @@ static INPUT_PORTS_START( getrivia )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) /* ticket status */
PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -896,10 +896,10 @@ static INPUT_PORTS_START( gt103a )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x40)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, PORTCOND_EQUALS, 0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00) PORT_NAME ("Start in no coins mode")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x40)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWA", 0x40, EQUALS, 0x00)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) /* ticket status */
PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c
index f9b69a15f16..e772c713db3 100644
--- a/src/mame/drivers/gijoe.c
+++ b/src/mame/drivers/gijoe.c
@@ -74,7 +74,7 @@ WRITE16_MEMBER(gijoe_state::control2_w)
/* bit 3 (unknown: coin) */
/* bit 5 is enable irq 6 */
/* bit 7 (unknown: enable irq 5?) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
m_cur_control2 = data;
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index 1932003c811..468d33f4e99 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -202,14 +202,14 @@ WRITE8_MEMBER(gladiatr_state::gladiatr_bankswitch_w)
static READ8_HANDLER( gladiator_dsw1_r )
{
- int orig = input_port_read(space->machine(), "DSW1")^0xff;
+ int orig = space->machine().root_device().ioport("DSW1")->read()^0xff;
return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
}
static READ8_HANDLER( gladiator_dsw2_r )
{
- int orig = input_port_read(space->machine(), "DSW2")^0xff;
+ int orig = space->machine().root_device().ioport("DSW2")->read()^0xff;
return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
}
@@ -218,15 +218,15 @@ static READ8_HANDLER( gladiator_controls_r )
{
int coins = 0;
- if( input_port_read(space->machine(), "COINS") & 0xc0 ) coins = 0x80;
+ if( space->machine().root_device().ioport("COINS")->read() & 0xc0 ) coins = 0x80;
switch(offset)
{
case 0x01: /* start button , coins */
- return input_port_read(space->machine(), "IN0") | coins;
+ return space->machine().root_device().ioport("IN0")->read() | coins;
case 0x02: /* Player 1 Controller , coins */
- return input_port_read(space->machine(), "IN1") | coins;
+ return space->machine().root_device().ioport("IN1")->read() | coins;
case 0x04: /* Player 2 Controller , coins */
- return input_port_read(space->machine(), "IN2") | coins;
+ return space->machine().root_device().ioport("IN2")->read() | coins;
}
/* unknown */
return 0;
@@ -237,7 +237,7 @@ static READ8_HANDLER( gladiator_button3_r )
switch(offset)
{
case 0x01: /* button 3 */
- return input_port_read(space->machine(), "IN3");
+ return space->machine().root_device().ioport("IN3")->read();
}
/* unknown */
return 0;
diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c
index 0305269590f..41d826726d6 100644
--- a/src/mame/drivers/go2000.c
+++ b/src/mame/drivers/go2000.c
@@ -136,14 +136,14 @@ static INPUT_PORTS_START( go2000 )
PORT_DIPSETTING( 0x0100, "7" )
PORT_DIPSETTING( 0x0000, "8" )
PORT_DIPNAME( 0x1800, 0x1800, "M1 value" ) PORT_DIPLOCATION("SW-2:4,5")
- PORT_DIPSETTING( 0x0800, "3000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, "3500" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x1800, "4000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x1000, "4500" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0800, "6000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, "7000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x1800, "8000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x1000, "9000" ) PORT_CONDITION("DSW", 0x0003, PORTCOND_NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0800, "3000" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, "3500" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x1800, "4000" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x1000, "4500" ) PORT_CONDITION("DSW", 0x0003, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0800, "6000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, "7000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x1800, "8000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x1000, "9000" ) PORT_CONDITION("DSW", 0x0003, NOTEQUALS, 0x0000)
PORT_DIPUNKNOWN_DIPLOC( 0x2000, IP_ACTIVE_LOW, "SW-2:6" )
PORT_DIPNAME( 0xc000, 0xc000, "Difficult-2" ) PORT_DIPLOCATION("SW-2:7,8")
PORT_DIPSETTING( 0xc000, "1" )
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index 5ca3ccb6c2c..7be77af8abb 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -29,15 +29,15 @@ READ16_MEMBER(goal92_state::goal92_inputs_r)
switch(offset)
{
case 0:
- return input_port_read(machine(), "DSW1");
+ return ioport("DSW1")->read();
case 1:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 2:
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
case 3:
- return input_port_read(machine(), "IN3");
+ return ioport("IN3")->read();
case 7:
- return input_port_read(machine(), "DSW2");
+ return ioport("DSW2")->read();
default:
logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,cpu_get_pc(&space.device()));
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index 369099ae0c2..3050da33402 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -1199,10 +1199,10 @@ static READ8_DEVICE_HANDLER( goldnpkr_mux_port_r )
goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
switch( state->m_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine(), "IN0-0");
- case 0x20: return input_port_read(device->machine(), "IN0-1");
- case 0x40: return input_port_read(device->machine(), "IN0-2");
- case 0x80: return input_port_read(device->machine(), "IN0-3");
+ case 0x10: return state->ioport("IN0-0")->read();
+ case 0x20: return state->ioport("IN0-1")->read();
+ case 0x40: return state->ioport("IN0-2")->read();
+ case 0x80: return state->ioport("IN0-3")->read();
}
return 0xff;
}
@@ -1214,10 +1214,10 @@ static READ8_DEVICE_HANDLER( pottnpkr_mux_port_r )
switch( state->m_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine(), "IN0-0");
- case 0x20: return input_port_read(device->machine(), "IN0-1");
- case 0x40: return input_port_read(device->machine(), "IN0-2");
- case 0x80: return input_port_read(device->machine(), "IN0-3");
+ case 0x10: return state->ioport("IN0-0")->read();
+ case 0x20: return state->ioport("IN0-1")->read();
+ case 0x40: return state->ioport("IN0-2")->read();
+ case 0x80: return state->ioport("IN0-3")->read();
}
pa_7 = (state->m_pia0_PA_data >> 7) & 1; /* To do: bit PA5 to pin CB1 */
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index fe824d833d6..6f438356ccc 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -680,28 +680,28 @@ static INPUT_PORTS_START( cmv801 )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -842,28 +842,28 @@ static INPUT_PORTS_START( cmv4 )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -1004,28 +1004,28 @@ static INPUT_PORTS_START( cmaster )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -1166,28 +1166,28 @@ static INPUT_PORTS_START( cmasterb )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -1328,28 +1328,28 @@ static INPUT_PORTS_START( cmasterc )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -1490,28 +1490,28 @@ static INPUT_PORTS_START( cmast91 )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) /* A-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) /* B-Type */
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) /* C-Type */
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) /* D-Type */
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -1789,28 +1789,28 @@ static INPUT_PORTS_START( chrygld )
PORT_START("DSW3") /* some of these could be wrong */
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPSETTING( 0x04, "1 Coin/20 Credits" )
PORT_DIPSETTING( 0x08, "1 Coin/50 Credits" )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
- PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
+ PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -1961,28 +1961,28 @@ static INPUT_PORTS_START( chry10 )
PORT_START("DSW3") /* seems ok */
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPSETTING( 0x04, "1 Coin/20 Credits" )
PORT_DIPSETTING( 0x08, "1 Coin/50 Credits" )
PORT_DIPSETTING( 0x0c, "1 Coin/100 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6") /* OK */
- PORT_DIPSETTING( 0x30, "5 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
- PORT_DIPSETTING( 0x20, "2 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, "1 Coin/20 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 200 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 500 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
+ PORT_DIPSETTING( 0x30, "5 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
+ PORT_DIPSETTING( 0x20, "2 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, "1 Coin/20 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 50 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 200 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 500 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8") /* OK */
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPSETTING( 0x40, "1 Coin/20 Credits" )
@@ -2133,28 +2133,28 @@ static INPUT_PORTS_START( ncb3 )
PORT_START("DSW3") /* some of these are wrong */
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
- PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
+ PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -2305,28 +2305,28 @@ static INPUT_PORTS_START( cb3a )
PORT_START("DSW3") /* some of these are wrong */
PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
- PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
- PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) // A-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // B-Type
+ PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_DIPSETTING( 0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
- PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
- PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10) // C-Type
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x30, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00) // D-Type
+ PORT_DIPSETTING( 0x20, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "1 Ticket/Coin / 100 Credits" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
@@ -3759,25 +3759,25 @@ static INPUT_PORTS_START( schery97 )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
/* DIP switches 2 to 5 work only for version 3.51 */
PORT_DIPNAME( 0x02, 0x00, "Limit Score of Each Game to Max 10x Bet or $5.00" ) PORT_DIPLOCATION("DSW5:2") /* OK */
- PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x04, 0x00, "Play Remaining Score when No Credit" ) PORT_DIPLOCATION("DSW5:3") /* OK */
- PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x04, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x04, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x08, 0x00, "Reset Remaining Score to Zero" ) PORT_DIPLOCATION("DSW5:4") /* OK */
- PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x10, 0x00, "Ticket Dispense from Score" ) PORT_DIPLOCATION("DSW5:5") /* OK */
- PORT_DIPSETTING( 0x00, "Use TDDD" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, "Use Interface" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "Use TDDD" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, "Use Interface" ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x20, 0x20, "Reel Speed (ver 2.3)" ) PORT_DIPLOCATION("DSW5:6") /* OK (turn the machine off/on after change) */
PORT_DIPSETTING( 0x20, "Slow" )
PORT_DIPSETTING( 0x00, "Fast" )
@@ -3831,27 +3831,27 @@ static INPUT_PORTS_START( nfb96 )
PORT_DIPSETTING( 0x01, "Level 7" )
PORT_DIPSETTING( 0x00, "Level 8" )
PORT_DIPNAME( 0x38, 0x38, "Maximum Play" ) PORT_DIPLOCATION("DSW1:4,5,6") /* OK */
- PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, "20" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "30" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x18, "40" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "8" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x08, "16" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x10, "24" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x18, "32" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "20" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "30" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "40" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "8" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x08, "16" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x10, "24" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x18, "32" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
PORT_DIPSETTING( 0x20, "40" )
PORT_DIPSETTING( 0x28, "48" )
PORT_DIPSETTING( 0x30, "64" )
PORT_DIPSETTING( 0x38, "80" )
PORT_DIPNAME( 0xc0, 0x80, "Minimum Play for Bonus" ) PORT_DIPLOCATION("DSW1:7,8") /* OK */
- PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x40, "20" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x80, "30" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0xc0, "40" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "8" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x40, "16" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x80, "24" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0xc0, "32" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, "10" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, "20" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x80, "30" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0xc0, "40" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "8" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x40, "16" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x80, "24" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0xc0, "32" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, "Double-Up Game" ) PORT_DIPLOCATION("DSW2:1") /* OK */
@@ -3881,12 +3881,12 @@ static INPUT_PORTS_START( nfb96 )
PORT_START("DSW3")
PORT_DIPNAME( 0x03, 0x02, "Minimum Play to Start" ) PORT_DIPLOCATION("DSW3:1,2") /* OK */
PORT_DIPSETTING( 0x00, "1" )
- PORT_DIPSETTING( 0x01, "10" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "20" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x03, "30" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x01, "8" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x02, "16" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x03, "24" ) PORT_CONDITION("DSW5",0x10,PORTCOND_EQUALS,0x10)
+ PORT_DIPSETTING( 0x01, "10" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "20" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, "30" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x01, "8" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x02, "16" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x03, "24" ) PORT_CONDITION("DSW5",0x10,EQUALS,0x10)
PORT_DIPNAME( 0x0c, 0x08, "Max Coin In & Note In Point" ) PORT_DIPLOCATION("DSW3:3,4") /* OK */
PORT_DIPSETTING( 0x00, "1000" )
PORT_DIPSETTING( 0x04, "5000" )
@@ -3941,10 +3941,10 @@ static INPUT_PORTS_START( nfb96 )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "Limit Score of Each Game to Max 10x Bet or $5.00" ) PORT_DIPLOCATION("DSW5:2") /* OK */
- PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x04, 0x00, "Use Printer" ) PORT_DIPLOCATION("DSW5:3") /* OK */
PORT_DIPSETTING( 0x00, "No (Use TDDD)" )
PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
@@ -3955,15 +3955,15 @@ static INPUT_PORTS_START( nfb96 )
PORT_DIPSETTING( 0x10, "Base 8" )
PORT_DIPSETTING( 0x00, "Base 10" )
PORT_DIPNAME( 0x20, 0x20, "Play Score when no point left" ) PORT_DIPLOCATION("DSW5:6") /* OK (turn the machine off/on after change) */
- PORT_DIPSETTING( 0x20, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x40, 0x00, "Reset Remaining Score when Game Over" ) PORT_DIPLOCATION("DSW5:7") /* OK (turn the machine off/on after change) */
- PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x80, 0x00, "Advanced Count Game" ) PORT_DIPLOCATION("DSW5:8") /* OK (turn the machine off/on after change) */
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
@@ -4111,10 +4111,10 @@ static INPUT_PORTS_START( nfb96tx )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "Limit Score of Each Game to Max 10x Bet or $5.00" ) PORT_DIPLOCATION("DSW5:2") /* OK */
- PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x04, 0x00, "Use Printer" ) PORT_DIPLOCATION("DSW5:3") /* OK */
PORT_DIPSETTING( 0x00, "Interfase" )
PORT_DIPSETTING( 0x04, "Direct Driver" )
@@ -4125,15 +4125,15 @@ static INPUT_PORTS_START( nfb96tx )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, "Play Score when no point left" ) PORT_DIPLOCATION("DSW5:6") /* OK (turn the machine off/on after change) */
- PORT_DIPSETTING( 0x20, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x40, 0x00, "Reset Remaining Score when Game Over" ) PORT_DIPLOCATION("DSW5:7") /* OK (turn the machine off/on after change) */
- PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
- PORT_DIPSETTING( 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x10)
+ PORT_DIPSETTING( 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Unused ) ) PORT_CONDITION("DSW4",0x10,EQUALS,0x00)
PORT_DIPNAME( 0x80, 0x00, "Advanced Count Game" ) PORT_DIPLOCATION("DSW5:8") /* OK (turn the machine off/on after change) */
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
diff --git a/src/mame/drivers/gomoku.c b/src/mame/drivers/gomoku.c
index bbe4f0a92f6..8c2a97bafa5 100644
--- a/src/mame/drivers/gomoku.c
+++ b/src/mame/drivers/gomoku.c
@@ -32,7 +32,7 @@ READ8_MEMBER(gomoku_state::input_port_r)
res = 0;
for (i = 0; i < 8; i++)
- res |= ((input_port_read_safe(machine(), portnames[i], 0xff) >> offset) & 1) << i;
+ res |= ((ioport(portnames[i])->read_safe(0xff) >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/goodejan.c b/src/mame/drivers/goodejan.c
index 91b201b37ce..e035bf41939 100644
--- a/src/mame/drivers/goodejan.c
+++ b/src/mame/drivers/goodejan.c
@@ -88,11 +88,11 @@ READ16_MEMBER(goodejan_state::mahjong_panel_r)
switch(m_mux_data)
{
- case 1: ret = input_port_read(machine(), "KEY0"); break;
- case 2: ret = input_port_read(machine(), "KEY1"); break;
- case 4: ret = input_port_read(machine(), "KEY2"); break;
- case 8: ret = input_port_read(machine(), "KEY3"); break;
- case 0x10: ret = input_port_read(machine(), "KEY4"); break;
+ case 1: ret = ioport("KEY0")->read(); break;
+ case 2: ret = ioport("KEY1")->read(); break;
+ case 4: ret = ioport("KEY2")->read(); break;
+ case 8: ret = ioport("KEY3")->read(); break;
+ case 0x10: ret = ioport("KEY4")->read(); break;
}
return ret;
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index dfde6cb64d0..16961b6eb88 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -295,22 +295,22 @@ CUSTOM_INPUT_MEMBER(gottlieb_state::analog_delta_r)
const char *string = (const char *)param;
int which = string[0] - '0';
- return input_port_read(machine(), &string[1]) - m_track[which];
+ return ioport(&string[1])->read() - m_track[which];
}
WRITE8_MEMBER(gottlieb_state::gottlieb_analog_reset_w)
{
/* reset the trackball counters */
- m_track[0] = input_port_read_safe(machine(), "TRACKX", 0);
- m_track[1] = input_port_read_safe(machine(), "TRACKY", 0);
+ m_track[0] = ioport("TRACKX")->read_safe(0);
+ m_track[1] = ioport("TRACKY")->read_safe(0);
}
CUSTOM_INPUT_MEMBER(gottlieb_state::stooges_joystick_r)
{
static const char *const joyport[] = { "P2JOY", "P3JOY", "P1JOY", NULL };
- return (joyport[m_joystick_select & 3] != NULL) ? input_port_read(machine(), joyport[m_joystick_select & 3]) : 0xff;
+ return (joyport[m_joystick_select & 3] != NULL) ? ioport(joyport[m_joystick_select & 3])->read() : 0xff;
}
@@ -1235,17 +1235,17 @@ static INPUT_PORTS_START( curvebal )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x20, DEF_STR( French ) )
PORT_DIPNAME( 0xc2, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:!6,!7,!8")
- PORT_DIPSETTING( 0x42, "A 3/1 B 1/2" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
- PORT_DIPSETTING( 0x42, "A 4/1 B 1/1" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x82, "A 1/5 B 1/2" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
- PORT_DIPSETTING( 0x82, "A 3/1 B 1/1" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, "A 2/1 B 2/3" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
- PORT_DIPSETTING( 0x02, "A 2/1 B 1/1" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x42, "A 3/1 B 1/2" ) PORT_CONDITION("DSW",0x20,EQUALS,0x20)
+ PORT_DIPSETTING( 0x42, "A 4/1 B 1/1" ) PORT_CONDITION("DSW",0x20,EQUALS,0x00)
+ PORT_DIPSETTING( 0x82, "A 1/5 B 1/2" ) PORT_CONDITION("DSW",0x20,EQUALS,0x20)
+ PORT_DIPSETTING( 0x82, "A 3/1 B 1/1" ) PORT_CONDITION("DSW",0x20,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, "A 2/1 B 2/3" ) PORT_CONDITION("DSW",0x20,EQUALS,0x20)
+ PORT_DIPSETTING( 0x02, "A 2/1 B 1/1" ) PORT_CONDITION("DSW",0x20,EQUALS,0x00)
PORT_DIPSETTING( 0xc0, "A 2/1 B 2/1" )
- PORT_DIPSETTING( 0x80, "A 1/1 B 1/2" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
- PORT_DIPSETTING( 0x80, "A 2/1 B 1/2" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x40, "A 1/1 B 1/3" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x20)
- PORT_DIPSETTING( 0x40, "A 2/1 B 1/3" ) PORT_CONDITION("DSW",0x20,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x80, "A 1/1 B 1/2" ) PORT_CONDITION("DSW",0x20,EQUALS,0x20)
+ PORT_DIPSETTING( 0x80, "A 2/1 B 1/2" ) PORT_CONDITION("DSW",0x20,EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, "A 1/1 B 1/3" ) PORT_CONDITION("DSW",0x20,EQUALS,0x20)
+ PORT_DIPSETTING( 0x40, "A 2/1 B 1/3" ) PORT_CONDITION("DSW",0x20,EQUALS,0x00)
PORT_DIPSETTING( 0x00, "A 1/1 B 1/1" )
PORT_DIPSETTING( 0xc2, DEF_STR( Free_Play ) )
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index e1fe9ba557d..f6c88700185 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -247,9 +247,9 @@ READ8_MEMBER(gpworld_state::ldp_read)
READ8_MEMBER(gpworld_state::pedal_in)
{
if (m_brake_gas)
- return input_port_read(machine(), "INACCEL");
+ return ioport("INACCEL")->read();
- return input_port_read(machine(), "INBRAKE");
+ return ioport("INBRAKE")->read();
}
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index 1f618dab5bc..db9900eb18b 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -79,7 +79,7 @@
static MACHINE_RESET( grchamp )
{
/* if the coin system is 1 way, lock Coin B (Page 40) */
- coin_lockout_w(machine, 1, (input_port_read(machine, "DSWB") & 0x10) ? 1 : 0);
+ coin_lockout_w(machine, 1, (machine.root_device().ioport("DSWB")->read() & 0x10) ? 1 : 0);
}
diff --git a/src/mame/drivers/gridlee.c b/src/mame/drivers/gridlee.c
index b1118ef3a12..f3e3e165189 100644
--- a/src/mame/drivers/gridlee.c
+++ b/src/mame/drivers/gridlee.c
@@ -180,7 +180,7 @@ READ8_MEMBER(gridlee_state::analog_port_r)
static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
/* first read the new trackball value and compute the signed delta */
- newval = input_port_read(machine(), portnames[offset + 2 * m_cocktail_flip]);
+ newval = ioport(portnames[offset + 2 * m_cocktail_flip])->read();
delta = (int)newval - (int)m_last_analog_input[offset];
/* handle the case where we wrap around from 0x00 to 0xff, or vice versa */
@@ -390,7 +390,7 @@ static INPUT_PORTS_START( gridlee )
PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index b976db6d9e1..00100d6053f 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -146,7 +146,7 @@ WRITE32_MEMBER(groundfx_state::groundfx_input_w)
if (ACCESSING_BITS_0_7)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
break;
@@ -166,7 +166,7 @@ WRITE32_MEMBER(groundfx_state::groundfx_input_w)
READ32_MEMBER(groundfx_state::groundfx_adc_r)
{
- return (input_port_read(machine(), "AN0") << 8) | input_port_read(machine(), "AN1");
+ return (ioport("AN0")->read() << 8) | ioport("AN1")->read();
}
WRITE32_MEMBER(groundfx_state::groundfx_adc_w)
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index 396b8c35a52..ad28a6cb06e 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -185,7 +185,7 @@ CUSTOM_INPUT_MEMBER(gstream_state::gstream_mirror_service_r)
int result;
/* PORT_SERVICE_NO_TOGGLE */
- result = (input_port_read(machine(), "IN0") & 0x8000) >> 15;
+ result = (ioport("IN0")->read() & 0x8000) >> 15;
return ~result;
}
@@ -195,15 +195,15 @@ CUSTOM_INPUT_MEMBER(gstream_state::gstream_mirror_r)
int result;
/* IPT_COIN1 */
- result = ((input_port_read(machine(), "IN0") & 0x200) >> 9) << 0;
+ result = ((ioport("IN0")->read() & 0x200) >> 9) << 0;
/* IPT_COIN2 */
- result |= ((input_port_read(machine(), "IN1") & 0x200) >> 9) << 1;
+ result |= ((ioport("IN1")->read() & 0x200) >> 9) << 1;
/* IPT_START1 */
- result |= ((input_port_read(machine(), "IN0") & 0x400) >> 10) << 2;
+ result |= ((ioport("IN0")->read() & 0x400) >> 10) << 2;
/* IPT_START2 */
- result |= ((input_port_read(machine(), "IN1") & 0x400) >> 10) << 3;
+ result |= ((ioport("IN1")->read() & 0x400) >> 10) << 3;
/* PORT_SERVICE_NO_TOGGLE */
- result |= ((input_port_read(machine(), "IN0") & 0x8000) >> 15) << 6;
+ result |= ((ioport("IN0")->read() & 0x8000) >> 15) << 6;
return ~result;
}
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 5019d93af03..6ac0e1298d1 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -153,7 +153,7 @@ reg: 0->1 (main->2nd) / : (1->0) 2nd->main :
static int gsword_coins_in(void)
{
/* emulate 8741 coin slot */
- if (input_port_read(machine, "IN4") & 0xc0)
+ if (machine.root_device().ioport("IN4")->read() & 0xc0)
{
logerror("Coin In\n");
return 0x80;
@@ -191,11 +191,11 @@ static READ8_HANDLER( gsword_8741_2_r )
switch (offset)
{
case 0x01: /* start button , coins */
- return input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
case 0x02: /* Player 1 Controller */
- return input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x04: /* Player 2 Controller */
- return input_port_read(space->machine(), "IN3");
+ return space->machine().root_device().ioport("IN3")->read();
// default:
// logerror("8741-2 unknown read %d PC=%04x\n",offset,cpu_get_pc(&space->device()));
}
@@ -208,11 +208,11 @@ static READ8_HANDLER( gsword_8741_3_r )
switch (offset)
{
case 0x01: /* start button */
- return input_port_read(space->machine(), "IN2");
+ return space->machine().root_device().ioport("IN2")->read();
case 0x02: /* Player 1 Controller? */
- return input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x04: /* Player 2 Controller? */
- return input_port_read(space->machine(), "IN3");
+ return space->machine().root_device().ioport("IN3")->read();
}
/* unknown */
// logerror("8741-3 unknown read %d PC=%04x\n",offset,cpu_get_pc(&space->device()));
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index be0e347f7ca..ce453679237 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -343,7 +343,7 @@ READ8_MEMBER(gticlub_state::sysreg_r)
case 0:
case 1:
case 3:
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
case 2:
return adc1038_sars_read(adc1038) << 7;
@@ -727,10 +727,10 @@ static int adc1038_input_callback( device_t *device, int input )
int value = 0;
switch (input)
{
- case 0: value = input_port_read(device->machine(), "AN0"); break;
- case 1: value = input_port_read(device->machine(), "AN1"); break;
- case 2: value = input_port_read(device->machine(), "AN2"); break;
- case 3: value = input_port_read(device->machine(), "AN3"); break;
+ case 0: value = device->machine().root_device().ioport("AN0")->read(); break;
+ case 1: value = device->machine().root_device().ioport("AN1")->read(); break;
+ case 2: value = device->machine().root_device().ioport("AN2")->read(); break;
+ case 3: value = device->machine().root_device().ioport("AN3")->read(); break;
case 4: value = 0x000; break;
case 5: value = 0x000; break;
case 6: value = 0x000; break;
@@ -1165,7 +1165,7 @@ static DRIVER_INIT(gticlub)
state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
- K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 1);
+ K001005_preprocess_texture_data(state->memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 1);
}
static DRIVER_INIT(hangplt)
@@ -1173,7 +1173,7 @@ static DRIVER_INIT(hangplt)
gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
state->m_sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index fadefe86604..6e09d7a56da 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -579,7 +579,7 @@ READ16_MEMBER(guab_state::io_r)
case 0x01:
case 0x02:
{
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
case 0x30:
{
diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c
index d0ed564ec28..4e8bb00d61f 100644
--- a/src/mame/drivers/gunbustr.c
+++ b/src/mame/drivers/gunbustr.c
@@ -174,8 +174,8 @@ WRITE32_MEMBER(gunbustr_state::motor_control_w)
READ32_MEMBER(gunbustr_state::gunbustr_gun_r)
{
- return ( input_port_read(machine(), "LIGHT0_X") << 24) | (input_port_read(machine(), "LIGHT0_Y") << 16) |
- ( input_port_read(machine(), "LIGHT1_X") << 8) | input_port_read(machine(), "LIGHT1_Y");
+ return ( ioport("LIGHT0_X")->read() << 24) | (ioport("LIGHT0_Y")->read() << 16) |
+ ( ioport("LIGHT1_X")->read() << 8) | ioport("LIGHT1_Y")->read();
}
WRITE32_MEMBER(gunbustr_state::gunbustr_gun_w)
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index d7dc78ccee7..61d9e24c01c 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -498,9 +498,9 @@ static TIMER_DEVICE_CALLBACK( yamyam_mcu_sim )
break;
}
- state->m_rambase[0x004] = input_port_read(timer.machine(), "IN2");
- state->m_rambase[0x005] = input_port_read(timer.machine(), "IN1");
- state->m_rambase[0x006] = input_port_read(timer.machine(), "IN0");
+ state->m_rambase[0x004] = timer.machine().root_device().ioport("IN2")->read();
+ state->m_rambase[0x005] = timer.machine().root_device().ioport("IN1")->read();
+ state->m_rambase[0x006] = timer.machine().root_device().ioport("IN0")->read();
}
static MACHINE_CONFIG_DERIVED( yamyam, gundealr )
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index 15ef83a2238..a11d2916aab 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -120,11 +120,11 @@ READ8_MEMBER(gunpey_state::gunpey_inputs_r)
{
switch(offset+0x7f40)
{
- case 0x7f40: return input_port_read(machine(), "DSW1");
- case 0x7f41: return input_port_read(machine(), "DSW2");
- case 0x7f42: return input_port_read(machine(), "P1");
- case 0x7f43: return input_port_read(machine(), "P2");
- case 0x7f44: return input_port_read(machine(), "SYSTEM");
+ case 0x7f40: return ioport("DSW1")->read();
+ case 0x7f41: return ioport("DSW2")->read();
+ case 0x7f42: return ioport("P1")->read();
+ case 0x7f43: return ioport("P2")->read();
+ case 0x7f44: return ioport("SYSTEM")->read();
}
return 0xff;
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index 38a05067677..51a934aab65 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -1488,7 +1488,7 @@ static SCREEN_UPDATE_IND16( halleys )
bitmap.fill(state->m_bgcolor, cliprect);
#ifdef MAME_DEBUG
- if (input_port_read(screen.machine(), "DEBUG")) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used???
+ if (screen.machine().root_device().ioport("DEBUG")->read()) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used???
#endif
copy_scroll_xp(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1);
@@ -1628,8 +1628,8 @@ READ8_MEMBER(halleys_state::coin_lockout_r)
// 0x8599 : 'benberob'
// 0x83e2 : 'halleys', 'halleysc', 'halleycj'
// 0x83df : 'halley87'
- int inp = input_port_read(machine(), "IN0");
- int result = ((input_port_read(machine(), "DSW4")) & 0x20) >> 5;
+ int inp = ioport("IN0")->read();
+ int result = ((ioport("DSW4")->read()) & 0x20) >> 5;
if (inp & 0x80) result |= 0x02;
if (inp & 0x40) result |= 0x04;
@@ -1642,7 +1642,7 @@ READ8_MEMBER(halleys_state::io_mirror_r)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
diff --git a/src/mame/drivers/hanaawas.c b/src/mame/drivers/hanaawas.c
index 35d0cfe672e..eaee22bf60e 100644
--- a/src/mame/drivers/hanaawas.c
+++ b/src/mame/drivers/hanaawas.c
@@ -38,13 +38,13 @@ READ8_MEMBER(hanaawas_state::hanaawas_input_port_0_r)
switch (m_mux)
{
case 1: /* start buttons */
- buttons = input_port_read(machine(), "START");
+ buttons = ioport("START")->read();
break;
case 2: /* player 1 buttons */
- buttons = input_port_read(machine(), "P1");
+ buttons = ioport("P1")->read();
break;
case 4: /* player 2 buttons */
- buttons = input_port_read(machine(), "P2");
+ buttons = ioport("P2")->read();
break;
}
@@ -60,7 +60,7 @@ READ8_MEMBER(hanaawas_state::hanaawas_input_port_0_r)
}
}
- return (input_port_read(machine(), "IN0") & 0xf0) | ordinal;
+ return (ioport("IN0")->read() & 0xf0) | ordinal;
}
WRITE8_MEMBER(hanaawas_state::hanaawas_inputs_mux_w)
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index f8cb2f270b0..5dc7246c279 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -686,7 +686,7 @@ static INPUT_PORTS_START( harddriv )
PORT_START("IN0") /* 600000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED ) /* diagnostic switch */
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
@@ -742,7 +742,7 @@ static INPUT_PORTS_START( racedriv )
PORT_START("IN0") /* 600000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED ) /* diagnostic switch */
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
@@ -798,7 +798,7 @@ static INPUT_PORTS_START( racedrivc )
PORT_START("IN0") /* 60c000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED ) /* diagnostic switch */
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
@@ -860,7 +860,7 @@ static INPUT_PORTS_START( stunrun )
PORT_START("IN0") /* 60c000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
@@ -922,7 +922,7 @@ static INPUT_PORTS_START( steeltal )
PORT_START("IN0") /* 60c000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
@@ -985,7 +985,7 @@ static INPUT_PORTS_START( strtdriv )
PORT_START("IN0") /* 60c000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
@@ -1048,7 +1048,7 @@ static INPUT_PORTS_START( hdrivair )
PORT_START("IN0") /* 60c000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) /* HBLANK */
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 12-bit EOC */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* 8-bit EOC */
PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index 30d5b174b7c..74529300a6c 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -194,17 +194,17 @@ static SCREEN_UPDATE_RGB32(brasil)
READ16_MEMBER(highvdeo_state::read1_r)
{
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
READ16_MEMBER(highvdeo_state::read2_r)
{
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
READ16_MEMBER(highvdeo_state::read3_r)
{
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
}
WRITE16_MEMBER(highvdeo_state::tv_vcf_paletteram_w)
@@ -322,7 +322,7 @@ READ16_MEMBER(highvdeo_state::tv_ncf_read2_r)
// machine resets itself.
resetpulse ^= 0x40;
- return (input_port_read(machine(), "IN1") & 0xbf) | resetpulse;
+ return (ioport("IN1")->read() & 0xbf) | resetpulse;
}
static WRITE16_DEVICE_HANDLER( tv_ncf_oki6376_w )
diff --git a/src/mame/drivers/hitme.c b/src/mame/drivers/hitme.c
index a0bb7e99754..b1ec5e1d861 100644
--- a/src/mame/drivers/hitme.c
+++ b/src/mame/drivers/hitme.c
@@ -72,7 +72,7 @@ static SCREEN_UPDATE_IND16( hitme )
{
hitme_state *state = screen.machine().driver_data<hitme_state>();
/* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */
- double width_resist = input_port_read(screen.machine(), "WIDTH") * 25000 / 100;
+ double width_resist = screen.machine().root_device().ioport("WIDTH")->read() * 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 */
@@ -136,7 +136,7 @@ static UINT8 read_port_and_t0( running_machine &machine, int port )
hitme_state *state = machine.driver_data<hitme_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- UINT8 val = input_port_read(machine, portnames[port]);
+ UINT8 val = machine.root_device().ioport(portnames[port])->read();
if (machine.time() > state->m_timeout_time)
val ^= 0x80;
return val;
@@ -192,7 +192,7 @@ static WRITE8_DEVICE_HANDLER( output_port_0_w )
system's equivalent computation, or else we will hang notes.
*/
hitme_state *state = device->machine().driver_data<hitme_state>();
- UINT8 raw_game_speed = input_port_read(device->machine(), "R3");
+ UINT8 raw_game_speed = state->ioport("R3")->read();
double resistance = raw_game_speed * 25000 / 100;
attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1));
state->m_timeout_time = device->machine().time() + duration;
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index 888cf8923f6..2d372f1dc49 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -289,7 +289,7 @@ static INPUT_PORTS_START( hitpoker )
PORT_DIPNAME( 0x40, 0x40, "Monitor" ) //a JP probably
PORT_DIPSETTING( 0x40, "15KHz" )
PORT_DIPSETTING( 0x00, "24KHz" )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN0")
PORT_DIPNAME( 0x01, 0x01, "IN0" )
diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c
index 729350123e7..e54450cebd9 100644
--- a/src/mame/drivers/hnayayoi.c
+++ b/src/mame/drivers/hnayayoi.c
@@ -49,7 +49,7 @@ READ8_MEMBER(hnayayoi_state::keyboard_0_r)
for (i = 0; i < 5; i++)
{
if (~m_keyb & (1 << i))
- res &= input_port_read(machine(), keynames[i]);
+ res &= ioport(keynames[i])->read();
}
return res;
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index cf6defe3300..11089f3b506 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -639,8 +639,8 @@ READ32_MEMBER(hng64_state::fight_io_r)
switch (offset*4)
{
case 0x000: return 0x00000400;
- case 0x004: return input_port_read(machine(), "SYSTEM");
- case 0x008: return input_port_read(machine(), "P1_P2");
+ case 0x004: return ioport("SYSTEM")->read();
+ case 0x008: return ioport("P1_P2")->read();
case 0x600: return m_no_machine_error_code;
}
@@ -668,8 +668,8 @@ READ32_MEMBER(hng64_state::samsho_io_r)
else
return 0x000;
}
- case 0x004: return input_port_read(machine(), "SYSTEM");
- case 0x008: return input_port_read(machine(), "P1_P2");
+ case 0x004: return ioport("SYSTEM")->read();
+ case 0x008: return ioport("P1_P2")->read();
case 0x600: return m_no_machine_error_code;
}
@@ -696,26 +696,26 @@ READ32_MEMBER(hng64_state::shoot_io_r)
case 0x010:
{
/* Quick kludge for use the input test items */
- if(input_port_read(machine(), "D_IN") & 0x01000000)
+ if(ioport("D_IN")->read() & 0x01000000)
m_p1_trig = machine().rand() & 0x01000000;
- return (input_port_read(machine(), "D_IN") & ~0x01000000) | (m_p1_trig);
+ return (ioport("D_IN")->read() & ~0x01000000) | (m_p1_trig);
}
case 0x018:
{
UINT8 p1_x, p1_y, p2_x, p2_y;
- p1_x = input_port_read(machine(), "LIGHT_P1_X") & 0xff;
- p1_y = input_port_read(machine(), "LIGHT_P1_Y") & 0xff;
- p2_x = input_port_read(machine(), "LIGHT_P2_X") & 0xff;
- p2_y = input_port_read(machine(), "LIGHT_P2_Y") & 0xff;
+ p1_x = ioport("LIGHT_P1_X")->read() & 0xff;
+ p1_y = ioport("LIGHT_P1_Y")->read() & 0xff;
+ p2_x = ioport("LIGHT_P2_X")->read() & 0xff;
+ p2_y = ioport("LIGHT_P2_Y")->read() & 0xff;
return p1_x<<24 | p1_y<<16 | p2_x<<8 | p2_y;
}
case 0x01c:
{
UINT8 p3_x, p3_y;
- p3_x = input_port_read(machine(), "LIGHT_P3_X") & 0xff;
- p3_y = input_port_read(machine(), "LIGHT_P3_Y") & 0xff;
+ p3_x = ioport("LIGHT_P3_X")->read() & 0xff;
+ p3_y = ioport("LIGHT_P3_Y")->read() & 0xff;
return p3_x<<24 | p3_y<<16 | p3_x<<8 | p3_y; //FIXME: see what's the right bank here when the trigger works
}
@@ -741,8 +741,8 @@ READ32_MEMBER(hng64_state::racing_io_r)
else
return 0x000;
}
- case 0x004: return input_port_read(machine(), "SYSTEM");
- case 0x008: return input_port_read(machine(), "P1_P2");
+ case 0x004: return ioport("SYSTEM")->read();
+ case 0x008: return ioport("P1_P2")->read();
case 0x600: return m_no_machine_error_code;
}
@@ -929,7 +929,7 @@ READ32_MEMBER(hng64_state::tcram_r)
//printf("Q1 R : %.8x %.8x\n", offset, hng64_tcram[offset]);
if(offset == 0x12)
- return input_port_read(machine(), "VBLANK");
+ return ioport("VBLANK")->read();
return m_tcram[offset];
}
@@ -1269,7 +1269,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( hng64 )
PORT_START("VBLANK")
- PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IPT_TEST")
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
@@ -1345,7 +1345,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( bbust2 )
PORT_START("VBLANK")
- PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("D_IN")
PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index afc00c1e370..89dbdf1915a 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -257,7 +257,7 @@ READ8_MEMBER(homedata_state::mrokumei_keyboard_r)
{
if (m_keyb & (1 << i))
{
- res = input_port_read(machine(), keynames[i]) & 0x3f;
+ res = ioport(keynames[i])->read() & 0x3f;
break;
}
}
@@ -370,7 +370,7 @@ WRITE8_MEMBER(homedata_state::reikaids_upd7807_portc_w)
READ8_MEMBER(homedata_state::reikaids_io_r)
{
- int res = input_port_read(machine(), "IN2"); // bit 4 = coin, bit 5 = service
+ int res = ioport("IN2")->read(); // bit 4 = coin, bit 5 = service
res |= BIT(m_upd7807_portc, 2) * 0x01; // bit 0 = upd7807 status
res |= BIT(m_upd7807_portc, 6) * 0x02; // bit 1 = upd7807 data
@@ -438,7 +438,7 @@ READ8_MEMBER(homedata_state::pteacher_io_r)
READ8_MEMBER(homedata_state::pteacher_keyboard_r)
{
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
- int dips = input_port_read(machine(), "DSW");
+ int dips = ioport("DSW")->read();
// logerror("%04x: keyboard_r with port A = %02x\n",cpu_get_pc(&space.device()),upd7807_porta);
@@ -446,7 +446,7 @@ READ8_MEMBER(homedata_state::pteacher_keyboard_r)
{
/* player 1 + dip switches */
int row = (m_upd7807_porta & 0x07);
- return input_port_read(machine(), keynames[row]) | (((dips >> row) & 1) << 5); // 0-5
+ return ioport(keynames[row])->read() | (((dips >> row) & 1) << 5); // 0-5
}
if (m_upd7807_porta & 0x08)
{
@@ -1149,7 +1149,7 @@ static MACHINE_START( homedata )
static MACHINE_START( reikaids )
{
homedata_state *state = machine.driver_data<homedata_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0xc000], 0x4000);
state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
@@ -1166,7 +1166,7 @@ static MACHINE_START( reikaids )
static MACHINE_START( pteacher )
{
homedata_state *state = machine.driver_data<homedata_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000);
state->membank("bank2")->configure_entries(0, 4, state->memregion("audiocpu")->base(), 0x10000);
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 5d5b0e67924..3243372f2c0 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -471,7 +471,7 @@ READ8_MEMBER(hornet_state::sysreg_r)
case 0: /* I/O port 0 */
case 1: /* I/O port 1 */
case 2: /* I/O port 2 */
- r = input_port_read(machine(), portnames[offset]);
+ r = ioport(portnames[offset])->read();
break;
case 3: /* I/O port 3 */
@@ -489,7 +489,7 @@ READ8_MEMBER(hornet_state::sysreg_r)
break;
case 4: /* I/O port 4 - DIP switches */
- r = input_port_read(machine(), "DSW");
+ r = ioport("DSW")->read();
break;
}
return r;
@@ -524,7 +524,7 @@ WRITE8_MEMBER(hornet_state::sysreg_w)
0x02 = LAMP1
0x01 = LAMP0
*/
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
mame_printf_debug("System register 0 = %02X\n", data);
break;
@@ -1255,7 +1255,7 @@ static DRIVER_INIT(hornet_2board)
{
hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine.root_device().memregion("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", state->memregion("user5")->base());
set_cgboard_texture_bank(machine, 1, "bank6", state->memregion("user5")->base());
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c
index 6a8df189574..7f3bf4018e3 100644
--- a/src/mame/drivers/hvyunit.c
+++ b/src/mame/drivers/hvyunit.c
@@ -369,9 +369,9 @@ READ8_MEMBER(hvyunit_state::mermaid_p2_r)
switch ((m_mermaid_p[0] >> 2) & 3)
{
- case 0: return input_port_read(machine(), "IN1");
- case 1: return input_port_read(machine(), "IN2");
- case 2: return input_port_read(machine(), "IN0");
+ case 0: return ioport("IN1")->read();
+ case 1: return ioport("IN2")->read();
+ case 2: return ioport("IN0")->read();
default: return 0xff;
}
}
@@ -386,8 +386,8 @@ READ8_MEMBER(hvyunit_state::mermaid_p3_r)
{
UINT8 dsw = 0;
- UINT8 dsw1 = input_port_read(machine(), "DSW1");
- UINT8 dsw2 = input_port_read(machine(), "DSW2");
+ UINT8 dsw1 = ioport("DSW1")->read();
+ UINT8 dsw2 = ioport("DSW2")->read();
switch ((m_mermaid_p[0] >> 5) & 3)
{
@@ -529,23 +529,23 @@ static INPUT_PORTS_START( hvyunit )
PORT_DIPSETTING( 0x08, ( "Mode 1" ) )
PORT_DIPSETTING( 0x00, ( "Mode 2" ) )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
- PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
diff --git a/src/mame/drivers/icecold.c b/src/mame/drivers/icecold.c
index b3ddd391e38..8b1322de518 100644
--- a/src/mame/drivers/icecold.c
+++ b/src/mame/drivers/icecold.c
@@ -207,11 +207,11 @@ READ8_MEMBER( icecold_state::kbd_r )
{
case 0:
// override the ball gate switch
- return input_port_read(machine(), "X0") & ~(m_ball_gate_sw<<2);
+ return ioport("X0")->read() & ~(m_ball_gate_sw<<2);
case 1:
- return input_port_read(machine(), "X1");
+ return ioport("X1")->read();
case 2:
- return input_port_read(machine(), "X2");
+ return ioport("X2")->read();
default:
return 0xff;
}
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index 9e30a1ec8f4..ddc635520a3 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -434,11 +434,11 @@ READ8_MEMBER(igs009_state::jingbell_magic_r)
switch(m_igs_magic[0])
{
case 0x00:
- if ( !(m_igs_magic[1] & 0x01) ) return input_port_read(machine(), "DSW1");
- if ( !(m_igs_magic[1] & 0x02) ) return input_port_read(machine(), "DSW2");
- if ( !(m_igs_magic[1] & 0x04) ) return input_port_read(machine(), "DSW3");
- if ( !(m_igs_magic[1] & 0x08) ) return input_port_read(machine(), "DSW4");
- if ( !(m_igs_magic[1] & 0x10) ) return input_port_read(machine(), "DSW5");
+ if ( !(m_igs_magic[1] & 0x01) ) return ioport("DSW1")->read();
+ if ( !(m_igs_magic[1] & 0x02) ) return ioport("DSW2")->read();
+ if ( !(m_igs_magic[1] & 0x04) ) return ioport("DSW3")->read();
+ if ( !(m_igs_magic[1] & 0x08) ) return ioport("DSW4")->read();
+ if ( !(m_igs_magic[1] & 0x10) ) return ioport("DSW5")->read();
logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[1]);
break;
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index 3b50c1e7c18..1c59d2faba8 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -540,7 +540,7 @@ UINT16 igs011_state::igs_dips_r(int NUM)
for (i = 0; i < NUM; i++)
if ((~m_igs_dips_sel) & (1 << i) )
- ret = input_port_read(machine(), dipnames[i]);
+ ret = ioport(dipnames[i])->read();
/* 0x0100 is blitter busy */
return (ret & 0xff) | 0x0000;
}
@@ -1373,9 +1373,9 @@ READ16_MEMBER(igs011_state::drgnwrld_igs003_r)
{
switch(m_igs003_reg[0])
{
- 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 0x00: return ioport("IN0")->read();
+ case 0x01: return ioport("IN1")->read();
+ case 0x02: return ioport("IN2")->read();
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -1431,11 +1431,11 @@ READ16_MEMBER(igs011_state::lhb_inputs_r)
case 0: return m_igs_input_sel;
case 1:
- if (~m_igs_input_sel & 0x01) return input_port_read(machine(), "KEY0");
- if (~m_igs_input_sel & 0x02) return input_port_read(machine(), "KEY1");
- if (~m_igs_input_sel & 0x04) return input_port_read(machine(), "KEY2");
- if (~m_igs_input_sel & 0x08) return input_port_read(machine(), "KEY3");
- if (~m_igs_input_sel & 0x10) return input_port_read(machine(), "KEY4");
+ if (~m_igs_input_sel & 0x01) return ioport("KEY0")->read();
+ if (~m_igs_input_sel & 0x02) return ioport("KEY1")->read();
+ if (~m_igs_input_sel & 0x04) return ioport("KEY2")->read();
+ if (~m_igs_input_sel & 0x08) return ioport("KEY3")->read();
+ if (~m_igs_input_sel & 0x10) return ioport("KEY4")->read();
logerror("%06x: warning, reading with igs_input_sel = %02x\n", cpu_get_pc(&space.device()), m_igs_input_sel);
break;
@@ -1494,11 +1494,11 @@ READ16_MEMBER(igs011_state::lhb2_igs003_r)
switch(m_igs003_reg[0])
{
case 0x01:
- if (~m_igs_input_sel & 0x01) return input_port_read(machine(), "KEY0");
- if (~m_igs_input_sel & 0x02) return input_port_read(machine(), "KEY1");
- if (~m_igs_input_sel & 0x04) return input_port_read(machine(), "KEY2");
- if (~m_igs_input_sel & 0x08) return input_port_read(machine(), "KEY3");
- if (~m_igs_input_sel & 0x10) return input_port_read(machine(), "KEY4");
+ if (~m_igs_input_sel & 0x01) return ioport("KEY0")->read();
+ if (~m_igs_input_sel & 0x02) return ioport("KEY1")->read();
+ if (~m_igs_input_sel & 0x04) return ioport("KEY2")->read();
+ if (~m_igs_input_sel & 0x08) return ioport("KEY3")->read();
+ if (~m_igs_input_sel & 0x10) return ioport("KEY4")->read();
/* fall through */
default:
logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(&space.device()), m_igs003_reg[0]);
@@ -1573,7 +1573,7 @@ READ16_MEMBER(igs011_state::wlcc_igs003_r)
{
switch(m_igs003_reg[0])
{
- case 0x00: return input_port_read(machine(), "IN0");
+ case 0x00: return ioport("IN0")->read();
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -1639,14 +1639,14 @@ READ16_MEMBER(igs011_state::xymg_igs003_r)
{
switch(m_igs003_reg[0])
{
- case 0x00: return input_port_read(machine(), "COIN");
+ case 0x00: return ioport("COIN")->read();
case 0x02:
- if (~m_igs_input_sel & 0x01) return input_port_read(machine(), "KEY0");
- if (~m_igs_input_sel & 0x02) return input_port_read(machine(), "KEY1");
- if (~m_igs_input_sel & 0x04) return input_port_read(machine(), "KEY2");
- if (~m_igs_input_sel & 0x08) return input_port_read(machine(), "KEY3");
- if (~m_igs_input_sel & 0x10) return input_port_read(machine(), "KEY4");
+ if (~m_igs_input_sel & 0x01) return ioport("KEY0")->read();
+ if (~m_igs_input_sel & 0x02) return ioport("KEY1")->read();
+ if (~m_igs_input_sel & 0x04) return ioport("KEY2")->read();
+ if (~m_igs_input_sel & 0x08) return ioport("KEY3")->read();
+ if (~m_igs_input_sel & 0x10) return ioport("KEY4")->read();
/* fall through */
case 0x20: return 0x49;
@@ -1711,8 +1711,8 @@ READ16_MEMBER(igs011_state::vbowl_igs003_r)
{
switch(m_igs003_reg[0])
{
- case 0x00: return input_port_read(machine(), "IN0");
- case 0x01: return input_port_read(machine(), "IN1");
+ case 0x00: return ioport("IN0")->read();
+ case 0x01: return ioport("IN1")->read();
// case 0x03:
// return 0xff; // parametric bitswaps?
@@ -2408,7 +2408,7 @@ static SCREEN_VBLANK( vbowl )
{
igs011_state *state = screen.machine().driver_data<igs011_state>();
state->m_vbowl_trackball[0] = state->m_vbowl_trackball[1];
- state->m_vbowl_trackball[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0");
+ state->m_vbowl_trackball[1] = (state->ioport("AN1")->read() << 8) | state->ioport("AN0")->read();
}
}
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index 3043d767885..498d2e307f9 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -219,7 +219,7 @@ WRITE16_MEMBER(igs017_state::spriteram_lsb_w)
static void expand_sprites(running_machine &machine)
{
igs017_state *state = machine.driver_data<igs017_state>();
- UINT8 *rom = machine.root_device().memregion("sprites")->base();
+ UINT8 *rom = state->memregion("sprites")->base();
int size = state->memregion("sprites")->bytes();
int i;
@@ -1259,9 +1259,9 @@ READ8_MEMBER(igs017_state::input_r)
{
switch (m_input_select)
{
- case 0x00: return input_port_read(machine(), "PLAYER1");
- case 0x01: return input_port_read(machine(), "PLAYER2");
- case 0x02: return input_port_read(machine(), "COINS");
+ case 0x00: return ioport("PLAYER1")->read();
+ case 0x01: return ioport("PLAYER2")->read();
+ case 0x02: return ioport("COINS")->read();
case 0x03: return 01;
@@ -1377,11 +1377,11 @@ READ16_MEMBER(igs017_state::mgcs_magic_r)
static READ8_DEVICE_HANDLER( mgcs_keys_r )
{
igs017_state *state = device->machine().driver_data<igs017_state>();
- if (~state->m_input_select & 0x08) return input_port_read(device->machine(), "KEY0");
- if (~state->m_input_select & 0x10) return input_port_read(device->machine(), "KEY1");
- if (~state->m_input_select & 0x20) return input_port_read(device->machine(), "KEY2");
- if (~state->m_input_select & 0x40) return input_port_read(device->machine(), "KEY3");
- if (~state->m_input_select & 0x80) return input_port_read(device->machine(), "KEY4");
+ if (~state->m_input_select & 0x08) return state->ioport("KEY0")->read();
+ if (~state->m_input_select & 0x10) return state->ioport("KEY1")->read();
+ if (~state->m_input_select & 0x20) return state->ioport("KEY2")->read();
+ if (~state->m_input_select & 0x40) return state->ioport("KEY3")->read();
+ if (~state->m_input_select & 0x80) return state->ioport("KEY4")->read();
logerror("%s: warning, reading key with input_select = %02x\n", device->machine().describe_context(), state->m_input_select);
return 0xff;
@@ -1449,13 +1449,13 @@ WRITE16_MEMBER(igs017_state::sdmg2_paletteram_w)
READ8_MEMBER(igs017_state::sdmg2_keys_r)
{
- if (~m_input_select & 0x01) return input_port_read(machine(), "KEY0");
- if (~m_input_select & 0x02) return input_port_read(machine(), "KEY1");
- if (~m_input_select & 0x04) return input_port_read(machine(), "KEY2");
- if (~m_input_select & 0x08) return input_port_read(machine(), "KEY3");
- if (~m_input_select & 0x10) return input_port_read(machine(), "KEY4");
+ if (~m_input_select & 0x01) return ioport("KEY0")->read();
+ if (~m_input_select & 0x02) return ioport("KEY1")->read();
+ if (~m_input_select & 0x04) return ioport("KEY2")->read();
+ if (~m_input_select & 0x08) return ioport("KEY3")->read();
+ if (~m_input_select & 0x10) return ioport("KEY4")->read();
- if (m_input_select == 0x1f) return input_port_read(machine(), "KEY0"); // in joystick mode
+ if (m_input_select == 0x1f) return ioport("KEY0")->read(); // in joystick mode
logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
return 0xff;
@@ -1502,7 +1502,7 @@ READ16_MEMBER(igs017_state::sdmg2_magic_r)
case 0x00:
{
UINT16 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
- return input_port_read(machine(), "COINS") | hopper_bit;
+ return ioport("COINS")->read() | hopper_bit;
}
case 0x02:
@@ -1538,13 +1538,13 @@ ADDRESS_MAP_END
READ8_MEMBER(igs017_state::mgdh_keys_r)
{
- if (~m_input_select & 0x04) return input_port_read(machine(), "KEY0");
- if (~m_input_select & 0x08) return input_port_read(machine(), "KEY1");
- if (~m_input_select & 0x10) return input_port_read(machine(), "KEY2");
- if (~m_input_select & 0x20) return input_port_read(machine(), "KEY3");
- if (~m_input_select & 0x40) return input_port_read(machine(), "KEY4");
+ if (~m_input_select & 0x04) return ioport("KEY0")->read();
+ if (~m_input_select & 0x08) return ioport("KEY1")->read();
+ if (~m_input_select & 0x10) return ioport("KEY2")->read();
+ if (~m_input_select & 0x20) return ioport("KEY3")->read();
+ if (~m_input_select & 0x40) return ioport("KEY4")->read();
- if ((m_input_select & 0xfc) == 0xfc) return input_port_read(machine(), "DSW1");
+ if ((m_input_select & 0xfc) == 0xfc) return ioport("DSW1")->read();
logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
return 0xff;
@@ -1616,15 +1616,15 @@ READ16_MEMBER(igs017_state::mgdha_magic_r)
return mgdh_keys_r(space, 0);
case 0x01:
- return input_port_read(machine(), "BUTTONS");
+ return ioport("BUTTONS")->read();
case 0x02:
- return BITSWAP8(input_port_read(machine(), "DSW2"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(ioport("DSW2")->read(), 0,1,2,3,4,5,6,7);
case 0x03:
{
UINT16 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
- return input_port_read(machine(), "COINS") | hopper_bit;
+ return ioport("COINS")->read() | hopper_bit;
}
default:
@@ -1702,13 +1702,13 @@ READ8_MEMBER(igs017_state::tjsb_input_r)
{
switch (m_input_select)
{
- case 0x00: return input_port_read(machine(), "PLAYER1");
- case 0x01: return input_port_read(machine(), "PLAYER2");
- case 0x02: return input_port_read(machine(), "COINS");
+ case 0x00: return ioport("PLAYER1")->read();
+ case 0x01: return ioport("PLAYER2")->read();
+ case 0x02: return ioport("COINS")->read();
case 0x03:
{
UINT8 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x00 : 0x20;
- return input_port_read(machine(), "HOPPER") | hopper_bit;
+ return ioport("HOPPER")->read() | hopper_bit;
}
default:
@@ -1794,11 +1794,11 @@ READ16_MEMBER(igs017_state::lhzb2_magic_r)
{
case 0x01:
{
- if (~m_input_select & 0x01) return input_port_read(machine(), "KEY0");
- if (~m_input_select & 0x02) return input_port_read(machine(), "KEY1");
- if (~m_input_select & 0x04) return input_port_read(machine(), "KEY2");
- if (~m_input_select & 0x08) return input_port_read(machine(), "KEY3");
- if (~m_input_select & 0x10) return input_port_read(machine(), "KEY4");
+ if (~m_input_select & 0x01) return ioport("KEY0")->read();
+ if (~m_input_select & 0x02) return ioport("KEY1")->read();
+ if (~m_input_select & 0x04) return ioport("KEY2")->read();
+ if (~m_input_select & 0x08) return ioport("KEY3")->read();
+ if (~m_input_select & 0x10) return ioport("KEY4")->read();
logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
return 0xffff;
@@ -1885,11 +1885,11 @@ READ16_MEMBER(igs017_state::lhzb2a_input_r)
{
case 0x00: // Keys
{
- if (~m_input_select & 0x01) return input_port_read(machine(), "KEY0") << 8;
- if (~m_input_select & 0x02) return input_port_read(machine(), "KEY1") << 8;
- if (~m_input_select & 0x04) return input_port_read(machine(), "KEY2") << 8;
- if (~m_input_select & 0x08) return input_port_read(machine(), "KEY3") << 8;
- if (~m_input_select & 0x10) return input_port_read(machine(), "KEY4") << 8;
+ if (~m_input_select & 0x01) return ioport("KEY0")->read() << 8;
+ if (~m_input_select & 0x02) return ioport("KEY1")->read() << 8;
+ if (~m_input_select & 0x04) return ioport("KEY2")->read() << 8;
+ if (~m_input_select & 0x08) return ioport("KEY3")->read() << 8;
+ if (~m_input_select & 0x10) return ioport("KEY4")->read() << 8;
logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select);
return 0xffff;
@@ -1898,11 +1898,11 @@ READ16_MEMBER(igs017_state::lhzb2a_input_r)
case 0x02:
{
UINT16 hopper_bit = (m_hopper && ((machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0002;
- return (input_port_read(machine(), "DSW1") << 8) | input_port_read(machine(), "COINS") | hopper_bit;
+ return (ioport("DSW1")->read() << 8) | ioport("COINS")->read() | hopper_bit;
}
case 0x04:
- return input_port_read(machine(), "DSW2");
+ return ioport("DSW2")->read();
}
return 0xffff;
@@ -2011,11 +2011,11 @@ READ16_MEMBER(igs017_state::slqz2_magic_r)
switch(m_igs_magic[0])
{
case 0x00:
- return input_port_read(machine(), "PLAYER2");
+ return ioport("PLAYER2")->read();
case 0x01:
- return input_port_read(machine(), "PLAYER1");
+ return ioport("PLAYER1")->read();
case 0x02:
- return input_port_read(machine(), "BUTTONS");
+ return ioport("BUTTONS")->read();
default:
logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic[0]);
@@ -2559,31 +2559,31 @@ static INPUT_PORTS_START( sdmg2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O)
// Keyboard mode:
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // shown in test mode
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // shown in test mode
// Joystick mode:
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY0")
// Keyboard mode:
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
// Joystick mode:
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
PORT_START("KEY1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
@@ -2690,23 +2690,23 @@ static INPUT_PORTS_START( mgdh )
PORT_START("KEY0")
// Keyboard mode:
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x02)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02)
// Joystick mode:
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
PORT_START("KEY1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index 6f51f76859f..e072f22610d 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -298,7 +298,7 @@ WRITE8_MEMBER(igspoker_state::custom_io_w)
switch (data)
{
- case 0x00: m_protection_res = input_port_read(machine(), "BUTTONS1"); break;
+ case 0x00: m_protection_res = ioport("BUTTONS1")->read(); break;
// CSK227
case 0x20: m_protection_res = 0x49; break;
case 0x21: m_protection_res = 0x47; break;
diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c
index f9639d9a3be..0ce9f43786b 100644
--- a/src/mame/drivers/imolagp.c
+++ b/src/mame/drivers/imolagp.c
@@ -472,7 +472,7 @@ static TIMER_DEVICE_CALLBACK ( imolagp_nmi_cb )
imolagp_state *state = timer.machine().driver_data<imolagp_state>();
{
- int newsteer = input_port_read(timer.machine(), "2802") & 0xf;
+ int newsteer = timer.machine().root_device().ioport("2802")->read() & 0xf;
if (newsteer != state->m_oldsteer)
{
if (state->m_steerlatch == 0)
diff --git a/src/mame/drivers/irobot.c b/src/mame/drivers/irobot.c
index c62b4de469a..b504b1ec14b 100644
--- a/src/mame/drivers/irobot.c
+++ b/src/mame/drivers/irobot.c
@@ -185,7 +185,7 @@ static INPUT_PORTS_START( irobot )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* MB DONE */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* EXT DONE */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2") /* DSW2 - 5E*/
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) ) PORT_DIPLOCATION("SW5E:1")
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index de20516833e..88fd4203b27 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -474,8 +474,8 @@ CUSTOM_INPUT_MEMBER(itech32_state::special_port_r)
READ16_MEMBER(itech32_state::trackball_r)
{
- int lower = input_port_read(machine(), "TRACKX1");
- int upper = input_port_read(machine(), "TRACKY1");
+ int lower = ioport("TRACKX1")->read();
+ int upper = ioport("TRACKY1")->read();
return (lower & 15) | ((upper & 15) << 4);
}
@@ -483,8 +483,8 @@ READ16_MEMBER(itech32_state::trackball_r)
READ32_MEMBER(itech32_state::trackball32_8bit_r)
{
- int lower = input_port_read(machine(), "TRACKX1");
- int upper = input_port_read(machine(), "TRACKY1");
+ int lower = ioport("TRACKX1")->read();
+ int upper = ioport("TRACKY1")->read();
return (lower & 255) | ((upper & 255) << 8);
}
@@ -499,8 +499,8 @@ READ32_MEMBER(itech32_state::trackball32_4bit_p1_r)
int upper, lower;
int dx, dy;
- int curx = input_port_read(machine(), "TRACKX1");
- int cury = input_port_read(machine(), "TRACKY1");
+ int curx = ioport("TRACKX1")->read();
+ int cury = ioport("TRACKY1")->read();
dx = curx - m_p1_effx;
if (dx < -0x80) dx += 0x100;
@@ -535,8 +535,8 @@ READ32_MEMBER(itech32_state::trackball32_4bit_p2_r)
int upper, lower;
int dx, dy;
- int curx = input_port_read(machine(), "TRACKX2");
- int cury = input_port_read(machine(), "TRACKY2");
+ int curx = ioport("TRACKX2")->read();
+ int cury = ioport("TRACKY2")->read();
dx = curx - m_p2_effx;
if (dx < -0x80) dx += 0x100;
@@ -571,7 +571,7 @@ READ32_MEMBER(itech32_state::trackball32_4bit_combined_r)
READ32_MEMBER(itech32_state::drivedge_steering_r)
{
- int val = input_port_read(machine(), "STEER") * 2 - 0x100;
+ int val = ioport("STEER")->read() * 2 - 0x100;
if (val < 0) val = 0x100 | (-val);
return val << 16;
}
@@ -579,7 +579,7 @@ READ32_MEMBER(itech32_state::drivedge_steering_r)
READ32_MEMBER(itech32_state::drivedge_gas_r)
{
- int val = input_port_read(machine(), "GAS");
+ int val = ioport("GAS")->read();
return val << 16;
}
@@ -1115,7 +1115,7 @@ static INPUT_PORTS_START( timekill )
PORT_START("DIPS") /* 58000 */
PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, NULL)
PORT_DIPNAME( 0x0010, 0x0000, "Video Sync" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0000, "-" )
@@ -1160,7 +1160,7 @@ static INPUT_PORTS_START( itech32_base_16bit )
PORT_START("DIPS") /* 280000 */
PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, NULL)
PORT_DIPNAME( 0x0010, 0x0000, "Video Sync" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x0000, "-" )
@@ -1278,7 +1278,7 @@ static INPUT_PORTS_START( drivedge )
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_SPECIAL )
PORT_DIPNAME( 0x70000000, 0x00000000, "Network Number" ) PORT_DIPLOCATION("SW1:4,3,2")
PORT_DIPSETTING( 0x00000000, "1" )
@@ -1363,7 +1363,7 @@ static INPUT_PORTS_START( itech32_base_32bit )
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x00010000, IP_ACTIVE_LOW )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, itech32_state,special_port_r, NULL)
PORT_DIPNAME( 0x00100000, 0x00000000, "Video Sync" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00000000, "-" )
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 73ff7a54ead..186246a4c5b 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -1104,7 +1104,7 @@ CUSTOM_INPUT_MEMBER(itech8_state::gtg_mux)
{
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(machine(), tag1) & input_port_read(machine(), tag2);
+ return ioport(tag2)->read();
}
static INPUT_PORTS_START( gtg )
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index acff3f65694..8f6b62d7586 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -82,7 +82,7 @@ CUSTOM_INPUT_MEMBER(jack_state::sound_check_r)
{
UINT8 ret = 0;
- if ((input_port_read(machine(), "IN2") & 0x80) && !m_joinem_snd_bit)
+ if ((ioport("IN2")->read() & 0x80) && !m_joinem_snd_bit)
ret = 1;
return ret;
@@ -682,14 +682,14 @@ static INPUT_PORTS_START( striv )
PORT_DIPSETTING( 0x02, "Horizontal" )
PORT_DIPSETTING( 0x00, "Vertical" )
PORT_DIPNAME( 0x05, 0x05, "Gaming Option Number" ) PORT_DIPLOCATION("SW1:!1,!3")
- PORT_DIPSETTING( 0x01, "2" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x05, "3" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x00, "4" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x04, "5" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x01, "4" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x05, "5" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x00, "6" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x04, "7" ) PORT_CONDITION("DSW1", 0x20, PORTCOND_NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x01, "2" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x05, "3" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "4" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x04, "5" ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x01, "4" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x05, "5" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "6" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x04, "7" ) PORT_CONDITION("DSW1", 0x20, NOTEQUALS, 0x20)
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!4")
PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
@@ -857,7 +857,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( joinem_vblank_irq )
{
/* TODO: looks hackish to me ... */
- if (!(input_port_read(device->machine(), "IN2") & 0x80))
+ if (!(device->machine().root_device().ioport("IN2")->read() & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 67c9fa64dd1..3b009155348 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -85,7 +85,7 @@ Address Dir Data Description
READ8_MEMBER(jackal_state::topgunbl_rotary_r)
{
- return (1 << input_port_read_safe(machine(), offset ? "DIAL1" : "DIAL0", 0x00)) ^ 0xff;
+ return (1 << ioport(offset ? "DIAL1" : "DIAL0")->read_safe(0x00)) ^ 0xff;
}
WRITE8_MEMBER(jackal_state::jackal_flipscreen_w)
diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c
index a40d539c841..4c1a753c3b4 100644
--- a/src/mame/drivers/jackpool.c
+++ b/src/mame/drivers/jackpool.c
@@ -97,20 +97,20 @@ READ16_MEMBER(jackpool_state::jackpool_io_r)
{
switch(offset*2)
{
- case 0x00: return input_port_read(machine(),"COIN1");
- case 0x04: return input_port_read(machine(),"UNK1");
- case 0x06: return input_port_read(machine(),"UNK2");
- case 0x08: return input_port_read(machine(),"SERVICE1");
- case 0x0a: return input_port_read(machine(),"SERVICE2");//probably not a button, remote?
- case 0x0c: return input_port_read(machine(),"PAYOUT");
- case 0x0e: return input_port_read(machine(),"START2");
- case 0x10: return input_port_read(machine(),"HOLD3");
- case 0x12: return input_port_read(machine(),"HOLD4");
- case 0x14: return input_port_read(machine(),"HOLD2");
- case 0x16: return input_port_read(machine(),"HOLD1");
- case 0x18: return input_port_read(machine(),"HOLD5");
- case 0x1a: return input_port_read(machine(),"START1");
- case 0x1c: return input_port_read(machine(),"BET");
+ case 0x00: return ioport("COIN1")->read();
+ case 0x04: return ioport("UNK1")->read();
+ case 0x06: return ioport("UNK2")->read();
+ case 0x08: return ioport("SERVICE1")->read();
+ case 0x0a: return ioport("SERVICE2")->read();//probably not a button, remote?
+ case 0x0c: return ioport("PAYOUT")->read();
+ case 0x0e: return ioport("START2")->read();
+ case 0x10: return ioport("HOLD3")->read();
+ case 0x12: return ioport("HOLD4")->read();
+ case 0x14: return ioport("HOLD2")->read();
+ case 0x16: return ioport("HOLD1")->read();
+ case 0x18: return ioport("HOLD5")->read();
+ case 0x1a: return ioport("START1")->read();
+ case 0x1c: return ioport("BET")->read();
case 0x1e: return 0xff; //ticket motor
case 0x20: return 0xff; //hopper motor
case 0x2c: return machine().device<eeprom_device>("eeprom")->read_bit();
diff --git a/src/mame/drivers/jaguar.c b/src/mame/drivers/jaguar.c
index 87c91597a1e..03b30401007 100644
--- a/src/mame/drivers/jaguar.c
+++ b/src/mame/drivers/jaguar.c
@@ -555,7 +555,7 @@ static MACHINE_RESET( jaguar )
joystick_data = 0xffffffff;
eeprom_bit_count = 0;
blitter_status = 1;
- if ((using_cart) && (input_port_read(machine, "CONFIG") & 2))
+ if ((using_cart) && (machine.root_device().ioport("CONFIG")->read() & 2))
{
cart_base[0x102] = 1;
using_cart = 0;
@@ -825,13 +825,13 @@ READ32_MEMBER(cojag_state::joystick_r)
{
if ((joystick_data & (0x10000 << i)) == 0)
{
- joystick_result &= input_port_read(machine(), keynames[0][i]);
- joybuts_result &= input_port_read(machine(), keynames[1][i]);
+ joystick_result &= ioport(keynames[0][i])->read();
+ joybuts_result &= ioport(keynames[1][i])->read();
}
}
joystick_result |= machine().device<eeprom_device>("eeprom")->read_bit();
- joybuts_result |= (input_port_read(machine(), "CONFIG") & 0x10);
+ joybuts_result |= (ioport("CONFIG")->read() & 0x10);
return (joystick_result << 16) | joybuts_result;
}
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 7dc61aad3f8..e227aaaf015 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -698,7 +698,7 @@ xxxx ---- MCU program revision
#define MCU_READ(tag, _bit_, _offset_, _retval_) \
-if((0xffff - input_port_read(machine, tag)) & _bit_) { jm_shared_ram[_offset_] = _retval_; }
+if((0xffff - machine.root_device().ioport(tag)->read()) & _bit_) { jm_shared_ram[_offset_] = _retval_; }
/*Funky "DMA" / protection thing*/
/*---- -x-- "DMA" execute.*/
@@ -749,12 +749,12 @@ static void daireika_mcu_run(running_machine &machine)
if(state->m_test_mode) //service_mode
{
- jm_shared_ram[0x000/2] = input_port_read(machine, "KEY0");
- jm_shared_ram[0x002/2] = input_port_read(machine, "KEY1");
- jm_shared_ram[0x004/2] = input_port_read(machine, "KEY2");
- jm_shared_ram[0x006/2] = input_port_read(machine, "KEY3");
- jm_shared_ram[0x008/2] = input_port_read(machine, "KEY4");
- jm_shared_ram[0x00a/2] = input_port_read(machine, "KEY5");
+ jm_shared_ram[0x000/2] = machine.root_device().ioport("KEY0")->read();
+ jm_shared_ram[0x002/2] = machine.root_device().ioport("KEY1")->read();
+ jm_shared_ram[0x004/2] = machine.root_device().ioport("KEY2")->read();
+ jm_shared_ram[0x006/2] = machine.root_device().ioport("KEY3")->read();
+ jm_shared_ram[0x008/2] = machine.root_device().ioport("KEY4")->read();
+ jm_shared_ram[0x00a/2] = machine.root_device().ioport("KEY5")->read();
}
else
{
@@ -793,12 +793,12 @@ static void mjzoomin_mcu_run(running_machine &machine)
if(state->m_test_mode) //service_mode
{
- jm_shared_ram[0x000/2] = input_port_read(machine, "KEY0");
- jm_shared_ram[0x002/2] = input_port_read(machine, "KEY1");
- jm_shared_ram[0x004/2] = input_port_read(machine, "KEY2");
- jm_shared_ram[0x006/2] = input_port_read(machine, "KEY3");
- jm_shared_ram[0x008/2] = input_port_read(machine, "KEY4");
- jm_shared_ram[0x00a/2] = input_port_read(machine, "KEY5");
+ jm_shared_ram[0x000/2] = state->ioport("KEY0")->read();
+ jm_shared_ram[0x002/2] = state->ioport("KEY1")->read();
+ jm_shared_ram[0x004/2] = state->ioport("KEY2")->read();
+ jm_shared_ram[0x006/2] = state->ioport("KEY3")->read();
+ jm_shared_ram[0x008/2] = state->ioport("KEY4")->read();
+ jm_shared_ram[0x00a/2] = state->ioport("KEY5")->read();
}
else
{
@@ -838,12 +838,12 @@ static void urashima_mcu_run(running_machine &machine)
if(state->m_test_mode) //service_mode
{
- jm_shared_ram[0x300/2] = input_port_read(machine, "KEY0");
- jm_shared_ram[0x302/2] = input_port_read(machine, "KEY1");
- jm_shared_ram[0x304/2] = input_port_read(machine, "KEY2");
- jm_shared_ram[0x306/2] = input_port_read(machine, "KEY3");
- jm_shared_ram[0x308/2] = input_port_read(machine, "KEY4");
- jm_shared_ram[0x30a/2] = input_port_read(machine, "KEY5");
+ jm_shared_ram[0x300/2] = state->ioport("KEY0")->read();
+ jm_shared_ram[0x302/2] = state->ioport("KEY1")->read();
+ jm_shared_ram[0x304/2] = state->ioport("KEY2")->read();
+ jm_shared_ram[0x306/2] = state->ioport("KEY3")->read();
+ jm_shared_ram[0x308/2] = state->ioport("KEY4")->read();
+ jm_shared_ram[0x30a/2] = state->ioport("KEY5")->read();
}
else
{
@@ -882,9 +882,9 @@ static void second_mcu_run(running_machine &machine)
UINT16 *jm_shared_ram = state->m_jm_shared_ram;
if(state->m_test_mode) //service_mode
{
- jm_shared_ram[0x200/2] = input_port_read(machine, "KEY0");
- jm_shared_ram[0x202/2] = input_port_read(machine, "KEY1");
- jm_shared_ram[0x204/2] = input_port_read(machine, "KEY2");
+ jm_shared_ram[0x200/2] = state->ioport("KEY0")->read();
+ jm_shared_ram[0x202/2] = state->ioport("KEY1")->read();
+ jm_shared_ram[0x204/2] = state->ioport("KEY2")->read();
}
else
{
@@ -1378,15 +1378,15 @@ static MACHINE_RESET ( jalmah )
{
case MJZOOMIN_MCU:
case DAIREIKA_MCU:
- state->m_test_mode = (~(input_port_read(machine, "SYSTEM")) & 0x0008) ? (1) : (0);
+ state->m_test_mode = (~(state->ioport("SYSTEM")->read()) & 0x0008) ? (1) : (0);
break;
case URASHIMA_MCU:
- state->m_test_mode = ((~(input_port_read(machine, "SYSTEM")) & 0x0008) || (~(input_port_read(machine, "DSW")) & 0x8000)) ? (1) : (0);
+ state->m_test_mode = ((~(state->ioport("SYSTEM")->read()) & 0x0008) || (~(state->ioport("DSW")->read()) & 0x8000)) ? (1) : (0);
break;
case KAKUMEI_MCU:
case KAKUMEI2_MCU:
case SUCHIPI_MCU:
- state->m_test_mode = (~(input_port_read(machine, "DSW")) & 0x0004) ? (1) : (0);
+ state->m_test_mode = (~(state->ioport("DSW")->read()) & 0x0004) ? (1) : (0);
break;
}
}
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index 1f8cc272dcd..2caf86151cd 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -277,20 +277,20 @@ static READ8_DEVICE_HANDLER( input_mux_r )
jangou_state *state = device->machine().driver_data<jangou_state>();
switch(state->m_mux_data)
{
- case 0x01: return input_port_read(device->machine(), "PL1_1");
- case 0x02: return input_port_read(device->machine(), "PL1_2");
- case 0x04: return input_port_read(device->machine(), "PL2_1");
- case 0x08: return input_port_read(device->machine(), "PL2_2");
- case 0x10: return input_port_read(device->machine(), "PL1_3");
- case 0x20: return input_port_read(device->machine(), "PL2_3");
+ case 0x01: return state->ioport("PL1_1")->read();
+ case 0x02: return state->ioport("PL1_2")->read();
+ case 0x04: return state->ioport("PL2_1")->read();
+ case 0x08: return state->ioport("PL2_2")->read();
+ case 0x10: return state->ioport("PL1_3")->read();
+ case 0x20: return state->ioport("PL2_3")->read();
}
- return input_port_read(device->machine(), "IN_NOMUX");
+ return device->machine().root_device().ioport("IN_NOMUX")->read();
}
static READ8_DEVICE_HANDLER( input_system_r )
{
- return input_port_read(device->machine(), "SYSTEM");
+ return device->machine().root_device().ioport("SYSTEM")->read();
}
@@ -595,7 +595,7 @@ static INPUT_PORTS_START( jangou )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK ) // guess
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // guess
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // blitter busy flag
INPUT_PORTS_END
@@ -656,7 +656,7 @@ static INPUT_PORTS_START( macha )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK ) // guess
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // guess
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // blitter busy flag
INPUT_PORTS_END
@@ -782,7 +782,7 @@ static INPUT_PORTS_START( jngolady )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //blitter busy flag
INPUT_PORTS_END
diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c
index 733bfc2d2f8..e8e6d317f14 100644
--- a/src/mame/drivers/jantotsu.c
+++ b/src/mame/drivers/jantotsu.c
@@ -238,12 +238,12 @@ READ8_MEMBER(jantotsu_state::jantotsu_mux_r)
UINT8 i,res;
// printf("%02x\n", m_mux_data);
- res = input_port_read(machine(), "COINS");
+ res = ioport("COINS")->read();
for(i=0;i<8;i++)
{
if((~m_mux_data) & (1 << i))
- res |= input_port_read(machine(), portnames[i]);
+ res |= ioport(portnames[i])->read();
}
return res;
@@ -260,7 +260,7 @@ WRITE8_MEMBER(jantotsu_state::jantotsu_mux_w)
a side-by-side test (to know if the background colors really works) to be sure. */
READ8_MEMBER(jantotsu_state::jantotsu_dsw2_r)
{
- return (input_port_read(machine(), "DSW2") & 0x3f) | 0x80;
+ return (ioport("DSW2")->read() & 0x3f) | 0x80;
}
static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
@@ -490,7 +490,7 @@ static MACHINE_RESET( jantotsu )
jantotsu_state *state = machine.driver_data<jantotsu_state>();
/*Load hard-wired background color.*/
- state->m_col_bank = (input_port_read(machine, "DSW2") & 0xc0) >> 3;
+ state->m_col_bank = (state->ioport("DSW2")->read() & 0xc0) >> 3;
state->m_vram_bank = 0;
state->m_mux_data = 0;
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index cbf6caa1ad5..d485432c242 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -260,7 +260,7 @@ static void jchan_mcu_run(running_machine &machine)
case 0x03: // DSW
{
- state->m_mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
+ state->m_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW")->read();
logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine.describe_context(),mcu_command,mcu_offset*2);
}
break;
@@ -447,10 +447,10 @@ READ16_MEMBER(jchan_state::jchan_ctrl_r)
switch(offset)
{
- case 0/2: return input_port_read(machine(), "P1");
- case 2/2: return input_port_read(machine(), "P2");
- case 4/2: return input_port_read(machine(), "SYSTEM");
- case 6/2: return input_port_read(machine(), "EXTRA");
+ case 0/2: return ioport("P1")->read();
+ case 2/2: return ioport("P2")->read();
+ case 4/2: return ioport("SYSTEM")->read();
+ case 6/2: return ioport("EXTRA")->read();
default: logerror("jchan_ctrl_r unknown!"); break;
}
return m_ctrl[offset];
@@ -590,8 +590,8 @@ static INPUT_PORTS_START( jchan )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P2") /* $f00002.w (-> $2000b5.b) */
@@ -601,8 +601,8 @@ static INPUT_PORTS_START( jchan )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SYSTEM") /* $f00004.b */
@@ -616,14 +616,14 @@ static INPUT_PORTS_START( jchan )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("EXTRA") /* $f00006.b */
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x0000)
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW",0x8000,EQUALS,0x0000)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* duplicated Player 1 Button 4 (whatever the layout is) */
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* duplicated Player 2 Button 4 (whatever the layout is) */
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index 33f76fc495e..741c0e26513 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -214,8 +214,8 @@ READ8_MEMBER(jedi_state::a2d_data_r)
switch (m_a2d_select)
{
- case 0: ret = input_port_read(machine(), "STICKY"); break;
- case 2: ret = input_port_read(machine(), "STICKX"); break;
+ case 0: ret = ioport("STICKY")->read(); break;
+ case 2: ret = ioport("STICKX")->read(); break;
}
return ret;
@@ -321,7 +321,7 @@ static INPUT_PORTS_START( jedi )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
PORT_BIT( 0x18, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,jedi_state,jedi_audio_comm_stat_r, NULL)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("STICKY") /* analog Y */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index e96d0cb2755..3c0ba64aea6 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -144,41 +144,41 @@ WRITE8_MEMBER(jongkyo_state::jongkyo_coin_counter_w)
static READ8_DEVICE_HANDLER( input_1p_r )
{
jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
- UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
+ UINT8 cr_clear = state->ioport("CR_CLEAR")->read();
switch (state->m_mux_data)
{
- case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
- case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
- case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
- case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
- case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
- case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
+ case 0x01: return state->ioport("PL1_1")->read() | cr_clear;
+ case 0x02: return state->ioport("PL1_2")->read() | cr_clear;
+ case 0x04: return state->ioport("PL1_3")->read() | cr_clear;
+ case 0x08: return state->ioport("PL1_4")->read() | cr_clear;
+ case 0x10: return state->ioport("PL1_5")->read() | cr_clear;
+ case 0x20: return state->ioport("PL1_6")->read() | cr_clear;
}
// printf("%04x\n", state->m_mux_data);
- return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
- input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
+ return (state->ioport("PL1_1")->read() & state->ioport("PL1_2")->read() & state->ioport("PL1_3")->read() &
+ state->ioport("PL1_4")->read() & state->ioport("PL1_5")->read() & state->ioport("PL1_6")->read()) | cr_clear;
}
static READ8_DEVICE_HANDLER( input_2p_r )
{
jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
- UINT8 coin_port = input_port_read(device->machine(), "COINS");
+ UINT8 coin_port = state->ioport("COINS")->read();
switch (state->m_mux_data)
{
- case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
- case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
- case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
- case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
- case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
- case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
+ case 0x01: return state->ioport("PL2_1")->read() | coin_port;
+ case 0x02: return state->ioport("PL2_2")->read() | coin_port;
+ case 0x04: return state->ioport("PL2_3")->read() | coin_port;
+ case 0x08: return state->ioport("PL2_4")->read() | coin_port;
+ case 0x10: return state->ioport("PL2_5")->read() | coin_port;
+ case 0x20: return state->ioport("PL2_6")->read() | coin_port;
}
// printf("%04x\n", state->m_mux_data);
- return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
- input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
+ return (state->ioport("PL2_1")->read() & state->ioport("PL2_2")->read() & state->ioport("PL2_3")->read() &
+ state->ioport("PL2_4")->read() & state->ioport("PL2_5")->read() & state->ioport("PL2_6")->read()) | coin_port;
}
WRITE8_MEMBER(jongkyo_state::videoram2_w)
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 5de9eccc62e..e1b76c9862f 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -250,7 +250,7 @@ READ16_MEMBER(jpmimpct_state::duart_1_r)
}
case 0xd:
{
- val = input_port_read(machine(), "TEST/DEMO");
+ val = ioport("TEST/DEMO")->read();
break;
}
case 0xe:
@@ -366,11 +366,11 @@ READ16_MEMBER(jpmimpct_state::duart_2_r)
{
if (m_touch_cnt == 0)
{
- if ( input_port_read(machine(), "TOUCH") & 0x1 )
+ if ( ioport("TOUCH")->read() & 0x1 )
{
m_touch_data[0] = 0x2a;
- m_touch_data[1] = 0x7 - (input_port_read(machine(), "TOUCH_Y") >> 5) + 0x30;
- m_touch_data[2] = (input_port_read(machine(), "TOUCH_X") >> 5) + 0x30;
+ m_touch_data[1] = 0x7 - (ioport("TOUCH_Y")->read() >> 5) + 0x30;
+ m_touch_data[2] = (ioport("TOUCH_X")->read() >> 5) + 0x30;
/* Return RXRDY */
return 0x1;
@@ -434,22 +434,22 @@ READ16_MEMBER(jpmimpct_state::inputs1_r)
{
case 0:
{
- val = input_port_read(machine(), "DSW");
+ val = ioport("DSW")->read();
break;
}
case 2:
{
- val = input_port_read(machine(), "SW2");
+ val = ioport("SW2")->read();
break;
}
case 4:
{
- val = input_port_read(machine(), "SW1");
+ val = ioport("SW1")->read();
break;
}
case 9:
{
- val = input_port_read(machine(), "COINS");
+ val = ioport("COINS")->read();
break;
}
}
@@ -1038,47 +1038,47 @@ READ16_MEMBER(jpmimpct_state::inputs1awp_r)
{
case 0:
{
- val = input_port_read(machine(), "DSW");
+ val = ioport("DSW")->read();
break;
}
case 1:
{
- val = input_port_read(machine(), "PERCENT");
+ val = ioport("PERCENT")->read();
break;
}
case 2:
{
- val = input_port_read(machine(), "KEYS");
+ val = ioport("KEYS")->read();
break;
}
case 3:
{
- val = input_port_read(machine(), "SW2");
+ val = ioport("SW2")->read();
break;
}
case 4:
{
- val = input_port_read(machine(), "SW1");
+ val = ioport("SW1")->read();
break;
}
case 5:
{
- val = (input_port_read(machine(), "SW3") );
+ val = (ioport("SW3")->read() );
break;
}
case 6:
{
- val = (input_port_read(machine(), "SW4") );
+ val = (ioport("SW4")->read() );
break;
}
case 7://5
{
- val = (input_port_read(machine(), "SW5") );
+ val = (ioport("SW5")->read() );
break;
}
case 9:
{
- val = input_port_read(machine(), "COINS");
+ val = ioport("COINS")->read();
break;
}
}
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 3a10138f822..fc0fe0e0710 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -257,7 +257,7 @@ WRITE16_MEMBER(jpmsys5_state::rombank_w)
READ16_MEMBER(jpmsys5_state::coins_r)
{
if (offset == 2)
- return input_port_read(machine(), "COINS") << 8;
+ return ioport("COINS")->read() << 8;
else
return 0xffff;
}
@@ -280,7 +280,7 @@ WRITE16_MEMBER(jpmsys5_state::mux_w)
READ16_MEMBER(jpmsys5_state::mux_r)
{
if (offset == 0x81/2)
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
return 0xffff;
}
@@ -410,8 +410,8 @@ INPUT_CHANGED_MEMBER(jpmsys5_state::touchscreen_press)
/* Each touch screen packet is 3 bytes */
m_touch_data[0] = 0x2a;
- m_touch_data[1] = 0x7 - (input_port_read(machine(), "TOUCH_Y") >> 5) + 0x30;
- m_touch_data[2] = (input_port_read(machine(), "TOUCH_X") >> 5) + 0x30;
+ m_touch_data[1] = 0x7 - (ioport("TOUCH_Y")->read() >> 5) + 0x30;
+ m_touch_data[2] = (ioport("TOUCH_X")->read() >> 5) + 0x30;
/* Start sending the data to the 68000 serially */
m_touch_data_count = 0;
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index 487fdd756a5..a47ea242902 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -343,7 +343,7 @@ WRITE16_MEMBER(kaneko16_state::kaneko16_eeprom_w)
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
if (ACCESSING_BITS_8_15)
@@ -612,12 +612,12 @@ ADDRESS_MAP_END
READ16_MEMBER(kaneko16_state::gtmr_wheel_r)
{
// check 'Controls' dip switch
- switch (input_port_read(machine(), "DSW1") & 0x1000)
+ switch (ioport("DSW1")->read() & 0x1000)
{
case 0x0000: // 'Both Sides' = 270deg Wheel
- return (input_port_read(machine(), "WHEEL0"));
+ return (ioport("WHEEL0")->read());
case 0x1000: // '1P Side' = 360' Wheel
- return (input_port_read(machine(), "WHEEL1"));
+ return (ioport("WHEEL1")->read());
default:
return (0);
}
@@ -700,14 +700,14 @@ ADDRESS_MAP_END
READ16_MEMBER(kaneko16_state::gtmr2_wheel_r)
{
- switch (input_port_read(machine(), "DSW1") & 0x1800)
+ switch (ioport("DSW1")->read() & 0x1800)
{
case 0x0000: // 270' A. Wheel
- return (input_port_read(machine(), "WHEEL0"));
+ return (ioport("WHEEL0")->read());
case 0x1000: // 270' D. Wheel
- return (input_port_read(machine(), "WHEEL1") << 8);
+ return (ioport("WHEEL1")->read() << 8);
case 0x0800: // 360' Wheel
- return (input_port_read(machine(), "WHEEL2") << 8);
+ return (ioport("WHEEL2")->read() << 8);
default:
logerror("gtmr2_wheel_r : read at %06x with joystick\n", cpu_get_pc(&space.device()));
return (~0);
@@ -716,7 +716,7 @@ READ16_MEMBER(kaneko16_state::gtmr2_wheel_r)
READ16_MEMBER(kaneko16_state::gtmr2_IN1_r)
{
- return (input_port_read(machine(), "P2") & (input_port_read(machine(), "FAKE") | ~0x7100));
+ return (ioport("P2")->read() & (ioport("FAKE")->read() | ~0x7100));
}
static ADDRESS_MAP_START( gtmr2_map, AS_PROGRAM, 16, kaneko16_state )
@@ -1362,10 +1362,10 @@ static INPUT_PORTS_START( gtmr )
PORT_DIPSETTING( 0x0800, DEF_STR( Joystick ) )
PORT_DIPSETTING( 0x0000, "Wheel" )
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:5")
- PORT_DIPSETTING( 0x1000, "1P Side" ) PORT_CONDITION("DSW1",0x0800,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0000, "Both Sides" ) PORT_CONDITION("DSW1",0x0800,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x1000, "360 degree wheel" ) PORT_CONDITION("DSW1",0x0800,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0000, "270 degree wheel" ) PORT_CONDITION("DSW1",0x0800,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x1000, "1P Side" ) PORT_CONDITION("DSW1",0x0800,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0000, "Both Sides" ) PORT_CONDITION("DSW1",0x0800,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x1000, "360 degree wheel" ) PORT_CONDITION("DSW1",0x0800,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0000, "270 degree wheel" ) PORT_CONDITION("DSW1",0x0800,EQUALS,0x00)
PORT_DIPNAME( 0x2000, 0x2000, "Use Brake" ) PORT_DIPLOCATION("SW1:6") /* Valid only when joystick is used */
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x2000, DEF_STR( On ) )
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 602d3317c67..3e986637bb2 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -407,11 +407,11 @@ READ16_MEMBER(karnov_state::karnov_control_r)
switch (offset << 1)
{
case 0:
- return input_port_read(machine(), "P1_P2");
+ return ioport("P1_P2")->read();
case 2: /* Start buttons & VBL */
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 4:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 6: /* i8751 return values */
return m_i8751_return;
}
@@ -481,7 +481,7 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -728,7 +728,7 @@ GFXDECODE_END
static INTERRUPT_GEN( karnov_interrupt )
{
karnov_state *state = device->machine().driver_data<karnov_state>();
- UINT8 port = input_port_read(device->machine(), "FAKE");
+ UINT8 port = state->ioport("FAKE")->read();
/* Coin input to the i8751 generates an interrupt to the main cpu */
if (port == state->m_coin_mask)
diff --git a/src/mame/drivers/kas89.c b/src/mame/drivers/kas89.c
index 56343a269f0..3c649942b01 100644
--- a/src/mame/drivers/kas89.c
+++ b/src/mame/drivers/kas89.c
@@ -290,19 +290,19 @@ READ8_MEMBER(kas89_state::mux_r)
{
switch(m_mux_data)
{
- case 0x01: return input_port_read(machine(), "PL1");
- case 0x02: return input_port_read(machine(), "PL2");
- case 0x04: return input_port_read(machine(), "PL3");
- case 0x08: return input_port_read(machine(), "PL4");
- case 0x10: return input_port_read(machine(), "PL5");
- case 0x20: return input_port_read(machine(), "PL6");
+ case 0x01: return ioport("PL1")->read();
+ case 0x02: return ioport("PL2")->read();
+ case 0x04: return ioport("PL3")->read();
+ case 0x08: return ioport("PL4")->read();
+ case 0x10: return ioport("PL5")->read();
+ case 0x20: return ioport("PL6")->read();
case 0x40:
{
- output_set_lamp_value(37, 1 - ((input_port_read(machine(), "SVC") >> 5) & 1)); /* Operator Key LAMP */
- return input_port_read(machine(), "SVC");
+ output_set_lamp_value(37, 1 - ((ioport("SVC")->read() >> 5) & 1)); /* Operator Key LAMP */
+ return ioport("SVC")->read();
}
- case 0x80: return input_port_read(machine(), "DSW"); /* Polled at $162a through NMI routine */
- case 0x3f: return input_port_read(machine(), "UNK");
+ case 0x80: return ioport("DSW")->read(); /* Polled at $162a through NMI routine */
+ case 0x3f: return ioport("UNK")->read();
}
logerror("Mux_data %02X\n", m_mux_data);
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index bb1a27465ce..aef06cf7dde 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -267,7 +267,7 @@ WRITE8_MEMBER(kingdrby_state::sc0_attr_w)
static READ8_DEVICE_HANDLER( hopper_io_r )
{
kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
- return (input_port_read(device->machine(),"HPIO") & 0x3f) | state->m_p1_hopper | state->m_p2_hopper;
+ return (state->ioport("HPIO")->read() & 0x3f) | state->m_p1_hopper | state->m_p2_hopper;
}
static WRITE8_DEVICE_HANDLER( hopper_io_w )
@@ -300,9 +300,9 @@ static READ8_DEVICE_HANDLER( input_mux_r )
{
kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
if(state->m_mux_data & 0x80)
- return input_port_read(device->machine(),"MUX0");
+ return state->ioport("MUX0")->read();
else
- return input_port_read(device->machine(),"MUX1");
+ return state->ioport("MUX1")->read();
}
static READ8_DEVICE_HANDLER( key_matrix_r )
@@ -310,8 +310,8 @@ static READ8_DEVICE_HANDLER( key_matrix_r )
UINT16 p1_val,p2_val;
UINT8 p1_res,p2_res;
- p1_val = input_port_read(device->machine(),"KEY_1P");
- p2_val = input_port_read(device->machine(),"KEY_2P");
+ p1_val = device->machine().root_device().ioport("KEY_1P")->read();
+ p2_val = device->machine().root_device().ioport("KEY_2P")->read();
p1_res = 0;
p2_res = 0;
@@ -556,7 +556,7 @@ static INPUT_PORTS_START( kingdrby )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) //2p hopper i/o
PORT_START("IN1") // ppi0 (5001)
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK ) //?
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //?
PORT_DIPNAME( 0x02, 0x02, "IN1" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -739,7 +739,7 @@ static INPUT_PORTS_START( kingdrbb )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN1") // ppi0 (5001)
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK ) //?
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //?
PORT_DIPNAME( 0x02, 0x02, "IN1" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c
index 3eb46b22e01..beba0045829 100644
--- a/src/mame/drivers/kingobox.c
+++ b/src/mame/drivers/kingobox.c
@@ -301,7 +301,7 @@ static INPUT_PORTS_START( ringking )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Sound busy??? */
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index 5be4212e064..a0ca431a24b 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -338,7 +338,7 @@ READ32_MEMBER(kinst_state::kinst_control_r)
switch (offset)
{
case 2: /* $90 -- sound return */
- result = input_port_read(machine(), portnames[offset]);
+ result = ioport(portnames[offset])->read();
result &= ~0x0002;
if (dcs_control_r(machine()) & 0x800)
result |= 0x0002;
@@ -347,11 +347,11 @@ READ32_MEMBER(kinst_state::kinst_control_r)
case 0: /* $80 */
case 1: /* $88 */
case 3: /* $98 */
- result = input_port_read(machine(), portnames[offset]);
+ result = ioport(portnames[offset])->read();
break;
case 4: /* $a0 */
- result = input_port_read(machine(), portnames[offset]);
+ result = ioport(portnames[offset])->read();
if (cpu_get_pc(&space.device()) == 0x802d428)
device_spin_until_interrupt(&space.device());
break;
diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c
index 9381cb561d9..0287f12bfd7 100644
--- a/src/mame/drivers/klax.c
+++ b/src/mame/drivers/klax.c
@@ -41,7 +41,7 @@ static void update_interrupts(running_machine &machine)
static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
- if ((scanline & 32) == 0 && !(input_port_read(screen.machine(), "P1") & 0x800))
+ if ((scanline & 32) == 0 && !(screen.machine().root_device().ioport("P1")->read() & 0x800))
atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
@@ -115,7 +115,7 @@ static INPUT_PORTS_START( klax )
PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0600, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c
index 4a934376a91..0fb103853a5 100644
--- a/src/mame/drivers/koikoi.c
+++ b/src/mame/drivers/koikoi.c
@@ -165,7 +165,7 @@ static READ8_DEVICE_HANDLER( input_r )
if (!state->m_inputcnt)
{
- int key = input_port_read(device->machine(), "IN1");
+ int key = state->ioport("IN1")->read();
int keyval = 0; //we must return 0 (0x2 in 2nd read) to clear 4 bit at $6600 and allow next read
if (key)
@@ -202,7 +202,7 @@ static WRITE8_DEVICE_HANDLER( unknown_w )
READ8_MEMBER(koikoi_state::io_r)
{
if (!offset)
- return input_port_read(machine(), "IN0") ^ m_ioram[4]; //coin
+ return ioport("IN0")->read() ^ m_ioram[4]; //coin
return 0;
}
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index e79677c37f7..d29f5f92995 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -144,7 +144,7 @@ static const UINT16 konamigq_def_eeprom[64] =
WRITE32_MEMBER(konamigq_state::eeprom_w)
{
- input_port_write(machine(), "EEPROMOUT", data & 0x07, 0xff);
+ ioport("EEPROMOUT")->write(data & 0x07, 0xff);
cputag_set_input_line(machine(), "soundcpu", INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
}
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index 3cc9edec010..f8b44dc669f 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -503,7 +503,7 @@ READ32_MEMBER(konamigv_state::trackball_r)
for( axis = 0; axis < 2; axis++ )
{
- value = input_port_read(machine(), axisnames[axis]);
+ value = ioport(axisnames[axis])->read();
diff = value - m_trackball_prev[ axis ];
m_trackball_prev[ axis ] = value;
m_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
@@ -595,7 +595,7 @@ READ32_MEMBER(konamigv_state::btc_trackball_r)
for( axis = 0; axis < 4; axis++ )
{
- value = input_port_read(machine(), axisnames[axis]);
+ value = ioport(axisnames[axis])->read();
diff = value - m_btc_trackball_prev[ axis ];
m_btc_trackball_prev[ axis ] = value;
m_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 44a9c93131a..53500ecebbe 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -463,7 +463,7 @@ WRITE32_MEMBER(konamigx_state::eeprom_w)
bit 0: eeprom data
*/
- input_port_write(machine(), "EEPROMOUT", odata, 0xff);
+ ioport("EEPROMOUT")->write(odata, 0xff);
konamigx_wrport1_0 = odata;
}
@@ -874,9 +874,9 @@ static double adc0834_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)(5 * input_port_read(device->machine(), "AN0")) / 255.0; // steer
+ return (double)(5 * device->machine().root_device().ioport("AN0")->read()) / 255.0; // steer
case ADC083X_CH1:
- return (double)(5 * input_port_read(device->machine(), "AN1")) / 255.0; // gas
+ return (double)(5 * device->machine().root_device().ioport("AN1")->read()) / 255.0; // gas
case ADC083X_VREF:
return 5;
}
@@ -890,16 +890,16 @@ static const adc083x_interface konamigx_adc_interface = {
READ32_MEMBER(konamigx_state::le2_gun_H_r)
{
- int p1x = input_port_read(machine(), "LIGHT0_X")*290/0xff+20;
- int p2x = input_port_read(machine(), "LIGHT1_X")*290/0xff+20;
+ int p1x = ioport("LIGHT0_X")->read()*290/0xff+20;
+ int p2x = ioport("LIGHT1_X")->read()*290/0xff+20;
return (p1x<<16)|p2x;
}
READ32_MEMBER(konamigx_state::le2_gun_V_r)
{
- int p1y = input_port_read(machine(), "LIGHT0_Y")*224/0xff;
- int p2y = input_port_read(machine(), "LIGHT1_Y")*224/0xff;
+ int p1y = ioport("LIGHT0_Y")->read()*224/0xff;
+ int p2y = ioport("LIGHT1_Y")->read()*224/0xff;
// make "off the bottom" reload too
if (p1y >= 0xdf) p1y = 0;
diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c
index 6cb1efa5389..4f884cf64d5 100644
--- a/src/mame/drivers/kongambl.c
+++ b/src/mame/drivers/kongambl.c
@@ -59,7 +59,7 @@ READ32_MEMBER(kongambl_state::eeprom_r)
{
if (ACCESSING_BITS_0_7)
{
- UINT32 rv = input_port_read(machine(), "SYSTEM") & ~0x1;
+ UINT32 rv = ioport("SYSTEM")->read() & ~0x1;
return rv; // bit 0 freezes the game if 1
}
@@ -71,7 +71,7 @@ WRITE32_MEMBER(kongambl_state::eeprom_w)
{
if (ACCESSING_BITS_8_15)
{
- input_port_write(machine(), "EEPROMOUT", (data>>8)&0xf, 0xff);
+ ioport("EEPROMOUT")->write((data>>8)&0xf, 0xff);
}
}
diff --git a/src/mame/drivers/kopunch.c b/src/mame/drivers/kopunch.c
index 95fe0e90f2b..a4e13e9656e 100644
--- a/src/mame/drivers/kopunch.c
+++ b/src/mame/drivers/kopunch.c
@@ -20,7 +20,7 @@ READ8_MEMBER(kopunch_state::kopunch_in_r)
if (offset == 0)
return machine().rand();
else
- return (machine().rand() & 0x07) | input_port_read(machine(), "SYSTEM");
+ return (machine().rand() & 0x07) | ioport("SYSTEM")->read();
}
WRITE8_MEMBER(kopunch_state::kopunch_lamp_w)
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index b428a4dc939..e395e45b89a 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -597,7 +597,7 @@ READ32_MEMBER(ksys573_state::mb89371_r)
READ32_MEMBER(ksys573_state::jamma_r)
{
int security_cart_number = m_security_cart_number;
- UINT32 data = input_port_read(machine(), "IN1");
+ UINT32 data = ioport("IN1")->read();
data |= 0x000000c0;
ds2401_device *ds2401 = machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
@@ -1233,7 +1233,7 @@ WRITE32_MEMBER(ksys573_state::security_w)
}
}
- input_port_write_safe( machine(), "OUT1", data, mem_mask );
+ machine().root_device().ioport("OUT1")->write_safe( data, mem_mask );
}
READ32_MEMBER(ksys573_state::security_r)
@@ -1366,8 +1366,8 @@ static void *atapi_get_device(running_machine &machine)
static void update_mode( running_machine &machine )
{
ksys573_state *state = machine.driver_data<ksys573_state>();
- int cart = input_port_read(machine, "CART");
- int cd = input_port_read( machine, "CD" );
+ int cart = state->ioport("CART")->read();
+ int cd = state->ioport( "CD" )->read();
SCSIInstance *new_cdrom;
if( state->machine().device<device_secure_serial_flash>("game_eeprom") )
@@ -1489,8 +1489,8 @@ READ32_MEMBER(ksys573_state::ge765pwbba_r)
switch (offset)
{
case 0x26:
- upd4701_y_add(upd4701, 0, input_port_read_safe(machine(), "uPD4701_y", 0), 0xffff);
- upd4701_switches_set(upd4701, 0, input_port_read_safe(machine(), "uPD4701_switches", 0));
+ upd4701_y_add(upd4701, 0, ioport("uPD4701_y")->read_safe(0), 0xffff);
+ upd4701_switches_set(upd4701, 0, ioport("uPD4701_switches")->read_safe(0));
upd4701_cs_w(upd4701, 0, 0);
upd4701_xy_w(upd4701, 0, 1);
@@ -1758,7 +1758,7 @@ static void gn845pwbb_clk_w( running_machine &machine, int offset, int data )
CUSTOM_INPUT_MEMBER(ksys573_state::gn845pwbb_read)
{
- return input_port_read(machine(), "STAGE") & m_stage_mask;
+ return ioport("STAGE")->read() & m_stage_mask;
}
static void gn845pwbb_output_callback( running_machine &machine, int offset, int data )
@@ -2717,7 +2717,7 @@ static double punchmania_inputs_callback( device_t *device, UINT8 input )
{
ksys573_state *state = device->machine().driver_data<ksys573_state>();
double *pad_position = state->m_pad_position;
- int pads = input_port_read(device->machine(), "PADS");
+ int pads = state->ioport("PADS")->read();
for( int i = 0; i < 6; i++ )
{
if( ( pads & ( 1 << i ) ) != 0 )
@@ -3004,15 +3004,15 @@ READ32_MEMBER(ksys573_state::gunmania_r)
switch( offset )
{
case 0x20:
- data = input_port_read( machine(), "GUNX" ) | ds2401->read() << 7;
+ data = ioport( "GUNX" )->read() | ds2401->read() << 7;
break;
case 0x22:
- data = input_port_read( machine(), "GUNY" ) | input_port_read( machine(), "SENSOR" );
+ data = ioport( "SENSOR" )->read();
break;
case 0x34:
- data = input_port_read( machine(), "ENCODER" );
+ data = ioport( "ENCODER" )->read();
popmessage( "encoder %04x", data );
break;
}
@@ -3035,13 +3035,13 @@ static double analogue_inputs_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)( 5 * input_port_read_safe( device->machine(), "analog0", 0 ) ) / 255.0;
+ return (double)( 5 * device->machine().root_device().ioport( "analog0" )->read_safe( 0 ) ) / 255.0;
case ADC083X_CH1:
- return (double)( 5 * input_port_read_safe( device->machine(), "analog1", 0 ) ) / 255.0;
+ return (double)( 5 * device->machine().root_device().ioport( "analog1" )->read_safe( 0 ) ) / 255.0;
case ADC083X_CH2:
- return (double)( 5 * input_port_read_safe( device->machine(), "analog2", 0 ) ) / 255.0;
+ return (double)( 5 * device->machine().root_device().ioport( "analog2" )->read_safe( 0 ) ) / 255.0;
case ADC083X_CH3:
- return (double)( 5 * input_port_read_safe( device->machine(), "analog3", 0 ) ) / 255.0;
+ return (double)( 5 * device->machine().root_device().ioport( "analog3" )->read_safe( 0 ) ) / 255.0;
case ADC083X_AGND:
return 0;
case ADC083X_VREF:
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index adbf04633da..9a2c189af15 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -203,7 +203,7 @@ INPUT_CHANGED_MEMBER(ladybug_state::coin2_inserted)
CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r)
{
- return input_port_read(machine(), LADYBUG_P1_CONTROL_PORT_TAG);
+ return ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read();
}
CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r)
@@ -211,10 +211,10 @@ CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r)
UINT32 ret;
/* upright cabinet only uses a single set of controls */
- if (input_port_read(machine(), "DSW0") & 0x20)
- ret = input_port_read(machine(), LADYBUG_P2_CONTROL_PORT_TAG);
+ if (ioport("DSW0")->read() & 0x20)
+ ret = ioport(LADYBUG_P2_CONTROL_PORT_TAG)->read();
else
- ret = input_port_read(machine(), LADYBUG_P1_CONTROL_PORT_TAG);
+ ret = ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read();
return ret;
}
@@ -234,7 +234,7 @@ static INPUT_PORTS_START( ladybug )
/* Note that there are TWO VBlank inputs, one is active low, the other active */
/* high. There are probably other differencies in the hardware, but emulating */
/* them this way is enough to get the game running. */
- PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
+ PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -331,7 +331,7 @@ static INPUT_PORTS_START( snapjack )
/* Note that there are TWO VBlank inputs, one is active low, the other active */
/* high. There are probably other differencies in the hardware, but emulating */
/* them this way is enough to get the game running. */
- PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
+ PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -416,7 +416,7 @@ static INPUT_PORTS_START( cavenger )
/* Note that there are TWO VBlank inputs, one is active low, the other active */
/* high. There are probably other differencies in the hardware, but emulating */
/* them this way is enough to get the game running. */
- PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
+ PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
@@ -499,7 +499,7 @@ static INPUT_PORTS_START( dorodon )
/* Note that there are TWO VBlank inputs, one is active low, the other active */
/* high. There are probably other differencies in the hardware, but emulating */
/* them this way is enough to get the game running. */
- PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
+ PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c
index 2ec1cd546f2..992edf5ba16 100644
--- a/src/mame/drivers/laserbat.c
+++ b/src/mame/drivers/laserbat.c
@@ -77,7 +77,7 @@ READ8_MEMBER(laserbat_state::laserbat_input_r)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- return input_port_read(machine(), portnames[m_input_mux]);
+ return ioport(portnames[m_input_mux])->read();
}
WRITE8_MEMBER(laserbat_state::laserbat_cnteff_w)
@@ -283,7 +283,7 @@ static INPUT_PORTS_START( laserbat )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( lazarian )
@@ -361,7 +361,7 @@ static INPUT_PORTS_START( lazarian )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( catnmous )
@@ -444,7 +444,7 @@ static INPUT_PORTS_START( catnmous )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static const gfx_layout charlayout =
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index ef99e215c11..a047996dbee 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -382,12 +382,12 @@ READ16_MEMBER(lastfght_state::lastfght_c00002_r)
{
// high byte:
// mask 0x1c: from sound?
- return (machine().rand() & 0x1c00) | input_port_read(machine(), "IN0");
+ return (machine().rand() & 0x1c00) | ioport("IN0")->read();
}
READ16_MEMBER(lastfght_state::lastfght_c00004_r)
{
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
READ16_MEMBER(lastfght_state::lastfght_c00006_r)
@@ -395,7 +395,7 @@ READ16_MEMBER(lastfght_state::lastfght_c00006_r)
// low byte:
// bit 7 = protection?
// bit 5 = blitter?
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
}
WRITE16_MEMBER(lastfght_state::lastfght_c00006_w)
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index 17d46d8f15c..c377e5c4313 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -290,7 +290,7 @@ WRITE8_MEMBER(lazercmd_state::lazercmd_data_port_w)
/* triggered by REDD,r opcode */
READ8_MEMBER(lazercmd_state::lazercmd_data_port_r)
{
- UINT8 data = input_port_read(machine(), "DSW") & 0x0f;
+ UINT8 data = ioport("DSW")->read() & 0x0f;
return data;
}
@@ -370,16 +370,16 @@ READ8_MEMBER(lazercmd_state::lazercmd_hardware_r)
switch (offset)
{
case 0: /* player 1 joysticks */
- data = input_port_read(machine(), "IN0");
+ data = ioport("IN0")->read();
break;
case 1: /* player 2 joysticks */
- data = input_port_read(machine(), "IN1");
+ data = ioport("IN1")->read();
break;
case 2: /* player 1 + 2 buttons */
- data = input_port_read(machine(), "IN3");
+ data = ioport("IN3")->read();
break;
case 3: /* coin slot + start buttons */
- data = input_port_read(machine(), "IN2");
+ data = ioport("IN2")->read();
break;
case 4: /* vertical scan counter */
data = ((m_timer_count & 0x10) >> 1) | ((m_timer_count & 0x20) >> 3)
diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c
index e8d0f668c68..f5b40685ff0 100644
--- a/src/mame/drivers/leland.c
+++ b/src/mame/drivers/leland.c
@@ -146,7 +146,7 @@ static INPUT_PORTS_START( cerberus ) /* complete, verified from code */
PORT_START("IN3") /* 0x91 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -192,7 +192,7 @@ static INPUT_PORTS_START( mayhem ) /* complete, verified from code */
PORT_START("IN3") /* 0xD1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -225,7 +225,7 @@ static INPUT_PORTS_START( wseries ) /* complete, verified from code */
PORT_START("IN3") /* 0x91 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -264,7 +264,7 @@ static INPUT_PORTS_START( alleymas ) /* complete, verified from code */
PORT_START("IN3") /* 0xD1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -300,7 +300,7 @@ static INPUT_PORTS_START( upyoural ) /* complete, verified from code */
PORT_START("IN3") /* 0xD1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -335,7 +335,7 @@ static INPUT_PORTS_START( dangerz ) /* complete, verified from code */
PORT_START("IN3") /* 0x91 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -370,7 +370,7 @@ static INPUT_PORTS_START( basebal2 ) /* complete, verified from code */
PORT_START("IN3") /* 0x51/D1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -407,7 +407,7 @@ static INPUT_PORTS_START( redline ) /* complete, verified in code */
PORT_START("IN3") /* 0xD1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -445,7 +445,7 @@ static INPUT_PORTS_START( quarterb ) /* complete, verified in code */
PORT_START("IN3") /* 0x91 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -487,7 +487,7 @@ static INPUT_PORTS_START( teamqb ) /* complete, verified in code */
PORT_START("IN3") /* 0x91 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -545,7 +545,7 @@ static INPUT_PORTS_START( aafb2p ) /* complete, verified in code */
PORT_START("IN3") /* 0x91 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -600,7 +600,7 @@ static INPUT_PORTS_START( offroad ) /* complete, verified from code */
PORT_START("IN3") /* 0xD1 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -660,7 +660,7 @@ static INPUT_PORTS_START( pigout ) /* complete, verified from code */
PORT_START("IN3") /* 0x51 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c
index 17f828bc376..60b7f283719 100644
--- a/src/mame/drivers/lemmings.c
+++ b/src/mame/drivers/lemmings.c
@@ -36,10 +36,10 @@ READ16_MEMBER(lemmings_state::lemmings_trackball_r)
{
switch (offset)
{
- case 0: return input_port_read(machine(), "AN0");
- case 1: return input_port_read(machine(), "AN1");
- case 4: return input_port_read(machine(), "AN2");
- case 5: return input_port_read(machine(), "AN3");
+ case 0: return ioport("AN0")->read();
+ case 1: return ioport("AN1")->read();
+ case 4: return ioport("AN2")->read();
+ case 5: return ioport("AN3")->read();
}
return 0;
}
@@ -50,13 +50,13 @@ READ16_MEMBER(lemmings_state::lemmings_prot_r)
switch (offset << 1)
{
case 0x41a:
- return input_port_read(machine(), "BUTTONS");
+ return ioport("BUTTONS")->read();
case 0x320:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 0x4e6:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
}
return 0;
@@ -143,7 +143,7 @@ static INPUT_PORTS_START( lemmings )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_SERVICE_NO_TOGGLE(0x0004, IP_ACTIVE_LOW)
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index 06f327b9aa3..90646458371 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -174,8 +174,8 @@ maybe some sprite placement issues
static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
/* a = 1, 2 = player # */
-#define GUNX( a ) (( ( input_port_read(machine(), gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
-#define GUNY( a ) (( ( input_port_read(machine(), gunnames[2 * (a - 1) + 1]) * 223 ) / 0xff ) + 10)
+#define GUNX( a ) (( ( ioport(gunnames[2 * (a - 1)])->read() * 287 ) / 0xff ) + 16)
+#define GUNY( a ) (( ( ioport(gunnames[2 * (a - 1) + 1])->read() * 223 ) / 0xff ) + 10)
static const eeprom_interface eeprom_intf =
{
@@ -200,7 +200,7 @@ WRITE8_MEMBER(lethal_state::control2_w)
m_cur_control2 = data;
- input_port_write(machine(), "EEPROMOUT", m_cur_control2, 0xff);
+ ioport("EEPROMOUT")->write(m_cur_control2, 0xff);
}
static INTERRUPT_GEN(lethalen_interrupt)
diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c
index ea02f964a8f..d06e520d07f 100644
--- a/src/mame/drivers/lethalj.c
+++ b/src/mame/drivers/lethalj.c
@@ -161,7 +161,7 @@ Pin #11(+) | | R |
CUSTOM_INPUT_MEMBER(lethalj_state::cclownz_paddle)
{
- int value = input_port_read(machine(), "PADDLE");
+ int value = ioport("PADDLE")->read();
return ((value << 4) & 0xf00) | (value & 0x00f);
}
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 453c7b21afe..4598e5cda4c 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -54,11 +54,11 @@ READ8_MEMBER(liberate_state::deco16_bank_r)
READ8_MEMBER(liberate_state::deco16_io_r)
{
- 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 */
+ if (offset == 0) return ioport("IN1")->read(); /* Player 1 controls */
+ if (offset == 1) return ioport("IN2")->read(); /* Player 2 controls */
+ if (offset == 2) return ioport("IN3")->read(); /* Vblank, coins */
+ if (offset == 3) return ioport("DSW1")->read(); /* Dip 1 */
+ if (offset == 4) return ioport("DSW2")->read(); /* Dip 2 */
logerror("%04x: Read input %d\n", cpu_get_pc(&space.device()), offset);
return 0xff;
@@ -338,7 +338,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( generic_input )
PORT_START("IN0")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
@@ -358,7 +358,7 @@ static INPUT_PORTS_START( generic_input )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -489,7 +489,7 @@ static INPUT_PORTS_START( yellowcb )
PORT_INCLUDE( kamikcab )
PORT_MODIFY("IN0")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfb, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -575,7 +575,7 @@ static INPUT_PORTS_START( liberatb )
PORT_MODIFY("IN0")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xf9, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW1")
@@ -763,7 +763,7 @@ GFXDECODE_END
static INTERRUPT_GEN( deco16_interrupt )
{
liberate_state *state = device->machine().driver_data<liberate_state>();
- int p = ~input_port_read(device->machine(), "IN3");
+ int p = ~state->ioport("IN3")->read();
if ((p & 0x43) && !state->m_latch)
{
device_set_input_line(device, DECO16_IRQ_LINE, ASSERT_LINE);
diff --git a/src/mame/drivers/liberatr.c b/src/mame/drivers/liberatr.c
index e1c7c6a4ed0..410a2d19d6c 100644
--- a/src/mame/drivers/liberatr.c
+++ b/src/mame/drivers/liberatr.c
@@ -182,8 +182,8 @@ WRITE8_MEMBER( liberatr_state::trackball_reset_w )
/* input becomes the starting point for the trackball counters */
if (((data ^ m_ctrld) & 0x10) && (data & 0x10))
{
- UINT8 trackball = input_port_read(machine(), "FAKE");
- UINT8 switches = input_port_read(machine(), "IN0");
+ UINT8 trackball = ioport("FAKE")->read();
+ UINT8 switches = ioport("IN0")->read();
m_trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f);
}
m_ctrld = data & 0x10;
@@ -195,13 +195,13 @@ READ8_MEMBER( liberatr_state::port0_r )
/* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */
if (m_ctrld)
{
- UINT8 trackball = input_port_read(machine(), "FAKE");
+ UINT8 trackball = ioport("FAKE")->read();
return ((trackball & 0xf0) - (m_trackball_offset & 0xf0)) | ((trackball - m_trackball_offset) & 0x0f);
}
/* otherwise, the LS191 is simply passing through the raw switch inputs */
else
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
@@ -300,7 +300,7 @@ static INPUT_PORTS_START( liberatr )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1") /* IN2 - Game Option switches DSW @ D4 on PCB */
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index d9a2b3b018d..1b1b7c20839 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -371,7 +371,7 @@ static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectan
limenko_state *state = machine.driver_data<limenko_state>();
int i;
- UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT8 *base_gfx = state->memregion("gfx1")->base();
UINT8 *gfx_max = base_gfx + state->memregion("gfx1")->bytes();
UINT8 *gfxdata;
@@ -1066,7 +1066,7 @@ static DRIVER_INIT( sb2003 )
static DRIVER_INIT( spotty )
{
limenko_state *state = machine.driver_data<limenko_state>();
- UINT8 *dst = machine.root_device().memregion("gfx1")->base();
+ UINT8 *dst = state->memregion("gfx1")->base();
UINT8 *src = state->memregion("user2")->base();
int x;
diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c
index b8e79803787..fc42aa6c938 100644
--- a/src/mame/drivers/lockon.c
+++ b/src/mame/drivers/lockon.c
@@ -332,10 +332,10 @@ READ8_MEMBER(lockon_state::adc_r)
{
switch (offset)
{
- 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");
+ case 0: return ioport("ADC_BANK")->read();
+ case 1: return ioport("ADC_PITCH")->read();
+ case 2: return ioport("ADC_MISSILE")->read();
+ case 3: return ioport("ADC_HOVER")->read();
default: return 0;
}
}
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index 4fa2113f8c3..53a00fcb14a 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -900,7 +900,7 @@ ROM_END
static DRIVER_INIT( looping )
{
looping_state *state = machine.driver_data<looping_state>();
- int length = machine.root_device().memregion("maincpu")->bytes();
+ int length = state->memregion("maincpu")->bytes();
UINT8 *rom = state->memregion("maincpu")->base();
int i;
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index cab22273790..8395e4d97d5 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -208,9 +208,9 @@ static READ8_DEVICE_HANDLER( aliencha_dip_r )
lordgun_state *state = device->machine().driver_data<lordgun_state>();
switch (state->m_aliencha_dip_sel & 0x70)
{
- case 0x30: return input_port_read(device->machine(), "DIP1");
- case 0x60: return input_port_read(device->machine(), "DIP2");
- case 0x50: return input_port_read(device->machine(), "DIP3");
+ case 0x30: return state->ioport("DIP1")->read();
+ case 0x60: return state->ioport("DIP2")->read();
+ case 0x50: return state->ioport("DIP3")->read();
default:
logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine().describe_context(),state->m_aliencha_dip_sel);
diff --git a/src/mame/drivers/lvcards.c b/src/mame/drivers/lvcards.c
index 44005c91278..1f040463ea6 100644
--- a/src/mame/drivers/lvcards.c
+++ b/src/mame/drivers/lvcards.c
@@ -130,7 +130,7 @@ WRITE8_MEMBER(lvcards_state::control_port_2a_w)
READ8_MEMBER(lvcards_state::payout_r)
{
- m_result = input_port_read(machine(), "IN2");
+ m_result = ioport("IN2")->read();
if (m_payout)
{
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index e0e7e6de8fe..605c6c737a8 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -251,10 +251,10 @@ WRITE8_MEMBER(m10_state::m10_ctrl_w)
/* I have NO IDEA if this is correct or not */
m_bottomline = ~data & 0x20;
- if (input_port_read(machine(), "CAB") & 0x01)
+ if (ioport("CAB")->read() & 0x01)
m_flip = ~data & 0x10;
- if (!(input_port_read(machine(), "CAB") & 0x02))
+ if (!(ioport("CAB")->read() & 0x02))
machine().sound().system_mute(data & 0x80);
/* sound command in lower 4 bytes */
@@ -326,10 +326,10 @@ WRITE8_MEMBER(m10_state::m11_ctrl_w)
m_bottomline = ~data & 0x20;
- if (input_port_read(machine(), "CAB") & 0x01)
+ if (ioport("CAB")->read() & 0x01)
m_flip = ~data & 0x10;
- if (!(input_port_read(machine(), "CAB") & 0x02))
+ if (!(ioport("CAB")->read() & 0x02))
machine().sound().system_mute(data & 0x80);
}
@@ -355,9 +355,9 @@ WRITE8_MEMBER(m10_state::m15_ctrl_w)
if (data & 0xf0)
popmessage("M15 ctrl: %02x",data);
#endif
- if (input_port_read(machine(), "CAB") & 0x01)
+ if (ioport("CAB")->read() & 0x01)
m_flip = ~data & 0x04;
- if (!(input_port_read(machine(), "CAB") & 0x02))
+ if (!(ioport("CAB")->read() & 0x02))
machine().sound().system_mute(data & 0x08);
}
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index 19fda4eb463..4761bd42602 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -202,7 +202,7 @@ static INPUT_PORTS_START( m107_2player )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) //this is sprite flag on Irem M92, if this is active low then Dream Soccer '94 is unplayably slow
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") //this is sprite flag on Irem M92, if this is active low then Dream Soccer '94 is unplayably slow
/* DIP switch bank 3 */
PORT_DIPUNKNOWN_DIPLOC( 0x0100, 0x0100, "SW3:1" )
@@ -369,7 +369,7 @@ static INPUT_PORTS_START( wpksoc )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) //this is sprite flag on Irem M92, if this is active low then Dream Soccer '94 is unplayably slow
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") //this is sprite flag on Irem M92, if this is active low then Dream Soccer '94 is unplayably slow
PORT_DIPNAME( 0x0100, 0x0000, "DSW3" )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0100, DEF_STR( On ) )
diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c
index 44ed81f3a03..eeb8b1349d8 100644
--- a/src/mame/drivers/m14.c
+++ b/src/mame/drivers/m14.c
@@ -162,7 +162,7 @@ WRITE8_MEMBER(m14_state::m14_cram_w)
READ8_MEMBER(m14_state::m14_rng_r)
{
/* graphic artifacts happens if this doesn't return random values. */
- return (machine().rand() & 0x0f) | 0xf0; /* | (input_port_read(machine(), "IN1") & 0x80)*/;
+ return (machine().rand() & 0x0f) | 0xf0; /* | (ioport("IN1")->read() & 0x80)*/;
}
/* Here routes the hopper & the inputs */
@@ -175,7 +175,7 @@ READ8_MEMBER(m14_state::input_buttons_r)
return 0; //0x43 status bits
}
else
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
#if 0
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index 7ff4bf2df6e..119379e8714 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -544,17 +544,17 @@ static INPUT_PORTS_START( wilytowr )
PORT_DIPSETTING( 0x04, "x1.2" )
PORT_DIPSETTING( 0x08, "x1.4" )
PORT_DIPSETTING( 0x0c, "x1.6" )
- PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!5,!6") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) /* coin mode 2 */
+ PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!5,!6") PORT_CONDITION("DSW1",0x04,EQUALS,0x04) /* coin mode 2 */
PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( Free_Play ) ) /* Not documented */
- PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!7,!8") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x04) /* coin mode 2 */
+ PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:!7,!8") PORT_CONDITION("DSW1",0x04,EQUALS,0x04) /* coin mode 2 */
PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!5,!6,!7,!8") PORT_CONDITION("DSW1",0x04,PORTCOND_EQUALS,0x00) /* coin mode 1 */
+ PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!5,!6,!7,!8") PORT_CONDITION("DSW1",0x04,EQUALS,0x00) /* coin mode 1 */
PORT_DIPSETTING( 0x60, DEF_STR( 7C_1C ) )
PORT_DIPSETTING( 0x50, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 5C_1C ) )
@@ -696,7 +696,7 @@ static SAMPLES_START( fghtbskt_sh_start )
{
running_machine &machine = device.machine();
m63_state *state = machine.driver_data<m63_state>();
- int i, len = machine.root_device().memregion("samples")->bytes();
+ int i, len = state->memregion("samples")->bytes();
UINT8 *ROM = state->memregion("samples")->base();
state->m_samplebuf = auto_alloc_array(machine, INT16, len);
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index b726b3724a3..cedb9e9cc0b 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -845,7 +845,7 @@ READ16_MEMBER(m72_state::poundfor_trackball_r)
for (i = 0;i < 4;i++)
{
- curr = input_port_read(machine(), axisnames[i]);
+ curr = ioport(axisnames[i])->read();
m_diff[i] = (curr - m_prev[i]);
m_prev[i] = curr;
}
@@ -857,7 +857,7 @@ READ16_MEMBER(m72_state::poundfor_trackball_r)
case 0:
return (m_diff[0] & 0xff) | ((m_diff[2] & 0xff) << 8);
case 1:
- return ((m_diff[0] >> 8) & 0x1f) | (m_diff[2] & 0x1f00) | (input_port_read(machine(), "IN0") & 0xe0e0);
+ return ((m_diff[0] >> 8) & 0x1f) | (m_diff[2] & 0x1f00) | (ioport("IN0")->read() & 0xe0e0);
case 2:
return (m_diff[1] & 0xff) | ((m_diff[3] & 0xff) << 8);
case 3:
@@ -1122,7 +1122,7 @@ static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, m72_state )
ADDRESS_MAP_END
#define COIN_MODE_1 \
- PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0400, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6,7,8") \
+ PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0400, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6,7,8") \
PORT_DIPSETTING( 0x00a0, DEF_STR( 6C_1C ) ) \
PORT_DIPSETTING( 0x00b0, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) \
@@ -1141,12 +1141,12 @@ ADDRESS_MAP_END
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
#define COIN_MODE_2_A \
- PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0400, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6") \
+ PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0400, EQUALS, 0x0000) PORT_DIPLOCATION("SW1:5,6") \
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) \
PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) \
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) \
- PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0400, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW1:7,8") \
+ PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0400, EQUALS, 0x0000) PORT_DIPLOCATION("SW1:7,8") \
PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) \
PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) \
PORT_DIPSETTING( 0x0040, DEF_STR( 1C_5C ) ) \
@@ -1426,10 +1426,10 @@ static INPUT_PORTS_START( xmultipl )
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2")
- PORT_DIPSETTING( 0x0000, "Upright (single)" ) PORT_CONDITION("DSW", 0x1000, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) PORT_CONDITION("DSW", 0x1000, PORTCOND_NOTEQUALS, 0x0000)
- PORT_DIPSETTING( 0x0000, "Upright (double) On" ) PORT_CONDITION("DSW", 0x1000, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x0200, "Upright (double) Off" ) PORT_CONDITION("DSW", 0x1000, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, "Upright (single)" ) PORT_CONDITION("DSW", 0x1000, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0200, DEF_STR( Cocktail ) ) PORT_CONDITION("DSW", 0x1000, NOTEQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, "Upright (double) On" ) PORT_CONDITION("DSW", 0x1000, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0200, "Upright (double) Off" ) PORT_CONDITION("DSW", 0x1000, EQUALS, 0x0000)
PORT_DIPNAME( 0x0400, 0x0400, "Coin Mode" ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x0400, "Mode 1" )
PORT_DIPSETTING( 0x0000, "Mode 2" )
@@ -1621,7 +1621,7 @@ static INPUT_PORTS_START( poundfor )
PORT_DIPSETTING( 0x0800, "Mode 1" )
PORT_DIPSETTING( 0x0000, "Mode 2" )
/* Coin Mode 1 */
- PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
+ PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) )
@@ -1683,7 +1683,7 @@ static INPUT_PORTS_START( airduel )
PORT_DIPSETTING( 0x0800, "Mode 1" )
PORT_DIPSETTING( 0x0000, "Mode 2" )
/* Coin Mode 1 */
- PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
+ PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8")
PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) )
diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c
index 88ed1232a38..f0dce9a96d4 100644
--- a/src/mame/drivers/m79amb.c
+++ b/src/mame/drivers/m79amb.c
@@ -114,16 +114,16 @@ static SCREEN_UPDATE_RGB32( ramtek )
READ8_MEMBER(m79amb_state::gray5bit_controller0_r)
{
- UINT8 port_data = input_port_read(machine(), "8004");
- UINT8 gun_pos = input_port_read(machine(), "GUN1");
+ UINT8 port_data = ioport("8004")->read();
+ UINT8 gun_pos = ioport("GUN1")->read();
return (port_data & 0xe0) | m_lut_gun1[gun_pos];
}
READ8_MEMBER(m79amb_state::gray5bit_controller1_r)
{
- UINT8 port_data = input_port_read(machine(), "8005");
- UINT8 gun_pos = input_port_read(machine(), "GUN2");
+ UINT8 port_data = ioport("8005")->read();
+ UINT8 gun_pos = ioport("GUN2")->read();
return (port_data & 0xe0) | m_lut_gun2[gun_pos];
}
@@ -171,7 +171,7 @@ static INPUT_PORTS_START( m79amb )
PORT_DIPSETTING( 0xc0, DEF_STR( Free_Play ))
PORT_START("8002")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 7e75025615f..a49ca5d909b 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -110,23 +110,23 @@ READ8_MEMBER(macs_state::macs_input_r)
/*It's bit-wise*/
switch(m_mux_data&0x0f)
{
- 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");
+ case 0x00: return ioport("IN0")->read();
+ case 0x01: return ioport("IN1")->read();
+ case 0x02: return ioport("IN2")->read();
+ case 0x04: return ioport("IN3")->read();
+ case 0x08: return ioport("IN4")->read();
default:
logerror("Unmapped mahjong panel mux data %02x\n",m_mux_data);
return 0xff;
}
}
- 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");
+ case 1: return ioport("SYS0")->read();
+ case 2: return ioport("DSW0")->read();
+ case 3: return ioport("DSW1")->read();
+ case 4: return ioport("DSW2")->read();
+ case 5: return ioport("DSW3")->read();
+ case 6: return ioport("DSW4")->read();
+ case 7: return ioport("SYS1")->read();
default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",cpu_get_pc(&space.device()),offset+0xc0);
}
@@ -676,10 +676,10 @@ static MACHINE_RESET(macs)
730E: ED B0 ldir
...
*/
- memcpy(macs_ram1 + 0x0e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x1e9f, machine.root_device().memregion("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x0e9f, state->memregion("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x1e9f, state->memregion("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x0800, machine.root_device().memregion("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x0800, state->memregion("user1")->base()+0x73fa, 0x507);
memcpy(macs_ram1 + 0x1800, state->memregion("user1")->base()+0x73fa, 0x507);
#define MAKEJMP(n,m) macs_ram2[(n) - 0xe800 + 0]=0xc3;\
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c
index 27f297582f9..142785bf4a7 100644
--- a/src/mame/drivers/madalien.c
+++ b/src/mame/drivers/madalien.c
@@ -143,7 +143,7 @@ static INPUT_PORTS_START( madalien )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet )) PORT_DIPLOCATION("SW:8")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ))
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ))
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("PLAYER2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index cd6721acfa9..2dac3fa974b 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -151,7 +151,7 @@ static INPUT_PORTS_START( madmotor )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/magic10.c b/src/mame/drivers/magic10.c
index 3196a5ed287..40ca4dd5fc6 100644
--- a/src/mame/drivers/magic10.c
+++ b/src/mame/drivers/magic10.c
@@ -427,23 +427,23 @@ static INPUT_PORTS_START( magic10 )
PORT_DIPSETTING( 0x0800, "Note A: 20 - Note B: 40 - Note C: 100 - Note D: 200" )
PORT_DIPSETTING( 0x0400, "Note A: 50 - Note B: 100 - Note C: 500 - Note D: 1000" )
PORT_DIPSETTING( 0x0c00, "Note A: 100 - Note B: 200 - Note C: 1000 - Note D: 2000" )
- PORT_DIPNAME( 0x3000, 0x3000, "Lots At" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0xc000)
+ PORT_DIPNAME( 0x3000, 0x3000, "Lots At" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
PORT_DIPSETTING( 0x0000, "50 200 500 1000 2000" )
PORT_DIPSETTING( 0x1000, "100 300 1000 3000 5000" )
PORT_DIPSETTING( 0x2000, "200 500 2000 3000 5000" )
PORT_DIPSETTING( 0x3000, "500 1000 2000 4000 8000" )
- PORT_DIPNAME( 0x3000, 0x3000, "1 Ticket Won" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x8000)
+ PORT_DIPNAME( 0x3000, 0x3000, "1 Ticket Won" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
// PORT_DIPSETTING( 0x0000, "Every 100 Score" )
// PORT_DIPSETTING( 0x1000, "Every 100 Score" )
// PORT_DIPSETTING( 0x2000, "Every 100 Score" )
PORT_DIPSETTING( 0x3000, "Every 100 Score" )
- PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x4000)
+ PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x4000)
+ PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x3000, 0x3000, "1 Play Won" ) PORT_CONDITION("DSW", 0xc000, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPNAME( 0x3000, 0x3000, "1 Play Won" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x0000)
// PORT_DIPSETTING( 0x0000, "Every 10 Score" )
// PORT_DIPSETTING( 0x1000, "Every 10 Score" )
// PORT_DIPSETTING( 0x2000, "Every 10 Score" )
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c
index d0605fab00d..ff020b1c276 100644
--- a/src/mame/drivers/magicfly.c
+++ b/src/mame/drivers/magicfly.c
@@ -561,11 +561,11 @@ READ8_MEMBER(magicfly_state::mux_port_r)
{
switch( m_input_selector )
{
- case 0x01: return input_port_read(machine(), "IN0-0");
- case 0x02: return input_port_read(machine(), "IN0-1");
- case 0x04: return input_port_read(machine(), "IN0-2");
- case 0x08: return input_port_read(machine(), "IN0-3");
- case 0x00: return input_port_read(machine(), "DSW0");
+ case 0x01: return ioport("IN0-0")->read();
+ case 0x02: return ioport("IN0-1")->read();
+ case 0x04: return ioport("IN0-2")->read();
+ case 0x08: return ioport("IN0-3")->read();
+ case 0x00: return ioport("DSW0")->read();
}
return 0xff;
}
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index db4c2fd4aff..395d64987ce 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -147,7 +147,7 @@ READ8_MEMBER(magtouch_state::magtouch_io_r)
switch(offset)
{
case 1:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
default:
return 0;
}
diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c
index bb091ad7282..0f3fc999bd3 100644
--- a/src/mame/drivers/majorpkr.c
+++ b/src/mame/drivers/majorpkr.c
@@ -655,10 +655,10 @@ READ8_MEMBER(majorpkr_state::mux_port_r)
switch( (m_mux_data & 0xf0) ) /* 00-10-20-30-0F-1F-2F-3F */
{
- case 0x00: return input_port_read(machine(), "DSW1"); /* confirmed */
- case 0x10: return input_port_read(machine(), "DSW2"); /* confirmed */
- case 0x20: return input_port_read(machine(), "DSW3"); /* confirmed */
- case 0x30: return input_port_read(machine(), "DSW4"); /* confirmed */
+ case 0x00: return ioport("DSW1")->read(); /* confirmed */
+ case 0x10: return ioport("DSW2")->read(); /* confirmed */
+ case 0x20: return ioport("DSW3")->read(); /* confirmed */
+ case 0x30: return ioport("DSW4")->read(); /* confirmed */
}
return 0xff;
@@ -669,11 +669,11 @@ READ8_MEMBER(majorpkr_state::mux_port2_r)
if ((m_mux_data & 0x0f) == 4)
{
- return input_port_read(machine(), "IN0-1");
+ return ioport("IN0-1")->read();
}
else
{
- return input_port_read(machine(), "IN0-0");
+ return ioport("IN0-0")->read();
}
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index f02522d0558..c4a2dd1b27e 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -82,7 +82,7 @@ READ8_MEMBER(malzak_state::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 (input_port_read(machine(), "POT"))
+ switch (ioport("POT")->read())
{
case 0: // Normal play
return 0xf0;
@@ -210,7 +210,7 @@ static INPUT_PORTS_START( malzak )
/* No POT switch on Malzak as far as I know */
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -237,7 +237,7 @@ static INPUT_PORTS_START( malzak2 )
PORT_DIPSETTING( 0x03, "4" ) // Change settings
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 2d8982b54ac..9cd17b5ee58 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -1050,21 +1050,21 @@ static INPUT_PORTS_START( superpac )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_7C ) )
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,5,6")
- PORT_DIPSETTING( 0x08, "30k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x30, "30k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x20, "30k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x38, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x18, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x28, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x10, "30k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "30k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "30k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "30k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x38, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x28, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "30k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
- PORT_DIPSETTING( 0x10, "30k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00) /* Manual shows 100k only, Test Mode shows 30k which is what we use */
- PORT_DIPSETTING( 0x38, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, "40k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x28, "40k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x18, "40k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "30k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00) /* Manual shows 100k only, Test Mode shows 30k which is what we use */
+ PORT_DIPSETTING( 0x38, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "40k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x28, "40k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "40k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x80, "1" )
PORT_DIPSETTING( 0x40, "2" )
@@ -1089,20 +1089,20 @@ static INPUT_PORTS_START( pacnpal )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_7C ) )
PORT_DIPNAME( 0x38, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,5,6")
- PORT_DIPSETTING( 0x20, "20k & 70k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x30, "20k, 70k & Every 70k" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x00, "30k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x18, "30k & 70k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x10, "30k & 80k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x28, "30k, 100k & Every 80k" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x08, "30k & 100k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x08, "30k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, "40k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "30k & 80k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "30k, 80k & Every 80k" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x18, "30k & 100k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "40k & 120k Only" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x28, "40k, 100k & Every 100k" ) PORT_CONDITION("DSW1",0xc0,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "20k & 70k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "20k, 70k & Every 70k" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "30k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "30k & 70k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "30k & 80k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x28, "30k, 100k & Every 80k" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "30k & 100k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "30k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, "40k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "30k & 80k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "30k, 80k & Every 80k" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "30k & 100k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "40k & 120k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
+ PORT_DIPSETTING( 0x28, "40k, 100k & Every 100k" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x38, DEF_STR( None ) )
PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0xc0, "1" )
@@ -1228,20 +1228,20 @@ static INPUT_PORTS_START( phozon )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4,5")
- PORT_DIPSETTING( 0x08, "20k & 80k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x10, "20k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x04, "30k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x18, "30k & 60k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x1c, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
-// PORT_DIPSETTING( 0x14, "30k 100k" ) // repeated PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0c, "30k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0x02,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0c, "20k & 80k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, "30k" ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x1c, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
-// PORT_DIPSETTING( 0x14, "30k 100k" ) // repeated PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x18, "40k & 80k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x04, "100k Only" ) PORT_CONDITION("DSW2",0x02,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "20k & 80k Only" ) PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "20k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x04, "30k Only" ) PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "30k & 60k Only" ) PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x1c, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+// PORT_DIPSETTING( 0x14, "30k 100k" ) // repeated PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0c, "30k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0x02,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0c, "20k & 80k Only" ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, "30k" ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_DIPSETTING( 0x1c, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+// PORT_DIPSETTING( 0x14, "30k 100k" ) // repeated PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_DIPSETTING( 0x18, "40k & 80k Only" ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
+ PORT_DIPSETTING( 0x04, "100k Only" ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:6,7,8")
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
@@ -1308,20 +1308,20 @@ static INPUT_PORTS_START( mappy )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,5,6")
- PORT_DIPSETTING( 0x18, "20k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x30, "20k & 60k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x38, "20k & 70k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x10, "20k, 70k & Every 70k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x28, "20k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x08, "20k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x20, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_NOTEQUALS,0x80)
- PORT_DIPSETTING( 0x20, "30k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x38, "30k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x30, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x10, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x28, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x18, "40k Only" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x08, "40k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,PORTCOND_EQUALS,0x80)
+ PORT_DIPSETTING( 0x18, "20k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x30, "20k & 60k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x38, "20k & 70k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x10, "20k, 70k & Every 70k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x28, "20k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x08, "20k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x20, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x80)
+ PORT_DIPSETTING( 0x20, "30k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
+ PORT_DIPSETTING( 0x38, "30k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
+ PORT_DIPSETTING( 0x30, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
+ PORT_DIPSETTING( 0x10, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
+ PORT_DIPSETTING( 0x28, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
+ PORT_DIPSETTING( 0x18, "40k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
+ PORT_DIPSETTING( 0x08, "40k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x80)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x40, "1" )
@@ -1560,14 +1560,14 @@ static const namco_interface namco_config =
***************************************************************************/
-static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine(), "DSW1"); } // dips A
-static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine(), "DSW1") >> 4; } // dips A
+static READ8_DEVICE_HANDLER( dipA_l ) { return device->machine().root_device().ioport("DSW1")->read(); } // dips A
+static READ8_DEVICE_HANDLER( dipA_h ) { return device->machine().root_device().ioport("DSW1")->read() >> 4; } // dips A
static READ8_DEVICE_HANDLER( dipB_mux ) // dips B
{
mappy_state *state = device->machine().driver_data<mappy_state>();
- return input_port_read(device->machine(), "DSW2") >> (4 * state->m_mux);
+ return state->ioport("DSW2")->read() >> (4 * state->m_mux);
}
static READ8_DEVICE_HANDLER( dipB_muxi ) // dips B
@@ -1575,7 +1575,7 @@ static READ8_DEVICE_HANDLER( dipB_muxi ) // dips B
mappy_state *state = device->machine().driver_data<mappy_state>();
// bits are interleaved in Phozon
- return BITSWAP8(input_port_read(device->machine(), "DSW2"),6,4,2,0,7,5,3,1) >> (4 * state->m_mux);
+ return BITSWAP8(state->ioport("DSW2")->read(),6,4,2,0,7,5,3,1) >> (4 * state->m_mux);
}
static WRITE8_DEVICE_HANDLER( out_mux )
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index ab35bfbc891..942d9becc0c 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -163,7 +163,7 @@ READ8_MEMBER(marinedt_state::marinedt_port1_r)
//might need to be reversed for cocktail stuff
/* x/y multiplexed */
- return input_port_read(machine(), ((m_pf & 0x08) >> 3) ? "TRACKY" : "TRACKX");
+ return ioport(((m_pf & 0x08) >> 3) ? "TRACKY" : "TRACKX")->read();
}
READ8_MEMBER(marinedt_state::marinedt_coll_r)
diff --git a/src/mame/drivers/matmania.c b/src/mame/drivers/matmania.c
index f5644908239..83bd7565b0b 100644
--- a/src/mame/drivers/matmania.c
+++ b/src/mame/drivers/matmania.c
@@ -176,7 +176,7 @@ static INPUT_PORTS_START( matmania )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) /* The default setting should be cocktail. */
PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) )
PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:7" )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) /* Listed as always ON among DIPs in the manual */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* Listed as always ON among DIPs in the manual */
PORT_START("DSW2")
PORT_DIPNAME(0x03, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index 8a8d5c54bcd..1b9bd6a8588 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -75,7 +75,7 @@ public:
READ8_MEMBER(maxaflex_state::mcu_portA_r)
{
- m_portA_in = input_port_read(machine(), "dsw") | (input_port_read(machine(), "coin") << 4) | (input_port_read(machine(), "console") << 5);
+ m_portA_in = ioport("dsw")->read() | (ioport("coin")->read() << 4) | (ioport("console")->read() << 5);
return (m_portA_in & ~m_ddrA) | (m_portA_out & m_ddrA);
}
@@ -371,12 +371,12 @@ static const pokey_interface pokey_config = {
READ8_DEVICE_HANDLER(maxaflex_atari_pia_pa_r)
{
- return atari_input_disabled(device->machine()) ? 0xFF : input_port_read_safe(device->machine(), "djoy_0_1", 0);
+ return atari_input_disabled(device->machine()) ? 0xFF : device->machine().root_device().ioport("djoy_0_1")->read_safe(0);
}
READ8_DEVICE_HANDLER(maxaflex_atari_pia_pb_r)
{
- return atari_input_disabled(device->machine()) ? 0xFF : input_port_read_safe(device->machine(), "djoy_2_3", 0);
+ return atari_input_disabled(device->machine()) ? 0xFF : device->machine().root_device().ioport("djoy_2_3")->read_safe(0);
}
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index 443ab31372f..ad3058d96f4 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -202,7 +202,7 @@ READ8_MEMBER(maygay1b_state::m1_8279_r)
/* read sensor RAM */
case 0x40:
addr = chip->command & 0x07;
- result = input_port_read(machine(),"SW1");
+ result = ioport("SW1")->read();
/* handle autoincrement */
if (chip->command & 0x10)
chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
@@ -229,7 +229,7 @@ READ8_MEMBER(maygay1b_state::m1_8279_r)
{
if ( chip->read_sensor )
{
- result = input_port_read(machine(),portnames[chip->sense_address]);
+ result = ioport(portnames[chip->sense_address])->read();
// break
}
if ( chip->sense_auto_inc )
@@ -377,7 +377,7 @@ READ8_MEMBER(maygay1b_state::m1_8279_2_r)
{
/* read sensor RAM */
case 0x40:
- //result = ~input_port_read(machine,"DSW1"); /* DSW 1 - inverted! */
+ //result = ~ioport("DSW1")->read(); /* DSW 1 - inverted! */
break;
/* read display RAM */
diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c
index 54a579291cc..f5428f85362 100644
--- a/src/mame/drivers/maygayv1.c
+++ b/src/mame/drivers/maygayv1.c
@@ -532,7 +532,7 @@ READ16_MEMBER(maygayv1_state::maygay_8279_r)
case 0x40:
addr = i8279.command & 0x07;
- result = input_port_read(machine(), portnames[addr]);
+ result = ioport(portnames[addr])->read();
/* handle autoincrement */
if (i8279.command & 0x10)
@@ -730,7 +730,7 @@ READ8_MEMBER(maygayv1_state::mcu_r)
case 1:
{
if ( !BIT(m_p3, 4) )
- return (input_port_read(machine(), "REEL")); // Reels???
+ return (ioport("REEL")->read()); // Reels???
else
return 0;
}
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index 860a7274494..b77aeaa22b2 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -124,7 +124,7 @@ READ8_MEMBER(mayumi_state::key_matrix_r)
for (i = 0; i < 5; i++)
{
if (BIT(p, i))
- ret &= input_port_read(machine(), keynames[offset][i]);
+ ret &= ioport(keynames[offset][i])->read();
}
return ret;
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 8b700dec6b3..0a0c742b92a 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -889,7 +889,7 @@ READ8_MEMBER(mazerbla_state::zpu_inputs_r)
UINT8 ret = 0;
- ret = input_port_read(machine(), strobenames[m_bcd_7445]);
+ ret = ioport(strobenames[m_bcd_7445])->read();
return ret;
}
diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c
index 77e4217310e..86c261373d1 100644
--- a/src/mame/drivers/mcatadv.c
+++ b/src/mame/drivers/mcatadv.c
@@ -279,21 +279,21 @@ static INPUT_PORTS_START( mcatadv )
PORT_DIPSETTING( 0x0800, "Mode 1" )
PORT_DIPSETTING( 0x0000, "Mode 2" )
PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
- PORT_DIPSETTING( 0x2000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
- PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
+ PORT_DIPSETTING( 0x2000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
+ PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
- PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
PORT_DIPSETTING( 0xc000, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
- PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0800)
- PORT_DIPSETTING( 0x8000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x0800, PORTCOND_EQUALS, 0x0000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
+ PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0800)
+ PORT_DIPSETTING( 0x8000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x0800, EQUALS, 0x0000)
PORT_START("DSW2")
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index cabbbd6e7b7..7a689fc7c70 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -337,9 +337,9 @@ READ8_MEMBER(mcr_state::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 input_port_read(machine(), "ssio:IP0") | 0x08;
+ return ioport("ssio:IP0")->read() | 0x08;
else
- 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);
+ return ((ioport("ssio:IP2")->read() & 0x01) << 4);
}
@@ -347,9 +347,9 @@ READ8_MEMBER(mcr_state::solarfox_ip1_r)
{
/* same deal as above */
if (mcr_cocktail_flip)
- return input_port_read(machine(), "ssio:IP1") | 0xf0;
+ return ioport("ssio:IP1")->read() | 0xf0;
else
- return (input_port_read(machine(), "ssio:IP1") >> 4) | 0xf0;
+ return (ioport("ssio:IP1")->read() >> 4) | 0xf0;
}
@@ -362,7 +362,7 @@ READ8_MEMBER(mcr_state::solarfox_ip1_r)
READ8_MEMBER(mcr_state::kick_ip1_r)
{
- return (input_port_read(machine(), "DIAL2") << 4) & 0xf0;
+ return (ioport("DIAL2")->read() << 4) & 0xf0;
}
@@ -382,18 +382,18 @@ WRITE8_MEMBER(mcr_state::wacko_op4_w)
READ8_MEMBER(mcr_state::wacko_ip1_r)
{
if (!input_mux)
- return input_port_read(machine(), "ssio:IP1");
+ return ioport("ssio:IP1")->read();
else
- return input_port_read(machine(), "ssio:IP1.ALT");
+ return ioport("ssio:IP1.ALT")->read();
}
READ8_MEMBER(mcr_state::wacko_ip2_r)
{
if (!input_mux)
- return input_port_read(machine(), "ssio:IP2");
+ return ioport("ssio:IP2")->read();
else
- return input_port_read(machine(), "ssio:IP2.ALT");
+ return ioport("ssio:IP2.ALT")->read();
}
@@ -406,7 +406,7 @@ READ8_MEMBER(mcr_state::wacko_ip2_r)
READ8_MEMBER(mcr_state::kroozr_ip1_r)
{
- int dial = input_port_read(machine(), "DIAL");
+ int dial = ioport("DIAL")->read();
return ((dial & 0x80) >> 1) | ((dial & 0x70) >> 4);
}
@@ -629,15 +629,15 @@ WRITE8_MEMBER(mcr_state::nflfoot_op4_w)
READ8_MEMBER(mcr_state::demoderb_ip1_r)
{
- return input_port_read(machine(), "ssio:IP1") |
- (input_port_read(machine(), input_mux ? "ssio:IP1.ALT2" : "ssio:IP1.ALT1") << 2);
+ return ioport("ssio:IP1")->read() |
+ (ioport(input_mux ? "ssio:IP1.ALT2" : "ssio:IP1.ALT1")->read() << 2);
}
READ8_MEMBER(mcr_state::demoderb_ip2_r)
{
- return input_port_read(machine(), "ssio:IP2") |
- (input_port_read(machine(), input_mux ? "ssio:IP2.ALT2" : "ssio:IP2.ALT1") << 2);
+ return ioport("ssio:IP2")->read() |
+ (ioport(input_mux ? "ssio:IP2.ALT2" : "ssio:IP2.ALT1")->read() << 2);
}
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index d0343c786d1..acffea8502d 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -143,15 +143,15 @@ WRITE8_MEMBER(mcr3_state::mcrmono_control_port_w)
READ8_MEMBER(mcr3_state::demoderm_ip1_r)
{
- return input_port_read(machine(), "MONO.IP1") |
- (input_port_read(machine(), m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1") << 2);
+ return ioport("MONO.IP1")->read() |
+ (ioport(m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1")->read() << 2);
}
READ8_MEMBER(mcr3_state::demoderm_ip2_r)
{
- return input_port_read(machine(), "MONO.IP2") |
- (input_port_read(machine(), m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1") << 2);
+ return ioport("MONO.IP2")->read() |
+ (ioport(m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1")->read() << 2);
}
@@ -182,8 +182,8 @@ READ8_MEMBER(mcr3_state::maxrpm_ip1_r)
READ8_MEMBER(mcr3_state::maxrpm_ip2_r)
{
static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 };
- UINT8 start = input_port_read(machine(), "MONO.IP0");
- UINT8 shift = input_port_read(machine(), "SHIFT");
+ UINT8 start = ioport("MONO.IP0")->read();
+ UINT8 shift = ioport("SHIFT")->read();
/* reset on a start */
if (!(start & 0x08))
@@ -256,7 +256,7 @@ WRITE8_MEMBER(mcr3_state::maxrpm_op6_w)
/* when the read is toggled is when the ADC value is latched */
if (!(data & 0x80))
- m_latched_input = input_port_read(machine(), inputs[m_maxrpm_adc_select]);
+ m_latched_input = ioport(inputs[m_maxrpm_adc_select])->read();
/* 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 */
@@ -278,7 +278,7 @@ WRITE8_MEMBER(mcr3_state::maxrpm_op6_w)
READ8_MEMBER(mcr3_state::rampage_ip4_r)
{
- return input_port_read(machine(), "MONO.IP4") | (m_sounds_good->read(space,0) << 7);
+ return ioport("MONO.IP4")->read() | (m_sounds_good->read(space,0) << 7);
}
@@ -301,7 +301,7 @@ WRITE8_MEMBER(mcr3_state::rampage_op6_w)
READ8_MEMBER(mcr3_state::powerdrv_ip2_r)
{
- return input_port_read(machine(), "MONO.IP2") | (m_sounds_good->read(space, 0) << 7);
+ return ioport("MONO.IP2")->read() | (m_sounds_good->read(space, 0) << 7);
}
@@ -345,9 +345,9 @@ WRITE8_MEMBER(mcr3_state::powerdrv_op6_w)
READ8_MEMBER(mcr3_state::stargrds_ip0_r)
{
- UINT8 result = input_port_read(machine(), "MONO.IP0");
+ UINT8 result = ioport("MONO.IP0")->read();
if (m_input_mux)
- result = (result & ~0x0a) | (input_port_read(machine(), "MONO.IP0.ALT") & 0x0a);
+ result = (result & ~0x0a) | (ioport("MONO.IP0.ALT")->read() & 0x0a);
return (result & ~0x10) | ((m_sounds_good->read(space, 0) << 4) & 0x10);
}
@@ -388,14 +388,14 @@ WRITE8_MEMBER(mcr3_state::stargrds_op6_w)
READ8_MEMBER(mcr3_state::spyhunt_ip1_r)
{
- return input_port_read(machine(), "ssio:IP1") | (m_chip_squeak_deluxe->read(space, 0) << 5);
+ return ioport("ssio:IP1")->read() | (m_chip_squeak_deluxe->read(space, 0) << 5);
}
READ8_MEMBER(mcr3_state::spyhunt_ip2_r)
{
/* multiplexed steering wheel/gas pedal */
- return input_port_read(machine(), m_input_mux ? "ssio:IP2.ALT" : "ssio:IP2");
+ return ioport(m_input_mux ? "ssio:IP2.ALT" : "ssio:IP2")->read();
}
@@ -447,9 +447,9 @@ READ8_MEMBER(mcr3_state::turbotag_ip2_r)
{
/* multiplexed steering wheel/gas pedal */
if (m_input_mux)
- return input_port_read(machine(), "ssio:IP2.ALT");
+ return ioport("ssio:IP2.ALT")->read();
- return input_port_read(machine(), "ssio:IP2") + 5 * (machine().primary_screen->frame_number() & 1);
+ return ioport("ssio:IP2")->read() + 5 * (machine().primary_screen->frame_number() & 1);
}
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index a92c17d4017..cd1bf8dfc0c 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -69,8 +69,8 @@
READ8_DEVICE_HANDLER( zwackery_port_2_r )
{
- int result = input_port_read(device->machine(), "IN2");
- int wheel = input_port_read(device->machine(), "IN5");
+ int result = device->machine().root_device().ioport("IN2")->read();
+ int wheel = device->machine().root_device().ioport("IN5")->read();
return result | ((wheel >> 2) & 0x3e);
}
@@ -131,9 +131,9 @@ WRITE16_MEMBER(mcr68_state::blasted_control_w)
READ16_MEMBER(mcr68_state::spyhunt2_port_0_r)
{
static const char *const portnames[] = { "AN1", "AN2", "AN3", "AN4" };
- int result = input_port_read(machine(), "IN0");
+ int result = ioport("IN0")->read();
int which = (m_control_word >> 3) & 3;
- int analog = input_port_read(machine(), portnames[which]);
+ int analog = ioport(portnames[which])->read();
return result | ((m_sounds_good->read(space, 0) & 1) << 5) | (analog << 8);
}
@@ -141,7 +141,7 @@ READ16_MEMBER(mcr68_state::spyhunt2_port_0_r)
READ16_MEMBER(mcr68_state::spyhunt2_port_1_r)
{
- int result = input_port_read(machine(), "IN1");
+ int result = ioport("IN1")->read();
return result | ((m_turbo_chip_squeak->read(space, 0) & 1) << 7);
}
@@ -194,10 +194,10 @@ static const UINT8 translate49[7] = { 0x7, 0x3, 0x1, 0x0, 0xc, 0xe, 0xf };
READ16_MEMBER(mcr68_state::archrivl_port_1_r)
{
- 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);
+ return (translate49[ioport("49WAYY2")->read() >> 4] << 12) |
+ (translate49[ioport("49WAYX2")->read() >> 4] << 8) |
+ (translate49[ioport("49WAYY1")->read() >> 4] << 4) |
+ (translate49[ioport("49WAYX1")->read() >> 4] << 0);
}
@@ -256,18 +256,18 @@ READ16_MEMBER(mcr68_state::pigskin_protection_r)
READ16_MEMBER(mcr68_state::pigskin_port_1_r)
{
/* see archrivl_port_1_r for 49-way joystick description */
- return input_port_read(machine(), "IN1") |
- (translate49[input_port_read(machine(), "49WAYX1") >> 4] << 12) |
- (translate49[input_port_read(machine(), "49WAYY1") >> 4] << 8);
+ return ioport("IN1")->read() |
+ (translate49[ioport("49WAYX1")->read() >> 4] << 12) |
+ (translate49[ioport("49WAYY1")->read() >> 4] << 8);
}
READ16_MEMBER(mcr68_state::pigskin_port_2_r)
{
/* see archrivl_port_1_r for 49-way joystick description */
- return input_port_read(machine(), "DSW") |
- (translate49[input_port_read(machine(), "49WAYX2") >> 4] << 12) |
- (translate49[input_port_read(machine(), "49WAYY2") >> 4] << 8);
+ return ioport("DSW")->read() |
+ (translate49[ioport("49WAYX2")->read() >> 4] << 12) |
+ (translate49[ioport("49WAYY2")->read() >> 4] << 8);
}
@@ -280,9 +280,9 @@ READ16_MEMBER(mcr68_state::pigskin_port_2_r)
READ16_MEMBER(mcr68_state::trisport_port_1_r)
{
- int xaxis = (INT8)input_port_read(machine(), "AN1");
- int yaxis = (INT8)input_port_read(machine(), "AN2");
- int result = input_port_read(machine(), "IN1");
+ int xaxis = (INT8)ioport("AN1")->read();
+ int yaxis = (INT8)ioport("AN2")->read();
+ int result = ioport("IN1")->read();
result |= (xaxis & 0x3c) << 6;
result |= (yaxis & 0x3c) << 10;
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 20d6119789c..9779169699c 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -572,21 +572,21 @@ READ32_MEMBER(mediagx_state::parallel_port_r)
if (ACCESSING_BITS_8_15)
{
- UINT8 nibble = m_parallel_latched;//(input_port_read_safe(machine(), m_portnames[m_parallel_pointer / 3], 0) >> (4 * (m_parallel_pointer % 3))) & 15;
+ UINT8 nibble = m_parallel_latched;//(ioport(m_portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
logerror("%08X:parallel_port_r()\n", cpu_get_pc(&space.device()));
#if 0
if (m_controls_data == 0x18)
{
- r |= input_port_read(machine(), "IN0") << 8;
+ r |= ioport("IN0")->read() << 8;
}
else if (m_controls_data == 0x60)
{
- r |= input_port_read(machine(), "IN1") << 8;
+ r |= ioport("IN1")->read() << 8;
}
else if (m_controls_data == 0xff || m_controls_data == 0x50)
{
- r |= input_port_read(machine(), "IN2") << 8;
+ r |= ioport("IN2")->read() << 8;
}
//r |= m_control_read << 8;
@@ -625,7 +625,7 @@ WRITE32_MEMBER(mediagx_state::parallel_port_w)
logerror("%08X:", cpu_get_pc(&space.device()));
- m_parallel_latched = (input_port_read_safe(machine(), portnames[m_parallel_pointer / 3], 0) >> (4 * (m_parallel_pointer % 3))) & 15;
+ m_parallel_latched = (ioport(portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_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/megadrvb.c b/src/mame/drivers/megadrvb.c
index 55de0266ded..cf97b295090 100644
--- a/src/mame/drivers/megadrvb.c
+++ b/src/mame/drivers/megadrvb.c
@@ -281,7 +281,7 @@ static READ16_HANDLER( aladmdb_r )
md_boot_state *state = space->machine().driver_data<md_boot_state>();
if (cpu_get_pc(&space->device())==0x1b2a56)
{
- state->m_aladmdb_mcu_port = input_port_read(space->machine(), "MCU");
+ state->m_aladmdb_mcu_port = state->ioport("MCU")->read();
if (state->m_aladmdb_mcu_port & 0x100)
return ((state->m_aladmdb_mcu_port & 0x0f) | 0x100); // coin inserted, calculate the number of coins
@@ -289,7 +289,7 @@ static READ16_HANDLER( aladmdb_r )
return (0x100); //MCU status, needed if you fall into a pitfall
}
if (cpu_get_pc(&space->device())==0x1b2a72) return 0x0000;
- if (cpu_get_pc(&space->device())==0x1b2d24) return (input_port_read(space->machine(), "MCU") & 0x00f0) | 0x1200; // difficulty
+ if (cpu_get_pc(&space->device())==0x1b2d24) return (space->machine().root_device().ioport("MCU")->read() & 0x00f0) | 0x1200; // difficulty
if (cpu_get_pc(&space->device())==0x1b2d4e) return 0x0000;
logerror("aladbl_r : %06x\n",cpu_get_pc(&space->device()));
@@ -300,19 +300,19 @@ static READ16_HANDLER( aladmdb_r )
static READ16_HANDLER( mk3mdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return input_port_read(space->machine(), dswname[offset]);
+ return space->machine().root_device().ioport(dswname[offset])->read();
}
static READ16_HANDLER( ssf2mdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return input_port_read(space->machine(), dswname[offset]);
+ return space->machine().root_device().ioport(dswname[offset])->read();
}
static READ16_HANDLER( srmdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return input_port_read(space->machine(), dswname[offset]);
+ return space->machine().root_device().ioport(dswname[offset])->read();
}
static READ16_HANDLER( topshoot_200051_r )
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index d7e1351f8aa..ea0bc5267e8 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -237,11 +237,11 @@ READ16_MEMBER(megasys1_state::ip_select_r)
switch (i)
{
- case 0 : return input_port_read(machine(), "SYSTEM");
- case 1 : return input_port_read(machine(), "P1");
- case 2 : return input_port_read(machine(), "P2");
- case 3 : return input_port_read(machine(), "DSW1");
- case 4 : return input_port_read(machine(), "DSW2");
+ case 0 : return ioport("SYSTEM")->read();
+ case 1 : return ioport("P1")->read();
+ case 2 : return ioport("P2")->read();
+ case 3 : return ioport("DSW1")->read();
+ case 4 : return ioport("DSW2")->read();
default : return 0x0006;
}
}
@@ -1367,8 +1367,8 @@ READ16_MEMBER(megasys1_state::protection_peekaboo_r)
switch (m_protection_val)
{
case 0x02: return 0x03;
- case 0x51: return input_port_read(machine(), "P1");
- case 0x52: return input_port_read(machine(), "P2");
+ case 0x51: return ioport("P1")->read();
+ case 0x52: return ioport("P2")->read();
default: return m_protection_val;
}
}
@@ -3801,7 +3801,7 @@ READ16_MEMBER(megasys1_state::edfbl_input_r)
case 0x04/2:
case 0x06/2:
case 0x08/2:
- case 0x0a/2: res = input_port_read(machine(), in_names[offset-1]); break;
+ case 0x0a/2: res = ioport(in_names[offset-1])->read(); break;
}
return res;
@@ -4017,7 +4017,7 @@ READ16_MEMBER(megasys1_state::monkelf_input_r)
case 0x04/2:
case 0x06/2:
case 0x08/2:
- case 0x0a/2: res = input_port_read(machine(), in_names[offset-1]); break;
+ case 0x0a/2: res = ioport(in_names[offset-1])->read(); break;
}
return res;
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 8adfe1a2275..c46f02939f3 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -222,7 +222,7 @@ static TIMER_CALLBACK( megatech_z80_run_state )
UINT8* game_region;
sprintf(tempname, "game%d", param);
- game_region = machine.root_device().memregion(tempname)->base();
+ game_region = state->memregion(tempname)->base();
memcpy(state->memregion("maincpu")->base(), game_region, 0x400000);
diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c
index bc2bd2ce259..651423db547 100644
--- a/src/mame/drivers/meijinsn.c
+++ b/src/mame/drivers/meijinsn.c
@@ -112,7 +112,7 @@ READ16_MEMBER(meijinsn_state::alpha_mcu_r)
switch (offset)
{
case 0: /* Dipswitch 2 */
- m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "DSW");
+ m_shared_ram[0] = (source & 0xff00) | ioport("DSW")->read();
return 0;
case 0x22: /* Coin value */
@@ -123,16 +123,16 @@ READ16_MEMBER(meijinsn_state::alpha_mcu_r)
m_credits = 0;
- if ((input_port_read(machine(), "COINS") & 0x3) == 3)
+ if ((ioport("COINS")->read() & 0x3) == 3)
m_mcu_latch = 0;
- if ((input_port_read(machine(), "COINS") & 0x1) == 0 && !m_mcu_latch)
+ if ((ioport("COINS")->read() & 0x1) == 0 && !m_mcu_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x00;
m_mcu_latch = 1;
- m_coinvalue = (~input_port_read(machine(), "DSW")>>3) & 1;
+ m_coinvalue = (~ioport("DSW")->read()>>3) & 1;
m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0])
@@ -143,13 +143,13 @@ READ16_MEMBER(meijinsn_state::alpha_mcu_r)
else
m_credits = 0;
}
- else if ((input_port_read(machine(), "COINS") & 0x2) == 0 && !m_mcu_latch)
+ else if ((ioport("COINS")->read() & 0x2) == 0 && !m_mcu_latch)
{
m_shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x00;
m_mcu_latch = 1;
- m_coinvalue = (~input_port_read(machine(), "DSW") >> 3) & 1;
+ m_coinvalue = (~ioport("DSW")->read() >> 3) & 1;
m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0])
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index 305f8c0d3af..415e765d096 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -220,8 +220,8 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine().root_device().memregion("gfx1")->base();
- gfx[1] = device->machine().root_device().memregion("gfx2")->base();
+ gfx[0] = state->memregion("gfx1")->base();
+ gfx[1] = state->memregion("gfx2")->base();
rlen = state->memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index e57bcfddca3..c908d94d5ad 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -1016,7 +1016,7 @@ static MACHINE_START(meritm_crt260)
state->m_ram = auto_alloc_array(machine, UINT8, 0x8000 );
machine.device<nvram_device>("nvram")->set_base(state->m_ram, 0x8000);
memset(state->m_ram, 0x00, 0x8000);
- state->membank("bank1")->configure_entries(0, 128, machine.root_device().memregion("maincpu")->base(), 0x8000);
+ state->membank("bank1")->configure_entries(0, 128, state->memregion("maincpu")->base(), 0x8000);
state->membank("bank2")->configure_entries(0, 128, state->memregion("maincpu")->base(), 0x8000);
state->membank("bank3")->configure_entries(0, 4, state->m_ram, 0x2000);
state->m_bank = 0xff;
diff --git a/src/mame/drivers/metlclsh.c b/src/mame/drivers/metlclsh.c
index 8c142ff15be..adce7f29345 100644
--- a/src/mame/drivers/metlclsh.c
+++ b/src/mame/drivers/metlclsh.c
@@ -198,7 +198,7 @@ static INPUT_PORTS_START( metlclsh )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // cpu2 will clr c040 on startup forever
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, metlclsh_state,coin_inserted, 0)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index e16dabc5a82..b790730327f 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -839,9 +839,9 @@ ADDRESS_MAP_END
/* Really weird way of mapping 3 DSWs */
READ16_MEMBER(metro_state::balcube_dsw_r)
{
- UINT16 dsw1 = input_port_read(machine(), "DSW0") >> 0;
- UINT16 dsw2 = input_port_read(machine(), "DSW0") >> 8;
- UINT16 dsw3 = input_port_read(machine(), "IN2");
+ UINT16 dsw1 = ioport("DSW0")->read() >> 0;
+ UINT16 dsw2 = ioport("DSW0")->read() >> 8;
+ UINT16 dsw3 = ioport("IN2")->read();
switch (offset * 2)
{
@@ -1293,11 +1293,11 @@ READ16_MEMBER(metro_state::gakusai_input_r)
{
UINT16 input_sel = (*m_input_sel) ^ 0x3e;
// Bit 0 ??
- if (input_sel & 0x0002) return input_port_read(machine(), "KEY0");
- if (input_sel & 0x0004) return input_port_read(machine(), "KEY1");
- if (input_sel & 0x0008) return input_port_read(machine(), "KEY2");
- if (input_sel & 0x0010) return input_port_read(machine(), "KEY3");
- if (input_sel & 0x0020) return input_port_read(machine(), "KEY4");
+ if (input_sel & 0x0002) return ioport("KEY0")->read();
+ if (input_sel & 0x0004) return ioport("KEY1")->read();
+ if (input_sel & 0x0008) return ioport("KEY2")->read();
+ if (input_sel & 0x0010) return ioport("KEY3")->read();
+ if (input_sel & 0x0020) return ioport("KEY4")->read();
return 0xffff;
}
@@ -5995,7 +5995,7 @@ static DRIVER_INIT( balcube )
{
metro_state *state = machine.driver_data<metro_state>();
- const size_t len = machine.root_device().memregion("gfx1")->bytes();
+ const size_t len = state->memregion("gfx1")->bytes();
UINT8 *src = state->memregion("gfx1")->base();
UINT8 *end = src + len;
diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c
index dde5db1a6a3..8459fe5ee0c 100644
--- a/src/mame/drivers/mexico86.c
+++ b/src/mame/drivers/mexico86.c
@@ -452,7 +452,7 @@ static MACHINE_RESET( mexico86 )
/*TODO: check the PCB and see how the halt / reset lines are connected. */
if (machine.device("sub") != NULL)
- cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (state->ioport("DSW1")->read() & 0x80) ? ASSERT_LINE : CLEAR_LINE);
state->m_port_a_in = 0;
state->m_port_a_out = 0;
diff --git a/src/mame/drivers/meyc8080.c b/src/mame/drivers/meyc8080.c
index 072b82257f0..8d0340eaffb 100644
--- a/src/mame/drivers/meyc8080.c
+++ b/src/mame/drivers/meyc8080.c
@@ -323,7 +323,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( wldarrow )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
PORT_DIPNAME( 0x04, 0x00, "Monitor" )
PORT_DIPSETTING( 0x00, "Color" )
@@ -384,7 +384,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mdrawpkr )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -443,7 +443,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mdrawpkra )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -502,7 +502,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( casbjack )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/meyc8088.c b/src/mame/drivers/meyc8088.c
index dccd82e845e..4cfd505072e 100644
--- a/src/mame/drivers/meyc8088.c
+++ b/src/mame/drivers/meyc8088.c
@@ -222,10 +222,10 @@ static READ8_DEVICE_HANDLER(meyc8088_input_r)
UINT8 ret = 0xff;
// multiplexed switch inputs
- if (~state->m_common & 1) ret &= input_port_read_safe(device->machine(), "C0", 0); // bit switches
- if (~state->m_common & 2) ret &= input_port_read_safe(device->machine(), "C1", 0); // control switches
- if (~state->m_common & 4) ret &= input_port_read_safe(device->machine(), "C2", 0); // light switches
- if (~state->m_common & 8) ret &= input_port_read_safe(device->machine(), "C3", 0); // light switches
+ if (~state->m_common & 1) ret &= state->ioport("C0")->read_safe(0); // bit switches
+ if (~state->m_common & 2) ret &= state->ioport("C1")->read_safe(0); // control switches
+ if (~state->m_common & 4) ret &= state->ioport("C2")->read_safe(0); // light switches
+ if (~state->m_common & 8) ret &= state->ioport("C3")->read_safe(0); // light switches
return ret;
}
@@ -311,7 +311,7 @@ static const i8155_interface i8155_intf[2] =
static INPUT_PORTS_START( gldarrow )
PORT_START("SW")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) // coin4
PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c
index 414b95fcc07..f64cffe3042 100644
--- a/src/mame/drivers/mgolf.c
+++ b/src/mame/drivers/mgolf.c
@@ -91,7 +91,7 @@ static SCREEN_UPDATE_IND16( mgolf )
static void update_plunger( running_machine &machine )
{
mgolf_state *state = machine.driver_data<mgolf_state>();
- UINT8 val = input_port_read(machine, "BUTTON");
+ UINT8 val = state->ioport("BUTTON")->read();
if (state->m_prev != val)
{
@@ -143,13 +143,13 @@ READ8_MEMBER(mgolf_state::mgolf_wram_r)
READ8_MEMBER(mgolf_state::mgolf_dial_r)
{
- UINT8 val = input_port_read(machine(), "41");
+ UINT8 val = ioport("41")->read();
- if ((input_port_read(machine(), "DIAL") + 0x00) & 0x20)
+ if ((ioport("DIAL")->read() + 0x00) & 0x20)
{
val |= 0x01;
}
- if ((input_port_read(machine(), "DIAL") + 0x10) & 0x20)
+ if ((ioport("DIAL")->read() + 0x10) & 0x20)
{
val |= 0x02;
}
@@ -162,7 +162,7 @@ READ8_MEMBER(mgolf_state::mgolf_misc_r)
{
double plunger = calc_plunger_pos(machine()); /* see Video Pinball */
- UINT8 val = input_port_read(machine(), "61");
+ UINT8 val = ioport("61")->read();
if (plunger >= 0.000 && plunger <= 0.001)
{
@@ -232,7 +232,7 @@ static INPUT_PORTS_START( mgolf )
PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* DIAL A */
PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* DIAL B */
PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("60")
PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c
index d6006be3de6..dfee6a2052a 100644
--- a/src/mame/drivers/midas.c
+++ b/src/mame/drivers/midas.c
@@ -299,10 +299,10 @@ ADDRESS_MAP_END
READ16_MEMBER(midas_state::hammer_sensor_r)
{
- if (input_port_read(machine(), "HAMMER") & 0x80)
+ if (ioport("HAMMER")->read() & 0x80)
return 0xffff;
- return (input_port_read(machine(), "SENSORY") << 8) | input_port_read(machine(), "SENSORX");
+ return (ioport("SENSORY")->read() << 8) | ioport("SENSORX")->read();
}
WRITE16_MEMBER(midas_state::hammer_coin_w)
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index 102a322701c..834fd3f76eb 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -89,7 +89,7 @@ static MACHINE_RESET( midvplus )
READ32_MEMBER(midvunit_state::port0_r)
{
- UINT16 val = input_port_read(machine(), "IN0");
+ UINT16 val = ioport("IN0")->read();
UINT16 diff = val ^ m_last_port0;
/* make sure the shift controls are mutually exclusive */
@@ -143,7 +143,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_adc_w)
int which = (data >> m_adc_shift) - 4;
if (which < 0 || which > 2)
logerror("adc_w: unexpected which = %02X\n", which + 4);
- m_adc_data = input_port_read_safe(machine(), adcnames[which], 0);
+ m_adc_data = ioport(adcnames[which])->read_safe(0);
machine().scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready));
}
else
@@ -296,7 +296,7 @@ WRITE32_MEMBER(midvunit_state::tms32031_control_w)
READ32_MEMBER(midvunit_state::crusnwld_serial_status_r)
{
int status = midway_serial_pic_status_r();
- return (input_port_read(machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
+ return (ioport("991030")->read() & 0x7fff7fff) | (status << 31) | (status << 15);
}
@@ -359,7 +359,7 @@ WRITE32_MEMBER(midvunit_state::bit_reset_w)
READ32_MEMBER(midvunit_state::offroadc_serial_status_r)
{
int status = midway_serial_pic2_status_r(&space);
- return (input_port_read(machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
+ return (ioport("991030")->read() & 0x7fff7fff) | (status << 31) | (status << 15);
}
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index a43d6c8664e..aac5b259457 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -425,7 +425,7 @@ CUSTOM_INPUT_MEMBER(midzeus_state::custom_49way_r)
static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
const char *namex = (const char *)param;
const char *namey = namex + strlen(namex) + 1;
- return (translate49[input_port_read(machine(), namey) >> 4] << 4) | translate49[input_port_read(machine(), namex) >> 4];
+ return (translate49[ioport(namey)->read() >> 4] << 4) | translate49[ioport(namex)->read() >> 4];
}
@@ -438,7 +438,7 @@ WRITE32_MEMBER(midzeus_state::keypad_select_w)
CUSTOM_INPUT_MEMBER(midzeus_state::keypad_r)
{
- UINT32 bits = input_port_read(machine(), (const char *)param);
+ UINT32 bits = ioport((const char *)param)->read();
UINT8 select = keypad_select;
while ((select & 1) != 0)
{
@@ -461,7 +461,7 @@ READ32_MEMBER(midzeus_state::analog_r)
static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" };
if (offset < 8 || offset > 11)
logerror("%06X:analog_r(%X)\n", cpu_get_pc(&space.device()), offset);
- return input_port_read(machine(), tags[offset & 3]);
+ return ioport(tags[offset & 3])->read();
}
@@ -527,8 +527,8 @@ WRITE32_MEMBER(midzeus_state::invasn_gun_w)
{ "GUNX1", "GUNY1" },
{ "GUNX2", "GUNY2" }
};
- gun_x[player] = input_port_read(machine(), names[player][0]) * visarea.width() / 255 + visarea.min_x + BEAM_XOFFS;
- gun_y[player] = input_port_read(machine(), names[player][1]) * visarea.height() / 255 + visarea.min_y;
+ gun_x[player] = ioport(names[player][0])->read() * visarea.width() / 255 + visarea.min_x + BEAM_XOFFS;
+ gun_y[player] = ioport(names[player][1])->read() * visarea.height() / 255 + visarea.min_y;
gun_timer[player]->adjust(machine().primary_screen->time_until_pos(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 84534a1e06c..1826bc9b431 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -111,11 +111,11 @@ READ16_MEMBER(miragemi_state::mirage_input_r)
{
switch (m_mux_data & 0x1f)
{
- case 0x01: return input_port_read(machine(), "KEY0");
- case 0x02: return input_port_read(machine(), "KEY1");
- case 0x04: return input_port_read(machine(), "KEY2");
- case 0x08: return input_port_read(machine(), "KEY3");
- case 0x10: return input_port_read(machine(), "KEY4");
+ case 0x01: return ioport("KEY0")->read();
+ case 0x02: return ioport("KEY1")->read();
+ case 0x04: return ioport("KEY2")->read();
+ case 0x08: return ioport("KEY3")->read();
+ case 0x10: return ioport("KEY4")->read();
}
return 0xffff;
@@ -166,7 +166,7 @@ static INPUT_PORTS_START( mirage )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c
index a768acd90d2..344d5dcb3ef 100644
--- a/src/mame/drivers/mirax.c
+++ b/src/mame/drivers/mirax.c
@@ -535,7 +535,7 @@ ROM_END
static DRIVER_INIT( mirax )
{
mirax_state *state = machine.driver_data<mirax_state>();
- UINT8 *DATA = machine.root_device().memregion("data_code")->base();
+ UINT8 *DATA = state->memregion("data_code")->base();
UINT8 *ROM = state->memregion("maincpu")->base();
int i;
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index 94965f82c2b..9073c8f29f1 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -798,21 +798,21 @@ READ8_MEMBER(missile_state::missile_r)
if (m_ctrld) /* trackball */
{
if (!m_flipscreen)
- result = ((input_port_read(machine(), "TRACK0_Y") << 4) & 0xf0) | (input_port_read(machine(), "TRACK0_X") & 0x0f);
+ result = ((ioport("TRACK0_Y")->read() << 4) & 0xf0) | (ioport("TRACK0_X")->read() & 0x0f);
else
- result = ((input_port_read(machine(), "TRACK1_Y") << 4) & 0xf0) | (input_port_read(machine(), "TRACK1_X") & 0x0f);
+ result = ((ioport("TRACK1_Y")->read() << 4) & 0xf0) | (ioport("TRACK1_X")->read() & 0x0f);
}
else /* buttons */
- result = input_port_read(machine(), "IN0");
+ result = ioport("IN0")->read();
}
/* IN1 */
else if (offset < 0x4a00)
- result = input_port_read(machine(), "IN1");
+ result = ioport("IN1")->read();
/* IN2 */
else if (offset < 0x4b00)
- result = input_port_read(machine(), "R10");
+ result = ioport("R10")->read();
/* anything else */
else
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index f86a6588ec6..dca25043fec 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -120,7 +120,7 @@ READ8_MEMBER(mitchell_state::pang_port5_r)
otherwise music doesn't work.
*/
- return (input_port_read(machine(), "SYS0") & 0xfe) | (m_irq_source & 1);
+ return (ioport("SYS0")->read() & 0xfe) | (m_irq_source & 1);
}
static WRITE8_DEVICE_HANDLER( eeprom_cs_w )
@@ -166,7 +166,7 @@ READ8_MEMBER(mitchell_state::block_input_r)
if (m_dial_selected)
{
- int delta = (input_port_read(machine(), dialnames[offset]) - m_dial[offset]) & 0xff;
+ int delta = (ioport(dialnames[offset])->read() - m_dial[offset]) & 0xff;
if (delta & 0x80)
{
@@ -194,7 +194,7 @@ READ8_MEMBER(mitchell_state::block_input_r)
}
else
{
- int res = input_port_read(machine(), portnames[offset]) & 0xf7;
+ int res = ioport(portnames[offset])->read() & 0xf7;
if (m_dir[offset])
res |= 0x08;
@@ -209,8 +209,8 @@ WRITE8_MEMBER(mitchell_state::block_dial_control_w)
if (data == 0x08)
{
/* reset the dial counters */
- m_dial[0] = input_port_read(machine(), "DIAL1");
- m_dial[1] = input_port_read(machine(), "DIAL2");
+ m_dial[0] = ioport("DIAL1")->read();
+ m_dial[1] = ioport("DIAL2")->read();
}
else if (data == 0x80)
m_dial_selected = 0;
@@ -231,7 +231,7 @@ READ8_MEMBER(mitchell_state::mahjong_input_r)
for (i = 0; i < 5; i++)
{
if (m_keymatrix & (0x80 >> i))
- return input_port_read(machine(), keynames[offset][i]);
+ return ioport(keynames[offset][i])->read();
}
return 0xff;
@@ -251,21 +251,21 @@ READ8_MEMBER(mitchell_state::input_r)
{
case 0:
default:
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
case 1: /* Mahjong games */
if (offset)
return mahjong_input_r(space, offset - 1);
else
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
break;
case 2: /* Block Block - dial control */
if (offset)
return block_input_r(space, offset - 1);
else
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
break;
case 3: /* Super Pang - simulate START 1 press to initialize EEPROM */
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
}
@@ -420,7 +420,7 @@ static INPUT_PORTS_START( mj_common )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
@@ -670,7 +670,7 @@ static INPUT_PORTS_START( pang )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
@@ -721,7 +721,7 @@ static INPUT_PORTS_START( mstworld )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
@@ -837,7 +837,7 @@ static INPUT_PORTS_START( qtono1 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
@@ -877,7 +877,7 @@ static INPUT_PORTS_START( block )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
@@ -919,7 +919,7 @@ static INPUT_PORTS_START( blockjoy )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 0aa333bfb11..0393bb58751 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -124,12 +124,12 @@ READ8_MEMBER(mjkjidai_state::keyboard_r)
{
if (~m_keyb & (1 << i))
{
- res = input_port_read(machine(), keynames[i]) & 0x3f;
+ res = ioport(keynames[i])->read() & 0x3f;
break;
}
}
- res |= (input_port_read(machine(), "IN3") & 0xc0);
+ res |= (ioport("IN3")->read() & 0xc0);
if (m_nvram_init_count)
{
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index 2f79d2971d6..761642f8d8f 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -266,7 +266,7 @@ READ8_MEMBER(mjsister_state::mjsister_keys_r)
for (i = 0; i < 6; i++)
{
if (BIT(p, i))
- ret |= input_port_read(machine(), keynames[i]);
+ ret |= ioport(keynames[i])->read();
}
return ret;
@@ -449,7 +449,7 @@ static void mjsister_redraw(mjsister_state *state)
static MACHINE_START( mjsister )
{
mjsister_state *state = machine.driver_data<mjsister_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000);
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index 1907e495b8d..9f54544762b 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -250,7 +250,7 @@ READ16_MEMBER(mlanding_state::io1_r)//240006
*/
// multiplexed? or just overriden?
- int retval = (m_dma_active << 15) | (input_port_read(machine(), "DSW") & 0x7fff);
+ int retval = (m_dma_active << 15) | (ioport("DSW")->read() & 0x7fff);
return retval;
}
@@ -365,17 +365,17 @@ WRITE8_MEMBER(mlanding_state::ml_sound_to_main_w)
READ16_MEMBER(mlanding_state::ml_analog1_lsb_r)
{
- return input_port_read(machine(), "STICKX") & 0xff;
+ return ioport("STICKX")->read() & 0xff;
}
READ16_MEMBER(mlanding_state::ml_analog2_lsb_r)
{
- return input_port_read(machine(), "STICKY") & 0xff;
+ return ioport("STICKY")->read() & 0xff;
}
READ16_MEMBER(mlanding_state::ml_analog3_lsb_r)
{
- return (input_port_read(machine(), "STICKZ") & 0xff);
+ return (ioport("STICKZ")->read() & 0xff);
}
/*
@@ -401,7 +401,7 @@ READ16_MEMBER(mlanding_state::ml_analog3_lsb_r)
/* high bits of analog inputs + "limiters"/ADC converters. */
READ16_MEMBER(mlanding_state::ml_analog1_msb_r)
{
- return ((input_port_read(machine(), "STICKY") & 0xf00)>>8) | (input_port_read(machine(), "IN2") & 0xf0);
+ return ((ioport("STICKY")->read() & 0xf00)>>8) | (ioport("IN2")->read() & 0xf0);
}
READ16_MEMBER(mlanding_state::ml_analog2_msb_r)
@@ -409,8 +409,8 @@ READ16_MEMBER(mlanding_state::ml_analog2_msb_r)
UINT8 res;
UINT16 y_adc,x_adc;
- y_adc = input_port_read(machine(), "STICKY");
- x_adc = input_port_read(machine(), "STICKZ");
+ y_adc = ioport("STICKY")->read();
+ x_adc = ioport("STICKZ")->read();
res = 0;
@@ -426,7 +426,7 @@ READ16_MEMBER(mlanding_state::ml_analog2_msb_r)
// popmessage("%04x %04x",x_adc,y_adc);
- return ((input_port_read(machine(), "STICKZ") & 0xf00)>>8) | res;
+ return ((ioport("STICKZ")->read() & 0xf00)>>8) | res;
}
READ16_MEMBER(mlanding_state::ml_analog3_msb_r)
@@ -434,8 +434,8 @@ READ16_MEMBER(mlanding_state::ml_analog3_msb_r)
UINT8 z_adc,res;
UINT16 x_adc;
- z_adc = input_port_read(machine(), "STICKX");
- x_adc = input_port_read(machine(), "STICKZ");
+ z_adc = ioport("STICKX")->read();
+ x_adc = ioport("STICKZ")->read();
res = 0;
@@ -449,7 +449,7 @@ READ16_MEMBER(mlanding_state::ml_analog3_msb_r)
if(x_adc & 0x800 || x_adc == 0)
res|= 0x10;
- return ((input_port_read(machine(), "STICKX") & 0xf00)>>8) | res;
+ return ((ioport("STICKX")->read() & 0xf00)>>8) | res;
}
WRITE16_MEMBER(mlanding_state::ml_nmi_to_sound_w)
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index 5667f42dcae..6c71ef5f6ab 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -640,13 +640,13 @@ READ16_MEMBER(model1_state::io_r)
static const char *const inputnames[] = { "IN0", "IN1", "IN2" };
if(offset < 0x8)
- return input_port_read_safe(machine(), analognames[offset], 0x00);
+ return ioport(analognames[offset])->read_safe(0x00);
if(offset < 0x10)
{
offset -= 0x8;
if(offset < 3)
- return input_port_read(machine(), inputnames[offset]);
+ return ioport(inputnames[offset])->read();
return 0xff;
}
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 2ba52ce5497..f8bfb81fa7d 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -356,8 +356,8 @@ static MACHINE_RESET(model2o)
static MACHINE_RESET(model2_scsp)
{
model2_state *state = machine.driver_data<model2_state>();
- state->membank("bank4")->set_base(machine.root_device().memregion("scsp")->base() + 0x200000);
- state->membank("bank5")->set_base(machine.root_device().memregion("scsp")->base() + 0x600000);
+ state->membank("bank4")->set_base(state->memregion("scsp")->base() + 0x200000);
+ state->membank("bank5")->set_base(state->memregion("scsp")->base() + 0x600000);
// copy the 68k vector table into RAM
memcpy(state->m_soundram, state->memregion("audiocpu")->base() + 0x80000, 16);
@@ -454,7 +454,7 @@ READ32_MEMBER(model2_state::videoctl_r)
CUSTOM_INPUT_MEMBER(model2_state::_1c00000_r)
{
- UINT32 ret = input_port_read(machine(), "IN0");
+ UINT32 ret = ioport("IN0")->read();
if(m_ctrlmode == 0)
{
@@ -473,7 +473,7 @@ CUSTOM_INPUT_MEMBER(model2_state::_1c0001c_r)
if(m_analog_channel < 4)
{
static const char *const ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
- iptval = input_port_read_safe(machine(), ports[m_analog_channel], 0);
+ iptval = ioport(ports[m_analog_channel])->read_safe(0);
++m_analog_channel;
}
return iptval;
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 2625dcc25c0..128c302b6e7 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1277,10 +1277,10 @@ static void model3_init(running_machine &machine, int step)
state->m_sound_irq_enable = 0;
state->m_sound_timer->adjust(attotime::never);
- state->membank("bank1")->set_base(machine.root_device().memregion( "user1" )->base() + 0x800000 ); /* banked CROM */
+ state->membank("bank1")->set_base(state->memregion( "user1" )->base() + 0x800000 ); /* banked CROM */
- state->membank("bank4")->set_base(machine.root_device().memregion("samples")->base() + 0x200000);
- state->membank("bank5")->set_base(machine.root_device().memregion("samples")->base() + 0x600000);
+ state->membank("bank4")->set_base(state->memregion("samples")->base() + 0x200000);
+ state->membank("bank5")->set_base(state->memregion("samples")->base() + 0x600000);
// copy the 68k vector table into RAM
memcpy(state->m_soundram, state->memregion("audiocpu")->base()+0x80000, 16);
@@ -1337,11 +1337,11 @@ READ64_MEMBER(model3_state::model3_ctrl_r)
{
if(m_controls_bank & 0x1)
{
- return (input_port_read(machine(), "IN1")) << 24;
+ return (ioport("IN1")->read()) << 24;
}
else
{
- return (input_port_read(machine(), "IN0")) << 24;
+ return (ioport("IN0")->read()) << 24;
}
}
break;
@@ -1349,11 +1349,11 @@ READ64_MEMBER(model3_state::model3_ctrl_r)
case 1:
if (ACCESSING_BITS_56_63)
{
- return (UINT64)input_port_read(machine(), "IN2") << 56;
+ return (UINT64)ioport("IN2")->read() << 56;
}
else if (ACCESSING_BITS_24_31)
{
- return input_port_read(machine(), "IN3") << 24;
+ return ioport("IN3")->read() << 24;
}
break;
@@ -1388,7 +1388,7 @@ READ64_MEMBER(model3_state::model3_ctrl_r)
if (ACCESSING_BITS_24_31) /* ADC Data read */
{
static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
- UINT8 adc_data = input_port_read_safe(machine(), adcnames[m_adc_channel], 0);
+ UINT8 adc_data = ioport(adcnames[m_adc_channel])->read_safe(0);
m_adc_channel++;
m_adc_channel &= 0x7;
return (UINT64)adc_data << 24;
@@ -1441,32 +1441,32 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w)
switch(m_lightgun_reg_sel) /* read lightrun register */
{
case 0: /* player 1 gun X-position, lower 8-bits */
- m_serial_fifo2 = input_port_read(machine(), "LIGHT0_Y") & 0xff;
+ m_serial_fifo2 = ioport("LIGHT0_Y")->read() & 0xff;
break;
case 1: /* player 1 gun X-position, upper 2-bits */
- m_serial_fifo2 = (input_port_read(machine(), "LIGHT0_Y") >> 8) & 0x3;
+ m_serial_fifo2 = (ioport("LIGHT0_Y")->read() >> 8) & 0x3;
break;
case 2: /* player 1 gun Y-position, lower 8-bits */
- m_serial_fifo2 = input_port_read(machine(), "LIGHT0_X") & 0xff;
+ m_serial_fifo2 = ioport("LIGHT0_X")->read() & 0xff;
break;
case 3: /* player 1 gun Y-position, upper 2-bits */
- m_serial_fifo2 = (input_port_read(machine(), "LIGHT0_X") >> 8) & 0x3;
+ m_serial_fifo2 = (ioport("LIGHT0_X")->read() >> 8) & 0x3;
break;
case 4: /* player 2 gun X-position, lower 8-bits */
- m_serial_fifo2 = input_port_read(machine(), "LIGHT1_Y") & 0xff;
+ m_serial_fifo2 = ioport("LIGHT1_Y")->read() & 0xff;
break;
case 5: /* player 2 gun X-position, upper 2-bits */
- m_serial_fifo2 = (input_port_read(machine(), "LIGHT1_Y") >> 8) & 0x3;
+ m_serial_fifo2 = (ioport("LIGHT1_Y")->read() >> 8) & 0x3;
break;
case 6: /* player 2 gun Y-position, lower 8-bits */
- m_serial_fifo2 = input_port_read(machine(), "LIGHT1_X") & 0xff;
+ m_serial_fifo2 = ioport("LIGHT1_X")->read() & 0xff;
break;
case 7: /* player 2 gun Y-position, upper 2-bits */
- m_serial_fifo2 = (input_port_read(machine(), "LIGHT1_X") >> 8) & 0x3;
+ m_serial_fifo2 = (ioport("LIGHT1_X")->read() >> 8) & 0x3;
break;
case 8: /* gun offscreen (bit set = gun offscreen, bit clear = gun on screen) */
m_serial_fifo2 = 0; /* bit 0 = player 1, bit 1 = player 2 */
- if(input_port_read(machine(), "OFFSCREEN") & 0x1) {
+ if(ioport("OFFSCREEN")->read() & 0x1) {
m_serial_fifo2 |= 0x01;
}
break;
@@ -5302,8 +5302,8 @@ static void interleave_vroms(running_machine &machine)
model3_state *state = machine.driver_data<model3_state>();
int start;
int i,j,x;
- UINT16 *vrom1 = (UINT16*)machine.root_device().memregion("user3")->base();
- UINT16 *vrom2 = (UINT16*)machine.root_device().memregion("user4")->base();
+ UINT16 *vrom1 = (UINT16*)state->memregion("user3")->base();
+ UINT16 *vrom2 = (UINT16*)state->memregion("user4")->base();
int vrom_length = state->memregion("user3")->bytes();
UINT16 *vrom;
diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c
index 5c37fb44e5f..e3149a56306 100644
--- a/src/mame/drivers/moo.c
+++ b/src/mame/drivers/moo.c
@@ -82,7 +82,7 @@ WRITE16_MEMBER(moo_state::control2_w)
COMBINE_DATA(&m_cur_control2);
- input_port_write(machine(), "EEPROMOUT", m_cur_control2, 0xff);
+ ioport("EEPROMOUT")->write(m_cur_control2, 0xff);
if (data & 0x100)
k053246_set_objcha_line(m_k053246, ASSERT_LINE);
diff --git a/src/mame/drivers/mpoker.c b/src/mame/drivers/mpoker.c
index 312e51f4359..b7aef7f12d6 100644
--- a/src/mame/drivers/mpoker.c
+++ b/src/mame/drivers/mpoker.c
@@ -258,7 +258,7 @@ READ8_MEMBER(mpoker_state::mixport_r)
If you change the status *every* read, the HW stucks.
*/
- m_mixdata = (input_port_read(machine(), "SW2") & 0xfd) | (machine().rand() & 0x02);
+ m_mixdata = (ioport("SW2")->read() & 0xfd) | (machine().rand() & 0x02);
return m_mixdata;
}
diff --git a/src/mame/drivers/mpu3.c b/src/mame/drivers/mpu3.c
index 2b8e96d1d63..b7d6cf6d5a6 100644
--- a/src/mame/drivers/mpu3.c
+++ b/src/mame/drivers/mpu3.c
@@ -346,13 +346,13 @@ static READ8_DEVICE_HANDLER( pia_ic3_porta_r )
case 2:
case 3:
{
- data = (input_port_read(device->machine(), portnames[state->m_input_strobe])<<2);
+ data = (device->machine().root_device().ioport(portnames[state->m_input_strobe])->read()<<2);
break;
}
case 4://DIL1
case 6://DIL2
{
- swizzle = (input_port_read(device->machine(), portnames[state->m_input_strobe]));
+ swizzle = (device->machine().root_device().ioport(portnames[state->m_input_strobe])->read());
data = (((swizzle & 0x01) << 7) + ((swizzle & 0x02) << 5) + ((swizzle & 0x04) << 3)
+ ((swizzle & 0x08) << 1) +((swizzle & 0x10) >> 1) + ((swizzle & 0x20) >> 3));
break;
@@ -360,7 +360,7 @@ static READ8_DEVICE_HANDLER( pia_ic3_porta_r )
case 5://DIL1
case 7://DIL2
{
- swizzle = (input_port_read(device->machine(), portnames[state->m_input_strobe]));
+ swizzle = (device->machine().root_device().ioport(portnames[state->m_input_strobe])->read());
data = (((swizzle & 0x80) >> 1) + ((swizzle & 0x40) << 1));
break;
}
@@ -600,14 +600,14 @@ static const pia6821_interface pia_ic5_intf =
static READ8_DEVICE_HANDLER( pia_ic6_porta_r )
{
mpu3_state *state = device->machine().driver_data<mpu3_state>();
- return (input_port_read(device->machine(), "AUX1"))|state->m_aux1_input;
+ return (state->ioport("AUX1")->read())|state->m_aux1_input;
}
static READ8_DEVICE_HANDLER( pia_ic6_portb_r )
{
mpu3_state *state = device->machine().driver_data<mpu3_state>();
- return (input_port_read(device->machine(), "AUX2"))|state->m_aux2_input;
+ return (state->ioport("AUX2")->read())|state->m_aux2_input;
}
static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w )
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index 965ece3a033..2955ace01da 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -910,7 +910,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_r )
}
LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
- return input_port_read(device->machine(), "AUX1")|state->m_aux1_input;
+ return device->machine().root_device().ioport("AUX1")->read()|state->m_aux1_input;
}
static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
@@ -1099,7 +1099,7 @@ READ8_DEVICE_HANDLER( pia_ic5_portb_r )
coin_lockout_w(device->machine(), 1, (pia_ic5->b_output() & 0x02) );
coin_lockout_w(device->machine(), 2, (pia_ic5->b_output() & 0x04) );
coin_lockout_w(device->machine(), 3, (pia_ic5->b_output() & 0x08) );
- return input_port_read(device->machine(), "AUX2") | state->m_aux2_input;
+ return device->machine().root_device().ioport("AUX2")->read() | state->m_aux2_input;
}
@@ -1415,8 +1415,8 @@ static READ8_DEVICE_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_ic5->cb1_w(input_port_read(device->machine(), "AUX2") & 0x80);
- return input_port_read(device->machine(), portnames[state->m_input_strobe]);
+ pia_ic5->cb1_w(device->machine().root_device().ioport("AUX2")->read() & 0x80);
+ return device->machine().root_device().ioport(portnames[state->m_input_strobe])->read();
}
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index 67d21fef681..f3fc1e50b1d 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -1182,10 +1182,10 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
- UINT8 data = input_port_read(device->machine(), "AUX1");
+ UINT8 data = state->ioport("AUX1")->read();
- INT8 dx = input_port_read(device->machine(), "TRACKX");
- INT8 dy = input_port_read(device->machine(), "TRACKY");
+ INT8 dx = state->ioport("TRACKX")->read();
+ INT8 dy = state->ioport("TRACKY")->read();
state->m_cur[0] = dy + dx;
state->m_cur[1] = dy - dx;
@@ -1468,12 +1468,12 @@ static INPUT_PORTS_START( dealem )
PORT_START("ORANGE2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN5) PORT_NAME("20p Token")PORT_IMPULSE(5)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x04)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x05)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x06)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x07)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x08)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x09)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x04)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x05)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x06)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x07)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x08)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p") PORT_CONDITION("DIL1",0x0f,EQUALS,0x09)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
@@ -1484,22 +1484,22 @@ static INPUT_PORTS_START( dealem )
PORT_START("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Gamble")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Pontoon")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x01)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x09)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x03)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x04)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x05)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x06)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x07)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x08)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x01)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x09)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x03)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x04)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x05)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x06)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x07)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x08)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Rear Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
PORT_START("BLACK2")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x00)
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x02)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x00)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Hi-Lo") PORT_CONDITION("DIL1",0x0f,EQUALS,0x02)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Twist")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Lo")
@@ -1574,10 +1574,10 @@ static INPUT_PORTS_START( dealem )
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x00)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x01)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x02)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,PORTCOND_EQUALS,0x03)
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x00)
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x01)
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x02)
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) PORT_CONDITION("DIL1",0x0f,EQUALS,0x03)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index d79f698e28e..c4cc0ce6e58 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -107,7 +107,7 @@ static WRITE16_HANDLER( output_w )
static READ16_HANDLER( coin_chip_r )
{
if (offset == 1)
- return input_port_read(space->machine(), "COINCHIP");
+ return space->machine().root_device().ioport("COINCHIP")->read();
logerror("%06x:coin_chip_r(%02x) & %04x\n", cpu_get_pc(&space->device()), offset, mem_mask);
return 0xffff;
}
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index c1865efec79..bd1bd4602a7 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -183,19 +183,19 @@ CUSTOM_INPUT_MEMBER(ms32_state::mahjong_ctrl_r)
switch (m_mahjong_input_select[0])
{
case 0x01:
- mj_input = input_port_read(machine(), "MJ0");
+ mj_input = ioport("MJ0")->read();
break;
case 0x02:
- mj_input = input_port_read(machine(), "MJ1");
+ mj_input = ioport("MJ1")->read();
break;
case 0x04:
- mj_input = input_port_read(machine(), "MJ2");
+ mj_input = ioport("MJ2")->read();
break;
case 0x08:
- mj_input = input_port_read(machine(), "MJ3");
+ mj_input = ioport("MJ3")->read();
break;
case 0x10:
- mj_input = input_port_read(machine(), "MJ4");
+ mj_input = ioport("MJ4")->read();
break;
default:
mj_input = 0;
@@ -209,10 +209,10 @@ CUSTOM_INPUT_MEMBER(ms32_state::mahjong_ctrl_r)
READ32_MEMBER(ms32_state::ms32_read_inputs3)
{
int a,b,c,d;
- a = input_port_read(machine(), "AN2?"); // unused?
- b = input_port_read(machine(), "AN2?"); // unused?
- c = input_port_read(machine(), "AN1");
- d = (input_port_read(machine(), "AN0") - 0xb0) & 0xff;
+ a = ioport("AN2?")->read(); // unused?
+ b = ioport("AN2?")->read(); // unused?
+ c = ioport("AN1")->read();
+ d = (ioport("AN0")->read() - 0xb0) & 0xff;
return a << 24 | b << 16 | c << 8 | d << 0;
}
@@ -2202,7 +2202,7 @@ static void configure_banks(running_machine &machine)
{
ms32_state *state = machine.driver_data<ms32_state>();
state_save_register_global(machine, state->m_to_main);
- state->membank("bank4")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base() + 0x14000, 0x4000);
+ state->membank("bank4")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
state->membank("bank5")->configure_entries(0, 16, state->memregion("audiocpu")->base() + 0x14000, 0x4000);
}
diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c
index f65c6a32054..0b333db0295 100644
--- a/src/mame/drivers/msisaac.c
+++ b/src/mame/drivers/msisaac.c
@@ -116,7 +116,7 @@ MCU simulation TODO:
//6-down
//7-leftdwn
- UINT8 val= (input_port_read(machine(), "IN1") >> 2) & 0x0f;
+ UINT8 val= (ioport("IN1")->read() >> 2) & 0x0f;
/* bit0 = left
bit1 = right
bit2 = down
diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c
index 8274c6e1835..ffaecdbe4b1 100644
--- a/src/mame/drivers/mugsmash.c
+++ b/src/mame/drivers/mugsmash.c
@@ -154,16 +154,16 @@ READ16_MEMBER(mugsmash_state::mugsmash_input_ports_r)
switch (offset)
{
case 0 :
- data = (input_port_read(machine(), "P1") & 0xff) | ((input_port_read(machine(), "DSW1") & 0xc0) << 6) | ((input_port_read(machine(), "IN0") & 0x03) << 8);
+ data = (ioport("P1")->read() & 0xff) | ((ioport("DSW1")->read() & 0xc0) << 6) | ((ioport("IN0")->read() & 0x03) << 8);
break;
case 1 :
- data = (input_port_read(machine(), "P2") & 0xff) | ((input_port_read(machine(), "DSW1") & 0x3f) << 8);
+ data = (ioport("P2")->read() & 0xff) | ((ioport("DSW1")->read() & 0x3f) << 8);
break;
case 2 :
- data = ((input_port_read(machine(), "DSW2") & 0x3f) << 8);
+ data = ((ioport("DSW2")->read() & 0x3f) << 8);
break;
case 3 :
- data = ((input_port_read(machine(), "DSW2") & 0xc0) << 2);
+ data = ((ioport("DSW2")->read() & 0xc0) << 2);
break;
}
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 18a363d2d5f..f8b17cda7c0 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -263,11 +263,11 @@ WRITE8_MEMBER(multigam_state::multigam_IN0_w)
m_in_0_shift = 0;
m_in_1_shift = 0;
- m_in_0 = input_port_read(machine(), "P1");
- m_in_1 = input_port_read(machine(), "P2");
+ m_in_0 = ioport("P1")->read();
+ m_in_1 = ioport("P2")->read();
m_in_dsw_shift = 0;
- m_in_dsw = input_port_read_safe(machine(), "DSW", 0);
+ m_in_dsw = ioport("DSW")->read_safe(0);
}
READ8_MEMBER(multigam_state::multigam_IN1_r)
diff --git a/src/mame/drivers/mw18w.c b/src/mame/drivers/mw18w.c
index efee453cced..304fd3bcebe 100644
--- a/src/mame/drivers/mw18w.c
+++ b/src/mame/drivers/mw18w.c
@@ -141,22 +141,22 @@ static INPUT_PORTS_START( mw18w )
PORT_DIPSETTING( 0x30, "90 seconds" )
PORT_DIPNAME( 0x0c, 0x00, "Extended Time" ) PORT_DIPLOCATION("SW:3,4")
- PORT_DIPSETTING( 0x00, "20 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00) // @ 60 seconds
- PORT_DIPSETTING( 0x04, "30 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x08, "15 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x0c, "30 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "20 seconds at 6000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10) // @ 70 seconds
- PORT_DIPSETTING( 0x04, "30 seconds at 9000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10)
- PORT_DIPSETTING( 0x08, "20 seconds at 9000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10)
- PORT_DIPSETTING( 0x0c, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10)
- PORT_DIPSETTING( 0x00, "20 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20) // @ 80 seconds
- PORT_DIPSETTING( 0x04, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x08, "20 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x0c, "30 seconds at 16000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x00, "20 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30) // @ 90 seconds
- PORT_DIPSETTING( 0x04, "30 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30)
- PORT_DIPSETTING( 0x08, "20 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30)
- PORT_DIPSETTING( 0x0c, "30 seconds at 20000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30)
+ PORT_DIPSETTING( 0x00, "20 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00) // @ 60 seconds
+ PORT_DIPSETTING( 0x04, "30 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x08, "15 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x0c, "30 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "20 seconds at 6000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10) // @ 70 seconds
+ PORT_DIPSETTING( 0x04, "30 seconds at 9000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
+ PORT_DIPSETTING( 0x08, "20 seconds at 9000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
+ PORT_DIPSETTING( 0x0c, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x10)
+ PORT_DIPSETTING( 0x00, "20 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20) // @ 80 seconds
+ PORT_DIPSETTING( 0x04, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x08, "20 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x0c, "30 seconds at 16000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "20 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30) // @ 90 seconds
+ PORT_DIPSETTING( 0x04, "30 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
+ PORT_DIPSETTING( 0x08, "20 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
+ PORT_DIPSETTING( 0x0c, "30 seconds at 20000" ) PORT_CONDITION("DSW", 0x30, EQUALS, 0x30)
PORT_DIPNAME( 0x40, 0x40, "I/O Test" ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c
index 3228a9b2197..71d79d2b1ac 100644
--- a/src/mame/drivers/mw8080bw.c
+++ b/src/mame/drivers/mw8080bw.c
@@ -315,8 +315,8 @@ WRITE8_MEMBER(mw8080bw_state::seawolf_periscope_lamp_w)
CUSTOM_INPUT_MEMBER(mw8080bw_state::seawolf_erase_input_r)
{
- return input_port_read(machine(), SEAWOLF_ERASE_SW_PORT_TAG) &
- input_port_read(machine(), SEAWOLF_ERASE_DIP_PORT_TAG);
+ return ioport(SEAWOLF_ERASE_SW_PORT_TAG)->read() &
+ ioport(SEAWOLF_ERASE_DIP_PORT_TAG)->read();
}
@@ -353,20 +353,20 @@ static INPUT_PORTS_START( seawolf )
/* The actual commutator pcb (encoder) has 30 positions and works like the table says. */
PORT_BIT( 0x1f, 0x0f, IPT_POSITIONAL ) PORT_POSITIONS(30) PORT_REMAP_TABLE(seawolf_controller_table) PORT_INVERT PORT_SENSITIVITY(20) PORT_KEYDELTA(8) PORT_CENTERDELTA(0) PORT_NAME("Periscope axis") PORT_CROSSHAIR(X, ((float)MW8080BW_HPIXCOUNT - 28) / MW8080BW_HPIXCOUNT, 16.0 / MW8080BW_HPIXCOUNT, 32.0 / MW8080BW_VBSTART)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
- PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:1,2")
- PORT_DIPSETTING( 0x00, "60 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x40, "70 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x80, "80 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, "90 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "60 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x40, "70 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, "80 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, "90 seconds" ) PORT_CONDITION("IN1", 0xe0, PORTCOND_EQUALS, 0x00)
+ PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:1,2")
+ PORT_DIPSETTING( 0x00, "60 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, "70 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, "80 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, "90 seconds + 20 extended" ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "60 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, "70 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, "80 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, "90 seconds" ) PORT_CONDITION("IN1", 0xe0, EQUALS, 0x00)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
- PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0xe0, PORTCOND_NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:3,4")
+ PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0xe0, NOTEQUALS, 0xe0) PORT_DIPLOCATION("G4:3,4")
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 2C_3C ) )
@@ -548,13 +548,13 @@ MACHINE_CONFIG_END
UINT8 tornbase_get_cabinet_type(running_machine &machine)
{
- return input_port_read(machine, TORNBASE_CAB_TYPE_PORT_TAG);
+ return machine.root_device().ioport(TORNBASE_CAB_TYPE_PORT_TAG)->read();
}
CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_left_input_r)
{
- return input_port_read(machine(), TORNBASE_L_HIT_PORT_TAG);
+ return ioport(TORNBASE_L_HIT_PORT_TAG)->read();
}
@@ -565,13 +565,13 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_right_input_r)
switch (tornbase_get_cabinet_type(machine()))
{
case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
- ret = input_port_read(machine(), TORNBASE_L_HIT_PORT_TAG);
+ ret = ioport(TORNBASE_L_HIT_PORT_TAG)->read();
break;
case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
case TORNBASE_CAB_TYPE_COCKTAIL:
default:
- ret = input_port_read(machine(), TORNBASE_R_HIT_PORT_TAG);
+ ret = ioport(TORNBASE_R_HIT_PORT_TAG)->read();
break;
}
@@ -587,12 +587,12 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_left_input_r)
{
case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
- ret = input_port_read(machine(), TORNBASE_L_PITCH_PORT_TAG);
+ ret = ioport(TORNBASE_L_PITCH_PORT_TAG)->read();
break;
case TORNBASE_CAB_TYPE_COCKTAIL:
default:
- ret = input_port_read(machine(), TORNBASE_R_PITCH_PORT_TAG);
+ ret = ioport(TORNBASE_R_PITCH_PORT_TAG)->read();
break;
}
@@ -602,14 +602,14 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_left_input_r)
CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_right_input_r)
{
- return input_port_read(machine(), TORNBASE_L_PITCH_PORT_TAG);
+ return ioport(TORNBASE_L_PITCH_PORT_TAG)->read();
}
CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_score_input_r)
{
- return input_port_read(machine(), TORNBASE_SCORE_SW_PORT_TAG) &
- input_port_read(machine(), TORNBASE_SCORE_DIP_PORT_TAG);
+ return ioport(TORNBASE_SCORE_SW_PORT_TAG)->read() &
+ ioport(TORNBASE_SCORE_DIP_PORT_TAG)->read();
}
@@ -643,7 +643,7 @@ static INPUT_PORTS_START( tornbase )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_hit_left_input_r, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_pitch_left_input_r, NULL)
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B1:7")
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
@@ -656,7 +656,7 @@ static INPUT_PORTS_START( tornbase )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* schematics shows it as "START", but not used by the software */
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,tornbase_score_input_r, NULL)
- PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B1:2,3,4,5")
+ PORT_DIPNAME( 0x78, 0x40, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B1:2,3,4,5")
PORT_DIPSETTING( 0x18, "4 Coins/1 Inning" )
PORT_DIPSETTING( 0x10, "3 Coins/1 Inning" )
PORT_DIPSETTING( 0x38, "4 Coins/2 Innings" )
@@ -774,25 +774,25 @@ static INPUT_PORTS_START( zzzap )
PORT_BIT( 0xff, 0x7f, IPT_PADDLE ) PORT_MINMAX(0x01,0xfe) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x0c, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x0c, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:1,2")
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("E3:3,4")
- PORT_DIPSETTING( 0x0c, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x00, "80 seconds + 40 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x08, "99 seconds + 50 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x0c, "60 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x00, "80 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x08, "99 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x20)
+ PORT_DIPSETTING( 0x0c, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "80 seconds + 40 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x08, "99 seconds + 50 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x0c, "60 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "80 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x08, "99 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x20)
PORT_DIPSETTING( 0x04, "Test Mode" )
- PORT_DIPNAME( 0x30, 0x00, "Extended Time At" ) PORT_CONDITION("IN2", 0x0c, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:5,6")
+ PORT_DIPNAME( 0x30, 0x00, "Extended Time At" ) PORT_CONDITION("IN2", 0x0c, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:5,6")
PORT_DIPSETTING( 0x10, "2.00" )
PORT_DIPSETTING( 0x00, "2.50" )
PORT_DIPSETTING( 0x20, DEF_STR( None ) )
/* PORT_DIPSETTING( 0x30, DEF_STR( None ) ) */
- PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language )) PORT_CONDITION("IN2", 0x0c, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:7,8")
+ PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language )) PORT_CONDITION("IN2", 0x0c, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:7,8")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x40, DEF_STR( German ) )
PORT_DIPSETTING( 0x80, DEF_STR( French ) )
@@ -817,16 +817,16 @@ static INPUT_PORTS_START( lagunar )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
- PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:3,4")
- PORT_DIPSETTING( 0x00, "45 seconds + 22 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
- PORT_DIPSETTING( 0x04, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
- PORT_DIPSETTING( 0x08, "75 seconds + 37 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
- PORT_DIPSETTING( 0x0c, "90 seconds + 45 extended" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0)
- PORT_DIPSETTING( 0x00, "45 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
- PORT_DIPSETTING( 0x04, "60 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
- PORT_DIPSETTING( 0x08, "75 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
- PORT_DIPSETTING( 0x0c, "90 seconds" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_EQUALS, 0xc0)
- PORT_DIPNAME( 0x30, 0x20, "Extended Time At" ) PORT_CONDITION("IN2", 0xc0, PORTCOND_NOTEQUALS, 0xc0) PORT_DIPLOCATION("E3:5,6")
+ PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0x04) PORT_DIPLOCATION("E3:3,4")
+ PORT_DIPSETTING( 0x00, "45 seconds + 22 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
+ PORT_DIPSETTING( 0x04, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
+ PORT_DIPSETTING( 0x08, "75 seconds + 37 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
+ PORT_DIPSETTING( 0x0c, "90 seconds + 45 extended" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0)
+ PORT_DIPSETTING( 0x00, "45 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
+ PORT_DIPSETTING( 0x04, "60 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
+ PORT_DIPSETTING( 0x08, "75 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
+ PORT_DIPSETTING( 0x0c, "90 seconds" ) PORT_CONDITION("IN2", 0xc0, EQUALS, 0xc0)
+ PORT_DIPNAME( 0x30, 0x20, "Extended Time At" ) PORT_CONDITION("IN2", 0xc0, NOTEQUALS, 0xc0) PORT_DIPLOCATION("E3:5,6")
PORT_DIPSETTING( 0x00, "350" )
PORT_DIPSETTING( 0x10, "400" )
PORT_DIPSETTING( 0x20, "450" )
@@ -940,12 +940,12 @@ static INPUT_PORTS_START( maze )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* labeled 'Not Used' */
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
- PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
+ PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) )
- PORT_DIPNAME( 0x40, 0x40, "2 Player Game Time" ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3")
+ PORT_DIPNAME( 0x40, 0x40, "2 Player Game Time" ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:3")
PORT_DIPSETTING( 0x40, "4 minutes" )
PORT_DIPSETTING( 0x00, "6 minutes" )
PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW:4" )
@@ -1024,12 +1024,12 @@ static INPUT_PORTS_START( boothill )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
PORT_DIPSETTING( 0x02, "2 Coins per Player" )
PORT_DIPSETTING( 0x03, "2 Coins/1 or 2 Players" )
PORT_DIPSETTING( 0x00, "1 Coin per Player" )
PORT_DIPSETTING( 0x01, "1 Coin/1 or 2 Players" )
- PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
+ PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
PORT_DIPSETTING( 0x00, "60 seconds" )
PORT_DIPSETTING( 0x04, "70 seconds" )
PORT_DIPSETTING( 0x08, "80 seconds" )
@@ -1111,21 +1111,21 @@ static INPUT_PORTS_START( checkmat )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
PORT_START("IN2")
- PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:1")
+ PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:1")
PORT_DIPSETTING( 0x00, "1 Coin/1 or 2 Players" )
PORT_DIPSETTING( 0x01, "1 Coin/1 or 2 Players, 2 Coins/3 or 4 Players" )
- PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:2")
+ PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:2")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
- PORT_DIPNAME( 0x0c, 0x04, "Rounds" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:3,4")
+ PORT_DIPNAME( 0x0c, 0x04, "Rounds" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:3,4")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x0c, "5" )
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:5")
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:5")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
- PORT_DIPNAME( 0x60, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("A4:6,7")
+ PORT_DIPNAME( 0x60, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("A4:6,7")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x20, "Language 2" )
PORT_DIPSETTING( 0x40, "Language 3" )
@@ -1190,9 +1190,9 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::desertgu_gun_input_r)
UINT32 ret;
if (m_desertgun_controller_select)
- ret = input_port_read(machine(), DESERTGU_GUN_X_PORT_TAG);
+ ret = ioport(DESERTGU_GUN_X_PORT_TAG)->read();
else
- ret = input_port_read(machine(), DESERTGU_GUN_Y_PORT_TAG);
+ ret = ioport(DESERTGU_GUN_Y_PORT_TAG)->read();
return ret;
}
@@ -1203,9 +1203,9 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::desertgu_dip_sw_0_1_r)
UINT32 ret;
if (m_desertgun_controller_select)
- ret = input_port_read(machine(), DESERTGU_DIP_SW_0_1_SET_2_TAG);
+ ret = ioport(DESERTGU_DIP_SW_0_1_SET_2_TAG)->read();
else
- ret = input_port_read(machine(), DESERTGU_DIP_SW_0_1_SET_1_TAG);
+ ret = ioport(DESERTGU_DIP_SW_0_1_SET_1_TAG)->read();
return ret;
}
@@ -1234,7 +1234,7 @@ static INPUT_PORTS_START( desertgu )
PORT_START("IN1")
PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,desertgu_dip_sw_0_1_r, NULL)
- PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN1", 0x30, PORTCOND_NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:5,6")
+ PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:5,6")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x04, DEF_STR( German ) )
PORT_DIPSETTING( 0x08, DEF_STR( French ) )
@@ -1257,7 +1257,7 @@ static INPUT_PORTS_START( desertgu )
/* D0 and D1 in the DIP SW input port can reflect two sets of switches depending on the controller
select bit. These two ports are fakes to handle this case */
PORT_START(DESERTGU_DIP_SW_0_1_SET_1_TAG)
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x30, PORTCOND_NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:1,2")
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_3C ) )
@@ -1265,7 +1265,7 @@ static INPUT_PORTS_START( desertgu )
PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START(DESERTGU_DIP_SW_0_1_SET_2_TAG)
- PORT_DIPNAME( 0x03, 0x01, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x30, PORTCOND_NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:3,4")
+ PORT_DIPNAME( 0x03, 0x01, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x30, NOTEQUALS, 0x30) PORT_DIPLOCATION("C2:3,4")
PORT_DIPSETTING( 0x00, "40 seconds + 30 extended" )
PORT_DIPSETTING( 0x01, "50 seconds + 30 extended" )
PORT_DIPSETTING( 0x02, "60 seconds + 30 extended" )
@@ -1318,10 +1318,10 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::dplay_pitch_left_input_r)
{
UINT32 ret;
- if (input_port_read(machine(), DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT)
- ret = input_port_read(machine(), DPLAY_L_PITCH_PORT_TAG);
+ if (ioport(DPLAY_CAB_TYPE_PORT_TAG)->read() == DPLAY_CAB_TYPE_UPRIGHT)
+ ret = ioport(DPLAY_L_PITCH_PORT_TAG)->read();
else
- ret = input_port_read(machine(), DPLAY_R_PITCH_PORT_TAG);
+ ret = ioport(DPLAY_R_PITCH_PORT_TAG)->read();
return ret;
}
@@ -1329,7 +1329,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::dplay_pitch_left_input_r)
CUSTOM_INPUT_MEMBER(mw8080bw_state::dplay_pitch_right_input_r)
{
- return input_port_read(machine(), DPLAY_L_PITCH_PORT_TAG);
+ return ioport(DPLAY_L_PITCH_PORT_TAG)->read();
}
@@ -1361,7 +1361,7 @@ static INPUT_PORTS_START( dplay )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2")
- PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
+ PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
PORT_DIPSETTING( 0x05, "2 Coins/1 Inning/1 Player, 4 Coins/1 Inning/2 Players, 8 Coins/3 Innings/2 Players" )
PORT_DIPSETTING( 0x04, "1 Coin/1 Inning/1 Player, 2 Coins/1 Inning/2 Players, 4 Coins/3 Innings/2 Players" )
PORT_DIPSETTING( 0x02, "2 Coins per Inning" )
@@ -1370,13 +1370,13 @@ static INPUT_PORTS_START( dplay )
/* PORT_DIPSETTING( 0x06, "1 Coin per Inning" ) */
/* PORT_DIPSETTING( 0x07, "1 Coin per Inning" ) */
PORT_DIPSETTING( 0x01, "1 Coin/1 Inning, 2 Coins/3 Innings" )
- PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "C1:7" )
@@ -1425,7 +1425,7 @@ static INPUT_PORTS_START( einning )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2")
- PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
+ PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage )) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:1,2,3")
PORT_DIPSETTING( 0x05, "2 Coins/1 Inning/1 Player, 4 Coins/1 Inning/2 Players, 8 Coins/3 Innings/2 Players" )
PORT_DIPSETTING( 0x04, "1 Coin/1 Inning/1 Player, 2 Coins/1 Inning/2 Players, 4 Coins/3 Innings/2 Players" )
PORT_DIPSETTING( 0x02, "2 Coins per Inning" )
@@ -1434,13 +1434,13 @@ static INPUT_PORTS_START( einning )
/* PORT_DIPSETTING( 0x06, "1 Coin per Inning" ) */
/* PORT_DIPSETTING( 0x07, "1 Coin per Inning" ) */
PORT_DIPSETTING( 0x01, "1 Coin/1 Inning, 2 Coins/3 Innings" )
- PORT_DIPNAME( 0x08, 0x00, "Wall Knock Out Behavior" ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
+ PORT_DIPNAME( 0x08, 0x00, "Wall Knock Out Behavior" ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:4")
PORT_DIPSETTING( 0x00, "Individually" )
PORT_DIPSETTING( 0x08, "In Pairs" )
- PORT_DIPNAME( 0x10, 0x00, "Double Score when Special Lit" ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
+ PORT_DIPNAME( 0x10, 0x00, "Double Score when Special Lit" ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:5")
PORT_DIPSETTING( 0x00, "Home Run Only" )
PORT_DIPSETTING( 0x10, "Any Hit" )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, PORTCOND_EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x40, EQUALS, 0x40) PORT_DIPLOCATION("C1:6")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "C1:7" )
@@ -1550,22 +1550,22 @@ static INPUT_PORTS_START( gmissile )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:1,2")
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:1,2")
PORT_DIPSETTING( 0x01, "2 Coins per Player" )
PORT_DIPSETTING( 0x00, "2 Coins/1 or 2 Players" )
PORT_DIPSETTING( 0x03, "1 Coin per Player" )
PORT_DIPSETTING( 0x02, "1 Coin/1 or 2 Players" )
- PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:3,4")
+ PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:3,4")
PORT_DIPSETTING( 0x00, "60 seconds + 30 extended" )
PORT_DIPSETTING( 0x08, "70 seconds + 35 extended" )
PORT_DIPSETTING( 0x04, "80 seconds + 40 extended" )
PORT_DIPSETTING( 0x0c, "90 seconds + 45 extended" )
- PORT_DIPNAME( 0x30, 0x10, "Extended Time At" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:5,6")
+ PORT_DIPNAME( 0x30, 0x10, "Extended Time At" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:5,6")
PORT_DIPSETTING( 0x00, "500" )
PORT_DIPSETTING( 0x20, "700" )
PORT_DIPSETTING( 0x10, "1000" )
PORT_DIPSETTING( 0x30, "1300" )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("D1:7")
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("D1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "D1:8" )
@@ -1644,12 +1644,12 @@ static INPUT_PORTS_START( m4 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x10) PORT_DIPLOCATION("C1:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x10) PORT_DIPLOCATION("C1:1,2")
PORT_DIPSETTING( 0x02, "2 Coins per Player" )
PORT_DIPSETTING( 0x03, "2 Coins/1 or 2 Players" )
PORT_DIPSETTING( 0x00, "1 Coin per Player" )
PORT_DIPSETTING( 0x01, "1 Coin/1 or 2 Players" )
- PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, PORTCOND_EQUALS, 0x10) PORT_DIPLOCATION("C1:3,4")
+ PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Game_Time ) ) PORT_CONDITION("IN2", 0x10, EQUALS, 0x10) PORT_DIPLOCATION("C1:3,4")
PORT_DIPSETTING( 0x00, "60 seconds" )
PORT_DIPSETTING( 0x04, "70 seconds" )
PORT_DIPSETTING( 0x08, "80 seconds" )
@@ -1711,11 +1711,11 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::clowns_controller_r)
if (m_clowns_controller_select)
{
- ret = input_port_read(machine(), CLOWNS_CONTROLLER_P2_TAG);
+ ret = ioport(CLOWNS_CONTROLLER_P2_TAG)->read();
}
else
{
- ret = input_port_read(machine(), CLOWNS_CONTROLLER_P1_TAG);
+ ret = ioport(CLOWNS_CONTROLLER_P1_TAG)->read();
}
return ret;
@@ -1754,23 +1754,23 @@ static INPUT_PORTS_START( clowns )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
- PORT_DIPNAME( 0x0c, 0x00, "Bonus Game" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
+ PORT_DIPNAME( 0x0c, 0x00, "Bonus Game" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
PORT_DIPSETTING( 0x00, "No Bonus" )
PORT_DIPSETTING( 0x04, "9000" )
PORT_DIPSETTING( 0x08, "11000" )
PORT_DIPSETTING( 0x0c, "13000" )
- PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
PORT_DIPSETTING( 0x00, "Each Row" )
PORT_DIPSETTING( 0x10, "All Rows" )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
PORT_DIPSETTING( 0x00, "3000" )
PORT_DIPSETTING( 0x20, "4000" )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:7")
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x40, "4" )
/* test mode - press coin button for input test */
@@ -1803,20 +1803,20 @@ static INPUT_PORTS_START( clowns1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:1,2")
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
- PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
+ PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:3,4")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x04, "3" )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x0c, "5" )
- PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x10, 0x00, "Balloon Resets" ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:5")
PORT_DIPSETTING( 0x00, "Each Row" )
PORT_DIPSETTING( 0x10, "All Rows" )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("SW:6")
PORT_DIPSETTING( 0x00, "3000" )
PORT_DIPSETTING( 0x20, "4000" )
PORT_DIPNAME( 0x40, 0x00, "Input Test" ) PORT_DIPLOCATION("SW:7")
@@ -1895,14 +1895,14 @@ static INPUT_PORTS_START( spacwalk )
but ROM contents suggests it's not connected (no different languages or unmapped reads) */
PORT_START("IN2")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("C2:1,2")
- PORT_DIPSETTING( 0x03, "40 seconds + 20 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 45 + 20 for 2 players
- PORT_DIPSETTING( 0x02, "50 seconds + 25 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 60 + 30 for 2 players
- PORT_DIPSETTING( 0x01, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 75 + 35 for 2 players
- PORT_DIPSETTING( 0x00, "70 seconds + 35 extended" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x00) // 90 + 45 for 2 players
- PORT_DIPSETTING( 0x03, "40 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x02, "50 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x01, "60 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "70 seconds" ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x03, "40 seconds + 20 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 45 + 20 for 2 players
+ PORT_DIPSETTING( 0x02, "50 seconds + 25 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 60 + 30 for 2 players
+ PORT_DIPSETTING( 0x01, "60 seconds + 30 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 75 + 35 for 2 players
+ PORT_DIPSETTING( 0x00, "70 seconds + 35 extended" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x00) // 90 + 45 for 2 players
+ PORT_DIPSETTING( 0x03, "40 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, "50 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x01, "60 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "70 seconds" ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00)
PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("C2:3,4")
PORT_DIPSETTING( 0x00, "1 Coin per Player" )
PORT_DIPSETTING( 0x04, "1 Coin/1 or 2 Players" )
@@ -1972,22 +1972,22 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( shuffle )
PORT_START("IN0")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:1,2")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x01, DEF_STR( French ) )
PORT_DIPSETTING( 0x02, DEF_STR( German ) )
/* PORT_DIPSETTING( 0x03, DEF_STR( German ) ) */
- PORT_DIPNAME( 0x0c, 0x04, "Points to Win" ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:3,4")
+ PORT_DIPNAME( 0x0c, 0x04, "Points to Win" ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:3,4")
PORT_DIPSETTING( 0x00, "Game 1 = 25, Game 2 = 11" )
PORT_DIPSETTING( 0x04, "Game 1 = 35, Game 2 = 15" )
PORT_DIPSETTING( 0x08, "Game 1 = 40, Game 2 = 18" )
PORT_DIPSETTING( 0x0c, "Game 1 = 50, Game 2 = 21" )
- PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:5,6")
+ PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:5,6")
PORT_DIPSETTING( 0x30, "2 Coins per Player" )
PORT_DIPSETTING( 0x20, "2 Coins/1 or 2 Players" )
PORT_DIPSETTING( 0x10, "1 Coin per Player" )
PORT_DIPSETTING( 0x00, "1 Coin/1 or 2 Players" )
- PORT_DIPNAME( 0x40, 0x40, "Time Limit" ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("B3:7")
+ PORT_DIPNAME( 0x40, 0x40, "Time Limit" ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("B3:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "B3:8" )
@@ -2073,21 +2073,21 @@ static INPUT_PORTS_START( dogpatch )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x02, "Number of Cans" ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:1,2")
+ PORT_DIPNAME( 0x03, 0x02, "Number of Cans" ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:1,2")
PORT_DIPSETTING( 0x03, "10" )
PORT_DIPSETTING( 0x02, "15" )
PORT_DIPSETTING( 0x01, "20" )
PORT_DIPSETTING( 0x00, "25" )
- PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:3,4")
+ PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:3,4")
PORT_DIPSETTING( 0x08, "2 Coins per Player" )
PORT_DIPSETTING( 0x0c, "2 Coins/1 or 2 Players" )
PORT_DIPSETTING( 0x00, "1 Coin per Player" )
PORT_DIPSETTING( 0x04, "1 Coin/1 or 2 Players" )
- PORT_DIPNAME( 0x10, 0x10, "Extended Time Reward" ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x10, 0x10, "Extended Time Reward" ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
PORT_DIPSETTING( 0x10, "3 extra cans" )
PORT_DIPSETTING( 0x00, "5 extra cans" )
PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW:6" )
- PORT_DIPNAME( 0xc0, 0x40, "Extended Time At" ) PORT_CONDITION("IN2", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:7,8")
+ PORT_DIPNAME( 0xc0, 0x40, "Extended Time At" ) PORT_CONDITION("IN2", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:7,8")
PORT_DIPSETTING( 0xc0, "150" )
PORT_DIPSETTING( 0x80, "175" )
PORT_DIPSETTING( 0x40, "225" )
@@ -2234,12 +2234,12 @@ static INPUT_PORTS_START( spcenctr )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* marked as COIN #2, but the software never reads it */
PORT_START("IN2")
- PORT_DIPNAME( 0x03, 0x02, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x30, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("F3:1,2")
+ PORT_DIPNAME( 0x03, 0x02, DEF_STR( Bonus_Life ) ) PORT_CONDITION("IN2", 0x30, EQUALS, 0x00) PORT_DIPLOCATION("F3:1,2")
PORT_DIPSETTING( 0x00, "2000 4000 8000" )
PORT_DIPSETTING( 0x01, "3000 6000 12000" )
PORT_DIPSETTING( 0x02, "4000 8000 16000" )
PORT_DIPSETTING( 0x03, "5000 10000 20000" )
- PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:3,4")
+ PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:3,4")
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 2C_3C ) )
@@ -2249,7 +2249,7 @@ static INPUT_PORTS_START( spcenctr )
PORT_DIPSETTING( 0x30, "Bonus Off" )
PORT_DIPSETTING( 0x20, "Cross Hatch" )
PORT_DIPSETTING( 0x10, "Test Mode" )
- PORT_DIPNAME( 0xc0, 0x40, "Time" ) PORT_CONDITION("IN2", 0x30, PORTCOND_NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:7,8")
+ PORT_DIPNAME( 0xc0, 0x40, "Time" ) PORT_CONDITION("IN2", 0x30, NOTEQUALS, 0x10) PORT_DIPLOCATION("F3:7,8")
PORT_DIPSETTING( 0x00, "45" )
PORT_DIPSETTING( 0x40, "60" )
PORT_DIPSETTING( 0x80, "75" )
@@ -2329,25 +2329,25 @@ static INPUT_PORTS_START( phantom2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* not connected */
PORT_START("IN1")
- PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:1")
+ PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:1")
PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x06, 0x06, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:2,3")
+ PORT_DIPNAME( 0x06, 0x06, DEF_STR( Game_Time ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:2,3")
PORT_DIPSETTING( 0x00, "45 seconds + 20 extended (at 20 points)" )
PORT_DIPSETTING( 0x02, "60 seconds + 25 extended (at 25 points)" )
PORT_DIPSETTING( 0x04, "75 seconds + 30 extended (at 30 points)" )
PORT_DIPSETTING( 0x06, "90 seconds + 35 extended (at 35 points)" )
- PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:4")
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:4")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:5")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW:6" )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:7")
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, PORTCOND_EQUALS, 0x20) PORT_DIPLOCATION("SW:8")
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x20, EQUALS, 0x20) PORT_DIPLOCATION("SW:8")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
INPUT_PORTS_END
@@ -2452,24 +2452,24 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( bowler )
PORT_START("IN0")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:1,2")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:1,2")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x01, DEF_STR( French ) )
PORT_DIPSETTING( 0x02, DEF_STR( German ) )
/*PORT_DIPSETTING( 0x03, DEF_STR( German ) ) */
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:3")
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:3")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) ) /* every 17 minutes */
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:4")
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Game_Time ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:4")
PORT_DIPSETTING( 0x00, "No Limit" )
PORT_DIPSETTING( 0x08, "5 Minutes" )
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:5")
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:5")
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:6")
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:6")
PORT_DIPSETTING( 0x20, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_CONDITION("IN0", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("B3:7")
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_CONDITION("IN0", 0x80, EQUALS, 0x00) PORT_DIPLOCATION("B3:7")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, "Cocktail (not functional)" )
PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_HIGH, "B3:8" )
@@ -2534,7 +2534,7 @@ static MACHINE_START( invaders )
CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_coin_input_r)
{
- UINT32 ret = input_port_read(machine(), INVADERS_COIN_INPUT_PORT_TAG);
+ UINT32 ret = ioport(INVADERS_COIN_INPUT_PORT_TAG)->read();
coin_counter_w(machine(), 0, !ret);
@@ -2552,7 +2552,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_sw6_sw7_r)
if (invaders_is_cabinet_cocktail(machine()))
ret = 0x03;
else
- ret = input_port_read(machine(), INVADERS_SW6_SW7_PORT_TAG);
+ ret = ioport(INVADERS_SW6_SW7_PORT_TAG)->read();
return ret;
}
@@ -2568,7 +2568,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_sw5_r)
if (invaders_is_cabinet_cocktail(machine()))
ret = 0x01;
else
- ret = input_port_read(machine(), INVADERS_SW5_PORT_TAG);
+ ret = ioport(INVADERS_SW5_PORT_TAG)->read();
return ret;
}
@@ -2584,7 +2584,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in0_control_r)
if (invaders_is_cabinet_cocktail(machine()))
ret = 0x07;
else
- ret = input_port_read(machine(), INVADERS_P1_CONTROL_PORT_TAG);
+ ret = ioport(INVADERS_P1_CONTROL_PORT_TAG)->read();
return ret;
}
@@ -2592,7 +2592,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in0_control_r)
CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in1_control_r)
{
- return input_port_read(machine(), INVADERS_P1_CONTROL_PORT_TAG);
+ return ioport(INVADERS_P1_CONTROL_PORT_TAG)->read();
}
@@ -2604,9 +2604,9 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in2_control_r)
cocktail PCB: P2 controls */
if (invaders_is_cabinet_cocktail(machine()))
- ret = input_port_read(machine(), INVADERS_P2_CONTROL_PORT_TAG);
+ ret = ioport(INVADERS_P2_CONTROL_PORT_TAG)->read();
else
- ret = input_port_read(machine(), INVADERS_P1_CONTROL_PORT_TAG);
+ ret = ioport(INVADERS_P1_CONTROL_PORT_TAG)->read();
return ret;
}
@@ -2614,7 +2614,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in2_control_r)
int invaders_is_cabinet_cocktail(running_machine &machine)
{
- return input_port_read(machine, INVADERS_CAB_TYPE_PORT_TAG);
+ return machine.root_device().ioport(INVADERS_CAB_TYPE_PORT_TAG)->read();
}
@@ -2741,7 +2741,7 @@ MACHINE_CONFIG_END
CUSTOM_INPUT_MEMBER(mw8080bw_state::blueshrk_coin_input_r)
{
- UINT32 ret = input_port_read(machine(), BLUESHRK_COIN_INPUT_PORT_TAG);
+ UINT32 ret = ioport(BLUESHRK_COIN_INPUT_PORT_TAG)->read();
coin_counter_w(machine(), 0, !ret);
@@ -2770,14 +2770,14 @@ static INPUT_PORTS_START( blueshrk )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw8080bw_state,blueshrk_coin_input_r, NULL)
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW:3")
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT ) /* not shown on the schematics, instead DIP SW4 is connected here */
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x60, 0x40, "Replay" ) PORT_CONDITION("IN1", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW:6,7")
+ PORT_DIPNAME( 0x60, 0x40, "Replay" ) PORT_CONDITION("IN1", 0x80, EQUALS, 0x80) PORT_DIPLOCATION("SW:6,7")
PORT_DIPSETTING( 0x20, "14000" )
PORT_DIPSETTING( 0x40, "18000" )
PORT_DIPSETTING( 0x60, "22000" )
@@ -2820,7 +2820,7 @@ MACHINE_CONFIG_END
#ifdef UNUSED_FUNCTION
static UINT32 invad2ct_coin_input_r(void *param)
{
- UINT32 ret = input_port_read(machine, INVAD2CT_COIN_INPUT_PORT_TAG);
+ UINT32 ret = machine.root_device().ioport(INVAD2CT_COIN_INPUT_PORT_TAG)->read();
coin_counter_w(machine, 0, !ret);
diff --git a/src/mame/drivers/mwarr.c b/src/mame/drivers/mwarr.c
index e5d4568d192..d42e79b4bf3 100644
--- a/src/mame/drivers/mwarr.c
+++ b/src/mame/drivers/mwarr.c
@@ -243,7 +243,7 @@ static INPUT_PORTS_START( mwarr )
PORT_START("SYSTEM")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SPECIAL ) // otherwise it doesn't boot
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/mystston.c b/src/mame/drivers/mystston.c
index c6c122fee79..c9b0763d9c6 100644
--- a/src/mame/drivers/mystston.c
+++ b/src/mame/drivers/mystston.c
@@ -177,7 +177,7 @@ static INPUT_PORTS_START( mystston )
PORT_DIPNAME(0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index f564298824c..91f2b438f0b 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -63,7 +63,7 @@ READ16_MEMBER(mystwarr_state::eeprom_r)
{
if (ACCESSING_BITS_0_7)
{
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
// logerror("msb access to eeprom port\n");
@@ -75,7 +75,7 @@ WRITE16_MEMBER(mystwarr_state::mweeprom_w)
{
if (ACCESSING_BITS_8_15)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xffff);
+ ioport("EEPROMOUT")->write(data, 0xffff);
}
// logerror("unknown LSB write %x to eeprom\n", data);
@@ -86,17 +86,17 @@ READ16_MEMBER(mystwarr_state::dddeeprom_r)
{
if (ACCESSING_BITS_8_15)
{
- return input_port_read(machine(), "IN1") << 8;
+ return ioport("IN1")->read() << 8;
}
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
}
WRITE16_MEMBER(mystwarr_state::mmeeprom_w)
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
diff --git a/src/mame/drivers/namcofl.c b/src/mame/drivers/namcofl.c
index 08d8aa00757..61c7f6fc556 100644
--- a/src/mame/drivers/namcofl.c
+++ b/src/mame/drivers/namcofl.c
@@ -282,16 +282,16 @@ READ8_MEMBER(namcofl_state::port7_r)
switch (m_mcu_port6 & 0xf0)
{
case 0x00:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x20:
- return input_port_read(machine(), "MISC");
+ return ioport("MISC")->read();
case 0x40:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 0x60:
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
default:
break;
@@ -302,17 +302,17 @@ READ8_MEMBER(namcofl_state::port7_r)
READ8_MEMBER(namcofl_state::dac7_r)
{
- return input_port_read_safe(machine(), "ACCEL", 0xff);
+ return ioport("ACCEL")->read_safe(0xff);
}
READ8_MEMBER(namcofl_state::dac6_r)
{
- return input_port_read_safe(machine(), "BRAKE", 0xff);
+ return ioport("BRAKE")->read_safe(0xff);
}
READ8_MEMBER(namcofl_state::dac5_r)
{
- return input_port_read_safe(machine(), "WHEEL", 0xff);
+ return ioport("WHEEL")->read_safe(0xff);
}
READ8_MEMBER(namcofl_state::dac4_r){ return 0xff; }
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index 066ab34f354..92eacd8cef0 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -881,16 +881,16 @@ READ8_MEMBER(namcona1_state::port7_r)
switch (m_mcu_port6 & 0xe0)
{
case 0x40:
- return input_port_read(machine(), "P1");
+ return ioport("P1")->read();
case 0x60:
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
case 0x20:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 0x00:
- return input_port_read(machine(), "P4");
+ return ioport("P4")->read();
}
return 0xff;
@@ -940,7 +940,7 @@ static MACHINE_RESET( namcona1_mcu )
READ8_MEMBER(namcona1_state::portana_r)
{
static const UINT8 bitnum[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 };
- UINT8 port = input_port_read(machine(), "P3");
+ UINT8 port = ioport("P3")->read();
return (port & bitnum[offset>>1]) ? 0xff : 0x00;
}
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index 5f63eac3e53..61a1739cbee 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -813,10 +813,10 @@ READ32_MEMBER(namconb1_state::gunbulet_gun_r)
switch( offset )
{
- case 0: case 1: result = (UINT8)(0x0f + input_port_read(machine(), "LIGHT1_Y") * 224/255); break; /* Y (p2) */
- case 2: case 3: result = (UINT8)(0x26 + input_port_read(machine(), "LIGHT1_X") * 288/314); break; /* X (p2) */
- case 4: case 5: result = (UINT8)(0x0f + input_port_read(machine(), "LIGHT0_Y") * 224/255); break; /* Y (p1) */
- case 6: case 7: result = (UINT8)(0x26 + input_port_read(machine(), "LIGHT0_X") * 288/314); break; /* X (p1) */
+ case 0: case 1: result = (UINT8)(0x0f + ioport("LIGHT1_Y")->read() * 224/255); break; /* Y (p2) */
+ case 2: case 3: result = (UINT8)(0x26 + ioport("LIGHT1_X")->read() * 288/314); break; /* X (p2) */
+ case 4: case 5: result = (UINT8)(0x0f + ioport("LIGHT0_Y")->read() * 224/255); break; /* Y (p1) */
+ case 6: case 7: result = (UINT8)(0x26 + ioport("LIGHT0_X")->read() * 288/314); break; /* X (p1) */
}
return result<<24;
} /* gunbulet_gun_r */
@@ -932,16 +932,16 @@ READ8_MEMBER(namconb1_state::port7_r)
switch (m_nbx_port6 & 0xf0)
{
case 0x00:
- return input_port_read_safe(machine(), "P4", 0xff);
+ return ioport("P4")->read_safe(0xff);
case 0x20:
- return input_port_read(machine(), "MISC");
+ return ioport("MISC")->read();
case 0x40:
- return input_port_read(machine(), "P1");
+ return ioport("P1")->read();
case 0x60:
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
default:
break;
@@ -955,42 +955,42 @@ READ8_MEMBER(namconb1_state::port7_r)
// register full scale, so it works...
READ8_MEMBER(namconb1_state::dac7_r)// bit 7
{
- return input_port_read_safe(machine(), "P3", 0xff)&0x80;
+ return ioport("P3")->read_safe(0xff)&0x80;
}
READ8_MEMBER(namconb1_state::dac6_r)// bit 3
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<1)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<1)&0x80;
}
READ8_MEMBER(namconb1_state::dac5_r)// bit 2
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<2)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<2)&0x80;
}
READ8_MEMBER(namconb1_state::dac4_r)// bit 1
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<3)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<3)&0x80;
}
READ8_MEMBER(namconb1_state::dac3_r)// bit 0
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<4)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<4)&0x80;
}
READ8_MEMBER(namconb1_state::dac2_r)// bit 4
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<5)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<5)&0x80;
}
READ8_MEMBER(namconb1_state::dac1_r)// bit 5
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<6)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<6)&0x80;
}
READ8_MEMBER(namconb1_state::dac0_r)// bit 6
{
- return (input_port_read_safe(machine(), "P3", 0xff)<<7)&0x80;
+ return (ioport("P3")->read_safe(0xff)<<7)&0x80;
}
static ADDRESS_MAP_START( namcoc75_io, AS_IO, 8, namconb1_state )
diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c
index 969dd5a4fb2..54a2e6225b2 100644
--- a/src/mame/drivers/namcos1.c
+++ b/src/mame/drivers/namcos1.c
@@ -369,7 +369,7 @@ WRITE8_MEMBER(namcos1_state::firq_ack_w)
READ8_MEMBER(namcos1_state::dsw_r)
{
- int ret = input_port_read(machine(), "DIPSW");
+ int ret = ioport("DIPSW")->read();
if (!(offset & 2)) ret >>= 4;
return 0xf0 | ret;
}
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index 6be4e052102..74a005513b2 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -495,7 +495,7 @@ ADDRESS_MAP_END
static void memn_driver_init( running_machine &machine )
{
namcos10_state *state = machine.driver_data<namcos10_state>();
- UINT8 *BIOS = (UINT8 *)machine.root_device().memregion( "user1" )->base();
+ UINT8 *BIOS = (UINT8 *)state->memregion( "user1" )->base();
state->nand_base = (UINT8 *)state->memregion( "user2" )->base();
state->nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index 3aa18febbc5..8691e16852c 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -696,16 +696,16 @@ READ32_MEMBER(namcos11_state::lightgun_r)
switch( offset )
{
case 0:
- data = input_port_read( machine(), "GUN1X" );
+ data = ioport( "GUN1X" )->read();
break;
case 1:
- data = ( input_port_read( machine(), "GUN1Y" ) ) | ( ( input_port_read( machine(), "GUN1Y" ) + 1 ) << 16 );
+ data = ( ioport( "GUN1Y" )->read() ) | ( ( ioport( "GUN1Y" )->read() + 1 ) << 16 );
break;
case 2:
- data = input_port_read( machine(), "GUN2X" );
+ data = ioport( "GUN2X" )->read();
break;
case 3:
- data = ( input_port_read( machine(), "GUN2Y" ) ) | ( ( input_port_read( machine(), "GUN2Y" ) + 1 ) << 16 );
+ data = ( ioport( "GUN2Y" )->read() ) | ( ( ioport( "GUN2Y" )->read() + 1 ) << 16 );
break;
}
verboselog( machine(), 2, "lightgun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
@@ -750,16 +750,16 @@ READ16_MEMBER(namcos11_state::c76_inputs_r)
switch (offset)
{
case 0:
- return input_port_read(machine(), "PLAYER4");
+ return ioport("PLAYER4")->read();
case 1:
- return input_port_read(machine(), "SWITCH");
+ return ioport("SWITCH")->read();
case 2:
- return input_port_read(machine(), "PLAYER1");
+ return ioport("PLAYER1")->read();
case 3:
- return input_port_read(machine(), "PLAYER2");
+ return ioport("PLAYER2")->read();
}
return 0xff;
@@ -779,52 +779,52 @@ ADDRESS_MAP_END
READ8_MEMBER(namcos11_state::dac7_r)// bit 7
{
- return input_port_read_safe(machine(), "PLAYER3", 0xff)&0x80;
+ return ioport("PLAYER3")->read_safe(0xff)&0x80;
}
READ8_MEMBER(namcos11_state::dac6_r)// bit 3
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<4)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<4)&0x80;
}
READ8_MEMBER(namcos11_state::dac5_r)// bit 2
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<5)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<5)&0x80;
}
READ8_MEMBER(namcos11_state::dac4_r)// bit 1
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<6)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<6)&0x80;
}
READ8_MEMBER(namcos11_state::dac3_r)// bit 0
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<7)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<7)&0x80;
}
READ8_MEMBER(namcos11_state::dac2_r)// bit 4
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<3)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<3)&0x80;
}
READ8_MEMBER(namcos11_state::dac1_r)// bit 5
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<2)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<2)&0x80;
}
READ8_MEMBER(namcos11_state::dac0_r)// bit 6
{
- return (input_port_read_safe(machine(), "PLAYER3", 0xff)<<1)&0x80;
+ return (ioport("PLAYER3")->read_safe(0xff)<<1)&0x80;
}
READ8_MEMBER(namcos11_state::pocketrc_gas_r)
{
- return input_port_read(machine(), "GAS");
+ return ioport("GAS")->read();
}
READ8_MEMBER(namcos11_state::pocketrc_steer_r)
{
- return input_port_read(machine(), "STEERING");
+ return ioport("STEERING")->read();
}
ADDRESS_MAP_START( c76_io_map, AS_IO, 8, namcos11_state )
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index dd061e8f802..754ae662fa4 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1296,16 +1296,16 @@ READ32_MEMBER(namcos12_state::system11gun_r)
switch( offset )
{
case 0:
- data = input_port_read(machine(), "LIGHT0_X");
+ data = ioport("LIGHT0_X")->read();
break;
case 1:
- data = ( input_port_read(machine(), "LIGHT0_Y") ) | ( ( input_port_read(machine(), "LIGHT0_Y") + 1 ) << 16 );
+ data = ( ioport("LIGHT0_Y")->read() ) | ( ( ioport("LIGHT0_Y")->read() + 1 ) << 16 );
break;
case 2:
- data = input_port_read(machine(), "LIGHT1_X");
+ data = ioport("LIGHT1_X")->read();
break;
case 3:
- data = ( input_port_read(machine(), "LIGHT1_Y") ) | ( ( input_port_read(machine(), "LIGHT1_Y") + 1 ) << 16 );
+ data = ( ioport("LIGHT1_Y")->read() ) | ( ( ioport("LIGHT1_Y")->read() + 1 ) << 16 );
break;
}
verboselog( machine(), 2, "system11gun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
@@ -1573,10 +1573,10 @@ WRITE8_MEMBER(namcos12_state::s12_mcu_settings_w)
READ8_MEMBER(namcos12_state::s12_mcu_gun_h_r)
{
- const input_port_config *port = ioport("LIGHT0_X");
+ ioport_port *port = ioport("LIGHT0_X");
if( port != NULL )
{
- int rv = input_port_read_direct( port ) << 6;
+ int rv = port->read() << 6;
if( ( offset & 1 ) != 0 )
{
@@ -1592,10 +1592,10 @@ READ8_MEMBER(namcos12_state::s12_mcu_gun_h_r)
READ8_MEMBER(namcos12_state::s12_mcu_gun_v_r)
{
- const input_port_config *port = ioport("LIGHT0_Y");
+ ioport_port *port = ioport("LIGHT0_Y");
if( port != NULL )
{
- int rv = input_port_read_direct( port ) << 6;
+ int rv = port->read() << 6;
if( ( offset & 1 ) != 0 )
{
@@ -1627,7 +1627,7 @@ static DRIVER_INIT( namcos12 )
psx_driver_init(machine);
- state->membank("bank1")->configure_entries(0, machine.root_device().memregion( "user2" )->bytes() / 0x200000, state->memregion( "user2" )->base(), 0x200000 );
+ state->membank("bank1")->configure_entries(0, state->memregion( "user2" )->bytes() / 0x200000, state->memregion( "user2" )->base(), 0x200000 );
state->m_s12_porta = 0;
state->m_s12_rtcstate = 0;
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index af8e57f18f5..0cbf0811cf3 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -2257,7 +2257,7 @@ static void namcos21_init( running_machine &machine, int game_type )
static DRIVER_INIT( winrun )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
+ UINT16 *pMem = (UINT16 *)state->memregion("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
@@ -2301,7 +2301,7 @@ static DRIVER_INIT( solvalou )
static DRIVER_INIT( driveyes )
{
namcos21_state *state = machine.driver_data<namcos21_state>();
- UINT16 *pMem = (UINT16 *)machine.root_device().memregion("dsp")->base();
+ UINT16 *pMem = (UINT16 *)state->memregion("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index 9f44243bfe8..36262bf352d 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -1183,9 +1183,9 @@ nthbyte( const UINT32 *pSource, int offs )
static void
ReadAnalogDrivingPorts( running_machine &machine, UINT16 *gas, UINT16 *brake, UINT16 *steer )
{
- *gas = input_port_read(machine, "GAS");
- *brake = input_port_read(machine, "BRAKE");
- *steer = input_port_read(machine, "STEER");
+ *gas = machine.root_device().ioport("GAS")->read();
+ *brake = machine.root_device().ioport("BRAKE")->read();
+ *steer = machine.root_device().ioport("STEER")->read();
}
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
@@ -1193,9 +1193,9 @@ static UINT16
AnalogAsDigital( running_machine &machine )
{
namcos22_state *state = machine.driver_data<namcos22_state>();
- UINT16 inputs = input_port_read_safe(machine, "INPUTS", 0);
- UINT16 gas = input_port_read_safe(machine, "GAS", 0);
- UINT16 steer = input_port_read_safe(machine, "STEER", 0);
+ UINT16 inputs = state->ioport("INPUTS")->read_safe(0);
+ UINT16 gas = state->ioport("GAS")->read_safe(0);
+ UINT16 steer = state->ioport("STEER")->read_safe(0);
UINT16 result = 0xffff;
switch( state->m_gametype )
@@ -1248,7 +1248,7 @@ HandleCoinage(running_machine &machine, int slots, int address_is_odd)
UINT16 *share16 = (UINT16 *)state->m_shareram.target();
UINT32 coin_state;
- coin_state = input_port_read(machine, "INPUTS") & 0x1200;
+ coin_state = state->ioport("INPUTS")->read() & 0x1200;
if (!(coin_state & 0x1000) && (state->m_old_coin_state & 0x1000))
{
@@ -1277,7 +1277,7 @@ HandleDrivingIO( running_machine &machine )
namcos22_state *state = machine.driver_data<namcos22_state>();
if( nthbyte(state->m_system_controller, 0x18) != 0 )
{
- UINT16 flags = input_port_read(machine, "INPUTS");
+ UINT16 flags = state->ioport("INPUTS")->read();
UINT16 gas, brake, steer, coinram_address_is_odd = 0;
ReadAnalogDrivingPorts( machine, &gas, &brake, &steer );
@@ -1335,12 +1335,12 @@ HandleCyberCommandoIO( running_machine &machine )
namcos22_state *state = machine.driver_data<namcos22_state>();
if( nthbyte(state->m_system_controller, 0x18) != 0 )
{
- UINT16 flags = input_port_read(machine, "INPUTS");
+ UINT16 flags = state->ioport("INPUTS")->read();
- UINT16 volume0 = input_port_read(machine, "STICKY1") * 0x10;
- UINT16 volume1 = input_port_read(machine, "STICKY2") * 0x10;
- UINT16 volume2 = input_port_read(machine, "STICKX1") * 0x10;
- UINT16 volume3 = input_port_read(machine, "STICKX2") * 0x10;
+ UINT16 volume0 = state->ioport("STICKY1")->read() * 0x10;
+ UINT16 volume1 = state->ioport("STICKY2")->read() * 0x10;
+ UINT16 volume2 = state->ioport("STICKX1")->read() * 0x10;
+ UINT16 volume3 = state->ioport("STICKX2")->read() * 0x10;
state->m_shareram[0x030/4] = (flags<<16) | volume0;
state->m_shareram[0x034/4] = (volume1<<16) | volume2;
@@ -2421,7 +2421,7 @@ WRITE32_MEMBER(namcos22_state::namcos22_portbit_w)
READ32_MEMBER(namcos22_state::namcos22_dipswitch_r)
{
- return input_port_read(machine(), "DSW0")<<16;
+ return ioport("DSW0")->read()<<16;
}
READ32_MEMBER(namcos22_state::namcos22_mcuram_r)
@@ -2436,8 +2436,8 @@ WRITE32_MEMBER(namcos22_state::namcos22_mcuram_w)
READ32_MEMBER(namcos22_state::namcos22_gun_r)
{
- int xpos = input_port_read_safe(machine(), "LIGHTX", 0) * 640 / 0xff;
- int ypos = input_port_read_safe(machine(), "LIGHTY", 0) * 240 / 0xff + 0x10;
+ int xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff;
+ int ypos = ioport("LIGHTY")->read_safe(0) * 240 / 0xff + 0x10;
switch( offset )
{
case 0: /* 430000 */
@@ -2626,9 +2626,9 @@ READ8_MEMBER(namcos22_state::mcu_port5_r)
{
if (m_p4 & 8)
- return input_port_read_safe(machine(), "MCUP5A", 0xff);
+ return ioport("MCUP5A")->read_safe(0xff);
else
- return input_port_read_safe(machine(), "MCUP5B", 0xff);
+ return ioport("MCUP5B")->read_safe(0xff);
}
WRITE8_MEMBER(namcos22_state::mcu_port6_w)
@@ -2666,9 +2666,9 @@ READ8_MEMBER(namcos22_state::propcycle_mcu_adc_r)
// H+L = horizontal, 1 H+L = vertical
UINT16 ddx, ddy;
- ddx = input_port_read(machine(), "STICKX");
+ ddx = ioport("STICKX")->read();
if (ddx > 0) ddx -= 1;
- ddy = input_port_read(machine(), "STICKY");
+ ddy = ioport("STICKY")->read();
if (ddy > 0) ddy -= 1;
ddx <<= 2;
@@ -2685,7 +2685,7 @@ READ8_MEMBER(namcos22_state::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( input_port_read(machine(), "JOY") & 0x10 )
+ if( ioport("JOY")->read() & 0x10 )
{
int i;
for (i = 0; i < 16; i++)
@@ -2739,8 +2739,8 @@ WRITE8_MEMBER(namcos22_state::alpine_mcu_port5_w)
READ8_MEMBER(namcos22_state::alpineracer_mcu_adc_r)
{
// 0 H+L = swing, 1 H+L = edge
- UINT16 swing = input_port_read(machine(), "SWING")<<2;
- UINT16 edge = input_port_read(machine(), "EDGE" )<<2;
+ UINT16 swing = ioport("SWING")->read()<<2;
+ UINT16 edge = ioport("EDGE" )->read()<<2;
switch (offset)
{
@@ -2833,9 +2833,9 @@ READ8_MEMBER(namcos22_state::aquajet_mcu_adc_r)
{
UINT16 gas, steer, ddy;
- gas = input_port_read(machine(), "GAS") ^ 0x7f;
- steer = input_port_read(machine(), "STEER") ^ 0xff;
- ddy = input_port_read(machine(), "STICKY");
+ gas = ioport("GAS")->read() ^ 0x7f;
+ steer = ioport("STEER")->read() ^ 0xff;
+ ddy = ioport("STICKY")->read();
if (ddy > 0) ddy -= 1;
gas <<= 2;
@@ -2877,9 +2877,9 @@ READ8_MEMBER(namcos22_state::airco22_mcu_adc_r)
{
UINT16 pedal, x, y;
- pedal = input_port_read(machine(), "PEDAL")<<2;
- x = input_port_read(machine(), "STICKX")<<2;
- y = input_port_read(machine(), "STICKY")<<2;
+ pedal = ioport("PEDAL")->read()<<2;
+ x = ioport("STICKX")->read()<<2;
+ y = ioport("STICKY")->read()<<2;
switch (offset)
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index ab89fd76360..bd700ed357a 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -1705,7 +1705,7 @@ WRITE16_MEMBER(namcos23_state::s23_ctl_w)
case 2: case 3:
// These may be coming from another CPU, in particular the I/O one
- m_ctl_inp_buffer[offset-2] = input_port_read(machine(), offset == 2 ? "P1" : "P2");
+ m_ctl_inp_buffer[offset-2] = ioport(offset == 2 ? "P1" : "P2")->read();
break;
case 5:
if(m_ctl_vbl_active) {
@@ -1728,7 +1728,7 @@ READ16_MEMBER(namcos23_state::s23_ctl_r)
{
switch(offset) {
// 0100 set freezes gorgon (polygon fifo flag)
- case 1: return 0x0000 | input_port_read(machine(), "DSW");
+ case 1: return 0x0000 | ioport("DSW")->read();
case 2: case 3: {
UINT16 res = m_ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000;
m_ctl_inp_buffer[offset-2] = (m_ctl_inp_buffer[offset-2] << 1) | 1;
@@ -2992,8 +2992,8 @@ WRITE8_MEMBER(namcos23_state::s23_iob_p4_w)
READ8_MEMBER(namcos23_state::s23_gun_r)
{
- UINT16 xpos = input_port_read_safe(machine(), "LIGHTX", 0) * 640 / 0xff + 0x80;
- UINT16 ypos = input_port_read_safe(machine(), "LIGHTY", 0) * 240 / 0xff + 0x20;
+ UINT16 xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff + 0x80;
+ UINT16 ypos = ioport("LIGHTY")->read_safe(0) * 240 / 0xff + 0x20;
// note: will need angle adjustments for accurate aiming at screen sides
switch(offset)
@@ -3070,13 +3070,13 @@ static DRIVER_INIT(ss23)
{
namcos23_state *state = machine.driver_data<namcos23_state>();
render_t &render = state->m_render;
- state->m_ptrom = (const UINT32 *)machine.root_device().memregion("pointrom")->base();
- state->m_tmlrom = (const UINT16 *)machine.root_device().memregion("textilemapl")->base();
- state->m_tmhrom = machine.root_device().memregion("textilemaph")->base();
- state->m_texrom = machine.root_device().memregion("textile")->base();
+ state->m_ptrom = (const UINT32 *)state->memregion("pointrom")->base();
+ state->m_tmlrom = (const UINT16 *)state->memregion("textilemapl")->base();
+ state->m_tmhrom = state->memregion("textilemaph")->base();
+ state->m_texrom = state->memregion("textile")->base();
- state->m_tileid_mask = (machine.root_device().memregion("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
- state->m_tile_mask = machine.root_device().memregion("textile")->bytes()/256 - 1;
+ state->m_tileid_mask = (state->memregion("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
+ state->m_tile_mask = state->memregion("textile")->bytes()/256 - 1;
state->m_ptrom_limit = state->memregion("pointrom")->bytes()/4;
state->m_mi_rd = state->m_mi_wr = state->m_im_rd = state->m_im_wr = 0;
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index cff065b6cde..2fb0d09b05b 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -214,15 +214,15 @@ READ8_MEMBER(namcos86_state::dsw0_r)
{
int rhi, rlo;
- 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;
+ rhi = ( ioport("DSWA")->read() & 0x01 ) << 4;
+ rhi |= ( ioport("DSWA")->read() & 0x04 ) << 3;
+ rhi |= ( ioport("DSWA")->read() & 0x10 ) << 2;
+ rhi |= ( ioport("DSWA")->read() & 0x40 ) << 1;
- 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;
+ rlo = ( ioport("DSWB")->read() & 0x01 );
+ rlo |= ( ioport("DSWB")->read() & 0x04 ) >> 1;
+ rlo |= ( ioport("DSWB")->read() & 0x10 ) >> 2;
+ rlo |= ( ioport("DSWB")->read() & 0x40 ) >> 3;
return rhi | rlo;
}
@@ -231,15 +231,15 @@ READ8_MEMBER(namcos86_state::dsw1_r)
{
int rhi, rlo;
- 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 );
+ rhi = ( ioport("DSWA")->read() & 0x02 ) << 3;
+ rhi |= ( ioport("DSWA")->read() & 0x08 ) << 2;
+ rhi |= ( ioport("DSWA")->read() & 0x20 ) << 1;
+ rhi |= ( ioport("DSWA")->read() & 0x80 );
- 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;
+ rlo = ( ioport("DSWB")->read() & 0x02 ) >> 1;
+ rlo |= ( ioport("DSWB")->read() & 0x08 ) >> 2;
+ rlo |= ( ioport("DSWB")->read() & 0x20 ) >> 3;
+ rlo |= ( ioport("DSWB")->read() & 0x80 ) >> 4;
return rhi | rlo;
}
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index 441a2566132..603ecf94204 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -1726,7 +1726,7 @@ static READ64_HANDLER( aw_modem_r )
if (reg == 0x280/4)
{
- UINT32 coins = input_port_read(space->machine(), "COINS");
+ UINT32 coins = space->machine().root_device().ioport("COINS")->read();
if (coins & 0x01)
{
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index f496e150aae..1dcdaa09b34 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -112,14 +112,14 @@ TODO:
READ8_MEMBER(naughtyb_state::in0_port_r)
{
- int in0 = input_port_read(machine(), "IN0");
+ int in0 = ioport("IN0")->read();
if ( m_cocktail )
{
// cabinet == cocktail -AND- handling player 2
in0 = ( in0 & 0x03 ) | // start buttons
- ( input_port_read(machine(), "IN0_COCKTAIL") & 0xFC ); // cocktail inputs
+ ( ioport("IN0_COCKTAIL")->read() & 0xFC ); // cocktail inputs
}
return in0;
@@ -129,8 +129,8 @@ READ8_MEMBER(naughtyb_state::dsw0_port_r)
{
// vblank replaces the cabinet dip
- return ( ( input_port_read(machine(), "DSW0") & 0x7F ) | // dsw0
- ( input_port_read(machine(), "FAKE") & 0x80 ) ); // vblank
+ return ( ( ioport("DSW0")->read() & 0x7F ) | // dsw0
+ ( ioport("FAKE")->read() & 0x80 ) ); // vblank
}
/* Pop Flamer
@@ -331,7 +331,7 @@ static INPUT_PORTS_START( naughtyb )
PORT_START( "FAKE" )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, naughtyb_state,coin_inserted, 0)
// when reading DSW0, bit 7 doesn't read cabinet, but vblank
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( trvmstr )
@@ -379,7 +379,7 @@ static INPUT_PORTS_START( trvmstr )
PORT_START( "FAKE" )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, naughtyb_state,coin_inserted, 0)
// when reading DSW0, bit 7 doesn't read cabinet, but vblank
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index bdaef15756a..1d967f9f5a2 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -72,7 +72,7 @@ WRITE8_MEMBER(nbmj9195_state::nbmj9195_inputportsel_w)
static int nbmj9195_dipsw_r(running_machine &machine)
{
nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
- return ((((input_port_read(machine, "DSWA") & 0xff) | ((input_port_read(machine, "DSWB") & 0xff) << 8)) >> state->m_dipswbitsel) & 0x01);
+ return (((state->ioport("DSWA")->read() & 0xff) | ((state->ioport("DSWB")->read() & 0xff) << 8)) >> state->m_dipswbitsel) & 0x01;
}
static void nbmj9195_dipswbitsel_w(address_space *space, int data)
@@ -104,19 +104,19 @@ static void mscoutm_inputportsel_w(address_space *space, int data)
READ8_MEMBER(nbmj9195_state::mscoutm_dipsw_0_r)
{
// DIPSW A
- return (((input_port_read(machine(), "DSWA") & 0x01) << 7) | ((input_port_read(machine(), "DSWA") & 0x02) << 5) |
- ((input_port_read(machine(), "DSWA") & 0x04) << 3) | ((input_port_read(machine(), "DSWA") & 0x08) << 1) |
- ((input_port_read(machine(), "DSWA") & 0x10) >> 1) | ((input_port_read(machine(), "DSWA") & 0x20) >> 3) |
- ((input_port_read(machine(), "DSWA") & 0x40) >> 5) | ((input_port_read(machine(), "DSWA") & 0x80) >> 7));
+ return (((ioport("DSWA")->read() & 0x01) << 7) | ((ioport("DSWA")->read() & 0x02) << 5) |
+ ((ioport("DSWA")->read() & 0x04) << 3) | ((ioport("DSWA")->read() & 0x08) << 1) |
+ ((ioport("DSWA")->read() & 0x10) >> 1) | ((ioport("DSWA")->read() & 0x20) >> 3) |
+ ((ioport("DSWA")->read() & 0x40) >> 5) | ((ioport("DSWA")->read() & 0x80) >> 7));
}
READ8_MEMBER(nbmj9195_state::mscoutm_dipsw_1_r)
{
// DIPSW B
- return (((input_port_read(machine(), "DSWB") & 0x01) << 7) | ((input_port_read(machine(), "DSWB") & 0x02) << 5) |
- ((input_port_read(machine(), "DSWB") & 0x04) << 3) | ((input_port_read(machine(), "DSWB") & 0x08) << 1) |
- ((input_port_read(machine(), "DSWB") & 0x10) >> 1) | ((input_port_read(machine(), "DSWB") & 0x20) >> 3) |
- ((input_port_read(machine(), "DSWB") & 0x40) >> 5) | ((input_port_read(machine(), "DSWB") & 0x80) >> 7));
+ return (((ioport("DSWB")->read() & 0x01) << 7) | ((ioport("DSWB")->read() & 0x02) << 5) |
+ ((ioport("DSWB")->read() & 0x04) << 3) | ((ioport("DSWB")->read() & 0x08) << 1) |
+ ((ioport("DSWB")->read() & 0x10) >> 1) | ((ioport("DSWB")->read() & 0x20) >> 3) |
+ ((ioport("DSWB")->read() & 0x40) >> 5) | ((ioport("DSWB")->read() & 0x80) >> 7));
}
@@ -136,30 +136,30 @@ READ8_MEMBER(nbmj9195_state::tmpz84c011_pio_r)
{
case 0: /* PA_0 */
// COIN IN, ETC...
- portdata = input_port_read(machine(), "SYSTEM");
+ portdata = ioport("SYSTEM")->read();
break;
case 1: /* PB_0 */
// PLAYER1 KEY, DIPSW A/B
switch (m_mscoutm_inputport)
{
case 0x01:
- portdata = input_port_read(machine(), "KEY0");
+ portdata = ioport("KEY0")->read();
break;
case 0x02:
- portdata = input_port_read(machine(), "KEY1");
+ portdata = ioport("KEY1")->read();
break;
case 0x04:
- portdata = input_port_read(machine(), "KEY2");
+ portdata = ioport("KEY2")->read();
break;
case 0x08:
- portdata = input_port_read(machine(), "KEY3");
+ portdata = ioport("KEY3")->read();
break;
case 0x10:
- portdata = input_port_read(machine(), "KEY4");
+ portdata = ioport("KEY4")->read();
break;
default:
- portdata = (input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") & input_port_read(machine(), "KEY2")
- & input_port_read(machine(), "KEY3") & input_port_read(machine(), "KEY4"));
+ portdata = (ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read()
+ & ioport("KEY3")->read() & ioport("KEY4")->read());
break;
}
break;
@@ -168,23 +168,23 @@ READ8_MEMBER(nbmj9195_state::tmpz84c011_pio_r)
switch (m_mscoutm_inputport)
{
case 0x01:
- portdata = input_port_read(machine(), "KEY5");
+ portdata = ioport("KEY5")->read();
break;
case 0x02:
- portdata = input_port_read(machine(), "KEY6");
+ portdata = ioport("KEY6")->read();
break;
case 0x04:
- portdata = input_port_read(machine(), "KEY7");
+ portdata = ioport("KEY7")->read();
break;
case 0x08:
- portdata = input_port_read(machine(), "KEY8");
+ portdata = ioport("KEY8")->read();
break;
case 0x10:
- portdata = input_port_read(machine(), "KEY9");
+ portdata = ioport("KEY9")->read();
break;
default:
- portdata = (input_port_read(machine(), "KEY5") & input_port_read(machine(), "KEY6") & input_port_read(machine(), "KEY7")
- & input_port_read(machine(), "KEY8") & input_port_read(machine(), "KEY9"));
+ portdata = (ioport("KEY5")->read() & ioport("KEY6")->read() & ioport("KEY7")->read()
+ & ioport("KEY8")->read() & ioport("KEY9")->read());
break;
}
break;
@@ -223,29 +223,29 @@ READ8_MEMBER(nbmj9195_state::tmpz84c011_pio_r)
{
case 0: /* PA_0 */
// COIN IN, ETC...
- portdata = ((input_port_read(machine(), "SYSTEM") & 0xfe) | m_outcoin_flag);
+ portdata = ((ioport("SYSTEM")->read() & 0xfe) | m_outcoin_flag);
break;
case 1: /* PB_0 */
// PLAYER1 KEY, DIPSW A/B
switch (m_inputport)
{
case 0x01:
- portdata = input_port_read(machine(), "KEY0");
+ portdata = ioport("KEY0")->read();
break;
case 0x02:
- portdata = input_port_read(machine(), "KEY1");
+ portdata = ioport("KEY1")->read();
break;
case 0x04:
- portdata = input_port_read(machine(), "KEY2");
+ portdata = ioport("KEY2")->read();
break;
case 0x08:
- portdata = input_port_read(machine(), "KEY3");
+ portdata = ioport("KEY3")->read();
break;
case 0x10:
- portdata = ((input_port_read(machine(), "KEY4") & 0x7f) | (nbmj9195_dipsw_r(machine()) << 7));
+ portdata = ((ioport("KEY4")->read() & 0x7f) | (nbmj9195_dipsw_r(machine()) << 7));
break;
default:
- portdata = (input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") & input_port_read(machine(), "KEY2") & input_port_read(machine(), "KEY3") & (input_port_read(machine(), "KEY4") & 0x7f));
+ portdata = (ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read() & ioport("KEY3")->read() & (ioport("KEY4")->read() & 0x7f));
break;
}
break;
@@ -254,22 +254,22 @@ READ8_MEMBER(nbmj9195_state::tmpz84c011_pio_r)
switch (m_inputport)
{
case 0x01:
- portdata = input_port_read(machine(), "KEY5");
+ portdata = ioport("KEY5")->read();
break;
case 0x02:
- portdata = input_port_read(machine(), "KEY6");
+ portdata = ioport("KEY6")->read();
break;
case 0x04:
- portdata = input_port_read(machine(), "KEY7");
+ portdata = ioport("KEY7")->read();
break;
case 0x08:
- portdata = input_port_read(machine(), "KEY8");
+ portdata = ioport("KEY8")->read();
break;
case 0x10:
- portdata = input_port_read(machine(), "KEY9") & 0x7f;
+ portdata = ioport("KEY9")->read() & 0x7f;
break;
default:
- portdata = (input_port_read(machine(), "KEY5") & input_port_read(machine(), "KEY6") & input_port_read(machine(), "KEY7") & input_port_read(machine(), "KEY8") & (input_port_read(machine(), "KEY9") & 0x7f));
+ portdata = (ioport("KEY5")->read() & ioport("KEY6")->read() & ioport("KEY7")->read() & ioport("KEY8")->read() & (ioport("KEY9")->read() & 0x7f));
break;
}
break;
diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c
index 93444a321a5..a667a0b2785 100644
--- a/src/mame/drivers/nemesis.c
+++ b/src/mame/drivers/nemesis.c
@@ -198,8 +198,8 @@ READ16_MEMBER(nemesis_state::konamigt_input_word_r)
bit 12-15: accel
*/
- int data = input_port_read(machine(), "IN3");
- int data2 = input_port_read(machine(), "PADDLE");
+ int data = ioport("IN3")->read();
+ int data2 = ioport("PADDLE")->read();
int ret=0x0000;
@@ -228,10 +228,10 @@ READ16_MEMBER(nemesis_state::selected_ip_word_r)
switch (m_selected_ip & 0xf)
{ // From WEC Le Mans Schems:
- case 0xc: return input_port_read(machine(), "ACCEL"); // Accel - Schems: Accelevr
- case 0: return input_port_read(machine(), "ACCEL");
- case 0xd: return input_port_read(machine(), "WHEEL"); // Wheel - Schems: Handlevr
- case 1: return input_port_read(machine(), "WHEEL");
+ case 0xc: return ioport("ACCEL")->read(); // Accel - Schems: Accelevr
+ case 0: return ioport("ACCEL")->read();
+ case 0xd: return ioport("WHEEL")->read(); // Wheel - Schems: Handlevr
+ case 1: return ioport("WHEEL")->read();
default: return ~0;
}
@@ -1281,8 +1281,8 @@ static INPUT_PORTS_START( hcrash )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x02) // only in WEC Le Mans 24 cabinets
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x02) // player 2?
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x02) // only in WEC Le Mans 24 cabinets
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x02) // player 2?
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) // must be 0 otherwise game freezes when using WEC Le Mans 24 cabinet
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
@@ -1329,8 +1329,8 @@ static INPUT_PORTS_START( hcrash )
PORT_BIT( 0x7f, 0x40, IPT_PADDLE ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
PORT_START("IN3")
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01) // only in Konami GT cabinet with brake
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01) // only in Konami GT cabinet with brake
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
// PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 0c83802540d..cc1a2cc95f7 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -9559,7 +9559,7 @@ static DRIVER_INIT( mslug5 )
static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
{
- int harddip3 = input_port_read(machine, "HARDDIP") & 1;
+ int harddip3 = machine.root_device().ioport("HARDDIP")->read() & 1;
machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
@@ -9596,7 +9596,7 @@ static DRIVER_INIT( ms5plus )
static TIMER_CALLBACK( svcpcb_bios_timer_callback )
{
- int harddip3 = input_port_read(machine, "HARDDIP") & 1;
+ int harddip3 = machine.root_device().ioport("HARDDIP")->read() & 1;
machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 9694f86d028..84c943a89ef 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -391,7 +391,7 @@ CUSTOM_INPUT_MEMBER(neogeo_state::multiplexed_controller_r)
{ "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" }
};
- return input_port_read_safe(machine(), cntrl[port][m_controller_select & 0x01], 0x00);
+ return ioport(cntrl[port][m_controller_select & 0x01])->read_safe(0x00);
}
#if 1 // this needs to be added dynamically somehow
@@ -410,10 +410,10 @@ cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF
{
default:
case 0x00: ret = 0x0000; break; /* nothing? */
- 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;
+ case 0x09: ret = ioport("MAHJONG1")->read(); break;
+ case 0x12: ret = ioport("MAHJONG2")->read(); break;
+ case 0x1b: ret = ioport("MAHJONG3")->read(); break; /* player 1 normal inputs? */
+ case 0x24: ret = ioport("MAHJONG4")->read(); break;
}
return ret;
@@ -800,12 +800,12 @@ static void audio_cpu_banking_init( running_machine &machine )
UINT32 address_mask;
/* audio bios/cartridge selection */
- if (machine.root_device().memregion("audiobios")->base())
- state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, machine.root_device().memregion("audiobios")->base());
- state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, machine.root_device().memregion("audiocpu")->base());
+ if (state->memregion("audiobios")->base())
+ state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(0, state->memregion("audiobios")->base());
+ state->membank(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK)->configure_entry(1, state->memregion("audiocpu")->base());
/* audio banking */
- address_mask = machine.root_device().memregion("audiocpu")->bytes() - 0x10000 - 1;
+ address_mask = state->memregion("audiocpu")->bytes() - 0x10000 - 1;
rgn = state->memregion("audiocpu")->base();
for (region = 0; region < 4; region++)
diff --git a/src/mame/drivers/nexus3d.c b/src/mame/drivers/nexus3d.c
index e28887a85e7..acba9ba6c7b 100644
--- a/src/mame/drivers/nexus3d.c
+++ b/src/mame/drivers/nexus3d.c
@@ -263,7 +263,7 @@ static DRIVER_INIT( nexus3d )
{
nexus3d_state *state = machine.driver_data<nexus3d_state>();
// the first part of the flash ROM automatically gets copied to RAM
- memcpy( state->m_mainram, machine.root_device().memregion("user1")->base(), 4 * 1024);
+ memcpy( state->m_mainram, state->memregion("user1")->base(), 4 * 1024);
state->m_flash_region = state->memregion("user1")->base();
}
diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c
index 51e1bd44cfc..c0b260e4b04 100644
--- a/src/mame/drivers/nightgal.c
+++ b/src/mame/drivers/nightgal.c
@@ -420,41 +420,41 @@ WRITE8_MEMBER(nightgal_state::mux_w)
static READ8_DEVICE_HANDLER( input_1p_r )
{
nightgal_state *state = device->machine().driver_data<nightgal_state>();
- UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
+ UINT8 cr_clear = state->ioport("CR_CLEAR")->read();
switch (state->m_mux_data)
{
- case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
- case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
- case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
- case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
- case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
- case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
+ case 0x01: return state->ioport("PL1_1")->read() | cr_clear;
+ case 0x02: return state->ioport("PL1_2")->read() | cr_clear;
+ case 0x04: return state->ioport("PL1_3")->read() | cr_clear;
+ case 0x08: return state->ioport("PL1_4")->read() | cr_clear;
+ case 0x10: return state->ioport("PL1_5")->read() | cr_clear;
+ case 0x20: return state->ioport("PL1_6")->read() | cr_clear;
}
//printf("%04x\n", state->m_mux_data);
- return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
- input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
+ return (state->ioport("PL1_1")->read() & state->ioport("PL1_2")->read() & state->ioport("PL1_3")->read() &
+ state->ioport("PL1_4")->read() & state->ioport("PL1_5")->read() & state->ioport("PL1_6")->read()) | cr_clear;
}
static READ8_DEVICE_HANDLER( input_2p_r )
{
nightgal_state *state = device->machine().driver_data<nightgal_state>();
- UINT8 coin_port = input_port_read(device->machine(), "COINS");
+ UINT8 coin_port = state->ioport("COINS")->read();
switch (state->m_mux_data)
{
- case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
- case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
- case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
- case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
- case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
- case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
+ case 0x01: return state->ioport("PL2_1")->read() | coin_port;
+ case 0x02: return state->ioport("PL2_2")->read() | coin_port;
+ case 0x04: return state->ioport("PL2_3")->read() | coin_port;
+ case 0x08: return state->ioport("PL2_4")->read() | coin_port;
+ case 0x10: return state->ioport("PL2_5")->read() | coin_port;
+ case 0x20: return state->ioport("PL2_6")->read() | coin_port;
}
//printf("%04x\n", state->m_mux_data);
- return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
- input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
+ return (state->ioport("PL2_1")->read() & state->ioport("PL2_2")->read() & state->ioport("PL2_3")->read() &
+ state->ioport("PL2_4")->read() & state->ioport("PL2_5")->read() & state->ioport("PL2_6")->read()) | coin_port;
}
/********************************************
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index e9068884e2e..d0ad3ac568d 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -228,7 +228,7 @@ static SAMPLES_START( ninjakd2_init_samples )
{
ninjakd2_state *state = device.machine().driver_data<ninjakd2_state>();
running_machine &machine = device.machine();
- const UINT8* const rom = machine.root_device().memregion("pcm")->base();
+ const UINT8* const rom = state->memregion("pcm")->base();
const int length = state->memregion("pcm")->bytes();
INT16* sampledata = auto_alloc_array(machine, INT16, length);
@@ -350,8 +350,8 @@ READ8_MEMBER(ninjakd2_state::omegaf_io_protection_r)
case 1: // dip switches
switch (offset)
{
- case 0: result = input_port_read(machine(), "DIPSW1"); break;
- case 1: result = input_port_read(machine(), "DIPSW2"); break;
+ case 0: result = ioport("DIPSW1")->read(); break;
+ case 1: result = ioport("DIPSW2")->read(); break;
case 2: result = 0x02; break;
}
break;
@@ -359,8 +359,8 @@ READ8_MEMBER(ninjakd2_state::omegaf_io_protection_r)
case 2: // player inputs
switch (offset)
{
- case 0: result = input_port_read(machine(), "PAD1"); break;
- case 1: result = input_port_read(machine(), "PAD2"); break;
+ case 0: result = ioport("PAD1")->read(); break;
+ case 1: result = ioport("PAD2")->read(); break;
case 2: result = 0x01; break;
}
break;
@@ -615,31 +615,31 @@ static INPUT_PORTS_START( ninjakd2 )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,4")
- PORT_DIPSETTING( 0x00, "2 Coins/1 Credit, 6/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x18, "1 Coin/1 Credit, 3/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x10, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x08, "1 Coin/3 Credits, 3/12" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "2 Coins/1 Credit, 6/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x18, "1 Coin/1 Credit, 3/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x08, "1 Coin/3 Credits, 3/12" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1")
- PORT_DIPSETTING( 0x00, "5 Coins/1 Credit, 15/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x20, "4 Coins/1 Credit, 12/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x40, "3 Coins/1 Credit, 9/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x60, "2 Coins/1 Credit, 6/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0xe0, "1 Coin/1 Credit, 3/4" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0xa0, "1 Coin/3 Credits, 3/12" ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_NOTEQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DIPSW2", 0x04, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "5 Coins/1 Credit, 15/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, "4 Coins/1 Credit, 12/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, "3 Coins/1 Credit, 9/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x60, "2 Coins/1 Credit, 6/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0xe0, "1 Coin/1 Credit, 3/4" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, "1 Coin/2 Credits, 2/6, 3/10" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0xa0, "1 Coin/3 Credits, 3/12" ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DIPSW2", 0x04, NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DIPSW2", 0x04, EQUALS, 0x00)
INPUT_PORTS_END
static INPUT_PORTS_START( rdaction )
diff --git a/src/mame/drivers/nitedrvr.c b/src/mame/drivers/nitedrvr.c
index b655b1e08db..934fe3f7b68 100644
--- a/src/mame/drivers/nitedrvr.c
+++ b/src/mame/drivers/nitedrvr.c
@@ -78,7 +78,7 @@ static INPUT_PORTS_START( nitedrvr )
PORT_DIPNAME( 0x20, 0x20, "Bonus Time" )
PORT_DIPSETTING( 0x00, DEF_STR ( No ) )
PORT_DIPSETTING( 0x20, "Score = 350" )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
PORT_START("GEARS") // fake
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index ec52524593d..1453d30b239 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -278,15 +278,15 @@ READ16_MEMBER(niyanpai_state::niyanpai_dipsw_r)
{
UINT8 dipsw_a, dipsw_b;
- dipsw_a = (((input_port_read(machine(), "DSWA") & 0x01) << 7) | ((input_port_read(machine(), "DSWA") & 0x02) << 5) |
- ((input_port_read(machine(), "DSWA") & 0x04) << 3) | ((input_port_read(machine(), "DSWA") & 0x08) << 1) |
- ((input_port_read(machine(), "DSWA") & 0x10) >> 1) | ((input_port_read(machine(), "DSWA") & 0x20) >> 3) |
- ((input_port_read(machine(), "DSWA") & 0x40) >> 5) | ((input_port_read(machine(), "DSWA") & 0x80) >> 7));
+ dipsw_a = (((ioport("DSWA")->read() & 0x01) << 7) | ((ioport("DSWA")->read() & 0x02) << 5) |
+ ((ioport("DSWA")->read() & 0x04) << 3) | ((ioport("DSWA")->read() & 0x08) << 1) |
+ ((ioport("DSWA")->read() & 0x10) >> 1) | ((ioport("DSWA")->read() & 0x20) >> 3) |
+ ((ioport("DSWA")->read() & 0x40) >> 5) | ((ioport("DSWA")->read() & 0x80) >> 7));
- dipsw_b = (((input_port_read(machine(), "DSWB") & 0x01) << 7) | ((input_port_read(machine(), "DSWB") & 0x02) << 5) |
- ((input_port_read(machine(), "DSWB") & 0x04) << 3) | ((input_port_read(machine(), "DSWB") & 0x08) << 1) |
- ((input_port_read(machine(), "DSWB") & 0x10) >> 1) | ((input_port_read(machine(), "DSWB") & 0x20) >> 3) |
- ((input_port_read(machine(), "DSWB") & 0x40) >> 5) | ((input_port_read(machine(), "DSWB") & 0x80) >> 7));
+ dipsw_b = (((ioport("DSWB")->read() & 0x01) << 7) | ((ioport("DSWB")->read() & 0x02) << 5) |
+ ((ioport("DSWB")->read() & 0x04) << 3) | ((ioport("DSWB")->read() & 0x08) << 1) |
+ ((ioport("DSWB")->read() & 0x10) >> 1) | ((ioport("DSWB")->read() & 0x20) >> 3) |
+ ((ioport("DSWB")->read() & 0x40) >> 5) | ((ioport("DSWB")->read() & 0x80) >> 7));
return ((dipsw_a << 8) | dipsw_b);
}
@@ -297,13 +297,13 @@ READ16_MEMBER(niyanpai_state::musobana_inputport_0_r)
switch ((m_musobana_inputport ^ 0xff00) >> 8)
{
- case 0x01: portdata = input_port_read(machine(), "KEY0"); break;
- case 0x02: portdata = input_port_read(machine(), "KEY1"); break;
- case 0x04: portdata = input_port_read(machine(), "KEY2"); break;
- case 0x08: portdata = input_port_read(machine(), "KEY3"); break;
- case 0x10: portdata = input_port_read(machine(), "KEY4"); break;
- default: portdata = input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") & input_port_read(machine(), "KEY2")
- & input_port_read(machine(), "KEY3") & input_port_read(machine(), "KEY4"); break;
+ case 0x01: portdata = ioport("KEY0")->read(); break;
+ case 0x02: portdata = ioport("KEY1")->read(); break;
+ case 0x04: portdata = ioport("KEY2")->read(); break;
+ case 0x08: portdata = ioport("KEY3")->read(); break;
+ case 0x10: portdata = ioport("KEY4")->read(); break;
+ default: portdata = ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read()
+ & ioport("KEY3")->read() & ioport("KEY4")->read(); break;
}
return (portdata);
diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c
index 7f79b33911a..e9b9cefbb5e 100644
--- a/src/mame/drivers/nmg5.c
+++ b/src/mame/drivers/nmg5.c
@@ -418,23 +418,23 @@ static INPUT_PORTS_START( nmg5 )
PORT_DIPSETTING( 0x0080, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:8,7")
- PORT_DIPSETTING( 0x0200, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0300, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0100, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0300, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0100, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0200, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x0200, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0300, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0100, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0300, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0100, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0200, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:6,5")
- PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0400, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x00)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0800, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0400, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x0800, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0400, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x00)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0800, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0400, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
+ PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x4000,EQUALS,0x00)
PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:4" ) // See notes
PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index f19220f48a6..cf6dd939da1 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -257,7 +257,7 @@ READ16_MEMBER(nmk16_state::tharrier_mcu_r)
return res << 8;
}
else
- return ~input_port_read(machine(), "IN1");
+ return ~ioport("IN1")->read();
}
WRITE16_MEMBER(nmk16_state::macross2_sound_reset_w)
@@ -750,8 +750,8 @@ static void mcu_run(running_machine &machine, UINT8 dsw_setting)
/*needed because of the uncompatibility of the dsw settings.*/
if(dsw_setting) // Thunder Dragon
{
- dsw[0] = (input_port_read(machine, "DSW2") & 0x7);
- dsw[1] = (input_port_read(machine, "DSW2") & 0x38) >> 3;
+ dsw[0] = (machine.root_device().ioport("DSW2")->read() & 0x7);
+ dsw[1] = (machine.root_device().ioport("DSW2")->read() & 0x38) >> 3;
for(i=0;i<2;i++)
{
switch(dsw[i] & 7)
@@ -769,8 +769,8 @@ static void mcu_run(running_machine &machine, UINT8 dsw_setting)
}
else // Hacha Mecha Fighter
{
- dsw[0] = (input_port_read(machine, "DSW1") & 0x0700) >> 8;
- dsw[1] = (input_port_read(machine, "DSW1") & 0x3800) >> 11;
+ dsw[0] = (machine.root_device().ioport("DSW1")->read() & 0x0700) >> 8;
+ dsw[1] = (machine.root_device().ioport("DSW1")->read() & 0x3800) >> 11;
for(i=0;i<2;i++)
{
switch(dsw[i] & 7)
@@ -788,7 +788,7 @@ static void mcu_run(running_machine &machine, UINT8 dsw_setting)
}
/*read the coin port*/
- coin_input = (~(input_port_read(machine, "IN0")));
+ coin_input = (~(machine.root_device().ioport("IN0")->read()));
if(coin_input & 0x01)//coin 1
{
diff --git a/src/mame/drivers/nova2001.c b/src/mame/drivers/nova2001.c
index 91d7f57fa15..e0fb00bcf5b 100644
--- a/src/mame/drivers/nova2001.c
+++ b/src/mame/drivers/nova2001.c
@@ -315,7 +315,7 @@ static INPUT_PORTS_START( nova2001 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
@@ -381,7 +381,7 @@ static INPUT_PORTS_START( ninjakun )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_START("IN2") /* 0xa002 */
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nova2001_state,ninjakun_io_A002_ctrl_r, NULL)
PORT_START("DSW1") // printed "SW 2"
@@ -442,7 +442,7 @@ static INPUT_PORTS_START( pkunwar )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
@@ -491,7 +491,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( raiders5 )
PORT_START("IN0")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index daabe814cd7..369efe1c530 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -296,15 +296,15 @@ READ32_MEMBER(nwktr_state::sysreg_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(machine(), "IN0") << 24;
+ r |= ioport("IN0")->read() << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= input_port_read(machine(), "IN1") << 16;
+ r |= ioport("IN1")->read() << 16;
}
if (ACCESSING_BITS_8_15)
{
- r |= input_port_read(machine(), "IN2") << 8;
+ r |= ioport("IN2")->read() << 8;
}
if (ACCESSING_BITS_0_7)
{
@@ -315,7 +315,7 @@ READ32_MEMBER(nwktr_state::sysreg_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(machine(), "DSW") << 24;
+ r |= ioport("DSW")->read() << 24;
}
}
return r;
@@ -625,11 +625,11 @@ static double adc12138_input_callback( device_t *device, UINT8 input )
int value = 0;
switch (input)
{
- case 0: value = input_port_read(device->machine(), "ANALOG1") - 0x800; break;
- case 1: value = input_port_read(device->machine(), "ANALOG2"); break;
- case 2: value = input_port_read(device->machine(), "ANALOG3"); break;
- case 3: value = input_port_read(device->machine(), "ANALOG4"); break;
- case 4: value = input_port_read(device->machine(), "ANALOG5"); break;
+ case 0: value = device->machine().root_device().ioport("ANALOG1")->read() - 0x800; break;
+ case 1: value = device->machine().root_device().ioport("ANALOG2")->read(); break;
+ case 2: value = device->machine().root_device().ioport("ANALOG3")->read(); break;
+ case 3: value = device->machine().root_device().ioport("ANALOG4")->read(); break;
+ case 4: value = device->machine().root_device().ioport("ANALOG5")->read(); break;
}
return (double)(value) / 2047.0;
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index 02f29645b24..2f21805cd90 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -233,7 +233,7 @@ READ8_MEMBER(nycaptor_state::nycaptor_b_r)
READ8_MEMBER(nycaptor_state::nycaptor_by_r)
{
- int port = input_port_read(machine(), "LIGHTY");
+ int port = ioport("LIGHTY")->read();
if (m_gametype == 1)
port = 255 - port;
@@ -243,7 +243,7 @@ READ8_MEMBER(nycaptor_state::nycaptor_by_r)
READ8_MEMBER(nycaptor_state::nycaptor_bx_r)
{
- return (input_port_read(machine(), "LIGHTX") + 0x27) | 1;
+ return (ioport("LIGHTX")->read() + 0x27) | 1;
}
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index 7e410c1770d..0a3330bd9f2 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -169,13 +169,13 @@ static INTERRUPT_GEN( update_pia_1 )
/* update the different PIA pins from the input ports */
/* CA1 - copy of PA0 (COIN1) */
- state->m_pia1->ca1_w(input_port_read(device->machine(), "IN0") & 0x01);
+ state->m_pia1->ca1_w(state->ioport("IN0")->read() & 0x01);
/* CA2 - copy of PA1 (SERVICE1) */
- state->m_pia1->ca2_w(input_port_read(device->machine(), "IN0") & 0x02);
+ state->m_pia1->ca2_w(state->ioport("IN0")->read() & 0x02);
/* CB1 - (crosshatch) */
- state->m_pia1->cb1_w(input_port_read(device->machine(), "CROSS"));
+ state->m_pia1->cb1_w(state->ioport("CROSS")->read());
/* CB2 - NOT CONNECTED */
}
diff --git a/src/mame/drivers/offtwall.c b/src/mame/drivers/offtwall.c
index fdb70cea81e..e7150d0cf37 100644
--- a/src/mame/drivers/offtwall.c
+++ b/src/mame/drivers/offtwall.c
@@ -91,7 +91,7 @@ WRITE16_MEMBER(offtwall_state::offtwall_atarivc_w)
READ16_MEMBER(offtwall_state::special_port3_r)
{
- int result = input_port_read(machine(), "260010");
+ int result = ioport("260010")->read();
if (m_cpu_to_sound_ready) result ^= 0x0020;
return result;
}
@@ -346,7 +346,7 @@ static INPUT_PORTS_START( offtwall )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* tested before writing to 260040 */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("260012")
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index dcdee4aa7e5..180e10302f9 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -113,18 +113,18 @@ READ8_MEMBER(ojankohs_state::ojankohs_keymatrix_r)
switch (m_portselect)
{
- case 0x01: ret = input_port_read(machine(), "KEY0"); break;
- case 0x02: ret = input_port_read(machine(), "KEY1"); break;
- case 0x04: ret = input_port_read(machine(), "KEY2"); break;
- case 0x08: ret = input_port_read(machine(), "KEY3"); break;
- case 0x10: ret = input_port_read(machine(), "KEY4"); break;
+ case 0x01: ret = ioport("KEY0")->read(); break;
+ case 0x02: ret = ioport("KEY1")->read(); break;
+ case 0x04: ret = ioport("KEY2")->read(); break;
+ case 0x08: ret = ioport("KEY3")->read(); break;
+ case 0x10: ret = ioport("KEY4")->read(); break;
case 0x20: ret = 0xff; break;
case 0x3f: ret = 0xff;
- ret &= input_port_read(machine(), "KEY0");
- ret &= input_port_read(machine(), "KEY1");
- ret &= input_port_read(machine(), "KEY2");
- ret &= input_port_read(machine(), "KEY3");
- ret &= input_port_read(machine(), "KEY4");
+ ret &= ioport("KEY0")->read();
+ ret &= ioport("KEY1")->read();
+ ret &= ioport("KEY2")->read();
+ ret &= ioport("KEY3")->read();
+ ret &= ioport("KEY4")->read();
break;
default: ret = 0xff;
logerror("PC:%04X unknown %02X\n", cpu_get_pc(&space.device()), m_portselect);
@@ -147,38 +147,40 @@ READ8_MEMBER(ojankohs_state::ojankoc_keymatrix_r)
for (i = 0; i < 5; i++)
{
if (!BIT(m_portselect, i))
- ret |= input_port_read(machine(), keynames[offset][i]);
+ ret |= ioport(keynames[offset][i])->read();
}
- return (ret & 0x3f) | (input_port_read(machine(), offset ? "IN1" : "IN0") & 0xc0);
+ return (ret & 0x3f) | (ioport(offset ? "IN1" : "IN0")->read() & 0xc0);
}
static READ8_DEVICE_HANDLER( ojankohs_ay8910_0_r )
{
// DIPSW 1
- return (((input_port_read(device->machine(), "DSW1") & 0x01) << 7) | ((input_port_read(device->machine(), "DSW1") & 0x02) << 5) |
- ((input_port_read(device->machine(), "DSW1") & 0x04) << 3) | ((input_port_read(device->machine(), "DSW1") & 0x08) << 1) |
- ((input_port_read(device->machine(), "DSW1") & 0x10) >> 1) | ((input_port_read(device->machine(), "DSW1") & 0x20) >> 3) |
- ((input_port_read(device->machine(), "DSW1") & 0x40) >> 5) | ((input_port_read(device->machine(), "DSW1") & 0x80) >> 7));
+ device_t &root = device->machine().root_device();
+ return (((root.ioport("DSW1")->read() & 0x01) << 7) | ((root.ioport("DSW1")->read() & 0x02) << 5) |
+ ((root.ioport("DSW1")->read() & 0x04) << 3) | ((root.ioport("DSW1")->read() & 0x08) << 1) |
+ ((root.ioport("DSW1")->read() & 0x10) >> 1) | ((root.ioport("DSW1")->read() & 0x20) >> 3) |
+ ((root.ioport("DSW1")->read() & 0x40) >> 5) | ((root.ioport("DSW1")->read() & 0x80) >> 7));
}
static READ8_DEVICE_HANDLER( ojankohs_ay8910_1_r )
{
// DIPSW 1
- return (((input_port_read(device->machine(), "DSW2") & 0x01) << 7) | ((input_port_read(device->machine(), "DSW2") & 0x02) << 5) |
- ((input_port_read(device->machine(), "DSW2") & 0x04) << 3) | ((input_port_read(device->machine(), "DSW2") & 0x08) << 1) |
- ((input_port_read(device->machine(), "DSW2") & 0x10) >> 1) | ((input_port_read(device->machine(), "DSW2") & 0x20) >> 3) |
- ((input_port_read(device->machine(), "DSW2") & 0x40) >> 5) | ((input_port_read(device->machine(), "DSW2") & 0x80) >> 7));
+ device_t &root = device->machine().root_device();
+ return (((root.ioport("DSW2")->read() & 0x01) << 7) | ((root.ioport("DSW2")->read() & 0x02) << 5) |
+ ((root.ioport("DSW2")->read() & 0x04) << 3) | ((root.ioport("DSW2")->read() & 0x08) << 1) |
+ ((root.ioport("DSW2")->read() & 0x10) >> 1) | ((root.ioport("DSW2")->read() & 0x20) >> 3) |
+ ((root.ioport("DSW2")->read() & 0x40) >> 5) | ((root.ioport("DSW2")->read() & 0x80) >> 7));
}
READ8_MEMBER(ojankohs_state::ccasino_dipsw3_r)
{
- return (input_port_read(machine(), "DSW3") ^ 0xff); // DIPSW 3
+ return (ioport("DSW3")->read() ^ 0xff); // DIPSW 3
}
READ8_MEMBER(ojankohs_state::ccasino_dipsw4_r)
{
- return (input_port_read(machine(), "DSW4") ^ 0xff); // DIPSW 4
+ return (ioport("DSW4")->read() ^ 0xff); // DIPSW 4
}
WRITE8_MEMBER(ojankohs_state::ojankoy_coinctr_w)
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index a4089cc5f6a..2f0fcf660cb 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -297,7 +297,7 @@ static const UINT8 spinnerTable[64] =
READ8_MEMBER(omegrace_state::omegrace_spinner1_r)
{
- return (spinnerTable[input_port_read(machine(), "SPIN0") & 0x3f]);
+ return (spinnerTable[ioport("SPIN0")->read() & 0x3f]);
}
diff --git a/src/mame/drivers/oneshot.c b/src/mame/drivers/oneshot.c
index 908ad24ad06..a0b89624171 100644
--- a/src/mame/drivers/oneshot.c
+++ b/src/mame/drivers/oneshot.c
@@ -41,7 +41,7 @@ NOTE: An eBay auction of the PCB shows "1996.9.16 PROMAT" on the JAMMA+ adapter
READ16_MEMBER(oneshot_state::oneshot_in0_word_r)
{
- int data = input_port_read(machine(), "DSW1");
+ int data = ioport("DSW1")->read();
switch (data & 0x0c)
{
diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c
index 2104b0c271a..177687b531c 100644
--- a/src/mame/drivers/onetwo.c
+++ b/src/mame/drivers/onetwo.c
@@ -215,7 +215,7 @@ static INPUT_PORTS_START( onetwo )
PORT_DIPSETTING( 0x08, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) )
@@ -232,12 +232,12 @@ static INPUT_PORTS_START( onetwo )
PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) )
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index 63680a883d8..c026266072e 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -304,13 +304,13 @@ WRITE16_MEMBER(opwolf_state::cchip_w)
READ16_MEMBER(opwolf_state::opwolf_in_r)
{
static const char *const inname[2] = { "IN0", "IN1" };
- return input_port_read(machine(), inname[offset]);
+ return ioport(inname[offset])->read();
}
READ16_MEMBER(opwolf_state::opwolf_dsw_r)
{
static const char *const dswname[2] = { "DSWA", "DSWB" };
- return input_port_read(machine(), dswname[offset]);
+ return ioport(dswname[offset])->read();
}
READ16_MEMBER(opwolf_state::opwolf_lightgun_r)
@@ -320,10 +320,10 @@ READ16_MEMBER(opwolf_state::opwolf_lightgun_r)
switch (offset)
{
case 0x00: /* P1X - Have to remap 8 bit input value, into 0-319 visible range */
- scaled = (input_port_read(machine(), P1X_PORT_TAG) * 320 ) / 256;
+ scaled = (ioport(P1X_PORT_TAG)->read() * 320 ) / 256;
return (scaled + 0x15 + m_opwolf_gun_xoffs);
case 0x01: /* P1Y */
- return (input_port_read(machine(), P1Y_PORT_TAG) - 0x24 + m_opwolf_gun_yoffs);
+ return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_opwolf_gun_yoffs);
}
return 0xff;
@@ -331,12 +331,12 @@ READ16_MEMBER(opwolf_state::opwolf_lightgun_r)
READ8_MEMBER(opwolf_state::z80_input1_r)
{
- return input_port_read(machine(), "IN0"); /* irrelevant mirror ? */
+ return ioport("IN0")->read(); /* irrelevant mirror ? */
}
READ8_MEMBER(opwolf_state::z80_input2_r)
{
- return input_port_read(machine(), "IN0"); /* needed for coins */
+ return ioport("IN0")->read(); /* needed for coins */
}
@@ -979,7 +979,7 @@ ROM_END
static DRIVER_INIT( opwolf )
{
opwolf_state *state = machine.driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
+ UINT16* rom = (UINT16*)state->memregion("maincpu")->base();
state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -996,7 +996,7 @@ static DRIVER_INIT( opwolf )
static DRIVER_INIT( opwolfb )
{
opwolf_state *state = machine.driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
+ UINT16* rom = (UINT16*)state->memregion("maincpu")->base();
state->m_opwolf_region = rom[0x03fffe / 2] & 0xff;
diff --git a/src/mame/drivers/orbit.c b/src/mame/drivers/orbit.c
index 02b29874f2e..8e7b76725bd 100644
--- a/src/mame/drivers/orbit.c
+++ b/src/mame/drivers/orbit.c
@@ -187,7 +187,7 @@ static INPUT_PORTS_START( orbit )
PORT_DIPNAME( 0x40, 0x40, "DIAG TEST" ) /* should be off */
PORT_DIPSETTING( 0x40, DEF_STR( Off ))
PORT_DIPSETTING( 0x00, DEF_STR( On ))
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("BUTTONS") /* 2800 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Game 7 / Strong Gravity") PORT_CODE(KEYCODE_7_PAD)
diff --git a/src/mame/drivers/othldrby.c b/src/mame/drivers/othldrby.c
index 6ecc2532700..5686b050246 100644
--- a/src/mame/drivers/othldrby.c
+++ b/src/mame/drivers/othldrby.c
@@ -104,7 +104,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( othldrby )
PORT_START("VBLANK")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index 69805436955..8a635974a22 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -372,7 +372,7 @@ READ16_MEMBER(othunder_state::othunder_tc0220ioc_r)
READ16_MEMBER(othunder_state::othunder_lightgun_r)
{
static const char *const portname[4] = { P1X_PORT_TAG, P1Y_PORT_TAG, P2X_PORT_TAG, P2Y_PORT_TAG };
- return input_port_read(machine(), portname[offset]);
+ return ioport(portname[offset])->read();
}
WRITE16_MEMBER(othunder_state::othunder_lightgun_w)
diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c
index 8103b485012..3e83ed23119 100644
--- a/src/mame/drivers/overdriv.c
+++ b/src/mame/drivers/overdriv.c
@@ -70,7 +70,7 @@ WRITE16_MEMBER(overdriv_state::eeprom_w)
/* bit 0 is data */
/* bit 1 is clock (active high) */
/* bit 2 is cs (active low) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c
index f20a01f3dfe..517a9bff616 100644
--- a/src/mame/drivers/pachifev.c
+++ b/src/mame/drivers/pachifev.c
@@ -311,10 +311,10 @@ static INTERRUPT_GEN( pachifev_vblank_irq )
address_space *ramspace = device->memory().space(AS_PROGRAM);
UINT8 player = 0;
- if ((ramspace->read_byte(0xe00f) == 0x01) && ((input_port_read(device->machine(), "DSW1") & 0x08) == 0x00))
+ if ((ramspace->read_byte(0xe00f) == 0x01) && ((state->ioport("DSW1")->read() & 0x08) == 0x00))
player = 1;
- int current_power=input_port_read(device->machine(), inname[player]) & 0x3f;
+ int current_power=state->ioport(inname[player])->read() & 0x3f;
if(current_power != state->m_previous_power)
{
popmessage ("%d%%", (current_power * 100) / 0x3f);
diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c
index 456c140c30b..40b56f53e14 100644
--- a/src/mame/drivers/pacland.c
+++ b/src/mame/drivers/pacland.c
@@ -198,8 +198,8 @@ READ8_MEMBER(pacland_state::pacland_input_r)
int shift = 4 * (offset & 1);
int port = offset & 2;
static const char *const portnames[] = { "DSWA", "DSWB", "IN0", "IN1" };
- int r = (input_port_read(machine(), portnames[port]) << shift) & 0xf0;
- r |= (input_port_read(machine(), portnames[port+1]) >> (4 - shift)) & 0x0f;
+ int r = (ioport(portnames[port])->read() << shift) & 0xf0;
+ r |= (ioport(portnames[port+1])->read() >> (4 - shift)) & 0x0f;
return r;
}
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index e00c3a09c1e..f8d584e3b55 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -374,7 +374,7 @@ Boards:
static MACHINE_RESET( mschamp )
{
UINT8 *rom = machine.root_device().memregion("maincpu")->base() + 0x10000;
- int whichbank = input_port_read(machine, "GAME") & 1;
+ int whichbank = machine.root_device().ioport("GAME")->read() & 1;
machine.root_device().membank("bank1")->configure_entries(0, 2, &rom[0x0000], 0x8000);
machine.root_device().membank("bank2")->configure_entries(0, 2, &rom[0x4000], 0x8000);
@@ -541,7 +541,7 @@ READ8_MEMBER(pacman_state::alibaba_mystery_2_r)
READ8_MEMBER(pacman_state::maketrax_special_port2_r)
{
- int data = input_port_read(machine(), "DSW1");
+ int data = ioport("DSW1")->read();
int pc = cpu_get_previouspc(&space.device());
if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40;
@@ -584,7 +584,7 @@ READ8_MEMBER(pacman_state::maketrax_special_port3_r)
READ8_MEMBER(pacman_state::korosuke_special_port2_r)
{
- int data = input_port_read(machine(), "DSW1");
+ int data = ioport("DSW1")->read();
int pc = cpu_get_previouspc(&space.device());
if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40;
@@ -2806,7 +2806,7 @@ static INPUT_PORTS_START( drivfrcp )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("Sense")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -2858,7 +2858,7 @@ static INPUT_PORTS_START( 8bpm )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("Sense")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -2910,7 +2910,7 @@ static INPUT_PORTS_START( porky )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("Sense")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index dc60e4eef99..f36361c0e28 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -260,7 +260,7 @@ static INPUT_PORTS_START( paradise )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -345,7 +345,7 @@ static INPUT_PORTS_START( tgtball )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -424,7 +424,7 @@ static INPUT_PORTS_START( penky )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -506,7 +506,7 @@ static INPUT_PORTS_START( torus )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -588,7 +588,7 @@ static INPUT_PORTS_START( madball )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -672,7 +672,7 @@ GFXDECODE_END
static MACHINE_START( paradise )
{
paradise_state *state = machine.driver_data<paradise_state>();
- int bank_n = machine.root_device().memregion("maincpu")->bytes() / 0x4000 - 1;
+ int bank_n = state->memregion("maincpu")->bytes() / 0x4000 - 1;
UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 3, &ROM[0x00000], 0x4000);
diff --git a/src/mame/drivers/pastelg.c b/src/mame/drivers/pastelg.c
index 8aba35434de..28102bd52d5 100644
--- a/src/mame/drivers/pastelg.c
+++ b/src/mame/drivers/pastelg.c
@@ -82,11 +82,11 @@ READ8_MEMBER(pastelg_state::threeds_inputport1_r)
{
switch(m_mux_data)
{
- case 0x01: return input_port_read(machine(),"KEY0_PL1");
- case 0x02: return input_port_read(machine(),"KEY1_PL1");
- case 0x04: return input_port_read(machine(),"KEY2_PL1");
- case 0x08: return input_port_read(machine(),"KEY3_PL1");
- case 0x10: return input_port_read(machine(),"KEY4_PL1");
+ case 0x01: return ioport("KEY0_PL1")->read();
+ case 0x02: return ioport("KEY1_PL1")->read();
+ case 0x04: return ioport("KEY2_PL1")->read();
+ case 0x08: return ioport("KEY3_PL1")->read();
+ case 0x10: return ioport("KEY4_PL1")->read();
}
return 0xff;
@@ -96,11 +96,11 @@ READ8_MEMBER(pastelg_state::threeds_inputport2_r)
{
switch(m_mux_data)
{
- case 0x01: return input_port_read(machine(),"KEY0_PL2");
- case 0x02: return input_port_read(machine(),"KEY1_PL2");
- case 0x04: return input_port_read(machine(),"KEY2_PL2");
- case 0x08: return input_port_read(machine(),"KEY3_PL2");
- case 0x10: return input_port_read(machine(),"KEY4_PL2");
+ case 0x01: return ioport("KEY0_PL2")->read();
+ case 0x02: return ioport("KEY1_PL2")->read();
+ case 0x04: return ioport("KEY2_PL2")->read();
+ case 0x08: return ioport("KEY3_PL2")->read();
+ case 0x10: return ioport("KEY4_PL2")->read();
}
return 0xff;
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index 4c114f72546..1174d26eb9a 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -195,7 +195,7 @@ READ8_MEMBER(pcat_nit_state::pcat_nit_io_r)
case 0: /* 278 */
return 0xff;
case 1: /* 279 */
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 7: /* 27f dips */
return 0xff;
default:
diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c
index f9314561cca..80669c8be39 100644
--- a/src/mame/drivers/pcxt.c
+++ b/src/mame/drivers/pcxt.c
@@ -146,8 +146,8 @@ static SCREEN_UPDATE_RGB32( tetriskr )
READ8_MEMBER(pcxt_state::disk_iobank_r)
{
//printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(&space.device()));
- //if(offset == 0) return input_port_read(machine(), "DSW");
- if(offset == 1) return input_port_read(machine(), "IN1");
+ //if(offset == 0) return ioport("DSW")->read();
+ if(offset == 1) return ioport("IN1")->read();
return m_disk_data[offset];
}
diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c
index e31c6ef0694..c4e65d41f2f 100644
--- a/src/mame/drivers/pengadvb.c
+++ b/src/mame/drivers/pengadvb.c
@@ -178,7 +178,7 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER( pengadvb_psg_port_a_r )
{
- return input_port_read(device->machine(), "IN0");
+ return device->machine().root_device().ioport("IN0")->read();
}
static const ay8910_interface pengadvb_ay8910_interface =
@@ -212,7 +212,7 @@ static READ8_DEVICE_HANDLER( pengadvb_ppi_port_b_r )
i8255_device *ppi = device->machine().device<i8255_device>("ppi8255");
address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
if ((ppi->read(*space, 2) & 0x0f) == 0)
- return input_port_read(device->machine(), "IN1");
+ return device->machine().root_device().ioport("IN1")->read();
return 0xff;
}
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 3234f3bb94f..cdcf6e05616 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -352,8 +352,8 @@ static TIMER_CALLBACK(assert_lp_cb)
static void handle_lightpen( device_t *device )
{
- int x_val = input_port_read_safe(device->machine(), "TOUCH_X",0x00);
- int y_val = input_port_read_safe(device->machine(), "TOUCH_Y",0x00);
+ int x_val = device->machine().root_device().ioport("TOUCH_X")->read_safe(0x00);
+ int y_val = device->machine().root_device().ioport("TOUCH_Y")->read_safe(0x00);
const rectangle &vis_area = device->machine().primary_screen->visible_area();
int xt, yt;
@@ -576,7 +576,7 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
sda = i2cmem_sda_read(device);
}
- if ((input_port_read_safe(device->machine(), "SENSOR",0x00) & 0x01) == 0x01 && state->m_coin_state == 0) {
+ if ((state->ioport("SENSOR")->read_safe(0x00) & 0x01) == 0x01 && state->m_coin_state == 0) {
state->m_coin_state = 1; // Start Coin Cycle
state->m_last_cycles = device->machine().firstcpu->total_cycles();
} else {
@@ -615,7 +615,7 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
door_wait = 12345;
if (curr_cycles - state->m_last_door > door_wait) {
- if ((input_port_read_safe(device->machine(), "DOOR",0xff) & 0x01) == 0x01) {
+ if ((state->ioport("DOOR")->read_safe(0xff) & 0x01) == 0x01) {
state->m_door_open = (!state->m_door_open & 0x01);
} else {
state->m_door_open = 1;
@@ -818,7 +818,7 @@ ADDRESS_MAP_END
CUSTOM_INPUT_MEMBER(peplus_state::peplus_input_r)
{
UINT8 inp_ret = 0x00;
- UINT8 inp_read = input_port_read(machine(), (const char *)param);
+ UINT8 inp_read = ioport((const char *)param)->read();
if (inp_read & 0x01) inp_ret = 0x01;
if (inp_read & 0x02) inp_ret = 0x02;
@@ -1035,7 +1035,7 @@ static MACHINE_RESET( peplus )
state->m_autohold_addr = 0x5e7e; // AutoHold Address
if (state->m_autohold_addr)
- state->m_program_ram[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01;
+ state->m_program_ram[state->m_autohold_addr] = state->ioport("AUTOHOLD")->read_safe(0x00) & 0x01;
#endif
}
diff --git a/src/mame/drivers/peyper.c b/src/mame/drivers/peyper.c
index d035ea1a89d..9641cd53275 100644
--- a/src/mame/drivers/peyper.c
+++ b/src/mame/drivers/peyper.c
@@ -174,9 +174,9 @@ CUSTOM_INPUT_MEMBER(peyper_state::wolfman_replay_hs_r)
switch (bit_mask)
{
case 0x03:
- return ((input_port_read(machine(), "REPLAY") & bit_mask) >> 0);
+ return ((ioport("REPLAY")->read() & bit_mask) >> 0);
case 0x40:
- return ((input_port_read(machine(), "REPLAY") & bit_mask) >> 6);
+ return ((ioport("REPLAY")->read() & bit_mask) >> 6);
default:
logerror("wolfman_replay_hs_r : invalid %02X bit_mask\n",bit_mask);
return 0;
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 4a29c150b02..fda6b29857b 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -3613,7 +3613,7 @@ static void expand_32x32x5bpp(running_machine &machine)
static void expand_colourdata( running_machine &machine )
{
pgm_state *state = machine.driver_data<pgm_state>();
- UINT8 *src = machine.root_device().memregion( "sprcol" )->base();
+ UINT8 *src = state->memregion( "sprcol" )->base();
size_t srcsize = state->memregion( "sprcol" )->bytes();
int cnt;
size_t needed = srcsize / 2 * 3;
diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c
index 565c6b5b3e2..c52d689500e 100644
--- a/src/mame/drivers/phoenix.c
+++ b/src/mame/drivers/phoenix.c
@@ -101,7 +101,7 @@ static INPUT_PORTS_START( phoenix )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:7" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") /* fake port for non-memory mapped dip switch */
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION( "SW1:!8" )
@@ -113,10 +113,10 @@ static INPUT_PORTS_START( phoenix )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
INPUT_PORTS_END
static INPUT_PORTS_START( phoenixa )
@@ -184,7 +184,7 @@ static INPUT_PORTS_START( condor )
PORT_DIPSETTING( 0x50, "Fast" )
PORT_DIPSETTING( 0x60, "Faster" )
PORT_DIPSETTING( 0x70, "Fastest" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION( "SW2:1,2,3,4" )
@@ -232,10 +232,10 @@ static INPUT_PORTS_START( condor )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
INPUT_PORTS_END
static INPUT_PORTS_START( falconz )
@@ -305,10 +305,10 @@ static INPUT_PORTS_START( pleiads )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("CAB",0x01,PORTCOND_EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_CONDITION("CAB",0x01,EQUALS,0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("CAB",0x01,EQUALS,0x01)
INPUT_PORTS_END
static INPUT_PORTS_START( pleiadbl )
@@ -381,7 +381,7 @@ static INPUT_PORTS_START( survival )
PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") /* fake port for non-memory mapped dip switch */
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
diff --git a/src/mame/drivers/pingpong.c b/src/mame/drivers/pingpong.c
index 58404d5e6d2..f8cc8ed3d5b 100644
--- a/src/mame/drivers/pingpong.c
+++ b/src/mame/drivers/pingpong.c
@@ -598,13 +598,13 @@ static DRIVER_INIT( cashquiz )
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8");
// setup default banks
- state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + 0x100*0 );
- state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base() + 0x100*1 );
- state->membank("bank3")->set_base(machine.root_device().memregion("user1")->base() + 0x100*2 );
- state->membank("bank4")->set_base(machine.root_device().memregion("user1")->base() + 0x100*3 );
- state->membank("bank5")->set_base(machine.root_device().memregion("user1")->base() + 0x100*4 );
- state->membank("bank6")->set_base(machine.root_device().memregion("user1")->base() + 0x100*5 );
- state->membank("bank7")->set_base(machine.root_device().memregion("user1")->base() + 0x100*6 );
+ state->membank("bank1")->set_base(state->memregion("user1")->base() + 0x100*0 );
+ state->membank("bank2")->set_base(state->memregion("user1")->base() + 0x100*1 );
+ state->membank("bank3")->set_base(state->memregion("user1")->base() + 0x100*2 );
+ state->membank("bank4")->set_base(state->memregion("user1")->base() + 0x100*3 );
+ state->membank("bank5")->set_base(state->memregion("user1")->base() + 0x100*4 );
+ state->membank("bank6")->set_base(state->memregion("user1")->base() + 0x100*5 );
+ state->membank("bank7")->set_base(state->memregion("user1")->base() + 0x100*6 );
state->membank("bank8")->set_base(state->memregion("user1")->base() + 0x100*7 );
}
diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c
index f6d7ca1a949..aeafea3cc64 100644
--- a/src/mame/drivers/pinkiri8.c
+++ b/src/mame/drivers/pinkiri8.c
@@ -450,11 +450,11 @@ READ8_MEMBER(pinkiri8_state::mux_p2_r)
{
switch(m_mux_data)
{
- case 0x01: return input_port_read(machine(), "PL2_01");
- case 0x02: return input_port_read(machine(), "PL2_02");
- case 0x04: return input_port_read(machine(), "PL2_03");
- case 0x08: return input_port_read(machine(), "PL2_04");
- case 0x10: return input_port_read(machine(), "PL2_05");
+ case 0x01: return ioport("PL2_01")->read();
+ case 0x02: return ioport("PL2_02")->read();
+ case 0x04: return ioport("PL2_03")->read();
+ case 0x08: return ioport("PL2_04")->read();
+ case 0x10: return ioport("PL2_05")->read();
}
return 0xff;
@@ -464,11 +464,11 @@ READ8_MEMBER(pinkiri8_state::mux_p1_r)
{
switch(m_mux_data)
{
- case 0x01: return input_port_read(machine(), "PL1_01");
- case 0x02: return input_port_read(machine(), "PL1_02");
- case 0x04: return input_port_read(machine(), "PL1_03");
- case 0x08: return input_port_read(machine(), "PL1_04");
- case 0x10: return input_port_read(machine(), "PL1_05");
+ case 0x01: return ioport("PL1_01")->read();
+ case 0x02: return ioport("PL1_02")->read();
+ case 0x04: return ioport("PL1_03")->read();
+ case 0x08: return ioport("PL1_04")->read();
+ case 0x10: return ioport("PL1_05")->read();
}
return 0xff;
diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c
index c2d8277f922..f67a72be6b2 100644
--- a/src/mame/drivers/pipedrm.c
+++ b/src/mame/drivers/pipedrm.c
@@ -595,7 +595,7 @@ static MACHINE_START( pipedrm )
state->m_subcpu = machine.device("sub");
/* initialize main Z80 bank */
- state->membank("bank1")->configure_entries(0, 8, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x2000);
+ state->membank("bank1")->configure_entries(0, 8, state->memregion("maincpu")->base() + 0x10000, 0x2000);
state->membank("bank1")->set_entry(0);
/* initialize sound bank */
diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c
index 2750ec4ddbb..3181cf048e4 100644
--- a/src/mame/drivers/pktgaldx.c
+++ b/src/mame/drivers/pktgaldx.c
@@ -162,7 +162,7 @@ static INPUT_PORTS_START( pktgaldx )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c
index 395fbd0c5b2..80d171e7a64 100644
--- a/src/mame/drivers/playch10.c
+++ b/src/mame/drivers/playch10.c
@@ -426,33 +426,33 @@ static INPUT_PORTS_START( playch10 )
PORT_START("SW1")
PORT_DIPNAME( 0x3f, 0x09, "Prime Time Bonus" )
// STANDARD TIME (no bonus)
- PORT_DIPSETTING( 0x00, "0%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x00, "0%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
// PRIME TIME (bonus) for 2 COINS
- PORT_DIPSETTING( 0x07, "8%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x08, "17%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x09, "25%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x10, "33%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x11, "42%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x12, "50%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x13, "58%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x14, "67%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x15, "75%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x16, "83%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x17, "92%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x18, "100%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x07, "8%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x08, "17%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x09, "25%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x10, "33%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x11, "42%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x12, "50%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x13, "58%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x14, "67%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x15, "75%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x16, "83%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x17, "92%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x18, "100%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
// PRIME TIME (bonus) for 4 COINS
- PORT_DIPSETTING( 0x04, "8%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x05, "17%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x06, "25%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x07, "33%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x08, "42%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x09, "50%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x10, "58%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x11, "67%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x12, "75%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x13, "83%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x14, "92%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x15, "100%" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x04, "8%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x05, "17%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x06, "25%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x07, "33%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x08, "42%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x09, "50%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x10, "58%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x11, "67%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x12, "75%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x13, "83%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x14, "92%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x15, "100%" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -462,53 +462,53 @@ static INPUT_PORTS_START( playch10 )
PORT_START("SW2")
PORT_DIPNAME( 0x3f, 0x28, "Play Time/Coin" )
// STANDARD TIME (no bonus)
- PORT_DIPSETTING( 0x3f, DEF_STR( Free_Play ) ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x23, "2:00 (120)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x21, "2:10 (130)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x1f, "2:20 (140)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x1d, "2:30 (150)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x1b, "2:40 (160)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x19, "2:50 (170)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x17, "3:00 (180)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x15, "3:10 (190)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x13, "3:20 (200)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x11, "3:30 (210)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x0f, "3:40 (220)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x0d, "3:50 (230)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x0b, "4:00 (240)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x09, "4:10 (250)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x07, "4:20 (260)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x05, "4:30 (270)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x03, "4:40 (280)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
- PORT_DIPSETTING( 0x01, "4:50 (290)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x3f, DEF_STR( Free_Play ) ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x23, "2:00 (120)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x21, "2:10 (130)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x1f, "2:20 (140)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x1d, "2:30 (150)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x1b, "2:40 (160)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x19, "2:50 (170)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x17, "3:00 (180)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x15, "3:10 (190)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x13, "3:20 (200)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x11, "3:30 (210)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x0f, "3:40 (220)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x0d, "3:50 (230)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x0b, "4:00 (240)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x09, "4:10 (250)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x07, "4:20 (260)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x05, "4:30 (270)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x03, "4:40 (280)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
+ PORT_DIPSETTING( 0x01, "4:50 (290)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0xc0 )
// PRIME TIME (bonus) for 2 COINS
- PORT_DIPSETTING( 0x1c, "2:00 (120)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x1e, "2:10 (130)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x20, "2:20 (140)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x22, "2:30 (150)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x24, "2:40 (160)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x26, "2:50 (170)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x28, "3:00 (180)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x2a, "3:10 (190)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x2c, "3:20 (200)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x2e, "3:30 (210)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x30, "3:40 (220)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x32, "3:50 (230)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
- PORT_DIPSETTING( 0x34, "4:00 (240)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x1c, "2:00 (120)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x1e, "2:10 (130)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x20, "2:20 (140)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x22, "2:30 (150)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x24, "2:40 (160)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x26, "2:50 (170)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x28, "3:00 (180)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x2a, "3:10 (190)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x2c, "3:20 (200)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x2e, "3:30 (210)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x30, "3:40 (220)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x32, "3:50 (230)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
+ PORT_DIPSETTING( 0x34, "4:00 (240)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x80 )
// PRIME TIME (bonus) for 4 COINS
- PORT_DIPSETTING( 0x1c, "2:00 (120)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x1e, "2:10 (130)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x20, "2:20 (140)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x22, "2:30 (150)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x24, "2:40 (160)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x26, "2:50 (170)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x28, "3:00 (180)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x2a, "3:10 (190)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x2c, "3:20 (200)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x2e, "3:30 (210)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x30, "3:40 (220)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x32, "3:50 (230)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
- PORT_DIPSETTING( 0x34, "4:00 (240)" ) PORT_CONDITION("SW2", 0xc0, PORTCOND_EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x1c, "2:00 (120)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x1e, "2:10 (130)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x20, "2:20 (140)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x22, "2:30 (150)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x24, "2:40 (160)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x26, "2:50 (170)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x28, "3:00 (180)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x2a, "3:10 (190)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x2c, "3:20 (200)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x2e, "3:30 (210)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x30, "3:40 (220)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x32, "3:50 (230)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
+ PORT_DIPSETTING( 0x34, "4:00 (240)" ) PORT_CONDITION("SW2", 0xc0, EQUALS, 0x00 )
PORT_DIPNAME( 0xc0, 0x80, "Bonus" )
PORT_DIPSETTING( 0xc0, "Standard Time" )
diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c
index 4e09041b32f..fe789c3ea02 100644
--- a/src/mame/drivers/playmark.c
+++ b/src/mame/drivers/playmark.c
@@ -414,7 +414,7 @@ static INPUT_PORTS_START( bigtwin )
PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
PORT_DIPSETTING( 0x01, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
- PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) )
@@ -431,12 +431,12 @@ static INPUT_PORTS_START( bigtwin )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
@@ -513,7 +513,7 @@ static INPUT_PORTS_START( bigtwinb )
PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
PORT_DIPSETTING( 0x01, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
- PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) )
@@ -530,12 +530,12 @@ static INPUT_PORTS_START( bigtwinb )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
@@ -661,7 +661,7 @@ static INPUT_PORTS_START( excelsr )
PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
PORT_DIPSETTING( 0x01, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
- PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) )
@@ -678,12 +678,12 @@ static INPUT_PORTS_START( excelsr )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
@@ -725,7 +725,7 @@ static INPUT_PORTS_START( hotmind )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* EEPROM data */
PORT_START("DSW1")
@@ -756,7 +756,7 @@ static INPUT_PORTS_START( hotmind )
PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
PORT_DIPSETTING( 0x01, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
- PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) )
@@ -773,12 +773,12 @@ static INPUT_PORTS_START( hotmind )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
@@ -852,7 +852,7 @@ static INPUT_PORTS_START( hrdtimes )
PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
PORT_DIPSETTING( 0x01, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
- PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01)
PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) )
@@ -869,12 +869,12 @@ static INPUT_PORTS_START( hrdtimes )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, NOTEQUALS, 0x01)
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
@@ -1678,7 +1678,7 @@ static UINT8 playmark_asciitohex(UINT8 data)
static DRIVER_INIT( bigtwin )
{
playmark_state *state = machine.driver_data<playmark_state>();
- UINT8 *playmark_PICROM_HEX = machine.root_device().memregion("user1")->base();
+ UINT8 *playmark_PICROM_HEX = state->memregion("user1")->base();
UINT16 *playmark_PICROM = (UINT16 *)state->memregion("audiocpu")->base();
INT32 offs, data;
UINT16 src_pos = 0;
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index cbffc795c00..17baaffa8e5 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -110,8 +110,8 @@ static READ32_DEVICE_HANDLER( polygonet_eeprom_r )
}
else
{
- UINT8 lowInputBits = input_port_read(device->machine(), "IN1");
- UINT8 highInputBits = input_port_read(device->machine(), "IN0");
+ UINT8 lowInputBits = device->machine().root_device().ioport("IN1")->read();
+ UINT8 highInputBits = device->machine().root_device().ioport("IN0")->read();
return ((highInputBits << 24) | (lowInputBits << 16));
}
@@ -124,7 +124,7 @@ WRITE32_MEMBER(polygonet_state::polygonet_eeprom_w)
{
if (ACCESSING_BITS_24_31)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xffffffff);
+ ioport("EEPROMOUT")->write(data, 0xffffffff);
return;
}
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 21040bf00b0..00de16ff71b 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -170,7 +170,7 @@ static READ16_DEVICE_HANDLER( pntnpuzl_eeprom_r )
pntnpuzl_state *state = device->machine().driver_data<pntnpuzl_state>();
/* bit 11 is EEPROM data */
eeprom_device *eeprom = downcast<eeprom_device *>(device);
- return (state->m_eeprom & 0xf4ff) | (eeprom->read_bit()<<11) | (input_port_read(device->machine(), "IN1") & 0x0300);
+ return (state->m_eeprom & 0xf4ff) | (eeprom->read_bit()<<11) | (state->ioport("IN1")->read() & 0x0300);
}
static WRITE16_DEVICE_HANDLER( pntnpuzl_eeprom_w )
@@ -241,11 +241,11 @@ READ16_MEMBER(pntnpuzl_state::pntnpuzl_280014_r)
if (m_serial_out == 0x11)
{
- if (input_port_read(machine(), "IN0") & 0x10)
+ if (ioport("IN0")->read() & 0x10)
{
m_touchscr[0] = 0x1b;
- m_touchscr[2] = BITSWAP8(input_port_read(machine(), "TOUCHX"),0,1,2,3,4,5,6,7);
- m_touchscr[4] = BITSWAP8(input_port_read(machine(), "TOUCHY"),0,1,2,3,4,5,6,7);
+ m_touchscr[2] = BITSWAP8(ioport("TOUCHX")->read(),0,1,2,3,4,5,6,7);
+ m_touchscr[4] = BITSWAP8(ioport("TOUCHY")->read(),0,1,2,3,4,5,6,7);
}
else
m_touchscr[0] = 0;
@@ -325,7 +325,7 @@ INPUT_CHANGED_MEMBER(pntnpuzl_state::coin_inserted)
static INPUT_PORTS_START( pntnpuzl )
PORT_START("IN0") /* fake inputs */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, pntnpuzl_state,coin_inserted, 1) PORT_IMPULSE(1)
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_HIGH )PORT_CHANGED_MEMBER(DEVICE_SELF, pntnpuzl_state,coin_inserted, 2) PORT_IMPULSE(1)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, pntnpuzl_state,coin_inserted, 4) PORT_IMPULSE(1)
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index c2503fd91bd..6aa48f740df 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -267,7 +267,7 @@ READ16_MEMBER(polepos_state::polepos2_ic25_r)
READ8_MEMBER(polepos_state::polepos_adc_r)
{
- return input_port_read(machine(), m_adc_input ? "ACCEL" : "BRAKE");
+ return ioport(m_adc_input ? "ACCEL" : "BRAKE")->read();
}
READ8_MEMBER(polepos_state::polepos_ready_r)
@@ -340,8 +340,8 @@ WRITE16_MEMBER(polepos_state::polepos_z8002_nvi_enable_w)
}
-CUSTOM_INPUT_MEMBER(polepos_state::high_port_r){ return input_port_read(field.machine(), (const char *)param) >> 4; }
-CUSTOM_INPUT_MEMBER(polepos_state::low_port_r){ return input_port_read(field.machine(), (const char *)param) & 0x0f; }
+CUSTOM_INPUT_MEMBER(polepos_state::high_port_r){ return field.machine().root_device().ioport((const char *)param)->read() >> 4; }
+CUSTOM_INPUT_MEMBER(polepos_state::low_port_r){ return field.machine().root_device().ioport((const char *)param)->read() & 0x0f; }
CUSTOM_INPUT_MEMBER(polepos_state::auto_start_r)
{
return m_auto_start_mask;
@@ -409,7 +409,7 @@ static READ8_DEVICE_HANDLER( steering_changed_r )
{
polepos_state *state = device->machine().driver_data<polepos_state>();
/* read the current steering value and update our delta */
- UINT8 steer_new = input_port_read(device->machine(), "STEER");
+ UINT8 steer_new = state->ioport("STEER")->read();
state->m_steer_accum += (INT8)(steer_new - state->m_steer_last) * 2;
state->m_steer_last = steer_new;
diff --git a/src/mame/drivers/polyplay.c b/src/mame/drivers/polyplay.c
index a08b5c74dd4..79c68ba1c22 100644
--- a/src/mame/drivers/polyplay.c
+++ b/src/mame/drivers/polyplay.c
@@ -129,7 +129,7 @@ static INTERRUPT_GEN( coin_interrupt )
{
polyplay_state *state = device->machine().driver_data<polyplay_state>();
- if (input_port_read(device->machine(), "INPUT") & 0x80)
+ if (state->ioport("INPUT")->read() & 0x80)
state->m_last = 0;
else
{
diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c
index 200fc8268d3..7e0a166a135 100644
--- a/src/mame/drivers/poolshrk.c
+++ b/src/mame/drivers/poolshrk.c
@@ -72,10 +72,10 @@ WRITE8_MEMBER(poolshrk_state::poolshrk_watchdog_w)
READ8_MEMBER(poolshrk_state::poolshrk_input_r)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- UINT8 val = input_port_read(machine(), portnames[offset & 3]);
+ UINT8 val = ioport(portnames[offset & 3])->read();
- int x = input_port_read(machine(), (offset & 1) ? "AN1" : "AN0");
- int y = input_port_read(machine(), (offset & 1) ? "AN3" : "AN2");
+ int x = ioport((offset & 1) ? "AN1" : "AN0")->read();
+ int y = ioport((offset & 1) ? "AN3" : "AN2")->read();
if (x >= m_da_latch) val |= 8;
if (y >= m_da_latch) val |= 4;
diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c
index 7c005c4cf60..7fdd3175c19 100644
--- a/src/mame/drivers/popeye.c
+++ b/src/mame/drivers/popeye.c
@@ -407,8 +407,8 @@ static READ8_DEVICE_HANDLER( popeye_portA_r )
int res;
- res = input_port_read(device->machine(), "DSW0");
- res |= (input_port_read(device->machine(), "DSW1") << (7-state->m_dswbit)) & 0x80;
+ res = state->ioport("DSW0")->read();
+ res |= (state->ioport("DSW1")->read() << (7-state->m_dswbit)) & 0x80;
return res;
}
diff --git a/src/mame/drivers/popper.c b/src/mame/drivers/popper.c
index ac857dc9746..a58a233bc1b 100644
--- a/src/mame/drivers/popper.c
+++ b/src/mame/drivers/popper.c
@@ -126,14 +126,14 @@ READ8_MEMBER(popper_state::popper_input_ports_r)
switch (offset)
{
// player inputs dsw1 dsw2
- case 0: data = input_port_read(machine(), "IN0") | ((input_port_read(machine(), "DSW1") & 0x02) << 5) | ((input_port_read(machine(), "DSW2") & 0x01) << 4); break;
- case 1: data = input_port_read(machine(), "IN1") | ((input_port_read(machine(), "DSW1") & 0x01) << 6) | ((input_port_read(machine(), "DSW2") & 0x02) << 3); break;
- case 2: data = input_port_read(machine(), "IN2") | ((input_port_read(machine(), "DSW1") & 0x08) << 3) | ((input_port_read(machine(), "DSW2") & 0x04) << 2); break;
- case 3: data = input_port_read(machine(), "IN3") | ((input_port_read(machine(), "DSW1") & 0x04) << 4) | ((input_port_read(machine(), "DSW2") & 0x08) << 1); break;
- case 4: data = ((input_port_read(machine(), "DSW1") & 0x20) << 2) | ((input_port_read(machine(), "DSW2") & 0x10) << 1); break;
- case 5: data = ((input_port_read(machine(), "DSW1") & 0x10) << 3) | ((input_port_read(machine(), "DSW2") & 0x20) << 0); break;
- case 6: data = ((input_port_read(machine(), "DSW1") & 0x80) << 0) | ((input_port_read(machine(), "DSW2") & 0x40) >> 1); break;
- case 7: data = ((input_port_read(machine(), "DSW1") & 0x40) << 1) | ((input_port_read(machine(), "DSW2") & 0x80) >> 2); break;
+ case 0: data = ioport("IN0")->read() | ((ioport("DSW1")->read() & 0x02) << 5) | ((ioport("DSW2")->read() & 0x01) << 4); break;
+ case 1: data = ioport("IN1")->read() | ((ioport("DSW1")->read() & 0x01) << 6) | ((ioport("DSW2")->read() & 0x02) << 3); break;
+ case 2: data = ioport("IN2")->read() | ((ioport("DSW1")->read() & 0x08) << 3) | ((ioport("DSW2")->read() & 0x04) << 2); break;
+ case 3: data = ioport("IN3")->read() | ((ioport("DSW1")->read() & 0x04) << 4) | ((ioport("DSW2")->read() & 0x08) << 1); break;
+ case 4: data = ((ioport("DSW1")->read() & 0x20) << 2) | ((ioport("DSW2")->read() & 0x10) << 1); break;
+ case 5: data = ((ioport("DSW1")->read() & 0x10) << 3) | ((ioport("DSW2")->read() & 0x20) << 0); break;
+ case 6: data = ((ioport("DSW1")->read() & 0x80) << 0) | ((ioport("DSW2")->read() & 0x40) >> 1); break;
+ case 7: data = ((ioport("DSW1")->read() & 0x40) << 1) | ((ioport("DSW2")->read() & 0x80) >> 2); break;
}
return data;
}
diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c
index d0e31cf69ea..436b81562a2 100644
--- a/src/mame/drivers/powerbal.c
+++ b/src/mame/drivers/powerbal.c
@@ -227,40 +227,40 @@ static INPUT_PORTS_START( magicstk )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
PORT_DIPSETTING( 0x01, "Mode 1" )
PORT_DIPSETTING( 0x00, "Mode 2" )
- PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,PORTCOND_NOTEQUALS,0x01)
+ PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1",0x01,EQUALS,0x01)
+ PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x01,NOTEQUALS,0x01)
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -324,7 +324,7 @@ static INPUT_PORTS_START( hotminda )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW1")
diff --git a/src/mame/drivers/prehisle.c b/src/mame/drivers/prehisle.c
index 5c3f8a316cc..823e9d5dbf8 100644
--- a/src/mame/drivers/prehisle.c
+++ b/src/mame/drivers/prehisle.c
@@ -140,7 +140,7 @@ static INPUT_PORTS_START( prehisle )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
/******************************************************************************/
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index a3b3ed59fea..fa3c3dbc9ee 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -279,7 +279,7 @@ INPUT_CHANGED_MEMBER(progolf_state::coin_inserted)
static INPUT_PORTS_START( progolf )
PORT_START("IN0")
PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
@@ -311,14 +311,14 @@ static INPUT_PORTS_START( progolf )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00)
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40)
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x10, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index 508b804ca20..4fff54dbd0e 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -124,9 +124,9 @@ READ32_MEMBER(psikyo_state::sngkace_input_r)
{
switch (offset)
{
- case 0x0: return input_port_read(machine(), "P1_P2");
- case 0x1: return input_port_read(machine(), "DSW");
- case 0x2: return input_port_read(machine(), "COIN");
+ case 0x0: return ioport("P1_P2")->read();
+ case 0x1: return ioport("DSW")->read();
+ case 0x2: return ioport("COIN")->read();
default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
return 0;
}
@@ -136,8 +136,8 @@ READ32_MEMBER(psikyo_state::gunbird_input_r)
{
switch (offset)
{
- case 0x0: return input_port_read(machine(), "P1_P2");
- case 0x1: return input_port_read(machine(), "DSW");
+ case 0x0: return ioport("P1_P2")->read();
+ case 0x1: return ioport("DSW")->read();
default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
return 0;
}
@@ -288,8 +288,8 @@ READ32_MEMBER(psikyo_state::s1945_input_r)
{
switch (offset)
{
- case 0x0: return input_port_read(machine(), "P1_P2");
- case 0x1: return (input_port_read(machine(), "DSW") & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
+ case 0x0: return ioport("P1_P2")->read();
+ case 0x1: return (ioport("DSW")->read() & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
case 0x2: return s1945_mcu_r(space, offset - 1, mem_mask);
default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(&space.device()), offset * 2);
return 0;
@@ -543,7 +543,7 @@ static INPUT_PORTS_START( samuraia )
PORT_INCLUDE(psikyo_common)
PORT_START("COIN")
- PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank
+ PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -670,7 +670,7 @@ static INPUT_PORTS_START( btlkroad )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_VBLANK ) // vblank ACTIVE_HIGH fixes slowdowns, but is it right?
+ PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank ACTIVE_HIGH fixes slowdowns, but is it right?
// This DSW is used for debugging the game
PORT_DIPNAME( 0x00000100, 0x00000100, "Unknown 3-0" ) // tested!
PORT_DIPSETTING( 0x00000100, DEF_STR( Off ) )
@@ -756,7 +756,7 @@ static INPUT_PORTS_START( gunbird )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank
+ PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
@@ -826,7 +826,7 @@ static INPUT_PORTS_START( s1945 )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank
+ PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
@@ -898,7 +898,7 @@ static INPUT_PORTS_START( s1945bl )
// I need to invert the Vblank on this to avoid excessive slowdown
PORT_MODIFY("DSW") /* c00004 -> c00007 */
- PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_VBLANK ) // vblank
+ PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
INPUT_PORTS_END
@@ -942,7 +942,7 @@ static INPUT_PORTS_START( tengai )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK ) // vblank
+ PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
@@ -1811,7 +1811,7 @@ static DRIVER_INIT( sngkace )
psikyo_state *state = machine.driver_data<psikyo_state>();
{
- UINT8 *RAM = machine.root_device().memregion("ymsnd")->base();
+ UINT8 *RAM = state->memregion("ymsnd")->base();
int len = state->memregion("ymsnd")->bytes();
int i;
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index be4c724236d..98a23f931c0 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -182,7 +182,7 @@ static READ32_DEVICE_HANDLER( ps4_eeprom_r )
{
if (ACCESSING_BITS_16_31)
{
- return input_port_read(device->machine(), "JP4");
+ return device->machine().root_device().ioport("JP4")->read();
}
// logerror("Unk EEPROM read mask %x\n", mem_mask);
@@ -197,7 +197,7 @@ static INTERRUPT_GEN(psikyosh_interrupt)
CUSTOM_INPUT_MEMBER(psikyo4_state::system_port_r)
{
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
CUSTOM_INPUT_MEMBER(psikyo4_state::mahjong_ctrl_r)/* used by hotgmck/hgkairak */
@@ -206,10 +206,10 @@ CUSTOM_INPUT_MEMBER(psikyo4_state::mahjong_ctrl_r)/* used by hotgmck/hgkairak */
int sel = (m_io_select[0] & 0x0000ff00) >> 8;
int ret = 0xff;
- if (sel & 1) ret &= input_port_read(machine(), player ? "KEY4" : "KEY0" );
- if (sel & 2) ret &= input_port_read(machine(), player ? "KEY5" : "KEY1" );
- if (sel & 4) ret &= input_port_read(machine(), player ? "KEY6" : "KEY2" );
- if (sel & 8) ret &= input_port_read(machine(), player ? "KEY7" : "KEY3" );
+ if (sel & 1) ret &= ioport(player ? "KEY4" : "KEY0" )->read();
+ if (sel & 2) ret &= ioport(player ? "KEY5" : "KEY1" )->read();
+ if (sel & 4) ret &= ioport(player ? "KEY6" : "KEY2" )->read();
+ if (sel & 8) ret &= ioport(player ? "KEY7" : "KEY3" )->read();
return ret;
}
@@ -328,7 +328,7 @@ WRITE32_MEMBER(psikyo4_state::ps4_vidregs_w)
static void set_hotgmck_pcm_bank( running_machine &machine, int n )
{
psikyo4_state *state = machine.driver_data<psikyo4_state>();
- UINT8 *ymf_pcmbank = machine.root_device().memregion("ymf")->base() + 0x200000;
+ UINT8 *ymf_pcmbank = state->memregion("ymf")->base() + 0x200000;
UINT8 *pcm_rom = state->memregion("ymfsource")->base();
memcpy(ymf_pcmbank + n * 0x100000, pcm_rom + PCM_BANK_NO_LEGACY(n) * 0x100000, 0x100000);
@@ -955,7 +955,7 @@ static void hotgmck_pcm_bank_postload(running_machine &machine)
static void install_hotgmck_pcm_bank(running_machine &machine)
{
psikyo4_state *state = machine.driver_data<psikyo4_state>();
- UINT8 *ymf_pcm = machine.root_device().memregion("ymf")->base();
+ UINT8 *ymf_pcm = state->memregion("ymf")->base();
UINT8 *pcm_rom = state->memregion("ymfsource")->base();
memcpy(ymf_pcm, pcm_rom, 0x200000);
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index 2bc4fe43708..d17d437a835 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -338,7 +338,7 @@ static READ32_DEVICE_HANDLER( psh_eeprom_r )
{
if (ACCESSING_BITS_24_31)
{
- return input_port_read(device->machine(), "JP4");
+ return device->machine().root_device().ioport("JP4")->read();
}
logerror("Unk EEPROM read mask %x\n", mem_mask);
@@ -437,8 +437,8 @@ P1KEY11 29|30 P2KEY11
GND 55|56 GND
*/
- UINT32 controls = input_port_read(machine(), "CONTROLLER");
- UINT32 value = input_port_read(machine(), "INPUTS");
+ UINT32 controls = ioport("CONTROLLER")->read();
+ UINT32 value = ioport("INPUTS")->read();
if(controls) {
// Clearly has ghosting, game will only recognise one key depressed at once, and keyboard can only represent keys with distinct rows and columns
@@ -483,7 +483,7 @@ P1KEY11 29|30 P2KEY11
KEY11 | KEY6, // Ron
KEY1 | KEY3 // Start
}; // generic Mahjong keyboard encoder, corresponds to ordering in input port
- UINT32 keys = input_port_read(machine(), "MAHJONG");
+ UINT32 keys = ioport("MAHJONG")->read();
UINT32 which_key = 0x1;
int count = 0;
diff --git a/src/mame/drivers/pushman.c b/src/mame/drivers/pushman.c
index b9dbccdf043..eed07e9f12d 100644
--- a/src/mame/drivers/pushman.c
+++ b/src/mame/drivers/pushman.c
@@ -215,7 +215,7 @@ static INPUT_PORTS_START( pushman )
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK ) /* not sure, probably wrong */
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* not sure, probably wrong */
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE1 )
@@ -282,7 +282,7 @@ static INPUT_PORTS_START( bballs )
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK ) /* not sure, probably wrong */
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* not sure, probably wrong */
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE1 )
diff --git a/src/mame/drivers/pzletime.c b/src/mame/drivers/pzletime.c
index b86c9dabcbb..3850f238953 100644
--- a/src/mame/drivers/pzletime.c
+++ b/src/mame/drivers/pzletime.c
@@ -235,7 +235,7 @@ static INPUT_PORTS_START( pzletime )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index 3b0a8b08310..b1904664ccc 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -41,7 +41,7 @@ CUSTOM_INPUT_MEMBER(qdrmfgp_state::inputs_r)
{
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(machine(), (m_control & 0x0080) ? tag1 : tag2);
+ return ioport((m_control & 0x0080) ? tag1 : tag2)->read();
}
CUSTOM_INPUT_MEMBER(qdrmfgp_state::battery_sensor_r)
diff --git a/src/mame/drivers/quantum.c b/src/mame/drivers/quantum.c
index 5eb436d63ae..f3709892e8f 100644
--- a/src/mame/drivers/quantum.c
+++ b/src/mame/drivers/quantum.c
@@ -74,19 +74,19 @@ public:
READ16_MEMBER(quantum_state::trackball_r)
{
- return (input_port_read(machine(), "TRACKY") << 4) | input_port_read(machine(), "TRACKX");
+ return (ioport("TRACKY")->read() << 4) | ioport("TRACKX")->read();
}
static READ8_DEVICE_HANDLER( input_1_r )
{
- return (input_port_read(device->machine(), "DSW0") << (7 - (offset - POT0_C))) & 0x80;
+ return (device->machine().root_device().ioport("DSW0")->read() << (7 - (offset - POT0_C))) & 0x80;
}
static READ8_DEVICE_HANDLER( input_2_r )
{
- return (input_port_read(device->machine(), "DSW1") << (7 - (offset - POT0_C))) & 0x80;
+ return (device->machine().root_device().ioport("DSW1")->read() << (7 - (offset - POT0_C))) & 0x80;
}
diff --git a/src/mame/drivers/quasar.c b/src/mame/drivers/quasar.c
index d2b4eee395f..e93ddbec3a1 100644
--- a/src/mame/drivers/quasar.c
+++ b/src/mame/drivers/quasar.c
@@ -72,10 +72,10 @@ READ8_MEMBER(quasar_state::quasar_IO_r)
switch (m_io_page)
{
- case 0: ans = input_port_read(machine(), "IN0"); break;
- case 1: ans = input_port_read(machine(), "IN1"); break;
- case 2: ans = input_port_read(machine(), "DSW0"); break;
- case 3: ans = input_port_read(machine(), "DSW1"); break;
+ case 0: ans = ioport("IN0")->read(); break;
+ case 1: ans = ioport("IN1")->read(); break;
+ case 2: ans = ioport("DSW0")->read(); break;
+ case 3: ans = ioport("DSW1")->read(); break;
}
return ans;
@@ -99,7 +99,7 @@ WRITE8_MEMBER(quasar_state::quasar_sh_command_w)
READ8_MEMBER(quasar_state::quasar_sh_command_r)
{
- return soundlatch_byte_r(space, 0) + (input_port_read(machine(), "DSW2") & 0x30);
+ return soundlatch_byte_r(space, 0) + (ioport("DSW2")->read() & 0x30);
}
READ8_MEMBER(quasar_state::audio_t1_r)
@@ -220,7 +220,7 @@ static INPUT_PORTS_START( quasar )
PORT_DIPSETTING( 0x00, "Wrap Around" )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
#if 0
diff --git a/src/mame/drivers/quizpani.c b/src/mame/drivers/quizpani.c
index 88cddcf4d18..8e2997fcd38 100644
--- a/src/mame/drivers/quizpani.c
+++ b/src/mame/drivers/quizpani.c
@@ -88,39 +88,39 @@ static INPUT_PORTS_START( quizpani )
PORT_START("P1_P2")
/* "Standard" buttons layout */
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0002)
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0002)
/* "Alternate" buttons layout */
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */ PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */ PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */ PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */ PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */ PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */ PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,PORTCOND_EQUALS,0x0000)
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */ PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */ PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P1 */ PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */ PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */ PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* dup. B1 P2 */ PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1",0x0002,EQUALS,0x0000)
PORT_START("DSW1")
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) /* guess, but check code at 0x004d9c and write to 0x100014 */
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index bc08876b975..f9fc3f735c5 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -138,7 +138,7 @@ static INPUT_PORTS_START( raiden )
PORT_DIPSETTING( 0x0001, "A" )
PORT_DIPSETTING( 0x0000, "B" )
/* Coin Mode A */
- PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3,4,5")
+ PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3,4,5")
PORT_DIPSETTING( 0x0014, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0x0016, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) )
@@ -156,12 +156,12 @@ static INPUT_PORTS_START( raiden )
PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
/* Coin Mode B */
- PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3")
+ PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0001, NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3")
PORT_DIPSETTING( 0x0000, "5C/1C or Free if Coin B too" )
PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:4,5")
+ PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0001, NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:4,5")
PORT_DIPSETTING( 0x0018, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_5C ) )
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index 2a88c6f3eca..ce574e15672 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -435,23 +435,23 @@ static INPUT_PORTS_START( rbisland_generic )
PORT_START("DSWA")
TAITO_MACHINE_COCKTAIL
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
- PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_START("DSWB")
TAITO_DIFFICULTY
diff --git a/src/mame/drivers/rallyx.c b/src/mame/drivers/rallyx.c
index c142052c6a5..7b2f22c9327 100644
--- a/src/mame/drivers/rallyx.c
+++ b/src/mame/drivers/rallyx.c
@@ -397,37 +397,37 @@ static INPUT_PORTS_START( rallyx )
PORT_DIPSETTING( 0x20, "3 Cars, Medium" )
PORT_DIPSETTING( 0x38, "3 Cars, Hard" )
PORT_DIPNAME( 0x06, 0x02, DEF_STR( Bonus_Life ) )
- PORT_DIPSETTING( 0x02, "15000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x04, "30000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x06, "40000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x02, "15000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x04, "30000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x06, "40000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x00)
- PORT_DIPSETTING( 0x02, "20000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x04, "40000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x06, "60000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
+ PORT_DIPSETTING( 0x02, "20000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x04, "40000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x06, "60000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x08)
- PORT_DIPSETTING( 0x02, "10000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
- PORT_DIPSETTING( 0x04, "20000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
- PORT_DIPSETTING( 0x06, "30000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
+ PORT_DIPSETTING( 0x02, "10000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x10)
+ PORT_DIPSETTING( 0x04, "20000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x10)
+ PORT_DIPSETTING( 0x06, "30000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x10)
- PORT_DIPSETTING( 0x02, "15000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
- PORT_DIPSETTING( 0x04, "30000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
- PORT_DIPSETTING( 0x06, "40000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
+ PORT_DIPSETTING( 0x02, "15000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x18)
+ PORT_DIPSETTING( 0x04, "30000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x18)
+ PORT_DIPSETTING( 0x06, "40000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x18)
- PORT_DIPSETTING( 0x02, "20000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x04, "40000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x06, "60000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
+ PORT_DIPSETTING( 0x02, "20000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x04, "40000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x06, "60000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x20)
- PORT_DIPSETTING( 0x02, "10000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
- PORT_DIPSETTING( 0x04, "20000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
- PORT_DIPSETTING( 0x06, "30000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
+ PORT_DIPSETTING( 0x02, "10000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x28)
+ PORT_DIPSETTING( 0x04, "20000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x28)
+ PORT_DIPSETTING( 0x06, "30000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x28)
- PORT_DIPSETTING( 0x02, "15000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
- PORT_DIPSETTING( 0x04, "30000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
- PORT_DIPSETTING( 0x06, "40000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
+ PORT_DIPSETTING( 0x02, "15000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x30)
+ PORT_DIPSETTING( 0x04, "30000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x30)
+ PORT_DIPSETTING( 0x06, "40000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x30)
- PORT_DIPSETTING( 0x02, "20000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
- PORT_DIPSETTING( 0x04, "40000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
- PORT_DIPSETTING( 0x06, "60000" ) PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
+ PORT_DIPSETTING( 0x02, "20000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x38)
+ PORT_DIPSETTING( 0x04, "40000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x38)
+ PORT_DIPSETTING( 0x06, "60000" ) PORT_CONDITION("DSW", 0x38, EQUALS, 0x38)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
INPUT_PORTS_END
diff --git a/src/mame/drivers/rampart.c b/src/mame/drivers/rampart.c
index 7693e1c6760..9b6fa28fb8d 100644
--- a/src/mame/drivers/rampart.c
+++ b/src/mame/drivers/rampart.c
@@ -177,7 +177,7 @@ static INPUT_PORTS_START( rampart )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
@@ -221,7 +221,7 @@ static INPUT_PORTS_START( ramprt2p )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
@@ -271,7 +271,7 @@ static INPUT_PORTS_START( rampartj )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c
index 3a82a8efce1..b983a8492ae 100644
--- a/src/mame/drivers/re900.c
+++ b/src/mame/drivers/re900.c
@@ -108,7 +108,7 @@ public:
static READ8_DEVICE_HANDLER (re_psg_portA_r)
{
- if ((input_port_read(device->machine(), "IN0") & 0x01) == 0)
+ if ((device->machine().root_device().ioport("IN0")->read() & 0x01) == 0)
{
output_set_lamp_value(0,1); // Operator Key ON
}
@@ -118,7 +118,7 @@ static READ8_DEVICE_HANDLER (re_psg_portA_r)
output_set_lamp_value(0,0); // Operator Key OFF
}
- return input_port_read(device->machine(), "IN0");
+ return device->machine().root_device().ioport("IN0")->read();
}
static READ8_DEVICE_HANDLER (re_psg_portB_r)
@@ -130,7 +130,7 @@ static READ8_DEVICE_HANDLER (re_psg_portB_r)
output_set_lamp_value(state->m_player,1);
- if (input_port_read(device->machine(), "IN_S"))
+ if (state->ioport("IN_S")->read())
{
if (!state->m_stat_a)
{
@@ -161,12 +161,12 @@ static READ8_DEVICE_HANDLER (re_psg_portB_r)
/* "INA": Unified port to share the player Keys among all players - Key In & Key Out have their own buttons on keyboard. */
switch( state->m_mux_data )
{
- case 0x01: retval = (input_port_read(device->machine(), "IN6") | 0x80 ) - (( state->m_player == 6 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 6 */
- case 0x02: retval = (input_port_read(device->machine(), "IN5") | 0x80 ) - (( state->m_player == 5 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 5 */
- case 0x04: retval = (input_port_read(device->machine(), "IN4") | 0x80 ) - (( state->m_player == 4 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 4 */
- case 0x08: retval = (input_port_read(device->machine(), "IN3") | 0x80 ) - (( state->m_player == 3 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 3 */
- case 0x10: retval = (input_port_read(device->machine(), "IN2") | 0x80 ) - (( state->m_player == 2 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 2 */
- case 0x20: retval = (input_port_read(device->machine(), "IN1") | 0x80 ) - (( state->m_player == 1 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 1 */
+ case 0x01: retval = (state->ioport("IN6")->read() | 0x80 ) - (( state->m_player == 6 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 6 */
+ case 0x02: retval = (state->ioport("IN5")->read() | 0x80 ) - (( state->m_player == 5 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 5 */
+ case 0x04: retval = (state->ioport("IN4")->read() | 0x80 ) - (( state->m_player == 4 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 4 */
+ case 0x08: retval = (state->ioport("IN3")->read() | 0x80 ) - (( state->m_player == 3 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 3 */
+ case 0x10: retval = (state->ioport("IN2")->read() | 0x80 ) - (( state->m_player == 2 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 2 */
+ case 0x20: retval = (state->ioport("IN1")->read() | 0x80 ) - (( state->m_player == 1 ) ? (state->ioport("INA")->read() | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 1 */
}
return retval;
diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c
index b8db2d2da54..2b02fca173b 100644
--- a/src/mame/drivers/realbrk.c
+++ b/src/mame/drivers/realbrk.c
@@ -53,15 +53,15 @@ To Do:
READ16_MEMBER(realbrk_state::realbrk_dsw_r)
{
UINT16 sel = ~m_dsw_select[0];
- if (sel & 0x01) return (input_port_read(machine(), "SW1") & 0x00ff) << 8; // DSW1 low bits
- if (sel & 0x02) return (input_port_read(machine(), "SW2") & 0x00ff) << 8; // DSW2 low bits
- if (sel & 0x04) return (input_port_read(machine(), "SW3") & 0x00ff) << 8; // DSW3 low bits
- if (sel & 0x08) return (input_port_read(machine(), "SW4") & 0x00ff) << 8; // DSW4 low bits
+ if (sel & 0x01) return (ioport("SW1")->read() & 0x00ff) << 8; // DSW1 low bits
+ if (sel & 0x02) return (ioport("SW2")->read() & 0x00ff) << 8; // DSW2 low bits
+ if (sel & 0x04) return (ioport("SW3")->read() & 0x00ff) << 8; // DSW3 low bits
+ if (sel & 0x08) return (ioport("SW4")->read() & 0x00ff) << 8; // DSW4 low bits
- if (sel & 0x10) return ((input_port_read(machine(), "SW1") & 0x0300) << 0) | // DSWs high 2 bits
- ((input_port_read(machine(), "SW2") & 0x0300) << 2) |
- ((input_port_read(machine(), "SW3") & 0x0300) << 4) |
- ((input_port_read(machine(), "SW4") & 0x0300) << 6) ;
+ if (sel & 0x10) return ((ioport("SW1")->read() & 0x0300) << 0) | // DSWs high 2 bits
+ ((ioport("SW2")->read() & 0x0300) << 2) |
+ ((ioport("SW3")->read() & 0x0300) << 4) |
+ ((ioport("SW4")->read() & 0x0300) << 6) ;
logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",cpu_get_pc(&space.device()),m_dsw_select[0]);
return 0xffff;
@@ -73,14 +73,14 @@ READ16_MEMBER(realbrk_state::pkgnsh_input_r)
{
case 0x00/2: return 0xffff;
case 0x02/2: return 0xffff;
- case 0x04/2: return input_port_read(machine(), "IN0"); /*Service buttons*/
- case 0x06/2: return input_port_read(machine(), "SW1"); /*DIP 2*/
- case 0x08/2: return input_port_read(machine(), "SW2"); /*DIP 1*/
- case 0x0a/2: return input_port_read(machine(), "SW3"); /*DIP 1+2 Hi-Bits*/
- case 0x0c/2: return input_port_read(machine(), "PADDLE1"); /*Handle 1p*/
- case 0x0e/2: return input_port_read(machine(), "P1"); /*Buttons 1p*/
- case 0x10/2: return input_port_read(machine(), "PADDLE2"); /*Handle 2p*/
- case 0x12/2: return input_port_read(machine(), "P2"); /*Buttons 2p*/
+ case 0x04/2: return ioport("IN0")->read(); /*Service buttons*/
+ case 0x06/2: return ioport("SW1")->read(); /*DIP 2*/
+ case 0x08/2: return ioport("SW2")->read(); /*DIP 1*/
+ case 0x0a/2: return ioport("SW3")->read(); /*DIP 1+2 Hi-Bits*/
+ case 0x0c/2: return ioport("PADDLE1")->read(); /*Handle 1p*/
+ case 0x0e/2: return ioport("P1")->read(); /*Buttons 1p*/
+ case 0x10/2: return ioport("PADDLE2")->read(); /*Handle 2p*/
+ case 0x12/2: return ioport("P2")->read(); /*Buttons 2p*/
}
return 0xffff;
}
@@ -92,22 +92,22 @@ READ16_MEMBER(realbrk_state::pkgnshdx_input_r)
switch(offset)
{
case 0x00/2: return 0xffff;
- case 0x02/2: return input_port_read(machine(), "IN0"); /*Service buttons*/
+ case 0x02/2: return ioport("IN0")->read(); /*Service buttons*/
/*DSW,same handling as realbrk*/
case 0x04/2:
- if (sel & 0x01) return (input_port_read(machine(), "SW1") & 0x00ff) << 8; // DSW1 low bits
- if (sel & 0x02) return (input_port_read(machine(), "SW2") & 0x00ff) << 8; // DSW2 low bits
- if (sel & 0x04) return (input_port_read(machine(), "SW3") & 0x00ff) << 8; // DSW3 low bits
- if (sel & 0x08) return (input_port_read(machine(), "SW4") & 0x00ff) << 8; // DSW4 low bits
+ if (sel & 0x01) return (ioport("SW1")->read() & 0x00ff) << 8; // DSW1 low bits
+ if (sel & 0x02) return (ioport("SW2")->read() & 0x00ff) << 8; // DSW2 low bits
+ if (sel & 0x04) return (ioport("SW3")->read() & 0x00ff) << 8; // DSW3 low bits
+ if (sel & 0x08) return (ioport("SW4")->read() & 0x00ff) << 8; // DSW4 low bits
- if (sel & 0x10) return ((input_port_read(machine(), "SW1") & 0x0300) << 0) | // DSWs high 2 bits
- ((input_port_read(machine(), "SW2") & 0x0300) << 2) |
- ((input_port_read(machine(), "SW3") & 0x0300) << 4) |
- ((input_port_read(machine(), "SW4") & 0x0300) << 6) ;
+ if (sel & 0x10) return ((ioport("SW1")->read() & 0x0300) << 0) | // DSWs high 2 bits
+ ((ioport("SW2")->read() & 0x0300) << 2) |
+ ((ioport("SW3")->read() & 0x0300) << 4) |
+ ((ioport("SW4")->read() & 0x0300) << 6) ;
return 0xffff;
- case 0x06/2: return input_port_read(machine(), "P2");/*Buttons+Handle 2p*/
- case 0x08/2: return input_port_read(machine(), "P1");/*Buttons+Handle 1p*/
+ case 0x06/2: return ioport("P2")->read();/*Buttons+Handle 2p*/
+ case 0x08/2: return ioport("P1")->read();/*Buttons+Handle 1p*/
case 0x0a/2: return 0xffff;
case 0x0c/2: return 0xffff;
case 0x0e/2: return 0xffff;
diff --git a/src/mame/drivers/redalert.c b/src/mame/drivers/redalert.c
index e1549454302..9102d3bf72d 100644
--- a/src/mame/drivers/redalert.c
+++ b/src/mame/drivers/redalert.c
@@ -109,7 +109,7 @@
static INTERRUPT_GEN( redalert_vblank_interrupt )
{
- if( input_port_read(device->machine(), "COIN") )
+ if( device->machine().root_device().ioport("COIN")->read() )
/* the service coin as conntected to the CPU's RDY pin as well */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -136,12 +136,12 @@ READ8_MEMBER(redalert_state::panther_interrupt_clear_r)
{
cputag_set_input_line(machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
- return input_port_read(machine(), "STICK0");
+ return ioport("STICK0")->read();
}
READ8_MEMBER(redalert_state::panther_unk_r)
{
- return ((machine().rand() & 0x01) | (input_port_read(machine(), "C020") & 0xfe));
+ return ((machine().rand() & 0x01) | (ioport("C020")->read() & 0xfe));
}
/*************************************
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index b9e79cc83b4..dc9e23a9ed5 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -109,7 +109,7 @@ static INPUT_PORTS_START( redclash )
/* Note that there are TWO VBlank inputs, one is active low, the other active */
/* high. There are probably other differencies in the hardware, but emulating */
/* them this way is enough to get the game running. */
- PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
+ PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Difficulty?" )
@@ -202,7 +202,7 @@ static INPUT_PORTS_START( zerohour )
/* Note that there are TWO VBlank inputs, one is active low, the other active */
/* high. There are probably other differencies in the hardware, but emulating */
/* them this way is enough to get the game running. */
- PORT_BIT( 0xc0, 0x40, IPT_VBLANK )
+ PORT_BIT( 0xc0, 0x40, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:8" ) /* Switches 6-8 are not used */
diff --git a/src/mame/drivers/relief.c b/src/mame/drivers/relief.c
index 74724654b96..9ebd1b84ceb 100644
--- a/src/mame/drivers/relief.c
+++ b/src/mame/drivers/relief.c
@@ -95,7 +95,7 @@ static MACHINE_RESET( relief )
READ16_MEMBER(relief_state::special_port2_r)
{
- int result = input_port_read(machine(), "260010");
+ int result = ioport("260010")->read();
if (m_cpu_to_sound_ready) result ^= 0x0020;
if (!(result & 0x0080) || atarigen_get_hblank(*machine().primary_screen)) result ^= 0x0001;
return result;
@@ -235,7 +235,7 @@ static INPUT_PORTS_START( relief )
PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* tested before writing to 260040 */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("260012") /* 260012 */
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 907aeec9a22..afbb2bc41b7 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -717,7 +717,7 @@ static INPUT_PORTS_START( renegade )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* attack right */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* attack right */
PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, renegade_state,mcu_status_r, NULL)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_START("DSW1") /* DIP1 */
diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c
index a6567fa8835..5d987bc769e 100644
--- a/src/mame/drivers/rltennis.c
+++ b/src/mame/drivers/rltennis.c
@@ -72,7 +72,7 @@ player - when there's nothing to play - first, empty 2k of ROMs are selected.
READ16_MEMBER(rltennis_state::rlt_io_r)
{
- return (input_port_read(machine(), "P1" )&0x1fff) | (m_unk_counter<<13); /* top 3 bits controls smaple address update */
+ return (ioport("P1" )->read()&0x1fff) | (m_unk_counter<<13); /* top 3 bits controls smaple address update */
}
WRITE16_MEMBER(rltennis_state::rlt_snd1_w)
@@ -162,8 +162,8 @@ static MACHINE_START( rltennis )
state->m_screen = machine.device( "screen");
state->m_dac_1 = machine.device("dac1");
state->m_dac_2 = machine.device("dac2");
- state->m_samples_1 = machine.root_device().memregion("samples1")->base();
- state->m_samples_2 = machine.root_device().memregion("samples2")->base();
+ state->m_samples_1 = state->memregion("samples1")->base();
+ state->m_samples_2 = state->memregion("samples2")->base();
state->m_gfx = state->memregion("gfx1")->base();
state->m_timer = machine.scheduler().timer_alloc(FUNC(sample_player));
}
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index 186da5fef2e..67f7fe7b9c9 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -114,9 +114,9 @@ READ8_MEMBER(rmhaihai_state::keyboard_r)
for (i = 0; i < 31; i++)
{
- if (input_port_read(machine(), keynames[i/16]) & (1 << (i & 15))) return i+1;
+ if (ioport(keynames[i/16])->read() & (1 << (i & 15))) return i+1;
}
- if (input_port_read(machine(), "KEY1") & 0x8000) return 0x80; // coin
+ if (ioport("KEY1")->read() & 0x8000) return 0x80; // coin
return 0;
}
case 0x5c7b: // rmhaihai, rmhaisei, rmhaijin
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index d7a4be56362..7ccb87db1e0 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -298,7 +298,7 @@ static INPUT_PORTS_START( rohga )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1_2")
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
@@ -396,7 +396,7 @@ static INPUT_PORTS_START( wizdfire )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1_2")
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
@@ -469,7 +469,7 @@ static INPUT_PORTS_START( nitrobal )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1_2")
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
@@ -553,7 +553,7 @@ static INPUT_PORTS_START( schmeisr )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1_2")
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
diff --git a/src/mame/drivers/rollrace.c b/src/mame/drivers/rollrace.c
index aa15b0cfdf2..f33ce435dab 100644
--- a/src/mame/drivers/rollrace.c
+++ b/src/mame/drivers/rollrace.c
@@ -127,7 +127,7 @@ static INPUT_PORTS_START( rollrace )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_6C ) )
-/* PORT_BIT( 0x40, IP_ACTIVE_HIGH , IPT_VBLANK ) freezes frame, could be vblank ?*/
+/* PORT_BIT( 0x40, IP_ACTIVE_HIGH , IPT_CUSTOM ) PORT_VBLANK("screen") freezes frame, could be vblank ?*/
PORT_DIPNAME( 0x40, 0x00, "Freeze" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index 1075cdd93a0..0957dc61349 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -163,10 +163,10 @@ READ8_MEMBER(route16_state::ttmahjng_input_port_matrix_r)
switch (m_ttmahjng_port_select)
{
- case 1: ret = input_port_read(machine(), "KEY0"); break;
- case 2: ret = input_port_read(machine(), "KEY1"); break;
- case 4: ret = input_port_read(machine(), "KEY2"); break;
- case 8: ret = input_port_read(machine(), "KEY3"); break;
+ case 1: ret = ioport("KEY0")->read(); break;
+ case 2: ret = ioport("KEY1")->read(); break;
+ case 4: ret = ioport("KEY2")->read(); break;
+ case 8: ret = ioport("KEY3")->read(); break;
default: break;
}
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index b0e314881d3..02f8426d490 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -326,13 +326,13 @@ WRITE8_MEMBER(royalmah_state::input_port_select_w)
static READ8_DEVICE_HANDLER( royalmah_player_1_port_r )
{
royalmah_state *state = device->machine().driver_data<royalmah_state>();
- int ret = (input_port_read(device->machine(), "KEY0") & 0xc0) | 0x3f;
+ int ret = (state->ioport("KEY0")->read() & 0xc0) | 0x3f;
- if ((state->m_input_port_select & 0x01) == 0) ret &= input_port_read(device->machine(), "KEY0");
- if ((state->m_input_port_select & 0x02) == 0) ret &= input_port_read(device->machine(), "KEY1");
- if ((state->m_input_port_select & 0x04) == 0) ret &= input_port_read(device->machine(), "KEY2");
- if ((state->m_input_port_select & 0x08) == 0) ret &= input_port_read(device->machine(), "KEY3");
- if ((state->m_input_port_select & 0x10) == 0) ret &= input_port_read(device->machine(), "KEY4");
+ if ((state->m_input_port_select & 0x01) == 0) ret &= state->ioport("KEY0")->read();
+ if ((state->m_input_port_select & 0x02) == 0) ret &= state->ioport("KEY1")->read();
+ if ((state->m_input_port_select & 0x04) == 0) ret &= state->ioport("KEY2")->read();
+ if ((state->m_input_port_select & 0x08) == 0) ret &= state->ioport("KEY3")->read();
+ if ((state->m_input_port_select & 0x10) == 0) ret &= state->ioport("KEY4")->read();
return ret;
}
@@ -340,13 +340,13 @@ static READ8_DEVICE_HANDLER( royalmah_player_1_port_r )
static READ8_DEVICE_HANDLER( royalmah_player_2_port_r )
{
royalmah_state *state = device->machine().driver_data<royalmah_state>();
- int ret = (input_port_read(device->machine(), "KEY5") & 0xc0) | 0x3f;
+ int ret = (state->ioport("KEY5")->read() & 0xc0) | 0x3f;
- if ((state->m_input_port_select & 0x01) == 0) ret &= input_port_read(device->machine(), "KEY5");
- if ((state->m_input_port_select & 0x02) == 0) ret &= input_port_read(device->machine(), "KEY6");
- if ((state->m_input_port_select & 0x04) == 0) ret &= input_port_read(device->machine(), "KEY7");
- if ((state->m_input_port_select & 0x08) == 0) ret &= input_port_read(device->machine(), "KEY8");
- if ((state->m_input_port_select & 0x10) == 0) ret &= input_port_read(device->machine(), "KEY9");
+ if ((state->m_input_port_select & 0x01) == 0) ret &= state->ioport("KEY5")->read();
+ if ((state->m_input_port_select & 0x02) == 0) ret &= state->ioport("KEY6")->read();
+ if ((state->m_input_port_select & 0x04) == 0) ret &= state->ioport("KEY7")->read();
+ if ((state->m_input_port_select & 0x08) == 0) ret &= state->ioport("KEY8")->read();
+ if ((state->m_input_port_select & 0x10) == 0) ret &= state->ioport("KEY9")->read();
return ret;
}
@@ -357,9 +357,9 @@ READ8_MEMBER(royalmah_state::majs101b_dsw_r)
{
switch (m_dsw_select)
{
- case 0x00: return input_port_read(machine(), "DSW3"); /* DSW3 */
- case 0x20: return input_port_read(machine(), "DSW4"); /* DSW4 */
- case 0x40: return input_port_read(machine(), "DSW2"); /* DSW2 */
+ case 0x00: return ioport("DSW3")->read(); /* DSW3 */
+ case 0x20: return ioport("DSW4")->read(); /* DSW4 */
+ case 0x40: return ioport("DSW2")->read(); /* DSW2 */
}
return 0;
}
@@ -376,9 +376,9 @@ READ8_MEMBER(royalmah_state::suzume_dsw_r)
{
switch (m_suzume_bank)
{
- case 0x08: return input_port_read(machine(), "DSW4"); /* DSW4 */
- case 0x10: return input_port_read(machine(), "DSW3"); /* DSW3 */
- case 0x18: return input_port_read(machine(), "DSW2"); /* DSW2 */
+ case 0x08: return ioport("DSW4")->read(); /* DSW4 */
+ case 0x10: return ioport("DSW3")->read(); /* DSW3 */
+ case 0x18: return ioport("DSW2")->read(); /* DSW2 */
}
return 0;
}
@@ -417,7 +417,7 @@ WRITE8_MEMBER(royalmah_state::mjapinky_palbank_w)
READ8_MEMBER(royalmah_state::mjapinky_dsw_r)
{
- if (m_rombank == 0x0e) return input_port_read(machine(), "DSW3");
+ if (m_rombank == 0x0e) return ioport("DSW3")->read();
else return *(machine().root_device().memregion("maincpu")->base() + 0x10000 + 0x8000 * m_rombank);
}
@@ -459,10 +459,10 @@ READ8_MEMBER(royalmah_state::daisyari_dsw_r)
{
switch (m_dsw_select)
{
- case 0x00: return input_port_read(machine(), "DSW4");
- case 0x04: return input_port_read(machine(), "DSW1");
- case 0x08: return input_port_read(machine(), "DSW2");
- case 0x0c: return input_port_read(machine(), "DSW3");
+ case 0x00: return ioport("DSW4")->read();
+ case 0x04: return ioport("DSW1")->read();
+ case 0x08: return ioport("DSW2")->read();
+ case 0x0c: return ioport("DSW3")->read();
}
return 0;
@@ -487,10 +487,10 @@ READ8_MEMBER(royalmah_state::mjclub_dsw_r)
{
switch (m_dsw_select)
{
-// case 0x00: return input_port_read(machine(), "DSW4");
- case 0x40: return input_port_read(machine(), "DSW2");
- case 0x80: return input_port_read(machine(), "DSW3");
- case 0xc0: return input_port_read(machine(), "DSW4");
+// case 0x00: return ioport("DSW4")->read();
+ case 0x40: return ioport("DSW2")->read();
+ case 0x80: return ioport("DSW3")->read();
+ case 0xc0: return ioport("DSW4")->read();
}
return 0;
@@ -694,9 +694,9 @@ READ8_MEMBER(royalmah_state::jansou_dsw_r)
{
switch (m_dsw_select & 7)
{
- case 1: return input_port_read(machine(), "DSW1");
- case 2: return input_port_read(machine(), "DSW2");
- case 4: return input_port_read(machine(), "DSW3");
+ case 1: return ioport("DSW1")->read();
+ case 2: return ioport("DSW2")->read();
+ case 4: return ioport("DSW3")->read();
}
return 0xff;
@@ -818,11 +818,11 @@ READ8_MEMBER(royalmah_state::janptr96_dswsel_r)
READ8_MEMBER(royalmah_state::janptr96_dsw_r)
{
- if (~m_dsw_select & 0x01) return input_port_read(machine(), "DSW4");
- if (~m_dsw_select & 0x02) return input_port_read(machine(), "DSW3");
- if (~m_dsw_select & 0x04) return input_port_read(machine(), "DSW2");
- if (~m_dsw_select & 0x08) return input_port_read(machine(), "DSW1");
- if (~m_dsw_select & 0x10) return input_port_read(machine(), "DSWTOP");
+ if (~m_dsw_select & 0x01) return ioport("DSW4")->read();
+ if (~m_dsw_select & 0x02) return ioport("DSW3")->read();
+ if (~m_dsw_select & 0x04) return ioport("DSW2")->read();
+ if (~m_dsw_select & 0x08) return ioport("DSW1")->read();
+ if (~m_dsw_select & 0x10) return ioport("DSWTOP")->read();
return 0xff;
}
@@ -886,10 +886,10 @@ READ8_MEMBER(royalmah_state::mjifb_rom_io_r)
switch(offset)
{
- case 0x8000: return input_port_read(machine(), "DSW4"); // dsw 4
- case 0x8200: return input_port_read(machine(), "DSW3"); // dsw 3
+ case 0x8000: return ioport("DSW4")->read(); // dsw 4
+ case 0x8200: return ioport("DSW3")->read(); // dsw 3
case 0x9001: return ay8910_r(machine().device("aysnd"), 0); // inputs
- case 0x9011: return input_port_read(machine(), "SYSTEM");
+ case 0x9011: return ioport("SYSTEM")->read();
}
logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(&space.device()), offset);
@@ -940,19 +940,19 @@ ADDRESS_MAP_END
READ8_MEMBER(royalmah_state::mjifb_p3_r)
{
- return input_port_read(machine(), "PORT3_5") >> 6;
+ return ioport("PORT3_5")->read() >> 6;
}
READ8_MEMBER(royalmah_state::mjifb_p5_r)
{
- return input_port_read(machine(), "PORT3_5");
+ return ioport("PORT3_5")->read();
}
READ8_MEMBER(royalmah_state::mjifb_p6_r)
{
- return input_port_read(machine(), "PORT6_7");
+ return ioport("PORT6_7")->read();
}
READ8_MEMBER(royalmah_state::mjifb_p7_r)
{
- return input_port_read(machine(), "PORT6_7") >> 4;
+ return ioport("PORT6_7")->read() >> 4;
}
READ8_MEMBER(royalmah_state::mjifb_p8_r)
{
@@ -995,10 +995,10 @@ READ8_MEMBER(royalmah_state::mjdejavu_rom_io_r)
switch(offset)
{
- case 0x8000: return input_port_read(machine(), "DSW2"); // dsw 2
- case 0x8001: return input_port_read(machine(), "DSW1"); // dsw 1
+ case 0x8000: return ioport("DSW2")->read(); // dsw 2
+ case 0x8001: return ioport("DSW1")->read(); // dsw 1
case 0x9001: return ay8910_r(machine().device("aysnd"), 0); // inputs
- case 0x9011: return input_port_read(machine(), "SYSTEM");
+ case 0x9011: return ioport("SYSTEM")->read();
}
logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(&space.device()), offset);
@@ -1113,11 +1113,11 @@ READ8_MEMBER(royalmah_state::cafetime_dsw_r)
{
switch( m_dsw_select )
{
- 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");
+ case 0x00: return ioport("DSW1")->read();
+ case 0x01: return ioport("DSW2")->read();
+ case 0x02: return ioport("DSW3")->read();
+ case 0x03: return ioport("DSW4")->read();
+ case 0x04: return ioport("DSWTOP")->read();
}
logerror("%04X: unmapped dsw read %02X\n", cpu_get_pc(&space.device()), m_dsw_select);
return 0xff;
@@ -1891,14 +1891,14 @@ static INPUT_PORTS_START( mjclub )
PORT_DIPSETTING( 0x02, "B" )
PORT_DIPSETTING( 0x01, "C" )
PORT_DIPSETTING( 0x03, "D" )
- PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x00)
- PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x02)
- PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (3renchan bonus)" ) PORT_DIPLOCATION("SW2:3,4") PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x01)
+ PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, EQUALS, 0x00)
+ PORT_DIPUNUSED_DIPLOC( 0x0c, 0x08, "SW2:3,4" ) PORT_CONDITION("DSW3", 0x03, EQUALS, 0x02)
+ PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (3renchan bonus)" ) PORT_DIPLOCATION("SW2:3,4") PORT_CONDITION("DSW3", 0x03, EQUALS, 0x01)
PORT_DIPSETTING( 0x00, "A (1 2 2 3 pts.)" )
PORT_DIPSETTING( 0x04, "B (1 2 2 5 pts.)" )
PORT_DIPSETTING( 0x08, "C (1 2 3 6 pts.)" )
PORT_DIPSETTING( 0x0c, "D (1 2 6 10 pts.)" )
- PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (5renchan bonus)" ) PORT_DIPLOCATION("SW2:3,4") PORT_CONDITION("DSW3", 0x03, PORTCOND_EQUALS, 0x03)
+ PORT_DIPNAME( 0x0c, 0x08, "Bonus Rate (5renchan bonus)" ) PORT_DIPLOCATION("SW2:3,4") PORT_CONDITION("DSW3", 0x03, EQUALS, 0x03)
PORT_DIPSETTING( 0x00, "A (5 pts.)" )
PORT_DIPSETTING( 0x04, "B (10 pts.)" )
PORT_DIPSETTING( 0x08, "C (15 pts.)" )
diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c
index ddd29c0f017..489339f83a0 100644
--- a/src/mame/drivers/rpunch.c
+++ b/src/mame/drivers/rpunch.c
@@ -146,7 +146,7 @@ static MACHINE_RESET( rpunch )
CUSTOM_INPUT_MEMBER(rpunch_state::hi_bits_r)
{
- return input_port_read(machine(), "SERVICE");
+ return ioport("SERVICE")->read();
}
diff --git a/src/mame/drivers/runaway.c b/src/mame/drivers/runaway.c
index cab1ae96b68..838d1e797ca 100644
--- a/src/mame/drivers/runaway.c
+++ b/src/mame/drivers/runaway.c
@@ -50,11 +50,11 @@ READ8_MEMBER(runaway_state::runaway_input_r)
{
UINT8 val = 0;
- if (input_port_read(machine(), "3000D7") & (1 << offset))
+ if (ioport("3000D7")->read() & (1 << offset))
{
val |= 0x80;
}
- if (input_port_read(machine(), "3000D6") & (1 << offset))
+ if (ioport("3000D6")->read() & (1 << offset))
{
val |= 0x40;
}
@@ -65,7 +65,7 @@ READ8_MEMBER(runaway_state::runaway_input_r)
static READ8_DEVICE_HANDLER( runaway_pot_r )
{
- return (input_port_read(device->machine(), "7000") << (7 - offset)) & 0x80;
+ return (device->machine().root_device().ioport("7000")->read() << (7 - offset)) & 0x80;
}
@@ -107,7 +107,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( qwak )
PORT_START("3000D7") /* 3000 D7 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -159,7 +159,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( runaway )
PORT_START("3000D7") /* 3000 D7 */
PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index a03114b2695..32e85497d2b 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -72,20 +72,20 @@ READ16_MEMBER(rungun_state::rng_sysregs_r)
switch (offset)
{
case 0x00/2:
- if (input_port_read(machine(), "DSW") & 0x20)
- return (input_port_read(machine(), "P1") | input_port_read(machine(), "P3") << 8);
+ if (ioport("DSW")->read() & 0x20)
+ return (ioport("P1")->read() | ioport("P3")->read() << 8);
else
{
- data = input_port_read(machine(), "P1") & input_port_read(machine(), "P3");
+ data = ioport("P1")->read() & ioport("P3")->read();
return (data << 8 | data);
}
case 0x02/2:
- if (input_port_read(machine(), "DSW") & 0x20)
- return (input_port_read(machine(), "P2") | input_port_read(machine(), "P4") << 8);
+ if (ioport("DSW")->read() & 0x20)
+ return (ioport("P2")->read() | ioport("P4")->read() << 8);
else
{
- data = input_port_read(machine(), "P2") & input_port_read(machine(), "P4");
+ data = ioport("P2")->read() & ioport("P4")->read();
return (data << 8 | data);
}
@@ -95,12 +95,12 @@ READ16_MEMBER(rungun_state::rng_sysregs_r)
bit8 : freeze
bit9 : joysticks layout(auto detect???)
*/
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 0x06/2:
if (ACCESSING_BITS_0_7)
{
- data = input_port_read(machine(), "DSW");
+ data = ioport("DSW")->read();
}
return ((m_sysreg[0x06 / 2] & 0xff00) | data);
}
@@ -125,7 +125,7 @@ WRITE16_MEMBER(rungun_state::rng_sysregs_w)
bit10 : IRQ5 ACK
*/
if (ACCESSING_BITS_0_7)
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
if (!(data & 0x40))
device_set_input_line(m_maincpu, M68K_IRQ_5, CLEAR_LINE);
diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c
index ac5c93aef36..3dcac9abc70 100644
--- a/src/mame/drivers/safarir.c
+++ b/src/mame/drivers/safarir.c
@@ -388,7 +388,7 @@ static INPUT_PORTS_START( safarir )
PORT_DIPSETTING( 0x20, "5000" )
PORT_DIPSETTING( 0x40, "7000" )
PORT_DIPSETTING( 0x60, "9000" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c
index 2570e83b408..15b9b16111e 100644
--- a/src/mame/drivers/saturn.c
+++ b/src/mame/drivers/saturn.c
@@ -830,68 +830,68 @@ INPUT_CHANGED_MEMBER(saturn_state::key_stroke)
}
#define SATURN_PAD_P1(_mask_, _val_) \
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 R") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 L") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 R") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 L") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
#define SATURN_PAD_P2(_mask_, _val_) \
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 R") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P2 L") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 R") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P2 L") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
#define MD_PAD_P1(_mask_, _val_) \
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 Mode") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 C") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P1 Mode") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
#define MD_PAD_P2(_mask_, _val_) \
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 Mode") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) \
- PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, PORTCOND_EQUALS, _val_) //read '1' when direct mode is polled
-
-#define SATURN_KEYBOARD PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x05)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 C") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 Mode") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \
+ PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) //read '1' when direct mode is polled
+
+#define SATURN_KEYBOARD PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x05)
INPUT_CHANGED_MEMBER(saturn_state::nmi_reset)
{
@@ -1098,40 +1098,40 @@ static INPUT_PORTS_START( saturn )
PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) /*PORT_CHAR('3')*/ PORT_CHANGED_MEMBER(DEVICE_SELF, saturn_state, key_stroke, 0x7b) PORT_PLAYER(1) SATURN_KEYBOARD
PORT_START("MOUSEB1")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Pointer Left Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x04)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Pointer Right Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x04)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Pointer Middle Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x04)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Pointer Start Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x04)
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Mouse Left Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x08)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Mouse Right Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x08)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Mouse Middle Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x08)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Mouse Start Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x08)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Pointer Left Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Pointer Right Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Pointer Middle Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Pointer Start Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Mouse Left Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Mouse Right Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Mouse Middle Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Mouse Start Button") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
PORT_START("MOUSEX1")
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P1 Pointer X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x04)
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P1 Mouse X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x08)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P1 Pointer X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P1 Mouse X") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
PORT_START("MOUSEY1")
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P1 Pointer Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x04)
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P1 Mouse Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x08)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P1 Pointer Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x04)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P1 Mouse Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x08)
PORT_START("MOUSEB2")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Pointer Left Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x40)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Pointer Right Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x40)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Pointer Middle Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x40)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P2 Pointer Start Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x40)
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Mouse Left Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x80)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Mouse Right Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x80)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Mouse Middle Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x80)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P2 Mouse Start Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x80)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Pointer Left Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Pointer Right Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Pointer Middle Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P2 Pointer Start Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Mouse Left Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Mouse Right Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Mouse Middle Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P2 Mouse Start Button") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
PORT_START("MOUSEX2")
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P2 Pointer X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x40)
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P2 Mouse X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x80)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P2 Pointer X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_NAME("P2 Mouse X") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
PORT_START("MOUSEY2")
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P2 Pointer Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x40)
- PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P2 Mouse Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x80)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P2 Pointer Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x40)
+ PORT_BIT(0xffff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_MINMAX(0x000, 0xffff) PORT_KEYDELTA(2) PORT_RESET PORT_REVERSE PORT_NAME("P2 Mouse Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x80)
PORT_START("AN_JOY1")
SATURN_PAD_P1(0x0f, 0x01) // racing device
@@ -1142,28 +1142,28 @@ static INPUT_PORTS_START( saturn )
SATURN_PAD_P2(0xf0, 0x20) // analog controller
PORT_START("AN_X1")
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 Racing Stick X") PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 AD Stick X") PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x02)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 Racing Stick X") PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x01)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 AD Stick X") PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x02)
PORT_START("AN_Y1")
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 Racing Stick Y") PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 AD Stick Y") PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x02)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 Racing Stick Y") PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x01)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 AD Stick Y") PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x02)
PORT_START("AN_Z1")
- PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 Racing Stick Z") PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 AD Stick Z") PORT_CONDITION("INPUT_TYPE", 0x0f, PORTCOND_EQUALS, 0x02)
+ PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 Racing Stick Z") PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x01)
+ PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(1) PORT_NAME("P1 AD Stick Z") PORT_CONDITION("INPUT_TYPE", 0x0f, EQUALS, 0x02)
PORT_START("AN_X2")
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 Racing Stick X") PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x10)
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 AD Stick X") PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x20)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 Racing Stick X") PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x10)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 AD Stick X") PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x20)
PORT_START("AN_Y2")
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 Racing Stick Y") PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x10)
- PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 AD Stick Y") PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x20)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 Racing Stick Y") PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x10)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 AD Stick Y") PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x20)
PORT_START("AN_Z2")
- PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 Racing Stick Z") PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x10)
- PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 AD Stick Z") PORT_CONDITION("INPUT_TYPE", 0xf0, PORTCOND_EQUALS, 0x20)
+ PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 Racing Stick Z") PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x10)
+ PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Z ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(200) PORT_PLAYER(2) PORT_NAME("P2 AD Stick Z") PORT_CONDITION("INPUT_TYPE", 0xf0, EQUALS, 0x20)
PORT_START("MD_JOY1")
MD_PAD_P1(0x0f, 0x06) // MD 3 buttons pad
@@ -1468,8 +1468,8 @@ static INPUT_PORTS_START( myfairld )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("PORTC")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("PORTE")
@@ -1479,55 +1479,55 @@ static INPUT_PORTS_START( myfairld )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P1_KEY0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
PORT_START("P1_KEY1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
PORT_START("P1_KEY2")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
PORT_START("P1_KEY3")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01)
PORT_START("P1_KEY4")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) /* F/F is there, but these two games are single player so it isn't connected */
@@ -2055,7 +2055,7 @@ static MACHINE_RESET( saturn )
stvcd_reset( machine );
- state->m_cart_type = input_port_read(machine,"CART_AREA") & 7;
+ state->m_cart_type = state->ioport("CART_AREA")->read() & 7;
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w));
machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x02400000, 0x027fffff, FUNC(saturn_null_ram_r), FUNC(saturn_null_ram_w));
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index 149a0d4937d..a71c1693fe2 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -216,9 +216,9 @@ READ8_MEMBER(sbowling_state::controls_r)
{
if (m_sbw_system & 2)
- return input_port_read(machine(), "TRACKY");
+ return ioport("TRACKY")->read();
else
- return input_port_read(machine(), "TRACKX");
+ return ioport("TRACKX")->read();
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state )
diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c
index c73fe2c10fa..1ddb0deafb4 100644
--- a/src/mame/drivers/sbrkout.c
+++ b/src/mame/drivers/sbrkout.c
@@ -142,7 +142,7 @@ static TIMER_CALLBACK( scanline_callback )
/* on the VBLANK, read the pot and schedule an interrupt time for it */
if (scanline == machine.primary_screen->visible_area().max_y + 1)
{
- UINT8 potvalue = input_port_read(machine, "PADDLE");
+ UINT8 potvalue = state->ioport("PADDLE")->read();
state->m_pot_timer->adjust(machine.primary_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128));
}
@@ -173,25 +173,25 @@ READ8_MEMBER(sbrkout_state::switches_r)
/* DIP switches are selected by ADR0+ADR1 if ADR3 == 0 */
if ((offset & 0x0b) == 0x00)
- result &= (input_port_read(machine(), "DIPS") << 6) | 0x3f;
+ result &= (ioport("DIPS")->read() << 6) | 0x3f;
if ((offset & 0x0b) == 0x01)
- result &= (input_port_read(machine(), "DIPS") << 4) | 0x3f;
+ result &= (ioport("DIPS")->read() << 4) | 0x3f;
if ((offset & 0x0b) == 0x02)
- result &= (input_port_read(machine(), "DIPS") << 0) | 0x3f;
+ result &= (ioport("DIPS")->read() << 0) | 0x3f;
if ((offset & 0x0b) == 0x03)
- result &= (input_port_read(machine(), "DIPS") << 2) | 0x3f;
+ result &= (ioport("DIPS")->read() << 2) | 0x3f;
/* other switches are selected by ADR0+ADR1+ADR2 if ADR4 == 0 */
if ((offset & 0x17) == 0x00)
- result &= (input_port_read(machine(), "SELECT") << 7) | 0x7f;
+ result &= (ioport("SELECT")->read() << 7) | 0x7f;
if ((offset & 0x17) == 0x04)
result &= ((m_pot_trigger[0] & ~m_pot_mask[0]) << 7) | 0x7f;
if ((offset & 0x17) == 0x05)
result &= ((m_pot_trigger[1] & ~m_pot_mask[1]) << 7) | 0x7f;
if ((offset & 0x17) == 0x06)
- result &= input_port_read(machine(), "SERVE");
+ result &= ioport("SERVE")->read();
if ((offset & 0x17) == 0x07)
- result &= (input_port_read(machine(), "SELECT") << 6) | 0x7f;
+ result &= (ioport("SELECT")->read() << 6) | 0x7f;
return result;
}
@@ -398,29 +398,29 @@ static INPUT_PORTS_START( sbrkout )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x70, 0x00, "Extended Play" )
/* Progressive */
- PORT_DIPSETTING( 0x10, "200" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x20, "400" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x30, "600" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x40, "900" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x50, "1200" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x60, "1600" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
- PORT_DIPSETTING( 0x70, "2000" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00)
+ PORT_DIPSETTING( 0x10, "200" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
+ PORT_DIPSETTING( 0x20, "400" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
+ PORT_DIPSETTING( 0x30, "600" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
+ PORT_DIPSETTING( 0x40, "900" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
+ PORT_DIPSETTING( 0x50, "1200" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
+ PORT_DIPSETTING( 0x60, "1600" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
+ PORT_DIPSETTING( 0x70, "2000" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
/* Double */
- PORT_DIPSETTING( 0x10, "200" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
- PORT_DIPSETTING( 0x20, "400" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
- PORT_DIPSETTING( 0x30, "600" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
- PORT_DIPSETTING( 0x40, "800" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
- PORT_DIPSETTING( 0x50, "1000" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
- PORT_DIPSETTING( 0x60, "1200" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
- PORT_DIPSETTING( 0x70, "1500" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02)
+ PORT_DIPSETTING( 0x10, "200" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
+ PORT_DIPSETTING( 0x20, "400" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
+ PORT_DIPSETTING( 0x30, "600" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
+ PORT_DIPSETTING( 0x40, "800" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
+ PORT_DIPSETTING( 0x50, "1000" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
+ PORT_DIPSETTING( 0x60, "1200" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
+ PORT_DIPSETTING( 0x70, "1500" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
/* Cavity */
- PORT_DIPSETTING( 0x10, "200" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x20, "300" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x30, "400" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x40, "700" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x50, "900" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x60, "1100" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x70, "1400" ) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01)
+ PORT_DIPSETTING( 0x10, "200" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
+ PORT_DIPSETTING( 0x20, "300" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
+ PORT_DIPSETTING( 0x30, "400" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
+ PORT_DIPSETTING( 0x40, "700" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
+ PORT_DIPSETTING( 0x50, "900" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
+ PORT_DIPSETTING( 0x60, "1100" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
+ PORT_DIPSETTING( 0x70, "1400" ) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x80, "3" )
diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c
index 79b02936e72..6180489fd17 100644
--- a/src/mame/drivers/scobra.c
+++ b/src/mame/drivers/scobra.c
@@ -268,7 +268,7 @@ ADDRESS_MAP_END
CUSTOM_INPUT_MEMBER(scobra_state::stratgyx_coinage_r)
{
int bit_mask = (FPTR)param;
- return (input_port_read(machine(), "IN4") & bit_mask) ? 0x01 : 0x00;
+ return (ioport("IN4")->read() & bit_mask) ? 0x01 : 0x00;
}
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index 86f8ede0fa3..91f691476ab 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -475,7 +475,7 @@ INPUT_PORTS_END
CUSTOM_INPUT_MEMBER(scramble_state::ckongs_coinage_r)
{
int bit_mask = (FPTR)param;
- return (input_port_read(machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
+ return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00;
}
@@ -816,7 +816,7 @@ static INPUT_PORTS_START( hunchbks )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* protection check? */
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( hncholms )
@@ -860,7 +860,7 @@ static INPUT_PORTS_START( hncholms )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* protection check? */
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( cavelon )
diff --git a/src/mame/drivers/scregg.c b/src/mame/drivers/scregg.c
index ee7c51cd200..9c0dbfcb75b 100644
--- a/src/mame/drivers/scregg.c
+++ b/src/mame/drivers/scregg.c
@@ -142,7 +142,7 @@ static INPUT_PORTS_START( scregg )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
diff --git a/src/mame/drivers/sderby.c b/src/mame/drivers/sderby.c
index f6eee569c01..900902f9a73 100644
--- a/src/mame/drivers/sderby.c
+++ b/src/mame/drivers/sderby.c
@@ -77,7 +77,7 @@ READ16_MEMBER(sderby_state::sderby_input_r)
switch (offset)
{
case 0x00 >> 1:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x02 >> 1:
return 0xffff; // to avoid game to reset (needs more work)
}
@@ -92,11 +92,11 @@ READ16_MEMBER(sderby_state::roulette_input_r)
switch (offset)
{
case 0x00 >> 1:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x02 >> 1:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 0x04 >> 1:
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
}
return 0xffff;
@@ -421,7 +421,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( pmroulet )
PORT_START("IN0")
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) /* it must be toggled to boot anyway */
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* it must be toggled to boot anyway */
PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW)
PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index 3b61432bafb..fbb63224421 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -1435,7 +1435,7 @@ WRITE32_MEMBER(seattle_state::analog_port_w)
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(&space.device()), data);
- m_pending_analog_read = input_port_read(machine(), portnames[data & 7]);
+ m_pending_analog_read = ioport(portnames[data & 7])->read();
}
@@ -1453,39 +1453,39 @@ READ32_MEMBER(seattle_state::carnevil_gun_r)
switch (offset)
{
case 0: /* low 8 bits of X */
- result = (input_port_read(machine(), "LIGHT0_X") << 4) & 0xff;
+ result = (ioport("LIGHT0_X")->read() << 4) & 0xff;
break;
case 1: /* upper 4 bits of X */
- result = (input_port_read(machine(), "LIGHT0_X") >> 4) & 0x0f;
- result |= (input_port_read(machine(), "FAKE") & 0x03) << 4;
+ result = (ioport("LIGHT0_X")->read() >> 4) & 0x0f;
+ result |= (ioport("FAKE")->read() & 0x03) << 4;
result |= 0x40;
break;
case 2: /* low 8 bits of Y */
- result = (input_port_read(machine(), "LIGHT0_Y") << 2) & 0xff;
+ result = (ioport("LIGHT0_Y")->read() << 2) & 0xff;
break;
case 3: /* upper 4 bits of Y */
- result = (input_port_read(machine(), "LIGHT0_Y") >> 6) & 0x03;
+ result = (ioport("LIGHT0_Y")->read() >> 6) & 0x03;
break;
case 4: /* low 8 bits of X */
- result = (input_port_read(machine(), "LIGHT1_X") << 4) & 0xff;
+ result = (ioport("LIGHT1_X")->read() << 4) & 0xff;
break;
case 5: /* upper 4 bits of X */
- result = (input_port_read(machine(), "LIGHT1_X") >> 4) & 0x0f;
- result |= (input_port_read(machine(), "FAKE") & 0x30);
+ result = (ioport("LIGHT1_X")->read() >> 4) & 0x0f;
+ result |= (ioport("FAKE")->read() & 0x30);
result |= 0x40;
break;
case 6: /* low 8 bits of Y */
- result = (input_port_read(machine(), "LIGHT1_Y") << 2) & 0xff;
+ result = (ioport("LIGHT1_Y")->read() << 2) & 0xff;
break;
case 7: /* upper 4 bits of Y */
- result = (input_port_read(machine(), "LIGHT1_Y") >> 6) & 0x03;
+ result = (ioport("LIGHT1_Y")->read() >> 6) & 0x03;
break;
}
return result;
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index ba9a31e3cac..476d3ab5ee0 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -118,7 +118,7 @@ static MACHINE_RESET( segac2 )
/* determine how many sound banks */
state->m_sound_banks = 0;
- if (machine.root_device().memregion("upd")->base())
+ if (state->memregion("upd")->base())
state->m_sound_banks = state->memregion("upd")->bytes() / 0x20000;
/* reset the protection */
@@ -326,8 +326,8 @@ static READ16_HANDLER( io_chip_r )
/* otherwise, return an input port */
if (offset == 0x04/2 && state->m_sound_banks)
- return (input_port_read(space->machine(), portnames[offset]) & 0xbf) | (upd7759_busy_r(space->machine().device("upd")) << 6);
- return input_port_read(space->machine(), portnames[offset]);
+ return (space->machine().root_device().ioport(portnames[offset])->read() & 0xbf) | (upd7759_busy_r(space->machine().device("upd")) << 6);
+ return space->machine().root_device().ioport(portnames[offset])->read();
/* 'SEGA' protection */
case 0x10/2:
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index f436851a178..0c39699b90b 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -487,10 +487,10 @@ READ8_MEMBER( systeme_state::hangonjr_port_f8_read )
temp = 0;
if (m_port_fa_last == 0x08) /* 0000 1000 */ /* Angle */
- temp = input_port_read(machine(), "IN2");
+ temp = ioport("IN2")->read();
if (m_port_fa_last == 0x09) /* 0000 1001 */ /* Accel */
- temp = input_port_read(machine(), "IN3");
+ temp = ioport("IN3")->read();
return temp;
}
@@ -524,13 +524,13 @@ WRITE8_MEMBER( systeme_state::ridleofp_port_fa_write )
if (data & 1)
{
- int curr = input_port_read(machine(), "IN2");
+ int curr = ioport("IN2")->read();
m_diff1 = ((curr - m_last1) & 0x0fff) | (curr & 0xf000);
m_last1 = curr;
}
if (data & 2)
{
- int curr = input_port_read(machine(), "IN3") & 0x0fff;
+ int curr = ioport("IN3")->read() & 0x0fff;
m_diff2 = ((curr - m_last2) & 0x0fff) | (curr & 0xf000);
m_last2 = curr;
}
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index b6ba355d4a3..6936e997d3e 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -214,10 +214,10 @@ READ8_MEMBER(segag80r_state::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 = 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");
+ UINT8 d7d6 = ioport("D7D6")->read();
+ UINT8 d5d4 = ioport("D5D4")->read();
+ UINT8 d3d2 = ioport("D3D2")->read();
+ UINT8 d1d0 = ioport("D1D0")->read();
int shift = offset & 3;
return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
}
@@ -229,17 +229,17 @@ READ8_MEMBER(segag80r_state::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 = 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");
+ UINT8 d7d6 = ioport("D7D6")->read();
+ UINT8 d5d4 = ioport("D5D4")->read();
+ UINT8 d3d2 = ioport("D3D2")->read();
+ UINT8 d1d0 = ioport("D1D0")->read();
int shift = offset & 3;
/* tweak bits for the upright case */
UINT8 upright = d3d2 & 0x04;
if (upright)
{
- UINT8 fc = input_port_read(machine(), "FC");
+ UINT8 fc = ioport("FC")->read();
d7d6 |= 0x60;
d5d4 = (d5d4 & ~0x1c) |
((~fc & 0x20) >> 3) | /* IPT_BUTTON2 */
@@ -253,8 +253,8 @@ READ8_MEMBER(segag80r_state::spaceod_mangled_ports_r)
READ8_MEMBER(segag80r_state::spaceod_port_fc_r)
{
- UINT8 upright = input_port_read(machine(), "D3D2") & 0x04;
- UINT8 fc = input_port_read(machine(), "FC");
+ UINT8 upright = ioport("D3D2")->read() & 0x04;
+ UINT8 fc = ioport("FC")->read();
/* tweak bits for the upright case */
if (upright)
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index fbd49f62f39..6adad26d2e7 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -233,10 +233,10 @@ READ8_MEMBER(segag80v_state::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 = 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");
+ UINT8 d7d6 = ioport("D7D6")->read();
+ UINT8 d5d4 = ioport("D5D4")->read();
+ UINT8 d3d2 = ioport("D3D2")->read();
+ UINT8 d1d0 = ioport("D1D0")->read();
int shift = offset & 3;
return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
}
@@ -260,7 +260,7 @@ READ8_MEMBER(segag80v_state::spinner_input_r)
INT8 delta;
if (m_spinner_select & 1)
- return input_port_read(machine(), "FC");
+ return ioport("FC")->read();
/*
* The values returned are always increasing. That is, regardless of whether
@@ -270,7 +270,7 @@ READ8_MEMBER(segag80v_state::spinner_input_r)
*/
/* I'm sure this can be further simplified ;-) BW */
- delta = input_port_read(machine(), "SPINNER");
+ delta = ioport("SPINNER")->read();
if (delta != 0)
{
m_spinner_sign = (delta >> 7) & 1;
@@ -289,7 +289,7 @@ READ8_MEMBER(segag80v_state::spinner_input_r)
CUSTOM_INPUT_MEMBER(segag80v_state::elim4_joint_coin_r)
{
- return (input_port_read(machine(), "COINS") & 0xf) != 0xf;
+ return (ioport("COINS")->read() & 0xf) != 0xf;
}
@@ -305,11 +305,11 @@ READ8_MEMBER(segag80v_state::elim4_input_r)
{
case 6:
/* player 3 & 4 controls */
- result = input_port_read(machine(), "FC");
+ result = ioport("FC")->read();
break;
case 7:
/* the 4 coin inputs */
- result = input_port_read(machine(), "COINS");
+ result = ioport("COINS")->read();
break;
}
}
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index c36bce22ec2..a28a592b237 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -180,7 +180,7 @@ static READ16_HANDLER( hangon_io_r )
case 0x1000/2: /* Input ports and DIP switches */
{
static const char *const sysports[] = { "SERVICE", "COINAGE", "DSW", "UNKNOWN" };
- return input_port_read(space->machine(), sysports[offset & 3]);
+ return space->machine().root_device().ioport(sysports[offset & 3])->read();
}
case 0x3000/2: /* PPI @ 4C */
@@ -189,7 +189,7 @@ static READ16_HANDLER( hangon_io_r )
case 0x3020/2: /* ADC0804 data output */
{
static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return input_port_read_safe(space->machine(), adcports[state->m_adc_select], 0);
+ return state->ioport(adcports[state->m_adc_select])->read_safe(0);
}
}
@@ -235,7 +235,7 @@ static READ16_HANDLER( sharrier_io_r )
case 0x0010/2: /* Input ports and DIP switches */
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
- return input_port_read(space->machine(), sysports[offset & 3]);
+ return space->machine().root_device().ioport(sysports[offset & 3])->read();
}
case 0x0020/2: /* PPI @ 4C */
@@ -245,7 +245,7 @@ static READ16_HANDLER( sharrier_io_r )
case 0x0030/2: /* ADC0804 data output */
{
static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return input_port_read_safe(space->machine(), adcports[state->m_adc_select], 0);
+ return state->ioport(adcports[state->m_adc_select])->read_safe(0);
}
}
@@ -393,7 +393,7 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
static void sharrier_i8751_sim(running_machine &machine)
{
- workram[0x492/2] = (input_port_read(machine, "ADC0") << 8) | input_port_read(machine, "ADC1");
+ workram[0x492/2] = (machine.root_device().ioport("ADC0")->read() << 8) | machine.root_device().ioport("ADC1")->read();
}
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index 1b78acd047a..9c67573f55a 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -663,13 +663,13 @@ static READ16_HANDLER( outrun_custom_io_r )
case 0x10/2:
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
- return input_port_read(space->machine(), sysports[offset & 3]);
+ return space->machine().root_device().ioport(sysports[offset & 3])->read();
}
case 0x30/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
- return input_port_read_safe(space->machine(), ports[state->m_adc_select], 0x0010);
+ return state->ioport(ports[state->m_adc_select])->read_safe(0x0010);
}
case 0x60/2:
@@ -733,13 +733,13 @@ static READ16_HANDLER( shangon_custom_io_r )
case 0x1006/2:
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
- return input_port_read(space->machine(), sysports[offset & 3]);
+ return space->machine().root_device().ioport(sysports[offset & 3])->read();
}
case 0x3020/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return input_port_read_safe(space->machine(), ports[state->m_adc_select], 0x0010);
+ return state->ioport(ports[state->m_adc_select])->read_safe(0x0010);
}
}
logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(&space->device()), offset * 2);
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index d38bf800ec3..c81ef00fc1e 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -298,11 +298,11 @@ static READ16_HANDLER( standard_io_r )
case 0x1000/2:
{
static const char *const sysports[] = { "SERVICE", "P1", "UNUSED", "P2" };
- return input_port_read(space->machine(), sysports[offset & 3]);
+ return state->ioport(sysports[offset & 3])->read();
}
case 0x2000/2:
- return input_port_read(space->machine(), (offset & 1) ? "DSW2" : "DSW1");
+ return state->ioport((offset & 1) ? "DSW2" : "DSW1")->read();
}
logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(&space->device()), offset * 2);
return 0xffff;
@@ -634,16 +634,16 @@ static READ16_HANDLER( aceattaa_custom_io_r )
{
switch (state->m_video_control & 0xf)
{
- case 0x00: return input_port_read(space->machine(), "P1"); // "HANDX1"
- case 0x04: return input_port_read(space->machine(), "TRACKX1");
- case 0x08: return input_port_read(space->machine(), "TRACKY1");
- case 0x0c: return input_port_read(space->machine(), "HANDY1");
+ case 0x00: return state->ioport("P1")->read(); // "HANDX1"
+ case 0x04: return state->ioport("TRACKX1")->read();
+ case 0x08: return state->ioport("TRACKY1")->read();
+ case 0x0c: return state->ioport("HANDY1")->read();
}
break;
}
case 0x02:
- return input_port_read(space->machine(), "DIAL1") | (input_port_read(space->machine(), "DIAL2") << 4);
+ return state->ioport("DIAL1")->read() | (state->ioport("DIAL2")->read() << 4);
// low nibble: Sega 56pin Edge "16"-"19" // rotary switch 10positions 4bit-binary-pinout
// high nibble: Sega 56pin Edge "T"-"W" // ditto
@@ -651,10 +651,10 @@ static READ16_HANDLER( aceattaa_custom_io_r )
{
switch (state->m_video_control & 0xf)
{
- case 0x00: return input_port_read(space->machine(), "P2"); // "HANDX2"
- case 0x04: return input_port_read(space->machine(), "TRACKX2");
- case 0x08: return input_port_read(space->machine(), "TRACKY2");
- case 0x0c: return input_port_read(space->machine(), "HANDY2");
+ case 0x00: return state->ioport("P2")->read(); // "HANDX2"
+ case 0x04: return state->ioport("TRACKX2")->read();
+ case 0x08: return state->ioport("TRACKY2")->read();
+ case 0x0c: return state->ioport("HANDY2")->read();
}
break;
}
@@ -686,9 +686,9 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* upper bit of the trackball controls */
case 0:
{
- UINT8 buttons = input_port_read(space->machine(), "SERVICE");
- UINT8 analog1 = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1");
- UINT8 analog2 = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ UINT8 buttons = state->ioport("SERVICE")->read();
+ UINT8 analog1 = state->ioport((state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read();
+ UINT8 analog2 = state->ioport((state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read();
buttons |= (analog1 & 0x80) >> 1;
buttons |= (analog2 & 0x80);
return buttons;
@@ -698,8 +698,8 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* player 1 select switch mapped to bit 7 */
case 1:
{
- UINT8 buttons = input_port_read(space->machine(), "BUTTONS1");
- UINT8 analog = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ UINT8 buttons = state->ioport("BUTTONS1")->read();
+ UINT8 analog = state->ioport((state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read();
return (buttons & 0x80) | (analog & 0x7f);
}
@@ -707,11 +707,11 @@ static READ16_HANDLER( mjleague_custom_io_r )
case 2:
{
if (state->m_video_control & 4)
- return (input_port_read(space->machine(), "ANALOGZ1") >> 4) | (input_port_read(space->machine(), "ANALOGZ2") & 0xf0);
+ return (state->ioport("ANALOGZ1")->read() >> 4) | (state->ioport("ANALOGZ2")->read() & 0xf0);
else
{
- UINT8 buttons1 = input_port_read(space->machine(), "BUTTONS1");
- UINT8 buttons2 = input_port_read(space->machine(), "BUTTONS2");
+ UINT8 buttons1 = state->ioport("BUTTONS1")->read();
+ UINT8 buttons2 = state->ioport("BUTTONS2")->read();
if (!(buttons1 & 0x01))
state->m_last_buttons1 = 0;
@@ -739,8 +739,8 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* player 2 select switch mapped to bit 7 */
case 3:
{
- UINT8 buttons = input_port_read(space->machine(), "BUTTONS2");
- UINT8 analog = input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ UINT8 buttons = state->ioport("BUTTONS2")->read();
+ UINT8 analog = state->ioport((state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read();
return (buttons & 0x80) | (analog & 0x7f);
}
}
@@ -773,10 +773,10 @@ static READ16_HANDLER( passsht16a_custom_io_r )
case 1:
switch ((state->m_read_port++) & 3)
{
- case 0: return input_port_read(space->machine(), "P1");
- case 1: return input_port_read(space->machine(), "P2");
- case 2: return input_port_read(space->machine(), "P3");
- case 3: return input_port_read(space->machine(), "P4");
+ case 0: return state->ioport("P1")->read();
+ case 1: return state->ioport("P2")->read();
+ case 2: return state->ioport("P3")->read();
+ case 3: return state->ioport("P4")->read();
}
break;
@@ -803,8 +803,8 @@ static READ16_HANDLER( sdi_custom_io_r )
case 0x1000/2:
switch (offset & 3)
{
- case 1: return input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1");
- case 3: return input_port_read(space->machine(), (state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ case 1: return state->ioport((state->m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read();
+ case 3: return state->ioport((state->m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read();
}
break;
}
@@ -830,12 +830,12 @@ static READ16_HANDLER( sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
- if (input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff) != 0xff)
+ if (state->ioport(portname[state->m_mj_input_num])->read_safe(0xff) != 0xff)
return 0xff & ~(1 << state->m_mj_input_num);
return 0xff;
case 2:
- return input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff);
+ return state->ioport(portname[state->m_mj_input_num])->read_safe(0xff);
}
break;
}
@@ -973,9 +973,9 @@ static READ8_HANDLER( mcu_io_r )
return maincpu_byte_r(space->machine(), 0x840001 ^ offset);
case 5:
- return space->machine().root_device().memregion("maincpu")->base()[0x00000 + offset];
+ return state->memregion("maincpu")->base()[0x00000 + offset];
case 6:
- return space->machine().root_device().memregion("maincpu")->base()[0x10000 + offset];
+ return state->memregion("maincpu")->base()[0x10000 + offset];
case 7:
return state->memregion("maincpu")->base()[0x20000 + offset];
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index c9a06a99cda..d56fc57fdf0 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1168,11 +1168,11 @@ static READ16_HANDLER( standard_io_r )
case 0x1000/2:
{
static const char *const sysports[] = { "SERVICE", "P1", "UNUSED", "P2" };
- return input_port_read(space->machine(), sysports[offset & 3]);
+ return space->machine().root_device().ioport(sysports[offset & 3])->read();
}
case 0x2000/2:
- return input_port_read(space->machine(), (offset & 1) ? "DSW1" : "DSW2");
+ return space->machine().root_device().ioport((offset & 1) ? "DSW1" : "DSW2")->read();
}
logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(&space->device()), offset * 2);
return segaic16_open_bus_r(space, 0, mem_mask);
@@ -1450,7 +1450,7 @@ static void altbeast_common_i8751_sim(running_machine &machine, offs_t soundoffs
}
/* read inputs */
- workram[inputoffs] = ~input_port_read(machine, "SERVICE") << 8;
+ workram[inputoffs] = ~machine.root_device().ioport("SERVICE")->read() << 8;
}
static void altbeasj_i8751_sim(running_machine &machine)
@@ -1534,8 +1534,8 @@ static void goldnaxe_i8751_sim(running_machine &machine)
}
/* read inputs */
- workram[0x2cd0/2] = (input_port_read(machine, "P1") << 8) | input_port_read(machine, "P2");
- workram[0x2c96/2] = input_port_read(machine, "SERVICE") << 8;
+ workram[0x2cd0/2] = (state->ioport("P1")->read() << 8) | state->ioport("P2")->read();
+ workram[0x2c96/2] = machine.root_device().ioport("SERVICE")->read() << 8;
}
@@ -1557,9 +1557,9 @@ static void tturf_i8751_sim(running_machine &machine)
}
/* read inputs */
- workram[0x01e6/2] = input_port_read(machine, "SERVICE") << 8;
- workram[0x01e8/2] = input_port_read(machine, "P1") << 8;
- workram[0x01ea/2] = input_port_read(machine, "P2") << 8;
+ workram[0x01e6/2] = machine.root_device().ioport("SERVICE")->read() << 8;
+ workram[0x01e8/2] = machine.root_device().ioport("P1")->read() << 8;
+ workram[0x01ea/2] = machine.root_device().ioport("P2")->read() << 8;
}
@@ -1591,34 +1591,35 @@ static void wb3_i8751_sim(running_machine &machine)
static READ16_HANDLER( aceattac_custom_io_r )
{
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
case 0x1000/2:
switch (offset & 3)
{
case 0x01:
- return input_port_read(space->machine(), "P1");
+ return state->ioport("P1")->read();
case 0x02:
- return input_port_read(space->machine(), "DIAL1") | (input_port_read(space->machine(), "DIAL2") << 4);
+ return state->ioport("DIAL1")->read() | (state->ioport("DIAL2")->read() << 4);
// low nibble: Sega 56pin Edge "16"-"19" // rotary switch 10positions 4bit-binary-pinout
// high nibble: Sega 56pin Edge "T"-"W" // ditto
case 0x03:
- return input_port_read(space->machine(), "P2");
+ return state->ioport("P2")->read();
}
break;
case 0x3000/2:
switch (offset & 3)
{
- case 0: return input_port_read(space->machine(), "HANDX1");
- case 1: return input_port_read(space->machine(), "TRACKX1");
- case 2: return input_port_read(space->machine(), "TRACKY1");
- case 3: return input_port_read(space->machine(), "HANDY1");
- case 4: return input_port_read(space->machine(), "HANDX2");
- case 5: return input_port_read(space->machine(), "TRACKX2");
- case 6: return input_port_read(space->machine(), "TRACKY2");
- case 7: return input_port_read(space->machine(), "HANDY2");
+ case 0: return state->ioport("HANDX1")->read();
+ case 1: return state->ioport("TRACKX1")->read();
+ case 2: return state->ioport("TRACKY1")->read();
+ case 3: return state->ioport("HANDY1")->read();
+ case 4: return state->ioport("HANDX2")->read();
+ case 5: return state->ioport("TRACKX2")->read();
+ case 6: return state->ioport("TRACKY2")->read();
+ case 7: return state->ioport("HANDY2")->read();
}
break;
}
@@ -1656,19 +1657,20 @@ static WRITE16_HANDLER( atomicp_sound_w )
static READ16_HANDLER( dunkshot_custom_io_r )
{
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
case 0x3000/2:
switch ((offset/2) & 7)
{
- case 0: return (input_port_read(space->machine(), "ANALOGX1") << 4) >> (8 * (offset & 1));
- case 1: return (input_port_read(space->machine(), "ANALOGY1") << 4) >> (8 * (offset & 1));
- case 2: return (input_port_read(space->machine(), "ANALOGX2") << 4) >> (8 * (offset & 1));
- case 3: return (input_port_read(space->machine(), "ANALOGY2") << 4) >> (8 * (offset & 1));
- case 4: return (input_port_read(space->machine(), "ANALOGX3") << 4) >> (8 * (offset & 1));
- case 5: return (input_port_read(space->machine(), "ANALOGY3") << 4) >> (8 * (offset & 1));
- case 6: return (input_port_read(space->machine(), "ANALOGX4") << 4) >> (8 * (offset & 1));
- case 7: return (input_port_read(space->machine(), "ANALOGY4") << 4) >> (8 * (offset & 1));
+ case 0: return (state->ioport("ANALOGX1")->read() << 4) >> (8 * (offset & 1));
+ case 1: return (state->ioport("ANALOGY1")->read() << 4) >> (8 * (offset & 1));
+ case 2: return (state->ioport("ANALOGX2")->read() << 4) >> (8 * (offset & 1));
+ case 3: return (state->ioport("ANALOGY2")->read() << 4) >> (8 * (offset & 1));
+ case 4: return (state->ioport("ANALOGX3")->read() << 4) >> (8 * (offset & 1));
+ case 5: return (state->ioport("ANALOGY3")->read() << 4) >> (8 * (offset & 1));
+ case 6: return (state->ioport("ANALOGX4")->read() << 4) >> (8 * (offset & 1));
+ case 7: return (state->ioport("ANALOGY4")->read() << 4) >> (8 * (offset & 1));
}
break;
}
@@ -1714,7 +1716,7 @@ static WRITE16_HANDLER( hwchamp_custom_io_w )
switch (offset & 0x30/2)
{
case 0x20/2:
- state->m_hwc_input_value = input_port_read_safe(space->machine(), portname[offset & 3], 0xff);
+ state->m_hwc_input_value = state->ioport(portname[offset & 3])->read_safe(0xff);
break;
case 0x30/2:
@@ -1741,15 +1743,16 @@ static WRITE16_HANDLER( hwchamp_custom_io_w )
static READ16_HANDLER( passshtj_custom_io_r )
{
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
case 0x3000/2:
switch (offset & 3)
{
- case 0: return input_port_read(space->machine(), "P1");
- case 1: return input_port_read(space->machine(), "P2");
- case 2: return input_port_read(space->machine(), "P3");
- case 3: return input_port_read(space->machine(), "P4");
+ case 0: return state->ioport("P1")->read();
+ case 1: return state->ioport("P2")->read();
+ case 2: return state->ioport("P3")->read();
+ case 3: return state->ioport("P4")->read();
}
break;
}
@@ -1766,15 +1769,16 @@ static READ16_HANDLER( passshtj_custom_io_r )
static READ16_HANDLER( sdi_custom_io_r )
{
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
case 0x3000/2:
switch ((offset/2) & 3)
{
- case 0: return input_port_read(space->machine(), "ANALOGX1");
- case 1: return input_port_read(space->machine(), "ANALOGY1");
- case 2: return input_port_read(space->machine(), "ANALOGX2");
- case 3: return input_port_read(space->machine(), "ANALOGY2");
+ case 0: return state->ioport("ANALOGX1")->read();
+ case 1: return state->ioport("ANALOGY1")->read();
+ case 2: return state->ioport("ANALOGX2")->read();
+ case 3: return state->ioport("ANALOGY2")->read();
}
break;
}
@@ -1800,12 +1804,12 @@ static READ16_HANDLER( sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
- if (input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff) != 0xff)
+ if (state->ioport(portname[state->m_mj_input_num])->read_safe(0xff) != 0xff)
return 0xff & ~(1 << state->m_mj_input_num);
return 0xff;
case 2:
- return input_port_read_safe(space->machine(), portname[state->m_mj_input_num], 0xff);
+ return state->ioport(portname[state->m_mj_input_num])->read_safe(0xff);
}
break;
}
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index 68993a569aa..8bad78796c8 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -252,7 +252,7 @@ static READ16_HANDLER( io_chip_r )
return state->m_misc_io_data[offset];
/* otherwise, return an input port */
- return input_port_read(space->machine(), portnames[offset]);
+ return space->machine().root_device().ioport(portnames[offset])->read();
/* 'SEGA' protection */
case 0x10/2:
@@ -359,7 +359,7 @@ static READ16_HANDLER( misc_io_r )
/* video control latch */
case 0x2000/2:
- return input_port_read(space->machine(), portnames[offset & 1]);
+ return space->machine().root_device().ioport(portnames[offset & 1])->read();
}
if (state->m_custom_io_r)
return state->m_custom_io_r(space, offset, mem_mask);
@@ -450,13 +450,13 @@ static READ16_HANDLER( ddcrew_custom_io_r )
switch (offset)
{
case 0x3020/2:
- return input_port_read(space->machine(), "P3");
+ return space->machine().root_device().ioport("P3")->read();
case 0x3022/2:
- return input_port_read(space->machine(), "P4");
+ return space->machine().root_device().ioport("P4")->read();
case 0x3024/2:
- return input_port_read(space->machine(), "P34START");
+ return space->machine().root_device().ioport("P34START")->read();
}
return segaic16_open_bus_r(space, 0, mem_mask);
}
@@ -494,19 +494,19 @@ static WRITE16_HANDLER( lghost_custom_io_w )
switch (offset)
{
case 0x3010/2:
- state->m_lghost_value = 255 - input_port_read(space->machine(), "GUNY1");
+ state->m_lghost_value = 255 - state->ioport("GUNY1")->read();
break;
case 0x3012/2:
- state->m_lghost_value = input_port_read(space->machine(), "GUNX1");
+ state->m_lghost_value = state->ioport("GUNX1")->read();
break;
case 0x3014/2:
- state->m_lghost_value = 255 - input_port_read(space->machine(), state->m_lghost_select ? "GUNY3" : "GUNY2");
+ state->m_lghost_value = 255 - state->ioport(state->m_lghost_select ? "GUNY3" : "GUNY2")->read();
break;
case 0x3016/2:
- state->m_lghost_value = input_port_read(space->machine(), state->m_lghost_select ? "GUNX3" : "GUNX2");
+ state->m_lghost_value = state->ioport(state->m_lghost_select ? "GUNX3" : "GUNX2")->read();
break;
case 0x3020/2:
@@ -530,22 +530,22 @@ static READ16_HANDLER( wwally_custom_io_r )
switch (offset)
{
case 0x3000/2:
- return (input_port_read(space->machine(), "TRACKX1") - state->m_wwally_last_x[0]) & 0xff;
+ return (state->ioport("TRACKX1")->read() - state->m_wwally_last_x[0]) & 0xff;
case 0x3004/2:
- return (input_port_read(space->machine(), "TRACKY1") - state->m_wwally_last_y[0]) & 0xff;
+ return (state->ioport("TRACKY1")->read() - state->m_wwally_last_y[0]) & 0xff;
case 0x3008/2:
- return (input_port_read(space->machine(), "TRACKX2") - state->m_wwally_last_x[1]) & 0xff;
+ return (state->ioport("TRACKX2")->read() - state->m_wwally_last_x[1]) & 0xff;
case 0x300c/2:
- return (input_port_read(space->machine(), "TRACKY2") - state->m_wwally_last_y[1]) & 0xff;
+ return (state->ioport("TRACKY2")->read() - state->m_wwally_last_y[1]) & 0xff;
case 0x3010/2:
- return (input_port_read(space->machine(), "TRACKX3") - state->m_wwally_last_x[2]) & 0xff;
+ return (state->ioport("TRACKX3")->read() - state->m_wwally_last_x[2]) & 0xff;
case 0x3014/2:
- return (input_port_read(space->machine(), "TRACKY3") - state->m_wwally_last_y[2]) & 0xff;
+ return (state->ioport("TRACKY3")->read() - state->m_wwally_last_y[2]) & 0xff;
}
return segaic16_open_bus_r(space, 0, mem_mask);
}
@@ -559,20 +559,20 @@ static WRITE16_HANDLER( wwally_custom_io_w )
{
case 0x3000/2:
case 0x3004/2:
- state->m_wwally_last_x[0] = input_port_read(space->machine(), "TRACKX1");
- state->m_wwally_last_y[0] = input_port_read(space->machine(), "TRACKY1");
+ state->m_wwally_last_x[0] = state->ioport("TRACKX1")->read();
+ state->m_wwally_last_y[0] = state->ioport("TRACKY1")->read();
break;
case 0x3008/2:
case 0x300c/2:
- state->m_wwally_last_x[1] = input_port_read(space->machine(), "TRACKX2");
- state->m_wwally_last_y[1] = input_port_read(space->machine(), "TRACKY2");
+ state->m_wwally_last_x[1] = state->ioport("TRACKX2")->read();
+ state->m_wwally_last_y[1] = state->ioport("TRACKY2")->read();
break;
case 0x3010/2:
case 0x3014/2:
- state->m_wwally_last_x[2] = input_port_read(space->machine(), "TRACKX3");
- state->m_wwally_last_y[2] = input_port_read(space->machine(), "TRACKY3");
+ state->m_wwally_last_x[2] = state->ioport("TRACKX3")->read();
+ state->m_wwally_last_y[2] = state->ioport("TRACKY3")->read();
break;
}
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index a8ca2a33b83..3aec111ce9a 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -515,19 +515,19 @@ UINT8 segas24_state::hotrod_io_r(UINT8 port)
switch(port)
{
case 0:
- return input_port_read(machine(), "P1");
+ return ioport("P1")->read();
case 1:
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
case 2:
- return input_port_read_safe(machine(), "P3", 0xff);
+ return ioport("P3")->read_safe(0xff);
case 3:
return 0xff;
case 4:
- return input_port_read(machine(), "SERVICE");
+ return ioport("SERVICE")->read();
case 5: // Dip switches
- return input_port_read(machine(), "COINAGE");
+ return ioport("COINAGE")->read();
case 6:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 7: // DAC
return 0xff;
}
@@ -541,20 +541,20 @@ UINT8 segas24_state::dcclub_io_r(UINT8 port)
case 0:
{
static const UINT8 pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9 };
- return (input_port_read(machine(), "P1") & 0xf) | ((~pos[input_port_read(machine(), "PADDLE")>>4]<<4) & 0xf0);
+ return (ioport("P1")->read() & 0xf) | ((~pos[ioport("PADDLE")->read()>>4]<<4) & 0xf0);
}
case 1:
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
case 2:
return 0xff;
case 3:
return 0xff;
case 4:
- return input_port_read(machine(), "SERVICE");
+ return ioport("SERVICE")->read();
case 5: // Dip switches
- return input_port_read(machine(), "COINAGE");
+ return ioport("COINAGE")->read();
case 6:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 7: // DAC
return 0xff;
}
@@ -573,15 +573,15 @@ UINT8 segas24_state::mahmajn_io_r(UINT8 port)
case 1:
return 0xff;
case 2:
- return input_port_read(machine(), keynames[cur_input_line]);
+ return ioport(keynames[cur_input_line])->read();
case 3:
return 0xff;
case 4:
- return input_port_read(machine(), "SERVICE");
+ return ioport("SERVICE")->read();
case 5: // Dip switches
- return input_port_read(machine(), "COINAGE");
+ return ioport("COINAGE")->read();
case 6:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 7: // DAC
return 0xff;
}
@@ -626,7 +626,7 @@ WRITE16_MEMBER( segas24_state::hotrod3_ctrl_w )
if(ACCESSING_BITS_0_7)
{
data &= 3;
- hotrod_ctrl_cur = input_port_read_safe(machine(), portnames[data], 0);
+ hotrod_ctrl_cur = ioport(portnames[data])->read_safe(0);
}
}
@@ -638,21 +638,21 @@ READ16_MEMBER( segas24_state::hotrod3_ctrl_r )
{
// Steering dials
case 0:
- return input_port_read_safe(machine(), "DIAL1", 0) & 0xff;
+ return ioport("DIAL1")->read_safe(0) & 0xff;
case 1:
- return input_port_read_safe(machine(), "DIAL1", 0) >> 8;
+ return ioport("DIAL1")->read_safe(0) >> 8;
case 2:
- return input_port_read_safe(machine(), "DIAL2", 0) & 0xff;
+ return ioport("DIAL2")->read_safe(0) & 0xff;
case 3:
- return input_port_read_safe(machine(), "DIAL2", 0) >> 8;
+ return ioport("DIAL2")->read_safe(0) >> 8;
case 4:
- return input_port_read_safe(machine(), "DIAL3", 0) & 0xff;
+ return ioport("DIAL3")->read_safe(0) & 0xff;
case 5:
- return input_port_read_safe(machine(), "DIAL3", 0) >> 8;
+ return ioport("DIAL3")->read_safe(0) >> 8;
case 6:
- return input_port_read_safe(machine(), "DIAL4", 0) & 0xff;
+ return ioport("DIAL4")->read_safe(0) & 0xff;
case 7:
- return input_port_read_safe(machine(), "DIAL4", 0) >> 8;
+ return ioport("DIAL4")->read_safe(0) >> 8;
case 8:
{
@@ -1262,7 +1262,7 @@ static MACHINE_START( system24 )
{
segas24_state *state = machine.driver_data<segas24_state>();
if (state->track_size)
- machine.device<nvram_device>("floppy_nvram")->set_base(machine.root_device().memregion("floppy")->base(), 2*state->track_size);
+ machine.device<nvram_device>("floppy_nvram")->set_base(state->memregion("floppy")->base(), 2*state->track_size);
UINT8 *usr1 = state->memregion("romboard")->base();
if (usr1)
@@ -1771,19 +1771,19 @@ static INPUT_PORTS_START( qrouka )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
PORT_START("SERVICE")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,EQUALS,0x00)
/* alt coin mode */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,PORTCOND_EQUALS,0x08)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW",0x08,EQUALS,0x08)
PORT_INCLUDE( system24_DSW )
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 01d477c64ba..0eb62c2ec5e 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -613,7 +613,7 @@ static UINT16 common_io_chip_r(address_space *space, int which, offs_t offset, U
return state->m_misc_io_data[which][offset];
/* otherwise, return an input port */
- return input_port_read_safe(space->machine(), portnames[which][offset], 0xffff);
+ return state->ioport(portnames[which][offset])->read_safe(0xffff);
/* 'SEGA' protection */
case 0x10/2:
@@ -885,7 +885,7 @@ WRITE16_MEMBER(segas32_state::analog_custom_io_w)
case 0x12/2:
case 0x14/2:
case 0x16/2:
- m_analog_value[offset & 3] = input_port_read_safe(machine(), names[offset & 3], 0);
+ m_analog_value[offset & 3] = ioport(names[offset & 3])->read_safe(0);
return;
}
logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(&space.device()), offset*2, data, mem_mask);
@@ -901,7 +901,7 @@ READ16_MEMBER(segas32_state::extra_custom_io_r)
case 0x22/2:
case 0x24/2:
case 0x26/2:
- return input_port_read_safe(machine(), names[offset & 3], 0xffff);
+ return ioport(names[offset & 3])->read_safe(0xffff);
}
logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
@@ -918,7 +918,7 @@ WRITE16_MEMBER(segas32_state::orunners_custom_io_w)
case 0x12/2:
case 0x14/2:
case 0x16/2:
- m_analog_value[offset & 3] = input_port_read_safe(machine(), names[m_analog_bank * 4 + (offset & 3)], 0);
+ m_analog_value[offset & 3] = ioport(names[m_analog_bank * 4 + (offset & 3)])->read_safe(0);
return;
case 0x20/2:
@@ -941,7 +941,7 @@ READ16_MEMBER(segas32_state::sonic_custom_io_r)
case 0x0c/2:
case 0x10/2:
case 0x14/2:
- return (UINT8)(input_port_read(machine(), names[offset/2]) - m_sonic_last[offset/2]);
+ return (UINT8)(ioport(names[offset/2])->read() - m_sonic_last[offset/2]);
}
logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(&space.device()), offset*2, mem_mask);
@@ -958,8 +958,8 @@ WRITE16_MEMBER(segas32_state::sonic_custom_io_w)
case 0x00/2:
case 0x08/2:
case 0x10/2:
- m_sonic_last[offset/2 + 0] = input_port_read(machine(), names[offset/2 + 0]);
- m_sonic_last[offset/2 + 1] = input_port_read(machine(), names[offset/2 + 1]);
+ m_sonic_last[offset/2 + 0] = ioport(names[offset/2 + 0])->read();
+ m_sonic_last[offset/2 + 1] = ioport(names[offset/2 + 1])->read();
return;
}
diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c
index f2cdfb9e04b..a8f8d19e621 100644
--- a/src/mame/drivers/segaxbd.c
+++ b/src/mame/drivers/segaxbd.c
@@ -451,7 +451,7 @@ static READ16_HANDLER( adc_r )
int which = (state->m_iochip_regs[0][2] >> 2) & 7;
/* on the write, latch the selected input port and stash the value */
- int value = input_port_read_safe(space->machine(), ports[which], 0x0010);
+ int value = state->ioport(ports[which])->read_safe(0x0010);
/* reverse some port values */
if (state->m_adc_reverse[which])
@@ -512,11 +512,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(space->machine(), 0, 0, input_port_read(space->machine(), "IO0PORTA"));
+ return iochip_r(space->machine(), 0, 0, space->machine().root_device().ioport("IO0PORTA")->read());
case 1:
/* I/O port: CN C pins 17,15,13,11,9,7,5,3 */
- return iochip_r(space->machine(), 0, 1, input_port_read(space->machine(), "IO0PORTB"));
+ return iochip_r(space->machine(), 0, 1, space->machine().root_device().ioport("IO0PORTB")->read());
case 2:
/* Output port */
@@ -588,19 +588,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(space->machine(), 1, 0, input_port_read(space->machine(), "IO1PORTA"));
+ return iochip_r(space->machine(), 1, 0, space->machine().root_device().ioport("IO1PORTA")->read());
case 1:
/* Input port: switches, CN D pin A9-16 (switch state 1= open, 0= closed) */
- return iochip_r(space->machine(), 1, 1, input_port_read(space->machine(), "IO1PORTB"));
+ return iochip_r(space->machine(), 1, 1, space->machine().root_device().ioport("IO1PORTB")->read());
case 2:
/* Input port: DIP switches (1= off, 0= on) */
- return iochip_r(space->machine(), 1, 2, input_port_read(space->machine(), "IO1PORTC"));
+ return iochip_r(space->machine(), 1, 2, space->machine().root_device().ioport("IO1PORTC")->read());
case 3:
/* Input port: DIP switches (1= off, 0= on) */
- return iochip_r(space->machine(), 1, 3, input_port_read(space->machine(), "IO1PORTD"));
+ return iochip_r(space->machine(), 1, 3, space->machine().root_device().ioport("IO1PORTD")->read());
case 4:
/* Unused */
diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c
index dbc182ad20a..e80ad951852 100644
--- a/src/mame/drivers/segaybd.c
+++ b/src/mame/drivers/segaybd.c
@@ -287,7 +287,7 @@ static READ16_HANDLER( io_chip_r )
return state->m_misc_io_data[offset];
/* otherwise, return an input port */
- return input_port_read(space->machine(), portnames[offset]);
+ return space->machine().root_device().ioport(portnames[offset])->read();
/* 'SEGA' protection */
case 0x10/2:
@@ -403,7 +403,7 @@ static WRITE16_HANDLER( analog_w )
segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
int selected = ((offset & 3) == 3) ? (3 + (state->m_misc_io_data[0x08/2] & 3)) : (offset & 3);
- int value = input_port_read_safe(space->machine(), ports[selected], 0xff);
+ int value = state->ioport(ports[selected])->read_safe(0xff);
state->m_analog_data[offset & 3] = value;
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 17998afe9e9..6b359ae4625 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -917,7 +917,7 @@ READ32_MEMBER(seibuspi_state::spi_controls1_r)
{
if( ACCESSING_BITS_0_7 )
{
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
}
return 0xffffffff;
}
@@ -926,7 +926,7 @@ READ32_MEMBER(seibuspi_state::spi_controls2_r)
{
if( ACCESSING_BITS_0_7 )
{
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
return 0xffffffff;
}
@@ -936,17 +936,17 @@ CUSTOM_INPUT_MEMBER(seibuspi_state::ejsakura_keyboard_r)
switch(m_ejsakura_input_port)
{
case 0x01:
- return input_port_read(machine(), "INPUT01");
+ return ioport("INPUT01")->read();
case 0x02:
- return input_port_read(machine(), "INPUT02");
+ return ioport("INPUT02")->read();
case 0x04:
- return input_port_read(machine(), "INPUT04");
+ return ioport("INPUT04")->read();
case 0x08:
- return input_port_read(machine(), "INPUT08");
+ return ioport("INPUT08")->read();
case 0x10:
- return input_port_read(machine(), "INPUT10");
+ return ioport("INPUT10")->read();
default:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
return 0xffffffff;
}
@@ -985,12 +985,12 @@ WRITE8_MEMBER(seibuspi_state::z80_bank_w)
READ8_MEMBER(seibuspi_state::z80_jp1_r)
{
- return input_port_read(machine(), "JP1");
+ return ioport("JP1")->read();
}
READ8_MEMBER(seibuspi_state::z80_coin_r)
{
- return input_port_read(machine(), "COIN");
+ return ioport("COIN")->read();
}
READ32_MEMBER(seibuspi_state::soundrom_r)
@@ -1289,7 +1289,7 @@ INPUT_PORTS_END
CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode)
{
static const UINT8 encoding[] = { 0x02, 0x10, 0x03, 0x18, 0x04, 0x20, 0x05, 0x28, 0x06, 0x30, 0x07 };
- input_port_value state = input_port_read(machine(), (const char *)param);
+ ioport_value state = ioport((const char *)param)->read();
int bit;
for (bit = 0; bit < ARRAY_LENGTH(encoding); bit++)
@@ -1812,7 +1812,7 @@ static MACHINE_RESET( spi )
{
seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
- UINT8 *sound = machine.root_device().memregion("ymf")->base();
+ UINT8 *sound = state->memregion("ymf")->base();
UINT8 *rombase = state->memregion("user1")->base();
UINT8 flash_data = rombase[0x1ffffc];
@@ -2057,7 +2057,7 @@ READ32_MEMBER(seibuspi_state::rfjet_speedup_r)
device_spin_until_interrupt(&space.device()); // idle
// Hack to enter test mode
r = m_spimainram[(0x002894c-0x800)/4] & (~0x400);
- return r | (((input_port_read(machine(), "SYSTEM") ^ 0xff)<<8) & 0x400);
+ return r | (((ioport("SYSTEM")->read() ^ 0xff)<<8) & 0x400);
}
/* rfjetj */
@@ -2075,8 +2075,8 @@ static void init_spi(running_machine &machine)
state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
- seibuspi_text_decrypt(machine.root_device().memregion("gfx1")->base());
- seibuspi_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_text_decrypt(state->memregion("gfx1")->base());
+ seibuspi_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
seibuspi_sprite_decrypt(state->memregion("gfx3")->base(), 0x400000);
}
@@ -2146,8 +2146,8 @@ static void init_rf2(running_machine &machine)
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),state));
- seibuspi_rise10_text_decrypt(machine.root_device().memregion("gfx1")->base());
- seibuspi_rise10_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_rise10_text_decrypt(state->memregion("gfx1")->base());
+ seibuspi_rise10_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
seibuspi_rise10_sprite_decrypt(state->memregion("gfx3")->base(), 0x600000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
@@ -2171,8 +2171,8 @@ static void init_rfjet(running_machine &machine)
state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),state));
- seibuspi_rise11_text_decrypt(machine.root_device().memregion("gfx1")->base());
- seibuspi_rise11_bg_decrypt(machine.root_device().memregion("gfx2")->base(), machine.root_device().memregion("gfx2")->bytes());
+ seibuspi_rise11_text_decrypt(state->memregion("gfx1")->base());
+ seibuspi_rise11_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
seibuspi_rise11_sprite_decrypt_rfjet(state->memregion("gfx3")->base(), 0x800000);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c
index e04f2ed964e..ecbc90ef1cf 100644
--- a/src/mame/drivers/seicross.c
+++ b/src/mame/drivers/seicross.c
@@ -85,7 +85,7 @@ static READ8_DEVICE_HANDLER( friskyt_portB_r )
{
seicross_state *state = device->machine().driver_data<seicross_state>();
- return (state->m_portb & 0x9f) | (input_port_read_safe(device->machine(), "DEBUG", 0) & 0x60);
+ return (state->m_portb & 0x9f) | (state->ioport("DEBUG")->read_safe(0) & 0x60);
}
static WRITE8_DEVICE_HANDLER( friskyt_portB_w )
diff --git a/src/mame/drivers/sengokmj.c b/src/mame/drivers/sengokmj.c
index 4a5231d055d..a5c09bec7dd 100644
--- a/src/mame/drivers/sengokmj.c
+++ b/src/mame/drivers/sengokmj.c
@@ -80,12 +80,12 @@ READ16_MEMBER(sengokmj_state::mahjong_panel_r)
{
switch(m_sengokumj_mux_data)
{
- case 0x0100: return input_port_read(machine(), "KEY0");
- case 0x0200: return input_port_read(machine(), "KEY1");
- case 0x0400: return input_port_read(machine(), "KEY2");
- case 0x0800: return input_port_read(machine(), "KEY3");
- case 0x1000: return input_port_read(machine(), "KEY4");
- case 0x2000: return input_port_read(machine(), "UNUSED");
+ case 0x0100: return ioport("KEY0")->read();
+ case 0x0200: return ioport("KEY1")->read();
+ case 0x0400: return ioport("KEY2")->read();
+ case 0x0800: return ioport("KEY3")->read();
+ case 0x1000: return ioport("KEY4")->read();
+ case 0x2000: return ioport("UNUSED")->read();
}
return 0xffff;
@@ -111,7 +111,7 @@ WRITE16_MEMBER(sengokmj_state::sengokmj_out_w)
READ16_MEMBER(sengokmj_state::sengokmj_system_r)
{
- return (input_port_read(machine(), "SYSTEM") & 0xffbf) | m_hopper_io;
+ return (ioport("SYSTEM")->read() & 0xffbf) | m_hopper_io;
}
static ADDRESS_MAP_START( sengokmj_map, AS_PROGRAM, 16, sengokmj_state )
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index cf4a1893259..3f240a95ef8 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -1517,7 +1517,7 @@ WRITE16_MEMBER(seta_state::sub_ctrl_w)
/* DSW reading for 16 bit CPUs */
READ16_MEMBER(seta_state::seta_dsw_r)
{
- UINT16 dsw = input_port_read(machine(), "DSW");
+ UINT16 dsw = ioport("DSW")->read();
if (offset == 0) return (dsw >> 8) & 0xff;
else return (dsw >> 0) & 0xff;
}
@@ -1527,12 +1527,12 @@ READ16_MEMBER(seta_state::seta_dsw_r)
static READ8_DEVICE_HANDLER( dsw1_r )
{
- return (input_port_read(device->machine(), "DSW") >> 8) & 0xff;
+ return (device->machine().root_device().ioport("DSW")->read() >> 8) & 0xff;
}
static READ8_DEVICE_HANDLER( dsw2_r )
{
- return (input_port_read(device->machine(), "DSW") >> 0) & 0xff;
+ return (device->machine().root_device().ioport("DSW")->read() >> 0) & 0xff;
}
@@ -1628,15 +1628,15 @@ ADDRESS_MAP_END
READ16_MEMBER(seta_state::calibr50_ip_r)
{
- int dir1 = input_port_read(machine(), "ROT1"); // analog port
- int dir2 = input_port_read(machine(), "ROT2"); // analog port
+ int dir1 = ioport("ROT1")->read(); // analog port
+ int dir2 = ioport("ROT2")->read(); // analog port
switch (offset)
{
- case 0x00/2: return input_port_read(machine(), "P1"); // p1
- case 0x02/2: return input_port_read(machine(), "P2"); // p2
+ case 0x00/2: return ioport("P1")->read(); // p1
+ case 0x02/2: return ioport("P2")->read(); // p2
- case 0x08/2: return input_port_read(machine(), "COINS"); // Coins
+ case 0x08/2: return ioport("COINS")->read(); // 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
@@ -1691,10 +1691,10 @@ READ16_MEMBER(seta_state::usclssic_dsw_r)
{
switch (offset)
{
- case 0/2: return (input_port_read(machine(), "DSW") >> 8) & 0xf;
- case 2/2: return (input_port_read(machine(), "DSW") >> 12) & 0xf;
- case 4/2: return (input_port_read(machine(), "DSW") >> 0) & 0xf;
- case 6/2: return (input_port_read(machine(), "DSW") >> 4) & 0xf;
+ case 0/2: return (ioport("DSW")->read() >> 8) & 0xf;
+ case 2/2: return (ioport("DSW")->read() >> 12) & 0xf;
+ case 4/2: return (ioport("DSW")->read() >> 0) & 0xf;
+ case 6/2: return (ioport("DSW")->read() >> 4) & 0xf;
}
return 0;
}
@@ -1705,8 +1705,8 @@ READ16_MEMBER(seta_state::usclssic_trackball_x_r)
switch (offset)
{
- case 0/2: return (input_port_read(machine(), portx_name[m_usclssic_port_select]) >> 0) & 0xff;
- case 2/2: return (input_port_read(machine(), portx_name[m_usclssic_port_select]) >> 8) & 0xff;
+ case 0/2: return (ioport(portx_name[m_usclssic_port_select])->read() >> 0) & 0xff;
+ case 2/2: return (ioport(portx_name[m_usclssic_port_select])->read() >> 8) & 0xff;
}
return 0;
}
@@ -1717,8 +1717,8 @@ READ16_MEMBER(seta_state::usclssic_trackball_y_r)
switch (offset)
{
- case 0/2: return (input_port_read(machine(), porty_name[m_usclssic_port_select]) >> 0) & 0xff;
- case 2/2: return (input_port_read(machine(), porty_name[m_usclssic_port_select]) >> 8) & 0xff;
+ case 0/2: return (ioport(porty_name[m_usclssic_port_select])->read() >> 0) & 0xff;
+ case 2/2: return (ioport(porty_name[m_usclssic_port_select])->read() >> 8) & 0xff;
}
return 0;
}
@@ -1866,7 +1866,7 @@ READ16_MEMBER(seta_state::zombraid_gun_r)// Serial interface
{
static const char *const portnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
- int data = input_port_read(machine(), portnames[m_gun_input_src]); // Input Ports 5-8
+ int data = ioport(portnames[m_gun_input_src])->read(); // Input Ports 5-8
return (data >> m_gun_input_bit) & 1;
}
@@ -2076,7 +2076,7 @@ READ16_MEMBER(seta_state::keroppi_protection_init_r)
READ16_MEMBER(seta_state::keroppi_coin_r)
{
- UINT16 result = input_port_read(machine(), "COINS");
+ UINT16 result = ioport("COINS")->read();
if (m_keroppi_prize_hop == 2)
{
@@ -2393,10 +2393,10 @@ ADDRESS_MAP_END
READ16_MEMBER(seta_state::krzybowl_input_r)
{
// analog ports
- int dir1x = input_port_read(machine(), "TRACK1_X") & 0xfff;
- int dir1y = input_port_read(machine(), "TRACK1_Y") & 0xfff;
- int dir2x = input_port_read(machine(), "TRACK2_X") & 0xfff;
- int dir2y = input_port_read(machine(), "TRACK2_Y") & 0xfff;
+ int dir1x = ioport("TRACK1_X")->read() & 0xfff;
+ int dir1y = ioport("TRACK1_Y")->read() & 0xfff;
+ int dir2x = ioport("TRACK2_X")->read() & 0xfff;
+ int dir2y = ioport("TRACK2_Y")->read() & 0xfff;
switch (offset)
{
@@ -2567,9 +2567,9 @@ READ16_MEMBER(seta_state::kiwame_input_r)
switch( offset )
{
- case 0x00/2: return input_port_read(machine(), keynames[i]);
+ case 0x00/2: return ioport(keynames[i])->read();
case 0x02/2: return 0xffff;
- case 0x04/2: return input_port_read(machine(), "COINS");
+ case 0x04/2: return ioport("COINS")->read();
// case 0x06/2:
case 0x08/2: return 0xffff;
@@ -2838,9 +2838,9 @@ ADDRESS_MAP_END
READ16_MEMBER(seta_state::inttoote_dsw_r)
{
int shift = offset * 4;
- return ((((input_port_read(machine(), "DSW1") >> shift) & 0xf)) << 0) |
- ((((input_port_read(machine(), "DSW2_3") >> shift) & 0xf)) << 4) |
- ((((input_port_read(machine(), "DSW2_3") >> (shift+8)) & 0xf)) << 8) ;
+ return ((((ioport("DSW1")->read() >> shift) & 0xf)) << 0) |
+ ((((ioport("DSW2_3")->read() >> shift) & 0xf)) << 4) |
+ ((((ioport("DSW2_3")->read() >> (shift+8)) & 0xf)) << 8) ;
}
READ16_MEMBER(seta_state::inttoote_key_r)
@@ -2848,11 +2848,11 @@ READ16_MEMBER(seta_state::inttoote_key_r)
switch( *m_inttoote_key_select )
{
- case 0x08: return input_port_read(machine(), "BET0");
- case 0x10: return input_port_read(machine(), "BET1");
- case 0x20: return input_port_read(machine(), "BET2");
- case 0x40: return input_port_read(machine(), "BET3");
- case 0x80: return input_port_read(machine(), "BET4");
+ case 0x08: return ioport("BET0")->read();
+ case 0x10: return ioport("BET1")->read();
+ case 0x20: return ioport("BET2")->read();
+ case 0x40: return ioport("BET3")->read();
+ case 0x80: return ioport("BET4")->read();
}
logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(&space.device()), *m_inttoote_key_select);
@@ -2905,11 +2905,11 @@ READ16_MEMBER(seta_state::jockeyc_mux_r)
switch( m_jockeyc_key_select )
{
- case 0x08: return input_port_read(machine(), "BET0");
- case 0x10: return input_port_read(machine(), "BET1");
- case 0x20: return input_port_read(machine(), "BET2");
- case 0x40: return input_port_read(machine(), "BET3");
- case 0x80: return input_port_read(machine(), "BET4");
+ case 0x08: return ioport("BET0")->read();
+ case 0x10: return ioport("BET1")->read();
+ case 0x20: return ioport("BET2")->read();
+ case 0x40: return ioport("BET3")->read();
+ case 0x80: return ioport("BET4")->read();
}
return 0xffff;
@@ -3037,21 +3037,21 @@ ADDRESS_MAP_END
READ8_MEMBER(seta_state::downtown_ip_r)
{
- int dir1 = input_port_read(machine(), "ROT1"); // analog port
- int dir2 = input_port_read(machine(), "ROT2"); // analog port
+ int dir1 = ioport("ROT1")->read(); // analog port
+ int dir2 = ioport("ROT2")->read(); // analog port
dir1 = (~ (0x800 >> dir1)) & 0xfff;
dir2 = (~ (0x800 >> dir2)) & 0xfff;
switch (offset)
{
- case 0: return (input_port_read(machine(), "COINS") & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins
+ case 0: return (ioport("COINS")->read() & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins
case 1: return (dir1 & 0xff); // lower 8 bits of p1 rotation
- case 2: return input_port_read(machine(), "P1"); // p1
+ case 2: return ioport("P1")->read(); // 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 input_port_read(machine(), "P2"); // p2
+ case 6: return ioport("P2")->read(); // p2
case 7: return 0xff; // ?
}
@@ -3234,10 +3234,10 @@ static INPUT_PORTS_START( arbalest )
PORT_START("DSW") // 2 DSWs - $600001 & 3.b
PORT_DIPNAME( 0x0001, 0x0001, "Licensed To" ) PORT_DIPLOCATION("SW1:1") /* Manual states "Don't Touch" */
- PORT_DIPSETTING( 0x0000, "Taito" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Jordan" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0000, "Taito" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Romstar" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Manual shows DSW1-1=Off & DSW2-7=Off */
+ PORT_DIPSETTING( 0x0000, "Taito" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Jordan" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0000, "Taito" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Romstar" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Manual shows DSW1-1=Off & DSW2-7=Off */
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -3246,23 +3246,23 @@ static INPUT_PORTS_START( arbalest )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0300, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Hard ) )
@@ -3406,20 +3406,20 @@ static INPUT_PORTS_START( blandia )
PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,7,8")
- PORT_DIPSETTING( 0x0080, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x0040, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x0020, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x0060, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_EQUALS,0x0002)
- PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
- PORT_DIPSETTING( 0x0060, DEF_STR( 2C_4C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
- PORT_DIPSETTING( 0x0080, "3 Coins/7 Credits" ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002) /* Manuals states "2 Coin 7 Credit" */
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_5C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_6C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
- PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x0002,PORTCOND_NOTEQUALS,0x0002)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x0060, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x0002,EQUALS,0x0002)
+ PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
+ PORT_DIPSETTING( 0x0060, DEF_STR( 2C_4C ) ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
+ PORT_DIPSETTING( 0x0080, "3 Coins/7 Credits" ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002) /* Manuals states "2 Coin 7 Credit" */
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_5C ) ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_6C ) ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
+ PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x0002,NOTEQUALS,0x0002)
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
@@ -3535,10 +3535,10 @@ static INPUT_PORTS_START( calibr50 )
PORT_START("DSW") //2 DSWs - $600001 & 3.b
PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" ) PORT_DIPLOCATION("SW1:1") /* Romstar's Manual states "Don't Touch" */
- PORT_DIPSETTING( 0x0000, "Seta (Japan only)" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Seta USA / Romstar" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0000, "Seta / Taito" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Seta USA / Taito America" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
+ PORT_DIPSETTING( 0x0000, "Seta (Japan only)" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Seta USA / Romstar" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0000, "Seta / Taito" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Seta USA / Taito America" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -3547,23 +3547,23 @@ static INPUT_PORTS_START( calibr50 )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0300, DEF_STR( Easiest ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) )
@@ -3740,23 +3740,23 @@ static INPUT_PORTS_START( drgnunit )
PORT_DIPSETTING( 0x0000, "1 of 8 Scenes" )
PORT_SERVICE_DIPLOC( 0x0800, IP_ACTIVE_LOW, "SW2:4" )
PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:5,6")
- PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0x2000, DEF_STR( 1C_2C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
- PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
- PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
- PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0x2000, DEF_STR( 1C_2C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:7,8")
- PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0xc000, DEF_STR( 1C_1C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_EQUALS,0x0010)
- PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
- PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
- PORT_DIPSETTING( 0x4000, DEF_STR( 1C_4C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("COINS",0x0010,PORTCOND_NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0xc000, DEF_STR( 1C_1C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_CONDITION("COINS",0x0010,EQUALS,0x0010)
+ PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x4000, DEF_STR( 1C_4C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("COINS",0x0010,NOTEQUALS,0x0010)
INPUT_PORTS_END
@@ -4140,23 +4140,23 @@ static INPUT_PORTS_START( downtown )
PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0300, DEF_STR( Normal ) )
@@ -4853,10 +4853,10 @@ static INPUT_PORTS_START( metafox )
PORT_START("DSW") //$600001 & 3.b
PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" ) PORT_DIPLOCATION("SW1:1") /* Romstar's Manual states "Don't Touch" */
- PORT_DIPSETTING( 0x0000, "Seta USA / Taito America" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Seta / Jordan I.S." ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0000, "Seta / Taito" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Seta USA / Romstar" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
+ PORT_DIPSETTING( 0x0000, "Seta USA / Taito America" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Seta / Jordan I.S." ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0000, "Seta / Taito" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Seta USA / Romstar" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Romstar's Manual shows DSW1-1=Off & DSW2-7=Off */
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -4865,23 +4865,23 @@ static INPUT_PORTS_START( metafox )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0300, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) )
@@ -5702,23 +5702,23 @@ static INPUT_PORTS_START( tndrcade )
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0x2000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
- PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
- PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
- PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0x2000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0xc000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_EQUALS,0x0080)
- PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
- PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
- PORT_DIPSETTING( 0x4000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x0080,PORTCOND_NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0xc000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0080,EQUALS,0x0080)
+ PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x4000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x0080,NOTEQUALS,0x0080)
INPUT_PORTS_END
@@ -5775,10 +5775,10 @@ static INPUT_PORTS_START( twineagl )
PORT_START("DSW") //2 DSWs - $600001 & 3.b
PORT_DIPNAME( 0x0001, 0x0001, "Copyright / License" ) PORT_DIPLOCATION("SW1:1") /* Always "Seta" if sim. players = 1 */
- PORT_DIPSETTING( 0x0000, "Taito America / Romstar" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Taito Corp Japan" ) PORT_CONDITION("DSW",0x4000,PORTCOND_NOTEQUALS,0x4000) /* "World" Copyright */
- PORT_DIPSETTING( 0x0000, "Taito America" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000)
- PORT_DIPSETTING( 0x0001, "Seta / Taito" ) PORT_CONDITION("DSW",0x4000,PORTCOND_EQUALS,0x4000) /* Japan Only Notice */
+ PORT_DIPSETTING( 0x0000, "Taito America / Romstar" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Taito Corp Japan" ) PORT_CONDITION("DSW",0x4000,NOTEQUALS,0x4000) /* "World" Copyright */
+ PORT_DIPSETTING( 0x0000, "Taito America" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000)
+ PORT_DIPSETTING( 0x0001, "Seta / Taito" ) PORT_CONDITION("DSW",0x4000,EQUALS,0x4000) /* Japan Only Notice */
PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -5787,23 +5787,23 @@ static INPUT_PORTS_START( twineagl )
PORT_DIPSETTING( 0x0000, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x0008, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0010, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_EQUALS,0x8000)
- PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,PORTCOND_NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,EQUALS,0x8000)
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW",0x8000,NOTEQUALS,0x8000)
PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0300, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x0200, DEF_STR( Easy ) )
@@ -10646,14 +10646,13 @@ static DRIVER_INIT( wiggie )
static DRIVER_INIT( crazyfgt )
{
- //seta_state *state = machine.driver_data<seta_state>();
- UINT16 *RAM = (UINT16 *) machine.root_device().memregion("maincpu")->base();
+ seta_state *state = machine.driver_data<seta_state>();
+ UINT16 *RAM = (UINT16 *) state->memregion("maincpu")->base();
// protection check at boot
RAM[0x1078/2] = 0x4e71;
// fixed priorities?
- seta_state *state = machine.driver_data<seta_state>();
state->m_vregs.allocate(3);
DRIVER_INIT_CALL(blandia);
@@ -10665,11 +10664,10 @@ static DRIVER_INIT( crazyfgt )
static DRIVER_INIT( inttoote )
{
- //seta_state *state = machine.driver_data<seta_state>();
- UINT16 *ROM = (UINT16 *)machine.root_device().memregion( "maincpu" )->base();
+ seta_state *state = machine.driver_data<seta_state>();
+ UINT16 *ROM = (UINT16 *)state->memregion( "maincpu" )->base();
// missing / unused video regs
- seta_state *state = machine.driver_data<seta_state>();
state->m_vregs.allocate(3);
// code patches (to be removed...)
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 1ae43023259..5b55b83f694 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -220,11 +220,11 @@ READ16_MEMBER(seta2_state::mj4simai_p1_r)
switch (m_keyboard_row)
{
- case 0x01: return input_port_read(machine(), "P1_KEY0");
- case 0x02: return input_port_read(machine(), "P1_KEY1");
- case 0x04: return input_port_read(machine(), "P1_KEY2");
- case 0x08: return input_port_read(machine(), "P1_KEY3");
- case 0x10: return input_port_read(machine(), "P1_KEY4");
+ case 0x01: return ioport("P1_KEY0")->read();
+ case 0x02: return ioport("P1_KEY1")->read();
+ case 0x04: return ioport("P1_KEY2")->read();
+ case 0x08: return ioport("P1_KEY3")->read();
+ case 0x10: return ioport("P1_KEY4")->read();
default: logerror("p1_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff;
}
}
@@ -234,11 +234,11 @@ READ16_MEMBER(seta2_state::mj4simai_p2_r)
switch (m_keyboard_row)
{
- case 0x01: return input_port_read(machine(), "P2_KEY0");
- case 0x02: return input_port_read(machine(), "P2_KEY1");
- case 0x04: return input_port_read(machine(), "P2_KEY2");
- case 0x08: return input_port_read(machine(), "P2_KEY3");
- case 0x10: return input_port_read(machine(), "P2_KEY4");
+ case 0x01: return ioport("P2_KEY0")->read();
+ case 0x02: return ioport("P2_KEY1")->read();
+ case 0x04: return ioport("P2_KEY2")->read();
+ case 0x08: return ioport("P2_KEY3")->read();
+ case 0x10: return ioport("P2_KEY4")->read();
default: logerror("p2_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff;
}
}
@@ -330,7 +330,7 @@ READ16_MEMBER(seta2_state::pzlbowl_protection_r)
READ16_MEMBER(seta2_state::pzlbowl_coins_r)
{
- return input_port_read(machine(), "SYSTEM") | (machine().rand() & 0x80 );
+ return ioport("SYSTEM")->read() | (machine().rand() & 0x80 );
}
WRITE16_MEMBER(seta2_state::pzlbowl_coin_counter_w)
@@ -567,7 +567,7 @@ READ32_MEMBER(seta2_state::coldfire_regs_r)
return machine().rand();
case CF_PPDAT:
- return input_port_read(machine(), "BATTERY") << 16;
+ return ioport("BATTERY")->read() << 16;
}
return m_coldfire_regs[offset];
@@ -575,7 +575,7 @@ READ32_MEMBER(seta2_state::coldfire_regs_r)
READ32_MEMBER(seta2_state::funcube_debug_r)
{
- UINT32 ret = input_port_read(machine(),"DEBUG");
+ UINT32 ret = ioport("DEBUG")->read();
// This bits let you move the crosshair in the inputs / touch panel test with a joystick
if (!(machine().primary_screen->frame_number() % 3))
@@ -638,7 +638,7 @@ ADDRESS_MAP_END
READ8_MEMBER(seta2_state::funcube_coins_r)
{
- UINT8 ret = input_port_read(machine(),"SWITCH");
+ UINT8 ret = ioport("SWITCH")->read();
UINT8 coin_bit0 = 1; // active low
UINT8 coin_bit1 = 1;
@@ -2153,14 +2153,14 @@ static INTERRUPT_GEN( funcube_sub_timer_irq )
}
else
{
- UINT8 press = input_port_read(device->machine(),"TOUCH_PRESS");
+ UINT8 press = device->machine().root_device().ioport("TOUCH_PRESS")->read();
UINT8 release = state->m_funcube_press && !press;
if ( press || release )
{
state->m_funcube_serial_fifo[0] = press ? 0xfe : 0xfd;
- state->m_funcube_serial_fifo[1] = input_port_read(device->machine(),"TOUCH_X");
- state->m_funcube_serial_fifo[2] = input_port_read(device->machine(),"TOUCH_Y");
+ state->m_funcube_serial_fifo[1] = device->machine().root_device().ioport("TOUCH_X")->read();
+ state->m_funcube_serial_fifo[2] = device->machine().root_device().ioport("TOUCH_Y")->read();
state->m_funcube_serial_fifo[3] = 0xff;
state->m_funcube_serial_count = 4;
}
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index a22bf375f8f..c3d8a7cf274 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -162,12 +162,12 @@ static const int scale[8] = { 0x00, 0x40, 0xe0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe };
READ16_MEMBER(sf_state::button1_r)
{
- return (scale[input_port_read(machine(), "IN3")] << 8) | scale[input_port_read(machine(), "IN1")];
+ return (scale[ioport("IN3")->read()] << 8) | scale[ioport("IN1")->read()];
}
READ16_MEMBER(sf_state::button2_r)
{
- return (scale[input_port_read(machine(), "IN4")] << 8) | scale[input_port_read(machine(), "IN2")];
+ return (scale[ioport("IN4")->read()] << 8) | scale[ioport("IN2")->read()];
}
diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c
index 3b5fa927019..60619f29903 100644
--- a/src/mame/drivers/sfbonus.c
+++ b/src/mame/drivers/sfbonus.c
@@ -5733,8 +5733,8 @@ static DRIVER_INIT( sfbonus_common)
// dummy.rom helper
{
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
- int length = machine.root_device().memregion("maincpu")->bytes();
+ UINT8 *ROM = state->memregion("maincpu")->base();
+ int length = state->memregion("maincpu")->bytes();
UINT8* ROM2 = state->memregion("user1")->base();
if (ROM2)
diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c
index ff9b7ec84b7..e919a7d93e5 100644
--- a/src/mame/drivers/sfkick.c
+++ b/src/mame/drivers/sfkick.c
@@ -91,11 +91,11 @@ static READ8_DEVICE_HANDLER( ppi_port_b_r )
sfkick_state *state = device->machine().driver_data<sfkick_state>();
switch(state->m_input_mux&0x0f)
{
- case 0: return input_port_read(device->machine(), "IN0");
- case 1: return input_port_read(device->machine(), "IN1");
- case 2: return BITSWAP8(input_port_read(device->machine(), "DIAL"),4,5,6,7,3,2,1,0);
- case 3: return input_port_read(device->machine(), "DSW2");
- case 4: return input_port_read(device->machine(), "DSW1");
+ case 0: return state->ioport("IN0")->read();
+ case 1: return state->ioport("IN1")->read();
+ case 2: return BITSWAP8(state->ioport("DIAL")->read(),4,5,6,7,3,2,1,0);
+ case 3: return state->ioport("DSW2")->read();
+ case 4: return state->ioport("DSW1")->read();
}
return 0xff;
}
diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c
index 69f95a7e779..cd148ff5c42 100644
--- a/src/mame/drivers/shadfrce.c
+++ b/src/mame/drivers/shadfrce.c
@@ -241,16 +241,16 @@ READ16_MEMBER(shadfrce_state::shadfrce_input_ports_r)
switch (offset)
{
case 0 :
- data = (input_port_read(machine(), "P1") & 0xff) | ((input_port_read(machine(), "DSW2") & 0xc0) << 6) | ((input_port_read(machine(), "SYSTEM") & 0x0f) << 8);
+ data = (ioport("P1")->read() & 0xff) | ((ioport("DSW2")->read() & 0xc0) << 6) | ((ioport("SYSTEM")->read() & 0x0f) << 8);
break;
case 1 :
- data = (input_port_read(machine(), "P2") & 0xff) | ((input_port_read(machine(), "DSW2") & 0x3f) << 8);
+ data = (ioport("P2")->read() & 0xff) | ((ioport("DSW2")->read() & 0x3f) << 8);
break;
case 2 :
- data = (input_port_read(machine(), "EXTRA") & 0xff) | ((input_port_read(machine(), "DSW1") & 0x3f) << 8);
+ data = (ioport("EXTRA")->read() & 0xff) | ((ioport("DSW1")->read() & 0x3f) << 8);
break;
case 3 :
- data = (input_port_read(machine(), "OTHER") & 0xff) | ((input_port_read(machine(), "DSW1") & 0xc0) << 2) | ((input_port_read(machine(), "MISC") & 0x38) << 8) | (m_vblank << 8);
+ data = (ioport("OTHER")->read() & 0xff) | ((ioport("DSW1")->read() & 0xc0) << 2) | ((ioport("MISC")->read() & 0x38) << 8) | (m_vblank << 8);
break;
}
diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c
index d527e119f5b..ea7a9b4e381 100644
--- a/src/mame/drivers/shangha3.c
+++ b/src/mame/drivers/shangha3.c
@@ -207,7 +207,7 @@ static INPUT_PORTS_START( shangha3 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
@@ -268,7 +268,7 @@ static INPUT_PORTS_START( heberpop )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) /* vblank?? has to toggle */
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* vblank?? has to toggle */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
@@ -276,7 +276,7 @@ static INPUT_PORTS_START( heberpop )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK ) /* vblank?? has to toggle */
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* vblank?? has to toggle */
PORT_START("SYSTEM")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -347,7 +347,7 @@ static INPUT_PORTS_START( blocken )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) /* vblank?? has to toggle */
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* vblank?? has to toggle */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
@@ -355,7 +355,7 @@ static INPUT_PORTS_START( blocken )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK ) /* vblank?? has to toggle */
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* vblank?? has to toggle */
PORT_START("SYSTEM")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/shangkid.c b/src/mame/drivers/shangkid.c
index b13ea64c790..44355baa75d 100644
--- a/src/mame/drivers/shangkid.c
+++ b/src/mame/drivers/shangkid.c
@@ -134,7 +134,7 @@ static DRIVER_INIT( shangkid )
state->m_gfx_type = 1;
/* set up banking */
- state->membank("bank1")->configure_entries(0, 2, machine.root_device().memregion("maincpu")->base() + 0x8000, 0x8000);
+ state->membank("bank1")->configure_entries(0, 2, state->memregion("maincpu")->base() + 0x8000, 0x8000);
state->membank("bank2")->configure_entries(0, 2, state->memregion("audiocpu")->base() + 0x0000, 0x10000);
}
diff --git a/src/mame/drivers/shisen.c b/src/mame/drivers/shisen.c
index 43db2cae734..5cb1460d0c1 100644
--- a/src/mame/drivers/shisen.c
+++ b/src/mame/drivers/shisen.c
@@ -15,18 +15,18 @@ driver by Nicola Salmoria
READ8_MEMBER(shisen_state::sichuan2_dsw1_r)
{
- int ret = input_port_read(machine(), "DSW1");
+ int ret = ioport("DSW1")->read();
/* Based on the coin mode fill in the upper bits */
- if (input_port_read(machine(), "DSW2") & 0x04)
+ if (ioport("DSW2")->read() & 0x04)
{
/* Mode 1 */
- ret |= (input_port_read(machine(), "DSW1") << 4);
+ ret |= (ioport("DSW1")->read() << 4);
}
else
{
/* Mode 2 */
- ret |= (input_port_read(machine(), "DSW1") & 0xf0);
+ ret |= (ioport("DSW1")->read() & 0xf0);
}
return ret;
@@ -117,7 +117,7 @@ static INPUT_PORTS_START( shisen )
PORT_DIPSETTING( 0x08, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2",0x04,EQUALS,0x04) PORT_DIPLOCATION("SW1:5,6,7,8")
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) )
PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) )
@@ -134,12 +134,12 @@ static INPUT_PORTS_START( shisen )
PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:5,6")
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,PORTCOND_NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2",0x04,NOTEQUALS,0x04) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) )
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index 6174093d35a..1aab7fc45ae 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -171,7 +171,7 @@ static INPUT_PORTS_START( shootout )
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) /* this is set when either coin is inserted */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static INPUT_PORTS_START( shootouj )
diff --git a/src/mame/drivers/shuuz.c b/src/mame/drivers/shuuz.c
index 1db1137dacd..85208553bde 100644
--- a/src/mame/drivers/shuuz.c
+++ b/src/mame/drivers/shuuz.c
@@ -100,8 +100,8 @@ READ16_MEMBER(shuuz_state::leta_r)
/* when reading the even ports, do a real analog port update */
if (which == 0)
{
- int dx = (INT8)input_port_read(machine(), "TRACKX");
- int dy = (INT8)input_port_read(machine(), "TRACKY");
+ int dx = (INT8)ioport("TRACKX")->read();
+ int dy = (INT8)ioport("TRACKY")->read();
m_cur[0] = dx + dy;
m_cur[1] = dx - dy;
@@ -121,7 +121,7 @@ READ16_MEMBER(shuuz_state::leta_r)
READ16_MEMBER(shuuz_state::special_port0_r)
{
- int result = input_port_read(machine(), "SYSTEM");
+ int result = ioport("SYSTEM")->read();
if ((result & 0x0800) && atarigen_get_hblank(*machine().primary_screen))
result &= ~0x0800;
@@ -171,7 +171,7 @@ static INPUT_PORTS_START( shuuz )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x07fc, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("BUTTONS")
@@ -198,7 +198,7 @@ static INPUT_PORTS_START( shuuz2 )
PORT_BIT( 0x00fc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Step Debug SW") PORT_CODE(KEYCODE_S)
PORT_BIT( 0x0600, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Playfield Debug SW") PORT_CODE(KEYCODE_Y)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset Debug SW") PORT_CODE(KEYCODE_E)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Crosshair Debug SW") PORT_CODE(KEYCODE_C)
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index c2f12b7dee5..ce970be14a7 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -63,7 +63,7 @@ READ8_MEMBER(sidearms_state::turtship_ports_r)
res = 0;
for (i = 0;i < 8;i++)
- res |= ((input_port_read_safe(machine(), portnames[i], 0) >> offset) & 1) << i;
+ res |= ((ioport(portnames[i])->read_safe(0) >> offset) & 1) << i;
return res;
}
@@ -260,7 +260,7 @@ static INPUT_PORTS_START( sidearms )
PORT_START("DSW2")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* not sure, but likely */
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* not sure, but likely */
INPUT_PORTS_END
static INPUT_PORTS_START( turtship )
@@ -534,7 +534,7 @@ static INPUT_PORTS_START( whizz )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_VBLANK )
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c
index 8dbba694a03..6ee7a4f9a2c 100644
--- a/src/mame/drivers/sigmab98.c
+++ b/src/mame/drivers/sigmab98.c
@@ -721,7 +721,7 @@ WRITE8_MEMBER(sigmab98_state::sammymdl_hopper_w)
READ8_MEMBER(sigmab98_state::sammymdl_coin_hopper_r)
{
- UINT8 ret = input_port_read(machine(), "COIN");
+ UINT8 ret = ioport("COIN")->read();
// if ( !machine().device<ticket_dispenser_device>("hopper")->read(0) )
// ret &= ~0x01;
@@ -1499,7 +1499,7 @@ static INPUT_PORTS_START( gegege )
PORT_START("EEPROM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) // protection? checks. Must be 0
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) // protection? checks. Must be 0
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // protection? checks. Must be 0
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1537,7 +1537,7 @@ static INPUT_PORTS_START( pepsiman )
PORT_START("EEPROM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) // protection? checks. Must be 0
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) // protection? checks. Must be 0
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // protection? checks. Must be 0
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1575,7 +1575,7 @@ static INPUT_PORTS_START( ucytokyu )
PORT_START("EEPROM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) // protection? checks. Must be 0
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) // protection? checks. Must be 0
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // protection? checks. Must be 0
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 5f5edaef491..1f31a0d3a52 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -103,7 +103,7 @@ static INPUT_PORTS_START( simpl156 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_VBLANK ) // all bits? check..
+ PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // all bits? check..
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) // eeprom?..
@@ -130,7 +130,7 @@ INPUT_PORTS_END
READ32_MEMBER(simpl156_state::simpl156_inputs_read)
{
int eep = m_eeprom->read_bit();
- UINT32 returndata = input_port_read(machine(), "IN0") ^ 0xffff0000;
+ UINT32 returndata = ioport("IN0")->read() ^ 0xffff0000;
returndata ^= ((eep << 8));
return returndata;
@@ -161,7 +161,7 @@ READ32_MEMBER(simpl156_state::simpl156_system_r)
{
UINT32 returndata;
- returndata = input_port_read(machine(), "IN1");
+ returndata = ioport("IN1")->read();
return returndata;
}
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index b1ea7c1319c..bebbd795465 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -138,7 +138,7 @@ READ32_MEMBER(skimaxx_state::skimaxx_blitter_r)
static VIDEO_START( skimaxx )
{
skimaxx_state *state = machine.driver_data<skimaxx_state>();
- state->m_blitter_gfx = (UINT16 *) machine.root_device().memregion( "blitter" )->base();
+ state->m_blitter_gfx = (UINT16 *) state->memregion( "blitter" )->base();
state->m_blitter_gfx_len = state->memregion( "blitter" )->bytes() / 2;
state->m_bg_buffer = auto_alloc_array(machine, UINT32, 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers
@@ -150,7 +150,7 @@ static VIDEO_START( skimaxx )
static SCREEN_UPDATE_IND16( skimaxx )
{
-// popmessage("%02x %02x", input_port_read(screen.machine(), "X"), input_port_read(screen.machine(), "Y") );
+// popmessage("%02x %02x", state->ioport("X")->read(), state->ioport("Y")->read() );
SCREEN_UPDATE16_CALL(tms340x0_ind16);
@@ -308,7 +308,7 @@ WRITE32_MEMBER(skimaxx_state::skimaxx_sub_ctrl_w)
*/
READ32_MEMBER(skimaxx_state::skimaxx_analog_r)
{
- return BITSWAP8(input_port_read(machine(), offset ? "Y" : "X"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(ioport(offset ? "Y" : "X")->read(), 0,1,2,3,4,5,6,7);
}
/*************************************
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index 7984c6d0be6..87266f866cd 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -97,7 +97,7 @@ static MACHINE_RESET( skullxbo )
READ16_MEMBER(skullxbo_state::special_port1_r)
{
- int temp = input_port_read(machine(), "FF5802");
+ int temp = ioport("FF5802")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0040;
if (atarigen_get_hblank(*machine().primary_screen)) temp ^= 0x0010;
return temp;
@@ -179,7 +179,7 @@ static INPUT_PORTS_START( skullxbo )
PORT_START("FF5802")
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) /* HBLANK */
- PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) /* /AUDBUSY */
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/skydiver.c b/src/mame/drivers/skydiver.c
index 641eeefbe4d..270ca26c629 100644
--- a/src/mame/drivers/skydiver.c
+++ b/src/mame/drivers/skydiver.c
@@ -309,7 +309,7 @@ static INPUT_PORTS_START( skydiver )
PORT_START("IN12")
PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN13")
PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/skyfox.c b/src/mame/drivers/skyfox.c
index 4a9c301262d..999d6405473 100644
--- a/src/mame/drivers/skyfox.c
+++ b/src/mame/drivers/skyfox.c
@@ -124,7 +124,7 @@ static INPUT_PORTS_START( skyfox )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
PORT_START("DSW1") // Coins, DSW + Vblank
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3")
PORT_DIPSETTING( 0x0e, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 4C_1C ) )
diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c
index 5997ab03506..e7c198946ba 100644
--- a/src/mame/drivers/skykid.c
+++ b/src/mame/drivers/skykid.c
@@ -37,19 +37,19 @@ READ8_MEMBER(skykid_state::inputport_r)
switch (m_inputport_selected)
{
case 0x00: /* DSW B (bits 0-4) */
- return (input_port_read(machine(), "DSWB") & 0xf8) >> 3;
+ return (ioport("DSWB")->read() & 0xf8) >> 3;
case 0x01: /* DSW B (bits 5-7), DSW A (bits 0-1) */
- return ((input_port_read(machine(), "DSWB") & 0x07) << 2) | ((input_port_read(machine(), "DSWA") & 0xc0) >> 6);
+ return ((ioport("DSWB")->read() & 0x07) << 2) | ((ioport("DSWA")->read() & 0xc0) >> 6);
case 0x02: /* DSW A (bits 2-6) */
- return (input_port_read(machine(), "DSWA") & 0x3e) >> 1;
+ return (ioport("DSWA")->read() & 0x3e) >> 1;
case 0x03: /* DSW A (bit 7), DSW C (bits 0-3) */
- return ((input_port_read(machine(), "DSWA") & 0x01) << 4) | (input_port_read(machine(), "BUTTON2") & 0x0f);
+ return ((ioport("DSWA")->read() & 0x01) << 4) | (ioport("BUTTON2")->read() & 0x0f);
case 0x04: /* coins, start */
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 0x05: /* 2P controls */
- return input_port_read(machine(), "P2");
+ return ioport("P2")->read();
case 0x06: /* 1P controls */
- return input_port_read(machine(), "P1");
+ return ioport("P1")->read();
default:
return 0xff;
}
diff --git a/src/mame/drivers/skyraid.c b/src/mame/drivers/skyraid.c
index 7946e482dc9..6cad467d051 100644
--- a/src/mame/drivers/skyraid.c
+++ b/src/mame/drivers/skyraid.c
@@ -36,11 +36,11 @@ static PALETTE_INIT( skyraid )
READ8_MEMBER(skyraid_state::skyraid_port_0_r)
{
- UINT8 val = input_port_read(machine(), "LANGUAGE");
+ UINT8 val = ioport("LANGUAGE")->read();
- if (input_port_read(machine(), "STICKY") > m_analog_range)
+ if (ioport("STICKY")->read() > m_analog_range)
val |= 0x40;
- if (input_port_read(machine(), "STICKX") > m_analog_range)
+ if (ioport("STICKX")->read() > m_analog_range)
val |= 0x80;
return val;
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index 83c7a7180d2..0db94b21873 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -194,8 +194,8 @@ READ16_MEMBER(slapshot_state::slapshot_service_input_r)
switch (offset)
{
case 0x03:
- return ((input_port_read(machine(), "SYSTEM") & 0xef) |
- (input_port_read(machine(), "SERVICE") & 0x10)) << 8; /* IN3 + service switch */
+ return ((ioport("SYSTEM")->read() & 0xef) |
+ (ioport("SERVICE")->read() & 0x10)) << 8; /* IN3 + service switch */
default:
return tc0640fio_r(m_tc0640fio, offset) << 8;
@@ -207,7 +207,7 @@ READ16_MEMBER(slapshot_state::opwolf3_adc_r)
{
static const char *const adcnames[] = { "GUN1X", "GUN1Y", "GUN2X", "GUN2Y" };
- return input_port_read(machine(), adcnames[offset]) << 8;
+ return ioport(adcnames[offset])->read() << 8;
}
WRITE16_MEMBER(slapshot_state::opwolf3_adc_req_w)
diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c
index 96cf5a19721..0d7f77195e1 100644
--- a/src/mame/drivers/slotcarn.c
+++ b/src/mame/drivers/slotcarn.c
@@ -112,8 +112,8 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine().root_device().memregion("gfx1")->base();
- gfx[1] = device->machine().root_device().memregion("gfx2")->base();
+ gfx[0] = state->memregion("gfx1")->base();
+ gfx[1] = state->memregion("gfx2")->base();
rlen = state->memregion("gfx2")->bytes();
//ma = ma ^ 0x7ff;
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index 9902818de71..72d959befac 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -212,17 +212,17 @@ READ8_MEMBER(snesb_state::sb2b_7xxx_r)
/* Generic read handlers for Dip Switches and coins inputs */
READ8_MEMBER(snesb_state::snesb_dsw1_r)
{
- return input_port_read(machine(), "DSW1");
+ return ioport("DSW1")->read();
}
READ8_MEMBER(snesb_state::snesb_dsw2_r)
{
- return input_port_read(machine(), "DSW2");
+ return ioport("DSW2")->read();
}
READ8_MEMBER(snesb_state::snesb_coin_r)
{
- return input_port_read(machine(), "COIN");
+ return ioport("COIN")->read();
}
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index dbf07048958..3f338e4bf86 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -741,7 +741,7 @@ CUSTOM_INPUT_MEMBER(snk_state::gwar_rotary)
{
static const char *const ports[] = { "P1ROT", "P2ROT" };
int which = (int)(FPTR)param;
- int value = input_port_read(machine(), ports[which]);
+ int value = ioport(ports[which])->read();
if ((m_last_value[which] == 0x5 && value == 0x6) || (m_last_value[which] == 0x6 && value == 0x5))
{
@@ -756,7 +756,7 @@ CUSTOM_INPUT_MEMBER(snk_state::gwar_rotary)
CUSTOM_INPUT_MEMBER(snk_state::gwarb_rotary)
{
- if (input_port_read(machine(), "JOYSTICK_MODE") == 1)
+ if (ioport("JOYSTICK_MODE")->read() == 1)
{
return gwar_rotary(field, param);
}
@@ -805,13 +805,13 @@ WRITE8_MEMBER(snk_state::countryc_trackball_w)
CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_x)
{
- return input_port_read(machine(), m_countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1");
+ return ioport(m_countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1")->read();
}
CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_y)
{
- return input_port_read(machine(), m_countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1");
+ return ioport(m_countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1")->read();
}
@@ -824,14 +824,14 @@ CUSTOM_INPUT_MEMBER(snk_state::snk_bonus_r)
switch (bit_mask)
{
case 0x01: /* older games : "Occurrence" Dip Switch (DSW2:1) */
- return ((input_port_read(machine(), "BONUS") & bit_mask) >> 0);
+ return ((ioport("BONUS")->read() & bit_mask) >> 0);
case 0xc0: /* older games : "Bonus Life" Dip Switches (DSW1:7,8) */
- return ((input_port_read(machine(), "BONUS") & bit_mask) >> 6);
+ return ((ioport("BONUS")->read() & bit_mask) >> 6);
case 0x04: /* later games : "Occurrence" Dip Switch (DSW1:3) */
- return ((input_port_read(machine(), "BONUS") & bit_mask) >> 2);
+ return ((ioport("BONUS")->read() & bit_mask) >> 2);
case 0x30: /* later games : "Bonus Life" Dip Switches (DSW2:5,6) */
- return ((input_port_read(machine(), "BONUS") & bit_mask) >> 4);
+ return ((ioport("BONUS")->read() & bit_mask) >> 4);
default:
logerror("snk_bonus_r : invalid %02X bit_mask\n",bit_mask);
@@ -2388,12 +2388,12 @@ static INPUT_PORTS_START( fitegolf )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) /* Dual Controls */
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
- PORT_DIPNAME( 0x08, 0x00, "Gameplay" ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01) PORT_DIPLOCATION("DSW1:4") /* code at 0x011e */
- PORT_DIPSETTING( 0x00, "Basic Player" ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x08, "Avid Golfer" ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("DSW1:4")
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
+ PORT_DIPNAME( 0x08, 0x00, "Gameplay" ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_DIPLOCATION("DSW1:4") /* code at 0x011e */
+ PORT_DIPSETTING( 0x00, "Basic Player" ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x08, "Avid Golfer" ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_DIPLOCATION("DSW1:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) )
diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c
index 116d301c67b..d081acf8389 100644
--- a/src/mame/drivers/snk68.c
+++ b/src/mame/drivers/snk68.c
@@ -63,35 +63,35 @@ WRITE8_MEMBER(snk68_state::sound_status_w)
READ16_MEMBER(snk68_state::control_1_r)
{
- return (input_port_read(machine(), "P1") + (input_port_read(machine(), "P2") << 8));
+ return (ioport("P1")->read() + (ioport("P2")->read() << 8));
}
READ16_MEMBER(snk68_state::control_2_r)
{
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
READ16_MEMBER(snk68_state::rotary_1_r)
{
- return (( ~(1 << input_port_read(machine(), "ROT1")) )<<8)&0xff00;
+ return (( ~(1 << ioport("ROT1")->read()) )<<8)&0xff00;
}
READ16_MEMBER(snk68_state::rotary_2_r)
{
- return (( ~(1 << input_port_read(machine(), "ROT2")) )<<8)&0xff00;
+ return (( ~(1 << ioport("ROT2")->read()) )<<8)&0xff00;
}
READ16_MEMBER(snk68_state::rotary_lsb_r)
{
- return ((( ~(1 << input_port_read(machine(), "ROT2")) ) <<4)&0xf000)
- + ((( ~(1 << input_port_read(machine(), "ROT1")) ) )&0x0f00);
+ return ((( ~(1 << ioport("ROT2")->read()) ) <<4)&0xf000)
+ + ((( ~(1 << ioport("ROT1")->read()) ) )&0x0f00);
}
READ16_MEMBER(snk68_state::protcontrols_r)
{
static const char *const portnames[] = { "P1", "P2", "SYSTEM" };
- return input_port_read(machine(), portnames[offset]) ^ m_invert_controls;
+ return ioport(portnames[offset])->read() ^ m_invert_controls;
}
WRITE16_MEMBER(snk68_state::protection_w)
diff --git a/src/mame/drivers/snookr10.c b/src/mame/drivers/snookr10.c
index f8f77f339a9..79536c26f65 100644
--- a/src/mame/drivers/snookr10.c
+++ b/src/mame/drivers/snookr10.c
@@ -390,7 +390,7 @@ READ8_MEMBER(snookr10_state::dsw_port_1_r)
BIT 7 = Complement of DS1, bit 7
---------------------------------
*/
-return input_port_read(machine(), "SW1");
+return ioport("SW1")->read();
}
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index c415b424e6e..c7af1689c08 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -418,13 +418,13 @@ static void sb3_play_music(running_machine &machine, int data)
{
case 0x23:
case 0x26:
- snd = machine.root_device().memregion("oki")->base();
+ snd = state->memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
case 0x24:
- snd = machine.root_device().memregion("oki")->base();
+ snd = state->memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
state->m_sb3_music_is_playing = 1;
break;
@@ -558,22 +558,22 @@ static INPUT_PORTS_START( snowbros )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
@@ -667,7 +667,7 @@ static INPUT_PORTS_START( honeydol )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK ) /* Must be low or game stops! */
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* Must be low or game stops! */
PORT_START("DSW2")
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
@@ -743,7 +743,7 @@ static INPUT_PORTS_START( twinadv )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 )
- PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK ) /* Must be low or game stops! */
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* Must be low or game stops! */
PORT_START("DSW2")
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
@@ -2352,7 +2352,7 @@ static DRIVER_INIT( moremorp )
static DRIVER_INIT( cookbib2 )
{
//snowbros_state *state = machine.driver_data<snowbros_state>();
-// UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
+// UINT16 *HCROM = (UINT16*)state->memregion("maincpu")->base();
// UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
// int i;
// state->m_hyperpac_ram[0xf000/2] = 0x46fc;
diff --git a/src/mame/drivers/spcforce.c b/src/mame/drivers/spcforce.c
index 6e59cc4e8cd..8f4458e95d6 100644
--- a/src/mame/drivers/spcforce.c
+++ b/src/mame/drivers/spcforce.c
@@ -152,7 +152,7 @@ static INPUT_PORTS_START( spcforce )
PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
INPUT_PORTS_END
@@ -194,7 +194,7 @@ static INPUT_PORTS_START( spcforc2 )
PORT_START("P2")
PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
- PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 0b65ecb9a28..a581b3ea431 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -98,8 +98,8 @@ static void mcu63705_update_inputs(running_machine &machine)
{
int curr[2][2];
- curr[p][0] = input_port_read(machine, p ? "P2" : "P1") & 0x01;
- curr[p][1] = input_port_read(machine, p ? "P2" : "P1") & 0x02;
+ curr[p][0] = state->ioport(p ? "P2" : "P1")->read() & 0x01;
+ curr[p][1] = state->ioport(p ? "P2" : "P1")->read() & 0x02;
for (j = 0;j <= 1;j++)
{
@@ -133,7 +133,7 @@ static void mcu63705_update_inputs(running_machine &machine)
{
int curr[2];
- curr[p] = input_port_read(machine, p ? "P2" : "P1") & 0x30;
+ curr[p] = machine.root_device().ioport(p ? "P2" : "P1")->read() & 0x30;
if (state->m_jumped[p]) buttons[p] = 0; /* jump only momentarily flips the buttons */
else buttons[p] = curr[p];
@@ -144,8 +144,8 @@ static void mcu63705_update_inputs(running_machine &machine)
state->m_prev[p] = curr[p];
}
- state->m_inputs[0] = input_port_read(machine, "P1") & 0xcf;
- state->m_inputs[1] = input_port_read(machine, "P2") & 0x0f;
+ state->m_inputs[0] = machine.root_device().ioport("P1")->read() & 0xcf;
+ state->m_inputs[1] = machine.root_device().ioport("P2")->read() & 0x0f;
state->m_inputs[2] = state->m_running[0] | buttons[0];
state->m_inputs[3] = state->m_running[1] | buttons[1];
}
@@ -166,7 +166,7 @@ static void mcu63705_update_inputs(running_machine &machine)
for (p=0; p<=1; p++)
{
- curr_port[p] = input_port_read(machine, p ? "P2" : "P1");
+ curr_port[p] = state->ioport(p ? "P2" : "P1")->read();
curr_dash[p] = 0;
if (curr_port[p] & R)
@@ -221,7 +221,7 @@ READ8_MEMBER(spdodgeb_state::mcu63701_r)
case 1: return m_inputs[1];
case 2: return m_inputs[2];
case 3: return m_inputs[3];
- case 4: return input_port_read(machine(), "IN1");
+ case 4: return ioport("IN1")->read();
}
}
@@ -235,7 +235,7 @@ WRITE8_MEMBER(spdodgeb_state::mcu63701_w)
READ8_MEMBER(spdodgeb_state::port_0_r)
{
- int port = input_port_read(machine(), "IN0");
+ int port = ioport("IN0")->read();
m_toggle^=0x02; /* mcu63701_busy flag */
@@ -272,7 +272,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( spdodgeb )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* mcu63701_busy flag */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/speedatk.c b/src/mame/drivers/speedatk.c
index 2152a0e5ad5..d0a6f253e42 100644
--- a/src/mame/drivers/speedatk.c
+++ b/src/mame/drivers/speedatk.c
@@ -94,7 +94,7 @@ static UINT8 iox_key_matrix_calc(running_machine &machine, UINT8 p_side)
for (t = 0 ; t < 8 ; t ++)
{
- if (!(input_port_read(machine, keynames[j+p_side]) & ( 1 << t )))
+ if (!(machine.root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
{
return (i + t) | (p_side ? 0x20 : 0x00);
}
@@ -113,7 +113,7 @@ READ8_MEMBER(speedatk_state::key_matrix_r)
return 0x80;
}
- if((input_port_read(machine(),"COINS") & 1) || (input_port_read(machine(),"COINS") & 2))
+ if((ioport("COINS")->read() & 1) || (ioport("COINS")->read() & 2))
{
m_coin_impulse = m_coin_settings;
m_coin_impulse--;
diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c
index a83dce3e326..7ce2bd1edbf 100644
--- a/src/mame/drivers/spiders.c
+++ b/src/mame/drivers/spiders.c
@@ -275,13 +275,13 @@ static INTERRUPT_GEN( update_pia_1 )
/* update the different PIA pins from the input ports */
/* CA1 - copy of PA1 (COIN1) */
- pia1->ca1_w(input_port_read(device->machine(), "IN0") & 0x02);
+ pia1->ca1_w(device->machine().root_device().ioport("IN0")->read() & 0x02);
/* CA2 - copy of PA0 (SERVICE1) */
- pia1->ca2_w(input_port_read(device->machine(), "IN0") & 0x01);
+ pia1->ca2_w(device->machine().root_device().ioport("IN0")->read() & 0x01);
/* CB1 - (crosshatch) */
- pia1->cb1_w(input_port_read(device->machine(), "XHATCH"));
+ pia1->cb1_w(device->machine().root_device().ioport("XHATCH")->read());
/* CB2 - NOT CONNECTED */
}
diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c
index 12dad8f2baa..6a2969984ab 100644
--- a/src/mame/drivers/splash.c
+++ b/src/mame/drivers/splash.c
@@ -1056,7 +1056,7 @@ static DRIVER_INIT( rebus )
static DRIVER_INIT( funystrp )
{
splash_state *state = machine.driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)state->memregion("maincpu")->base();
state->m_bitmap_type = 0;
state->m_sprite_attr2_shift = 0;
diff --git a/src/mame/drivers/splus.c b/src/mame/drivers/splus.c
index c1b0f7fb885..fdddd86970f 100644
--- a/src/mame/drivers/splus.c
+++ b/src/mame/drivers/splus.c
@@ -395,7 +395,7 @@ READ8_MEMBER(splus_state::splus_serial_r)
break;
case 0x01: // Bank 10
// Test for Coin-In
- if ((input_port_read_safe(machine(),"SENSOR",0x00) & 0x01) == 0x01 && m_coin_state == 0) {
+ if ((ioport("SENSOR")->read_safe(0x00) & 0x01) == 0x01 && m_coin_state == 0) {
m_coin_state = 1; // Start Coin Cycle
m_last_cycles = machine().firstcpu->total_cycles();
#if DEBUG_OUTPUT
@@ -438,7 +438,7 @@ READ8_MEMBER(splus_state::splus_serial_r)
}
// Determine Door Optics
- if ((input_port_read_safe(machine(),"I10",0x08) & 0x08) == 0x08)
+ if ((ioport("I10")->read_safe(0x08) & 0x08) == 0x08)
door_optics = 0x08;
else
door_optics = (((m_bank20 >> 4) & 1) << 3); // Use Door Optics Transmitter
@@ -483,22 +483,22 @@ READ8_MEMBER(splus_state::splus_serial_r)
val = val | door_optics; // Door Optics Receiver
val = val | coin_out; // Hopper Coin OutR
val = val | 0x00; // Hopper Full
- val = val | (input_port_read_safe(machine(),"I10",0x40) & 0x40); // Handle/Spin Button
- val = val | (input_port_read_safe(machine(),"I10",0x80) & 0x80); // Jackpot Reset Key
+ val = val | (ioport("I10")->read_safe(0x40) & 0x40); // Handle/Spin Button
+ val = val | (ioport("I10")->read_safe(0x80) & 0x80); // Jackpot Reset Key
break;
case 0x02: // Bank 20
- val = val | (input_port_read_safe(machine(),"I20",0x01) & 0x01); // Bet One Credit
- val = val | (input_port_read_safe(machine(),"I20",0x02) & 0x02); // Play Max Credits
- val = val | (input_port_read_safe(machine(),"I20",0x04) & 0x04); // Cash Out
- val = val | (input_port_read_safe(machine(),"I20",0x08) & 0x08); // Change Request
+ val = val | (ioport("I20")->read_safe(0x01) & 0x01); // Bet One Credit
+ val = val | (ioport("I20")->read_safe(0x02) & 0x02); // Play Max Credits
+ val = val | (ioport("I20")->read_safe(0x04) & 0x04); // Cash Out
+ val = val | (ioport("I20")->read_safe(0x08) & 0x08); // Change Request
val = val | 0x00; // Reel Mechanism
- val = val | (input_port_read_safe(machine(),"I20",0x20) & 0x20); // Self Test Button
+ val = val | (ioport("I20")->read_safe(0x20) & 0x20); // Self Test Button
val = val | 0x40; // Card Cage
val = val | 0x80; // Bill Acceptor
break;
case 0x04: // Bank 30
// Reserved
- val = val | (input_port_read_safe(machine(),"I30",0x02) & 0x02); // Drop Door
+ val = val | (ioport("I30")->read_safe(0x02) & 0x02); // Drop Door
// Jackpot to Credit Key
// Reserved
// Reserved
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index 612b8328d24..70c59bffa29 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -201,11 +201,11 @@ READ8_MEMBER(spoker_state::spoker_magic_r)
switch(m_igs_magic[0])
{
case 0x00:
- if ( !(m_igs_magic[1] & 0x01) ) return input_port_read(machine(), "DSW1");
- if ( !(m_igs_magic[1] & 0x02) ) return input_port_read(machine(), "DSW2");
- if ( !(m_igs_magic[1] & 0x04) ) return input_port_read(machine(), "DSW3");
- if ( !(m_igs_magic[1] & 0x08) ) return input_port_read(machine(), "DSW4");
- if ( !(m_igs_magic[1] & 0x10) ) return input_port_read(machine(), "DSW5");
+ if ( !(m_igs_magic[1] & 0x01) ) return ioport("DSW1")->read();
+ if ( !(m_igs_magic[1] & 0x02) ) return ioport("DSW2")->read();
+ if ( !(m_igs_magic[1] & 0x04) ) return ioport("DSW3")->read();
+ if ( !(m_igs_magic[1] & 0x08) ) return ioport("DSW4")->read();
+ if ( !(m_igs_magic[1] & 0x10) ) return ioport("DSW5")->read();
logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(&space.device()), m_igs_magic[1]);
break;
diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c
index fab1405d33f..28351607327 100644
--- a/src/mame/drivers/spool99.c
+++ b/src/mame/drivers/spool99.c
@@ -165,19 +165,19 @@ READ8_MEMBER(spool99_state::spool99_io_r)
{
switch(offset+0xaf00)
{
- case 0xafd8: return input_port_read(machine(),"COIN1");
+ case 0xafd8: return ioport("COIN1")->read();
// case 0xafd9: return 1;
- case 0xafda: return input_port_read(machine(),"COIN2");
+ case 0xafda: return ioport("COIN2")->read();
case 0xafdb: return 1;
- case 0xafdc: return input_port_read(machine(),"SERVICE1");//attract mode
- case 0xafdd: return input_port_read(machine(),"HOLD3");
- case 0xafde: return input_port_read(machine(),"HOLD4");
- case 0xafdf: return input_port_read(machine(),"HOLD2");
- case 0xafe0: return input_port_read(machine(),"HOLD1");
- case 0xafe1: return input_port_read(machine(),"HOLD5");
- case 0xafe2: return input_port_read(machine(),"START");
- case 0xafe3: return input_port_read(machine(),"BET");//system 2
- case 0xafe4: return input_port_read(machine(),"SERVICE2");//attract mode
+ case 0xafdc: return ioport("SERVICE1")->read();//attract mode
+ case 0xafdd: return ioport("HOLD3")->read();
+ case 0xafde: return ioport("HOLD4")->read();
+ case 0xafdf: return ioport("HOLD2")->read();
+ case 0xafe0: return ioport("HOLD1")->read();
+ case 0xafe1: return ioport("HOLD5")->read();
+ case 0xafe2: return ioport("START")->read();
+ case 0xafe3: return ioport("BET")->read();//system 2
+ case 0xafe4: return ioport("SERVICE2")->read();//attract mode
// case 0xafe5: return 1;
// case 0xafe6: return 1;
case 0xafe7: return machine().device<eeprom_device>("eeprom")->read_bit();
@@ -235,18 +235,18 @@ READ8_MEMBER(spool99_state::vcarn_io_r)
{
switch(offset+0xa700)
{
- case 0xa720: return input_port_read(machine(),"SERVICE1");//attract mode
- case 0xa722: return input_port_read(machine(),"COIN1");
- case 0xa723: return input_port_read(machine(),"COIN2");
- case 0xa724: return input_port_read(machine(),"SERVICE2");//attract mode
- case 0xa725: return input_port_read(machine(),"HOLD3");
- case 0xa726: return input_port_read(machine(),"HOLD4");
- case 0xa727: return input_port_read(machine(),"HOLD2");
+ case 0xa720: return ioport("SERVICE1")->read();//attract mode
+ case 0xa722: return ioport("COIN1")->read();
+ case 0xa723: return ioport("COIN2")->read();
+ case 0xa724: return ioport("SERVICE2")->read();//attract mode
+ case 0xa725: return ioport("HOLD3")->read();
+ case 0xa726: return ioport("HOLD4")->read();
+ case 0xa727: return ioport("HOLD2")->read();
case 0xa780: return machine().device<okim6295_device>("oki")->read(space,0);
- case 0xa7a0: return input_port_read(machine(),"HOLD1");
- case 0xa7a1: return input_port_read(machine(),"HOLD5");
- case 0xa7a2: return input_port_read(machine(),"START");
- case 0xa7a3: return input_port_read(machine(),"BET");//system 2
+ case 0xa7a0: return ioport("HOLD1")->read();
+ case 0xa7a1: return ioport("HOLD5")->read();
+ case 0xa7a2: return ioport("START")->read();
+ case 0xa7a3: return ioport("BET")->read();//system 2
case 0xa7a7: return machine().device<eeprom_device>("eeprom")->read_bit();
diff --git a/src/mame/drivers/sprint2.c b/src/mame/drivers/sprint2.c
index 430fe6f0baa..90a18fba194 100644
--- a/src/mame/drivers/sprint2.c
+++ b/src/mame/drivers/sprint2.c
@@ -50,7 +50,7 @@ static DRIVER_INIT( dominos )
static int service_mode(running_machine &machine)
{
sprint2_state *state = machine.driver_data<sprint2_state>();
- UINT8 v = input_port_read(machine, "INB");
+ UINT8 v = state->ioport("INB")->read();
if (GAME_IS_SPRINT1)
{
@@ -82,7 +82,7 @@ static INTERRUPT_GEN( sprint2 )
for (i = 0; i < 2; i++)
{
- signed char delta = input_port_read(device->machine(), i ? "DIAL_P2" : "DIAL_P1") - state->m_dial[i];
+ signed char delta = state->ioport(i ? "DIAL_P2" : "DIAL_P1")->read() - state->m_dial[i];
if (delta < 0)
{
@@ -95,7 +95,7 @@ static INTERRUPT_GEN( sprint2 )
state->m_dial[i] += delta;
- switch (input_port_read(device->machine(), i ? "GEAR_P2" : "GEAR_P1") & 15)
+ switch (device->machine().root_device().ioport(i ? "GEAR_P2" : "GEAR_P1")->read() & 15)
{
case 1: state->m_gear[i] = 1; break;
case 2: state->m_gear[i] = 2; break;
@@ -126,13 +126,13 @@ READ8_MEMBER(sprint2_state::sprint2_wram_r)
READ8_MEMBER(sprint2_state::sprint2_dip_r)
{
- return (input_port_read(machine(), "DSW") << (2 * ((offset & 3) ^ 3))) & 0xc0;
+ return (ioport("DSW")->read() << (2 * ((offset & 3) ^ 3))) & 0xc0;
}
READ8_MEMBER(sprint2_state::sprint2_input_A_r)
{
- UINT8 val = input_port_read(machine(), "INA");
+ UINT8 val = ioport("INA")->read();
if (m_game == 2)// (GAME_IS_SPRINT2)
{
@@ -150,7 +150,7 @@ READ8_MEMBER(sprint2_state::sprint2_input_A_r)
READ8_MEMBER(sprint2_state::sprint2_input_B_r)
{
- UINT8 val = input_port_read(machine(), "INB");
+ UINT8 val = ioport("INB")->read();
if (m_game == 1) // (GAME_IS_SPRINT1)
{
diff --git a/src/mame/drivers/sprint4.c b/src/mame/drivers/sprint4.c
index 9a385cab369..3b1f83987ee 100644
--- a/src/mame/drivers/sprint4.c
+++ b/src/mame/drivers/sprint4.c
@@ -50,17 +50,17 @@ static TIMER_CALLBACK( nmi_callback )
UINT8 wheel[4] =
{
- input_port_read(machine, "WHEEL1"),
- input_port_read(machine, "WHEEL2"),
- input_port_read(machine, "WHEEL3"),
- input_port_read(machine, "WHEEL4")
+ state->ioport("WHEEL1")->read(),
+ state->ioport("WHEEL2")->read(),
+ state->ioport("WHEEL3")->read(),
+ state->ioport("WHEEL4")->read()
};
UINT8 lever[4] =
{
- input_port_read(machine, "LEVER1"),
- input_port_read(machine, "LEVER2"),
- input_port_read(machine, "LEVER3"),
- input_port_read(machine, "LEVER4")
+ machine.root_device().ioport("LEVER1")->read(),
+ machine.root_device().ioport("LEVER2")->read(),
+ machine.root_device().ioport("LEVER3")->read(),
+ machine.root_device().ioport("LEVER4")->read()
};
int i;
@@ -99,9 +99,9 @@ static TIMER_CALLBACK( nmi_callback )
/* NMI and watchdog are disabled during service mode */
- machine.watchdog_enable(input_port_read(machine, "IN0") & 0x40);
+ machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40);
- if (input_port_read(machine, "IN0") & 0x40)
+ if (machine.root_device().ioport("IN0")->read() & 0x40)
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
@@ -134,21 +134,21 @@ READ8_MEMBER(sprint4_state::sprint4_wram_r)
READ8_MEMBER(sprint4_state::sprint4_analog_r)
{
- return (input_port_read(machine(), "ANALOG") << (~offset & 7)) & 0x80;
+ return (ioport("ANALOG")->read() << (~offset & 7)) & 0x80;
}
READ8_MEMBER(sprint4_state::sprint4_coin_r)
{
- return (input_port_read(machine(), "COIN") << (~offset & 7)) & 0x80;
+ return (ioport("COIN")->read() << (~offset & 7)) & 0x80;
}
READ8_MEMBER(sprint4_state::sprint4_collision_r)
{
- return (input_port_read(machine(), "COLLISION") << (~offset & 7)) & 0x80;
+ return (ioport("COLLISION")->read() << (~offset & 7)) & 0x80;
}
READ8_MEMBER(sprint4_state::sprint4_options_r)
{
- return (input_port_read(machine(), "DIP") >> (2 * (offset & 3))) & 3;
+ return (ioport("DIP")->read() >> (2 * (offset & 3))) & 3;
}
@@ -259,7 +259,7 @@ static INPUT_PORTS_START( sprint4 )
PORT_START("IN0")
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE)
diff --git a/src/mame/drivers/sprint8.c b/src/mame/drivers/sprint8.c
index 2c58748094d..e79f9b14b20 100644
--- a/src/mame/drivers/sprint8.c
+++ b/src/mame/drivers/sprint8.c
@@ -32,7 +32,7 @@ static TIMER_DEVICE_CALLBACK( input_callback )
for (i = 0; i < 8; i++)
{
- UINT8 val = input_port_read(timer.machine(), dialnames[i]) >> 4;
+ UINT8 val = timer.machine().root_device().ioport(dialnames[i])->read() >> 4;
signed char delta = (val - state->m_dial[i]) & 15;
@@ -69,7 +69,7 @@ READ8_MEMBER(sprint8_state::sprint8_collision_r)
READ8_MEMBER(sprint8_state::sprint8_input_r)
{
static const char *const portnames[] = { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" };
- UINT8 val = input_port_read(machine(), portnames[offset]);
+ UINT8 val = ioport(portnames[offset])->read();
if (m_steer_dir[offset])
{
@@ -255,7 +255,7 @@ static INPUT_PORTS_START( sprint8 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Track Select") PORT_CODE(KEYCODE_SPACE)
PORT_START("VBLANK")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
/* this is actually a variable resistor */
PORT_START("R132")
@@ -383,7 +383,7 @@ static INPUT_PORTS_START( sprint8p )
PORT_DIPSETTING( 0x01, "Tag" )
PORT_START("VBLANK")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
/* this is actually a variable resistor */
PORT_START("R132")
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index 85d9248e033..dc5b5499a02 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -261,7 +261,7 @@ static UINT8 iox_key_matrix_calc(running_machine &machine,UINT8 p_side)
for (t = 0 ; t < 8 ; t ++)
{
- if (!(input_port_read(machine, keynames[j+p_side]) & ( 1 << t )))
+ if (!(machine.root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
{
return (i + t) | (p_side ? 0x20 : 0x00);
}
@@ -313,7 +313,7 @@ READ8_MEMBER(srmp2_state::iox_mux_r)
return iox_key_matrix_calc(machine(),(iox.mux == 2) ? 0 : 4);
}
- return input_port_read(machine(),"SERVICE") & 0xff;
+ return ioport("SERVICE")->read() & 0xff;
}
READ8_MEMBER(srmp2_state::iox_status_r)
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index f8550bbc112..db3097647b4 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -288,17 +288,17 @@ READ32_MEMBER(srmp5_state::srmp5_inputs_r)
switch (m_input_select)
{
case 0x01:
- ret = input_port_read(machine(), "IN0");
+ ret = ioport("IN0")->read();
break;
case 0x02:
- ret = input_port_read(machine(), "IN1");
+ ret = ioport("IN1")->read();
break;
case 0x04:
- ret = input_port_read(machine(), "IN2");
+ ret = ioport("IN2")->read();
break;
case 0x00:
case 0x08:
- ret = input_port_read(machine(), "IN3");
+ ret = ioport("IN3")->read();
break;
}
return ret;
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index 05d3fdb924c..970e31724e5 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -311,14 +311,14 @@ READ16_MEMBER(srmp6_state::srmp6_inputs_r)
{
if (offset == 0) // DSW
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
switch (m_input_select) // inputs
{
- case 1<<0: return input_port_read(machine(), "KEY0");
- case 1<<1: return input_port_read(machine(), "KEY1");
- case 1<<2: return input_port_read(machine(), "KEY2");
- case 1<<3: return input_port_read(machine(), "KEY3");
+ case 1<<0: return ioport("KEY0")->read();
+ case 1<<1: return ioport("KEY1")->read();
+ case 1<<2: return ioport("KEY2")->read();
+ case 1<<3: return ioport("KEY3")->read();
}
return 0;
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index db1fbed206d..3e6a2c7e7d0 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -393,10 +393,10 @@ READ32_MEMBER(ssfindo_state::PS7500_IO_r)
if( m_iocr_hack)
{
- return (input_port_read(machine(), "PS7500") & 0x80) | 0x34 | (machine().rand()&3); //eeprom read ?
+ return (ioport("PS7500")->read() & 0x80) | 0x34 | (machine().rand()&3); //eeprom read ?
}
- return (input_port_read(machine(), "PS7500") & 0x80) | 0x37;
+ return (ioport("PS7500")->read() & 0x80) | 0x37;
case VIDCR:
return (m_PS7500_IO[offset] | 0x50) & 0xfffffff0;
@@ -613,7 +613,7 @@ static MACHINE_RESET( ssfindo )
static INPUT_PORTS_START( ssfindo )
PORT_START("PS7500")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN0")
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED ) // IPT_START2 ??
@@ -663,7 +663,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( ppcar )
PORT_START("PS7500")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN0")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
@@ -680,7 +680,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( tetfight )
PORT_START("PS7500")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, "DSW 0" )
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 29aa157cdf7..16d549a01bf 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -73,11 +73,11 @@ READ16_MEMBER(sshangha_state::sshangha_protection16_r)
switch (offset)
{
case 0x050 >> 1:
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 0x76a >> 1:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 0x0ac >> 1:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
// Protection TODO
}
@@ -91,11 +91,11 @@ READ16_MEMBER(sshangha_state::sshanghb_protection16_r)
switch (offset)
{
case 0x050 >> 1:
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 0x76a >> 1:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 0x0ac >> 1:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
}
return m_prot_data[offset];
@@ -259,7 +259,7 @@ static INPUT_PORTS_START( sshangha )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -278,23 +278,23 @@ static INPUT_PORTS_START( sshangha )
PORT_DIPSETTING( 0x0010, "Mode 1" )
PORT_DIPSETTING( 0x0000, "Mode 2" )
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
- PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
- PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
- PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x0002, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0001, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
- PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
- PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
- PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
- PORT_DIPSETTING( 0x0001, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0002, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0001, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0010, EQUALS, 0x0010) //Mode 1
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
+ PORT_DIPSETTING( 0x0001, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0010, NOTEQUALS, 0x0010) //Mode 2
PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x4000, DEF_STR( Easy ) )
PORT_DIPSETTING( 0xc000, DEF_STR( Normal ) )
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index 8259e5c5f17..656c0d0f801 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -342,7 +342,7 @@ WRITE8_MEMBER(ssingles_state::c001_w)
CUSTOM_INPUT_MEMBER(ssingles_state::controls_r)
{
int data = 7;
- switch(input_port_read(machine(), "EXTRA")) //multiplexed
+ switch(ioport("EXTRA")->read()) //multiplexed
{
case 0x01: data = 1; break;
case 0x02: data = 2; break;
diff --git a/src/mame/drivers/ssozumo.c b/src/mame/drivers/ssozumo.c
index 9fd3e17d91d..4737426a8de 100644
--- a/src/mame/drivers/ssozumo.c
+++ b/src/mame/drivers/ssozumo.c
@@ -129,7 +129,7 @@ static INPUT_PORTS_START( ssozumo )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Controls ) )
PORT_DIPSETTING( 0x00, DEF_STR( Single ) )
PORT_DIPSETTING( 0x40, DEF_STR( Dual ) )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/ssrj.c b/src/mame/drivers/ssrj.c
index f34b0295c5a..88b5903325b 100644
--- a/src/mame/drivers/ssrj.c
+++ b/src/mame/drivers/ssrj.c
@@ -45,7 +45,7 @@ static MACHINE_RESET(ssrj)
READ8_MEMBER(ssrj_state::ssrj_wheel_r)
{
- int port = input_port_read(machine(), "IN1") - 0x80;
+ int port = ioport("IN1")->read() - 0x80;
int retval = port - m_oldport;
m_oldport = port;
diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c
index 14ebabf9044..11bff566a80 100644
--- a/src/mame/drivers/sstrangr.c
+++ b/src/mame/drivers/sstrangr.c
@@ -186,7 +186,7 @@ static INPUT_PORTS_START( sstrangr )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_START("EXT") /* External switches */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -253,7 +253,7 @@ static INPUT_PORTS_START( sstrngr2 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
PORT_START("EXT") /* External switches */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_DIPNAME( 0x02, 0x00, "Player's Bullet Speed (Cheat)" )
PORT_DIPSETTING( 0x00, "Slow" )
PORT_DIPSETTING( 0x02, "Fast" )
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 4de742d82c9..c4a09eb04b2 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -459,7 +459,7 @@ static READ16_DEVICE_HANDLER( gdfs_eeprom_r )
static const char *const gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
eeprom_device *eeprom = downcast<eeprom_device *>(device);
- return (((state->m_gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine(), gunnames[state->m_gdfs_lightgun_select])) | (eeprom->read_bit() << 8);
+ return (((state->m_gdfs_lightgun_select & 1) ? 0 : 0xff) ^ device->machine().root_device().ioport(gunnames[state->m_gdfs_lightgun_select])->read()) | (eeprom->read_bit() << 8);
}
static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w )
@@ -608,10 +608,10 @@ READ16_MEMBER(ssv_state::hypreact_input_r)
{
UINT16 input_sel = *m_input_sel;
- if (input_sel & 0x0001) return input_port_read(machine(), "KEY0");
- if (input_sel & 0x0002) return input_port_read(machine(), "KEY1");
- if (input_sel & 0x0004) return input_port_read(machine(), "KEY2");
- if (input_sel & 0x0008) return input_port_read(machine(), "KEY3");
+ if (input_sel & 0x0001) return ioport("KEY0")->read();
+ if (input_sel & 0x0002) return ioport("KEY1")->read();
+ if (input_sel & 0x0004) return ioport("KEY2")->read();
+ if (input_sel & 0x0008) return ioport("KEY3")->read();
logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
return 0xffff;
}
@@ -733,10 +733,10 @@ READ16_MEMBER(ssv_state::srmp4_input_r)
{
UINT16 input_sel = *m_input_sel;
- if (input_sel & 0x0002) return input_port_read(machine(), "KEY0");
- if (input_sel & 0x0004) return input_port_read(machine(), "KEY1");
- if (input_sel & 0x0008) return input_port_read(machine(), "KEY2");
- if (input_sel & 0x0010) return input_port_read(machine(), "KEY3");
+ if (input_sel & 0x0002) return ioport("KEY0")->read();
+ if (input_sel & 0x0004) return ioport("KEY1")->read();
+ if (input_sel & 0x0008) return ioport("KEY2")->read();
+ if (input_sel & 0x0010) return ioport("KEY3")->read();
logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
return 0xffff;
}
@@ -781,10 +781,10 @@ READ16_MEMBER(ssv_state::srmp7_input_r)
{
UINT16 input_sel = *m_input_sel;
- if (input_sel & 0x0002) return input_port_read(machine(), "KEY0");
- if (input_sel & 0x0004) return input_port_read(machine(), "KEY1");
- if (input_sel & 0x0008) return input_port_read(machine(), "KEY2");
- if (input_sel & 0x0010) return input_port_read(machine(), "KEY3");
+ if (input_sel & 0x0002) return ioport("KEY0")->read();
+ if (input_sel & 0x0004) return ioport("KEY1")->read();
+ if (input_sel & 0x0008) return ioport("KEY2")->read();
+ if (input_sel & 0x0010) return ioport("KEY3")->read();
logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(&space.device()),input_sel);
return 0xffff;
}
@@ -827,7 +827,7 @@ ADDRESS_MAP_END
READ16_MEMBER(ssv_state::sxyreact_ballswitch_r)
{
- return input_port_read_safe(machine(), "SERVICE", 0);
+ return ioport("SERVICE")->read_safe(0);
}
READ16_MEMBER(ssv_state::sxyreact_dial_r)
@@ -843,7 +843,7 @@ WRITE16_MEMBER(ssv_state::sxyreact_dial_w)
{
if (data & 0x20)
- m_sxyreact_serial = input_port_read_safe(machine(), "PADDLE", 0) & 0xff;
+ m_sxyreact_serial = ioport("PADDLE")->read_safe(0) & 0xff;
if ( (m_sxyreact_dial & 0x40) && !(data & 0x40) ) // $40 -> $00
m_sxyreact_serial <<= 1; // shift 1 bit
@@ -986,11 +986,11 @@ READ16_MEMBER(ssv_state::eaglshot_trackball_r)
switch(m_trackball_select)
{
- case 0x60: return (input_port_read(machine(), "TRACKX") >> 8) & 0xff;
- case 0x40: return (input_port_read(machine(), "TRACKX") >> 0) & 0xff;
+ case 0x60: return (ioport("TRACKX")->read() >> 8) & 0xff;
+ case 0x40: return (ioport("TRACKX")->read() >> 0) & 0xff;
- case 0x70: return (input_port_read(machine(), "TRACKY") >> 8) & 0xff;
- case 0x50: return (input_port_read(machine(), "TRACKY") >> 0) & 0xff;
+ case 0x70: return (ioport("TRACKY")->read() >> 8) & 0xff;
+ case 0x50: return (ioport("TRACKY")->read() >> 0) & 0xff;
}
return 0;
}
diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c
index 1bf9d7e5b11..8fd3185d869 100644
--- a/src/mame/drivers/st0016.c
+++ b/src/mame/drivers/st0016.c
@@ -45,18 +45,18 @@ READ8_MEMBER(st0016_state::mux_r)
xxxx - input port #2
xxxx - dip switches (2x8 bits) (multiplexed)
*/
- int retval = input_port_read(machine(), "SYSTEM") & 0x0f;
+ int retval = ioport("SYSTEM")->read() & 0x0f;
switch(mux_port & 0x30)
{
- case 0x00: retval |= ((input_port_read(machine(), "DSW1") & 1) << 4) | ((input_port_read(machine(), "DSW1") & 0x10) << 1)
- | ((input_port_read(machine(), "DSW2") & 1) << 6) | ((input_port_read(machine(), "DSW2") & 0x10) <<3); break;
- case 0x10: retval |= ((input_port_read(machine(), "DSW1") & 2) << 3) | ((input_port_read(machine(), "DSW1") & 0x20) )
- | ((input_port_read(machine(), "DSW2") & 2) << 5) | ((input_port_read(machine(), "DSW2") & 0x20) <<2); break;
- case 0x20: retval |= ((input_port_read(machine(), "DSW1") & 4) << 2) | ((input_port_read(machine(), "DSW1") & 0x40) >> 1)
- | ((input_port_read(machine(), "DSW2") & 4) << 4) | ((input_port_read(machine(), "DSW2") & 0x40) <<1); break;
- case 0x30: retval |= ((input_port_read(machine(), "DSW1") & 8) << 1) | ((input_port_read(machine(), "DSW1") & 0x80) >> 2)
- | ((input_port_read(machine(), "DSW2") & 8) << 3) | ((input_port_read(machine(), "DSW2") & 0x80) ); break;
+ case 0x00: retval |= ((ioport("DSW1")->read() & 1) << 4) | ((ioport("DSW1")->read() & 0x10) << 1)
+ | ((ioport("DSW2")->read() & 1) << 6) | ((ioport("DSW2")->read() & 0x10) <<3); break;
+ case 0x10: retval |= ((ioport("DSW1")->read() & 2) << 3) | ((ioport("DSW1")->read() & 0x20) )
+ | ((ioport("DSW2")->read() & 2) << 5) | ((ioport("DSW2")->read() & 0x20) <<2); break;
+ case 0x20: retval |= ((ioport("DSW1")->read() & 4) << 2) | ((ioport("DSW1")->read() & 0x40) >> 1)
+ | ((ioport("DSW2")->read() & 4) << 4) | ((ioport("DSW2")->read() & 0x40) <<1); break;
+ case 0x30: retval |= ((ioport("DSW1")->read() & 8) << 1) | ((ioport("DSW1")->read() & 0x80) >> 2)
+ | ((ioport("DSW2")->read() & 8) << 3) | ((ioport("DSW2")->read() & 0x80) ); break;
}
return retval;
diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c
index 31eca057b38..977aa252261 100644
--- a/src/mame/drivers/stactics.c
+++ b/src/mame/drivers/stactics.c
@@ -81,8 +81,8 @@ static void move_motor(running_machine &machine, stactics_state *state)
/* monitor motor under joystick control */
if (*state->m_motor_on & 0x01)
{
- int ip3 = input_port_read(machine, "IN3");
- int ip4 = input_port_read(machine, "FAKE");
+ int ip3 = machine.root_device().ioport("IN3")->read();
+ int ip4 = machine.root_device().ioport("FAKE")->read();
/* up */
if (((ip4 & 0x01) == 0) && (state->m_vert_pos > -128))
diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c
index a0ce4172d95..e20cf570237 100644
--- a/src/mame/drivers/stadhero.c
+++ b/src/mame/drivers/stadhero.c
@@ -25,13 +25,13 @@ READ16_MEMBER(stadhero_state::stadhero_control_r)
switch (offset<<1)
{
case 0:
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 2:
- return input_port_read(machine(), "COIN");
+ return ioport("COIN")->read();
case 4:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(&space.device()),0x30c000+offset);
@@ -150,7 +150,7 @@ static INPUT_PORTS_START( stadhero )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
/******************************************************************************/
diff --git a/src/mame/drivers/starfire.c b/src/mame/drivers/starfire.c
index 22c44255d33..b2b787f5b12 100644
--- a/src/mame/drivers/starfire.c
+++ b/src/mame/drivers/starfire.c
@@ -102,11 +102,11 @@ READ8_MEMBER(starfire_state::starfire_input_r)
{
switch (offset & 15)
{
- case 0: return input_port_read(machine(), "DSW");
- case 1: return input_port_read(machine(), "SYSTEM"); /* Note: need to loopback sounds lengths on that one */
- case 5: return input_port_read(machine(), "STICKZ");
- case 6: return input_port_read(machine(), "STICKX");
- case 7: return input_port_read(machine(), "STICKY");
+ case 0: return ioport("DSW")->read();
+ case 1: return ioport("SYSTEM")->read(); /* Note: need to loopback sounds lengths on that one */
+ case 5: return ioport("STICKZ")->read();
+ case 6: return ioport("STICKX")->read();
+ case 7: return ioport("STICKY")->read();
default: return 0xff;
}
}
@@ -130,10 +130,10 @@ READ8_MEMBER(starfire_state::fireone_input_r)
switch (offset & 15)
{
- case 0: return input_port_read(machine(), "DSW");
- case 1: return input_port_read(machine(), "SYSTEM");
+ case 0: return ioport("DSW")->read();
+ case 1: return ioport("SYSTEM")->read();
case 2:
- temp = m_fireone_select ? input_port_read(machine(), "P1") : input_port_read(machine(), "P2");
+ temp = m_fireone_select ? ioport("P1")->read() : ioport("P2")->read();
temp = (temp & 0xc0) | fireone_paddle_map[temp & 0x3f];
return temp;
default: return 0xff;
diff --git a/src/mame/drivers/starshp1.c b/src/mame/drivers/starshp1.c
index 363bda57437..351da7ade66 100644
--- a/src/mame/drivers/starshp1.c
+++ b/src/mame/drivers/starshp1.c
@@ -16,7 +16,7 @@ Atari Starship 1 driver
static INTERRUPT_GEN( starshp1_interrupt )
{
- if ((input_port_read(device->machine(), "SYSTEM") & 0x90) != 0x90)
+ if ((device->machine().root_device().ioport("SYSTEM")->read() & 0x90) != 0x90)
generic_pulse_irq_line(device, 0, 1);
}
@@ -71,16 +71,16 @@ CUSTOM_INPUT_MEMBER(starshp1_state::starshp1_analog_r)
switch (m_analog_in_select)
{
case 0:
- val = input_port_read(machine(), "STICKY");
+ val = ioport("STICKY")->read();
break;
case 1:
- val = input_port_read(machine(), "STICKX");
+ val = ioport("STICKX")->read();
break;
case 2:
val = 0x20; /* DAC feedback, not used */
break;
case 3:
- val = input_port_read(machine(), "PLAYTIME");
+ val = ioport("PLAYTIME")->read();
break;
}
@@ -202,7 +202,7 @@ static INPUT_PORTS_START( starshp1 )
PORT_START("VBLANK")
PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starshp1_state,starshp1_analog_r, NULL) /* analog in */
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("COINAGE")
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starshp1_state,collision_latch_r, NULL) /* collision latch */
diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c
index c7959bd36ca..635124a1767 100644
--- a/src/mame/drivers/statriv2.c
+++ b/src/mame/drivers/statriv2.c
@@ -204,7 +204,7 @@ static SCREEN_UPDATE_IND16( statriv2 )
static INTERRUPT_GEN( statriv2_interrupt )
{
statriv2_state *state = device->machine().driver_data<statriv2_state>();
- UINT8 new_coin = input_port_read(device->machine(), "COIN");
+ UINT8 new_coin = state->ioport("COIN")->read();
/* check the coin inputs once per frame */
state->m_latched_coin |= new_coin & (new_coin ^ state->m_last_coin);
diff --git a/src/mame/drivers/stlforce.c b/src/mame/drivers/stlforce.c
index e1ebca9cafc..f8b82092398 100644
--- a/src/mame/drivers/stlforce.c
+++ b/src/mame/drivers/stlforce.c
@@ -137,7 +137,7 @@ static INPUT_PORTS_START( stlforce )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 59e545c57a0..e26c3fe0e01 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -58,12 +58,12 @@ READ8_MEMBER(saturn_state::stv_ioga_r)
switch(offset)
{
- case 0x01: res = input_port_read(machine(), "PORTA"); break; // P1
- case 0x03: res = input_port_read(machine(), "PORTB"); break; // P2
- case 0x05: res = input_port_read(machine(), "PORTC"); break; // SYSTEM
+ case 0x01: res = ioport("PORTA")->read(); break; // P1
+ case 0x03: res = ioport("PORTB")->read(); break; // P2
+ case 0x05: res = ioport("PORTC")->read(); break; // SYSTEM
case 0x07: res = m_system_output | 0xf0; break; // port D, read-backs value written
- case 0x09: res = input_port_read(machine(), "PORTE"); break; // P3
- case 0x0b: res = input_port_read(machine(), "PORTF"); break; // P4
+ case 0x09: res = ioport("PORTE")->read(); break; // P3
+ case 0x0b: res = ioport("PORTF")->read(); break; // P4
case 0x1b: res = 0; break; // Serial COM READ status
}
@@ -101,9 +101,9 @@ READ8_MEMBER(saturn_state::critcrsh_ioga_r)
{
case 0x01:
case 0x03:
- res = input_port_read(machine(), lgnames[offset >> 1]);
+ res = ioport(lgnames[offset >> 1])->read();
res = BITSWAP8(res, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
- res |= (input_port_read(machine(), "PORTC") & 0x10) ? 0x0 : 0x4; // x/y hit latch actually
+ res |= (ioport("PORTC")->read() & 0x10) ? 0x0 : 0x4; // x/y hit latch actually
break;
default: res = stv_ioga_r(space,offset); break;
}
@@ -169,7 +169,7 @@ READ8_MEMBER(saturn_state::stvmp_ioga_r)
for(i=0;i<5;i++)
{
if(m_mux_data & 1 << i)
- res = input_port_read(machine(), mpnames[offset >> 1][i]);
+ res = ioport(mpnames[offset >> 1][i])->read();
}
}
break;
diff --git a/src/mame/drivers/subs.c b/src/mame/drivers/subs.c
index 3ef397ec294..7374db5110f 100644
--- a/src/mame/drivers/subs.c
+++ b/src/mame/drivers/subs.c
@@ -114,7 +114,7 @@ static INPUT_PORTS_START( subs )
PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c
index 2555d895a4d..000f7d9c87b 100644
--- a/src/mame/drivers/subsino2.c
+++ b/src/mame/drivers/subsino2.c
@@ -786,10 +786,10 @@ WRITE8_MEMBER(subsino2_state::dsw_mask_w)
READ8_MEMBER(subsino2_state::dsw_r)
{
- return ( (input_port_read(machine(), "DSW1") & m_dsw_mask) ? 0x01 : 0 ) |
- ( (input_port_read(machine(), "DSW2") & m_dsw_mask) ? 0x02 : 0 ) |
- ( (input_port_read(machine(), "DSW3") & m_dsw_mask) ? 0x04 : 0 ) |
- ( (input_port_read(machine(), "DSW4") & m_dsw_mask) ? 0x08 : 0 ) ;
+ return ( (ioport("DSW1")->read() & m_dsw_mask) ? 0x01 : 0 ) |
+ ( (ioport("DSW2")->read() & m_dsw_mask) ? 0x02 : 0 ) |
+ ( (ioport("DSW3")->read() & m_dsw_mask) ? 0x04 : 0 ) |
+ ( (ioport("DSW4")->read() & m_dsw_mask) ? 0x08 : 0 ) ;
}
@@ -915,10 +915,10 @@ READ16_MEMBER(subsino2_state::bishjan_input_r)
for (i = 0; i < 5; i++)
if (m_bishjan_input & (1 << i))
- res = input_port_read(machine(), port[i]);
+ res = ioport(port[i])->read();
return (res << 8) | // high byte
- input_port_read(machine(), "SYSTEM") | // low byte
+ ioport("SYSTEM")->read() | // low byte
(machine().device<ticket_dispenser_device>("hopper")->read(space, 0) ? 0x00 : 0x04) // bit 2: hopper sensor
;
}
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 16e75a64497..f50c2b8204e 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -470,10 +470,10 @@ READ8_MEMBER(suna8_state::hardhead_ip_r)
switch (*m_hardhead_ip)
{
- case 0: return input_port_read(machine(), "P1");
- case 1: return input_port_read(machine(), "P2");
- case 2: return input_port_read(machine(), "DSW1");
- case 3: return input_port_read(machine(), "DSW2");
+ case 0: return ioport("P1")->read();
+ case 1: return ioport("P2")->read();
+ case 2: return ioport("DSW1")->read();
+ case 3: return ioport("DSW2")->read();
default:
logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n", cpu_get_pc(&space.device()), *m_hardhead_ip);
return 0xff;
@@ -1329,7 +1329,7 @@ static INPUT_PORTS_START( hardhea2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index c6ec233eb12..7c50b4be7eb 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -36,11 +36,11 @@ READ16_MEMBER(supbtime_state::supbtime_controls_r)
switch (offset << 1)
{
case 0:
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 2:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 8:
- return input_port_read(machine(), "COIN");
+ return ioport("COIN")->read();
case 10: /* ? Not used for anything */
case 12:
return 0;
@@ -131,7 +131,7 @@ static INPUT_PORTS_START( supbtime )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -209,7 +209,7 @@ static INPUT_PORTS_START( chinatwn )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c
index 0ee5affd341..f57c60f7c92 100644
--- a/src/mame/drivers/superchs.c
+++ b/src/mame/drivers/superchs.c
@@ -109,7 +109,7 @@ READ32_MEMBER(superchs_state::superchs_input_r)
switch (offset)
{
case 0x00:
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 0x01:
return m_coin_word<<16;
@@ -169,12 +169,12 @@ WRITE32_MEMBER(superchs_state::superchs_input_w)
READ32_MEMBER(superchs_state::superchs_stick_r)
{
- int fake = input_port_read(machine(), "FAKE");
+ int fake = ioport("FAKE")->read();
int accel;
if (!(fake &0x10)) /* Analogue steer (the real control method) */
{
- m_steer = input_port_read(machine(), "WHEEL");
+ m_steer = ioport("WHEEL")->read();
}
else /* Digital steer, with smoothing - speed depends on how often stick_r is called */
{
@@ -199,13 +199,13 @@ READ32_MEMBER(superchs_state::superchs_stick_r)
}
/* Accelerator is an analogue input but the game treats it as digital (on/off) */
- if (input_port_read(machine(), "FAKE") & 0x1) /* pressing B1 */
+ if (ioport("FAKE")->read() & 0x1) /* pressing B1 */
accel = 0x0;
else
accel = 0xff;
/* Todo: Verify brake - and figure out other input */
- return (m_steer << 24) | (accel << 16) | (input_port_read(machine(), "SOUND") << 8) | input_port_read(machine(), "UNKNOWN");
+ return (m_steer << 24) | (accel << 16) | (ioport("SOUND")->read() << 8) | ioport("UNKNOWN")->read();
}
WRITE32_MEMBER(superchs_state::superchs_stick_w)
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 47fa32441a5..a5b5c3ca3c4 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -112,7 +112,7 @@ static SAMPLES_START( pbillian_sh_start )
{
superqix_state *state = device.machine().driver_data<superqix_state>();
running_machine &machine = device.machine();
- UINT8 *src = machine.root_device().memregion("samples")->base();
+ UINT8 *src = state->memregion("samples")->base();
int i, len = state->memregion("samples")->bytes();
/* convert 8-bit unsigned samples to 8-bit signed */
@@ -174,7 +174,7 @@ static READ8_DEVICE_HANDLER( in4_mcu_r )
{
superqix_state *state = device->machine().driver_data<superqix_state>();
// logerror("%04x: in4_mcu_r\n",cpu_get_pc(&space->device()));
- return input_port_read(device->machine(), "P2") | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7);
+ return state->ioport("P2")->read() | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7);
}
static READ8_DEVICE_HANDLER( sqix_from_mcu_r )
@@ -255,11 +255,11 @@ READ8_MEMBER(superqix_state::bootleg_mcu_p3_r)
{
if ((m_port1 & 0x10) == 0)
{
- return input_port_read(machine(), "DSW1");
+ return ioport("DSW1")->read();
}
else if ((m_port1 & 0x20) == 0)
{
- return input_port_read(machine(), "SYSTEM") | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
+ return ioport("SYSTEM")->read() | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
}
else if ((m_port1 & 0x40) == 0)
{
@@ -272,7 +272,7 @@ READ8_MEMBER(superqix_state::bootleg_mcu_p3_r)
READ8_MEMBER(superqix_state::sqixu_mcu_p0_r)
{
- return input_port_read(machine(), "SYSTEM") | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
+ return ioport("SYSTEM")->read() | (m_from_mcu_pending << 6) | (m_from_z80_pending << 7);
}
WRITE8_MEMBER(superqix_state::sqixu_mcu_p2_w)
@@ -325,7 +325,7 @@ READ8_MEMBER(superqix_state::nmi_ack_r)
static READ8_DEVICE_HANDLER( bootleg_in0_r )
{
- return BITSWAP8(input_port_read(device->machine(), "DSW1"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(device->machine().root_device().ioport("DSW1")->read(), 0,1,2,3,4,5,6,7);
}
WRITE8_MEMBER(superqix_state::bootleg_flipscreen_w)
@@ -352,7 +352,7 @@ static int read_dial(running_machine &machine, int player)
int newpos;
/* get the new position and adjust the result */
- newpos = input_port_read(machine, player ? "DIAL2" : "DIAL1");
+ newpos = state->ioport(player ? "DIAL2" : "DIAL1")->read();
if (newpos != state->m_oldpos[player])
{
state->m_sign[player] = ((newpos - state->m_oldpos[player]) & 0x80) >> 7;
@@ -429,11 +429,11 @@ WRITE8_MEMBER(superqix_state::hotsmash_68705_portC_w)
switch (data & 0x07)
{
case 0x0: // dsw A
- m_portA_in = input_port_read(machine(), "DSW1");
+ m_portA_in = ioport("DSW1")->read();
break;
case 0x1: // dsw B
- m_portA_in = input_port_read(machine(), "DSW2");
+ m_portA_in = ioport("DSW2")->read();
break;
case 0x2:
@@ -478,7 +478,7 @@ static READ8_DEVICE_HANDLER(hotsmash_ay_port_a_r)
{
superqix_state *state = device->machine().driver_data<superqix_state>();
// logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(&space->device()),state->m_from_mcu_pending);
- return input_port_read(device->machine(), "SYSTEM") | ((state->m_from_mcu_pending^1) << 7);
+ return state->ioport("SYSTEM")->read() | ((state->m_from_mcu_pending^1) << 7);
}
/**************************************************************************
@@ -499,15 +499,15 @@ READ8_MEMBER(superqix_state::pbillian_from_mcu_r)
{
case 0x01:
{
- UINT8 p = input_port_read(machine(), m_curr_player ? "PLUNGER2" : "PLUNGER1") & 0xbf;
+ UINT8 p = ioport(m_curr_player ? "PLUNGER2" : "PLUNGER1")->read() & 0xbf;
if ((p & 0x3f) == 0) p |= 0x40;
return p;
}
- case 0x02: return input_port_read(machine(), m_curr_player ? "DIAL2" : "DIAL1");
+ case 0x02: return ioport(m_curr_player ? "DIAL2" : "DIAL1")->read();
- case 0x04: return input_port_read(machine(), "DSW1");
- case 0x08: return input_port_read(machine(), "DSW2");
+ case 0x04: return ioport("DSW1")->read();
+ case 0x08: return ioport("DSW2")->read();
case 0x80: m_curr_player = 0; return 0;
case 0x81: m_curr_player = 1; return 0;
@@ -521,7 +521,7 @@ static READ8_DEVICE_HANDLER(pbillian_ay_port_a_r)
{
// logerror("%04x: ay_port_a_r\n",cpu_get_pc(&space->device()));
/* bits 76------ MCU status bits */
- return (device->machine().rand() & 0xc0) | input_port_read(device->machine(), "BUTTONS");
+ return (device->machine().rand() & 0xc0) | device->machine().root_device().ioport("BUTTONS")->read();
}
@@ -867,7 +867,7 @@ static INPUT_PORTS_START( superqix )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) /* ??? */
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* ??? */
PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
PORT_START("P2")
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index 2066e6a89ef..341df78e0b4 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -285,20 +285,20 @@ static READ8_DEVICE_HANDLER( pedal_extra_bits_r )
{
UINT8 p1_sht_sw,p2_sht_sw;
- p1_sht_sw = (input_port_read(device->machine(), "P1_RELEASE") & 0x80)>>7;
- p2_sht_sw = (input_port_read(device->machine(), "P2_RELEASE") & 0x80)>>6;
+ p1_sht_sw = (device->machine().root_device().ioport("P1_RELEASE")->read() & 0x80)>>7;
+ p2_sht_sw = (device->machine().root_device().ioport("P2_RELEASE")->read() & 0x80)>>6;
return p1_sht_sw | p2_sht_sw;
}
static READ8_DEVICE_HANDLER( p1_r )
{
- return (input_port_read(device->machine(), "P1") & 0xf0) | ((input_port_read(device->machine(), "P1_ANALOG") & 0xf));
+ return (device->machine().root_device().ioport("P1")->read() & 0xf0) | ((device->machine().root_device().ioport("P1_ANALOG")->read() & 0xf));
}
static READ8_DEVICE_HANDLER( p2_r )
{
- return (input_port_read(device->machine(), "P2") & 0xf0) | ((input_port_read(device->machine(), "P2_ANALOG") & 0xf));
+ return (device->machine().root_device().ioport("P2")->read() & 0xf0) | ((device->machine().root_device().ioport("P2_ANALOG")->read() & 0xf));
}
static ADDRESS_MAP_START( suprgolf_map, AS_PROGRAM, 8, suprgolf_state )
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index a406738d066..9498a5050ad 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -458,7 +458,7 @@ static TIMER_DEVICE_CALLBACK(skns_irq)
CUSTOM_INPUT_MEMBER(skns_state::paddle_r)
{
const char *tag = (const char *)param;
- return input_port_read(machine(), tag);
+ return ioport(tag)->read();
}
static INPUT_PORTS_START( skns ) /* 3 buttons, 2 players */
diff --git a/src/mame/drivers/suprridr.c b/src/mame/drivers/suprridr.c
index 5da14320153..54dedd510f8 100644
--- a/src/mame/drivers/suprridr.c
+++ b/src/mame/drivers/suprridr.c
@@ -230,9 +230,9 @@ CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r)
/* screen flip multiplexes controls */
if (suprridr_is_screen_flipped(machine()))
- ret = input_port_read(machine(), SUPRRIDR_P2_CONTROL_PORT_TAG);
+ ret = ioport(SUPRRIDR_P2_CONTROL_PORT_TAG)->read();
else
- ret = input_port_read(machine(), SUPRRIDR_P1_CONTROL_PORT_TAG);
+ ret = ioport(SUPRRIDR_P1_CONTROL_PORT_TAG)->read();
return ret;
}
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 0694cb43a28..e15d28a5829 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -356,10 +356,10 @@ static const UINT8 cc_ex[0x100] = {
static MACHINE_START( system1 )
{
system1_state *state = machine.driver_data<system1_state>();
- UINT32 numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
+ UINT32 numbanks = (state->memregion("maincpu")->bytes() - 0x10000) / 0x4000;
if (numbanks > 0)
- state->membank("bank1")->configure_entries(0, numbanks, machine.root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
+ state->membank("bank1")->configure_entries(0, numbanks, state->memregion("maincpu")->base() + 0x10000, 0x4000);
else
state->membank("bank1")->configure_entry(0, state->memregion("maincpu")->base() + 0x8000);
state->membank("bank1")->set_entry(0);
@@ -442,7 +442,7 @@ WRITE8_MEMBER(system1_state::videomode_w)
CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_data_r)
{
static const char *const ports[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" };
- return input_port_read(machine(), ports[m_dakkochn_mux_data]);
+ return ioport(ports[m_dakkochn_mux_data])->read();
}
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 2f3a9d406ff..33e54c555e0 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -203,37 +203,37 @@ ADDRESS_MAP_END
READ16_MEMBER(segas1x_bootleg_state::passht4b_service_r)
{
- UINT16 val = input_port_read(machine(), "SERVICE");
+ UINT16 val = ioport("SERVICE")->read();
- if(!(input_port_read(machine(), "P1") & 0x40)) val &= 0xef;
- if(!(input_port_read(machine(), "P2") & 0x40)) val &= 0xdf;
- if(!(input_port_read(machine(), "P3") & 0x40)) val &= 0xbf;
- if(!(input_port_read(machine(), "P4") & 0x40)) val &= 0x7f;
+ if(!(ioport("P1")->read() & 0x40)) val &= 0xef;
+ if(!(ioport("P2")->read() & 0x40)) val &= 0xdf;
+ if(!(ioport("P3")->read() & 0x40)) val &= 0xbf;
+ if(!(ioport("P4")->read() & 0x40)) val &= 0x7f;
- m_passht4b_io3_val = (input_port_read(machine(), "P1") << 4) | (input_port_read(machine(), "P3") & 0xf);
- m_passht4b_io2_val = (input_port_read(machine(), "P2") << 4) | (input_port_read(machine(), "P4") & 0xf);
+ m_passht4b_io3_val = (ioport("P1")->read() << 4) | (ioport("P3")->read() & 0xf);
+ m_passht4b_io2_val = (ioport("P2")->read() << 4) | (ioport("P4")->read() & 0xf);
m_passht4b_io1_val = 0xff;
// player 1 buttons
- if(!(input_port_read(machine(), "P1") & 0x10)) m_passht4b_io1_val &= 0xfe;
- if(!(input_port_read(machine(), "P1") & 0x20)) m_passht4b_io1_val &= 0xfd;
- if(!(input_port_read(machine(), "P1") & 0x80)) m_passht4b_io1_val &= 0xfc;
+ if(!(ioport("P1")->read() & 0x10)) m_passht4b_io1_val &= 0xfe;
+ if(!(ioport("P1")->read() & 0x20)) m_passht4b_io1_val &= 0xfd;
+ if(!(ioport("P1")->read() & 0x80)) m_passht4b_io1_val &= 0xfc;
// player 2 buttons
- if(!(input_port_read(machine(), "P2") & 0x10)) m_passht4b_io1_val &= 0xfb;
- if(!(input_port_read(machine(), "P2") & 0x20)) m_passht4b_io1_val &= 0xf7;
- if(!(input_port_read(machine(), "P2") & 0x80)) m_passht4b_io1_val &= 0xf3;
+ if(!(ioport("P2")->read() & 0x10)) m_passht4b_io1_val &= 0xfb;
+ if(!(ioport("P2")->read() & 0x20)) m_passht4b_io1_val &= 0xf7;
+ if(!(ioport("P2")->read() & 0x80)) m_passht4b_io1_val &= 0xf3;
// player 3 buttons
- if(!(input_port_read(machine(), "P3") & 0x10)) m_passht4b_io1_val &= 0xef;
- if(!(input_port_read(machine(), "P3") & 0x20)) m_passht4b_io1_val &= 0xdf;
- if(!(input_port_read(machine(), "P3") & 0x80)) m_passht4b_io1_val &= 0xcf;
+ if(!(ioport("P3")->read() & 0x10)) m_passht4b_io1_val &= 0xef;
+ if(!(ioport("P3")->read() & 0x20)) m_passht4b_io1_val &= 0xdf;
+ if(!(ioport("P3")->read() & 0x80)) m_passht4b_io1_val &= 0xcf;
// player 4 buttons
- if(!(input_port_read(machine(), "P4") & 0x10)) m_passht4b_io1_val &= 0xbf;
- if(!(input_port_read(machine(), "P4") & 0x20)) m_passht4b_io1_val &= 0x7f;
- if(!(input_port_read(machine(), "P4") & 0x80)) m_passht4b_io1_val &= 0x3f;
+ if(!(ioport("P4")->read() & 0x10)) m_passht4b_io1_val &= 0xbf;
+ if(!(ioport("P4")->read() & 0x20)) m_passht4b_io1_val &= 0x7f;
+ if(!(ioport("P4")->read() & 0x80)) m_passht4b_io1_val &= 0x3f;
return val;
}
@@ -1892,7 +1892,7 @@ static INPUT_PORTS_START( mwalkbl )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE4 )
PORT_MODIFY("COINAGE")
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x20)
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8") PORT_CONDITION("DSW1",0x20,EQUALS,0x20)
PORT_DIPSETTING( 0x70, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x90, DEF_STR( 2C_1C ) )
@@ -3349,7 +3349,7 @@ static DRIVER_INIT( goldnaxeb1 )
{
segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int i;
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 *KEY = state->memregion("decryption")->base();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 data[0x1000];
diff --git a/src/mame/drivers/tagteam.c b/src/mame/drivers/tagteam.c
index ed4b607e90f..99feea2f9a5 100644
--- a/src/mame/drivers/tagteam.c
+++ b/src/mame/drivers/tagteam.c
@@ -118,7 +118,7 @@ static INPUT_PORTS_START( bigprowr )
PORT_DIPSETTING( 0x40, "Upright, Dual Controls" )
// PORT_DIPSETTING( 0x20, "Cocktail, Single Controls" ) // IMPOSSIBLE !
PORT_DIPSETTING( 0x60, DEF_STR( Cocktail ) ) // "Cocktail, Dual Controls"
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1")
@@ -144,14 +144,14 @@ static INPUT_PORTS_START( tagteam )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_NOTEQUALS, 0x80) //Mode 1
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_EQUALS, 0x80) //Mode 2
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2", 0xe0, NOTEQUALS, 0x80) //Mode 1
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2", 0xe0, EQUALS, 0x80) //Mode 2
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4")
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_NOTEQUALS, 0x80) //Mode 1
- PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_EQUALS, 0x80) //Mode 2
+ PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2", 0xe0, NOTEQUALS, 0x80) //Mode 1
+ PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2", 0xe0, EQUALS, 0x80) //Mode 2
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0xe0, 0x00, "Coin Mode" ) PORT_DIPLOCATION("SW2:6,7,8")
diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c
index 7a4fe809376..5fdbd3ca72f 100644
--- a/src/mame/drivers/tail2nos.c
+++ b/src/mame/drivers/tail2nos.c
@@ -227,7 +227,7 @@ static MACHINE_RESET( tail2nos )
tail2nos_state *state = machine.driver_data<tail2nos_state>();
/* point to the extra ROMs */
- state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base());
+ state->membank("bank1")->set_base(state->memregion("user1")->base());
state->membank("bank2")->set_base(state->memregion("user2")->base());
state->m_charbank = 0;
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index 9c76fbbb2f4..7ce25752353 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -336,42 +336,42 @@ static INTERRUPT_GEN( realpunc_interrupt )//2
READ16_MEMBER(taitob_state::tracky1_hi_r)
{
- return input_port_read(machine(), "TRACKX1");
+ return ioport("TRACKX1")->read();
}
READ16_MEMBER(taitob_state::tracky1_lo_r)
{
- return (input_port_read(machine(), "TRACKX1") & 0xff) << 8;
+ return (ioport("TRACKX1")->read() & 0xff) << 8;
}
READ16_MEMBER(taitob_state::trackx1_hi_r)
{
- return input_port_read(machine(), "TRACKY1");
+ return ioport("TRACKY1")->read();
}
READ16_MEMBER(taitob_state::trackx1_lo_r)
{
- return (input_port_read(machine(), "TRACKY1") & 0xff) << 8;
+ return (ioport("TRACKY1")->read() & 0xff) << 8;
}
READ16_MEMBER(taitob_state::tracky2_hi_r)
{
- return input_port_read(machine(), "TRACKX2");
+ return ioport("TRACKX2")->read();
}
READ16_MEMBER(taitob_state::tracky2_lo_r)
{
- return (input_port_read(machine(), "TRACKX2") & 0xff) << 8;
+ return (ioport("TRACKX2")->read() & 0xff) << 8;
}
READ16_MEMBER(taitob_state::trackx2_hi_r)
{
- return input_port_read(machine(), "TRACKY2");
+ return ioport("TRACKY2")->read();
}
READ16_MEMBER(taitob_state::trackx2_lo_r)
{
- return (input_port_read(machine(), "TRACKY2") & 0xff) << 8;
+ return (ioport("TRACKY2")->read() & 0xff) << 8;
}
@@ -438,7 +438,7 @@ WRITE16_MEMBER(taitob_state::eeprom_w)
/* bit 7 - set all the time (Chip Select?) */
/* EEPROM */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
@@ -475,7 +475,7 @@ READ16_MEMBER(taitob_state::pbobble_input_bypass_r)
switch (offset)
{
case 0x01:
- return input_port_read(machine(), "COIN") << 8;
+ return ioport("COIN")->read() << 8;
default:
return tc0640fio_r(m_tc0640fio, offset) << 8;
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index 7ecbe0685ec..3530984ac75 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -324,25 +324,25 @@ READ16_MEMBER(taitof2_state::ninjak_input_r)
switch (offset)
{
case 0x00:
- return (input_port_read(machine(), "DSWA") << 8);
+ return (ioport("DSWA")->read() << 8);
case 0x01:
- return (input_port_read(machine(), "DSWB") << 8);
+ return (ioport("DSWB")->read() << 8);
case 0x02:
- return (input_port_read(machine(), "IN0") << 8);
+ return (ioport("IN0")->read() << 8);
case 0x03:
- return (input_port_read(machine(), "IN1") << 8);
+ return (ioport("IN1")->read() << 8);
case 0x04:
- return (input_port_read(machine(), "IN3") << 8);
+ return (ioport("IN3")->read() << 8);
case 0x05:
- return (input_port_read(machine(), "IN4") << 8);
+ return (ioport("IN4")->read() << 8);
case 0x06:
- return (input_port_read(machine(), "IN2") << 8);
+ return (ioport("IN2")->read() << 8);
// case 0x07:
// return (coin_word & mem_mask);
@@ -360,13 +360,13 @@ READ16_MEMBER(taitof2_state::cameltry_paddle_r)
switch (offset)
{
case 0x00:
- curr = input_port_read(machine(), "PADDLE1");
+ curr = ioport("PADDLE1")->read();
res = curr - m_last[0];
m_last[0] = curr;
return res;
case 0x02:
- curr = input_port_read(machine(), "PADDLE2");
+ curr = ioport("PADDLE2")->read();
res = curr - m_last[1];
m_last[1] = curr;
return res;
@@ -383,12 +383,12 @@ READ16_MEMBER(taitof2_state::mjnquest_dsw_r)
{
case 0x00:
{
- return (input_port_read(machine(), "IN5") << 8) + input_port_read(machine(), "DSWA"); /* DSW A + coin */
+ return (ioport("IN5")->read() << 8) + ioport("DSWA")->read(); /* DSW A + coin */
}
case 0x01:
{
- return (input_port_read(machine(), "IN6") << 8) + input_port_read(machine(), "DSWB"); /* DSW B + coin */
+ return (ioport("IN6")->read() << 8) + ioport("DSWB")->read(); /* DSW B + coin */
}
}
@@ -402,19 +402,19 @@ READ16_MEMBER(taitof2_state::mjnquest_input_r)
switch (m_mjnquest_input)
{
case 0x01:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 0x02:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 0x04:
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
case 0x08:
- return input_port_read(machine(), "IN3");
+ return ioport("IN3")->read();
case 0x10:
- return input_port_read(machine(), "IN4");
+ return ioport("IN4")->read();
}
@@ -2461,43 +2461,43 @@ static INPUT_PORTS_START( qcrayon2 )
PORT_START("IN0")
/* Joystick Control */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
/* 4 Buttons Control */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_START("IN1")
/* Joystick Control */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
/* 4 Buttons Control */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_START("IN2")
TAITO_F2_SYSTEM_INPUT
@@ -5310,7 +5310,7 @@ static DRIVER_INIT( cameltry )
static DRIVER_INIT( mjnquest )
{
taitof2_state *state = machine.driver_data<taitof2_state>();
- int i, len = machine.root_device().memregion("gfx2")->bytes();
+ int i, len = state->memregion("gfx2")->bytes();
UINT8 *gfx = state->memregion("gfx2")->base();
/* the bytes in each longword are in reversed order, put them in the
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index b945ab251f9..ac1ca7f14fb 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -46,7 +46,7 @@ CUSTOM_INPUT_MEMBER(taito_f3_state::f3_analog_r)
const char *tag = (const char *)param;
UINT32 ipt = 0;
- ipt = ((input_port_read(machine(), tag) & 0xf)<<12) | ((input_port_read(machine(), tag) & 0xff0)>>4);
+ ipt = ((ioport(tag)->read() & 0xf)<<12) | ((ioport(tag)->read() & 0xff0)>>4);
return ipt;
}
@@ -62,7 +62,7 @@ READ32_MEMBER(taito_f3_state::f3_control_r)
static const char *const iptnames[] = { "IN0", "IN1", "AN0", "AN1", "IN2", "IN3" };
if (offset < 6)
- return input_port_read(machine(), iptnames[offset]);
+ return ioport(iptnames[offset])->read();
logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(&space.device()), offset);
return 0xffffffff;
@@ -90,7 +90,7 @@ WRITE32_MEMBER(taito_f3_state::f3_control_w)
case 0x04: /* Eeprom */
if (ACCESSING_BITS_0_7)
{
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
return;
diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c
index e2fdbacc79e..936c8e5fba1 100644
--- a/src/mame/drivers/taito_h.c
+++ b/src/mame/drivers/taito_h.c
@@ -188,37 +188,37 @@ READ8_MEMBER(taitoh_state::syvalion_input_bypass_r)
switch( port )
{
case 0x08: /* trackball y coords bottom 8 bits for 2nd player */
- return input_port_read(machine(), P2TRACKY_PORT_TAG);
+ return ioport(P2TRACKY_PORT_TAG)->read();
case 0x09: /* trackball y coords top 8 bits for 2nd player */
- if (input_port_read(machine(), P2TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
+ if (ioport(P2TRACKY_PORT_TAG)->read() & 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 input_port_read(machine(), P2TRACKX_PORT_TAG);
+ return ioport(P2TRACKX_PORT_TAG)->read();
case 0x0b: /* trackball x coords top 8 bits for 2nd player */
- if (input_port_read(machine(), P2TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
+ if (ioport(P2TRACKX_PORT_TAG)->read() & 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 input_port_read(machine(), P1TRACKY_PORT_TAG);
+ return ioport(P1TRACKY_PORT_TAG)->read();
case 0x0d: /* trackball y coords top 8 bits for 1st player */
- if (input_port_read(machine(), P1TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
+ if (ioport(P1TRACKY_PORT_TAG)->read() & 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 input_port_read(machine(), P1TRACKX_PORT_TAG);
+ return ioport(P1TRACKX_PORT_TAG)->read();
case 0x0f: /* trackball x coords top 8 bits for 1st player */
- if (input_port_read(machine(), P1TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
+ if (ioport(P1TRACKX_PORT_TAG)->read() & 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 49a5d7b5b97..7e01389bca7 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -487,13 +487,13 @@ WRITE8_MEMBER(taitol_state::control2_w)
static READ8_DEVICE_HANDLER( portA_r )
{
taitol_state *state = device->machine().driver_data<taitol_state>();
- return input_port_read(device->machine(), (state->m_extport == 0) ? state->m_porte0_tag : state->m_porte1_tag);
+ return state->ioport((state->m_extport == 0) ? state->m_porte0_tag : state->m_porte1_tag)->read();
}
static READ8_DEVICE_HANDLER( portB_r )
{
taitol_state *state = device->machine().driver_data<taitol_state>();
- return input_port_read(device->machine(), (state->m_extport == 0) ? state->m_portf0_tag : state->m_portf1_tag);
+ return state->ioport((state->m_extport == 0) ? state->m_portf0_tag : state->m_portf1_tag)->read();
}
static READ8_DEVICE_HANDLER( extport_select_and_ym2203_r )
@@ -551,15 +551,15 @@ READ8_MEMBER(taitol_state::mux_r)
switch (m_mux_ctrl)
{
case 0:
- return input_port_read(machine(), "DSWA");
+ return ioport("DSWA")->read();
case 1:
- return input_port_read(machine(), "DSWB");
+ return ioport("DSWB")->read();
case 2:
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
case 3:
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
case 7:
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
default:
logerror("Mux read from unknown port %d (%04x)\n", m_mux_ctrl, cpu_get_pc(&space.device()));
return 0xff;
@@ -636,7 +636,7 @@ READ8_MEMBER(taitol_state::horshoes_tracky_reset_r)
{
/* reset the trackball counter */
- m_tracky = input_port_read(machine(), "AN0");
+ m_tracky = ioport("AN0")->read();
return 0;
}
@@ -644,28 +644,28 @@ READ8_MEMBER(taitol_state::horshoes_trackx_reset_r)
{
/* reset the trackball counter */
- m_trackx = input_port_read(machine(), "AN1");
+ m_trackx = ioport("AN1")->read();
return 0;
}
READ8_MEMBER(taitol_state::horshoes_tracky_lo_r)
{
- return (input_port_read(machine(), "AN0") - m_tracky) & 0xff;
+ return (ioport("AN0")->read() - m_tracky) & 0xff;
}
READ8_MEMBER(taitol_state::horshoes_tracky_hi_r)
{
- return (input_port_read(machine(), "AN0") - m_tracky) >> 8;
+ return (ioport("AN0")->read() - m_tracky) >> 8;
}
READ8_MEMBER(taitol_state::horshoes_trackx_lo_r)
{
- return (input_port_read(machine(), "AN1") - m_trackx) & 0xff;
+ return (ioport("AN1")->read() - m_trackx) & 0xff;
}
READ8_MEMBER(taitol_state::horshoes_trackx_hi_r)
{
- return (input_port_read(machine(), "AN1") - m_trackx) >> 8;
+ return (ioport("AN1")->read() - m_trackx) >> 8;
}
@@ -1532,23 +1532,23 @@ static INPUT_PORTS_START( plgirls2 )
PORT_DIPSETTING( 0x08, "Mode A" )
PORT_DIPSETTING( 0x00, "Mode B" )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
- PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x08)
- PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, PORTCOND_EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x08)
+ PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x08, EQUALS, 0x00)
PORT_START("DSWB")
TAITO_DIFFICULTY_LOC(SW2) /* Difficulty controls the number of hits requiered to destroy enemies */
diff --git a/src/mame/drivers/taito_o.c b/src/mame/drivers/taito_o.c
index 60498c3f72d..02b3dd785da 100644
--- a/src/mame/drivers/taito_o.c
+++ b/src/mame/drivers/taito_o.c
@@ -53,8 +53,8 @@ READ16_MEMBER(taitoo_state::io_r)
switch(offset)
{
- case 0: retval = input_port_read(machine(), "IN0") & (clear_hack ? 0xf7ff : 0xffff); break;
- case 1: retval = input_port_read(machine(), "IN1") & (clear_hack ? 0xfff7 : 0xffff); break;
+ case 0: retval = ioport("IN0")->read() & (clear_hack ? 0xf7ff : 0xffff); break;
+ case 1: retval = ioport("IN1")->read() & (clear_hack ? 0xfff7 : 0xffff); break;
default: logerror("IO R %x %x = %x @ %x\n", offset, mem_mask, retval, cpu_get_pc(&space.device()));
}
return retval;
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index f1390a12435..c6b13660f73 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -340,13 +340,13 @@ READ16_MEMBER(taitox_state::superman_dsw_input_r)
switch (offset)
{
case 0x00:
- return input_port_read(machine(), "DSWA") & 0x0f;
+ return ioport("DSWA")->read() & 0x0f;
case 0x01:
- return (input_port_read(machine(), "DSWA") & 0xf0) >> 4;
+ return (ioport("DSWA")->read() & 0xf0) >> 4;
case 0x02:
- return input_port_read(machine(), "DSWB") & 0x0f;
+ return ioport("DSWB")->read() & 0x0f;
case 0x03:
- return (input_port_read(machine(), "DSWB") & 0xf0) >> 4;
+ return (ioport("DSWB")->read() & 0xf0) >> 4;
default:
logerror("taitox unknown dsw read offset: %04x\n", offset);
return 0x00;
@@ -358,11 +358,11 @@ READ16_MEMBER(taitox_state::daisenpu_input_r)
switch (offset)
{
case 0x00:
- return input_port_read(machine(), "IN0"); /* Player 1 controls + START1 */
+ return ioport("IN0")->read(); /* Player 1 controls + START1 */
case 0x01:
- return input_port_read(machine(), "IN1"); /* Player 2 controls + START2 */
+ return ioport("IN1")->read(); /* Player 2 controls + START2 */
case 0x02:
- return input_port_read(machine(), "IN2"); /* COINn + SERVICE1 + TILT */
+ return ioport("IN2")->read(); /* COINn + SERVICE1 + TILT */
default:
logerror("taitox unknown input read offset: %04x\n", offset);
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index bedc843964c..bafe11a0d2c 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -1046,7 +1046,7 @@ WRITE16_MEMBER(taitoz_state::spacegun_output_bypass_w)
x0000000 (unused) */
COMBINE_DATA(&m_eep_latch);
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
break;
default:
@@ -1065,12 +1065,12 @@ READ8_MEMBER(taitoz_state::contcirc_input_bypass_r)
UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0); /* read port number */
int steer = 0;
- int fake = input_port_read(machine(), "FAKE");
+ int fake = ioport("FAKE")->read();
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero and reduce span to 0xc0 */
- steer = ((input_port_read(machine(), "STEER") - 0x80) * 0xc0) / 0x100;
+ steer = ((ioport("STEER")->read() - 0x80) * 0xc0) / 0x100;
}
else /* Digital steer */
@@ -1105,12 +1105,12 @@ READ8_MEMBER(taitoz_state::chasehq_input_bypass_r)
UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0); /* read port number */
int steer = 0;
- int fake = input_port_read(machine(), "FAKE");
+ int fake = ioport("FAKE")->read();
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero */
- steer = input_port_read(machine(), "STEER") - 0x80;
+ steer = ioport("STEER")->read() - 0x80;
}
else /* Digital steer */
{
@@ -1127,16 +1127,16 @@ READ8_MEMBER(taitoz_state::chasehq_input_bypass_r)
switch (port)
{
case 0x08:
- return input_port_read(machine(), "UNK1");
+ return ioport("UNK1")->read();
case 0x09:
- return input_port_read(machine(), "UNK2");
+ return ioport("UNK2")->read();
case 0x0a:
- return input_port_read(machine(), "UNK3");
+ return ioport("UNK3")->read();
case 0x0b:
- return input_port_read(machine(), "UNK4");
+ return ioport("UNK4")->read();
case 0x0c:
return steer & 0xff;
@@ -1155,16 +1155,16 @@ READ16_MEMBER(taitoz_state::bshark_stick_r)
switch (offset)
{
case 0x00:
- return input_port_read(machine(), "STICKX");
+ return ioport("STICKX")->read();
case 0x01:
- return input_port_read(machine(), "X_ADJUST");
+ return ioport("X_ADJUST")->read();
case 0x02:
- return input_port_read(machine(), "STICKY");
+ return ioport("STICKY")->read();
case 0x03:
- return input_port_read(machine(), "Y_ADJUST");
+ return ioport("Y_ADJUST")->read();
}
logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(&space.device()), offset);
@@ -1178,16 +1178,16 @@ READ16_MEMBER(taitoz_state::nightstr_stick_r)
switch (offset)
{
case 0x00:
- return input_port_read(machine(), "STICKX");
+ return ioport("STICKX")->read();
case 0x01:
- return input_port_read(machine(), "STICKY");
+ return ioport("STICKY")->read();
case 0x02:
- return input_port_read(machine(), "X_ADJUST");
+ return ioport("X_ADJUST")->read();
case 0x03:
- return input_port_read(machine(), "Y_ADJUST");
+ return ioport("Y_ADJUST")->read();
}
logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(&space.device()), offset);
@@ -1210,12 +1210,12 @@ WRITE16_MEMBER(taitoz_state::bshark_stick_w)
READ16_MEMBER(taitoz_state::sci_steer_input_r)
{
int steer = 0;
- int fake = input_port_read(machine(), "FAKE");
+ int fake = ioport("FAKE")->read();
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero and reduce span to 0xc0 */
- steer = ((input_port_read(machine(), "STEER") - 0x80) * 0xc0) / 0x100;
+ steer = ((ioport("STEER")->read() - 0x80) * 0xc0) / 0x100;
}
else /* Digital steer */
{
@@ -1262,16 +1262,16 @@ READ16_MEMBER(taitoz_state::spacegun_lightgun_r)
switch (offset)
{
case 0x00:
- return input_port_read(machine(), "STICKX1");
+ return ioport("STICKX1")->read();
case 0x01:
- return input_port_read(machine(), "STICKY1");
+ return ioport("STICKY1")->read();
case 0x02:
- return input_port_read(machine(), "STICKX2");
+ return ioport("STICKX2")->read();
case 0x03:
- return input_port_read(machine(), "STICKY2");
+ return ioport("STICKY2")->read();
}
return 0x00;
@@ -1300,12 +1300,12 @@ WRITE16_MEMBER(taitoz_state::spacegun_gun_output_w)
READ16_MEMBER(taitoz_state::dblaxle_steer_input_r)
{
int steer = 0;
- int fake = input_port_read(machine(), "FAKE");
+ int fake = ioport("FAKE")->read();
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero and reduce span to 0x80 */
- steer = ((input_port_read(machine(), "STEER") - 0x80) * 0x80) / 0x100;
+ steer = ((ioport("STEER")->read() - 0x80) * 0x80) / 0x100;
}
else /* Digital steer */
{
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c
index 8dbeca57aea..1f89d7c4614 100644
--- a/src/mame/drivers/taitoair.c
+++ b/src/mame/drivers/taitoair.c
@@ -341,19 +341,19 @@ READ16_MEMBER(taitoair_state::stick_input_r)
switch( offset )
{
case 0x00: /* "counter 1" lo */
- return input_port_read(machine(), STICK1_PORT_TAG);
+ return ioport(STICK1_PORT_TAG)->read();
case 0x01: /* "counter 2" lo */
- return input_port_read(machine(), STICK2_PORT_TAG);
+ return ioport(STICK2_PORT_TAG)->read();
case 0x02: /* "counter 1" hi */
- if(input_port_read(machine(), STICK1_PORT_TAG) & 0x80)
+ if(ioport(STICK1_PORT_TAG)->read() & 0x80)
return 0xff;
return 0;
case 0x03: /* "counter 2" hi */
- return (input_port_read(machine(), STICK2_PORT_TAG) & 0xff00) >> 8;
+ return (ioport(STICK2_PORT_TAG)->read() & 0xff00) >> 8;
}
return 0;
@@ -364,10 +364,10 @@ READ16_MEMBER(taitoair_state::stick2_input_r)
switch( offset )
{
case 0x00: /* "counter 3" lo */
- return input_port_read(machine(), STICK3_PORT_TAG);
+ return ioport(STICK3_PORT_TAG)->read();
case 0x02: /* "counter 3" hi */
- return (input_port_read(machine(), STICK3_PORT_TAG) & 0xff00) >> 8;
+ return (ioport(STICK3_PORT_TAG)->read() & 0xff00) >> 8;
}
return 0;
diff --git a/src/mame/drivers/taitogn.c b/src/mame/drivers/taitogn.c
index 24f24a6231d..54161f48198 100644
--- a/src/mame/drivers/taitogn.c
+++ b/src/mame/drivers/taitogn.c
@@ -754,7 +754,7 @@ static void sio_dip_handler( running_machine &machine, int n_data )
{
if( state->m_b_lastclock )
{
- int bit = ( ( input_port_read(machine, "DSW") >> state->m_n_dip_bit ) & 1 );
+ int bit = ( ( state->ioport("DSW")->read() >> state->m_n_dip_bit ) & 1 );
psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
state->m_n_dip_bit++;
state->m_n_dip_bit &= 7;
@@ -866,14 +866,14 @@ READ32_MEMBER(taitogn_state::gnet_mahjong_panel_r)
switch(m_mux_data)
{
- case 0x04: return input_port_read(machine(), "KEY0");
- case 0x08: return input_port_read(machine(), "KEY1");
- case 0x40: return input_port_read(machine(), "KEY2");
- case 0x80: return input_port_read(machine(), "KEY3");
+ case 0x04: return ioport("KEY0")->read();
+ case 0x08: return ioport("KEY1")->read();
+ case 0x40: return ioport("KEY2")->read();
+ case 0x80: return ioport("KEY3")->read();
}
/* mux disabled */
- return input_port_read(machine(), "P4");
+ return ioport("P4")->read();
}
// Init and reset
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 9eb9c2bfc21..c5b2ed36972 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -397,7 +397,7 @@ READ32_MEMBER(taitojc_state::jc_control_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= ((input_port_read(machine(), "COINS") & 0x2) << 2) << 24;
+ r |= ((ioport("COINS")->read() & 0x2) << 2) << 24;
}
return r;
}
@@ -405,7 +405,7 @@ READ32_MEMBER(taitojc_state::jc_control_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(machine(), "COINS") << 24;
+ r |= ioport("COINS")->read() << 24;
}
return r;
}
@@ -413,7 +413,7 @@ READ32_MEMBER(taitojc_state::jc_control_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(machine(), "START") << 24;
+ r |= ioport("START")->read() << 24;
}
return r;
}
@@ -421,7 +421,7 @@ READ32_MEMBER(taitojc_state::jc_control_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(machine(), "UNUSED") << 24;
+ r |= ioport("UNUSED")->read() << 24;
}
return r;
}
@@ -437,7 +437,7 @@ READ32_MEMBER(taitojc_state::jc_control_r)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(machine(), "BUTTONS") << 24;
+ r |= ioport("BUTTONS")->read() << 24;
}
return r;
}
@@ -471,7 +471,7 @@ WRITE32_MEMBER(taitojc_state::jc_control_w)
{
if (ACCESSING_BITS_24_31)
{
- input_port_write(machine(), "EEPROMOUT", data >> 24, 0xff);
+ ioport("EEPROMOUT")->write(data >> 24, 0xff);
}
else
popmessage("jc_control_w: %08X, %08X, %08X\n", data, offset, mem_mask);
@@ -828,9 +828,9 @@ WRITE32_MEMBER(taitojc_state::jc_meters_w)
else if(offset == 1 && ACCESSING_BITS_16_31)
m_brake_meter = taitojc_brake_table[(data >> 16) & 0xff];
- if(input_port_read_safe(machine(), "METER", 0))
+ if(ioport("METER")->read_safe(0))
{
- UINT8 mascon_lv = (input_port_read(machine(), "MASCON") & 0x70) >> 4;
+ UINT8 mascon_lv = (ioport("MASCON")->read() & 0x70) >> 4;
popmessage("%d %.02f km/h %.02f MPa",mascon_lv,m_speed_meter,m_brake_meter/10);
}
@@ -898,7 +898,7 @@ READ8_MEMBER(taitojc_state::hc11_analog_r)
static const char *const portnames[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4",
"ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8" };
- return input_port_read_safe(machine(), portnames[offset], 0);
+ return ioport(portnames[offset])->read_safe(0);
}
@@ -1166,7 +1166,7 @@ INPUT_PORTS_END
CUSTOM_INPUT_MEMBER(taitojc_state::mascon_state_r)
{
static const UINT8 mascon_table[6] = { 0x01, 0x10, 0x02, 0x20, 0x04, 0x40 };
- UINT8 res = input_port_read(machine(), "MASCON");
+ UINT8 res = ioport("MASCON")->read();
int i;
//popmessage("%02x",res);
diff --git a/src/mame/drivers/taitosj.c b/src/mame/drivers/taitosj.c
index ba322713b9e..0a9b95b6aa4 100644
--- a/src/mame/drivers/taitosj.c
+++ b/src/mame/drivers/taitosj.c
@@ -290,9 +290,9 @@ CUSTOM_INPUT_MEMBER(taitosj_state::kikstart_gear_r)
port_tag = "GEARP2";
/* gear MUST be 1, 2 or 3 */
- if (input_port_read(machine(), port_tag) & 0x01) m_kikstart_gears[player] = 0x02;
- if (input_port_read(machine(), port_tag) & 0x02) m_kikstart_gears[player] = 0x03;
- if (input_port_read(machine(), port_tag) & 0x04) m_kikstart_gears[player] = 0x01;
+ if (ioport(port_tag)->read() & 0x01) m_kikstart_gears[player] = 0x02;
+ if (ioport(port_tag)->read() & 0x02) m_kikstart_gears[player] = 0x03;
+ if (ioport(port_tag)->read() & 0x04) m_kikstart_gears[player] = 0x01;
return m_kikstart_gears[player];
}
diff --git a/src/mame/drivers/tank8.c b/src/mame/drivers/tank8.c
index d4dbf198ced..96b2cefe0f6 100644
--- a/src/mame/drivers/tank8.c
+++ b/src/mame/drivers/tank8.c
@@ -257,7 +257,7 @@ static INPUT_PORTS_START( tank8 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 8" )
PORT_START("VBLANK")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CRASH")
PORT_ADJUSTER( 50, "Crash, Explosion Volume" )
diff --git a/src/mame/drivers/tankbatt.c b/src/mame/drivers/tankbatt.c
index fae36b1fb1e..5fa9bfdc5d2 100644
--- a/src/mame/drivers/tankbatt.c
+++ b/src/mame/drivers/tankbatt.c
@@ -71,7 +71,7 @@ READ8_MEMBER(tankbatt_state::tankbatt_in0_r)
{
int val;
- val = input_port_read(machine(), "P1");
+ val = ioport("P1")->read();
return ((val << (7 - offset)) & 0x80);
}
@@ -79,7 +79,7 @@ READ8_MEMBER(tankbatt_state::tankbatt_in1_r)
{
int val;
- val = input_port_read(machine(), "P2");
+ val = ioport("P2")->read();
return ((val << (7 - offset)) & 0x80);
}
@@ -87,7 +87,7 @@ READ8_MEMBER(tankbatt_state::tankbatt_dsw_r)
{
int val;
- val = input_port_read(machine(), "DSW");
+ val = ioport("DSW")->read();
return ((val << (7 - offset)) & 0x80);
}
diff --git a/src/mame/drivers/tapatune.c b/src/mame/drivers/tapatune.c
index 10ccd0b0062..b11966516d4 100644
--- a/src/mame/drivers/tapatune.c
+++ b/src/mame/drivers/tapatune.c
@@ -157,9 +157,9 @@ READ8_MEMBER(tapatune_state::controls_r)
{
switch( m_controls_mux )
{
- case 0x07: return input_port_read(machine(), "DSW1");
- case 0x08: return input_port_read(machine(), "DSW2");
- case 0x09: return input_port_read(machine(), "IN0");
+ case 0x07: return ioport("DSW1")->read();
+ case 0x08: return ioport("DSW2")->read();
+ case 0x09: return ioport("IN0")->read();
default: return 0xff;
}
}
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index 1ddd71f89dd..6a30b50c1e2 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -188,13 +188,13 @@ WRITE16_MEMBER(tatsumi_state::bigfight_a60000_w)
READ16_MEMBER(tatsumi_state::cyclwarr_input_r)
{
static const char *const port[] = { "SERVICE", "P1", "P2", "DSW3" };
- return input_port_read(machine(), port[offset]);
+ return ioport(port[offset])->read();
}
READ16_MEMBER(tatsumi_state::cyclwarr_input2_r)
{
static const char *const port2[] = { "DSW1", "DSW2", "P3", "P4" };
- return input_port_read(machine(), port2[offset]);
+ return ioport(port2[offset])->read();
}
WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_w)
@@ -1284,8 +1284,8 @@ ROM_END
static DRIVER_INIT( apache3 )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.root_device().memregion("gfx1")->base();
- UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = state->memregion("gfx1")->base();
+ UINT8 *src1 = state->memregion("gfx2")->base();
UINT8 *src2 = state->memregion("gfx3")->base();
int i;
@@ -1312,8 +1312,8 @@ static DRIVER_INIT( apache3 )
static DRIVER_INIT( roundup5 )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.root_device().memregion("gfx1")->base();
- UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
+ UINT8 *dst = state->memregion("gfx1")->base();
+ UINT8 *src1 = state->memregion("gfx2")->base();
UINT8 *src2 = state->memregion("gfx3")->base();
int i;
@@ -1338,10 +1338,10 @@ static DRIVER_INIT( roundup5 )
static DRIVER_INIT( cyclwarr )
{
tatsumi_state *state = machine.driver_data<tatsumi_state>();
- UINT8 *dst = machine.root_device().memregion("gfx1")->base();
- UINT8 *src1 = machine.root_device().memregion("gfx2")->base();
- int len1 = machine.root_device().memregion("gfx2")->bytes();
- UINT8 *src2 = machine.root_device().memregion("gfx3")->base();
+ UINT8 *dst = state->memregion("gfx1")->base();
+ UINT8 *src1 = state->memregion("gfx2")->base();
+ int len1 = state->memregion("gfx2")->bytes();
+ UINT8 *src2 = state->memregion("gfx3")->base();
int len2 = state->memregion("gfx3")->bytes();
int i;
for (i=0; i<len1; i+=32) {
diff --git a/src/mame/drivers/taxidriv.c b/src/mame/drivers/taxidriv.c
index 0291692e9cb..3561e719b27 100644
--- a/src/mame/drivers/taxidriv.c
+++ b/src/mame/drivers/taxidriv.c
@@ -69,7 +69,7 @@ static READ8_DEVICE_HANDLER( p1b_r )
static READ8_DEVICE_HANDLER( p1c_r )
{
taxidriv_state *state = device->machine().driver_data<taxidriv_state>();
- return (state->m_s2 << 7) | (state->m_s4 << 6) | ((input_port_read(device->machine(), "SERVCOIN") & 1) << 4);
+ return (state->m_s2 << 7) | (state->m_s4 << 6) | ((state->ioport("SERVCOIN")->read() & 1) << 4);
}
static WRITE8_DEVICE_HANDLER( p1a_w )
diff --git a/src/mame/drivers/tceptor.c b/src/mame/drivers/tceptor.c
index e9dfb6678e4..93f19582949 100644
--- a/src/mame/drivers/tceptor.c
+++ b/src/mame/drivers/tceptor.c
@@ -131,22 +131,22 @@ static UINT8 fix_input1(UINT8 in1, UINT8 in2)
READ8_MEMBER(tceptor_state::dsw0_r)
{
- return fix_input0(input_port_read(machine(), "DSW1"), input_port_read(machine(), "DSW2"));
+ return fix_input0(ioport("DSW1")->read(), ioport("DSW2")->read());
}
READ8_MEMBER(tceptor_state::dsw1_r)
{
- return fix_input1(input_port_read(machine(), "DSW1"), input_port_read(machine(), "DSW2"));
+ return fix_input1(ioport("DSW1")->read(), ioport("DSW2")->read());
}
READ8_MEMBER(tceptor_state::input0_r)
{
- return fix_input0(input_port_read(machine(), "BUTTONS"), input_port_read(machine(), "SERVICE"));
+ return fix_input0(ioport("BUTTONS")->read(), ioport("SERVICE")->read());
}
READ8_MEMBER(tceptor_state::input1_r)
{
- return fix_input1(input_port_read(machine(), "BUTTONS"), input_port_read(machine(), "SERVICE"));
+ return fix_input1(ioport("BUTTONS")->read(), ioport("SERVICE")->read());
}
READ8_MEMBER(tceptor_state::readFF)
diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c
index b80cf9e9abc..2d4f72b724f 100644
--- a/src/mame/drivers/tecmo.c
+++ b/src/mame/drivers/tecmo.c
@@ -105,28 +105,28 @@ static void tecmo_adpcm_int(device_t *device)
/* the 8-bit dipswitches are split across addresses */
READ8_MEMBER(tecmo_state::tecmo_dswa_l_r)
{
- UINT8 port = input_port_read(machine(), "DSWA");
+ UINT8 port = ioport("DSWA")->read();
port &= 0x0f;
return port;
}
READ8_MEMBER(tecmo_state::tecmo_dswa_h_r)
{
- UINT8 port = input_port_read(machine(), "DSWA");
+ UINT8 port = ioport("DSWA")->read();
port &= 0xf0;
return port>>4;
}
READ8_MEMBER(tecmo_state::tecmo_dswb_l_r)
{
- UINT8 port = input_port_read(machine(), "DSWB");
+ UINT8 port = ioport("DSWB")->read();
port &= 0x0f;
return port;
}
READ8_MEMBER(tecmo_state::tecmo_dswb_h_r)
{
- UINT8 port = input_port_read(machine(), "DSWB");
+ UINT8 port = ioport("DSWB")->read();
port &= 0xf0;
return port>>4;
}
diff --git a/src/mame/drivers/tecmosys.c b/src/mame/drivers/tecmosys.c
index 7212ae74f95..f676645bf7e 100644
--- a/src/mame/drivers/tecmosys.c
+++ b/src/mame/drivers/tecmosys.c
@@ -447,8 +447,8 @@ static const ymf262_interface tecmosys_ymf262_interface =
static MACHINE_START( tecmosys )
{
-// tecmosys_state *state = machine.driver_data<tecmosys_state>();
- machine.root_device().membank("bank1")->configure_entries(0, 16, machine.root_device().memregion("audiocpu")->base(), 0x4000);
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
+ state->membank("bank1")->configure_entries(0, 16, state->memregion("audiocpu")->base(), 0x4000);
}
static MACHINE_CONFIG_START( deroon, tecmosys_state )
diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c
index f8be8501f5a..532badd933a 100644
--- a/src/mame/drivers/tehkanwc.c
+++ b/src/mame/drivers/tehkanwc.c
@@ -108,32 +108,32 @@ READ8_MEMBER(tehkanwc_state::tehkanwc_track_0_r)
{
int joy;
- joy = input_port_read(machine(), "FAKE") >> (2 * offset);
+ joy = ioport("FAKE")->read() >> (2 * offset);
if (joy & 1) return -63;
if (joy & 2) return 63;
- return input_port_read(machine(), offset ? "P1Y" : "P1X") - m_track0[offset];
+ return ioport(offset ? "P1Y" : "P1X")->read() - m_track0[offset];
}
READ8_MEMBER(tehkanwc_state::tehkanwc_track_1_r)
{
int joy;
- joy = input_port_read(machine(), "FAKE") >> (4 + 2 * offset);
+ joy = ioport("FAKE")->read() >> (4 + 2 * offset);
if (joy & 1) return -63;
if (joy & 2) return 63;
- return input_port_read(machine(), offset ? "P2Y" : "P2X") - m_track1[offset];
+ return ioport(offset ? "P2Y" : "P2X")->read() - m_track1[offset];
}
WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_0_reset_w)
{
/* reset the trackball counters */
- m_track0[offset] = input_port_read(machine(), offset ? "P1Y" : "P1X") + data;
+ m_track0[offset] = ioport(offset ? "P1Y" : "P1X")->read() + data;
}
WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_1_reset_w)
{
/* reset the trackball counters */
- m_track1[offset] = input_port_read(machine(), offset ? "P2Y" : "P2X") + data;
+ m_track1[offset] = ioport(offset ? "P2Y" : "P2X")->read() + data;
}
diff --git a/src/mame/drivers/tempest.c b/src/mame/drivers/tempest.c
index 84949cfe7aa..bdcc221591d 100644
--- a/src/mame/drivers/tempest.c
+++ b/src/mame/drivers/tempest.c
@@ -334,14 +334,12 @@ WRITE8_MEMBER(tempest_state::wdclr_w)
CUSTOM_INPUT_MEMBER(tempest_state::tempest_knob_r)
{
- return input_port_read(machine(), (m_player_select == 0) ?
- TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG);
+ return ioport((m_player_select == 0) ? TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG)->read();
}
CUSTOM_INPUT_MEMBER(tempest_state::tempest_buttons_r)
{
- return input_port_read(machine(), (m_player_select == 0) ?
- TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG);
+ return ioport((m_player_select == 0) ? TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG)->read();
}
@@ -354,13 +352,13 @@ CUSTOM_INPUT_MEMBER(tempest_state::clock_r)
static READ8_DEVICE_HANDLER( input_port_1_bit_r )
{
- return (input_port_read(device->machine(), "IN1/DSW0") & (1 << offset)) ? 0 : 228;
+ return (device->machine().root_device().ioport("IN1/DSW0")->read() & (1 << offset)) ? 0 : 228;
}
static READ8_DEVICE_HANDLER( input_port_2_bit_r )
{
- return (input_port_read(device->machine(), "IN2") & (1 << offset)) ? 0 : 228;
+ return (device->machine().root_device().ioport("IN2")->read() & (1 << offset)) ? 0 : 228;
}
diff --git a/src/mame/drivers/terracre.c b/src/mame/drivers/terracre.c
index 5ce66c0724c..f49cd14d6d4 100644
--- a/src/mame/drivers/terracre.c
+++ b/src/mame/drivers/terracre.c
@@ -133,7 +133,7 @@ static const UINT16 mHoreKidProtData[] =
READ16_MEMBER(terracre_state::horekid_IN2_r)
{
- int data = input_port_read(machine(), "IN2");
+ int data = ioport("IN2")->read();
if (!(data & 0x40)) // FAKE button 3 for "Debug Mode"
{
diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c
index 52602cecf23..79cd6cc5a83 100644
--- a/src/mame/drivers/tetrisp2.c
+++ b/src/mame/drivers/tetrisp2.c
@@ -212,7 +212,7 @@ WRITE16_MEMBER(tetrisp2_state::nndmseal_sound_bank_w)
READ16_MEMBER(tetrisp2_state::tetrisp2_ip_1_word_r)
{
- return ( input_port_read(machine(), "SYSTEM") & 0xfcff ) |
+ return ( ioport("SYSTEM")->read() & 0xfcff ) |
( machine().rand() & ~0xfcff ) |
( 1 << (8 + (machine().rand()&1)) );
}
@@ -540,7 +540,7 @@ ADDRESS_MAP_END
READ16_MEMBER(stepstag_state::stepstag_coins_r)
{
// bits 8 & 9?
- return ( input_port_read(machine(), "COINS") & 0xfcff ) |
+ return ( ioport("COINS")->read() & 0xfcff ) |
( machine().rand() & ~0xfcff ) |
( 1 << (8 + (machine().rand()&1)) );
}
diff --git a/src/mame/drivers/thayers.c b/src/mame/drivers/thayers.c
index 32ed6fb78af..a3af3102cc4 100644
--- a/src/mame/drivers/thayers.c
+++ b/src/mame/drivers/thayers.c
@@ -300,7 +300,7 @@ READ8_MEMBER(thayers_state::cop_si_r)
sprintf(port, "R%d", m_keylatch);
- data = BIT(input_port_read(machine(), port), m_rx_bit - 5);
+ data = BIT(ioport(port)->read(), m_rx_bit - 5);
return data;
}
@@ -359,7 +359,7 @@ WRITE8_MEMBER(thayers_state::control2_w)
READ8_MEMBER(thayers_state::dsw_b_r)
{
- return (input_port_read(machine(), "COIN") & 0xf0) | (input_port_read(machine(), "DSWB") & 0x0f);
+ return (ioport("COIN")->read() & 0xf0) | (ioport("DSWB")->read() & 0x0f);
}
READ8_MEMBER(thayers_state::laserdsc_data_r)
@@ -764,7 +764,7 @@ static MACHINE_RESET( thayers )
state->m_cart_present = 0;
state->m_pr7820_enter = 0;
-// newtype = (input_port_read(machine, "DSWB") & 0x18) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
+// newtype = (state->ioport("DSWB")->read() & 0x18) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
// laserdisc_set_type(state->m_laserdisc, newtype);
}
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index 2313439f89c..531e4eb10f6 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -250,9 +250,9 @@ READ8_MEMBER(thedeep_state::thedeep_p0_r)
{
UINT8 coin_mux;
- coin_mux = ((input_port_read(machine(),"COINS") & 0x0e) == 0x0e); // bit 0 is hard-wired to ALL three coin latches
+ coin_mux = ((ioport("COINS")->read() & 0x0e) == 0x0e); // bit 0 is hard-wired to ALL three coin latches
- return (input_port_read(machine(),"COINS") & 0xfe) | (coin_mux & 1);
+ return (ioport("COINS")->read() & 0xfe) | (coin_mux & 1);
}
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, thedeep_state )
@@ -416,7 +416,7 @@ static TIMER_DEVICE_CALLBACK( thedeep_interrupt )
{
if (state->m_protection_command != 0x59)
{
- int coins = input_port_read(timer.machine(), "MCU");
+ int coins = timer.machine().root_device().ioport("MCU")->read();
if (coins & 1) state->m_protection_data = 1;
else if (coins & 2) state->m_protection_data = 2;
else if (coins & 4) state->m_protection_data = 3;
diff --git a/src/mame/drivers/thepit.c b/src/mame/drivers/thepit.c
index 8b29dac92b2..99943d643ef 100644
--- a/src/mame/drivers/thepit.c
+++ b/src/mame/drivers/thepit.c
@@ -536,14 +536,14 @@ static INPUT_PORTS_START( rtriv )
PORT_DIPSETTING( 0x20, "Number of Wrong Answer" )
PORT_DIPSETTING( 0x00, "Number of Good Answer for Bonus Question" )
PORT_DIPNAME( 0xc0, 0x40, "Gaming Option Number" )
- PORT_DIPSETTING( 0x00, "2" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x40, "3" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x80, "4" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0xc0, "5" ) PORT_CONDITION("DSW", 0x20, PORTCOND_EQUALS, 0x20)
- PORT_DIPSETTING( 0x00, "4" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x40, "5" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0x80, "6" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
- PORT_DIPSETTING( 0xc0, "7" ) PORT_CONDITION("DSW", 0x20, PORTCOND_NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "2" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x40, "3" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x80, "4" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0xc0, "5" ) PORT_CONDITION("DSW", 0x20, EQUALS, 0x20)
+ PORT_DIPSETTING( 0x00, "4" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x40, "5" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0x80, "6" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
+ PORT_DIPSETTING( 0xc0, "7" ) PORT_CONDITION("DSW", 0x20, NOTEQUALS, 0x20)
/* Since the real inputs are multiplexed, we used this fake port
to read the 2nd player controls when the screen is flipped */
diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c
index a2756914a6d..1e6f5020ffb 100644
--- a/src/mame/drivers/thief.c
+++ b/src/mame/drivers/thief.c
@@ -36,7 +36,7 @@ Credits:
static INTERRUPT_GEN( thief_interrupt )
{
/* SLAM switch causes an NMI if it's pressed */
- if( (input_port_read(device->machine(), "P2") & 0x10) == 0 )
+ if( (device->machine().root_device().ioport("P2")->read() & 0x10) == 0 )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
else
device_set_input_line(device, 0, HOLD_LINE);
@@ -141,10 +141,10 @@ READ8_MEMBER(thief_state::thief_io_r)
{
switch( m_input_select )
{
- case 0x01: return input_port_read(machine(), "DSW1");
- case 0x02: return input_port_read(machine(), "DSW2");
- case 0x04: return input_port_read(machine(), "P1");
- case 0x08: return input_port_read(machine(), "P2");
+ case 0x01: return ioport("DSW1")->read();
+ case 0x02: return ioport("DSW2")->read();
+ case 0x04: return ioport("P1")->read();
+ case 0x08: return ioport("P2")->read();
}
return 0x00;
}
diff --git a/src/mame/drivers/thunderj.c b/src/mame/drivers/thunderj.c
index 1c858458851..8894bbe64f6 100644
--- a/src/mame/drivers/thunderj.c
+++ b/src/mame/drivers/thunderj.c
@@ -70,7 +70,7 @@ static MACHINE_RESET( thunderj )
READ16_MEMBER(thunderj_state::special_port2_r)
{
- int result = input_port_read(machine(), "260012");
+ int result = ioport("260012")->read();
if (m_sound_to_cpu_ready) result ^= 0x0004;
if (m_cpu_to_sound_ready) result ^= 0x0008;
@@ -219,7 +219,7 @@ static INPUT_PORTS_START( thunderj )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_START("260012")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
diff --git a/src/mame/drivers/tiamc1.c b/src/mame/drivers/tiamc1.c
index 361d45a5499..dd2a4227c18 100644
--- a/src/mame/drivers/tiamc1.c
+++ b/src/mame/drivers/tiamc1.c
@@ -188,7 +188,7 @@ static INPUT_PORTS_START( tiamc1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // Kick
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // Jump
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static const gfx_layout sprites16x16_layout =
diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c
index 7cf5ba9fe83..bc0e10256c0 100644
--- a/src/mame/drivers/tickee.c
+++ b/src/mame/drivers/tickee.c
@@ -71,8 +71,8 @@ INLINE void get_crosshair_xy(running_machine &machine, int player, int *x, int *
{
const rectangle &visarea = machine.primary_screen->visible_area();
- *x = (((input_port_read(machine, player ? "GUNX2" : "GUNX1") & 0xff) * visarea.width()) >> 8) + visarea.min_x;
- *y = (((input_port_read(machine, player ? "GUNY2" : "GUNY1") & 0xff) * visarea.height()) >> 8) + visarea.min_y;
+ *x = (((machine.root_device().ioport(player ? "GUNX2" : "GUNX1")->read() & 0xff) * visarea.width()) >> 8) + visarea.min_x;
+ *y = (((machine.root_device().ioport(player ? "GUNY2" : "GUNY1")->read() & 0xff) * visarea.height()) >> 8) + visarea.min_y;
}
diff --git a/src/mame/drivers/timetrv.c b/src/mame/drivers/timetrv.c
index a3541c8d6ea..a1fc0f96473 100644
--- a/src/mame/drivers/timetrv.c
+++ b/src/mame/drivers/timetrv.c
@@ -59,13 +59,13 @@ static SCREEN_UPDATE_IND16( timetrv )
READ8_MEMBER(timetrv_state::test1_r)
{
- return input_port_read(machine(), "IN0");//machine().rand();
+ return ioport("IN0")->read();//machine().rand();
}
READ8_MEMBER(timetrv_state::test2_r)
{
/*bit 7,eeprom read bit*/
- return (input_port_read(machine(), "IN1") & 0x7f);//machine().rand();
+ return (ioport("IN1")->read() & 0x7f);//machine().rand();
}
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index f7454b08fb8..408da8aad7e 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -517,7 +517,7 @@ READ16_MEMBER(tmaster_state::tmaster_blitter_r)
READ16_MEMBER(tmaster_state::tmaster_coins_r)
{
- return input_port_read(machine(), "COIN")|(machine().rand()&0x0800);
+ return ioport("COIN")->read()|(machine().rand()&0x0800);
}
static ADDRESS_MAP_START( tmaster_map, AS_PROGRAM, 16, tmaster_state )
@@ -1834,7 +1834,7 @@ Protection starts:
static DRIVER_INIT( galgames )
{
tmaster_state *state = machine.driver_data<tmaster_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
int cart;
// RAM bank at 0x000000-0x03ffff and 0x200000-0x23ffff
@@ -1856,7 +1856,7 @@ static DRIVER_INIT( galgames )
for (cart = 1; cart <= 4; cart++)
{
- UINT8 *CART = machine.root_device().memregion("maincpu")->base();
+ UINT8 *CART = state->memregion("maincpu")->base();
if (0x200000 * (cart+1) <= state->memregion("maincpu")->bytes())
CART += 0x200000 * cart;
diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c
index 394711ba80a..f58ff623eea 100644
--- a/src/mame/drivers/tmmjprd.c
+++ b/src/mame/drivers/tmmjprd.c
@@ -515,15 +515,15 @@ static WRITE32_DEVICE_HANDLER( tmmjprd_eeprom_write )
READ32_MEMBER(tmmjprd_state::tmmjprd_mux_r)
{
- m_system_in = input_port_read(machine(), "SYSTEM");
+ m_system_in = ioport("SYSTEM")->read();
switch(m_mux_data)
{
- case 0x01: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_1")<<8) | (input_port_read(machine(), "PL2_1")<<16) | 0xff000000;
- case 0x02: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_2")<<8) | (input_port_read(machine(), "PL2_2")<<16) | 0xff000000;
- case 0x04: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_3")<<8) | (input_port_read(machine(), "PL2_3")<<16) | 0xff000000;
- case 0x08: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_4")<<8) | (input_port_read(machine(), "PL2_4")<<16) | 0xff000000;
- case 0x10: return (m_system_in & 0xff) | (input_port_read(machine(), "PL1_5")<<8) | (input_port_read(machine(), "PL2_5")<<16) | 0xff000000;
+ case 0x01: return (m_system_in & 0xff) | (ioport("PL1_1")->read()<<8) | (ioport("PL2_1")->read()<<16) | 0xff000000;
+ case 0x02: return (m_system_in & 0xff) | (ioport("PL1_2")->read()<<8) | (ioport("PL2_2")->read()<<16) | 0xff000000;
+ case 0x04: return (m_system_in & 0xff) | (ioport("PL1_3")->read()<<8) | (ioport("PL2_3")->read()<<16) | 0xff000000;
+ case 0x08: return (m_system_in & 0xff) | (ioport("PL1_4")->read()<<8) | (ioport("PL2_4")->read()<<16) | 0xff000000;
+ case 0x10: return (m_system_in & 0xff) | (ioport("PL1_5")->read()<<8) | (ioport("PL2_5")->read()<<16) | 0xff000000;
}
return (m_system_in & 0xff) | 0xffffff00;
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index 8efaa2389b5..055ca307325 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -434,7 +434,7 @@ READ16_MEMBER(tmnt_state::blswhstl_coin_r)
/* bit 3 is service button */
/* bit 6 is ??? VBLANK? OBJMPX? */
- res = input_port_read(machine(), "COINS");
+ res = ioport("COINS")->read();
m_toggle ^= 0x40;
return res ^ m_toggle;
@@ -448,7 +448,7 @@ READ16_MEMBER(tmnt_state::ssriders_eeprom_r)
/* bit 1 is EEPROM ready */
/* bit 2 is VBLANK (???) */
/* bit 7 is service button */
- res = input_port_read(machine(), "EEPROM");
+ res = ioport("EEPROM")->read();
m_toggle ^= 0x04;
return res ^ m_toggle;
@@ -462,7 +462,7 @@ READ16_MEMBER(tmnt_state::sunsetbl_eeprom_r)
/* bit 1 is EEPROM ready */
/* bit 2 is VBLANK (???) */
/* bit 3 is service button */
- res = input_port_read(machine(), "EEPROM");
+ res = ioport("EEPROM")->read();
m_toggle ^= 0x04;
return res ^ m_toggle;
@@ -475,7 +475,7 @@ WRITE16_MEMBER(tmnt_state::blswhstl_eeprom_w)
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
}
@@ -498,7 +498,7 @@ READ16_MEMBER(tmnt_state::thndrx2_eeprom_r)
/* bit 1 is EEPROM ready */
/* bit 3 is VBLANK (???) */
/* bit 7 is service button */
- res = input_port_read(machine(), "P2/EEPROM");
+ res = ioport("P2/EEPROM")->read();
m_toggle ^= 0x0800;
return (res ^ m_toggle);
}
@@ -511,7 +511,7 @@ WRITE16_MEMBER(tmnt_state::thndrx2_eeprom_w)
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
/* bit 5 triggers IRQ on sound cpu */
if (m_last == 0 && (data & 0x20) != 0)
@@ -535,7 +535,7 @@ WRITE16_MEMBER(tmnt_state::prmrsocr_eeprom_w)
/* bit 8 is data */
/* bit 9 is cs (active low) */
/* bit 10 is clock (active high) */
- input_port_write(machine(), "EEPROMOUT", data, 0xffff);
+ ioport("EEPROMOUT")->write(data, 0xffff);
}
}
@@ -1790,7 +1790,7 @@ static INPUT_PORTS_START( ssriders )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK */
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* ?? TMNT2: NVBLK */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: IPL0 */
PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1828,7 +1828,7 @@ static INPUT_PORTS_START( ssridr4p )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK */
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* ?? TMNT2: NVBLK */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: IPL0 */
PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1868,7 +1868,7 @@ static INPUT_PORTS_START( ssrid4ps )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK */
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* ?? TMNT2: NVBLK */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: IPL0 */
PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
@@ -1957,7 +1957,7 @@ static INPUT_PORTS_START( qgakumon )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) /* EEPROM status? - always 1 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: OBJMPX */
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* ?? TMNT2: IPL0 */
PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
diff --git a/src/mame/drivers/tmspoker.c b/src/mame/drivers/tmspoker.c
index 816442115cc..269355d958e 100644
--- a/src/mame/drivers/tmspoker.c
+++ b/src/mame/drivers/tmspoker.c
@@ -300,7 +300,7 @@ static MACHINE_START( tmspoker )
static MACHINE_RESET( tmspoker )
{
- UINT8 seldsw = (input_port_read(machine, "SELDSW") );
+ UINT8 seldsw = (machine.root_device().ioport("SELDSW")->read() );
popmessage("ROM Bank: %02X", seldsw);
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 34489fd8905..28217ff576d 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -680,8 +680,8 @@ static READ8_DEVICE_HANDLER( kageki_csport_r )
tnzs_state *state = device->machine().driver_data<tnzs_state>();
int dsw, dsw1, dsw2;
- dsw1 = input_port_read(device->machine(), "DSWA");
- dsw2 = input_port_read(device->machine(), "DSWB");
+ dsw1 = state->ioport("DSWA")->read();
+ dsw2 = state->ioport("DSWB")->read();
switch (state->m_kageki_csport_sel)
{
diff --git a/src/mame/drivers/toaplan1.c b/src/mame/drivers/toaplan1.c
index 2135c614953..a324a8cd2a1 100644
--- a/src/mame/drivers/toaplan1.c
+++ b/src/mame/drivers/toaplan1.c
@@ -689,7 +689,7 @@ static INPUT_PORTS_START( toaplan1_2b )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("VBLANK")
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -724,11 +724,11 @@ INPUT_PORTS_END
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) \
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) \
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) \
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
#define TOAPLAN1_VBLANK_INPUT \
PORT_START("VBLANK") \
- PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_VBLANK ) \
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") \
PORT_BIT( 0xfffe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index 05d1a0ecfdb..18614f8e155 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -662,7 +662,7 @@ READ16_MEMBER(toaplan2_state::ghox_p1_h_analog_r)
{
INT8 value, new_value;
- new_value = input_port_read(machine(), "PAD1");
+ new_value = ioport("PAD1")->read();
if (new_value == m_old_p1_paddle_h) return 0;
value = new_value - m_old_p1_paddle_h;
m_old_p1_paddle_h = new_value;
@@ -674,7 +674,7 @@ READ16_MEMBER(toaplan2_state::ghox_p2_h_analog_r)
{
INT8 value, new_value;
- new_value = input_port_read(machine(), "PAD2");
+ new_value = ioport("PAD2")->read();
if (new_value == m_old_p2_paddle_h) return 0;
value = new_value - m_old_p2_paddle_h;
m_old_p2_paddle_h = new_value;
@@ -788,19 +788,19 @@ WRITE16_MEMBER(toaplan2_state::fixeightbl_oki_bankswitch_w)
READ8_MEMBER(toaplan2_state::v25_dswa_r)
{
- return input_port_read(machine(), "DSWA") ^ 0xff;
+ return ioport("DSWA")->read() ^ 0xff;
}
READ8_MEMBER(toaplan2_state::v25_dswb_r)
{
- return input_port_read(machine(), "DSWB") ^ 0xff;
+ return ioport("DSWB")->read() ^ 0xff;
}
READ8_MEMBER(toaplan2_state::v25_jmpr_r)
{
- return input_port_read(machine(), "JMPR") ^ 0xff;
+ return ioport("JMPR")->read() ^ 0xff;
}
@@ -1010,7 +1010,7 @@ WRITE16_MEMBER(toaplan2_state::bbakraid_eeprom_w)
logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",cpu_get_pc(&space.device()),data);
if ( ACCESSING_BITS_0_7 )
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
m_z80_busreq = data & 0x10; // see bbakraid_eeprom_r above
}
@@ -2521,25 +2521,25 @@ static INPUT_PORTS_START( bgaregga )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8")
- PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
-// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
+ PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8")
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWA", 0x001c, NOTEQUALS, 0x001c)
// When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur
- PORT_DIPNAME( 0x0020, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6")
- PORT_DIPSETTING( 0x0000, "90 degrees ACW" ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0020, DEF_STR( Normal ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPNAME( 0x0040, 0x0000, "Effect" ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, PORTCOND_EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0020, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6")
+ PORT_DIPSETTING( 0x0000, "90 degrees ACW" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0020, DEF_STR( Normal ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0040, 0x0000, "Effect" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSWA", 0x001c, EQUALS, 0x001c)
PORT_START("DSWB")
PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2")
@@ -2563,10 +2563,10 @@ static INPUT_PORTS_START( bgaregga )
PORT_DIPSETTING( 0x0060, DEF_STR( Infinite ) )
PORT_DIPSETTING( 0x0070, "Invulnerability (Cheat)" )
PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!8")
- PORT_DIPSETTING( 0x0000, DEF_STR( None ) ) PORT_CONDITION("JMPR",0x0003,PORTCOND_NOTEQUALS,0x0000) // Non-Japan
- PORT_DIPSETTING( 0x0080, "Every 2000k" ) PORT_CONDITION("JMPR",0x0003,PORTCOND_NOTEQUALS,0x0000) // Non-Japan
- PORT_DIPSETTING( 0x0080, "1000k and 2000k" ) PORT_CONDITION("JMPR",0x0003,PORTCOND_EQUALS,0x0000) // Japan
- PORT_DIPSETTING( 0x0000, "Every 1000k" ) PORT_CONDITION("JMPR",0x0003,PORTCOND_EQUALS,0x0000) // Japan
+ PORT_DIPSETTING( 0x0000, DEF_STR( None ) ) PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000) // Non-Japan
+ PORT_DIPSETTING( 0x0080, "Every 2000k" ) PORT_CONDITION("JMPR",0x0003,NOTEQUALS,0x0000) // Non-Japan
+ PORT_DIPSETTING( 0x0080, "1000k and 2000k" ) PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000) // Japan
+ PORT_DIPSETTING( 0x0000, "Every 1000k" ) PORT_CONDITION("JMPR",0x0003,EQUALS,0x0000) // Japan
PORT_START("JMPR")
PORT_DIPNAME( 0x0008, 0x0000, "Stage Edit" ) PORT_DIPLOCATION("SW3:!1")
@@ -2642,12 +2642,12 @@ static INPUT_PORTS_START( batrider )
PORT_START("DSW") // DSWA and DSWB
PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1")
- PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
- PORT_DIPSETTING( 0x0000, "1" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0002, "2" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPNAME( 0x0002, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
- PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0002, "90 degrees ACW" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
+ PORT_DIPSETTING( 0x0000, "1" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0002, "2" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPNAME( 0x0002, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0002, "90 degrees ACW" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!3,!4,!5")
PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0014, DEF_STR( 3C_1C ) )
@@ -2657,25 +2657,25 @@ static INPUT_PORTS_START( batrider )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8")
- PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
-// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
+ PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8")
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
// When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur
- PORT_DIPNAME( 0x0020, 0x0000, "Hit Score" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPNAME( 0x0040, 0x0000, "Sound Effect" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0020, 0x0000, "Hit Score" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0040, 0x0000, "Sound Effect" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2")
PORT_DIPSETTING( 0x0100, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) )
@@ -2771,12 +2771,12 @@ static INPUT_PORTS_START( bbakraid )
PORT_START("DSW") // DSWA and DSWB
PORT_SERVICE_DIPLOC(0x0001, IP_ACTIVE_HIGH, "SW1:!1")
- PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
- PORT_DIPSETTING( 0x0000, "1" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0002, "2" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPNAME( 0x0002, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
- PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0002, "90 degrees ACW" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0002, 0x0000, "Credits to Start" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
+ PORT_DIPSETTING( 0x0000, "1" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0002, "2" ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPNAME( 0x0002, 0x0000, "Joystick Mode" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!2")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0002, "90 degrees ACW" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
PORT_DIPNAME( 0x001c, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:!3,!4,!5")
PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0014, DEF_STR( 3C_1C ) )
@@ -2786,25 +2786,25 @@ static INPUT_PORTS_START( bbakraid )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x001c, DEF_STR( Free_Play ) )
- PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8")
- PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
-// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
- PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_NOTEQUALS, 0x001c)
+ PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6,!7,!8")
+ PORT_DIPSETTING( 0x00c0, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x00a0, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+// PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0060, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x001c, NOTEQUALS, 0x001c)
// When Coin_A is set to Free_Play, Coin_A becomes Coin_A and Coin_B, and the following dips occur
- PORT_DIPNAME( 0x0020, 0x0000, "Hit Score" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPNAME( 0x0040, 0x0000, "Sound Effect" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8")
- PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
- PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, PORTCOND_EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0020, 0x0000, "Hit Score" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!6")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0040, 0x0000, "Sound Effect" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!7")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPNAME( 0x0080, 0x0000, "Music" ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c) PORT_DIPLOCATION("SW1:!8")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
+ PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_CONDITION("DSW", 0x001c, EQUALS, 0x001c)
PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:!1,!2")
PORT_DIPSETTING( 0x0100, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) )
diff --git a/src/mame/drivers/tomcat.c b/src/mame/drivers/tomcat.c
index 96e7dd679c4..7f7f8ab8337 100644
--- a/src/mame/drivers/tomcat.c
+++ b/src/mame/drivers/tomcat.c
@@ -89,8 +89,8 @@ READ16_MEMBER(tomcat_state::tomcat_adcread_r)
{
switch( m_control_num )
{
- case 0: return input_port_read(machine(), "STICKY");
- case 1: return input_port_read(machine(), "STICKX");
+ case 0: return ioport("STICKY")->read();
+ case 1: return ioport("STICKX")->read();
default: return 0x7f7f;
}
}
@@ -99,7 +99,7 @@ READ16_MEMBER(tomcat_state::tomcat_inputs_r)
{
UINT16 result = 0;
if (ACCESSING_BITS_8_15)
- result |= input_port_read(machine(), "IN0") << 8;
+ result |= ioport("IN0")->read() << 8;
return result;
}
diff --git a/src/mame/drivers/toobin.c b/src/mame/drivers/toobin.c
index 63b8714d2c4..c0f00aad6b2 100644
--- a/src/mame/drivers/toobin.c
+++ b/src/mame/drivers/toobin.c
@@ -90,7 +90,7 @@ WRITE16_MEMBER(toobin_state::interrupt_scan_w)
READ16_MEMBER(toobin_state::special_port1_r)
{
- int result = input_port_read(machine(), "FF9000");
+ int result = ioport("FF9000")->read();
if (atarigen_get_hblank(*machine().primary_screen)) result ^= 0x8000;
if (m_cpu_to_sound_ready) result ^= 0x2000;
return result;
@@ -158,7 +158,7 @@ static INPUT_PORTS_START( toobin )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x1000, IP_ACTIVE_LOW )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( atarijsa_i ) /* audio port */
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index 6610183c547..81e2b3ad307 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -324,8 +324,8 @@ READ8_MEMBER(topspeed_state::topspeed_input_bypass_r)
{
UINT8 port = tc0220ioc_port_r(m_tc0220ioc, 0); /* read port number */
int steer = 0;
- int analogue_steer = input_port_read_safe(machine(), STEER_PORT_TAG, 0x00);
- int fake = input_port_read_safe(machine(), FAKE_PORT_TAG, 0x00);
+ int analogue_steer = ioport(STEER_PORT_TAG)->read_safe(0x00);
+ int fake = ioport(FAKE_PORT_TAG)->read_safe(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 3da4d4f19c1..1954085b59a 100644
--- a/src/mame/drivers/toratora.c
+++ b/src/mame/drivers/toratora.c
@@ -148,14 +148,14 @@ static INTERRUPT_GEN( toratora_timer )
if (state->m_timer & 0x100)
popmessage("watchdog!");
- if (state->m_last != (input_port_read(device->machine(), "INPUT") & 0x0f))
+ if (state->m_last != (state->ioport("INPUT")->read() & 0x0f))
{
- state->m_last = input_port_read(device->machine(), "INPUT") & 0x0f;
+ state->m_last = state->ioport("INPUT")->read() & 0x0f;
generic_pulse_irq_line(device, 0, 1);
}
- state->m_pia_u1->set_a_input(input_port_read(device->machine(), "INPUT") & 0x0f, 0);
- state->m_pia_u1->ca1_w(input_port_read(device->machine(), "INPUT") & 0x10);
- state->m_pia_u1->ca2_w(input_port_read(device->machine(), "INPUT") & 0x20);
+ state->m_pia_u1->set_a_input(device->machine().root_device().ioport("INPUT")->read() & 0x0f, 0);
+ state->m_pia_u1->ca1_w(device->machine().root_device().ioport("INPUT")->read() & 0x10);
+ state->m_pia_u1->ca2_w(device->machine().root_device().ioport("INPUT")->read() & 0x20);
}
READ8_MEMBER(toratora_state::timer_r)
diff --git a/src/mame/drivers/tourtabl.c b/src/mame/drivers/tourtabl.c
index 01bf6f0dc2b..1a8756c159b 100644
--- a/src/mame/drivers/tourtabl.c
+++ b/src/mame/drivers/tourtabl.c
@@ -40,7 +40,7 @@ static READ16_DEVICE_HANDLER( tourtabl_read_input_port )
{
static const char *const tianames[] = { "PADDLE4", "PADDLE3", "PADDLE2", "PADDLE1", "TIA_IN4", "TIA_IN5" };
- return input_port_read(device->machine(), tianames[offset]);
+ return device->machine().root_device().ioport(tianames[offset])->read();
}
static READ8_DEVICE_HANDLER( tourtabl_get_databus_contents )
diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c
index 3e76af585ab..9c6209444f2 100644
--- a/src/mame/drivers/toypop.c
+++ b/src/mame/drivers/toypop.c
@@ -306,17 +306,17 @@ static INPUT_PORTS_START( liblrabl )
PORT_DIPSETTING( 0x1c, "40k 120k 200k 400k 600k 1m" )
PORT_DIPSETTING( 0x0c, "40k 140k 250k 400k 700k 1m" )
// bonus scores for 1, 2 or 3 lives
- PORT_DIPSETTING( 0x14, "50k 150k 300k 500k 700k 1m" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
- PORT_DIPSETTING( 0x04, "40k 120k and every 120k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
- PORT_DIPSETTING( 0x18, "40k 150k and every 150k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
- PORT_DIPSETTING( 0x08, "50k 150k 300k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
- PORT_DIPSETTING( 0x10, "40k 120k 200k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
+ PORT_DIPSETTING( 0x14, "50k 150k 300k 500k 700k 1m" ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
+ PORT_DIPSETTING( 0x04, "40k 120k and every 120k" ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
+ PORT_DIPSETTING( 0x18, "40k 150k and every 150k" ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
+ PORT_DIPSETTING( 0x08, "50k 150k 300k" ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
+ PORT_DIPSETTING( 0x10, "40k 120k 200k" ) PORT_CONDITION("DSW1", 0x03, NOTEQUALS, 0x01)
// bonus scores for 5 lives
- PORT_DIPSETTING( 0x14, "40k 120k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x04, "50k 150k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x18, "50k 150k and every 150k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x08, "60k 200k and every 200k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
- PORT_DIPSETTING( 0x10, "50k" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
+ PORT_DIPSETTING( 0x14, "40k 120k" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x04, "50k 150k" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x18, "50k 150k and every 150k" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x08, "60k 200k and every 200k" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
+ PORT_DIPSETTING( 0x10, "50k" ) PORT_CONDITION("DSW1", 0x03, EQUALS, 0x01)
// bonus scores for common
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
@@ -493,10 +493,10 @@ static const namco_interface namco_config =
***************************************************************************/
-static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine(), "DSW1"); } // dips A
-static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine(), "DSW1") >> 4; } // dips A
-static READ8_DEVICE_HANDLER( dipB_l ) { return input_port_read(device->machine(), "DSW2"); } // dips B
-static READ8_DEVICE_HANDLER( dipB_h ) { return input_port_read(device->machine(), "DSW2") >> 4; } // dips B
+static READ8_DEVICE_HANDLER( dipA_l ) { return device->machine().root_device().ioport("DSW1")->read(); } // dips A
+static READ8_DEVICE_HANDLER( dipA_h ) { return device->machine().root_device().ioport("DSW1")->read() >> 4; } // dips A
+static READ8_DEVICE_HANDLER( dipB_l ) { return device->machine().root_device().ioport("DSW2")->read(); } // dips B
+static READ8_DEVICE_HANDLER( dipB_h ) { return device->machine().root_device().ioport("DSW2")->read() >> 4; } // dips B
static WRITE8_DEVICE_HANDLER( out_coin0 )
{
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index 486b3df30b8..f4d6c1fb0f8 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -634,8 +634,8 @@ static INPUT_PORTS_START( wizzquiz )
PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1", 0xf0, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "No Coin A" ) PORT_CONDITION("DSW1", 0xf0, PORTCOND_NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1", 0xf0, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "No Coin A" ) PORT_CONDITION("DSW1", 0xf0, NOTEQUALS, 0x00)
PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) )
@@ -652,8 +652,8 @@ static INPUT_PORTS_START( wizzquiz )
PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1", 0x0f, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, "No Coin B" ) PORT_CONDITION("DSW1", 0x0f, PORTCOND_NOTEQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW1", 0x0f, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, "No Coin B" ) PORT_CONDITION("DSW1", 0x0f, NOTEQUALS, 0x00)
/* No Coin X = coin slot X open (coins produce sound), but no effect on coin counter */
PORT_START("DSW2")
diff --git a/src/mame/drivers/triplhnt.c b/src/mame/drivers/triplhnt.c
index a661158f8aa..9440e3d1a92 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(discrete, TRIPLHNT_LAMP_EN, state->m_misc_flags & 0x02); // Lamp is used to reset noise
discrete_sound_w(discrete, TRIPLHNT_BEAR_EN, state->m_misc_flags & 0x80); // bear
- is_witch_hunt = input_port_read(machine, "0C09") == 0x40;
+ is_witch_hunt = machine.root_device().ioport("0C09")->read() == 0x40;
bit = ~state->m_misc_flags & 0x40;
/* if we're not playing the sample yet, start it */
@@ -108,21 +108,21 @@ READ8_MEMBER(triplhnt_state::triplhnt_cmos_r)
READ8_MEMBER(triplhnt_state::triplhnt_input_port_4_r)
{
watchdog_reset_w(space, 0, 0);
- return input_port_read(machine(), "0C0B");
+ return ioport("0C0B")->read();
}
READ8_MEMBER(triplhnt_state::triplhnt_misc_r)
{
triplhnt_update_misc(machine(), offset);
- return input_port_read(machine(), "VBLANK") | m_hit_code;
+ return ioport("VBLANK")->read() | m_hit_code;
}
READ8_MEMBER(triplhnt_state::triplhnt_da_latch_r)
{
- int cross_x = input_port_read(machine(), "STICKX");
- int cross_y = input_port_read(machine(), "STICKY");
+ int cross_x = ioport("STICKX")->read();
+ int cross_y = ioport("STICKY")->read();
m_da_latch = offset;
@@ -196,7 +196,7 @@ static INPUT_PORTS_START( triplhnt )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_START("VBLANK")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("STICKX")
PORT_BIT( 0xfc, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xfc) PORT_CROSSHAIR(X, 62.0/64, 1.0/64, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15)
diff --git a/src/mame/drivers/truco.c b/src/mame/drivers/truco.c
index 488eff5f503..dd687088fc7 100644
--- a/src/mame/drivers/truco.c
+++ b/src/mame/drivers/truco.c
@@ -395,7 +395,7 @@ static INTERRUPT_GEN( truco_interrupt )
truco_state *state = device->machine().driver_data<truco_state>();
/* coinup */
- if ( input_port_read(device->machine(), "COIN") & 1 )
+ if ( state->ioport("COIN")->read() & 1 )
{
if ( state->m_trigger == 0 )
{
diff --git a/src/mame/drivers/tryout.c b/src/mame/drivers/tryout.c
index 30a870e3d01..426f402de48 100644
--- a/src/mame/drivers/tryout.c
+++ b/src/mame/drivers/tryout.c
@@ -140,7 +140,7 @@ static INPUT_PORTS_START( tryout )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, tryout_state,coin_inserted, 0)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
static const gfx_layout charlayout =
diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c
index 63846dd7289..56620714d6a 100644
--- a/src/mame/drivers/tugboat.c
+++ b/src/mame/drivers/tugboat.c
@@ -145,15 +145,15 @@ static READ8_DEVICE_HANDLER( tugboat_input_r )
{
tugboat_state *state = device->machine().driver_data<tugboat_state>();
if (~state->m_ctrl & 0x80)
- return input_port_read(device->machine(), "IN0");
+ return state->ioport("IN0")->read();
else if (~state->m_ctrl & 0x40)
- return input_port_read(device->machine(), "IN1");
+ return state->ioport("IN1")->read();
else if (~state->m_ctrl & 0x20)
- return input_port_read(device->machine(), "IN2");
+ return state->ioport("IN2")->read();
else if (~state->m_ctrl & 0x10)
- return input_port_read(device->machine(), "IN3");
+ return state->ioport("IN3")->read();
else
- return input_port_read(device->machine(), "IN4");
+ return state->ioport("IN4")->read();
}
static READ8_DEVICE_HANDLER( tugboat_ctrl_r )
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 7ef620a4e02..37d794a4d1f 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -361,11 +361,11 @@ READ16_MEMBER(tumbleb_state::tumblepopb_controls_r)
switch (offset << 1)
{
case 0:
- return input_port_read(machine(), "PLAYERS");
+ return ioport("PLAYERS")->read();
case 2:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 8:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 10: /* ? */
case 12:
return 0;
@@ -952,7 +952,7 @@ static INPUT_PORTS_START( tumblepb )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1039,7 +1039,7 @@ static INPUT_PORTS_START( metlsavr )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1159,7 +1159,7 @@ static INPUT_PORTS_START( fncywld )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1247,7 +1247,7 @@ static INPUT_PORTS_START( htchctch )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1309,7 +1309,7 @@ static INPUT_PORTS_START( cookbib )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1371,7 +1371,7 @@ static INPUT_PORTS_START( chokchok )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1446,7 +1446,7 @@ static INPUT_PORTS_START( wlstar )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1516,7 +1516,7 @@ static INPUT_PORTS_START( wondl96 )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be high to avoid endless loops
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1593,7 +1593,7 @@ static INPUT_PORTS_START( sdfight )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1671,7 +1671,7 @@ static INPUT_PORTS_START( bcstory )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1814,7 +1814,7 @@ static INPUT_PORTS_START( dquizgo )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK ) // to be confirmed
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // to be confirmed
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2227,7 +2227,7 @@ static MACHINE_RESET (htchctch)
tumbleb_state *state = machine.driver_data<tumbleb_state>();
/* copy protection data every reset */
- UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
+ UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
int i, len = state->memregion("user1")->bytes();
for (i = 0; i < len / 2; i++)
@@ -3441,7 +3441,7 @@ READ16_MEMBER(tumbleb_state::bcstory_1a0_read)
//mame_printf_debug("bcstory_io %06x\n",cpu_get_pc(&space.device()));
if (cpu_get_pc(&space.device())==0x0560) return 0x1a0;
- else return input_port_read(machine(), "SYSTEM");
+ else return ioport("SYSTEM")->read();
}
static DRIVER_INIT ( bcstory )
@@ -3456,8 +3456,8 @@ static DRIVER_INIT( htchctch )
{
tumbleb_state *state = machine.driver_data<tumbleb_state>();
-// UINT16 *HCROM = (UINT16*)machine.root_device().memregion("maincpu")->base();
- UINT16 *PROTDATA = (UINT16*)machine.root_device().memregion("user1")->base();
+// UINT16 *HCROM = (UINT16*)state->memregion("maincpu")->base();
+ UINT16 *PROTDATA = (UINT16*)state->memregion("user1")->base();
int i, len = state->memregion("user1")->bytes();
/* simulate RAM initialization done by the protection MCU */
/* verified on real hardware */
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index dcd50d91d5f..d23d2c64163 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -89,11 +89,11 @@ READ16_MEMBER(tumblep_state::tumblepop_controls_r)
switch (offset << 1)
{
case 0:
- return input_port_read(machine(), "PLAYERS");
+ return ioport("PLAYERS")->read();
case 2:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 8:
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 10: /* ? */
case 12:
return 0;
@@ -164,7 +164,7 @@ static INPUT_PORTS_START( tumblep )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/tunhunt.c b/src/mame/drivers/tunhunt.c
index bd778c1022a..ada57f2c7e7 100644
--- a/src/mame/drivers/tunhunt.c
+++ b/src/mame/drivers/tunhunt.c
@@ -88,38 +88,38 @@ WRITE8_MEMBER(tunhunt_state::tunhunt_control_w)
READ8_MEMBER(tunhunt_state::tunhunt_button_r)
{
- int data = input_port_read(machine(), "IN0");
+ int data = ioport("IN0")->read();
return ((data>>offset)&1)?0x00:0x80;
}
static READ8_DEVICE_HANDLER( dsw2_0r )
{
- return (input_port_read(device->machine(), "DSW")&0x0100)?0x80:0x00;
+ return (device->machine().root_device().ioport("DSW")->read()&0x0100)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_1r )
{
- return (input_port_read(device->machine(), "DSW")&0x0200)?0x80:0x00;
+ return (device->machine().root_device().ioport("DSW")->read()&0x0200)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_2r )
{
- return (input_port_read(device->machine(), "DSW")&0x0400)?0x80:0x00;
+ return (device->machine().root_device().ioport("DSW")->read()&0x0400)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_3r )
{
- return (input_port_read(device->machine(), "DSW")&0x0800)?0x80:0x00;
+ return (device->machine().root_device().ioport("DSW")->read()&0x0800)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_4r )
{
- return (input_port_read(device->machine(), "DSW")&0x1000)?0x80:0x00;
+ return (device->machine().root_device().ioport("DSW")->read()&0x1000)?0x80:0x00;
}
@@ -171,7 +171,7 @@ static INPUT_PORTS_START( tunhunt )
PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index 24954ed8503..f1b4eaafa4d 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -490,7 +490,7 @@ static I8279_INTERFACE( turbo_i8279_intf )
READ8_MEMBER(turbo_state::turbo_collision_r)
{
machine().primary_screen->update_partial(machine().primary_screen->vpos());
- return input_port_read(machine(), "DSW3") | (m_turbo_collision & 15);
+ return ioport("DSW3")->read() | (m_turbo_collision & 15);
}
@@ -504,13 +504,13 @@ WRITE8_MEMBER(turbo_state::turbo_collision_clear_w)
static READ8_DEVICE_HANDLER( turbo_analog_r )
{
turbo_state *state = device->machine().driver_data<turbo_state>();
- return input_port_read(device->machine(), "DIAL") - state->m_turbo_last_analog;
+ return state->ioport("DIAL")->read() - state->m_turbo_last_analog;
}
WRITE8_MEMBER(turbo_state::turbo_analog_reset_w)
{
- m_turbo_last_analog = input_port_read(machine(), "DIAL");
+ m_turbo_last_analog = ioport("DIAL")->read();
}
@@ -548,8 +548,8 @@ READ8_MEMBER(turbo_state::buckrog_cpu2_command_r)
READ8_MEMBER(turbo_state::buckrog_port_2_r)
{
- int inp1 = input_port_read(machine(), "DSW1");
- int inp2 = input_port_read(machine(), "DSW2");
+ int inp1 = ioport("DSW1")->read();
+ int inp2 = ioport("DSW2")->read();
return (((inp2 >> 6) & 1) << 7) |
(((inp2 >> 4) & 1) << 6) |
@@ -564,8 +564,8 @@ READ8_MEMBER(turbo_state::buckrog_port_2_r)
READ8_MEMBER(turbo_state::buckrog_port_3_r)
{
- int inp1 = input_port_read(machine(), "DSW1");
- int inp2 = input_port_read(machine(), "DSW2");
+ int inp1 = ioport("DSW1")->read();
+ int inp2 = ioport("DSW2")->read();
return (((inp2 >> 7) & 1) << 7) |
(((inp2 >> 5) & 1) << 6) |
diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c
index 0ed1e5f81a0..ebe5118efa7 100644
--- a/src/mame/drivers/twin16.c
+++ b/src/mame/drivers/twin16.c
@@ -176,13 +176,13 @@ READ16_MEMBER(twin16_state::twin16_input_r)
{
switch( offset )
{
- case 0x00: return input_port_read(machine(), "SYSTEM");
- case 0x01: return input_port_read(machine(), "P1");
- case 0x02: return input_port_read(machine(), "P2");
- case 0x03: return input_port_read(machine(), "P3");
- case 0x08: return input_port_read(machine(), "DSW2");
- case 0x09: return input_port_read(machine(), "DSW1");
- case 0x0c: return input_port_read(machine(), "DSW3");
+ case 0x00: return ioport("SYSTEM")->read();
+ case 0x01: return ioport("P1")->read();
+ case 0x02: return ioport("P2")->read();
+ case 0x03: return ioport("P3")->read();
+ case 0x08: return ioport("DSW2")->read();
+ case 0x09: return ioport("DSW1")->read();
+ case 0x0c: return ioport("DSW3")->read();
default: break;
}
return 0;
diff --git a/src/mame/drivers/twincobr.c b/src/mame/drivers/twincobr.c
index 84fecda3fa4..3a2e5bb85c6 100644
--- a/src/mame/drivers/twincobr.c
+++ b/src/mame/drivers/twincobr.c
@@ -390,7 +390,7 @@ static INPUT_PORTS_START( twincobr )
PORT_START("VBLANK")
PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
/* verified from M68000 and Z80 code */
@@ -425,7 +425,7 @@ static INPUT_PORTS_START( gulfwar2 )
PORT_MODIFY("VBLANK")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
@@ -471,7 +471,7 @@ static INPUT_PORTS_START( fshark )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
/* verified from M68000 code */
diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c
index f0f41718fc9..6d0f12306aa 100644
--- a/src/mame/drivers/twinkle.c
+++ b/src/mame/drivers/twinkle.c
@@ -504,27 +504,27 @@ READ32_MEMBER(twinkle_state::twinkle_io_r)
switch( m_io_offset )
{
case 0x07:
- data |= input_port_read( machine(), "IN0" );
+ data |= ioport( "IN0" )->read();
break;
case 0x0f:
- data |= input_port_read( machine(), "IN1" );
+ data |= ioport( "IN1" )->read();
break;
case 0x17:
- data |= input_port_read( machine(), "IN2" );
+ data |= ioport( "IN2" )->read();
break;
case 0x1f:
- data |= input_port_read( machine(), "IN3" );
+ data |= ioport( "IN3" )->read();
break;
case 0x27:
- data |= input_port_read( machine(), "IN4" );
+ data |= ioport( "IN4" )->read();
break;
case 0x2f:
- data |= input_port_read( machine(), "IN5" );
+ data |= ioport( "IN5" )->read();
break;
default:
diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c
index 5a55c717a7e..e0be5af9c9d 100644
--- a/src/mame/drivers/tx1.c
+++ b/src/mame/drivers/tx1.c
@@ -381,7 +381,7 @@ INPUT_PORTS_END
READ16_MEMBER(tx1_state::dipswitches_r)
{
- return (input_port_read(machine(), "DSW") & 0xfffe) | m_ts;
+ return (ioport("DSW")->read() & 0xfffe) | m_ts;
}
/*
@@ -417,8 +417,8 @@ static WRITE8_DEVICE_HANDLER( bb_coin_cnt_w )
WRITE8_MEMBER(tx1_state::tx1_ppi_latch_w)
{
- m_ppi_latch_a = ((input_port_read(machine(), "AN_BRAKE") & 0xf) << 4) | (input_port_read(machine(), "AN_ACCELERATOR") & 0xf);
- m_ppi_latch_b = input_port_read(machine(), "AN_STEERING");
+ m_ppi_latch_a = ((ioport("AN_BRAKE")->read() & 0xf) << 4) | (ioport("AN_ACCELERATOR")->read() & 0xf);
+ m_ppi_latch_b = ioport("AN_STEERING")->read();
}
static READ8_DEVICE_HANDLER( tx1_ppi_porta_r )
@@ -430,7 +430,7 @@ static READ8_DEVICE_HANDLER( tx1_ppi_porta_r )
static READ8_DEVICE_HANDLER( tx1_ppi_portb_r )
{
tx1_state *state = device->machine().driver_data<tx1_state>();
- return input_port_read(device->machine(), "PPI_PORTD") | state->m_ppi_latch_b;
+ return state->ioport("PPI_PORTD")->read() | state->m_ppi_latch_b;
}
@@ -446,17 +446,17 @@ static UINT8 bit_reverse8(UINT8 val)
READ8_MEMBER(tx1_state::bb_analog_r)
{
if (offset == 0)
- return bit_reverse8(((input_port_read(machine(), "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(machine(), "AN_STEERING"));
+ return bit_reverse8(((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read());
else
- return bit_reverse8((input_port_read(machine(), "AN_BRAKE") & 0xf) << 4);
+ return bit_reverse8((ioport("AN_BRAKE")->read() & 0xf) << 4);
}
READ8_MEMBER(tx1_state::bbjr_analog_r)
{
if (offset == 0)
- return ((input_port_read(machine(), "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(machine(), "AN_STEERING");
+ return ((ioport("AN_ACCELERATOR")->read() & 0xf) << 4) | ioport("AN_STEERING")->read();
else
- return (input_port_read(machine(), "AN_BRAKE") & 0xf) << 4;
+ return (ioport("AN_BRAKE")->read() & 0xf) << 4;
}
diff --git a/src/mame/drivers/uapce.c b/src/mame/drivers/uapce.c
index cbd8f1133d9..ac3d9b68983 100644
--- a/src/mame/drivers/uapce.c
+++ b/src/mame/drivers/uapce.c
@@ -173,7 +173,7 @@ READ8_MEMBER(uapce_state::jamma_if_read_dsw)
{
UINT8 dsw_val;
- dsw_val = input_port_read(machine(), "DSW" );
+ dsw_val = ioport("DSW" )->read();
if ( BIT( offset, 7 ) == 0 )
{
@@ -216,11 +216,11 @@ static UINT8 jamma_if_read_joystick( running_machine &machine )
uapce_state *state = machine.driver_data<uapce_state>();
if ( state->m_jamma_if_control_latch & 0x10 )
{
- return input_port_read(machine, "JOY" );
+ return state->ioport("JOY" )->read();
}
else
{
- return input_port_read(machine, "JOY" ) | 0x08;
+ return machine.root_device().ioport("JOY" )->read() | 0x08;
}
}
diff --git a/src/mame/drivers/ultratnk.c b/src/mame/drivers/ultratnk.c
index 6918a8cf3dc..340974c9712 100644
--- a/src/mame/drivers/ultratnk.c
+++ b/src/mame/drivers/ultratnk.c
@@ -26,7 +26,7 @@ CUSTOM_INPUT_MEMBER(ultratnk_state::get_collision)
CUSTOM_INPUT_MEMBER(ultratnk_state::get_joystick)
{
- UINT8 joy = input_port_read(machine(), (const char *)param) & 3;
+ UINT8 joy = ioport((const char *)param)->read() & 3;
if (joy == 1)
{
@@ -50,9 +50,9 @@ static TIMER_CALLBACK( nmi_callback )
/* NMI and watchdog are disabled during service mode */
- machine.watchdog_enable(input_port_read(machine, "IN0") & 0x40);
+ machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40);
- if (input_port_read(machine, "IN0") & 0x40)
+ if (machine.root_device().ioport("IN0")->read() & 0x40)
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
@@ -74,21 +74,21 @@ READ8_MEMBER(ultratnk_state::ultratnk_wram_r)
READ8_MEMBER(ultratnk_state::ultratnk_analog_r)
{
- return (input_port_read(machine(), "ANALOG") << (~offset & 7)) & 0x80;
+ return (ioport("ANALOG")->read() << (~offset & 7)) & 0x80;
}
READ8_MEMBER(ultratnk_state::ultratnk_coin_r)
{
- return (input_port_read(machine(), "COIN") << (~offset & 7)) & 0x80;
+ return (ioport("COIN")->read() << (~offset & 7)) & 0x80;
}
READ8_MEMBER(ultratnk_state::ultratnk_collision_r)
{
- return (input_port_read(machine(), "COLLISION") << (~offset & 7)) & 0x80;
+ return (ioport("COLLISION")->read() << (~offset & 7)) & 0x80;
}
READ8_MEMBER(ultratnk_state::ultratnk_options_r)
{
- return (input_port_read(machine(), "DIP") >> (2 * (offset & 3))) & 3;
+ return (ioport("DIP")->read() >> (2 * (offset & 3))) & 3;
}
@@ -181,7 +181,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( ultratnk )
PORT_START("IN0")
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN1")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Option 1") PORT_TOGGLE
diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c
index 5ec3cf4f5f1..1a6677c87f1 100644
--- a/src/mame/drivers/ultrsprt.c
+++ b/src/mame/drivers/ultrsprt.c
@@ -78,7 +78,7 @@ READ32_MEMBER(ultrsprt_state::eeprom_r)
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
- r |= input_port_read(machine(), "SERVICE");
+ r |= ioport("SERVICE")->read();
return r;
}
@@ -86,13 +86,13 @@ READ32_MEMBER(ultrsprt_state::eeprom_r)
WRITE32_MEMBER(ultrsprt_state::eeprom_w)
{
if (ACCESSING_BITS_24_31)
- input_port_write(machine(), "EEPROMOUT", data, 0xffffffff);
+ ioport("EEPROMOUT")->write(data, 0xffffffff);
}
CUSTOM_INPUT_MEMBER(ultrsprt_state::analog_ctrl_r)
{
const char *tag = (const char *)param;
- return input_port_read(machine(), tag) & 0xfff;
+ return ioport(tag)->read() & 0xfff;
}
WRITE32_MEMBER(ultrsprt_state::int_ack_w)
diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c
index 019e1cc11be..2f688da0137 100644
--- a/src/mame/drivers/undrfire.c
+++ b/src/mame/drivers/undrfire.c
@@ -262,12 +262,12 @@ READ32_MEMBER(undrfire_state::undrfire_input_r)
{
case 0x00:
{
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
}
case 0x01:
{
- return input_port_read(machine(), "SYSTEM") | (m_coin_word << 16);
+ return ioport("SYSTEM")->read() | (m_coin_word << 16);
}
}
@@ -376,8 +376,8 @@ READ32_MEMBER(undrfire_state::undrfire_lightgun_r)
case 0x00: /* P1 */
{
- x = input_port_read(machine(), "GUNX1") << 6;
- y = input_port_read(machine(), "GUNY1") << 6;
+ x = ioport("GUNX1")->read() << 6;
+ y = ioport("GUNY1")->read() << 6;
return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
| ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
@@ -385,8 +385,8 @@ READ32_MEMBER(undrfire_state::undrfire_lightgun_r)
case 0x01: /* P2 */
{
- x = input_port_read(machine(), "GUNX2") << 6;
- y = input_port_read(machine(), "GUNY2") << 6;
+ x = ioport("GUNX2")->read() << 6;
+ y = ioport("GUNY2")->read() << 6;
return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
| ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
@@ -457,7 +457,7 @@ WRITE32_MEMBER(undrfire_state::cbombers_cpua_ctrl_w)
READ32_MEMBER(undrfire_state::cbombers_adc_r)
{
- return (input_port_read(machine(), "STEER") << 24);
+ return (ioport("STEER")->read() << 24);
}
WRITE32_MEMBER(undrfire_state::cbombers_adc_w)
diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c
index 5d658951733..f119b5abdc8 100644
--- a/src/mame/drivers/unico.c
+++ b/src/mame/drivers/unico.c
@@ -104,7 +104,7 @@ WRITE16_MEMBER(unico_state::zeropnt_sound_bank_w)
/* Light Gun - need to wiggle the input slightly otherwise fire doesn't work */
READ16_MEMBER(unico_state::unico_gunx_0_msb_r)
{
- int x=input_port_read(machine(), "X0");
+ int x=ioport("X0")->read();
x=x*384/256; /* On screen pixel X */
if (x<0x160) x=0x30 + (x*0xd0/0x15f);
@@ -115,7 +115,7 @@ READ16_MEMBER(unico_state::unico_gunx_0_msb_r)
READ16_MEMBER(unico_state::unico_guny_0_msb_r)
{
- int y=input_port_read(machine(), "Y0");
+ int y=ioport("Y0")->read();
y=0x18+((y*0xe0)/0xff);
@@ -124,7 +124,7 @@ READ16_MEMBER(unico_state::unico_guny_0_msb_r)
READ16_MEMBER(unico_state::unico_gunx_1_msb_r)
{
- int x=input_port_read(machine(), "X1");
+ int x=ioport("X1")->read();
x=x*384/256; /* On screen pixel X */
if (x<0x160) x=0x30 + (x*0xd0/0x15f);
@@ -135,7 +135,7 @@ READ16_MEMBER(unico_state::unico_gunx_1_msb_r)
READ16_MEMBER(unico_state::unico_guny_1_msb_r)
{
- int y=input_port_read(machine(), "Y1");
+ int y=ioport("Y1")->read();
y=0x18+((y*0xe0)/0xff);
diff --git a/src/mame/drivers/unkhorse.c b/src/mame/drivers/unkhorse.c
index 03626c64075..a0c1b593872 100644
--- a/src/mame/drivers/unkhorse.c
+++ b/src/mame/drivers/unkhorse.c
@@ -95,9 +95,9 @@ static READ8_DEVICE_HANDLER(horse_input_r)
switch (state->m_output >> 6 & 3)
{
- case 0: return input_port_read(device->machine(), "IN0");
- case 1: return input_port_read(device->machine(), "IN1");
- case 2: return input_port_read(device->machine(), "IN2");
+ case 0: return state->ioport("IN0")->read();
+ case 1: return state->ioport("IN1")->read();
+ case 2: return state->ioport("IN2")->read();
default: break;
}
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index ff20fac87fc..961abf8f7d7 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -218,7 +218,7 @@ static WRITE8_DEVICE_HANDLER( upscope_cia_1_porta_w )
if (data & 4)
{
if (LOG_IO) logerror("Internal register (%d) read\n", state->m_nvram_address_latch);
- state->m_nvram_data_latch = (state->m_nvram_address_latch == 0) ? input_port_read(device->machine(), "IO0") : 0xff;
+ state->m_nvram_data_latch = (state->m_nvram_address_latch == 0) ? device->machine().root_device().ioport("IO0")->read() : 0xff;
}
/* if SEL == 0, we read NVRAM */
diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c
index eb9a3e3a588..75c811e4eb7 100644
--- a/src/mame/drivers/usgames.c
+++ b/src/mame/drivers/usgames.c
@@ -131,7 +131,7 @@ static INPUT_PORTS_START( usg32 )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) // +12 Volts?
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("UNK1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 0b3496c9465..b4ce837501b 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -649,7 +649,7 @@ static SCREEN_UPDATE_IND16( aoh )
CUSTOM_INPUT_MEMBER(vamphalf_state::boonggab_photo_sensors_r)
{
static const UINT16 photo_sensors_table[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 };
- UINT8 res = input_port_read(machine(), "PHOTO_SENSORS");
+ UINT8 res = ioport("PHOTO_SENSORS")->read();
switch(res)
{
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index 180bd0cca21..2743a111940 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -34,11 +34,11 @@ READ16_MEMBER(vaportra_state::vaportra_control_r)
switch (offset << 1)
{
case 4:
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 2:
- return input_port_read(machine(), "COINS");
+ return ioport("COINS")->read();
case 0:
- return input_port_read(machine(), "PLAYERS");
+ return ioport("PLAYERS")->read();
}
logerror("Unknown control read at %d\n",offset);
@@ -112,7 +112,7 @@ static INPUT_PORTS_START( vaportra )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index bc2fdda5987..b3ed80efb8c 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -258,7 +258,7 @@ static INPUT_PORTS_START( vball )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 1043901138a..31d8e4bff42 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -199,17 +199,17 @@ WRITE16_MEMBER(vcombat_state::main_video_write)
READ16_MEMBER(vcombat_state::control_1_r)
{
- return (input_port_read(machine(), "IN0") << 8);
+ return (ioport("IN0")->read() << 8);
}
READ16_MEMBER(vcombat_state::control_2_r)
{
- return (input_port_read(machine(), "IN1") << 8);
+ return (ioport("IN1")->read() << 8);
}
READ16_MEMBER(vcombat_state::control_3_r)
{
- return (input_port_read(machine(), "IN2") << 8);
+ return (ioport("IN2")->read() << 8);
}
static void wiggle_i860_common(device_t *device, UINT16 data)
diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c
index c849b0bcdaa..179018224c6 100644
--- a/src/mame/drivers/vegaeo.c
+++ b/src/mame/drivers/vegaeo.c
@@ -93,7 +93,7 @@ WRITE32_MEMBER(vegaeo_state::vega_misc_w)
READ32_MEMBER(vegaeo_state::vegaeo_custom_read)
{
eolith_speedup_read(&space);
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
}
static ADDRESS_MAP_START( vega_map, AS_PROGRAM, 32, vegaeo_state )
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index f8fbac127e9..689b05c9e1a 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -1428,7 +1428,7 @@ static WRITE32_HANDLER( analog_port_w )
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(&space->device()), data);
- state->m_pending_analog_read = input_port_read_safe(space->machine(), portnames[data & 7], 0);
+ state->m_pending_analog_read = state->ioport(portnames[data & 7])->read_safe(0);
}
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index d8ac75f24f2..6bae63a4bf9 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -134,7 +134,7 @@ WRITE8_MEMBER(vendetta_state::vendetta_eeprom_w)
return;
/* EEPROM */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
m_irq_enabled = (data >> 6) & 1;
@@ -322,7 +322,7 @@ static INPUT_PORTS_START( vendet4p )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM ready */
PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* not really vblank, object related. Its timed, otherwise sprites flicker */
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START( "EEPROMOUT" )
@@ -378,7 +378,7 @@ static INPUT_PORTS_START( esckids )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* EEPROM ready */
PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* not really vblank, object related. Its timed, otherwise sprites flicker */
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START( "EEPROMOUT" )
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index 2d0325f0f6e..3d8d696d647 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -170,7 +170,7 @@ CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_get_timer_value)
int vicdual_is_cabinet_color(running_machine &machine)
{
- return (input_port_read(machine, COLOR_BW_PORT_TAG) == 0);
+ return (machine.root_device().ioport(COLOR_BW_PORT_TAG)->read() == 0);
}
@@ -233,8 +233,8 @@ READ8_MEMBER(vicdual_state::depthch_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x08) ret = ioport("IN1")->read();
return ret;
}
@@ -315,8 +315,8 @@ READ8_MEMBER(vicdual_state::safari_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x08) ret = ioport("IN1")->read();
return ret;
}
@@ -399,8 +399,8 @@ READ8_MEMBER(vicdual_state::frogs_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x08) ret = ioport("IN1")->read();
return ret;
}
@@ -507,8 +507,8 @@ READ8_MEMBER(vicdual_state::headon_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x08) ret = ioport("IN1")->read();
return ret;
}
@@ -518,9 +518,9 @@ READ8_MEMBER(vicdual_state::sspaceat_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x04) ret = input_port_read(machine(), "IN1");
- if (offset & 0x08) ret = input_port_read(machine(), "IN2");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x04) ret = ioport("IN1")->read();
+ if (offset & 0x08) ret = ioport("IN2")->read();
return ret;
}
@@ -717,10 +717,10 @@ READ8_MEMBER(vicdual_state::headon2_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x01) ret = ioport("IN0")->read();
if (offset & 0x02) /* schematics show this as in input port, but never read from */
- if (offset & 0x04) ret = input_port_read(machine(), "IN1");
- if (offset & 0x08) ret = input_port_read(machine(), "IN2");
+ if (offset & 0x04) ret = ioport("IN1")->read();
+ if (offset & 0x08) ret = ioport("IN2")->read();
if (offset & 0x12) logerror("********* Read from port %x\n", offset);
return ret;
@@ -1628,7 +1628,7 @@ INPUT_PORTS_END
CUSTOM_INPUT_MEMBER(vicdual_state::brdrline_lives)
{
int bit_mask = (FPTR)param;
- return (input_port_read(machine(), "FAKE_LIVES") & bit_mask) ? 0x00 : 0x01;
+ return (ioport("FAKE_LIVES")->read() & bit_mask) ? 0x00 : 0x01;
}
static INPUT_PORTS_START( brdrline )
@@ -2167,8 +2167,8 @@ READ8_MEMBER(vicdual_state::nsub_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x08) ret = ioport("IN1")->read();
return ret;
}
@@ -2262,9 +2262,9 @@ READ8_MEMBER(vicdual_state::invinco_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(machine(), "IN0");
- if (offset & 0x02) ret = input_port_read(machine(), "IN1");
- if (offset & 0x08) ret = input_port_read(machine(), "IN2");
+ if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x02) ret = ioport("IN1")->read();
+ if (offset & 0x08) ret = ioport("IN2")->read();
return ret;
}
diff --git a/src/mame/drivers/videopin.c b/src/mame/drivers/videopin.c
index 0de8fad00ae..62d2670f56d 100644
--- a/src/mame/drivers/videopin.c
+++ b/src/mame/drivers/videopin.c
@@ -25,7 +25,7 @@ static WRITE8_DEVICE_HANDLER(videopin_out2_w);
static void update_plunger(running_machine &machine)
{
videopin_state *state = machine.driver_data<videopin_state>();
- UINT8 val = input_port_read(machine, "IN2");
+ UINT8 val = state->ioport("IN2")->read();
if (state->m_prev != val)
{
@@ -94,7 +94,7 @@ READ8_MEMBER(videopin_state::videopin_misc_r)
// signals received. This results in the MPU displaying the
// ball being shot onto the playfield at a certain speed.
- UINT8 val = input_port_read(machine(), "IN1");
+ UINT8 val = ioport("IN1")->read();
if (plunger >= 0.000 && plunger <= 0.001)
{
@@ -258,7 +258,7 @@ static INPUT_PORTS_START( videopin )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Nudge") PORT_CODE(KEYCODE_SPACE)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("IN2")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Ball Shooter") PORT_CODE(KEYCODE_DOWN)
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index de3f2a5d526..435abdb84e8 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -493,7 +493,7 @@ static TILE_GET_INFO( get_bg_tile_info )
{
videopkr_state *state = machine.driver_data<videopkr_state>();
int offs = tile_index;
- int attr = state->m_color_ram[offs] + input_port_read(machine, "IN2"); /* Color Switch Action */
+ int attr = state->m_color_ram[offs] + state->ioport("IN2")->read(); /* Color Switch Action */
int code = state->m_video_ram[offs];
int color = attr;
SET_TILE_INFO(0, code, color, 0);
@@ -536,9 +536,9 @@ READ8_MEMBER(videopkr_state::videopkr_io_r)
{
case 0xef: /* inputs are multiplexed through a diode matrix */
{
- hf = ((input_port_read(machine(), "IN1") & 0x10 ) >> 4) & 1; /* Hopper full detection */
- co = 0x10 * ((input_port_read(machine(), "IN1") & 0x20 ) >> 5); /* Coin Out detection */
- kbdin = ((input_port_read(machine(), "IN1") & 0xaf ) << 8) + input_port_read(machine(), "IN0");
+ hf = ((ioport("IN1")->read() & 0x10 ) >> 4) & 1; /* Hopper full detection */
+ co = 0x10 * ((ioport("IN1")->read() & 0x20 ) >> 5); /* Coin Out detection */
+ kbdin = ((ioport("IN1")->read() & 0xaf ) << 8) + ioport("IN0")->read();
switch (kbdin)
{
diff --git a/src/mame/drivers/vindictr.c b/src/mame/drivers/vindictr.c
index abb04e2c535..df0fc9709d7 100644
--- a/src/mame/drivers/vindictr.c
+++ b/src/mame/drivers/vindictr.c
@@ -65,7 +65,7 @@ static MACHINE_RESET( vindictr )
READ16_MEMBER(vindictr_state::port1_r)
{
- int result = input_port_read(machine(), "260010");
+ int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0004;
if (m_cpu_to_sound_ready) result ^= 0x0008;
result ^= 0x0010;
@@ -124,7 +124,7 @@ static INPUT_PORTS_START( vindictr )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(1)
PORT_START("260010")
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index dcf95d19e8f..1c41614c1c8 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -1604,12 +1604,12 @@ READ64_MEMBER(viper_state::unk1_r)
}
if (ACCESSING_BITS_32_39)
{
- UINT64 reg = input_port_read(machine(), "IN0");
+ UINT64 reg = ioport("IN0")->read();
r |= reg << 32;
}
if (ACCESSING_BITS_24_31)
{
- UINT64 reg = input_port_read(machine(), "IN1");
+ UINT64 reg = ioport("IN1")->read();
r |= reg << 24;
}
if (ACCESSING_BITS_16_23)
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index 370fab699b1..7416c07da2c 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -164,14 +164,14 @@ WRITE16_MEMBER(vmetal_state::vmetal_mid2tileram_w)
}
-READ16_MEMBER(vmetal_state::varia_dips_bit8_r){ return ((input_port_read(machine(), "DSW2") & 0x80) << 0) | ((input_port_read(machine(), "DSW1") & 0x80) >> 1); }
-READ16_MEMBER(vmetal_state::varia_dips_bit7_r){ return ((input_port_read(machine(), "DSW2") & 0x40) << 1) | ((input_port_read(machine(), "DSW1") & 0x40) >> 0); }
-READ16_MEMBER(vmetal_state::varia_dips_bit6_r){ return ((input_port_read(machine(), "DSW2") & 0x20) << 2) | ((input_port_read(machine(), "DSW1") & 0x20) << 1); }
-READ16_MEMBER(vmetal_state::varia_dips_bit5_r){ return ((input_port_read(machine(), "DSW2") & 0x10) << 3) | ((input_port_read(machine(), "DSW1") & 0x10) << 2); }
-READ16_MEMBER(vmetal_state::varia_dips_bit4_r){ return ((input_port_read(machine(), "DSW2") & 0x08) << 4) | ((input_port_read(machine(), "DSW1") & 0x08) << 3); }
-READ16_MEMBER(vmetal_state::varia_dips_bit3_r){ return ((input_port_read(machine(), "DSW2") & 0x04) << 5) | ((input_port_read(machine(), "DSW1") & 0x04) << 4); }
-READ16_MEMBER(vmetal_state::varia_dips_bit2_r){ return ((input_port_read(machine(), "DSW2") & 0x02) << 6) | ((input_port_read(machine(), "DSW1") & 0x02) << 5); }
-READ16_MEMBER(vmetal_state::varia_dips_bit1_r){ return ((input_port_read(machine(), "DSW2") & 0x01) << 7) | ((input_port_read(machine(), "DSW1") & 0x01) << 6); }
+READ16_MEMBER(vmetal_state::varia_dips_bit8_r){ return ((ioport("DSW2")->read() & 0x80) << 0) | ((ioport("DSW1")->read() & 0x80) >> 1); }
+READ16_MEMBER(vmetal_state::varia_dips_bit7_r){ return ((ioport("DSW2")->read() & 0x40) << 1) | ((ioport("DSW1")->read() & 0x40) >> 0); }
+READ16_MEMBER(vmetal_state::varia_dips_bit6_r){ return ((ioport("DSW2")->read() & 0x20) << 2) | ((ioport("DSW1")->read() & 0x20) << 1); }
+READ16_MEMBER(vmetal_state::varia_dips_bit5_r){ return ((ioport("DSW2")->read() & 0x10) << 3) | ((ioport("DSW1")->read() & 0x10) << 2); }
+READ16_MEMBER(vmetal_state::varia_dips_bit4_r){ return ((ioport("DSW2")->read() & 0x08) << 4) | ((ioport("DSW1")->read() & 0x08) << 3); }
+READ16_MEMBER(vmetal_state::varia_dips_bit3_r){ return ((ioport("DSW2")->read() & 0x04) << 5) | ((ioport("DSW1")->read() & 0x04) << 4); }
+READ16_MEMBER(vmetal_state::varia_dips_bit2_r){ return ((ioport("DSW2")->read() & 0x02) << 6) | ((ioport("DSW1")->read() & 0x02) << 5); }
+READ16_MEMBER(vmetal_state::varia_dips_bit1_r){ return ((ioport("DSW2")->read() & 0x01) << 7) | ((ioport("DSW1")->read() & 0x01) << 6); }
static WRITE8_DEVICE_HANDLER( vmetal_control_w )
{
@@ -423,7 +423,7 @@ static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
static void expand_gfx1(running_machine &machine)
{
metro_state *state = machine.driver_data<metro_state>();
- UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT8 *base_gfx = state->memregion("gfx1")->base();
UINT32 length = 2 * state->memregion("gfx1")->bytes();
state->m_expanded_gfx1 = auto_alloc_array(machine, UINT8, length);
for (int i = 0; i < length; i += 2)
diff --git a/src/mame/drivers/voyager.c b/src/mame/drivers/voyager.c
index b56942329d5..74fe646f08f 100644
--- a/src/mame/drivers/voyager.c
+++ b/src/mame/drivers/voyager.c
@@ -532,7 +532,7 @@ static INPUT_PORTS_START( voyager )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // returns back to MS-DOS (likely to be unmapped and actually used as a lame protection check)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IOCARD3")
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xdfff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IOCARD4")
diff --git a/src/mame/drivers/vpoker.c b/src/mame/drivers/vpoker.c
index 72335b47385..415243154f6 100644
--- a/src/mame/drivers/vpoker.c
+++ b/src/mame/drivers/vpoker.c
@@ -158,7 +158,7 @@ static SCREEN_UPDATE_IND16( vpoker )
READ8_MEMBER(vpoker_state::blitter_r)
{
if(offset == 6)
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
return 0;
}
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index 7c14293851c..e6b0e4f85fe 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -291,7 +291,7 @@ static INPUT_PORTS_START( wardner_generic )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) /* "V-BLANKING" in "test mode" */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* "V-BLANKING" in "test mode" */
PORT_START("DSWA")
TOAPLAN_MACHINE_COCKTAIL_LOC(SW1)
diff --git a/src/mame/drivers/warpsped.c b/src/mame/drivers/warpsped.c
index ad20b3ce492..2be9f3497c6 100644
--- a/src/mame/drivers/warpsped.c
+++ b/src/mame/drivers/warpsped.c
@@ -243,7 +243,7 @@ static INPUT_PORTS_START( warpspeed )
PORT_START("IN2")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW")
PORT_DIPNAME( 0x07, 0x00, "Coin/Time" )
diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c
index d7360a52e6e..3db32767751 100644
--- a/src/mame/drivers/warpwarp.c
+++ b/src/mame/drivers/warpwarp.c
@@ -155,10 +155,10 @@ READ8_MEMBER(warpwarp_state::geebee_in_r)
static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3
offset &= 3;
- res = input_port_read_safe(machine(), portnames[offset], 0);
+ res = ioport(portnames[offset])->read_safe(0);
if (offset == 3)
{
- res = input_port_read(machine(), (flip_screen() & 1) ? "IN2" : "IN1"); // read player 2 input in cocktail mode
+ res = ioport((flip_screen() & 1) ? "IN2" : "IN1")->read(); // read player 2 input in cocktail mode
if (m_handle_joystick)
{
/* map digital two-way joystick to two fixed VOLIN values */
@@ -231,13 +231,13 @@ WRITE8_MEMBER(warpwarp_state::geebee_out7_w)
/* Read Switch Inputs */
READ8_MEMBER(warpwarp_state::warpwarp_sw_r)
{
- return (input_port_read(machine(), "IN0") >> (offset & 7)) & 1;
+ return (ioport("IN0")->read() >> (offset & 7)) & 1;
}
/* Read Dipswitches */
static READ8_DEVICE_HANDLER( warpwarp_dsw1_r )
{
- return (input_port_read(device->machine(), "DSW1") >> (offset & 7)) & 1;
+ return (device->machine().root_device().ioport("DSW1")->read() >> (offset & 7)) & 1;
}
/* Read mux Controller Inputs */
@@ -246,7 +246,7 @@ static READ8_DEVICE_HANDLER( warpwarp_vol_r )
warpwarp_state *state = device->machine().driver_data<warpwarp_state>();
int res;
- res = input_port_read(device->machine(), (state->flip_screen() & 1) ? "VOLIN2" : "VOLIN1");
+ res = state->ioport((state->flip_screen() & 1) ? "VOLIN2" : "VOLIN1")->read();
if (state->m_handle_joystick)
{
if (res & 1) return 0x0f;
@@ -379,14 +379,14 @@ static INPUT_PORTS_START( geebee )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x30, 0x10, "Replay" ) PORT_DIPLOCATION("DSW2:5,6") // awards 1 credit
- PORT_DIPSETTING( 0x10, "40k 80k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x20, "70k 140k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x30, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, "60k 120k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x20, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x30, "150k 300k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
+ PORT_DIPSETTING( 0x10, "40k 80k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, "70k 140k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x30, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, "60k 120k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x20, "100k 200k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x30, "150k 300k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
@@ -401,14 +401,14 @@ static INPUT_PORTS_START( geebeeb )
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x30, 0x10, "Replay" ) // awards 1 credit
- PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x20, "70k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x30, "100k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x10, "60k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x20, "100k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x30, "150k" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
+ PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x20, "70k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x30, "100k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x10, "60k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x20, "100k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x30, "150k" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
INPUT_PORTS_END
static INPUT_PORTS_START( navarone )
@@ -432,14 +432,14 @@ static INPUT_PORTS_START( navarone )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x02, "3" )
PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:3,4")
- PORT_DIPSETTING( 0x04, "5000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x08, "6000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x0c, "7000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x00)
- PORT_DIPSETTING( 0x04, "6000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x08, "7000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x0c, "8000" ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
- PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, PORTCOND_EQUALS, 0x02)
+ PORT_DIPSETTING( 0x04, "5000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x08, "6000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x0c, "7000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x04, "6000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x08, "7000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x0c, "8000" ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02)
PORT_DIPNAME( 0x30, 0x10, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW2:5,6")
PORT_DIPSETTING( 0x30, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_1C ) )
@@ -661,14 +661,14 @@ static INPUT_PORTS_START( warpwarp )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x0c, "5" )
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW1:5,6")
- PORT_DIPSETTING( 0x00, "8k 30k 30k+" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
- PORT_DIPSETTING( 0x10, "10k 40k 40k+" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
- PORT_DIPSETTING( 0x20, "15k 60k 60k+" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
- PORT_DIPSETTING(0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_NOTEQUALS, 0x0c)
- PORT_DIPSETTING( 0x00, "30k" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
- PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
- PORT_DIPSETTING( 0x20, "60k" ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
- PORT_DIPSETTING( 0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, PORTCOND_EQUALS, 0x0c)
+ PORT_DIPSETTING( 0x00, "8k 30k 30k+" ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
+ PORT_DIPSETTING( 0x10, "10k 40k 40k+" ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
+ PORT_DIPSETTING( 0x20, "15k 60k 60k+" ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
+ PORT_DIPSETTING(0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, NOTEQUALS, 0x0c)
+ PORT_DIPSETTING( 0x00, "30k" ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
+ PORT_DIPSETTING( 0x10, "40k" ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
+ PORT_DIPSETTING( 0x20, "60k" ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
+ PORT_DIPSETTING( 0x30, DEF_STR( None ) ) PORT_CONDITION("DSW1", 0x0c, EQUALS, 0x0c)
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c
index db613bfbcad..1406813aeb2 100644
--- a/src/mame/drivers/wecleman.c
+++ b/src/mame/drivers/wecleman.c
@@ -371,9 +371,9 @@ READ16_MEMBER(wecleman_state::selected_ip_r)
{
switch ( (m_selected_ip >> 5) & 3 )
{ // From WEC Le Mans Schems:
- case 0: return input_port_read(machine(), "ACCEL"); // Accel - Schems: Accelevr
+ case 0: return ioport("ACCEL")->read(); // Accel - Schems: Accelevr
case 1: return ~0; // ????? - Schems: Not Used
- case 2: return input_port_read(machine(), "STEER"); // Wheel - Schems: Handlevr
+ case 2: return ioport("STEER")->read(); // Wheel - Schems: Handlevr
case 3: return ~0; // Table - Schems: Turnvr
default: return ~0;
@@ -1251,7 +1251,7 @@ static DRIVER_INIT( wecleman )
wecleman_state *state = machine.driver_data<wecleman_state>();
int i, len;
UINT8 *RAM;
-// UINT16 *RAM1 = (UINT16 *) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16 *) state->memregion("maincpu")->base(); /* Main CPU patches */
// RAM1[0x08c2/2] = 0x601e; // faster self test
/* Decode GFX Roms - Compensate for the address lines scrambling */
@@ -1261,7 +1261,7 @@ static DRIVER_INIT( wecleman )
I hope you'll appreciate this effort! */
/* let's swap even and odd *pixels* of the sprites */
- RAM = machine.root_device().memregion("gfx1")->base();
+ RAM = state->memregion("gfx1")->base();
len = state->memregion("gfx1")->bytes();
for (i = 0; i < len; i ++)
{
@@ -1393,7 +1393,7 @@ static void hotchase_sprite_decode( running_machine &machine, int num16_banks, i
static DRIVER_INIT( hotchase )
{
wecleman_state *state = machine.driver_data<wecleman_state>();
-// UINT16 *RAM1 = (UINT16) machine.root_device().memregion("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16) state->memregion("maincpu")->base(); /* Main CPU patches */
// RAM[0x1140/2] = 0x0015; RAM[0x195c/2] = 0x601A; // faster self test
UINT8 *RAM;
@@ -1401,7 +1401,7 @@ static DRIVER_INIT( hotchase )
/* Decode GFX Roms */
/* Let's swap even and odd bytes of the sprites gfx roms */
- RAM = machine.root_device().memregion("gfx1")->base();
+ RAM = state->memregion("gfx1")->base();
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
hotchase_sprite_decode(machine,3,0x80000*2); // num banks, bank len
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 594ecbe001c..e15345eb916 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -533,12 +533,12 @@ WRITE16_MEMBER(wgp_state::rotate_port_w)
READ16_MEMBER(wgp_state::wgp_adinput_r)
{
int steer = 0x40;
- int fake = input_port_read_safe(machine(), FAKE_PORT_TAG, 0x00);
+ int fake = ioport(FAKE_PORT_TAG)->read_safe(0x00);
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* Reduce span to 0x80 */
- steer = (input_port_read_safe(machine(), STEER_PORT_TAG, 0x00) * 0x80) / 0x100;
+ steer = (ioport(STEER_PORT_TAG)->read_safe(0x00) * 0x80) / 0x100;
}
else /* Digital steer */
{
@@ -583,7 +583,7 @@ READ16_MEMBER(wgp_state::wgp_adinput_r)
}
case 0x05:
- return input_port_read_safe(machine(), UNKNOWN_PORT_TAG, 0x00); /* unknown */
+ return ioport(UNKNOWN_PORT_TAG)->read_safe(0x00); /* unknown */
}
logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",cpu_get_pc(&space.device()),offset);
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index 6d456bc617e..cad9bdd3ebf 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -783,10 +783,10 @@ static INPUT_PORTS_START( colony7 )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x01, "3")
PORT_DIPNAME( 0x02, 0x00, "Bonus At" )
- PORT_DIPSETTING( 0x00, "20k/40k" ) PORT_CONDITION("IN2",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x02, "30k/50k" ) PORT_CONDITION("IN2",0x01,PORTCOND_NOTEQUALS,0x01)
- PORT_DIPSETTING( 0x00, "30k/50k" ) PORT_CONDITION("IN2",0x01,PORTCOND_EQUALS,0x01)
- PORT_DIPSETTING( 0x02, "40k/70k" ) PORT_CONDITION("IN2",0x01,PORTCOND_EQUALS,0x01)
+ PORT_DIPSETTING( 0x00, "20k/40k" ) PORT_CONDITION("IN2",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x02, "30k/50k" ) PORT_CONDITION("IN2",0x01,NOTEQUALS,0x01)
+ PORT_DIPSETTING( 0x00, "30k/50k" ) PORT_CONDITION("IN2",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x02, "40k/70k" ) PORT_CONDITION("IN2",0x01,EQUALS,0x01)
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown )) /* documented as unused */
PORT_DIPSETTING( 0x04, DEF_STR( Off ))
PORT_DIPSETTING( 0x00, DEF_STR( On ))
diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c
index dc5dbc731bb..185c17aef3e 100644
--- a/src/mame/drivers/wink.c
+++ b/src/mame/drivers/wink.c
@@ -95,12 +95,12 @@ WRITE8_MEMBER(wink_state::wink_coin_counter_w)
READ8_MEMBER(wink_state::analog_port_r)
{
- return input_port_read(machine(), /* player_mux ? "DIAL2" : */ "DIAL1");
+ return ioport(/* player_mux ? "DIAL2" : */ "DIAL1")->read();
}
READ8_MEMBER(wink_state::player_inputs_r)
{
- return input_port_read(machine(), /* player_mux ? "INPUTS2" : */ "INPUTS1");
+ return ioport(/* player_mux ? "INPUTS2" : */ "INPUTS1")->read();
}
WRITE8_MEMBER(wink_state::sound_irq_w)
diff --git a/src/mame/drivers/wiping.c b/src/mame/drivers/wiping.c
index 079b74f4126..e9473e955c7 100644
--- a/src/mame/drivers/wiping.c
+++ b/src/mame/drivers/wiping.c
@@ -47,7 +47,7 @@ READ8_MEMBER(wiping_state::ports_r)
res = 0;
for (i = 0; i < 8; i++)
- res |= ((input_port_read(machine(), portnames[i]) >> offset) & 1) << i;
+ res |= ((ioport(portnames[i])->read() >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index cb951e82551..969ec7047da 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -345,10 +345,10 @@ READ8_MEMBER(witch_state::read_a00x)
switch(offset)
{
case 0x02: return m_reg_a002;
- case 0x04: return input_port_read(machine(), "A004");
- case 0x05: return input_port_read(machine(), "A005");
- case 0x0c: return input_port_read(machine(), "SERVICE"); // stats / reset
- case 0x0e: return input_port_read(machine(), "A00E"); // coin/reset
+ case 0x04: return ioport("A004")->read();
+ case 0x05: return ioport("A005")->read();
+ case 0x0c: return ioport("SERVICE")->read(); // stats / reset
+ case 0x0e: return ioport("A00E")->read(); // coin/reset
}
if(offset == 0x00) //muxed with A002?
@@ -356,11 +356,11 @@ READ8_MEMBER(witch_state::read_a00x)
switch(m_reg_a002 & 0x3f)
{
case 0x3b:
- return input_port_read(machine(), "UNK"); //bet10 / pay out
+ return ioport("UNK")->read(); //bet10 / pay out
case 0x3e:
- return input_port_read(machine(), "INPUTS"); //TODO : trace f564
+ return ioport("INPUTS")->read(); //TODO : trace f564
case 0x3d:
- return input_port_read(machine(), "A005");
+ return ioport("A005")->read();
default:
logerror("A000 read with mux=0x%02x\n", m_reg_a002 & 0x3f);
}
diff --git a/src/mame/drivers/wolfpack.c b/src/mame/drivers/wolfpack.c
index d46541a0943..2d8ab9200db 100644
--- a/src/mame/drivers/wolfpack.c
+++ b/src/mame/drivers/wolfpack.c
@@ -33,7 +33,7 @@ static MACHINE_RESET( wolfpack )
CUSTOM_INPUT_MEMBER(wolfpack_state::wolfpack_dial_r)
{
int bit = (FPTR)param;
- return ((input_port_read(machine(), "DIAL") + bit) / 2) & 0x01;
+ return ((ioport("DIAL")->read() + bit) / 2) & 0x01;
}
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index ac6083a777a..a0c97a5d46d 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -177,13 +177,13 @@ WRITE16_MEMBER(wwfwfest_state::wwfwfest_soundwrite)
CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_3f_r)
{
const char *tag = (const char *)param;
- return input_port_read(machine(), tag) & 0x3f;
+ return ioport(tag)->read() & 0x3f;
}
CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_c0_r)
{
const char *tag = (const char *)param;
- return (input_port_read(machine(), tag) & 0xc0) >> 6;
+ return (ioport(tag)->read() & 0xc0) >> 6;
}
@@ -237,7 +237,7 @@ static INPUT_PORTS_START( wwfwfest )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0x0300, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, wwfwfest_state,dsw_c0_r, "DSW1")
- PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index 7471a7e2a31..7c3223fe6c9 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -183,7 +183,7 @@ static void parse_control2( running_machine &machine )
/* bit 5 is enable irq 6 */
/* bit 6 is enable irq 5 */
/* bit 11 is watchdog */
- input_port_write(machine, "EEPROMOUT", state->m_cur_control2, 0xff);
+ state->ioport("EEPROMOUT")->write(state->m_cur_control2, 0xff);
/* bit 8 = enable sprite ROM reading */
k053246_set_objcha_line(state->m_k053246, (state->m_cur_control2 & 0x0100) ? ASSERT_LINE : CLEAR_LINE);
@@ -684,7 +684,7 @@ static DRIVER_INIT( xexex )
if (!strcmp(machine.system().name, "xexex"))
{
// Invulnerability
-// *(UINT16 *)(machine.root_device().memregion("maincpu")->base() + 0x648d4) = 0x4a79;
+// *(UINT16 *)(state->memregion("maincpu")->base() + 0x648d4) = 0x4a79;
// *(UINT16 *)(state->memregion("maincpu")->base() + 0x00008) = 0x5500;
state->m_strip_0x1a = 1;
}
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index a947a3e3669..8a8caee8d68 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -54,7 +54,7 @@ WRITE16_MEMBER(xmen_state::eeprom_w)
/* bit 3 is clock (active high) */
/* bit 4 is cs (active low) */
/* bit 5 is enabled in IRQ3, disabled in IRQ5 (sprite DMA start?) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
}
if (ACCESSING_BITS_8_15)
{
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index b9a07cdebea..cce53aace1a 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -191,7 +191,7 @@ WRITE16_MEMBER(xtheball_state::bit_controls_w)
READ16_MEMBER(xtheball_state::analogx_r)
{
- return (input_port_read(machine(), "ANALOGX") << 8) | 0x00ff;
+ return (ioport("ANALOGX")->read() << 8) | 0x00ff;
}
@@ -199,7 +199,7 @@ READ16_MEMBER(xtheball_state::analogy_watchdog_r)
{
/* doubles as a watchdog address */
watchdog_reset_w(space,0,0);
- return (input_port_read(machine(), "ANALOGY") << 8) | 0x00ff;
+ return (ioport("ANALOGY")->read() << 8) | 0x00ff;
}
diff --git a/src/mame/drivers/xxmissio.c b/src/mame/drivers/xxmissio.c
index 3ab0739f304..e4818ce1764 100644
--- a/src/mame/drivers/xxmissio.c
+++ b/src/mame/drivers/xxmissio.c
@@ -199,7 +199,7 @@ static INPUT_PORTS_START( xxmissio )
PORT_START("STATUS")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x01)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x04)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x08)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xxmissio_state,xxmissio_status_r, (void *)0x10)
diff --git a/src/mame/drivers/xybots.c b/src/mame/drivers/xybots.c
index 7ce13ac0caf..32cc920d096 100644
--- a/src/mame/drivers/xybots.c
+++ b/src/mame/drivers/xybots.c
@@ -66,7 +66,7 @@ static MACHINE_RESET( xybots )
READ16_MEMBER(xybots_state::special_port1_r)
{
- int result = input_port_read(machine(), "FFE200");
+ int result = ioport("FFE200")->read();
if (m_cpu_to_sound_ready) result ^= 0x0200;
result ^= m_h256 ^= 0x0400;
@@ -135,7 +135,7 @@ static INPUT_PORTS_START( xybots )
PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) /* /AUDBUSY */
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) /* 256H */
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_VBLANK ) /* VBLANK */
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( atarijsa_i ) /* audio port */
diff --git a/src/mame/drivers/xyonix.c b/src/mame/drivers/xyonix.c
index 0736bf1b90f..25ea31ddf81 100644
--- a/src/mame/drivers/xyonix.c
+++ b/src/mame/drivers/xyonix.c
@@ -43,7 +43,7 @@ static void handle_coins(running_machine &machine, int coin)
if (coin & 1) // Coin 2 !
{
- tmp = (input_port_read(machine, "DSW") & 0xc0) >> 6;
+ tmp = (state->ioport("DSW")->read() & 0xc0) >> 6;
state->m_coins++;
if (state->m_coins >= coinage_table[tmp][0])
{
@@ -56,7 +56,7 @@ static void handle_coins(running_machine &machine, int coin)
if (coin & 2) // Coin 1 !
{
- tmp = (input_port_read(machine, "DSW") & 0x30) >> 4;
+ tmp = (machine.root_device().ioport("DSW")->read() & 0x30) >> 4;
state->m_coins++;
if (state->m_coins >= coinage_table[tmp][0])
{
@@ -89,12 +89,12 @@ READ8_MEMBER(xyonix_state::xyonix_io_r)
switch (m_e0_data)
{
case 0x81 :
- return input_port_read(machine(), "P1") & 0x7f;
+ return ioport("P1")->read() & 0x7f;
case 0x82 :
- return input_port_read(machine(), "P2") & 0x7f;
+ return ioport("P2")->read() & 0x7f;
case 0x91:
/* check coin inputs */
- coin = ((input_port_read(machine(), "P1") & 0x80) >> 7) | ((input_port_read(machine(), "P2") & 0x80) >> 6);
+ coin = ((ioport("P1")->read() & 0x80) >> 7) | ((ioport("P2")->read() & 0x80) >> 6);
if (coin ^ m_prev_coin && coin != 3)
{
if (m_credits < 9) handle_coins(machine(), coin);
@@ -102,7 +102,7 @@ READ8_MEMBER(xyonix_state::xyonix_io_r)
m_prev_coin = coin;
return m_credits;
case 0x92:
- return ((input_port_read(machine(), "P1") & 0x80) >> 7) | ((input_port_read(machine(), "P2") & 0x80) >> 6);
+ return ((ioport("P1")->read() & 0x80) >> 7) | ((ioport("P2")->read() & 0x80) >> 6);
case 0xe0: /* reset? */
m_coins = 0;
m_credits = 0;
@@ -111,9 +111,9 @@ READ8_MEMBER(xyonix_state::xyonix_io_r)
m_credits--;
return 0xff;
case 0xfe: /* Dip Switches 1 to 4 */
- return input_port_read(machine(), "DSW") & 0x0f;
+ return ioport("DSW")->read() & 0x0f;
case 0xff: /* Dip Switches 5 to 8 */
- return input_port_read(machine(), "DSW") >> 4;
+ return ioport("DSW")->read() >> 4;
}
}
diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c
index 743d5d3c289..d0d05136ec8 100644
--- a/src/mame/drivers/yunsung8.c
+++ b/src/mame/drivers/yunsung8.c
@@ -466,8 +466,8 @@ static const msm5205_interface yunsung8_msm5205_interface =
static MACHINE_START( yunsung8 )
{
yunsung8_state *state = machine.driver_data<yunsung8_state>();
- UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
- UINT8 *AUDIO = machine.root_device().memregion("audiocpu")->base();
+ UINT8 *MAIN = state->memregion("maincpu")->base();
+ UINT8 *AUDIO = state->memregion("audiocpu")->base();
state->m_videoram_0 = state->m_videoram + 0x0000; // Ram is banked
state->m_videoram_1 = state->m_videoram + 0x2000;
diff --git a/src/mame/drivers/zac2650.c b/src/mame/drivers/zac2650.c
index 368f7c3588e..3bdfc0feb3a 100644
--- a/src/mame/drivers/zac2650.c
+++ b/src/mame/drivers/zac2650.c
@@ -79,7 +79,7 @@ static INPUT_PORTS_START( tinvader )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("1E85")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -147,7 +147,7 @@ static INPUT_PORTS_START( dodgem )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SENSE")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("1E85")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c
index cf19a99a14b..058ba4411d1 100644
--- a/src/mame/drivers/zaccaria.c
+++ b/src/mame/drivers/zaccaria.c
@@ -75,7 +75,7 @@ READ8_MEMBER(zaccaria_state::zaccaria_dsw_r)
{
static const char *const dswnames[] = { "IN0", "DSW0", "DSW1" };
- return input_port_read(machine(), dswnames[m_dsw]);
+ return ioport(dswnames[m_dsw])->read();
}
@@ -228,7 +228,7 @@ READ8_MEMBER(zaccaria_state::zaccaria_prot2_r)
switch (offset)
{
case 0:
- return input_port_read(machine(), "COINS"); /* bits 4 and 5 must be 0 in Jack Rabbit */
+ return ioport("COINS")->read(); /* bits 4 and 5 must be 0 in Jack Rabbit */
case 2:
return 0x10; /* Jack Rabbit */
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index cde65077253..242b6f52835 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -356,7 +356,7 @@ CUSTOM_INPUT_MEMBER(zaxxon_state::razmataz_dial_r)
int num = (FPTR)param;
int delta, res;
- delta = input_port_read(machine(), dialname[num]);
+ delta = ioport(dialname[num])->read();
if (delta < 0x80)
{
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 7b90b241801..d937d85d28f 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -342,7 +342,7 @@ static void sio_dip_handler( running_machine &machine, int n_data )
{
if( state->m_b_lastclock )
{
- int bit = ( ( input_port_read(machine, "DSW") >> state->m_n_dip_bit ) & 1 );
+ int bit = ( ( state->ioport("DSW")->read() >> state->m_n_dip_bit ) & 1 );
verboselog( machine, 2, "read dip %02x -> %02x\n", n_data, bit * PSX_SIO_IN_DATA );
psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
state->m_n_dip_bit++;
@@ -2094,13 +2094,13 @@ void jdredd_vblank(zn_state *state, screen_device &screen, bool vblank_state)
if( state->m_jdredd_gun_mux == 0 )
{
- x = input_port_read(state->machine(), "GUN1X");
- y = input_port_read(state->machine(), "GUN1Y");
+ x = state->machine().root_device().ioport("GUN1X")->read();
+ y = state->machine().root_device().ioport("GUN1Y")->read();
}
else
{
- x = input_port_read(state->machine(), "GUN2X");
- y = input_port_read(state->machine(), "GUN2Y");
+ x = state->machine().root_device().ioport("GUN2X")->read();
+ y = state->machine().root_device().ioport("GUN2Y")->read();
}
if( x > 0x393 && x < 0xcb2 &&
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index a090e5876ca..96a755b00d2 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -295,7 +295,7 @@ READ8_MEMBER(zr107_state::sysreg_r)
case 2: /* I/O port 2 */
case 3: /* System Port 0 */
case 4: /* System Port 1 */
- r = input_port_read(machine(), portnames[offset]);
+ r = ioport(portnames[offset])->read();
break;
case 5: /* Parallel data port */
@@ -331,7 +331,7 @@ WRITE8_MEMBER(zr107_state::sysreg_w)
0x02 = EEPCLK
0x01 = EEPDI
*/
- input_port_write(machine(), "EEPROMOUT", data & 0x07, 0xff);
+ ioport("EEPROMOUT")->write(data & 0x07, 0xff);
cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
mame_printf_debug("System register 0 = %02X\n", data);
break;
@@ -352,7 +352,7 @@ WRITE8_MEMBER(zr107_state::sysreg_w)
if (data & 0x40) /* CG Board 0 IRQ Ack */
cputag_set_input_line(machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
set_cgboard_id((data >> 4) & 3);
- input_port_write(machine(), "OUT4", data, 0xff);
+ ioport("OUT4")->write(data, 0xff);
mame_printf_debug("System register 1 = %02X\n", data);
break;
@@ -647,11 +647,11 @@ static double adc0838_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)(5 * input_port_read(device->machine(), "ANALOG1")) / 255.0;
+ return (double)(5 * device->machine().root_device().ioport("ANALOG1")->read()) / 255.0;
case ADC083X_CH1:
- return (double)(5 * input_port_read(device->machine(), "ANALOG2")) / 255.0;
+ return (double)(5 * device->machine().root_device().ioport("ANALOG2")->read()) / 255.0;
case ADC083X_CH2:
- return (double)(5 * input_port_read(device->machine(), "ANALOG3")) / 255.0;
+ return (double)(5 * device->machine().root_device().ioport("ANALOG3")->read()) / 255.0;
case ADC083X_CH3:
return 0;
case ADC083X_COM:
@@ -838,7 +838,7 @@ static void init_zr107(running_machine &machine)
state->m_led_reg0 = state->m_led_reg1 = 0x7f;
state->m_ccu_vcth = state->m_ccu_vctl = 0;
- K001005_preprocess_texture_data(machine.root_device().memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 0);
+ K001005_preprocess_texture_data(state->memregion("gfx1")->base(), state->memregion("gfx1")->bytes(), 0);
}
static DRIVER_INIT(zr107)
diff --git a/src/mame/includes/galpnipt.h b/src/mame/includes/galpnipt.h
index fb153210ca4..f0874e9b672 100644
--- a/src/mame/includes/galpnipt.h
+++ b/src/mame/includes/galpnipt.h
@@ -101,17 +101,17 @@
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")\
PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) )\
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) )\
- PORT_DIPSETTING( 0x0010, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
- PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
+ PORT_DIPSETTING( 0x0010, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
+ PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")\
PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) )\
PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) )\
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)
#define COINAGE_TEST_LOC\
PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW1:1" )\
@@ -125,17 +125,17 @@
PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")\
PORT_DIPSETTING( 0x0020, DEF_STR( 2C_1C ) )\
PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) )\
- PORT_DIPSETTING( 0x0010, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
- PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
+ PORT_DIPSETTING( 0x0010, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
+ PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")\
PORT_DIPSETTING( 0x0080, DEF_STR( 2C_1C ) )\
PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) )\
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)\
- PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0000)\
- PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,PORTCOND_EQUALS,0x0008)
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)\
+ PORT_DIPSETTING( 0x0040, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0000)\
+ PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1",0x0008,EQUALS,0x0008)
#define DIFFICULTY_DEMO_SOUNDS\
diff --git a/src/mame/includes/iremipt.h b/src/mame/includes/iremipt.h
index 45274441b06..b0d04e0904b 100644
--- a/src/mame/includes/iremipt.h
+++ b/src/mame/includes/iremipt.h
@@ -94,24 +94,24 @@
/* Mode 2 Coinage */
#define IREM_COIN_MODE_2_OLD_LOC(DIPBANK) \
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) \
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) \
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) \
PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \
PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) \
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) )
#define IREM_COIN_MODE_2_DSW1_LOC(DIPBANK) \
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6") \
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) \
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW2", 0x04, EQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":7,8") \
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) \
PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \
PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) \
@@ -122,24 +122,24 @@
/* to make the definitions a bit more general. However, these are enough to cover */
/* all the currently emulated games */
#define IREM_COIN_MODE_2 \
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW2:5,6") \
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00) PORT_DIPLOCATION("SW2:5,6") \
PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) \
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) \
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) \
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW1", 0x04, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW2:7,8") \
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW1", 0x04, EQUALS, 0x00) PORT_DIPLOCATION("SW2:7,8") \
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) \
PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) \
PORT_DIPSETTING( 0x40, DEF_STR( 1C_5C ) ) \
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) )
#define IREM_COIN_MODE_2_HIGH \
- PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6") \
+ PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0800, EQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6") \
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) \
PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) \
PORT_DIPSETTING( 0x3000, DEF_STR( 1C_1C ) ) \
- PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_EQUALS, 0x0000) PORT_DIPLOCATION("SW2:7,8") \
+ PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0800, EQUALS, 0x0000) PORT_DIPLOCATION("SW2:7,8") \
PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) \
PORT_DIPSETTING( 0x8000, DEF_STR( 1C_3C ) ) \
PORT_DIPSETTING( 0x4000, DEF_STR( 1C_5C ) ) \
@@ -150,7 +150,7 @@
#define IREM_Z80_COINAGE_TYPE_1_LOC(DIPBANK) \
/* Coin Mode 1 */ \
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
/* PORT_DIPSETTING( 0x80, DEF_STR( 1C_1C ) ) */ \
PORT_DIPSETTING( 0x90, DEF_STR( 7C_1C ) ) \
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) \
@@ -172,7 +172,7 @@
#define IREM_Z80_COINAGE_TYPE_2_LOC(DIPBANK) \
/* Coin Mode 1 */ \
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
/* PORT_DIPSETTING( 0x80, DEF_STR( Free_Play ) ) */ \
/* PORT_DIPSETTING( 0x90, DEF_STR( Free_Play ) ) */ \
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) \
@@ -194,7 +194,7 @@
#define IREM_Z80_COINAGE_TYPE_3_LOC(DIPBANK) \
/* Coin Mode 1 */ \
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
PORT_DIPSETTING( 0x90, DEF_STR( 7C_1C ) ) \
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) \
PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) \
@@ -216,7 +216,7 @@
#define IREM_Z80_COINAGE_TYPE_4_LOC(DIPBANK) \
/* Coin Mode 1 */ \
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) \
PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0xc0, DEF_STR( 4C_1C ) ) \
@@ -238,7 +238,7 @@
#define IREM_Z80_COINAGE_TYPE_5_LOC(DIPBANK) \
/* Coin Mode 1 */ \
- PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, PORTCOND_NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
+ PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_CONDITION("DSW2", 0x04, NOTEQUALS, 0x00) PORT_DIPLOCATION(#DIPBANK":5,6,7,8") \
PORT_DIPSETTING( 0x00, DEF_STR( 8C_1C ) ) \
PORT_DIPSETTING( 0xa0, DEF_STR( 6C_1C ) ) \
PORT_DIPSETTING( 0xb0, DEF_STR( 5C_1C ) ) \
@@ -281,7 +281,7 @@
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
#define IREM_COIN_MODE_1_NEW_HIGH \
- PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, PORTCOND_NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8") \
+ PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0800, NOTEQUALS, 0x0000) PORT_DIPLOCATION("SW2:5,6,7,8") \
PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) \
PORT_DIPSETTING( 0xb000, DEF_STR( 5C_1C ) ) \
PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) \
diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h
index 2b3b58e99be..b77453ae4ed 100644
--- a/src/mame/includes/lordgun.h
+++ b/src/mame/includes/lordgun.h
@@ -55,7 +55,7 @@ public:
/*----------- defined in video/lordgun.c -----------*/
-float lordgun_crosshair_mapper(const input_field_config *field, float linear_value);
+float lordgun_crosshair_mapper(const ioport_field *field, float linear_value);
void lordgun_update_gun(running_machine &machine, int i);
VIDEO_START( lordgun );
diff --git a/src/mame/includes/toaplipt.h b/src/mame/includes/toaplipt.h
index 6306f67646e..ee1d3f72247 100644
--- a/src/mame/includes/toaplipt.h
+++ b/src/mame/includes/toaplipt.h
@@ -91,22 +91,22 @@
#define TOAPLAN_COINAGE_DUAL_LOC(DIP, MASK, WORLD, DIPBANK) \
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION(#DIPBANK":!5,!6") \
- PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \
- PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION(#DIPBANK":!7,!8") \
- PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD)
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD)
/* without location */
#define TOAPLAN_COINAGE_JAPAN_COIN_A \
@@ -147,22 +147,22 @@
#define TOAPLAN_COINAGE_DUAL(DIP, MASK, WORLD) \
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) ) \
- PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) \
- PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x30, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \
- PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_NOTEQUALS,WORLD) \
- PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD) \
- PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,PORTCOND_EQUALS,WORLD)
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0xc0, DEF_STR( 2C_3C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,NOTEQUALS,WORLD) \
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD) \
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_6C ) ) PORT_CONDITION(#DIP,MASK,EQUALS,WORLD)
/************************** Difficulty Dip Switches ***************************/
diff --git a/src/mame/machine/acitya.c b/src/mame/machine/acitya.c
index 5b0e08c6904..5866e5ab03e 100644
--- a/src/mame/machine/acitya.c
+++ b/src/mame/machine/acitya.c
@@ -184,7 +184,7 @@ READ8_HANDLER( acitya_decrypt_rom )
MACHINE_START( acitya )
{
pacman_state *state = machine.driver_data<pacman_state>();
- UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *RAM = state->memregion("maincpu")->base();
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index 78a49b2ac9d..4feca2d2326 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -115,14 +115,14 @@ READ8_MEMBER(ajax_state::ajax_ls138_f10_r)
data = machine().rand();
break;
case 0x04: /* 2P inputs */
- data = input_port_read(machine(), "P2");
+ data = ioport("P2")->read();
break;
case 0x06: /* 1P inputs + DIPSW #1 & #2 */
index = offset & 0x01;
- data = input_port_read(machine(), (offset & 0x02) ? portnames[2 + index] : portnames[index]);
+ data = ioport((offset & 0x02) ? portnames[2 + index] : portnames[index])->read();
break;
case 0x07: /* DIPSW #3 */
- data = input_port_read(machine(), "DSW3");
+ data = ioport("DSW3")->read();
break;
default:
@@ -197,7 +197,7 @@ WRITE8_MEMBER(ajax_state::ajax_bankswitch_2_w)
MACHINE_START( ajax )
{
ajax_state *state = machine.driver_data<ajax_state>();
- UINT8 *MAIN = machine.root_device().memregion("maincpu")->base();
+ UINT8 *MAIN = state->memregion("maincpu")->base();
UINT8 *SUB = state->memregion("sub")->base();
state->membank("bank1")->configure_entries(0, 9, &SUB[0x10000], 0x2000);
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c
index d7f0bf94497..88695b4578f 100644
--- a/src/mame/machine/amiga.c
+++ b/src/mame/machine/amiga.c
@@ -419,7 +419,7 @@ static TIMER_CALLBACK( amiga_irq_proc )
CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert )
{
- UINT8 bits = input_port_read(machine(), (const char *)param);
+ UINT8 bits = ioport((const char *)param)->read();
int up = (bits >> 0) & 1;
int down = (bits >> 1) & 1;
int left = (bits >> 2) & 1;
@@ -1180,21 +1180,21 @@ READ16_HANDLER( amiga_custom_r )
case REG_JOY0DAT:
if (state->m_intf->joy0dat_r != NULL)
return (*state->m_intf->joy0dat_r)(space->machine());
- return input_port_read_safe(space->machine(), "JOY0DAT", 0xffff);
+ return state->ioport("JOY0DAT")->read_safe(0xffff);
case REG_JOY1DAT:
if (state->m_intf->joy1dat_r != NULL)
return (*state->m_intf->joy1dat_r)(space->machine());
- return input_port_read_safe(space->machine(), "JOY1DAT", 0xffff);
+ return state->ioport("JOY1DAT")->read_safe(0xffff);
case REG_POTGOR:
- return input_port_read_safe(space->machine(), "POTGO", 0x5500);
+ return state->ioport("POTGO")->read_safe(0x5500);
case REG_POT0DAT:
- return input_port_read_safe(space->machine(), "POT0DAT", 0x0000);
+ return state->ioport("POT0DAT")->read_safe(0x0000);
case REG_POT1DAT:
- return input_port_read_safe(space->machine(), "POT1DAT", 0x0000);
+ return state->ioport("POT1DAT")->read_safe(0x0000);
case REG_DSKBYTR:
return space->machine().device<amiga_fdc>("fdc")->dskbytr_r();
diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c
index a7f4fce58a1..f82732e3334 100644
--- a/src/mame/machine/arkanoid.c
+++ b/src/mame/machine/arkanoid.c
@@ -116,7 +116,7 @@ CUSTOM_INPUT_MEMBER(arkanoid_state::arkanoid_input_mux)
{
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(machine(), (m_paddle_select == 0) ? tag1 : tag2);
+ return ioport((m_paddle_select == 0) ? tag1 : tag2)->read();
}
/*
@@ -575,7 +575,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_d008_r)
{
UINT8 arkanoid_bootleg_d008_bit[8];
UINT8 arkanoid_bootleg_d008_val;
- UINT8 arkanoid_paddle_value = input_port_read(machine(), "MUX");
+ UINT8 arkanoid_paddle_value = ioport("MUX")->read();
int b;
arkanoid_bootleg_d008_bit[4] = arkanoid_bootleg_d008_bit[6] = arkanoid_bootleg_d008_bit[7] = 0; /* untested bits */
diff --git a/src/mame/machine/asteroid.c b/src/mame/machine/asteroid.c
index 54d01bde0b9..0e0f12a55a8 100644
--- a/src/mame/machine/asteroid.c
+++ b/src/mame/machine/asteroid.c
@@ -16,27 +16,27 @@
INTERRUPT_GEN( asteroid_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (!(input_port_read(device->machine(), "IN0") & 0x80))
+ if (!(device->machine().root_device().ioport("IN0")->read() & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( asterock_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if ((input_port_read(device->machine(), "IN0") & 0x80))
+ if ((device->machine().root_device().ioport("IN0")->read() & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( llander_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (input_port_read(device->machine(), "IN0") & 0x02)
+ if (device->machine().root_device().ioport("IN0")->read() & 0x02)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
READ8_MEMBER(asteroid_state::asteroid_IN0_r)
{
- int res = input_port_read(machine(), "IN0");
+ int res = ioport("IN0")->read();
int bitmask = (1 << offset);
if (res & bitmask)
@@ -50,7 +50,7 @@ READ8_MEMBER(asteroid_state::asteroid_IN0_r)
READ8_MEMBER(asteroid_state::asterock_IN0_r)
{
- int res = input_port_read(machine(), "IN0");
+ int res = ioport("IN0")->read();
int bitmask = (1 << offset);
if (res & bitmask)
@@ -68,7 +68,7 @@ READ8_MEMBER(asteroid_state::asterock_IN0_r)
READ8_MEMBER(asteroid_state::asteroid_IN1_r)
{
- int res = input_port_read(machine(), "IN1");
+ int res = ioport("IN1")->read();
int bitmask = (1 << (offset & 0x7));
if (res & bitmask)
@@ -85,7 +85,7 @@ READ8_MEMBER(asteroid_state::asteroid_DSW1_r)
int res;
int res1;
- res1 = input_port_read(machine(), "DSW1");
+ res1 = ioport("DSW1")->read();
res = 0xfc | ((res1 >> (2 * (3 - (offset & 0x3)))) & 0x3);
return res;
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index a59855b1fef..654e0d23c2d 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -64,12 +64,12 @@ void atari_interrupt_cb(device_t *device, int mask)
READ8_DEVICE_HANDLER(atari_pia_pa_r)
{
- return input_port_read_safe(device->machine(), "djoy_0_1", 0);
+ return device->machine().root_device().ioport("djoy_0_1")->read_safe(0);
}
READ8_DEVICE_HANDLER(atari_pia_pb_r)
{
- return input_port_read_safe(device->machine(), "djoy_2_3", 0);
+ return device->machine().root_device().ioport("djoy_2_3")->read_safe(0);
}
WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(device->machine(), data); }
@@ -169,7 +169,7 @@ void a800_handle_keyboard(running_machine &machine)
/* check keyboard */
for( i = 0; i < 8; i++ )
{
- ipt = input_port_read_safe(machine, tag[i], 0);
+ ipt = machine.root_device().ioport(tag[i])->read_safe(0);
if( ipt )
{
@@ -183,11 +183,11 @@ void a800_handle_keyboard(running_machine &machine)
atari_code = i*8 + count;
/* SHIFT */
- if(input_port_read_safe(machine, "fake", 0) & 0x01)
+ if(machine.root_device().ioport("fake")->read_safe(0) & 0x01)
atari_code |= 0x40;
/* CTRL */
- if(input_port_read_safe(machine, "fake", 0) & 0x02)
+ if(machine.root_device().ioport("fake")->read_safe(0) & 0x02)
atari_code |= 0x80;
if( atari_code != AKEY_NONE )
@@ -251,7 +251,7 @@ void a5200_handle_keypads(running_machine &machine)
/* check keypad */
for( i = 0; i < 4; i++ )
{
- ipt = input_port_read_safe(machine, tag[i], 0);
+ ipt = machine.root_device().ioport(tag[i])->read_safe(0);
if( ipt )
{
@@ -281,7 +281,7 @@ void a5200_handle_keypads(running_machine &machine)
}
/* check top button */
- if ((input_port_read(machine, "djoy_b") & 0x10) == 0)
+ if ((machine.root_device().ioport("djoy_b")->read() & 0x10) == 0)
{
if (atari_last == 0xfe)
return;
@@ -316,7 +316,7 @@ static void pokey_reset(running_machine &machine)
static UINT8 console_read(address_space *space)
{
- return input_port_read(space->machine(), "console");
+ return space->machine().root_device().ioport("console")->read();
}
diff --git a/src/mame/machine/atarifb.c b/src/mame/machine/atarifb.c
index 6b9d913fa2c..658f34357e9 100644
--- a/src/mame/machine/atarifb.c
+++ b/src/mame/machine/atarifb.c
@@ -154,7 +154,7 @@ READ8_MEMBER(atarifb_state::atarifb_in0_r)
(m_sign_x_2 >> 6) |
(m_sign_y_1 >> 5) |
(m_sign_x_1 >> 4) |
- input_port_read(machine(), "IN0");
+ ioport("IN0")->read();
return val;
}
else
@@ -162,14 +162,14 @@ READ8_MEMBER(atarifb_state::atarifb_in0_r)
int new_x, new_y;
/* Read player 1 trackball */
- new_x = input_port_read(machine(), "IN3");
+ new_x = ioport("IN3")->read();
if (new_x != m_counter_x_in0)
{
m_sign_x_1 = (new_x - m_counter_x_in0) & 0x80;
m_counter_x_in0 = new_x;
}
- new_y = input_port_read(machine(), "IN2");
+ new_y = ioport("IN2")->read();
if (new_y != m_counter_y_in0)
{
m_sign_y_1 = (new_y - m_counter_y_in0) & 0x80;
@@ -186,21 +186,21 @@ READ8_MEMBER(atarifb_state::atarifb_in2_r)
if ((m_CTRLD & 0x20) == 0x00)
{
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
else
{
int new_x, new_y;
/* Read player 2 trackball */
- new_x = input_port_read(machine(), "IN5");
+ new_x = ioport("IN5")->read();
if (new_x != m_counter_x_in2)
{
m_sign_x_2 = (new_x - m_counter_x_in2) & 0x80;
m_counter_x_in2 = new_x;
}
- new_y = input_port_read(machine(), "IN4");
+ new_y = ioport("IN4")->read();
if (new_y != m_counter_y_in2)
{
m_sign_y_2 = (new_y - m_counter_y_in2) & 0x80;
@@ -235,14 +235,14 @@ READ8_MEMBER(atarifb_state::atarifb4_in0_r)
int new_x, new_y;
/* Read player 1 trackball */
- new_x = input_port_read(machine(), "IN3");
+ new_x = ioport("IN3")->read();
if (new_x != m_counter_x_in0)
{
m_sign_x_1 = (new_x - m_counter_x_in0) & 0x80;
m_counter_x_in0 = new_x;
}
- new_y = input_port_read(machine(), "IN2");
+ new_y = ioport("IN2")->read();
if (new_y != m_counter_y_in0)
{
m_sign_y_1 = (new_y - m_counter_y_in0) & 0x80;
@@ -257,14 +257,14 @@ READ8_MEMBER(atarifb_state::atarifb4_in0_r)
int new_x, new_y;
/* Read player 2 trackball */
- new_x = input_port_read(machine(), "IN5");
+ new_x = ioport("IN5")->read();
if (new_x != m_counter_x_in0b)
{
m_sign_x_2 = (new_x - m_counter_x_in0b) & 0x80;
m_counter_x_in0b = new_x;
}
- new_y = input_port_read(machine(), "IN4");
+ new_y = ioport("IN4")->read();
if (new_y != m_counter_y_in0b)
{
m_sign_y_2 = (new_y - m_counter_y_in0b) & 0x80;
@@ -283,7 +283,7 @@ READ8_MEMBER(atarifb_state::atarifb4_in2_r)
if ((m_CTRLD & 0x40) == 0x00)
{
- return input_port_read(machine(), "IN1");
+ return ioport("IN1")->read();
}
else if ((m_CTRLD & 0x60) == 0x60)
/* LD1 and LD2 both high, return Team 2 right player (player 3) */
@@ -291,14 +291,14 @@ READ8_MEMBER(atarifb_state::atarifb4_in2_r)
int new_x, new_y;
/* Read player 3 trackball */
- new_x = input_port_read(machine(), "IN7");
+ new_x = ioport("IN7")->read();
if (new_x != m_counter_x_in2)
{
m_sign_x_3 = (new_x - m_counter_x_in2) & 0x80;
m_counter_x_in2 = new_x;
}
- new_y = input_port_read(machine(), "IN6");
+ new_y = ioport("IN6")->read();
if (new_y != m_counter_y_in2)
{
m_sign_y_3 = (new_y - m_counter_y_in2) & 0x80;
@@ -313,14 +313,14 @@ READ8_MEMBER(atarifb_state::atarifb4_in2_r)
int new_x, new_y;
/* Read player 4 trackball */
- new_x = input_port_read(machine(), "IN9");
+ new_x = ioport("IN9")->read();
if (new_x != m_counter_x_in2b)
{
m_sign_x_4 = (new_x - m_counter_x_in2b) & 0x80;
m_counter_x_in2b = new_x;
}
- new_y = input_port_read(machine(), "IN8");
+ new_y = ioport("IN8")->read();
if (new_y != m_counter_y_in2b)
{
m_sign_y_4 = (new_y - m_counter_y_in2b) & 0x80;
diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c
index 674da7cfa8d..566e3b22abd 100644
--- a/src/mame/machine/balsente.c
+++ b/src/mame/machine/balsente.c
@@ -62,8 +62,8 @@ TIMER_DEVICE_CALLBACK( balsente_interrupt_timer )
/* we latch the beam values on the first interrupt after VBLANK */
if (param == 64)
{
- state->m_shooter_x = input_port_read(timer.machine(), "FAKEX");
- state->m_shooter_y = input_port_read(timer.machine(), "FAKEY");
+ state->m_shooter_x = timer.machine().root_device().ioport("FAKEX")->read();
+ state->m_shooter_y = timer.machine().root_device().ioport("FAKEY")->read();
}
/* which bits get returned depends on which scanline we're at */
@@ -172,8 +172,8 @@ MACHINE_RESET( balsente )
memset(state->m_noise_position, 0, sizeof(state->m_noise_position));
/* point the banks to bank 0 */
- numbanks = (machine.root_device().memregion("maincpu")->bytes() > 0x40000) ? 16 : 8;
- state->membank("bank1")->configure_entries(0, numbanks, &machine.root_device().memregion("maincpu")->base()[0x10000], 0x6000);
+ numbanks = (state->memregion("maincpu")->bytes() > 0x40000) ? 16 : 8;
+ state->membank("bank1")->configure_entries(0, numbanks, &state->memregion("maincpu")->base()[0x10000], 0x6000);
state->membank("bank2")->configure_entries(0, numbanks, &state->memregion("maincpu")->base()[0x12000], 0x6000);
state->membank("bank1")->set_entry(0);
state->membank("bank2")->set_entry(0);
@@ -569,7 +569,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++)
- state->m_analog_input_data[i] = input_port_read(device->machine(), analog[i]);
+ state->m_analog_input_data[i] = device->machine().root_device().ioport(analog[i])->read();
}
@@ -1140,9 +1140,9 @@ static void update_grudge_steering(running_machine &machine)
INT8 diff[3];
/* read the current steering values */
- wheel[0] = input_port_read(machine, "AN0");
- wheel[1] = input_port_read(machine, "AN1");
- wheel[2] = input_port_read(machine, "AN2");
+ wheel[0] = state->ioport("AN0")->read();
+ wheel[1] = state->ioport("AN1")->read();
+ wheel[2] = state->ioport("AN2")->read();
/* diff the values */
diff[0] = wheel[0] - state->m_grudge_last_steering[0];
diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c
index e171413be59..5c2ff564dac 100644
--- a/src/mame/machine/beezer.c
+++ b/src/mame/machine/beezer.c
@@ -111,16 +111,16 @@ static WRITE8_DEVICE_HANDLER( b_via_0_pa_w )
switch (data & 0x03)
{
case 0:
- state->m_pbus = input_port_read(device->machine(), "IN0");
+ state->m_pbus = state->ioport("IN0")->read();
break;
case 1:
- state->m_pbus = input_port_read(device->machine(), "IN1") | (input_port_read(device->machine(), "IN2") << 4);
+ state->m_pbus = state->ioport("IN1")->read() | (state->ioport("IN2")->read() << 4);
break;
case 2:
- state->m_pbus = input_port_read(device->machine(), "DSWB");
+ state->m_pbus = state->ioport("DSWB")->read();
break;
case 3:
- state->m_pbus = input_port_read(device->machine(), "DSWA"); // Technically DSWA isn't populated on the board and is pulled to 0xFF with resistor pack, but there IS a DSWA port in the driver so we may as well use it.
+ state->m_pbus = state->ioport("DSWA")->read(); // Technically DSWA isn't populated on the board and is pulled to 0xFF with resistor pack, but there IS a DSWA port in the driver so we may as well use it.
break;
}
}
diff --git a/src/mame/machine/bonzeadv.c b/src/mame/machine/bonzeadv.c
index 8eeaf12bed5..7bd6b25067f 100644
--- a/src/mame/machine/bonzeadv.c
+++ b/src/mame/machine/bonzeadv.c
@@ -446,10 +446,10 @@ READ16_HANDLER( bonzeadv_cchip_ram_r )
{
switch (offset)
{
- case 0x03: return input_port_read(space->machine(), "800007"); /* STARTn + SERVICE1 */
- case 0x04: return input_port_read(space->machine(), "800009"); /* COINn */
- case 0x05: return input_port_read(space->machine(), "80000B"); /* Player controls + TILT */
- case 0x06: return input_port_read(space->machine(), "80000D"); /* Player controls (cocktail) */
+ case 0x03: return state->ioport("800007")->read(); /* STARTn + SERVICE1 */
+ case 0x04: return state->ioport("800009")->read(); /* COINn */
+ case 0x05: return state->ioport("80000B")->read(); /* Player controls + TILT */
+ case 0x06: return state->ioport("80000D")->read(); /* Player controls (cocktail) */
case 0x08: return state->m_cc_port;
}
diff --git a/src/mame/machine/bsktball.c b/src/mame/machine/bsktball.c
index 49d69ea11dc..418bbc893eb 100644
--- a/src/mame/machine/bsktball.c
+++ b/src/mame/machine/bsktball.c
@@ -58,10 +58,10 @@ READ8_MEMBER(bsktball_state::bsktball_in0_r)
int p2_vert;
int temp;
- p1_horiz = input_port_read(machine(), "TRACK0_X");
- p1_vert = input_port_read(machine(), "TRACK0_Y");
- p2_horiz = input_port_read(machine(), "TRACK1_X");
- p2_vert = input_port_read(machine(), "TRACK1_Y");
+ p1_horiz = ioport("TRACK0_X")->read();
+ p1_vert = ioport("TRACK0_Y")->read();
+ p2_horiz = ioport("TRACK1_X")->read();
+ p2_vert = ioport("TRACK1_Y")->read();
/* Set direction bits */
@@ -146,7 +146,7 @@ READ8_MEMBER(bsktball_state::bsktball_in0_r)
}
else
{
- temp = input_port_read(machine(), "IN0") & 0x0f;
+ temp = ioport("IN0")->read() & 0x0f;
return (temp | m_dir0 | m_dir1 | m_dir2 | m_dir3);
}
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index bb88a79e3dc..4b29df8e21c 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -185,7 +185,7 @@ READ8_MEMBER(bublbobl_state::bublbobl_mcu_port1_r)
{
//logerror("%04x: 6801U4 port 1 read\n", cpu_get_pc(&space.device()));
- m_port1_in = input_port_read(machine(), "IN0");
+ m_port1_in = ioport("IN0")->read();
return (m_port1_out & m_ddr1) | (m_port1_in & ~m_ddr1);
}
@@ -236,7 +236,7 @@ WRITE8_MEMBER(bublbobl_state::bublbobl_mcu_port2_w)
{
// read
if ((address & 0x0800) == 0x0000)
- m_port3_in = input_port_read(machine(), portnames[address & 3]);
+ m_port3_in = ioport(portnames[address & 3])->read();
else if ((address & 0x0c00) == 0x0c00)
m_port3_in = m_mcu_sharedram[address & 0x03ff];
// logerror("reading %02x from shared RAM %04x\n", m_port3_in, address);
@@ -448,7 +448,7 @@ WRITE8_MEMBER(bublbobl_state::bublbobl_68705_port_b_w)
if ((m_address & 0x0800) == 0x0000)
{
//logerror("%04x: 68705 read input port %02x\n", cpu_get_pc(&space.device()), m_address);
- m_latch = input_port_read(machine(), portnames[m_address & 3]);
+ m_latch = ioport(portnames[m_address & 3])->read();
}
else if ((m_address & 0x0c00) == 0x0c00)
{
diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c
index 2189b827542..9abaa444e71 100644
--- a/src/mame/machine/carpolo.c
+++ b/src/mame/machine/carpolo.c
@@ -217,7 +217,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
/* check the coins here as well - they drive the clock of the flip-flops */
- port_value = input_port_read(device->machine(), "IN0");
+ port_value = state->ioport("IN0")->read();
state->m_ttl7474_2s_1->clock_w((port_value & 0x01) >> 0);
state->m_ttl7474_2s_2->clock_w((port_value & 0x02) >> 1);
@@ -240,7 +240,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
case 3: movement_flip_flop = state->m_ttl7474_1a_1; dir_flip_flop = state->m_ttl7474_1a_2; break;
}
- port_value = input_port_read(device->machine(), portnames[player]);
+ port_value = device->machine().root_device().ioport(portnames[player])->read();
if (port_value != state->m_last_wheel_value[player])
{
@@ -258,7 +258,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
/* finally read the accelerator pedals */
- port_value = input_port_read(device->machine(), "PEDALS");
+ port_value = device->machine().root_device().ioport("PEDALS")->read();
for (player = 0; player < 4; player++)
{
@@ -422,7 +422,7 @@ static READ8_DEVICE_HANDLER( pia_1_port_a_r )
(state->m_ttl7474_1c_2->output_r() ? 0x02 : 0x00) |
(state->m_ttl7474_1d_2->output_r() ? 0x04 : 0x00) |
(state->m_ttl7474_1f_2->output_r() ? 0x08 : 0x00) |
- (input_port_read(device->machine(), "IN2") & 0xf0);
+ (state->ioport("IN2")->read() & 0xf0);
return ret;
}
diff --git a/src/mame/machine/cchip.c b/src/mame/machine/cchip.c
index 02d3cfdd309..7787e6465bf 100644
--- a/src/mame/machine/cchip.c
+++ b/src/mame/machine/cchip.c
@@ -117,9 +117,9 @@ READ16_HANDLER( cchip1_ram_r )
{
switch (offset)
{
- case 0x00: return input_port_read(space->machine(), "IN0"); /* Player 1 controls + START1 */
- case 0x01: return input_port_read(space->machine(), "IN1"); /* Player 2 controls + START2 */
- case 0x02: return input_port_read(space->machine(), "IN2"); /* COINn + SERVICE1 + TILT */
+ case 0x00: return space->machine().root_device().ioport("IN0")->read(); /* Player 1 controls + START1 */
+ case 0x01: return space->machine().root_device().ioport("IN1")->read(); /* Player 2 controls + START2 */
+ case 0x02: return space->machine().root_device().ioport("IN2")->read(); /* COINn + SERVICE1 + TILT */
case 0x03: return cc_port;
}
}
diff --git a/src/mame/machine/cdislave.c b/src/mame/machine/cdislave.c
index 6b38e550842..d7f83d9976e 100644
--- a/src/mame/machine/cdislave.c
+++ b/src/mame/machine/cdislave.c
@@ -79,9 +79,9 @@ void cdislave_device::prepare_readback(attotime delay, UINT8 channel, UINT8 coun
void cdislave_device::perform_mouse_update()
{
- UINT16 x = input_port_read(machine(), "MOUSEX");
- UINT16 y = input_port_read(machine(), "MOUSEY");
- UINT8 buttons = input_port_read(machine(), "MOUSEBTN");
+ UINT16 x = ioport("MOUSEX")->read();
+ UINT16 y = ioport("MOUSEY")->read();
+ UINT8 buttons = ioport("MOUSEBTN")->read();
UINT16 old_mouse_x = m_real_mouse_x;
UINT16 old_mouse_y = m_real_mouse_y;
diff --git a/src/mame/machine/dc-ctrl.c b/src/mame/machine/dc-ctrl.c
index e5f0ea3d174..610efd9eb9a 100644
--- a/src/mame/machine/dc-ctrl.c
+++ b/src/mame/machine/dc-ctrl.c
@@ -72,14 +72,14 @@ void dc_controller_device::fixed_status(UINT32 *dest)
{
dest[0] = 0x20000000; // Controller
dest[1] =
- (input_port_exists(machine(), port_tag[2]) ? 0x010000 : 0) |
- (input_port_exists(machine(), port_tag[3]) ? 0x020000 : 0) |
- (input_port_exists(machine(), port_tag[4]) ? 0x040000 : 0) |
- (input_port_exists(machine(), port_tag[5]) ? 0x080000 : 0) |
- (input_port_exists(machine(), port_tag[6]) ? 0x100000 : 0) |
- (input_port_exists(machine(), port_tag[7]) ? 0x200000 : 0) |
- (input_port_active_safe(machine(), port_tag[0], 0) << 8) |
- input_port_active_safe(machine(), port_tag[1], 0); // 1st function - controller
+ ((machine().root_device().ioport(port_tag[2]) != NULL) ? 0x010000 : 0) |
+ ((machine().root_device().ioport(port_tag[3]) != NULL) ? 0x020000 : 0) |
+ ((machine().root_device().ioport(port_tag[4]) != NULL) ? 0x040000 : 0) |
+ ((machine().root_device().ioport(port_tag[5]) != NULL) ? 0x080000 : 0) |
+ ((machine().root_device().ioport(port_tag[6]) != NULL) ? 0x100000 : 0) |
+ ((machine().root_device().ioport(port_tag[7]) != NULL) ? 0x200000 : 0) |
+ (machine().root_device().ioport(port_tag[0])->active_safe(0) << 8) |
+ machine().root_device().ioport(port_tag[1])->active_safe(0); // 1st function - controller
dest[2] = 0; // No 2nd function
dest[3] = 0; // No 3rd function
dest[4] = 0x00ff; // Every region, no expansion
@@ -97,14 +97,14 @@ void dc_controller_device::read(UINT32 *dest)
{
dest[0] = 0x21000000; // Controller
dest[1] =
- input_port_read_safe(machine(), port_tag[0], 0xff) |
- (input_port_read_safe(machine(), port_tag[1], 0xff) << 8) |
- (input_port_read_safe(machine(), port_tag[2], 0x00) << 16) |
- (input_port_read_safe(machine(), port_tag[3], 0x00) << 24);
+ ioport(port_tag[0])->read_safe(0xff) |
+ (ioport(port_tag[1])->read_safe(0xff) << 8) |
+ (ioport(port_tag[2])->read_safe(0x00) << 16) |
+ (ioport(port_tag[3])->read_safe(0x00) << 24);
dest[2] =
- input_port_read_safe(machine(), port_tag[4], 0x80) |
- (input_port_read_safe(machine(), port_tag[5], 0x80) << 8) |
- (input_port_read_safe(machine(), port_tag[6], 0x80) << 16) |
- (input_port_read_safe(machine(), port_tag[7], 0x80) << 24);
+ ioport(port_tag[4])->read_safe(0x80) |
+ (ioport(port_tag[5])->read_safe(0x80) << 8) |
+ (ioport(port_tag[6])->read_safe(0x80) << 16) |
+ (ioport(port_tag[7])->read_safe(0x80) << 24);
}
diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c
index 1f301951ea4..b47ef52bbf3 100644
--- a/src/mame/machine/dec0.c
+++ b/src/mame/machine/dec0.c
@@ -19,13 +19,13 @@ READ16_MEMBER(dec0_state::dec0_controls_r)
switch (offset<<1)
{
case 0: /* Player 1 & 2 joystick & buttons */
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 2: /* Credits, start buttons */
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 8: /* Intel 8751 mc, Bad Dudes & Heavy Barrel only */
//logerror("CPU #0 PC %06x: warning - read i8751 %06x - %04x\n", cpu_get_pc(&space.device()), 0x30c000+offset, m_i8751_return);
@@ -43,10 +43,10 @@ READ16_MEMBER(dec0_state::dec0_rotary_r)
switch (offset<<1)
{
case 0: /* Player 1 rotary */
- return ~(1 << input_port_read(machine(), "AN0"));
+ return ~(1 << ioport("AN0")->read());
case 8: /* Player 2 rotary */
- return ~(1 << input_port_read(machine(), "AN1"));
+ return ~(1 << ioport("AN1")->read());
default:
logerror("Unknown rotary read at 300000 %02x\n", offset);
@@ -62,19 +62,19 @@ READ16_MEMBER(dec0_state::midres_controls_r)
switch (offset<<1)
{
case 0: /* Player 1 Joystick + start, Player 2 Joystick + start */
- return input_port_read(machine(), "INPUTS");
+ return ioport("INPUTS")->read();
case 2: /* Dipswitches */
- return input_port_read(machine(), "DSW");
+ return ioport("DSW")->read();
case 4: /* Player 1 rotary */
- return ~(1 << input_port_read(machine(), "AN0"));
+ return ~(1 << ioport("AN0")->read());
case 6: /* Player 2 rotary */
- return ~(1 << input_port_read(machine(), "AN1"));
+ return ~(1 << ioport("AN1")->read());
case 8: /* Credits, start buttons */
- return input_port_read(machine(), "SYSTEM");
+ return ioport("SYSTEM")->read();
case 12:
return 0; /* ?? watchdog ?? */
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 98ae239fa31..8a618557588 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -152,10 +152,10 @@ WRITE8_HANDLER( decocass_quadrature_decoder_reset_w )
decocass_state *state = space->machine().driver_data<decocass_state>();
/* just latch the analog controls here */
- state->m_quadrature_decoder[0] = input_port_read(space->machine(), "AN0");
- state->m_quadrature_decoder[1] = input_port_read(space->machine(), "AN1");
- state->m_quadrature_decoder[2] = input_port_read(space->machine(), "AN2");
- state->m_quadrature_decoder[3] = input_port_read(space->machine(), "AN3");
+ state->m_quadrature_decoder[0] = state->ioport("AN0")->read();
+ state->m_quadrature_decoder[1] = state->ioport("AN1")->read();
+ state->m_quadrature_decoder[2] = state->ioport("AN2")->read();
+ state->m_quadrature_decoder[3] = state->ioport("AN3")->read();
}
WRITE8_HANDLER( decocass_adc_w )
@@ -181,7 +181,7 @@ READ8_HANDLER( decocass_input_r )
switch (offset & 7)
{
case 0: case 1: case 2:
- data = input_port_read(space->machine(), portnames[offset & 7]);
+ data = space->machine().root_device().ioport(portnames[offset & 7])->read();
break;
case 3: case 4: case 5: case 6:
data = state->m_quadrature_decoder[(offset & 7) - 3];
diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c
index 726f12db926..ce4837f676a 100644
--- a/src/mame/machine/decoprot.c
+++ b/src/mame/machine/decoprot.c
@@ -130,16 +130,16 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */
{
switch (offset<<1) {
case 0x110: /* Player input */
- return input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
case 0x36c: /* Coins */
case 0x334: /* Probably also, c6, 2c0, 2e0, 4b2, 46a, 4da, rohga is 44c */
- return input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x0dc:
- return input_port_read(space->machine(), "IN1")<<4;
+ return space->machine().root_device().ioport("IN1")->read()<<4;
case 0x494: /* Dips */
- return input_port_read(space->machine(), "DSW1_2");
+ return space->machine().root_device().ioport("DSW1_2")->read();
case 0x244:
return deco16_prot_ram[0];
@@ -364,9 +364,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 input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
case 0x6f8: /* written to 76 byte */
- return (input_port_read(space->machine(), "IN0")>>8)|(input_port_read(space->machine(), "IN0")<<8); /* byte swap IN0 */
+ return (space->machine().root_device().ioport("IN0")->read()>>8)|(space->machine().root_device().ioport("IN0")->read()<<8); /* byte swap IN0 */
case 0x5c: /* After coin insert, high 0x8000 bit set starts game */
return deco16_prot_ram[0x3b];
@@ -376,9 +376,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 input_port_read(space->machine(), "DSW");
+ return space->machine().root_device().ioport("DSW")->read();
case 0xc2:
- return input_port_read(space->machine(), "DSW") ^ deco16_prot_ram[0x2c/2];
+ return space->machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
case 0x5d4: /* The state of the dips last frame */
return deco16_prot_ram[0x34/2];
@@ -390,7 +390,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 input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x284: /* Bit shifting with inverted mask register */
return (((deco16_prot_ram[0x40/2]&0xfff0)>>0) | ((deco16_prot_ram[0x40/2]&0x0007)<<1) | ((deco16_prot_ram[0x40/2]&0x0008)>>3)) & (~deco16_prot_ram[0x36/2]);
@@ -404,7 +404,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 input_port_read(space->machine(), "IN0") ^ deco16_prot_ram[0x2c/2];
+ return space->machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
case 0x4b4:
return ((deco16_prot_ram[0x32/2]&0x00f0)<<8) | ((deco16_prot_ram[0x32/2]&0x000e)<<7) | ((deco16_prot_ram[0x32/2]&0x0001)<<11);
}
@@ -467,15 +467,15 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
switch (offset*2) {
case 0xac: /* Dip switches */
- return input_port_read(space->machine(), "DSW");
+ return space->machine().root_device().ioport("DSW")->read();
case 0xc2: /* Dip switches */
- return input_port_read(space->machine(), "DSW") ^ deco16_prot_ram[0x2c/2];
+ return space->machine().root_device().ioport("DSW")->read() ^ deco16_prot_ram[0x2c/2];
case 0x46: /* Coins */
- return input_port_read(space->machine(), "IN1") ^ deco16_prot_ram[0x2c/2];
+ return space->machine().root_device().ioport("IN1")->read() ^ deco16_prot_ram[0x2c/2];
case 0x50: /* Player 1 & 2 input ports */
- return input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
case 0x63c: /* Player 1 & 2 input ports */
- return input_port_read(space->machine(), "IN0") ^ deco16_prot_ram[0x2c/2];
+ return space->machine().root_device().ioport("IN0")->read() ^ deco16_prot_ram[0x2c/2];
case 0x5f4:
return deco16_prot_ram[0x18/2];
@@ -652,13 +652,13 @@ READ16_HANDLER( deco16_104_cninja_prot_r )
return deco16_prot_ram[15];
case 0x36: /* Dip switches */
- return input_port_read(space->machine(), "DSW");
+ return space->machine().root_device().ioport("DSW")->read();
case 0x1c8: /* Coins */
- return input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x22c: /* Player 1 & 2 input ports */
- return input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
}
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(&space->device()),offset);
@@ -750,15 +750,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 input_port_read(space->machine(), "INPUTS");
+ return space->machine().root_device().ioport("INPUTS")->read();
case 0x778 >> 1: /* Credits */
- return input_port_read(space->machine(), "SYSTEM");
+ return space->machine().root_device().ioport("SYSTEM")->read();
case 0x382 >> 1: /* DIPS */
- return input_port_read(space->machine(), "DSW");
+ return space->machine().root_device().ioport("DSW")->read();
}
if (cpu_get_pc(&space->device())!=0xc0ea)
- logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(&space->device()), offset<<1, input_port_read(space->machine(), "INPUTS"));
+ logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(&space->device()), offset<<1, space->machine().root_device().ioport("INPUTS")->read());
return 0;
}
@@ -868,13 +868,13 @@ READ16_HANDLER( deco16_104_rohga_prot_r )
switch (offset) {
case 0x88/2: /* Player 1 & 2 input ports */
- return input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
case 0x36c/2:
- return input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x44c/2:
- return ((input_port_read(space->machine(), "IN1") & 0x7)<<13)|((input_port_read(space->machine(), "IN1") & 0x8)<<9);
+ return ((space->machine().root_device().ioport("IN1")->read() & 0x7)<<13)|((space->machine().root_device().ioport("IN1")->read() & 0x8)<<9);
case 0x292/2: /* Dips */
- return input_port_read(space->machine(), "DSW1_2");
+ return space->machine().root_device().ioport("DSW1_2")->read();
case 0x44/2:
return ((((DECO_PORT(0x2c)&0x000f)<<12)) ^ deco16_xor) & (~deco16_mask);
@@ -1253,11 +1253,11 @@ static READ16_HANDLER( deco16_146_core_prot_r )
switch (offset)
{
case 0x582: /* Player 1 & Player 2 */
- return input_port_read(space->machine(), "IN0");
+ return space->machine().root_device().ioport("IN0")->read();
case 0x04c: /* Coins/VBL */
- return input_port_read(space->machine(), "IN1");
+ return space->machine().root_device().ioport("IN1")->read();
case 0x672: /* Dip switches */
- return input_port_read(space->machine(), "DSW1_2");
+ return space->machine().root_device().ioport("DSW1_2")->read();
case 0x13a:
return ((DECO_PORT(0x190)&0x00f0)<<8) | ((DECO_PORT(0x190)&0x0003)<<10) | ((DECO_PORT(0x190)&0x000c)<<6);
@@ -1315,8 +1315,8 @@ static READ16_HANDLER( deco16_146_core_prot_r )
/*********************************************************************************/
-// case 0x582: return input_port_read(space->machine(), "IN0"); /* IN0 */
-// case 0x672: return input_port_read(space->machine(), "IN1"); /* IN1 */
+// case 0x582: return space->machine().root_device().ioport("IN0")->read(); /* IN0 */
+// case 0x672: return space->machine().root_device().ioport("IN1")->read(); /* IN1 */
// case 0x04c: return space->machine().device<eeprom_device>("eeprom")->read_bit();
case 0x468:
@@ -1664,8 +1664,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 (input_port_read(space->machine(), "IN0")<<16) | 0xffff; /* IN0 */
- case 0x672: return (input_port_read(space->machine(), "IN1")<<16) | 0xffff; /* IN1 */
+ case 0x582: return (space->machine().root_device().ioport("IN0")->read()<<16) | 0xffff; /* IN0 */
+ case 0x672: return (space->machine().root_device().ioport("IN1")->read()<<16) | 0xffff; /* IN1 */
case 0x04c: return (space->machine().device<eeprom_device>("eeprom")->read_bit()<<16) | 0xffff;
}
@@ -1740,9 +1740,9 @@ READ16_HANDLER( dietgo_104_prot_r )
{
switch (offset * 2)
{
- case 0x298: return input_port_read(space->machine(), "IN0");
- case 0x342: return input_port_read(space->machine(), "IN1");
- case 0x506: return input_port_read(space->machine(), "DSW");
+ case 0x298: return space->machine().root_device().ioport("IN0")->read();
+ case 0x342: return space->machine().root_device().ioport("IN1")->read();
+ case 0x506: return space->machine().root_device().ioport("DSW")->read();
}
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(&space->device()), offset<<1);
@@ -1769,9 +1769,9 @@ READ16_HANDLER( deco16_104_pktgaldx_prot_r )
const UINT16* prot_ram=deco16_prot_ram;
switch (offset * 2)
{
- case 0x5b2: return input_port_read(space->machine(), "SYSTEM");
- case 0x44c: return input_port_read(space->machine(), "DSW");
- case 0x042: return input_port_read(space->machine(), "INPUTS");
+ case 0x5b2: return space->machine().root_device().ioport("SYSTEM")->read();
+ case 0x44c: return space->machine().root_device().ioport("DSW")->read();
+ case 0x042: return space->machine().root_device().ioport("INPUTS")->read();
case 0x510: return DECO_PORT(0);
case 0x51a: return DECO_PORT(2);
diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c
index 7f6a1e3eb29..cc014cf14f9 100644
--- a/src/mame/machine/gaelco2.c
+++ b/src/mame/machine/gaelco2.c
@@ -248,8 +248,8 @@ WRITE16_MEMBER(gaelco2_state::wrally2_adc_cs)
{
if (!(data & 0xff))
{
- m_analog_ports[0] = input_port_read_safe(machine(), "ANALOG0", 0);
- m_analog_ports[1] = input_port_read_safe(machine(), "ANALOG1", 0);
+ m_analog_ports[0] = ioport("ANALOG0")->read_safe(0);
+ m_analog_ports[1] = ioport("ANALOG1")->read_safe(0);
}
}
else
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index 612e2124083..bbfd87c811a 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -259,7 +259,7 @@ CUSTOM_INPUT_MEMBER(galaxold_state::_4in1_fake_port_r)
static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
int bit_mask = (FPTR)param;
- return (input_port_read(machine(), portnames[m__4in1_bank]) & bit_mask) ? 0x01 : 0x00;
+ return (ioport(portnames[m__4in1_bank])->read() & bit_mask) ? 0x01 : 0x00;
}
#ifdef UNUSED_FUNCTION
@@ -399,7 +399,7 @@ DRIVER_INIT( 4in1 )
{
galaxold_state *state = machine.driver_data<galaxold_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- offs_t i, len = machine.root_device().memregion("maincpu")->bytes();
+ offs_t i, len = state->memregion("maincpu")->bytes();
UINT8 *RAM = state->memregion("maincpu")->base();
/* Decrypt Program Roms */
diff --git a/src/mame/machine/gaplus.c b/src/mame/machine/gaplus.c
index 04e06169861..9e1daa24715 100644
--- a/src/mame/machine/gaplus.c
+++ b/src/mame/machine/gaplus.c
@@ -35,7 +35,7 @@ READ8_MEMBER(gaplus_state::gaplus_customio_3_r)
switch (offset)
{
case 0:
- return input_port_read(machine(), "IN2"); /* cabinet & test mode */
+ return ioport("IN2")->read(); /* cabinet & test mode */
case 1:
return (mode == 2) ? m_customio_3[offset] : 0x0f;
case 2:
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index a8a9551a956..a6dc380ecf6 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -59,7 +59,7 @@ MACHINE_START( harddriv )
atarigen_init(machine);
/* predetermine memory regions */
- state->m_sim_memory = (UINT16 *)machine.root_device().memregion("user1")->base();
+ state->m_sim_memory = (UINT16 *)state->memregion("user1")->base();
state->m_sim_memory_size = state->memregion("user1")->bytes() / 2;
state->m_adsp_pgm_memory_word = (UINT16 *)(reinterpret_cast<UINT8 *>(state->m_adsp_pgm_memory.target()) + 1);
}
@@ -238,7 +238,7 @@ READ16_HANDLER( hd68k_port0_r )
.....
0x8000 = SW1 #1
*/
- int temp = input_port_read(space->machine(), "IN0");
+ int temp = space->machine().root_device().ioport("IN0")->read();
if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0002;
temp ^= 0x0018; /* both EOCs always high for now */
return temp;
@@ -248,7 +248,7 @@ READ16_HANDLER( hd68k_port0_r )
READ16_HANDLER( hdc68k_port1_r )
{
harddriv_state *state = space->machine().driver_data<harddriv_state>();
- UINT16 result = input_port_read(space->machine(), "a80000");
+ UINT16 result = state->ioport("a80000")->read();
UINT16 diff = result ^ state->m_hdc68k_last_port1;
/* if a new shifter position is selected, use it */
@@ -277,7 +277,7 @@ READ16_HANDLER( hdc68k_port1_r )
READ16_HANDLER( hda68k_port1_r )
{
harddriv_state *state = space->machine().driver_data<harddriv_state>();
- UINT16 result = input_port_read(space->machine(), "a80000");
+ UINT16 result = state->ioport("a80000")->read();
/* merge in the wheel edge latch bit */
if (state->m_hdc68k_wheel_edge)
@@ -292,7 +292,7 @@ READ16_HANDLER( hdc68k_wheel_r )
harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* grab the new wheel value and upconvert to 12 bits */
- UINT16 new_wheel = input_port_read(space->machine(), "12BADC0") << 4;
+ UINT16 new_wheel = state->ioport("12BADC0")->read() << 4;
/* hack to display the wheel position */
if (space->machine().input().code_pressed(KEYCODE_LSHIFT))
@@ -350,14 +350,14 @@ WRITE16_HANDLER( hd68k_adc_control_w )
if (state->m_adc_control & 0x08)
{
state->m_adc8_select = state->m_adc_control & 0x07;
- state->m_adc8_data = input_port_read(space->machine(), adc8names[state->m_adc8_select]);
+ state->m_adc8_data = state->ioport(adc8names[state->m_adc8_select])->read();
}
/* handle a write to the 12-bit ADC address select */
if (state->m_adc_control & 0x40)
{
state->m_adc12_select = (state->m_adc_control >> 4) & 0x03;
- state->m_adc12_data = input_port_read(space->machine(), adc12names[state->m_adc12_select]) << 4;
+ state->m_adc12_data = space->machine().root_device().ioport(adc12names[state->m_adc12_select])->read() << 4;
}
/* bit 7 selects which byte of the 12 bit data to read */
diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c
index 8754b90c475..a7f6440b8ab 100644
--- a/src/mame/machine/irobot.c
+++ b/src/mame/machine/irobot.c
@@ -204,9 +204,9 @@ READ8_MEMBER(irobot_state::irobot_control_r)
{
if (m_control_num == 0)
- return input_port_read(machine(), "AN0");
+ return ioport("AN0")->read();
else if (m_control_num == 1)
- return input_port_read(machine(), "AN1");
+ return ioport("AN1")->read();
return 0;
}
diff --git a/src/mame/machine/jvs13551.c b/src/mame/machine/jvs13551.c
index ecfa61b9353..ae689c39911 100644
--- a/src/mame/machine/jvs13551.c
+++ b/src/mame/machine/jvs13551.c
@@ -120,9 +120,9 @@ bool sega_837_13551::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_
if(count_players > 2 || bytes_per_switch > 2)
return false;
- *buf++ = input_port_read_safe(machine(), port_tag[0], 0);
+ *buf++ = ioport(port_tag[0])->read_safe(0);
for(int i=0; i<count_players; i++) {
- UINT32 val = input_port_read_safe(machine(), port_tag[1+i], 0);
+ UINT32 val = ioport(port_tag[1+i])->read_safe(0);
for(int j=0; j<bytes_per_switch; j++)
*buf++ = val >> ((1-j) << 3);
}
@@ -135,7 +135,7 @@ bool sega_837_13551::analogs(UINT8 *&buf, UINT8 count)
if(count > 8)
return false;
for(int i=0; i<count; i++) {
- UINT16 val = input_port_read_safe(machine(), port_tag[3+i], 0x8000);
+ UINT16 val = ioport(port_tag[3+i])->read_safe(0x8000);
*buf++ = val >> 8;
*buf++ = val;
}
@@ -148,7 +148,7 @@ bool sega_837_13551::swoutputs(UINT8 count, const UINT8 *vals)
return false;
jvs_outputs = vals[0] & 0x3f;
logerror("837-13551: output %02x\n", jvs_outputs);
- input_port_write_safe(machine(), port_tag[11], jvs_outputs, 0x3f);
+ machine().root_device().ioport(port_tag[11])->write_safe(jvs_outputs, 0x3f);
return true;
}
diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c
index dda5d5c8a73..55c8e3f8fae 100644
--- a/src/mame/machine/kaneko16.c
+++ b/src/mame/machine/kaneko16.c
@@ -2059,7 +2059,7 @@ void calc3_mcu_run(running_machine &machine)
if ( calc3.mcu_status != (1|2|4|8) ) return;
- if (calc3.dsw_addr) space->write_byte(calc3.dsw_addr+0x200000, ( ~input_port_read(machine, "DSW1"))&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
+ if (calc3.dsw_addr) space->write_byte(calc3.dsw_addr+0x200000, ( ~state->ioport("DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
//calc3.mcu_status = 0;
@@ -2100,7 +2100,7 @@ void calc3_mcu_run(running_machine &machine)
printf("Calc 3 Init Command - %04x ROM Checksum Address\n", calc3.checksumaddress);
printf("Calc 3 Init Command - %08x Data Write Address\n", calc3.writeaddress);
#endif
- // space->write_byte(calc3.dsw_addr+0x200000, ( ~input_port_read(machine, "DSW1"))&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
+ // space->write_byte(calc3.dsw_addr+0x200000, ( ~state->ioport("DSW1")->read())&0xff); // // DSW // dsw actually updates in realtime - mcu reads+writes it every frame
state->m_mcu_ram[calc3.checksumaddress / 2] = calc3.mcu_crc; // MCU Rom Checksum!
@@ -2406,7 +2406,7 @@ void bloodwar_mcu_run(running_machine &machine)
case 0x03: // DSW
{
- kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
+ kaneko16_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW1")->read();
logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
@@ -2464,7 +2464,7 @@ void bonkadv_mcu_run(running_machine &machine)
case 0x03: // DSW
{
- kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
+ kaneko16_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW1")->read();
logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
@@ -2537,7 +2537,7 @@ void gtmr_mcu_run(running_machine &machine)
case 0x03: // DSW
{
- kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
+ kaneko16_mcu_ram[mcu_offset] = machine.root_device().ioport("DSW1")->read();
}
break;
diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c
index 594f67126dd..3651ba87af9 100644
--- a/src/mame/machine/leland.c
+++ b/src/mame/machine/leland.c
@@ -83,16 +83,16 @@ static int dial_compute_value(running_machine &machine, int new_val, int indx)
READ8_MEMBER(leland_state::cerberus_dial_1_r)
{
- int original = input_port_read(machine(), "IN0");
- int modified = dial_compute_value(machine(), input_port_read(machine(), "AN0"), 0);
+ int original = ioport("IN0")->read();
+ int modified = dial_compute_value(machine(), ioport("AN0")->read(), 0);
return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
}
READ8_MEMBER(leland_state::cerberus_dial_2_r)
{
- int original = input_port_read(machine(), "IN0");
- int modified = dial_compute_value(machine(), input_port_read(machine(), "AN1"), 1);
+ int original = ioport("IN0")->read();
+ int modified = dial_compute_value(machine(), ioport("AN1")->read(), 1);
return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
}
@@ -136,8 +136,8 @@ WRITE8_MEMBER(leland_state::alleymas_joystick_kludge)
static void update_dangerz_xy(running_machine &machine)
{
leland_state *state = machine.driver_data<leland_state>();
- UINT8 newy = input_port_read(machine, "AN0");
- UINT8 newx = input_port_read(machine, "AN1");
+ UINT8 newy = state->ioport("AN0")->read();
+ UINT8 newx = state->ioport("AN1")->read();
int deltay = newy - state->m_dial_last_input[0];
int deltax = newx - state->m_dial_last_input[1];
@@ -190,27 +190,27 @@ static const UINT8 redline_pedal_value[8] = { 0xf0, 0xe0, 0xc0, 0xd0, 0x90, 0xb0
READ8_MEMBER(leland_state::redline_pedal_1_r)
{
- int pedal = input_port_read(machine(), "IN0");
+ int pedal = ioport("IN0")->read();
return redline_pedal_value[pedal >> 5] | 0x0f;
}
READ8_MEMBER(leland_state::redline_pedal_2_r)
{
- int pedal = input_port_read(machine(), "IN2");
+ int pedal = ioport("IN2")->read();
return redline_pedal_value[pedal >> 5] | 0x0f;
}
READ8_MEMBER(leland_state::redline_wheel_1_r)
{
- return dial_compute_value(machine(), input_port_read(machine(), "AN0"), 0);
+ return dial_compute_value(machine(), ioport("AN0")->read(), 0);
}
READ8_MEMBER(leland_state::redline_wheel_2_r)
{
- return dial_compute_value(machine(), input_port_read(machine(), "AN1"), 1);
+ return dial_compute_value(machine(), ioport("AN1")->read(), 1);
}
@@ -223,19 +223,19 @@ READ8_MEMBER(leland_state::redline_wheel_2_r)
READ8_MEMBER(leland_state::offroad_wheel_1_r)
{
- return dial_compute_value(machine(), input_port_read(machine(), "AN3"), 0);
+ return dial_compute_value(machine(), ioport("AN3")->read(), 0);
}
READ8_MEMBER(leland_state::offroad_wheel_2_r)
{
- return dial_compute_value(machine(), input_port_read(machine(), "AN4"), 1);
+ return dial_compute_value(machine(), ioport("AN4")->read(), 1);
}
READ8_MEMBER(leland_state::offroad_wheel_3_r)
{
- return dial_compute_value(machine(), input_port_read(machine(), "AN5"), 2);
+ return dial_compute_value(machine(), ioport("AN5")->read(), 2);
}
@@ -250,7 +250,7 @@ READ8_MEMBER(leland_state::ataxx_trackball_r)
{
static const char *const tracknames[] = { "AN0", "AN1", "AN2", "AN3" };
- return dial_compute_value(machine(), input_port_read(machine(), tracknames[offset]), offset);
+ return dial_compute_value(machine(), ioport(tracknames[offset])->read(), offset);
}
@@ -265,7 +265,7 @@ READ8_MEMBER(leland_state::indyheat_wheel_r)
{
static const char *const tracknames[] = { "AN0", "AN1", "AN2" };
- return dial_compute_value(machine(), input_port_read(machine(), tracknames[offset]), offset);
+ return dial_compute_value(machine(), ioport(tracknames[offset])->read(), offset);
}
@@ -297,7 +297,7 @@ WRITE8_MEMBER(leland_state::indyheat_analog_w)
switch (offset)
{
case 3:
- m_analog_result = input_port_read(machine(), tracknames[data]);
+ m_analog_result = ioport(tracknames[data])->read();
break;
case 0:
@@ -354,12 +354,12 @@ MACHINE_RESET( leland )
state->m_alternate_bank = 0;
/* initialize the master banks */
- state->m_master_length = machine.root_device().memregion("master")->bytes();
- state->m_master_base = machine.root_device().memregion("master")->base();
+ state->m_master_length = state->memregion("master")->bytes();
+ state->m_master_base = state->memregion("master")->base();
(*state->m_update_master_bank)(machine);
/* initialize the slave banks */
- state->m_slave_length = machine.root_device().memregion("slave")->bytes();
+ state->m_slave_length = state->memregion("slave")->bytes();
state->m_slave_base = state->memregion("slave")->base();
if (state->m_slave_length > 0x10000)
state->membank("bank3")->set_base(&state->m_slave_base[0x10000]);
@@ -385,8 +385,8 @@ MACHINE_RESET( ataxx )
state->m_master_int_timer->adjust(machine.primary_screen->time_until_pos(8), 8);
/* initialize the XROM */
- state->m_xrom_length = machine.root_device().memregion("user1")->bytes();
- state->m_xrom_base = machine.root_device().memregion("user1")->base();
+ state->m_xrom_length = state->memregion("user1")->bytes();
+ state->m_xrom_base = state->memregion("user1")->base();
state->m_xrom1_addr = 0;
state->m_xrom2_addr = 0;
@@ -400,12 +400,12 @@ MACHINE_RESET( ataxx )
state->m_master_bank = 0;
/* initialize the master banks */
- state->m_master_length = machine.root_device().memregion("master")->bytes();
- state->m_master_base = machine.root_device().memregion("master")->base();
+ state->m_master_length = state->memregion("master")->bytes();
+ state->m_master_base = state->memregion("master")->base();
ataxx_bankswitch(machine);
/* initialize the slave banks */
- state->m_slave_length = machine.root_device().memregion("slave")->bytes();
+ state->m_slave_length = state->memregion("slave")->bytes();
state->m_slave_base = state->memregion("slave")->base();
if (state->m_slave_length > 0x10000)
state->membank("bank3")->set_base(&state->m_slave_base[0x10000]);
@@ -452,7 +452,7 @@ static TIMER_CALLBACK( ataxx_interrupt_callback )
INTERRUPT_GEN( leland_master_interrupt )
{
/* check for coins here */
- if ((input_port_read(device->machine(), "IN1") & 0x0e) != 0x0e)
+ if ((device->machine().root_device().ioport("IN1")->read() & 0x0e) != 0x0e)
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
}
@@ -824,7 +824,7 @@ void ataxx_init_eeprom(running_machine &machine, const UINT16 *data)
READ8_DEVICE_HANDLER( ataxx_eeprom_r )
{
- int port = input_port_read(device->machine(), "IN2");
+ int port = device->machine().root_device().ioport("IN2")->read();
if (LOG_EEPROM) logerror("%s:EE read\n", device->machine().describe_context());
return port;
}
@@ -1060,7 +1060,7 @@ WRITE8_MEMBER(leland_state::leland_master_analog_key_w)
break;
case 0x01: /* FE = analog port select/bankswitch */
- m_analog_result = input_port_read(machine(), portnames[data & 15]);
+ m_analog_result = ioport(portnames[data & 15])->read();
/* update top board banking for some games */
if (LOG_BANKSWITCHING_M)
@@ -1091,11 +1091,11 @@ READ8_MEMBER(leland_state::leland_master_input_r)
switch (offset)
{
case 0x00: /* /GIN0 */
- result = input_port_read(machine(), "IN0");
+ result = ioport("IN0")->read();
break;
case 0x01: /* /GIN1 */
- result = input_port_read(machine(), "IN1");
+ result = ioport("IN1")->read();
if (cpu_get_reg(machine().device("slave"), Z80_HALT))
result ^= 0x01;
break;
@@ -1111,11 +1111,11 @@ READ8_MEMBER(leland_state::leland_master_input_r)
break;
case 0x10: /* /GIN0 */
- result = input_port_read(machine(), "IN2");
+ result = ioport("IN2")->read();
break;
case 0x11: /* /GIN1 */
- result = input_port_read(machine(), "IN3");
+ result = ioport("IN3")->read();
if (LOG_EEPROM) logerror("%04X:EE read\n", cpu_get_pc(&space.device()));
break;
@@ -1173,11 +1173,11 @@ READ8_MEMBER(leland_state::ataxx_master_input_r)
switch (offset)
{
case 0x06: /* /GIN0 */
- result = input_port_read(machine(), "IN0");
+ result = ioport("IN0")->read();
break;
case 0x07: /* /SLVBLK */
- result = input_port_read(machine(), "IN1");
+ result = ioport("IN1")->read();
if (cpu_get_reg(machine().device("slave"), Z80_HALT))
result ^= 0x01;
break;
diff --git a/src/mame/machine/lsasquad.c b/src/mame/machine/lsasquad.c
index 8170e83878c..32e81324874 100644
--- a/src/mame/machine/lsasquad.c
+++ b/src/mame/machine/lsasquad.c
@@ -181,7 +181,7 @@ READ8_MEMBER(lsasquad_state::lsasquad_mcu_r)
READ8_MEMBER(lsasquad_state::lsasquad_mcu_status_r)
{
- int res = input_port_read(machine(), "MCU");
+ int res = ioport("MCU")->read();
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
/* bit 1 = when 0, mcu has sent data to the main cpu */
@@ -196,7 +196,7 @@ READ8_MEMBER(lsasquad_state::lsasquad_mcu_status_r)
READ8_MEMBER(lsasquad_state::daikaiju_mcu_status_r)
{
- int res = input_port_read(machine(), "MCU");
+ int res = ioport("MCU")->read();
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
/* bit 1 = when 0, mcu has sent data to the main cpu */
diff --git a/src/mame/machine/mcr68.c b/src/mame/machine/mcr68.c
index 81f22c400b0..e91ea9461c1 100644
--- a/src/mame/machine/mcr68.c
+++ b/src/mame/machine/mcr68.c
@@ -41,7 +41,7 @@ static TIMER_CALLBACK( counter_fired_callback );
static READ8_DEVICE_HANDLER( zwackery_port_1_r )
{
- UINT8 ret = input_port_read(device->machine(), "IN1");
+ UINT8 ret = device->machine().root_device().ioport("IN1")->read();
downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
@@ -51,7 +51,7 @@ static READ8_DEVICE_HANDLER( zwackery_port_1_r )
static READ8_DEVICE_HANDLER( zwackery_port_3_r )
{
- UINT8 ret = input_port_read(device->machine(), "IN3");
+ UINT8 ret = device->machine().root_device().ioport("IN3")->read();
downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c
index 6f023e875f5..eddbf1cb5f1 100644
--- a/src/mame/machine/megadriv.c
+++ b/src/mame/machine/megadriv.c
@@ -1788,14 +1788,14 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine &machine, int p
{
/* here we read B, C & the additional buttons */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x30) |
- (input_port_read_safe(machine, pad6names[portnum], 0) & 0x0f)) & ~helper);
+ (((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x30) |
+ (machine.root_device().ioport(pad6names[portnum])->read_safe(0) & 0x0f)) & ~helper);
}
else
{
/* here we read B, C & the directional buttons */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) & ~helper);
+ ((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x3f) & ~helper);
}
}
else
@@ -1804,20 +1804,20 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine &machine, int p
{
/* here we read ((Start & A) >> 2) | 0x00 */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- (((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) & ~helper);
+ (((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) & ~helper);
}
else if (io_stage[portnum]==2)
{
/* here we read ((Start & A) >> 2) | 0x0f */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) | 0x0f) & ~helper);
+ ((((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) | 0x0f) & ~helper);
}
else
{
/* here we read ((Start & A) >> 2) | Up and Down */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
- (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03)) & ~helper);
+ ((((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) |
+ (machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x03)) & ~helper);
}
}
@@ -1837,14 +1837,14 @@ static UINT8 megadrive_io_read_data_port_3button(running_machine &machine, int p
{
/* here we read B, C & the directional buttons */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) | 0x40) & ~helper);
+ (((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x3f) | 0x40) & ~helper);
}
else
{
/* here we read ((Start & A) >> 2) | Up and Down */
retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
- (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03) | 0x40) & ~helper);
+ ((((machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0xc0) >> 2) |
+ (machine.root_device().ioport(pad3names[portnum])->read_safe(0) & 0x03) | 0x40) & ~helper);
}
return retdata;
@@ -1858,18 +1858,18 @@ UINT8 megatech_bios_port_cc_dc_r(running_machine &machine, int offset, int ctrl)
if (ctrl == 0x55)
{
/* A keys */
- retdata = ((input_port_read(machine, "PAD1") & 0x40) >> 2) |
- ((input_port_read(machine, "PAD2") & 0x40) >> 4) | 0xeb;
+ retdata = ((machine.root_device().ioport("PAD1")->read() & 0x40) >> 2) |
+ ((machine.root_device().ioport("PAD2")->read() & 0x40) >> 4) | 0xeb;
}
else
{
if (offset == 0)
{
- retdata = (input_port_read(machine, "PAD1") & 0x3f) | ((input_port_read(machine, "PAD2") & 0x03) << 6);
+ retdata = (machine.root_device().ioport("PAD1")->read() & 0x3f) | ((machine.root_device().ioport("PAD2")->read() & 0x03) << 6);
}
else
{
- retdata = ((input_port_read(machine, "PAD2") & 0x3c) >> 2) | 0xf0;
+ retdata = ((machine.root_device().ioport("PAD2")->read() & 0x3c) >> 2) | 0xf0;
}
}
@@ -7133,7 +7133,7 @@ ADDRESS_MAP_END
/* emulate testmode plug */
static UINT8 megadrive_io_read_data_port_svp(running_machine &machine, int portnum)
{
- if (portnum == 0 && input_port_read_safe(machine, "MEMORY_TEST", 0x00))
+ if (portnum == 0 && machine.root_device().ioport("MEMORY_TEST")->read_safe(0x00))
{
return (megadrive_io_data_regs[0] & 0xc0);
}
@@ -9277,7 +9277,7 @@ MACHINE_RESET( megadriv )
/* default state of z80 = reset, with bus */
mame_printf_debug("Resetting Megadrive / Genesis\n");
- switch (input_port_read_safe(machine, "REGION", 0xff))
+ switch (machine.root_device().ioport("REGION")->read_safe(0xff))
{
case 1: // US
@@ -9414,7 +9414,7 @@ SCREEN_VBLANK(megadriv)
megadrive_imode_odd_frame^=1;
// cputag_set_input_line(machine, "genesis_snd_z80", 0, CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it..
- if (input_port_read_safe(screen.machine(), "RESET", 0x00) & 0x01)
+ if (screen.machine().root_device().ioport("RESET")->read_safe(0x00) & 0x01)
cputag_set_input_line(screen.machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
/*
diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c
index 207137fa37b..205a2b3451a 100644
--- a/src/mame/machine/mexico86.c
+++ b/src/mame/machine/mexico86.c
@@ -67,7 +67,7 @@ static void mcu_simulate( running_machine &machine )
int i;
int coin_curr;
- coin_curr = ~input_port_read(machine, "IN0") & 1;
+ coin_curr = ~machine.root_device().ioport("IN0")->read() & 1;
if (coin_curr && !state->m_coin_last && state->m_protection_ram[0x01] < 9)
{
state->m_protection_ram[0x01]++; // increase credits counter
@@ -77,8 +77,8 @@ static void mcu_simulate( running_machine &machine )
state->m_protection_ram[0x04] = 0x3c; // coin inputs
- state->m_protection_ram[0x02] = BITSWAP8(input_port_read(machine, "IN1"), 7,6,5,4,2,3,1,0); // player 1
- state->m_protection_ram[0x03] = BITSWAP8(input_port_read(machine, "IN2"), 7,6,5,4,2,3,1,0); // player 2
+ state->m_protection_ram[0x02] = BITSWAP8(machine.root_device().ioport("IN1")->read(), 7,6,5,4,2,3,1,0); // player 1
+ state->m_protection_ram[0x03] = BITSWAP8(machine.root_device().ioport("IN2")->read(), 7,6,5,4,2,3,1,0); // player 2
if (state->m_protection_ram[0x19] == 0xaa) // player 2 active
state->m_protection_ram[0x1b] = state->m_protection_ram[0x03];
@@ -293,7 +293,7 @@ WRITE8_MEMBER(mexico86_state::mexico86_68705_port_b_w)
else
{
//logerror("%04x: 68705 read input port %04x\n", cpu_get_pc(&space.device()), m_address);
- m_latch = input_port_read(machine(), (m_address & 1) ? "IN2" : "IN1");
+ m_latch = ioport((m_address & 1) ? "IN2" : "IN1")->read();
}
}
else /* write */
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index 618c6e518a9..d5d9b283e12 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -214,7 +214,7 @@ CUSTOM_INPUT_MEMBER(mhavoc_state::mhavoc_bit67_r)
{
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(machine(), m_player_1 ? tag2 : tag1) & 0x03;
+ return ioport(m_player_1 ? tag2 : tag1)->read() & 0x03;
}
CUSTOM_INPUT_MEMBER(mhavoc_state::gamma_rcvd_r)
diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c
index 1d29b7e2aa2..e7d6fd0a5ac 100644
--- a/src/mame/machine/micro3d.c
+++ b/src/mame/machine/micro3d.c
@@ -488,16 +488,16 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
READ16_MEMBER(micro3d_state::micro3d_encoder_h_r)
{
- UINT16 x_encoder = input_port_read_safe(machine(), "JOYSTICK_X", 0);
- UINT16 y_encoder = input_port_read_safe(machine(), "JOYSTICK_Y", 0);
+ UINT16 x_encoder = ioport("JOYSTICK_X")->read_safe(0);
+ UINT16 y_encoder = ioport("JOYSTICK_Y")->read_safe(0);
return (y_encoder & 0xf00) | ((x_encoder & 0xf00) >> 8);
}
READ16_MEMBER(micro3d_state::micro3d_encoder_l_r)
{
- UINT16 x_encoder = input_port_read_safe(machine(), "JOYSTICK_X", 0);
- UINT16 y_encoder = input_port_read_safe(machine(), "JOYSTICK_Y", 0);
+ UINT16 x_encoder = ioport("JOYSTICK_X")->read_safe(0);
+ UINT16 y_encoder = ioport("JOYSTICK_Y")->read_safe(0);
return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff);
}
@@ -508,9 +508,9 @@ static TIMER_CALLBACK( adc_done_callback )
switch (param)
{
- case 0: state->m_adc_val = input_port_read_safe(machine, "THROTTLE", 0);
+ case 0: state->m_adc_val = state->ioport("THROTTLE")->read_safe(0);
break;
- case 1: state->m_adc_val = (UINT8)((255.0/100.0) * input_port_read(machine, "VOLUME") + 0.5);
+ case 1: state->m_adc_val = (UINT8)((255.0/100.0) * state->ioport("VOLUME")->read() + 0.5);
break;
case 2: break;
case 3: break;
diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c
index df75e7b6e6e..a1aec861cf5 100644
--- a/src/mame/machine/midtunit.c
+++ b/src/mame/machine/midtunit.c
@@ -105,7 +105,7 @@ READ16_MEMBER(midtunit_state::midtunit_input_r)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW" };
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c
index 1e535e51345..a9289c2382f 100644
--- a/src/mame/machine/midwayic.c
+++ b/src/mame/machine/midwayic.c
@@ -862,7 +862,7 @@ READ32_HANDLER( midway_ioasic_r )
switch (offset)
{
case IOASIC_PORT0:
- result = input_port_read(space->machine(), "DIPS");
+ result = space->machine().root_device().ioport("DIPS")->read();
/* bit 0 seems to be a ready flag before shuffling happens */
if (!ioasic.shuffle_active)
{
@@ -874,15 +874,15 @@ READ32_HANDLER( midway_ioasic_r )
break;
case IOASIC_PORT1:
- result = input_port_read(space->machine(), "SYSTEM");
+ result = space->machine().root_device().ioport("SYSTEM")->read();
break;
case IOASIC_PORT2:
- result = input_port_read(space->machine(), "IN1");
+ result = space->machine().root_device().ioport("IN1")->read();
break;
case IOASIC_PORT3:
- result = input_port_read(space->machine(), "IN2");
+ result = space->machine().root_device().ioport("IN2")->read();
break;
case IOASIC_UARTIN:
diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c
index 0404308129f..09db75547d1 100644
--- a/src/mame/machine/midwunit.c
+++ b/src/mame/machine/midwunit.c
@@ -126,7 +126,7 @@ READ16_MEMBER(midwunit_state::midwunit_io_r)
case 1:
case 2:
case 3:
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
case 4:
return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(space,0,0xffff);
@@ -156,7 +156,7 @@ static void init_wunit_generic(running_machine &machine)
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- midtunit_gfx_rom = base = machine.root_device().memregion("gfx1")->base();
+ midtunit_gfx_rom = base = state->memregion("gfx1")->base();
len = state->memregion("gfx1")->bytes();
for (i = 0; i < len / 0x400000; i++)
{
diff --git a/src/mame/machine/midxunit.c b/src/mame/machine/midxunit.c
index 07ae50a7931..2ca359796ef 100644
--- a/src/mame/machine/midxunit.c
+++ b/src/mame/machine/midxunit.c
@@ -126,7 +126,7 @@ READ16_MEMBER(midxunit_state::midxunit_io_r)
case 1:
case 2:
case 3:
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
default:
logerror("%08X:Unknown I/O read from %d\n", cpu_get_pc(&space.device()), offset);
@@ -140,7 +140,7 @@ READ16_MEMBER(midxunit_state::midxunit_analog_r)
{
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
- return input_port_read(machine(), portnames[m_analog_port]);
+ return ioport(portnames[m_analog_port])->read();
}
@@ -299,7 +299,7 @@ DRIVER_INIT( revx )
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- midtunit_gfx_rom = base = machine.root_device().memregion("gfx1")->base();
+ midtunit_gfx_rom = base = state->memregion("gfx1")->base();
len = state->memregion("gfx1")->bytes();
for (i = 0; i < len / 0x200000; i++)
{
diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c
index 76c7347a7a9..6c60437615b 100644
--- a/src/mame/machine/midyunit.c
+++ b/src/mame/machine/midyunit.c
@@ -114,7 +114,7 @@ READ16_MEMBER(midyunit_state::midyunit_input_r)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW", "UNK0", "UNK1" };
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
}
@@ -130,15 +130,15 @@ READ16_MEMBER(midyunit_state::term2_input_r)
static const char *const portnames[] = { "IN0", "IN1", NULL, "DSW", "UNK0", "UNK1" };
if (offset != 2)
- return input_port_read(machine(), portnames[offset]);
+ return ioport(portnames[offset])->read();
switch (m_term2_analog_select)
{
default:
- case 0: return input_port_read(machine(), "STICK0_X");
- case 1: return input_port_read(machine(), "STICK0_Y");
- case 2: return input_port_read(machine(), "STICK1_X");
- case 3: return input_port_read(machine(), "STICK1_Y");
+ case 0: return ioport("STICK0_X")->read();
+ case 1: return ioport("STICK0_Y")->read();
+ case 2: return ioport("STICK1_X")->read();
+ case 3: return ioport("STICK1_Y")->read();
}
}
diff --git a/src/mame/machine/mie.c b/src/mame/machine/mie.c
index 286ed89bc7c..ec5aef155eb 100644
--- a/src/mame/machine/mie.c
+++ b/src/mame/machine/mie.c
@@ -202,7 +202,7 @@ READ8_MEMBER(mie_device::read_78xx)
READ8_MEMBER(mie_device::gpio_r)
{
if(gpiodir & (1 << offset))
- return gpio_name[offset] ? input_port_read(machine(), gpio_name[offset]) : 0xff;
+ return gpio_name[offset] ? ioport(gpio_name[offset])->read() : 0xff;
else
return gpio_val[offset];
}
@@ -211,7 +211,7 @@ WRITE8_MEMBER(mie_device::gpio_w)
{
gpio_val[offset] = data;
if(!(gpiodir & (1 << offset)) && gpio_name[offset])
- input_port_write(machine(), gpio_name[offset], data, 0xff);
+ ioport(gpio_name[offset])->write(data, 0xff);
}
READ8_MEMBER(mie_device::gpiodir_r)
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index 867160a075d..b6bf7ba58b7 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -1781,9 +1781,9 @@ int n64_periphs::pif_channel_handle_command(int channel, int slength, UINT8 *sda
case 1: //p2 inputs
{
//printf("Read p%d inputs\n", channel + 1);
- buttons = input_port_read(machine(), portnames[(channel*3) + 0]);
- x = input_port_read(machine(), portnames[(channel*3) + 1]) - 128;
- y = input_port_read(machine(), portnames[(channel*3) + 2]) - 128;
+ buttons = ioport(portnames[(channel*3) + 0])->read();
+ x = ioport(portnames[(channel*3) + 1])->read() - 128;
+ y = ioport(portnames[(channel*3) + 2])->read() - 128;
rdata[0] = (buttons >> 8) & 0xff;
rdata[1] = (buttons >> 0) & 0xff;
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index 86bc12c9506..4688342c0ef 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -1282,9 +1282,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (input_port_read(space->machine(), "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine(), "PADDLE0")&0x0f);
+ ret = (space->machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space->machine().root_device().ioport("PADDLE0")->read()&0x0f);
else
- ret = (input_port_read(space->machine(), "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine(), "PADDLE1")&0x0f);
+ ret = (space->machine().root_device().ioport("CONTROL0")->read()&0x90) | qstrobe | (space->machine().root_device().ioport("PADDLE1")->read()&0x0f);
qstrobe ^= 0x40;
@@ -1295,9 +1295,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (input_port_read(space->machine(), "CONTROL1")&0x90) | qnum | (input_port_read(space->machine(), "PADDLE0")>>4);
+ ret = (space->machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space->machine().root_device().ioport("PADDLE0")->read()>>4);
else
- ret = (input_port_read(space->machine(), "CONTROL1")&0x90) | qnum | (input_port_read(space->machine(), "PADDLE1")>>4);
+ ret = (space->machine().root_device().ioport("CONTROL1")->read()&0x90) | qnum | (space->machine().root_device().ioport("PADDLE1")->read()>>4);
if (!qstrobe) qnum ^= 0x20;
@@ -1327,7 +1327,7 @@ static READ8_HANDLER( berabohm_buttons_r )
{
int inp = input_count;
- if (inp == 4) res = input_port_read(space->machine(), "CONTROL0");
+ if (inp == 4) res = space->machine().root_device().ioport("CONTROL0")->read();
else
{
char portname[40];
@@ -1336,7 +1336,7 @@ static READ8_HANDLER( berabohm_buttons_r )
static int counter[4];
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = input_port_read(space->machine(), portname);
+ res = space->machine().root_device().ioport(portname)->read();
if (res & 0x80)
{
if (counter[inp] >= 0)
@@ -1360,7 +1360,7 @@ static READ8_HANDLER( berabohm_buttons_r )
counter[inp] = -1;
#else
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = input_port_read(space->machine(), portname);
+ res = space->machine().root_device().ioport(portname)->read();
if (res & 1) res = 0x7f; /* weak */
else if (res & 2) res = 0x48; /* medium */
else if (res & 4) res = 0x40; /* strong */
@@ -1371,7 +1371,7 @@ static READ8_HANDLER( berabohm_buttons_r )
}
else
{
- res = input_port_read(space->machine(), "CONTROL1") & 0x8f;
+ res = space->machine().root_device().ioport("CONTROL1")->read() & 0x8f;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1413,13 +1413,13 @@ static READ8_HANDLER( faceoff_inputs_r )
if (offset == 0)
{
- res = (input_port_read(space->machine(), "CONTROL0") & 0x80) | stored_input[0];
+ res = (space->machine().root_device().ioport("CONTROL0")->read() & 0x80) | stored_input[0];
return res;
}
else
{
- res = input_port_read(space->machine(), "CONTROL1") & 0x80;
+ res = space->machine().root_device().ioport("CONTROL1")->read() & 0x80;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1434,17 +1434,17 @@ static READ8_HANDLER( faceoff_inputs_r )
switch (input_count)
{
case 0:
- stored_input[0] = input_port_read(space->machine(), "IN0") & 0x1f;
- stored_input[1] = (input_port_read(space->machine(), "IN3") & 0x07) << 3;
+ stored_input[0] = space->machine().root_device().ioport("IN0")->read() & 0x1f;
+ stored_input[1] = (space->machine().root_device().ioport("IN3")->read() & 0x07) << 3;
break;
case 3:
- stored_input[0] = input_port_read(space->machine(), "IN2") & 0x1f;
+ stored_input[0] = space->machine().root_device().ioport("IN2")->read() & 0x1f;
break;
case 4:
- stored_input[0] = input_port_read(space->machine(), "IN1") & 0x1f;
- stored_input[1] = input_port_read(space->machine(), "IN3") & 0x18;
+ stored_input[0] = space->machine().root_device().ioport("IN1")->read() & 0x1f;
+ stored_input[1] = space->machine().root_device().ioport("IN3")->read() & 0x18;
break;
default:
diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c
index a2af5e69b8c..800520f05ad 100644
--- a/src/mame/machine/namcos2.c
+++ b/src/mame/machine/namcos2.c
@@ -736,28 +736,28 @@ WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
switch((data>>2) & 0x07)
{
case 0:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN0");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN0")->read();
break;
case 1:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN1");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN1")->read();
break;
case 2:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN2");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN2")->read();
break;
case 3:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN3");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN3")->read();
break;
case 4:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN4");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN4")->read();
break;
case 5:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN5");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN5")->read();
break;
case 6:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN6");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN6")->read();
break;
case 7:
- namcos2_mcu_analog_data=input_port_read(space->machine(), "AN7");
+ namcos2_mcu_analog_data=space->machine().root_device().ioport("AN7")->read();
break;
default:
output_set_value("anunk",data);
@@ -815,14 +815,14 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
int data = 0;
/* Read/convert the bits one at a time */
- if(input_port_read(space->machine(), "AN0") > threshold) data |= 0x01;
- if(input_port_read(space->machine(), "AN1") > threshold) data |= 0x02;
- if(input_port_read(space->machine(), "AN2") > threshold) data |= 0x04;
- if(input_port_read(space->machine(), "AN3") > threshold) data |= 0x08;
- if(input_port_read(space->machine(), "AN4") > threshold) data |= 0x10;
- if(input_port_read(space->machine(), "AN5") > threshold) data |= 0x20;
- if(input_port_read(space->machine(), "AN6") > threshold) data |= 0x40;
- if(input_port_read(space->machine(), "AN7") > threshold) data |= 0x80;
+ if(space->machine().root_device().ioport("AN0")->read() > threshold) data |= 0x01;
+ if(space->machine().root_device().ioport("AN1")->read() > threshold) data |= 0x02;
+ if(space->machine().root_device().ioport("AN2")->read() > threshold) data |= 0x04;
+ if(space->machine().root_device().ioport("AN3")->read() > threshold) data |= 0x08;
+ if(space->machine().root_device().ioport("AN4")->read() > threshold) data |= 0x10;
+ if(space->machine().root_device().ioport("AN5")->read() > threshold) data |= 0x20;
+ if(space->machine().root_device().ioport("AN6")->read() > threshold) data |= 0x40;
+ if(space->machine().root_device().ioport("AN7")->read() > threshold) data |= 0x80;
/* Return the result */
return data;
@@ -830,18 +830,18 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
READ8_HANDLER( namcos2_input_port_0_r )
{
- int data = input_port_read(space->machine(), "MCUB");
+ int data = space->machine().root_device().ioport("MCUB")->read();
return data;
}
READ8_HANDLER( namcos2_input_port_10_r )
{
- int data = input_port_read(space->machine(), "MCUH");
+ int data = space->machine().root_device().ioport("MCUH")->read();
return data;
}
READ8_HANDLER( namcos2_input_port_12_r )
{
- int data = input_port_read(space->machine(), "MCUDI0");
+ int data = space->machine().root_device().ioport("MCUDI0")->read();
return data;
}
diff --git a/src/mame/machine/nb1413m3.c b/src/mame/machine/nb1413m3.c
index dc9fe6e8d3b..550e0c31125 100644
--- a/src/mame/machine/nb1413m3.c
+++ b/src/mame/machine/nb1413m3.c
@@ -363,55 +363,56 @@ CUSTOM_INPUT( nb1413m3_outcoin_flag_r )
READ8_HANDLER( nb1413m3_inputport0_r )
{
- return ((input_port_read(space->machine(), "SYSTEM") & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
+ return ((space->machine().root_device().ioport("SYSTEM")->read() & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
}
READ8_HANDLER( nb1413m3_inputport1_r )
{
+ device_t &root = space->machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_HYHOO:
case NB1413M3_HYHOO2:
switch ((nb1413m3_inputport ^ 0xff) & 0x07)
{
- case 0x01: return input_port_read(space->machine(), "IN0");
- case 0x02: return input_port_read(space->machine(), "IN1");
+ case 0x01: return root.ioport("IN0")->read();
+ case 0x02: return root.ioport("IN1")->read();
case 0x04: return 0xff;
default: return 0xff;
}
break;
case NB1413M3_MSJIKEN:
case NB1413M3_TELMAHJN:
- if (input_port_read(space->machine(), "DSWA") & 0x80)
+ if (root.ioport("DSWA")->read() & 0x80)
{
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine(), "KEY0");
- case 0x02: return input_port_read(space->machine(), "KEY1");
- case 0x04: return input_port_read(space->machine(), "KEY2");
- case 0x08: return input_port_read(space->machine(), "KEY3");
- case 0x10: return input_port_read(space->machine(), "KEY4");
- default: return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
- & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
+ case 0x01: return root.ioport("KEY0")->read();
+ case 0x02: return root.ioport("KEY1")->read();
+ case 0x04: return root.ioport("KEY2")->read();
+ case 0x08: return root.ioport("KEY3")->read();
+ case 0x10: return root.ioport("KEY4")->read();
+ default: return (root.ioport("KEY0")->read() & root.ioport("KEY1")->read() & root.ioport("KEY2")->read()
+ & root.ioport("KEY3")->read() & root.ioport("KEY4")->read());
}
}
- else return input_port_read(space->machine(), "JAMMA2");
+ else return root.ioport("JAMMA2")->read();
break;
case NB1413M3_PAIRSNB:
case NB1413M3_PAIRSTEN:
case NB1413M3_OHPAIPEE:
case NB1413M3_TOGENKYO:
- return input_port_read(space->machine(), "P1");
+ return root.ioport("P1")->read();
default:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine(), "KEY0");
- case 0x02: return input_port_read(space->machine(), "KEY1");
- case 0x04: return input_port_read(space->machine(), "KEY2");
- case 0x08: return input_port_read(space->machine(), "KEY3");
- case 0x10: return input_port_read(space->machine(), "KEY4");
- default: return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
- & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
+ case 0x01: return root.ioport("KEY0")->read();
+ case 0x02: return root.ioport("KEY1")->read();
+ case 0x04: return root.ioport("KEY2")->read();
+ case 0x08: return root.ioport("KEY3")->read();
+ case 0x10: return root.ioport("KEY4")->read();
+ default: return (root.ioport("KEY0")->read() & root.ioport("KEY1")->read() & root.ioport("KEY2")->read()
+ & root.ioport("KEY3")->read() & root.ioport("KEY4")->read());
}
break;
}
@@ -419,6 +420,7 @@ READ8_HANDLER( nb1413m3_inputport1_r )
READ8_HANDLER( nb1413m3_inputport2_r )
{
+ device_t &root = space->machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_HYHOO:
@@ -427,42 +429,42 @@ READ8_HANDLER( nb1413m3_inputport2_r )
{
case 0x01: return 0xff;
case 0x02: return 0xff;
- case 0x04: return input_port_read(space->machine(), "IN2");
+ case 0x04: return root.ioport("IN2")->read();
default: return 0xff;
}
break;
case NB1413M3_MSJIKEN:
case NB1413M3_TELMAHJN:
- if (input_port_read(space->machine(), "DSWA") & 0x80)
+ if (root.ioport("DSWA")->read() & 0x80)
{
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine(), "KEY5");
- case 0x02: return input_port_read(space->machine(), "KEY6");
- case 0x04: return input_port_read(space->machine(), "KEY7");
- case 0x08: return input_port_read(space->machine(), "KEY8");
- case 0x10: return input_port_read(space->machine(), "KEY9");
- default: return (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
- & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
+ case 0x01: return root.ioport("KEY5")->read();
+ case 0x02: return root.ioport("KEY6")->read();
+ case 0x04: return root.ioport("KEY7")->read();
+ case 0x08: return root.ioport("KEY8")->read();
+ case 0x10: return root.ioport("KEY9")->read();
+ default: return (root.ioport("KEY5")->read() & root.ioport("KEY6")->read() & root.ioport("KEY7")->read()
+ & root.ioport("KEY8")->read() & root.ioport("KEY9")->read());
}
}
- else return input_port_read(space->machine(), "JAMMA1");
+ else return root.ioport("JAMMA1")->read();
break;
case NB1413M3_PAIRSNB:
case NB1413M3_PAIRSTEN:
case NB1413M3_OHPAIPEE:
case NB1413M3_TOGENKYO:
- return input_port_read(space->machine(), "P2");
+ return root.ioport("P2")->read();
default:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine(), "KEY5");
- case 0x02: return input_port_read(space->machine(), "KEY6");
- case 0x04: return input_port_read(space->machine(), "KEY7");
- case 0x08: return input_port_read(space->machine(), "KEY8");
- case 0x10: return input_port_read(space->machine(), "KEY9");
- default: return (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
- & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
+ case 0x01: return root.ioport("KEY5")->read();
+ case 0x02: return root.ioport("KEY6")->read();
+ case 0x04: return root.ioport("KEY7")->read();
+ case 0x08: return root.ioport("KEY8")->read();
+ case 0x10: return root.ioport("KEY9")->read();
+ default: return (root.ioport("KEY5")->read() & root.ioport("KEY6")->read() & root.ioport("KEY7")->read()
+ & root.ioport("KEY8")->read() & root.ioport("KEY9")->read());
}
break;
}
@@ -493,18 +495,19 @@ READ8_HANDLER( nb1413m3_inputport3_r )
READ8_HANDLER( nb1413m3_dipsw1_r )
{
+ device_t &root = space->machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_KANATUEN:
case NB1413M3_KYUHITO:
- return input_port_read(space->machine(), "DSWB");
+ return root.ioport("DSWB")->read();
case NB1413M3_TAIWANMB:
- return ((input_port_read(space->machine(), "DSWA") & 0xf0) | ((input_port_read(space->machine(), "DSWB") & 0xf0) >> 4));
+ return ((root.ioport("DSWA")->read() & 0xf0) | ((root.ioport("DSWB")->read() & 0xf0) >> 4));
case NB1413M3_OTONANO:
case NB1413M3_MJCAMERA:
case NB1413M3_IDHIMITU:
case NB1413M3_KAGUYA2:
- return (((input_port_read(space->machine(), "DSWA") & 0x0f) << 4) | (input_port_read(space->machine(), "DSWB") & 0x0f));
+ return (((root.ioport("DSWA")->read() & 0x0f) << 4) | (root.ioport("DSWB")->read() & 0x0f));
case NB1413M3_SCANDAL:
case NB1413M3_SCANDALM:
case NB1413M3_MJFOCUSM:
@@ -515,7 +518,7 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
case NB1413M3_UCHUUAI:
case NB1413M3_TOKIMBSJ:
case NB1413M3_TOKYOGAL:
- return ((input_port_read(space->machine(), "DSWA") & 0x0f) | ((input_port_read(space->machine(), "DSWB") & 0x0f) << 4));
+ return ((root.ioport("DSWA")->read() & 0x0f) | ((root.ioport("DSWB")->read() & 0x0f) << 4));
case NB1413M3_TRIPLEW1:
case NB1413M3_NTOPSTAR:
case NB1413M3_PSTADIUM:
@@ -525,29 +528,30 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
case NB1413M3_MJLSTORY:
case NB1413M3_QMHAYAKU:
case NB1413M3_MJGOTTUB:
- return (((input_port_read(space->machine(), "DSWB") & 0x01) >> 0) | ((input_port_read(space->machine(), "DSWB") & 0x04) >> 1) |
- ((input_port_read(space->machine(), "DSWB") & 0x10) >> 2) | ((input_port_read(space->machine(), "DSWB") & 0x40) >> 3) |
- ((input_port_read(space->machine(), "DSWA") & 0x01) << 4) | ((input_port_read(space->machine(), "DSWA") & 0x04) << 3) |
- ((input_port_read(space->machine(), "DSWA") & 0x10) << 2) | ((input_port_read(space->machine(), "DSWA") & 0x40) << 1));
+ return (((root.ioport("DSWB")->read() & 0x01) >> 0) | ((root.ioport("DSWB")->read() & 0x04) >> 1) |
+ ((root.ioport("DSWB")->read() & 0x10) >> 2) | ((root.ioport("DSWB")->read() & 0x40) >> 3) |
+ ((root.ioport("DSWA")->read() & 0x01) << 4) | ((root.ioport("DSWA")->read() & 0x04) << 3) |
+ ((root.ioport("DSWA")->read() & 0x10) << 2) | ((root.ioport("DSWA")->read() & 0x40) << 1));
default:
- return input_port_read(space->machine(), "DSWA");
+ return space->machine().root_device().ioport("DSWA")->read();
}
}
READ8_HANDLER( nb1413m3_dipsw2_r )
{
+ device_t &root = space->machine().root_device();
switch (nb1413m3_type)
{
case NB1413M3_KANATUEN:
case NB1413M3_KYUHITO:
- return input_port_read(space->machine(), "DSWA");
+ return root.ioport("DSWA")->read();
case NB1413M3_TAIWANMB:
- return (((input_port_read(space->machine(), "DSWA") & 0x0f) << 4) | (input_port_read(space->machine(), "DSWB") & 0x0f));
+ return (((root.ioport("DSWA")->read() & 0x0f) << 4) | (root.ioport("DSWB")->read() & 0x0f));
case NB1413M3_OTONANO:
case NB1413M3_MJCAMERA:
case NB1413M3_IDHIMITU:
case NB1413M3_KAGUYA2:
- return ((input_port_read(space->machine(), "DSWA") & 0xf0) | ((input_port_read(space->machine(), "DSWB") & 0xf0) >> 4));
+ return ((root.ioport("DSWA")->read() & 0xf0) | ((root.ioport("DSWB")->read() & 0xf0) >> 4));
case NB1413M3_SCANDAL:
case NB1413M3_SCANDALM:
case NB1413M3_MJFOCUSM:
@@ -558,7 +562,7 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
case NB1413M3_UCHUUAI:
case NB1413M3_TOKIMBSJ:
case NB1413M3_TOKYOGAL:
- return (((input_port_read(space->machine(), "DSWA") & 0xf0) >> 4) | (input_port_read(space->machine(), "DSWB") & 0xf0));
+ return (((root.ioport("DSWA")->read() & 0xf0) >> 4) | (root.ioport("DSWB")->read() & 0xf0));
case NB1413M3_TRIPLEW1:
case NB1413M3_NTOPSTAR:
case NB1413M3_PSTADIUM:
@@ -568,23 +572,23 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
case NB1413M3_MJLSTORY:
case NB1413M3_QMHAYAKU:
case NB1413M3_MJGOTTUB:
- return (((input_port_read(space->machine(), "DSWB") & 0x02) >> 1) | ((input_port_read(space->machine(), "DSWB") & 0x08) >> 2) |
- ((input_port_read(space->machine(), "DSWB") & 0x20) >> 3) | ((input_port_read(space->machine(), "DSWB") & 0x80) >> 4) |
- ((input_port_read(space->machine(), "DSWA") & 0x02) << 3) | ((input_port_read(space->machine(), "DSWA") & 0x08) << 2) |
- ((input_port_read(space->machine(), "DSWA") & 0x20) << 1) | ((input_port_read(space->machine(), "DSWA") & 0x80) << 0));
+ return (((root.ioport("DSWB")->read() & 0x02) >> 1) | ((root.ioport("DSWB")->read() & 0x08) >> 2) |
+ ((root.ioport("DSWB")->read() & 0x20) >> 3) | ((root.ioport("DSWB")->read() & 0x80) >> 4) |
+ ((root.ioport("DSWA")->read() & 0x02) << 3) | ((root.ioport("DSWA")->read() & 0x08) << 2) |
+ ((root.ioport("DSWA")->read() & 0x20) << 1) | ((root.ioport("DSWA")->read() & 0x80) << 0));
default:
- return input_port_read(space->machine(), "DSWB");
+ return space->machine().root_device().ioport("DSWB")->read();
}
}
READ8_HANDLER( nb1413m3_dipsw3_l_r )
{
- return ((input_port_read(space->machine(), "DSWC") & 0xf0) >> 4);
+ return ((space->machine().root_device().ioport("DSWC")->read() & 0xf0) >> 4);
}
READ8_HANDLER( nb1413m3_dipsw3_h_r )
{
- return ((input_port_read(space->machine(), "DSWC") & 0x0f) >> 0);
+ return ((space->machine().root_device().ioport("DSWC")->read() & 0x0f) >> 0);
}
WRITE8_HANDLER( nb1413m3_outcoin_w )
diff --git a/src/mame/machine/nitedrvr.c b/src/mame/machine/nitedrvr.c
index 3ebda789055..735a8e116a1 100644
--- a/src/mame/machine/nitedrvr.c
+++ b/src/mame/machine/nitedrvr.c
@@ -21,7 +21,7 @@ change in-between can affect the direction you move.
static int nitedrvr_steering( running_machine &machine )
{
nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
- int this_val = input_port_read(machine, "STEER");
+ int this_val = state->ioport("STEER")->read();
int delta = this_val - state->m_last_steering_val;
state->m_last_steering_val = this_val;
@@ -98,7 +98,7 @@ Fill in the steering and gear bits in a special way.
READ8_MEMBER(nitedrvr_state::nitedrvr_in0_r)
{
- int gear = input_port_read(machine(), "GEARS");
+ int gear = ioport("GEARS")->read();
if (gear & 0x10) m_gear = 1;
else if (gear & 0x20) m_gear = 2;
@@ -108,9 +108,9 @@ READ8_MEMBER(nitedrvr_state::nitedrvr_in0_r)
switch (offset & 0x03)
{
case 0x00: /* No remapping necessary */
- return input_port_read(machine(), "DSW0");
+ return ioport("DSW0")->read();
case 0x01: /* No remapping necessary */
- return input_port_read(machine(), "DSW1");
+ return ioport("DSW1")->read();
case 0x02: /* Remap our gear shift */
if (m_gear == 1)
return 0xe0;
@@ -121,7 +121,7 @@ READ8_MEMBER(nitedrvr_state::nitedrvr_in0_r)
else
return 0x70;
case 0x03: /* Remap our steering */
- return (input_port_read(machine(), "DSW2") | nitedrvr_steering(machine()));
+ return (ioport("DSW2")->read() | nitedrvr_steering(machine()));
default:
return 0xff;
}
@@ -161,7 +161,7 @@ Fill in the track difficulty switch and special signal in a special way.
READ8_MEMBER(nitedrvr_state::nitedrvr_in1_r)
{
- int port = input_port_read(machine(), "IN0");
+ int port = ioport("IN0")->read();
m_ac_line = (m_ac_line + 1) % 3;
diff --git a/src/mame/machine/opwolf.c b/src/mame/machine/opwolf.c
index 94d6512b6e3..37635754c13 100644
--- a/src/mame/machine/opwolf.c
+++ b/src/mame/machine/opwolf.c
@@ -529,8 +529,8 @@ static TIMER_CALLBACK( cchip_timer )
opwolf_state *state = machine.driver_data<opwolf_state>();
// Update input ports, these are used by both the 68k directly and by the c-chip
- state->m_cchip_ram[0x4] = input_port_read(machine, "IN0");
- state->m_cchip_ram[0x5] = input_port_read(machine, "IN1");
+ state->m_cchip_ram[0x4] = state->ioport("IN0")->read();
+ state->m_cchip_ram[0x5] = state->ioport("IN1")->read();
// Coin slots
if (state->m_cchip_ram[0x4] != state->m_cchip_last_04)
diff --git a/src/mame/machine/pcecommn.c b/src/mame/machine/pcecommn.c
index 3434467c2cf..5735b0c4841 100644
--- a/src/mame/machine/pcecommn.c
+++ b/src/mame/machine/pcecommn.c
@@ -57,7 +57,7 @@ READ8_HANDLER ( pce_joystick_r )
}
else
{
- data = input_port_read(space->machine(), "JOY");
+ data = space->machine().root_device().ioport("JOY")->read();
}
if(joystick_data_select) data >>= 4;
ret = (data & 0x0F) | pce.io_port_options;
diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c
index 6b22bb6d455..eb0697b1ece 100644
--- a/src/mame/machine/pckeybrd.c
+++ b/src/mame/machine/pckeybrd.c
@@ -183,7 +183,7 @@ typedef struct at_keyboard
int scan_code_set;
int last_code;
- const input_port_config *ports[8];
+ ioport_port *ports[8];
} at_keyboard;
static at_keyboard keyboard;
@@ -306,8 +306,8 @@ static void at_keyboard_queue_insert(UINT8 data);
static int at_keyboard_queue_size(void);
static int at_keyboard_queue_chars(running_machine &machine, const unicode_char *text, size_t text_len);
-static int at_keyboard_accept_char(running_machine &machine, unicode_char ch);
-static int at_keyboard_charqueue_empty(running_machine &machine);
+static bool at_keyboard_accept_char(running_machine &machine, unicode_char ch);
+static bool at_keyboard_charqueue_empty(running_machine &machine);
@@ -339,10 +339,10 @@ void at_keyboard_init(running_machine &machine, AT_KEYBOARD_TYPE type)
keyboard.ports[i] = machine.root_device().ioport(buf);
}
- inputx_setup_natural_keyboard(machine,
- at_keyboard_queue_chars,
- at_keyboard_accept_char,
- at_keyboard_charqueue_empty);
+ machine.ioport().natkeyboard().configure(
+ ioport_queue_chars_delegate(FUNC(at_keyboard_queue_chars), &machine),
+ ioport_accept_char_delegate(FUNC(at_keyboard_accept_char), &machine),
+ ioport_charqueue_empty_delegate(FUNC(at_keyboard_charqueue_empty), &machine));
}
@@ -499,7 +499,7 @@ static UINT32 at_keyboard_readport(int port)
{
UINT32 result = 0;
if (keyboard.ports[port] != NULL)
- result = input_port_read_direct(keyboard.ports[port]);
+ result = keyboard.ports[port]->read();
return result;
}
@@ -1237,14 +1237,14 @@ INPUT_PORTS_END
Inputx stuff
***************************************************************************/
-static int at_keyboard_accept_char(running_machine &machine, unicode_char ch)
+static bool at_keyboard_accept_char(running_machine &machine, unicode_char ch)
{
return unicode_char_to_at_keycode(ch) != 0;
}
-static int at_keyboard_charqueue_empty(running_machine &machine)
+static bool at_keyboard_charqueue_empty(running_machine &machine)
{
return at_keyboard_queue_size() == 0;
}
diff --git a/src/mame/machine/pgmprot.c b/src/mame/machine/pgmprot.c
index 5ce799b6974..6f7dbc73ffa 100644
--- a/src/mame/machine/pgmprot.c
+++ b/src/mame/machine/pgmprot.c
@@ -21,7 +21,7 @@ static void asic3_compute_hold(running_machine &machine)
// The mode is dependent on the region
static const int modes[4] = { 1, 1, 3, 2 };
- int mode = modes[input_port_read(machine, "Region") & 3];
+ int mode = modes[machine.root_device().ioport("Region")->read() & 3];
switch (mode)
{
@@ -60,9 +60,9 @@ READ16_HANDLER( pgm_asic3_r )
switch (state->m_asic3_reg)
{
- case 0x00: res = (state->m_asic3_latch[0] & 0xf7) | ((input_port_read(space->machine(), "Region") << 3) & 0x08); break;
+ case 0x00: res = (state->m_asic3_latch[0] & 0xf7) | ((state->ioport("Region")->read() << 3) & 0x08); break;
case 0x01: res = state->m_asic3_latch[1]; break;
- case 0x02: res = (state->m_asic3_latch[2] & 0x7f) | ((input_port_read(space->machine(), "Region") << 6) & 0x80); break;
+ case 0x02: res = (state->m_asic3_latch[2] & 0x7f) | ((state->ioport("Region")->read() << 6) & 0x80); break;
case 0x03:
res = (BIT(state->m_asic3_hold, 15) << 0)
| (BIT(state->m_asic3_hold, 12) << 1)
diff --git a/src/mame/machine/pgmprot1.c b/src/mame/machine/pgmprot1.c
index fafaa7bc1d4..8a279899394 100644
--- a/src/mame/machine/pgmprot1.c
+++ b/src/mame/machine/pgmprot1.c
@@ -273,7 +273,7 @@ void pgm_arm7_type1_latch_init( running_machine &machine )
static READ16_HANDLER( kovsh_fake_region_r )
{
pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
- int regionhack = input_port_read(space->machine(), "RegionHack");
+ int regionhack = state->ioport("RegionHack")->read();
if (regionhack != 0xff) return regionhack;
offset = 0x4;
@@ -1388,7 +1388,7 @@ static WRITE16_HANDLER( pgm_arm7_type1_sim_w )
static READ16_HANDLER( pgm_arm7_type1_sim_protram_r )
{
if (offset == 4)
- return input_port_read(space->machine(), "Region");
+ return space->machine().root_device().ioport("Region")->read();
return 0x0000;
}
@@ -1398,7 +1398,7 @@ static READ16_HANDLER( pstars_arm7_type1_sim_protram_r )
pgm_arm_type1_state *state = space->machine().driver_data<pgm_arm_type1_state>();
if (offset == 4) //region
- return input_port_read(space->machine(), "Region");
+ return state->ioport("Region")->read();
else if (offset >= 0x10) //timer
{
logerror("PSTARS ACCESS COUNTER %6X\n", state->m_extra_ram[offset - 0x10]);
diff --git a/src/mame/machine/pgmprot2.c b/src/mame/machine/pgmprot2.c
index 5c0e918d160..00b6a2d6372 100644
--- a/src/mame/machine/pgmprot2.c
+++ b/src/mame/machine/pgmprot2.c
@@ -182,7 +182,7 @@ static WRITE32_HANDLER( kov2_arm_region_w )
{
pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
int pc = cpu_get_pc(&space->device());
- int regionhack = input_port_read(space->machine(), "RegionHack");
+ int regionhack = state->ioport("RegionHack")->read();
if (pc==0x190 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0);
COMBINE_DATA(&state->m_arm7_shareram[0x138/4]);
}
@@ -235,7 +235,7 @@ static WRITE32_HANDLER( martmast_arm_region_w )
{
pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
int pc = cpu_get_pc(&space->device());
- int regionhack = input_port_read(space->machine(), "RegionHack");
+ int regionhack = state->ioport("RegionHack")->read();
if (pc==0x170 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0);
COMBINE_DATA(&state->m_arm7_shareram[0x138/4]);
}
@@ -256,7 +256,7 @@ static WRITE32_HANDLER( ddp2_arm_region_w )
{
pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>();
int pc = cpu_get_pc(&space->device());
- int regionhack = input_port_read(space->machine(), "RegionHack");
+ int regionhack = state->ioport("RegionHack")->read();
if (pc==0x0174 && regionhack != 0xff) data = (data & 0x0000ffff) | (regionhack << 16);
COMBINE_DATA(&state->m_arm7_shareram[0x0]);
}
@@ -312,8 +312,8 @@ DRIVER_INIT( ddp2 )
DRIVER_INIT( dw2001 )
{
- //pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
- UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
+ UINT16 *mem16 = (UINT16 *)state->memregion("maincpu")->base();
pgm_basic_init(machine);
kov2_latch_init(machine);
@@ -330,7 +330,7 @@ DRIVER_INIT( dw2001 )
mem16[0x11eb04 / 2] = 0x4e71;
/* patch ARM area with fake code */
- UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
+ UINT16 *temp16 = (UINT16 *)state->memregion("prot")->base();
temp16[(0x0000)/2] = 0xd088;
temp16[(0x0002)/2] = 0xe59f;
temp16[(0x0004)/2] = 0x0680;
@@ -346,8 +346,8 @@ DRIVER_INIT( dw2001 )
DRIVER_INIT( dwpc )
{
- //pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
- UINT16 *mem16 = (UINT16 *)machine.root_device().memregion("maincpu")->base();
+ pgm_arm_type2_state *state = machine.driver_data<pgm_arm_type2_state>();
+ UINT16 *mem16 = (UINT16 *)state->memregion("maincpu")->base();
pgm_basic_init(machine);
kov2_latch_init(machine);
@@ -365,7 +365,7 @@ DRIVER_INIT( dwpc )
/* patch ARM area with fake code */
- UINT16 *temp16 = (UINT16 *)machine.root_device().memregion("prot")->base();
+ UINT16 *temp16 = (UINT16 *)state->memregion("prot")->base();
temp16[(0x0000)/2] = 0xd088;
temp16[(0x0002)/2] = 0xe59f;
temp16[(0x0004)/2] = 0x0680;
diff --git a/src/mame/machine/pgmprot4.c b/src/mame/machine/pgmprot4.c
index dc564c73bc7..c693ae471d7 100644
--- a/src/mame/machine/pgmprot4.c
+++ b/src/mame/machine/pgmprot4.c
@@ -334,7 +334,7 @@ static READ16_HANDLER( killbld_igs025_prot_r )
}
else
{
- UINT32 protvalue = 0x89911400 | input_port_read(space->machine(), "Region");
+ UINT32 protvalue = 0x89911400 | space->machine().root_device().ioport("Region")->read();
ret = (protvalue >> (8 * (state->m_kb_ptr - 1))) & 0xff;
}
@@ -514,7 +514,7 @@ static READ16_HANDLER( drgw3_igs025_prot_r )
else if(state->m_kb_cmd==5)
{
UINT32 protvalue;
- protvalue = 0x60000|input_port_read(space->machine(), "Region");
+ protvalue = 0x60000|space->machine().root_device().ioport("Region")->read();
res=(protvalue>>(8*(ptr-1)))&0xff;
diff --git a/src/mame/machine/pgmprot6.c b/src/mame/machine/pgmprot6.c
index e69a8e14f46..e103a5eb846 100644
--- a/src/mame/machine/pgmprot6.c
+++ b/src/mame/machine/pgmprot6.c
@@ -120,7 +120,7 @@ static READ16_HANDLER( olds_r )
res = state->m_olds_cmd3;
else if (state->m_kb_cmd == 5)
{
- UINT32 protvalue = 0x900000 | input_port_read(space->machine(), "Region"); // region from protection device.
+ UINT32 protvalue = 0x900000 | state->ioport("Region")->read(); // region from protection device.
res = (protvalue >> (8 * (state->m_kb_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/machine/playch10.c b/src/mame/machine/playch10.c
index b56c67c6718..d49a6ff61a9 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -46,7 +46,7 @@ MACHINE_RESET( pc10 )
MACHINE_START( pc10 )
{
playch10_state *state = machine.driver_data<playch10_state>();
- state->m_vrom = machine.root_device().memregion("gfx2")->base();
+ state->m_vrom = state->memregion("gfx2")->base();
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
@@ -214,8 +214,8 @@ WRITE8_MEMBER(playch10_state::pc10_in0_w)
return;
/* load up the latches */
- m_input_latch[0] = input_port_read(machine(), "P1");
- m_input_latch[1] = input_port_read(machine(), "P2");
+ m_input_latch[0] = ioport("P1")->read();
+ m_input_latch[1] = ioport("P2")->read();
/* apply any masking from the BIOS */
if (m_cntrl_mask)
@@ -250,9 +250,9 @@ READ8_MEMBER(playch10_state::pc10_in1_r)
if (m_pc10_gun_controller)
{
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
- int trigger = input_port_read(machine(), "P1");
- int x = input_port_read(machine(), "GUNX");
- int y = input_port_read(machine(), "GUNY");
+ int trigger = ioport("P1")->read();
+ int x = ioport("GUNX")->read();
+ int y = ioport("GUNY")->read();
UINT32 pix, color_base;
/* no sprite hit (yet) */
diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c
index 6074bef1f36..9e3b9a61abb 100644
--- a/src/mame/machine/qix.c
+++ b/src/mame/machine/qix.c
@@ -410,7 +410,7 @@ READ8_MEMBER(qix_state::qix_68705_portB_r)
UINT8 ddr = m_68705_ddr[1];
UINT8 out = m_68705_port_out[1];
- UINT8 in = (input_port_read(machine(), "COIN") & 0x0f) | ((input_port_read(machine(), "COIN") & 0x80) >> 3);
+ UINT8 in = (ioport("COIN")->read() & 0x0f) | ((ioport("COIN")->read() & 0x80) >> 3);
return (out & ddr) | (in & ~ddr);
}
@@ -420,7 +420,7 @@ READ8_MEMBER(qix_state::qix_68705_portC_r)
UINT8 ddr = m_68705_ddr[2];
UINT8 out = m_68705_port_out[2];
- UINT8 in = (m_coinctrl & 0x08) | ((input_port_read(machine(), "COIN") & 0x70) >> 4);
+ UINT8 in = (m_coinctrl & 0x08) | ((ioport("COIN")->read() & 0x70) >> 4);
return (out & ddr) | (in & ~ddr);
}
@@ -534,7 +534,7 @@ static READ8_DEVICE_HANDLER( slither_trak_lr_r )
{
qix_state *state = device->machine().driver_data<qix_state>();
- return input_port_read(device->machine(), state->m_flip ? "AN3" : "AN1");
+ return state->ioport(state->m_flip ? "AN3" : "AN1")->read();
}
@@ -542,5 +542,5 @@ static READ8_DEVICE_HANDLER( slither_trak_ud_r )
{
qix_state *state = device->machine().driver_data<qix_state>();
- return input_port_read(device->machine(), state->m_flip ? "AN2" : "AN0");
+ return state->ioport(state->m_flip ? "AN2" : "AN0")->read();
}
diff --git a/src/mame/machine/rainbow.c b/src/mame/machine/rainbow.c
index edb460ae7fd..bd8fe11755b 100644
--- a/src/mame/machine/rainbow.c
+++ b/src/mame/machine/rainbow.c
@@ -761,10 +761,10 @@ static TIMER_CALLBACK( cchip_timer )
coin_counter_w(machine, 1, state->m_CRAM[0][8] & 0x20);
coin_counter_w(machine, 0, state->m_CRAM[0][8] & 0x10);
- state->m_CRAM[0][3] = input_port_read(machine, "800007"); /* STARTn + SERVICE1 */
- state->m_CRAM[0][4] = input_port_read(machine, "800009"); /* COINn */
- state->m_CRAM[0][5] = input_port_read(machine, "80000B"); /* Player controls + TILT */
- state->m_CRAM[0][6] = input_port_read(machine, "80000D"); /* Player controls (cocktail) */
+ state->m_CRAM[0][3] = machine.root_device().ioport("800007")->read(); /* STARTn + SERVICE1 */
+ state->m_CRAM[0][4] = machine.root_device().ioport("800009")->read(); /* COINn */
+ state->m_CRAM[0][5] = machine.root_device().ioport("80000B")->read(); /* Player controls + TILT */
+ state->m_CRAM[0][6] = machine.root_device().ioport("80000D")->read(); /* Player controls (cocktail) */
}
/*************************************
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index d1b02850a3f..6b6940f7ee2 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -43,7 +43,7 @@ CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r)
0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b,
0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f,
0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
- UINT8 val = input_port_read(machine(), (const char *)param);
+ UINT8 val = ioport((const char *)param)->read();
return remap[val >> 2];
}
diff --git a/src/mame/machine/segamsys.c b/src/mame/machine/segamsys.c
index ac5892ae622..de90243f1b1 100644
--- a/src/mame/machine/segamsys.c
+++ b/src/mame/machine/segamsys.c
@@ -1180,7 +1180,7 @@ SCREEN_VBLANK(sms)
end_of_frame(screen.machine(), md_sms_vdp);
// the SMS has a 'RESET' button on the machine, it generates an NMI
- if (input_port_read_safe(screen.machine(),"PAUSE",0x00))
+ if (screen.machine().root_device().ioport("PAUSE")->read_safe(0x00))
cputag_set_input_line(screen.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -1464,7 +1464,7 @@ DRIVER_INIT( sms )
static UINT8 ioport_gg00_r(running_machine& machine)
{
- UINT8 GG_START_BUTTON = input_port_read_safe(machine,"GGSTART",0x00);
+ UINT8 GG_START_BUTTON = machine.root_device().ioport("GGSTART")->read_safe(0x00);
return (GG_START_BUTTON << 7) |
(0 << 6) |
@@ -1567,7 +1567,7 @@ READ8_HANDLER (megatech_sms_ioport_dc_r)
running_machine &machine = space->machine();
/* 2009-05 FP: would it be worth to give separate inputs to SMS? SMS has only 2 keys A,B (which are B,C on megadrive) */
/* bit 4: TL-A; bit 5: TR-A */
- return (input_port_read(machine, "PAD1") & 0x3f) | ((input_port_read(machine, "PAD2") & 0x03) << 6);
+ return (machine.root_device().ioport("PAD1")->read() & 0x3f) | ((machine.root_device().ioport("PAD2")->read() & 0x03) << 6);
}
READ8_HANDLER (megatech_sms_ioport_dd_r)
@@ -1575,7 +1575,7 @@ READ8_HANDLER (megatech_sms_ioport_dd_r)
running_machine &machine = space->machine();
/* 2009-05 FP: would it be worth to give separate inputs to SMS? SMS has only 2 keys A,B (which are B,C on megadrive) */
/* bit 2: TL-B; bit 3: TR-B; bit 4: RESET; bit 5: unused; bit 6: TH-A; bit 7: TH-B*/
- return ((input_port_read(machine, "PAD2") & 0x3c) >> 2) | 0x10;
+ return ((machine.root_device().ioport("PAD2")->read() & 0x3c) >> 2) | 0x10;
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index df259d91bc3..e0e588d8a1e 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -1680,11 +1680,11 @@ READ16_HANDLER( copdxbl_0_r )
//case (0x5b4/2):
// return cop_mcu_ram[offset];
- case (0x700/2): return input_port_read(space->machine(), "DSW1");
- case (0x704/2): return input_port_read(space->machine(), "PLAYERS12");
- case (0x708/2): return input_port_read(space->machine(), "PLAYERS34");
- case (0x70c/2): return input_port_read(space->machine(), "SYSTEM");
- case (0x71c/2): return input_port_read(space->machine(), "DSW2");
+ case (0x700/2): return space->machine().root_device().ioport("DSW1")->read();
+ case (0x704/2): return space->machine().root_device().ioport("PLAYERS12")->read();
+ case (0x708/2): return space->machine().root_device().ioport("PLAYERS34")->read();
+ case (0x70c/2): return space->machine().root_device().ioport("SYSTEM")->read();
+ case (0x71c/2): return space->machine().root_device().ioport("DSW2")->read();
}
}
@@ -2676,7 +2676,7 @@ READ16_HANDLER( heatbrl_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2726,12 +2726,12 @@ READ16_HANDLER( cupsoc_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x35c/2)
{
- return input_port_read(space->machine(), "DSW2");
+ return space->machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2768,12 +2768,12 @@ READ16_HANDLER( cupsocs_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x31c/2)
{
- return input_port_read(space->machine(), "DSW2");
+ return space->machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2820,7 +2820,7 @@ READ16_HANDLER( godzilla_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2867,12 +2867,12 @@ READ16_HANDLER( denjinmk_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x35c/2)
{
- return input_port_read(space->machine(), "DSW2");
+ return space->machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2919,12 +2919,12 @@ READ16_HANDLER( grainbow_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
if(offset == 0x35c/2)
{
- return input_port_read(space->machine(), "DSW2");
+ return space->machine().root_device().ioport("DSW2")->read();
}
return generic_cop_r(space, offset, mem_mask);
@@ -2967,7 +2967,7 @@ READ16_HANDLER( legionna_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "UNK", "SYSTEM" };
- return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
+ return space->machine().root_device().ioport(portnames[(offset >> 1) & 3])->read();
}
return generic_cop_r(space, offset, mem_mask);
diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c
index e546bf06ba9..a573898d06c 100644
--- a/src/mame/machine/simpsons.c
+++ b/src/mame/machine/simpsons.c
@@ -17,7 +17,7 @@ WRITE8_MEMBER(simpsons_state::simpsons_eeprom_w)
if (data == 0xff)
return;
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
m_video_bank = data & 0x03;
simpsons_video_banking(machine(), m_video_bank);
diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c
index e588aa76fb0..043bf10ab05 100644
--- a/src/mame/machine/slikshot.c
+++ b/src/mame/machine/slikshot.c
@@ -559,8 +559,8 @@ SCREEN_UPDATE_RGB32( slikshot )
SCREEN_UPDATE32_CALL(itech8_2page);
/* add the current X,Y positions to the list */
- state->m_xbuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen.machine(), "FAKEX", 0);
- state->m_ybuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen.machine(), "FAKEY", 0);
+ state->m_xbuffer[state->m_ybuffer_next % YBUFFER_COUNT] = state->ioport("FAKEX")->read_safe(0);
+ state->m_ybuffer[state->m_ybuffer_next % YBUFFER_COUNT] = state->ioport("FAKEY")->read_safe(0);
state->m_ybuffer_next++;
/* determine where to draw the starting point */
diff --git a/src/mame/machine/smpc.c b/src/mame/machine/smpc.c
index 00ec7c022b7..8dffd82d832 100644
--- a/src/mame/machine/smpc.c
+++ b/src/mame/machine/smpc.c
@@ -345,7 +345,7 @@ static void smpc_digital_pad(running_machine &machine, UINT8 pad_num, UINT8 offs
static const char *const padnames[] = { "JOY1", "JOY2" };
UINT16 pad_data;
- pad_data = input_port_read(machine, padnames[pad_num]);
+ pad_data = machine.root_device().ioport(padnames[pad_num])->read();
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
state->m_smpc.OREG[1+pad_num*offset] = 0x02;
state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
@@ -360,16 +360,16 @@ static void smpc_analog_pad(running_machine &machine, UINT8 pad_num, UINT8 offse
{ "AN_X2", "AN_Y2", "AN_Z2" }};
UINT16 pad_data;
- pad_data = input_port_read(machine, padnames[pad_num]);
+ pad_data = machine.root_device().ioport(padnames[pad_num])->read();
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
state->m_smpc.OREG[1+pad_num*offset] = id;
state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
state->m_smpc.OREG[3+pad_num*offset] = pad_data & 0xff;
- state->m_smpc.OREG[4+pad_num*offset] = input_port_read(machine, annames[pad_num][0]);
+ state->m_smpc.OREG[4+pad_num*offset] = machine.root_device().ioport(annames[pad_num][0])->read();
if(id == 0x15)
{
- state->m_smpc.OREG[5+pad_num*offset] = input_port_read(machine, annames[pad_num][1]);
- state->m_smpc.OREG[6+pad_num*offset] = input_port_read(machine, annames[pad_num][2]);
+ state->m_smpc.OREG[5+pad_num*offset] = machine.root_device().ioport(annames[pad_num][1])->read();
+ state->m_smpc.OREG[6+pad_num*offset] = machine.root_device().ioport(annames[pad_num][2])->read();
}
}
@@ -380,19 +380,19 @@ static void smpc_keyboard(running_machine &machine, UINT8 pad_num, UINT8 offset)
game_key = 0xffff;
- game_key ^= ((input_port_read(machine, "KEYS_1") & 0x80) << 8); // right
- game_key ^= ((input_port_read(machine, "KEYS_1") & 0x40) << 8); // left
- game_key ^= ((input_port_read(machine, "KEYS_1") & 0x20) << 8); // down
- game_key ^= ((input_port_read(machine, "KEYS_1") & 0x10) << 8); // up
- game_key ^= ((input_port_read(machine, "KEYF") & 0x80) << 4); // ESC -> START
- game_key ^= ((input_port_read(machine, "KEY3") & 0x04) << 8); // Z / A trigger
- game_key ^= ((input_port_read(machine, "KEY4") & 0x02) << 8); // C / C trigger
- game_key ^= ((input_port_read(machine, "KEY6") & 0x04) << 6); // X / B trigger
- game_key ^= ((input_port_read(machine, "KEY2") & 0x20) << 2); // Q / R trigger
- game_key ^= ((input_port_read(machine, "KEY3") & 0x10) << 2); // A / X trigger
- game_key ^= ((input_port_read(machine, "KEY3") & 0x08) << 2); // S / Y trigger
- game_key ^= ((input_port_read(machine, "KEY4") & 0x08) << 1); // D / Z trigger
- game_key ^= ((input_port_read(machine, "KEY4") & 0x10) >> 1); // E / L trigger
+ game_key ^= ((state->ioport("KEYS_1")->read() & 0x80) << 8); // right
+ game_key ^= ((state->ioport("KEYS_1")->read() & 0x40) << 8); // left
+ game_key ^= ((state->ioport("KEYS_1")->read() & 0x20) << 8); // down
+ game_key ^= ((state->ioport("KEYS_1")->read() & 0x10) << 8); // up
+ game_key ^= ((state->ioport("KEYF")->read() & 0x80) << 4); // ESC -> START
+ game_key ^= ((state->ioport("KEY3")->read() & 0x04) << 8); // Z / A trigger
+ game_key ^= ((state->ioport("KEY4")->read() & 0x02) << 8); // C / C trigger
+ game_key ^= ((state->ioport("KEY6")->read() & 0x04) << 6); // X / B trigger
+ game_key ^= ((state->ioport("KEY2")->read() & 0x20) << 2); // Q / R trigger
+ game_key ^= ((state->ioport("KEY3")->read() & 0x10) << 2); // A / X trigger
+ game_key ^= ((state->ioport("KEY3")->read() & 0x08) << 2); // S / Y trigger
+ game_key ^= ((state->ioport("KEY4")->read() & 0x08) << 1); // D / Z trigger
+ game_key ^= ((state->ioport("KEY4")->read() & 0x10) >> 1); // E / L trigger
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
state->m_smpc.OREG[1+pad_num*offset] = 0x34;
@@ -420,9 +420,9 @@ static void smpc_mouse(running_machine &machine, UINT8 pad_num, UINT8 offset, UI
UINT8 mouse_ctrl;
INT16 mouse_x, mouse_y;
- mouse_ctrl = input_port_read(machine, mousenames[pad_num][0]);
- mouse_x = input_port_read(machine, mousenames[pad_num][1]);
- mouse_y = input_port_read(machine, mousenames[pad_num][2]);
+ mouse_ctrl = machine.root_device().ioport(mousenames[pad_num][0])->read();
+ mouse_x = machine.root_device().ioport(mousenames[pad_num][1])->read();
+ mouse_y = machine.root_device().ioport(mousenames[pad_num][2])->read();
if(mouse_x < 0)
mouse_ctrl |= 0x10;
@@ -450,7 +450,7 @@ static void smpc_md_pad(running_machine &machine, UINT8 pad_num, UINT8 offset, U
static const char *const padnames[] = { "MD_JOY1", "MD_JOY2" };
UINT16 pad_data;
- pad_data = input_port_read(machine, padnames[pad_num]);
+ pad_data = machine.root_device().ioport(padnames[pad_num])->read();
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
state->m_smpc.OREG[1+pad_num*offset] = id;
state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
@@ -475,8 +475,8 @@ static TIMER_CALLBACK( intback_peripheral )
// if (LOG_SMPC) logerror("SMPC: providing PAD data for intback, pad %d\n", intback_stage-2);
- read_id[0] = (input_port_read(machine, "INPUT_TYPE")) & 0x0f;
- read_id[1] = (input_port_read(machine, "INPUT_TYPE")) >> 4;
+ read_id[0] = (machine.root_device().ioport("INPUT_TYPE")->read()) & 0x0f;
+ read_id[1] = (machine.root_device().ioport("INPUT_TYPE")->read()) >> 4;
/* doesn't work? */
//pad_num = state->m_smpc.intback_stage - 1;
@@ -744,7 +744,7 @@ READ8_HANDLER( stv_SMPC_r )
return_data = state->m_smpc.SF;
if (offset == 0x75)//PDR1 read
- return_data = input_port_read(space->machine(), "DSW1");
+ return_data = state->ioport("DSW1")->read();
if (offset == 0x77)//PDR2 read
return_data = (0xfe | space->machine().device<eeprom_device>("eeprom")->read_bit());
@@ -866,7 +866,7 @@ READ8_HANDLER( saturn_SMPC_r )
const int shift_bit[4] = { 4, 12, 8, 0 };
const char *const padnames[] = { "JOY1", "JOY2" };
- if(input_port_read(space->machine(), "INPUT_TYPE") && !(space->debugger_access()))
+ if(space->machine().root_device().ioport("INPUT_TYPE")->read() && !(space->debugger_access()))
{
popmessage("Warning: read with SH-2 direct mode with a non-pad device");
return 0;
@@ -879,7 +879,7 @@ READ8_HANDLER( saturn_SMPC_r )
if (LOG_SMPC) logerror("SMPC: SH-2 direct mode, returning data for phase %d\n", hshake);
- return_data = 0x80 | 0x10 | ((input_port_read(space->machine(), padnames[offset == 0x77])>>shift_bit[hshake]) & 0xf);
+ return_data = 0x80 | 0x10 | ((space->machine().root_device().ioport(padnames[offset == 0x77])->read()>>shift_bit[hshake]) & 0xf);
}
}
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 3158835dd49..f054fb279a9 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -577,9 +577,9 @@ READ8_HANDLER( snes_r_io )
case 0x4100: /* NSS Dip-Switches */
{
- const input_port_config *port = state->ioport("DSW");
+ ioport_port *port = state->ioport("DSW");
if (port != NULL)
- return input_port_read(space->machine(), "DSW");
+ return space->machine().root_device().ioport("DSW")->read();
else
return snes_open_bus_r(space, 0);
}
@@ -1644,8 +1644,8 @@ static void nss_io_read( running_machine &machine )
for (port = 0; port < 2; port++)
{
- state->m_data1[port] = input_port_read(machine, portnames[port][0]) | (input_port_read(machine, portnames[port][1]) << 8);
- state->m_data2[port] = input_port_read(machine, portnames[port][2]) | (input_port_read(machine, portnames[port][3]) << 8);
+ state->m_data1[port] = state->ioport(portnames[port][0])->read() | (state->ioport(portnames[port][1])->read() << 8);
+ state->m_data2[port] = state->ioport(portnames[port][2])->read() | (state->ioport(portnames[port][3])->read() << 8);
// avoid sending signals that could crash games
// if left, no right
@@ -1998,7 +1998,7 @@ DRIVER_INIT( snes )
UINT16 total_blocks, read_blocks;
UINT8 *rom;
- rom = machine.root_device().memregion("user3")->base();
+ rom = state->memregion("user3")->base();
snes_ram = auto_alloc_array_clear(machine, UINT8, 0x1400000);
/* all NSS games seem to use MODE 20 */
@@ -2064,7 +2064,7 @@ DRIVER_INIT( snes_hirom )
UINT16 total_blocks, read_blocks;
UINT8 *rom;
- rom = machine.root_device().memregion("user3")->base();
+ rom = state->memregion("user3")->base();
snes_ram = auto_alloc_array(machine, UINT8, 0x1400000);
memset(snes_ram, 0, 0x1400000);
diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c
index 987cd0f377a..bdfcc08989a 100644
--- a/src/mame/machine/starwars.c
+++ b/src/mame/machine/starwars.c
@@ -125,11 +125,11 @@ READ8_MEMBER(starwars_state::starwars_adc_r)
{
/* pitch */
if (m_control_num == kPitch)
- return input_port_read(machine(), "STICKY");
+ return ioport("STICKY")->read();
/* yaw */
else if (m_control_num == kYaw)
- return input_port_read(machine(), "STICKX");
+ return ioport("STICKX")->read();
/* default to unused thrust */
else
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index bb351f5c756..607dd9d4d66 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -132,7 +132,7 @@ INTERRUPT_GEN( stfight_vb_interrupt )
// Perhaps define dipswitches as active low?
READ8_MEMBER(stfight_state::stfight_dsw_r)
{
- return( ~input_port_read(machine(), offset ? "DSW1" : "DSW0") );
+ return( ~ioport(offset ? "DSW1" : "DSW0")->read() );
}
READ8_MEMBER(stfight_state::stfight_coin_r)
@@ -154,7 +154,7 @@ READ8_MEMBER(stfight_state::stfight_coin_r)
* since it's read by the 30Hz interrupt ISR
*/
- coin_mech_data = input_port_read(machine(), "COIN");
+ coin_mech_data = ioport("COIN")->read();
for( i=0; i<2; i++ )
{
diff --git a/src/mame/machine/subs.c b/src/mame/machine/subs.c
index 3d9b00110ed..393af691b3c 100644
--- a/src/mame/machine/subs.c
+++ b/src/mame/machine/subs.c
@@ -26,7 +26,7 @@ subs_interrupt
INTERRUPT_GEN( subs_interrupt )
{
/* only do NMI interrupt if not in TEST mode */
- if ((input_port_read(device->machine(), "IN1") & 0x40)==0x40)
+ if ((device->machine().root_device().ioport("IN1")->read() & 0x40)==0x40)
device_set_input_line(device,INPUT_LINE_NMI,PULSE_LINE);
}
@@ -43,7 +43,7 @@ static int subs_steering_1(running_machine &machine)
int this_val;
int delta;
- this_val=input_port_read(machine, "DIAL2");
+ this_val=state->ioport("DIAL2")->read();
delta=this_val-state->m_last_val_1;
state->m_last_val_1=this_val;
@@ -72,7 +72,7 @@ static int subs_steering_2(running_machine &machine)
int this_val;
int delta;
- this_val=input_port_read(machine, "DIAL1");
+ this_val=state->ioport("DIAL1")->read();
delta=this_val-state->m_last_val_2;
state->m_last_val_2=this_val;
@@ -109,7 +109,7 @@ subs_control_r
***************************************************************************/
READ8_MEMBER(subs_state::subs_control_r)
{
- int inport = input_port_read(machine(), "IN0");
+ int inport = ioport("IN0")->read();
switch (offset & 0x07)
{
@@ -131,7 +131,7 @@ subs_coin_r
***************************************************************************/
READ8_MEMBER(subs_state::subs_coin_r)
{
- int inport = input_port_read(machine(), "IN1");
+ int inport = ioport("IN1")->read();
switch (offset & 0x07)
{
@@ -153,7 +153,7 @@ subs_options_r
***************************************************************************/
READ8_MEMBER(subs_state::subs_options_r)
{
- int opts = input_port_read(machine(), "DSW");
+ int opts = ioport("DSW")->read();
switch (offset & 0x03)
{
diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c
index 61136540b41..c80deafe4af 100644
--- a/src/mame/machine/tait8741.c
+++ b/src/mame/machine/tait8741.c
@@ -177,7 +177,7 @@ static void taito8741_update(address_space *space, int num)
else
{ /* port select */
st->parallelselect = data & 0x07;
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? input_port_read(space->machine(), st->portName) : 0);
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0);
}
}
}
@@ -188,7 +188,7 @@ static void taito8741_update(address_space *space, int num)
case -1: /* no command data */
break;
case 0x00: /* read from parallel port */
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine(), st->portName) : 0 );
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0 );
break;
case 0x01: /* read receive buffer 0 */
case 0x02: /* read receive buffer 1 */
@@ -201,7 +201,7 @@ static void taito8741_update(address_space *space, int num)
taito8741_hostdata_w(st,st->rxd[data-1]);
break;
case 0x08: /* latch received serial data */
- st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine(), st->portName) : 0;
+ st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0;
if( sst )
{
space->machine().scheduler().synchronize(FUNC(taito8741_serial_tx), num);
@@ -295,7 +295,7 @@ static int I8741_data_r(address_space *space, int num)
switch( st->mode )
{
case TAITO8741_PORT: /* parallel data */
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? input_port_read(space->machine(), st->portName) : 0);
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? space->machine().root_device().ioport(st->portName)->read() : 0);
break;
}
return ret;
@@ -472,7 +472,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
break;
case 2:
#if 1
- mcu->rxd = input_port_read(space->machine(), "DSW2");
+ mcu->rxd = space->machine().root_device().ioport("DSW2")->read();
mcu->sts |= 0x01; /* RD ready */
#endif
break;
@@ -515,7 +515,7 @@ static INT8 josvolly_8741_r(address_space *space,int num,int offset)
if(offset==1)
{
if(mcu->rst)
- mcu->rxd = input_port_read(space->machine(), mcu->initReadPort); /* port in */
+ mcu->rxd = space->machine().root_device().ioport(mcu->initReadPort)->read(); /* port in */
ret = mcu->sts;
LOG(("%s:8741[%d] SR %02X\n",space->machine().describe_context(),num,ret));
}
@@ -579,11 +579,11 @@ static void cyclemb_8741_w(address_space *space, int num, int offset, int data)
cyclemb_mcu.rst = 0;
break;
case 2:
- cyclemb_mcu.rxd = (input_port_read(space->machine(), "DSW2") & 0x1f) << 2;
+ cyclemb_mcu.rxd = (space->machine().root_device().ioport("DSW2")->read() & 0x1f) << 2;
cyclemb_mcu.rst = 0;
break;
case 3:
- //cyclemb_mcu.rxd = input_port_read(space->machine(), "DSW2");
+ //cyclemb_mcu.rxd = space->machine().root_device().ioport("DSW2")->read();
cyclemb_mcu.rst = 1;
break;
}
@@ -613,15 +613,15 @@ static INT8 cyclemb_8741_r(address_space *space,int num,int offset)
/* FIXME: remove cpu_get_pc hack */
switch(cpu_get_pc(&space->device()))
{
- case 0x760: cyclemb_mcu.rxd = ((input_port_read(space->machine(),"DSW1") & 0x1f) << 2); break;
+ case 0x760: cyclemb_mcu.rxd = ((space->machine().root_device().ioport("DSW1")->read() & 0x1f) << 2); break;
case 0x35c:
{
static UINT8 mux_r;
mux_r^=0x20;
if(mux_r & 0x20)
- cyclemb_mcu.rxd = ((input_port_read(space->machine(),"DSW3")) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
+ cyclemb_mcu.rxd = ((space->machine().root_device().ioport("DSW3")->read()) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
else
- cyclemb_mcu.rxd = ((input_port_read(space->machine(),"IN0")) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
+ cyclemb_mcu.rxd = ((space->machine().root_device().ioport("IN0")->read()) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
}
break;
}
diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c
index 28c95fac976..3535a81a166 100644
--- a/src/mame/machine/taitosj.c
+++ b/src/mame/machine/taitosj.c
@@ -19,7 +19,7 @@
MACHINE_START( taitosj )
{
taitosj_state *state = machine.driver_data<taitosj_state>();
- state->membank("bank1")->configure_entry(0, machine.root_device().memregion("maincpu")->base() + 0x6000);
+ state->membank("bank1")->configure_entry(0, state->memregion("maincpu")->base() + 0x6000);
state->membank("bank1")->configure_entry(1, state->memregion("maincpu")->base() + 0x10000);
state->save_item(NAME(state->m_fromz80));
@@ -308,5 +308,5 @@ WRITE8_MEMBER(taitosj_state::alpinea_bankswitch_w)
READ8_MEMBER(taitosj_state::alpine_port_2_r)
{
- return input_port_read(machine(), "IN2") | m_protection_value;
+ return ioport("IN2")->read() | m_protection_value;
}
diff --git a/src/mame/machine/tatsumi.c b/src/mame/machine/tatsumi.c
index a111037f039..5e2c9ed24f2 100644
--- a/src/mame/machine/tatsumi.c
+++ b/src/mame/machine/tatsumi.c
@@ -108,12 +108,12 @@ READ8_MEMBER(tatsumi_state::apache3_adc_r)
{
switch (m_apache3_adc)
{
- case 0: return input_port_read(machine(), "STICK_X");
- case 1: return input_port_read(machine(), "STICK_Y");
+ case 0: return ioport("STICK_X")->read();
+ case 1: return ioport("STICK_Y")->read();
case 2: return 0; // VSP1
case 3: return 0;
- case 4: return (UINT8)((255./100) * (100 - input_port_read(machine(), "VR1")));
- case 5: return input_port_read(machine(), "THROTTLE");
+ case 4: return (UINT8)((255./100) * (100 - ioport("VR1")->read()));
+ case 5: return ioport("THROTTLE")->read();
case 6: return 0; // RPSNC
case 7: return 0; // LPSNC
}
diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c
index 8106f3cd9e2..18e3fc17fab 100644
--- a/src/mame/machine/tnzs.c
+++ b/src/mame/machine/tnzs.c
@@ -43,9 +43,9 @@ READ8_MEMBER(tnzs_state::tnzs_port1_r)
switch (m_input_select & 0x0f)
{
- case 0x0a: data = input_port_read(machine(), "IN2"); break;
- case 0x0c: data = input_port_read(machine(), "IN0"); break;
- case 0x0d: data = input_port_read(machine(), "IN1"); break;
+ case 0x0a: data = ioport("IN2")->read(); break;
+ case 0x0c: data = ioport("IN0")->read(); break;
+ case 0x0d: data = ioport("IN1")->read(); break;
default: data = 0xff; break;
}
@@ -56,7 +56,7 @@ READ8_MEMBER(tnzs_state::tnzs_port1_r)
READ8_MEMBER(tnzs_state::tnzs_port2_r)
{
- int data = input_port_read(machine(), "IN2");
+ int data = ioport("IN2")->read();
// logerror("I8742:%04x Read %02x from port 2\n", cpu_get_previouspc(&space.device()), data);
@@ -83,7 +83,7 @@ READ8_MEMBER(tnzs_state::arknoid2_sh_f000_r)
// logerror("PC %04x: read input %04x\n", cpu_get_pc(&space.device()), 0xf000 + offset);
- val = input_port_read_safe(machine(), (offset / 2) ? "AN2" : "AN1", 0);
+ val = ioport((offset / 2) ? "AN2" : "AN1")->read_safe(0);
if (offset & 1)
return ((val >> 8) & 0xff);
else
@@ -214,7 +214,7 @@ READ8_MEMBER(tnzs_state::mcu_arknoid2_r)
}
else return m_mcu_credits;
}
- else return input_port_read(machine(), "IN0"); /* buttons */
+ else return ioport("IN0")->read(); /* buttons */
default:
logerror("error, unknown mcu command\n");
@@ -306,16 +306,16 @@ READ8_MEMBER(tnzs_state::mcu_extrmatn_r)
switch (m_mcu_command)
{
case 0x01:
- return input_port_read(machine(), "IN0") ^ 0xff; /* player 1 joystick + buttons */
+ return ioport("IN0")->read() ^ 0xff; /* player 1 joystick + buttons */
case 0x02:
- return input_port_read(machine(), "IN1") ^ 0xff; /* player 2 joystick + buttons */
+ return ioport("IN1")->read() ^ 0xff; /* player 2 joystick + buttons */
case 0x1a:
- return (input_port_read(machine(), "COIN1") | (input_port_read(machine(), "COIN2") << 1));
+ return (ioport("COIN1")->read() | (ioport("COIN2")->read() << 1));
case 0x21:
- return input_port_read(machine(), "IN2") & 0x0f;
+ return ioport("IN2")->read() & 0x0f;
case 0x41:
return m_mcu_credits;
@@ -343,7 +343,7 @@ READ8_MEMBER(tnzs_state::mcu_extrmatn_r)
else return m_mcu_credits;
}
/* buttons */
- else return ((input_port_read(machine(), "IN0") & 0xf0) | (input_port_read(machine(), "IN1") >> 4)) ^ 0xff;
+ else return ((ioport("IN0")->read() & 0xf0) | (ioport("IN1")->read() >> 4)) ^ 0xff;
default:
logerror("error, unknown mcu command\n");
@@ -610,9 +610,9 @@ INTERRUPT_GEN( arknoid2_interrupt )
case MCU_DRTOPPEL:
case MCU_PLUMPOP:
coin = 0;
- coin |= ((input_port_read(device->machine(), "COIN1") & 1) << 0);
- coin |= ((input_port_read(device->machine(), "COIN2") & 1) << 1);
- coin |= ((input_port_read(device->machine(), "IN2") & 3) << 2);
+ coin |= ((state->ioport("COIN1")->read() & 1) << 0);
+ coin |= ((state->ioport("COIN2")->read() & 1) << 1);
+ coin |= ((state->ioport("IN2")->read() & 3) << 2);
coin ^= 0x0c;
mcu_handle_coins(device->machine(), coin);
break;
@@ -671,7 +671,7 @@ static void tnzs_postload(running_machine &machine)
MACHINE_START( tnzs )
{
tnzs_state *state = machine.driver_data<tnzs_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 *SUB = state->memregion("sub")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
@@ -709,7 +709,7 @@ MACHINE_START( tnzs )
MACHINE_START( jpopnics )
{
tnzs_state *state = machine.driver_data<tnzs_state>();
- UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
+ UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 *SUB = state->memregion("sub")->base();
state->membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
diff --git a/src/mame/machine/toaplan1.c b/src/mame/machine/toaplan1.c
index d258d0ed440..f897d434d60 100644
--- a/src/mame/machine/toaplan1.c
+++ b/src/mame/machine/toaplan1.c
@@ -187,7 +187,7 @@ READ16_MEMBER(toaplan1_state::samesame_port_6_word_r)
{
/* Bit 0x80 is secondary CPU (HD647180) ready signal */
logerror("PC:%04x Warning !!! IO reading from $14000a\n",cpu_get_previouspc(&space.device()));
- return (0x80 | input_port_read(machine(), "TJUMP")) & 0xff;
+ return (0x80 | ioport("TJUMP")->read()) & 0xff;
}
READ16_MEMBER(toaplan1_state::vimana_system_port_r)
@@ -203,9 +203,9 @@ READ16_MEMBER(toaplan1_state::vimana_system_port_r)
int data, p, r, d, slot, reg, dsw;
slot = -1;
- d = input_port_read(machine(), "DSWA");
- r = input_port_read(machine(), "TJUMP");
- p = input_port_read(machine(), "SYSTEM");
+ d = ioport("DSWA")->read();
+ r = ioport("TJUMP")->read();
+ p = ioport("SYSTEM")->read();
m_vimana_latch ^= p;
data = (m_vimana_latch & p);
diff --git a/src/mame/machine/vectrex.c b/src/mame/machine/vectrex.c
index 4350fa79dcf..dda8096b289 100644
--- a/src/mame/machine/vectrex.c
+++ b/src/mame/machine/vectrex.c
@@ -125,7 +125,7 @@ DEVICE_IMAGE_LOAD(vectrex_cart)
void vectrex_configuration(running_machine &machine)
{
vectrex_state *state = machine.driver_data<vectrex_state>();
- unsigned char cport = input_port_read(machine, "3DCONF");
+ unsigned char cport = state->ioport("3DCONF")->read();
/* Vectrex 'dipswitch' configuration */
@@ -202,7 +202,7 @@ void vectrex_configuration(running_machine &machine)
state->m_beam_color = RGB_WHITE;
state->m_imager_colors[0] = state->m_imager_colors[1] = state->m_imager_colors[2] = state->m_imager_colors[3] = state->m_imager_colors[4] = state->m_imager_colors[5] = RGB_WHITE;
}
- state->m_lightpen_port = input_port_read(machine, "LPENCONF") & 0x03;
+ state->m_lightpen_port = machine.root_device().ioport("LPENCONF")->read() & 0x03;
}
@@ -224,7 +224,7 @@ READ8_DEVICE_HANDLER(vectrex_via_pb_r)
int pot;
static const char *const ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" };
- pot = input_port_read(device->machine(), ctrlnames[(state->m_via_out[PORTB] & 0x6) >> 1]) - 0x80;
+ pot = device->machine().root_device().ioport(ctrlnames[(state->m_via_out[PORTB] & 0x6) >> 1])->read() - 0x80;
if (pot > (signed char)state->m_via_out[PORTA])
state->m_via_out[PORTB] |= 0x20;
@@ -253,7 +253,7 @@ READ8_DEVICE_HANDLER(vectrex_via_pa_r)
READ8_DEVICE_HANDLER(vectrex_s1_via_pb_r)
{
vectrex_state *state = device->machine().driver_data<vectrex_state>();
- return (state->m_via_out[PORTB] & ~0x40) | (input_port_read(device->machine(), "COIN") & 0x40);
+ return (state->m_via_out[PORTB] & ~0x40) | (state->ioport("COIN")->read() & 0x40);
}
diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c
index 1cae9fad997..011f03169b6 100644
--- a/src/mame/machine/vertigo.c
+++ b/src/mame/machine/vertigo.c
@@ -119,7 +119,7 @@ READ16_MEMBER(vertigo_state::vertigo_io_convert)
if (offset > 2)
m_adc_result = 0;
else
- m_adc_result = input_port_read(machine(), adcnames[offset]);
+ m_adc_result = ioport(adcnames[offset])->read();
update_irq_encoder(machine(), INPUT_LINE_IRQ2, ASSERT_LINE);
return 0;
@@ -136,14 +136,14 @@ READ16_MEMBER(vertigo_state::vertigo_io_adc)
READ16_MEMBER(vertigo_state::vertigo_coin_r)
{
update_irq_encoder(machine(), INPUT_LINE_IRQ6, CLEAR_LINE);
- return (input_port_read(machine(), "COIN"));
+ return (ioport("COIN")->read());
}
INTERRUPT_GEN( vertigo_interrupt )
{
/* Coin inputs cause IRQ6 */
- if ((input_port_read(device->machine(), "COIN") & 0x7) < 0x7)
+ if ((device->machine().root_device().ioport("COIN")->read() & 0x7) < 0x7)
update_irq_encoder(device->machine(), INPUT_LINE_IRQ6, ASSERT_LINE);
}
diff --git a/src/mame/machine/volfied.c b/src/mame/machine/volfied.c
index 867de218f13..5e1aab9f2a4 100644
--- a/src/mame/machine/volfied.c
+++ b/src/mame/machine/volfied.c
@@ -436,10 +436,10 @@ READ16_MEMBER(volfied_state::volfied_cchip_ram_r)
{
switch (offset)
{
- 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 0x03: return ioport("F00007")->read(); /* STARTn + SERVICE1 */
+ case 0x04: return ioport("F00009")->read(); /* COINn */
+ case 0x05: return ioport("F0000B")->read(); /* Player controls + TILT */
+ case 0x06: return ioport("F0000D")->read(); /* Player controls (cocktail) */
case 0x08: return m_cc_port;
}
}
diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c
index d426e2d3a3c..1d003a68411 100644
--- a/src/mame/machine/vsnes.c
+++ b/src/mame/machine/vsnes.c
@@ -38,8 +38,8 @@ WRITE8_MEMBER(vsnes_state::vsnes_in0_w)
if (data & 1)
{
/* load up the latches */
- m_input_latch[0] = input_port_read(machine(), "IN0");
- m_input_latch[1] = input_port_read(machine(), "IN1");
+ m_input_latch[0] = ioport("IN0")->read();
+ m_input_latch[1] = ioport("IN1")->read();
}
}
@@ -50,8 +50,8 @@ READ8_MEMBER(vsnes_state::gun_in0_r)
/* shift */
m_input_latch[0] >>= 1;
- ret |= input_port_read(machine(), "COINS"); /* merge coins, etc */
- ret |= (input_port_read(machine(), "DSW0") & 3) << 3; /* merge 2 dipswitches */
+ ret |= ioport("COINS")->read(); /* merge coins, etc */
+ ret |= (ioport("DSW0")->read() & 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 */
@@ -75,8 +75,8 @@ READ8_MEMBER(vsnes_state::vsnes_in0_r)
/* shift */
m_input_latch[0] >>= 1;
- ret |= input_port_read(machine(), "COINS"); /* merge coins, etc */
- ret |= (input_port_read(machine(), "DSW0") & 3) << 3; /* merge 2 dipswitches */
+ ret |= ioport("COINS")->read(); /* merge coins, etc */
+ ret |= (ioport("DSW0")->read() & 3) << 3; /* merge 2 dipswitches */
return ret;
@@ -86,7 +86,7 @@ READ8_MEMBER(vsnes_state::vsnes_in1_r)
{
int ret = (m_input_latch[1]) & 1;
- ret |= input_port_read(machine(), "DSW0") & ~3; /* merge the rest of the dipswitches */
+ ret |= ioport("DSW0")->read() & ~3; /* merge the rest of the dipswitches */
/* shift */
m_input_latch[1] >>= 1;
@@ -100,8 +100,8 @@ WRITE8_MEMBER(vsnes_state::vsnes_in0_1_w)
if (data & 1)
{
/* load up the latches */
- m_input_latch[2] = input_port_read(machine(), "IN2");
- m_input_latch[3] = input_port_read(machine(), "IN3");
+ m_input_latch[2] = ioport("IN2")->read();
+ m_input_latch[3] = ioport("IN3")->read();
}
}
@@ -112,8 +112,8 @@ READ8_MEMBER(vsnes_state::vsnes_in0_1_r)
/* shift */
m_input_latch[2] >>= 1;
- ret |= input_port_read(machine(), "COINS2"); /* merge coins, etc */
- ret |= (input_port_read(machine(), "DSW1") & 3) << 3; /* merge 2 dipswitches */
+ ret |= ioport("COINS2")->read(); /* merge coins, etc */
+ ret |= (ioport("DSW1")->read() & 3) << 3; /* merge 2 dipswitches */
return ret;
}
@@ -121,7 +121,7 @@ READ8_MEMBER(vsnes_state::vsnes_in1_1_r)
{
int ret = (m_input_latch[3]) & 1;
- ret |= input_port_read(machine(), "DSW1") & ~3; /* merge the rest of the dipswitches */
+ ret |= ioport("DSW1")->read() & ~3; /* merge the rest of the dipswitches */
/* shift */
m_input_latch[3] >>= 1;
@@ -202,7 +202,7 @@ MACHINE_START( vsnes )
ppu1_space->install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(vsnes_state::vsnes_nt0_r),state), write8_delegate(FUNC(vsnes_state::vsnes_nt0_w),state));
- state->m_vrom[0] = machine.root_device().memregion("gfx1")->base();
+ state->m_vrom[0] = state->memregion("gfx1")->base();
state->m_vrom_size[0] = state->memregion("gfx1")->bytes();
state->m_vrom_banks = state->m_vrom_size[0] / 0x400;
@@ -227,9 +227,9 @@ MACHINE_START( vsnes )
MACHINE_START( vsdual )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
- state->m_vrom[0] = machine.root_device().memregion("gfx1")->base();
- state->m_vrom[1] = machine.root_device().memregion("gfx2")->base();
- state->m_vrom_size[0] = machine.root_device().memregion("gfx1")->bytes();
+ state->m_vrom[0] = state->memregion("gfx1")->base();
+ state->m_vrom[1] = state->memregion("gfx2")->base();
+ state->m_vrom_size[0] = state->memregion("gfx1")->bytes();
state->m_vrom_size[1] = state->memregion("gfx2")->bytes();
/* establish nametable ram */
@@ -365,11 +365,11 @@ WRITE8_MEMBER(vsnes_state::gun_in0_w)
{
/* load up the latches */
- m_input_latch[0] = input_port_read(machine(), "IN0");
+ m_input_latch[0] = ioport("IN0")->read();
/* do the gun thing */
- int x = input_port_read(machine(), "GUNX");
- int y = input_port_read(machine(), "GUNY");
+ int x = ioport("GUNX")->read();
+ int y = ioport("GUNY")->read();
UINT32 pix, color_base;
/* get the pixel at the gun position */
@@ -385,7 +385,7 @@ WRITE8_MEMBER(vsnes_state::gun_in0_w)
m_input_latch[0] |= 0x40;
}
- m_input_latch[1] = input_port_read(machine(), "IN1");
+ m_input_latch[1] = ioport("IN1")->read();
}
if ((m_zapstore & 1) && (!(data & 1)))
@@ -773,7 +773,7 @@ WRITE8_MEMBER(vsnes_state::mapper4_w)
DRIVER_INIT( MMC3 )
{
vsnes_state *state = machine.driver_data<vsnes_state>();
- UINT8 *prg = machine.root_device().memregion("maincpu")->base();
+ UINT8 *prg = state->memregion("maincpu")->base();
state->m_IRQ_enable = state->m_IRQ_count = state->m_IRQ_count_latch = 0;
int MMC3_prg_chunks = (state->memregion("maincpu")->bytes() - 0x10000) / 0x4000;
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index d96c9c6536f..3921eccc8bc 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -622,7 +622,7 @@ CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r)
if (m_port_select != 0)
tag += strlen(tag) + 1;
- return input_port_read(machine(), tag);
+ return ioport(tag)->read();
}
/*
@@ -653,7 +653,7 @@ CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r)
READ8_DEVICE_HANDLER( williams_49way_port_0_r )
{
static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 };
- return (translate49[input_port_read(device->machine(), "49WAYX") >> 4] << 4) | translate49[input_port_read(device->machine(), "49WAYY") >> 4];
+ return (translate49[device->machine().root_device().ioport("49WAYX")->read() >> 4] << 4) | translate49[device->machine().root_device().ioport("49WAYY")->read() >> 4];
}
@@ -663,7 +663,7 @@ READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r )
if (state->m_port_select)
return williams_49way_port_0_r(device, 0);
else
- return input_port_read(device->machine(), "IN3");
+ return state->ioport("IN3")->read();
}
@@ -879,7 +879,7 @@ MACHINE_START( blaster )
/* banking is different for blaster */
state->membank("bank1")->configure_entry(0, state->m_videoram);
- state->membank("bank1")->configure_entries(1, 16, machine.root_device().memregion("maincpu")->base() + 0x18000, 0x4000);
+ state->membank("bank1")->configure_entries(1, 16, state->memregion("maincpu")->base() + 0x18000, 0x4000);
state->membank("bank2")->configure_entry(0, state->m_videoram + 0x4000);
state->membank("bank2")->configure_entries(1, 16, state->memregion("maincpu")->base() + 0x10000, 0x0000);
@@ -946,7 +946,7 @@ static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
{
/* merge in the gun inputs with the standard data */
- int data = input_port_read(device->machine(), "IN0");
+ int data = device->machine().root_device().ioport("IN0")->read();
int gun = (data & 0x3f) ^ ((data & 0x3f) >> 1);
return (data & 0xc0) | gun;
diff --git a/src/mame/machine/xevious.c b/src/mame/machine/xevious.c
index 2071aaf74b1..77b6d2b9332 100644
--- a/src/mame/machine/xevious.c
+++ b/src/mame/machine/xevious.c
@@ -174,10 +174,10 @@ READ8_HANDLER( battles_input_port_r )
switch ( offset )
{
default:
- case 0: return ~BITSWAP8(input_port_read(space->machine(), "IN0H"),7,6,5,4,2,3,1,0);
- case 1: return ~input_port_read(space->machine(), "IN1L");
- case 2: return ~input_port_read(space->machine(), "IN1H");
- case 3: return ~input_port_read(space->machine(), "IN0L");
+ case 0: return ~BITSWAP8(space->machine().root_device().ioport("IN0H")->read(),7,6,5,4,2,3,1,0);
+ case 1: return ~space->machine().root_device().ioport("IN1L")->read();
+ case 2: return ~space->machine().root_device().ioport("IN1H")->read();
+ case 3: return ~space->machine().root_device().ioport("IN0L")->read();
}
}
diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c
index d5205bb3024..d19b89da521 100644
--- a/src/mame/video/aeroboto.c
+++ b/src/mame/video/aeroboto.c
@@ -81,7 +81,7 @@ VIDEO_START( aeroboto )
READ8_MEMBER(aeroboto_state::aeroboto_in0_r)
{
- return input_port_read(machine(), flip_screen() ? "P2" : "P1");
+ return ioport(flip_screen() ? "P2" : "P1")->read();
}
WRITE8_MEMBER(aeroboto_state::aeroboto_3000_w)
diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c
index 0dfad44fbb5..36c59c811e9 100644
--- a/src/mame/video/amiga.c
+++ b/src/mame/video/amiga.c
@@ -147,7 +147,7 @@ UINT32 amiga_gethvpos(screen_device &screen)
{
amiga_state *state = screen.machine().driver_data<amiga_state>();
UINT32 hvpos = (state->m_last_scanline << 8) | (screen.hpos() >> 2);
- UINT32 latchedpos = input_port_read_safe(screen.machine(), "HVPOS", 0);
+ UINT32 latchedpos = state->ioport("HVPOS")->read_safe(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/argus.c b/src/mame/video/argus.c
index 0edc4eb4665..dff2c8778da 100644
--- a/src/mame/video/argus.c
+++ b/src/mame/video/argus.c
@@ -369,7 +369,7 @@ static void argus_write_dummy_rams(running_machine &machine, int dramoffs, int v
int voffs;
int offs;
- UINT8 *VROM1 = machine.root_device().memregion("user1")->base(); /* "ag_15.bin" */
+ UINT8 *VROM1 = state->memregion("user1")->base(); /* "ag_15.bin" */
UINT8 *VROM2 = state->memregion("user2")->base(); /* "ag_16.bin" */
/* offset in pattern data */
diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c
index f52eaa17a64..cbd48af8d5f 100644
--- a/src/mame/video/artmagic.c
+++ b/src/mame/video/artmagic.c
@@ -41,7 +41,7 @@ INLINE UINT16 *address_to_vram(artmagic_state *state, offs_t *address)
VIDEO_START( artmagic )
{
artmagic_state *state = machine.driver_data<artmagic_state>();
- state->m_blitter_base = (UINT16 *)machine.root_device().memregion("gfx1")->base();
+ state->m_blitter_base = (UINT16 *)state->memregion("gfx1")->base();
state->m_blitter_mask = state->memregion("gfx1")->bytes()/2 - 1;
state_save_register_global_array(machine, state->m_xor);
diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c
index d27e9c1f149..456d0328ec8 100644
--- a/src/mame/video/astrocde.c
+++ b/src/mame/video/astrocde.c
@@ -481,51 +481,51 @@ READ8_MEMBER(astrocde_state::astrocade_data_chip_register_r)
break;
case 0x10: /* player 1 handle */
- result = input_port_read_safe(machine(), "P1HANDLE", 0xff);
+ result = ioport("P1HANDLE")->read_safe(0xff);
break;
case 0x11: /* player 2 handle */
- result = input_port_read_safe(machine(), "P2HANDLE", 0xff);
+ result = ioport("P2HANDLE")->read_safe(0xff);
break;
case 0x12: /* player 3 handle */
- result = input_port_read_safe(machine(), "P3HANDLE", 0xff);
+ result = ioport("P3HANDLE")->read_safe(0xff);
break;
case 0x13: /* player 4 handle */
- result = input_port_read_safe(machine(), "P4HANDLE", 0xff);
+ result = ioport("P4HANDLE")->read_safe(0xff);
break;
case 0x14: /* keypad column 0 */
- result = input_port_read_safe(machine(), "KEYPAD0", 0xff);
+ result = ioport("KEYPAD0")->read_safe(0xff);
break;
case 0x15: /* keypad column 1 */
- result = input_port_read_safe(machine(), "KEYPAD1", 0xff);
+ result = ioport("KEYPAD1")->read_safe(0xff);
break;
case 0x16: /* keypad column 2 */
- result = input_port_read_safe(machine(), "KEYPAD2", 0xff);
+ result = ioport("KEYPAD2")->read_safe(0xff);
break;
case 0x17: /* keypad column 3 */
- result = input_port_read_safe(machine(), "KEYPAD3", 0xff);
+ result = ioport("KEYPAD3")->read_safe(0xff);
break;
case 0x1c: /* player 1 knob */
- result = input_port_read_safe(machine(), "P1_KNOB", 0xff);
+ result = ioport("P1_KNOB")->read_safe(0xff);
break;
case 0x1d: /* player 2 knob */
- result = input_port_read_safe(machine(), "P2_KNOB", 0xff);
+ result = ioport("P2_KNOB")->read_safe(0xff);
break;
case 0x1e: /* player 3 knob */
- result = input_port_read_safe(machine(), "P3_KNOB", 0xff);
+ result = ioport("P3_KNOB")->read_safe(0xff);
break;
case 0x1f: /* player 4 knob */
- result = input_port_read_safe(machine(), "P4_KNOB", 0xff);
+ result = ioport("P4_KNOB")->read_safe(0xff);
break;
}
diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c
index 8f5767fc66c..80986dba8c8 100644
--- a/src/mame/video/atari.c
+++ b/src/mame/video/atari.c
@@ -774,7 +774,7 @@ SCREEN_UPDATE_IND16( atari )
copybitmap(bitmap, *antic.bitmap, 0, 0, 0, 0, cliprect);
- new_tv_artifacts = input_port_read_safe(screen.machine(), "artifacts", 0);
+ new_tv_artifacts = screen.machine().root_device().ioport("artifacts")->read_safe(0);
if( tv_artifacts != new_tv_artifacts )
{
tv_artifacts = new_tv_artifacts;
@@ -1501,7 +1501,7 @@ static void generic_atari_interrupt(running_machine &machine, void (*handle_keyb
if( antic.scanline == VBL_START )
{
- button_port = input_port_read_safe(machine, "djoy_b", 0);
+ button_port = machine.root_device().ioport("djoy_b")->read_safe(0);
/* specify buttons relevant to this Atari variant */
for (i = 0; i < button_count; i++)
diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c
index f938b93b437..60b842cb5e7 100644
--- a/src/mame/video/atarisy1.c
+++ b/src/mame/video/atarisy1.c
@@ -557,7 +557,7 @@ SCREEN_UPDATE_IND16( atarisy1 )
static void decode_gfx(running_machine &machine, UINT16 *pflookup, UINT16 *molookup)
{
atarisy1_state *state = machine.driver_data<atarisy1_state>();
- UINT8 *prom1 = &machine.root_device().memregion("proms")->u8(0x000);
+ UINT8 *prom1 = &state->memregion("proms")->u8(0x000);
UINT8 *prom2 = &state->memregion("proms")->u8(0x200);
int obj, i;
diff --git a/src/mame/video/balsente.c b/src/mame/video/balsente.c
index 416bec6ceba..217c31ca384 100644
--- a/src/mame/video/balsente.c
+++ b/src/mame/video/balsente.c
@@ -22,11 +22,11 @@ VIDEO_START( balsente )
/* reset the system */
state->m_palettebank_vis = 0;
- state->m_sprite_bank[0] = machine.root_device().memregion("gfx1")->base();
- state->m_sprite_bank[1] = machine.root_device().memregion("gfx1")->base() + 0x10000;
+ state->m_sprite_bank[0] = state->memregion("gfx1")->base();
+ state->m_sprite_bank[1] = state->memregion("gfx1")->base() + 0x10000;
/* determine sprite size */
- state->m_sprite_data = machine.root_device().memregion("gfx1")->base();
+ state->m_sprite_data = state->memregion("gfx1")->base();
state->m_sprite_mask = state->memregion("gfx1")->bytes() - 1;
/* register for saving */
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index 9ac13119773..2a47ab13298 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -194,12 +194,12 @@ WRITE8_MEMBER(bking_state::bking_playfield_w)
READ8_MEMBER(bking_state::bking_input_port_5_r)
{
- return input_port_read(machine(), m_controller ? "TRACK1_X" : "TRACK0_X");
+ return ioport(m_controller ? "TRACK1_X" : "TRACK0_X")->read();
}
READ8_MEMBER(bking_state::bking_input_port_6_r)
{
- return input_port_read(machine(), m_controller ? "TRACK1_Y" : "TRACK0_Y");
+ return ioport(m_controller ? "TRACK1_Y" : "TRACK0_Y")->read();
}
READ8_MEMBER(bking_state::bking_pos_r)
diff --git a/src/mame/video/blockade.c b/src/mame/video/blockade.c
index 277bda03a6c..3ea11c7b68f 100644
--- a/src/mame/video/blockade.c
+++ b/src/mame/video/blockade.c
@@ -6,7 +6,7 @@ WRITE8_MEMBER(blockade_state::blockade_videoram_w)
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
- if (input_port_read(machine(), "IN3") & 0x80)
+ if (ioport("IN3")->read() & 0x80)
{
logerror("blockade_videoram_w: scanline %d\n", machine().primary_screen->vpos());
device_spin_until_interrupt(&space.device());
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index 51f26b9ec53..d9698b5104d 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -264,7 +264,7 @@ WRITE8_MEMBER(btime_state::bnj_video_control_w)
/* For now we just check 0x40 in DSW1, and ignore the write if we */
/* are in upright controls mode. */
- if (input_port_read(machine(), "DSW1") & 0x40) /* cocktail mode */
+ if (ioport("DSW1")->read() & 0x40) /* cocktail mode */
btime_video_control_w(space, offset, data);
}
@@ -278,7 +278,7 @@ WRITE8_MEMBER(btime_state::zoar_video_control_w)
m_btime_palette = (data & 0x30) >> 3;
- if (input_port_read(machine(), "DSW1") & 0x40) /* cocktail mode */
+ if (ioport("DSW1")->read() & 0x40) /* cocktail mode */
flip_screen_set(data & 0x80);
}
@@ -286,7 +286,7 @@ WRITE8_MEMBER(btime_state::disco_video_control_w)
{
m_btime_palette = (data >> 2) & 0x03;
- if (!(input_port_read(machine(), "DSW1") & 0x40)) /* cocktail mode */
+ if (!(ioport("DSW1")->read() & 0x40)) /* cocktail mode */
flip_screen_set(data & 0x01);
}
diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c
index 442b529d87a..69657471e4b 100644
--- a/src/mame/video/bwing.c
+++ b/src/mame/video/bwing.c
@@ -150,7 +150,7 @@ WRITE8_MEMBER(bwing_state::bwing_paletteram_w)
g = ((g << 5) + (g << 2) + (g >> 1));
b = ((b << 5) + (b << 2) + (b >> 1));
- if ((i = input_port_read(machine(), "EXTRA")) < 4)
+ if ((i = ioport("EXTRA")->read()) < 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 eba833902ab..18371d7d7b6 100644
--- a/src/mame/video/canyon.c
+++ b/src/mame/video/canyon.c
@@ -83,7 +83,7 @@ SCREEN_UPDATE_IND16( canyon )
draw_bombs(screen.machine(), bitmap, cliprect);
/* watchdog is disabled during service mode */
- screen.machine().watchdog_enable(!(input_port_read(screen.machine(), "IN2") & 0x10));
+ screen.machine().watchdog_enable(!(screen.machine().root_device().ioport("IN2")->read() & 0x10));
return 0;
}
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index 94119762d01..2373bb8e0f8 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -515,7 +515,7 @@ static void get_sprite_info_cave( running_machine &machine )
{
cave_state *state = machine.driver_data<cave_state>();
pen_t base_pal = 0;
- const UINT8 *base_gfx = machine.root_device().memregion("sprites")->base();
+ const UINT8 *base_gfx = state->memregion("sprites")->base();
int code_max = state->memregion("sprites")->bytes() / (16*16);
UINT16 *source;
@@ -644,7 +644,7 @@ static void get_sprite_info_donpachi( running_machine &machine )
{
cave_state *state = machine.driver_data<cave_state>();
pen_t base_pal = 0;
- const UINT8 *base_gfx = machine.root_device().memregion("sprites")->base();
+ const UINT8 *base_gfx = state->memregion("sprites")->base();
int code_max = state->memregion("sprites")->bytes() / (16*16);
UINT16 *source;
diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c
index dcb065cb455..29dff0246ae 100644
--- a/src/mame/video/centiped.c
+++ b/src/mame/video/centiped.c
@@ -462,7 +462,7 @@ SCREEN_UPDATE_IND16( warlords )
{
centiped_state *state = screen.machine().driver_data<centiped_state>();
UINT8 *spriteram = state->m_spriteram;
- int upright_mode = input_port_read(screen.machine(), "IN0") & 0x80;
+ int upright_mode = screen.machine().root_device().ioport("IN0")->read() & 0x80;
int offs;
/* if the cocktail/upright switch flipped, force refresh */
diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c
index 9fe21eaf44c..a3b591109d7 100644
--- a/src/mame/video/changela.c
+++ b/src/mame/video/changela.c
@@ -175,9 +175,9 @@ static void draw_river( running_machine &machine, bitmap_ind16 &bitmap, int sy )
changela_state *state = machine.driver_data<changela_state>();
int sx, i, j;
- UINT8* ROM = machine.root_device().memregion("user2")->base();
+ UINT8* ROM = state->memregion("user2")->base();
UINT8* RAM = state->m_memory_devices + 0x800;
- UINT8* TILE_ROM = machine.root_device().memregion("gfx1")->base();
+ UINT8* TILE_ROM = state->memregion("gfx1")->base();
UINT8* TILE_RAM = state->m_memory_devices + 0x1000;
UINT8* PROM = state->memregion("proms")->base();
@@ -355,13 +355,13 @@ static void draw_tree( running_machine &machine, bitmap_ind16 &bitmap, int sy, i
int sx, i, j;
/* State machine */
- UINT8* ROM = machine.root_device().memregion("user2")->base();
+ UINT8* ROM = state->memregion("user2")->base();
UINT8* RAM = state->m_memory_devices + 0x840 + 0x40 * tree_num;
- UINT8* PROM = machine.root_device().memregion("proms")->base();
+ UINT8* PROM = state->memregion("proms")->base();
/* Tree Data */
UINT8* RAM2 = state->m_tree_ram + 0x20 * tree_num;
- UINT8* TILE_ROM = (tree_num ? (machine.root_device().memregion("user3")->base() + 0x1000) : (machine.root_device().memregion("gfx1")->base() + 0x2000));
+ UINT8* TILE_ROM = (tree_num ? (state->memregion("user3")->base() + 0x1000) : (state->memregion("gfx1")->base() + 0x2000));
UINT8* TILE_RAM = (tree_num ? (state->memregion("user3")->base()) : (state->m_memory_devices + 0x1800));
int preload = ((sy < 32) ? 1 : 0);
diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c
index 066836b9f2c..b15b011a5a3 100644
--- a/src/mame/video/cinemat.c
+++ b/src/mame/video/cinemat.c
@@ -232,7 +232,7 @@ SCREEN_UPDATE_RGB32( cinemat )
SCREEN_UPDATE_RGB32( spacewar )
{
- int sw_option = input_port_read(screen.machine(), "INPUTS");
+ int sw_option = screen.machine().root_device().ioport("INPUTS")->read();
SCREEN_UPDATE32_CALL(cinemat);
diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c
index 385f17f5a91..db997efe787 100644
--- a/src/mame/video/cischeat.c
+++ b/src/mame/video/cischeat.c
@@ -299,25 +299,25 @@ READ16_MEMBER(cischeat_state::bigrun_vregs_r)
{
switch (offset)
{
- case 0x0000/2 : return input_port_read(machine(), "IN1"); // Coins
- case 0x0002/2 : return input_port_read(machine(), "IN2"); // Buttons
- case 0x0004/2 : return input_port_read(machine(), "IN3"); // Motor Limit Switches
- case 0x0006/2 : return input_port_read(machine(), "IN4"); // DSW 1 & 2
+ case 0x0000/2 : return ioport("IN1")->read(); // Coins
+ case 0x0002/2 : return ioport("IN2")->read(); // Buttons
+ case 0x0004/2 : return ioport("IN3")->read(); // Motor Limit Switches
+ case 0x0006/2 : return ioport("IN4")->read(); // DSW 1 & 2
case 0x0008/2 : return soundlatch2_word_r(space,0,0xffff); // From sound cpu
case 0x0010/2 :
switch (m_ip_select & 0x3)
{
- case 0 : return input_port_read(machine(), "IN6"); // Driving Wheel
+ case 0 : return ioport("IN6")->read(); // Driving Wheel
case 1 : return 0xffff; // Cockpit: Up / Down Position
case 2 : return 0xffff; // Cockpit: Left / Right Position?
- case 3 : return input_port_read(machine(), "PEDAL"); // Accelerator (Pedal)
+ case 3 : return ioport("PEDAL")->read(); // Accelerator (Pedal)
default: return 0xffff;
}
- case 0x2200/2 : return input_port_read(machine(), "IN5"); // DSW 3 (4 bits)
+ case 0x2200/2 : return ioport("IN5")->read(); // DSW 3 (4 bits)
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
@@ -395,21 +395,21 @@ READ16_MEMBER(cischeat_state::cischeat_vregs_r)
{
switch (offset)
{
- case 0x0000/2 : return input_port_read(machine(), "IN1"); // Coins
- case 0x0002/2 : return input_port_read(machine(), "IN2"); // Buttons
- case 0x0004/2 : return input_port_read(machine(), "IN3"); // Motor Limit Switches
- case 0x0006/2 : return input_port_read(machine(), "IN4"); // DSW 1 & 2
+ case 0x0000/2 : return ioport("IN1")->read(); // Coins
+ case 0x0002/2 : return ioport("IN2")->read(); // Buttons
+ case 0x0004/2 : return ioport("IN3")->read(); // Motor Limit Switches
+ case 0x0006/2 : return ioport("IN4")->read(); // DSW 1 & 2
case 0x0010/2 :
switch (m_ip_select & 0x3)
{
- case 0 : return input_port_read(machine(), "IN6"); // Driving Wheel
+ case 0 : return ioport("IN6")->read(); // 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 input_port_read(machine(), "IN5"); // DSW 3 (4 bits)
+ case 0x2200/2 : return ioport("IN5")->read(); // DSW 3 (4 bits)
case 0x2300/2 : return soundlatch2_byte_r(space,0); // From sound cpu
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
@@ -488,20 +488,20 @@ READ16_MEMBER(cischeat_state::f1gpstar_vregs_r)
{
switch (offset)
{
- case 0x0000/2 : return input_port_read(machine(), "IN1"); // DSW 1 & 2
+ case 0x0000/2 : return ioport("IN1")->read(); // DSW 1 & 2
// case 0x0002/2 : return 0xFFFF;
- case 0x0004/2 : return input_port_read(machine(), "IN2"); // Buttons
+ case 0x0004/2 : return ioport("IN2")->read(); // Buttons
- case 0x0006/2 : return input_port_read(machine(), "IN3"); // ? Read at boot only
+ case 0x0006/2 : return ioport("IN3")->read(); // ? Read at boot only
case 0x0008/2 : return soundlatch2_byte_r(space,0); // From sound cpu
- case 0x000c/2 : return input_port_read(machine(), "IN4"); // DSW 3
+ case 0x000c/2 : return ioport("IN4")->read(); // DSW 3
case 0x0010/2 : // Accel + Driving Wheel
- return (input_port_read(machine(), "PEDAL") & 0xff) + ((input_port_read(machine(), "IN5") & 0xff)<<8);
+ return (ioport("PEDAL")->read() & 0xff) + ((ioport("IN5")->read() & 0xff)<<8);
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
@@ -534,14 +534,14 @@ READ16_MEMBER(cischeat_state::wildplt_vregs_r)
switch (offset)
{
- case 0x0000/2 : return input_port_read(machine(), "IN0"); // DSW 1 & 2
+ case 0x0000/2 : return ioport("IN0")->read(); // DSW 1 & 2
- case 0x0004/2 : return input_port_read(machine(), "IN1"); // Buttons
+ case 0x0004/2 : return ioport("IN1")->read(); // Buttons
case 0x0008/2 : return soundlatch2_byte_r(space,0); // From sound cpu
case 0x0010/2 : // X, Y
- return input_port_read(machine(), "IN2") | (input_port_read(machine(), "IN3")<<8);
+ return ioport("IN2")->read() | (ioport("IN3")->read()<<8);
case 0x0018/2 :
return (m_f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c
index 39e8aae5657..a3edb10481e 100644
--- a/src/mame/video/cosmic.c
+++ b/src/mame/video/cosmic.c
@@ -373,7 +373,7 @@ static void devzone_draw_grid( running_machine &machine, bitmap_ind16 &bitmap, c
{
cosmic_state *state = machine.driver_data<cosmic_state>();
UINT8 y;
- UINT8 *horz_PROM = machine.root_device().memregion("user2")->base();
+ UINT8 *horz_PROM = state->memregion("user2")->base();
UINT8 *vert_PROM = state->memregion("user3")->base();
offs_t horz_addr = 0;
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index c518f89ef51..58260f3233d 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -1619,10 +1619,10 @@ READ16_MEMBER(cps_state::cps1_cps_b_r)
m_cps_b_regs[m_game_config->mult_factor2 / 2]) >> 16;
if (offset == m_game_config->in2_addr / 2) /* Extra input ports (on C-board) */
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
if (offset == m_game_config->in3_addr / 2) /* Player 4 controls (on C-board) ("Captain Commando") */
- return input_port_read(machine(), "IN3");
+ return ioport("IN3")->read();
if (m_cps_version == 2)
{
diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c
index 3eb4edcca54..a5b740dd4a3 100644
--- a/src/mame/video/dc.c
+++ b/src/mame/video/dc.c
@@ -2679,7 +2679,7 @@ SCREEN_UPDATE_RGB32(dc)
pvr_drawframebuffer(screen.machine(),bitmap,cliprect);
// update this here so we only do string lookup once per frame
- state->debug_dip_status = input_port_read(screen.machine(), "MAMEDEBUG");
+ state->debug_dip_status = screen.machine().root_device().ioport("MAMEDEBUG")->read();
return 0;
}
diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c
index f39a29593fa..0cafb066692 100644
--- a/src/mame/video/dcheese.c
+++ b/src/mame/video/dcheese.c
@@ -168,7 +168,7 @@ static void do_blit( running_machine &machine )
INT32 dxdy = (INT32)(((state->m_blitter_xparam[6] & 0x0fff) | ((state->m_blitter_xparam[7] & 0x0fff) << 12)) << 12) >> 12;
INT32 dydx = (INT32)(((state->m_blitter_yparam[4] & 0x0fff) | ((state->m_blitter_yparam[5] & 0x0fff) << 12)) << 12) >> 12;
INT32 dydy = (INT32)(((state->m_blitter_yparam[6] & 0x0fff) | ((state->m_blitter_yparam[7] & 0x0fff) << 12)) << 12) >> 12;
- UINT8 *src = machine.root_device().memregion("gfx1")->base();
+ UINT8 *src = state->memregion("gfx1")->base();
UINT32 pagemask = (state->memregion("gfx1")->bytes() - 1) / 0x40000;
int xstart = state->m_blitter_xparam[14];
int xend = state->m_blitter_xparam[15] + 1;
@@ -307,9 +307,9 @@ READ16_MEMBER(dcheese_state::madmax_blitter_vidparam_r)
{
/* analog inputs seem to be hooked up here -- might not actually map to blitter */
if (offset == 0x02/2)
- return input_port_read(machine(), "2a0002");
+ return ioport("2a0002")->read();
if (offset == 0x0e/2)
- return input_port_read(machine(), "2a000e");
+ return ioport("2a000e")->read();
/* early code polls on this bit, wants it to be 0 */
if (offset == 0x36/2)
diff --git a/src/mame/video/deco_mlc.c b/src/mame/video/deco_mlc.c
index 21838518550..8c0af6b27f1 100644
--- a/src/mame/video/deco_mlc.c
+++ b/src/mame/video/deco_mlc.c
@@ -216,7 +216,7 @@ static void draw_sprites(running_machine& machine, bitmap_rgb32 &bitmap,const re
UINT32 *index_ptr=0;
int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
int xoffs,yoffs;
- UINT8 *rom = machine.root_device().memregion("gfx2")->base() + 0x20000, *index_ptr8;
+ UINT8 *rom = state->memregion("gfx2")->base() + 0x20000, *index_ptr8;
UINT8 *rawrom = state->memregion("gfx2")->base();
int blockIsTilemapIndex=0;
int sprite2=0,indx2=0,use8bppMode=0;
diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c
index 37a0aa2112f..8563454dccb 100644
--- a/src/mame/video/decocass.c
+++ b/src/mame/video/decocass.c
@@ -526,7 +526,7 @@ SCREEN_UPDATE_IND16( decocass )
int scrollx, scrolly_l, scrolly_r;
rectangle clip;
- if (0xc0 != (input_port_read(screen.machine(), "IN2") & 0xc0)) /* coin slots assert an NMI */
+ if (0xc0 != (screen.machine().root_device().ioport("IN2")->read() & 0xc0)) /* coin slots assert an NMI */
device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, ASSERT_LINE);
if (0 == (state->m_watchdog_flip & 0x04))
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index 5da9e58a8c7..45ccd7edf6e 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -880,13 +880,13 @@ static TIMER_CALLBACK( scanline_callback )
static void check_palette(running_machine &machine)
{
dkong_state *state = machine.driver_data<dkong_state>();
- const input_port_config *port;
+ ioport_port *port;
int newset;
port = state->ioport("VIDHW");
if (port != NULL)
{
- newset = input_port_read_direct(port);
+ newset = port->read();
if (newset != state->m_vidhw)
{
state->m_vidhw = newset;
@@ -937,8 +937,8 @@ VIDEO_START( dkong )
{
case HARDWARE_TRS02:
machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
- state->m_gfx3 = machine.root_device().memregion("gfx3")->base();
- state->m_gfx3_len = machine.root_device().memregion("gfx3")->bytes();
+ state->m_gfx3 = state->memregion("gfx3")->base();
+ state->m_gfx3_len = state->memregion("gfx3")->bytes();
/* fall through */
case HARDWARE_TKG04:
case HARDWARE_TKG02:
@@ -950,8 +950,8 @@ VIDEO_START( dkong )
state->m_bg_tilemap->set_scrolldx(0, 128);
machine.primary_screen->register_screen_bitmap(state->m_bg_bits);
- state->m_gfx4 = machine.root_device().memregion("gfx4")->base();
- state->m_gfx3 = machine.root_device().memregion("gfx3")->base();
+ state->m_gfx4 = state->memregion("gfx4")->base();
+ state->m_gfx3 = state->memregion("gfx3")->base();
state->m_gfx3_len = state->memregion("gfx3")->bytes();
break;
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index 30eb3d5eaf7..4d957cc3c95 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -629,7 +629,7 @@ VIDEO_START( lastday )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_bg_tilerom = state->memregion("gfx5")->base();
state->m_fg_tilerom = state->memregion("gfx6")->base();
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
@@ -669,7 +669,7 @@ VIDEO_START( gulfstrm )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_bg_tilerom = state->memregion("gfx5")->base();
state->m_fg_tilerom = state->memregion("gfx6")->base();
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
@@ -708,7 +708,7 @@ VIDEO_START( pollux )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
+ state->m_bg_tilerom = state->memregion("gfx5")->base();
state->m_fg_tilerom = state->memregion("gfx6")->base();
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
@@ -744,8 +744,8 @@ VIDEO_START( bluehawk )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx3")->base() + 0x78000;
- state->m_fg_tilerom = machine.root_device().memregion("gfx4")->base() + 0x78000;
+ state->m_bg_tilerom = state->memregion("gfx3")->base() + 0x78000;
+ state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
state->m_fg2_tilerom = state->memregion("gfx5")->base() + 0x38000;
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
@@ -785,7 +785,7 @@ VIDEO_START( flytiger )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx3")->base() + 0x78000;
+ state->m_bg_tilerom = state->memregion("gfx3")->base() + 0x78000;
state->m_fg_tilerom = state->memregion("gfx4")->base() + 0x78000;
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
@@ -821,8 +821,8 @@ VIDEO_START( primella )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx2")->base() + machine.root_device().memregion("gfx2")->bytes() - 0x8000;
- state->m_fg_tilerom = machine.root_device().memregion("gfx3")->base() + state->memregion("gfx3")->bytes() - 0x8000;
+ state->m_bg_tilerom = state->memregion("gfx2")->base() + state->memregion("gfx2")->bytes() - 0x8000;
+ state->m_fg_tilerom = state->memregion("gfx3")->base() + state->memregion("gfx3")->bytes() - 0x8000;
state->m_bg_tilerom2 = NULL;
state->m_fg_tilerom2 = NULL;
state->m_bg_gfx = 1;
@@ -856,13 +856,13 @@ VIDEO_START( rshark )
{
dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->m_bg_tilerom = machine.root_device().memregion("gfx5")->base();
- state->m_bg2_tilerom = machine.root_device().memregion("gfx4")->base();
- state->m_fg_tilerom = machine.root_device().memregion("gfx3")->base();
- state->m_fg2_tilerom = machine.root_device().memregion("gfx2")->base();
- state->m_bg_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x60000;
- state->m_bg2_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x40000;
- state->m_fg_tilerom2 = machine.root_device().memregion("gfx6")->base() + 0x20000;
+ state->m_bg_tilerom = state->memregion("gfx5")->base();
+ state->m_bg2_tilerom = state->memregion("gfx4")->base();
+ state->m_fg_tilerom = state->memregion("gfx3")->base();
+ state->m_fg2_tilerom = state->memregion("gfx2")->base();
+ state->m_bg_tilerom2 = state->memregion("gfx6")->base() + 0x60000;
+ state->m_bg2_tilerom2 = state->memregion("gfx6")->base() + 0x40000;
+ state->m_fg_tilerom2 = state->memregion("gfx6")->base() + 0x20000;
state->m_fg2_tilerom2 = state->memregion("gfx6")->base() + 0x00000;
state->m_bg_gfx = 4;
state->m_bg2_gfx = 3;
diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c
index 90bc55dd41f..a6fbeab37dd 100644
--- a/src/mame/video/dynax.c
+++ b/src/mame/video/dynax.c
@@ -356,7 +356,7 @@ static int blitter_drawgfx( running_machine &machine, int layer, int mask, const
{
dynax_state *state = machine.driver_data<dynax_state>();
UINT8 cmd;
- UINT8 *ROM = machine.root_device().memregion(gfx)->base();
+ UINT8 *ROM = state->memregion(gfx)->base();
size_t ROM_size = state->memregion(gfx)->bytes();
int sx;
@@ -1204,7 +1204,7 @@ static int debug_viewer( running_machine &machine, bitmap_ind16 &bitmap, const r
if (toggle)
{
dynax_state *state = machine.driver_data<dynax_state>();
- UINT8 *RAM = machine.root_device().memregion( "gfx1" )->base();
+ UINT8 *RAM = state->memregion( "gfx1" )->base();
size_t size = state->memregion( "gfx1" )->bytes();
static int i = 0, c = 0, r = 0;
diff --git a/src/mame/video/esripsys.c b/src/mame/video/esripsys.c
index 3ebaa2a1730..a05cbaf7dfb 100644
--- a/src/mame/video/esripsys.c
+++ b/src/mame/video/esripsys.c
@@ -225,7 +225,7 @@ int esripsys_draw(running_machine &machine, int l, int r, int fig, int attr, int
if (x_flip)
{
- rom_l = machine.root_device().memregion("8bpp_r")->base();
+ rom_l = state->memregion("8bpp_r")->base();
rom_r = state->memregion("8bpp_l")->base();
}
else
diff --git a/src/mame/video/exerion.c b/src/mame/video/exerion.c
index c086da15da4..4451b4be160 100644
--- a/src/mame/video/exerion.c
+++ b/src/mame/video/exerion.c
@@ -111,7 +111,7 @@ VIDEO_START( exerion )
UINT8 *gfx;
/* get pointers to the mixing and lookup PROMs */
- state->m_background_mixer = machine.root_device().memregion("proms")->base() + 0x320;
+ state->m_background_mixer = state->memregion("proms")->base() + 0x320;
/* allocate memory for the decoded background graphics */
state->m_background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
diff --git a/src/mame/video/exidy.c b/src/mame/video/exidy.c
index 4caa7d0c83a..db703b5f804 100644
--- a/src/mame/video/exidy.c
+++ b/src/mame/video/exidy.c
@@ -62,7 +62,7 @@ INLINE void latch_condition(running_machine &machine, int collision)
{
exidy_state *state = machine.driver_data<exidy_state>();
collision ^= state->m_collision_invert;
- state->m_int_condition = (input_port_read(machine, "INTSOURCE") & ~0x1c) | (collision & state->m_collision_mask);
+ state->m_int_condition = (state->ioport("INTSOURCE")->read() & ~0x1c) | (collision & state->m_collision_mask);
}
diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c
index 5e4b5509f9b..6540fb6883a 100644
--- a/src/mame/video/exidy440.c
+++ b/src/mame/video/exidy440.c
@@ -435,8 +435,8 @@ static SCREEN_UPDATE_IND16( exidy440 )
{
int i;
- int beamx = ((input_port_read(screen.machine(), "AN0") & 0xff) * (HBSTART - HBEND)) >> 8;
- int beamy = ((input_port_read(screen.machine(), "AN1") & 0xff) * (VBSTART - VBEND)) >> 8;
+ int beamx = ((screen.machine().root_device().ioport("AN0")->read() & 0xff) * (HBSTART - HBEND)) >> 8;
+ int beamy = ((screen.machine().root_device().ioport("AN1")->read() & 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/f1gp.c b/src/mame/video/f1gp.c
index 6a4d5018698..7efd2471e1e 100644
--- a/src/mame/video/f1gp.c
+++ b/src/mame/video/f1gp.c
@@ -52,7 +52,7 @@ VIDEO_START( f1gp )
state->m_fg_tilemap->set_transparent_pen(0xff);
- state->m_zoomdata = (UINT16 *)machine.root_device().memregion("gfx4")->base();
+ state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base();
gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_zoomdata);
// state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
@@ -68,7 +68,7 @@ VIDEO_START( f1gpb )
state->m_fg_tilemap->set_transparent_pen(0xff);
- state->m_zoomdata = (UINT16 *)machine.root_device().memregion("gfx4")->base();
+ state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base();
gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_zoomdata);
// state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes());
diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c
index 723830b07db..298ef34a282 100644
--- a/src/mame/video/fgoal.c
+++ b/src/mame/video/fgoal.c
@@ -48,7 +48,7 @@ SCREEN_UPDATE_IND16( fgoal )
/* draw color overlay foreground and background */
- if (state->m_fgoal_player == 1 && (input_port_read(screen.machine(), "IN1") & 0x40))
+ if (state->m_fgoal_player == 1 && (screen.machine().root_device().ioport("IN1")->read() & 0x40))
{
drawgfxzoom_opaque(state->m_fgbitmap, cliprect, screen.machine().gfx[0],
0, (state->m_fgoal_player << 2) | state->m_current_color,
diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c
index 1c18987d08c..a663afb725b 100644
--- a/src/mame/video/gomoku.c
+++ b/src/mame/video/gomoku.c
@@ -106,8 +106,8 @@ WRITE8_MEMBER(gomoku_state::gomoku_bg_dispsw_w)
VIDEO_START( gomoku )
{
gomoku_state *state = machine.driver_data<gomoku_state>();
- UINT8 *GOMOKU_BG_X = machine.root_device().memregion( "user1" )->base();
- UINT8 *GOMOKU_BG_Y = machine.root_device().memregion( "user2" )->base();
+ UINT8 *GOMOKU_BG_X = state->memregion( "user1" )->base();
+ UINT8 *GOMOKU_BG_Y = state->memregion( "user2" )->base();
UINT8 *GOMOKU_BG_D = state->memregion( "user3" )->base();
int x, y;
int bgdata;
diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c
index ccc0222eef1..38a0fb374d8 100644
--- a/src/mame/video/hyprduel.c
+++ b/src/mame/video/hyprduel.c
@@ -472,7 +472,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
{
hyprduel_state *state = machine.driver_data<hyprduel_state>();
UINT8 *base_gfx4 = state->m_expanded_gfx1;
- UINT8 *base_gfx8 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *base_gfx8 = state->memregion("gfx1")->base();
UINT32 gfx_size = state->memregion("gfx1")->bytes();
int max_x = machine.primary_screen->width();
diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c
index f862a7f42e9..b7727f0e689 100644
--- a/src/mame/video/itech32.c
+++ b/src/mame/video/itech32.c
@@ -184,7 +184,7 @@ VIDEO_START( itech32 )
state->m_videoplane[0][i] = state->m_videoplane[1][i] = 0xff;
/* fetch the GROM base */
- state->m_grom_base = machine.root_device().memregion("gfx1")->base();
+ state->m_grom_base = state->memregion("gfx1")->base();
state->m_grom_size = state->memregion("gfx1")->bytes();
state->m_grom_bank = 0;
state->m_grom_bank_mask = state->m_grom_size >> 24;
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 9fa41573eb7..dfdab00b9f2 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -175,7 +175,7 @@ VIDEO_START( itech8 )
state->m_page_select = 0xc0;
/* fetch the GROM base */
- state->m_grom_base = machine.root_device().memregion("grom")->base();
+ state->m_grom_base = state->memregion("grom")->base();
state->m_grom_size = state->memregion("grom")->bytes();
}
@@ -461,7 +461,7 @@ READ8_MEMBER(itech8_state::itech8_blitter_r)
/* a read from offsets 12-15 return input port values */
if (offset >= 12 && offset <= 15)
- result = input_port_read_safe(machine(), portnames[offset - 12], 0x00);
+ result = ioport(portnames[offset - 12])->read_safe(0x00);
return result;
}
diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c
index f059d4cb6f4..cf9353c805e 100644
--- a/src/mame/video/jaguar.c
+++ b/src/mame/video/jaguar.c
@@ -239,8 +239,8 @@ INLINE void get_crosshair_xy(running_machine &machine, int player, int *x, int *
int width = visarea.width();
int height = visarea.height();
/* only 2 lightguns are connected */
- *x = visarea.min_x + (((input_port_read(machine, player ? "FAKE2_X" : "FAKE1_X") & 0xff) * width) >> 8);
- *y = visarea.min_y + (((input_port_read(machine, player ? "FAKE2_Y" : "FAKE1_Y") & 0xff) * height) >> 8);
+ *x = visarea.min_x + (((machine.root_device().ioport(player ? "FAKE2_X" : "FAKE1_X")->read() & 0xff) * width) >> 8);
+ *y = visarea.min_y + (((machine.root_device().ioport(player ? "FAKE2_Y" : "FAKE1_Y")->read() & 0xff) * height) >> 8);
}
@@ -805,7 +805,7 @@ READ32_HANDLER( cojag_gun_input_r )
return (beamy << 16) | (beamx ^ 0x1ff);
case 2:
- return input_port_read(space->machine(), "IN3");
+ return space->machine().root_device().ioport("IN3")->read();
}
return 0;
}
diff --git a/src/mame/video/kangaroo.c b/src/mame/video/kangaroo.c
index 6fac1876653..6c32e590744 100644
--- a/src/mame/video/kangaroo.c
+++ b/src/mame/video/kangaroo.c
@@ -101,7 +101,7 @@ WRITE8_MEMBER(kangaroo_state::kangaroo_video_control_w)
static void blitter_execute( running_machine &machine )
{
kangaroo_state *state = machine.driver_data<kangaroo_state>();
- UINT32 gfxhalfsize = machine.root_device().memregion("gfx1")->bytes() / 2;
+ UINT32 gfxhalfsize = state->memregion("gfx1")->bytes() / 2;
const UINT8 *gfxbase = state->memregion("gfx1")->base();
UINT16 src = state->m_video_control[0] + 256 * state->m_video_control[1];
UINT16 dst = state->m_video_control[2] + 256 * state->m_video_control[3];
diff --git a/src/mame/video/lazercmd.c b/src/mame/video/lazercmd.c
index 4f9015c01f7..34b2cf6738b 100644
--- a/src/mame/video/lazercmd.c
+++ b/src/mame/video/lazercmd.c
@@ -29,7 +29,7 @@ static void plot_pattern( running_machine &machine, bitmap_ind16 &bitmap, int x,
int xbit, ybit, size;
size = 2;
- if (input_port_read(machine, "DSW") & 0x40)
+ if (machine.root_device().ioport("DSW")->read() & 0x40)
{
size = 4;
}
@@ -55,7 +55,7 @@ SCREEN_UPDATE_IND16( lazercmd )
lazercmd_state *state = screen.machine().driver_data<lazercmd_state>();
int i, x, y;
- int video_inverted = input_port_read(screen.machine(), "DSW") & 0x20;
+ int video_inverted = screen.machine().root_device().ioport("DSW")->read() & 0x20;
/* The first row of characters are invisible */
for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++)
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c
index 89bbdad1b2c..a064bd1a55a 100644
--- a/src/mame/video/lethalj.c
+++ b/src/mame/video/lethalj.c
@@ -27,8 +27,8 @@ INLINE void get_crosshair_xy(running_machine &machine, int player, int *x, int *
int width = visarea.width();
int height = visarea.height();
- *x = ((input_port_read_safe(machine, gunnames[player * 2], 0x00) & 0xff) * width) / 255;
- *y = ((input_port_read_safe(machine, gunnames[1 + player * 2], 0x00) & 0xff) * height) / 255;
+ *x = ((machine.root_device().ioport(gunnames[player * 2])->read_safe(0x00) & 0xff) * width) / 255;
+ *y = ((machine.root_device().ioport(gunnames[1 + player * 2])->read_safe(0x00) & 0xff) * height) / 255;
}
@@ -82,7 +82,7 @@ VIDEO_START( lethalj )
state->m_screenram = auto_alloc_array(machine, UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
/* predetermine blitter info */
- state->m_blitter_base = (UINT16 *)machine.root_device().memregion("gfx1")->base();
+ state->m_blitter_base = (UINT16 *)state->memregion("gfx1")->base();
state->m_blitter_rows = state->memregion("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
}
diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c
index 2f7cea60950..b892af749fd 100644
--- a/src/mame/video/lordgun.c
+++ b/src/mame/video/lordgun.c
@@ -177,7 +177,7 @@ static const int lordgun_gun_x_table[] =
static const char *const gunnames[] = { "LIGHT0_X", "LIGHT1_X", "LIGHT0_Y", "LIGHT1_Y" };
-float lordgun_crosshair_mapper(const input_field_config *field, float linear_value)
+float lordgun_crosshair_mapper(ioport_field *field, float linear_value)
{
int x = linear_value - 0x3c;
@@ -190,15 +190,15 @@ float lordgun_crosshair_mapper(const input_field_config *field, float linear_val
static void lorddgun_calc_gun_scr(running_machine &machine, int i)
{
lordgun_state *state = machine.driver_data<lordgun_state>();
-// popmessage("%03x, %02x", input_port_read(machine, "LIGHT0_X"), input_port_read(machine, "LIGHT0_Y"));
+// popmessage("%03x, %02x", machine, "LIGHT0_X"), state->ioport("LIGHT0_Y")->read());
- int x = input_port_read(machine, gunnames[i]) - 0x3c;
+ int x = state->ioport(gunnames[i])->read() - 0x3c;
if ( (x < 0) || (x > sizeof(lordgun_gun_x_table)/sizeof(lordgun_gun_x_table[0])) )
x = 0;
state->m_gun[i].scr_x = lordgun_gun_x_table[x];
- state->m_gun[i].scr_y = input_port_read(machine, gunnames[i+2]);
+ state->m_gun[i].scr_y = state->ioport(gunnames[i+2])->read();
}
void lordgun_update_gun(running_machine &machine, int i)
@@ -206,8 +206,8 @@ void lordgun_update_gun(running_machine &machine, int i)
lordgun_state *state = machine.driver_data<lordgun_state>();
const rectangle &visarea = machine.primary_screen->visible_area();
- state->m_gun[i].hw_x = input_port_read(machine, gunnames[i]);
- state->m_gun[i].hw_y = input_port_read(machine, gunnames[i+2]);
+ state->m_gun[i].hw_x = state->ioport(gunnames[i])->read();
+ state->m_gun[i].hw_y = state->ioport(gunnames[i+2])->read();
lorddgun_calc_gun_scr(machine, i);
diff --git a/src/mame/video/lwings.c b/src/mame/video/lwings.c
index 706e6a56ced..0140e8ff50d 100644
--- a/src/mame/video/lwings.c
+++ b/src/mame/video/lwings.c
@@ -63,7 +63,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
{
lwings_state *state = machine.driver_data<lwings_state>();
int code, color;
- UINT8 *rom = machine.root_device().memregion("gfx5")->base();
+ UINT8 *rom = state->memregion("gfx5")->base();
int mask = state->memregion("gfx5")->bytes() - 1;
tile_index = (tile_index + state->m_bg2_image * 0x20) & mask;
diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c
index 28896e1582a..15854b0e77a 100644
--- a/src/mame/video/m52.c
+++ b/src/mame/video/m52.c
@@ -276,7 +276,7 @@ WRITE8_MEMBER(m52_state::m52_bgcontrol_w)
WRITE8_MEMBER(m52_state::m52_flipscreen_w)
{
/* screen flip is handled both by software and hardware */
- flip_screen_set((data & 0x01) ^ (~input_port_read(machine(), "DSW2") & 0x01));
+ flip_screen_set((data & 0x01) ^ (~ioport("DSW2")->read() & 0x01));
coin_counter_w(machine(), 0, data & 0x02);
coin_counter_w(machine(), 1, data & 0x20);
diff --git a/src/mame/video/m57.c b/src/mame/video/m57.c
index 59552150853..71d9f9d6000 100644
--- a/src/mame/video/m57.c
+++ b/src/mame/video/m57.c
@@ -162,7 +162,7 @@ WRITE8_MEMBER(m57_state::m57_flipscreen_w)
{
/* screen flip is handled both by software and hardware */
- m_flipscreen = (data & 0x01) ^ (~input_port_read(machine(), "DSW2") & 0x01);
+ m_flipscreen = (data & 0x01) ^ (~ioport("DSW2")->read() & 0x01);
m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
coin_counter_w(machine(), 0,data & 0x02);
diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c
index 4f4d6f56c12..396b4932fd2 100644
--- a/src/mame/video/m58.c
+++ b/src/mame/video/m58.c
@@ -201,7 +201,7 @@ VIDEO_START( yard )
WRITE8_MEMBER(m58_state::yard_flipscreen_w)
{
/* screen flip is handled both by software and hardware */
- flip_screen_set((data & 0x01) ^ (~input_port_read(machine(), "DSW2") & 0x01));
+ flip_screen_set((data & 0x01) ^ (~ioport("DSW2")->read() & 0x01));
coin_counter_w(machine(), 0, data & 0x02);
coin_counter_w(machine(), 1, data & 0x20);
diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c
index 1bf910ad6e4..e9356837463 100644
--- a/src/mame/video/m62.c
+++ b/src/mame/video/m62.c
@@ -305,7 +305,7 @@ static void register_savestate( running_machine &machine )
WRITE8_MEMBER(m62_state::m62_flipscreen_w)
{
/* screen flip is handled both by software and hardware */
- data ^= ~input_port_read(machine(), "DSW2") & 1;
+ data ^= ~ioport("DSW2")->read() & 1;
m_flipscreen = data & 0x01;
if (m_flipscreen)
diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c
index cd7e59f9cbf..cf1f4122da5 100644
--- a/src/mame/video/m72.c
+++ b/src/mame/video/m72.c
@@ -365,7 +365,7 @@ WRITE16_MEMBER(m72_state::m72_port02_w)
coin_counter_w(machine(), 1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(machine(), "DSW") >> 8) & 1));
+ flip_screen_set(((data & 0x04) >> 2) ^ ((~ioport("DSW")->read() >> 8) & 1));
/* bit 3 is display disable */
m_video_off = data & 0x08;
@@ -391,7 +391,7 @@ WRITE16_MEMBER(m72_state::rtype2_port02_w)
coin_counter_w(machine(), 1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(((data & 0x04) >> 2) ^ ((~input_port_read(machine(), "DSW") >> 8) & 1));
+ flip_screen_set(((data & 0x04) >> 2) ^ ((~ioport("DSW")->read() >> 8) & 1));
/* bit 3 is display disable */
m_video_off = data & 0x08;
diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c
index 9c541ec3480..db0c995dba7 100644
--- a/src/mame/video/m92.c
+++ b/src/mame/video/m92.c
@@ -545,7 +545,7 @@ SCREEN_UPDATE_IND16( m92 )
/* Flipscreen appears hardwired to the dipswitch - strange */
m92_state *state = screen.machine().driver_data<m92_state>();
- if (input_port_read(screen.machine(), "DSW") & 0x100)
+ if (screen.machine().root_device().ioport("DSW")->read() & 0x100)
state->flip_screen_set(0);
else
state->flip_screen_set(1);
@@ -563,7 +563,7 @@ SCREEN_UPDATE_IND16( ppan )
/* Flipscreen appears hardwired to the dipswitch - strange */
m92_state *state = screen.machine().driver_data<m92_state>();
- if (input_port_read(screen.machine(), "DSW") & 0x100)
+ if (screen.machine().root_device().ioport("DSW")->read() & 0x100)
state->flip_screen_set(0);
else
state->flip_screen_set(1);
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c
index a5de79c329f..eb7e664ca42 100644
--- a/src/mame/video/madalien.c
+++ b/src/mame/video/madalien.c
@@ -253,7 +253,7 @@ WRITE8_MEMBER(madalien_state::madalien_charram_w)
static SCREEN_UPDATE_IND16( madalien )
{
madalien_state *state = screen.machine().driver_data<madalien_state>();
- int flip = BIT(input_port_read(screen.machine(), "DSW"), 6) && BIT(*state->m_video_control, 0);
+ int flip = BIT(screen.machine().root_device().ioport("DSW")->read(), 6) && BIT(*state->m_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 872f2d0df5d..ef457681c14 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -209,7 +209,7 @@ SCREEN_UPDATE_IND16( mario )
mario_state *state = screen.machine().driver_data<mario_state>();
int t;
- t = input_port_read(screen.machine(), "MONITOR");
+ t = screen.machine().root_device().ioport("MONITOR")->read();
if (t != state->m_monitor)
{
state->m_monitor = t;
diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c
index 63848401ad1..b72f0eec084 100644
--- a/src/mame/video/mcatadv.c
+++ b/src/mame/video/mcatadv.c
@@ -60,7 +60,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
UINT16 *destline;
UINT8 *priline;
- UINT8 *sprdata = machine.root_device().memregion("gfx1")->base();
+ UINT8 *sprdata = state->memregion("gfx1")->base();
int sprmask = state->memregion("gfx1")->bytes()-1;
int xstart, xend, xinc;
diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c
index 2be193f55a3..3e29b11d3ef 100644
--- a/src/mame/video/mcd212.c
+++ b/src/mame/video/mcd212.c
@@ -1115,7 +1115,7 @@ static void mcd212_mix_lines(mcd212_regs_t *mcd212, UINT8 *plane_a_r, UINT8 *pla
{
running_machine &machine = mcd212->machine();
int x = 0;
- UINT8 debug_mode = input_port_read(machine, "DEBUG");
+ UINT8 debug_mode = machine.root_device().ioport("DEBUG")->read();
UINT8 global_plane_a_disable = debug_mode & 1;
UINT8 global_plane_b_disable = debug_mode & 2;
UINT8 debug_backdrop_enable = debug_mode & 4;
diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c
index 137f10953fa..3cbdced829d 100644
--- a/src/mame/video/metro.c
+++ b/src/mame/video/metro.c
@@ -446,7 +446,7 @@ void metro_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const r
{
metro_state *state = machine.driver_data<metro_state>();
UINT8 *base_gfx4 = state->m_expanded_gfx1;
- UINT8 *base_gfx8 = machine.root_device().memregion("gfx1")->base();
+ UINT8 *base_gfx8 = state->memregion("gfx1")->base();
UINT32 gfx_size = state->memregion("gfx1")->bytes();
const rectangle &visarea = machine.primary_screen->visible_area();
diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c
index 3b4c181444a..6ac83320ac1 100644
--- a/src/mame/video/model2.c
+++ b/src/mame/video/model2.c
@@ -2713,7 +2713,7 @@ VIDEO_START(model2)
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model2_exit), &machine));
/* initialize the hardware rasterizer */
- model2_3d_init( machine, (UINT16*)machine.root_device().memregion("user3")->base() );
+ model2_3d_init( machine, (UINT16*)state->memregion("user3")->base() );
/* initialize the geometry engine */
geo_init( machine, (UINT32*)state->memregion("user2")->base() );
diff --git a/src/mame/video/momoko.c b/src/mame/video/momoko.c
index f91e8283bd9..8d9947b3cf4 100644
--- a/src/mame/video/momoko.c
+++ b/src/mame/video/momoko.c
@@ -113,7 +113,7 @@ SCREEN_UPDATE_IND16( momoko )
UINT8 *TEXT_COLOR = state->memregion("proms")->base();
- flip = state->m_flipscreen ^ (input_port_read(screen.machine(), "FAKE") & 0x01);
+ flip = state->m_flipscreen ^ (screen.machine().root_device().ioport("FAKE")->read() & 0x01);
/* draw BG layer */
dx = (7 - state->m_bg_scrollx[0]) & 7;
diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c
index cdc792b9562..3f3930b54bf 100644
--- a/src/mame/video/mystston.c
+++ b/src/mame/video/mystston.c
@@ -257,7 +257,7 @@ static SCREEN_UPDATE_IND16( mystston )
{
mystston_state *state = screen.machine().driver_data<mystston_state>();
- int flip = (*state->m_video_control & 0x80) ^ ((input_port_read(screen.machine(), "DSW1") & 0x20) << 2);
+ int flip = (*state->m_video_control & 0x80) ^ ((screen.machine().root_device().ioport("DSW1")->read() & 0x20) << 2);
set_palette(screen.machine(), state);
diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c
index 1b79b860689..906eaf09f8e 100644
--- a/src/mame/video/n8080.c
+++ b/src/mame/video/n8080.c
@@ -254,8 +254,8 @@ SCREEN_UPDATE_IND16( sheriff )
SCREEN_UPDATE_IND16( helifire )
{
n8080_state *state = screen.machine().driver_data<n8080_state>();
- int SUN_BRIGHTNESS = input_port_read(screen.machine(), "POT0");
- int SEA_BRIGHTNESS = input_port_read(screen.machine(), "POT1");
+ int SUN_BRIGHTNESS = screen.machine().root_device().ioport("POT0")->read();
+ int SEA_BRIGHTNESS = screen.machine().root_device().ioport("POT1")->read();
static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 };
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 71b031660dd..50d57348218 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -2741,9 +2741,9 @@ static VIDEO_START( common )
for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->total_elements; code++)
gfx_element_decode(machine.gfx[GFX_TEXTURE_TILE], code);
- Prepare3dTexture(machine, machine.root_device().memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
+ Prepare3dTexture(machine, state->memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
state->m_dirtypal = auto_alloc_array(machine, UINT8, NAMCOS22_PALETTE_SIZE/4);
- state->m_mPtRomSize = machine.root_device().memregion("pointrom")->bytes()/3;
+ state->m_mPtRomSize = state->memregion("pointrom")->bytes()/3;
state->m_mpPolyL = state->memregion("pointrom")->base();
state->m_mpPolyM = state->m_mpPolyL + state->m_mPtRomSize;
state->m_mpPolyH = state->m_mpPolyM + state->m_mPtRomSize;
diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c
index 1307856a6c3..c845fded434 100644
--- a/src/mame/video/naughtyb.c
+++ b/src/mame/video/naughtyb.c
@@ -117,7 +117,7 @@ WRITE8_MEMBER(naughtyb_state::naughtyb_videoreg_w)
pleiads_sound_control_c_w(machine().device("cust"),offset,data);
m_cocktail =
- ( ( input_port_read(machine(), "DSW0") & 0x80 ) && // cabinet == cocktail
+ ( ( ioport("DSW0")->read() & 0x80 ) && // cabinet == cocktail
( data & 0x01 ) ); // handling player 2
m_palreg = (data >> 1) & 0x03; // palette sel is bit 1 & 2
m_bankreg = (data >> 2) & 0x01; // banksel is just bit 2
@@ -129,7 +129,7 @@ WRITE8_MEMBER(naughtyb_state::popflame_videoreg_w)
pleiads_sound_control_c_w(machine().device("cust"),offset,data);
m_cocktail =
- ( ( input_port_read(machine(), "DSW0") & 0x80 ) && // cabinet == cocktail
+ ( ( ioport("DSW0")->read() & 0x80 ) && // cabinet == cocktail
( data & 0x01 ) ); // handling player 2
m_palreg = (data >> 1) & 0x03; // palette sel is bit 1 & 2
m_bankreg = (data >> 3) & 0x01; // banksel is just bit 3
diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c
index 62347d77f8e..ecd6344b2bf 100644
--- a/src/mame/video/neogeo.c
+++ b/src/mame/video/neogeo.c
@@ -271,7 +271,7 @@ static void draw_fixed_layer( running_machine &machine, bitmap_rgb32 &bitmap, in
neogeo_state *state = machine.driver_data<neogeo_state>();
int x;
- UINT8* gfx_base = machine.root_device().memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->base();
+ UINT8* gfx_base = state->memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->base();
UINT32 addr_mask = state->memregion(state->m_fixed_layer_source ? "fixed" : "fixedbios")->bytes() - 1;
UINT16 *video_data = &state->m_videoram[0x7000 | (scanline >> 3)];
UINT32 *pixel_addr = &bitmap.pix32(scanline, NEOGEO_HBEND);
diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c
index c3cfaa50e90..e124ffb8ffe 100644
--- a/src/mame/video/nmk16.c
+++ b/src/mame/video/nmk16.c
@@ -979,8 +979,8 @@ static void video_update(running_machine &machine, bitmap_ind16 &bitmap, const r
if (dsw_flipscreen)
{
- state->flip_screen_x_set(~input_port_read(machine, "DSW1") & 0x0100);
- state->flip_screen_y_set(~input_port_read(machine, "DSW1") & 0x0200);
+ state->flip_screen_x_set(~state->ioport("DSW1")->read() & 0x0100);
+ state->flip_screen_y_set(~state->ioport("DSW1")->read() & 0x0200);
}
diff --git a/src/mame/video/oneshot.c b/src/mame/video/oneshot.c
index 85e75c47675..0063e09db31 100644
--- a/src/mame/video/oneshot.c
+++ b/src/mame/video/oneshot.c
@@ -69,8 +69,8 @@ static void draw_crosshairs( running_machine &machine, bitmap_ind16 &bitmap, con
//int xpos,ypos;
/* get gun raw coordinates (player 1) */
- state->m_gun_x_p1 = (input_port_read(machine, "LIGHT0_X") & 0xff) * 320 / 256;
- state->m_gun_y_p1 = (input_port_read(machine, "LIGHT0_Y") & 0xff) * 240 / 256;
+ state->m_gun_x_p1 = (state->ioport("LIGHT0_X")->read() & 0xff) * 320 / 256;
+ state->m_gun_y_p1 = (state->ioport("LIGHT0_Y")->read() & 0xff) * 240 / 256;
/* compute the coordinates for drawing (from routine at 0x009ab0) */
//xpos = state->m_gun_x_p1;
@@ -84,8 +84,8 @@ static void draw_crosshairs( running_machine &machine, bitmap_ind16 &bitmap, con
/* get gun raw coordinates (player 2) */
- state->m_gun_x_p2 = (input_port_read(machine, "LIGHT1_X") & 0xff) * 320 / 256;
- state->m_gun_y_p2 = (input_port_read(machine, "LIGHT1_Y") & 0xff) * 240 / 256;
+ state->m_gun_x_p2 = (state->ioport("LIGHT1_X")->read() & 0xff) * 320 / 256;
+ state->m_gun_y_p2 = (state->ioport("LIGHT1_Y")->read() & 0xff) * 240 / 256;
/* compute the coordinates for drawing (from routine at 0x009b6e) */
//xpos = state->m_gun_x_p2;
diff --git a/src/mame/video/opwolf.c b/src/mame/video/opwolf.c
index c1d816f338f..28ab3452ffe 100644
--- a/src/mame/video/opwolf.c
+++ b/src/mame/video/opwolf.c
@@ -52,8 +52,8 @@ SCREEN_UPDATE_IND16( opwolf )
pc090oj_draw_sprites(state->m_pc090oj, bitmap, cliprect, 1);
-// if (input_port_read(machine, "P1X"))
-// popmessage("%d %d", input_port_read(machine, "P1X"), input_port_read(machine, "P1Y"));
+// if (state->ioport("P1X")->read())
+// popmessage("%d %d", machine, "P1X"), state->ioport("P1Y")->read());
return 0;
}
diff --git a/src/mame/video/orbit.c b/src/mame/video/orbit.c
index 3f072596928..2d812676a3a 100644
--- a/src/mame/video/orbit.c
+++ b/src/mame/video/orbit.c
@@ -82,7 +82,7 @@ SCREEN_UPDATE_IND16( orbit )
{
orbit_state *state = screen.machine().driver_data<orbit_state>();
- state->m_flip_screen = input_port_read(screen.machine(), "DSW2") & 8;
+ state->m_flip_screen = screen.machine().root_device().ioport("DSW2")->read() & 8;
state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
diff --git a/src/mame/video/pgm.c b/src/mame/video/pgm.c
index b1843d7197e..185dbae49f9 100644
--- a/src/mame/video/pgm.c
+++ b/src/mame/video/pgm.c
@@ -620,7 +620,7 @@ VIDEO_START( pgm )
pgm_state *state = machine.driver_data<pgm_state>();
int i;
- state->m_bdata = machine.root_device().memregion("sprmask")->base();
+ state->m_bdata = state->memregion("sprmask")->base();
state->m_bdatasize = state->memregion("sprmask")->bytes() - 1;
state->m_aoffset = 0;
state->m_boffset = 0;
diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c
index d37d63e97cd..80be43c24a2 100644
--- a/src/mame/video/phoenix.c
+++ b/src/mame/video/phoenix.c
@@ -251,7 +251,7 @@ WRITE8_MEMBER(phoenix_state::phoenix_videoreg_w)
m_videoram_pg_index = data & 1;
membank("bank1")->set_entry(m_videoram_pg_index);
- m_cocktail_mode = m_videoram_pg_index && (input_port_read(machine(), "CAB") & 0x01);
+ m_cocktail_mode = m_videoram_pg_index && (ioport("CAB")->read() & 0x01);
machine().tilemap().set_flip_all(m_cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
machine().tilemap().mark_all_dirty();
@@ -274,7 +274,7 @@ WRITE8_MEMBER(phoenix_state::pleiads_videoreg_w)
m_videoram_pg_index = data & 1;
membank("bank1")->set_entry(m_videoram_pg_index);
- m_cocktail_mode = m_videoram_pg_index && (input_port_read(machine(), "CAB") & 0x01);
+ m_cocktail_mode = m_videoram_pg_index && (ioport("CAB")->read() & 0x01);
machine().tilemap().set_flip_all(m_cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
machine().tilemap().mark_all_dirty();
@@ -310,9 +310,9 @@ WRITE8_MEMBER(phoenix_state::phoenix_scroll_w)
CUSTOM_INPUT_MEMBER(phoenix_state::player_input_r)
{
if (m_cocktail_mode)
- return (input_port_read(machine(), "CTRL") & 0xf0) >> 4;
+ return (ioport("CTRL")->read() & 0xf0) >> 4;
else
- return (input_port_read(machine(), "CTRL") & 0x0f) >> 0;
+ return (ioport("CTRL")->read() & 0x0f) >> 0;
}
CUSTOM_INPUT_MEMBER(phoenix_state::pleiads_protection_r)
@@ -365,7 +365,7 @@ CUSTOM_INPUT_MEMBER(phoenix_state::pleiads_protection_r)
#define REMAP_JS(js) ((ret & 0xf) | ( (js & 0xf) << 4))
READ8_MEMBER(phoenix_state::survival_input_port_0_r)
{
- UINT8 ret = ~input_port_read(machine(), "IN0");
+ UINT8 ret = ~ioport("IN0")->read();
if( m_survival_input_readc++ == 2 )
{
diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c
index 2504a4eaede..a7598d1d990 100644
--- a/src/mame/video/policetr.c
+++ b/src/mame/video/policetr.c
@@ -26,7 +26,7 @@ VIDEO_START( policetr )
{
policetr_state *state = machine.driver_data<policetr_state>();
/* the source bitmap is in ROM */
- state->m_srcbitmap = machine.root_device().memregion("gfx1")->base();
+ state->m_srcbitmap = state->memregion("gfx1")->base();
/* compute the height */
state->m_srcbitmap_height_mask = (state->memregion("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
@@ -267,25 +267,25 @@ READ32_MEMBER(policetr_state::policetr_video_r)
{
/* latch 0x00 is player 1's gun X coordinate */
case 0x00:
- inputval = ((input_port_read(machine(), "GUNX1") & 0xff) * width) >> 8;
+ inputval = ((ioport("GUNX1")->read() & 0xff) * width) >> 8;
inputval += 0x50;
return (inputval << 20) | 0x20000000;
/* latch 0x01 is player 1's gun Y coordinate */
case 0x01:
- inputval = ((input_port_read(machine(), "GUNY1") & 0xff) * height) >> 8;
+ inputval = ((ioport("GUNY1")->read() & 0xff) * height) >> 8;
inputval += 0x17;
return (inputval << 20);
/* latch 0x02 is player 2's gun X coordinate */
case 0x02:
- inputval = ((input_port_read(machine(), "GUNX2") & 0xff) * width) >> 8;
+ inputval = ((ioport("GUNX2")->read() & 0xff) * width) >> 8;
inputval += 0x50;
return (inputval << 20) | 0x20000000;
/* latch 0x03 is player 2's gun Y coordinate */
case 0x03:
- inputval = ((input_port_read(machine(), "GUNY2") & 0xff) * height) >> 8;
+ inputval = ((ioport("GUNY2")->read() & 0xff) * height) >> 8;
inputval += 0x17;
return (inputval << 20);
diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c
index 812942b78eb..763ded474ca 100644
--- a/src/mame/video/prehisle.c
+++ b/src/mame/video/prehisle.c
@@ -29,11 +29,11 @@ READ16_MEMBER(prehisle_state::prehisle_control16_r)
switch (offset)
{
- case 0x08: return input_port_read(machine(), "P2"); // Player 2
- case 0x10: return input_port_read(machine(), "COIN"); // Coins, Tilt, Service
- case 0x20: return input_port_read(machine(), "P1") ^ m_invert_controls; // Player 1
- case 0x21: return input_port_read(machine(), "DSW0"); // DIPs
- case 0x22: return input_port_read(machine(), "DSW1"); // DIPs + VBLANK
+ case 0x08: return ioport("P2")->read(); // Player 2
+ case 0x10: return ioport("COIN")->read(); // Coins, Tilt, Service
+ case 0x20: return ioport("P1")->read() ^ m_invert_controls; // Player 1
+ case 0x21: return ioport("DSW0")->read(); // DIPs
+ case 0x22: return ioport("DSW1")->read(); // DIPs + VBLANK
default: return 0;
}
}
diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c
index f8aa0a853d7..0ed8430cac6 100644
--- a/src/mame/video/psikyo.c
+++ b/src/mame/video/psikyo.c
@@ -533,7 +533,7 @@ SCREEN_UPDATE_IND16( psikyo )
tilemap_t *tmptilemap0, *tmptilemap1;
- state->flip_screen_set(~input_port_read(screen.machine(), "DSW") & 0x00010000); // hardwired to a DSW bit
+ state->flip_screen_set(~screen.machine().root_device().ioport("DSW")->read() & 0x00010000); // hardwired to a DSW bit
/* Layers enable (not quite right) */
@@ -707,7 +707,7 @@ SCREEN_UPDATE_IND16( psikyo_bootleg )
tilemap_t *tmptilemap0, *tmptilemap1;
- state->flip_screen_set(~input_port_read(screen.machine(), "DSW") & 0x00010000); // hardwired to a DSW bit
+ state->flip_screen_set(~screen.machine().root_device().ioport("DSW")->read() & 0x00010000); // hardwired to a DSW bit
/* Layers enable (not quite right) */
diff --git a/src/mame/video/psychic5.c b/src/mame/video/psychic5.c
index 60ac0e209ab..a19c2686375 100644
--- a/src/mame/video/psychic5.c
+++ b/src/mame/video/psychic5.c
@@ -110,11 +110,11 @@ READ8_MEMBER(psychic5_state::psychic5_paged_ram_r)
{
switch (offset)
{
- case 0x00: return input_port_read(machine(), "SYSTEM");
- case 0x01: return input_port_read(machine(), "P1");
- case 0x02: return input_port_read(machine(), "P2");
- case 0x03: return input_port_read(machine(), "DSW1");
- case 0x04: return input_port_read(machine(), "DSW2");
+ case 0x00: return ioport("SYSTEM")->read();
+ case 0x01: return ioport("P1")->read();
+ case 0x02: return ioport("P2")->read();
+ case 0x03: return ioport("DSW1")->read();
+ case 0x04: return ioport("DSW2")->read();
}
}
diff --git a/src/mame/video/route16.c b/src/mame/video/route16.c
index 4a93f37cafd..86b222e99ff 100644
--- a/src/mame/video/route16.c
+++ b/src/mame/video/route16.c
@@ -130,7 +130,7 @@ static int video_update_stratvox_ttmahjng(running_machine &machine, bitmap_rgb32
route16_state *state = machine.driver_data<route16_state>();
offs_t offs;
- UINT8 *color_prom1 = &machine.root_device().memregion("proms")->base()[0x000];
+ UINT8 *color_prom1 = &state->memregion("proms")->base()[0x000];
UINT8 *color_prom2 = &state->memregion("proms")->base()[0x100];
for (offs = 0; offs < state->m_videoram1.bytes(); offs++)
diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c
index 4b6757eb5b6..139f1ee6637 100644
--- a/src/mame/video/shisen.c
+++ b/src/mame/video/shisen.c
@@ -66,7 +66,7 @@ SCREEN_UPDATE_IND16( sichuan2 )
// on Irem boards, screen flip is handled in both hardware and software.
// this game doesn't have cocktail mode so if there's software control we don't
// know where it is mapped.
- state->flip_screen_set(~input_port_read(screen.machine(), "DSW2") & 1);
+ state->flip_screen_set(~screen.machine().root_device().ioport("DSW2")->read() & 1);
state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c
index aa0839f7504..808aeae5ac4 100644
--- a/src/mame/video/snes.c
+++ b/src/mame/video/snes.c
@@ -1505,7 +1505,7 @@ static void snes_refresh_scanline( running_machine &machine, bitmap_rgb32 &bitma
struct SCANLINE *scanline1, *scanline2;
UINT16 c;
UINT16 prev_colour = 0;
- int blurring = input_port_read_safe(machine, "OPTIONS", 0) & 0x01;
+ int blurring = machine.root_device().ioport("OPTIONS")->read_safe(0) & 0x01;
g_profiler.start(PROFILER_VIDEO);
@@ -2661,13 +2661,13 @@ WRITE8_HANDLER( snes_ppu_write )
static UINT8 snes_dbg_video( running_machine &machine, UINT16 curline )
{
int i;
- UINT8 toggles = input_port_read_safe(machine, "DEBUG1", 0);
+ UINT8 toggles = machine.root_device().ioport("DEBUG1")->read_safe(0);
debug_options.select_pri[SNES_BG1] = (toggles & 0x03);
debug_options.select_pri[SNES_BG2] = (toggles & 0x0c) >> 2;
debug_options.select_pri[SNES_BG3] = (toggles & 0x30) >> 4;
debug_options.select_pri[SNES_BG4] = (toggles & 0xc0) >> 6;
- toggles = input_port_read_safe(machine, "DEBUG2", 0);
+ toggles = machine.root_device().ioport("DEBUG2")->read_safe(0);
for (i = 0; i < 4; i++)
DEBUG_TOGGLE(i, debug_options.bg_disabled[i], ("Debug: Disabled BG%d.\n", i + 1), ("Debug: Enabled BG%d.\n", i + 1))
DEBUG_TOGGLE(4, debug_options.bg_disabled[SNES_OAM], ("Debug: Disabled OAM.\n"), ("Debug: Enabled OAM.\n"))
@@ -2675,11 +2675,11 @@ static UINT8 snes_dbg_video( running_machine &machine, UINT16 curline )
DEBUG_TOGGLE(6, debug_options.colormath_disabled, ("Debug: Disabled Color Math.\n"), ("Debug: Enabled Color Math.\n"))
DEBUG_TOGGLE(7, debug_options.windows_disabled, ("Debug: Disabled Window Masks.\n"), ("Debug: Enabled Window Masks.\n"))
- toggles = input_port_read_safe(machine, "DEBUG4", 0);
+ toggles = machine.root_device().ioport("DEBUG4")->read_safe(0);
for (i = 0; i < 8; i++)
DEBUG_TOGGLE(i, debug_options.mode_disabled[i], ("Debug: Disabled Mode %d drawing.\n", i), ("Debug: Enabled Mode %d drawing.\n", i))
- toggles = input_port_read_safe(machine, "DEBUG3", 0);
+ toggles = machine.root_device().ioport("DEBUG3")->read_safe(0);
DEBUG_TOGGLE(2, debug_options.mosaic_disabled, ("Debug: Disabled Mosaic.\n"), ("Debug: Enabled Mosaic.\n"))
debug_options.sprite_reversed = BIT(toggles, 7);
debug_options.select_pri[SNES_OAM] = (toggles & 0x70) >> 4;
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index 9f1a86e41de..b3d490be6e3 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -363,7 +363,7 @@ WRITE8_MEMBER(system1_state::system1_paletteram_w)
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset)
{
system1_state *state = machine.driver_data<system1_state>();
- UINT32 gfxbanks = machine.root_device().memregion("sprites")->bytes() / 0x8000;
+ UINT32 gfxbanks = state->memregion("sprites")->bytes() / 0x8000;
const UINT8 *gfxbase = state->memregion("sprites")->base();
UINT8 *spriteram = state->m_spriteram;
int flipscreen = state->flip_screen();
diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c
index e0d708842a3..b26f271010b 100644
--- a/src/mame/video/thepit.c
+++ b/src/mame/video/thepit.c
@@ -210,11 +210,11 @@ READ8_MEMBER(thepit_state::thepit_input_port_0_r)
horizontal flip switch. (This is how the real PCB does it) */
if (m_flip_screen_x)
{
- return input_port_read(machine(), "IN2");
+ return ioport("IN2")->read();
}
else
{
- return input_port_read(machine(), "IN0");
+ return ioport("IN0")->read();
}
}
diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c
index 10a03c54196..6b83f343a63 100644
--- a/src/mame/video/tmnt.c
+++ b/src/mame/video/tmnt.c
@@ -466,7 +466,7 @@ WRITE16_MEMBER(tmnt_state::ssriders_eeprom_w)
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
/* bits 3-4 control palette dimming */
/* 4 = DIMPOL = when set, negate SHAD */
diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c
index 28841595ef6..803d3482e89 100644
--- a/src/mame/video/travrusa.c
+++ b/src/mame/video/travrusa.c
@@ -276,7 +276,7 @@ WRITE8_MEMBER(travrusa_state::travrusa_scroll_x_high_w)
WRITE8_MEMBER(travrusa_state::travrusa_flipscreen_w)
{
/* screen flip is handled both by software and hardware */
- data ^= ~input_port_read(machine(), "DSW2") & 1;
+ data ^= ~ioport("DSW2")->read() & 1;
flip_screen_set(data & 1);
diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c
index 96ec0559f13..f5bebff4895 100644
--- a/src/mame/video/turbo.c
+++ b/src/mame/video/turbo.c
@@ -341,8 +341,8 @@ static void turbo_prepare_sprites(running_machine &machine, turbo_state *state,
VR1 = 310 Ohm
VR2 = 910 Ohm
*/
- 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);
- }
+ info->step[level] = sprite_xscale(xscale, 1.0e3 * machine.root_device().ioport("VR1")->read() / 100.0, 1.0e3 * machine.root_device().ioport("VR2")->read() / 100.0, 100e-12);
+ }
}
}
diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c
index bcd4613a75c..19c4f92f1f9 100644
--- a/src/mame/video/tx1.c
+++ b/src/mame/video/tx1.c
@@ -416,7 +416,7 @@ static void tx1_draw_road(running_machine &machine, UINT8 *bitmap)
UINT8 pix[2][4][3];
/* Road slice map ROMs */
- const UINT8 *const gfx3 = machine.root_device().memregion("gfx3")->base();
+ const UINT8 *const gfx3 = state->memregion("gfx3")->base();
const UINT8 *const rom_a = gfx3;
const UINT8 *const rom_b = gfx3 + 0x2000;
const UINT8 *const rom_c = gfx3 + 0x4000;
@@ -859,15 +859,15 @@ static void tx1_draw_objects(running_machine &machine, UINT8 *bitmap)
UINT32 offs;
/* The many lookup table ROMs */
- const UINT8 *const ic48 = machine.root_device().memregion("user3")->base();
+ const UINT8 *const ic48 = state->memregion("user3")->base();
const UINT8 *const ic281 = ic48 + 0x2000;
- const UINT8 *const proms = machine.root_device().memregion("proms")->base();
+ const UINT8 *const proms = state->memregion("proms")->base();
const UINT8 *const ic190 = proms + 0xc00;
const UINT8 *const ic162 = proms + 0xe00;
const UINT8 *const ic25 = proms + 0x1000;
- const UINT8 *const ic106 = machine.root_device().memregion("obj_map")->base();
+ const UINT8 *const ic106 = state->memregion("obj_map")->base();
const UINT8 *const ic73 = ic106 + 0x4000;
const UINT8 *const pixdata_rgn = state->memregion("obj_tiles")->base();
@@ -1300,7 +1300,7 @@ static void buggyboy_draw_char(running_machine &machine, UINT8 *bitmap, int wide
UINT32 x_mask;
/* 2bpp characters */
- chars = machine.root_device().memregion("char_tiles")->base();
+ chars = state->memregion("char_tiles")->base();
gfx2 = state->memregion("char_tiles")->base() + 0x4000;
/* X/Y scroll values are the last word in char RAM */
@@ -1535,7 +1535,7 @@ static void buggyboy_draw_road(running_machine &machine, UINT8 *bitmap)
UINT32 rva20_6;
/* ROM/PROM lookup tables */
- const UINT8 *rcols = (UINT8*)(machine.root_device().memregion("proms")->base() + 0x1500);
+ const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
const UINT8 *rom = state->memregion("road")->base();
const UINT8 *prom0 = rom + 0x4000;
const UINT8 *prom1 = rom + 0x4200;
@@ -2167,7 +2167,7 @@ static void buggybjr_draw_road(running_machine &machine, UINT8 *bitmap, int wide
UINT32 rva20_6;
/* ROM/PROM lookup tables */
- const UINT8 *rcols = (UINT8*)(machine.root_device().memregion("proms")->base() + 0x1500);
+ const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
const UINT8 *rom = state->memregion("road")->base();
const UINT8 *prom0 = rom + 0x4000;
const UINT8 *prom1 = rom + 0x4200;
@@ -2580,14 +2580,14 @@ static void buggyboy_draw_objs(running_machine &machine, UINT8 *bitmap, int wide
UINT32 x_stride;
/* The many lookup table ROMs */
- const UINT8 *const bug13 = (UINT8*)machine.root_device().memregion("obj_luts")->base();
+ const UINT8 *const bug13 = (UINT8*)state->memregion("obj_luts")->base();
const UINT8 *const bug18s = bug13 + 0x2000;
- const UINT8 *const bb8 = (UINT8*)machine.root_device().memregion("proms")->base() + 0x1600;
+ const UINT8 *const bb8 = (UINT8*)state->memregion("proms")->base() + 0x1600;
- const UINT8 *const bug16s = (UINT8*)machine.root_device().memregion("obj_map")->base();
+ const UINT8 *const bug16s = (UINT8*)state->memregion("obj_map")->base();
const UINT8 *const bug17s = bug16s + 0x8000;
- const UINT8 *const bb9o = (UINT8*)machine.root_device().memregion("proms")->base() + 0x500;
+ const UINT8 *const bb9o = (UINT8*)state->memregion("proms")->base() + 0x500;
const UINT8 *const bb9e = bb9o + 0x800;
const UINT8 *const pixdata_rgn = (UINT8*)state->memregion("obj_tiles")->base();
diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c
index 2765aa5e153..f90db20e939 100644
--- a/src/mame/video/undrfire.c
+++ b/src/mame/video/undrfire.c
@@ -212,7 +212,7 @@ static void draw_sprites_cbombers(running_machine &machine, bitmap_ind16 &bitmap
{
undrfire_state *state = machine.driver_data<undrfire_state>();
UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)machine.root_device().memregion("user1")->base();
+ UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
UINT8 *spritemapHibit = (UINT8 *)state->memregion("user2")->base();
int offs, data, tilenum, color, flipx, flipy;
@@ -468,7 +468,7 @@ SCREEN_UPDATE_IND16( undrfire )
/* See if we should draw artificial gun targets */
/* (not yet implemented...) */
- if (input_port_read(screen.machine(), "FAKE") & 0x1) /* Fake DSW */
+ if (screen.machine().root_device().ioport("FAKE")->read() & 0x1) /* Fake DSW */
{
popmessage("Gunsights on");
}
diff --git a/src/mame/video/vectrex.c b/src/mame/video/vectrex.c
index 46cb8a4608f..53da1479764 100644
--- a/src/mame/video/vectrex.c
+++ b/src/mame/video/vectrex.c
@@ -435,12 +435,12 @@ static WRITE8_DEVICE_HANDLER(v_via_cb2_w)
/* Check lightpen */
if (state->m_lightpen_port != 0)
{
- state->m_lightpen_down = input_port_read(device->machine(), "LPENCONF") & 0x10;
+ state->m_lightpen_down = state->ioport("LPENCONF")->read() & 0x10;
if (state->m_lightpen_down)
{
- state->m_pen_x = input_port_read(device->machine(), "LPENX") * (state->m_x_max / 0xff);
- state->m_pen_y = input_port_read(device->machine(), "LPENY") * (state->m_y_max / 0xff);
+ state->m_pen_x = state->ioport("LPENX")->read() * (state->m_x_max / 0xff);
+ state->m_pen_y = state->ioport("LPENY")->read() * (state->m_y_max / 0xff);
dx = abs(state->m_pen_x - state->m_x_int);
dy = abs(state->m_pen_y - state->m_y_int);
diff --git a/src/mame/video/vertigo.c b/src/mame/video/vertigo.c
index 15bb5aba704..04563da8459 100644
--- a/src/mame/video/vertigo.c
+++ b/src/mame/video/vertigo.c
@@ -159,7 +159,7 @@ void vertigo_vproc_reset(running_machine &machine)
int i;
UINT64 *mcode;
- state->m_vectorrom = (UINT16 *)machine.root_device().memregion("user1")->base();
+ state->m_vectorrom = (UINT16 *)state->memregion("user1")->base();
mcode = (UINT64 *)state->memregion("proms")->base();
/* Decode microcode */
diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c
index 24ed3b3bcf8..fec28277b8b 100644
--- a/src/mame/video/wecleman.c
+++ b/src/mame/video/wecleman.c
@@ -77,7 +77,7 @@ static void get_sprite_info(running_machine &machine)
{
wecleman_state *state = machine.driver_data<wecleman_state>();
const pen_t *base_pal = machine.pens;
- UINT8 *base_gfx = machine.root_device().memregion("gfx1")->base();
+ UINT8 *base_gfx = state->memregion("gfx1")->base();
int gfx_max = state->memregion("gfx1")->bytes();
UINT16 *source = state->m_spriteram;
diff --git a/src/mame/video/zac2650.c b/src/mame/video/zac2650.c
index 38b865cbb9a..f5bb77e3a99 100644
--- a/src/mame/video/zac2650.c
+++ b/src/mame/video/zac2650.c
@@ -41,7 +41,7 @@ WRITE8_MEMBER(zac2650_state::zac_s2636_w)
READ8_MEMBER(zac2650_state::tinvader_port_0_r)
{
- return input_port_read(machine(), "1E80") - m_CollisionBackground;
+ return ioport("1E80")->read() - m_CollisionBackground;
}
/*****************************************/
diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c
index 1434f1392e7..7dbbab91a37 100644
--- a/src/osd/sdl/input.c
+++ b/src/osd/sdl/input.c
@@ -1651,7 +1651,7 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
// loop over the defaults
for (entry = typelist.first(); entry != NULL; entry = entry->next())
{
- switch (entry->type)
+ switch (entry->type())
{
// configurable UI mode switch
case IPT_UI_TOGGLE_UI:
@@ -1670,26 +1670,23 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
mameid_code = lookup_mame_code(fullmode);
}
ui_code = input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(mameid_code));
- entry->defseq[SEQ_TYPE_STANDARD].set(ui_code);
+ entry->defseq(SEQ_TYPE_STANDARD).set(ui_code);
break;
// alt-enter for fullscreen
case IPT_OSD_1:
- entry->token = "TOGGLE_FULLSCREEN";
- entry->name = "Toggle Fullscreen";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_ENTER, KEYCODE_LALT);
+ entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, KEYCODE_LALT);
break;
// disable UI_SELECT when LALT is down, this stops selecting
// things in the menu when toggling fullscreen with LALT+ENTER
/* case IPT_UI_SELECT:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
break;*/
// page down for fastforward (must be OSD_3 as per src/emu/ui.c)
case IPT_UI_FAST_FORWARD:
- entry->token = "FAST_FORWARD";
- entry->name = "Fast Forward";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_PGDN);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_PGDN);
break;
// OSD hotkeys use LCTRL and start at F3, they start at
@@ -1699,68 +1696,67 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
// LCTRL-F3 to toggle fullstretch
case IPT_OSD_2:
- entry->token = "TOGGLE_FULLSTRETCH";
- entry->name = "Toggle Uneven stretch";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F3, KEYCODE_LCONTROL);
+ entry->configure_osd("TOGGLE_FULLSTRETCH", "Toggle Uneven stretch");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the reset key
case IPT_UI_SOFT_RESET:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
break;
// LCTRL-F4 to toggle keep aspect
case IPT_OSD_4:
- entry->token = "TOGGLE_KEEP_ASPECT";
- entry->name = "Toggle Keepaspect";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F4, KEYCODE_LCONTROL);
+ entry->configure_osd("TOGGLE_KEEP_ASPECT", "Toggle Keepaspect");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the show gfx key
case IPT_UI_SHOW_GFX:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F5 to toggle OpenGL filtering
case IPT_OSD_5:
- entry->token = "TOGGLE_FILTER";
- entry->name = "Toggle Filter";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F5, KEYCODE_LCONTROL);
+ entry->configure_osd("TOGGLE_FILTER", "Toggle Filter");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the toggle debug key
case IPT_UI_TOGGLE_DEBUG:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F6 to decrease OpenGL prescaling
case IPT_OSD_6:
- entry->token = "DECREASE_PRESCALE";
- entry->name = "Decrease Prescaling";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F6, KEYCODE_LCONTROL);
+ entry->configure_osd("DECREASE_PRESCALE", "Decrease Prescaling");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the toggle cheat key
case IPT_UI_TOGGLE_CHEAT:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F7 to increase OpenGL prescaling
case IPT_OSD_7:
- entry->token = "INCREASE_PRESCALE";
- entry->name = "Increase Prescaling";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F7, KEYCODE_LCONTROL);
+ entry->configure_osd("INCREASE_PRESCALE", "Increase Prescaling");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the load state key
case IPT_UI_LOAD_STATE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
break;
// add a Not lcrtl condition to the throttle key
case IPT_UI_THROTTLE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
break;
// disable the config menu if the ALT key is down
// (allows ALT-TAB to switch between apps)
case IPT_UI_CONFIGURE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ break;
+
+ // leave everything else alone
+ default:
break;
}
}
diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c
index 1c308aa9de0..ad0143e7329 100644
--- a/src/osd/windows/debugwin.c
+++ b/src/osd/windows/debugwin.c
@@ -335,7 +335,7 @@ void windows_osd_interface::wait_for_debugger(device_t &device, bool firststop)
static int debugwin_seq_pressed(running_machine &machine)
{
- const input_seq &seq = input_type_seq(machine, IPT_UI_DEBUG_BREAK, 0, SEQ_TYPE_STANDARD);
+ const input_seq &seq = machine.ioport().type_seq(IPT_UI_DEBUG_BREAK);
int result = FALSE;
int invert = FALSE;
int first = TRUE;
diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c
index c94d2c67cb5..d0c9bfd8660 100644
--- a/src/osd/windows/input.c
+++ b/src/osd/windows/input.c
@@ -767,33 +767,34 @@ void windows_osd_interface::customize_input_type_list(simple_list<input_type_ent
// loop over the defaults
for (entry = typelist.first(); entry != NULL; entry = entry->next())
- switch (entry->type)
+ switch (entry->type())
{
// disable the config menu if the ALT key is down
// (allows ALT-TAB to switch between windows apps)
case IPT_UI_CONFIGURE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
break;
// alt-enter for fullscreen
case IPT_OSD_1:
- entry->token = "TOGGLE_FULLSCREEN";
- entry->name = "Toggle Fullscreen";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_ENTER);
+ entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_ENTER);
break;
// alt-F12 for fullscreen snap
case IPT_OSD_2:
- entry->token = "RENDER_SNAP";
- entry->name = "Take Rendered Snapshot";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_F12);
+ entry->configure_osd("RENDER_SNAP", "Take Rendered Snapshot");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_F12);
break;
// alt-F11 for fullscreen video
case IPT_OSD_3:
- entry->token = "RENDER_AVI";
- entry->name = "Record Rendered Video";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_F11);
+ entry->configure_osd("RENDER_AVI", "Record Rendered Video");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_F11);
+ break;
+
+ // leave everything else alone
+ default:
break;
}
}